选入药品逻辑优化

dev_drug
qiuyt 3 months ago
parent e7c63dbbed
commit 8733163392

@ -26,6 +26,7 @@ import com.glxp.api.req.alihealth.AlihealthKytDrugrescodeReqeust;
import com.glxp.api.req.alihealth.AlihealthKytGetentinfoReqeust;
import com.glxp.api.req.alihealth.local.AlihealthRelCodeInsertReqeust;
import com.glxp.api.req.alihealth.local.AlihealthThirdAliDrugInsertReqeust;
import com.glxp.api.req.thrsys.CodeRelRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.alihealth.AlihealthKytGetentinfoResponse;
import com.glxp.api.service.alihealth.AlihealthBusService;

@ -0,0 +1,95 @@
package com.glxp.api.req.thrsys;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.glxp.api.util.page.ListPageRequest;
import lombok.Data;
import java.util.Date;
@Data
public class CodeRelRequest extends ListPageRequest {
@TableId(type = IdType.AUTO)
public Integer id;
/**
*
*/
@TableField(value = "diNameCode")
public String diNameCode;
/**
*
*/
@TableField(value = "drugCode")
public String drugCode;
/**
*
*/
@TableField(value = "ybbm")
public String ybbm;
/**
*
*/
@TableField(value = "ycCode")
public String ycCode;
/**
*
*/
@TableField(value = "sptm")
public String sptm;
/**
*
*/
@TableField(value = "ypbwm")
public String ypbwm;
/**
*
*/
@TableField(value = "tyshxyh")
public String tyshxyh;
/**
* 9
*/
@TableField(value = "gjbm")
public String gjbm;
@TableField(value = "status")
public String status;
@TableField(value = "updateTime")
public Date updateTime;
@TableField(value = "createTime")
public Date createTime;
@TableField(value = "fromType")
public Integer fromType;
/**
*
*/
@TableField(value = "packUnit")
public String packUnit;
/**
*
*/
@TableField(value = "bhxjsl")
public Integer bhxjsl;
/**
*
*/
@TableField(value = "xjdw")
public String xjdw;
/**
*
*/
@TableField(value = "ybBzgg")
public String ybBzgg;
}

@ -304,7 +304,7 @@ public class UdiProductServiceImpl implements UdiProductService {
if (addProductRequest.getRelId() != null) {
udiRelevanceEntity = udiRelevanceDao.selectById(addProductRequest.getRelId());
List<UdiProductEntity> udiProductEntities = udiProductDao.findByUuids(udiRelevanceEntity.getUuid());
List<CodeRel> list = new ArrayList<>();
// List<CodeRel> list = new ArrayList<>();
for (UdiProductEntity udiProductEntity : udiProductEntities) {
addProductRequest.setNameCode(udiProductEntity.getNameCode());
addProductRequest.setId(udiProductEntity.getId());
@ -318,24 +318,24 @@ public class UdiProductServiceImpl implements UdiProductService {
if (IntUtil.value(udiProductEntity.getPackLevel()) == 1) {
udiProductEntity.setDiType(1);
}
CodeRel codeRel = new CodeRel();
codeRel.setDrugCode(udiProductEntity.getNameCode());
codeRel.setYbbm(udiProductEntity.getYbbm());
codeRel.setUpdateTime(new Date());
codeRel.setPackUnit(udiProductEntity.getPackUnit());
codeRel.setBhxjsl(udiProductEntity.getBhxjsl());
codeRel.setXjdw(udiProductEntity.getXjdw());
codeRel.setYbBzgg(udiProductEntity.getBzgg());
list.add(codeRel);
// CodeRel codeRel = new CodeRel();
// codeRel.setDrugCode(udiProductEntity.getNameCode());
// codeRel.setYbbm(udiProductEntity.getYbbm());
// codeRel.setUpdateTime(new Date());
// codeRel.setPackUnit(udiProductEntity.getPackUnit());
// codeRel.setBhxjsl(udiProductEntity.getBhxjsl());
// codeRel.setXjdw(udiProductEntity.getXjdw());
// codeRel.setYbBzgg(udiProductEntity.getBzgg());
// list.add(codeRel);
int i = udiProductDao.updateById(udiProductEntity);
if (i == 0) {
throw new JsonException(500, "更新错误");
}
}
if (list != null && list.size() > 0) {
// 上传多玛关系
udiContrastService.codeRelUpdateBatch(list);
}
// if (list != null && list.size() > 0) {
// // 上传多玛关系
// udiContrastService.codeRelUpdateBatch(list);
// }
//修改关联表
// udiRelevanceEntity.setUseLeverCount(addProductRequest.getUseLeverCount());
@ -472,27 +472,27 @@ public class UdiProductServiceImpl implements UdiProductService {
}
updateLevelCount(udiRelevanceEntity);
// 上传多玛融合表
List<UdiProductEntity> udiProductEntityList = udiProductDao.selectList(
new QueryWrapper<UdiProductEntity>().eq(StringUtils.isNotBlank(udiProductEntity1.getUuid()), "uuid", udiProductEntity1.getUuid())
);
List<CodeRel> codeRelArrayList = new ArrayList<>();
if (udiProductEntityList != null && udiProductEntityList.size() > 0) {
for (UdiProductEntity udiProductEntity : udiProductEntityList) {
CodeRel codeRel = new CodeRel();
codeRel.setDrugCode(udiProductEntity.getNameCode());
codeRel.setUpdateTime(new Date());
codeRel.setYbbm(udiRelevanceEntity.getMainId());
codeRel.setPackUnit(udiProductEntity.getPackUnit());
codeRel.setBhxjsl(udiProductEntity.getBhxjsl());
codeRel.setXjdw(udiProductEntity.getXjdw());
codeRel.setYbBzgg(udiProductEntity.getBzgg());
codeRelArrayList.add(codeRel);
}
// 上传到多码融合表
udiContrastService.codeRelUpdateBatch(codeRelArrayList);
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());
codeRel.setYbbm(udiRelevanceEntity.getMainId());
codeRel.setPackUnit(udiProductEntity1.getPackUnit());
codeRel.setBhxjsl(udiProductEntity1.getBhxjsl());
codeRel.setXjdw(udiProductEntity1.getXjdw());
codeRel.setYbBzgg(udiProductEntity1.getBzgg());
codeRelArrayList.add(codeRel);
}
// 上传到多码融合表
udiContrastService.codeRelUpdateBatch(codeRelArrayList);
// if (IntUtil.value(udiProductEntity1.getPackLevel()) == 1) {
// calculateDistCount(udiProductEntity1, udiRelevanceEntity);
// calculateUseCount(udiProductEntity1, udiRelevanceEntity);
@ -824,7 +824,6 @@ public class UdiProductServiceImpl implements UdiProductService {
udiProductEntity.setId(IdUtil.getSnowflakeNextId());
CodeRel codeRel = new CodeRel();
codeRel.setDrugCode(thirdAliDrug.getNameCode());
codeRel.setUpdateTime(new Date());

Loading…
Cancel
Save