Commit b06c5b70 authored by hongguangwu's avatar hongguangwu

档案相关权限-优化

parent 1e40227a
......@@ -2,10 +2,15 @@ package com.yifu.cloud.plus.v1.yifu.salary.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.SysMessageSalary;
import com.yifu.cloud.plus.v1.yifu.salary.service.SysMessageSalaryService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.SysMessageSalarySearchVo;
......@@ -31,7 +36,7 @@ import javax.servlet.http.HttpServletResponse;
public class SysMessageSalaryController {
private final SysMessageSalaryService sysMessageSalaryService;
private final MenuUtil menuUtil;
/**
* 简单分页查询
* @param page 分页对象
......@@ -41,6 +46,11 @@ public class SysMessageSalaryController {
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<SysMessageSalary>> getSysMessageSalaryPage(Page<SysMessageSalary> page, SysMessageSalary sysMessageSalary) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, sysMessageSalary);
if (Common.isNotNull(sysMessageSalary.getAuthSql()) && sysMessageSalary.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
sysMessageSalary.setAuthSql(sysMessageSalary.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.DEPART_ID"));
}
return new R<>(sysMessageSalaryService.getSysMessageSalaryPage(page, sysMessageSalary));
}
......@@ -115,6 +125,11 @@ public class SysMessageSalaryController {
@PostMapping("/export")
public void export(HttpServletResponse response,
@RequestBody SysMessageSalarySearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
if (Common.isNotNull(searchVo.getAuthSql()) && searchVo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
searchVo.setAuthSql(searchVo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.DEPART_ID"));
}
sysMessageSalaryService.listExport(response,searchVo);
}
......
......@@ -4,8 +4,13 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TConfigSalary;
import com.yifu.cloud.plus.v1.yifu.salary.service.TConfigSalaryService;
import com.yifu.cloud.plus.v1.yifu.salary.util.SalaryConstants;
......@@ -33,7 +38,7 @@ import java.util.List;
public class TConfigSalaryController {
private final TConfigSalaryService tConfigSalaryService;
private final MenuUtil menuUtil;
/**
* @param settleDepart 结算主体id
* @Description: 获取结算主体下的配置信息
......@@ -64,6 +69,11 @@ public class TConfigSalaryController {
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TConfigSalary>> getTConfigSalaryPage(Page<TConfigSalary> page, TConfigSalary tConfigSalary) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, tConfigSalary);
if (Common.isNotNull(tConfigSalary.getAuthSql()) && tConfigSalary.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
tConfigSalary.setAuthSql(tConfigSalary.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.DEPART_ID"));
}
return tConfigSalaryService.getTConfigSalaryPage(page, tConfigSalary);
}
......
......@@ -20,8 +20,13 @@ package com.yifu.cloud.plus.v1.yifu.salary.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TDeptSee;
import com.yifu.cloud.plus.v1.yifu.salary.service.TDeptSeeService;
import com.yifu.cloud.plus.v1.yifu.salary.util.SalaryConstants;
......@@ -49,7 +54,7 @@ public class TDeptSeeController {
private final TDeptSeeService tDeptSeeService;
private final MenuUtil menuUtil;
/**
* 简单分页查询
*
......@@ -60,6 +65,11 @@ public class TDeptSeeController {
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TDeptSee>> getTDeptSeePage(Page<TDeptSee> page, TDeptSeeSearchVo tDeptSee) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, tDeptSee);
if (Common.isNotNull(tDeptSee.getAuthSql()) && tDeptSee.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
tDeptSee.setAuthSql(tDeptSee.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.ID"));
}
return new R<>(tDeptSeeService.getTDeptSeePage(page, tDeptSee));
}
......
......@@ -2,10 +2,15 @@ package com.yifu.cloud.plus.v1.yifu.salary.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.THaveSalaryNosocial;
import com.yifu.cloud.plus.v1.yifu.salary.service.THaveSalaryNosocialService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.THaveSalaryNosocialSearchVo;
......@@ -35,7 +40,7 @@ import javax.validation.Valid;
public class THaveSalaryNosocialController {
private final THaveSalaryNosocialService tHaveSalaryNosocialService;
private final MenuUtil menuUtil;
/**
* 简单分页查询
*
......@@ -46,6 +51,11 @@ public class THaveSalaryNosocialController {
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<THaveSalaryNosocial>> getTHaveSalaryNosocialPage(Page<THaveSalaryNosocial> page, THaveSalaryNosocial tHaveSalaryNosocial) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, tHaveSalaryNosocial);
if (Common.isNotNull(tHaveSalaryNosocial.getAuthSql()) && tHaveSalaryNosocial.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
tHaveSalaryNosocial.setAuthSql(tHaveSalaryNosocial.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.SETTLE_DOMAIN_ID"));
}
return new R<>(tHaveSalaryNosocialService.getTHaveSalaryNosocialPage(page, tHaveSalaryNosocial));
}
......@@ -129,6 +139,11 @@ public class THaveSalaryNosocialController {
@PostMapping("/export")
public void export(HttpServletResponse response,
@RequestBody THaveSalaryNosocialSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
if (Common.isNotNull(searchVo.getAuthSql()) && searchVo.getAuthSql().contains(CommonConstants.A_DEPT_ID)) {
searchVo.setAuthSql(searchVo.getAuthSql().replace(CommonConstants.A_DEPT_ID, "a.SETTLE_DOMAIN_ID"));
}
tHaveSalaryNosocialService.listExport(response,searchVo);
}
......
......@@ -23,8 +23,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.constants.SalaryConstants;
import com.yifu.cloud.plus.v1.yifu.salary.entity.THaveSalaryNosocial;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
......@@ -61,6 +64,7 @@ public class TSalaryAccountController {
private final TSalaryAccountItemService tSalaryAccountItemService;
private final MenuUtil menuUtil;
/**
* 简单分页查询
......@@ -73,6 +77,8 @@ public class TSalaryAccountController {
@GetMapping("/page")
public R<IPage<TSalaryAccount>> getTSalaryAccountPage(Page<TSalaryAccount> page, TSalaryAccountSearchVo tSalaryAccount) {
tSalaryAccount.setDeleteFlag(CommonConstants.ZERO_INT);
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, tSalaryAccount);
return new R<>(tSalaryAccountService.getTSalaryAccountPage(page, tSalaryAccount));
}
......@@ -153,6 +159,8 @@ public class TSalaryAccountController {
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('salary_tsalaryaccount-export')")
public void export(HttpServletResponse response, @RequestBody TSalaryAccountSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
tSalaryAccountService.listExport(response, searchVo);
}
......
......@@ -19,8 +19,13 @@ package com.yifu.cloud.plus.v1.yifu.salary.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryEmployee;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryEmployeeService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmployeeExportVo;
......@@ -49,6 +54,7 @@ public class TSalaryEmployeeController {
private final TSalaryEmployeeService tSalaryEmployeeService;
private final MenuUtil menuUtil;
/**
* 简单分页查询
......@@ -60,6 +66,11 @@ public class TSalaryEmployeeController {
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TSalaryEmployee>> getTSalaryEmployeePage(Page<TSalaryEmployee> page, TSalaryEmployeeSearchVo tSalaryEmployee) {
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
}
menuUtil.setAuthSql(user, tSalaryEmployee);
return new R<>(tSalaryEmployeeService.getTSalaryEmployeePage(page, tSalaryEmployee));
}
......@@ -140,6 +151,10 @@ public class TSalaryEmployeeController {
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('salary_tsalaryemployee-export')")
public void export(HttpServletResponse response, @RequestBody TSalaryEmployeeSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
if (user != null && Common.isNotNull(user.getId())) {
menuUtil.setAuthSql(user, searchVo);
}
tSalaryEmployeeService.listExport(response, searchVo);
}
}
......@@ -80,7 +80,9 @@ public class TSalaryStandardController {
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TSalaryStandard>> getTSalaryStandardPage(Page<TSalaryStandard> page, TSalaryStandardSearchVo tSalaryStandard) {
YifuUser user = SecurityUtils.getUser();
tSalaryStandard.setDeleteFlag(CommonConstants.ZERO_INT);
menuUtil.setAuthSql(user, tSalaryStandard);
return new R<>(tSalaryStandardService.getTSalaryStandardPage(page, tSalaryStandard));
}
......@@ -134,6 +136,10 @@ public class TSalaryStandardController {
@PostMapping("/export")
//@PreAuthorize("@pms.hasPermission('salary_tsalarystandard-export')")
public void export(HttpServletResponse response, @RequestBody TSalaryStandardSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
if (user != null && Common.isNotNull(user.getId())) {
menuUtil.setAuthSql(user, searchVo);
}
tSalaryStandardService.listExport(response, searchVo);
}
......
......@@ -33,6 +33,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo;
import com.yifu.cloud.plus.v1.check.entity.TCheckMobile;
import com.yifu.cloud.plus.v1.check.vo.CheckBankNoVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCertRecord;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
......@@ -159,11 +160,15 @@ public class TSalaryEmployeeServiceImpl extends ServiceImpl<TSalaryEmployeeMappe
if (Common.isNotNull(idList)) {
wrapper.in(TSalaryEmployee::getId, idList);
}
if (Common.isNotNull(searchVo.getAuthSql())) {
wrapper.last(searchVo.getAuthSql());
}
return baseMapper.selectCount(wrapper);
}
private LambdaQueryWrapper buildQueryWrapper(TSalaryEmployeeSearchVo entity) {
LambdaQueryWrapper<TSalaryEmployee> wrapper = Wrappers.lambdaQuery();
wrapper.ne(TSalaryEmployee::getId,CommonConstants.ZERO_STRING);
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(TSalaryEmployee::getCreateTime, entity.getCreateTimes()[0])
.le(TSalaryEmployee::getCreateTime,
......
......@@ -130,8 +130,11 @@
FROM sys_message_salary a
left join t_feed_back b on a.ID=b.RELATE_ID
<where>
<include refid="sysMessageSalarySql"/>
<include refid="sysMessageSalary_where"/>
<include refid="sysMessageSalarySql"/>
<include refid="sysMessageSalary_where"/>
<if test="sysMessageSalary.authSql != null and sysMessageSalary.authSql.trim() != ''">
${sysMessageSalary.authSql}
</if>
order by a.CREATE_TIME desc
</where>
</select>
......@@ -300,6 +303,9 @@
1=1 and ((b.IGNORE_FLAG=1 and b.TYPE=2) or (b.id is null))
<include refid="export_sql"/>
<if test="sysMessageSalary != null">
<if test="sysMessageSalary.authSql != null and sysMessageSalary.authSql.trim() != ''">
${sysMessageSalary.authSql}
</if>
<if test="sysMessageSalary.limitStart != null">
limit #{sysMessageSalary.limitStart},#{sysMessageSalary.limitEnd}
</if>
......@@ -316,6 +322,9 @@
<where>
1=1 and ((b.IGNORE_FLAG=1 and b.TYPE=2) or (b.id is null))
<include refid="export_sql"/>
<if test="sysMessageSalary.authSql != null and sysMessageSalary.authSql.trim() != ''">
${sysMessageSalary.authSql}
</if>
</where>
</select>
<sql id="export_sql">
......
......@@ -75,6 +75,9 @@
#{param}
</foreach>
</if>
<if test="tConfigSalary.authSql != null and tConfigSalary.authSql.trim() != ''">
${tConfigSalary.authSql}
</if>
</where>
order by CREATE_TIME DESC
</select>
......
......@@ -84,6 +84,9 @@
<where>
1=1
<include refid="tDeptSee_where"/>
<if test="tDeptSee.authSql != null and tDeptSee.authSql.trim() != ''">
${tDeptSee.authSql}
</if>
order by a.CREATE_TIME DESC
</where>
</select>
......
......@@ -156,6 +156,9 @@
AND b.REASON_TYPE = #{tHaveSalaryNosocial.reasonType}
</if>
<include refid="tHaveSalaryNosocial_where"/>
<if test="tHaveSalaryNosocial.authSql != null and tHaveSalaryNosocial.authSql.trim() != ''">
${tHaveSalaryNosocial.authSql}
</if>
</where>
</select>
......@@ -166,6 +169,9 @@
<where>
1=1 and ((b.IGNORE_FLAG=1 and b.TYPE=1) or (b.id is null))
<include refid="tHaveSalaryNosocial_where"/>
<if test="tHaveSalaryNosocial.authSql != null and tHaveSalaryNosocial.authSql.trim() != ''">
${tHaveSalaryNosocial.authSql}
</if>
<!--数据权限判断-->
<if test="settleDomainVos != null">
<if test="settleDomainVos.size() > 0">
......@@ -219,6 +225,9 @@
1=1 and ((b.IGNORE_FLAG=1 and b.TYPE=1) or (b.id is null))
<include refid="export_where"/>
<if test="tHaveSalaryNosocial != null">
<if test="tHaveSalaryNosocial.authSql != null and tHaveSalaryNosocial.authSql.trim() != ''">
${tHaveSalaryNosocial.authSql}
</if>
<if test="tHaveSalaryNosocial.limitStart != null">
limit #{tHaveSalaryNosocial.limitStart},#{tHaveSalaryNosocial.limitEnd}
</if>
......@@ -233,6 +242,9 @@
<where>
1=1 and ((b.IGNORE_FLAG=1 and b.TYPE=1) or (b.id is null))
<include refid="export_where"/>
<if test="tHaveSalaryNosocial.authSql != null and tHaveSalaryNosocial.authSql.trim() != ''">
${tHaveSalaryNosocial.authSql}
</if>
</where>
</select>
<sql id="export_where">
......
......@@ -352,6 +352,9 @@
<where>
a.DELETE_FLAG = 0 AND (d.CAN_SEE = 0 OR d.id is null)
<include refid="tSalaryAccount_where"/>
<if test="tSalaryAccount.authSql != null and tSalaryAccount.authSql.trim() != ''">
${tSalaryAccount.authSql}
</if>
</where>
order by a.CREATE_TIME desc
</select>
......@@ -546,6 +549,9 @@
<where>
a.DELETE_FLAG = 0 AND (d.CAN_SEE = 0 OR d.id is null)
<include refid="where_export"/>
<if test="searchVo.authSql != null and searchVo.authSql.trim() != ''">
${searchVo.authSql}
</if>
ORDER BY a.CREATE_TIME desc
<if test="searchVo != null">
<if test="searchVo.limitStart != null">
......@@ -582,6 +588,9 @@
<where>
a.DELETE_FLAG = 0 AND (d.CAN_SEE = 0 OR d.id is null)
<include refid="where_export"/>
<if test="searchVo.authSql != null and searchVo.authSql.trim() != ''">
${searchVo.authSql}
</if>
</where>
</select>
<sql id="where_export">
......
......@@ -184,6 +184,9 @@
<where>
1=1
<include refid="where_export"/>
<if test="tSalaryEmployee.authSql != null and tSalaryEmployee.authSql.trim() != ''">
${tSalaryEmployee.authSql}
</if>
ORDER BY a.CREATE_TIME DESC
</where>
<if test="tSalaryEmployee != null">
......
......@@ -269,6 +269,9 @@
<!-- 薪资是否可查看 0 是 1否-->
and (d.CAN_SEE = 0 OR d.id is null)
<include refid="tSalaryStandard_where"/>
<if test="tSalaryStandard.authSql != null and tSalaryStandard.authSql.trim() != ''">
${tSalaryStandard.authSql}
</if>
</where>
ORDER BY a.CREATE_TIME desc
</select>
......@@ -347,6 +350,9 @@
<where>
a.DELETE_FLAG = 0 AND (d.CAN_SEE = 0 OR d.id is null)
<include refid="where_export"/>
<if test="searchVo.authSql != null and searchVo.authSql.trim() != ''">
${searchVo.authSql}
</if>
ORDER BY a.CREATE_TIME desc
<if test="searchVo != null">
<if test="searchVo.limitStart != null">
......@@ -364,6 +370,9 @@
<where>
a.DELETE_FLAG = 0 AND (d.CAN_SEE = 0 OR d.id is null)
<include refid="where_export"/>
<if test="searchVo.authSql != null and searchVo.authSql.trim() != ''">
${searchVo.authSql}
</if>
</where>
</select>
<sql id="where_page">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment