|
|
|
@ -474,9 +474,9 @@ public class UdiProductServiceImpl implements UdiProductService {
|
|
|
|
|
// 上传多玛融合表
|
|
|
|
|
|
|
|
|
|
List<CodeRel> codeRelArrayList = new ArrayList<>();
|
|
|
|
|
if(StringUtils.isNotEmpty(updateLevelDrugRequest.getPackUnit())
|
|
|
|
|
|| !Objects.isNull(updateLevelDrugRequest.getBhxjsl()) || StringUtils.isNotEmpty(updateLevelDrugRequest.getXjdw())
|
|
|
|
|
){
|
|
|
|
|
if (StringUtils.isNotEmpty(updateLevelDrugRequest.getPackUnit())
|
|
|
|
|
|| !Objects.isNull(updateLevelDrugRequest.getBhxjsl()) || StringUtils.isNotEmpty(updateLevelDrugRequest.getXjdw())
|
|
|
|
|
) {
|
|
|
|
|
CodeRel codeRel = new CodeRel();
|
|
|
|
|
codeRel.setDrugCode(udiProductEntity1.getNameCode());
|
|
|
|
|
codeRel.setUpdateTime(new Date());
|
|
|
|
@ -673,192 +673,184 @@ public class UdiProductServiceImpl implements UdiProductService {
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse saveOrUpadateLevelDrugAli(ThirdAliDrugRequest thirdAliDrugRequest) {
|
|
|
|
|
Integer detailSort = 0;
|
|
|
|
|
ThirdAliDrug thirdAliDrugServiceOne = thirdAliDrugService.getOne(
|
|
|
|
|
new QueryWrapper<ThirdAliDrug>().eq("nameCode", thirdAliDrugRequest.getNameCodeRow()).last("limit 1")
|
|
|
|
|
);
|
|
|
|
|
// ThirdAliDrug thirdAliDrugServiceOne = thirdAliDrugService.getOne(
|
|
|
|
|
// new QueryWrapper<ThirdAliDrug>().eq("nameCode", thirdAliDrugRequest.getNameCodeRow()).last("limit 1")
|
|
|
|
|
// );
|
|
|
|
|
String str = "";
|
|
|
|
|
if (thirdAliDrugServiceOne != null) {
|
|
|
|
|
List<ThirdAliDrug> thirdAliDrugList = thirdAliDrugService.list(
|
|
|
|
|
new QueryWrapper<ThirdAliDrug>().eq(StringUtils.isNotBlank(thirdAliDrugServiceOne.getBzgg()), "bzgg", thirdAliDrugServiceOne.getBzgg())
|
|
|
|
|
.eq(StringUtils.isNotBlank(thirdAliDrugServiceOne.getPackRatio()), "packRatio", thirdAliDrugServiceOne.getPackRatio())
|
|
|
|
|
.like(StringUtils.isNotBlank(thirdAliDrugRequest.getCpmctymc()), "cpmctymc", thirdAliDrugRequest.getCpmctymc())
|
|
|
|
|
.like(StringUtils.isNotBlank(thirdAliDrugRequest.getManufacturer()), "manufacturer", thirdAliDrugRequest.getManufacturer())
|
|
|
|
|
.like(StringUtils.isNotBlank(thirdAliDrugRequest.getApprovalNum()), "approvalNum", thirdAliDrugRequest.getApprovalNum())
|
|
|
|
|
.like(StringUtils.isNotBlank(thirdAliDrugRequest.getFormSpec()), "formSpec", thirdAliDrugRequest.getFormSpec())
|
|
|
|
|
.like(StringUtils.isNotBlank(thirdAliDrugRequest.getBzgg()), "bzgg", thirdAliDrugRequest.getBzgg())
|
|
|
|
|
|
|
|
|
|
List<ThirdAliDrug> thirdAliDrugList = new ArrayList<>();
|
|
|
|
|
thirdAliDrugRequest.setNameCode(thirdAliDrugRequest.getNameCodeRow());
|
|
|
|
|
thirdAliDrugList = udiContrastService.optThirdAliDrug(thirdAliDrugRequest);
|
|
|
|
|
if (thirdAliDrugList != null && thirdAliDrugList.size() > 0) {
|
|
|
|
|
// 多码融合表拼接参数
|
|
|
|
|
List<CodeRel> codeRelArrayList = new ArrayList<>();
|
|
|
|
|
udiProductDao.delete(new QueryWrapper<UdiProductEntity>()
|
|
|
|
|
.eq("uuid", thirdAliDrugRequest.getUuid())
|
|
|
|
|
.isNull("nameCode")
|
|
|
|
|
);
|
|
|
|
|
if (thirdAliDrugList != null && thirdAliDrugList.size() > 0) {
|
|
|
|
|
// 多码融合表拼接参数
|
|
|
|
|
List<CodeRel> codeRelArrayList = new ArrayList<>();
|
|
|
|
|
udiProductDao.delete(new QueryWrapper<UdiProductEntity>()
|
|
|
|
|
.eq("uuid", thirdAliDrugRequest.getUuid())
|
|
|
|
|
.isNull("nameCode")
|
|
|
|
|
);
|
|
|
|
|
ThrProductsEntity thrProductsEntity = thrProductsService.selectByCode(thirdAliDrugRequest.getYbbm());
|
|
|
|
|
for (ThirdAliDrug thirdAliDrug : thirdAliDrugList) {
|
|
|
|
|
ThrInsDrugFeeRequest thrInsDrugFeeRequest = new ThrInsDrugFeeRequest();
|
|
|
|
|
thrInsDrugFeeRequest.setMedCatalogCode(thrProductsEntity.getYbbm());
|
|
|
|
|
YbDrugDetailFilterRequest ybHcflDetailFilterRequest = new YbDrugDetailFilterRequest();
|
|
|
|
|
ybHcflDetailFilterRequest.setLimit(1);
|
|
|
|
|
ybHcflDetailFilterRequest.setPage(1);
|
|
|
|
|
ybHcflDetailFilterRequest.setGoodsCode(thrProductsEntity.getYbbm());
|
|
|
|
|
List<YbDrug> list = ybDrugService.getList(ybHcflDetailFilterRequest);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UdiProductEntity udiProductEntity = new UdiProductEntity();
|
|
|
|
|
BeanUtils.copyProperties(thrProductsEntity, udiProductEntity);
|
|
|
|
|
YbDrug ybDrug = new YbDrug();
|
|
|
|
|
|
|
|
|
|
// 数据处理
|
|
|
|
|
udiProductEntity.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
ThrProductsEntity thrProductsEntity = thrProductsService.selectByCode(thirdAliDrugRequest.getYbbm());
|
|
|
|
|
for (ThirdAliDrug thirdAliDrug : thirdAliDrugList) {
|
|
|
|
|
ThrInsDrugFeeRequest thrInsDrugFeeRequest = new ThrInsDrugFeeRequest();
|
|
|
|
|
thrInsDrugFeeRequest.setMedCatalogCode(thrProductsEntity.getYbbm());
|
|
|
|
|
YbDrugDetailFilterRequest ybHcflDetailFilterRequest = new YbDrugDetailFilterRequest();
|
|
|
|
|
ybHcflDetailFilterRequest.setLimit(1);
|
|
|
|
|
ybHcflDetailFilterRequest.setPage(1);
|
|
|
|
|
ybHcflDetailFilterRequest.setGoodsCode(thrProductsEntity.getYbbm());
|
|
|
|
|
List<YbDrug> list = ybDrugService.getList(ybHcflDetailFilterRequest);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UdiProductEntity udiProductEntity = new UdiProductEntity();
|
|
|
|
|
BeanUtils.copyProperties(thrProductsEntity, udiProductEntity);
|
|
|
|
|
YbDrug ybDrug = new YbDrug();
|
|
|
|
|
|
|
|
|
|
// 数据处理
|
|
|
|
|
udiProductEntity.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
// udiProductEntity.setNameCode(thrProductsEntity.getCode());
|
|
|
|
|
|
|
|
|
|
udiProductEntity.setUuid(thirdAliDrugRequest.getUuid());
|
|
|
|
|
udiProductEntity.setDiType(1);
|
|
|
|
|
udiProductEntity.setScbssfbhph("是");
|
|
|
|
|
udiProductEntity.setScbssfbhscrq("是");
|
|
|
|
|
udiProductEntity.setScbssfbhsxrq("是");
|
|
|
|
|
udiProductEntity.setScbssfbhxlh("否");
|
|
|
|
|
udiProductEntity.setProductsType(thrProductsEntity.getProductType());
|
|
|
|
|
udiProductEntity.setRequireScanCode(1);
|
|
|
|
|
udiProductEntity.setMajorStatus(1);
|
|
|
|
|
udiProductEntity.setPhysicType(3);
|
|
|
|
|
//设置包装级别
|
|
|
|
|
udiProductEntity.setPackLevel(1 + "");
|
|
|
|
|
if (StrUtil.isEmpty(udiProductEntity.getPrice())) {
|
|
|
|
|
udiProductEntity.setPrice("0.00");
|
|
|
|
|
udiProductEntity.setUuid(thirdAliDrugRequest.getUuid());
|
|
|
|
|
udiProductEntity.setDiType(1);
|
|
|
|
|
udiProductEntity.setScbssfbhph("是");
|
|
|
|
|
udiProductEntity.setScbssfbhscrq("是");
|
|
|
|
|
udiProductEntity.setScbssfbhsxrq("是");
|
|
|
|
|
udiProductEntity.setScbssfbhxlh("否");
|
|
|
|
|
udiProductEntity.setProductsType(thrProductsEntity.getProductType());
|
|
|
|
|
udiProductEntity.setRequireScanCode(1);
|
|
|
|
|
udiProductEntity.setMajorStatus(1);
|
|
|
|
|
udiProductEntity.setPhysicType(3);
|
|
|
|
|
//设置包装级别
|
|
|
|
|
udiProductEntity.setPackLevel(1 + "");
|
|
|
|
|
if (StrUtil.isEmpty(udiProductEntity.getPrice())) {
|
|
|
|
|
udiProductEntity.setPrice("0.00");
|
|
|
|
|
}
|
|
|
|
|
udiProductEntity.setUpdateTime(new Date());
|
|
|
|
|
udiProductEntity = UdiInfoUtil.initUdiInfoEntity(udiProductEntity);
|
|
|
|
|
|
|
|
|
|
if (list != null && list.size() > 0) {
|
|
|
|
|
ybDrug = list.get(0);
|
|
|
|
|
// 数据做处理好查询阿里接口
|
|
|
|
|
if (ybDrug.getApprovalCode().contains("(")) {
|
|
|
|
|
String[] charArr = ybDrug.getRegisteredProductName().split("\\(");
|
|
|
|
|
ybDrug.setApprovalCode(charArr[0]);
|
|
|
|
|
}
|
|
|
|
|
udiProductEntity.setUpdateTime(new Date());
|
|
|
|
|
udiProductEntity = UdiInfoUtil.initUdiInfoEntity(udiProductEntity);
|
|
|
|
|
|
|
|
|
|
if (list != null && list.size() > 0) {
|
|
|
|
|
ybDrug = list.get(0);
|
|
|
|
|
// 数据做处理好查询阿里接口
|
|
|
|
|
if (ybDrug.getApprovalCode().contains("(")) {
|
|
|
|
|
String[] charArr = ybDrug.getRegisteredProductName().split("\\(");
|
|
|
|
|
ybDrug.setApprovalCode(charArr[0]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// udiProductEntity.setNameCode(thrProductsEntity.getCode());
|
|
|
|
|
udiProductEntity.setPrepnSpec(ybDrug.getRealityOutlook());
|
|
|
|
|
udiProductEntity.setZczbhhzbapzbh(ybDrug.getApprovalCode());
|
|
|
|
|
udiProductEntity.setCpmctymc(ybDrug.getRegisteredProductName());
|
|
|
|
|
udiProductEntity.setSpmc(ybDrug.getGoodsName());
|
|
|
|
|
|
|
|
|
|
udiProductEntity.setBzgg(String.valueOf(ybDrug.getFactor()) + ybDrug.getMinUnit() + "/" + ybDrug.getUnit());
|
|
|
|
|
udiProductEntity.setMatrial(ybDrug.getMaterialName());
|
|
|
|
|
udiProductEntity.setPackMatrial(ybDrug.getMaterialName());
|
|
|
|
|
udiProductEntity.setMedicareType(udiContrastService.setMedicareType(ybDrug.getProductInsuranceType()));
|
|
|
|
|
//最小产品单位
|
|
|
|
|
udiProductEntity.setPackUnit(ybDrug.getUnit());
|
|
|
|
|
//设置最小产品数量
|
|
|
|
|
udiProductEntity.setBhxjsl(ybDrug.getFactor());
|
|
|
|
|
udiProductEntity.setPrepnSpec(ybDrug.getRealityOutlook());
|
|
|
|
|
udiProductEntity.setZczbhhzbapzbh(ybDrug.getApprovalCode());
|
|
|
|
|
udiProductEntity.setCpmctymc(ybDrug.getRegisteredProductName());
|
|
|
|
|
udiProductEntity.setSpmc(ybDrug.getGoodsName());
|
|
|
|
|
|
|
|
|
|
udiProductEntity.setBzgg(String.valueOf(ybDrug.getFactor()) + ybDrug.getMinUnit() + "/" + ybDrug.getUnit());
|
|
|
|
|
udiProductEntity.setMatrial(ybDrug.getMaterialName());
|
|
|
|
|
udiProductEntity.setPackMatrial(ybDrug.getMaterialName());
|
|
|
|
|
udiProductEntity.setMedicareType(udiContrastService.setMedicareType(ybDrug.getProductInsuranceType()));
|
|
|
|
|
//最小产品单位
|
|
|
|
|
udiProductEntity.setPackUnit(ybDrug.getUnit());
|
|
|
|
|
//设置最小产品数量
|
|
|
|
|
udiProductEntity.setBhxjsl(ybDrug.getFactor());
|
|
|
|
|
|
|
|
|
|
//生产厂家
|
|
|
|
|
udiProductEntity.setManufactory(ybDrug.getCompanyNameSc());
|
|
|
|
|
//商品条码 essentialDrugMarkName sptm
|
|
|
|
|
//生产厂家
|
|
|
|
|
udiProductEntity.setManufactory(ybDrug.getCompanyNameSc());
|
|
|
|
|
//商品条码 essentialDrugMarkName sptm
|
|
|
|
|
// udiProductEntity.setSptm(ybDrug.getBusinessLicense());
|
|
|
|
|
udiProductEntity.setPrepnUnit(ybDrug.getRealityMedicinemodel());
|
|
|
|
|
} else {
|
|
|
|
|
udiProductEntity.setCpmctymc(thrProductsEntity.getName());
|
|
|
|
|
}
|
|
|
|
|
udiProductEntity.setPrepnUnit(ybDrug.getRealityMedicinemodel());
|
|
|
|
|
} else {
|
|
|
|
|
udiProductEntity.setCpmctymc(thrProductsEntity.getName());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
udiProductEntity.setNameCode(thirdAliDrug.getNameCode());
|
|
|
|
|
udiProductEntity.setNameCode(thirdAliDrug.getNameCode());
|
|
|
|
|
|
|
|
|
|
// 数据处理
|
|
|
|
|
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.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(CopyUtils.copyNullStr(udiProductEntity.getBzgg(), thirdAliDrug.getBzgg()));
|
|
|
|
|
udiProductEntity.setPackRatio(CopyUtils.copyNullStr(udiProductEntity.getPackRatio(), thirdAliDrug.getPackRatio()));
|
|
|
|
|
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(CopyUtils.copyNullStr(udiProductEntity.getPackUnit(), thirdAliDrug.getPackUnitName()));
|
|
|
|
|
//设置最小产品数量
|
|
|
|
|
//最小产品单位
|
|
|
|
|
udiProductEntity.setPackUnit(CopyUtils.copyNullStr(udiProductEntity.getPackUnit(), thirdAliDrug.getPackUnitName()));
|
|
|
|
|
//设置最小产品数量
|
|
|
|
|
// udiProductEntity.setBhxjsl(ybDrug.getFactor());
|
|
|
|
|
//生产厂家
|
|
|
|
|
//生产厂家
|
|
|
|
|
// udiProductEntity.setManufactory(thirdAliDrug.getManufacturer());
|
|
|
|
|
//商品条码 essentialDrugMarkName sptm
|
|
|
|
|
//商品条码 essentialDrugMarkName sptm
|
|
|
|
|
// udiProductEntity.setSptm(ybDrug.getBusinessLicense());
|
|
|
|
|
udiProductEntity.setPrepnUnit(CopyUtils.copyNullStr(udiProductEntity.getPrepnUnit(), thirdAliDrug.getPrepnUnitName()));
|
|
|
|
|
udiProductEntity.setPrepnUnit(CopyUtils.copyNullStr(udiProductEntity.getPrepnUnit(), thirdAliDrug.getPrepnUnitName()));
|
|
|
|
|
|
|
|
|
|
List<Integer> integers = new ArrayList<>();
|
|
|
|
|
if (StrUtil.isNotEmpty(thirdAliDrug.getPackRatio())) {
|
|
|
|
|
integers = DimaUtil.calculateLevels(thirdAliDrug.getPackRatio());
|
|
|
|
|
}
|
|
|
|
|
udiProductEntity.setPackLevel(thirdAliDrug.getPackLevel());
|
|
|
|
|
try {
|
|
|
|
|
udiProductEntity.setBhxjsl(integers.get(IntUtil.value(thirdAliDrug.getPackLevel()) - 1));
|
|
|
|
|
} catch (IndexOutOfBoundsException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
Log.error("计算包装级别出错" + thirdAliDrug.getPackLevel() + "---" + integers + "-----" + thirdAliDrug.toString());
|
|
|
|
|
udiProductEntity.setBhxjsl(0);
|
|
|
|
|
}
|
|
|
|
|
List<Integer> integers = new ArrayList<>();
|
|
|
|
|
if (StrUtil.isNotEmpty(thirdAliDrug.getPackRatio())) {
|
|
|
|
|
integers = DimaUtil.calculateLevels(thirdAliDrug.getPackRatio());
|
|
|
|
|
}
|
|
|
|
|
udiProductEntity.setPackLevel(thirdAliDrug.getPackLevel());
|
|
|
|
|
try {
|
|
|
|
|
udiProductEntity.setBhxjsl(integers.get(IntUtil.value(thirdAliDrug.getPackLevel()) - 1));
|
|
|
|
|
} catch (IndexOutOfBoundsException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
Log.error("计算包装级别出错" + thirdAliDrug.getPackLevel() + "---" + integers + "-----" + thirdAliDrug.toString());
|
|
|
|
|
udiProductEntity.setBhxjsl(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (IntUtil.value(udiProductEntity.getBhxjsl()) == 0) {
|
|
|
|
|
udiProductEntity.setBhxjsl(IntUtil.value(ybDrug.getFactor()));
|
|
|
|
|
}
|
|
|
|
|
if (IntUtil.value(thirdAliDrug.getPackLevel()) == 1) {
|
|
|
|
|
udiProductEntity.setXjdw(ybDrug.getMinUnit());
|
|
|
|
|
if (DimaUtil.trMinCount(thirdAliDrug.getBzgg()) != null) {
|
|
|
|
|
udiProductEntity.setBhxjsl(DimaUtil.trMinCount(thirdAliDrug.getBzgg()));
|
|
|
|
|
} else
|
|
|
|
|
udiProductEntity.setBhxjsl(ybDrug.getFactor());
|
|
|
|
|
} else {
|
|
|
|
|
udiProductEntity.setXjdw(thirdAliDrug.getPrepnUnitName());
|
|
|
|
|
if (IntUtil.value(udiProductEntity.getBhxjsl()) == 0) {
|
|
|
|
|
udiProductEntity.setBhxjsl(IntUtil.value(ybDrug.getFactor()));
|
|
|
|
|
}
|
|
|
|
|
if (IntUtil.value(thirdAliDrug.getPackLevel()) == 1) {
|
|
|
|
|
udiProductEntity.setXjdw(ybDrug.getMinUnit());
|
|
|
|
|
if (DimaUtil.trMinCount(thirdAliDrug.getBzgg()) != null) {
|
|
|
|
|
udiProductEntity.setBhxjsl(DimaUtil.trMinCount(thirdAliDrug.getBzgg()));
|
|
|
|
|
} else
|
|
|
|
|
udiProductEntity.setBhxjsl(ybDrug.getFactor());
|
|
|
|
|
} else {
|
|
|
|
|
udiProductEntity.setXjdw(thirdAliDrug.getPrepnUnitName());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (thirdAliDrug.getPackLevel() != null && !thirdAliDrug.getPackLevel().equals("0")) {
|
|
|
|
|
udiProductEntity.setDiType(IntUtil.value(thirdAliDrug.getPackLevel()) == 1 ? 1 : 4);
|
|
|
|
|
} else {
|
|
|
|
|
udiProductEntity.setDiType(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (thirdAliDrug.getPackLevel() != null && !thirdAliDrug.getPackLevel().equals("0")) {
|
|
|
|
|
udiProductEntity.setDiType(IntUtil.value(thirdAliDrug.getPackLevel()) == 1 ? 1 : 4);
|
|
|
|
|
} else {
|
|
|
|
|
udiProductEntity.setDiType(1);
|
|
|
|
|
}
|
|
|
|
|
// udiProductEntity.setPackUnit(thirdAliDrug.getPackUnitName());
|
|
|
|
|
|
|
|
|
|
udiProductEntity.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
|
|
|
|
|
udiProductEntity.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
|
|
|
|
|
CodeRel codeRel = new CodeRel();
|
|
|
|
|
codeRel.setDrugCode(thirdAliDrug.getNameCode());
|
|
|
|
|
codeRel.setUpdateTime(new Date());
|
|
|
|
|
codeRel.setYbbm(ybDrug.getGoodsCode());
|
|
|
|
|
codeRel.setPackUnit(udiProductEntity.getPackUnit());
|
|
|
|
|
codeRel.setBhxjsl(udiProductEntity.getBhxjsl());
|
|
|
|
|
codeRel.setXjdw(udiProductEntity.getXjdw());
|
|
|
|
|
codeRel.setYbBzgg(udiProductEntity.getBzgg());
|
|
|
|
|
codeRelArrayList.add(codeRel);
|
|
|
|
|
|
|
|
|
|
// 多码融合存在就以多码融合为准
|
|
|
|
|
udiProductEntity.setPackUnit(CopyUtils.copyNullStr(thirdAliDrug.getPackUnit(), udiProductEntity.getPackUnit()));
|
|
|
|
|
udiProductEntity.setBhxjsl(CopyUtils.copyNullNum(thirdAliDrug.getBhxjsl(), udiProductEntity.getBhxjsl()));
|
|
|
|
|
udiProductEntity.setXjdw(CopyUtils.copyNullStr(thirdAliDrug.getXjdw(), udiProductEntity.getXjdw()));
|
|
|
|
|
udiProductEntity.setBzgg(CopyUtils.copyNullStr(thirdAliDrug.getBzgg(), udiProductEntity.getBzgg()));
|
|
|
|
|
CodeRel codeRel = new CodeRel();
|
|
|
|
|
codeRel.setDrugCode(thirdAliDrug.getNameCode());
|
|
|
|
|
codeRel.setUpdateTime(new Date());
|
|
|
|
|
codeRel.setYbbm(ybDrug.getGoodsCode());
|
|
|
|
|
codeRel.setPackUnit(udiProductEntity.getPackUnit());
|
|
|
|
|
codeRel.setBhxjsl(udiProductEntity.getBhxjsl());
|
|
|
|
|
codeRel.setXjdw(udiProductEntity.getXjdw());
|
|
|
|
|
codeRel.setYbBzgg(udiProductEntity.getBzgg());
|
|
|
|
|
codeRelArrayList.add(codeRel);
|
|
|
|
|
|
|
|
|
|
udiProductService.insertUdiInfo(udiProductEntity);
|
|
|
|
|
}
|
|
|
|
|
// 多码融合存在就以多码融合为准
|
|
|
|
|
udiProductEntity.setPackUnit(CopyUtils.copyNullStr(thirdAliDrug.getPackUnit(), udiProductEntity.getPackUnit()));
|
|
|
|
|
udiProductEntity.setBhxjsl(CopyUtils.copyNullNum(thirdAliDrug.getBhxjsl(), udiProductEntity.getBhxjsl()));
|
|
|
|
|
udiProductEntity.setXjdw(CopyUtils.copyNullStr(thirdAliDrug.getXjdw(), udiProductEntity.getXjdw()));
|
|
|
|
|
udiProductEntity.setBzgg(CopyUtils.copyNullStr(thirdAliDrug.getBzgg(), udiProductEntity.getBzgg()));
|
|
|
|
|
|
|
|
|
|
UdiRelevanceEntity udiRelevanceEntity = new UdiRelevanceEntity();
|
|
|
|
|
try {
|
|
|
|
|
udiRelevanceEntity.setDetailSort(Integer.valueOf(thirdAliDrugList.get(0).getPhysicDetailType()));
|
|
|
|
|
detailSort = udiRelevanceEntity.getDetailSort();
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("明细分类转换出现错误" + e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
udiRelevanceService.update(udiRelevanceEntity, new QueryWrapper<UdiRelevanceEntity>()
|
|
|
|
|
.eq("uuid", thirdAliDrugRequest.getUuid())
|
|
|
|
|
);
|
|
|
|
|
udiContrastService.codeRelUpdateBatch(codeRelArrayList);
|
|
|
|
|
return ResultVOUtils.success(detailSort);
|
|
|
|
|
udiProductService.insertUdiInfo(udiProductEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UdiRelevanceEntity udiRelevanceEntity = new UdiRelevanceEntity();
|
|
|
|
|
try {
|
|
|
|
|
udiRelevanceEntity.setDetailSort(Integer.valueOf(thirdAliDrugList.get(0).getPhysicDetailType()));
|
|
|
|
|
detailSort = udiRelevanceEntity.getDetailSort();
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("明细分类转换出现错误" + e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
udiRelevanceService.update(udiRelevanceEntity, new QueryWrapper<UdiRelevanceEntity>()
|
|
|
|
|
.eq("uuid", thirdAliDrugRequest.getUuid())
|
|
|
|
|
);
|
|
|
|
|
udiContrastService.codeRelUpdateBatch(codeRelArrayList);
|
|
|
|
|
return ResultVOUtils.success(detailSort);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
return ResultVOUtils.error("获取错误");
|
|
|
|
|
|
|
|
|
|