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

v3
qiuyt 3 months ago
parent afdbcea36f
commit d0109a4969

@ -60,36 +60,40 @@ public class ThirdAliDrugController {
}
List<ThirdAliDrug> list = thirdAliDrugService.filterList(thirdAliDrug);
if (CollUtil.isEmpty(list)){
ThirdAliDrugAddRequest thirdAliDrugAddRequest = new ThirdAliDrugAddRequest();
AlihealthThirdAliDrugInsertReqeust request = new AlihealthThirdAliDrugInsertReqeust();
AlihealthKytDrugrescodeReqeust alihealthKytDrugrescodeReqeust = new AlihealthKytDrugrescodeReqeust();
alihealthKytDrugrescodeReqeust.setPhysic_name(thirdAliDrug.getCpmctymc());
alihealthKytDrugrescodeReqeust.setApproval_licence_no(thirdAliDrug.getApprovalNum());
alihealthKytDrugrescodeReqeust.setEnt_name(thirdAliDrug.getManufacturer());
alihealthKytDrugrescodeReqeust.setPackage_spec(thirdAliDrug.getBzgg());
alihealthKytDrugrescodeReqeust.setPrepn_spec(thirdAliDrug.getFormSpec());
request.setAlihealthKytDrugrescodeReqeust(alihealthKytDrugrescodeReqeust);
try {
BaseResponse<List<ThirdAliDrug>> baseResponse = alihealthUtils.thirdAliDrugInsertAll(request);
if(baseResponse.getCode() == 20000){
list = baseResponse.getData();
}else {
log.error("阿里访问失败==="+baseResponse.getMessage());
}
}catch (Exception e){
log.error("阿里访问失败==="+e.getMessage());
}
List<ThirdAliDrug> finalList = list;
ThreadUtil.execAsync(() -> {
// 剔除当前选入的产品编码要给他删了再重新查一次判断 如果还是查不到就去查阿里
thirdAliDrug.setNameCodeIn(null);
List<ThirdAliDrug> listNew = thirdAliDrugService.filterList(thirdAliDrug);
if (CollUtil.isEmpty(listNew)){
ThirdAliDrugAddRequest thirdAliDrugAddRequest = new ThirdAliDrugAddRequest();
AlihealthThirdAliDrugInsertReqeust request = new AlihealthThirdAliDrugInsertReqeust();
AlihealthKytDrugrescodeReqeust alihealthKytDrugrescodeReqeust = new AlihealthKytDrugrescodeReqeust();
alihealthKytDrugrescodeReqeust.setPhysic_name(thirdAliDrug.getCpmctymc());
alihealthKytDrugrescodeReqeust.setApproval_licence_no(thirdAliDrug.getApprovalNum());
alihealthKytDrugrescodeReqeust.setEnt_name(thirdAliDrug.getManufacturer());
alihealthKytDrugrescodeReqeust.setPackage_spec(thirdAliDrug.getBzgg());
alihealthKytDrugrescodeReqeust.setPrepn_spec(thirdAliDrug.getFormSpec());
request.setAlihealthKytDrugrescodeReqeust(alihealthKytDrugrescodeReqeust);
try {
thirdAliDrugAddRequest.setList(finalList);
thirdAliDrugService.addThirdAliDrug(thirdAliDrugAddRequest);
} catch (Exception e) {
log.error("异步更新阿里药品数据错误==="+e.getMessage());
BaseResponse<List<ThirdAliDrug>> baseResponse = alihealthUtils.thirdAliDrugInsertAll(request);
if(baseResponse.getCode() == 20000){
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());
}
});
}
}
PageInfo<ThirdAliDrug> pageInfo = new PageInfo<>(list);

@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class ThirdAliDrugRequest extends ListPageRequest {
@ -108,5 +109,6 @@ public class ThirdAliDrugRequest extends ListPageRequest {
private String approvalNum;
private List<String> nameCodeIn;
}

@ -100,6 +100,12 @@
<if test="bzgg != '' and bzgg != null">
AND bzgg LIKE concat('%', #{bzgg}, '%')
</if>
<if test="nameCodeIn!=null and nameCodeIn.size()>0">
AND nameCode NOT IN
<foreach collection="nameCodeIn" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</where>
</select>

Loading…
Cancel
Save