Bläddra i källkod

考勤消息通知

dzx 5 månader sedan
förälder
incheckning
eb958944c6

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

@@ -153,10 +153,11 @@ public class AttendanceMessageTask {
             );
 
             LocalDateTime recentlyTime = null;
+            String characterKey = "character_string16";
             String wechatTemplate = weChatUtil.getAttendanceMsgLateTemplate();
             if(messageSet.getMessageCategory() != null && messageSet.getMessageCategory() == 1){
                 wechatTemplate = weChatUtil.getAttendanceMsgLateTemplate();
-
+                characterKey = "character_string18";
                 //获取最近的时间
                 recentlyTime = getRecentlyTime(ruleDetails, now);
                 if(now.isBefore(recentlyTime)){
@@ -166,6 +167,7 @@ public class AttendanceMessageTask {
             }else if(messageSet.getMessageCategory() != null && messageSet.getMessageCategory() == 3){
                 wechatTemplate = weChatUtil.getAttendanceMsgAbsenceTemplate();
                 recentlyTime = getRecentlyOverTime(ruleDetails, now);
+                characterKey = "character_string36";
                 if(now.isBefore(recentlyTime)){
                     log.info("未到时间,不需要提醒");
                     continue;
@@ -218,9 +220,10 @@ public class AttendanceMessageTask {
                 const23.put("value", timePeriodStr);
                 paramJson.put("const23", const23);
 
+                //迟到人数或者缺勤人数
                 JSONObject character_string18 = new JSONObject();
                 character_string18.put("value", teacherCout - collect.size());
-                paramJson.put("character_string18", character_string18);
+                paramJson.put(characterKey, character_string18);
 
                 JSONObject character_string16 = new JSONObject();
                 character_string16.put("value", teacherCout);

+ 2 - 2
src/test/java/com/xjrsoft/module/job/AttendanceMessageTaskTest.java

@@ -158,7 +158,7 @@ class AttendanceMessageTaskTest {
         List<AttendanceRuleDetails> ruleDetails = ruleCategoryService.getTodayRules();
         //获取最近的时间
         LocalDateTime recentlyTime = getRecentlyTime(ruleDetails, now);
-        String wechatTemplate = weChatUtil.getAttendanceMessageTemplate();
+        String wechatTemplate = weChatUtil.getAttendanceMsgLateTemplate();
         WechatMessageLog log = wechatMessageLogService.getOne(
                 new QueryWrapper<WechatMessageLog>().lambda()
                         .select(WechatMessageLog.class, x -> VoToColumnUtil.fieldsToColumns(WechatMessageLog.class).contains(x.getProperty()))
@@ -272,7 +272,7 @@ class AttendanceMessageTaskTest {
                 );
 
                 WeChatSendMessageDto weChatSendMessageDto = new WeChatSendMessageDto();
-                weChatSendMessageDto.setTemplateId(weChatUtil.getAttendanceMessageTemplate());
+                weChatSendMessageDto.setTemplateId(weChatUtil.getAttenDanceWarnTemplate());
                 JSONObject paramJson = new JSONObject();
 
                 JSONObject thing6 = new JSONObject();