|  |  | @ -95,7 +95,7 @@ public class IoSplitCodeService extends ServiceImpl<IoSplitCodeMapper, IoSplitCo | 
			
		
	
		
		
			
				
					
					|  |  |  |                 .eq(IoSplitCodeEntity::getCode, code).last("limit 1")); |  |  |  |                 .eq(IoSplitCodeEntity::getCode, code).last("limit 1")); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     public void splitRemove(IoCollectOrderBiz collectOrderBiz, IoCollectOrder collectOrder, Long putWorkPlaceCode) { |  |  |  |     public void splitRemove(IoCollectOrderBiz collectOrderBiz, IoCollectOrder collectOrder, Long putWorkPlaceCode, Boolean isAuto) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         //1.按照先进先出原则,查询拆零表,获取拆零表ID
 |  |  |  |         //1.按照先进先出原则,查询拆零表,获取拆零表ID
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         List<IoSplitCodeEntity> ioSplitCodeEntities = findSplitCodes(collectOrderBiz.getRelId(), collectOrderBiz.getBatchNo(), putWorkPlaceCode); |  |  |  |         List<IoSplitCodeEntity> ioSplitCodeEntities = findSplitCodes(collectOrderBiz.getRelId(), collectOrderBiz.getBatchNo(), putWorkPlaceCode); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -146,8 +146,10 @@ public class IoSplitCodeService extends ServiceImpl<IoSplitCodeMapper, IoSplitCo | 
			
		
	
		
		
			
				
					
					|  |  |  |                 //预出库队列数量不足
 |  |  |  |                 //预出库队列数量不足
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 collectOrderBiz.setTagStatus(2); |  |  |  |                 collectOrderBiz.setTagStatus(2); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 collectOrderBiz.setTagMsg("预出库队列码数量不足,赋码失败!"); |  |  |  |                 collectOrderBiz.setTagMsg("预出库队列码数量不足,赋码失败!"); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 return; |  |  |  |                 if (isAuto) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //                throw new JsonException(500, "提交失败,工位库存数量不足!");
 |  |  |  |                     throw new JsonException(500, "提交失败,工位库存数量不足!"); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 else return; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             } else { |  |  |  |             } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 //再次执行赋码
 |  |  |  |                 //再次执行赋码
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                 ioSplitCodeEntities = findSplitCodes(collectOrderBiz.getRelId(), collectOrderBiz.getBatchNo(), putWorkPlaceCode); |  |  |  |                 ioSplitCodeEntities = findSplitCodes(collectOrderBiz.getRelId(), collectOrderBiz.getBatchNo(), putWorkPlaceCode); | 
			
		
	
	
		
		
			
				
					|  |  | @ -185,8 +187,9 @@ public class IoSplitCodeService extends ServiceImpl<IoSplitCodeMapper, IoSplitCo | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (unCount > 0) { |  |  |  |                 if (unCount > 0) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     collectOrderBiz.setTagStatus(2); |  |  |  |                     collectOrderBiz.setTagStatus(2); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     collectOrderBiz.setTagMsg("预出库队列码数量不足,赋码失败!"); |  |  |  |                     collectOrderBiz.setTagMsg("预出库队列码数量不足,赋码失败!"); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     return; |  |  |  |                     if (isAuto) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //                    throw new JsonException(500, "提交失败,工位库存数量不足!");
 |  |  |  |                         throw new JsonException(500, "提交失败,工位库存数量不足!"); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     else return; | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } else { |  |  |  |                 } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     collectOrderBiz.setTagStatus(3); |  |  |  |                     collectOrderBiz.setTagStatus(3); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     collectOrderBiz.setTagMsg("赋码完成!"); |  |  |  |                     collectOrderBiz.setTagMsg("赋码完成!"); | 
			
		
	
	
		
		
			
				
					|  |  | @ -210,7 +213,7 @@ public class IoSplitCodeService extends ServiceImpl<IoSplitCodeMapper, IoSplitCo | 
			
		
	
		
		
			
				
					
					|  |  |  |     IoCollectOrderBizBackupService ioCollectOrderBizBackupService; |  |  |  |     IoCollectOrderBizBackupService ioCollectOrderBizBackupService; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Transactional(rollbackFor = Exception.class) |  |  |  |     @Transactional(rollbackFor = Exception.class) | 
			
		
	
		
		
			
				
					
					|  |  |  |     public void finishAutoTagCode(IoCollectOrder collectOrder) { |  |  |  |     public void finishAutoTagCode(IoCollectOrder collectOrder, Boolean isAuto) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         SysWorkplacePutRel sysWorkplacePutRel = workplacePutRelService.findPutWorkPlace(collectOrder.getWorkPlaceCode(), collectOrder.getBusType()); |  |  |  |         SysWorkplacePutRel sysWorkplacePutRel = workplacePutRelService.findPutWorkPlace(collectOrder.getWorkPlaceCode(), collectOrder.getBusType()); | 
			
		
	
		
		
			
				
					
					|  |  |  |         Long putWorkPlaceCode = null; |  |  |  |         Long putWorkPlaceCode = null; | 
			
		
	
	
		
		
			
				
					|  |  | @ -333,8 +336,9 @@ public class IoSplitCodeService extends ServiceImpl<IoSplitCodeMapper, IoSplitCo | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (quotient > 0) { |  |  |  |             if (quotient > 0) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 List<IoSplitFifoCodeEntity> ioSplitFifoCodeEntities = splitFifoCodeService.findByRelId(putWorkPlaceCode, collectOrderBiz.getRelId(), collectOrderBiz.getBatchNo()); |  |  |  |                 List<IoSplitFifoCodeEntity> ioSplitFifoCodeEntities = splitFifoCodeService.findByRelId(putWorkPlaceCode, collectOrderBiz.getRelId(), collectOrderBiz.getBatchNo()); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (ioSplitFifoCodeEntities.size() < quotient) { |  |  |  |                 if (ioSplitFifoCodeEntities.size() < quotient) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     return; |  |  |  |                     if (isAuto) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //                    throw new JsonException(500, "提交失败,工位库存数量不足!");
 |  |  |  |                         throw new JsonException(500, "提交失败,工位库存数量不足!"); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     else return; | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |                 for (int i = 0; i < quotient; i++) { |  |  |  |                 for (int i = 0; i < quotient; i++) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     IoSplitFifoCodeEntity splitFifoCodeEntity = ioSplitFifoCodeEntities.get(i); |  |  |  |                     IoSplitFifoCodeEntity splitFifoCodeEntity = ioSplitFifoCodeEntities.get(i); | 
			
		
	
	
		
		
			
				
					|  |  | @ -368,7 +372,7 @@ public class IoSplitCodeService extends ServiceImpl<IoSplitCodeMapper, IoSplitCo | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |             //.如果拆零,拆零表扣除
 |  |  |  |             //.如果拆零,拆零表扣除
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (remainder > 0) { |  |  |  |             if (remainder > 0) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 splitRemove(collectOrderBiz, collectOrder, putWorkPlaceCode); |  |  |  |                 splitRemove(collectOrderBiz, collectOrder, putWorkPlaceCode, isAuto); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         ArrayList<IoCollectOrderBizBackup> ioCollectOrderBizBackups = new ArrayList<>(); |  |  |  |         ArrayList<IoCollectOrderBizBackup> ioCollectOrderBizBackups = new ArrayList<>(); | 
			
		
	
	
		
		
			
				
					|  |  | @ -441,7 +445,7 @@ public class IoSplitCodeService extends ServiceImpl<IoSplitCodeMapper, IoSplitCo | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         //.如果拆零,拆零表扣除
 |  |  |  |         //.如果拆零,拆零表扣除
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (remainder > 0) { |  |  |  |         if (remainder > 0) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             splitRemove(collectOrderBiz, collectOrder, putWorkPlaceCode); |  |  |  |             splitRemove(collectOrderBiz, collectOrder, putWorkPlaceCode, false); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (collectOrderBiz.getTagStatus() == 2) { |  |  |  |         if (collectOrderBiz.getTagStatus() == 2) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             throw new JsonException(500, "确认失败,工位库存数量不足!"); |  |  |  |             throw new JsonException(500, "确认失败,工位库存数量不足!"); | 
			
		
	
	
		
		
			
				
					|  |  | 
 |