Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
5f7e450cc1
|
|
@ -27,7 +27,6 @@ public class PickmApproveBP {
|
|||
IRule<AggPickmVO> pickmstatusFilterRule = new AfterApproveRuleSyncRZWMS();
|
||||
processer.addAfterRule(pickmstatusFilterRule);
|
||||
//备料计划审批后推送高压MES
|
||||
IRule<AggPickmVO> pickmHighpressureMesRules = new AfterApproveRuleHighpressureMes();
|
||||
processer.addAfterRule(new AfterApproveRuleHighpressureMes());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class AfterApproveRuleHighpressureMes implements IRule<AggPickmVO> {
|
|||
for (AggPickmVO vo : useVOs) {
|
||||
PickmHeadVO pickmHeadVO = vo.getParentVO();
|
||||
PickmItemVO[] itemVOS = (PickmItemVO[]) vo.getChildrenVO();
|
||||
// 判断物料的业务单元是否是箱变公司,不是则跳过
|
||||
// 判断物料的业务单元是否是高压公司,不是则跳过
|
||||
String pkOrg = pickmHeadVO.getPk_org();
|
||||
String orgCode = MyHelper.transferField(OrgVO.getDefaultTableName(), OrgVO.CODE, OrgVO.PK_ORG, pkOrg);
|
||||
if (checkIfOrg(orgCode, configParams)) {
|
||||
|
|
@ -82,7 +82,7 @@ public class AfterApproveRuleHighpressureMes implements IRule<AggPickmVO> {
|
|||
singleObj.put("bipParentProcessProductionOrderRowNum", pickmHeadVO.getVsourcebillrowno()); // 上级来源单据行号
|
||||
singleObj.put("bipOriginProcessProductionOrderId", pickmHeadVO.getVfirstbillcode()); // 顶级来源单据号
|
||||
singleObj.put("bipOriginProcessProductionOrderRowNum", pickmHeadVO.getVfirstbillrowno()); // 顶级来源单据行号
|
||||
singleObj.put("orderQuantity", pickmHeadVO.getNastnum()); // 订单数量(计划数量)
|
||||
singleObj.put("orderQuantity", pickmHeadVO.getNastnum() != null ? pickmHeadVO.getNastnum().doubleValue() : null); // 订单数量(计划数量)
|
||||
singleObj.put("bomVersion", pickmHeadVO.getVbomversionnumber()); // bom版本
|
||||
// 物料信息
|
||||
String cpsql = "select code,name,graphid,pk_measdoc,materialspec from bd_material where pk_material = '" + pickmHeadVO.getCmaterialvid() + "' ";
|
||||
|
|
@ -90,8 +90,9 @@ public class AfterApproveRuleHighpressureMes implements IRule<AggPickmVO> {
|
|||
singleObj.put("productCode", mrl.get("code")); // 产品编码
|
||||
singleObj.put("productName", mrl.get("name")); // 产品名称
|
||||
|
||||
singleObj.put("intervalModel", mrl.get("materialspec")); // (物料的自定义字段)
|
||||
singleObj.put("requiredDate", pickmHeadVO.getDmakedate()); // 需用日期
|
||||
// singleObj.put("intervalModel", mrl.get("materialspec")); // (物料的自定义字段)
|
||||
singleObj.put("intervalModel", "(物料的自定义字段)"); // (物料的自定义字段)
|
||||
singleObj.put("requiredDate", pickmHeadVO.getDmakedate().toString()); // 需用日期
|
||||
String sql1 = " select user_name from sm_user where cuserid = '" + pickmHeadVO.getCreator() + "' ";
|
||||
String bipCreateBy = (String) baseDAO.executeQuery(sql1, new ColumnProcessor());
|
||||
|
||||
|
|
@ -103,12 +104,13 @@ public class AfterApproveRuleHighpressureMes implements IRule<AggPickmVO> {
|
|||
JSONObject itemObj = new JSONObject();
|
||||
|
||||
itemObj.put("bipChildId", item.getCpickm_bid()); // 子项主键ID
|
||||
itemObj.put("bchkitemforwr", item.getBchkitemforwr()); // 完工齐套检查
|
||||
itemObj.put("lineNumber", item.getVrowno()); // 行号
|
||||
itemObj.put("quantityPerSet", item.getNunituseastnum()); // 单套数量(单位用量)
|
||||
itemObj.put("reservedQuantity", item.getNatpastnum()); // 预留数量
|
||||
itemObj.put("cumulativePendingQuantity", item.getNshouldastnum()); // 累计待发数量
|
||||
itemObj.put("cumulativeIssuedQuantity", item.getNaccoutastnum()); // 累计出库数量
|
||||
// itemObj.put("bchkitemforwr", item.getBchkitemforwr()); // 完工齐套检查
|
||||
itemObj.put("bchkitemforwr", "Y"); // 完工齐套检查
|
||||
itemObj.put("quantityPerSet", item.getNunituseastnum() != null ? item.getNunituseastnum().doubleValue() : null); // 单套数量(单位用量)
|
||||
itemObj.put("reservedQuantity", item.getNatpastnum() != null ? item.getNatpastnum().doubleValue() : null); // 预留数量
|
||||
itemObj.put("cumulativePendingQuantity", item.getNshouldastnum() != null ? item.getNshouldastnum().doubleValue() : null); // 累计待发数量
|
||||
itemObj.put("cumulativeIssuedQuantity", item.getNaccoutastnum() != null ? item.getNaccoutastnum().doubleValue() : null); // 累计出库数量
|
||||
itemObj.put("totalQuantity", item.getNplanoutnum() != null ? item.getNplanoutnum().doubleValue() : null); // 总数量(计划出库主数量)
|
||||
|
||||
// 物料信息
|
||||
String mrlsql = "select code,name,graphid,pk_measdoc,materialspec from bd_material where pk_material = '" + item.getCbmaterialid() + "' ";
|
||||
|
|
@ -141,16 +143,16 @@ public class AfterApproveRuleHighpressureMes implements IRule<AggPickmVO> {
|
|||
SerializerFeature.WriteMapNullValue,
|
||||
SerializerFeature.WriteNullStringAsEmpty
|
||||
);
|
||||
logger.error("gyMes-Agg-param = " + jsonStr);
|
||||
logger.error("gyMes-Pickm-param = " + jsonStr);
|
||||
String baseUrl = configParams.get("mesBaseUrl");
|
||||
String requestUrl = baseUrl + configParams.get("productionOrderAdd");
|
||||
logger.error("gyMes-Agg-url = " + requestUrl);
|
||||
String requestUrl = baseUrl + configParams.get("materialRequirementsAdd");
|
||||
logger.error("gyMes-Pickm-url = " + requestUrl);
|
||||
String result = ThirdPartyPostRequestUtil.sendPostRequest(requestUrl, jsonStr);
|
||||
JSONObject resultObj = JSONObject.parseObject(result);
|
||||
logger.error("gyMes-Agg-res = " + result);
|
||||
logger.error("gyMes-Pickm-res = " + result);
|
||||
|
||||
if (!"200".equals(resultObj.getString("code"))) {
|
||||
logger.error("gyMes-Agg-error,result[" + resultObj.toJSONString() + "]");
|
||||
logger.error("gyMes-Pickm-error,result[" + resultObj.toJSONString() + "]");
|
||||
throw new BusinessException("备料计划推送高压MES错误:" + resultObj.getString("msg"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue