| @@ -32,6 +32,7 @@ data class PoLineWithStockInLine ( | |||||
| val itemNo: String, | val itemNo: String, | ||||
| val itemName: String?, | val itemName: String?, | ||||
| val qty: BigDecimal, | val qty: BigDecimal, | ||||
| @get:Value("#{target.stockInLines.?[].inventoryLot.?[].inventoryLotLines.?[inQty != null][].inQty.sum()}") | |||||
| val processed: BigDecimal, | val processed: BigDecimal, | ||||
| val receivedQty: BigDecimal, | val receivedQty: BigDecimal, | ||||
| @get:Value("#{target.uom}") | @get:Value("#{target.uom}") | ||||
| @@ -239,7 +239,10 @@ open class PurchaseOrderService( | |||||
| itemNo = thisPol.itemNo!!, | itemNo = thisPol.itemNo!!, | ||||
| itemName = thisPol.item!!.name, | itemName = thisPol.item!!.name, | ||||
| qty = thisPol.qty!!, | qty = thisPol.qty!!, | ||||
| processed = inLine.filter{ it.status == StockInLineStatus.COMPLETE.status}.sumOf { it.acceptedQty }, | |||||
| // processed = inLine.filter{ it.status == StockInLineStatus.COMPLETE.status}.sumOf { it.acceptedQty }, | |||||
| processed = inLine | |||||
| .filter { line -> line.putAwayLines.any { it.qty?.let { qty -> qty > BigDecimal.ZERO } == true } } | |||||
| .sumOf { line -> line.putAwayLines.sumOf { it.qty?.takeIf { qty -> qty > BigDecimal.ZERO } ?: BigDecimal.ZERO } }, | |||||
| receivedQty = thisPol.stockInLines.sumOf { it.acceptedQty ?: BigDecimal.ZERO }, | receivedQty = thisPol.stockInLines.sumOf { it.acceptedQty ?: BigDecimal.ZERO }, | ||||
| uom = thisPol.uom!!, | uom = thisPol.uom!!, | ||||
| price = thisPol.price!!, | price = thisPol.price!!, | ||||
| @@ -18,6 +18,8 @@ interface QcResultInfo { | |||||
| val stockInLineId: Long? | val stockInLineId: Long? | ||||
| @get:Value("#{target.stockOutLine?.id}") | @get:Value("#{target.stockOutLine?.id}") | ||||
| val stockOutLineId: Long? | val stockOutLineId: Long? | ||||
| @get:Value("#{target.escalationLog?.id}") | |||||
| val escalationLogId: Long? | |||||
| val failQty: Double? | val failQty: Double? | ||||
| val qcPassed: Boolean | val qcPassed: Boolean | ||||
| @get:Value("#{target.modified}") | @get:Value("#{target.modified}") | ||||
| @@ -71,6 +71,7 @@ interface EscalationLogInfo { | |||||
| val qcTotalCount: Int?; | val qcTotalCount: Int?; | ||||
| val qcFailCount: Int?; | val qcFailCount: Int?; | ||||
| val reason: String?; | val reason: String?; | ||||
| val recordDate: LocalDateTime?; | |||||
| @get:Value("#{target.status?.value}") | @get:Value("#{target.status?.value}") | ||||
| val status: String?; | val status: String?; | ||||
| } | } | ||||
| @@ -38,6 +38,7 @@ open class EscalationLogService( | |||||
| open fun getLogsByUser(): List<EscalationLogInfo> { | open fun getLogsByUser(): List<EscalationLogInfo> { | ||||
| val user = SecurityUtils.getUser().orElseThrow() | val user = SecurityUtils.getUser().orElseThrow() | ||||
| val logs = user.id?.let { escalationLogRepository.findAllInfoByDeletedFalseAndHandlerIdIs(it) } ?: listOf() | val logs = user.id?.let { escalationLogRepository.findAllInfoByDeletedFalseAndHandlerIdIs(it) } ?: listOf() | ||||
| // val pendingLogs = logs.filter { it.status == EscalationLogStatus.PENDING.value } | |||||
| return logs | return logs | ||||
| } | } | ||||