Merge remote-tracking branch 'origin/dev_fifo_z' into dev_fifo_z

dev_unify
yewj 6 months ago
commit 52b59b52f4

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

@ -21,6 +21,7 @@ import com.glxp.api.res.alihealth.AlihealthKytSinglerelationResponse;
import com.glxp.api.service.auth.AuthAliUserService;
import com.glxp.api.service.thrsys.*;
import com.glxp.api.util.*;
import com.glxp.api.util.alihealth.CopyUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.xmlbeans.impl.xb.xsdschema.Public;
import org.aspectj.weaver.ast.Var;
@ -354,6 +355,8 @@ public class UdiContrastService {
udiProductEntity.setPrepnUnit(ybDrug.getRealityMedicinemodel());
}else {
udiProductEntity.setCpmctymc(thrProductsEntity.getName());
}
if (StrUtil.isEmpty(udiProductEntity.getZczbhhzbapzbh()) || StrUtil.isEmpty(udiProductEntity.getCpmctymc())) {
return;
@ -362,6 +365,8 @@ public class UdiContrastService {
new QueryWrapper<ThirdAliDrug>()
.eq(StringUtils.isNotEmpty(udiProductEntity.getCpmctymc()), "cpmctymc", udiProductEntity.getCpmctymc())
.eq(StringUtils.isNotEmpty(udiProductEntity.getZczbhhzbapzbh()), "approvalNum", udiProductEntity.getZczbhhzbapzbh())
.eq(StringUtils.isNotEmpty(udiProductEntity.getManufactory()), "manufacturer", udiProductEntity.getManufactory())
);
if (CollUtil.isNotEmpty(thirdAliDrugList)) {
@ -370,6 +375,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());
@ -388,6 +394,8 @@ public class UdiContrastService {
new QueryWrapper<ThirdAliDrug>()
.eq(StringUtils.isNotEmpty(udiProductEntity.getCpmctymc()), "cpmctymc", udiProductEntity.getCpmctymc())
.eq(StringUtils.isNotEmpty(udiProductEntity.getZczbhhzbapzbh()), "approvalNum", udiProductEntity.getZczbhhzbapzbh())
.eq(StringUtils.isNotEmpty(udiProductEntity.getManufactory()), "manufacturer", udiProductEntity.getManufactory())
);
} else {
log.info("供应商平台获取阿里和国家库码段信息===未查到产品信息");
@ -423,27 +431,26 @@ public class UdiContrastService {
udiProductEntity.setNameCode(thirdAliDrug.getNameCode());
// 数据处理
udiProductEntity.setPrepnSpec(thirdAliDrug.getFormSpec());
udiProductEntity.setZczbhhzbapzbh(thirdAliDrug.getApprovalNum());
udiProductEntity.setCpmctymc(thirdAliDrug.getCpmctymc());
udiProductEntity.setSpmc(thirdAliDrug.getSpmc());
udiProductEntity.setPrepnSpec(CopyUtils.copyNullStr(udiProductEntity.getPrepnSpec(),thirdAliDrug.getFormSpec()));
udiProductEntity.setZczbhhzbapzbh(CopyUtils.copyNullStr(udiProductEntity.getZczbhhzbapzbh(),thirdAliDrug.getApprovalNum()));
udiProductEntity.setCpmctymc(CopyUtils.copyNullStr(udiProductEntity.getCpmctymc(),thirdAliDrug.getCpmctymc()));
udiProductEntity.setSpmc(CopyUtils.copyNullStr(udiProductEntity.getSpmc(),thirdAliDrug.getSpmc()));
udiProductEntity.setBzgg(thirdAliDrug.getBzgg());
udiProductEntity.setBzgg(CopyUtils.copyNullStr(udiProductEntity.getBzgg(),thirdAliDrug.getBzgg()));
udiProductEntity.setPackRatio(CopyUtils.copyNullStr(udiProductEntity.getPackRatio(),thirdAliDrug.getPackRatio()));
// udiProductEntity.setMatrial(ybDrug.getMaterialName());
// udiProductEntity.setPackMatrial(ybDrug.getMaterialName());
// udiProductEntity.setMedicareType(setMedicareType(ybDrug.getProductInsuranceType()));
//最小产品单位
udiProductEntity.setPackUnit(thirdAliDrug.getPackUnitName());
udiProductEntity.setPackUnit(CopyUtils.copyNullStr(udiProductEntity.getPackUnit(),thirdAliDrug.getPackUnitName()));
//设置最小产品数量
// udiProductEntity.setBhxjsl(ybDrug.getFactor());
//设置包装级别
// udiProductEntity.setPackLevel(1 + "");
//生产厂家
udiProductEntity.setManufactory(thirdAliDrug.getManufacturer());
// udiProductEntity.setManufactory(thirdAliDrug.getManufacturer());
//商品条码 essentialDrugMarkName sptm
// udiProductEntity.setSptm(ybDrug.getBusinessLicense());
udiProductEntity.setPrepnUnit(thirdAliDrug.getPrepnUnitName());
udiProductEntity.setPackRatio(thirdAliDrug.getPackRatio());
udiProductEntity.setPrepnUnit(CopyUtils.copyNullStr(udiProductEntity.getPrepnUnit(),thirdAliDrug.getPrepnUnitName()));
List<Integer> integers = new ArrayList<>();
if (StrUtil.isNotEmpty(thirdAliDrug.getPackRatio())) {

@ -1882,6 +1882,7 @@ public class HeartService {
// basicProductsDao.replaceBatchs(productsList, 1000);
}
if (CollectionUtil.isNotEmpty(relevanceList)) {
relevanceDao.replaceBatch(relevanceList);
}
if (CollectionUtil.isNotEmpty(corpList)) {
corpDao.replaceBatch(corpList);

@ -0,0 +1,66 @@
package com.glxp.api.util.alihealth;
import com.glxp.api.util.StringUtils;
import java.lang.reflect.Field;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
public class CopyUtils {
// 第一个参数为空才复制
public static String copyNullStr(String str,String strNew){
return StringUtils.isNotEmpty(str) ? str : strNew;
}
public static void compatibleCopy(Map<String,Object> map, Object target) {
try {
Class targetClass = target.getClass();//得到对象的Class
Field[] targetFields = targetClass.getDeclaredFields();//得到Class对象的所有属性
Set keySet =map.keySet(); //获取到所有值
for(Object key : keySet ) {
Object value = map.get(key);
for (Field targetField : targetFields) {
targetField.setAccessible(true);
String targetName = targetField.getName();//目标对象的属性名
if (targetName.equals(snakeToCamel((String) key)) && !Objects.isNull(value)) {
targetField.set(target, value);
}
}
}
} catch (Exception e) {
System.out.println("错误==="+e);
e.printStackTrace();
// BeanUtil.copyProperties(source, target);
}
}
public static String snakeToCamel(String snakeCase) {
// 将字符串按下划线分割
String[] parts = snakeCase.split("_");
StringBuilder camelCase = new StringBuilder();
for (String part : parts) {
if (camelCase.length() == 0) {
// 第一个单词首字母小写
camelCase.append(part.toLowerCase());
} else {
// 其他单词首字母大写
camelCase.append(part.substring(0, 1).toUpperCase())
.append(part.substring(1).toLowerCase());
}
}
return camelCase.toString();
}
}
Loading…
Cancel
Save