From 2e672e725039b90f2b1a103ddbef504a80cd2675 Mon Sep 17 00:00:00 2001 From: anthonyywj2 <353682448@qq.com> Date: Thu, 28 Jul 2022 17:04:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B0=8F=E6=9D=A8=E8=A6=81?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/ProductInfoController.java | 53 +++++++++++++++++++ .../admin/entity/info/CompanyEntity.java | 5 ++ .../admin/service/info/CompanyService.java | 2 + .../service/info/impl/CompanyServiceImpl.java | 5 ++ .../mybatis/mapper/info/CompanyMapper.xml | 45 ++++++++-------- 5 files changed, 89 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/glxp/udidl/admin/controller/device/ProductInfoController.java b/src/main/java/com/glxp/udidl/admin/controller/device/ProductInfoController.java index 9281ba6..0ebb47e 100644 --- a/src/main/java/com/glxp/udidl/admin/controller/device/ProductInfoController.java +++ b/src/main/java/com/glxp/udidl/admin/controller/device/ProductInfoController.java @@ -242,6 +242,59 @@ public class ProductInfoController { return ResultVOUtils.success(pageSimpleResponse); } + + //开放查询 查询全部,不会过滤只显示主 + @ApiOperation(value = "赋码系统下载全部产品信息接口", response = ProductInfoEntity.class) + @AuthRuleAnnotation("udidl/device/dlDiByPc") + @GetMapping("udidl/device/dlDiByPc") + public BaseResponse dlDiByPc(ProductInfoFilterRequest productInfoFilterRequest) { + //过滤--1.参数不能全未空 + if ((productInfoFilterRequest.getYlqxzcrbarmc() == null || productInfoFilterRequest.getYlqxzcrbarmc().equals("")) && + (productInfoFilterRequest.getCpmctymc() == null || productInfoFilterRequest.getCpmctymc().equals("")) && + (productInfoFilterRequest.getNameCode() == null || productInfoFilterRequest.getNameCode().equals("")) && + (productInfoFilterRequest.getGgxh() == null || productInfoFilterRequest.getGgxh().equals("")) && + (productInfoFilterRequest.getUuid() == null || productInfoFilterRequest.getUuid().equals("")) && + (productInfoFilterRequest.getZczbhhzbapzbh() == null || productInfoFilterRequest.getZczbhhzbapzbh().equals("")) && + (productInfoFilterRequest.getDeviceRecordKey() == null || productInfoFilterRequest.getDeviceRecordKey().equals("")) + ) { + return ResultVOUtils.error(500, "参数不能为空!"); + } + + if (productInfoFilterRequest.getNameCode() != null && !productInfoFilterRequest.getNameCode().equals("") && productInfoFilterRequest.getNameCode().length() < 10) { + return ResultVOUtils.error(500, "请输入完整的最小销售单元标识!"); + } + + if (productInfoFilterRequest.getYlqxzcrbarmc() != null && !productInfoFilterRequest.getYlqxzcrbarmc().equals("") && productInfoFilterRequest.getYlqxzcrbarmc().length() < 4) { + return ResultVOUtils.error(500, "请输入完整的医疗器械注册备案人名称!"); + } + + + if ((productInfoFilterRequest.getYlqxzcrbarmc() == null || productInfoFilterRequest.getYlqxzcrbarmc().equals("")) + && (productInfoFilterRequest.getNameCode() == null || productInfoFilterRequest.getNameCode().equals("")) + && (productInfoFilterRequest.getCpmctymc() == null || productInfoFilterRequest.getCpmctymc().equals("")) + + ) { + if (productInfoFilterRequest.getGgxh() != null && !productInfoFilterRequest.getGgxh().equals("")) { + return ResultVOUtils.error(500, "请输入医疗器械注册备案人名称"); + } + if (productInfoFilterRequest.getZczbhhzbapzbh() != null && !productInfoFilterRequest.getZczbhhzbapzbh().equals("")) { + return ResultVOUtils.error(500, "请输入医疗器械注册备案人名称"); + } + } + + if (productInfoFilterRequest.getCpmctymc() != null && !productInfoFilterRequest.getCpmctymc().equals("") && productInfoFilterRequest.getCpmctymc().length() < 4) { + return ResultVOUtils.error(500, "请输入完整的产品通用名称!"); + } + productInfoFilterRequest.setIsNewest(1); + List productInfoEntityList = productInfoService.filterUdi(productInfoFilterRequest); + PageInfo pageInfo; + pageInfo = new PageInfo<>(productInfoEntityList); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + pageSimpleResponse.setTotal(pageInfo.getTotal()); + pageSimpleResponse.setList(productInfoEntityList); + return ResultVOUtils.success(pageSimpleResponse); + } + @ApiOperation(value = "根据UUID查询产品信息", response = ProductInfoEntity.class) @AuthRuleAnnotation("udidl/device/filterByUuid") @GetMapping("udidl/device/filterByUuid") diff --git a/src/main/java/com/glxp/udidl/admin/entity/info/CompanyEntity.java b/src/main/java/com/glxp/udidl/admin/entity/info/CompanyEntity.java index 8686aab..2bb2162 100644 --- a/src/main/java/com/glxp/udidl/admin/entity/info/CompanyEntity.java +++ b/src/main/java/com/glxp/udidl/admin/entity/info/CompanyEntity.java @@ -3,6 +3,7 @@ package com.glxp.udidl.admin.entity.info; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import io.swagger.models.auth.In; import lombok.Data; @Data @@ -10,6 +11,10 @@ import lombok.Data; @ApiModel(value = "企业信息实体") public class CompanyEntity { + + @ApiModelProperty(value = "ID主键") + private Integer id; //自增长ID + @ApiModelProperty(value = "企业名称") private String name; //企业名称 diff --git a/src/main/java/com/glxp/udidl/admin/service/info/CompanyService.java b/src/main/java/com/glxp/udidl/admin/service/info/CompanyService.java index e11cf76..423a74e 100644 --- a/src/main/java/com/glxp/udidl/admin/service/info/CompanyService.java +++ b/src/main/java/com/glxp/udidl/admin/service/info/CompanyService.java @@ -9,6 +9,8 @@ public interface CompanyService { CompanyEntity findCompany(); + CompanyEntity findByTyshxydm(String tyshxydm); + boolean modifyCompany(CompanyEntity companyEntity); /** diff --git a/src/main/java/com/glxp/udidl/admin/service/info/impl/CompanyServiceImpl.java b/src/main/java/com/glxp/udidl/admin/service/info/impl/CompanyServiceImpl.java index 5ac4134..1bca3b8 100644 --- a/src/main/java/com/glxp/udidl/admin/service/info/impl/CompanyServiceImpl.java +++ b/src/main/java/com/glxp/udidl/admin/service/info/impl/CompanyServiceImpl.java @@ -28,6 +28,11 @@ public class CompanyServiceImpl implements CompanyService { return companyDao.selectOne(new QueryWrapper().isNull("dataSource")); } + @Override + public CompanyEntity findByTyshxydm(String tyshxydm) { + return companyDao.selectOne(new QueryWrapper().eq("tyshxydm", tyshxydm)); + } + @Transactional(rollbackFor = Exception.class) @Override public boolean modifyCompany(CompanyEntity companyEntity) { diff --git a/src/main/resources/mybatis/mapper/info/CompanyMapper.xml b/src/main/resources/mybatis/mapper/info/CompanyMapper.xml index 58d8bd8..ed59b95 100644 --- a/src/main/resources/mybatis/mapper/info/CompanyMapper.xml +++ b/src/main/resources/mybatis/mapper/info/CompanyMapper.xml @@ -5,33 +5,36 @@ + - UPDATE company SET - name = #{name}, - category = #{category}, - creditCode = #{creditCode}, - addr = #{addr}, - productAddr = #{productAddr}, - classes = #{classes}, - appId = #{appId}, - appSecret = #{appSecret}, - tyshxydm = #{tyshxydm} + UPDATE company + + `name`=#{name}, + category=#{category}, + `creditCode`=#{creditCode}, + addr=#{addr}, + `classes`=#{classes}, + appId=#{appId}, + appSecret=#{appSecret}, + + WHERE tyshxydm=#{tyshxydm} - INSERT INTO company(name,category,creditCode,addr,productAddr,classes,appId,appSecret,tyshxydm) values - ( #{name}, - #{category}, - #{creditCode}, - #{addr}, - #{productAddr}, - #{classes}, - #{appId}, - #{appSecret}, - #{tyshxydm}) + INSERT INTO company(name, category, creditCode, addr, productAddr, classes, appId, appSecret, tyshxydm) + values (#{name}, + #{category}, + #{creditCode}, + #{addr}, + #{productAddr}, + #{classes}, + #{appId}, + #{appSecret}, + #{tyshxydm})