Browse Source

上传一下代码

master
HY 2 months ago
parent
commit
dbf09c89d0
2 changed files with 20 additions and 5 deletions
  1. +18
    -3
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/controller/ClockinLogController.java
  2. +2
    -2
      jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/mapper/ClockinLogMapper.java

+ 18
- 3
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/controller/ClockinLogController.java View File

@ -1,5 +1,7 @@
package org.jeecg.modules.clockinlog.controller; package org.jeecg.modules.clockinlog.controller;
import java.time.DayOfWeek;
import java.time.LocalDateTime;
import java.time.YearMonth; import java.time.YearMonth;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -196,7 +198,7 @@ public class ClockinLogController extends JeecgController<ClockinLog, IClockinLo
@RequestMapping(value = "/exportXls2") @RequestMapping(value = "/exportXls2")
public ModelAndView exportXls3(HttpServletRequest request, ClockinLog clockinLog) { public ModelAndView exportXls3(HttpServletRequest request, ClockinLog clockinLog) {
return this.exportXls3(request,ClockInLogExportResp2.class, "打卡");
return this.exportXls2(request,ClockInLogExportResp.class, "打卡");
} }
// @RequestMapping(value = "/exportXls2") // @RequestMapping(value = "/exportXls2")
@ -270,7 +272,14 @@ public class ClockinLogController extends JeecgController<ClockinLog, IClockinLo
yearMonthDay = nowYearMonth+"-0"+n; yearMonthDay = nowYearMonth+"-0"+n;
} }
List<ClockInLogResp> clockInLogExpeort = clockinLogMapper.getClockInLogExpeort(yearMonthDay, clockInProject.getId(), clockinTeamLog.getUserId());
Date date = DateUtils2.getDate(yearMonthDay + " 23:59:59");
LocalDateTime localDateTime = DateUtils2.dateToDateTime(date);
Integer type = 0;
if(DayOfWeek.SATURDAY.equals(localDateTime.getDayOfWeek()) || DayOfWeek.SUNDAY.equals(localDateTime.getDayOfWeek())){
type = 1;
}
List<ClockInLogResp> clockInLogExpeort = clockinLogMapper.getClockInLogExpeort(yearMonthDay, clockInProject.getId(), clockinTeamLog.getUserId(),type);
String clockInTime = ""; String clockInTime = "";
for (ClockInLogResp clockInLogResp:clockInLogExpeort) { for (ClockInLogResp clockInLogResp:clockInLogExpeort) {
@ -362,8 +371,14 @@ public class ClockinLogController extends JeecgController<ClockinLog, IClockinLo
for (int day = 1; day <= daysInMonth; day++) { for (int day = 1; day <= daysInMonth; day++) {
String yearMonthDay = nowYearMonth + "-" + (day < 10 ? "0" + day : day); String yearMonthDay = nowYearMonth + "-" + (day < 10 ? "0" + day : day);
Date date = DateUtils2.getDate(yearMonthDay + " 23:59:59");
LocalDateTime localDateTime = DateUtils2.dateToDateTime(date);
Integer type = 0;
if(DayOfWeek.SATURDAY.equals(localDateTime.getDayOfWeek()) || DayOfWeek.SUNDAY.equals(localDateTime.getDayOfWeek())){
type = 1;
}
List<ClockInLogResp> clockInLogs = clockinLogMapper.getClockInLogExpeort( List<ClockInLogResp> clockInLogs = clockinLogMapper.getClockInLogExpeort(
yearMonthDay, clockInProject.getId(), clockinTeamLog.getUserId()
yearMonthDay, clockInProject.getId(), clockinTeamLog.getUserId(),type
); );
// 拼接打卡时间或标记缺卡 // 拼接打卡时间或标记缺卡


+ 2
- 2
jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/clockinlog/mapper/ClockinLogMapper.java View File

@ -41,7 +41,7 @@ public interface ClockinLogMapper extends BaseMapper<ClockinLog> {
@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)") @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); 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}'\n")
List<ClockInLogResp> getClockInLogExpeort(@Param("date") String date,@Param("projectId") String projectId,@Param("userId") String userId);
@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")
List<ClockInLogResp> getClockInLogExpeort(@Param("date") String date,@Param("projectId") String projectId,@Param("userId") String userId,@Param("type") Integer type);
} }

Loading…
Cancel
Save