选入药品加上生产厂家对照查不到就改括号

dev_unify
qiuyt 4 months ago
parent 3eddd3676a
commit 1ac430e083

@ -7,6 +7,7 @@ import lombok.Data;
public class AlihealthThirdAliDrugInsertReqeust {
private String erpId;
private String appSecret;
private String manufactory;
private AlihealthKytDrugrescodeReqeust alihealthKytDrugrescodeReqeust;
}

@ -22,7 +22,22 @@ public class AlihealthKytDrugrescodeResponse extends AlihealthKytCommonParameter
private JSONArray drug_table_dto;
private Integer page;
private Integer page_size;
public boolean judgeCall(String manufactory){
List<JSONObject> jsonArray = (List) this.getDrug_table_dto();
boolean bo = false;
if (jsonArray != null && jsonArray.size() > 0) {
for (JSONObject jsonObject : jsonArray) {
String entName = jsonObject.getStr("ent_name");
if(manufactory.equals(entName)){
bo = true;
}
}
}
if(org.apache.commons.lang.StringUtils.isNotEmpty(this.getMsg_info()) && this.getMsg_info().equals("调用成功") && bo){
return true;
}
return false;
}
public AlihealthKytDrugrescodeResponse(String json) {
// 初始化请求的值
cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(json);

@ -12,7 +12,6 @@ import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.dao.basic.UdiRelevanceDao;
import com.glxp.api.entity.auth.AuthAliUser;
import com.glxp.api.entity.auth.CustomerInfoEntity;
import com.glxp.api.entity.basic.UdiProductEntity;
import com.glxp.api.entity.basic.UdiRelevanceEntity;
import com.glxp.api.entity.thrsys.*;
@ -43,7 +42,6 @@ import org.jfree.util.Log;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
@ -366,6 +364,7 @@ public class UdiContrastService {
AlihealthThirdAliDrugInsertReqeust alihealthThirdAliDrugInsertReqeust = new AlihealthThirdAliDrugInsertReqeust();
alihealthThirdAliDrugInsertReqeust.setErpId(authAliUser.getErpid());
alihealthThirdAliDrugInsertReqeust.setAppSecret(authAliUser.getAppsecret());
alihealthThirdAliDrugInsertReqeust.setManufactory(udiProductEntity.getManufactory());
AlihealthKytDrugrescodeReqeust alihealthKytDrugrescodeReqeust = new AlihealthKytDrugrescodeReqeust();
alihealthKytDrugrescodeReqeust.setPhysic_name(udiProductEntity.getCpmctymc());
alihealthKytDrugrescodeReqeust.setApproval_licence_no(udiProductEntity.getZczbhhzbapzbh());
@ -439,7 +438,7 @@ public class UdiContrastService {
//设置最小产品数量
// udiProductEntity.setBhxjsl(ybDrug.getFactor());
//生产厂家
udiProductEntity.setManufactory(thirdAliDrug.getManufacturer());
// udiProductEntity.setManufactory(thirdAliDrug.getManufacturer());
//商品条码 essentialDrugMarkName sptm
// udiProductEntity.setSptm(ybDrug.getBusinessLicense());
udiProductEntity.setPrepnUnit(thirdAliDrug.getPrepnUnitName());

@ -2,6 +2,7 @@ package com.glxp.api.util.alihealth;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONObject;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.entity.thrsys.ThirdAliDrug;
@ -131,7 +132,9 @@ public class AlihealthUtils {
} else {
return ResultVOUtils.error("阿里健康接口调用失败===用户找不到或者key和秘钥为空");
}
if (alihealthKytDrugrescodeResponse.judgeCall()) {
if (alihealthKytDrugrescodeResponse.judgeCall(alihealthThirdAliDrugInsertReqeust.getManufactory()) ) {
List<ThirdAliDrug> list = alihealthKytDrugrescodeResponse.disposeThirdAliDrugList(alihealthThirdAliDrugInsertReqeust.getErpId());
return ResultVOUtils.success(list);
} else {

Loading…
Cancel
Save