Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
6e0217aa86
|
|
@ -42,6 +42,7 @@ import nc.vo.pub.lang.UFDate;
|
||||||
import nc.vo.pub.lang.UFDouble;
|
import nc.vo.pub.lang.UFDouble;
|
||||||
import nc.vo.pubapp.pattern.exception.ExceptionUtils;
|
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.StockOrgVersionVO;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -79,9 +80,12 @@ public class NoItemsDeliverMaterialRule implements IRule<PurchaseInVO> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void noItemsDeliverMaterial(PurchaseInVO[] inVOS) throws BusinessException {
|
private void noItemsDeliverMaterial(PurchaseInVO[] inVOS) throws BusinessException {
|
||||||
String OrgCondition = "code = 'C038' and enablestate = '2' and isbusinessunit='Y'";
|
String orgCondition = "code = 'C038' and enablestate = '2' and isbusinessunit='Y'";
|
||||||
HYPubBO hyPub = new HYPubBO();
|
HYPubBO hyPub = new HYPubBO();
|
||||||
String orgId = hyPub.findColValue(OrgVO.getDefaultTableName(), OrgVO.PK_ORG, OrgCondition) + "";
|
String orgId = hyPub.findColValue(OrgVO.getDefaultTableName(), OrgVO.PK_ORG, orgCondition) + "";
|
||||||
|
// 组织版本id
|
||||||
|
orgCondition = "code = 'C038' and enablestate = '2'";
|
||||||
|
String org_vid = hyPub.findColValue(StockOrgVersionVO.getDefaultTableName(), StockOrgVersionVO.PK_VID, orgCondition) + "";
|
||||||
// 精密铸造,生成采购入库成功后再进行无备料领料
|
// 精密铸造,生成采购入库成功后再进行无备料领料
|
||||||
for (PurchaseInVO inVO : inVOS) {
|
for (PurchaseInVO inVO : inVOS) {
|
||||||
PurchaseInHeadVO head = inVO.getHead();
|
PurchaseInHeadVO head = inVO.getHead();
|
||||||
|
|
@ -94,6 +98,10 @@ public class NoItemsDeliverMaterialRule implements IRule<PurchaseInVO> {
|
||||||
if (configParams.isEmpty()) {
|
if (configParams.isEmpty()) {
|
||||||
ExceptionUtils.wrappBusinessException("自定义档案中的jm-config参数未配置");
|
ExceptionUtils.wrappBusinessException("自定义档案中的jm-config参数未配置");
|
||||||
}
|
}
|
||||||
|
String warehouseId = getWarehouseInfo(pkOrg, configParams);
|
||||||
|
if (MMValueCheck.isEmpty(warehouseId) || "~".equals(warehouseId)) {
|
||||||
|
ExceptionUtils.wrappBusinessException("请检查仓库编码是否配置正确");
|
||||||
|
}
|
||||||
for (PurchaseInBodyVO body : bodys) {
|
for (PurchaseInBodyVO body : bodys) {
|
||||||
String cmaterialvid = body.getCmaterialvid();
|
String cmaterialvid = body.getCmaterialvid();
|
||||||
String condition = "pk_material = '" + cmaterialvid + "'";
|
String condition = "pk_material = '" + cmaterialvid + "'";
|
||||||
|
|
@ -172,10 +180,7 @@ public class NoItemsDeliverMaterialRule implements IRule<PurchaseInVO> {
|
||||||
PickmHeadVO pickmHeadVO = pickmVO.getParentVO();
|
PickmHeadVO pickmHeadVO = pickmVO.getParentVO();
|
||||||
String cpickmid = pickmHeadVO.getCpickmid();
|
String cpickmid = pickmHeadVO.getCpickmid();
|
||||||
List<PickmItemVO> itemVOS = new ArrayList<>();
|
List<PickmItemVO> itemVOS = new ArrayList<>();
|
||||||
String warehouseId = getWarehouseInfo(pkOrg, configParams);
|
|
||||||
if (MMValueCheck.isEmpty(warehouseId) || "~".equals(warehouseId)) {
|
|
||||||
ExceptionUtils.wrappBusinessException("请检查仓库编码是否配置正确");
|
|
||||||
}
|
|
||||||
Map<String, Object> materialMap = getMaterialInfo(cmaterialvid);
|
Map<String, Object> materialMap = getMaterialInfo(cmaterialvid);
|
||||||
String pkMeasdoc = "";
|
String pkMeasdoc = "";
|
||||||
if (materialMap != null) {
|
if (materialMap != null) {
|
||||||
|
|
@ -185,8 +190,8 @@ public class NoItemsDeliverMaterialRule implements IRule<PurchaseInVO> {
|
||||||
itemVO.setCpickmid(cpickmid);
|
itemVO.setCpickmid(cpickmid);
|
||||||
itemVO.setPk_group("00");
|
itemVO.setPk_group("00");
|
||||||
itemVO.setPk_org(pkOrg);
|
itemVO.setPk_org(pkOrg);
|
||||||
itemVO.setPk_org_v(pkOrg);
|
itemVO.setPk_org_v(org_vid);
|
||||||
itemVO.setCdeliverorgvid(pkOrg);// 发料组织
|
itemVO.setCdeliverorgvid(org_vid);// 发料组织
|
||||||
itemVO.setCdeliverorgid(pkOrg);// 发料组织
|
itemVO.setCdeliverorgid(pkOrg);// 发料组织
|
||||||
itemVO.setVrowno("10");// 行号
|
itemVO.setVrowno("10");// 行号
|
||||||
itemVO.setCbmaterialid(cmaterialvid);
|
itemVO.setCbmaterialid(cmaterialvid);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package nc.bs.ic.m4d.insert.rule;
|
package nc.bs.ic.m4d.insert.rule;
|
||||||
|
|
||||||
|
import nc.bs.dao.BaseDAO;
|
||||||
|
import nc.bs.dao.DAOException;
|
||||||
import nc.bs.framework.common.InvocationInfoProxy;
|
import nc.bs.framework.common.InvocationInfoProxy;
|
||||||
import nc.bs.framework.common.NCLocator;
|
import nc.bs.framework.common.NCLocator;
|
||||||
import nc.bs.ic.pub.base.ICRule;
|
import nc.bs.ic.pub.base.ICRule;
|
||||||
|
|
@ -8,8 +10,10 @@ import nc.bs.trade.business.HYPubBO;
|
||||||
import nc.bs.uapbd.util.MyHelper;
|
import nc.bs.uapbd.util.MyHelper;
|
||||||
import nc.itf.mmpac.pickm.IPickmQueryService;
|
import nc.itf.mmpac.pickm.IPickmQueryService;
|
||||||
import nc.itf.uap.IUAPQueryBS;
|
import nc.itf.uap.IUAPQueryBS;
|
||||||
|
import nc.jdbc.framework.processor.ColumnProcessor;
|
||||||
import nc.util.mmf.framework.base.MMValueCheck;
|
import nc.util.mmf.framework.base.MMValueCheck;
|
||||||
import nc.vo.bd.material.MaterialVO;
|
import nc.vo.bd.material.MaterialVO;
|
||||||
|
import nc.vo.bd.stordoc.StordocVO;
|
||||||
import nc.vo.ic.m4d.entity.MaterialOutBodyVO;
|
import nc.vo.ic.m4d.entity.MaterialOutBodyVO;
|
||||||
import nc.vo.ic.m4d.entity.MaterialOutHeadVO;
|
import nc.vo.ic.m4d.entity.MaterialOutHeadVO;
|
||||||
import nc.vo.ic.m4d.entity.MaterialOutVO;
|
import nc.vo.ic.m4d.entity.MaterialOutVO;
|
||||||
|
|
@ -36,6 +40,16 @@ public class MaterialOutBatchCodeRule extends ICRule<MaterialOutVO> {
|
||||||
private static final String LOG_INFO_NAME = "jmqylog";
|
private static final String LOG_INFO_NAME = "jmqylog";
|
||||||
private static final Log logger = Log.getInstance(LOG_INFO_NAME);
|
private static final Log logger = Log.getInstance(LOG_INFO_NAME);
|
||||||
private Map<String, String> configParams;
|
private Map<String, String> configParams;
|
||||||
|
|
||||||
|
public BaseDAO dao;
|
||||||
|
|
||||||
|
public BaseDAO getDao() {
|
||||||
|
if (dao == null) {
|
||||||
|
dao = new BaseDAO();
|
||||||
|
}
|
||||||
|
return dao;
|
||||||
|
}
|
||||||
|
|
||||||
private IUAPQueryBS queryBS = null;
|
private IUAPQueryBS queryBS = null;
|
||||||
|
|
||||||
public final IUAPQueryBS getQueryBS() {
|
public final IUAPQueryBS getQueryBS() {
|
||||||
|
|
@ -64,10 +78,15 @@ public class MaterialOutBatchCodeRule extends ICRule<MaterialOutVO> {
|
||||||
MaterialOutHeadVO headVO = vo.getHead();
|
MaterialOutHeadVO headVO = vo.getHead();
|
||||||
MaterialOutBodyVO[] bodys = vo.getBodys();
|
MaterialOutBodyVO[] bodys = vo.getBodys();
|
||||||
String pk_org = (String) headVO.getAttributeValue("pk_org");
|
String pk_org = (String) headVO.getAttributeValue("pk_org");
|
||||||
String vtrantypecode = headVO.getVtrantypecode();
|
String cwarehouseid = headVO.getCwarehouseid();
|
||||||
String orgCode = MyHelper.transferField(StockOrgVO.getDefaultTableName(), StockOrgVO.CODE, StockOrgVO.PK_STOCKORG, pk_org);
|
String orgCode = MyHelper.transferField(StockOrgVO.getDefaultTableName(), StockOrgVO.CODE, StockOrgVO.PK_STOCKORG, pk_org);
|
||||||
if ("C038".equals(orgCode)) {
|
if ("C038".equals(orgCode)) {
|
||||||
if ("4D-Cxx-58".equals(vtrantypecode)) {
|
String warehouseId = getWarehouseInfo(pk_org, configParams);
|
||||||
|
if (MMValueCheck.isEmpty(warehouseId) || "~".equals(warehouseId)) {
|
||||||
|
ExceptionUtils.wrappBusinessException("请检查仓库编码是否配置正确");
|
||||||
|
}
|
||||||
|
// 判断仓库是否为WF001
|
||||||
|
if (warehouseId.equals(cwarehouseid)) {
|
||||||
IPickmQueryService service = NCLocator.getInstance().lookup(IPickmQueryService.class);
|
IPickmQueryService service = NCLocator.getInstance().lookup(IPickmQueryService.class);
|
||||||
// Åú´ÎºÅ¸³Öµ
|
// Åú´ÎºÅ¸³Öµ
|
||||||
for (MaterialOutBodyVO body : bodys) {
|
for (MaterialOutBodyVO body : bodys) {
|
||||||
|
|
@ -126,4 +145,18 @@ public class MaterialOutBatchCodeRule extends ICRule<MaterialOutVO> {
|
||||||
return resMap;
|
return resMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getWarehouseInfo(String pk_org, Map<String, String> configParams) throws DAOException {
|
||||||
|
String warehouseCode = configParams.get("warehouseCode");
|
||||||
|
SqlBuilder sqlBuilder = new SqlBuilder();
|
||||||
|
sqlBuilder.append(" select " + StordocVO.PK_STORDOC);
|
||||||
|
sqlBuilder.append(" from " + StordocVO.getDefaultTableName());
|
||||||
|
sqlBuilder.append(" where dr = 0");
|
||||||
|
sqlBuilder.append(" and ");
|
||||||
|
sqlBuilder.append(StordocVO.CODE, warehouseCode);
|
||||||
|
sqlBuilder.append(" and ");
|
||||||
|
sqlBuilder.append(StordocVO.PK_ORG, pk_org);
|
||||||
|
String warehouseId = (String) getDao().executeQuery(sqlBuilder.toString(), new ColumnProcessor());
|
||||||
|
return warehouseId;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue