Browse Source

推送问题

8966 6 years ago
parent
commit
b3b738ea16

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

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

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

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

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

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