认证-参数模板-增删改查
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.jero.boot</groupId>
|
||||
<artifactId>jero-boot</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jero-boot-module-certification</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.jero.boot</groupId>
|
||||
<artifactId>jero-boot-modules</artifactId>
|
||||
<version>${jero.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
+183
@@ -0,0 +1,183 @@
|
||||
package com.jero.modules.cert.template.controller;
|
||||
|
||||
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.modules.cert.template.entity.ParamsTemplateEO;
|
||||
import com.jero.modules.cert.template.service.IParamsTemplateEOService;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
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-21
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="参数模板表")
|
||||
@RestController
|
||||
@RequestMapping("/params/template")
|
||||
@Slf4j
|
||||
public class ParamsTemplateEOController extends JeroController<ParamsTemplateEO, IParamsTemplateEOService> {
|
||||
@Autowired
|
||||
private IParamsTemplateEOService paramsTemplateEOService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param paramsTemplateEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "参数模板表-分页列表查询")
|
||||
@ApiOperation(value="参数模板表-分页列表查询", notes="参数模板表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(ParamsTemplateEO paramsTemplateEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
@RequestParam(name="cut") String cut,
|
||||
HttpServletRequest req) {
|
||||
// QueryWrapper<ParamsTemplateEO> queryWrapper = QueryGenerator.initQueryWrapper(paramsTemplateEO, req.getParameterMap());
|
||||
LambdaQueryWrapper<ParamsTemplateEO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.like(StringUtils.isNotEmpty(paramsTemplateEO.getParamsTemplateName()), ParamsTemplateEO::getParamsTemplateName, paramsTemplateEO.getParamsTemplateName())
|
||||
.like(StringUtils.isNotEmpty(paramsTemplateEO.getDescription()), ParamsTemplateEO::getDescription, paramsTemplateEO.getDescription())
|
||||
.eq(StringUtils.isNotEmpty(paramsTemplateEO.getState()), ParamsTemplateEO::getState, paramsTemplateEO.getState())
|
||||
.orderByDesc(ParamsTemplateEO::getUpdateTime);
|
||||
Page<ParamsTemplateEO> page = new Page<ParamsTemplateEO>(pageNo, pageSize);
|
||||
IPage<ParamsTemplateEO> pageList = paramsTemplateEOService.page(page, queryWrapper);
|
||||
return Result.OK(cut, pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "参数模板表-列表查询")
|
||||
@ApiOperation(value="参数模板表-列表查询", notes="参数模板表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<ParamsTemplateEO>> queryList() {
|
||||
List<ParamsTemplateEO> list = paramsTemplateEOService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param paramsTemplateEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "参数模板表-添加")
|
||||
@ApiOperation(value="参数模板表-添加", notes="参数模板表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody ParamsTemplateEO paramsTemplateEO) {
|
||||
paramsTemplateEOService.add(paramsTemplateEO);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param paramsTemplateEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "参数模板表-编辑")
|
||||
@ApiOperation(value="参数模板表-编辑", notes="参数模板表-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody ParamsTemplateEO paramsTemplateEO) {
|
||||
paramsTemplateEOService.editById(paramsTemplateEO);
|
||||
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) {
|
||||
if (StringUtils.isBlank(id)) {
|
||||
return Result.error("删除数据不能为空");
|
||||
}
|
||||
paramsTemplateEOService.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) {
|
||||
if (StringUtils.isBlank(ids)) {
|
||||
return Result.error("删除数据不能为空");
|
||||
}
|
||||
this.paramsTemplateEOService.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) {
|
||||
ParamsTemplateEO paramsTemplateEO = paramsTemplateEOService.queryById(id);
|
||||
if(paramsTemplateEO==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(paramsTemplateEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param paramsTemplateEO
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ParamsTemplateEO paramsTemplateEO) {
|
||||
return super.exportXls(request, paramsTemplateEO, ParamsTemplateEO.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, ParamsTemplateEO.class);
|
||||
}
|
||||
|
||||
}
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
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 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;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 参数模板表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-04-21
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("params_template")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="params_template对象", description="参数模板表")
|
||||
public class ParamsTemplateEO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private java.lang.String id;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.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 java.lang.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 java.lang.String sysOrgCode;
|
||||
|
||||
/**参数模板*/
|
||||
@Excel(name = "参数模板", width = 15)
|
||||
@ApiModelProperty(value = "参数模板")
|
||||
private java.lang.String paramsTemplateName;
|
||||
|
||||
/**状态*/
|
||||
@Excel(name = "状态", width = 15)
|
||||
@Dict(dicCode = "params_template_state")
|
||||
@ApiModelProperty(value = "状态")
|
||||
private java.lang.String state;
|
||||
|
||||
/**适用地区*/
|
||||
@Excel(name = "适用地区", width = 15, dicCode = "region")
|
||||
@Dict(dicCode = "region")
|
||||
@ApiModelProperty(value = "适用地区")
|
||||
private java.lang.String region;
|
||||
|
||||
/**内容说明*/
|
||||
@Excel(name = "内容说明", width = 15)
|
||||
@ApiModelProperty(value = "内容说明")
|
||||
private java.lang.String description;
|
||||
|
||||
/**当前版本*/
|
||||
@Excel(name = "当前版本", width = 15)
|
||||
@ApiModelProperty(value = "当前版本")
|
||||
private java.lang.Integer version;
|
||||
|
||||
}
|
||||
+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.ParamsTemplateEO;
|
||||
|
||||
/**
|
||||
* @Description: 参数模板表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-04-21
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ParamsTemplateEOMapper extends BaseMapper<ParamsTemplateEO> {
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<?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.params.mapper.ParamsTemplateEOMapper">
|
||||
<resultMap id="ParamsTemplateEOResultMap" type="com.jero.modules.cert.template.entity.ParamsTemplateEO">
|
||||
<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_template_name" property="paramsTemplateName" />
|
||||
<result column="state" property="state" />
|
||||
<result column="region" property="region" />
|
||||
<result column="description" property="description" />
|
||||
<result column="version" property="version" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
package com.jero.modules.cert.template.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.cert.template.entity.ParamsTemplateEO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 参数模板表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-04-21
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IParamsTemplateEOService extends IService<ParamsTemplateEO> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param paramsTemplateEO
|
||||
* @return
|
||||
*/
|
||||
void add(ParamsTemplateEO paramsTemplateEO);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param paramsTemplateEO
|
||||
* @return
|
||||
*/
|
||||
void editById(ParamsTemplateEO paramsTemplateEO);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
ParamsTemplateEO queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<ParamsTemplateEO> queryList();
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
package com.jero.modules.cert.template.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.modules.cert.template.entity.ParamsTemplateEO;
|
||||
import com.jero.modules.cert.template.mapper.ParamsTemplateEOMapper;
|
||||
import com.jero.modules.cert.template.service.IParamsTemplateEOService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 参数模板表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-04-21
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class ParamsTemplateEOServiceImpl extends ServiceImpl<ParamsTemplateEOMapper, ParamsTemplateEO> implements IParamsTemplateEOService {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param paramsTemplateEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(ParamsTemplateEO paramsTemplateEO) {
|
||||
Date now = new Date();
|
||||
paramsTemplateEO.setCreateTime(now);
|
||||
paramsTemplateEO.setUpdateTime(now);
|
||||
save(paramsTemplateEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param paramsTemplateEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(ParamsTemplateEO paramsTemplateEO) {
|
||||
Date now = new Date();
|
||||
paramsTemplateEO.setUpdateTime(now);
|
||||
updateById(paramsTemplateEO);
|
||||
// saveOrUpdate(paramsTemplateEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过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 ParamsTemplateEO queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ParamsTemplateEO> queryList() {
|
||||
return list();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user