重构 MES 接口调用逻辑
- 将 IHttpPostOtherSys 实例化移至类级别,避免重复创建- 替换静态方法调用为接口方法,提高代码可维护性 - 优化部分代码结构,提高可读性
This commit is contained in:
parent
c8182e8da6
commit
7ce829f8b5
|
@ -27,7 +27,6 @@ import nccloud.pubift.commen.itf.utils.IHttpPostOtherSys;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static nccloud.pubift.commen.impl.utils.HttpPostOtherSysImpl.checkIfIncludeOrg;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 粒劃⻌踱キ趼綴肮祭善MES
|
* 粒劃⻌踱キ趼綴肮祭善MES
|
||||||
|
@ -41,12 +40,12 @@ public class AfterSigningSynchronizeRuleMES implements IRule<PurchaseInVO> {
|
||||||
private static final String logginfo = "OALOG";
|
private static final String logginfo = "OALOG";
|
||||||
private static final Log obmlog = Log.getInstance(logginfo);
|
private static final Log obmlog = Log.getInstance(logginfo);
|
||||||
private static final BaseDAO dao = new BaseDAO();
|
private static final BaseDAO dao = new BaseDAO();
|
||||||
|
// 놓迦뺏HTTP헝헹묏야잚
|
||||||
|
IHttpPostOtherSys httpPostOtherSys = NCLocator.getInstance().lookup(IHttpPostOtherSys.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process(PurchaseInVO[] purchaseInVOs) {
|
public void process(PurchaseInVO[] purchaseInVOs) {
|
||||||
try {
|
try {
|
||||||
// 놓迦뺏HTTP헝헹묏야잚
|
|
||||||
IHttpPostOtherSys httpPostOtherSys = NCLocator.getInstance().lookup(IHttpPostOtherSys.class);
|
|
||||||
if (purchaseInVOs == null || purchaseInVOs.length == 0) {
|
if (purchaseInVOs == null || purchaseInVOs.length == 0) {
|
||||||
obmlog.debug("AfterSigningSynchronizeRuleMES-粒劃⻌踱肮祭MES-拸粒劃⻌踱等");
|
obmlog.debug("AfterSigningSynchronizeRuleMES-粒劃⻌踱肮祭MES-拸粒劃⻌踱等");
|
||||||
return;
|
return;
|
||||||
|
@ -140,7 +139,7 @@ public class AfterSigningSynchronizeRuleMES implements IRule<PurchaseInVO> {
|
||||||
for (PurchaseInVO vo : purchaseInVOS) {
|
for (PurchaseInVO vo : purchaseInVOS) {
|
||||||
try {
|
try {
|
||||||
String code = transferCodeByPk(StockOrgVO.getDefaultTableName(), StockOrgVO.CODE, StockOrgVO.PK_STOCKORG, vo.getParentVO().getPk_org());
|
String code = transferCodeByPk(StockOrgVO.getDefaultTableName(), StockOrgVO.CODE, StockOrgVO.PK_STOCKORG, vo.getParentVO().getPk_org());
|
||||||
if (checkIfIncludeOrg(code)) {
|
if (httpPostOtherSys.checkIfIncludeOrg(code)) {
|
||||||
result.add(vo);
|
result.add(vo);
|
||||||
}
|
}
|
||||||
} catch (BusinessException e) {
|
} catch (BusinessException e) {
|
||||||
|
|
|
@ -6,7 +6,6 @@ import nc.bs.dao.BaseDAO;
|
||||||
import nc.bs.framework.common.NCLocator;
|
import nc.bs.framework.common.NCLocator;
|
||||||
import nc.bs.logging.Log;
|
import nc.bs.logging.Log;
|
||||||
import nc.impl.pubapp.pattern.rule.IRule;
|
import nc.impl.pubapp.pattern.rule.IRule;
|
||||||
import nc.itf.arap.goldentax.SysParaInitQuery;
|
|
||||||
import nc.jdbc.framework.processor.ColumnProcessor;
|
import nc.jdbc.framework.processor.ColumnProcessor;
|
||||||
import nc.vo.bd.material.MaterialVO;
|
import nc.vo.bd.material.MaterialVO;
|
||||||
import nc.vo.bd.material.measdoc.MeasdocVO;
|
import nc.vo.bd.material.measdoc.MeasdocVO;
|
||||||
|
@ -31,8 +30,6 @@ import java.math.RoundingMode;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static nccloud.pubift.commen.impl.utils.HttpPostOtherSysImpl.checkIfIncludeOrg;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (前置)采购收货单推送MES系统,后续调用采购入库
|
* (前置)采购收货单推送MES系统,后续调用采购入库
|
||||||
*/
|
*/
|
||||||
|
@ -42,12 +39,12 @@ public class PurchaseReceiptRuleMES implements IRule<PurchaseInVO> {
|
||||||
private static final String logginfo = "OALOG";
|
private static final String logginfo = "OALOG";
|
||||||
private static final Log obmlog = Log.getInstance(logginfo);
|
private static final Log obmlog = Log.getInstance(logginfo);
|
||||||
private static final BaseDAO dao = new BaseDAO();
|
private static final BaseDAO dao = new BaseDAO();
|
||||||
|
// 놓迦뺏HTTP헝헹묏야잚
|
||||||
|
IHttpPostOtherSys httpPostOtherSys = NCLocator.getInstance().lookup(IHttpPostOtherSys.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process(PurchaseInVO[] purchaseInVOS) {
|
public void process(PurchaseInVO[] purchaseInVOS) {
|
||||||
try {
|
try {
|
||||||
// 놓迦뺏HTTP헝헹묏야잚
|
|
||||||
IHttpPostOtherSys httpPostOtherSys = NCLocator.getInstance().lookup(IHttpPostOtherSys.class);
|
|
||||||
if (purchaseInVOS == null || purchaseInVOS.length == 0) {
|
if (purchaseInVOS == null || purchaseInVOS.length == 0) {
|
||||||
obmlog.debug("AfterSigningSynchronizeRuleMES-没有需要处理的采购收货单");
|
obmlog.debug("AfterSigningSynchronizeRuleMES-没有需要处理的采购收货单");
|
||||||
return;
|
return;
|
||||||
|
@ -133,7 +130,7 @@ public class PurchaseReceiptRuleMES implements IRule<PurchaseInVO> {
|
||||||
for (PurchaseInVO vo : purchaseInVOS) {
|
for (PurchaseInVO vo : purchaseInVOS) {
|
||||||
try {
|
try {
|
||||||
String code = transferCodeByPk(StockOrgVO.getDefaultTableName(), StockOrgVO.CODE, StockOrgVO.PK_STOCKORG, vo.getParentVO().getPk_org());
|
String code = transferCodeByPk(StockOrgVO.getDefaultTableName(), StockOrgVO.CODE, StockOrgVO.PK_STOCKORG, vo.getParentVO().getPk_org());
|
||||||
if (checkIfIncludeOrg(code)) {
|
if (httpPostOtherSys.checkIfIncludeOrg(code)) {
|
||||||
result.add(vo);
|
result.add(vo);
|
||||||
}
|
}
|
||||||
} catch (BusinessException e) {
|
} catch (BusinessException e) {
|
||||||
|
|
|
@ -2,14 +2,11 @@ package nc.bs.ic.m4c.sign.rule;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.yonyou.cloud.utils.StringUtils;
|
|
||||||
import nc.bs.dao.BaseDAO;
|
import nc.bs.dao.BaseDAO;
|
||||||
import nc.bs.framework.common.NCLocator;
|
import nc.bs.framework.common.NCLocator;
|
||||||
import nc.bs.logging.Log;
|
import nc.bs.logging.Log;
|
||||||
import nc.impl.pubapp.pattern.rule.IRule;
|
import nc.impl.pubapp.pattern.rule.IRule;
|
||||||
import nc.itf.arap.goldentax.SysParaInitQuery;
|
|
||||||
import nc.jdbc.framework.processor.ColumnProcessor;
|
import nc.jdbc.framework.processor.ColumnProcessor;
|
||||||
import nc.vo.bd.currtype.CurrtypeVO;
|
|
||||||
import nc.vo.bd.cust.CustomerVO;
|
import nc.vo.bd.cust.CustomerVO;
|
||||||
import nc.vo.bd.material.MaterialVO;
|
import nc.vo.bd.material.MaterialVO;
|
||||||
import nc.vo.bd.material.measdoc.MeasdocVO;
|
import nc.vo.bd.material.measdoc.MeasdocVO;
|
||||||
|
@ -17,12 +14,9 @@ import nc.vo.bd.psn.PsndocVO;
|
||||||
import nc.vo.bd.rack.RackVO;
|
import nc.vo.bd.rack.RackVO;
|
||||||
import nc.vo.bd.stordoc.StordocVO;
|
import nc.vo.bd.stordoc.StordocVO;
|
||||||
import nc.vo.bd.supplier.SupplierVO;
|
import nc.vo.bd.supplier.SupplierVO;
|
||||||
import nc.vo.ic.m45.entity.PurchaseInVO;
|
|
||||||
import nc.vo.ic.m4c.entity.SaleOutBodyVO;
|
import nc.vo.ic.m4c.entity.SaleOutBodyVO;
|
||||||
import nc.vo.ic.m4c.entity.SaleOutHeadVO;
|
import nc.vo.ic.m4c.entity.SaleOutHeadVO;
|
||||||
import nc.vo.ic.m4c.entity.SaleOutVO;
|
import nc.vo.ic.m4c.entity.SaleOutVO;
|
||||||
import nc.vo.org.DeptVO;
|
|
||||||
import nc.vo.org.SalesOrgVO;
|
|
||||||
import nc.vo.org.StockOrgVO;
|
import nc.vo.org.StockOrgVO;
|
||||||
import nc.vo.pub.BusinessException;
|
import nc.vo.pub.BusinessException;
|
||||||
import nc.vo.pub.lang.UFDate;
|
import nc.vo.pub.lang.UFDate;
|
||||||
|
@ -30,16 +24,12 @@ import nc.vo.pubapp.pattern.exception.ExceptionUtils;
|
||||||
import nc.vo.pubapp.pattern.pub.SqlBuilder;
|
import nc.vo.pubapp.pattern.pub.SqlBuilder;
|
||||||
import nc.vo.vorg.DeptVersionVO;
|
import nc.vo.vorg.DeptVersionVO;
|
||||||
import nccloud.pubift.commen.itf.utils.IHttpPostOtherSys;
|
import nccloud.pubift.commen.itf.utils.IHttpPostOtherSys;
|
||||||
import net.sf.mpxj.primavera.schema.CurrencyType;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static nccloud.pubift.commen.impl.utils.HttpPostOtherSysImpl.checkIfIncludeOrg;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 销售出库(签字后传MES金思维系统)
|
* 销售出库(签字后传MES金思维系统)
|
||||||
|
@ -48,6 +38,7 @@ public class AfterSigningSynchronizeRuleMES implements IRule<SaleOutVO> {
|
||||||
private static final String SALE_OUT_URL = "/GTHINKING/AjaxService/N_KCSJJS/101527003.ashx/gt_rec_api_xsckdj"; // 销售出库登记接口
|
private static final String SALE_OUT_URL = "/GTHINKING/AjaxService/N_KCSJJS/101527003.ashx/gt_rec_api_xsckdj"; // 销售出库登记接口
|
||||||
private static final Log obmlog = Log.getInstance("OALOG");
|
private static final Log obmlog = Log.getInstance("OALOG");
|
||||||
private static final BaseDAO dao = new BaseDAO();
|
private static final BaseDAO dao = new BaseDAO();
|
||||||
|
IHttpPostOtherSys httpPostOtherSys = NCLocator.getInstance().lookup(IHttpPostOtherSys.class);
|
||||||
|
|
||||||
public AfterSigningSynchronizeRuleMES() {
|
public AfterSigningSynchronizeRuleMES() {
|
||||||
}
|
}
|
||||||
|
@ -55,8 +46,6 @@ public class AfterSigningSynchronizeRuleMES implements IRule<SaleOutVO> {
|
||||||
@Override
|
@Override
|
||||||
public void process(SaleOutVO[] saleOutVOS) {
|
public void process(SaleOutVO[] saleOutVOS) {
|
||||||
try {
|
try {
|
||||||
// ³õʼ»¯HTTPÇëÇ󹤾ßÀà
|
|
||||||
IHttpPostOtherSys httpPostOtherSys = NCLocator.getInstance().lookup(IHttpPostOtherSys.class);
|
|
||||||
if (saleOutVOS == null || saleOutVOS.length == 0) {
|
if (saleOutVOS == null || saleOutVOS.length == 0) {
|
||||||
obmlog.debug("AfterSigningSynchronizeRule-没有需要处理的销售出库单.");
|
obmlog.debug("AfterSigningSynchronizeRule-没有需要处理的销售出库单.");
|
||||||
return;
|
return;
|
||||||
|
@ -196,7 +185,7 @@ public class AfterSigningSynchronizeRuleMES implements IRule<SaleOutVO> {
|
||||||
for (SaleOutVO vo : saleOutVOS) {
|
for (SaleOutVO vo : saleOutVOS) {
|
||||||
try {
|
try {
|
||||||
String code = transferCodeByPk(StockOrgVO.getDefaultTableName(), StockOrgVO.CODE, StockOrgVO.PK_STOCKORG, vo.getParentVO().getPk_org());
|
String code = transferCodeByPk(StockOrgVO.getDefaultTableName(), StockOrgVO.CODE, StockOrgVO.PK_STOCKORG, vo.getParentVO().getPk_org());
|
||||||
if (checkIfIncludeOrg(code)) {
|
if (httpPostOtherSys.checkIfIncludeOrg(code)) {
|
||||||
result.add(vo);
|
result.add(vo);
|
||||||
}
|
}
|
||||||
} catch (BusinessException e) {
|
} catch (BusinessException e) {
|
||||||
|
|
|
@ -6,15 +6,12 @@ import nc.bs.dao.BaseDAO;
|
||||||
import nc.bs.framework.common.NCLocator;
|
import nc.bs.framework.common.NCLocator;
|
||||||
import nc.bs.logging.Log;
|
import nc.bs.logging.Log;
|
||||||
import nc.impl.pubapp.pattern.rule.IRule;
|
import nc.impl.pubapp.pattern.rule.IRule;
|
||||||
import nc.itf.arap.goldentax.SysParaInitQuery;
|
|
||||||
import nc.jdbc.framework.processor.ColumnProcessor;
|
import nc.jdbc.framework.processor.ColumnProcessor;
|
||||||
import nc.vo.bd.currtype.CurrtypeVO;
|
|
||||||
import nc.vo.bd.cust.CustomerVO;
|
import nc.vo.bd.cust.CustomerVO;
|
||||||
import nc.vo.bd.material.MaterialVO;
|
import nc.vo.bd.material.MaterialVO;
|
||||||
import nc.vo.bd.material.measdoc.MeasdocVO;
|
import nc.vo.bd.material.measdoc.MeasdocVO;
|
||||||
import nc.vo.bd.psn.PsndocVO;
|
import nc.vo.bd.psn.PsndocVO;
|
||||||
import nc.vo.bd.stordoc.StordocVO;
|
import nc.vo.bd.stordoc.StordocVO;
|
||||||
import nc.vo.ic.m45.entity.PurchaseInVO;
|
|
||||||
import nc.vo.ic.m4c.entity.SaleOutBodyVO;
|
import nc.vo.ic.m4c.entity.SaleOutBodyVO;
|
||||||
import nc.vo.ic.m4c.entity.SaleOutHeadVO;
|
import nc.vo.ic.m4c.entity.SaleOutHeadVO;
|
||||||
import nc.vo.ic.m4c.entity.SaleOutVO;
|
import nc.vo.ic.m4c.entity.SaleOutVO;
|
||||||
|
@ -30,8 +27,6 @@ import java.math.RoundingMode;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static nccloud.pubift.commen.impl.utils.HttpPostOtherSysImpl.checkIfIncludeOrg;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (前置)销售交货单(BIP无) 推送至MES
|
* (前置)销售交货单(BIP无) 推送至MES
|
||||||
|
@ -43,12 +38,11 @@ public class SalesDeliveryOrderRuleMES implements IRule<SaleOutVO> {
|
||||||
// 删除销售交货单接口地址
|
// 删除销售交货单接口地址
|
||||||
private static final String MES_DELETE_API_URL = "/GTHINKING/AjaxService/N_XSSJJSA/102397002.ashx/SOTH_DELETE";
|
private static final String MES_DELETE_API_URL = "/GTHINKING/AjaxService/N_XSSJJSA/102397002.ashx/SOTH_DELETE";
|
||||||
private static final Log obmlog = Log.getInstance("OALOG");
|
private static final Log obmlog = Log.getInstance("OALOG");
|
||||||
|
IHttpPostOtherSys httpPostOtherSys = NCLocator.getInstance().lookup(IHttpPostOtherSys.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process(SaleOutVO[] saleOutVOS) {
|
public void process(SaleOutVO[] saleOutVOS) {
|
||||||
try {
|
try {
|
||||||
// 놓迦뺏HTTP헝헹묏야잚
|
|
||||||
IHttpPostOtherSys httpPostOtherSys = NCLocator.getInstance().lookup(IHttpPostOtherSys.class);
|
|
||||||
if (saleOutVOS == null || saleOutVOS.length == 0) {
|
if (saleOutVOS == null || saleOutVOS.length == 0) {
|
||||||
obmlog.info("SalesDeliveryOrderRuleMES-没有要进行处理的销售交货单");
|
obmlog.info("SalesDeliveryOrderRuleMES-没有要进行处理的销售交货单");
|
||||||
return;
|
return;
|
||||||
|
@ -198,32 +192,23 @@ public class SalesDeliveryOrderRuleMES implements IRule<SaleOutVO> {
|
||||||
if (orderNo == null || orderNo.trim().isEmpty()) {
|
if (orderNo == null || orderNo.trim().isEmpty()) {
|
||||||
throw new BusinessException("销售交货单号不能为空");
|
throw new BusinessException("销售交货单号不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
obmlog.debug("SalesDeliveryOrderRuleMES-准备删除第三方系统销售交货单: " + orderNo);
|
obmlog.debug("SalesDeliveryOrderRuleMES-准备删除第三方系统销售交货单: " + orderNo);
|
||||||
|
|
||||||
// 构建请求数据
|
// 构建请求数据
|
||||||
JSONObject requestData = new JSONObject();
|
JSONObject requestData = new JSONObject();
|
||||||
JSONObject dataObj = new JSONObject();
|
JSONObject dataObj = new JSONObject();
|
||||||
dataObj.put("orderNo", orderNo);
|
dataObj.put("orderNo", orderNo);
|
||||||
requestData.put("Data", dataObj);
|
requestData.put("Data", dataObj);
|
||||||
|
|
||||||
// 놓迦뺏HTTP헝헹묏야잚
|
|
||||||
IHttpPostOtherSys httpPostOtherSys = NCLocator.getInstance().lookup(IHttpPostOtherSys.class);
|
|
||||||
|
|
||||||
// 发送删除请求
|
// 发送删除请求
|
||||||
String response = httpPostOtherSys.callMes(MES_DELETE_API_URL, requestData);
|
String response = httpPostOtherSys.callMes(MES_DELETE_API_URL, requestData);
|
||||||
obmlog.debug("SalesDeliveryOrderRuleMES-删除请求返回结果: " + response);
|
obmlog.debug("SalesDeliveryOrderRuleMES-删除请求返回结果: " + response);
|
||||||
|
|
||||||
// 解析返回结果
|
// 解析返回结果
|
||||||
JSONObject jsonResponse = JSONObject.parseObject(response);
|
JSONObject jsonResponse = JSONObject.parseObject(response);
|
||||||
boolean isSuccess = jsonResponse.getBooleanValue("Success");
|
boolean isSuccess = jsonResponse.getBooleanValue("Success");
|
||||||
String errorMessage = jsonResponse.getString("ErrorMessage");
|
String errorMessage = jsonResponse.getString("ErrorMessage");
|
||||||
|
|
||||||
if (!isSuccess) {
|
if (!isSuccess) {
|
||||||
obmlog.error("SalesDeliveryOrderRuleMES-删除销售交货单失败: " + orderNo + ", 错误信息: " + errorMessage);
|
obmlog.error("SalesDeliveryOrderRuleMES-删除销售交货单失败: " + orderNo + ", 错误信息: " + errorMessage);
|
||||||
throw new BusinessException("删除销售交货单失败: " + (errorMessage != null ? errorMessage : "未知错误"));
|
throw new BusinessException("删除销售交货单失败: " + (errorMessage != null ? errorMessage : "未知错误"));
|
||||||
}
|
}
|
||||||
|
|
||||||
obmlog.debug("SalesDeliveryOrderRuleMES-成功删除销售交货单: " + orderNo);
|
obmlog.debug("SalesDeliveryOrderRuleMES-成功删除销售交货单: " + orderNo);
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -240,7 +225,7 @@ public class SalesDeliveryOrderRuleMES implements IRule<SaleOutVO> {
|
||||||
for (SaleOutVO vo : saleOutVOS) {
|
for (SaleOutVO vo : saleOutVOS) {
|
||||||
try {
|
try {
|
||||||
String code = transferCodeByPk(StockOrgVO.getDefaultTableName(), StockOrgVO.CODE, StockOrgVO.PK_STOCKORG, vo.getParentVO().getPk_org());
|
String code = transferCodeByPk(StockOrgVO.getDefaultTableName(), StockOrgVO.CODE, StockOrgVO.PK_STOCKORG, vo.getParentVO().getPk_org());
|
||||||
if (checkIfIncludeOrg(code)) {
|
if (httpPostOtherSys.checkIfIncludeOrg(code)) {
|
||||||
result.add(vo);
|
result.add(vo);
|
||||||
}
|
}
|
||||||
} catch (BusinessException e) {
|
} catch (BusinessException e) {
|
||||||
|
|
|
@ -7,7 +7,6 @@ import nc.bs.dao.BaseDAO;
|
||||||
import nc.bs.framework.common.NCLocator;
|
import nc.bs.framework.common.NCLocator;
|
||||||
import nc.bs.logging.Log;
|
import nc.bs.logging.Log;
|
||||||
import nc.impl.pubapp.pattern.rule.IRule;
|
import nc.impl.pubapp.pattern.rule.IRule;
|
||||||
import nc.itf.arap.goldentax.SysParaInitQuery;
|
|
||||||
import nc.jdbc.framework.processor.ColumnProcessor;
|
import nc.jdbc.framework.processor.ColumnProcessor;
|
||||||
import nc.vo.bd.cust.CustomerVO;
|
import nc.vo.bd.cust.CustomerVO;
|
||||||
import nc.vo.bd.material.MaterialVO;
|
import nc.vo.bd.material.MaterialVO;
|
||||||
|
@ -25,11 +24,9 @@ import nc.vo.pubapp.pattern.exception.ExceptionUtils;
|
||||||
import nc.vo.pubapp.pattern.pub.SqlBuilder;
|
import nc.vo.pubapp.pattern.pub.SqlBuilder;
|
||||||
import nc.vo.vorg.DeptVersionVO;
|
import nc.vo.vorg.DeptVersionVO;
|
||||||
import nccloud.pubift.commen.itf.utils.IHttpPostOtherSys;
|
import nccloud.pubift.commen.itf.utils.IHttpPostOtherSys;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static nccloud.pubift.commen.impl.utils.HttpPostOtherSysImpl.checkIfIncludeOrg;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,6 +37,7 @@ public class AfterApprovingSynchronizeRuleMES implements IRule<InvCountBillVO> {
|
||||||
private static final String logginfo = "OALOG";
|
private static final String logginfo = "OALOG";
|
||||||
private static final Log obmlog = Log.getInstance(logginfo);
|
private static final Log obmlog = Log.getInstance(logginfo);
|
||||||
private static final BaseDAO dao = new BaseDAO();
|
private static final BaseDAO dao = new BaseDAO();
|
||||||
|
IHttpPostOtherSys httpPostOtherSys = NCLocator.getInstance().lookup(IHttpPostOtherSys.class);
|
||||||
|
|
||||||
public AfterApprovingSynchronizeRuleMES() {
|
public AfterApprovingSynchronizeRuleMES() {
|
||||||
}
|
}
|
||||||
|
@ -47,8 +45,6 @@ public class AfterApprovingSynchronizeRuleMES implements IRule<InvCountBillVO> {
|
||||||
@Override
|
@Override
|
||||||
public void process(InvCountBillVO[] invCountBillVOs) {
|
public void process(InvCountBillVO[] invCountBillVOs) {
|
||||||
try {
|
try {
|
||||||
// 놓迦뺏HTTP헝헹묏야잚
|
|
||||||
IHttpPostOtherSys httpPostOtherSys = NCLocator.getInstance().lookup(IHttpPostOtherSys.class);
|
|
||||||
if (invCountBillVOs == null || invCountBillVOs.length == 0) {
|
if (invCountBillVOs == null || invCountBillVOs.length == 0) {
|
||||||
obmlog.debug("AfterApprovingSynchronizeRule-ûÓÐÒª´¦ÀíµÄÅ̵ã");
|
obmlog.debug("AfterApprovingSynchronizeRule-ûÓÐÒª´¦ÀíµÄÅ̵ã");
|
||||||
return;
|
return;
|
||||||
|
@ -82,7 +78,7 @@ public class AfterApprovingSynchronizeRuleMES implements IRule<InvCountBillVO> {
|
||||||
for (InvCountBillVO vo : invCountBillVOS) {
|
for (InvCountBillVO vo : invCountBillVOS) {
|
||||||
try {
|
try {
|
||||||
String code = transferCodeByPk(StockOrgVO.getDefaultTableName(), StockOrgVO.CODE, StockOrgVO.PK_STOCKORG, vo.getParentVO().getPk_org());
|
String code = transferCodeByPk(StockOrgVO.getDefaultTableName(), StockOrgVO.CODE, StockOrgVO.PK_STOCKORG, vo.getParentVO().getPk_org());
|
||||||
if (checkIfIncludeOrg(code)) {
|
if (httpPostOtherSys.checkIfIncludeOrg(code)) {
|
||||||
result.add(vo);
|
result.add(vo);
|
||||||
}
|
}
|
||||||
} catch (BusinessException e) {
|
} catch (BusinessException e) {
|
||||||
|
|
|
@ -55,7 +55,6 @@ public class BatchTransferToPurchaseOrder implements IBackgroundWorkPlugin {
|
||||||
logger.info("批量转换请购单到采购订单完成", this.getClass(), "executeTask");
|
logger.info("批量转换请购单到采购订单完成", this.getClass(), "executeTask");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("执行批量转换请购单到采购订单任务失败", e, this.getClass(), "executeTask");
|
logger.error("执行批量转换请购单到采购订单任务失败", e, this.getClass(), "executeTask");
|
||||||
ExceptionUtils.marsh(e);
|
|
||||||
}
|
}
|
||||||
logger.info("批量转换请购单到采购订单任务执行完成", this.getClass(), "executeTask");
|
logger.info("批量转换请购单到采购订单任务执行完成", this.getClass(), "executeTask");
|
||||||
return retObj;
|
return retObj;
|
||||||
|
@ -204,13 +203,12 @@ public class BatchTransferToPurchaseOrder implements IBackgroundWorkPlugin {
|
||||||
Arrays.stream(vos).forEach(currentVO -> {
|
Arrays.stream(vos).forEach(currentVO -> {
|
||||||
PraybillHeaderVO hvo = currentVO.getHVO();
|
PraybillHeaderVO hvo = currentVO.getHVO();
|
||||||
hvo.setVdef30("success");
|
hvo.setVdef30("success");
|
||||||
hvo.setVdef31("N");
|
hvo.setVdef31("Y");
|
||||||
hvo.setStatus(VOStatus.UPDATED);
|
hvo.setStatus(VOStatus.UPDATED);
|
||||||
});
|
});
|
||||||
if (orderVOs.length == 1) {
|
if (orderVOs.length == 1) {
|
||||||
PraybillVO singleVO = vos[0];
|
PraybillVO singleVO = vos[0];
|
||||||
PraybillHeaderVO singleHVO = singleVO.getHVO();
|
PraybillHeaderVO singleHVO = singleVO.getHVO();
|
||||||
SCMScriptResultDTO scriptResult = null;
|
|
||||||
try {
|
try {
|
||||||
(NCLocator.getInstance().lookup(IBatchRunScriptService.class)).runBacth(cloudContext, OrderVO.class);
|
(NCLocator.getInstance().lookup(IBatchRunScriptService.class)).runBacth(cloudContext, OrderVO.class);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -240,9 +238,7 @@ public class BatchTransferToPurchaseOrder implements IBackgroundWorkPlugin {
|
||||||
logger.warn("单据转换生成采购订单时发生错误: " + scriptResult.getErrorMessage(), this.getClass(), "processBatchTransfer");
|
logger.warn("单据转换生成采购订单时发生错误: " + scriptResult.getErrorMessage(), this.getClass(), "processBatchTransfer");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!failedHVOList.isEmpty()) {
|
updatePrayBillVOs(failedHVOList);
|
||||||
updatePrayBillVOs(failedHVOList);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updatePrayBillVOs(List<PraybillVO> hvoList) {
|
private void updatePrayBillVOs(List<PraybillVO> hvoList) {
|
||||||
|
|
|
@ -1,17 +1,12 @@
|
||||||
package nc.bs.so.m30.rule.approve;
|
package nc.bs.so.m30.rule.approve;
|
||||||
|
|
||||||
import bsh.StringUtil;
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import nc.bs.dao.BaseDAO;
|
import nc.bs.dao.BaseDAO;
|
||||||
import nc.bs.framework.common.InvocationInfoProxy;
|
|
||||||
import nc.bs.framework.common.NCLocator;
|
import nc.bs.framework.common.NCLocator;
|
||||||
import nc.bs.logging.Log;
|
import nc.bs.logging.Log;
|
||||||
import nc.hr.utils.PubEnv;
|
|
||||||
import nc.impl.pubapp.pattern.rule.IRule;
|
import nc.impl.pubapp.pattern.rule.IRule;
|
||||||
import nc.itf.arap.goldentax.SysParaInitQuery;
|
|
||||||
import nc.jdbc.framework.processor.ColumnProcessor;
|
import nc.jdbc.framework.processor.ColumnProcessor;
|
||||||
import nc.vo.am.common.util.StringUtils;
|
|
||||||
import nc.vo.bd.balatype.BalaTypeVO;
|
import nc.vo.bd.balatype.BalaTypeVO;
|
||||||
import nc.vo.bd.currtype.CurrtypeVO;
|
import nc.vo.bd.currtype.CurrtypeVO;
|
||||||
import nc.vo.bd.cust.CustomerVO;
|
import nc.vo.bd.cust.CustomerVO;
|
||||||
|
@ -36,8 +31,6 @@ import java.math.RoundingMode;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static nccloud.pubift.commen.impl.utils.HttpPostOtherSysImpl.checkIfIncludeOrg;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 销售订单审批后推送MES金思维系统
|
* 销售订单审批后推送MES金思维系统
|
||||||
*/
|
*/
|
||||||
|
@ -46,14 +39,14 @@ public class AfterApprovingSynchronizeRuleMES implements IRule<SaleOrderVO> {
|
||||||
private static final String logginfo = "OALOG";
|
private static final String logginfo = "OALOG";
|
||||||
private static final Log obmlog = Log.getInstance(logginfo);
|
private static final Log obmlog = Log.getInstance(logginfo);
|
||||||
private static final BaseDAO dao = new BaseDAO();
|
private static final BaseDAO dao = new BaseDAO();
|
||||||
|
// 놓迦뺏HTTP헝헹묏야잚
|
||||||
|
IHttpPostOtherSys httpPostOtherSys = NCLocator.getInstance().lookup(IHttpPostOtherSys.class);
|
||||||
|
|
||||||
public AfterApprovingSynchronizeRuleMES() {
|
public AfterApprovingSynchronizeRuleMES() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process(SaleOrderVO[] saleOrderVOs) {
|
public void process(SaleOrderVO[] saleOrderVOs) {
|
||||||
// 놓迦뺏HTTP헝헹묏야잚
|
|
||||||
IHttpPostOtherSys httpPostOtherSys = NCLocator.getInstance().lookup(IHttpPostOtherSys.class);
|
|
||||||
try {
|
try {
|
||||||
if (saleOrderVOs == null || saleOrderVOs.length == 0) {
|
if (saleOrderVOs == null || saleOrderVOs.length == 0) {
|
||||||
obmlog.debug("AfterApprovingSynchronizeRuleMES-没有需要处理的销售订单");
|
obmlog.debug("AfterApprovingSynchronizeRuleMES-没有需要处理的销售订单");
|
||||||
|
@ -238,7 +231,7 @@ public class AfterApprovingSynchronizeRuleMES implements IRule<SaleOrderVO> {
|
||||||
for (SaleOrderVO vo : saleOutVOS) {
|
for (SaleOrderVO vo : saleOutVOS) {
|
||||||
try {
|
try {
|
||||||
String code = transferCodeByPk(SalesOrgVO.getDefaultTableName(), SalesOrgVO.CODE, SalesOrgVO.PK_SALESORG, vo.getParentVO().getPk_org());
|
String code = transferCodeByPk(SalesOrgVO.getDefaultTableName(), SalesOrgVO.CODE, SalesOrgVO.PK_SALESORG, vo.getParentVO().getPk_org());
|
||||||
if (checkIfIncludeOrg(code)) {
|
if (httpPostOtherSys.checkIfIncludeOrg(code)) {
|
||||||
result.add(vo);
|
result.add(vo);
|
||||||
}
|
}
|
||||||
} catch (BusinessException e) {
|
} catch (BusinessException e) {
|
||||||
|
|
Loading…
Reference in New Issue