模块数据隔离,bug修改

Signed-off-by: lSun <15893999301@qq.com>
This commit is contained in:
lSun 2025-01-17 18:01:41 +08:00
parent 6aa7e58525
commit fd75c8b95b
6 changed files with 50 additions and 28 deletions

View File

@ -113,17 +113,22 @@ public class AttendanceDetailsController extends BaseController {
//管理员与人资角色可以看到所有 //管理员与人资角色可以看到所有
if( roleId !=null && !roleId.isEmpty()){ if( roleId !=null && !roleId.isEmpty()){
if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) { if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) {
List<MapVo> orgList = sysUser.getOrgList(); if(Collections.frequency(roleId, "15")==0){
if (!orgList.isEmpty()) { List<MapVo> orgList = sysUser.getOrgList();
ArrayList<String> ids = new ArrayList<>(); if (!orgList.isEmpty()) {
for (MapVo mapVo : orgList) { ArrayList<String> ids = new ArrayList<>();
String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); for (MapVo mapVo : orgList) {
// 使用 Arrays.asList() 将数组转换为 ArrayList String id = proDeptRoleDao.getOrgChildById(mapVo.getId());
ArrayList<String> idList = new ArrayList<>(Arrays.asList(id.split(","))); // 使用 Arrays.asList() 将数组转换为 ArrayList
ids.addAll(idList); ArrayList<String> idList = new ArrayList<>(Arrays.asList(id.split(",")));
ids.addAll(idList);
// ids.add(String.valueOf(mapVo.getId())); // ids.add(String.valueOf(mapVo.getId()));
}
bean.setOrgList(ids);
} }
bean.setOrgList(ids); }else{
Long userId = SecurityUtils.getUserId();
bean.setUserId(userId);
} }
} }
} }

View File

@ -254,18 +254,24 @@ public class ExportFileController {
//管理员与人资角色可以看到所有 //管理员与人资角色可以看到所有
if (roleId != null && !roleId.isEmpty()) { if (roleId != null && !roleId.isEmpty()) {
if (Collections.frequency(roleId, "1") == 0 && Collections.frequency(roleId, "16") == 0) { if (Collections.frequency(roleId, "1") == 0 && Collections.frequency(roleId, "16") == 0) {
List<MapVo> orgList = sysUser.getOrgList(); if(Collections.frequency(roleId, "15")==0){
if (!orgList.isEmpty()) { List<MapVo> orgList = sysUser.getOrgList();
ArrayList<String> ids = new ArrayList<>(); if (!orgList.isEmpty()) {
for (MapVo mapVo : orgList) { ArrayList<String> ids = new ArrayList<>();
String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); for (MapVo mapVo : orgList) {
// 使用 Arrays.asList() 将数组转换为 ArrayList String id = proDeptRoleDao.getOrgChildById(mapVo.getId());
ArrayList<String> idList = new ArrayList<>(Arrays.asList(id.split(","))); // 使用 Arrays.asList() 将数组转换为 ArrayList
ids.addAll(idList); ArrayList<String> idList = new ArrayList<>(Arrays.asList(id.split(",")));
ids.addAll(idList);
// ids.add(String.valueOf(mapVo.getId())); // ids.add(String.valueOf(mapVo.getId()));
}
bean.setOrgList(ids);
} }
bean.setOrgList(ids); }else{
Long userId = SecurityUtils.getUserId();
bean.setUserId(userId);
} }
} }
} }

View File

@ -86,6 +86,8 @@ public class EvectionController extends BaseController {
} }
bean.setOrgList(ids); bean.setOrgList(ids);
} }
Long userId = SecurityUtils.getUserId();
bean.setUserId(userId);
}else{ }else{
Long userId = SecurityUtils.getUserId(); Long userId = SecurityUtils.getUserId();
bean.setUserId(userId); bean.setUserId(userId);

View File

@ -54,7 +54,7 @@ public class HolidayController extends BaseController {
/** /**
* 获取假期列表(表格) * 获取假期列表(表格)
*/ */
@RequiresPermissions("flow:holiday:list") // @RequiresPermissions("flow:holiday:list")
@GetMapping("/list") @GetMapping("/list")
@Log(title = "流程管理->假期管理->列表查询", businessType = BusinessType.QUERY) @Log(title = "流程管理->假期管理->列表查询", businessType = BusinessType.QUERY)
public TableDataInfo list(HolidayBean bean) { public TableDataInfo list(HolidayBean bean) {
@ -94,7 +94,7 @@ public class HolidayController extends BaseController {
/** /**
* 新增假期 * 新增假期
*/ */
@RequiresPermissions("flow:holiday:add") // @RequiresPermissions("flow:holiday:add")
@PostMapping @PostMapping
@Log(title = "流程管理->假期管理->新增假期", businessType = BusinessType.INSERT) @Log(title = "流程管理->假期管理->新增假期", businessType = BusinessType.INSERT)
public AjaxResult add(@Validated @RequestBody HolidayBean o) { public AjaxResult add(@Validated @RequestBody HolidayBean o) {
@ -110,7 +110,7 @@ public class HolidayController extends BaseController {
/** /**
* 根据组织编号获取详细信息 * 根据组织编号获取详细信息
*/ */
@RequiresPermissions("flow:holiday:query") // @RequiresPermissions("flow:holiday:query")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
@Log(title = "流程管理->假期管理->查询单个请假单", businessType = BusinessType.QUERY) @Log(title = "流程管理->假期管理->查询单个请假单", businessType = BusinessType.QUERY)
public AjaxResult getInfo(@PathVariable Long id) { public AjaxResult getInfo(@PathVariable Long id) {
@ -125,7 +125,7 @@ public class HolidayController extends BaseController {
/** /**
* 修改请假单 * 修改请假单
*/ */
@RequiresPermissions("flow:holiday:edit") // @RequiresPermissions("flow:holiday:edit")
@PutMapping @PutMapping
@Log(title = "流程管理->假期管理->修改请假单", businessType = BusinessType.UPDATE) @Log(title = "流程管理->假期管理->修改请假单", businessType = BusinessType.UPDATE)
public AjaxResult edit(@Validated @RequestBody HolidayBean o) { public AjaxResult edit(@Validated @RequestBody HolidayBean o) {
@ -141,7 +141,7 @@ public class HolidayController extends BaseController {
/** /**
* 删除请假单 * 删除请假单
*/ */
@RequiresPermissions("flow:holiday:remove") // @RequiresPermissions("flow:holiday:remove")
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@Log(title = "流程管理->假期管理->删除请假单", businessType = BusinessType.DELETE) @Log(title = "流程管理->假期管理->删除请假单", businessType = BusinessType.DELETE)
public AjaxResult remove(@PathVariable("id") Long id) { public AjaxResult remove(@PathVariable("id") Long id) {
@ -156,7 +156,7 @@ public class HolidayController extends BaseController {
/** /**
* 获取假期列表(审核表格) * 获取假期列表(审核表格)
*/ */
@RequiresPermissions("flow:holiday:list") // @RequiresPermissions("flow:holiday:list")
@GetMapping("/checkList") @GetMapping("/checkList")
@Log(title = "流程管理->假期管理->列表查询", businessType = BusinessType.QUERY) @Log(title = "流程管理->假期管理->列表查询", businessType = BusinessType.QUERY)
public TableDataInfo checkList(HolidayBean bean) { public TableDataInfo checkList(HolidayBean bean) {
@ -191,7 +191,7 @@ public class HolidayController extends BaseController {
/** /**
* 提交/撤回 审核 * 提交/撤回 审核
*/ */
@RequiresPermissions("flow:holiday:edit") // @RequiresPermissions("flow:holiday:edit")
@PutMapping("changeStatus") @PutMapping("changeStatus")
@Log(title = "流程管理->假期管理->修改状态", businessType = BusinessType.UPDATE) @Log(title = "流程管理->假期管理->修改状态", businessType = BusinessType.UPDATE)
public AjaxResult changeStatus(@Validated @RequestBody HolidayBean o) { public AjaxResult changeStatus(@Validated @RequestBody HolidayBean o) {

View File

@ -17,6 +17,10 @@
<if test="bean.orgId != null and bean.orgId != ''"> <if test="bean.orgId != null and bean.orgId != ''">
AND v.org_id = #{bean.orgId} AND v.org_id = #{bean.orgId}
</if> </if>
<if test="bean.userId != null and bean.userId != ''">
AND v.user_id = #{bean.userId}
</if>
<if test="bean.userName != null and bean.userName != ''"> <if test="bean.userName != null and bean.userName != ''">
AND su.user_name like concat('%', #{bean.userName}, '%') AND su.user_name like concat('%', #{bean.userName}, '%')
</if> </if>
@ -79,6 +83,10 @@
AND su.user_name like concat('%', #{bean.userName}, '%') AND su.user_name like concat('%', #{bean.userName}, '%')
</if> </if>
<if test="bean.userId != null and bean.userId != ''">
AND v.user_id = #{bean.userId}
</if>
<if test='bean.attStatus != null and bean.attStatus == "6"'> <if test='bean.attStatus != null and bean.attStatus == "6"'>
and (v.toWorkAttStatus in (SELECT dict_value and (v.toWorkAttStatus in (SELECT dict_value
FROM sys_dict_data FROM sys_dict_data
@ -134,6 +142,9 @@
<if test="bean.userName != null and bean.userName != ''"> <if test="bean.userName != null and bean.userName != ''">
AND su.user_name like concat('%', #{bean.userName}, '%') AND su.user_name like concat('%', #{bean.userName}, '%')
</if> </if>
<if test="bean.userId != null and bean.userId != ''">
AND v.user_id = #{bean.userId}
</if>
<if test='bean.attStatus != null and bean.attStatus == "6"'> <if test='bean.attStatus != null and bean.attStatus == "6"'>
and (v.toWorkAttStatus in (SELECT dict_value and (v.toWorkAttStatus in (SELECT dict_value

View File

@ -111,9 +111,7 @@
LEFT JOIN sys_user_org suo on suo.user_id=l.user_id and suo.is_active=1 LEFT JOIN sys_user_org suo on suo.user_id=l.user_id and suo.is_active=1
WHERE WHERE
l.is_active = '1' AND l.leave_type = '出差' AND l.source = '1' l.is_active = '1' AND l.leave_type = '出差' AND l.source = '1'
<if test='bean.userId != null '>
and l.user_id = #{bean.userId}
</if>
<if test="params.beginTime != null and params.beginTime != ''"> <if test="params.beginTime != null and params.beginTime != ''">
and ( and (
date_format(l.leave_start_date,'%y%m%d') between date_format(#{params.beginTime},'%y%m%d') and date_format(#{params.endTime},'%y%m%d') or date_format(l.leave_start_date,'%y%m%d') between date_format(#{params.beginTime},'%y%m%d') and date_format(#{params.endTime},'%y%m%d') or