|  |  | @ -1,5 +1,6 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  | package com.glxp.api.controller.collect; |  |  |  | package com.glxp.api.controller.collect; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import cn.hutool.core.date.DateUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import cn.hutool.core.util.StrUtil; |  |  |  | import cn.hutool.core.util.StrUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.github.pagehelper.PageInfo; |  |  |  | import com.github.pagehelper.PageInfo; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.annotation.CusRedissonAnnotation; |  |  |  | import com.glxp.api.annotation.CusRedissonAnnotation; | 
			
		
	
	
		
		
			
				
					|  |  | @ -11,11 +12,16 @@ import com.glxp.api.controller.BaseController; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.dao.inout.IoCodeTempDao; |  |  |  | import com.glxp.api.dao.inout.IoCodeTempDao; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.collect.RelCodeBatch; |  |  |  | import com.glxp.api.entity.collect.RelCodeBatch; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.entity.inout.IoCodeTempEntity; |  |  |  | import com.glxp.api.entity.inout.IoCodeTempEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.entity.inout.IoOrderDetailCodeEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.req.collect.RelCodeBatchRequest; |  |  |  | import com.glxp.api.req.collect.RelCodeBatchRequest; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.req.collect.RelCodeDetailRequest; |  |  |  | import com.glxp.api.req.collect.RelCodeDetailRequest; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.res.PageSimpleResponse; |  |  |  | import com.glxp.api.res.PageSimpleResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.res.collect.RelCodeBatchResponse; |  |  |  | import com.glxp.api.res.collect.RelCodeBatchResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.res.collect.RelCodeDetailResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.service.collect.RelCodeBatchService; |  |  |  | import com.glxp.api.service.collect.RelCodeBatchService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.service.collect.RelCodeDetailService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.service.inout.IoOrderDetailCodeService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.util.MsDateUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import lombok.extern.slf4j.Slf4j; |  |  |  | import lombok.extern.slf4j.Slf4j; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.validation.BindingResult; |  |  |  | import org.springframework.validation.BindingResult; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.web.bind.annotation.*; |  |  |  | import org.springframework.web.bind.annotation.*; | 
			
		
	
	
		
		
			
				
					|  |  | @ -134,6 +140,10 @@ public class RelCodeBatchController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Resource |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |     IoCodeTempDao ioCodeTempDao; |  |  |  |     IoCodeTempDao ioCodeTempDao; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     RelCodeDetailService relCodeDetailService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     IoOrderDetailCodeService orderDetailCodeService; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     /** |  |  |  |     /** | 
			
		
	
		
		
			
				
					
					|  |  |  |      * 更新明细 |  |  |  |      * 更新明细 | 
			
		
	
	
		
		
			
				
					|  |  | @ -144,11 +154,32 @@ public class RelCodeBatchController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |     @GetMapping("/udiwms/relCode/updateIoCodeTempEntity") |  |  |  |     @GetMapping("/udiwms/relCode/updateIoCodeTempEntity") | 
			
		
	
		
		
			
				
					
					|  |  |  |     public BaseResponse threadUpdateIoCodeTempEntity(@RequestParam("parentCode") String parentCode, @RequestParam("id") Integer id) { |  |  |  |     public BaseResponse threadUpdateIoCodeTempEntity(@RequestParam("parentCode") String parentCode, @RequestParam("id") Integer id) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (StrUtil.isBlank(parentCode)) return ResultVOUtils.error(500, "层级编码格式错误!"); |  |  |  |         if (StrUtil.isBlank(parentCode)) return ResultVOUtils.error(500, "层级编码格式错误!"); | 
			
		
	
		
		
			
				
					
					|  |  |  |         IoCodeTempEntity codeTempEntity = new IoCodeTempEntity(); |  |  |  |         IoCodeTempEntity codeTempEntity = ioCodeTempDao.selectById(id); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         IoOrderDetailCodeEntity orderDetailCodeEntity = orderDetailCodeService.findByUnique(codeTempEntity.getOrderId(), codeTempEntity.getRelId(), codeTempEntity.getBatchNo(), null); | 
			
		
	
		
		
			
				
					
					|  |  |  |         codeTempEntity.setId(id); |  |  |  |         codeTempEntity.setId(id); | 
			
		
	
		
		
			
				
					
					|  |  |  |         codeTempEntity.setDrugLink(1); |  |  |  |         codeTempEntity.setDrugLink(1); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         RelCodeDetailResponse relCodeDetailResponse = relCodeDetailService.findByCode(parentCode); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (relCodeDetailResponse != null) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (StrUtil.isEmpty(codeTempEntity.getBatchNo())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 if (orderDetailCodeEntity != null) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     orderDetailCodeEntity.setBatchNo(relCodeDetailResponse.getBatchNo()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 codeTempEntity.setBatchNo(relCodeDetailResponse.getBatchNo()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (StrUtil.isEmpty(codeTempEntity.getProduceDate())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 codeTempEntity.setProduceDate(MsDateUtil.formatDate(relCodeDetailResponse.getMadeDate(), "yyMMdd")); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 if (orderDetailCodeEntity != null) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     orderDetailCodeEntity.setProductDate(codeTempEntity.getProduceDate()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (StrUtil.isEmpty(codeTempEntity.getExpireDate())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 codeTempEntity.setExpireDate(MsDateUtil.formatDate(relCodeDetailResponse.getValidateDate(), "yyMMdd")); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 if (orderDetailCodeEntity != null) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     orderDetailCodeEntity.setExpireDate(codeTempEntity.getExpireDate()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         ioCodeTempDao.updateById(codeTempEntity); |  |  |  |         ioCodeTempDao.updateById(codeTempEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         orderDetailCodeService.update(orderDetailCodeEntity); | 
			
		
	
		
		
			
				
					
					|  |  |  |         relCodeBatchService.threadUpdateIoCodeTempEntity(parentCode); |  |  |  |         relCodeBatchService.threadUpdateIoCodeTempEntity(parentCode); | 
			
		
	
		
		
			
				
					
					|  |  |  |         return ResultVOUtils.success(); |  |  |  |         return ResultVOUtils.success(); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |