Browse Source

quick update

master
cyril.tsui 2 months ago
parent
commit
b9bcd7d658
2 changed files with 9 additions and 4 deletions
  1. +1
    -1
      src/main/java/com/ffii/fpsms/modules/jobOrder/entity/JobOrderRepository.kt
  2. +8
    -3
      src/main/java/com/ffii/fpsms/modules/stock/service/StockTakeService.kt

+ 1
- 1
src/main/java/com/ffii/fpsms/modules/jobOrder/entity/JobOrderRepository.kt View File

@@ -32,7 +32,7 @@ interface JobOrderRepository : AbstractRepository<JobOrder, Long> {
) as pickedLotNo ) as pickedLotNo
from pick_order po from pick_order po
left join pick_order_line pol on pol.poId = po.id left join pick_order_line pol on pol.poId = po.id
left join stock_out_line sol on sol.pickOrderLineId = pol.id
left join stock_out_line sol on sol.pickOrderLineId = pol.id and sol.status = 'completed'
left join inventory_lot_line ill on ill.id = sol.inventoryLotLineId left join inventory_lot_line ill on ill.id = sol.inventoryLotLineId
left join inventory_lot il on il.id = ill.inventoryLotId left join inventory_lot il on il.id = ill.inventoryLotId
where po.joId = :id and il.lotNo is not null where po.joId = :id and il.lotNo is not null


+ 8
- 3
src/main/java/com/ffii/fpsms/modules/stock/service/StockTakeService.kt View File

@@ -69,7 +69,7 @@ class StockTakeService(
when (it.cellType) { when (it.cellType) {
CellType.STRING -> it.stringCellValue CellType.STRING -> it.stringCellValue
CellType.NUMERIC -> it.numericCellValue CellType.NUMERIC -> it.numericCellValue
else -> null
else -> ""
} }
}.toString() }.toString()
} }
@@ -85,6 +85,8 @@ class StockTakeService(


// Columns // Columns
val COLUMN_ITEM_CODE_INDEX = 6; val COLUMN_ITEM_CODE_INDEX = 6;
val COLUMN_FLOOR_INDEX = 11;
val COLUMN_PLACE_INDEX = 12;
val COLUMN_WAREHOSE_INDEX = 13; val COLUMN_WAREHOSE_INDEX = 13;
val COLUMN_ZONE_INDEX = 14; val COLUMN_ZONE_INDEX = 14;
val COLUMN_SLOT_INDEX = 15; val COLUMN_SLOT_INDEX = 15;
@@ -117,6 +119,8 @@ class StockTakeService(


// Warehouse // Warehouse
val warehouse = try { val warehouse = try {
val floor = getCellStringValue(row.getCell(COLUMN_FLOOR_INDEX))
val place = getCellStringValue(row.getCell(COLUMN_PLACE_INDEX))
val code = getCellStringValue(row.getCell(COLUMN_WAREHOSE_INDEX)) val code = getCellStringValue(row.getCell(COLUMN_WAREHOSE_INDEX))
val zone = getCellStringValue(row.getCell(COLUMN_ZONE_INDEX)) val zone = getCellStringValue(row.getCell(COLUMN_ZONE_INDEX))
val slot = getCellStringValue(row.getCell(COLUMN_SLOT_INDEX)) val slot = getCellStringValue(row.getCell(COLUMN_SLOT_INDEX))
@@ -124,6 +128,7 @@ class StockTakeService(


val defaultCapacity = BigDecimal(10000) val defaultCapacity = BigDecimal(10000)
val warehouseCode = "$code-$zone-$slot" val warehouseCode = "$code-$zone-$slot"
val warehouseName = "$floor-$place"
val existingWarehouse = warehouseService.findByCode(warehouseCode) val existingWarehouse = warehouseService.findByCode(warehouseCode)


if (existingWarehouse != null) { if (existingWarehouse != null) {
@@ -131,8 +136,8 @@ class StockTakeService(
} else { } else {
val warehouseRequest = SaveWarehouseRequest( val warehouseRequest = SaveWarehouseRequest(
code = warehouseCode, code = warehouseCode,
name = warehouseCode,
description = warehouseCode,
name = warehouseName,
description = warehouseName,
capacity = defaultCapacity capacity = defaultCapacity
) )
warehouseService.saveWarehouse(warehouseRequest) warehouseService.saveWarehouse(warehouseRequest)


Loading…
Cancel
Save