单据推送锐制_V1_sdlizheng_20250521

This commit is contained in:
李正@用友 2025-05-21 22:33:20 +08:00
parent f1354e1697
commit 9dc9e9e266
11 changed files with 32 additions and 17 deletions

View File

@ -110,7 +110,7 @@ public class AfterApproceRuleSyncRZWMSProcess implements IRule<SCOrderVO> {
JSONObject dataIn = new JSONObject();
JSONObject dataIn2 = new JSONObject();
JSONArray details = new JSONArray();
jsonObject.put("dataflow", "Ì©¿ªBIP¡úRZMOMv6");
jsonObject.put("dataflow", "用友BIP→RZMOMv6");
jsonObject.put("actionCode", "htmxb");
//데궝/툽좆객츠玖눈
for (SCOrderVO SCOrderVO : SCOrderVOS) {

View File

@ -45,7 +45,7 @@ public class SCOrderApproveAction {
prcr.addAfterRule(new ApproveSupplyRule());
prcr.addAfterRule(new SCOrderApprovePMSupplyRule());
//2025年5月18日15点12分--互感器委外订单审批推送RZ系统
//2025年5月18日15点12分-- 互感器委外订单审批推送RZ系统
prcr.addAfterRule(new AfterApproceRuleSyncRZWMSProcess());
}

View File

@ -74,7 +74,7 @@ public class AfterSigningSynchronizeRuleRZ implements IRule<SaleOutVO> {
JSONObject dataIn = new JSONObject();
JSONObject dataIn2 = new JSONObject();
JSONArray details = new JSONArray();
jsonObject.put("dataflow","Ì©¿ªBIP¡úRZMOMv6");
jsonObject.put("dataflow","用友BIP→RZMOMv6");
jsonObject.put("actionCode","cpfhtzdb");
//데궝/툽좆객츠玖눈
for (SaleOutVO saleOutVO : saleOutVOS) {

View File

@ -1,6 +1,7 @@
package nc.bs.mmpac.pickm.bp;
import nc.bs.mmpac.pickm.bp.rule.AfterApproveRuleSyncRZWMS;
import nc.bs.mmpac.pickm.plugin.PickmPluginPoint;
import nc.bs.mmpac.pickm.rule.PickmApproveCheckStatusRule;
import nc.bs.mmpac.pickm.rule.PickmCheckAuditRule;
@ -20,6 +21,8 @@ import nc.vo.mmpac.pickm.enumeration.FbillstatusEnum;
public class PickmApproveBP {
private void addAfterRule(CompareAroundProcesser<AggPickmVO> processer) {
IRule<AggPickmVO> pickmstatusFilterRule = new AfterApproveRuleSyncRZWMS();
processer.addAfterRule(pickmstatusFilterRule);
}
private void addBeforeRule(CompareAroundProcesser<AggPickmVO> processer) {

View File

@ -57,11 +57,12 @@ public class AfterApproveRuleSyncRZWMS implements IRule<AggPickmVO> {
singleObj.put("scgx_wbid", scgx_wbid); // 第三方系统使用工序id
singleObj.put("scjh_wbid", vsourcebillcode); // 第三方系统生产计划ID
singleObj.put("dwyl", body.getNplanoutastnum()); // 单位用量
singleObj.put("djyl", body.getNplanoutastnum()); // 单据用量
singleObj.put("clyl", body.getNplanoutastnum()); // 材料用量
singleObj.put("dwyl", body.getNplanoutastnum().getDouble()); // 单位用量
singleObj.put("djyl", body.getNplanoutastnum().getDouble()); // 单据用量
singleObj.put("clyl", body.getNplanoutastnum().getDouble()); // 材料用量
singleObj.put("wlbm_wbid", wlbm_wbid); // 第三方系统材料id
singleObj.put("wbid", wbid); // 第三方系统主键id
singleObj.put("operate", "1");
details.add(singleObj);
@ -87,8 +88,8 @@ public class AfterApproveRuleSyncRZWMS implements IRule<AggPickmVO> {
JSONObject dataIn = new JSONObject();
JSONObject dataIn2 = new JSONObject();
JSONArray details = new JSONArray();
jsonObject.put("dataflow", "泰开BIP→RZMOMv6");
jsonObject.put("actionCode", "cpfhtzdb");
jsonObject.put("dataflow", "用友BIP→RZMOMv6");
jsonObject.put("actionCode", "scbomb");
for (AggPickmVO aggPickmVO : aggPickmVOS) {
PickmHeadVO head = aggPickmVO.getParentVO();

View File

@ -74,8 +74,8 @@ public class AfterApprovingSynchronizeRuleRZ implements IRule<PMOAggVO> {
private void pushToRZMOM(PMOAggVO[] pmoAggVOS) throws BusinessException {
String rzwmsip = SysInitQuery.getParaString("GLOBLE00000000000000", "RZWMSIP");
JSONObject jsonObject = new JSONObject();
jsonObject.put("dataflow", "泰开BIP→RZMOMv6");
jsonObject.put("actionCode", "jhxmb"); // 生产订单的action code
jsonObject.put("dataflow", "用友BIP→RZMOMv6");
jsonObject.put("actionCode", "jhmxb"); // 生产订单的action code
JSONObject dataIn = new JSONObject();
JSONObject dataIn2 = new JSONObject();
@ -113,6 +113,14 @@ public class AfterApprovingSynchronizeRuleRZ implements IRule<PMOAggVO> {
JSONObject detailItem = new JSONObject();
// jhmx_wbid varchar(100) 第三方系统主键id 必填 上位系统后台唯一ID
detailItem.put("jhmx_wbid", head.getCpmohid());
detailItem.put("scbh", vbillcode);
detailItem.put("scjh_wbid", vbillcode);
//jhxh numeric(5) 计划序号 必填 生产订单的产品行号有按实际
//若无默认1
detailItem.put("scjh_wbid", body.getVrowno());
detailItem.put("jhbhzdsc", 1);//如果直接把第三方系统的编号作为我们的计划编号传0如果我们系统自己取号则传1
detailItem.put("operate", 1);
// 第三方系统计划类别id
detailItem.put("jhlb_wbid", head.getVtrantypecode());
// 第三方系统产品ID 物料ID

View File

@ -54,7 +54,7 @@ public class AfterApprovingSynchronizeRuleRZ implements IRule<OrderVO> {
// 推送到睿智系统
pushToRZMOM(newOrderVOS.toArray(new OrderVO[0]));
} catch (Exception e) {
log.error("同步采购订单到睿智系统失败: " + e.getMessage(), e);
log.error("同步采购订单到睿智系统失败: " + e.getMessage());
ExceptionUtils.wrappException(e);
}
}
@ -80,7 +80,7 @@ public class AfterApprovingSynchronizeRuleRZ implements IRule<OrderVO> {
JSONObject jsonObject = new JSONObject();
// 设置请求头
jsonObject.put("dataflow", "泰开BIP→RZMOMv6");
jsonObject.put("dataflow", "用友BIP→RZMOMv6");
jsonObject.put("actionCode", "htmxb");
JSONObject dataIn = new JSONObject();
@ -105,6 +105,8 @@ public class AfterApprovingSynchronizeRuleRZ implements IRule<OrderVO> {
// 使用ThirdPartyPostRequestUtil发送请求
String result = ThirdPartyPostRequestUtil.sendPostRequest(rzwmsip, jsonObject.toJSONString());
JSONObject resultObj = JSONObject.parseObject(result);
log.error("采购订单推送锐制返回报文:" + result);
if ("false".equals(resultObj.getString("success"))) {
throw new BusinessException("RZMOM同步失败原因" + resultObj.getString("msg"));
}

View File

@ -110,7 +110,8 @@ public class OrderApproveAction {
processer.addAfterFinalRule(new ApproveM21AndRewriteCTPayPlan());
processer.addAfterRule(new OrderRewritePMStartDateRule(true));
processer.addAfterRule(new OrderApprovePMSupplyRule());
// 采购订单审批后 同步到MES系统
// 采购订单审批后 同步到锐制MES系统
processer.addAfterRule(new AfterApprovingSynchronizeRuleRZ());
}

View File

@ -17,8 +17,8 @@ import java.net.URL;
*/
public class ThirdPartyPostRequestUtil {
private static final int DEFAULT_CONNECT_TIMEOUT = 20000;
private static final int DEFAULT_READ_TIMEOUT = 20000;
private static final int DEFAULT_CONNECT_TIMEOUT = 30000;
private static final int DEFAULT_READ_TIMEOUT = 30000;
/**
* 向第三方系统发送 POST 请求并根据 HTTP 状态码返回数据