diff --git a/src/main/java/com/glxp/api/controller/basic/UdiSyncController.java b/src/main/java/com/glxp/api/controller/basic/UdiSyncController.java index 364e0e6..c997556 100644 --- a/src/main/java/com/glxp/api/controller/basic/UdiSyncController.java +++ b/src/main/java/com/glxp/api/controller/basic/UdiSyncController.java @@ -18,7 +18,7 @@ import com.glxp.api.res.auth.AuthAdminResponse; import com.glxp.api.res.basic.BasicUdiRelResponse; import com.glxp.api.res.basic.UdiRelevanceResponse; import com.glxp.api.service.auth.CustomerService; -import com.glxp.api.service.basic.BasicUdiRelService; +import com.glxp.api.service.basic.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.Data; @@ -34,9 +34,6 @@ import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.constant.AsyncDiDlHelper; import com.glxp.api.res.PageSimpleResponse; -import com.glxp.api.service.basic.ProductInfoService; -import com.glxp.api.service.basic.SyncUdiService; -import com.glxp.api.service.basic.UdiCompanyService; import com.glxp.api.util.udi.FilterUdiUtils; import cn.hutool.core.util.StrUtil; @@ -61,6 +58,8 @@ public class UdiSyncController extends BaseController { BasicUdiRelService basicUdiRelService; @Resource CustomerService customerService; + @Resource + BasicUdiProductService basicUdiProductService; //获取同步库UDI信息 @ApiIgnore @@ -154,6 +153,7 @@ public class UdiSyncController extends BaseController { } //产品信息关联新增 + @ApiIgnore @AuthRuleAnnotation("") @ApiOperation(value = "注册企业新增医疗器械信息", response = BaseResponse.class) @PostMapping("udi/basic/rel/save") @@ -174,15 +174,29 @@ public class UdiSyncController extends BaseController { @PostMapping("udi/basic/rel/batch/save") public BaseResponse batchSaveRel(@RequestBody UdiSelectRequest udiSelectRequest) { String userId = customerService.getUserId() + ""; - if (CollUtil.isNotEmpty(udiSelectRequest.getKeys())) { - for (String uuid : udiSelectRequest.getKeys()) { - BasicUdiRelEntity basicUdiRelEntity = new BasicUdiRelEntity(); - basicUdiRelEntity.setUuid(uuid); - basicUdiRelEntity.setCompanyIdFk(udiSelectRequest.getCompanyId()); - basicUdiRelEntity.setUpdateTime(new Date()); - basicUdiRelEntity.setUpdateUser(userId); - basicUdiRelEntity.setId(IdUtil.getSnowflakeNextId()); - basicUdiRelService.save(basicUdiRelEntity); + if (CollUtil.isNotEmpty(udiSelectRequest.getProducts())) { + for (BasicUdiRelRequest basicUdiRelRequest : udiSelectRequest.getProducts()) { + if (!basicUdiRelService.isExit(basicUdiRelRequest.getUuid(), udiSelectRequest.getCompanyId())) { + BasicUdiRelEntity basicUdiRelEntity = new BasicUdiRelEntity(); + basicUdiRelEntity.setUuid(basicUdiRelRequest.getUuid()); + basicUdiRelEntity.setCompanyIdFk(udiSelectRequest.getCompanyId()); + basicUdiRelEntity.setUpdateTime(new Date()); + basicUdiRelEntity.setUpdateUser(userId); + basicUdiRelEntity.setId(IdUtil.getSnowflakeNextId()); + basicUdiRelService.save(basicUdiRelEntity); + + List productInfoEntities = productInfoService.selectByUuid(basicUdiRelRequest.getUuid()); + if (CollUtil.isNotEmpty(productInfoEntities)) { + for (ProductInfoEntity productInfoEntity : productInfoEntities) { +// basicUdiProductService + BasicUdiProductEntity basicUdiProductEntity = new BasicUdiProductEntity(); + BeanUtils.copyProperties(productInfoEntity, basicUdiProductEntity); + basicUdiProductEntity.setId(IdUtil.getSnowflakeNextId()); + basicUdiProductService.save(basicUdiProductEntity); + } + } + + } } } return ResultVOUtils.success("添加成功!"); @@ -198,7 +212,10 @@ public class UdiSyncController extends BaseController { //产品信息关联修改 @AuthRuleAnnotation("") @PostMapping("udi/basic/rel/update") - public BaseResponse updateRel(@RequestBody BasicUdiRelEntity basicUdiRelEntity) { + public BaseResponse updateRel(@RequestBody BasicUdiRelRequest basicUdiRelRequest) { + + BasicUdiRelEntity basicUdiRelEntity = new BasicUdiRelEntity(); + BeanUtils.copyProperties(basicUdiRelRequest, basicUdiRelEntity); basicUdiRelEntity.setUpdateTime(new Date()); basicUdiRelEntity.setUpdateUser(customerService.getUserId() + ""); basicUdiRelService.updateById(basicUdiRelEntity); diff --git a/src/main/java/com/glxp/api/dao/basic/BasicUdiProductMapper.java b/src/main/java/com/glxp/api/dao/basic/BasicUdiProductMapper.java new file mode 100644 index 0000000..e3737e7 --- /dev/null +++ b/src/main/java/com/glxp/api/dao/basic/BasicUdiProductMapper.java @@ -0,0 +1,9 @@ +package com.glxp.api.dao.basic; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.glxp.api.entity.basic.BasicUdiProductEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface BasicUdiProductMapper extends BaseMapper { +} diff --git a/src/main/java/com/glxp/api/entity/basic/BasicUdiProductEntity.java b/src/main/java/com/glxp/api/entity/basic/BasicUdiProductEntity.java new file mode 100644 index 0000000..c02bad3 --- /dev/null +++ b/src/main/java/com/glxp/api/entity/basic/BasicUdiProductEntity.java @@ -0,0 +1,305 @@ +package com.glxp.api.entity.basic; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +@Data +@TableName(value = "basic_udi_product") +public class BasicUdiProductEntity implements Serializable { + @TableId(value = "id", type = IdType.INPUT) + private Long id; + + /** + * 标识 + */ + @TableField(value = "nameCode") + private String nameCode; + + /** + * 包装比例 + */ + @TableField(value = "packRatio") + private String packRatio; + + /** + * 包装级别 + */ + @TableField(value = "packLevel") + private String packLevel; + + /** + * 包含下级数量 + */ + @TableField(value = "bhxjsl") + private Integer bhxjsl; + + /** + * 包含最小销售包装数量 + */ + @TableField(value = "bhzxxsbzsl") + private Integer bhzxxsbzsl; + + /** + * 最小包装单元内包含使用单元数量: +最小销售标识包含使用单元数量 + */ + @TableField(value = "zxxsbzbhsydysl") + private Integer zxxsbzbhsydysl; + + /** + * 包含下级产品编码 + */ + @TableField(value = "bhxjcpbm") + private String bhxjcpbm; + + /** + * 包装层级 + */ + @TableField(value = "bzcj") + private String bzcj; + + /** + * ERPID + */ + @TableField(value = "thirdProductNo") + private String thirdProductNo; + + /** + * 1.器械,2,药品 + */ + @TableField(value = "addType") + private Integer addType; + + /** + * 国家库key + */ + @TableField(value = "deviceRecordKey") + private String deviceRecordKey; + + /** + * 以使用单元数量入库 + */ + @TableField(value = "isUseDy") + private Byte isUseDy; + + /** + * ERP产品名 + */ + @TableField(value = "thirdProductName") + private String thirdProductName; + + /** + * 产品名称,通用名称 + */ + @TableField(value = "cpmctymc") + private String cpmctymc; + + /** + * 产品类别 + */ + @TableField(value = "cplb") + private String cplb; + + /** + * 分类编码 + */ + @TableField(value = "flbm") + private String flbm; + + /** + * 规格型号 + */ + @TableField(value = "ggxh") + private String ggxh; + + /** + * 器械类别 + */ + @TableField(value = "qxlb") + private String qxlb; + + /** + * 统一社会信用代码证号 + */ + @TableField(value = "tyshxydm") + private String tyshxydm; + + /** + * 注册/备案人名称 + */ + @TableField(value = "ylqxzcrbarmc") + private String ylqxzcrbarmc; + + /** + * "注册/备案证号, + */ + @TableField(value = "zczbhhzbapzbh") + private String zczbhhzbapzbh; + + /** + * 注册/备案人名称英文名称 + */ + @TableField(value = "ylqxzcrbarywmc") + private String ylqxzcrbarywmc; + + /** + * 使用单元产品标识 + */ + @TableField(value = "sydycpbs") + private String sydycpbs; + + /** + * UUID主键 + */ + @TableField(value = "uuid") + private String uuid; + + /** + * 上级产品标识 + */ + @TableField(value = "sjcpbm") + private String sjcpbm; + + /** + * 历史版本号,最高为最新 + */ + @TableField(value = "versionNumber") + private Integer versionNumber; + + /** + * 表示类型:1.主标识,2,使用单元标识,3.本体标识,4,包装标识 + */ + @TableField(value = "diType") + private Byte diType; + + /** + * 生产标识是否包含批号 + */ + @TableField(value = "scbssfbhph") + private String scbssfbhph; + + /** + * 生产标识是否包含序列号 + */ + @TableField(value = "scbssfbhxlh") + private String scbssfbhxlh; + + /** + * 生产标识是否包含生产日期 + */ + @TableField(value = "scbssfbhscrq") + private String scbssfbhscrq; + + /** + * 生产标识是否包含失效日期 + */ + @TableField(value = "scbssfbhsxrq") + private String scbssfbhsxrq; + + /** + * 医保编码 + */ + @TableField(value = "ybbm") + private String ybbm; + + /** + * 商品名称 + */ + @TableField(value = "spmc") + private String spmc; + + @TableField(value = "cphhhbh") + private String cphhhbh; + + @TableField(value = "cpms") + private String cpms; + + @TableField(value = "cpbsbmtxmc") + private String cpbsbmtxmc; + + /** + * 是否是最新记录 + */ + @TableField(value = "isNewest") + private Byte isNewest; + + /** + * 更新时间 + */ + @TableField(value = "updateTime") + private Date updateTime; + + /** + * 产品类型 + */ + @TableField(value = "cplx") + private String cplx; + + /** + * 耗材或者设备 + */ + @TableField(value = "hchzsb") + private String hchzsb; + + /** + * 是否为包类产品/组套类产品; 1 是 0 否 + */ + @TableField(value = "sfwblztlcp") + private String sfwblztlcp; + + /** + * 共振(MR) 安全相关信息; 0 安全 , 1 条件安全, 28 +不安全 , 3 说明书或标签上面不包括 MR 安全信息 + */ + @TableField(value = "cgzmraqxgxx") + private String cgzmraqxgxx; + + /** + * 标记为一次性使用:0 否, 1 是 + */ + @TableField(value = "sfbjwycxsy") + private String sfbjwycxsy; + + /** + * 最大重复使用次数 + */ + @TableField(value = "zdcfsycs") + private String zdcfsycs; + + /** + * 是否为已灭菌产品:1 是 0 否 + */ + @TableField(value = "sfwwjbz") + private String sfwwjbz; + + /** + * 使用前是否需要进行灭菌:1 是 0 否 + */ + @TableField(value = "syqsfxyjxmj") + private String syqsfxyjxmj; + + /** + * 灭菌方式 + */ + @TableField(value = "mjfs") + private String mjfs; + + /** + * 其他信息的网址链接 + */ + @TableField(value = "qtxxdwzlj") + private String qtxxdwzlj; + + /** + * 分类编码对应分类名称 + */ + @TableField(value = "categoryName") + private String categoryName; + + private static final long serialVersionUID = 1L; +} diff --git a/src/main/java/com/glxp/api/entity/basic/BasicUdiRelEntity.java b/src/main/java/com/glxp/api/entity/basic/BasicUdiRelEntity.java index 061d414..49f85fb 100644 --- a/src/main/java/com/glxp/api/entity/basic/BasicUdiRelEntity.java +++ b/src/main/java/com/glxp/api/entity/basic/BasicUdiRelEntity.java @@ -46,11 +46,19 @@ public class BasicUdiRelEntity implements Serializable { @TableField(value = "updateUser") private String updateUser; +// -------------企业自定义设置------------------------ + /** * 生产数据对接方(1.生产企业/2.代理商/3.购买方) */ @TableField(value = "companyType") - private String companyType; + private Integer companyType; + + @TableField(value = "agengtStartDate") + private Date agengtStartDate; + + @TableField(value = "agengtEndDate") + private Date agengtEndDate; private static final long serialVersionUID = 1L; } diff --git a/src/main/java/com/glxp/api/req/basic/BasicUdiRelRequest.java b/src/main/java/com/glxp/api/req/basic/BasicUdiRelRequest.java new file mode 100644 index 0000000..fe38a5c --- /dev/null +++ b/src/main/java/com/glxp/api/req/basic/BasicUdiRelRequest.java @@ -0,0 +1,48 @@ +package com.glxp.api.req.basic; + +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Data; + +import java.util.Date; + +@Data +public class BasicUdiRelRequest { + + private Long id; + + /** + * 国家库uuid + */ + private String uuid; + + /** + * 企业信息ID外键 + */ + private Long companyIdFk; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 备注 + */ + private String remark; + + /** + * 更新人 + */ + private String updateUser; + +// -------------企业自定义设置------------------------ + + /** + * 生产数据对接方(1.生产企业/2.代理商/3.购买方) + */ + private Integer companyType; + + private Date agengtStartDate; + + private Date agengtEndDate; +} diff --git a/src/main/java/com/glxp/api/req/basic/UdiSelectRequest.java b/src/main/java/com/glxp/api/req/basic/UdiSelectRequest.java index aa53ea8..6bd7c73 100644 --- a/src/main/java/com/glxp/api/req/basic/UdiSelectRequest.java +++ b/src/main/java/com/glxp/api/req/basic/UdiSelectRequest.java @@ -7,6 +7,8 @@ import java.util.List; @Data public class UdiSelectRequest { - List keys; + List products; private Long companyId; + + } diff --git a/src/main/java/com/glxp/api/res/basic/BasicUdiRelResponse.java b/src/main/java/com/glxp/api/res/basic/BasicUdiRelResponse.java index 8865498..4188bca 100644 --- a/src/main/java/com/glxp/api/res/basic/BasicUdiRelResponse.java +++ b/src/main/java/com/glxp/api/res/basic/BasicUdiRelResponse.java @@ -1,5 +1,6 @@ package com.glxp.api.res.basic; +import com.baomidou.mybatisplus.annotation.TableField; import lombok.Data; import java.util.Date; @@ -35,7 +36,7 @@ public class BasicUdiRelResponse { */ private String updateUser; - private String companyType; + private Integer companyType; private String companyName; @@ -97,4 +98,8 @@ public class BasicUdiRelResponse { private String mjfs; + private Date agengtStartDate; + private Date agengtEndDate; + + } diff --git a/src/main/java/com/glxp/api/service/basic/BasicUdiProductService.java b/src/main/java/com/glxp/api/service/basic/BasicUdiProductService.java new file mode 100644 index 0000000..7d95d33 --- /dev/null +++ b/src/main/java/com/glxp/api/service/basic/BasicUdiProductService.java @@ -0,0 +1,8 @@ +package com.glxp.api.service.basic; + +import com.glxp.api.entity.basic.BasicUdiProductEntity; +import com.baomidou.mybatisplus.extension.service.IService; +public interface BasicUdiProductService extends IService{ + + +} diff --git a/src/main/java/com/glxp/api/service/basic/BasicUdiProductServiceImpl.java b/src/main/java/com/glxp/api/service/basic/BasicUdiProductServiceImpl.java new file mode 100644 index 0000000..1b9fe40 --- /dev/null +++ b/src/main/java/com/glxp/api/service/basic/BasicUdiProductServiceImpl.java @@ -0,0 +1,11 @@ +package com.glxp.api.service.basic; + +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.glxp.api.dao.basic.BasicUdiProductMapper; +import com.glxp.api.entity.basic.BasicUdiProductEntity; + +@Service +public class BasicUdiProductServiceImpl extends ServiceImpl implements BasicUdiProductService{ + +} diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index caf382c..4011118 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -34,10 +34,10 @@ spring: max-request-size: 500MB rabbitmq: - host: 127.0.0.1 + host: 192.168.0.66 port: 5672 - username: cpt - password: 123456 + username: glxp + password: glxp1234 virtual-host: / publisher-confirms: false connection-timeout: 15000 diff --git a/src/main/resources/mybatis/mapper/basic/BasicUdiProductMapper.xml b/src/main/resources/mybatis/mapper/basic/BasicUdiProductMapper.xml new file mode 100644 index 0000000..3af6238 --- /dev/null +++ b/src/main/resources/mybatis/mapper/basic/BasicUdiProductMapper.xml @@ -0,0 +1,4 @@ + + + +