|  |  |  | @ -145,15 +145,23 @@ public class InvMAOrderDetailServiceImpl implements InvMAOrderDetailService { | 
			
		
	
		
			
				
					|  |  |  |  |             codeList.forEach(code -> codeMap.put(code, 0)); | 
			
		
	
		
			
				
					|  |  |  |  |             //计算当前在库存中的码明细
 | 
			
		
	
		
			
				
					|  |  |  |  |             for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) { | 
			
		
	
		
			
				
					|  |  |  |  |                 Integer count = codeMap.get(invProductDetailEntity.getOriginCode()); | 
			
		
	
		
			
				
					|  |  |  |  |                 if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { | 
			
		
	
		
			
				
					|  |  |  |  |                     //出库
 | 
			
		
	
		
			
				
					|  |  |  |  |                     count = count - 1; | 
			
		
	
		
			
				
					|  |  |  |  |                 UdiEntity udi = FilterUdiUtils.getUdi(invProductDetailEntity.getOriginCode()); | 
			
		
	
		
			
				
					|  |  |  |  |                 if (StrUtil.isNotBlank(udi.getSerialNo())) { | 
			
		
	
		
			
				
					|  |  |  |  |                     //有序列号产品,根据产品数量计算即可
 | 
			
		
	
		
			
				
					|  |  |  |  |                     Integer count = codeMap.get(invProductDetailEntity.getOriginCode()); | 
			
		
	
		
			
				
					|  |  |  |  |                     if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { | 
			
		
	
		
			
				
					|  |  |  |  |                         //出库
 | 
			
		
	
		
			
				
					|  |  |  |  |                         count = count - 1; | 
			
		
	
		
			
				
					|  |  |  |  |                     } else { | 
			
		
	
		
			
				
					|  |  |  |  |                         //入库
 | 
			
		
	
		
			
				
					|  |  |  |  |                         count = count + 1; | 
			
		
	
		
			
				
					|  |  |  |  |                     } | 
			
		
	
		
			
				
					|  |  |  |  |                     codeMap.put(invProductDetailEntity.getOriginCode(), count); | 
			
		
	
		
			
				
					|  |  |  |  |                 } else { | 
			
		
	
		
			
				
					|  |  |  |  |                     //入库
 | 
			
		
	
		
			
				
					|  |  |  |  |                     count = count + 1; | 
			
		
	
		
			
				
					|  |  |  |  |                     //无序列号产品条码,直接查询库存,使用此库存信息计算出养护数量
 | 
			
		
	
		
			
				
					|  |  |  |  |                     int count = invProductEntity.getInCount() - invProductEntity.getOutCount(); | 
			
		
	
		
			
				
					|  |  |  |  |                     codeMap.put(invProductDetailEntity.getOriginCode(), count); | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  |                 codeMap.put(invProductDetailEntity.getOriginCode(), count); | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             //根据库存中的码明细,生成库存养护记录详情
 | 
			
		
	
	
		
			
				
					|  |  |  | 
 |