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位,请选择合适的仓库!"); - } - 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位,请选择合适的仓库!"); - } - 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());