新增小杨要的接口

master
anthonyywj2 3 years ago
parent b7cf0fdc06
commit 2e672e7250

@ -242,6 +242,59 @@ public class ProductInfoController {
return ResultVOUtils.success(pageSimpleResponse); 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<ProductInfoEntity> productInfoEntityList = productInfoService.filterUdi(productInfoFilterRequest);
PageInfo<ProductInfoEntity> pageInfo;
pageInfo = new PageInfo<>(productInfoEntityList);
PageSimpleResponse<ProductInfoEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(productInfoEntityList);
return ResultVOUtils.success(pageSimpleResponse);
}
@ApiOperation(value = "根据UUID查询产品信息", response = ProductInfoEntity.class) @ApiOperation(value = "根据UUID查询产品信息", response = ProductInfoEntity.class)
@AuthRuleAnnotation("udidl/device/filterByUuid") @AuthRuleAnnotation("udidl/device/filterByUuid")
@GetMapping("udidl/device/filterByUuid") @GetMapping("udidl/device/filterByUuid")

@ -3,6 +3,7 @@ package com.glxp.udidl.admin.entity.info;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data; import lombok.Data;
@Data @Data
@ -10,6 +11,10 @@ import lombok.Data;
@ApiModel(value = "企业信息实体") @ApiModel(value = "企业信息实体")
public class CompanyEntity { public class CompanyEntity {
@ApiModelProperty(value = "ID主键")
private Integer id; //自增长ID
@ApiModelProperty(value = "企业名称") @ApiModelProperty(value = "企业名称")
private String name; //企业名称 private String name; //企业名称

@ -9,6 +9,8 @@ public interface CompanyService {
CompanyEntity findCompany(); CompanyEntity findCompany();
CompanyEntity findByTyshxydm(String tyshxydm);
boolean modifyCompany(CompanyEntity companyEntity); boolean modifyCompany(CompanyEntity companyEntity);
/** /**

@ -28,6 +28,11 @@ public class CompanyServiceImpl implements CompanyService {
return companyDao.selectOne(new QueryWrapper<CompanyEntity>().isNull("dataSource")); return companyDao.selectOne(new QueryWrapper<CompanyEntity>().isNull("dataSource"));
} }
@Override
public CompanyEntity findByTyshxydm(String tyshxydm) {
return companyDao.selectOne(new QueryWrapper<CompanyEntity>().eq("tyshxydm", tyshxydm));
}
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public boolean modifyCompany(CompanyEntity companyEntity) { public boolean modifyCompany(CompanyEntity companyEntity) {

@ -5,33 +5,36 @@
<select id="findCompany" <select id="findCompany"
resultType="com.glxp.udidl.admin.entity.info.CompanyEntity"> resultType="com.glxp.udidl.admin.entity.info.CompanyEntity">
SELECT * FROM company SELECT *
FROM company
</select> </select>
<update id="modifyCompany" parameterType="com.glxp.udidl.admin.entity.info.CompanyEntity"> <update id="modifyCompany" parameterType="com.glxp.udidl.admin.entity.info.CompanyEntity">
UPDATE company SET UPDATE company
name = #{name}, <set>
category = #{category}, <if test="name != null">`name`=#{name},</if>
creditCode = #{creditCode}, <if test="category != null">category=#{category},</if>
addr = #{addr}, <if test="creditCode != null">`creditCode`=#{creditCode},</if>
productAddr = #{productAddr}, <if test="addr != null">addr=#{addr},</if>
classes = #{classes}, <if test="classes != null">`classes`=#{classes},</if>
appId = #{appId}, <if test="appId != null">appId=#{appId},</if>
appSecret = #{appSecret}, <if test="appSecret != null">appSecret=#{appSecret},</if>
tyshxydm = #{tyshxydm} </set>
WHERE tyshxydm=#{tyshxydm}
</update> </update>
<insert id="insertCompany" parameterType="com.glxp.udidl.admin.entity.info.CompanyEntity"> <insert id="insertCompany" parameterType="com.glxp.udidl.admin.entity.info.CompanyEntity">
INSERT INTO company(name,category,creditCode,addr,productAddr,classes,appId,appSecret,tyshxydm) values INSERT INTO company(name, category, creditCode, addr, productAddr, classes, appId, appSecret, tyshxydm)
( #{name}, values (#{name},
#{category}, #{category},
#{creditCode}, #{creditCode},
#{addr}, #{addr},
#{productAddr}, #{productAddr},
#{classes}, #{classes},
#{appId}, #{appId},
#{appSecret}, #{appSecret},
#{tyshxydm}) #{tyshxydm})
</insert> </insert>

Loading…
Cancel
Save