精密-材料出库新增-单据日期赋值-启源领料
This commit is contained in:
		
							parent
							
								
									fb76ce3647
								
							
						
					
					
						commit
						215c55e889
					
				|  | @ -109,6 +109,7 @@ public class InsertBP implements IInsertBP<MaterialOutVO>, | |||
| 
 | ||||
|         //2025年6月13日09点38分 -- 物料档案基本页签启用项目辅助属性+库存组织未启用项目,采购入库单保存时(包含接口导入)清除行项目,材料出库单保存时(包含接口导入)清除行项目 | ||||
|         processor.addBeforeRule(new MaterialOutProjectRule()); | ||||
|         processor.addBeforeRule(new MaterialOutBillDateRule()); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|  |  | |||
|  | @ -0,0 +1,57 @@ | |||
| package nc.bs.ic.m4d.insert.rule; | ||||
| 
 | ||||
| import nc.bs.ic.pub.base.ICRule; | ||||
| import nc.bs.uapbd.util.MyHelper; | ||||
| import nc.util.mmf.framework.base.MMValueCheck; | ||||
| import nc.vo.ic.general.define.ICBillHeadVO; | ||||
| import nc.vo.ic.general.define.ICBillVO; | ||||
| import nc.vo.ic.m4d.entity.MaterialOutVO; | ||||
| import nc.vo.org.StockOrgVO; | ||||
| import nc.vo.pub.BusinessException; | ||||
| import nc.vo.pub.lang.UFDate; | ||||
| import nc.vo.pubapp.pattern.exception.ExceptionUtils; | ||||
| 
 | ||||
| /** | ||||
|  * 精密-材料出库新增-单据日期赋值-启源领料 | ||||
|  * | ||||
|  * @author mzr | ||||
|  * @date 2025/10/26 | ||||
|  */ | ||||
| public class MaterialOutBillDateRule extends ICRule<MaterialOutVO> { | ||||
|     @Override | ||||
|     public void process(MaterialOutVO[] vos) { | ||||
|         if (MMValueCheck.isEmpty(vos)) { | ||||
|             return; | ||||
|         } | ||||
|         try { | ||||
|             for (ICBillVO vo : vos) { | ||||
|                 ICBillHeadVO headVO = vo.getParentVO(); | ||||
|                 String pk_org = (String) headVO.getAttributeValue("pk_org"); | ||||
|                 String orgCode = MyHelper.transferField(StockOrgVO.getDefaultTableName(), StockOrgVO.CODE, StockOrgVO.PK_STOCKORG, pk_org); | ||||
|                 // 启源领料id | ||||
|                 String vdef9 = headVO.getVdef9(); | ||||
|                 if ("C038".equals(orgCode) && MMValueCheck.isNotEmpty(vdef9)) { | ||||
|                     // 启源传入的单据,单据日期增加校验 | ||||
|                     UFDate dbilldate = headVO.getDbilldate(); | ||||
|                     // 设置单据日期, 如果单据日期小于2025-11-02,则单据日期设置为2025-11-02 | ||||
|                     UFDate ufDate = new UFDate("2025-11-02"); | ||||
|                     if (dbilldate != null) { | ||||
|                         int i = dbilldate.compareTo(ufDate); | ||||
|                         if (i < 0) { | ||||
|                             headVO.setDbilldate(ufDate); | ||||
|                         } | ||||
|                     } else { | ||||
|                         UFDate nowDate = new UFDate(); | ||||
|                         int i = nowDate.compareTo(ufDate); | ||||
|                         if (i < 0) { | ||||
|                             headVO.setDbilldate(ufDate); | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         } catch (BusinessException e) { | ||||
|             ExceptionUtils.wrappException(e); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| } | ||||
		Loading…
	
		Reference in New Issue