进出口单证推送数据修改

This commit is contained in:
zhaoqing
2026-06-09 15:43:34 +08:00
parent abb2c444ca
commit b3e2b3fc8c
@@ -222,16 +222,16 @@ public class BusinessDocumentOrderApplicationService {
// 4. 构建推送数据
Map<String, Object> 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的productType0料件,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<Map<String, Object>> billList = new ArrayList<>();
if (cargoList != null && !cargoList.isEmpty()) {
@@ -239,9 +239,9 @@ public class BusinessDocumentOrderApplicationService {
for (BusinessDocumentCargoMulti cargo : cargoList) {
Map<String, Object> 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);
}