认证-模板参数项-增删改查
This commit is contained in:
+171
@@ -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<CertCategoryParamsInfoEO, ICertCategoryParamsInfoEOService> {
|
||||
@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<CertCategoryParamsInfoEO> queryWrapper = QueryGenerator.initQueryWrapper(certCategoryParamsInfoEO, req.getParameterMap());
|
||||
Page<CertCategoryParamsInfoEO> page = new Page<CertCategoryParamsInfoEO>(pageNo, pageSize);
|
||||
IPage<CertCategoryParamsInfoEO> pageList = certCategoryParamsInfoEOService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "认证类别参数信息表-列表查询")
|
||||
@ApiOperation(value="认证类别参数信息表-列表查询", notes="认证类别参数信息表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<CertCategoryParamsInfoEO>> queryList() {
|
||||
List<CertCategoryParamsInfoEO> 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);
|
||||
}
|
||||
|
||||
}
|
||||
+202
@@ -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<ParamsInfoEO, IParamsInfoEOService> {
|
||||
@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<ParamsInfoEO> 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<ParamsInfoEO> page = new Page<ParamsInfoEO>(pageNo, pageSize);
|
||||
IPage<ParamsInfoEO> pageList = paramsInfoEOService.page(page, queryWrapper);
|
||||
return Result.OK(cut, pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "参数项基本信息表-列表查询")
|
||||
@ApiOperation(value="参数项基本信息表-列表查询", notes="参数项基本信息表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<ParamsInfoEO>> queryList() {
|
||||
List<ParamsInfoEO> 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<ParamsInfoEO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ParamsInfoEO::getNioNumber, nioNumber);
|
||||
List<ParamsInfoEO> 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);
|
||||
}
|
||||
|
||||
}
|
||||
+91
@@ -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;
|
||||
|
||||
}
|
||||
+136
@@ -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<CertCategoryParamsInfoEO> certCategoryParamsInfoEOList; // 认证类别参数列表
|
||||
|
||||
}
|
||||
+43
@@ -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;
|
||||
}
|
||||
}
|
||||
+42
@@ -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;
|
||||
}
|
||||
}
|
||||
+35
@@ -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;
|
||||
}
|
||||
}
|
||||
+20
@@ -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<CertCategoryParamsInfoEO> {
|
||||
|
||||
List<CertCategoryParamsInfoEO> selectListByNioNumber(@Param("nioNumber") String nioNumber);
|
||||
|
||||
int deleteByNioNumberList(@Param("list") List<String> nioNumberList);
|
||||
}
|
||||
+14
@@ -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<ParamsInfoEO> {
|
||||
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.cert.template.mapper.CertCategoryParamsInfoEOMapper">
|
||||
<resultMap id="CertCategoryParamsInfoEOResultMap" type="com.jero.modules.cert.template.entity.CertCategoryParamsInfoEO">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="params_number" property="paramsNumber" />
|
||||
<result column="params_name" property="paramsName" />
|
||||
<result column="description" property="description" />
|
||||
<result column="nio_number" property="nioNumber" />
|
||||
<result column="cert_category" property="certCategory" />
|
||||
<result column="params_template_id" property="paramsTemplateId" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectListByNioNumber" resultMap="CertCategoryParamsInfoEOResultMap" parameterType="java.lang.String">
|
||||
select *
|
||||
from cert_category_params_info
|
||||
where nio_number = #{nioNumber}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByNioNumberList" parameterType="java.util.List">
|
||||
delete from cert_category_params_info
|
||||
where nio_number in
|
||||
<foreach collection="list" index="index" separator="," open="(" close=")" item="nioNumber">
|
||||
#{nioNumber}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.cert.template.mapper.ParamsInfoEOMapper">
|
||||
<resultMap id="ParamsInfoEOResultMap" type="com.jero.modules.cert.template.entity.ParamsInfoEO">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="nio_number" property="nioNumber" />
|
||||
<result column="is_must" property="isMust" />
|
||||
<result column="params_name" property="paramsName" />
|
||||
<result column="technology_territory" property="technologyTerritory" />
|
||||
<result column="params_batch" property="paramsBatch" />
|
||||
<result column="duty_territory" property="dutyTerritory" />
|
||||
<result column="description" property="description" />
|
||||
<result column="cert_category" property="certCategory" />
|
||||
<result column="control_type" property="controlType" />
|
||||
<result column="control_values" property="controlValues" />
|
||||
<result column="control_verify" property="controlVerify" />
|
||||
<result column="file_template_connect_id" property="fileTemplateConnectId" />
|
||||
<result column="params_template_id" property="paramsTemplateId" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+65
@@ -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<CertCategoryParamsInfoEO> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @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<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
CertCategoryParamsInfoEO queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<CertCategoryParamsInfoEO> queryList();
|
||||
|
||||
List<CertCategoryParamsInfoEO> selectListByNioNumber(String nioNumber);
|
||||
|
||||
int deleteByNioNumberList(List<String> nioNumberList);
|
||||
}
|
||||
+61
@@ -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<ParamsInfoEO> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @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<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
ParamsInfoEO queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<ParamsInfoEO> queryList();
|
||||
}
|
||||
+100
@@ -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<CertCategoryParamsInfoEOMapper, CertCategoryParamsInfoEO> 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<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public CertCategoryParamsInfoEO queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<CertCategoryParamsInfoEO> queryList() {
|
||||
return list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CertCategoryParamsInfoEO> selectListByNioNumber(String nioNumber) {
|
||||
return selectListByNioNumber(nioNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByNioNumberList(List<String> nioNumberList) {
|
||||
return deleteByNioNumberList(nioNumberList);
|
||||
}
|
||||
}
|
||||
+198
@@ -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<ParamsInfoEOMapper, ParamsInfoEO> 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<CertCategoryParamsInfoEO> certCategoryParamsInfoEOList = paramsInfoEO.getCertCategoryParamsInfoEOList();
|
||||
if (CollectionUtil.isNotEmpty(certCategoryParamsInfoEOList)) {
|
||||
// 校验认证类别参数项编号 同一nio下编号 不同类别间编号唯一
|
||||
List<CertCategoryParamsInfoEO> 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<CertCategoryParamsInfoEO> certCategoryParamsInfoEOList = paramsInfoEO.getCertCategoryParamsInfoEOList();
|
||||
if (CollectionUtil.isNotEmpty(certCategoryParamsInfoEOList)) {
|
||||
// 校验认证类别参数项编号 同一nio下编号 不同类别间编号唯一
|
||||
List<CertCategoryParamsInfoEO> 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<String> ids) {
|
||||
LambdaQueryWrapper<ParamsInfoEO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(ParamsInfoEO::getId, ids);
|
||||
List<ParamsInfoEO> paramsInfoEOList = list(queryWrapper);
|
||||
if (CollectionUtil.isNotEmpty(paramsInfoEOList)) {
|
||||
List<String> 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<CertCategoryParamsInfoEO> certCategoryParamsInfoEOList = certCategoryParamsInfoEOService.selectListByNioNumber(paramsInfoEO.getNioNumber());
|
||||
paramsInfoEO.setCertCategoryParamsInfoEOList(certCategoryParamsInfoEOList);
|
||||
return paramsInfoEO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ParamsInfoEO> queryList() {
|
||||
return list();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user