| @@ -18,4 +18,5 @@ interface StockInLineRepository : AbstractRepository<StockInLine, Long> { | |||||
| fun findAllStockInLineInfoByPurchaseOrderIdAndStatusStartsWithAndDeletedFalse(purchaseOrderId: Long, status: String): List<Optional<StockInLineInfo>> | fun findAllStockInLineInfoByPurchaseOrderIdAndStatusStartsWithAndDeletedFalse(purchaseOrderId: Long, status: String): List<Optional<StockInLineInfo>> | ||||
| fun findAllByPurchaseOrderIdAndDeletedFalse(purchaseOrderId: Long): Optional<List<StockInLine>> | fun findAllByPurchaseOrderIdAndDeletedFalse(purchaseOrderId: Long): Optional<List<StockInLine>> | ||||
| fun findStockInLineInfoByInventoryLotLineId(inventoryLotLineId: Long): Optional<StockInLineInfo> | fun findStockInLineInfoByInventoryLotLineId(inventoryLotLineId: Long): Optional<StockInLineInfo> | ||||
| fun findStockInLineInfoById(id: Long): Optional<StockInLineInfo> | |||||
| } | } | ||||
| @@ -40,14 +40,14 @@ interface InventoryLotLineInfo { | |||||
| var holdQty: BigDecimal? | var holdQty: BigDecimal? | ||||
| @get:Value("#{(target.inQty ?: 0) - (target.outQty ?: 0) - (target.holdQty ?: 0)}") | @get:Value("#{(target.inQty ?: 0) - (target.outQty ?: 0) - (target.holdQty ?: 0)}") | ||||
| val qtyPerSmallestUnit: BigDecimal? | 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? | val baseUom: String? | ||||
| @get:Value("#{target.status.value}") | @get:Value("#{target.status.value}") | ||||
| val status: String? | val status: String? | ||||
| val remarks: String? | val remarks: String? | ||||
| @get:Value("#{target.stockUom.uom.udfudesc}") | |||||
| @get:Value("#{target.stockUom?.uom?.udfudesc}") | |||||
| val uom: String? | val uom: String? | ||||
| @get:Value("#{target.inventoryLot.expiryDate}") | @get:Value("#{target.inventoryLot.expiryDate}") | ||||
| @@ -99,8 +99,11 @@ open class InventoryLotLineService( | |||||
| } | } | ||||
| val inputStream = resource.inputStream | val inputStream = resource.inputStream | ||||
| val poLabel = JasperCompileManager.compileReport(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 qrCodeInfo = stockInLineRepository.findStockInLineInfoByIdInAndDeletedFalse(request.stockInLineIds).toMutableList() | ||||
| val fields = mutableListOf<MutableMap<String ,Any>>() | val fields = mutableListOf<MutableMap<String ,Any>>() | ||||
| @@ -42,7 +42,7 @@ class InventoryLotLineController ( | |||||
| @GetMapping("/getRecordByPage") | @GetMapping("/getRecordByPage") | ||||
| fun allInventoryLotLinesByPage(@ModelAttribute request: SearchInventoryLotLineInfoRequest): RecordsRes<InventoryLotLineInfo> { | fun allInventoryLotLinesByPage(@ModelAttribute request: SearchInventoryLotLineInfoRequest): RecordsRes<InventoryLotLineInfo> { | ||||
| println(request.itemId) | |||||
| // println(request.itemId) | |||||
| return inventoryLotLineService.allInventoryLotLinesByPage(request); | return inventoryLotLineService.allInventoryLotLinesByPage(request); | ||||
| } | } | ||||