|
|
|
@ -126,7 +126,8 @@ public class QualifiedStorageServiceImpl implements QualifiedStorageService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public R validateHandlingUnitForQualifiedStorage(String unitId, String site, String expectedPartNo, String expectedBatchNo) { |
|
|
|
public R validateHandlingUnitForQualifiedStorage(String unitId, String site, String expectedPartNo, String expectedBatchNo, |
|
|
|
String expectedLocationNo, String expectedLotBatchNo, String expectedWdrNo) { |
|
|
|
try { |
|
|
|
// 1. 基础参数校验 |
|
|
|
if (StringUtils.isBlank(unitId)) { |
|
|
|
@ -166,11 +167,39 @@ public class QualifiedStorageServiceImpl implements QualifiedStorageService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 7. 在库状态校验(检验合格入库通常要求HU已经在库) |
|
|
|
// 6. 库位编号匹配校验 |
|
|
|
if (StringUtils.isNotBlank(expectedLocationNo)) { |
|
|
|
String actualLocationNo = handlingUnit.getLocationId(); |
|
|
|
if (!expectedLocationNo.equals(actualLocationNo)) { |
|
|
|
return R.error("HandlingUnit库位不匹配,期望: " + expectedLocationNo + ",实际: " + actualLocationNo); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 7. Lot批次号匹配校验 |
|
|
|
if (StringUtils.isNotBlank(expectedLotBatchNo)) { |
|
|
|
String actualLotBatchNo = handlingUnit.getBatchNo(); |
|
|
|
if (!expectedLotBatchNo.equals(actualLotBatchNo)) { |
|
|
|
return R.error("HandlingUnit Lot批次号不匹配,期望: " + expectedLotBatchNo + ",实际: " + actualLotBatchNo); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 8. WDR单号匹配校验 |
|
|
|
if (StringUtils.isNotBlank(expectedWdrNo)) { |
|
|
|
String actualWdrNo = handlingUnit.getWdr(); |
|
|
|
if (actualWdrNo == null || actualWdrNo.isEmpty() || "*".equals(actualWdrNo)) { |
|
|
|
return R.error("HandlingUnit WDR单号为空或默认值"); |
|
|
|
} |
|
|
|
if (!expectedWdrNo.equals(actualWdrNo)) { |
|
|
|
return R.error("HandlingUnit WDR单号不匹配,期望: " + expectedWdrNo + ",实际: " + actualWdrNo); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 9. 在库状态校验(检验合格入库通常要求HU已经在库) |
|
|
|
if (!"X".equals(handlingUnit.getInStockFlag())) { |
|
|
|
return R.error("HandlingUnit不是未入库状态,无法进行检验合格入库"); |
|
|
|
} |
|
|
|
// 8. 返回HandlingUnit信息 |
|
|
|
|
|
|
|
// 10. 返回HandlingUnit信息 |
|
|
|
Map<String, Object> huInfo = Map.ofEntries( |
|
|
|
Map.entry("unitId", handlingUnit.getUnitId()), |
|
|
|
Map.entry("partNo", handlingUnit.getPartNo()), |
|
|
|
@ -213,6 +242,10 @@ public class QualifiedStorageServiceImpl implements QualifiedStorageService { |
|
|
|
String wdr = (String) params.get("wdr"); |
|
|
|
String toLocationNo = (String) params.get("toLocationNo"); |
|
|
|
BigDecimal qtyToMove = new BigDecimal(params.get("qtyToMove").toString()); |
|
|
|
|
|
|
|
// 获取engChgLevel参数,如果没有则默认为"1" |
|
|
|
String engChgLevel = params.get("engChgLevel") != null ? |
|
|
|
params.get("engChgLevel").toString() : "1"; |
|
|
|
|
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
List<String> handlingUnitIds = (List<String>) params.get("handlingUnitIds"); |
|
|
|
@ -351,7 +384,7 @@ public class QualifiedStorageServiceImpl implements QualifiedStorageService { |
|
|
|
moveDto.setIfsLotBatchNo(lotBatchNo); |
|
|
|
moveDto.setIfsNewLotBatchNo(lotBatchNo); |
|
|
|
moveDto.setIfsSerialNo("*"); |
|
|
|
moveDto.setIfsEngChgLevel("1"); |
|
|
|
moveDto.setIfsEngChgLevel(engChgLevel); // 从IFS接口返回数据中获取 |
|
|
|
moveDto.setIfsWDR(wdr); |
|
|
|
moveDto.setIfsToLocationNo(toLocationNo); |
|
|
|
moveDto.setIfsHandlingUnitID(0); |
|
|
|
|