|  |  | @ -1,10 +1,6 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  | package com.glxp.api.controller.inout; |  |  |  | package com.glxp.api.controller.inout; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | import cn.hutool.core.date.DateUtil; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import cn.hutool.core.thread.ThreadUtil; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |  |  |  | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.annotation.CusRedissonAnnotation; |  |  |  | import com.glxp.api.annotation.CusRedissonAnnotation; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.constant.*; |  |  |  | import com.glxp.api.constant.*; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.dao.inout.IoOrderDetailCodeDao; |  |  |  | import com.glxp.api.dao.inout.IoOrderDetailCodeDao; | 
			
		
	
	
		
		
			
				
					|  |  | @ -22,7 +18,6 @@ import com.glxp.api.service.collect.RelCodeDetailService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.inout.impl.IoCodeService; |  |  |  | import com.glxp.api.service.inout.impl.IoCodeService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.inv.impl.InvProductServiceNew; |  |  |  | import com.glxp.api.service.inv.impl.InvProductServiceNew; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.vo.basic.InvProductNewVo; |  |  |  | import com.glxp.api.vo.basic.InvProductNewVo; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.aspectj.weaver.ast.Var; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.beans.BeanUtils; |  |  |  | import org.springframework.beans.BeanUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  | import cn.hutool.core.collection.CollUtil; |  |  |  | import cn.hutool.core.collection.CollUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import cn.hutool.core.util.IdUtil; |  |  |  | import cn.hutool.core.util.IdUtil; | 
			
		
	
	
		
		
			
				
					|  |  | @ -43,7 +38,6 @@ import com.glxp.api.req.inout.*; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.res.PageSimpleResponse; |  |  |  | import com.glxp.api.res.PageSimpleResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.res.basic.UdiRelevanceResponse; |  |  |  | import com.glxp.api.res.basic.UdiRelevanceResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.res.basic.UdiRlSupResponse; |  |  |  | import com.glxp.api.res.basic.UdiRlSupResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.res.inv.InvPlaceDetailResponse; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.auth.InvWarehouseService; |  |  |  | import com.glxp.api.service.auth.InvWarehouseService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.basic.*; |  |  |  | import com.glxp.api.service.basic.*; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.inout.*; |  |  |  | import com.glxp.api.service.inout.*; | 
			
		
	
	
		
		
			
				
					|  |  | @ -332,10 +326,17 @@ public class IoCodeTempController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |             baseResponse.setData(originCode); |  |  |  |             baseResponse.setData(originCode); | 
			
		
	
		
		
			
				
					
					|  |  |  |             return baseResponse; |  |  |  |             return baseResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         UdiRelevanceResponse checkUdi = udiRelevanceService.selectByNameCode(udiEntity.getUdi()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (checkUdi == null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return ResultVOUtils.error(500, "耗材字典不存在此产品!"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (IntUtil.value(udiEntity.getProductType()) == 2) { |  |  |  |         if (IntUtil.value(udiEntity.getProductType()) == 2) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             //药品
 |  |  |  |             //药品
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             udiEntity.setCode(code); |  |  |  |             udiEntity.setCode(code); | 
			
		
	
		
		
			
				
					
					|  |  |  |             return ResultVOUtils.success(udiEntity); |  |  |  |             AddEnterCodeResponse addEnterCodeResponse = setAddEnterCodeResponse(udiEntity, checkUdi); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return ResultVOUtils.success(addEnterCodeResponse); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (StrUtil.isNotEmpty(udiEntity.getBatchNo())) { |  |  |  |         if (StrUtil.isNotEmpty(udiEntity.getBatchNo())) { | 
			
		
	
	
		
		
			
				
					|  |  | @ -344,10 +345,7 @@ public class IoCodeTempController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         UdiRelevanceResponse checkUdi = udiRelevanceService.selectByNameCode(udiEntity.getUdi()); |  |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         if (checkUdi == null) { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             return ResultVOUtils.error(500, "耗材字典不存在此产品!"); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         boolean checkSuccess = true; |  |  |  |         boolean checkSuccess = true; | 
			
		
	
		
		
			
				
					
					|  |  |  |         String lostMsg = ""; |  |  |  |         String lostMsg = ""; | 
			
		
	
		
		
			
				
					
					|  |  |  |         //校验条码完整性
 |  |  |  |         //校验条码完整性
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -383,7 +381,8 @@ public class IoCodeTempController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 code = code.substring(0, code.length() - "\u001D".length()); |  |  |  |                 code = code.substring(0, code.length() - "\u001D".length()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |             udiEntity.setCode(code); |  |  |  |             udiEntity.setCode(code); | 
			
		
	
		
		
			
				
					
					|  |  |  |             return ResultVOUtils.success(udiEntity); |  |  |  |             AddEnterCodeResponse addEnterCodeResponse = setAddEnterCodeResponse(udiEntity, checkUdi); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return ResultVOUtils.success(addEnterCodeResponse); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } else { |  |  |  |         } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (newCode.startsWith("21") || (StrUtil.isNotEmpty(udiEntity.getSerialNo()) && newCode.contains("21" + udiEntity.getSerialNo()))) { |  |  |  |             if (newCode.startsWith("21") || (StrUtil.isNotEmpty(udiEntity.getSerialNo()) && newCode.contains("21" + udiEntity.getSerialNo()))) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (StrUtil.isEmpty(lostMsg)) { |  |  |  |                 if (StrUtil.isEmpty(lostMsg)) { | 
			
		
	
	
		
		
			
				
					|  |  | @ -391,17 +390,32 @@ public class IoCodeTempController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |                 BaseResponse baseResponse = ResultVOUtils.error(503, "条码完整性错误,缺少" + lostMsg.substring(1) + "是否继续添加?"); |  |  |  |                 BaseResponse baseResponse = ResultVOUtils.error(503, "条码完整性错误,缺少" + lostMsg.substring(1) + "是否继续添加?"); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 udiEntity.setCode(code); |  |  |  |                 udiEntity.setCode(code); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 baseResponse.setData(udiEntity); |  |  |  |                 AddEnterCodeResponse addEnterCodeResponse = setAddEnterCodeResponse(udiEntity, checkUdi); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 baseResponse.setData(addEnterCodeResponse); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 return baseResponse; |  |  |  |                 return baseResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         BaseResponse baseResponse = ResultVOUtils.error(502, "校验未完成,缺少" + lostMsg.substring(1)); |  |  |  |         BaseResponse baseResponse = ResultVOUtils.error(502, "校验未完成,缺少" + lostMsg.substring(1)); | 
			
		
	
		
		
			
				
					
					|  |  |  |         udiEntity.setCode(code); |  |  |  |         udiEntity.setCode(code); | 
			
		
	
		
		
			
				
					
					|  |  |  |         baseResponse.setData(udiEntity); |  |  |  |         AddEnterCodeResponse addEnterCodeResponse = setAddEnterCodeResponse(udiEntity, checkUdi); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         baseResponse.setData(addEnterCodeResponse); | 
			
		
	
		
		
			
				
					
					|  |  |  |         return baseResponse; |  |  |  |         return baseResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public AddEnterCodeResponse setAddEnterCodeResponse(UdiEntity udiEntity, UdiRelevanceResponse checkUdi) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         AddEnterCodeResponse addEnterCodeResponse = new AddEnterCodeResponse(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         BeanUtils.copyProperties(udiEntity, addEnterCodeResponse); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         addEnterCodeResponse.setBzgg(checkUdi.getBzgg()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         addEnterCodeResponse.setCpmctymc(checkUdi.getCpmctymc()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         addEnterCodeResponse.setPrepnSpec(checkUdi.getPrepnSpec()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         addEnterCodeResponse.setPrepnUnit(checkUdi.getPrepnUnit()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         addEnterCodeResponse.setPackUnit(checkUdi.getPackUnit()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         addEnterCodeResponse.setGgxh(checkUdi.getGgxh()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         return addEnterCodeResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @AuthRuleAnnotation("") |  |  |  |     @AuthRuleAnnotation("") | 
			
		
	
		
		
			
				
					
					|  |  |  |     @PostMapping("warehouse/inout/batchVailCode") |  |  |  |     @PostMapping("warehouse/inout/batchVailCode") | 
			
		
	
		
		
			
				
					
					|  |  |  |     public BaseResponse batchVailCode(@RequestBody AddEnterCodeRequest addEnterCodeRequest) { |  |  |  |     public BaseResponse batchVailCode(@RequestBody AddEnterCodeRequest addEnterCodeRequest) { | 
			
		
	
	
		
		
			
				
					|  |  | 
 |