diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/dept/service/ProDeptRoleServiceImpl.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/dept/service/ProDeptRoleServiceImpl.java index d59eba0..561853c 100644 --- a/bonus-modules/bonus-system/src/main/java/com/bonus/system/dept/service/ProDeptRoleServiceImpl.java +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/dept/service/ProDeptRoleServiceImpl.java @@ -40,21 +40,6 @@ public class ProDeptRoleServiceImpl implements ProDeptRoleService { @Override public List getRoleUserList(ProDeptRoleBean bean) { -// //只能查自己分公司的人 -// SysUser sysUser = SecurityUtils.getLoginUser().getSysUser(); -// List roleId = sysUser.getRoleList(); -// if(roleId !=null && !roleId.isEmpty() ){ -// if (Collections.frequency(roleId, "1")==0) { -// List orgList = sysUser.getOrgList(); -// if (!orgList.isEmpty()) { -// ArrayList ids = new ArrayList<>(); -// for (MapVo mapVo : orgList) { -// ids.add(String.valueOf(mapVo.getId())); -// } -// bean.setOrgList(ids); -// } -// } -// } return proDeptRoleDao.getRoleUserList(bean); } diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/download/ExportFileController.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/download/ExportFileController.java index fccb59c..8b88925 100644 --- a/bonus-modules/bonus-system/src/main/java/com/bonus/system/download/ExportFileController.java +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/download/ExportFileController.java @@ -182,27 +182,27 @@ public class ExportFileController { public void exportHoliday(HttpServletResponse response, HolidayBean bean) { try { List personExportVoList = new ArrayList<>(); -// if ("审批".equals(bean.getExportType())) { -// } else { -// //只能查询自己的 -// bean.setUserId(SecurityUtils.getLoginUser().getSysUser().getUserId()); -// } SysUser sysUser = SecurityUtils.getLoginUser().getSysUser(); List roleId = sysUser.getRoleList(); //管理员与人资角色可以看到所有 - if( roleId !=null && !roleId.isEmpty()){ - if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) { - List orgList = sysUser.getOrgList(); - if (!orgList.isEmpty()) { - ArrayList ids = new ArrayList<>(); - for (MapVo mapVo : orgList) { - String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); - // 使用 Arrays.asList() 将数组转换为 ArrayList - ArrayList idList = new ArrayList<>(Arrays.asList(id.split(","))); - ids.addAll(idList); + if (roleId != null && !roleId.isEmpty()) { + if (Collections.frequency(roleId, "1") == 0 && Collections.frequency(roleId, "16") == 0) { + if (Collections.frequency(roleId, "15") == 0) { + List orgList = sysUser.getOrgList(); + if (!orgList.isEmpty()) { + ArrayList ids = new ArrayList<>(); + for (MapVo mapVo : orgList) { + String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); + // 使用 Arrays.asList() 将数组转换为 ArrayList + ArrayList idList = new ArrayList<>(Arrays.asList(id.split(","))); + ids.addAll(idList); // ids.add(String.valueOf(mapVo.getId())); + } + bean.setOrgList(ids); } - bean.setOrgList(ids); + } else { + Long userId = SecurityUtils.getUserId(); + bean.setUserId(userId); } } } @@ -230,9 +230,11 @@ public class ExportFileController { personExportVoList.add(vo); } extracted(personExportVoList, HolidayBean.class, "轮休临时外出导出", "轮休临时外出导出", "轮休临时外出导出", response); - } catch (Exception e) { + } catch ( + Exception e) { log.error(e.toString(), e); } + } /** @@ -250,8 +252,8 @@ public class ExportFileController { SysUser sysUser = SecurityUtils.getLoginUser().getSysUser(); List roleId = sysUser.getRoleList(); //管理员与人资角色可以看到所有 - if( roleId !=null && !roleId.isEmpty()){ - if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) { + if (roleId != null && !roleId.isEmpty()) { + if (Collections.frequency(roleId, "1") == 0 && Collections.frequency(roleId, "16") == 0) { List orgList = sysUser.getOrgList(); if (!orgList.isEmpty()) { ArrayList ids = new ArrayList<>(); @@ -504,7 +506,7 @@ public class ExportFileController { dayTable.setEndDate(bean.getEndDate()); headers.entrySet() .forEach(entry -> { - if("99".equals(entry.getKey())){ + if ("99".equals(entry.getKey())) { List list = attendanceDetailsService.getOutCountList(dayTable); Sheet departmentSheet2 = exporter.createSheet(entry.getValue()); List departmentHeaders2 = Arrays.asList("序号", "考勤日期", "姓名", "所属部门", "打卡时间", "打卡地址"); @@ -522,7 +524,7 @@ public class ExportFileController { departmentData2.add(map); } exporter.addDataRows(departmentSheet2, departmentData2, departmentHeaders2); - }else{ + } else { dayTable.setAttStatus(entry.getKey()); List list = attendanceDetailsService.getAttDayReportDetailsList(dayTable); Sheet departmentSheet2 = exporter.createSheet(entry.getValue()); @@ -663,16 +665,16 @@ public class ExportFileController { AttDetailBean dayTable = new AttDetailBean(); dayTable.setStartDate(monthFirstAndLast.get(0)); dayTable.setEndDate(monthFirstAndLast.get(1)); - if(bean.getOrgId() != null){ + if (bean.getOrgId() != null) { dayTable.setOrgId(String.valueOf(bean.getOrgId())); } dayTable.setName(bean.getUserName()); headers.entrySet() .forEach(entry -> { - if("99".equals(entry.getKey())){ + if ("99".equals(entry.getKey())) { AttDataDetailsBean att = new AttDataDetailsBean(); att.setAttCurrentMonth(bean.getMonth()); - if(bean.getOrgId() != null){ + if (bean.getOrgId() != null) { att.setOrgId(bean.getOrgId()); } att.setUserName(bean.getUserName()); @@ -692,7 +694,7 @@ public class ExportFileController { departmentData2.add(map); } exporter.addDataRows(departmentSheet2, departmentData2, departmentHeaders2); - }else { + } else { dayTable.setAttStatis(Integer.parseInt(entry.getKey())); List list = attDetailByMonthService.getDetailList(dayTable); Sheet departmentSheet2 = exporter.createSheet(entry.getValue()); @@ -715,7 +717,7 @@ public class ExportFileController { } exporter.addDataRows(departmentSheet2, departmentData2, departmentHeaders2); } - }); + }); // 导出Excel文件 exporter.exportToResponse(response, "月报表导出"); } @@ -830,19 +832,24 @@ public class ExportFileController { SysUser sysUser = SecurityUtils.getLoginUser().getSysUser(); List roleId = sysUser.getRoleList(); //管理员与人资角色可以看到所有 - if( roleId !=null && !roleId.isEmpty()){ - if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) { - List orgList = sysUser.getOrgList(); - if (!orgList.isEmpty()) { - ArrayList ids = new ArrayList<>(); - for (MapVo mapVo : orgList) { - String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); - // 使用 Arrays.asList() 将数组转换为 ArrayList - ArrayList idList = new ArrayList<>(Arrays.asList(id.split(","))); - ids.addAll(idList); + if (roleId != null && !roleId.isEmpty()) { + if (Collections.frequency(roleId, "1") == 0 && Collections.frequency(roleId, "16") == 0) { + if(Collections.frequency(roleId, "15")==0){ + List orgList = sysUser.getOrgList(); + if (!orgList.isEmpty()) { + ArrayList ids = new ArrayList<>(); + for (MapVo mapVo : orgList) { + String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); + // 使用 Arrays.asList() 将数组转换为 ArrayList + ArrayList idList = new ArrayList<>(Arrays.asList(id.split(","))); + ids.addAll(idList); // ids.add(String.valueOf(mapVo.getId())); + } + bean.setOrgList(ids); } - bean.setOrgList(ids); + }else{ + Long userId = SecurityUtils.getUserId(); + bean.setUserId(userId); } } } @@ -886,6 +893,30 @@ public class ExportFileController { public void exportEvection(HttpServletResponse response, EvectionBean bean) { try { List personExportVoList = new ArrayList<>(); + SysUser sysUser = SecurityUtils.getLoginUser().getSysUser(); + List roleId = sysUser.getRoleList(); + //管理员与人资角色可以看到所有 + if( roleId !=null && !roleId.isEmpty()){ + if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) { + if(Collections.frequency(roleId, "15")==0){ + List orgList = sysUser.getOrgList(); + if (!orgList.isEmpty()) { + ArrayList ids = new ArrayList<>(); + for (MapVo mapVo : orgList) { + String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); + // 使用 Arrays.asList() 将数组转换为 ArrayList + ArrayList idList = new ArrayList<>(Arrays.asList(id.split(","))); + ids.addAll(idList); +// ids.add(String.valueOf(mapVo.getId())); + } + bean.setOrgList(ids); + } + }else{ + Long userId = SecurityUtils.getUserId(); + bean.setUserId(userId); + } + } + } List personLists = evectionService.getEvectionList(bean); for (int i = 0; i < personLists.size(); i++) { EvectionBean vo = personLists.get(i); @@ -1029,7 +1060,7 @@ public class ExportFileController { /** - * 数据管理-休假报备 + * 数据管理-休假报备-微信 * * @param response * @param bean @@ -1041,20 +1072,26 @@ public class ExportFileController { SysUser sysUser = SecurityUtils.getLoginUser().getSysUser(); List roleId = sysUser.getRoleList(); //管理员与人资角色可以看到所有 - if( roleId !=null && !roleId.isEmpty()){ - if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) { - List orgList = sysUser.getOrgList(); - if (!orgList.isEmpty()) { - ArrayList ids = new ArrayList<>(); - for (MapVo mapVo : orgList) { - String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); - // 使用 Arrays.asList() 将数组转换为 ArrayList - ArrayList idList = new ArrayList<>(Arrays.asList(id.split(","))); - ids.addAll(idList); + if (roleId != null && !roleId.isEmpty()) { + if (Collections.frequency(roleId, "1") == 0 && Collections.frequency(roleId, "16") == 0) { + if(Collections.frequency(roleId, "15")==0){ + List orgList = sysUser.getOrgList(); + if (!orgList.isEmpty()) { + ArrayList ids = new ArrayList<>(); + for (MapVo mapVo : orgList) { + String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); + // 使用 Arrays.asList() 将数组转换为 ArrayList + ArrayList idList = new ArrayList<>(Arrays.asList(id.split(","))); + ids.addAll(idList); // ids.add(String.valueOf(mapVo.getId())); + } + bean.setOrgList(ids); } - bean.setOrgList(ids); + }else{ + Long userId = SecurityUtils.getUserId(); + bean.setUserId(userId); } + } } List personExportVoList = new ArrayList<>(); @@ -1102,17 +1139,22 @@ public class ExportFileController { //管理员与人资角色可以看到所有 if (roleId != null && !roleId.isEmpty()) { if (Collections.frequency(roleId, "1") == 0 && Collections.frequency(roleId, "16") == 0) { - List orgList = sysUser.getOrgList(); - if (!orgList.isEmpty()) { - ArrayList ids = new ArrayList<>(); - for (MapVo mapVo : orgList) { - String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); - // 使用 Arrays.asList() 将数组转换为 ArrayList - ArrayList idList = new ArrayList<>(Arrays.asList(id.split(","))); - ids.addAll(idList); + if(Collections.frequency(roleId, "15")==0){ + List orgList = sysUser.getOrgList(); + if (!orgList.isEmpty()) { + ArrayList ids = new ArrayList<>(); + for (MapVo mapVo : orgList) { + String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); + // 使用 Arrays.asList() 将数组转换为 ArrayList + ArrayList idList = new ArrayList<>(Arrays.asList(id.split(","))); + ids.addAll(idList); // ids.add(String.valueOf(mapVo.getId())); + } + bean.setOrgList(ids); } - bean.setOrgList(ids); + }else{ + Long userId = SecurityUtils.getUserId(); + bean.setUserId(userId); } } } @@ -1166,6 +1208,4 @@ public class ExportFileController { } - - } diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/evection/controller/EvectionController.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/evection/controller/EvectionController.java index 3efe9be..a21efb0 100644 --- a/bonus-modules/bonus-system/src/main/java/com/bonus/system/evection/controller/EvectionController.java +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/evection/controller/EvectionController.java @@ -7,7 +7,10 @@ import com.bonus.common.log.annotation.Log; import com.bonus.common.log.enums.BusinessType; import com.bonus.common.security.annotation.RequiresPermissions; import com.bonus.common.security.utils.SecurityUtils; +import com.bonus.system.api.domain.MapVo; import com.bonus.system.api.domain.SysRole; +import com.bonus.system.api.domain.SysUser; +import com.bonus.system.dept.dao.ProDeptRoleDao; import com.bonus.system.evection.entity.EvectionBean; import com.bonus.system.evection.service.EvectionService; import com.bonus.system.holiday.dao.WorkReportDao; @@ -16,6 +19,8 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; import java.util.List; /** @@ -34,6 +39,9 @@ public class EvectionController extends BaseController { @Resource(name = "WorkReportDao") private WorkReportDao dao; + @Resource(name = "ProDeptRoleDao") + private ProDeptRoleDao proDeptRoleDao; + /** * 获取出差报备列表(表格) */ @@ -43,23 +51,47 @@ public class EvectionController extends BaseController { public TableDataInfo list(EvectionBean bean) { try{ - //不是管理员,只能查自己 - Long userId = SecurityUtils.getUserId(); - List sysRoleList = dao.getRoleListByUserId(userId); - int roleCount = 0; - if(!sysRoleList.isEmpty()){ - for (SysRole sysRole : sysRoleList) { - if(sysRole.getRoleName().contains("管理员")){ - roleCount = 1; - break; +// //不是管理员,只能查自己 +// Long userId = SecurityUtils.getUserId(); +// List sysRoleList = dao.getRoleListByUserId(userId); +// int roleCount = 0; +// if(!sysRoleList.isEmpty()){ +// for (SysRole sysRole : sysRoleList) { +// if(sysRole.getRoleName().contains("管理员")){ +// roleCount = 1; +// break; +// } +// } +// } +// if(roleCount==1){ +// +// }else{ +// bean.setUserId(userId); +// } + SysUser sysUser = SecurityUtils.getLoginUser().getSysUser(); + List roleId = sysUser.getRoleList(); + //管理员与人资角色可以看到所有 + if( roleId !=null && !roleId.isEmpty()){ + if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) { + if(Collections.frequency(roleId, "15")==0){ + List orgList = sysUser.getOrgList(); + if (!orgList.isEmpty()) { + ArrayList ids = new ArrayList<>(); + for (MapVo mapVo : orgList) { + String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); + // 使用 Arrays.asList() 将数组转换为 ArrayList + ArrayList idList = new ArrayList<>(Arrays.asList(id.split(","))); + ids.addAll(idList); +// ids.add(String.valueOf(mapVo.getId())); + } + bean.setOrgList(ids); + } + }else{ + Long userId = SecurityUtils.getUserId(); + bean.setUserId(userId); } } } - if(roleCount==1){ - - }else{ - bean.setUserId(userId); - } startPage(); return getDataTable(evectionService.getEvectionList(bean)); }catch (Exception e){ diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/evection/service/EvectionServiceImpl.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/evection/service/EvectionServiceImpl.java index d7c6ab8..b8c27ba 100644 --- a/bonus-modules/bonus-system/src/main/java/com/bonus/system/evection/service/EvectionServiceImpl.java +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/evection/service/EvectionServiceImpl.java @@ -30,16 +30,6 @@ public class EvectionServiceImpl implements EvectionService { @Override public List getEvectionList(EvectionBean bean) { - //只能查自己部门的人 -// List orgList = SecurityUtils.getLoginUser().getSysUser().getOrgList(); -// if(!orgList.isEmpty()){ -// ArrayList ids = new ArrayList<>(); -// for (MapVo mapVo : orgList) { -// ids.add(String.valueOf(mapVo.getId())); -// } -// bean.setOrgList(ids); -// } -// Map params = bean.getParams(); Map params = bean.getParams(); return evectionDao.getEvectionList(bean,params); } diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/holiday/controller/HolidayController.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/holiday/controller/HolidayController.java index 45b3725..0f20787 100644 --- a/bonus-modules/bonus-system/src/main/java/com/bonus/system/holiday/controller/HolidayController.java +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/holiday/controller/HolidayController.java @@ -64,17 +64,22 @@ public class HolidayController extends BaseController { //管理员与人资角色可以看到所有 if( roleId !=null && !roleId.isEmpty()){ if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) { - List orgList = sysUser.getOrgList(); - if (!orgList.isEmpty()) { - ArrayList ids = new ArrayList<>(); - for (MapVo mapVo : orgList) { - String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); - // 使用 Arrays.asList() 将数组转换为 ArrayList - ArrayList idList = new ArrayList<>(Arrays.asList(id.split(","))); - ids.addAll(idList); + if(Collections.frequency(roleId, "15")==0){ + List orgList = sysUser.getOrgList(); + if (!orgList.isEmpty()) { + ArrayList ids = new ArrayList<>(); + for (MapVo mapVo : orgList) { + String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); + // 使用 Arrays.asList() 将数组转换为 ArrayList + ArrayList idList = new ArrayList<>(Arrays.asList(id.split(","))); + ids.addAll(idList); // ids.add(String.valueOf(mapVo.getId())); + } + bean.setOrgList(ids); } - bean.setOrgList(ids); + }else{ + Long userId = SecurityUtils.getUserId(); + bean.setUserId(userId); } } } diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/leaveReporting/controller/LeaveReportingController.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/leaveReporting/controller/LeaveReportingController.java index 894fd90..a6591ab 100644 --- a/bonus-modules/bonus-system/src/main/java/com/bonus/system/leaveReporting/controller/LeaveReportingController.java +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/leaveReporting/controller/LeaveReportingController.java @@ -56,17 +56,22 @@ public class LeaveReportingController extends BaseController { //管理员与人资角色可以看到所有 if( roleId !=null && !roleId.isEmpty()){ if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) { - List orgList = sysUser.getOrgList(); - if (!orgList.isEmpty()) { - ArrayList ids = new ArrayList<>(); - for (MapVo mapVo : orgList) { - String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); - // 使用 Arrays.asList() 将数组转换为 ArrayList - ArrayList idList = new ArrayList<>(Arrays.asList(id.split(","))); - ids.addAll(idList); + if(Collections.frequency(roleId, "15")==0){ + List orgList = sysUser.getOrgList(); + if (!orgList.isEmpty()) { + ArrayList ids = new ArrayList<>(); + for (MapVo mapVo : orgList) { + String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); + // 使用 Arrays.asList() 将数组转换为 ArrayList + ArrayList idList = new ArrayList<>(Arrays.asList(id.split(","))); + ids.addAll(idList); // ids.add(String.valueOf(mapVo.getId())); + } + bean.setOrgList(ids); } - bean.setOrgList(ids); + }else{ + Long userId = SecurityUtils.getUserId(); + bean.setUserId(userId); } } } diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/controller/WechatController.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/controller/WechatController.java index 6fd8980..a915cf8 100644 --- a/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/controller/WechatController.java +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/controller/WechatController.java @@ -54,17 +54,22 @@ public class WechatController extends BaseController { //管理员与人资角色可以看到所有 if( roleId !=null && !roleId.isEmpty()){ if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) { - List orgList = sysUser.getOrgList(); - if (!orgList.isEmpty()) { - ArrayList ids = new ArrayList<>(); - for (MapVo mapVo : orgList) { + if(Collections.frequency(roleId, "15")==0){ + List orgList = sysUser.getOrgList(); + if (!orgList.isEmpty()) { + ArrayList ids = new ArrayList<>(); + for (MapVo mapVo : orgList) { // ids.add(String.valueOf(mapVo.getId())); - String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); - // 使用 Arrays.asList() 将数组转换为 ArrayList - ArrayList idList = new ArrayList<>(Arrays.asList(id.split(","))); - ids.addAll(idList); + String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); + // 使用 Arrays.asList() 将数组转换为 ArrayList + ArrayList idList = new ArrayList<>(Arrays.asList(id.split(","))); + ids.addAll(idList); + } + bean.setOrgList(ids); } - bean.setOrgList(ids); + }else{ + Long userId = SecurityUtils.getUserId(); + bean.setUserId(userId); } } } @@ -102,17 +107,22 @@ public class WechatController extends BaseController { //管理员与人资角色可以看到所有 if( roleId !=null && !roleId.isEmpty()){ if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) { - List orgList = sysUser.getOrgList(); - if (!orgList.isEmpty()) { - ArrayList ids = new ArrayList<>(); - for (MapVo mapVo : orgList) { + if(Collections.frequency(roleId, "15")==0){ + List orgList = sysUser.getOrgList(); + if (!orgList.isEmpty()) { + ArrayList ids = new ArrayList<>(); + for (MapVo mapVo : orgList) { // ids.add(String.valueOf(mapVo.getId())); - String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); - // 使用 Arrays.asList() 将数组转换为 ArrayList - ArrayList idList = new ArrayList<>(Arrays.asList(id.split(","))); - ids.addAll(idList); + String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); + // 使用 Arrays.asList() 将数组转换为 ArrayList + ArrayList idList = new ArrayList<>(Arrays.asList(id.split(","))); + ids.addAll(idList); + } + bean.setOrgList(ids); } - bean.setOrgList(ids); + }else{ + Long userId = SecurityUtils.getUserId(); + bean.setUserId(userId); } } } diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/controller/WechatEvectionController.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/controller/WechatEvectionController.java index 691affe..fac6bae 100644 --- a/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/controller/WechatEvectionController.java +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/controller/WechatEvectionController.java @@ -52,17 +52,22 @@ public class WechatEvectionController extends BaseController { //管理员与人资角色可以看到所有 if (roleId != null && !roleId.isEmpty()) { if (Collections.frequency(roleId, "1") == 0 && Collections.frequency(roleId, "16") == 0) { - List orgList = sysUser.getOrgList(); - if (!orgList.isEmpty()) { - ArrayList ids = new ArrayList<>(); - for (MapVo mapVo : orgList) { - String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); - // 使用 Arrays.asList() 将数组转换为 ArrayList - ArrayList idList = new ArrayList<>(Arrays.asList(id.split(","))); - ids.addAll(idList); + if(Collections.frequency(roleId, "15")==0){ + List orgList = sysUser.getOrgList(); + if (!orgList.isEmpty()) { + ArrayList ids = new ArrayList<>(); + for (MapVo mapVo : orgList) { + String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); + // 使用 Arrays.asList() 将数组转换为 ArrayList + ArrayList idList = new ArrayList<>(Arrays.asList(id.split(","))); + ids.addAll(idList); // ids.add(String.valueOf(mapVo.getId())); + } + bean.setOrgList(ids); } - bean.setOrgList(ids); + }else{ + Long userId = SecurityUtils.getUserId(); + bean.setUserId(userId); } } } diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/controller/WechatLeaveReportingController.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/controller/WechatLeaveReportingController.java index 877a9d4..c8a9381 100644 --- a/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/controller/WechatLeaveReportingController.java +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/wechat/controller/WechatLeaveReportingController.java @@ -50,17 +50,22 @@ public class WechatLeaveReportingController extends BaseController { //管理员与人资角色可以看到所有 if( roleId !=null && !roleId.isEmpty()){ if (Collections.frequency(roleId, "1")==0 && Collections.frequency(roleId, "16")==0) { - List orgList = sysUser.getOrgList(); - if (!orgList.isEmpty()) { - ArrayList ids = new ArrayList<>(); - for (MapVo mapVo : orgList) { - String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); - // 使用 Arrays.asList() 将数组转换为 ArrayList - ArrayList idList = new ArrayList<>(Arrays.asList(id.split(","))); - ids.addAll(idList); + if(Collections.frequency(roleId, "15")==0){ + List orgList = sysUser.getOrgList(); + if (!orgList.isEmpty()) { + ArrayList ids = new ArrayList<>(); + for (MapVo mapVo : orgList) { + String id = proDeptRoleDao.getOrgChildById(mapVo.getId()); + // 使用 Arrays.asList() 将数组转换为 ArrayList + ArrayList idList = new ArrayList<>(Arrays.asList(id.split(","))); + ids.addAll(idList); // ids.add(String.valueOf(mapVo.getId())); + } + bean.setOrgList(ids); } - bean.setOrgList(ids); + }else{ + Long userId = SecurityUtils.getUserId(); + bean.setUserId(userId); } } } diff --git a/bonus-modules/bonus-system/src/main/resources/mapper/evection/EvectionMapper.xml b/bonus-modules/bonus-system/src/main/resources/mapper/evection/EvectionMapper.xml index 0b0eea1..4bc9ee8 100644 --- a/bonus-modules/bonus-system/src/main/resources/mapper/evection/EvectionMapper.xml +++ b/bonus-modules/bonus-system/src/main/resources/mapper/evection/EvectionMapper.xml @@ -108,6 +108,7 @@ leave_apply l LEFT JOIN sys_user_post p ON p.user_id = l.user_id LEFT JOIN sys_dict_data d on d.dict_code = p.post_id + LEFT JOIN sys_user_org suo on suo.user_id=l.user_id and suo.is_active=1 WHERE l.is_active = '1' AND l.leave_type = '出差' AND l.source = '1' @@ -119,6 +120,15 @@ date_format(l.leave_end_date,'%y%m%d') between date_format(#{params.beginTime},'%y%m%d') and date_format(#{params.endTime},'%y%m%d') ) + + + and suo.org_id in ( + + #{item} + + ) + + GROUP BY l.id, l.user_id, @@ -138,6 +148,11 @@ ORDER BY l.update_time DESC ) a LEFT JOIN sys_user su ON su.user_id = a.submit_id + + + and a.submit_id = #{bean.userId} + + GROUP BY uuid ORDER BY leave_start_date DESC diff --git a/bonus-modules/bonus-system/src/main/resources/mapper/wechat/WechatEvectionMapper.xml b/bonus-modules/bonus-system/src/main/resources/mapper/wechat/WechatEvectionMapper.xml index 3bd3388..e07c921 100644 --- a/bonus-modules/bonus-system/src/main/resources/mapper/wechat/WechatEvectionMapper.xml +++ b/bonus-modules/bonus-system/src/main/resources/mapper/wechat/WechatEvectionMapper.xml @@ -78,6 +78,11 @@ ORDER BY l.update_time DESC ) a LEFT JOIN sys_user su ON su.user_id = a.submit_id + + + and a.submit_id = #{bean.userId} + + GROUP BY uuId ORDER BY leave_start_date DESC diff --git a/bonus-modules/bonus-system/src/main/resources/mapper/wechat/WechatLeaveReportingMapper.xml b/bonus-modules/bonus-system/src/main/resources/mapper/wechat/WechatLeaveReportingMapper.xml index 9ea1182..bbc12f2 100644 --- a/bonus-modules/bonus-system/src/main/resources/mapper/wechat/WechatLeaveReportingMapper.xml +++ b/bonus-modules/bonus-system/src/main/resources/mapper/wechat/WechatLeaveReportingMapper.xml @@ -51,6 +51,9 @@ AND l.org_id = #{params.orgId} + + and l.user_id = #{params.userId} + GROUP BY l.id, l.user_id, diff --git a/bonus-modules/bonus-system/src/main/resources/mapper/wechat/WechatMapper.xml b/bonus-modules/bonus-system/src/main/resources/mapper/wechat/WechatMapper.xml index 594e990..03a3334 100644 --- a/bonus-modules/bonus-system/src/main/resources/mapper/wechat/WechatMapper.xml +++ b/bonus-modules/bonus-system/src/main/resources/mapper/wechat/WechatMapper.xml @@ -48,6 +48,10 @@ AND ad.org_id = #{bean.orgId} + + and ad.user_id = #{bean.userId} + + GROUP BY ad.user_id, ad.org_id, ad.att_current_day