选入药品层级带到基本信息去

dev_unify
qiuyt 3 months ago
parent b552020caa
commit 668a1e768d

@ -377,8 +377,8 @@ public class UdiContrastController {
@AuthRuleAnnotation("")
@PostMapping("/udi/udirel/updateLevelDrugAli")
public BaseResponse updateLevelDrugAli(@RequestBody ThirdAliDrugRequest thirdAliDrug) {
udiProductService.saveOrUpadateLevelDrugAli(thirdAliDrug);
return ResultVOUtils.success("更新成功");
;
return udiProductService.saveOrUpadateLevelDrugAli(thirdAliDrug);
}
@AuthRuleAnnotation("")

@ -97,7 +97,7 @@ public class TestCodeController {
alihealthThirdAliDrugInsertReqeust.setErpId("123");
alihealthThirdAliDrugInsertReqeust.setAppSecret("5231c601505706a9d49823c3dfe2cb01");
AlihealthKytDrugrescodeReqeust alihealthKytDrugrescodeReqeust = new AlihealthKytDrugrescodeReqeust();
alihealthKytDrugrescodeReqeust.setPhysic_name("苯巴比妥片");
alihealthKytDrugrescodeReqeust.setPhysic_name("复方黄柏液涂剂");
// alihealthKytDrugrescodeReqeust.setApproval_licence_no();
// alihealthKytDrugrescodeReqeust.setStart_date();
// alihealthKytDrugrescodeReqeust.setEnd_date();
@ -110,24 +110,7 @@ public class TestCodeController {
alihealthKytDrugrescodeReqeust.setRef_ent_id("ef99b78bd9c54c1284f813149c858fb0");
alihealthThirdAliDrugInsertReqeust.setAlihealthKytDrugrescodeReqeust(alihealthKytDrugrescodeReqeust);
BaseResponse<List<ThirdAliDrug>> baseResponse = alihealthUtils.thirdAliDrugInsertAll(alihealthThirdAliDrugInsertReqeust);
if (baseResponse.getCode() == 20000) {
List<ThirdAliDrug> list = baseResponse.getData();
if (list != null && list.size() > 0) {
for (ThirdAliDrug thirdAliDrug : list) {
ThirdAliDrug thirdAliDrugNew = thirdAliDrugService.getOne(new QueryWrapper<ThirdAliDrug>().eq("nameCode", thirdAliDrug.getNameCode())
.last("limit 1")
);
if (Objects.isNull(thirdAliDrugNew)) {
thirdAliDrugService.save(thirdAliDrug);
} else {
thirdAliDrugService.update(thirdAliDrug, new QueryWrapper<ThirdAliDrug>().eq("nameCode", thirdAliDrug.getNameCode()));
}
}
}
}
return baseResponse;
// return alihealthUtils.thirdAliDrugInsert(alihealthThirdAliDrugInsertReqeust,true);
}

@ -1,5 +1,6 @@
package com.glxp.api.service.basic;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.entity.basic.UdiProductEntity;
import com.glxp.api.entity.basic.UdiRelevanceEntity;
import com.glxp.api.req.basic.AddProductRequest;
@ -86,6 +87,6 @@ public interface UdiProductService {
UdiProductEntity findProductByNameCode(String nameCode);
void saveOrUpadateLevelDrugAli(ThirdAliDrugRequest thirdAliDrugRequest);
BaseResponse saveOrUpadateLevelDrugAli(ThirdAliDrugRequest thirdAliDrugRequest);
}

@ -5,6 +5,8 @@ import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.dao.basic.UdiProductDao;
import com.glxp.api.dao.basic.UdiRelevanceDao;
@ -22,15 +24,18 @@ import com.glxp.api.res.basic.UdiRelevanceResponse;
import com.glxp.api.service.auth.CustomerService;
import com.glxp.api.service.basic.UdiContrastService;
import com.glxp.api.service.basic.UdiProductService;
import com.glxp.api.service.basic.UdiRelevanceService;
import com.glxp.api.service.thrsys.ThirdAliDrugService;
import com.glxp.api.service.thrsys.ThrProductsService;
import com.glxp.api.service.thrsys.YbDrugService;
import com.glxp.api.util.CustomUtil;
import com.glxp.api.util.DimaUtil;
import com.glxp.api.util.IntUtil;
import com.glxp.api.util.PinyinUtils;
import com.glxp.api.util.alihealth.CopyUtils;
import com.glxp.api.util.udi.FilterUdiUtils;
import com.glxp.api.util.udi.UdiInfoUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.jfree.util.Log;
@ -47,6 +52,7 @@ import java.util.stream.Collectors;
@Service
@Transactional(rollbackFor = Exception.class)
@Slf4j
public class UdiProductServiceImpl implements UdiProductService {
@Resource
@ -618,13 +624,15 @@ public class UdiProductServiceImpl implements UdiProductService {
private YbDrugService ybDrugService;
@Resource
private UdiContrastService udiContrastService;
@Resource
private UdiRelevanceService udiRelevanceService;
@Override
public void saveOrUpadateLevelDrugAli(ThirdAliDrugRequest thirdAliDrugRequest) {
public BaseResponse saveOrUpadateLevelDrugAli(ThirdAliDrugRequest thirdAliDrugRequest) {
Integer detailSort=0;
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())
@ -759,11 +767,24 @@ public class UdiProductServiceImpl implements UdiProductService {
udiProductEntity.setId(IdUtil.getSnowflakeNextId());
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())
);
return ResultVOUtils.success(detailSort);
}
}
// }
return ResultVOUtils.error("获取错误");
}

Loading…
Cancel
Save