diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/xcx/clockin/service/impl/ClockinServiceImpl.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/xcx/clockin/service/impl/ClockinServiceImpl.java index 32afb64..a72e716 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/xcx/clockin/service/impl/ClockinServiceImpl.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/xcx/clockin/service/impl/ClockinServiceImpl.java @@ -175,6 +175,86 @@ public class ClockinServiceImpl implements IClockinService { return Result.OK(clockInLogResp); } + @Override + public Result clockInTotal(ClockInTotalReq clockInTotalReq) { + Map map = new HashMap<>(); + HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiAccount(clockInTotalReq.getToken()); + ClockinTeamLog clockinTeamLog = clockinTeamLogService.lambdaQuery() + .eq(ClockinTeamLog::getDelFlag, 0) + .eq(ClockinTeamLog::getUserId, hanHaiMember.getId()) + .one(); + ClockInProject clockInProject = clockInProjectService.lambdaQuery() + .eq(ClockInProject::getDelFlag, 0) + .eq(ClockInProject::getTeamId, clockinTeamLog.getTeamId()) + .one(); + + Date date = new Date(); + if(StringUtils.isNotBlank(clockInTotalReq.getDate())){ + date = DateUtils2.getDate(clockInTotalReq.getDate()); + } + String nowDay2 = DateUtils2.getNowDay2(DateUtils2.currentXDayOfMonth(date)); + Integer n = Integer.parseInt(nowDay2); + String yyyymm = DateUtils2.getYYYYMM(date); + List clockInTotalResps = new ArrayList<>(); + //正常 + Integer normal = 0; + //缺卡 + Integer noCard = 0; + //未打卡 + Integer abnormal = 0; + Long todayDate = DateUtils2.getTodayTwelve(); + for (int i = 1;i <= n;i++){ + + ClockInTotalResp clockInTotalResp = new ClockInTotalResp(); + String dd = i+""; + if(i < 10){ + dd = "0"+i; + } + dd = "-"+dd; + String yyyymmdd = yyyymm+dd; + Long milliSecond = DateUtils2.getMilliSecond(yyyymmdd+" 23:59:59"); + if(milliSecond>todayDate){ + break; + } + + Date date2 = DateUtils2.getDate(yyyymmdd + " 23:59:59"); + LocalDateTime localDateTime = DateUtils2.dateToDateTime(date2); + Integer type = 0; + if(DayOfWeek.SATURDAY.equals(localDateTime.getDayOfWeek()) || DayOfWeek.SUNDAY.equals(localDateTime.getDayOfWeek())){ + type = 1; + } + List clockInProjectItemList = clockInProjectItemService.lambdaQuery() + .eq(ClockInProjectItem::getDelFlag, 0) + .eq(ClockInProjectItem::getType,type) + .eq(ClockInProjectItem::getProjectId, clockInProject.getId()) + .list(); + Integer clockInTotal = clockinLogService.getClockInTotal(hanHaiMember.getId(), yyyymmdd); + clockInTotalResp.setDate(yyyymmdd); + + if(clockInTotal == 0){// 2未打卡 + + abnormal = abnormal+1; + + clockInTotalResp.setType(2); + }else if(clockInTotal clockInTotal(ClockInTotalReq clockInTotalReq) { Map map = new HashMap<>(); @@ -242,7 +322,7 @@ public class ClockinServiceImpl implements IClockinService { }else if(clockInTotal verifyFace(VerifyFaceReq verifyFaceReq) { diff --git a/jeecg-boot-module-system/src/main/resources/application-dev.yml b/jeecg-boot-module-system/src/main/resources/application-dev.yml index 9e247e9..466c69e 100644 --- a/jeecg-boot-module-system/src/main/resources/application-dev.yml +++ b/jeecg-boot-module-system/src/main/resources/application-dev.yml @@ -134,7 +134,7 @@ spring: # connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 datasource: master: - url: jdbc:mysql://82.156.46.249:3306/clockin?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&autoReconnect=true&failOverReadOnly=false + url: jdbc:mysql://82.156.46.249:3306/clockin_test?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&autoReconnect=true&failOverReadOnly=false # url: jdbc:mysql://gz-cdb-4486l6qp.sql.tencentcdb.com:28636/clockin?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&autoReconnect=true&failOverReadOnly=false username: root # password: hhlm.168820241016