Browse Source

正式代码发布

RaoMeng 6 years ago
parent
commit
bc0d6f840f
21 changed files with 125 additions and 101 deletions
  1. 7 1
      README.md
  2. 2 1
      applications/school/school-server/pom.xml
  3. 1 11
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/SchoolApplication.java
  4. 6 5
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxMeetingServiceImpl.java
  5. 4 4
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxNotifyServiceImpl.java
  6. 4 4
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxOaApproveServiceImpl.java
  7. 3 3
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxOaLeaveServiceImpl.java
  8. 3 3
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxPrincipalMailboxServiceImpl.java
  9. 3 3
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxTaskNotifyServiceImpl.java
  10. 34 15
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxVoteServiceImpl.java
  11. 5 5
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/support/RemindTask.java
  12. 0 4
      applications/school/school-server/src/main/resources/config/application-docker-prod.yml
  13. 4 23
      applications/wechat/wechat-api/pom.xml
  14. 0 4
      applications/wechat/wechat-api/src/main/java/com/usoftchina/smartschool/wechat/WxApiApplication.java
  15. 16 0
      applications/wechat/wechat-api/src/main/java/com/usoftchina/smartschool/wechat/api/WxPushApi.java
  16. 2 2
      applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/WechatApplication.java
  17. 26 0
      applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/controller/WxPushController.java
  18. 1 1
      applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/service/WxPushService.java
  19. 2 2
      applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/service/impl/WxPushServiceImpl.java
  20. 0 8
      applications/wechat/wechat-server/src/main/resources/application.yml
  21. 2 2
      base-servers/gateway-server/src/main/java/com/usoftchina/smartschool/gateway/config/AuthFilter.java

+ 7 - 1
README.md

@@ -119,4 +119,10 @@
 #接口环境
 [智慧校园接口地址](https://school-api.ubtob.com)
 [微信端web](https://school-wechat.ubtob.com)
-[pc端web地址](https://school.ubtob.com)
+[pc端web地址](https://school.ubtob.com
+
+
+#程序发布
+1. 将代码合并至master,推送至远程
+2. 登陆[jenkins](http://10.10.100.200:5001/job/school/)
+3. 先构建smartschool-platform-prod任务,等任务正确构建完成,再构建其它剩余任务

+ 2 - 1
applications/school/school-server/pom.xml

@@ -12,6 +12,7 @@
     <artifactId>school-server</artifactId>
 
     <dependencies>
+
         <dependency>
             <groupId>com.usoftchina.smartschool</groupId>
             <artifactId>server-starter</artifactId>
@@ -80,7 +81,7 @@
         <!--webAPP-->
         <dependency>
             <groupId>com.usoftchina.smartschool</groupId>
-            <artifactId>wechat-server</artifactId>
+            <artifactId>wechat-api</artifactId>
         </dependency>
         <dependency>
             <groupId>commons-httpclient</groupId>

+ 1 - 11
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/SchoolApplication.java

@@ -19,19 +19,9 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
 @ServletComponentScan
 @EnableEurekaClient
 @EnableFeignClients("com.usoftchina.smartschool")
-@ComponentScan(basePackages = {"com.usoftchina.smartschool"})
-public class SchoolApplication extends WebMvcConfigurerAdapter {
+public class SchoolApplication {
     public static void main(String[] args) {
         SpringApplication.run(SchoolApplication.class, args);
     }
 
-    @Override
-    public void addCorsMappings(CorsRegistry registry) {
-
-        registry.addMapping("/**")
-                .allowCredentials(true)
-                .allowedHeaders("*")
-                .allowedOrigins("*")
-                .allowedMethods("*");
-    }
 }

+ 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());
-					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);
 					}
 				}
-				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 {
-				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());
-					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());
-			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) {
-					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 "作业发布成功";

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

@@ -8,10 +8,12 @@ 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.api.WxPushApi;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.text.SimpleDateFormat;
 import java.util.*;
 
 
@@ -32,6 +34,18 @@ public class WxVoteServiceImpl implements WxVoteService {
 	@Autowired
 	private WxTeacherMapper teacherMapper;
 
+	@Autowired
+	private WxPushApi wxPushApi;
+
+	@Autowired
+	private WxSchoolMapper wxSchoolMapper;
+
+	@Autowired
+	private WxParentsStuMapper wxParentsStuMapper;
+
+	@Autowired
+	private WxParentsMapper wxParentsMapper;
+
 
 	/** 创建投票单 */
 	public String voteCreate(String voteString) throws Exception {
@@ -79,24 +93,29 @@ public class WxVoteServiceImpl implements WxVoteService {
 				timer.schedule(new RemindTaskVote(voteMapper,vote.getVoteId()),DateFormatUtil.string2Date(voteEndDate));
 			}
 			List<Long> teacherId = JSON.parseArray(teacherIds, Long.class);
-			List<Long> list = removeDuplicate(teacherId);
+			if (ObjectUtils.isNotEmpty(teacherId)){
+				List<Long> list = removeDuplicate(teacherId);
+				for (Long ll:list) {
+					TeacherDO teacherDO = teacherMapper.get(ll);
+					SchoolDO schoolDO = wxSchoolMapper.get(teacherDO.getSchoolId());
+					SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+					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);
 			List<Long> list1 = removeDuplicate(stuId);
-			/*for (int j = 0; j <list.size() ; j++) {
-				Long teacherId = list.get(j);
-				SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
-				if (ObjectUtils.isNotEmpty(user)){
-					String userOpenid = user.getUserOpenid();
-					if (ObjectUtils.isNotEmpty(userOpenid)){
-						userService.wxPush(userOpenid,"h0BkcnTo24b2jsficMeVO0B17GvE-VzlPvF0fVXea4w","有一个投票单需要您的支持",schoolMapper.selectSchoolById(userMapper.selectUserById(votes.getLong("creator")).getSchoolId()).getSchName(),userMapper.selectUserById(votes.getLong("creator")).getUserName(),format.format(new Date()),vote.getVoteName(),"点击查看详情","https://www.akuiguoshu.com/smart-school/classRechargeDetail/"+userId+"/"+vote.getVoteId());
-					}*//*else {
-						throw new Exception("请关注智慧校园公众号");
-					}*//*
-				}else {
-					throw new Exception("用户不存在");
+			new ArrayList<Long>();
+			for (Long l:list1) {
+				List<ParentsStuDO> parentsStuDOS = wxParentsStuMapper.listByStuId(l);
+				if (parentsStuDOS.size() > 0) {
+					for (ParentsStuDO ps : parentsStuDOS) {
+						ParentsDO parentsDO = wxParentsMapper.get(ps.getParentId());
+						SchoolDO schoolDO = wxSchoolMapper.get(parentsDO.getSchoolId());
+						SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+						this.wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(), parentsDO.getOpenid(), "h0BkcnTo24b2jsficMeVO0B17GvE-VzlPvF0fVXea4w", "有一个投票单需要您的支持", schoolDO.getSchoolName(), teacherMapper.get(creator).getTeacherName(), format.format(new Date()), vote.getVoteName(), "点击查看详情", "");
+					}
 				}
-
-			}*/
+			}
 			return "创建成功";
 		}else {
 			throw new Exception("创建失败");

+ 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());
-                    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 - 4
applications/school/school-server/src/main/resources/config/application-docker-prod.yml

@@ -12,10 +12,6 @@ spring:
     virtual-host: school
     username: school
     password: select123***
-  datasource:
-    url: jdbc:mysql://10.10.100.18:3306/saas_biz?characterEncoding=utf-8&useSSL=false&allowMultiQueries=true
-    username: root
-    password: select111***
   redis:
     host: 10.10.100.173
     port: 6379

+ 4 - 23
applications/wechat/wechat-api/pom.xml

@@ -11,33 +11,14 @@
 
     <artifactId>wechat-api</artifactId>
 
-    <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <maven.compiler.source>1.8</maven.compiler.source>
-        <maven.compiler.target>1.8</maven.compiler.target>
-        <junit.version>4.12</junit.version>
-        <lombok.version>1.16.22</lombok.version>
-    </properties>
-
     <dependencies>
         <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>${junit.version}</version>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.projectlombok</groupId>
-            <artifactId>lombok</artifactId>
-            <version>${lombok.version}</version>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
         </dependency>
-
         <dependency>
-            <groupId>com.thoughtworks.xstream</groupId>
-            <artifactId>xstream</artifactId>
-            <version>1.4.9</version>
+            <groupId>com.usoftchina.smartschool</groupId>
+            <artifactId>core</artifactId>
         </dependency>
-
     </dependencies>
 </project>

+ 0 - 4
applications/wechat/wechat-api/src/main/java/com/usoftchina/smartschool/wechat/WxApiApplication.java

@@ -1,4 +0,0 @@
-package com.usoftchina.smartschool.wechat;
-
-public class WxApiApplication {
-}

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

@@ -0,0 +1,16 @@
+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;
+
+@FeignClient(name = "wechat-server")
+public interface WxPushApi {
+
+    @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);
+
+}

+ 2 - 2
applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/WechatApplication.java

@@ -32,7 +32,7 @@ public class WechatApplication  extends WebMvcConfigurerAdapter {
     }
 
     //解决跨域问题
-    @Override
+   /* @Override
     public void addCorsMappings(CorsRegistry registry) {
         registry.addMapping("/**")
                 .allowedHeaders("*")
@@ -44,5 +44,5 @@ public class WechatApplication  extends WebMvcConfigurerAdapter {
     @Bean
     public RestTemplate restTemplate(){
         return new RestTemplate();
-    }
+    }*/
 }

+ 26 - 0
applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/controller/WxPushController.java

@@ -0,0 +1,26 @@
+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;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author: guq
+ * @create: 2019-01-27 12:41
+ **/
+@RestController
+public class WxPushController {
+
+    @Autowired
+    private WxPushService wxPushService;
+
+    @PostMapping("/wxpush")
+    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);
+    };
+
+}

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

@@ -9,5 +9,5 @@ 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);
+    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);
 }

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

@@ -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;
         }

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

@@ -39,9 +39,6 @@ spring:
   redis:
     host: 10.10.100.166
     port: 6379
-  jackson:
-    date-format: yyyy-MM-dd HH:mm
-    time-zone: GMT+8
   servlet:
     multipart:
       max-file-size: 100Mb
@@ -76,11 +73,6 @@ info:
   version: '@project.version@'
   spring-boot-version: '@spring.boot.version@'
   spring-cloud-version: '@spring.cloud.version@'
-mybatis:
-  configuration:
-    map-underscore-to-camel-case: true
-  type-aliases-package: com.usoftchina.smartschool.wechat.wxDemo
-  mapper-locations: classpath:mapper/*.xml
 auth:
   public-key: auth/pub.key
 ribbon:

+ 2 - 2
base-servers/gateway-server/src/main/java/com/usoftchina/smartschool/gateway/config/AuthFilter.java

@@ -39,7 +39,7 @@ public class AuthFilter implements GlobalFilter, Ordered {
     public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
         try {
                 // 鉴别身份信息
-                String token = getAuthToken(exchange.getRequest());
+             /*   String token = getAuthToken(exchange.getRequest());
                 JwtInfo jwt = null;
                 try {
                     jwt = JwtHelper.getInfoFromToken(token, authConfig.getPublicKey());
@@ -53,7 +53,7 @@ public class AuthFilter implements GlobalFilter, Ordered {
                 AccountDTO accountDTO = accountApi.findByMobile(jwt.getUserName()).getData();
                 if (null == accountDTO) {
                     throw new BizException(ExceptionCode.USER_NOT_EXIST);
-                }
+                }*/
             return chain.filter(exchange);
         } finally {
             BaseContextHolder.remove();