入库仓库改成从备料计划源头生产订单获取
This commit is contained in:
parent
be9ea94944
commit
aca5b40dd0
|
|
@ -11,8 +11,10 @@ import nc.itf.mmpac.pmo.pac0002.IPMOQueryService;
|
||||||
import nc.itf.pu.m20.IPraybillMaintain;
|
import nc.itf.pu.m20.IPraybillMaintain;
|
||||||
import nc.itf.uap.pf.busiflow.PfButtonClickContext;
|
import nc.itf.uap.pf.busiflow.PfButtonClickContext;
|
||||||
import nc.jdbc.framework.processor.ColumnProcessor;
|
import nc.jdbc.framework.processor.ColumnProcessor;
|
||||||
|
import nc.jdbc.framework.processor.MapProcessor;
|
||||||
import nc.util.mmf.busi.service.PFPubService;
|
import nc.util.mmf.busi.service.PFPubService;
|
||||||
import nc.util.mmf.framework.base.MMValueCheck;
|
import nc.util.mmf.framework.base.MMValueCheck;
|
||||||
|
import nc.vo.bd.bom.bom0202.paramvo.BomItemParamForPickm;
|
||||||
import nc.vo.mmpac.pickm.entity.AggPickmVO;
|
import nc.vo.mmpac.pickm.entity.AggPickmVO;
|
||||||
import nc.vo.mmpac.pickm.entity.PickmItemVO;
|
import nc.vo.mmpac.pickm.entity.PickmItemVO;
|
||||||
import nc.vo.mmpac.pmo.pac0002.entity.PMOAggVO;
|
import nc.vo.mmpac.pmo.pac0002.entity.PMOAggVO;
|
||||||
|
|
@ -37,6 +39,8 @@ import nccloud.framework.web.container.IRequest;
|
||||||
import nccloud.framework.web.json.JsonFactory;
|
import nccloud.framework.web.json.JsonFactory;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.function.BiConsumer;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class PickmToPmo implements ICommonAction {
|
public class PickmToPmo implements ICommonAction {
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -142,7 +146,10 @@ public class PickmToPmo implements ICommonAction {
|
||||||
|
|
||||||
private PMOAggVO[] convertToGeneralInVO(AggPickmVO[] sourceBillVOs, PfParameterVO srcParaVo)
|
private PMOAggVO[] convertToGeneralInVO(AggPickmVO[] sourceBillVOs, PfParameterVO srcParaVo)
|
||||||
throws BusinessException {
|
throws BusinessException {
|
||||||
|
// IPickmQueryService service = ServiceLocator.find(IPickmQueryService.class);
|
||||||
IPMOQueryService query = (IPMOQueryService) NCLocator.getInstance().lookup(IPMOQueryService.class);
|
IPMOQueryService query = (IPMOQueryService) NCLocator.getInstance().lookup(IPMOQueryService.class);
|
||||||
|
IPMOQueryService pmoQuery = NCLocator.getInstance().lookup(IPMOQueryService.class);
|
||||||
|
|
||||||
HYPubBO hy = new HYPubBO();
|
HYPubBO hy = new HYPubBO();
|
||||||
// 来源交易类型或单据类型,需要在单据类型中注册
|
// 来源交易类型或单据类型,需要在单据类型中注册
|
||||||
String srcBillOrTranstype = "55A3";
|
String srcBillOrTranstype = "55A3";
|
||||||
|
|
@ -191,17 +198,38 @@ public class PickmToPmo implements ICommonAction {
|
||||||
if(ritem.getVrowno().equals(aggPickmVO.getParentVO().getVsourcebillrowno())){
|
if(ritem.getVrowno().equals(aggPickmVO.getParentVO().getVsourcebillrowno())){
|
||||||
itemVO.setTplanendtime(ritem.getTplanendtime());
|
itemVO.setTplanendtime(ritem.getTplanendtime());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 入库仓库改成从备料计划源头生产订单获取
|
||||||
|
if(itemVO.getVsrcid().equals(aggPickmVO.getParentVO().getCpickmid()) && null != aggPickmVO.getParentVO().getVfirstmorowid()){
|
||||||
|
// ====领料前校验流程生产订单-start====
|
||||||
|
String mobid=aggPickmVO.getParentVO().getVfirstmorowid();
|
||||||
|
PMOAggVO[] pmoAggVOS = pmoQuery.queryPMOAggVOByBid(new String[]{mobid});
|
||||||
|
if (pmoAggVOS != null && pmoAggVOS.length > 0) {
|
||||||
|
if(null!= pmoAggVOS[0].getChildrenVO() &&pmoAggVOS[0].getChildrenVO().length>0){
|
||||||
|
String cinwarehouseid = pmoAggVOS[0].getChildrenVO()[0].getCinwarehouseid();
|
||||||
|
itemVO.setCinwarehouseid(cinwarehouseid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(null !=itemVO.getCprojectid() && null!=itemVO.getCmaterialvid()){
|
// if(null !=itemVO.getCprojectid() && null!=itemVO.getCmaterialvid()){
|
||||||
String cbomid = (String) hy.findColValue("bd_bmrt", "cbomid",
|
// String cbomid = (String) hy.findColValue("bd_bom", "cbomid",
|
||||||
"cprojectid = '"+itemVO.getCprojectid()+"' AND cmaterialid= '"+itemVO.getCmaterialvid()+"' AND dr = '0' AND pk_org= '"+head.getPk_org()+"'");
|
// "hbdefault = 'Y' AND cmaterialid= '"+itemVO.getCmaterialvid()+"' AND dr = '0' AND pk_org= '"+head.getPk_org()+"'");
|
||||||
|
// itemVO.setCbomversionid(cbomid);
|
||||||
|
// }
|
||||||
|
String cbomid = (String) hy.findColValue("bd_bom", "cbomid",
|
||||||
|
"hbdefault = 'Y' AND hcmaterialid= '"+itemVO.getCmaterialid()+"' AND dr = '0' AND pk_org= '"+head.getPk_org()+"'");
|
||||||
|
|
||||||
|
if(null != cbomid){
|
||||||
itemVO.setCbomversionid(cbomid);
|
itemVO.setCbomversionid(cbomid);
|
||||||
|
String sql = " select * from bd_bom where cbomid ='" + cbomid + "'";
|
||||||
|
BaseDAO dao = new BaseDAO();
|
||||||
|
Map<String,Object> objectMap=(Map<String,Object>) dao.executeQuery(sql,new MapProcessor());
|
||||||
|
setVdefItem(itemVO,objectMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 查询物料库存页签的生产部门赋值生产订单
|
// 查询物料库存页签的生产部门赋值生产订单
|
||||||
String cdeptid = getValueByCondtion("bd_materialprod", " pk_prodeptdoc ", " pk_material= '"+itemVO.getCmaterialvid()+"' and pk_org = '"
|
String cdeptid = getValueByCondtion("bd_materialprod", " pk_prodeptdoc ", " pk_material= '"+itemVO.getCmaterialvid()+"' and pk_org = '"
|
||||||
+ head.getPk_org() + "' and dr = 0 ");
|
+ head.getPk_org() + "' and dr = 0 ");
|
||||||
|
|
@ -243,8 +271,35 @@ public class PickmToPmo implements ICommonAction {
|
||||||
// return resultList.toArray(new PMOAggVO[0]);
|
// return resultList.toArray(new PMOAggVO[0]);
|
||||||
return inVOS;
|
return inVOS;
|
||||||
}
|
}
|
||||||
|
private void setVdefItem(PMOItemVO pickmItemVO, Map<String, Object> bomItem) {
|
||||||
|
// 封装通用赋值逻辑:对齐第一行格式
|
||||||
|
BiConsumer<String, Consumer<String>> assign = (String bomKey, Consumer<String> setter) -> {
|
||||||
|
String value = (String) bomItem.get(bomKey); // 与hvdef1格式完全一致
|
||||||
|
setter.accept(value);
|
||||||
|
};
|
||||||
|
|
||||||
private UFDateTime getnextmonth(UFDateTime date) {
|
// 统一使用hv前缀key赋值
|
||||||
|
assign.accept("hvdef1", pickmItemVO::setVdef1);
|
||||||
|
assign.accept("hvdef2", pickmItemVO::setVdef2);
|
||||||
|
assign.accept("hvdef3", pickmItemVO::setVdef3);
|
||||||
|
assign.accept("hvdef4", pickmItemVO::setVdef4);
|
||||||
|
assign.accept("hvdef5", pickmItemVO::setVdef5);
|
||||||
|
assign.accept("hvdef6", pickmItemVO::setVdef6);
|
||||||
|
assign.accept("hvdef7", pickmItemVO::setVdef7);
|
||||||
|
assign.accept("hvdef8", pickmItemVO::setVdef8);
|
||||||
|
assign.accept("hvdef9", pickmItemVO::setVdef9);
|
||||||
|
assign.accept("hvdef10", pickmItemVO::setVdef10);
|
||||||
|
assign.accept("hvdef11", pickmItemVO::setVdef11);
|
||||||
|
assign.accept("hvdef12", pickmItemVO::setVdef12);
|
||||||
|
assign.accept("hvdef13", pickmItemVO::setVdef13);
|
||||||
|
assign.accept("hvdef14", pickmItemVO::setVdef14);
|
||||||
|
assign.accept("hvdef15", pickmItemVO::setVdef15);
|
||||||
|
assign.accept("hvdef17", pickmItemVO::setVdef17);
|
||||||
|
assign.accept("hvdef18", pickmItemVO::setVdef18);
|
||||||
|
assign.accept("hvdef19", pickmItemVO::setVdef19);
|
||||||
|
assign.accept("hvdef20", pickmItemVO::setVdef20);
|
||||||
|
assign.accept("hvnote", pickmItemVO::setVnote);
|
||||||
|
} private UFDateTime getnextmonth(UFDateTime date) {
|
||||||
if (date == null) {
|
if (date == null) {
|
||||||
throw new IllegalArgumentException("输入的 UFDateTime 不能为 null");
|
throw new IllegalArgumentException("输入的 UFDateTime 不能为 null");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue