|  |  | @ -350,10 +350,23 @@ public class IoCollectOrderService extends ServiceImpl<IoCollectOrderMapper, IoC | 
			
		
	
		
		
			
				
					
					|  |  |  |             IoCollectOrderBiz bizServiceOne = collectOrderBizService.getOne(new LambdaQueryWrapper<IoCollectOrderBiz>() |  |  |  |             IoCollectOrderBiz bizServiceOne = collectOrderBizService.getOne(new LambdaQueryWrapper<IoCollectOrderBiz>() | 
			
		
	
		
		
			
				
					
					|  |  |  |                     .eq(IoCollectOrderBiz::getId, bizIdFk)); |  |  |  |                     .eq(IoCollectOrderBiz::getId, bizIdFk)); | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (bizServiceOne == null) throw new JsonException("扫码详情未查找到"); |  |  |  |             if (bizServiceOne == null) throw new JsonException("扫码详情未查找到"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             //反差单据类型 查看是否来源业务单
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             String orderIdFk = bizServiceOne.getOrderIdFk(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             IoCollectOrder ioCollectOrder = collectOrderMapper.selectOne(new LambdaQueryWrapper<IoCollectOrder>().eq(IoCollectOrder::getBillNo, orderIdFk)); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (ioCollectOrder == null) throw new JsonException("反差单据失败"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             String busType = ioCollectOrder.getBusType(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             Long workPlaceCode = ioCollectOrder.getWorkPlaceCode(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             SysWorkplaceDocumentEntity byWorkplaceCode = sysWorkplaceDocumentService.findByWorkplaceCode(workPlaceCode, busType); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (byWorkplaceCode == null) throw new JsonException("反差工位单据类型失败"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             Integer scanType = byWorkplaceCode.getScanType(); | 
			
		
	
		
		
			
				
					
					|  |  |  |             Integer oneScanCount = bizServiceOne.getScanCount(); |  |  |  |             Integer oneScanCount = bizServiceOne.getScanCount(); | 
			
		
	
		
		
			
				
					
					|  |  |  |             Integer newCount = oneScanCount - delCount; |  |  |  |             Integer newCount = oneScanCount - delCount; | 
			
		
	
		
		
			
				
					
					|  |  |  |             bizServiceOne.setScanCount(newCount); |  |  |  |             if (scanType == 1 && newCount <= 0){ | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             collectOrderBizService.updateById(bizServiceOne); |  |  |  |                 collectOrderBizService.removeById(bizServiceOne); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             }else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 bizServiceOne.setScanCount(newCount); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 collectOrderBizService.updateById(bizServiceOne); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |