[新增] 权限申请流程 及 工作台的接口 开发完毕
This commit is contained in:
@@ -45,4 +45,5 @@ public interface PowerApplyActDao extends BaseMapper<PowerApplyAct> {
|
||||
|
||||
int batchInsert(@Param("list")List<PowerApplyAct> powerApplyActs);
|
||||
|
||||
List<PowerApplyActPageVO> selectListBydataId(@Param("dataId")String dataId);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.adc.da.report.dao.mysql;
|
||||
|
||||
import com.adc.da.report.eo.PowerApply;
|
||||
import com.adc.da.report.eo.PowerApplyAct;
|
||||
import com.adc.da.report.vo.PowerApplyPageVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -41,4 +42,6 @@ public interface PowerApplyDao extends BaseMapper<PowerApply> {
|
||||
* @description 列表查询
|
||||
*/
|
||||
List<PowerApply> queryList(@Param("pageVO") PowerApplyPageVO powerApplyPageVO);
|
||||
|
||||
int saveBatch(@Param("list") List<PowerApplyAct> powerApplies);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author bu
|
||||
* @version 1.0
|
||||
@@ -64,13 +66,13 @@ public class PowerApply {
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("create_date")
|
||||
private String createDate;
|
||||
private Date createDate;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField("update_date")
|
||||
private String updateDate;
|
||||
private Date updateDate = new Date();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,6 +6,9 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* @author bu
|
||||
* @version 1.0
|
||||
@@ -76,13 +79,13 @@ public class PowerApplyAct {
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("create_date")
|
||||
private String createDate;
|
||||
private Date createDate;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField("update_date")
|
||||
private String updateDate;
|
||||
private Date updateDate = new Date();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.adc.da.report.service.impl;
|
||||
|
||||
import com.adc.da.login.util.CommonUtils;
|
||||
import com.adc.da.login.util.UserUtils;
|
||||
import com.adc.da.report.constant.ReportConstants;
|
||||
import com.adc.da.report.dao.mysql.FileDao;
|
||||
import com.adc.da.report.dao.mysql.ReportDao;
|
||||
@@ -16,6 +17,8 @@ import com.adc.da.report.service.ITreeLabelService;
|
||||
import com.adc.da.report.util.*;
|
||||
import com.adc.da.report.vo.ReportQueryVo;
|
||||
import com.adc.da.report.vo.ReportVo;
|
||||
import com.adc.da.sys.dao.mysql.RoleEODao;
|
||||
import com.adc.da.sys.entity.RoleEO;
|
||||
import com.adc.da.util.utils.FileUtil;
|
||||
import com.adc.da.util.utils.StringUtils;
|
||||
import com.adc.da.util.utils.UUID;
|
||||
@@ -84,6 +87,9 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
||||
@Autowired
|
||||
private ObsBootUtil obsBootUtil;
|
||||
|
||||
@Autowired
|
||||
private RoleEODao roleEODao;
|
||||
|
||||
/**
|
||||
* 新增或编辑报告
|
||||
*
|
||||
@@ -347,16 +353,20 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
||||
IPage<ReportEntity> page = new Page<>();
|
||||
page.setCurrent(vo.getPageNo());
|
||||
page.setSize(vo.getPageSize());
|
||||
|
||||
//判断是不是管理员
|
||||
// boolean admin = CommonUtils.isAdmin();
|
||||
// if (admin) {
|
||||
// vo.setUsid(null);
|
||||
// } else {
|
||||
// vo.setUsid(CommonUtils.getUserId());
|
||||
// }
|
||||
|
||||
vo.setUsid(CommonUtils.getUserId());
|
||||
boolean admin = false;
|
||||
List<RoleEO> roleEOList = roleEODao.selectByuserId(UserUtils.getUserId());
|
||||
for (RoleEO roleEO : roleEOList) {
|
||||
if ("管理员".equals(roleEO.getName())){
|
||||
admin= !admin;
|
||||
}
|
||||
}
|
||||
if (admin) {
|
||||
vo.setUsid(null);
|
||||
} else {
|
||||
vo.setUsid(UserUtils.getUserId());
|
||||
}
|
||||
// vo.setUsid(CommonUtils.getUserId());
|
||||
IPage<ReportVo> list = reportDao.getAddReportPage(page, vo);
|
||||
|
||||
return list;
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.adc.da.report.vo;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author bu
|
||||
* @version 1.0
|
||||
@@ -24,6 +26,7 @@ public class PowerApplyActPageVO extends BasePageVO {
|
||||
*/
|
||||
private String taskId;
|
||||
|
||||
private String userId;
|
||||
/**
|
||||
* 数据id
|
||||
*/
|
||||
@@ -58,4 +61,80 @@ public class PowerApplyActPageVO extends BasePageVO {
|
||||
* 报告类别
|
||||
*/
|
||||
private String reportType;
|
||||
|
||||
private String reportId;
|
||||
/**
|
||||
* 原因
|
||||
*/
|
||||
private String applyReason;
|
||||
/**
|
||||
* 权限
|
||||
*/
|
||||
private String power;
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
private String keyContent;
|
||||
|
||||
/**
|
||||
* 主要内容
|
||||
*/
|
||||
private String mainContent;
|
||||
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
private String department;
|
||||
|
||||
/**
|
||||
* 年
|
||||
*/
|
||||
private String year;
|
||||
|
||||
/**
|
||||
* 文件id
|
||||
*/
|
||||
private String fileId;
|
||||
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 文件类型
|
||||
*/
|
||||
private String fileType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String createDate;
|
||||
|
||||
/**
|
||||
* 报告用户id
|
||||
*/
|
||||
private List<String> reportUserIdList;
|
||||
|
||||
/**
|
||||
* 报告涉密等级
|
||||
*/
|
||||
private String confidentialLevel;
|
||||
|
||||
/**
|
||||
* 隐私等级
|
||||
*/
|
||||
private String privacyLevel;
|
||||
|
||||
/**
|
||||
* 关联的标签id集合
|
||||
*/
|
||||
private List<String> labelList;
|
||||
|
||||
/**
|
||||
* 文件大小
|
||||
*/
|
||||
private String fileSize;
|
||||
|
||||
private String name;
|
||||
}
|
||||
|
||||
@@ -47,5 +47,7 @@ public class ReportQueryVo {
|
||||
private String usid;
|
||||
|
||||
private List<String> ids;
|
||||
//
|
||||
// private List<String> noIds;
|
||||
|
||||
}
|
||||
|
||||
@@ -92,4 +92,11 @@
|
||||
<include refid="BaseQuerySql"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
<select id="selectListBydataId" resultType="com.adc.da.report.vo.PowerApplyActPageVO">
|
||||
select a.*,
|
||||
rep.name,rep.keycontent,rep.maincontent,rep.DEPARTMENT,rep.year,rep.fileid,rep.confidentialLevel,rep.privacyLevel
|
||||
from <include refid="TableName"/> a
|
||||
left join TT_REPORT_MANAGE rep on a.report_id = rep.id
|
||||
where a.data_id = #{dataId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -44,6 +44,14 @@
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
<insert id="saveBatch">
|
||||
insert into power_apply (id,data_id, report_id, power, apply_reason, user_id, create_user_id, create_date, update_date, update_user_id, del_flag)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.id}, #{item.dataId}, #{item.reportId}, #{item.power}, #{item.applyReason}, #{item.userId}, #{item.createUserId}, #{item.createDate}, #{item.updateDate}, #{item.updateUserId}, #{item.delFlag})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<!-- 根据查询VO进行分页查询 -->
|
||||
<select id="selectPage" resultMap="BaseResultMap">
|
||||
|
||||
@@ -170,12 +170,33 @@
|
||||
|
||||
|
||||
<select id="getAddReportPage" resultType="com.adc.da.report.vo.ReportVo">
|
||||
SELECT a.*
|
||||
from (
|
||||
select * from TT_REPORT_MANAGE eo
|
||||
LEFT JOIN tr_report_user ru on eo.id = ru.reportId
|
||||
WHERE eo.DEL_FLAG = 0 and ru.userId != #{pageVO.usid}
|
||||
|
||||
SELECT
|
||||
eo.id,
|
||||
eo.NAME,
|
||||
eo.keycontent,
|
||||
eo.maincontent,
|
||||
eo.DEPARTMENT,
|
||||
eo.YEAR,
|
||||
eo.fileid,
|
||||
eo.confidentialLevel,
|
||||
eo.privacyLevel,
|
||||
pa.report_id,
|
||||
pa.user_id
|
||||
FROM
|
||||
TT_REPORT_MANAGE eo
|
||||
LEFT JOIN tr_report_user ru ON eo.id = ru.reportId
|
||||
LEFT JOIN power_apply pa ON pa.report_id = eo.id
|
||||
WHERE
|
||||
eo.DEL_FLAG = 0
|
||||
<if test="pageVO.usid !='' and pageVO.usid != null">
|
||||
and ru.userId != #{pageVO.usid}
|
||||
</if>
|
||||
<if test="pageVO.usid !='' and pageVO.usid != null">
|
||||
and eo.id not in (
|
||||
SELECT tt.report_id from power_apply tt WHERE tt.user_id = #{pageVO.usid}
|
||||
)
|
||||
</if>
|
||||
<if test="pageVO.name !='' and pageVO.name != null">
|
||||
and name like CONCAT(CONCAT('%',#{pageVO.name}),'%')
|
||||
</if>
|
||||
@@ -186,11 +207,21 @@
|
||||
#{year}
|
||||
</foreach>
|
||||
</if>
|
||||
) a
|
||||
|
||||
LEFT JOIN power_apply pa on pa.report_id = a.id
|
||||
where
|
||||
pa.user_id is null or pa.user_id != #{pageVO.usid}
|
||||
<if test="pageVO.ids != null and pageVO.ids.size() > 0">
|
||||
and eo.id in
|
||||
<foreach collection="pageVO.ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY
|
||||
eo.id
|
||||
ORDER BY
|
||||
eo.updateDate DESC
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user