非通宇 保税仓出口订单推送;

This commit is contained in:
王奎兴
2026-06-11 17:27:06 +08:00
parent 889f5f34bc
commit e9a56f5a31
4 changed files with 68 additions and 78 deletions
@@ -1549,10 +1549,8 @@ public class StockOutOrderApplicationService {
item.put("lineNum", split[1]);
}
}
item.put("itemNo", detail.getMaterialBaseInfoId() != null ? detail.getMaterialBaseInfoId().toString() : "");
item.put("itemNo", detail.getMaterialCode() != null ? detail.getMaterialCode().toString() : "");
item.put("itemName", detail.getMaterialName() != null ? detail.getMaterialName() : "");
item.put("spec", detail.getSpecificationModel() != null ? detail.getSpecificationModel() : "");
item.put("unit", detail.getUnit() != null ? detail.getUnit() : "");
item.put("qty", detail.getQuantity());
// 获取物料详情
@@ -1561,7 +1559,8 @@ public class StockOutOrderApplicationService {
if (materialBaseInfoPO != null) {
item.put("erpCurr", materialBaseInfoPO.getCurrency() != null ? materialBaseInfoPO.getCurrency() : "");
item.put("erpPrice", materialBaseInfoPO.getUnitPrice());
item.put("spec", materialBaseInfoPO.getSpecificationModel() != null ? materialBaseInfoPO.getSpecificationModel() : "");
item.put("unit", materialBaseInfoPO.getDeclarationUnit() != null ? materialBaseInfoPO.getDeclarationUnit() : "");
// 计算金额
BigDecimal unitPrice = materialBaseInfoPO.getUnitPrice();
BigDecimal quantity = detail.getQuantity();
@@ -1572,55 +1571,45 @@ public class StockOutOrderApplicationService {
}
}
// 库存关联信息(实体默认值 + WMS覆盖)
item.put("orderINo", detail.getInOrderNumber() != null ? detail.getInOrderNumber() : "");
if (detail.getLotNo() != null && detail.getLotNo().contains("-")) {
String lotNumStr = detail.getLotNo().substring(detail.getLotNo().lastIndexOf("-") + 1);
try {
Integer lotRowNum = Integer.valueOf(lotNumStr);
item.put("orderIRow", lotRowNum);
item.put("billIRow", lotRowNum);
} catch (NumberFormatException ignored) {}
}
item.put("warehouse", detail.getWarehouseName() != null ? detail.getWarehouseName() : "");
item.put("opWhLoc", detail.getStorageLocationName() != null ? detail.getStorageLocationName() : "");
Long materialInventoryId = detail.getMaterialInventoryId();
MaterialInventory materialInventory = materialInventoryMapper.selectById(materialInventoryId);
// WMS仓储数据(如有则覆盖)
if (detail.getLotNo() != null) {
if (materialInventory != null) {
String inOrderNumber = materialInventory.getInOrderNumber();
String warehouseCode = materialInventory.getWarehouseCode();
String storageLocationCode = materialInventory.getStorageLocationCode();
String inLotNo = materialInventory.getLotNumber();
Long kcId = stockOutOrderMapper.getKcId(detail.getLotNo());
if (kcId != null) {
String inOrderNumber = stockOutOrderMapper.getInOrderNumber(kcId);
String inLotNo = inOrderNumber != null ? stockOutOrderMapper.getInLotNo(inOrderNumber, detail.getMaterialBaseInfoId()) : null;
String warehouse = stockOutOrderMapper.getWarehouse(kcId);
String opWhLoc = stockOutOrderMapper.getOpWhLoc(kcId);
if (inOrderNumber != null) {
item.put("orderINo", inOrderNumber);
}
if (warehouse != null) {
item.put("warehouse", warehouse);
if (warehouseCode != null) {
item.put("warehouse", warehouseCode);
}
if (storageLocationCode != null) {
item.put("opWhLoc", storageLocationCode);
}
item.put("opWhLoc", opWhLoc != null ? opWhLoc : "");
// billI = 入库单号
if (inOrderNumber != null) {
item.put("billI", inOrderNumber);
}
if (inLotNo != null) {
if (inLotNo.contains("-")) {
String numStr = inLotNo.substring(inLotNo.lastIndexOf("-") + 1);
try {
Integer result = Integer.valueOf(numStr);
item.put("orderIRow", result);
item.put("billIRow", result);
} catch (NumberFormatException e) {
}
if (inLotNo != null && inLotNo.contains("-")) {
String[] split = inLotNo.split("-");
if (split.length == 2) {
item.put("orderIRow", split[1]);
item.put("billIRow", split[1]);
} else {
item.put("orderIRow", 1);
item.put("billIRow", 1);
}
} else {
item.put("orderIRow", 1);
item.put("billIRow", 1);
}
}
}
orderList.add(item);
}
order.put("orderList", orderList);