|
|
@@ -472,6 +472,56 @@ public class SmartAttendanceController implements SmartAttendanceControllerAPI {
|
|
|
return CommonResult.ok(result);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ @DESRespondSecret(validated = true)
|
|
|
+ public CommonResult studentHistoricalAttendance(String dateTime) {
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
+ Date startTime = null;
|
|
|
+ Date endTime= null;
|
|
|
+ HistoricalAttendanceVo historicalAttendanceVo = new HistoricalAttendanceVo();
|
|
|
+ if ("1".equals(dateTime)) {
|
|
|
+// 本学期
|
|
|
+ SmartSemester smartSemester = smartSemesterService.getSemester(now);
|
|
|
+ if (ObjectUtils.isEmpty(smartSemester)) {
|
|
|
+ return CommonResult.ok(historicalAttendanceVo);
|
|
|
+ }
|
|
|
+ startTime = smartSemester.getStartTime();
|
|
|
+ endTime = smartSemester.getEndTime();
|
|
|
+ System.out.println("smartSemester = " + smartSemester);
|
|
|
+
|
|
|
+ } else if ("2".equals(dateTime)) {
|
|
|
+// 近1个月
|
|
|
+ LocalDateTime localDateTime = now.minusMonths(1);
|
|
|
+ startTime = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
|
|
|
+ endTime = Date.from(now.atZone(ZoneId.systemDefault()).toInstant());
|
|
|
+
|
|
|
+ } else if ("3".equals(dateTime)) {
|
|
|
+// 近一周
|
|
|
+ LocalDateTime localDateTime = now.minusDays(7);
|
|
|
+ startTime = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
|
|
|
+ endTime = Date.from(now.atZone(ZoneId.systemDefault()).toInstant());
|
|
|
+ }
|
|
|
+
|
|
|
+ List<Integer> statusList=smartAttendanceService.getGroup();
|
|
|
+
|
|
|
+ for (Integer status : statusList) {
|
|
|
+ Integer count =smartAttendanceService.getStudentHistoricalAttendance(status,startTime,endTime);
|
|
|
+ if (0==status) {
|
|
|
+ historicalAttendanceVo.setPunctuality(count);
|
|
|
+ }else if (1==status){
|
|
|
+ historicalAttendanceVo.setBeLate(count);
|
|
|
+ }else if (3==status){
|
|
|
+ historicalAttendanceVo.setNotClockingIn(count);
|
|
|
+ }else if (6==status){
|
|
|
+ historicalAttendanceVo.setAskForLeave(count);
|
|
|
+ }else if (7==status){
|
|
|
+ historicalAttendanceVo.setClockOut(count);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return CommonResult.ok(historicalAttendanceVo);
|
|
|
+ }
|
|
|
+
|
|
|
public PersonalLeaveListSchoolPeriodRecordsResult getXwAttendance(String startDate, String endDate, Integer currentPage, Integer pageSize) {
|
|
|
//初始化客户端
|
|
|
SeewoClient seewoClient = new DefaultSeewoClient(new Account(seewoConfig.getAppId(), seewoConfig.getAppSecret()));
|