多码融合表增加字段和逻辑

v3
qiuyt 3 months ago
parent 4e328ffcfe
commit 378174251d

@ -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<ThirdAliDrug> list = thirdAliDrugService.filterList(thirdAliDrug);
if (CollUtil.isEmpty(list)){
ThirdAliDrugAddRequest thirdAliDrugAddRequest = new ThirdAliDrugAddRequest();
List<ThirdAliDrug> add = null;
AlihealthThirdAliDrugInsertReqeust request = new AlihealthThirdAliDrugInsertReqeust();
AlihealthKytDrugrescodeReqeust alihealthKytDrugrescodeReqeust = new AlihealthKytDrugrescodeReqeust();
alihealthKytDrugrescodeReqeust.setPhysic_name(thirdAliDrug.getCpmctymc());
@ -69,17 +70,23 @@ public class ThirdAliDrugController {
try {
BaseResponse<List<ThirdAliDrug>> 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<ThirdAliDrug> 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<ThirdAliDrug> pageInfo = new PageInfo<>(list);

@ -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;

@ -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;
}

@ -32,12 +32,12 @@ public class CodeRelServiceImpl extends ServiceImpl<CodeRelMapper, CodeRel> {
public void updateBatchByCodeRel(List<CodeRel> paramList) {
for (int i = 0; i < paramList.size(); i++) {
if(i == 0){
CodeRel param = paramList.get(i);
this.remove(
new QueryWrapper<CodeRel>().eq("ybbm",param.getYbbm())
);
}
// if(i == 0){
// CodeRel param = paramList.get(i);
// this.remove(
// new QueryWrapper<CodeRel>().eq("ybbm",param.getYbbm())
// );
// }
CodeRel param = paramList.get(i);
if ( param == null ||

Loading…
Cancel
Save