From de8a9f61aab7dfaddfdf0e27b09fc8ad831c2899 Mon Sep 17 00:00:00 2001 From: fl <3098731433@qq.com> Date: Wed, 12 Feb 2025 09:56:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=88=E8=AE=A1=E5=88=92=E4=B8=8E=E6=9C=88?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=BC=82=E5=B8=B8=E5=AF=BC=E5=87=BA=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=A4=B4=E9=83=A8=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AttDetailByMonthController.java | 35 ++++++++++--------- .../system/download/ExportFileController.java | 1 - .../mapper/att/AttendanceDetailsMapper.xml | 3 ++ 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/att/controller/AttDetailByMonthController.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/att/controller/AttDetailByMonthController.java index 76b7f60..b059ca4 100644 --- a/bonus-modules/bonus-system/src/main/java/com/bonus/system/att/controller/AttDetailByMonthController.java +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/att/controller/AttDetailByMonthController.java @@ -77,7 +77,7 @@ public class AttDetailByMonthController extends BaseController { // 如果需要转换回 List 类型 List uniqueIds = new ArrayList<>(idsSet); data.setOrgList(uniqueIds); - }else{ + } else { data.setUserId(userId); } } @@ -96,8 +96,8 @@ public class AttDetailByMonthController extends BaseController { 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<>(); @@ -134,6 +134,7 @@ public class AttDetailByMonthController extends BaseController { */ @Resource(name = "attendanceDetailsService") private AttendanceDetailsService attendanceDetailsService; + @RequiresPermissions("att:detail:export") @GetMapping("/export") public void export(HttpServletResponse response, AttDetailByMonthBean bean) { @@ -159,7 +160,7 @@ public class AttDetailByMonthController extends BaseController { // 如果需要转换回 List 类型 List uniqueIds = new ArrayList<>(idsSet); bean.setOrgList(uniqueIds); - }else{ + } else { bean.setUserId(userId); } } @@ -207,25 +208,25 @@ public class AttDetailByMonthController extends BaseController { AttDetailBean dayTable = new AttDetailBean(); dayTable.setStartDate(monthFirstAndLast.get(0)); dayTable.setEndDate(monthFirstAndLast.get(1)); - if(bean.getOrgId() != null){ - dayTable.setOrgId(String.valueOf(bean.getOrgId())); - }else{ - //受限于当前登录人 - if(bean.getOrgList() != null && !bean.getOrgList().isEmpty()){ - dayTable.setOrgList(bean.getOrgList()); - } - } dayTable.setName(bean.getName()); + if (bean.getOrgId() != null) { + dayTable.setOrgId(String.valueOf(bean.getOrgId())); + } else { + //受限于当前登录人 + if (bean.getOrgList() != null && !bean.getOrgList().isEmpty()) { + dayTable.setOrgList(bean.getOrgList()); + } + } headers.entrySet() .forEach(entry -> { - if("99".equals(entry.getKey())){ + if ("99".equals(entry.getKey())) { AttDataDetailsBean att = new AttDataDetailsBean(); att.setAttCurrentMonth(bean.getAttCurrentMonth()); - if(bean.getOrgId() != null){ + if (bean.getOrgId() != null) { att.setOrgId(Long.valueOf(bean.getOrgId())); - }else{ + } else { //受限于当前登录人 - if(bean.getOrgList() != null && !bean.getOrgList().isEmpty()){ + if (bean.getOrgList() != null && !bean.getOrgList().isEmpty()) { att.setOrgList(bean.getOrgList()); } } @@ -248,7 +249,7 @@ public class AttDetailByMonthController extends BaseController { 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()); 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 4e2825b..fbf613a 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 @@ -727,7 +727,6 @@ public class ExportFileController { dayTable.setOrgList(bean.getOrgList()); } } - dayTable.setName(bean.getUserName()); headers.entrySet() .forEach(entry -> { if ("99".equals(entry.getKey())) { diff --git a/bonus-modules/bonus-system/src/main/resources/mapper/att/AttendanceDetailsMapper.xml b/bonus-modules/bonus-system/src/main/resources/mapper/att/AttendanceDetailsMapper.xml index 8dd8dc6..ede1588 100644 --- a/bonus-modules/bonus-system/src/main/resources/mapper/att/AttendanceDetailsMapper.xml +++ b/bonus-modules/bonus-system/src/main/resources/mapper/att/AttendanceDetailsMapper.xml @@ -453,6 +453,9 @@ and locate(#{bean.userName},awa.user_name) + + and so.id = #{bean.orgId} + and so.id in (