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

v3
qiuyt 3 months ago
parent afdbcea36f
commit d0109a4969

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

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

@ -100,6 +100,12 @@
<if test="bzgg != '' and bzgg != null"> <if test="bzgg != '' and bzgg != null">
AND bzgg LIKE concat('%', #{bzgg}, '%') AND bzgg LIKE concat('%', #{bzgg}, '%')
</if> </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> </where>
</select> </select>

Loading…
Cancel
Save