Browse Source

添加测试环境

master
前端-胡立永 1 month ago
parent
commit
d1d4270a43
2 changed files with 83 additions and 2 deletions
  1. +82
    -1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/xcx/clockin/service/impl/ClockinServiceImpl.java
  2. +1
    -1
      jeecg-boot-module-system/src/main/resources/application-dev.yml

+ 82
- 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/xcx/clockin/service/impl/ClockinServiceImpl.java View File

@ -175,6 +175,86 @@ public class ClockinServiceImpl implements IClockinService {
return Result.OK(clockInLogResp);
}
@Override
public Result<?> clockInTotal(ClockInTotalReq clockInTotalReq) {
Map<String, Object> 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<ClockInTotalResp> 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<ClockInProjectItem> 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<clockInProjectItemList.size()){
clockInTotalResp.setType(1);
noCard = noCard+1;
}else{//0正常
clockInTotalResp.setType(0);
normal = normal+1;
}
clockInTotalResp.setNum(clockInProjectItemList.size()-clockInTotal);
clockInTotalResps.add(clockInTotalResp);
}
map.put("date",clockInTotalResps);
map.put("normal",normal);
map.put("noCard",noCard);
map.put("abnormal",abnormal);
return Result.OK(map);
}
/* 备份代码 2025-11-09
@Override
public Result<?> clockInTotal(ClockInTotalReq clockInTotalReq) {
Map<String, Object> map = new HashMap<>();
@ -242,7 +322,7 @@ public class ClockinServiceImpl implements IClockinService {
}else if(clockInTotal<clockInProjectItemList.size()){
clockInTotalResp.setType(1);
noCard = noCard+1;
}else{/**0正常*/
}else{//0正常
clockInTotalResp.setType(0);
normal = normal+1;
}
@ -255,6 +335,7 @@ public class ClockinServiceImpl implements IClockinService {
map.put("abnormal",abnormal);
return Result.OK(map);
}
*/
@Override
public Result<?> verifyFace(VerifyFaceReq verifyFaceReq) {


+ 1
- 1
jeecg-boot-module-system/src/main/resources/application-dev.yml View File

@ -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


Loading…
Cancel
Save