diff --git a/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterApproveSyncHighpressureMesRule.java b/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterApproveSyncHighpressureMesRule.java index 3109934..5e0d472 100644 --- a/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterApproveSyncHighpressureMesRule.java +++ b/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterApproveSyncHighpressureMesRule.java @@ -44,7 +44,7 @@ public class AfterApproveSyncHighpressureMesRule implements IRule { if (ArrayUtil.isEmpty(pmoAggVOS)) { return; } - configParams = MyHelper.getConfigParams("xb-config", null); + configParams = MyHelper.getConfigParams("gy-config", null); try { @@ -65,9 +65,9 @@ public class AfterApproveSyncHighpressureMesRule implements IRule { // 判断物料的业务单元是否是箱变公司,不是则跳过 String pkOrg = vo.getParentVO().getPk_org(); String orgCode = MyHelper.transferField(OrgVO.getDefaultTableName(), OrgVO.CODE, OrgVO.PK_ORG, pkOrg); - if (checkIfOrg(orgCode, configParams)) { - continue; - } +// if (checkIfOrg(orgCode, configParams)) { +// continue; +// } JSONObject singleObj = new JSONObject(); PMOHeadVO pmoHeadVO = vo.getParentVO(); PMOItemVO[] itemVOS = vo.getChildrenVO(); @@ -75,10 +75,13 @@ public class AfterApproveSyncHighpressureMesRule implements IRule { singleObj.put("bipProcessProductionOrderId", pmoHeadVO.getVbillcode()); singleObj.put("bipId", pmoHeadVO.getCpmohid());// 主键ID // singleObj.put("orderQuantity", pmoHeadVO.getPlanQuantity()); // 订单数量(计划数量) - singleObj.put("billDate", pmoHeadVO.getDbilldate()); // 单据日期 + singleObj.put("billDate", pmoHeadVO.getDbilldate().toString()); // 单据日期 singleObj.put("orderVersion", pmoHeadVO.getVersion()); // 版本号 singleObj.put("orderTranType", pmoHeadVO.getVtrantypecode()); // 订单交易类型 - singleObj.put("bipCreateBy", pmoHeadVO.getCreator()); // 创建人ID + String sql1 = " select user_code from sm_user where cuserid = '" + pmoHeadVO.getCreator() + "' "; + String bipCreateBy= (String) baseDAO.executeQuery(sql1, new ColumnProcessor()); + + singleObj.put("bipCreateBy", bipCreateBy); // 创建人ID // 创建子项数组 JSONArray contentArray = new JSONArray(); @@ -107,7 +110,7 @@ public class AfterApproveSyncHighpressureMesRule implements IRule { itemObj.put("bipDeptId", tr.get("code")); // 生产部门编码 // 日期信息 - itemObj.put("requiredDate", item.getTrequiredate()); // 需用日期 + itemObj.put("requiredDate", item.getTrequiredate().toString()); // 需用日期 itemObj.put("bipParentProcessProductionOrderId", item.getVparentbillcode()); itemObj.put("bipParentProcessProductionOrderRowNum", item.getVparentmorowno()); @@ -115,7 +118,7 @@ public class AfterApproveSyncHighpressureMesRule implements IRule { itemObj.put("bipOriginProcessProductionOrderRowNum", item.getVsrcrowno()); // 物料信息 - String mrlsql = "select code,name,graphid,pk_measdoc from bd_material where pk_material = '" + item.getCmaterialvid() + "' "; + String mrlsql = "select code,name,graphid,pk_measdoc,materialspec from bd_material where pk_material = '" + item.getCmaterialvid() + "' "; Map mrl = (Map) baseDAO.executeQuery(mrlsql, new MapProcessor()); itemObj.put("materialCode", mrl.get("code")); // 物料编码 itemObj.put("materialName",mrl.get("name")); // 物料名称 @@ -126,16 +129,16 @@ public class AfterApproveSyncHighpressureMesRule implements IRule { itemObj.put("unit", unit); // 单位 pk_measdoc // 生产信息 -// itemObj.put("intervalModel", item.getCmaterialvid()); // 产品类型 物料分类 - itemObj.put("processCode", item.getProcedures()); // 工序编码 + itemObj.put("intervalModel", mrl.get("materialspec")); // 产品类型 +// itemObj.put("processCode", item.getProcedures()); // 工序编码 itemObj.put("lineNumber", String.valueOf(item.getVrowno())); // 行号 // 库存信息 itemObj.put("demandInventoryOrganization", item.getCrequireorg()); // 需求库存组织 - itemObj.put("plannedInputQuantity", item.getNplanputastnum()); // 计划投入量 - itemObj.put("plannedOutputQuantity", item.getNmmastnum()); // 计划产出量 - itemObj.put("plannedStartTime", item.getTplanstarttime()); // 计划开工时间 - itemObj.put("plannedCompletionTime", item.getTplanendtime()); // 计划完工时间 + itemObj.put("plannedInputQuantity", item.getNplanputastnum().doubleValue()); // 计划投入量 + itemObj.put("plannedOutputQuantity", item.getNmmastnum().doubleValue()); // 计划产出量 + itemObj.put("plannedStartTime", item.getTplanstarttime().toString()); // 计划开工时间 + itemObj.put("plannedCompletionTime", item.getTplanendtime().toString()); // 计划完工时间 itemObj.put("customerMaterialCode", item.getCcustmaterialid()); // 客户物料编码 itemObj.put("productionBatch", item.getCbatchid()); // 生产批次(按BIP格式) itemObj.put("productionBatchNumber", item.getVbatchcode()); // 生产批次号(按BIP格式) @@ -203,10 +206,10 @@ public class AfterApproveSyncHighpressureMesRule implements IRule { SerializerFeature.WriteNullStringAsEmpty ); // logDl.error("QMS-Material-param = " + jsonStr); -// String baseUrl = configParams.get("qmsBaseUrl"); -// String requestUrl = baseUrl + configParams.get("pomInsertUrl"); + String baseUrl = configParams.get("mesBaseUrl"); + String requestUrl = baseUrl + configParams.get("productionOrderAdd"); // logDl.error("QMS-Material-url = " + requestUrl); - String requestUrl ="http://192.168.223.115:8087/bip/order/productionOrderAdd"; +// String requestUrl ="/bip/order/productionOrderAdd"; String result = ThirdPartyPostRequestUtil.sendPostRequest(requestUrl, jsonStr); JSONObject resultObj = JSONObject.parseObject(result); logDl.error("QMS-Material-res = " + result); @@ -218,7 +221,7 @@ public class AfterApproveSyncHighpressureMesRule implements IRule { } private boolean checkIfOrg(String code, Map configParams) throws BusinessException { - String targetCode = configParams.get("xbOrg"); + String targetCode = configParams.get("gyOrg"); if (targetCode == null || nc.vo.am.common.util.StringUtils.isEmpty(targetCode)) { throw new BusinessException("未配置组织参数"); }