高压生产订单同步调整

This commit is contained in:
mzr 2025-11-19 10:08:52 +08:00
parent 98e6f8de65
commit 05d5709ce8
4 changed files with 25 additions and 11 deletions

View File

@ -8,7 +8,6 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
import nc.bs.dao.BaseDAO;
import nc.bs.framework.common.InvocationInfoProxy;
import nc.bs.logging.Log;
import nc.bs.trade.business.HYPubBO;
import nc.bs.uapbd.util.MyHelper;
import nc.bs.uapbd.util.ThirdPartyPostRequestUtil;
import nc.impl.pubapp.pattern.rule.IRule;
@ -57,9 +56,7 @@ public class AfterApproveCancelSyncHighpressureMesRule implements IRule<PMOAggVO
private void buildSyncData(PMOAggVO[] useVOs) throws BusinessException {
BaseDAO baseDAO = new BaseDAO();
HYPubBO hybo = new HYPubBO();
JSONObject list = new JSONObject();
JSONArray jsonArray = new JSONArray();
for (PMOAggVO vo : useVOs) {
PMOHeadVO pmoHeadVO = vo.getParentVO();
PMOItemVO[] itemVOS = vo.getChildrenVO();
@ -69,14 +66,17 @@ public class AfterApproveCancelSyncHighpressureMesRule implements IRule<PMOAggVO
if (checkIfOrg(orgCode, configParams)) {
continue;
}
String billType = pmoHeadVO.getVtrantypecode();
if (checkBillType(billType, configParams)) {
continue;
}
// 取消审批人
String bipUpdateId = InvocationInfoProxy.getInstance().getUserId();//当前登录人
String bipUpdateId = InvocationInfoProxy.getInstance().getUserId();// 当前登录人
String userSql = " select user_name from sm_user where dr = 0 and cuserid = '" + bipUpdateId + "' ";
String bipUpdateBy = (String) baseDAO.executeQuery(userSql, new ColumnProcessor());
list.put("bipUpdateBy", bipUpdateBy); // 修改人ID
// 创建子项数组
JSONArray contentArray = new JSONArray();
JSONArray cmoidArray = new JSONArray();
for (PMOItemVO item : itemVOS) {
// 填充子项基础信息
@ -120,8 +120,8 @@ public class AfterApproveCancelSyncHighpressureMesRule implements IRule<PMOAggVO
String requestUrl = baseUrl + configParams.get("productionOrderCancel");
logger.error("gyMes-PMO-url = " + requestUrl);
String result = ThirdPartyPostRequestUtil.sendPostRequest(requestUrl, jsonStr);
JSONObject resultObj = JSONObject.parseObject(result);
logger.error("gyMes-PMO-res = " + result);
JSONObject resultObj = JSONObject.parseObject(result);
if (!"200".equals(resultObj.getString("code"))) {
logger.error("gyMes-PMO-error,result[" + resultObj.toJSONString() + "]");
@ -142,4 +142,18 @@ public class AfterApproveCancelSyncHighpressureMesRule implements IRule<PMOAggVO
}
return true;
}
private boolean checkBillType(String code, Map<String, String> configParams) throws BusinessException {
String targetCode = configParams.get("gymesPmoType");
if (targetCode == null || nc.vo.am.common.util.StringUtils.isEmpty(targetCode)) {
throw new BusinessException("未配置单据类型参数");
}
String[] types = targetCode.split(",");
for (String type : types) {
if (!type.isEmpty() && type.equals(code)) {
return true;
}
}
return false;
}
}

View File

@ -233,8 +233,8 @@ public class AfterApproveSyncHighpressureMesRule implements IRule<PMOAggVO> {
}
logger.error("gyMes-PMO-url = " + requestUrl);
String result = ThirdPartyPostRequestUtil.sendPostRequest(requestUrl, jsonStr);
JSONObject resultObj = JSONObject.parseObject(result);
logger.error("gyMes-PMO-res = " + result);
JSONObject resultObj = JSONObject.parseObject(result);
if (!"200".equals(resultObj.getString("code"))) {
logger.error("gyMes-PMO-error,result[" + resultObj.toJSONString() + "]");
@ -330,7 +330,7 @@ public class AfterApproveSyncHighpressureMesRule implements IRule<PMOAggVO> {
return true;
}
public static Map<String, MaterialPlanVO> queryMaterialPlanInfoByPks(String[] pks, String pk_stockorg,
public Map<String, MaterialPlanVO> queryMaterialPlanInfoByPks(String[] pks, String pk_stockorg,
String[] fields) throws BusinessException {
Map<String, MaterialPlanVO> map = null;
List<String> vids = Stream.of(pks).filter(Objects::nonNull).distinct().toList();
@ -345,7 +345,7 @@ public class AfterApproveSyncHighpressureMesRule implements IRule<PMOAggVO> {
}
private boolean checkBillType(String code, Map<String, String> configParams) throws BusinessException {
String targetCode = configParams.get("vtrantypecode");
String targetCode = configParams.get("gymesPmoType");
if (targetCode == null || nc.vo.am.common.util.StringUtils.isEmpty(targetCode)) {
throw new BusinessException("δÅäÖõ¥¾ÝÀàÐͲÎÊý");
}

View File

@ -139,7 +139,7 @@ public class AfterApproveSyncImsRule implements IRule<PMOAggVO> {
}
private boolean checkIfVtrantypecode(String vtrantypecode, Map<String, String> configParams) throws BusinessException {
String targetCode = configParams.get("vtrantypecode");
String targetCode = configParams.get("gyimsPmoType");
if (targetCode == null || nc.vo.am.common.util.StringUtils.isEmpty(targetCode)) {
throw new BusinessException("未配置生产订单交易类型组织参数");
}

View File

@ -222,8 +222,8 @@ public class AfterPickmRuleHighpressureRule implements IRule<PMOAggVO> {
String requestUrl = baseUrl + configParams.get("materialRequirementsUpdate");
logger.error("gyMes-Pickm-url = " + requestUrl);
String result = ThirdPartyPostRequestUtil.sendPostRequest(requestUrl, jsonStr);
JSONObject resultObj = JSONObject.parseObject(result);
logger.error("gyMes-Pickm-res = " + result);
JSONObject resultObj = JSONObject.parseObject(result);
if (!"200".equals(resultObj.getString("code"))) {
logger.error("gyMes-Pickm-error,result[" + resultObj.toJSONString() + "]");