|  |  | @ -190,6 +190,7 @@ public class IoOrderServiceImpl implements IoOrderService { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } else if (basicBussinessTypeEntity.isAdvanceType()) { |  |  |  |                 } else if (basicBussinessTypeEntity.isAdvanceType()) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     //是否寄售,删除寄售库存
 |  |  |  |                     //是否寄售,删除寄售库存
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                     List<InvPreProductDetailEntity> invProductDetailEntities = invPreProductDetailService.selectByOrderIdFk(billNo); |  |  |  |                     List<InvPreProductDetailEntity> invProductDetailEntities = invPreProductDetailService.selectByOrderIdFk(billNo); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     if (CollUtil.isNotEmpty(invProductDetailEntities)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                         for (InvPreProductDetailEntity invProductDetailEntity : invProductDetailEntities) { |  |  |  |                         for (InvPreProductDetailEntity invProductDetailEntity : invProductDetailEntities) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                             //更新库存
 |  |  |  |                             //更新库存
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                             InvPreProductEntity invProductEntity = invPreProductService.selectByUnique(invProductDetailEntity.getRelId(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode()); |  |  |  |                             InvPreProductEntity invProductEntity = invPreProductService.selectByUnique(invProductDetailEntity.getRelId(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode()); | 
			
		
	
	
		
		
			
				
					|  |  | @ -201,16 +202,20 @@ public class IoOrderServiceImpl implements IoOrderService { | 
			
		
	
		
		
			
				
					
					|  |  |  |                                     int count = invProductEntity.getOutCount() - invProductDetailEntity.getReCount(); |  |  |  |                                     int count = invProductEntity.getOutCount() - invProductDetailEntity.getReCount(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                                     invProductEntity.setOutCount(count); |  |  |  |                                     invProductEntity.setOutCount(count); | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 } |  |  |  |                                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |                         } |  |  |  | 
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                 //计算实际数量
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                 invProductEntity.setReCount(invProductEntity.getInCount() - invProductEntity.getOutCount()); | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 invPreProductService.update(invProductEntity); |  |  |  |                                 invPreProductService.update(invProductEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |                             } |  |  |  |                             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         } | 
			
		
	
		
		
			
				
					
					|  |  |  |                         //删除库存详情
 |  |  |  |                         //删除库存详情
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                         invPreProductDetailService.deleteByOrderId(billNo); |  |  |  |                         invPreProductDetailService.deleteByOrderId(billNo); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |                     } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 } else { |  |  |  |                 } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     //删除普通库存
 |  |  |  |                     //删除普通库存
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                     List<InvProductDetailEntity> invProductDetailEntities = invProductDetailService.selectByOrderIdFk(billNo); |  |  |  |                     List<InvProductDetailEntity> invProductDetailEntities = invProductDetailService.selectByOrderIdFk(billNo); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     if (CollUtil.isNotEmpty(invProductDetailEntities)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                         for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) { |  |  |  |                         for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                             //更新库存
 |  |  |  |                             //更新库存
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                             InvProductEntity invProductEntity = invProductService.selectByUnique(invProductDetailEntity.getRelId(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode()); |  |  |  |                             InvProductEntity invProductEntity = invProductService.selectByUnique(invProductDetailEntity.getRelId(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode()); | 
			
		
	
	
		
		
			
				
					|  |  | @ -222,14 +227,18 @@ public class IoOrderServiceImpl implements IoOrderService { | 
			
		
	
		
		
			
				
					
					|  |  |  |                                     int count = invProductEntity.getOutCount() - invProductDetailEntity.getReCount(); |  |  |  |                                     int count = invProductEntity.getOutCount() - invProductDetailEntity.getReCount(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                                     invProductEntity.setOutCount(count); |  |  |  |                                     invProductEntity.setOutCount(count); | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 } |  |  |  |                                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |                         } |  |  |  | 
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                 //计算实际数量
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                 invProductEntity.setReCount(invProductEntity.getInCount() - invProductEntity.getOutCount()); | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 invProductService.update(invProductEntity); |  |  |  |                                 invProductService.update(invProductEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |                             } |  |  |  |                             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         } | 
			
		
	
		
		
			
				
					
					|  |  |  |                         //删除库存详情
 |  |  |  |                         //删除库存详情
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                         invProductDetailService.deleteByOrderId(billNo); |  |  |  |                         invProductDetailService.deleteByOrderId(billNo); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         return 0; |  |  |  |         return 0; | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
	
		
		
			
				
					|  |  | @ -680,11 +689,12 @@ public class IoOrderServiceImpl implements IoOrderService { | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         ArrayList<IoOrderEntity> orders = new ArrayList<>(); |  |  |  |         ArrayList<IoOrderEntity> orders = new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (CollUtil.isNotEmpty(orders)) { |  |  |  |         if (CollUtil.isNotEmpty(billNos)) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             List<IoOrderEntity> list = orderDao.selectList(new QueryWrapper<IoOrderEntity>().in("billNo", billNos).orderByDesc("id")); |  |  |  |             List<IoOrderEntity> list = orderDao.selectList(new QueryWrapper<IoOrderEntity>().in("billNo", billNos).orderByDesc("id")); | 
			
		
	
		
		
			
				
					
					|  |  |  |             orders.addAll(list); |  |  |  |             orders.addAll(list); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         orders.add(order); |  |  |  |         //将查询入口单据放在第一位的顺序
 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         orders.add(0, order); | 
			
		
	
		
		
			
				
					
					|  |  |  |         return orders; |  |  |  |         return orders; | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | 
 |