From e7190ac324c9c3b1c728b7c8c90b51ba9ddb35fa Mon Sep 17 00:00:00 2001 From: maolei Date: Thu, 5 Jun 2025 10:46:01 +0800 Subject: [PATCH] =?UTF-8?q?bom:=20=E4=BF=AE=E5=A4=8D=20BOM=20=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=B7=E8=AE=A1=E7=AE=97=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 优化了 BOM 版本号计算逻辑,确保在查询不到数据时默认版本号为 1 - 使用 BigInteger 替代 Long 类型,避免数据类型转换异常 - 重构了代码结构,提高了可读性和维护性 --- .../rule/AfterSignRuleSyncInToMesProcess.java | 74 ------------------- .../AfterSignRuleSyncOutToMesProcess.java | 12 +-- 2 files changed, 6 insertions(+), 80 deletions(-) diff --git a/ic/src/private/nc/bs/ic/m4a/sign/rule/AfterSignRuleSyncInToMesProcess.java b/ic/src/private/nc/bs/ic/m4a/sign/rule/AfterSignRuleSyncInToMesProcess.java index 93cc0d5..009acbb 100644 --- a/ic/src/private/nc/bs/ic/m4a/sign/rule/AfterSignRuleSyncInToMesProcess.java +++ b/ic/src/private/nc/bs/ic/m4a/sign/rule/AfterSignRuleSyncInToMesProcess.java @@ -138,80 +138,6 @@ public class AfterSignRuleSyncInToMesProcess implements IRule { } } - private void syncTransferIn(GeneralInVO generalInVO) throws BusinessException { - GeneralInHeadVO head = generalInVO.getHead(); - // bodyϢƴ - JSONArray details = new JSONArray(); - // details - for (GeneralInBodyVO body : generalInVO.getBodys()) { - JSONObject temp = new JSONObject(); - temp.put("orderNo", head.getVbillcode()); // ֪ͨID - temp.put("sequenceNum", body.getCrowno()); // ֪ͨ - temp.put("type", "DBRK"); // - MaterialVersionVO materialVersionVO = (MaterialVersionVO) IUIFSERVICE.queryByPrimaryKey(MaterialVersionVO.class, body.getCmaterialvid()); - if (Objects.isNull(materialVersionVO)) { - throw new BusinessException("Ϣ, :" + body.getCmaterialvid()); - } - temp.put("materialId", materialVersionVO.getCode()); // ID - temp.put("outQty", body.getNnum() != null ? body.getNnum().doubleValue() : null); // Ӧ - temp.put("actInQty", body.getNshouldnum() != null ? body.getNshouldnum().doubleValue() : null); // ʵ - temp.put("assistActInQry", body.getNassistnum() != null ? body.getNassistnum().doubleValue() : 0); // ʵ - temp.put("productNum", null); // Ʒ - temp.put("inStorageId", body.getClocationid()); // λ - temp.put("inBatchNum", body.getVbatchcode()); // - temp.put("customId", null); // ͻID - temp.put("supplierId", null); // ӦID - temp.put("manufactureDate", null); // - temp.put("color", null); // ɫ - temp.put("packLen", null); // װ - temp.put("packSize", null); // װߴ - temp.put("remark", body.getVnotebody()); // ע () - details.add(temp); - } - - JSONObject info = new JSONObject(); - info.put("details", details); // ϸ - // headȡ - info.put("orderNo", head.getVbillcode()); // ֪ͨID - info.put("type", "DBRK"); // - info.put("outDate", head.getDbilldate() != null ? head.getDbilldate().toString() : null); // - - StordocVO outWarehouse = (StordocVO) IUIFSERVICE.queryByPrimaryKey(StordocVO.class, head.getCwarehouseid()); - if (Objects.isNull(outWarehouse)) { - throw new BusinessException("ֿϢ, :" + head.getCwarehouseid()); - } - if (outWarehouse.getCode() != null && outWarehouse.getCode().length() > 4) { - throw new BusinessException("MESϵͳֿ[" + outWarehouse.getCode() + "]ܳ4λѡʵIJֿ!"); - } - info.put("outStoreId", outWarehouse.getCode()); // ֿID - - StordocVO inWarehouse = (StordocVO) IUIFSERVICE.queryByPrimaryKey(StordocVO.class, head.getCotherwhid()); - if (Objects.isNull(inWarehouse)) { - throw new BusinessException("ֿϢ, :" + head.getCotherwhid()); - } - if (inWarehouse.getCode() != null && inWarehouse.getCode().length() > 4) { - throw new BusinessException("MESϵͳֿ[" + inWarehouse.getCode() + "]ܳ4λѡʵIJֿ!"); - } - info.put("inStoreId", inWarehouse.getCode()); // ֿID - - info.put("workerNo", null); - info.put("worker", null); - info.put("storeKeeper", head.getCwhsmanagerid()); - info.put("returned", "N"); // Ƿ˿ - info.put("mark", "N"); // ɱ־ - info.put("remark", head.getVnote()); // ע (ͷ) - - - // ƴ,ȴһjsonObject - JSONObject requestData = new JSONObject(); - requestData.put("operation_type", "I"); // - requestData.put("info", info); - obmlog.debug("requestData:" + requestData.toJSONString()); - - HTTP_POST_OTHER_SYS.sendToExternalSystem("/GTHINKING/AjaxService/N_KCSJJS/101527013.ashx/gt_rec_api_dbrkdj", requestData); - obmlog.debug("ⵥ " + head.getVbillcode() + " ͬɹ"); - } - private String transferCodeByPk(String tableName, String selectField, String pkField, String pk) throws BusinessException { if (StringUtils.isEmpty(pk)) { return null; diff --git a/ic/src/private/nc/bs/ic/m4i/sign/rule/AfterSignRuleSyncOutToMesProcess.java b/ic/src/private/nc/bs/ic/m4i/sign/rule/AfterSignRuleSyncOutToMesProcess.java index 8e5f33a..dbec75f 100644 --- a/ic/src/private/nc/bs/ic/m4i/sign/rule/AfterSignRuleSyncOutToMesProcess.java +++ b/ic/src/private/nc/bs/ic/m4i/sign/rule/AfterSignRuleSyncOutToMesProcess.java @@ -116,10 +116,10 @@ public class AfterSignRuleSyncOutToMesProcess implements IRule { if ("4I-01".equals(trantypecode)) { syncOtherOut(generalOutVO); } -// // /תⵥ -// else if ("4I-02".equals(trantypecode)) { -// syncTransferOut(generalOutVO); -// } + // /תⵥ + else if ("4I-02".equals(trantypecode)) { + syncTransferOut(generalOutVO); + } } @@ -131,7 +131,7 @@ public class AfterSignRuleSyncOutToMesProcess implements IRule { // details for (GeneralOutBodyVO body : generalOutVO.getBodys()) {// bodyȡ JSONObject temp = new JSONObject(); - temp.put("orderNo", head.getVbillcode()); // ֪ͨID +// temp.put("orderNo", head.getVbillcode()); // ֪ͨID temp.put("sequenceNum", body.getCrowno()); // ֪ͨ temp.put("type", "DBCK"); // temp.put("genType", null); @@ -159,7 +159,7 @@ public class AfterSignRuleSyncOutToMesProcess implements IRule { JSONObject info = new JSONObject(); info.put("details", details); // headȡ - info.put("orderNo", head.getVbillcode()); // ֪ͨID +// info.put("orderNo", head.getVbillcode()); // ֪ͨID info.put("type", "DBCK"); // info.put("genType", null); info.put("outDate", head.getDbilldate().toString());