期初类型的销售订单、流程生产订单以及备料计划不推MES,其余类型的单据推MES
This commit is contained in:
parent
0030bd2f1c
commit
163d854ace
|
|
@ -86,6 +86,11 @@ public class AfterApproveRuleHighpressureMes implements IRule<AggPickmVO> {
|
|||
if ("55A3-0002".equals(sourcebilltype.get("pk_billtypecode"))) {
|
||||
continue;
|
||||
}
|
||||
// 期初类型的单据不推MES,其余类型推MES
|
||||
String billType = pickmHeadVO.getVbusitype();
|
||||
if (checkBillType(billType, configParams)) {
|
||||
continue;
|
||||
}
|
||||
JSONObject singleObj = new JSONObject();
|
||||
// 创建子项数组
|
||||
JSONArray contentArray = new JSONArray();
|
||||
|
|
@ -93,7 +98,7 @@ public class AfterApproveRuleHighpressureMes implements IRule<AggPickmVO> {
|
|||
String saleDef = pickmHeadVO.getVdef19() == null ? "" : pickmHeadVO.getVdef19();
|
||||
if (!saleDef.equals("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);
|
||||
|
||||
singleObj.put("materialPreparationPlanNumber", pickmHeadVO.getVbillcode());// 备料计划单号
|
||||
|
|
@ -339,4 +344,18 @@ public class AfterApproveRuleHighpressureMes implements IRule<AggPickmVO> {
|
|||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,12 +72,17 @@ public class AfterApproveSyncHighpressureMesRule implements IRule<PMOAggVO> {
|
|||
for (PMOAggVO vo : useVOs) {
|
||||
PMOHeadVO pmoHeadVO = vo.getParentVO();
|
||||
PMOItemVO[] itemVOS = vo.getChildrenVO();
|
||||
// 判断物料的业务单元是否是箱变公司,不是则跳过
|
||||
// 判断物料的业务单元是否是高压生产公司,不是则跳过
|
||||
String pkOrg = pmoHeadVO.getPk_org();
|
||||
String orgCode = MyHelper.transferField(OrgVO.getDefaultTableName(), OrgVO.CODE, OrgVO.PK_ORG, pkOrg);
|
||||
if (checkIfOrg(orgCode, configParams)) {
|
||||
continue;
|
||||
}
|
||||
// 期初生产订单不推MES,其余生产订单类型推MES
|
||||
String billType = pmoHeadVO.getVtrantypecode();
|
||||
if (checkBillType(billType, configParams)) {
|
||||
continue;
|
||||
}
|
||||
String cpmohid = pmoHeadVO.getCpmohid();
|
||||
String vbillcode = pmoHeadVO.getVbillcode();
|
||||
JSONObject singleObj = new JSONObject();
|
||||
|
|
@ -339,5 +344,19 @@ public class AfterApproveSyncHighpressureMesRule implements IRule<PMOAggVO> {
|
|||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,6 +121,11 @@ public class AfterPickmRuleHighpressureRule implements IRule<PMOAggVO> {
|
|||
if ("55A3-0002".equals(sourcebilltype.get("pk_billtypecode"))) {
|
||||
continue;
|
||||
}
|
||||
// 期初类型的单据不推MES,其余类型推MES
|
||||
String billType = pickmHeadVO.getVbusitype();
|
||||
if (checkBillType(billType, configParams)) {
|
||||
continue;
|
||||
}
|
||||
JSONObject singleObj = new JSONObject();
|
||||
// 创建子项数组
|
||||
JSONArray contentArray = new JSONArray();
|
||||
|
|
@ -281,5 +286,19 @@ public class AfterPickmRuleHighpressureRule implements IRule<PMOAggVO> {
|
|||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -79,6 +79,11 @@ public class SyncGyMesPickmUtil {
|
|||
if ("55A3-0002".equals(sourcebilltype.get("pk_billtypecode"))) {
|
||||
continue;
|
||||
}
|
||||
// 期初类型的单据不推MES,其余类型推MES
|
||||
String billType = pickmHeadVO.getVbusitype();
|
||||
if (checkBillType(billType, configParams)) {
|
||||
continue;
|
||||
}
|
||||
JSONObject singleObj = new JSONObject();
|
||||
// 创建子项数组
|
||||
JSONArray contentArray = new JSONArray();
|
||||
|
|
@ -236,4 +241,18 @@ public class SyncGyMesPickmUtil {
|
|||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,15 +67,20 @@ public class AfterSoSyncRuleGyMes implements IRule<SaleOrderVO> {
|
|||
BaseDAO baseDAO = new BaseDAO();
|
||||
HYPubBO hybo = new HYPubBO();
|
||||
for (SaleOrderVO vo : useVOs) {
|
||||
// 判断物料的业务单元是否是箱变公司,不是则跳过
|
||||
// 判断物料的业务单元是否是高压生产公司,不是则跳过
|
||||
String pkOrg = vo.getParentVO().getPk_org();
|
||||
String orgCode = MyHelper.transferField(OrgVO.getDefaultTableName(), OrgVO.CODE, OrgVO.PK_ORG, pkOrg);
|
||||
if (checkIfOrg(orgCode, configParams)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
SaleOrderHVO hvo = vo.getParentVO();
|
||||
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 customerName = (String) baseDAO.executeQuery(customerSql, new ColumnProcessor());
|
||||
|
|
@ -90,7 +95,7 @@ public class AfterSoSyncRuleGyMes implements IRule<SaleOrderVO> {
|
|||
String saleDef = hvo.getVdef26()== null ? "" : hvo.getVdef26();
|
||||
if (!saleDef.equals("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);
|
||||
|
||||
for (SaleOrderBVO item : itemVOS) {
|
||||
|
|
@ -302,6 +307,20 @@ public class AfterSoSyncRuleGyMes implements IRule<SaleOrderVO> {
|
|||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue