|  |  |  | @ -15,12 +15,14 @@ import com.glxp.api.common.res.BaseResponse; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.common.util.ResultVOUtils; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.dao.basic.BasicProductsDao; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.dao.collect.RelCodeBatchMapper; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.dao.inout.IoCodeTempDao; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.auth.AuthAdmin; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.basic.BasicProductsEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.basic.ProductInfoEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.basic.UdiEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.collect.RelCodeBatch; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.collect.RelCodeDetail; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.inout.IoCodeTempEntity; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.exception.JsonException; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.req.collect.RelCodeBatchRequest; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.req.collect.RelCodeDetailRequest; | 
			
		
	
	
		
			
				
					|  |  |  | @ -28,6 +30,7 @@ import com.glxp.api.res.collect.RelCodeBatchResponse; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.res.collect.RelCodeDetailByParentCodeResponse; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.auth.CustomerService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.basic.ProductInfoService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.inout.IoCodeTempService; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.util.HttpClient; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.util.udi.FilterUdiUtils; | 
			
		
	
		
			
				
					|  |  |  |  | import lombok.extern.slf4j.Slf4j; | 
			
		
	
	
		
			
				
					|  |  |  | @ -384,22 +387,22 @@ public class RelCodeBatchService extends ServiceImpl<RelCodeBatchMapper, RelCode | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |             return respList; | 
			
		
	
		
			
				
					|  |  |  |  |         }else { | 
			
		
	
		
			
				
					|  |  |  |  |         } else { | 
			
		
	
		
			
				
					|  |  |  |  |             for (int i = 0; i < list.size(); i++) { | 
			
		
	
		
			
				
					|  |  |  |  |                 RelCodeBatch relCodeBatch = list.get(i); | 
			
		
	
		
			
				
					|  |  |  |  |                 RelCodeDetailByParentCodeResponse relCodeDetailByParentCodeResponse = new RelCodeDetailByParentCodeResponse(); | 
			
		
	
		
			
				
					|  |  |  |  |                 List<RelCodeDetail> relCodeDetails = relCodeDetailService.list(new LambdaQueryWrapper<RelCodeDetail>().eq(RelCodeDetail::getParentCode, parentCode)); | 
			
		
	
		
			
				
					|  |  |  |  |                 BeanUtils.copyProperties(relCodeBatch,relCodeDetailByParentCodeResponse); | 
			
		
	
		
			
				
					|  |  |  |  |                 BeanUtils.copyProperties(relCodeBatch, relCodeDetailByParentCodeResponse); | 
			
		
	
		
			
				
					|  |  |  |  |                 relCodeDetailByParentCodeResponse.setRelCodeDetail(relCodeDetails); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |                 if (CollUtil.isNotEmpty(relCodeDetails)){ | 
			
		
	
		
			
				
					|  |  |  |  |                 if (CollUtil.isNotEmpty(relCodeDetails)) { | 
			
		
	
		
			
				
					|  |  |  |  |                     RelCodeDetail relCodeDetail = relCodeDetails.get(0); | 
			
		
	
		
			
				
					|  |  |  |  |                     if (relCodeDetail.getPackLayer() > 1){//说明有下级
 | 
			
		
	
		
			
				
					|  |  |  |  |                         List<RelCodeDetailByParentCodeResponse> sons =  new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |  |                     if (relCodeDetail.getPackLayer() > 1) {//说明有下级
 | 
			
		
	
		
			
				
					|  |  |  |  |                         List<RelCodeDetailByParentCodeResponse> sons = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |  |                         for (int i1 = 0; i1 < relCodeDetails.size(); i1++) { | 
			
		
	
		
			
				
					|  |  |  |  |                             RelCodeDetail relCodeDetail1 = relCodeDetails.get(i1); | 
			
		
	
		
			
				
					|  |  |  |  |                             List<RelCodeDetailByParentCodeResponse> relCodeDetailByParentCodeResponses = this.detailByParentCodeSpms(relCodeDetail1.getCurCode(),uploadFlagDown); | 
			
		
	
		
			
				
					|  |  |  |  |                             if (CollUtil.isNotEmpty(relCodeDetailByParentCodeResponses)){ | 
			
		
	
		
			
				
					|  |  |  |  |                             List<RelCodeDetailByParentCodeResponse> relCodeDetailByParentCodeResponses = this.detailByParentCodeSpms(relCodeDetail1.getCurCode(), uploadFlagDown); | 
			
		
	
		
			
				
					|  |  |  |  |                             if (CollUtil.isNotEmpty(relCodeDetailByParentCodeResponses)) { | 
			
		
	
		
			
				
					|  |  |  |  |                                 sons.addAll(relCodeDetailByParentCodeResponses); | 
			
		
	
		
			
				
					|  |  |  |  |                             } | 
			
		
	
		
			
				
					|  |  |  |  |                         } | 
			
		
	
	
		
			
				
					|  |  |  | @ -410,6 +413,33 @@ public class RelCodeBatchService extends ServiceImpl<RelCodeBatchMapper, RelCode | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |             return respList; | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     IoCodeTempDao ioCodeTempDao; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     public void threadUpdateIoCodeTempEntity(IoCodeTempEntity codeTempEntity){ | 
			
		
	
		
			
				
					|  |  |  |  |         String parentCode = codeTempEntity.getCode(); | 
			
		
	
		
			
				
					|  |  |  |  |         List<IoCodeTempEntity> ioCodeTempEntities = ioCodeTempDao.selectList(new LambdaQueryWrapper<IoCodeTempEntity>().eq(IoCodeTempEntity::getCode, parentCode)); | 
			
		
	
		
			
				
					|  |  |  |  |         if (CollUtil.isNotEmpty(ioCodeTempEntities)){ | 
			
		
	
		
			
				
					|  |  |  |  |             if (this.batchExist(parentCode)){ | 
			
		
	
		
			
				
					|  |  |  |  |                 //打上匹配到了药品关联关系的标记
 | 
			
		
	
		
			
				
					|  |  |  |  |                 for (int i = 0; i < ioCodeTempEntities.size(); i++) { | 
			
		
	
		
			
				
					|  |  |  |  |                     IoCodeTempEntity ioCodeTempEntity = ioCodeTempEntities.get(i); | 
			
		
	
		
			
				
					|  |  |  |  |                     ioCodeTempEntity.setDrugLink(1); | 
			
		
	
		
			
				
					|  |  |  |  |                     ioCodeTempDao.updateById(ioCodeTempEntity); | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             }else { | 
			
		
	
		
			
				
					|  |  |  |  |                 //打上匹配不到了药品关联关系的标记
 | 
			
		
	
		
			
				
					|  |  |  |  |                 for (int i = 0; i < ioCodeTempEntities.size(); i++) { | 
			
		
	
		
			
				
					|  |  |  |  |                     IoCodeTempEntity ioCodeTempEntity = ioCodeTempEntities.get(i); | 
			
		
	
		
			
				
					|  |  |  |  |                     ioCodeTempEntity.setDrugLink(0); | 
			
		
	
		
			
				
					|  |  |  |  |                     ioCodeTempDao.updateById(ioCodeTempEntity); | 
			
		
	
		
			
				
					|  |  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | } | 
			
		
	
	
		
			
				
					|  |  |  | 
 |