Browse Source

1、日志打印

guq 6 years ago
parent
commit
2070f69070

+ 4 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxMeetingServiceImpl.java

@@ -9,6 +9,8 @@ import com.usoftchina.smartschool.school.wxschool.support.RemindTask;
 import com.usoftchina.smartschool.school.wxschool.utils.DateFormatUtil;
 import com.usoftchina.smartschool.school.wxschool.utils.ObjectUtils;
 import com.usoftchina.smartschool.wechat.api.WxPushApi;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -40,6 +42,7 @@ public class WxMeetingServiceImpl implements WxMeetingService {
 	@Value("${smartschool.domain.wechat}")
 	private String wechatUrl;
 
+	private final static Logger LOGGER = LoggerFactory.getLogger(WxMeetingServiceImpl.class);
 	/**
 	 * 创建会议
 	 * @param jsonMeeting
@@ -99,6 +102,7 @@ public class WxMeetingServiceImpl implements WxMeetingService {
 						SchoolDO schoolDO = wxSchoolMapper.get(schoolId);
 						if (ObjectUtils.isNotEmpty(schoolDO)){
 							String openid = teacherMapper.get(l).getOpenid();
+							LOGGER.error("URL:{}" , wechatUrl);
 							wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(),openid , meeting, "您好,您有一条新的会议通知", meetingName, simpleDateFormat.format(meetingDO.getStartDate()), meetingAddress, "-", "点击查看详情",  wechatUrl + "/meet-detail/" + meetingDO.getMeetingId()+"?teacherId="+l);
 
 						}

+ 6 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/support/RemindTask.java

@@ -3,12 +3,15 @@ package com.usoftchina.smartschool.school.wxschool.support;
 import com.alibaba.fastjson.JSON;
 import com.usoftchina.smartschool.school.po.MeetingDO;
 import com.usoftchina.smartschool.school.po.SchoolDO;
+import com.usoftchina.smartschool.school.wxschool.basic.service.impl.WxMeetingServiceImpl;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxMeetingMapper;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxSchoolMapper;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxTeacherMapper;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxTemplateMapper;
 import com.usoftchina.smartschool.school.wxschool.utils.ObjectUtils;
 import com.usoftchina.smartschool.wechat.api.WxPushApi;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 
@@ -39,6 +42,8 @@ public class RemindTask extends TimerTask {
     @Value("${smartschool.domain.wechat}")
     private String wechatUrl;
 
+    private final static Logger LOGGER = LoggerFactory.getLogger(RemindTask.class);
+
     private MeetingDO meetingDO;
 
     private Integer i;
@@ -74,6 +79,7 @@ public class RemindTask extends TimerTask {
                     String openid = teacherMapper.get(teacherId).getOpenid();
                     if (ObjectUtils.isNotEmpty(schoolDO)){
                         try {
+                            LOGGER.error("URL:{}" , wechatUrl);
                             wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(),openid , meeting, "您好,您有一条新的会议通知",meetingName , simpleDateFormat.format(meetingDO.getStartDate()), meetingDO.getMeetingAddress(), "-", "点击查看详情", wechatUrl + "/meet-detail/" + meetingDO.getMeetingId()+"?teacherId="+teacherId);
                         } catch (Exception e) {
                             e.printStackTrace();