From dea23dde9f0d9015b380dd9164d7e3a606c743aa Mon Sep 17 00:00:00 2001 From: liyawei Date: Fri, 22 Apr 2022 18:32:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A4=E8=AF=81-=E6=A8=A1=E6=9D=BF=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E9=A1=B9-=E5=A2=9E=E5=88=A0=E6=94=B9=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CertCategoryParamsInfoEOController.java | 171 +++++++++++++++ .../controller/ParamsInfoEOController.java | 202 ++++++++++++++++++ .../entity/CertCategoryParamsInfoEO.java | 91 ++++++++ .../cert/template/entity/ParamsInfoEO.java | 136 ++++++++++++ .../cert/template/enums/ControlTypeEnum.java | 43 ++++ .../template/enums/ControlVerifyEnum.java | 42 ++++ .../cert/template/enums/IsMustEnum.java | 35 +++ .../CertCategoryParamsInfoEOMapper.java | 20 ++ .../template/mapper/ParamsInfoEOMapper.java | 14 ++ .../xml/CertCategoryParamsInfoEOMapper.xml | 32 +++ .../mapper/xml/ParamsInfoEOMapper.xml | 25 +++ .../ICertCategoryParamsInfoEOService.java | 65 ++++++ .../service/IParamsInfoEOService.java | 61 ++++++ .../CertCategoryParamsInfoEOServiceImpl.java | 100 +++++++++ .../service/impl/ParamsInfoEOServiceImpl.java | 198 +++++++++++++++++ 15 files changed, 1235 insertions(+) create mode 100644 jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/controller/CertCategoryParamsInfoEOController.java create mode 100644 jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/controller/ParamsInfoEOController.java create mode 100644 jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/entity/CertCategoryParamsInfoEO.java create mode 100644 jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/entity/ParamsInfoEO.java create mode 100644 jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/enums/ControlTypeEnum.java create mode 100644 jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/enums/ControlVerifyEnum.java create mode 100644 jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/enums/IsMustEnum.java create mode 100644 jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/mapper/CertCategoryParamsInfoEOMapper.java create mode 100644 jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/mapper/ParamsInfoEOMapper.java create mode 100644 jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/mapper/xml/CertCategoryParamsInfoEOMapper.xml create mode 100644 jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/mapper/xml/ParamsInfoEOMapper.xml create mode 100644 jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/ICertCategoryParamsInfoEOService.java create mode 100644 jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/IParamsInfoEOService.java create mode 100644 jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/impl/CertCategoryParamsInfoEOServiceImpl.java create mode 100644 jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/impl/ParamsInfoEOServiceImpl.java diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/controller/CertCategoryParamsInfoEOController.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/controller/CertCategoryParamsInfoEOController.java new file mode 100644 index 000000000..263d8d6fc --- /dev/null +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/controller/CertCategoryParamsInfoEOController.java @@ -0,0 +1,171 @@ +package com.jero.modules.cert.template.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.jero.common.api.vo.Result; +import com.jero.common.aspect.annotation.AutoLog; +import com.jero.common.system.base.controller.JeroController; +import com.jero.common.system.query.QueryGenerator; +import com.jero.modules.cert.template.entity.CertCategoryParamsInfoEO; +import com.jero.modules.cert.template.service.ICertCategoryParamsInfoEOService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; +import java.util.List; + + + /** + * @Description: 认证类别参数信息表 + * @Author: jero-boot + * @Date: 2022-04-22 + * @Version: V1.0 + */ +@Api(tags="认证类别参数信息表") +@RestController +@RequestMapping("/params/certCategoryParamsInfo") +@Slf4j +public class CertCategoryParamsInfoEOController extends JeroController { + @Autowired + private ICertCategoryParamsInfoEOService certCategoryParamsInfoEOService; + + /** + * 分页列表查询 + * + * @param certCategoryParamsInfoEO + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "认证类别参数信息表-分页列表查询") + @ApiOperation(value="认证类别参数信息表-分页列表查询", notes="认证类别参数信息表-分页列表查询") + @GetMapping(value = "/page") + public Result queryPageList(CertCategoryParamsInfoEO certCategoryParamsInfoEO, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(certCategoryParamsInfoEO, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = certCategoryParamsInfoEOService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 列表查询 + * + * @return + */ + @AutoLog(value = "认证类别参数信息表-列表查询") + @ApiOperation(value="认证类别参数信息表-列表查询", notes="认证类别参数信息表-列表查询") + @GetMapping(value = "/list") + public Result> queryList() { + List list = certCategoryParamsInfoEOService.queryList(); + return Result.OK(list); + } + + /** + * 添加 + * + * @param certCategoryParamsInfoEO + * @return + */ + @AutoLog(value = "认证类别参数信息表-添加") + @ApiOperation(value="认证类别参数信息表-添加", notes="认证类别参数信息表-添加") + @PostMapping(value = "/add") + public Result add(@Validated @RequestBody CertCategoryParamsInfoEO certCategoryParamsInfoEO) { + certCategoryParamsInfoEOService.add(certCategoryParamsInfoEO); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param certCategoryParamsInfoEO + * @return + */ + @AutoLog(value = "认证类别参数信息表-编辑") + @ApiOperation(value="认证类别参数信息表-编辑", notes="认证类别参数信息表-编辑") + @PutMapping(value = "/edit") + public Result edit(@Validated @RequestBody CertCategoryParamsInfoEO certCategoryParamsInfoEO) { + certCategoryParamsInfoEOService.editById(certCategoryParamsInfoEO); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "认证类别参数信息表-通过id删除") + @ApiOperation(value="认证类别参数信息表-通过id删除", notes="认证类别参数信息表-通过id删除") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + certCategoryParamsInfoEOService.deleteById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "认证类别参数信息表-批量删除") + @ApiOperation(value="认证类别参数信息表-批量删除", notes="认证类别参数信息表-批量删除") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.certCategoryParamsInfoEOService.deleteByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + @AutoLog(value = "认证类别参数信息表-通过id查询") + @ApiOperation(value="认证类别参数信息表-通过id查询", notes="认证类别参数信息表-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + CertCategoryParamsInfoEO certCategoryParamsInfoEO = certCategoryParamsInfoEOService.queryById(id); + if(certCategoryParamsInfoEO==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(certCategoryParamsInfoEO); + } + + /** + * 导出excel + * + * @param request + * @param certCategoryParamsInfoEO + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, CertCategoryParamsInfoEO certCategoryParamsInfoEO) { + return super.exportXls(request, certCategoryParamsInfoEO, CertCategoryParamsInfoEO.class, "认证类别参数信息表"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, CertCategoryParamsInfoEO.class); + } + +} diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/controller/ParamsInfoEOController.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/controller/ParamsInfoEOController.java new file mode 100644 index 000000000..5199c1ecd --- /dev/null +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/controller/ParamsInfoEOController.java @@ -0,0 +1,202 @@ +package com.jero.modules.cert.template.controller; + +import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.jero.common.api.vo.Result; +import com.jero.common.aspect.annotation.AutoLog; +import com.jero.common.system.base.controller.JeroController; +import com.jero.modules.cert.template.entity.ParamsInfoEO; +import com.jero.modules.cert.template.service.IParamsInfoEOService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; +import java.util.List; + + + /** + * @Description: 参数项基本信息表 + * @Author: jero-boot + * @Date: 2022-04-22 + * @Version: V1.0 + */ +@Api(tags="参数项基本信息表") +@RestController +@RequestMapping("/params/paramsInfo") +@Slf4j +public class ParamsInfoEOController extends JeroController { + @Autowired + private IParamsInfoEOService paramsInfoEOService; + + /** + * 分页列表查询 + * + * @param paramsInfoEO + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "参数项基本信息表-分页列表查询") + @ApiOperation(value="参数项基本信息表-分页列表查询", notes="参数项基本信息表-分页列表查询") + @GetMapping(value = "/page") + public Result queryPageList(ParamsInfoEO paramsInfoEO, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + @RequestParam(name="cut") String cut, + HttpServletRequest req) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.like(StringUtils.isNotEmpty(paramsInfoEO.getNioNumber()), ParamsInfoEO::getNioNumber, paramsInfoEO.getNioNumber()) + .like(StringUtils.isNotEmpty(paramsInfoEO.getParamsName()), ParamsInfoEO::getParamsName, paramsInfoEO.getParamsName()) + .eq(StringUtils.isNotEmpty(paramsInfoEO.getDutyTerritory()), ParamsInfoEO::getDutyTerritory, paramsInfoEO.getDutyTerritory()) + .orderByDesc(ParamsInfoEO::getCreateTime); + Page page = new Page(pageNo, pageSize); + IPage pageList = paramsInfoEOService.page(page, queryWrapper); + return Result.OK(cut, pageList); + } + + /** + * 列表查询 + * + * @return + */ + @AutoLog(value = "参数项基本信息表-列表查询") + @ApiOperation(value="参数项基本信息表-列表查询", notes="参数项基本信息表-列表查询") + @GetMapping(value = "/list") + public Result> queryList() { + List list = paramsInfoEOService.queryList(); + return Result.OK(list); + } + + /** + * 校验nio编号在当前参数模板下是否唯一 + * true-唯一,false-不唯一 + * @param nioNumber + * @return + */ + @AutoLog(value = "参数项基本信息表-校验nio编号") + @ApiOperation(value="参数项基本信息表-校验nio编号", notes="参数项基本信息表-校验nio编号") + @GetMapping(value = "/verifyNioNumber") + public boolean verifyNioNumber(@RequestParam(name = "nioNumber") String nioNumber) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ParamsInfoEO::getNioNumber, nioNumber); + List paramsInfoEOList = paramsInfoEOService.list(queryWrapper); + if (CollectionUtil.isNotEmpty(paramsInfoEOList)) { + return false; + } + return true; + } + + /** + * 添加 + * + * @param paramsInfoEO + * @return + */ + @AutoLog(value = "参数项基本信息表-添加") + @ApiOperation(value="参数项基本信息表-添加", notes="参数项基本信息表-添加") + @PostMapping(value = "/add") + public Result add(@Validated @RequestBody ParamsInfoEO paramsInfoEO) { + paramsInfoEOService.add(paramsInfoEO); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param paramsInfoEO + * @return + */ + @AutoLog(value = "参数项基本信息表-编辑") + @ApiOperation(value="参数项基本信息表-编辑", notes="参数项基本信息表-编辑") + @PostMapping(value = "/edit") + public Result edit(@Validated @RequestBody ParamsInfoEO paramsInfoEO) { + paramsInfoEOService.editById(paramsInfoEO); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "参数项基本信息表-通过id删除") + @ApiOperation(value="参数项基本信息表-通过id删除", notes="参数项基本信息表-通过id删除") + @GetMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + if (StringUtils.isBlank(id)) { + return Result.error("删除数据不能为空"); + } + paramsInfoEOService.deleteById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "参数项基本信息表-批量删除") + @ApiOperation(value="参数项基本信息表-批量删除", notes="参数项基本信息表-批量删除") + @PostMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + if (StringUtils.isBlank(ids)) { + return Result.error("删除数据不能为空"); + } + this.paramsInfoEOService.deleteByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + @AutoLog(value = "参数项基本信息表-通过id查询") + @ApiOperation(value="参数项基本信息表-通过id查询", notes="参数项基本信息表-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + ParamsInfoEO paramsInfoEO = paramsInfoEOService.queryById(id); + if(paramsInfoEO==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(paramsInfoEO); + } + + /** + * 导出excel + * + * @param request + * @param paramsInfoEO + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, ParamsInfoEO paramsInfoEO) { + return super.exportXls(request, paramsInfoEO, ParamsInfoEO.class, "参数项基本信息表"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, ParamsInfoEO.class); + } + +} diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/entity/CertCategoryParamsInfoEO.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/entity/CertCategoryParamsInfoEO.java new file mode 100644 index 000000000..28d75d0f7 --- /dev/null +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/entity/CertCategoryParamsInfoEO.java @@ -0,0 +1,91 @@ +package com.jero.modules.cert.template.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; + + +/** + * @Description: 认证类别参数信息表 + * @Author: jero-boot + * @Date: 2022-04-22 + * @Version: V1.0 + */ +@Data +@TableName("cert_category_params_info") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="cert_category_params_info对象", description="认证类别参数信息表") +public class CertCategoryParamsInfoEO implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private String id; + + /**创建人*/ + @ApiModelProperty(value = "创建人") + private String createBy; + + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + + /**更新人*/ + @ApiModelProperty(value = "更新人") + private String updateBy; + + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + + /**所属部门*/ + @ApiModelProperty(value = "所属部门") + private String sysOrgCode; + + /**编号*/ + @Excel(name = "编号", width = 15) + @ApiModelProperty(value = "编号") + private String paramsNumber; + + /**参数名称*/ + @Excel(name = "参数名称", width = 15) + @ApiModelProperty(value = "参数名称") + private String paramsName; + + /**参数说明*/ + @Excel(name = "参数说明", width = 15) + @ApiModelProperty(value = "参数说明") + private String description; + + /**nio编号*/ + @Excel(name = "nio编号", width = 15) + @ApiModelProperty(value = "nio编号") + private String nioNumber; + + /**所属认证类别*/ + @Excel(name = "所属认证类别", width = 15) + @ApiModelProperty(value = "所属认证类别") + private String certCategory; + + /**参数模板id*/ + @Excel(name = "参数模板id", width = 15) + @ApiModelProperty(value = "参数模板id") + private String paramsTemplateId; + +} diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/entity/ParamsInfoEO.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/entity/ParamsInfoEO.java new file mode 100644 index 000000000..f6b86b9c1 --- /dev/null +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/entity/ParamsInfoEO.java @@ -0,0 +1,136 @@ +package com.jero.modules.cert.template.entity; + +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 com.fasterxml.jackson.annotation.JsonFormat; +import com.jero.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.List; + + +/** + * @Description: 参数项基本信息表 + * @Author: jero-boot + * @Date: 2022-04-22 + * @Version: V1.0 + */ +@Data +@TableName("params_info") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="params_info对象", description="参数项基本信息表") +public class ParamsInfoEO implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private String id; + + /**创建人*/ + @ApiModelProperty(value = "创建人") + private String createBy; + + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + + /**更新人*/ + @ApiModelProperty(value = "更新人") + private String updateBy; + + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + + /**所属部门*/ + @ApiModelProperty(value = "所属部门") + private String sysOrgCode; + + /**nio编号*/ + @Excel(name = "nio编号", width = 15) + @ApiModelProperty(value = "nio编号") + private String nioNumber; + + /**是否必填*/ + @Excel(name = "是否必填", width = 15) + @ApiModelProperty(value = "是否必填") + private String isMust; + + /**参数名称*/ + @Excel(name = "参数名称", width = 15) + @ApiModelProperty(value = "参数名称") + private String paramsName; + + /**技术领域*/ + @Excel(name = "技术领域", width = 15) + @Dict(dicCode = "technology_territory") + @ApiModelProperty(value = "技术领域") + private String technologyTerritory; + + /**参数批次*/ + @Excel(name = "参数批次", width = 15) + @Dict(dicCode = "params_batch") + @ApiModelProperty(value = "参数批次") + private String paramsBatch; + + /**责任领域*/ + @Excel(name = "责任领域", width = 15) + @Dict(dicCode = "duty_territory") + @ApiModelProperty(value = "责任领域") + private String dutyTerritory; + + /**参数说明*/ + @Excel(name = "参数说明", width = 15) + @ApiModelProperty(value = "参数说明") + private String description; + + /**认证类别*/ + @Excel(name = "认证类别", width = 15) + @Dict(dicCode = "cert_category") + @ApiModelProperty(value = "认证类别") + private String certCategory; + + /**控件类型*/ + @Excel(name = "控件类型", width = 15) + @ApiModelProperty(value = "控件类型") + private String controlType; + + /**控件备选值*/ + @Excel(name = "控件备选值", width = 15) + @ApiModelProperty(value = "控件备选值") + private String controlValues; + + /**控件校验*/ + @Excel(name = "控件校验", width = 15) + @ApiModelProperty(value = "控件校验") + private String controlVerify; + + /**附件模板*/ + @Excel(name = "附件模板", width = 15) + @ApiModelProperty(value = "附件模板") + private String fileTemplateConnectId; + + /**参数模板id*/ + @Excel(name = "参数模板id", width = 15) + @ApiModelProperty(value = "参数模板id") + private String paramsTemplateId; + + @TableField(exist = false) + private List certCategoryParamsInfoEOList; // 认证类别参数列表 + +} diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/enums/ControlTypeEnum.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/enums/ControlTypeEnum.java new file mode 100644 index 000000000..87b9ce159 --- /dev/null +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/enums/ControlTypeEnum.java @@ -0,0 +1,43 @@ +package com.jero.modules.cert.template.enums; + +/** + * @Author: liyawei + * @Description: + * @Date: Created in 15:51 2022/4/22 + */ +public enum ControlTypeEnum { + TEXT("文本","1"), + PULL_SINGLE("下拉单选","2"), + PULL_MORE("下拉多选","3"), + FILE("附件","4"), + TEXT_PULL_SINGLE("文本+下拉单选","5"), + TEXT_PULL_MORE("文本+下拉多选","6"), + TEXT_FILE("文本+附件","7"), + PULL_SINGLE_FILE("下拉单选+附件","8"), + PULL_MORE_FILE("下拉多选+附件","9"), + TEXT_PULL_SINGLE_FILE("文本+下拉单选+附件","10"); + + String name; + String value; + + ControlTypeEnum(String name, String value) { + this.name = name; + this.value = value; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/enums/ControlVerifyEnum.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/enums/ControlVerifyEnum.java new file mode 100644 index 000000000..94697f0c9 --- /dev/null +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/enums/ControlVerifyEnum.java @@ -0,0 +1,42 @@ +package com.jero.modules.cert.template.enums; + +/** + * @Author: liyawei + * @Description: 控件类型为文本时需要该校验 + * @Date: Created in 15:58 2022/4/22 + */ +public enum ControlVerifyEnum { + NULL("无","1"), + CHINESE("中文","2"), + POSITIVE_INTEGER("正整数","3"), + POSITIVE_FLOAT("正浮点数","4"), + INTEGER_DECIMAL("整数或小数","5"), + DECIMAL_ONE("一位小数","6"), + DECIMAL_TWO("两位小数","7"), + DECIMAL_THREE("三位小数","8"), + DECIMAL_FOUR("四位小数","9"); + + String name; + String value; + + ControlVerifyEnum(String name, String value) { + this.name = name; + this.value = value; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/enums/IsMustEnum.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/enums/IsMustEnum.java new file mode 100644 index 000000000..5b464a0fa --- /dev/null +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/enums/IsMustEnum.java @@ -0,0 +1,35 @@ +package com.jero.modules.cert.template.enums; + +/** + * @Author: liyawei + * @Description: + * @Date: Created in 11:20 2022/4/14 + */ +public enum IsMustEnum { + YES("是","1"), + NO("否","0"); + + String name; + String value; + + IsMustEnum(String name, String value) { + this.name = name; + this.value = value; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/mapper/CertCategoryParamsInfoEOMapper.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/mapper/CertCategoryParamsInfoEOMapper.java new file mode 100644 index 000000000..aea7a2efa --- /dev/null +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/mapper/CertCategoryParamsInfoEOMapper.java @@ -0,0 +1,20 @@ +package com.jero.modules.cert.template.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.jero.modules.cert.template.entity.CertCategoryParamsInfoEO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Description: 认证类别参数信息表 + * @Author: jero-boot + * @Date: 2022-04-22 + * @Version: V1.0 + */ +public interface CertCategoryParamsInfoEOMapper extends BaseMapper { + + List selectListByNioNumber(@Param("nioNumber") String nioNumber); + + int deleteByNioNumberList(@Param("list") List nioNumberList); +} diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/mapper/ParamsInfoEOMapper.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/mapper/ParamsInfoEOMapper.java new file mode 100644 index 000000000..bc30ab0c6 --- /dev/null +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/mapper/ParamsInfoEOMapper.java @@ -0,0 +1,14 @@ +package com.jero.modules.cert.template.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.jero.modules.cert.template.entity.ParamsInfoEO; + +/** + * @Description: 参数项基本信息表 + * @Author: jero-boot + * @Date: 2022-04-22 + * @Version: V1.0 + */ +public interface ParamsInfoEOMapper extends BaseMapper { + +} diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/mapper/xml/CertCategoryParamsInfoEOMapper.xml b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/mapper/xml/CertCategoryParamsInfoEOMapper.xml new file mode 100644 index 000000000..edf706584 --- /dev/null +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/mapper/xml/CertCategoryParamsInfoEOMapper.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + delete from cert_category_params_info + where nio_number in + + #{nioNumber} + + + \ No newline at end of file diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/mapper/xml/ParamsInfoEOMapper.xml b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/mapper/xml/ParamsInfoEOMapper.xml new file mode 100644 index 000000000..ce4cbefa7 --- /dev/null +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/mapper/xml/ParamsInfoEOMapper.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/ICertCategoryParamsInfoEOService.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/ICertCategoryParamsInfoEOService.java new file mode 100644 index 000000000..7421eaee0 --- /dev/null +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/ICertCategoryParamsInfoEOService.java @@ -0,0 +1,65 @@ +package com.jero.modules.cert.template.service; + +import com.jero.modules.cert.template.entity.CertCategoryParamsInfoEO; +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + +/** + * @Description: 认证类别参数信息表 + * @Author: jero-boot + * @Date: 2022-04-22 + * @Version: V1.0 + */ +public interface ICertCategoryParamsInfoEOService extends IService { + + /** + * 保存 + * + * @param certCategoryParamsInfoEO + * @return + */ + void add(CertCategoryParamsInfoEO certCategoryParamsInfoEO); + + /** + * 更新 + * + * @param certCategoryParamsInfoEO + * @return + */ + void editById(CertCategoryParamsInfoEO certCategoryParamsInfoEO); + + /** + * 通过id删除 + * + * @param id + * @return + */ + void deleteById(String id); + + /** + * 批量删除 + * + * @param ids + * @return + */ + void deleteByIds(List ids); + + /** + * 通过id查询 + * + * @param id + * @return + */ + CertCategoryParamsInfoEO queryById(String id); + + /** + * 列表查询 + * + * @return + */ + List queryList(); + + List selectListByNioNumber(String nioNumber); + + int deleteByNioNumberList(List nioNumberList); +} diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/IParamsInfoEOService.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/IParamsInfoEOService.java new file mode 100644 index 000000000..b92d22890 --- /dev/null +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/IParamsInfoEOService.java @@ -0,0 +1,61 @@ +package com.jero.modules.cert.template.service; + +import com.jero.modules.cert.template.entity.ParamsInfoEO; +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + +/** + * @Description: 参数项基本信息表 + * @Author: jero-boot + * @Date: 2022-04-22 + * @Version: V1.0 + */ +public interface IParamsInfoEOService extends IService { + + /** + * 保存 + * + * @param paramsInfoEO + * @return + */ + void add(ParamsInfoEO paramsInfoEO); + + /** + * 更新 + * + * @param paramsInfoEO + * @return + */ + void editById(ParamsInfoEO paramsInfoEO); + + /** + * 通过id删除 + * + * @param id + * @return + */ + void deleteById(String id); + + /** + * 批量删除 + * + * @param ids + * @return + */ + void deleteByIds(List ids); + + /** + * 通过id查询 + * + * @param id + * @return + */ + ParamsInfoEO queryById(String id); + + /** + * 列表查询 + * + * @return + */ + List queryList(); +} diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/impl/CertCategoryParamsInfoEOServiceImpl.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/impl/CertCategoryParamsInfoEOServiceImpl.java new file mode 100644 index 000000000..679380e0d --- /dev/null +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/impl/CertCategoryParamsInfoEOServiceImpl.java @@ -0,0 +1,100 @@ +package com.jero.modules.cert.template.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.jero.modules.cert.template.entity.CertCategoryParamsInfoEO; +import com.jero.modules.cert.template.mapper.CertCategoryParamsInfoEOMapper; +import com.jero.modules.cert.template.service.ICertCategoryParamsInfoEOService; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * @Description: 认证类别参数信息表 + * @Author: jero-boot + * @Date: 2022-04-22 + * @Version: V1.0 + */ +@Service +public class CertCategoryParamsInfoEOServiceImpl extends ServiceImpl implements ICertCategoryParamsInfoEOService { + + /** + * 保存 + * + * @param certCategoryParamsInfoEO + * @return + */ + @Override + public void add(CertCategoryParamsInfoEO certCategoryParamsInfoEO) { + Date now = new Date(); + certCategoryParamsInfoEO.setCreateTime(now); + certCategoryParamsInfoEO.setUpdateTime(now); + save(certCategoryParamsInfoEO); + } + + /** + * 更新 + * + * @param certCategoryParamsInfoEO + * @return + */ + @Override + public void editById(CertCategoryParamsInfoEO certCategoryParamsInfoEO) { + Date now = new Date(); + certCategoryParamsInfoEO.setUpdateTime(now); + saveOrUpdate(certCategoryParamsInfoEO); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @Override + public void deleteById(String id) { + removeById(id); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @Override + public void deleteByIds(List ids) { + removeByIds(ids); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + @Override + public CertCategoryParamsInfoEO queryById(String id) { + return getById(id); + } + + /** + * 列表查询 + * + * @return + */ + @Override + public List queryList() { + return list(); + } + + @Override + public List selectListByNioNumber(String nioNumber) { + return selectListByNioNumber(nioNumber); + } + + @Override + public int deleteByNioNumberList(List nioNumberList) { + return deleteByNioNumberList(nioNumberList); + } +} diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/impl/ParamsInfoEOServiceImpl.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/impl/ParamsInfoEOServiceImpl.java new file mode 100644 index 000000000..5604afd75 --- /dev/null +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/impl/ParamsInfoEOServiceImpl.java @@ -0,0 +1,198 @@ +package com.jero.modules.cert.template.service.impl; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.jero.common.exception.JeroBootException; +import com.jero.modules.cert.template.entity.CertCategoryParamsInfoEO; +import com.jero.modules.cert.template.entity.ParamsInfoEO; +import com.jero.modules.cert.template.mapper.ParamsInfoEOMapper; +import com.jero.modules.cert.template.service.ICertCategoryParamsInfoEOService; +import com.jero.modules.cert.template.service.IParamsInfoEOService; +import com.jero.modules.oss.entity.OSSFile; +import com.jero.modules.oss.service.IOSSFileService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Description: 参数项基本信息表 + * @Author: jero-boot + * @Date: 2022-04-22 + * @Version: V1.0 + */ +@Service +@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class) +public class ParamsInfoEOServiceImpl extends ServiceImpl implements IParamsInfoEOService { + @Autowired + private ICertCategoryParamsInfoEOService certCategoryParamsInfoEOService; + + @Autowired + private IOSSFileService ossFileService; + + /** + * 保存 + * + * @param paramsInfoEO + * @return + */ + @Override + public void add(ParamsInfoEO paramsInfoEO) { + String nioNumber = paramsInfoEO.getNioNumber(); + String paramsInfoId = UUID.randomUUID().toString().replace("-", ""); + // 校验nio编号 格式:字母数字横杠(-) + String nioNumberRegex = "^[A-Za-z0-9-]+$"; + if (!nioNumber.matches(nioNumberRegex)) { + throw new JeroBootException("nio编号格式错误,仅能为字母,数字,横杠(-)"); + } + + // 批量添加认证类别参数 + List certCategoryParamsInfoEOList = paramsInfoEO.getCertCategoryParamsInfoEOList(); + if (CollectionUtil.isNotEmpty(certCategoryParamsInfoEOList)) { + // 校验认证类别参数项编号 同一nio下编号 不同类别间编号唯一 + List ccParamsInfoList = certCategoryParamsInfoEOList.stream() + .collect(Collectors.collectingAndThen(Collectors + .toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getCertCategory() + ";" + o.getParamsNumber()))), ArrayList::new)); + if (ccParamsInfoList.size() < certCategoryParamsInfoEOList.size()) { + throw new JeroBootException("不同类别间参数编号必须唯一!"); + } + certCategoryParamsInfoEOList.forEach(certCategoryParamsInfoEO -> { + certCategoryParamsInfoEO.setParamsTemplateId(paramsInfoId); + certCategoryParamsInfoEO.setNioNumber(nioNumber); + }); + certCategoryParamsInfoEOService.saveBatch(certCategoryParamsInfoEOList); + } + + // 处理附件模板 修改文件表关联信息connect_id + if (StringUtils.isNotBlank(paramsInfoEO.getFileTemplateConnectId())) { + String fileId = paramsInfoEO.getFileTemplateConnectId(); + OSSFile targetOSSFile = ossFileService.getById(fileId); + if (ObjectUtil.isNotEmpty(targetOSSFile)) { + String connectId = UUID.randomUUID().toString().replace("-", ""); + OSSFile ossFile = new OSSFile(); + ossFile.setId(fileId); + ossFile.setConnectId(connectId); + ossFileService.updateById(ossFile); + paramsInfoEO.setFileTemplateConnectId(connectId); + } else { + paramsInfoEO.setFileTemplateConnectId(null); + } + } + + paramsInfoEO.setId(paramsInfoId); + Date now = new Date(); + paramsInfoEO.setCreateTime(now); + paramsInfoEO.setUpdateTime(now); + save(paramsInfoEO); + } + + /** + * 更新 + * + * @param paramsInfoEO + * @return + */ + @Override + public void editById(ParamsInfoEO paramsInfoEO) { + String nioNumber = paramsInfoEO.getNioNumber(); + String paramsInfoId = paramsInfoEO.getId(); + + // 校验nio编号 格式:字母数字横杠(-) + String nioNumberRegex = "^[A-Za-z0-9-]+$"; + if (!nioNumber.matches(nioNumberRegex)) { + throw new JeroBootException("nio编号格式错误,仅能为字母,数字,横杠(-)"); + } + + ParamsInfoEO oldParamsInfoEO = getById(paramsInfoId); + String oldNioNumber = oldParamsInfoEO.getNioNumber(); + // 认证类别参数项 先删除后添加 + certCategoryParamsInfoEOService.deleteByNioNumberList(Arrays.asList(oldNioNumber)); + + // 批量添加认证类别参数项 + List certCategoryParamsInfoEOList = paramsInfoEO.getCertCategoryParamsInfoEOList(); + if (CollectionUtil.isNotEmpty(certCategoryParamsInfoEOList)) { + // 校验认证类别参数项编号 同一nio下编号 不同类别间编号唯一 + List ccParamsInfoList = certCategoryParamsInfoEOList.stream() + .collect(Collectors.collectingAndThen(Collectors + .toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getCertCategory() + ";" + o.getParamsNumber()))), ArrayList::new)); + if (ccParamsInfoList.size() < certCategoryParamsInfoEOList.size()) { + throw new JeroBootException("不同类别间参数编号必须唯一!"); + } + + certCategoryParamsInfoEOList.forEach(certCategoryParamsInfoEO -> { + certCategoryParamsInfoEO.setParamsTemplateId(paramsInfoId); + certCategoryParamsInfoEO.setNioNumber(nioNumber); + }); + certCategoryParamsInfoEOService.saveBatch(certCategoryParamsInfoEOList); + } + Date now = new Date(); + paramsInfoEO.setUpdateTime(now); + updateById(paramsInfoEO); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @Override + public void deleteById(String id) { + // 关联删除认证类别参数项 + ParamsInfoEO paramsInfoEO = getById(id); + String nioNumber = paramsInfoEO.getNioNumber(); + certCategoryParamsInfoEOService.deleteByNioNumberList(Arrays.asList(nioNumber)); + removeById(id); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @Override + public void deleteByIds(List ids) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.in(ParamsInfoEO::getId, ids); + List paramsInfoEOList = list(queryWrapper); + if (CollectionUtil.isNotEmpty(paramsInfoEOList)) { + List nioNumberList = paramsInfoEOList.stream().map(ParamsInfoEO::getNioNumber).collect(Collectors.toList()); + // 关联删除认证类别参数项 + certCategoryParamsInfoEOService.deleteByNioNumberList(nioNumberList); + } + + removeByIds(ids); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + @Override + public ParamsInfoEO queryById(String id) { + ParamsInfoEO paramsInfoEO = getById(id); + // 关联查询认证类别参数 + List certCategoryParamsInfoEOList = certCategoryParamsInfoEOService.selectListByNioNumber(paramsInfoEO.getNioNumber()); + paramsInfoEO.setCertCategoryParamsInfoEOList(certCategoryParamsInfoEOList); + return paramsInfoEO; + } + + /** + * 列表查询 + * + * @return + */ + @Override + public List queryList() { + return list(); + } +}