|  |  | @ -1271,39 +1271,9 @@ public class IoCodeTempController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         //------工位上货相关-----校验工位存量是否存在----
 |  |  |  |         //------工位上货相关-----校验工位存量是否存在----
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (bussinessTypeEntity.getAction().equals(ConstantType.SPLIT_OUT)) { |  |  |  |         BaseResponse handleSplitOutAndSplitReturnResponse = handleSplitOutAndSplitReturn(code, udiEntity, bussinessTypeEntity); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             IoSplitFifoCodeEntity fifoCodeEntity = fifoCodeService.findByCode(code, null); |  |  |  |         if (handleSplitOutAndSplitReturnResponse.getCode() != 20000){ | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             if (fifoCodeEntity != null && StrUtil.isNotEmpty(fifoCodeEntity.getSerialNo())) { |  |  |  |             return handleSplitOutAndSplitReturnResponse; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 return ResultVOUtils.error(533, "当前追溯码已存在!"); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             IoSplitCodeEntity splitCodeEntity = splitCodeService.findByCode(code); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (splitCodeEntity != null) {//&& StrUtil.isNotEmpty(splitCodeEntity.getSerialNo())
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 return ResultVOUtils.error(533, "当前追溯码已存在拆零库存!"); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             //校验码表是否已经存在追溯码 io_code_temp
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             IoCodeTempEntity codeTempEntity = codeTempService.selectByCode(code, udiEntity.getBatchNo(), bussinessTypeEntity.getAction()); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (codeTempEntity != null) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 return ResultVOUtils.error(533, "扫码重复或当前追溯码已存在草稿单据中!"); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         } else if (bussinessTypeEntity.getAction().equals(ConstantType.SPLIT_RETURN)) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             IoSplitFifoCodeEntity fifoCodeEntity = fifoCodeService.findByCode(code, null); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (fifoCodeEntity == null) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 return ResultVOUtils.error(500, "当前追溯码未上货或已出库完毕!"); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             IoSplitCodeEntity splitCodeEntity = splitCodeService.findByCode(code); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (splitCodeEntity != null) {//&& StrUtil.isNotEmpty(splitCodeEntity.getSerialNo())
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 return ResultVOUtils.error(533, "当前追溯码已经拆零,无法退货!"); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             //校验码表是否已经存在追溯码 io_code_temp
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             IoCodeTempEntity codeTempEntity = codeTempService.selectByCode(code, udiEntity.getBatchNo(), bussinessTypeEntity.getAction()); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (codeTempEntity != null) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 return ResultVOUtils.error(533, "扫码重复或当前追溯码已存在草稿单据中!"); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -1812,6 +1782,37 @@ public class IoCodeTempController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |         return packLevel >= compareLevel; |  |  |  |         return packLevel >= compareLevel; | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     private BaseResponse handleSplitOutAndSplitReturn(String code, UdiEntity udiEntity,BasicBussinessTypeEntity bussinessTypeEntity) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         IoSplitFifoCodeEntity fifoCodeEntity = fifoCodeService.findByCode(code, null); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         IoSplitCodeEntity splitCodeEntity = splitCodeService.findByCode(code); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         //校验码表是否已经存在追溯码 io_code_temp
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         IoCodeTempEntity codeTempEntity = codeTempService.selectByCode(code, udiEntity.getBatchNo(), bussinessTypeEntity.getAction()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (bussinessTypeEntity.getAction().equals(ConstantType.SPLIT_OUT)){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (fifoCodeEntity != null && StrUtil.isNotEmpty(fifoCodeEntity.getSerialNo())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 return ResultVOUtils.error(533, "当前追溯码已存在!"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (splitCodeEntity != null) {//&& StrUtil.isNotEmpty(splitCodeEntity.getSerialNo())
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 return ResultVOUtils.error(533, "当前追溯码已存在拆零库存!"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (codeTempEntity != null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 return ResultVOUtils.error(533, "扫码重复或当前追溯码已存在草稿单据中!"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         }else if (bussinessTypeEntity.getAction().equals(ConstantType.SPLIT_RETURN)){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (fifoCodeEntity == null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 return ResultVOUtils.error(500, "当前追溯码未上货或已出库完毕!"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (splitCodeEntity != null) {//&& StrUtil.isNotEmpty(splitCodeEntity.getSerialNo())
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 return ResultVOUtils.error(533, "当前追溯码已经拆零,无法退货!"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (codeTempEntity != null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 return ResultVOUtils.error(533, "扫码重复或当前追溯码已存在草稿单据中!"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         return ResultVOUtils.success(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     public Integer getMaxGroupNumber() { |  |  |  |     public Integer getMaxGroupNumber() { | 
			
		
	
		
		
			
				
					
					|  |  |  |         Integer groupNumber = codeTempService.selectMaxGroupNumber(); |  |  |  |         Integer groupNumber = codeTempService.selectMaxGroupNumber(); | 
			
		
	
	
		
		
			
				
					|  |  | 
 |