期初类型的销售订单、流程生产订单以及备料计划不推MES,其余类型的单据推MES

This commit is contained in:
houyi 2025-11-12 17:01:12 +08:00
parent 0030bd2f1c
commit 163d854ace
5 changed files with 100 additions and 5 deletions

View File

@ -86,6 +86,11 @@ public class AfterApproveRuleHighpressureMes implements IRule<AggPickmVO> {
if ("55A3-0002".equals(sourcebilltype.get("pk_billtypecode"))) { if ("55A3-0002".equals(sourcebilltype.get("pk_billtypecode"))) {
continue; continue;
} }
// 期初类型的单据不推MES其余类型推MES
String billType = pickmHeadVO.getVbusitype();
if (checkBillType(billType, configParams)) {
continue;
}
JSONObject singleObj = new JSONObject(); JSONObject singleObj = new JSONObject();
// 创建子项数组 // 创建子项数组
JSONArray contentArray = new JSONArray(); JSONArray contentArray = new JSONArray();
@ -93,7 +98,7 @@ public class AfterApproveRuleHighpressureMes implements IRule<AggPickmVO> {
String saleDef = pickmHeadVO.getVdef19() == null ? "" : pickmHeadVO.getVdef19(); String saleDef = pickmHeadVO.getVdef19() == null ? "" : pickmHeadVO.getVdef19();
if (!saleDef.equals("Y")) { if (!saleDef.equals("Y")) {
// 更新自定义项19为Y // 更新自定义项19为Y
String sql = "update mm_pickm set vdef19 = '" + "Y" + "' where vbillcode = '" + pickmHeadVO.getVbillcode() + "'"; String sql = "update mm_pickm set vdef19 = 'Y' where cpickmid = '" + pickmHeadVO.getCpickmid() + "'";
baseDAO.executeUpdate(sql); baseDAO.executeUpdate(sql);
singleObj.put("materialPreparationPlanNumber", pickmHeadVO.getVbillcode());// 备料计划单号 singleObj.put("materialPreparationPlanNumber", pickmHeadVO.getVbillcode());// 备料计划单号
@ -339,4 +344,18 @@ public class AfterApproveRuleHighpressureMes implements IRule<AggPickmVO> {
return map; return map;
} }
private boolean checkBillType(String code, Map<String, String> configParams) throws BusinessException {
String targetCode = configParams.get("vbusitype");
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

@ -72,12 +72,17 @@ public class AfterApproveSyncHighpressureMesRule implements IRule<PMOAggVO> {
for (PMOAggVO vo : useVOs) { for (PMOAggVO vo : useVOs) {
PMOHeadVO pmoHeadVO = vo.getParentVO(); PMOHeadVO pmoHeadVO = vo.getParentVO();
PMOItemVO[] itemVOS = vo.getChildrenVO(); PMOItemVO[] itemVOS = vo.getChildrenVO();
// 判断物料的业务单元是否是箱变公司不是则跳过 // 判断物料的业务单元是否是高压生产公司不是则跳过
String pkOrg = pmoHeadVO.getPk_org(); String pkOrg = pmoHeadVO.getPk_org();
String orgCode = MyHelper.transferField(OrgVO.getDefaultTableName(), OrgVO.CODE, OrgVO.PK_ORG, pkOrg); String orgCode = MyHelper.transferField(OrgVO.getDefaultTableName(), OrgVO.CODE, OrgVO.PK_ORG, pkOrg);
if (checkIfOrg(orgCode, configParams)) { if (checkIfOrg(orgCode, configParams)) {
continue; continue;
} }
// 期初生产订单不推MES其余生产订单类型推MES
String billType = pmoHeadVO.getVtrantypecode();
if (checkBillType(billType, configParams)) {
continue;
}
String cpmohid = pmoHeadVO.getCpmohid(); String cpmohid = pmoHeadVO.getCpmohid();
String vbillcode = pmoHeadVO.getVbillcode(); String vbillcode = pmoHeadVO.getVbillcode();
JSONObject singleObj = new JSONObject(); JSONObject singleObj = new JSONObject();
@ -339,5 +344,19 @@ public class AfterApproveSyncHighpressureMesRule implements IRule<PMOAggVO> {
return map; return map;
} }
private boolean checkBillType(String code, Map<String, String> configParams) throws BusinessException {
String targetCode = configParams.get("vtrantypecode");
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

@ -121,6 +121,11 @@ public class AfterPickmRuleHighpressureRule implements IRule<PMOAggVO> {
if ("55A3-0002".equals(sourcebilltype.get("pk_billtypecode"))) { if ("55A3-0002".equals(sourcebilltype.get("pk_billtypecode"))) {
continue; continue;
} }
// 期初类型的单据不推MES其余类型推MES
String billType = pickmHeadVO.getVbusitype();
if (checkBillType(billType, configParams)) {
continue;
}
JSONObject singleObj = new JSONObject(); JSONObject singleObj = new JSONObject();
// 创建子项数组 // 创建子项数组
JSONArray contentArray = new JSONArray(); JSONArray contentArray = new JSONArray();
@ -281,5 +286,19 @@ public class AfterPickmRuleHighpressureRule implements IRule<PMOAggVO> {
return map; return map;
} }
private boolean checkBillType(String code, Map<String, String> configParams) throws BusinessException {
String targetCode = configParams.get("vbusitype");
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

@ -79,6 +79,11 @@ public class SyncGyMesPickmUtil {
if ("55A3-0002".equals(sourcebilltype.get("pk_billtypecode"))) { if ("55A3-0002".equals(sourcebilltype.get("pk_billtypecode"))) {
continue; continue;
} }
// 期初类型的单据不推MES其余类型推MES
String billType = pickmHeadVO.getVbusitype();
if (checkBillType(billType, configParams)) {
continue;
}
JSONObject singleObj = new JSONObject(); JSONObject singleObj = new JSONObject();
// 创建子项数组 // 创建子项数组
JSONArray contentArray = new JSONArray(); JSONArray contentArray = new JSONArray();
@ -236,4 +241,18 @@ public class SyncGyMesPickmUtil {
return map; return map;
} }
private boolean checkBillType(String code, Map<String, String> configParams) throws BusinessException {
String targetCode = configParams.get("vbusitype");
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

@ -67,15 +67,20 @@ public class AfterSoSyncRuleGyMes implements IRule<SaleOrderVO> {
BaseDAO baseDAO = new BaseDAO(); BaseDAO baseDAO = new BaseDAO();
HYPubBO hybo = new HYPubBO(); HYPubBO hybo = new HYPubBO();
for (SaleOrderVO vo : useVOs) { for (SaleOrderVO vo : useVOs) {
// 判断物料的业务单元是否是箱变公司不是则跳过 // 判断物料的业务单元是否是高压生产公司不是则跳过
String pkOrg = vo.getParentVO().getPk_org(); String pkOrg = vo.getParentVO().getPk_org();
String orgCode = MyHelper.transferField(OrgVO.getDefaultTableName(), OrgVO.CODE, OrgVO.PK_ORG, pkOrg); String orgCode = MyHelper.transferField(OrgVO.getDefaultTableName(), OrgVO.CODE, OrgVO.PK_ORG, pkOrg);
if (checkIfOrg(orgCode, configParams)) { if (checkIfOrg(orgCode, configParams)) {
continue; continue;
} }
SaleOrderHVO hvo = vo.getParentVO(); SaleOrderHVO hvo = vo.getParentVO();
SaleOrderBVO[] itemVOS = vo.getChildrenVO(); SaleOrderBVO[] itemVOS = vo.getChildrenVO();
// 期初类型的订单不推MES其余订单类型推MES
String billType = hvo.getVtrantypecode();
if (checkBillType(billType, configParams)) {
continue;
}
// 客户 // 客户
String customerSql = " select name from bd_customer where dr = 0 and pk_customer = '" + hvo.getCcustomerid() + "' "; String customerSql = " select name from bd_customer where dr = 0 and pk_customer = '" + hvo.getCcustomerid() + "' ";
String customerName = (String) baseDAO.executeQuery(customerSql, new ColumnProcessor()); String customerName = (String) baseDAO.executeQuery(customerSql, new ColumnProcessor());
@ -90,7 +95,7 @@ public class AfterSoSyncRuleGyMes implements IRule<SaleOrderVO> {
String saleDef = hvo.getVdef26()== null ? "" : hvo.getVdef26(); String saleDef = hvo.getVdef26()== null ? "" : hvo.getVdef26();
if (!saleDef.equals("Y")) { if (!saleDef.equals("Y")) {
// 更新自定义项26为Y // 更新自定义项26为Y
String sql = "update so_saleorder set vdef26 = '" + "Y" + "' where vbillcode = '" + hvo.getVbillcode() + "'"; String sql = "update so_saleorder set vdef26 = 'Y' where csaleorderid = '" + hvo.getCsaleorderid() + "'";
baseDAO.executeUpdate(sql); baseDAO.executeUpdate(sql);
for (SaleOrderBVO item : itemVOS) { for (SaleOrderBVO item : itemVOS) {
@ -302,6 +307,20 @@ public class AfterSoSyncRuleGyMes implements IRule<SaleOrderVO> {
return map; return map;
} }
private boolean checkBillType(String code, Map<String, String> configParams) throws BusinessException {
String targetCode = configParams.get("vtrantypecodeS");
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;
}
} }