diff --git a/src/main/java/com/glxp/api/controller/alihealth/AlihealthBusController.java b/src/main/java/com/glxp/api/controller/alihealth/AlihealthBusController.java index 86aa8519..993f68e9 100644 --- a/src/main/java/com/glxp/api/controller/alihealth/AlihealthBusController.java +++ b/src/main/java/com/glxp/api/controller/alihealth/AlihealthBusController.java @@ -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; diff --git a/src/main/java/com/glxp/api/req/thrsys/CodeRelRequest.java b/src/main/java/com/glxp/api/req/thrsys/CodeRelRequest.java new file mode 100644 index 00000000..0a0c9c4b --- /dev/null +++ b/src/main/java/com/glxp/api/req/thrsys/CodeRelRequest.java @@ -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; +} diff --git a/src/main/java/com/glxp/api/service/basic/impl/UdiProductServiceImpl.java b/src/main/java/com/glxp/api/service/basic/impl/UdiProductServiceImpl.java index d4dfa65d..f9a63266 100644 --- a/src/main/java/com/glxp/api/service/basic/impl/UdiProductServiceImpl.java +++ b/src/main/java/com/glxp/api/service/basic/impl/UdiProductServiceImpl.java @@ -304,7 +304,7 @@ public class UdiProductServiceImpl implements UdiProductService { if (addProductRequest.getRelId() != null) { udiRelevanceEntity = udiRelevanceDao.selectById(addProductRequest.getRelId()); List udiProductEntities = udiProductDao.findByUuids(udiRelevanceEntity.getUuid()); - List list = new ArrayList<>(); +// List 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 udiProductEntityList = udiProductDao.selectList( - new QueryWrapper().eq(StringUtils.isNotBlank(udiProductEntity1.getUuid()), "uuid", udiProductEntity1.getUuid()) - ); List 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());