From 378174251dbb99e9cd65240a8c038c92344825f1 Mon Sep 17 00:00:00 2001 From: qiuyt Date: Thu, 9 Jan 2025 14:18:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E7=A0=81=E8=9E=8D=E5=90=88=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=97=E6=AE=B5=E5=92=8C=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../collect/ThirdAliDrugController.java | 17 +++- .../controller/udchs/CodeRelController.java | 1 + .../udidl/admin/dto/sys/CodeRelRequest.java | 93 +++++++++++++++++++ .../udchs/impl/CodeRelServiceImpl.java | 12 +-- 4 files changed, 112 insertions(+), 11 deletions(-) create mode 100644 src/main/java/com/glxp/udidl/admin/dto/sys/CodeRelRequest.java diff --git a/src/main/java/com/glxp/udidl/admin/controller/collect/ThirdAliDrugController.java b/src/main/java/com/glxp/udidl/admin/controller/collect/ThirdAliDrugController.java index 1189062..8332fd6 100644 --- a/src/main/java/com/glxp/udidl/admin/controller/collect/ThirdAliDrugController.java +++ b/src/main/java/com/glxp/udidl/admin/controller/collect/ThirdAliDrugController.java @@ -1,11 +1,13 @@ package com.glxp.udidl.admin.controller.collect; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.thread.ThreadUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.github.pagehelper.PageInfo; import com.glxp.udidl.admin.entity.collect.ThirdAliDrug; import com.glxp.udidl.admin.enums.ResultEnum; +import com.glxp.udidl.admin.exception.JsonException; import com.glxp.udidl.admin.req.alihealth.AlihealthKytDrugrescodeReqeust; import com.glxp.udidl.admin.req.alihealth.local.AlihealthThirdAliDrugInsertReqeust; import com.glxp.udidl.admin.req.collect.ThirdAliDrugAddRequest; @@ -56,7 +58,6 @@ public class ThirdAliDrugController { List list = thirdAliDrugService.filterList(thirdAliDrug); if (CollUtil.isEmpty(list)){ ThirdAliDrugAddRequest thirdAliDrugAddRequest = new ThirdAliDrugAddRequest(); - List add = null; AlihealthThirdAliDrugInsertReqeust request = new AlihealthThirdAliDrugInsertReqeust(); AlihealthKytDrugrescodeReqeust alihealthKytDrugrescodeReqeust = new AlihealthKytDrugrescodeReqeust(); alihealthKytDrugrescodeReqeust.setPhysic_name(thirdAliDrug.getCpmctymc()); @@ -69,17 +70,23 @@ public class ThirdAliDrugController { try { BaseResponse> baseResponse = alihealthUtils.thirdAliDrugInsertAll(request); if(baseResponse.getCode() == 20000){ - add = baseResponse.getData(); + list = baseResponse.getData(); }else { log.error("阿里访问失败==="+baseResponse.getMessage()); } }catch (Exception e){ log.error("阿里访问失败==="+e.getMessage()); } + List finalList = list; + ThreadUtil.execAsync(() -> { + try { + thirdAliDrugAddRequest.setList(finalList); + thirdAliDrugService.addThirdAliDrug(thirdAliDrugAddRequest); + } catch (Exception e) { + log.error("异步更新阿里药品数据错误==="+e.getMessage()); + } + }); - thirdAliDrugAddRequest.setList(add); - thirdAliDrugService.addThirdAliDrug(thirdAliDrugAddRequest); - list = thirdAliDrugService.filterList(thirdAliDrug); } PageInfo pageInfo = new PageInfo<>(list); diff --git a/src/main/java/com/glxp/udidl/admin/controller/udchs/CodeRelController.java b/src/main/java/com/glxp/udidl/admin/controller/udchs/CodeRelController.java index 64bc581..bf8c993 100644 --- a/src/main/java/com/glxp/udidl/admin/controller/udchs/CodeRelController.java +++ b/src/main/java/com/glxp/udidl/admin/controller/udchs/CodeRelController.java @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.glxp.udidl.admin.dto.sys.CodeRelRequest; import com.glxp.udidl.admin.dto.udchs.BaseParam; import com.glxp.udidl.admin.entity.chs.CodeRel; import com.glxp.udidl.admin.entity.chs.YbDrug; diff --git a/src/main/java/com/glxp/udidl/admin/dto/sys/CodeRelRequest.java b/src/main/java/com/glxp/udidl/admin/dto/sys/CodeRelRequest.java new file mode 100644 index 0000000..f480f5f --- /dev/null +++ b/src/main/java/com/glxp/udidl/admin/dto/sys/CodeRelRequest.java @@ -0,0 +1,93 @@ +package com.glxp.udidl.admin.dto.sys; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +import java.util.Date; +@Data +public class CodeRelRequest { + @TableId(type = IdType.AUTO) + public Integer id; + + /** + * 器械最小销售产品标识 + */ + @TableField(value = "diNameCode") + public String diNameCode; + + /** + * 阿里药品标识码 + */ + @TableField(value = "drugCode") + public String drugCode; + + /** + * 医保编码 + */ + @TableField(value = "ybbm") + public String ybbm; + + /** + * 阳光采购平台编码 + */ + @TableField(value = "ycCode") + public String ycCode; + + /** + * 商品条码 + */ + @TableField(value = "sptm") + public String sptm; + + /** + * 药品本位码 + */ + @TableField(value = "ypbwm") + public String ypbwm; + + /** + * 统一社会信用号 + */ + @TableField(value = "tyshxyh") + public String tyshxyh; + + /** + * 国家编码9码 + */ + @TableField(value = "gjbm") + public String gjbm; + + @TableField(value = "status") + public String status; + + @TableField(value = "updateTime") + public Date updateTime; + + @TableField(value = "createTime") + public Date createTime; + + @TableField(value = "fromType") + public Integer fromType; + /** + * 层级单位 + */ + @TableField(value = "packUnit") + public String packUnit; + /** + * 下级数量 + */ + @TableField(value = "bhxjsl") + public Integer bhxjsl; + /** + * 下级单位 + */ + @TableField(value = "xjdw") + public String xjdw; + /** + * 医保包装规格 + */ + @TableField(value = "ybBzgg") + public String ybBzgg; +} diff --git a/src/main/java/com/glxp/udidl/admin/service/udchs/impl/CodeRelServiceImpl.java b/src/main/java/com/glxp/udidl/admin/service/udchs/impl/CodeRelServiceImpl.java index 8ed47d0..e5fcf08 100644 --- a/src/main/java/com/glxp/udidl/admin/service/udchs/impl/CodeRelServiceImpl.java +++ b/src/main/java/com/glxp/udidl/admin/service/udchs/impl/CodeRelServiceImpl.java @@ -32,12 +32,12 @@ public class CodeRelServiceImpl extends ServiceImpl { public void updateBatchByCodeRel(List paramList) { for (int i = 0; i < paramList.size(); i++) { - if(i == 0){ - CodeRel param = paramList.get(i); - this.remove( - new QueryWrapper().eq("ybbm",param.getYbbm()) - ); - } +// if(i == 0){ +// CodeRel param = paramList.get(i); +// this.remove( +// new QueryWrapper().eq("ybbm",param.getYbbm()) +// ); +// } CodeRel param = paramList.get(i); if ( param == null ||