Explorar el Código

no message

reset-do-picking-order
[email protected] hace 1 semana
padre
commit
b92e66659e
Se han modificado 1 ficheros con 6 adiciones y 3 borrados
  1. +6
    -3
      src/main/java/com/ffii/fpsms/modules/master/service/ProductionScheduleService.kt

+ 6
- 3
src/main/java/com/ffii/fpsms/modules/master/service/ProductionScheduleService.kt Ver fichero

@@ -638,6 +638,10 @@ open class ProductionScheduleService(
}

open fun getNeedQty(): List<NeedQtyRecord> {
val fromDate = java.time.LocalDate.now().minusMonths(1)
val toDate = java.time.LocalDate.now()
val args = mapOf("fromDate" to fromDate.toString(), "toDate" to toDate.toString())

val sql = """
SELECT
i.outputQty,
@@ -672,8 +676,7 @@ open class ProductionScheduleService(
WHERE
do.deleted = 0 and
dol.itemId = items.id
-- AND MONTH(do.estimatedArrivalDate) = MONTH(DATE_SUB(NOW(), INTERVAL 1 MONTH))
AND do.estimatedArrivalDate >= '2026-02-07' AND do.estimatedArrivalDate < '2026-03-07'
AND do.estimatedArrivalDate >= :fromDate AND do.estimatedArrivalDate <= :toDate
GROUP BY do.estimatedArrivalDate) AS d) AS avgQtyLastMonth,

(select sum(reqQty) from job_order where bomId = bom.id and status != 'completed') AS pendingJobQty,
@@ -741,7 +744,7 @@ open class ProductionScheduleService(

""".trimIndent()

val rows: List<Map<String, Any>> = jdbcDao.queryForList(sql)
val rows: List<Map<String, Any>> = jdbcDao.queryForList(sql, args)

return rows.map { row ->
NeedQtyRecord().apply {


Cargando…
Cancelar
Guardar