diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/businessDocumentOrder/BusinessDocumentOrderApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/businessDocumentOrder/BusinessDocumentOrderApplicationService.java index 24b434c6e..949c9dd10 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/application/service/businessDocumentOrder/BusinessDocumentOrderApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/businessDocumentOrder/BusinessDocumentOrderApplicationService.java @@ -222,16 +222,16 @@ public class BusinessDocumentOrderApplicationService { // 4. 构建推送数据 Map body = new HashMap<>(); - body.put("erpBillNo", order.getGoodsNumber()); + body.put("erpBillNo", order.getGoodsNumber() != null ? order.getGoodsNumber() : ""); String billDate = order.getDocumentDate() != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(order.getDocumentDate()) - : null; + : ""; body.put("billDate", billDate); // 商品类型取第一个cargo的productType(0料件,1半成品,2成品) Integer goodsType = (cargoList != null && !cargoList.isEmpty()) ? cargoList.get(0).getProductType() : null; - body.put("goodsType", goodsType); - body.put("ieFlag", order.getIeType() != null ? order.getIeType() : null); - body.put("corpCode", corpCode); + body.put("goodsType", goodsType != null ? goodsType : ""); + body.put("ieFlag", order.getIeType() != null ? order.getIeType() : ""); + body.put("corpCode", corpCode != null ? corpCode : ""); List> billList = new ArrayList<>(); if (cargoList != null && !cargoList.isEmpty()) { @@ -239,9 +239,9 @@ public class BusinessDocumentOrderApplicationService { for (BusinessDocumentCargoMulti cargo : cargoList) { Map billMap = new HashMap<>(); billMap.put("gNo", gNo++); - billMap.put("goodsCode", cargo.getMaterialCode() != null ? cargo.getMaterialCode() : null); - billMap.put("packNo", cargo.getCargoNum()); - billMap.put("erpQty", cargo.getCargoNum()); + billMap.put("goodsCode", cargo.getMaterialCode() != null ? cargo.getMaterialCode() : ""); + billMap.put("packNo", cargo.getCargoNum() != null ? cargo.getCargoNum() : ""); + billMap.put("erpQty", cargo.getCargoNum() != null ? cargo.getCargoNum() : ""); // 查询物料基础信息,计算净重和毛重 if (cargo.getMaterialBaseInfoId() != null) { @@ -249,11 +249,21 @@ public class BusinessDocumentOrderApplicationService { if (material != null && cargo.getCargoNum() != null) { if (material.getWeightLimit() != null) { billMap.put("netWt", material.getWeightLimit().multiply(cargo.getCargoNum())); + } else { + billMap.put("netWt", ""); } if (material.getGrossWeight() != null) { billMap.put("grossWt", material.getGrossWeight().multiply(cargo.getCargoNum())); + } else { + billMap.put("grossWt", ""); } + } else { + billMap.put("netWt", ""); + billMap.put("grossWt", ""); } + } else { + billMap.put("netWt", ""); + billMap.put("grossWt", ""); } billList.add(billMap); }