优化艾普MES接口代码-物料+生产订单
This commit is contained in:
parent
0d448df7f2
commit
370ccc0b35
|
@ -119,15 +119,17 @@ public class AfterApproveSyncEpicMesRule implements IRule<PMOAggVO> {
|
||||||
String pkOrg = aggVo.getParentVO().getPk_org();
|
String pkOrg = aggVo.getParentVO().getPk_org();
|
||||||
String orgCode = MyHelper.transferField(FactoryVO.getDefaultTableName(), FactoryVO.CODE, FactoryVO.PK_FACTORY, pkOrg);
|
String orgCode = MyHelper.transferField(FactoryVO.getDefaultTableName(), FactoryVO.CODE, FactoryVO.PK_FACTORY, pkOrg);
|
||||||
// 检查当前组织是否为电力电子
|
// 检查当前组织是否为电力电子
|
||||||
if (!MyHelper.checkIfDldzOrg(orgCode)) {
|
if (MyHelper.checkIfDldzOrg(orgCode)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 按照部门筛选生产订单,只传消弧车间、电容车间、成套车间(部门是配置项)
|
// 按照部门筛选生产订单,只传消弧车间、电容车间、成套车间(部门是配置项)
|
||||||
PMOItemVO[] childrenVO = aggVo.getChildrenVO();
|
PMOItemVO childrenVO = aggVo.getChildrenVO()[0];
|
||||||
for (PMOItemVO item : childrenVO) {
|
String cdeptid = childrenVO.getCdeptid();
|
||||||
String cdeptid = item.getCdeptid();
|
String deptCode = MyHelper.transferField(DeptVO.getDefaultTableName(), DeptVO.CODE, DeptVO.PK_DEPT, cdeptid);
|
||||||
String deptCode = MyHelper.transferField(DeptVO.getDefaultTableName(), DeptVO.CODE, DeptVO.PK_DEPT, cdeptid);
|
// 如果部门不在范围内则跳过本次循环
|
||||||
// 如果部门不在范围内则跳过本次循环
|
String deptRange = "5020151,5020147,5020148";
|
||||||
|
if (deptCode == null || !deptRange.contains(deptCode)) {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
aggvoList.add(aggVo);
|
aggvoList.add(aggVo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ public class MaterialToEpicMesListener implements IBusinessListener {
|
||||||
// 判断物料的业务单元是否是电力电子公司,不是则跳过
|
// 判断物料的业务单元是否是电力电子公司,不是则跳过
|
||||||
String pkOrg = vo.getPk_org();
|
String pkOrg = vo.getPk_org();
|
||||||
String orgCode = MyHelper.transferField(FactoryVO.getDefaultTableName(), FactoryVO.CODE, FactoryVO.PK_FACTORY, pkOrg);
|
String orgCode = MyHelper.transferField(FactoryVO.getDefaultTableName(), FactoryVO.CODE, FactoryVO.PK_FACTORY, pkOrg);
|
||||||
if (!MyHelper.checkIfDldzOrg(orgCode)) {
|
if (MyHelper.checkIfDldzOrg(orgCode)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 字段值翻译
|
// 字段值翻译
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
package nc.bs.uapbd.util;
|
package nc.bs.uapbd.util;
|
||||||
|
|
||||||
import nc.bs.dao.BaseDAO;
|
import nc.bs.dao.BaseDAO;
|
||||||
|
import nc.bs.dao.DAOException;
|
||||||
import nc.bs.logging.Logger;
|
import nc.bs.logging.Logger;
|
||||||
|
import nc.bs.trade.business.HYSuperDMO;
|
||||||
|
import nc.hr.utils.PubEnv;
|
||||||
import nc.itf.arap.goldentax.SysParaInitQuery;
|
import nc.itf.arap.goldentax.SysParaInitQuery;
|
||||||
import nc.jdbc.framework.processor.ColumnProcessor;
|
import nc.jdbc.framework.processor.ColumnProcessor;
|
||||||
import nc.jdbc.framework.processor.MapProcessor;
|
import nc.jdbc.framework.processor.MapProcessor;
|
||||||
|
import nc.vo.bd.defdoc.DefdocVO;
|
||||||
import nc.vo.cmp.util.StringUtils;
|
import nc.vo.cmp.util.StringUtils;
|
||||||
import nc.vo.pub.BusinessException;
|
import nc.vo.pub.BusinessException;
|
||||||
import nc.vo.pubapp.pattern.pub.SqlBuilder;
|
import nc.vo.pubapp.pattern.pub.SqlBuilder;
|
||||||
|
@ -69,18 +73,18 @@ public class MyHelper {
|
||||||
* 检查当前组织是否为电力电子
|
* 检查当前组织是否为电力电子
|
||||||
*/
|
*/
|
||||||
public static boolean checkIfDldzOrg(String code) throws BusinessException {
|
public static boolean checkIfDldzOrg(String code) throws BusinessException {
|
||||||
String targetCode = SysParaInitQuery.getParaString("GLOBLE00000000000000", "DLDZORG");
|
String targetCode = SysParaInitQuery.getParaString(PubEnv.getPk_group(), "DLDZORG");
|
||||||
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("未配置组织参数,请前往 [业务参数设置-全局] 配置DLDZORG参数");
|
throw new BusinessException("未配置组织参数,请前往 [业务参数设置-全局] 配置DLDZORG参数");
|
||||||
}
|
}
|
||||||
String[] orgItem = targetCode.split(";");
|
String[] orgItem = targetCode.split(",");
|
||||||
for (String orgCode : orgItem) {
|
for (String orgCode : orgItem) {
|
||||||
if (!orgCode.isEmpty() && orgCode.equals(code)) {
|
if (!orgCode.isEmpty() && orgCode.equals(code)) {
|
||||||
Logger.debug("当前处理组织校验为电力电子:" + code);
|
Logger.debug("当前处理组织校验为电力电子:" + code);
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -108,4 +112,23 @@ public class MyHelper {
|
||||||
}
|
}
|
||||||
return field;
|
return field;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Map<String, String> getConfigParams(String code) {
|
||||||
|
Map<String, String> map = new HashMap<String, String>();
|
||||||
|
String strWhere = " pk_defdoclist in (select pk_defdoclist from bd_defdoclist where code='[code]' and dr=0 ) and dr=0";
|
||||||
|
strWhere = strWhere.replace("[code]", code);
|
||||||
|
try {
|
||||||
|
DefdocVO[] defdocVOs = (DefdocVO[]) new HYSuperDMO().queryByWhereClause(DefdocVO.class, strWhere);
|
||||||
|
if (defdocVOs != null) {
|
||||||
|
for (DefdocVO defdocVO : defdocVOs) {
|
||||||
|
String value = StringUtils.isEmpty(defdocVO.getMemo()) ? defdocVO.getName() : defdocVO.getMemo();
|
||||||
|
map.put(defdocVO.getCode().trim(), value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (DAOException e) {
|
||||||
|
Logger.error("getConfigParams-exp:" + e.getMessage());
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue