|
@@ -114,20 +114,16 @@ public class AttendanceMessageTask {
|
|
|
}
|
|
|
|
|
|
|
|
|
- String wechatTemplate = weChatUtil.getAttendanceMessageTemplate();
|
|
|
- WechatMessageLog log = wechatMessageLogService.getOne(
|
|
|
- new QueryWrapper<WechatMessageLog>().lambda()
|
|
|
- .select(WechatMessageLog.class, x -> VoToColumnUtil.fieldsToColumns(WechatMessageLog.class).contains(x.getProperty()))
|
|
|
- .eq(WechatMessageLog::getSendTime, recentlyTime)
|
|
|
- .eq(WechatMessageLog::getTemplateId, wechatTemplate)
|
|
|
- );
|
|
|
- if(log != null){//已经推送过,不再进行推送
|
|
|
- return;
|
|
|
- }
|
|
|
+// WechatMessageLog log = wechatMessageLogService.getOne(
|
|
|
+// new QueryWrapper<WechatMessageLog>().lambda()
|
|
|
+// .select(WechatMessageLog.class, x -> VoToColumnUtil.fieldsToColumns(WechatMessageLog.class).contains(x.getProperty()))
|
|
|
+// .eq(WechatMessageLog::getSendTime, recentlyTime)
|
|
|
+// .eq(WechatMessageLog::getTemplateId, wechatTemplate)
|
|
|
+// );
|
|
|
+// if(log != null){//已经推送过,不再进行推送
|
|
|
+// return;
|
|
|
+// }
|
|
|
|
|
|
- WechatMessageLog messageLog = new WechatMessageLog();
|
|
|
- messageLog.setTemplateId(wechatTemplate);
|
|
|
- messageLog.setSendTime(recentlyTime);
|
|
|
|
|
|
List<AttendanceMessageSet> list = messageSetService.list(
|
|
|
new QueryWrapper<AttendanceMessageSet>().lambda()
|
|
@@ -166,6 +162,13 @@ public class AttendanceMessageTask {
|
|
|
|
|
|
|
|
|
for (AttendanceMessageSet messageSet : list) {
|
|
|
+ String wechatTemplate = weChatUtil.getAttendanceMsgLateTemplate();
|
|
|
+ if(messageSet.getMessageCategory() != null && messageSet.getMessageCategory() == 1){
|
|
|
+ wechatTemplate = weChatUtil.getAttendanceMsgLateTemplate();
|
|
|
+ }else if(messageSet.getMessageCategory() != null && messageSet.getMessageCategory() == 3){
|
|
|
+ wechatTemplate = weChatUtil.getAttendanceMsgAbsenceTemplate();
|
|
|
+ }
|
|
|
+
|
|
|
if(!messageSet.getTimePeriod().contains(timePeriod + "")){
|
|
|
continue;
|
|
|
}
|
|
@@ -236,7 +239,7 @@ public class AttendanceMessageTask {
|
|
|
);
|
|
|
|
|
|
WeChatSendMessageDto weChatSendMessageDto = new WeChatSendMessageDto();
|
|
|
- weChatSendMessageDto.setTemplateId(weChatUtil.getAttendanceMessageTemplate());
|
|
|
+ weChatSendMessageDto.setTemplateId(wechatTemplate);
|
|
|
JSONObject paramJson = new JSONObject();
|
|
|
|
|
|
JSONObject thing6 = new JSONObject();
|
|
@@ -268,10 +271,15 @@ public class AttendanceMessageTask {
|
|
|
weChatService.sendTemplateMessage(weChatSendMessageDto);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ WechatMessageLog messageLog = new WechatMessageLog();
|
|
|
+ messageLog.setTemplateId(wechatTemplate);
|
|
|
+ messageLog.setSendTime(recentlyTime);
|
|
|
+
|
|
|
+ messageLog.setCreateDate(new Date());
|
|
|
+ messageLog.setContent("消息推送人数:" + userCount);
|
|
|
+ wechatMessageLogService.save(messageLog);
|
|
|
}
|
|
|
- messageLog.setCreateDate(new Date());
|
|
|
- messageLog.setContent("消息推送人数:" + userCount);
|
|
|
- wechatMessageLogService.save(messageLog);
|
|
|
}
|
|
|
|
|
|
LocalDateTime getRecentlyTime(List<AttendanceRuleDetails> ruleDetails, LocalDateTime now){
|