diff --git a/src/main/java/com/ffii/fpsms/modules/stock/entity/StockInLineRepository.kt b/src/main/java/com/ffii/fpsms/modules/stock/entity/StockInLineRepository.kt index 19ef084..6d38b50 100644 --- a/src/main/java/com/ffii/fpsms/modules/stock/entity/StockInLineRepository.kt +++ b/src/main/java/com/ffii/fpsms/modules/stock/entity/StockInLineRepository.kt @@ -18,4 +18,5 @@ interface StockInLineRepository : AbstractRepository { fun findAllStockInLineInfoByPurchaseOrderIdAndStatusStartsWithAndDeletedFalse(purchaseOrderId: Long, status: String): List> fun findAllByPurchaseOrderIdAndDeletedFalse(purchaseOrderId: Long): Optional> fun findStockInLineInfoByInventoryLotLineId(inventoryLotLineId: Long): Optional + fun findStockInLineInfoById(id: Long): Optional } \ No newline at end of file diff --git a/src/main/java/com/ffii/fpsms/modules/stock/entity/projection/InventoryLotLineInfo.kt b/src/main/java/com/ffii/fpsms/modules/stock/entity/projection/InventoryLotLineInfo.kt index 8fee2f0..109251c 100644 --- a/src/main/java/com/ffii/fpsms/modules/stock/entity/projection/InventoryLotLineInfo.kt +++ b/src/main/java/com/ffii/fpsms/modules/stock/entity/projection/InventoryLotLineInfo.kt @@ -40,14 +40,14 @@ interface InventoryLotLineInfo { var holdQty: BigDecimal? @get:Value("#{(target.inQty ?: 0) - (target.outQty ?: 0) - (target.holdQty ?: 0)}") val qtyPerSmallestUnit: BigDecimal? - @get:Value("#{target.inventoryLot.item.itemUoms.^[baseUnit == true && deleted == false]?.uom.udfudesc}") + @get:Value("#{target.inventoryLot.item?.itemUoms.^[baseUnit == true && deleted == false]?.uom?.udfudesc}") val baseUom: String? @get:Value("#{target.status.value}") val status: String? val remarks: String? - @get:Value("#{target.stockUom.uom.udfudesc}") + @get:Value("#{target.stockUom?.uom?.udfudesc}") val uom: String? @get:Value("#{target.inventoryLot.expiryDate}") diff --git a/src/main/java/com/ffii/fpsms/modules/stock/service/InventoryLotLineService.kt b/src/main/java/com/ffii/fpsms/modules/stock/service/InventoryLotLineService.kt index d39cb97..afd93f1 100644 --- a/src/main/java/com/ffii/fpsms/modules/stock/service/InventoryLotLineService.kt +++ b/src/main/java/com/ffii/fpsms/modules/stock/service/InventoryLotLineService.kt @@ -99,8 +99,11 @@ open class InventoryLotLineService( } val inputStream = resource.inputStream val poLabel = JasperCompileManager.compileReport(inputStream) - val qrContent = stockInLineRepository.findStockInLineInfoByInventoryLotLineId(request.inventoryLotLineId).orElseThrow() - val qrCodeInfo = listOf(qrContent) +// val stockInLineInfo = stockInLineRepository.findStockInLineInfoByInventoryLotLineId(request.inventoryLotLineId).orElseThrow() + val inventoryLotLine = inventoryLotLineRepository.findById(request.inventoryLotLineId).orElseThrow() + val stockInLineInfo = inventoryLotLine.inventoryLot?.stockInLine?.id?.let { stockInLineRepository.findStockInLineInfoById(it).orElseThrow() } ?: throw NoSuchElementException() + + val qrCodeInfo = listOf(stockInLineInfo) // val qrCodeInfo = stockInLineRepository.findStockInLineInfoByIdInAndDeletedFalse(request.stockInLineIds).toMutableList() val fields = mutableListOf>() diff --git a/src/main/java/com/ffii/fpsms/modules/stock/web/InventoryLotLineController.kt b/src/main/java/com/ffii/fpsms/modules/stock/web/InventoryLotLineController.kt index 4b5ce21..faf761b 100644 --- a/src/main/java/com/ffii/fpsms/modules/stock/web/InventoryLotLineController.kt +++ b/src/main/java/com/ffii/fpsms/modules/stock/web/InventoryLotLineController.kt @@ -42,7 +42,7 @@ class InventoryLotLineController ( @GetMapping("/getRecordByPage") fun allInventoryLotLinesByPage(@ModelAttribute request: SearchInventoryLotLineInfoRequest): RecordsRes { - println(request.itemId) +// println(request.itemId) return inventoryLotLineService.allInventoryLotLinesByPage(request); }