[新增] 上传报告流程开发

This commit is contained in:
bupengxiang
2023-05-04 16:30:42 +08:00
parent 6ed1a2d061
commit 9ba6760fef
16 changed files with 923 additions and 7 deletions
@@ -0,0 +1,116 @@
package com.adc.da.report.controller;
import com.adc.da.report.eo.TtReportManageAct;
import com.adc.da.report.service.impl.ITtReportManageActServiceImpl;
import com.adc.da.report.vo.DeleteParamRequestVO;
import com.adc.da.report.vo.TtReportManageActPageVO;
import com.adc.da.util.http.ResponseMessage;
import com.adc.da.util.http.Result;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author bu
* @version 1.0
* @description 前端控制器
* @date 2023-05-04
*/
@Slf4j
@RestController
@RequestMapping("/${restPath}/report/ttReportManageAct")
@Api(tags = "report|")
public class TtReportManageActController {
@Autowired
private ITtReportManageActServiceImpl ttReportManageActService;
/**
* @param ttReportManageActPageVO
* @return com.adc.da.util.http.ResponseMessage
* @author bu
* @date 2023-05-04
* @description 分页查询
*/
@PostMapping(value = "/page")
@ApiOperation(value = "分页查询")
@ApiImplicitParam(name = "ttReportManageActPageVO", value = "查询条件VO", dataType = "TtReportManageActPageVO")
public ResponseMessage<Page<TtReportManageAct>> page(@RequestBody TtReportManageActPageVO ttReportManageActPageVO){
//分页查询
Page<TtReportManageAct> ttReportManageActIPage = ttReportManageActService.selectPage(ttReportManageActPageVO);
return Result.success(ttReportManageActIPage);
}
/**
* @param ttReportManageActPageVO
* @return com.adc.da.util.http.ResponseMessage
* @author bu
* @date 2023-05-04
* @description 列表查询
*/
@PostMapping("/list")
@ApiOperation(value = "列表查询")
@ApiImplicitParam(name = "ttReportManageActPageVO", value = "查询条件VO", dataType = "TtReportManageActPageVO")
public ResponseMessage<List<TtReportManageAct>> list(@RequestBody TtReportManageActPageVO ttReportManageActPageVO) {
//列表查询
List<TtReportManageAct> ttReportManageActList = ttReportManageActService.selectList(ttReportManageActPageVO);
return Result.success(ttReportManageActList);
}
/**
* @param id
* @return com.adc.da.util.http.ResponseMessage
* @author bu
* @date 2023-05-04
* @description 根据id查询
*/
@GetMapping("/info/{id}")
@ApiOperation(value = "根据id查询")
@ApiImplicitParam(name = "id", value = "主键ID", dataType = "String")
public ResponseMessage<TtReportManageAct> info(@PathVariable("id") String id){
//根据id查询
TtReportManageAct ttReportManageAct = ttReportManageActService.selectById(id);
return Result.success(ttReportManageAct);
}
/**
* @param ttReportManageAct
* @return com.adc.da.util.http.ResponseMessage
* @author bu
* @date 2023-05-04
* @description 单条数据新增/更改
*/
@PostMapping("/saveOrUpdate")
@ApiOperation(value = "单条数据新增/更改")
@ApiImplicitParam(name = "ttReportManageAct", value = " TtReportManageAct实体", dataType = "TtReportManageAct")
public ResponseMessage<String> saveOrUpdate(@RequestBody TtReportManageAct ttReportManageAct){
//单条数据新增/更改
ttReportManageActService.saveOrUpdateSingle(ttReportManageAct);
return Result.success(ttReportManageAct.getId());
}
/**
* @param deleteParamRequestVO
* @return com.adc.da.util.http.ResponseMessage
* @author bu
* @date 2023-05-04
* @description 根据id或id数组进行删除
*/
@DeleteMapping("/delete")
@ApiOperation(value = "单条/批量删除数据")
public ResponseMessage delete(@RequestBody DeleteParamRequestVO deleteParamRequestVO){
//单条/批量删除数据
ttReportManageActService.deleteById(deleteParamRequestVO);
return Result.success();
}
}
@@ -46,4 +46,5 @@ public interface PowerApplyActDao extends BaseMapper<PowerApplyAct> {
int batchInsert(@Param("list")List<PowerApplyAct> powerApplyActs);
List<PowerApplyActPageVO> selectListBydataId(@Param("dataId")String dataId);
}
@@ -0,0 +1,48 @@
package com.adc.da.report.dao.mysql;
import com.adc.da.report.eo.TtReportManageAct;
import com.adc.da.report.vo.TtReportManageActPageVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author bu
* @version 1.0
* @description Mapper接口
* @date 2023-05-04
*/
public interface TtReportManageActDao extends BaseMapper<TtReportManageAct> {
/**
* @param ttReportManageActPageVO
* @param page
* @author bu
* @date 2023-05-04
* @description 使用分页插件进行查询
*/
List<TtReportManageAct> selectPage(Page<TtReportManageAct> page, @Param("pageVO") TtReportManageActPageVO ttReportManageActPageVO);
/**
* @param ttReportManageActPageVO
* @param page
* @author bu
* @date 2023-05-04
* @description 使用分页插件进行查询总数
*/
Long selectPageCount(@Param("pageVO") TtReportManageActPageVO ttReportManageActPageVO);
/**
* @param ttReportManageActPageVO
* @return java.util.List
* @author bu
* @date 2023-05-04
* @description 列表查询
*/
List<TtReportManageAct> queryList(@Param("pageVO") TtReportManageActPageVO ttReportManageActPageVO);
TtReportManageActPageVO selectByDataId(String dataId);
}
@@ -0,0 +1,122 @@
package com.adc.da.report.eo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author bu
* @version 1.0
* @description
* @date 2023-05-04
*/
@Data
@TableName("tt_report_manage_act")
public class TtReportManageAct {
@TableField(exist = false)
private String id;
/**
* 任务id
*/
@TableField("task_id")
private String taskId;
/**
* 流程id
*/
@TableField("prc_id")
private String prcId;
/**
* 数据id
*/
@TableField("data_id")
private String dataId;
/**
* 报告名
*/
@TableField("name")
private String name;
/**
* 关键字
*/
@TableField("keycontent")
private String keyContent;
/**
* 主要内容
*/
@TableField("maincontent")
private String mainContent;
/**
* 部门
*/
@TableField("department")
private String department;
/**
* 年
*/
@TableField("year")
private String year;
/**
* 报告涉密等级
*/
@TableField("confidentialLevel")
private String confidentialLevel;
/**
* 隐私等级
*/
@TableField("privacyLevel")
private String privacyLevel;
/**
* 文件id
*/
@TableField("fileId")
private String fileId;
/**
*
*/
private String createUserId;
/**
*
*/
private Date createDate;
/**
*
*/
private Date updateDate = new Date();
/**
*
*/
@TableField("del_flag")
private Integer delFlag;
/**
* 创建人id
*/
@TableField("update_user_id")
private String updateUserId;
/**
* 权限设置
*/
private List<PowerApplyAct> powerList;
}
@@ -0,0 +1,21 @@
package com.adc.da.report.service;
import com.adc.da.report.eo.TtReportManageAct;
import com.adc.da.report.vo.DeleteParamRequestVO;
import com.adc.da.report.vo.TtReportManageActPageVO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
public interface ITtReportManageActService {
Page<TtReportManageAct> selectPage(TtReportManageActPageVO ttReportManageActPageVO);
List<TtReportManageAct> selectList(TtReportManageActPageVO ttReportManageActPageVO);
TtReportManageAct selectById(String id);
void saveOrUpdateSingle(TtReportManageAct ttReportManageAct);
void deleteById(DeleteParamRequestVO deleteParamVO);
}
@@ -0,0 +1,111 @@
package com.adc.da.report.service.impl;
import com.adc.da.report.dao.mysql.TtReportManageActDao;
import com.adc.da.report.eo.TtReportManageAct;
import com.adc.da.report.service.ITtReportManageActService;
import com.adc.da.report.vo.DeleteParamRequestVO;
import com.adc.da.report.vo.TtReportManageActPageVO;
import com.adc.da.util.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.List;
/**
* @author bu
* @version 1.0
* @description 服务实现类
* @date 2023-05-04
*/
@Slf4j
@Service
public class ITtReportManageActServiceImpl extends ServiceImpl<TtReportManageActDao, TtReportManageAct> implements ITtReportManageActService {
/**
* @param ttReportManageActPageVO
* @return <com.adc.da.report.entity.TtReportManageAct>
* @author bu
* @date 2023-05-04
* @description 分页查询
*/
public Page<TtReportManageAct> selectPage(TtReportManageActPageVO ttReportManageActPageVO){
Page<TtReportManageAct> page = new Page<>(ttReportManageActPageVO.getCurrent(),
ttReportManageActPageVO.getSize());
page.setRecords(baseMapper.selectPage(page, ttReportManageActPageVO));
Long total = baseMapper.selectPageCount(ttReportManageActPageVO);
page.setTotal(total);
return page;
}
/**
* @param ttReportManageActPageVO
* @return java.util.List<com.adc.da.report.entity.TtReportManageAct>
* @author bu
* @date 2023-05-04
* @description 列表查询
*/
public List<TtReportManageAct> selectList(TtReportManageActPageVO ttReportManageActPageVO) {
return baseMapper.queryList(ttReportManageActPageVO);
}
/**
* @param id
* @return com.adc.da.report.entity.TtReportManageAct
* @author bu
* @date 2023-05-04
* @description 根据id查询
*/
public TtReportManageAct selectById(String id) {
return baseMapper.selectById(id);
}
/**
* @param ttReportManageAct
* @return boolean
* @author bu
* @date 2023-05-04
* @description 单条数据新增/更改
*/
public void saveOrUpdateSingle(TtReportManageAct ttReportManageAct) {
if (StringUtils.isEmpty(ttReportManageAct.getId())) {
baseMapper.insert(ttReportManageAct);
} else {
baseMapper.updateById(ttReportManageAct);
}
}
/**
* @param deleteParamVO
* @return void
* @author bu
* @date 2023-05-04
* @description 根据id或id数组进行删除
*/
public void deleteById(DeleteParamRequestVO deleteParamVO) {
if (ObjectUtils.isEmpty(deleteParamVO)) {
return;
}
List<String> ids = new ArrayList<>();
if (!ObjectUtils.isEmpty(deleteParamVO.getId())) {
ids.add(deleteParamVO.getId());
}
if (!ObjectUtils.isEmpty(deleteParamVO.getIds())) {
ids.addAll(deleteParamVO.getIds());
}
if (ObjectUtils.isEmpty(deleteParamVO)) {
return;
}
QueryWrapper<TtReportManageAct> wrapper = new QueryWrapper();
wrapper.in("id",ids);
TtReportManageAct ttReportManageAct = new TtReportManageAct();
ttReportManageAct.setDelFlag(1);
baseMapper.update(ttReportManageAct,wrapper);
}
}
@@ -0,0 +1,96 @@
package com.adc.da.report.vo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
/**
* @author bu
* @version 1.0
* @description 查询条件VO
* @date 2023-05-04
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class TtReportManageActPageVO extends BasePageVO {
/**
* 任务id
*/
private String taskId;
/**
* 流程id
*/
private String prcId;
/**
* 数据id
*/
private String dataId;
/**
*
*/
private String name;
/**
*
*/
private String keycontent;
/**
*
*/
private String maincontent;
/**
*
*/
private String department;
/**
*
*/
private String year;
/**
*
*/
private String fileId;
/**
*
*/
private String confidentialLevel;
/**
*
*/
private String privacyLevel;
/**
*
*/
private String createUserId;
/**
*
*/
private Date createDate;
/**
*
*/
private Date updateDate;
/**
*
*/
private Integer delFlag;
private List<PowerApplyActPageVO> powerList;
}
@@ -0,0 +1,128 @@
<?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.adc.da.report.dao.mysql.TtReportManageActDao">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.adc.da.report.eo.TtReportManageAct">
<result column="id" property="id" />
<result column="task_id" property="taskId" />
<result column="prc_id" property="prcId" />
<result column="data_id" property="dataId" />
<result column="name" property="name" />
<result column="keycontent" property="keyContent" />
<result column="maincontent" property="mainContent" />
<result column="department" property="department" />
<result column="year" property="year" />
<result column="fileId" property="fileId" />
<result column="confidentialLevel" property="confidentialLevel" />
<result column="privacyLevel" property="privacyLevel" />
<result column="createUserId" property="createUserId" />
<result column="createDate" property="createDate" />
<result column="updateDate" property="updateDate" />
<result column="del_flag" property="delFlag" />
</resultMap>
<!--表名信息-->
<sql id="TableName">
tt_report_manage_act
</sql>
<!-- 通用查询结果列 -->
<sql id="BaseColumnList">
id,
task_id, prc_id, data_id, name, keycontent, maincontent, department, year, fileId, confidentialLevel, privacyLevel, createUserId, createDate, updateDate, del_flag
</sql>
<!-- 查询条件 -->
<sql id="BaseQuerySql">
<where>
AND del = '${@com.adc.da.sys.constant.YesOrNoEnum@NO.value}'
<if test="pageVO != null">
<if test="pageVO.taskId !=null and pageVO.taskId !=''">
AND task_id LIKE CONCAT(CONCAT('%',#{pageVO.taskId}),'%')
</if>
<if test="pageVO.prcId !=null and pageVO.prcId !=''">
AND prc_id LIKE CONCAT(CONCAT('%',#{pageVO.prcId}),'%')
</if>
<if test="pageVO.dataId !=null and pageVO.dataId !=''">
AND data_id LIKE CONCAT(CONCAT('%',#{pageVO.dataId}),'%')
</if>
<if test="pageVO.name !=null and pageVO.name !=''">
AND name LIKE CONCAT(CONCAT('%',#{pageVO.name}),'%')
</if>
<if test="pageVO.keyContent !=null and pageVO.keyContent !=''">
AND keycontent LIKE CONCAT(CONCAT('%',#{pageVO.keyContent}),'%')
</if>
<if test="pageVO.mainContent !=null and pageVO.mainContent !=''">
AND maincontent LIKE CONCAT(CONCAT('%',#{pageVO.mainContent}),'%')
</if>
<if test="pageVO.department !=null and pageVO.department !=''">
AND department LIKE CONCAT(CONCAT('%',#{pageVO.department}),'%')
</if>
<if test="pageVO.year !=null and pageVO.year !=''">
AND year LIKE CONCAT(CONCAT('%',#{pageVO.year}),'%')
</if>
<if test="pageVO.fileId !=null and pageVO.fileId !=''">
AND fileId LIKE CONCAT(CONCAT('%',#{pageVO.fileId}),'%')
</if>
<if test="pageVO.confidentialLevel !=null and pageVO.confidentialLevel !=''">
AND confidentialLevel LIKE CONCAT(CONCAT('%',#{pageVO.confidentialLevel}),'%')
</if>
<if test="pageVO.privacyLevel !=null and pageVO.privacyLevel !=''">
AND privacyLevel LIKE CONCAT(CONCAT('%',#{pageVO.privacyLevel}),'%')
</if>
<if test="pageVO.createUserId !=null and pageVO.createUserId !=''">
AND createUserId LIKE CONCAT(CONCAT('%',#{pageVO.createUserId}),'%')
</if>
<if test="pageVO.createDate !=null">
AND createDate = #{pageVO.createDate}
</if>
<if test="pageVO.updateDate !=null">
AND updateDate = #{pageVO.updateDate}
</if>
<if test="pageVO.delFlag !=null">
AND del_flag = #{pageVO.delFlag}
</if>
</if>
</where>
</sql>
<!-- 根据查询VO进行分页查询 -->
<select id="selectPage" resultMap="BaseResultMap">
SELECT
<include refid="BaseColumnList"/>
FROM <include refid="TableName"/>
<include refid="BaseQuerySql"/>
ORDER BY create_time DESC
</select>
<!-- 根据查询VO进行分页查询总数 -->
<select id="selectPageCount" resultType="java.lang.Long">
SELECT
COUNT(1)
FROM (
SELECT
<include refid="BaseColumnList"/>
FROM <include refid="TableName"/>
<include refid="BaseQuerySql"/>
)a
</select>
<!-- 根据查询VO进行列表查询 -->
<select id="queryList" resultMap="BaseResultMap">
SELECT
<include refid="BaseColumnList"/>
FROM <include refid="TableName"/>
<include refid="BaseQuerySql"/>
ORDER BY create_time DESC
</select>
<select id="selectByDataId" resultType="com.adc.da.report.vo.TtReportManageActPageVO">
SELECT
<include refid="BaseColumnList"/>
FROM <include refid="TableName"/>
<where>
data_id = #{dataId}
</where>
</select>
</mapper>