|  |  |  | @ -299,7 +299,7 @@ public class IoOrderServiceImpl implements IoOrderService { | 
			
		
	
		
			
				
					|  |  |  |  |         //查询条码
 | 
			
		
	
		
			
				
					|  |  |  |  |         IoOrderEntity orderEntity = findByBillNo(billNo); | 
			
		
	
		
			
				
					|  |  |  |  |         if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_AUDITED | 
			
		
	
		
			
				
					|  |  |  |  |                 || orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_SUCCESS) { | 
			
		
	
		
			
				
					|  |  |  |  |                 || orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_SUCCESS || orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_REW) { | 
			
		
	
		
			
				
					|  |  |  |  |             //更新正式表
 | 
			
		
	
		
			
				
					|  |  |  |  |             IoCodeEntity ioCodeEntity = codeService.findByUnique(billNo, code); | 
			
		
	
		
			
				
					|  |  |  |  |             if (ioCodeEntity.getMyCount() > 1) { | 
			
		
	
	
		
			
				
					|  |  |  | @ -331,12 +331,12 @@ public class IoOrderServiceImpl implements IoOrderService { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                     InvPreInProductDetailEntity invProductDetailEntity = invPreinProductDetailService.selectByCode(billNo, code); | 
			
		
	
		
			
				
					|  |  |  |  |                     int count = invProductDetailEntity.getCount() - 1; | 
			
		
	
		
			
				
					|  |  |  |  |                     int reCount = udiCalCountUtil.getActCount(invProductDetailEntity.getNameCode()); | 
			
		
	
		
			
				
					|  |  |  |  |                     if (count == 0) { | 
			
		
	
		
			
				
					|  |  |  |  |                         invPreinProductDetailService.deleteById(invProductDetailEntity.getId() + ""); | 
			
		
	
		
			
				
					|  |  |  |  |                     } else { | 
			
		
	
		
			
				
					|  |  |  |  |                         //更新详情表
 | 
			
		
	
		
			
				
					|  |  |  |  |                         invProductDetailEntity.setCount(count); | 
			
		
	
		
			
				
					|  |  |  |  |                         int reCount = udiCalCountUtil.getActCount(invProductDetailEntity.getNameCode()); | 
			
		
	
		
			
				
					|  |  |  |  |                         invProductDetailEntity.setReCount(invProductDetailEntity.getReCount() - reCount); | 
			
		
	
		
			
				
					|  |  |  |  |                         invPreinProductDetailService.update(invProductDetailEntity); | 
			
		
	
		
			
				
					|  |  |  |  |                     } | 
			
		
	
	
		
			
				
					|  |  |  | @ -344,10 +344,10 @@ public class IoOrderServiceImpl implements IoOrderService { | 
			
		
	
		
			
				
					|  |  |  |  |                     InvPreinProductEntity invProductEntity = invPreinProductService.selectByUnique(invProductDetailEntity.getRelId(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode()); | 
			
		
	
		
			
				
					|  |  |  |  |                     if (invProductEntity != null) { | 
			
		
	
		
			
				
					|  |  |  |  |                         if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) { | 
			
		
	
		
			
				
					|  |  |  |  |                             int inCount = invProductEntity.getInCount() - invProductDetailEntity.getReCount(); | 
			
		
	
		
			
				
					|  |  |  |  |                             int inCount = invProductEntity.getInCount() - reCount; | 
			
		
	
		
			
				
					|  |  |  |  |                             invProductEntity.setInCount(inCount); | 
			
		
	
		
			
				
					|  |  |  |  |                         } else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) { | 
			
		
	
		
			
				
					|  |  |  |  |                             int outCount = invProductEntity.getOutCount() - invProductDetailEntity.getReCount(); | 
			
		
	
		
			
				
					|  |  |  |  |                             int outCount = invProductEntity.getOutCount() - reCount; | 
			
		
	
		
			
				
					|  |  |  |  |                             invProductEntity.setOutCount(outCount); | 
			
		
	
		
			
				
					|  |  |  |  |                         } | 
			
		
	
		
			
				
					|  |  |  |  |                         invProductEntity.setReCount(invProductEntity.getInCount() - invProductEntity.getOutCount()); | 
			
		
	
	
		
			
				
					|  |  |  | @ -357,12 +357,12 @@ public class IoOrderServiceImpl implements IoOrderService { | 
			
		
	
		
			
				
					|  |  |  |  |                 } else if (basicBussinessTypeEntity.getActionType() == ConstantStatus.ACTION_TYPE_ADVANCE) {  //寄售库存
 | 
			
		
	
		
			
				
					|  |  |  |  |                     InvPreProductDetailEntity invProductDetailEntity = invPreProductDetailService.selectByCode(billNo, code); | 
			
		
	
		
			
				
					|  |  |  |  |                     int count = invProductDetailEntity.getCount() - 1; | 
			
		
	
		
			
				
					|  |  |  |  |                     int reCount = udiCalCountUtil.getActCount(invProductDetailEntity.getNameCode()); | 
			
		
	
		
			
				
					|  |  |  |  |                     if (count == 0) { | 
			
		
	
		
			
				
					|  |  |  |  |                         invPreProductService.deleteById(invProductDetailEntity.getId()); | 
			
		
	
		
			
				
					|  |  |  |  |                     } else { | 
			
		
	
		
			
				
					|  |  |  |  |                         //更新详情表
 | 
			
		
	
		
			
				
					|  |  |  |  |                         invProductDetailEntity.setCount(count); | 
			
		
	
		
			
				
					|  |  |  |  |                         int reCount = udiCalCountUtil.getActCount(invProductDetailEntity.getNameCode()); | 
			
		
	
		
			
				
					|  |  |  |  |                         invProductDetailEntity.setReCount(invProductDetailEntity.getReCount() - reCount); | 
			
		
	
		
			
				
					|  |  |  |  |                         invPreProductDetailService.update(invProductDetailEntity); | 
			
		
	
		
			
				
					|  |  |  |  |                     } | 
			
		
	
	
		
			
				
					|  |  |  | @ -370,10 +370,10 @@ public class IoOrderServiceImpl implements IoOrderService { | 
			
		
	
		
			
				
					|  |  |  |  |                     InvPreProductEntity invProductEntity = invPreProductService.selectByUnique(invProductDetailEntity.getRelId(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode()); | 
			
		
	
		
			
				
					|  |  |  |  |                     if (invProductEntity != null) { | 
			
		
	
		
			
				
					|  |  |  |  |                         if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) { | 
			
		
	
		
			
				
					|  |  |  |  |                             int inCount = invProductEntity.getInCount() - invProductDetailEntity.getReCount(); | 
			
		
	
		
			
				
					|  |  |  |  |                             int inCount = invProductEntity.getInCount() - reCount; | 
			
		
	
		
			
				
					|  |  |  |  |                             invProductEntity.setInCount(inCount); | 
			
		
	
		
			
				
					|  |  |  |  |                         } else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) { | 
			
		
	
		
			
				
					|  |  |  |  |                             int outCount = invProductEntity.getOutCount() - invProductDetailEntity.getReCount(); | 
			
		
	
		
			
				
					|  |  |  |  |                             int outCount = invProductEntity.getOutCount() - reCount; | 
			
		
	
		
			
				
					|  |  |  |  |                             invProductEntity.setOutCount(outCount); | 
			
		
	
		
			
				
					|  |  |  |  |                         } | 
			
		
	
		
			
				
					|  |  |  |  |                         invProductEntity.setReCount(invProductEntity.getInCount() - invProductEntity.getOutCount()); | 
			
		
	
	
		
			
				
					|  |  |  | @ -382,12 +382,12 @@ public class IoOrderServiceImpl implements IoOrderService { | 
			
		
	
		
			
				
					|  |  |  |  |                 } else {   //普通库存
 | 
			
		
	
		
			
				
					|  |  |  |  |                     InvProductDetailEntity invProductDetailEntity = invProductDetailService.selectByCode(billNo, code); | 
			
		
	
		
			
				
					|  |  |  |  |                     int count = invProductDetailEntity.getCount() - 1; | 
			
		
	
		
			
				
					|  |  |  |  |                     int reCount = udiCalCountUtil.getActCount(invProductDetailEntity.getNameCode()); | 
			
		
	
		
			
				
					|  |  |  |  |                     if (count == 0) { | 
			
		
	
		
			
				
					|  |  |  |  |                         invProductDetailService.deleteById(invProductDetailEntity.getId()); | 
			
		
	
		
			
				
					|  |  |  |  |                     } else { | 
			
		
	
		
			
				
					|  |  |  |  |                         //更新详情表
 | 
			
		
	
		
			
				
					|  |  |  |  |                         invProductDetailEntity.setCount(count); | 
			
		
	
		
			
				
					|  |  |  |  |                         int reCount = udiCalCountUtil.getActCount(invProductDetailEntity.getNameCode()); | 
			
		
	
		
			
				
					|  |  |  |  |                         invProductDetailEntity.setReCount(invProductDetailEntity.getReCount() - reCount); | 
			
		
	
		
			
				
					|  |  |  |  |                         invProductDetailService.update(invProductDetailEntity); | 
			
		
	
		
			
				
					|  |  |  |  |                     } | 
			
		
	
	
		
			
				
					|  |  |  | @ -395,10 +395,10 @@ public class IoOrderServiceImpl implements IoOrderService { | 
			
		
	
		
			
				
					|  |  |  |  |                     InvProductEntity invProductEntity = invProductService.selectByUnique(invProductDetailEntity.getRelId(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode()); | 
			
		
	
		
			
				
					|  |  |  |  |                     if (invProductEntity != null) { | 
			
		
	
		
			
				
					|  |  |  |  |                         if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) { | 
			
		
	
		
			
				
					|  |  |  |  |                             int inCount = invProductEntity.getInCount() - invProductDetailEntity.getReCount(); | 
			
		
	
		
			
				
					|  |  |  |  |                             int inCount = invProductEntity.getInCount() - reCount; | 
			
		
	
		
			
				
					|  |  |  |  |                             invProductEntity.setInCount(inCount); | 
			
		
	
		
			
				
					|  |  |  |  |                         } else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) { | 
			
		
	
		
			
				
					|  |  |  |  |                             int outCount = invProductEntity.getOutCount() - invProductDetailEntity.getReCount(); | 
			
		
	
		
			
				
					|  |  |  |  |                             int outCount = invProductEntity.getOutCount() - reCount; | 
			
		
	
		
			
				
					|  |  |  |  |                             invProductEntity.setOutCount(outCount); | 
			
		
	
		
			
				
					|  |  |  |  |                         } | 
			
		
	
		
			
				
					|  |  |  |  |                         invProductEntity.setReCount(invProductEntity.getInCount() - invProductEntity.getOutCount()); | 
			
		
	
	
		
			
				
					|  |  |  | 
 |