From a8be0197596c2629a1e40ea5abc80f6b2b21094f Mon Sep 17 00:00:00 2001
From: ieaii <1069385070@qq.com>
Date: Mon, 13 Jan 2025 19:46:47 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=9C=80=E7=BB=88=E7=89=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
jeecg-boot-base/jeecg-boot-base-core/pom.xml | 4 +-
.../controller/ClockinLogController.java | 56 +++++++++++++++++-----
.../clockinlog/mapper/ClockinLogMapper.java | 2 +-
3 files changed, 48 insertions(+), 14 deletions(-)
diff --git a/jeecg-boot-base/jeecg-boot-base-core/pom.xml b/jeecg-boot-base/jeecg-boot-base-core/pom.xml
index 9064ab5..5a4273a 100644
--- a/jeecg-boot-base/jeecg-boot-base-core/pom.xml
+++ b/jeecg-boot-base/jeecg-boot-base-core/pom.xml
@@ -290,8 +290,8 @@
org.apache.poi
- poi-ooxml-schemas
- 4.1.2
+ poi-ooxml-full
+ 5.3.0
diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/controller/ClockinLogController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/controller/ClockinLogController.java
index 16a698a..e34a92d 100644
--- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/controller/ClockinLogController.java
+++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/controller/ClockinLogController.java
@@ -17,6 +17,7 @@ import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpHeaders;
import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbookFactory;
import org.apache.shiro.SecurityUtils;
@@ -199,8 +200,8 @@ public class ClockinLogController extends JeecgController> maps = new ArrayList<>();
Map map = new HashMap<>();
@@ -441,6 +444,14 @@ public class ClockinLogController extends JeecgController> list = new ArrayList<>();
List strings = null;
List exportList = new ArrayList<>();
+ CellStyle wrapStyle = workbook.createCellStyle();
+ wrapStyle.setAlignment(HorizontalAlignment.CENTER);
+ wrapStyle.setBorderTop(BorderStyle.THIN); // 顶部边框
+ wrapStyle.setBorderBottom(BorderStyle.THIN); // 底部边框
+ wrapStyle.setBorderLeft(BorderStyle.THIN); // 左边边框
+ wrapStyle.setBorderRight(BorderStyle.THIN); // 右边边框
+
+ int headerRowNum = 0;
for (ClockinTeamLog clockinTeamLog:clockinTeamLogs){
ClockInProject clockInProject = clockInProjectService.lambdaQuery()
.eq(ClockInProject::getDelFlag, 0)
@@ -461,9 +472,26 @@ public class ClockinLogController extends JeecgController> maps1 = new ArrayList<>();
+ Row row = sheet.createRow(1+headerRowNum);
+ Row row2 = sheet.createRow(2+headerRowNum);
+ headerRowNum = headerRowNum + 3;
+
+ int num = 3;
for (int n= 1;n<=day;n++){
ClockInLogExportResp2 clockInLogExportResp2 = new ClockInLogExportResp2();
@@ -480,11 +508,17 @@ public class ClockinLogController extends JeecgController clockInLogExpeort = clockinLogMapper.getClockInLogExpeort(yearMonthDay, clockInProject.getId(), clockinTeamLog.getUserId(),type);
String clockInTime = "";
for (ClockInLogResp clockInLogResp:clockInLogExpeort) {
+ if(StringUtils.isBlank(clockInLogResp.getTime())&&clockInLogResp.getType() == 2){
+ continue;
+ }
if(StringUtils.isBlank(clockInLogResp.getTime())){
clockInLogResp.setClockStartTime("缺卡");
@@ -493,9 +527,9 @@ public class ClockinLogController extends JeecgController map1 = new HashMap<>();
diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/mapper/ClockinLogMapper.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/mapper/ClockinLogMapper.java
index 4ba6098..f7f6701 100644
--- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/mapper/ClockinLogMapper.java
+++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/mapper/ClockinLogMapper.java
@@ -41,7 +41,7 @@ public interface ClockinLogMapper extends BaseMapper {
@Select("SELECT IFNULL(count(1),0) FROM clockin_log WHERE del_flag = 0 AND user_id = #{userId} AND clock_in_time like '%${date}%' AND type in (0,1)")
Integer getClockInTotal(@Param("userId") String userId,@Param("date") String date);
- @Select("select clock_start_time,(select clock_in_time from clockin_log where project_item_id = a.id and del_flag = 0 and user_id = '${userId}' and clock_in_time like '%${date}%') time from clock_in_project_item a where project_id = '${projectId}' AND a.del_flag = 0 AND type = #{type}\n")
+ @Select("select clock_start_time,(select clock_in_time from clockin_log where project_item_id = a.id and del_flag = 0 and user_id = '${userId}' and clock_in_time like '%${date}%') time, a.type from clock_in_project_item a where project_id = '${projectId}' AND a.del_flag = 0 AND type in (${type},2)\n")
List getClockInLogExpeort(@Param("date") String date,@Param("projectId") String projectId,@Param("userId") String userId,@Param("type") Integer type);
}