|  |  | @ -6,6 +6,7 @@ import cn.hutool.http.HttpUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import cn.hutool.json.JSONUtil; |  |  |  | import cn.hutool.json.JSONUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.alibaba.fastjson.JSONObject; |  |  |  | import com.alibaba.fastjson.JSONObject; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.alibaba.fastjson.TypeReference; |  |  |  | import com.alibaba.fastjson.TypeReference; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.baomidou.mybatisplus.core.metadata.IPage; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.github.pagehelper.PageInfo; |  |  |  | import com.github.pagehelper.PageInfo; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.annotation.CusRedissonAnnotation; |  |  |  | import com.glxp.api.annotation.CusRedissonAnnotation; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.annotation.Log; |  |  |  | import com.glxp.api.annotation.Log; | 
			
		
	
	
		
		
			
				
					|  |  | @ -37,6 +38,7 @@ import com.glxp.api.util.IntUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.util.JsonUtils; |  |  |  | import com.glxp.api.util.JsonUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.util.alihealth.AlihealthUtils; |  |  |  | import com.glxp.api.util.alihealth.AlihealthUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.util.alihealth.CopyUtils; |  |  |  | import com.glxp.api.util.alihealth.CopyUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.util.alihealth.PaginationUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.google.api.client.json.Json; |  |  |  | import com.google.api.client.json.Json; | 
			
		
	
		
		
			
				
					
					|  |  |  | import lombok.extern.slf4j.Slf4j; |  |  |  | import lombok.extern.slf4j.Slf4j; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.apache.commons.lang3.StringUtils; |  |  |  | import org.apache.commons.lang3.StringUtils; | 
			
		
	
	
		
		
			
				
					|  |  | @ -104,10 +106,12 @@ public class AlihealthBusController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Resource |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |     private UdiContrastService udiContrastService; |  |  |  |     private UdiContrastService udiContrastService; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @PostMapping("/spms/alihealth/thirdAliDrugList") |  |  |  |     @PostMapping("/spms/alihealth/thirdAliDrugList") | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Log(title = "获取阿里药品码段信息列表包括查询国家库", businessType = BusinessType.OTHER) |  |  |  |     @Log(title = "获取阿里药品码段信息列表包括查询国家库", businessType = BusinessType.OTHER) | 
			
		
	
		
		
			
				
					
					|  |  |  |     public BaseResponse<List<ThirdAliDrug>> thirdAliDrugList(@RequestBody AlihealthThirdAliDrugInsertReqeust alihealthThirdAliDrugInsertReqeust) { |  |  |  |     public BaseResponse<PageSimpleResponse<ThirdAliDrug>> thirdAliDrugList(@RequestBody AlihealthThirdAliDrugInsertReqeust alihealthThirdAliDrugInsertReqeust) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         List<ThirdAliDrug> thirdAliDrugsListGjk = null; |  |  |  |         List<ThirdAliDrug> thirdAliDrugsListGjk = null; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         PageSimpleResponse<ThirdAliDrug> pageSimpleResponse =new PageSimpleResponse(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         // 本地查询和新增都先注释了 到时候加到这边来
 |  |  |  |         // 本地查询和新增都先注释了 到时候加到这边来
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         YbDrug ybDrug = alihealthThirdAliDrugInsertReqeust.getYbDrug(); |  |  |  |         YbDrug ybDrug = alihealthThirdAliDrugInsertReqeust.getYbDrug(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         if(ybDrug!= null && StringUtils.isNotEmpty(ybDrug.getGoodsCode())){ |  |  |  |         if(ybDrug!= null && StringUtils.isNotEmpty(ybDrug.getGoodsCode())){ | 
			
		
	
	
		
		
			
				
					|  |  | @ -123,8 +127,12 @@ public class AlihealthBusController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if(responseListAndAliDrug.getCode() == 20000){ |  |  |  |                 if(responseListAndAliDrug.getCode() == 20000){ | 
			
		
	
		
		
			
				
					
					|  |  |  |                     thirdAliDrugsListGjk = responseListAndAliDrug.getData(); |  |  |  |                     thirdAliDrugsListGjk = responseListAndAliDrug.getData(); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     if(thirdAliDrugsListGjk != null && thirdAliDrugsListGjk.size() >0){ |  |  |  |                     if(thirdAliDrugsListGjk != null && thirdAliDrugsListGjk.size() >0){ | 
			
		
	
		
		
			
				
					
					|  |  |  |                         return ResultVOUtils.success(thirdAliDrugsListGjk); |  |  |  |                         pageSimpleResponse.setList(thirdAliDrugsListGjk); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         return ResultVOUtils.success(pageSimpleResponse); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 }else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     pageSimpleResponse.setList(thirdAliDrugsListGjk); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     return ResultVOUtils.success(pageSimpleResponse); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |             } catch (Exception e) { |  |  |  |             } catch (Exception e) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 log.error("国家库===用医保编码查询国家库药品信息===出现错误===" + e.getMessage()); |  |  |  |                 log.error("国家库===用医保编码查询国家库药品信息===出现错误===" + e.getMessage()); | 
			
		
	
	
		
		
			
				
					|  |  | @ -133,7 +141,8 @@ public class AlihealthBusController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         // 校验标识判断 为false不会后续增加多玛融合库的逻辑 直接返回
 |  |  |  |         // 校验标识判断 为false不会后续增加多玛融合库的逻辑 直接返回
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         if(alihealthThirdAliDrugInsertReqeust.isDrugCheckMark() == false){ |  |  |  |         if(alihealthThirdAliDrugInsertReqeust.isDrugCheckMark() == false){ | 
			
		
	
		
		
			
				
					
					|  |  |  |             return ResultVOUtils.success(thirdAliDrugsListGjk); |  |  |  |             pageSimpleResponse.setList(thirdAliDrugsListGjk); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return ResultVOUtils.success(pageSimpleResponse); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         // 查询国家库药品信息 并且要插入到多玛融合表
 |  |  |  |         // 查询国家库药品信息 并且要插入到多玛融合表
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -162,6 +171,7 @@ public class AlihealthBusController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         map.put("page", alihealthThirdAliDrugInsertReqeust.getPage()); |  |  |  |         map.put("page", alihealthThirdAliDrugInsertReqeust.getPage()); | 
			
		
	
		
		
			
				
					
					|  |  |  |         map.put("limit", alihealthThirdAliDrugInsertReqeust.getLimit()); |  |  |  |         map.put("limit", alihealthThirdAliDrugInsertReqeust.getLimit()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         map.put("nameCodeIn", alihealthThirdAliDrugInsertReqeust.getNameCodeIn()); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         if(alihealthThirdAliDrugInsertReqeust.getGjkSwitch()){ |  |  |  |         if(alihealthThirdAliDrugInsertReqeust.getGjkSwitch()){ | 
			
		
	
	
		
		
			
				
					|  |  | @ -175,6 +185,12 @@ public class AlihealthBusController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 ) { |  |  |  |                 ) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     // 查询国家库是否有值 有值直接返回没值查询阿里接口
 |  |  |  |                     // 查询国家库是否有值 有值直接返回没值查询阿里接口
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                     thirdAliDrugsListGjk = udiDlDeviceResponse.getData().getList(); |  |  |  |                     thirdAliDrugsListGjk = udiDlDeviceResponse.getData().getList(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     if(thirdAliDrugsListGjk.size() == udiDlDeviceResponse.getData().getTotal()){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                         thirdAliDrugsListGjk = PaginationUtil.getPage(thirdAliDrugsListGjk, alihealthThirdAliDrugInsertReqeust.getPage() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                 , alihealthThirdAliDrugInsertReqeust.getLimit()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     pageSimpleResponse.setList(thirdAliDrugsListGjk); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     pageSimpleResponse.setTotal(Long.valueOf(udiDlDeviceResponse.getData().getTotal())); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |             } catch (Exception e) { |  |  |  |             } catch (Exception e) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 log.error("国家库===查询药品信息===出现错误===" + e.getMessage()); |  |  |  |                 log.error("国家库===查询药品信息===出现错误===" + e.getMessage()); | 
			
		
	
	
		
		
			
				
					|  |  | @ -182,38 +198,38 @@ public class AlihealthBusController extends BaseController { | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (thirdAliDrugsListGjk != null && thirdAliDrugsListGjk.size() > 0) { |  |  |  | //        if (thirdAliDrugsListGjk != null && thirdAliDrugsListGjk.size() > 0) {
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | //
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         } else { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //            BaseResponse<List<ThirdAliDrug>> baseResponse = alihealthUtils.thirdAliDrugInsertAll(alihealthThirdAliDrugInsertReqeust);
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //            if (baseResponse.getCode() == 20000) {
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //                thirdAliDrugsListGjk = baseResponse.getData();
 |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | //        } else {
 |  |  |  | //        } else {
 | 
			
		
	
		
		
			
				
					
					|  |  |  | //                log.error("阿里接口未查到产品信息===" + baseResponse.getMessage());
 |  |  |  | ////            BaseResponse<List<ThirdAliDrug>> baseResponse = alihealthUtils.thirdAliDrugInsertAll(alihealthThirdAliDrugInsertReqeust);
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //                return ResultVOUtils.error("阿里接口未查到产品信息===" + baseResponse.getMessage());
 |  |  |  | ////            if (baseResponse.getCode() == 20000) {
 | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | ////                thirdAliDrugsListGjk = baseResponse.getData();
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | ////            } else {
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | ////                log.error("阿里接口未查到产品信息===" + baseResponse.getMessage());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | ////                return ResultVOUtils.error("阿里接口未查到产品信息===" + baseResponse.getMessage());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | ////
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | ////            }
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | ////            // 上传到国家库
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | ////            try {
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | ////                Map mapNew = new HashMap();
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | ////                mapNew.put("list", thirdAliDrugsListGjk);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | ////                String response = HttpUtil.post(udiUrl + "/udiwms/aliDrug/addThirdAliDrug", JSONUtil.toJsonStr(mapNew));
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | ////                BaseResponse baseResponseAdd = JSONUtil.toBean(response, BaseResponse.class);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | ////                log.info("成功上传国家库阿里产品数据");
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | ////            } catch (Exception e) {
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | ////
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | ////                log.error("国家库上传阿里产品访问出现错误===" + e.getMessage());
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | ////            }
 | 
			
		
	
		
		
			
				
					
					|  |  |  | //
 |  |  |  | //
 | 
			
		
	
		
		
			
				
					
					|  |  |  | //        }
 |  |  |  | //        }
 | 
			
		
	
		
		
			
				
					
					|  |  |  | //            // 上传到国家库
 |  |  |  | //        // 上传多玛关系于处理规则在插入到融合表
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //            try {
 |  |  |  | //        if(ybDrug!= null && StringUtils.isNotEmpty(ybDrug.getGoodsCode())
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //                Map mapNew = new HashMap();
 |  |  |  | //        ){
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //                mapNew.put("list", thirdAliDrugsListGjk);
 |  |  |  | //            // 规则匹配
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //                String response = HttpUtil.post(udiUrl + "/udiwms/aliDrug/addThirdAliDrug", JSONUtil.toJsonStr(mapNew));
 |  |  |  | //            thirdAliDrugsListGjk  = udiContrastService.disposeYbDrugList(thirdAliDrugsListGjk,ybDrug,alihealthThirdAliDrugInsertReqeust.getNameCodeIn());
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | //                BaseResponse baseResponseAdd = JSONUtil.toBean(response, BaseResponse.class);
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //                log.info("成功上传国家库阿里产品数据");
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //            } catch (Exception e) {
 |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | //
 |  |  |  | //
 | 
			
		
	
		
		
			
				
					
					|  |  |  | //                log.error("国家库上传阿里产品访问出现错误===" + e.getMessage());
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | //        }
 |  |  |  | //        }
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |         return ResultVOUtils.success(pageSimpleResponse); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         // 上传多玛关系于处理规则在插入到融合表
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         if(ybDrug!= null && StringUtils.isNotEmpty(ybDrug.getGoodsCode()) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         ){ |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             // 规则匹配
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             thirdAliDrugsListGjk  = udiContrastService.disposeYbDrugList(thirdAliDrugsListGjk,ybDrug,alihealthThirdAliDrugInsertReqeust.getNameCodeIn()); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         return ResultVOUtils.success(thirdAliDrugsListGjk); |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | //                        udiProductService.insertUdiInfo(udiProductEntity);
 |  |  |  | //                        udiProductService.insertUdiInfo(udiProductEntity);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |