高压生产订单同步调整
This commit is contained in:
parent
98e6f8de65
commit
05d5709ce8
|
|
@ -8,7 +8,6 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||||
import nc.bs.dao.BaseDAO;
|
import nc.bs.dao.BaseDAO;
|
||||||
import nc.bs.framework.common.InvocationInfoProxy;
|
import nc.bs.framework.common.InvocationInfoProxy;
|
||||||
import nc.bs.logging.Log;
|
import nc.bs.logging.Log;
|
||||||
import nc.bs.trade.business.HYPubBO;
|
|
||||||
import nc.bs.uapbd.util.MyHelper;
|
import nc.bs.uapbd.util.MyHelper;
|
||||||
import nc.bs.uapbd.util.ThirdPartyPostRequestUtil;
|
import nc.bs.uapbd.util.ThirdPartyPostRequestUtil;
|
||||||
import nc.impl.pubapp.pattern.rule.IRule;
|
import nc.impl.pubapp.pattern.rule.IRule;
|
||||||
|
|
@ -57,9 +56,7 @@ public class AfterApproveCancelSyncHighpressureMesRule implements IRule<PMOAggVO
|
||||||
private void buildSyncData(PMOAggVO[] useVOs) throws BusinessException {
|
private void buildSyncData(PMOAggVO[] useVOs) throws BusinessException {
|
||||||
BaseDAO baseDAO = new BaseDAO();
|
BaseDAO baseDAO = new BaseDAO();
|
||||||
|
|
||||||
HYPubBO hybo = new HYPubBO();
|
|
||||||
JSONObject list = new JSONObject();
|
JSONObject list = new JSONObject();
|
||||||
JSONArray jsonArray = new JSONArray();
|
|
||||||
for (PMOAggVO vo : useVOs) {
|
for (PMOAggVO vo : useVOs) {
|
||||||
PMOHeadVO pmoHeadVO = vo.getParentVO();
|
PMOHeadVO pmoHeadVO = vo.getParentVO();
|
||||||
PMOItemVO[] itemVOS = vo.getChildrenVO();
|
PMOItemVO[] itemVOS = vo.getChildrenVO();
|
||||||
|
|
@ -69,14 +66,17 @@ public class AfterApproveCancelSyncHighpressureMesRule implements IRule<PMOAggVO
|
||||||
if (checkIfOrg(orgCode, configParams)) {
|
if (checkIfOrg(orgCode, configParams)) {
|
||||||
continue;
|
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 userSql = " select user_name from sm_user where dr = 0 and cuserid = '" + bipUpdateId + "' ";
|
||||||
String bipUpdateBy = (String) baseDAO.executeQuery(userSql, new ColumnProcessor());
|
String bipUpdateBy = (String) baseDAO.executeQuery(userSql, new ColumnProcessor());
|
||||||
list.put("bipUpdateBy", bipUpdateBy); // 修改人ID
|
list.put("bipUpdateBy", bipUpdateBy); // 修改人ID
|
||||||
|
|
||||||
// 创建子项数组
|
// 创建子项数组
|
||||||
JSONArray contentArray = new JSONArray();
|
|
||||||
JSONArray cmoidArray = new JSONArray();
|
JSONArray cmoidArray = new JSONArray();
|
||||||
for (PMOItemVO item : itemVOS) {
|
for (PMOItemVO item : itemVOS) {
|
||||||
// 填充子项基础信息
|
// 填充子项基础信息
|
||||||
|
|
@ -120,8 +120,8 @@ public class AfterApproveCancelSyncHighpressureMesRule implements IRule<PMOAggVO
|
||||||
String requestUrl = baseUrl + configParams.get("productionOrderCancel");
|
String requestUrl = baseUrl + configParams.get("productionOrderCancel");
|
||||||
logger.error("gyMes-PMO-url = " + requestUrl);
|
logger.error("gyMes-PMO-url = " + requestUrl);
|
||||||
String result = ThirdPartyPostRequestUtil.sendPostRequest(requestUrl, jsonStr);
|
String result = ThirdPartyPostRequestUtil.sendPostRequest(requestUrl, jsonStr);
|
||||||
JSONObject resultObj = JSONObject.parseObject(result);
|
|
||||||
logger.error("gyMes-PMO-res = " + result);
|
logger.error("gyMes-PMO-res = " + result);
|
||||||
|
JSONObject resultObj = JSONObject.parseObject(result);
|
||||||
|
|
||||||
if (!"200".equals(resultObj.getString("code"))) {
|
if (!"200".equals(resultObj.getString("code"))) {
|
||||||
logger.error("gyMes-PMO-error,result[" + resultObj.toJSONString() + "]");
|
logger.error("gyMes-PMO-error,result[" + resultObj.toJSONString() + "]");
|
||||||
|
|
@ -142,4 +142,18 @@ public class AfterApproveCancelSyncHighpressureMesRule implements IRule<PMOAggVO
|
||||||
}
|
}
|
||||||
return true;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -233,8 +233,8 @@ public class AfterApproveSyncHighpressureMesRule implements IRule<PMOAggVO> {
|
||||||
}
|
}
|
||||||
logger.error("gyMes-PMO-url = " + requestUrl);
|
logger.error("gyMes-PMO-url = " + requestUrl);
|
||||||
String result = ThirdPartyPostRequestUtil.sendPostRequest(requestUrl, jsonStr);
|
String result = ThirdPartyPostRequestUtil.sendPostRequest(requestUrl, jsonStr);
|
||||||
JSONObject resultObj = JSONObject.parseObject(result);
|
|
||||||
logger.error("gyMes-PMO-res = " + result);
|
logger.error("gyMes-PMO-res = " + result);
|
||||||
|
JSONObject resultObj = JSONObject.parseObject(result);
|
||||||
|
|
||||||
if (!"200".equals(resultObj.getString("code"))) {
|
if (!"200".equals(resultObj.getString("code"))) {
|
||||||
logger.error("gyMes-PMO-error,result[" + resultObj.toJSONString() + "]");
|
logger.error("gyMes-PMO-error,result[" + resultObj.toJSONString() + "]");
|
||||||
|
|
@ -330,7 +330,7 @@ public class AfterApproveSyncHighpressureMesRule implements IRule<PMOAggVO> {
|
||||||
return true;
|
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 {
|
String[] fields) throws BusinessException {
|
||||||
Map<String, MaterialPlanVO> map = null;
|
Map<String, MaterialPlanVO> map = null;
|
||||||
List<String> vids = Stream.of(pks).filter(Objects::nonNull).distinct().toList();
|
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 {
|
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)) {
|
if (targetCode == null || nc.vo.am.common.util.StringUtils.isEmpty(targetCode)) {
|
||||||
throw new BusinessException("δÅäÖõ¥¾ÝÀàÐͲÎÊý");
|
throw new BusinessException("δÅäÖõ¥¾ÝÀàÐͲÎÊý");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ public class AfterApproveSyncImsRule implements IRule<PMOAggVO> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkIfVtrantypecode(String vtrantypecode, Map<String, String> configParams) throws BusinessException {
|
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)) {
|
if (targetCode == null || nc.vo.am.common.util.StringUtils.isEmpty(targetCode)) {
|
||||||
throw new BusinessException("未配置生产订单交易类型组织参数");
|
throw new BusinessException("未配置生产订单交易类型组织参数");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -222,8 +222,8 @@ public class AfterPickmRuleHighpressureRule implements IRule<PMOAggVO> {
|
||||||
String requestUrl = baseUrl + configParams.get("materialRequirementsUpdate");
|
String requestUrl = baseUrl + configParams.get("materialRequirementsUpdate");
|
||||||
logger.error("gyMes-Pickm-url = " + requestUrl);
|
logger.error("gyMes-Pickm-url = " + requestUrl);
|
||||||
String result = ThirdPartyPostRequestUtil.sendPostRequest(requestUrl, jsonStr);
|
String result = ThirdPartyPostRequestUtil.sendPostRequest(requestUrl, jsonStr);
|
||||||
JSONObject resultObj = JSONObject.parseObject(result);
|
|
||||||
logger.error("gyMes-Pickm-res = " + result);
|
logger.error("gyMes-Pickm-res = " + result);
|
||||||
|
JSONObject resultObj = JSONObject.parseObject(result);
|
||||||
|
|
||||||
if (!"200".equals(resultObj.getString("code"))) {
|
if (!"200".equals(resultObj.getString("code"))) {
|
||||||
logger.error("gyMes-Pickm-error,result[" + resultObj.toJSONString() + "]");
|
logger.error("gyMes-Pickm-error,result[" + resultObj.toJSONString() + "]");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue