根据物料库存信息批次管理进行过滤
This commit is contained in:
		
							parent
							
								
									11b094294a
								
							
						
					
					
						commit
						d0754dfa77
					
				|  | @ -23,6 +23,7 @@ import nc.bs.mmpac.pmo.pac0002.bp.service.PMOBPService; | |||
| import nc.bs.pubapp.AppBsContext; | ||||
| import nc.bs.trade.business.HYPubBO; | ||||
| import nc.impl.pubapp.bd.userdef.UserDefSaveRule; | ||||
| import nc.itf.bd.material.baseinfo.IMaterialBaseInfoQueryService; | ||||
| import nc.itf.uap.rbac.IUserManageQuery_C; | ||||
| import nc.jdbc.framework.generator.SequenceGenerator; | ||||
| import nc.jdbc.framework.processor.ColumnListProcessor; | ||||
|  | @ -42,6 +43,7 @@ import nc.util.mmf.framework.base.MMMapUtil; | |||
| import nc.util.mmf.framework.base.MMNumberUtil; | ||||
| import nc.util.mmf.framework.base.MMValueCheck; | ||||
| import nc.util.mmf.framework.db.MMSqlBuilder; | ||||
| import nc.vo.bd.material.MaterialVO; | ||||
| import nc.vo.bd.material.prod.MaterialProdVO; | ||||
| import nc.vo.bd.material.stock.MaterialStockVO; | ||||
| import nc.vo.bd.vermatch.enumeration.MfgTypeEnum; | ||||
|  | @ -855,7 +857,13 @@ public class PMOBPUtil { | |||
|                 for (PMOAggVO vo : aggvos) { | ||||
|                     for(PMOItemVO itemVO : vo.getChildrenVO()) { | ||||
|                         if(itemVO.getPk_org().equals(org)) { | ||||
|                             xbitemList.add(itemVO); | ||||
| //                            只有实际独立需求的流程生产订单生成相同批次号  根据上游单据类型为销售订单进行判断 | ||||
| //                             if(itemVO.getVsrctype().equals("30")){ | ||||
| //                                 xbitemList.add(itemVO); | ||||
| //                             } | ||||
|                             if(checkMaterial(itemVO.getCmaterialvid(),itemVO.getPk_org())){ | ||||
|                                 xbitemList.add(itemVO); | ||||
|                             } | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|  | @ -891,6 +899,31 @@ public class PMOBPUtil { | |||
|         } | ||||
|     } | ||||
| 
 | ||||
|     private boolean checkMaterial(String cmaterialid,String org) throws BusinessException { | ||||
|         // 根据物料档案库存信息页签批次管理字段判断是否生成批次号,只有勾选批次管理的物料才生成生产批次号 | ||||
| 
 | ||||
|         MaterialVO[] vos = NCLocator.getInstance().lookup(IMaterialBaseInfoQueryService.class).queryDataByPks(new String[]{cmaterialid}); | ||||
|         for (MaterialVO vo : vos) { | ||||
|             String whereSql = " pk_material='" + vo.getPk_material() + "' and pk_org='" + org + "'  and nvl(dr,0)=0 "; | ||||
|             List<MaterialStockVO> list = null; | ||||
|             try { | ||||
|                 list = (List<MaterialStockVO>) new BaseDAO().retrieveByClause(MaterialStockVO.class, whereSql); | ||||
|             } catch (DAOException e) { | ||||
|                 e.printStackTrace(); | ||||
|             } | ||||
|             if(!list.isEmpty()){ | ||||
|                 for (MaterialStockVO materialStockVO:list){ | ||||
|                     if(materialStockVO.getWholemanaflag().booleanValue()) { | ||||
|                         return true; | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
| 
 | ||||
|         } | ||||
| 
 | ||||
|         return false; | ||||
|     } | ||||
| 
 | ||||
|     public Map<String, MaterialStockVO> getInwarehouseid(String[] cmaterialvids, String pk_org) { | ||||
|         Map<String, MaterialStockVO> stockMap = new HashMap(); | ||||
|         if (MMArrayUtil.isEmpty(cmaterialvids)) { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue