瀏覽代碼

考勤消息通知调整

dzx 5 月之前
父節點
當前提交
a03249e764
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/main/java/com/xjrsoft/module/job/AttendanceMessageTask.java

+ 4 - 4
src/main/java/com/xjrsoft/module/job/AttendanceMessageTask.java

@@ -176,13 +176,13 @@ public class AttendanceMessageTask {
                                 .leftJoin(BaseTeacher.class, BaseTeacher::getUserId, XjrUser::getId)
                 );
                 //查询进入记录,就是实际到校的人数
-                long outInRecords = teachertOutInRecordService.count(
+                List<TeacherOutInRecord> outInRecords = teachertOutInRecordService.list(
                         new MPJLambdaWrapper<TeacherOutInRecord>()
                                 .le(TeacherOutInRecord::getRecordTime, recentlyTime)
                                 .eq(TeacherOutInRecord::getStatus, 1)
-                                .eq("DATE_FORMAT(record_time, '%Y-%m-%d')" , recentlyTime.toLocalDate())
-                                .groupBy(TeacherOutInRecord::getUserId)
+                                .eq("DATE_FORMAT(record_time, '%Y-%m-%d')", recentlyTime.toLocalDate())
                 );
+                List<Long> collect = outInRecords.stream().map(TeacherOutInRecord::getUserId).collect(Collectors.toList());
 
                 WeChatSendMessageDto weChatSendMessageDto = new WeChatSendMessageDto();
                 weChatSendMessageDto.setTemplateId(wechatTemplate);
@@ -201,7 +201,7 @@ public class AttendanceMessageTask {
                 paramJson.put("const23", const23);
 
                 JSONObject character_string18 = new JSONObject();
-                character_string18.put("value", teacherCout - outInRecords);
+                character_string18.put("value", teacherCout - collect.size());
                 paramJson.put("character_string18", character_string18);
 
                 JSONObject character_string16 = new JSONObject();