|
|
|
@ -211,7 +211,7 @@ public class PoServiceImpl extends ServiceImpl<PoMapper, PurchaseOrder> implemen |
|
|
|
inData.setReceiptNo(receiptNo); |
|
|
|
if (inData.getHandlingUnitList().isEmpty()) { |
|
|
|
TransDetailSubDto huInfo = new TransDetailSubDto(); |
|
|
|
huInfo.setPerQty(inData.getTransQty().setScale(2, RoundingMode.HALF_UP).doubleValue()); |
|
|
|
huInfo.setPerQty(inData.getTransQty().setScale(3, RoundingMode.HALF_UP).doubleValue()); |
|
|
|
huInfo.setPackageQty(1D); |
|
|
|
inData.setHandlingUnitList(Collections.singletonList(huInfo)); |
|
|
|
inData.setNeedHandlingUnit("N"); |
|
|
|
@ -248,7 +248,7 @@ public class PoServiceImpl extends ServiceImpl<PoMapper, PurchaseOrder> implemen |
|
|
|
for (int j = 0; j < huInfo.getPackageQty(); j++) { |
|
|
|
// 生成处理单元ID - 使用新的格式:A+site+YYYYMMDD+8位自增流水码 |
|
|
|
String unitId = handlingUnitIdGeneratorService.generateUnitId(inData.getSite()); |
|
|
|
|
|
|
|
|
|
|
|
// 记录unitId生成日志到数据库 |
|
|
|
handlingUnitIdLogService.logUnitIdGeneration( |
|
|
|
unitId, |
|
|
|
@ -263,7 +263,7 @@ public class PoServiceImpl extends ServiceImpl<PoMapper, PurchaseOrder> implemen |
|
|
|
"GENERATING", |
|
|
|
"PO接收-第" + (j+1) + "个HU" |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// 创建TransDetailSub记录(保持原有逻辑) |
|
|
|
TransDetailSub transDetailSub = new TransDetailSub(); |
|
|
|
transDetailSub.setSite(inData.getSite()); |
|
|
|
@ -341,10 +341,10 @@ public class PoServiceImpl extends ServiceImpl<PoMapper, PurchaseOrder> implemen |
|
|
|
handlingUnit.setLength(receiptDetail.getLength()); |
|
|
|
handlingUnit.setManufactureDate(inData.getManufactureDate()); |
|
|
|
handlingUnit.setHeight(inData.getHeight()); |
|
|
|
|
|
|
|
|
|
|
|
// 保存HandlingUnit主记录 |
|
|
|
handlingUnitService.save(handlingUnit); |
|
|
|
|
|
|
|
|
|
|
|
// 立即验证是否保存成功(防止保存失败但业务继续执行) |
|
|
|
HandlingUnit savedUnit = handlingUnitService.getById(unitId); |
|
|
|
if (savedUnit == null) { |
|
|
|
@ -358,7 +358,7 @@ public class PoServiceImpl extends ServiceImpl<PoMapper, PurchaseOrder> implemen |
|
|
|
); |
|
|
|
throw new XJException("标签保存失败: " + unitId + "请重试"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 更新日志为成功 |
|
|
|
handlingUnitIdLogService.logUnitIdGeneration( |
|
|
|
unitId, inData.getSite(), "PO_RECEIVE", inData.getPoNo(), |
|
|
|
|