Browse Source

fix qr code

master
cyril.tsui 3 months ago
parent
commit
9a1756a846
4 changed files with 9 additions and 5 deletions
  1. +1
    -0
      src/main/java/com/ffii/fpsms/modules/stock/entity/StockInLineRepository.kt
  2. +2
    -2
      src/main/java/com/ffii/fpsms/modules/stock/entity/projection/InventoryLotLineInfo.kt
  3. +5
    -2
      src/main/java/com/ffii/fpsms/modules/stock/service/InventoryLotLineService.kt
  4. +1
    -1
      src/main/java/com/ffii/fpsms/modules/stock/web/InventoryLotLineController.kt

+ 1
- 0
src/main/java/com/ffii/fpsms/modules/stock/entity/StockInLineRepository.kt View File

@@ -18,4 +18,5 @@ interface StockInLineRepository : AbstractRepository<StockInLine, Long> {
fun findAllStockInLineInfoByPurchaseOrderIdAndStatusStartsWithAndDeletedFalse(purchaseOrderId: Long, status: String): List<Optional<StockInLineInfo>>
fun findAllByPurchaseOrderIdAndDeletedFalse(purchaseOrderId: Long): Optional<List<StockInLine>>
fun findStockInLineInfoByInventoryLotLineId(inventoryLotLineId: Long): Optional<StockInLineInfo>
fun findStockInLineInfoById(id: Long): Optional<StockInLineInfo>
}

+ 2
- 2
src/main/java/com/ffii/fpsms/modules/stock/entity/projection/InventoryLotLineInfo.kt View File

@@ -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}")


+ 5
- 2
src/main/java/com/ffii/fpsms/modules/stock/service/InventoryLotLineService.kt View File

@@ -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<MutableMap<String ,Any>>()



+ 1
- 1
src/main/java/com/ffii/fpsms/modules/stock/web/InventoryLotLineController.kt View File

@@ -42,7 +42,7 @@ class InventoryLotLineController (

@GetMapping("/getRecordByPage")
fun allInventoryLotLinesByPage(@ModelAttribute request: SearchInventoryLotLineInfoRequest): RecordsRes<InventoryLotLineInfo> {
println(request.itemId)
// println(request.itemId)
return inventoryLotLineService.allInventoryLotLinesByPage(request);
}



Loading…
Cancel
Save