负计划(采购入库校验最终需求数量)
This commit is contained in:
		
							parent
							
								
									5d46717594
								
							
						
					
					
						commit
						c2d403c9ba
					
				|  | @ -0,0 +1,34 @@ | |||
| // | ||||
| // Source code recreated from a .class file by IntelliJ IDEA | ||||
| // (powered by FernFlower decompiler) | ||||
| // | ||||
| 
 | ||||
| package nc.impl.ic.m45.action; | ||||
| 
 | ||||
| import nc.bs.ic.m45.insert.InsertBP; | ||||
| import nc.bs.pu.m23.plugin.ArriveActionPlugInPoint; | ||||
| import nc.impl.ic.general.InsertActionTemplate; | ||||
| import nc.impl.ic.m45.action.rule.XbPushTo45BeforeProcess; | ||||
| import nc.impl.ic.m45.base.ActionPlugInPoint; | ||||
| import nc.impl.pu.m23.maintain.rule.CheckBillDateRule; | ||||
| import nc.impl.pubapp.pattern.rule.processer.AroundProcesser; | ||||
| import nc.vo.ic.m45.entity.PurchaseInVO; | ||||
| import nc.vo.pu.m23.entity.ArriveVO; | ||||
| 
 | ||||
| public class InsertAction { | ||||
|     public InsertAction() { | ||||
|     } | ||||
| 
 | ||||
|     public PurchaseInVO[] insert(PurchaseInVO[] bills) { | ||||
| 
 | ||||
|         AroundProcesser<PurchaseInVO> processer = new AroundProcesser(ActionPlugInPoint.InsertAction); | ||||
|         addBeforeRule(processer); | ||||
|         InsertActionTemplate<PurchaseInVO> insertAction = new InsertActionTemplate(ActionPlugInPoint.InsertAction, new InsertBP()); | ||||
| 
 | ||||
|         return (PurchaseInVO[])insertAction.insert(bills); | ||||
|     } | ||||
|     private void addBeforeRule(AroundProcesser<PurchaseInVO> processer) { | ||||
|         processer.addBeforeRule(new XbPushTo45BeforeProcess()); | ||||
| 
 | ||||
|     } | ||||
| } | ||||
|  | @ -0,0 +1,44 @@ | |||
| // | ||||
| // Source code recreated from a .class file by IntelliJ IDEA | ||||
| // (powered by FernFlower decompiler) | ||||
| // | ||||
| 
 | ||||
| package nc.impl.ic.m45.action.rule; | ||||
| 
 | ||||
| import nc.impl.pubapp.pattern.rule.IFilterRule; | ||||
| import nc.vo.ic.m45.entity.PurchaseInBodyVO; | ||||
| import nc.vo.ic.m45.entity.PurchaseInVO; | ||||
| import nc.vo.pub.BusinessException; | ||||
| import nc.vo.pub.lang.UFDouble; | ||||
| 
 | ||||
| public class XbPushTo45BeforeProcess implements IFilterRule<PurchaseInVO> { | ||||
| 
 | ||||
| 
 | ||||
|     public XbPushTo45BeforeProcess() { | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     public PurchaseInVO[] process(PurchaseInVO[] vos) { | ||||
|         PurchaseInVO[] retvos = vos; | ||||
|         if(retvos == null || retvos.length == 0){ | ||||
|             return retvos; | ||||
|         } | ||||
|         for (PurchaseInVO vo : vos) { | ||||
|             if(vo.getHead().getPrimaryKey() == null){ | ||||
|                 for (PurchaseInBodyVO body:vo.getBodys()){ | ||||
|                     if(null!=body.getAttributeValue("vbdef33") && body.getNshouldnum().compareTo(new UFDouble(String.valueOf(body.getAttributeValue("vbdef33"))))>0){ | ||||
|                         try { | ||||
|                             throw new BusinessException("入库数量大于最终需求数量不能生成采购入库!"); | ||||
|                         } catch (BusinessException e) { | ||||
|                             throw new RuntimeException(e); | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         return retvos; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
|  | @ -190,9 +190,9 @@ public class InboundPubServiceImpl implements IInboundPubService { | |||
| 
 | ||||
|             for(ArriveItemVO body : bodys) { | ||||
|                 body.setTs((UFDateTime)Bid_ts1.get(body.getPk_arriveorder_b())); | ||||
|                 if(null!=body.getAttributeValue("vbdef33") && body.getNastnum().compareTo(body.getAttributeValue("vbdef33"))<0){ | ||||
|                     throw new BusinessException("入库数量大于最终需求数量不能生成采购入库!"); | ||||
|                 } | ||||
|                 // if(null!=body.getAttributeValue("vbdef33") && body.getNastnum().compareTo(new UFDouble(String.valueOf(body.getAttributeValue("vbdef33"))))>0){ | ||||
|                 //     throw new BusinessException("入库数量大于最终需求数量不能生成采购入库!"); | ||||
|                 // } | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue