任务记录按用户目录权限查询

master
hansha 2 years ago
parent af41641e6c
commit 3368d4daf5

@ -3,6 +3,8 @@ package com.da.dangan.controller;
import com.da.common.annotation.Log; import com.da.common.annotation.Log;
import com.da.common.core.controller.BaseController; import com.da.common.core.controller.BaseController;
import com.da.common.core.domain.AjaxResult; import com.da.common.core.domain.AjaxResult;
import com.da.common.core.domain.entity.SysUser;
import com.da.common.core.domain.model.LoginUser;
import com.da.common.core.page.TableDataInfo; import com.da.common.core.page.TableDataInfo;
import com.da.common.enums.BusinessType; import com.da.common.enums.BusinessType;
import com.da.common.utils.poi.ExcelUtil; import com.da.common.utils.poi.ExcelUtil;
@ -35,6 +37,13 @@ public class DaTaskController extends BaseController
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(DaTask daTask) public TableDataInfo list(DaTask daTask)
{ {
// 超管及角色为管理员显示所有目录信息
LoginUser loginUser = getLoginUser();
if (SysUser.isAdmin(getUserId()) ||
loginUser.getUser().getRoles().stream().anyMatch(sysRole -> sysRole.getRoleKey().equals("sysAdmin"))) {
}else{
daTask.setUserId(getUserId());
}
startPage(); startPage();
List<DaTask> list = daTaskService.selectDaTaskList(daTask); List<DaTask> list = daTaskService.selectDaTaskList(daTask);
return getDataTable(list); return getDataTable(list);

@ -11,156 +11,178 @@ import com.da.common.core.domain.BaseEntity;
* @author hs * @author hs
* @date 2024-06-20 * @date 2024-06-20
*/ */
public class DaTask extends BaseEntity public class DaTask extends BaseEntity {
{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 任务id */ /**
* id
*/
private Long id; private Long id;
/** 目录id */ /**
* id
*/
@Excel(name = "目录id") @Excel(name = "目录id")
private Long muId; private Long muId;
/** 业务类型 */ /**
*
*/
@Excel(name = "业务类型") @Excel(name = "业务类型")
private String ywType; private String ywType;
/** 任务图片ids */ /**
* ids
*/
@Excel(name = "任务图片ids") @Excel(name = "任务图片ids")
private String picIds; private String picIds;
/** 任务数量 */ /**
*
*/
@Excel(name = "任务数量") @Excel(name = "任务数量")
private Long num; private Long num;
/** 档案目录路径 */ /**
*
*/
@Excel(name = "档案目录路径") @Excel(name = "档案目录路径")
private String muPath; private String muPath;
/** 任务状态(字典) */ /**
* ()
*/
@Excel(name = "任务状态(字典)") @Excel(name = "任务状态(字典)")
private String status; private String status;
/** 成功 */ /**
*
*/
@Excel(name = "成功") @Excel(name = "成功")
private Long successNum; private Long successNum;
/** 任务图片ids */ /**
* ids
*/
@Excel(name = "任务图片ids") @Excel(name = "任务图片ids")
private String successIds; private String successIds;
/** 失败 */ /**
*
*/
@Excel(name = "失败") @Excel(name = "失败")
private Long failNum; private Long failNum;
/** 任务图片ids */ /**
* ids
*/
@Excel(name = "任务图片ids") @Excel(name = "任务图片ids")
private String failIds; private String failIds;
public void setId(Long id) /**
{ * id
*/
private Long userId;
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public void setId(Long id) {
this.id = id; this.id = id;
} }
public Long getId() public Long getId() {
{
return id; return id;
} }
public void setMuId(Long muId)
{ public void setMuId(Long muId) {
this.muId = muId; this.muId = muId;
} }
public Long getMuId() public Long getMuId() {
{
return muId; return muId;
} }
public void setYwType(String ywType)
{ public void setYwType(String ywType) {
this.ywType = ywType; this.ywType = ywType;
} }
public String getYwType() public String getYwType() {
{
return ywType; return ywType;
} }
public void setPicIds(String picIds)
{ public void setPicIds(String picIds) {
this.picIds = picIds; this.picIds = picIds;
} }
public String getPicIds() public String getPicIds() {
{
return picIds; return picIds;
} }
public void setNum(Long num)
{ public void setNum(Long num) {
this.num = num; this.num = num;
} }
public Long getNum() public Long getNum() {
{
return num; return num;
} }
public void setMuPath(String muPath)
{ public void setMuPath(String muPath) {
this.muPath = muPath; this.muPath = muPath;
} }
public String getMuPath() public String getMuPath() {
{
return muPath; return muPath;
} }
public void setStatus(String status)
{ public void setStatus(String status) {
this.status = status; this.status = status;
} }
public String getStatus() public String getStatus() {
{
return status; return status;
} }
public void setSuccessNum(Long successNum)
{ public void setSuccessNum(Long successNum) {
this.successNum = successNum; this.successNum = successNum;
} }
public Long getSuccessNum() public Long getSuccessNum() {
{
return successNum; return successNum;
} }
public void setSuccessIds(String successIds)
{ public void setSuccessIds(String successIds) {
this.successIds = successIds; this.successIds = successIds;
} }
public String getSuccessIds() public String getSuccessIds() {
{
return successIds; return successIds;
} }
public void setFailNum(Long failNum)
{ public void setFailNum(Long failNum) {
this.failNum = failNum; this.failNum = failNum;
} }
public Long getFailNum() public Long getFailNum() {
{
return failNum; return failNum;
} }
public void setFailIds(String failIds)
{ public void setFailIds(String failIds) {
this.failIds = failIds; this.failIds = failIds;
} }
public String getFailIds() public String getFailIds() {
{
return failIds; return failIds;
} }
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId()) .append("id", getId())
.append("muId", getMuId()) .append("muId", getMuId())
.append("ywType", getYwType()) .append("ywType", getYwType())

@ -28,9 +28,11 @@
</sql> </sql>
<select id="selectDaTaskList" parameterType="DaTask" resultMap="DaTaskResult"> <select id="selectDaTaskList" parameterType="DaTask" resultMap="DaTaskResult">
<include refid="selectDaTaskVo"/> select distinct t.* from da_task t
left join da_user_catalog uc on t.mu_id = uc.mu_id
<where> <where>
<if test="muId != null "> and mu_id = #{muId}</if> <if test="userId != null"> and uc.user_id = #{userId}</if>
<if test="muId != null "> and t.mu_id = #{muId}</if>
<if test="ywType != null and ywType != ''"> and yw_type = #{ywType}</if> <if test="ywType != null and ywType != ''"> and yw_type = #{ywType}</if>
<if test="picIds != null and picIds != ''"> and pic_ids = #{picIds}</if> <if test="picIds != null and picIds != ''"> and pic_ids = #{picIds}</if>
<if test="num != null "> and num = #{num}</if> <if test="num != null "> and num = #{num}</if>

Loading…
Cancel
Save