销售出库和流程生产订单的公司控制调整
This commit is contained in:
parent
2fffd8820a
commit
5f4d39777d
|
@ -1,17 +1,17 @@
|
|||
package nccloud.resources.ic.ic.saleout;
|
||||
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import nc.bs.businessevent.BdUpdateEvent;
|
||||
import nc.bs.businessevent.BusinessEvent;
|
||||
import nc.bs.businessevent.IBusinessEvent;
|
||||
import nc.bs.businessevent.IBusinessListener;
|
||||
import nc.bs.dao.DAOException;
|
||||
import nc.bs.framework.common.NCLocator;
|
||||
import nc.bs.ic.general.businessevent.ICGeneralCommonEvent;
|
||||
import nc.bs.trade.business.HYSuperDMO;
|
||||
import nc.itf.uap.IUAPQueryBS;
|
||||
import nc.jdbc.framework.processor.ColumnProcessor;
|
||||
import nc.jdbc.framework.processor.MapProcessor;
|
||||
import nc.vo.bd.defdoc.DefdocVO;
|
||||
import nc.vo.ic.general.define.ICBillBodyVO;
|
||||
import nc.vo.ic.m4c.entity.SaleOutHeadVO;
|
||||
import nc.vo.ic.m4c.entity.SaleOutVO;
|
||||
|
@ -20,7 +20,12 @@ import nc.vo.pub.lang.UFDouble;
|
|||
import nc.vo.pubapp.AppContext;
|
||||
import nc.vo.tmpub.util.ModuleEnum;
|
||||
import nc.vo.tmpub.util.ModuleUtil;
|
||||
import nccloud.baseapp.core.log.NCCForUAPLogger;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -41,7 +46,7 @@ public class saveBeforeCheck implements IBusinessListener {
|
|||
// 判断是否是需要控制的业务单元
|
||||
SaleOutHeadVO parentVO = obills[0].getHead();
|
||||
String pkstockorgStr = getPk_stockorg(parentVO.getPk_org());
|
||||
if (pkstockorgStr == null || pkstockorgStr.equals("")) {
|
||||
if (pkstockorgStr == null || pkstockorgStr.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
ICBillBodyVO[] childrenVO = obills[0].getChildrenVO();
|
||||
|
@ -173,15 +178,39 @@ public class saveBeforeCheck implements IBusinessListener {
|
|||
if (object.getClass().isArray()) {
|
||||
return (SaleOutVO[]) object;
|
||||
} else {
|
||||
return new SaleOutVO[] { (SaleOutVO) object };
|
||||
return new SaleOutVO[]{(SaleOutVO) object};
|
||||
}
|
||||
}
|
||||
|
||||
private String getPk_stockorg(String pk_stockorg) throws BusinessException {
|
||||
String sql = " select pk_stockorg from org_stockorg where code in ('C018','C029','C033','C039','C020','C019') and pk_stockorg='"
|
||||
Map<String, String> defMap = checkOrgCtrl();
|
||||
if (defMap.isEmpty() || "".equals(defMap.getOrDefault("so_out", ""))) {
|
||||
return "";
|
||||
}
|
||||
String orgStr = defMap.getOrDefault("so_out", "");
|
||||
// 将数组转换为字符串,并添加单引号
|
||||
String newOrgStr = orgStr.replace(",", "','");
|
||||
String sql = " select pk_stockorg from org_stockorg where code in ('" + newOrgStr + "') and pk_stockorg='"
|
||||
+ pk_stockorg + "' ";
|
||||
NCCForUAPLogger.debug("so_out-getPk_stockorg-sql:" + sql);
|
||||
String saleorderPK = (String) getQueryService().executeQuery(sql, new ColumnProcessor());
|
||||
return saleorderPK;
|
||||
}
|
||||
|
||||
private Map<String, String> checkOrgCtrl() {
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
String strWhere = " pk_defdoclist in (select pk_defdoclist from bd_defdoclist where code='org-ctrl' and dr=0 ) and dr=0";
|
||||
try {
|
||||
DefdocVO[] defdocVOs = (DefdocVO[]) new HYSuperDMO().queryByWhereClause(DefdocVO.class, strWhere);
|
||||
if (defdocVOs != null && defdocVOs.length > 0) {
|
||||
for (DefdocVO defdocVO : defdocVOs) {
|
||||
map.put(defdocVO.getCode().trim(), defdocVO.getMemo());
|
||||
}
|
||||
}
|
||||
} catch (DAOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,20 +1,26 @@
|
|||
package nc.bs.mmpac.pmo.pac0002.bp.rule;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import nc.bs.dao.DAOException;
|
||||
import nc.bs.framework.common.NCLocator;
|
||||
import nc.bs.trade.business.HYSuperDMO;
|
||||
import nc.impl.pubapp.pattern.rule.IRule;
|
||||
import nc.itf.uap.IUAPQueryBS;
|
||||
import nc.jdbc.framework.processor.ColumnProcessor;
|
||||
import nc.jdbc.framework.processor.MapProcessor;
|
||||
import nc.vo.bd.defdoc.DefdocVO;
|
||||
import nc.vo.mmpac.pmo.pac0002.entity.PMOAggVO;
|
||||
import nc.vo.mmpac.pmo.pac0002.entity.PMOHeadVO;
|
||||
import nc.vo.mmpac.pmo.pac0002.entity.PMOItemVO;
|
||||
import nc.vo.pub.BusinessException;
|
||||
import nc.vo.so.m30.entity.SaleOrderBVO;
|
||||
import nccloud.baseapp.core.log.NCCForUAPLogger;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 流程生成订单保存时验证销售订单累计排产状态,并验收首付款比例 zhangxinah 适配2312
|
||||
|
@ -30,7 +36,7 @@ public class saveBeforeCheckRule implements IRule<PMOAggVO> {
|
|||
// 判断是否是需要控制的业务单元
|
||||
PMOHeadVO pmoHeadVO = vo.getParentVO();
|
||||
String pkstockorgStr = getPk_stockorg(pmoHeadVO.getPk_org());
|
||||
if (pkstockorgStr == null || pkstockorgStr.equals("")) {
|
||||
if (pkstockorgStr == null || pkstockorgStr.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
PMOItemVO[] iSuperVOs = vo.getChildrenVO();
|
||||
|
@ -98,12 +104,36 @@ public class saveBeforeCheckRule implements IRule<PMOAggVO> {
|
|||
}
|
||||
|
||||
private String getPk_stockorg(String pk_stockorg) throws BusinessException {
|
||||
String sql = " select pk_stockorg from org_stockorg where code in ('C018','C029','C033','C039','C020','C019') and pk_stockorg='"
|
||||
Map<String, String> defMap = checkOrgCtrl();
|
||||
if (defMap.isEmpty() || "".equals(defMap.getOrDefault("pmo", ""))) {
|
||||
return "";
|
||||
}
|
||||
String orgStr = defMap.getOrDefault("pmo", "");
|
||||
// 将数组转换为字符串,并添加单引号
|
||||
String newOrgStr = orgStr.replace(",", "','");
|
||||
String sql = " select pk_stockorg from org_stockorg where code in ('" + newOrgStr + "') and pk_stockorg='"
|
||||
+ pk_stockorg + "' ";
|
||||
// NCCForUAPLogger.debug("pmo-getPk_stockorg-sql:" + sql);
|
||||
String saleorderPK = (String) getQueryService().executeQuery(sql, new ColumnProcessor());
|
||||
return saleorderPK;
|
||||
}
|
||||
|
||||
private Map<String, String> checkOrgCtrl() {
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
String strWhere = " pk_defdoclist in (select pk_defdoclist from bd_defdoclist where code='org-ctrl' and dr=0 ) and dr=0";
|
||||
try {
|
||||
DefdocVO[] defdocVOs = (DefdocVO[]) new HYSuperDMO().queryByWhereClause(DefdocVO.class, strWhere);
|
||||
if (defdocVOs != null && defdocVOs.length > 0) {
|
||||
for (DefdocVO defdocVO : defdocVOs) {
|
||||
map.put(defdocVO.getCode().trim(), defdocVO.getMemo());
|
||||
}
|
||||
}
|
||||
} catch (DAOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public IUAPQueryBS getQueryService() {
|
||||
return NCLocator.getInstance().lookup(IUAPQueryBS.class);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue