Browse Source

问题处理

guq 7 years ago
parent
commit
9eb39a6f78
15 changed files with 67 additions and 148 deletions
  1. 6 5
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxMeetingServiceImpl.java
  2. 4 4
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxNotifyServiceImpl.java
  3. 4 4
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxOaApproveServiceImpl.java
  4. 3 3
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxOaLeaveServiceImpl.java
  5. 3 3
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxPrincipalMailboxServiceImpl.java
  6. 3 3
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxTaskNotifyServiceImpl.java
  7. 4 4
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxVoteServiceImpl.java
  8. 5 5
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/support/RemindTask.java
  9. 0 78
      applications/wechat/wechat-api/pom.xml
  10. 2 2
      applications/wechat/wechat-api/src/main/java/com/usoftchina/smartschool/wechat/api/WxPushApi.java
  11. 0 18
      applications/wechat/wechat-api/src/main/java/com/usoftchina/smartschool/wechat/service/WxPushService.java
  12. 4 3
      applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/controller/WxPushController.java
  13. 13 0
      applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/service/WxPushService.java
  14. 5 5
      applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/service/impl/WxPushServiceImpl.java
  15. 11 11
      applications/wechat/wechat-server/src/main/resources/application.yml

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

@@ -13,7 +13,8 @@ import com.usoftchina.smartschool.school.wxschool.basic.service.WxMeetingService
 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.service.WxPushService;
+
+import com.usoftchina.smartschool.wechat.api.WxPushApi;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -32,7 +33,7 @@ public class WxMeetingServiceImpl implements WxMeetingService {
 	private WxTeacherMapper teacherMapper;
 
 	@Autowired
-	private WxPushService wxPushService;
+	private WxPushApi wxPushApi;
 
 	@Autowired
 	private WxSchoolMapper wxSchoolMapper;
@@ -80,9 +81,9 @@ public class WxMeetingServiceImpl implements WxMeetingService {
 				meetingRecordsMapper.save(meetingRecordsDO);
 			}
 			Timer timer = new Timer();
-			timer.schedule(new RemindTask(teacherMapper,wxSchoolMapper,wxPushService,meetingMapper,1,meetingDO), startDate);
-			timer.schedule(new RemindTask(teacherMapper,wxSchoolMapper,wxPushService,meetingMapper,2,meetingDO), endDate);
-			timer.schedule(new RemindTask(teacherMapper,wxSchoolMapper,wxPushService,meetingMapper,3,meetingDO), reminderDate);
+			timer.schedule(new RemindTask(teacherMapper,wxSchoolMapper,wxPushApi,meetingMapper,1,meetingDO), startDate);
+			timer.schedule(new RemindTask(teacherMapper,wxSchoolMapper,wxPushApi,meetingMapper,2,meetingDO), endDate);
+			timer.schedule(new RemindTask(teacherMapper,wxSchoolMapper,wxPushApi,meetingMapper,3,meetingDO), reminderDate);
 			return "创建成功";
 		}else {
 			throw new Exception("创建失败,请核查");

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

@@ -6,7 +6,7 @@ import com.usoftchina.smartschool.school.po.*;
 import com.usoftchina.smartschool.school.wxschool.basic.service.WxNotifyService;
 import com.usoftchina.smartschool.school.wxschool.mapper.*;
 import com.usoftchina.smartschool.school.wxschool.utils.ObjectUtils;
-import com.usoftchina.smartschool.wechat.service.WxPushService;
+import com.usoftchina.smartschool.wechat.api.WxPushApi;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -29,7 +29,7 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 	private WxStudentMapper studentMapper;
 
 	@Autowired
-	private WxPushService wxPushService;
+	private WxPushApi wxPushApi;
 
 	@Autowired
 	private WxSchoolMapper wxSchoolMapper;
@@ -91,7 +91,7 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 					notifyrecordsMapper.save(notifyrecordsDO);
 					TeacherDO teacherDO = teacherMapper.get(l);
 					SchoolDO schoolDO = wxSchoolMapper.get(teacherDO.getSchoolId());
-					wxPushService.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(), "h0BkcnTo24b2jsficMeVO0B17GvE-VzlPvF0fVXea4w", "您好,您有一条通知", schoolDO.getSchoolName(),teacherMapper.get(notifyCreator).getTeacherName(),format.format(new Date()),notifyDetails, "点击查看详情", "");
+					wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(), "h0BkcnTo24b2jsficMeVO0B17GvE-VzlPvF0fVXea4w", "您好,您有一条通知", schoolDO.getSchoolName(),teacherMapper.get(notifyCreator).getTeacherName(),format.format(new Date()),notifyDetails, "点击查看详情", "");
 				}
 			}
 			List<Long> stuIds = JSON.parseArray(notifyStu, Long.class);
@@ -105,7 +105,7 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 					notifyrecordsMapper.save(notifyrecordsDO);
 					ParentsDO parentsDO = wxParentsMapper.get(l);
 					SchoolDO schoolDO = wxSchoolMapper.get(parentsDO.getSchoolId());
-					this.wxPushService.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),parentsDO.getOpenid(), "h0BkcnTo24b2jsficMeVO0B17GvE-VzlPvF0fVXea4w", "您好,您有一条通知", schoolDO.getSchoolName(),teacherMapper.get(notifyCreator).getTeacherName(),format.format(new Date()),notifyDetails, "点击查看详情", "");
+					this.wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),parentsDO.getOpenid(), "h0BkcnTo24b2jsficMeVO0B17GvE-VzlPvF0fVXea4w", "您好,您有一条通知", schoolDO.getSchoolName(),teacherMapper.get(notifyCreator).getTeacherName(),format.format(new Date()),notifyDetails, "点击查看详情", "");
 				}
 			}
 			return "创建成功";

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

@@ -15,7 +15,7 @@ import com.usoftchina.smartschool.school.wxschool.oaBean.Manager;
 import com.usoftchina.smartschool.school.wxschool.basic.service.WxOaApproveService;
 import com.usoftchina.smartschool.school.wxschool.utils.DateFormatUtil;
 import com.usoftchina.smartschool.school.wxschool.utils.ObjectUtils;
-import com.usoftchina.smartschool.wechat.service.WxPushService;
+import com.usoftchina.smartschool.wechat.api.WxPushApi;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -35,7 +35,7 @@ public class WxOaApproveServiceImpl implements WxOaApproveService {
 	private WxTeacherMapper teacherMapper;
 
 	@Autowired
-	private WxPushService wxPushService;
+	private WxPushApi wxPushApi;
 
 	@Autowired
 	private WxSchoolMapper wxSchoolMapper;
@@ -77,9 +77,9 @@ public class WxOaApproveServiceImpl implements WxOaApproveService {
 						oaArticlesMapper.save(articles);
 					}
 				}
-				this.wxPushService.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),"ohqfldHKfEmZPrLthLYt3h5SEjqd0AY7UFdngTDLTFY","您有一个待审批事项",approveTitle,teacher.getTeacherName(),format.format(new Date()),approveDetails,"点击查看详情","");
+				this.wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),"ohqfldHKfEmZPrLthLYt3h5SEjqd0AY7UFdngTDLTFY","您有一个待审批事项",approveTitle,teacher.getTeacherName(),format.format(new Date()),approveDetails,"点击查看详情","");
 			}else {
-				this.wxPushService.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),"ohqfldHKfEmZPrLthLYt3h5SEjqd0AY7UFdngTDLTFY","您有一个待审批事项",approveTitle,teacher.getTeacherName(),format.format(new Date()),approveDetails,"点击查看详情","");
+				this.wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),"ohqfldHKfEmZPrLthLYt3h5SEjqd0AY7UFdngTDLTFY","您有一个待审批事项",approveTitle,teacher.getTeacherName(),format.format(new Date()),approveDetails,"点击查看详情","");
 			}
 			return i;
 		}else {

+ 3 - 3
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxOaLeaveServiceImpl.java

@@ -8,7 +8,7 @@ import com.usoftchina.smartschool.school.wxschool.mapper.*;
 import com.usoftchina.smartschool.school.wxschool.basic.service.WxOaLeaveService;
 import com.usoftchina.smartschool.school.wxschool.utils.DateFormatUtil;
 import com.usoftchina.smartschool.school.wxschool.utils.ObjectUtils;
-import com.usoftchina.smartschool.wechat.service.WxPushService;
+import com.usoftchina.smartschool.wechat.api.WxPushApi;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -33,7 +33,7 @@ public class WxOaLeaveServiceImpl implements WxOaLeaveService {
 	private WxOaLeaveReplyMapper oaLeaveReplyMapper;
 
 	@Autowired
-	private WxPushService wxPushService;
+	private WxPushApi wxPushApi;
 
 	@Autowired
 	private WxSchoolMapper wxSchoolMapper;
@@ -67,7 +67,7 @@ public class WxOaLeaveServiceImpl implements WxOaLeaveService {
 				for (Long teacherId:longs) {
 					TeacherDO teacherDO = teacherMapper.get(teacherId);
 					SchoolDO schoolDO = wxSchoolMapper.get(teacherDO.getSchoolId());
-					this.wxPushService.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(), "QC8H4hQd1Fh0wqaaE3mbAxvoBC6y-XkHctIe8Kx6gcA", "您好,您有一个来自家长的请假申请",studentMapper.get(lvProposer).getStuName(), json.getString("startDate")+"-"+json.getString("endDate"), leave.getLvDetails(),"-", "点击查看详情", "");
+					this.wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(), "QC8H4hQd1Fh0wqaaE3mbAxvoBC6y-XkHctIe8Kx6gcA", "您好,您有一个来自家长的请假申请",studentMapper.get(lvProposer).getStuName(), json.getString("startDate")+"-"+json.getString("endDate"), leave.getLvDetails(),"-", "点击查看详情", "");
 				}
 				return "申请成功";
 			}else {

+ 3 - 3
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxPrincipalMailboxServiceImpl.java

@@ -7,7 +7,7 @@ import com.usoftchina.smartschool.school.wxschool.mapper.*;
 import com.usoftchina.smartschool.school.wxschool.basic.service.WxPrincipalMailboxService;
 import com.usoftchina.smartschool.school.wxschool.utils.JavaBeanUtil;
 import com.usoftchina.smartschool.school.wxschool.utils.ObjectUtils;
-import com.usoftchina.smartschool.wechat.service.WxPushService;
+import com.usoftchina.smartschool.wechat.api.WxPushApi;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -37,7 +37,7 @@ public class WxPrincipalMailboxServiceImpl implements WxPrincipalMailboxService
 	private WxSchoolMapper schoolMapper;
 
 	@Autowired
-	private WxPushService wxPushService;
+	private WxPushApi wxPushApi;
 
 	/**
 	 * 校长信箱创建
@@ -55,7 +55,7 @@ public class WxPrincipalMailboxServiceImpl implements WxPrincipalMailboxService
 			SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
 			SchoolDO schoolDO = schoolMapper.get(schoolId);
 			TeacherDO teacherDO = teacherMapper.get(principalMailboxDO.getNotifier());
-			this.wxPushService.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(), "h0BkcnTo24b2jsficMeVO0B17GvE-VzlPvF0fVXea4w", "您有一个新的邮件通知",schoolDO.getSchoolName(),parentsMapper.get(principalMailboxDO.getMailboxCreator()).getParentsName(), simpleDateFormat.format(new Date()), principalMailboxDO.getMailboxContext(),"点击查看详情", "");
+			this.wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(), "h0BkcnTo24b2jsficMeVO0B17GvE-VzlPvF0fVXea4w", "您有一个新的邮件通知",schoolDO.getSchoolName(),parentsMapper.get(principalMailboxDO.getMailboxCreator()).getParentsName(), simpleDateFormat.format(new Date()), principalMailboxDO.getMailboxContext(),"点击查看详情", "");
 			return principalMailboxDO.getMailboxId();
 		}else {
 			throw new Exception("提交失败,请重新提交");

+ 3 - 3
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxTaskNotifyServiceImpl.java

@@ -8,7 +8,7 @@ import com.usoftchina.smartschool.school.wxschool.mapper.*;
 import com.usoftchina.smartschool.school.wxschool.utils.DateFormatUtil;
 import com.usoftchina.smartschool.school.wxschool.utils.JavaBeanUtil;
 import com.usoftchina.smartschool.school.wxschool.utils.ObjectUtils;
-import com.usoftchina.smartschool.wechat.service.WxPushService;
+import com.usoftchina.smartschool.wechat.api.WxPushApi;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -37,7 +37,7 @@ public class WxTaskNotifyServiceImpl implements WxTaskNotifyService {
 	private WxStudentMapper studentMapper;
 
 	@Autowired
-	private WxPushService wxPushService;
+	private WxPushApi wxPushApi;
 
 	@Autowired
 	private WxSchoolMapper wxSchoolMapper;
@@ -75,7 +75,7 @@ public class WxTaskNotifyServiceImpl implements WxTaskNotifyService {
 				SchoolDO schoolDO = wxSchoolMapper.get(schoolId);
 				List<Long> longs = JSON.parseArray(taskNotifier, Long.class);
 				for (Long parentId:longs) {
-					this.wxPushService.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),parentsMapper.get(parentId).getOpenid(), "WwKtiHd4lso9axuavfLdpHIVbzTiopOTyh_uCsL3ZI8",taskTitle,"-",format.format(new Date()), taskContext,"-", "点击查看详情", "");
+					this.wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),parentsMapper.get(parentId).getOpenid(), "WwKtiHd4lso9axuavfLdpHIVbzTiopOTyh_uCsL3ZI8",taskTitle,"-",format.format(new Date()), taskContext,"-", "点击查看详情", "");
 				}
 			}
 			return "作业发布成功";

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

@@ -8,7 +8,7 @@ import com.usoftchina.smartschool.school.wxschool.mapper.*;
 import com.usoftchina.smartschool.school.wxschool.support.RemindTaskVote;
 import com.usoftchina.smartschool.school.wxschool.utils.DateFormatUtil;
 import com.usoftchina.smartschool.school.wxschool.utils.ObjectUtils;
-import com.usoftchina.smartschool.wechat.service.WxPushService;
+import com.usoftchina.smartschool.wechat.api.WxPushApi;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -35,7 +35,7 @@ public class WxVoteServiceImpl implements WxVoteService {
 	private WxTeacherMapper teacherMapper;
 
 	@Autowired
-	private WxPushService wxPushService;
+	private WxPushApi wxPushApi;
 
 	@Autowired
 	private WxSchoolMapper wxSchoolMapper;
@@ -99,7 +99,7 @@ public class WxVoteServiceImpl implements WxVoteService {
 					TeacherDO teacherDO = teacherMapper.get(ll);
 					SchoolDO schoolDO = wxSchoolMapper.get(teacherDO.getSchoolId());
 					SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
-					this.wxPushService.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),"h0BkcnTo24b2jsficMeVO0B17GvE-VzlPvF0fVXea4w","有一个投票单需要您的支持",schoolDO.getSchoolName(),teacherMapper.get(creator).getTeacherName(),format.format(new Date()),vote.getVoteName(),"点击查看详情","");
+					this.wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),"h0BkcnTo24b2jsficMeVO0B17GvE-VzlPvF0fVXea4w","有一个投票单需要您的支持",schoolDO.getSchoolName(),teacherMapper.get(creator).getTeacherName(),format.format(new Date()),vote.getVoteName(),"点击查看详情","");
 				}
 			}
 			List<Long> stuId = JSON.parseArray(stuIds, Long.class);
@@ -112,7 +112,7 @@ public class WxVoteServiceImpl implements WxVoteService {
 						ParentsDO parentsDO = wxParentsMapper.get(ps.getParentId());
 						SchoolDO schoolDO = wxSchoolMapper.get(parentsDO.getSchoolId());
 						SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
-						this.wxPushService.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(), parentsDO.getOpenid(), "h0BkcnTo24b2jsficMeVO0B17GvE-VzlPvF0fVXea4w", "有一个投票单需要您的支持", schoolDO.getSchoolName(), teacherMapper.get(creator).getTeacherName(), format.format(new Date()), vote.getVoteName(), "点击查看详情", "");
+						this.wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(), parentsDO.getOpenid(), "h0BkcnTo24b2jsficMeVO0B17GvE-VzlPvF0fVXea4w", "有一个投票单需要您的支持", schoolDO.getSchoolName(), teacherMapper.get(creator).getTeacherName(), format.format(new Date()), vote.getVoteName(), "点击查看详情", "");
 					}
 				}
 			}

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

@@ -6,7 +6,7 @@ import com.usoftchina.smartschool.school.po.SchoolDO;
 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.wechat.service.WxPushService;
+import com.usoftchina.smartschool.wechat.api.WxPushApi;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import java.text.SimpleDateFormat;
@@ -21,7 +21,7 @@ public class RemindTask extends TimerTask {
     private WxMeetingMapper meetingMapper;
 
     @Autowired
-    private WxPushService wxPushService;
+    private WxPushApi wxPushApi;
 
     @Autowired
     private WxSchoolMapper wxSchoolMapper;
@@ -33,11 +33,11 @@ public class RemindTask extends TimerTask {
 
     private Integer i;
 
-    public RemindTask(WxTeacherMapper teacherM,WxSchoolMapper wxSchool,WxPushService wxPushs,WxMeetingMapper nm, Integer ll, MeetingDO meet){//关键点解决 null指针错误,
+    public RemindTask(WxTeacherMapper teacherM,WxSchoolMapper wxSchool,WxPushApi wxPushs,WxMeetingMapper nm, Integer ll, MeetingDO meet){//关键点解决 null指针错误,
         teacherMapper = teacherM;
         wxSchoolMapper = wxSchool;
         meetingMapper=nm;
-        wxPushService = wxPushs;
+        wxPushApi = wxPushs;
         meetingDO = meet;
         i= ll;
         }
@@ -53,7 +53,7 @@ public class RemindTask extends TimerTask {
                 List<Long> list = removeDuplicate(longs);
                 for (Long teacherId:list) {
                     SchoolDO schoolDO = wxSchoolMapper.get(meetingDO.getSchoolId());
-                    this.wxPushService.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherMapper.get(teacherId).getOpenid(), "_hX_lGEG1W1bJmW37VBaPYQoLrRrUAlNCSScezZQQWk","您好,您有一条新的会议通知", meetingDO.getMeetingName(),simpleDateFormat.format(meetingDO.getStartDate()),meetingDO.getMeetingAddress(),"-", "点击查看详情", "");
+                    this.wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherMapper.get(teacherId).getOpenid(), "_hX_lGEG1W1bJmW37VBaPYQoLrRrUAlNCSScezZQQWk","您好,您有一条新的会议通知", meetingDO.getMeetingName(),simpleDateFormat.format(meetingDO.getStartDate()),meetingDO.getMeetingAddress(),"-", "点击查看详情", "");
                 }
 
             }

+ 0 - 78
applications/wechat/wechat-api/pom.xml

@@ -12,70 +12,6 @@
     <artifactId>wechat-api</artifactId>
 
     <dependencies>
-        <dependency>
-            <groupId>com.usoftchina.smartschool</groupId>
-            <artifactId>wechat-server</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>fastjson</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.jdom</groupId>
-            <artifactId>jdom</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.github.kevinsawicki</groupId>
-            <artifactId>http-request</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-lang3</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>net.sf.json-lib</groupId>
-            <artifactId>json-lib</artifactId>
-            <classifier>jdk15</classifier>
-        </dependency>
-        <dependency>
-            <groupId>com.usoftchina.smartschool</groupId>
-            <artifactId>server-starter</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>com.usoftchina.smartschool</groupId>
-            <artifactId>core</artifactId>
-        </dependency>
-
-        <!--test-->
-        <dependency>
-            <groupId>com.usoftchina.smartschool</groupId>
-            <artifactId>test-starter</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-        <!-- db -->
-        <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.mybatis.spring.boot</groupId>
-            <artifactId>mybatis-spring-boot-starter</artifactId>
-        </dependency>
-        <!-- sleuth -->
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-starter-zipkin</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.amqp</groupId>
-            <artifactId>spring-rabbit</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>net.logstash.logback</groupId>
-            <artifactId>logstash-logback-encoder</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-openfeign</artifactId>
@@ -84,19 +20,5 @@
             <groupId>com.usoftchina.smartschool</groupId>
             <artifactId>core</artifactId>
         </dependency>
-        <dependency>
-            <groupId>com.github.pagehelper</groupId>
-            <artifactId>pagehelper-spring-boot-starter</artifactId>
-        </dependency>
-        <!-- feign -->
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-starter-openfeign</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
-        </dependency>
-
     </dependencies>
 </project>

+ 2 - 2
applications/wechat/wechat-api/src/main/java/com/usoftchina/smartschool/wechat/api/WxPushApi.java

@@ -1,6 +1,6 @@
 package com.usoftchina.smartschool.wechat.api;
 
-/*
+
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -13,4 +13,4 @@ public interface WxPushApi {
                          @RequestParam("title")String title, @RequestParam("keyword1")String keyword1, @RequestParam("keyword2")String keyword2, @RequestParam("keyword3")String keyword3,
                          @RequestParam("keyword4")String keyword4, @RequestParam("remark")String remark, @RequestParam("url")String url);
 
-}*/
+}

+ 0 - 18
applications/wechat/wechat-api/src/main/java/com/usoftchina/smartschool/wechat/service/WxPushService.java

@@ -1,18 +0,0 @@
-package com.usoftchina.smartschool.wechat.service;
-
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-
-@FeignClient(value = "wechat-server")
-public interface WxPushService {
-
-    /**
-     * 推送消息
-     * @param
-     * @return
-     */
-    @RequestMapping(value = "/wxPush", method = RequestMethod.GET)
-    public String wxPush(@RequestParam("appId")String appId, @RequestParam("secret") String secret, @RequestParam("openid") String openid, @RequestParam("templateId")String templateId, @RequestParam("title")String title, @RequestParam("keyword1")String keyword1, @RequestParam("keyword2")String keyword2, @RequestParam("keyword3")String keyword3, @RequestParam("keyword4")String keyword4, @RequestParam("remark")String remark, @RequestParam("url")String url);
-}

+ 4 - 3
applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/controller/WxPushController.java

@@ -1,5 +1,6 @@
 package com.usoftchina.smartschool.wechat.controller;
 
+import com.usoftchina.smartschool.wechat.service.WxPushService;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -14,12 +15,12 @@ import org.springframework.web.bind.annotation.RestController;
 @RestController
 public class WxPushController {
 
-   /* @Autowired
+    @Autowired
     private WxPushService wxPushService;
 
     @PostMapping("/wxpush")
-    public String wxPush(@RequestParam("appId")String appId, @RequestParam("secret") String secret, @RequestParam("openid") String openid, @RequestParam("templateId")String templateId, @RequestParam("title")String title, @RequestParam("keyword1")String keyword1, @RequestParam("keyword2")String keyword2, @RequestParam("keyword3")String keyword3, @RequestParam("keyword4")String keyword4, @RequestParam("remark")String remark, @RequestParam("url")String url){
+    public String wxPush(String appId, String secret, String openid, String templateId, String title, String keyword1, String keyword2, String keyword3, String keyword4, String remark, String url){
         return wxPushService.wxPush(appId, secret,openid, templateId, title, keyword1, keyword2, keyword3, keyword4, remark, url);
-    };*/
+    };
 
 }

+ 13 - 0
applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/service/WxPushService.java

@@ -0,0 +1,13 @@
+package com.usoftchina.smartschool.wechat.service;
+
+import org.apache.ibatis.annotations.Param;
+
+public interface WxPushService {
+
+    /**
+     * 推送消息
+     * @param
+     * @return
+     */
+    public String wxPush(@Param("appId") String appId, @Param("secret") String secret, @Param("openid") String openid, @Param("templateId") String templateId, @Param("title") String title, @Param("keyword1") String keyword1, @Param("keyword2") String keyword2, @Param("keyword3") String keyword3, @Param("keyword4") String keyword4, @Param("remark") String remark, @Param("url") String url);
+}

+ 5 - 5
applications/wechat/wechat-api/src/main/java/com/usoftchina/smartschool/wechat/service/impl/WxPushServiceImpl.java → applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/service/impl/WxPushServiceImpl.java

@@ -4,18 +4,18 @@ import com.alibaba.fastjson.JSON;
 import com.github.kevinsawicki.http.HttpRequest;
 import com.usoftchina.smartschool.wechat.service.WxPushService;
 import com.usoftchina.smartschool.wechat.wxUtils.ObjectUtils;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.stereotype.Service;
 
 import java.util.HashMap;
 
+@Service
 public class WxPushServiceImpl implements WxPushService{
     /**
      * 推送消息
      * @param
      * @return
      */
+    @Override
     public String wxPush(String appId,String secret,String openid, String templateId, String title, String keyword1, String keyword2, String keyword3, String keyword4, String remark, String url) {
             if (ObjectUtils.isNotEmpty(openid)){
                 String json="{\"touser\":\""+openid+"\","
@@ -31,7 +31,7 @@ public class WxPushServiceImpl implements WxPushService{
                         + "\"remark\":{\"value\":\""+remark+"\",\"color\":\"#173177\"}}}";
                 String access_token=  getWxAcessToken(appId,secret);
                 String token= JSON.parseObject(access_token).getString("access_token");
-                com.github.kevinsawicki.http.HttpRequest hRequest=  com.github.kevinsawicki.http.HttpRequest.post("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token)
+                HttpRequest hRequest=  HttpRequest.post("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token)
                         .header("Content-Type", "application/json")
                         .send(json.getBytes());
                 String result= hRequest.body();
@@ -54,7 +54,7 @@ public class WxPushServiceImpl implements WxPushService{
             params.put("appid", appId);
             params.put("secret", secret);
             params.put("grant_type", "client_credential");
-            com.github.kevinsawicki.http.HttpRequest httpRequest= HttpRequest.get("https://api.weixin.qq.com/cgi-bin/token",params,false);
+            HttpRequest httpRequest= HttpRequest.get("https://api.weixin.qq.com/cgi-bin/token",params,false);
             String content=httpRequest.body();
             return content;
         }

+ 11 - 11
applications/wechat/wechat-server/src/main/resources/application.yml

@@ -7,17 +7,17 @@ spring:
     user:
       name: admin
       password: select111***
-  #datasource:
-    #driver-class-name: com.mysql.jdbc.Driver
-    #url: jdbc:mysql://10.10.100.166:3306/smart_campus?characterEncoding=utf-8&useSSL=false&allowMultiQueries=true
-    #username: root
-    #password: select111***
-    #hikari:
-      #minimum-idle: 5
-      #maximum-pool-size: 50
-      #idle-timeout: 30000
-      #max-lifetime: 1800000
-      #connection-timeout: 30000
+  datasource:
+    driver-class-name: com.mysql.jdbc.Driver
+    url: jdbc:mysql://10.10.100.166:3306/smart_campus?characterEncoding=utf-8&useSSL=false&allowMultiQueries=true
+    username: root
+    password: select111***
+    hikari:
+      minimum-idle: 5
+      maximum-pool-size: 50
+      idle-timeout: 30000
+      max-lifetime: 1800000
+      connection-timeout: 30000
   messages:
     basename: i18n/messages
     encoding: UTF-8