Browse Source

将域名转换为配置形式

guq 6 years ago
parent
commit
e422f67a34
13 changed files with 83 additions and 54 deletions
  1. 6 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/controller/WxUserController.java
  2. 5 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxMeetingServiceImpl.java
  3. 7 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxNotifyServiceImpl.java
  4. 7 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxOaApproveServiceImpl.java
  5. 5 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxOaLeaveServiceImpl.java
  6. 7 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxVoteServiceImpl.java
  7. 0 35
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/config/DomainConfig.java
  8. 19 7
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/oaBean/Manager.java
  9. 6 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/support/RemindTask.java
  10. 4 1
      applications/school/school-server/src/main/resources/application.yml
  11. 3 0
      applications/school/school-server/src/main/resources/config/application-dev.yml
  12. 4 1
      applications/school/school-server/src/main/resources/config/application-docker-prod.yml
  13. 10 0
      framework/core/src/main/java/com/usoftchina/smartschool/context/SpringContextHolder.java

+ 6 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/controller/WxUserController.java

@@ -10,6 +10,7 @@ import com.usoftchina.smartschool.school.wxschool.utils.ObjectUtils;
 import com.usoftchina.smartschool.school.wxschool.utils.ResultBean;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.util.Assert;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -44,6 +45,10 @@ public class WxUserController {
 
 	@Autowired
 	private WxSchoolService schoolService;
+
+
+	@Value("${smartschool.domain.wechat}")
+	private String wechatUrl;
 	/**
 	 * 发送验证码
 	 */
@@ -151,7 +156,7 @@ public class WxUserController {
 		} catch (UnsupportedEncodingException e) {
 			e.printStackTrace();
 		}
-		return  new ModelAndView("redirect:https://school-wechat.ubtob.com/bindMenu/open/"+openid+"/"+encode);
+		return  new ModelAndView("redirect:" + wechatUrl + "/bindMenu/open/"+openid+"/"+encode);
 	}
 
 	/**

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

@@ -16,6 +16,7 @@ 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.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import java.text.SimpleDateFormat;
@@ -39,6 +40,9 @@ public class WxMeetingServiceImpl implements WxMeetingService {
 	@Autowired
 	private WxSchoolMapper wxSchoolMapper;
 
+	@Value("${smartschool.domain.wechat}")
+	private String wechatUrl;
+
 	/**
 	 * 创建会议
 	 * @param jsonMeeting
@@ -91,7 +95,7 @@ public class WxMeetingServiceImpl implements WxMeetingService {
 					SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
 					SchoolDO schoolDO = wxSchoolMapper.get(meetingDO.getSchoolId());
 					String openid = teacherMapper.get(l).getOpenid();
-					wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(),openid , "_hX_lGEG1W1bJmW37VBaPYQoLrRrUAlNCSScezZQQWk", "您好,您有一条新的会议通知", meetingDO.getMeetingName(), simpleDateFormat.format(meetingDO.getStartDate()), meetingDO.getMeetingAddress(), "-", "点击查看详情", "https://school-wechat.ubtob.com/meet-detail/" + meetingDO.getMeetingId()+"?teacherId="+l);
+					wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(),openid , "_hX_lGEG1W1bJmW37VBaPYQoLrRrUAlNCSScezZQQWk", "您好,您有一条新的会议通知", meetingDO.getMeetingName(), simpleDateFormat.format(meetingDO.getStartDate()), meetingDO.getMeetingAddress(), "-", "点击查看详情",  wechatUrl + "/meet-detail/" + meetingDO.getMeetingId()+"?teacherId="+l);
 				}
 			}
 			return "创建成功";

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

@@ -8,6 +8,7 @@ import com.usoftchina.smartschool.school.wxschool.mapper.*;
 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.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import java.text.SimpleDateFormat;
@@ -41,6 +42,10 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 	private WxParentsStuMapper wxParentsStuMapper;
 
 
+	@Value("${smartschool.domain.wechat}")
+	private String wechatUrl;
+
+
 	/**
 	 * 获取系统消息和使用帮助
 	 * @param notifyType
@@ -96,7 +101,7 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 					SchoolDO schoolDO = wxSchoolMapper.get(teacherDO.getSchoolId());
 					String teacherName = teacherMapper.get(notifyCreator).getTeacherName();
 					try {
-						wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(), "h0BkcnTo24b2jsficMeVO0B17GvE-VzlPvF0fVXea4w", "您好,您有一条通知", schoolDO.getSchoolName(),teacherName,format.format(new Date()),notifyDetails, "点击查看详情", "https://school-wechat.ubtob.com/notifyDetail/teacher/"+notifyDO.getNotifyId()+"?teacherId="+l);
+						wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(), "h0BkcnTo24b2jsficMeVO0B17GvE-VzlPvF0fVXea4w", "您好,您有一条通知", schoolDO.getSchoolName(),teacherName,format.format(new Date()),notifyDetails, "点击查看详情", wechatUrl + "/notifyDetail/teacher/"+notifyDO.getNotifyId()+"?teacherId="+l);
 					}catch (Exception e){
 						e.printStackTrace();
 					}
@@ -118,7 +123,7 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 							SchoolDO schoolDO = wxSchoolMapper.get(parentsDO.getSchoolId());
 							String teacherName = teacherMapper.get(notifyCreator).getTeacherName();
 							try {
-								wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),parentsDO.getOpenid(), "h0BkcnTo24b2jsficMeVO0B17GvE-VzlPvF0fVXea4w", "您好,您有一条通知", schoolDO.getSchoolName(),teacherName,format.format(new Date()),notifyDetails, "点击查看详情", "https://school-wechat.ubtob.com/notifyDetail/parent/"+notifyDO.getNotifyId()+"?stuId="+l);
+								wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),parentsDO.getOpenid(), "h0BkcnTo24b2jsficMeVO0B17GvE-VzlPvF0fVXea4w", "您好,您有一条通知", schoolDO.getSchoolName(),teacherName,format.format(new Date()),notifyDetails, "点击查看详情",  wechatUrl + "/notifyDetail/parent/"+notifyDO.getNotifyId()+"?stuId="+l);
 							}catch (Exception e){
 								e.printStackTrace();
 							}

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

@@ -17,6 +17,7 @@ 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.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import java.text.SimpleDateFormat;
@@ -40,6 +41,10 @@ public class WxOaApproveServiceImpl implements WxOaApproveService {
     @Autowired
     private WxSchoolMapper wxSchoolMapper;
 
+
+    @Value("${smartschool.domain.wechat}")
+    private String wechatUrl;
+
     public int oaCreate(String oaString) {
         JSONObject parse = JSONObject.parseObject(oaString);
         OaApproveDO oaApprove = new OaApproveDO();
@@ -89,7 +94,7 @@ public class WxOaApproveServiceImpl implements WxOaApproveService {
                     wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(), teacherDO.getOpenid(),
                             "ohqfldHKfEmZPrLthLYt3h5SEjqd0AY7UFdngTDLTFY", "您有一个待审批事项", approveTitle,
                             teacher.getTeacherName(), format.format(new Date()), approveDetails, "点击查看详情",
-                            "https://school-wechat.ubtob.com/approvel-detail/false/" +oaApprove.getApproveId());
+                             wechatUrl + "/approvel-detail/false/" +oaApprove.getApproveId());
                 }catch (Exception e){
                     e.printStackTrace();
                 }
@@ -98,7 +103,7 @@ public class WxOaApproveServiceImpl implements WxOaApproveService {
                     wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(), teacherDO.getOpenid(),
                             "ohqfldHKfEmZPrLthLYt3h5SEjqd0AY7UFdngTDLTFY", "您有一个待审批事项", approveTitle,
                             teacher.getTeacherName(), format.format(new Date()), approveDetails, "点击查看详情",
-                            "https://school-wechat.ubtob.com/approvel-detail/false/" +oaApprove.getApproveId());
+                             wechatUrl + "/approvel-detail/false/" +oaApprove.getApproveId());
                 }catch (Exception e){
                     e.printStackTrace();
                 }

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

@@ -9,6 +9,7 @@ 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.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import java.text.SimpleDateFormat;
@@ -37,6 +38,9 @@ public class WxOaLeaveServiceImpl implements WxOaLeaveService {
     @Autowired
     private WxSchoolMapper wxSchoolMapper;
 
+    @Value("${smartschool.domain.wechat}")
+    private String wechatUrl;
+
     /**
      * 请假条提交
      */
@@ -77,7 +81,7 @@ public class WxOaLeaveServiceImpl implements WxOaLeaveService {
                     SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
                     String date =format.format(leave.getStartDate())  + "至" + format.format(leave.getEndDate());
                     try {
-                        wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(), teacherDO.getOpenid(), "QC8H4hQd1Fh0wqaaE3mbAxvoBC6y-XkHctIe8Kx6gcA","您好,学生的请假申请", stuName, date, leave.getLvDetails(), "-", "点击查看详情", "https://school-wechat.ubtob.com/leavedetail/teacher/" + leave.getLvId());
+                        wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(), teacherDO.getOpenid(), "QC8H4hQd1Fh0wqaaE3mbAxvoBC6y-XkHctIe8Kx6gcA","您好,学生的请假申请", stuName, date, leave.getLvDetails(), "-", "点击查看详情", wechatUrl + "/leavedetail/teacher/" + leave.getLvId());
                     }catch (Exception e){
                         e.printStackTrace();
                     }

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

@@ -10,6 +10,7 @@ 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.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -47,6 +48,10 @@ public class WxVoteServiceImpl implements WxVoteService {
     private WxParentsMapper wxParentsMapper;
 
 
+    @Value("${smartschool.domain.wechat}")
+    private String wechatUrl;
+
+
     /**
      * 创建投票单
      */
@@ -108,7 +113,7 @@ public class WxVoteServiceImpl implements WxVoteService {
                         wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(), teacherDO.getOpenid(),
                                 "h0BkcnTo24b2jsficMeVO0B17GvE-VzlPvF0fVXea4w", "有一个投票单需要您的支持", schoolDO.getSchoolName(),
                                 teacherName, format.format(new Date()), vote.getVoteName()
-                                , "点击查看详情", "https://school-wechat.ubtob.com/voteDetail/teacher/" + vote.getVoteId()+"?teacherId="+ll);
+                                , "点击查看详情", wechatUrl + "/voteDetail/teacher/" + vote.getVoteId()+"?teacherId="+ll);
                     }catch (Exception e){
                         e.printStackTrace();
                     }
@@ -130,7 +135,7 @@ public class WxVoteServiceImpl implements WxVoteService {
                                     , "h0BkcnTo24b2jsficMeVO0B17GvE-VzlPvF0fVXea4w", "有一个投票单需要您的支持",
                                     schoolDO.getSchoolName(),teacherName ,
                                     format.format(new Date()), vote.getVoteName(), "点击查看详情",
-                                    "https://school-wechat.ubtob.com/voteDetail/parent/" + vote.getVoteId()+"?stuId="+l);
+                                     wechatUrl + "/voteDetail/parent/" + vote.getVoteId()+"?stuId="+l);
                         }catch (Exception e){
                             e.printStackTrace();
                         }

+ 0 - 35
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/config/DomainConfig.java

@@ -1,35 +0,0 @@
-package com.usoftchina.smartschool.school.wxschool.config;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * @author: guq
- * @create: 2019-02-27 17:19
- **/
-@ConfigurationProperties("smartschool.domin")
-public class DomainConfig {
-
-    private String wechatUrl;
-
-
-    private String apiUrl;
-
-    private String pcUrl;
-
-
-    public String getWechatUrl() {
-        return wechatUrl;
-    }
-
-    public void setWechatUrl(String wechatUrl) {
-        this.wechatUrl = wechatUrl;
-    }
-
-    public String getApiUrl() {
-        return apiUrl;
-    }
-
-    public void setApiUrl(String apiUrl) {
-        this.apiUrl = apiUrl;
-    }
-}

+ 19 - 7
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/oaBean/Manager.java

@@ -2,6 +2,7 @@ package com.usoftchina.smartschool.school.wxschool.oaBean;
 
 
 
+import com.usoftchina.smartschool.context.SpringContextHolder;
 import com.usoftchina.smartschool.school.po.SchoolDO;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxOaApproveMapper;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxSchoolMapper;
@@ -13,14 +14,25 @@ import com.usoftchina.smartschool.wechat.api.WxPushApi;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
-
 public class Manager extends Leader {
+
+
+    //private static String wechatUrl = "https://school-wechat.ubtob.com";
+
+    /*static {
+        String active = SpringContextHolder.getActiveProfile();
+        if ("docker-cloud".equals(active)) {
+            wechatUrl = "https://school-wechat.ydyhz.com";
+        }
+    }
+*/
     public Manager(String name){
         super(name);
     }
 
     @Override
     public String handleRequest(WxSchoolMapper wxSchoolMapper,WxPushApi wxPushApi, WxTeacherMapper teacherMapper, WxOaApproveMapper oaApproveMapper, OaApproveDO oaApprove, Integer status, String approveOpinion) throws Exception {
+        String wechatUrl = SpringContextHolder.getDomain();
         if (status==1){
             oaApprove.setApproveDate(new Date());
             oaApprove.setApproveStatus(2);
@@ -33,19 +45,19 @@ public class Manager extends Leader {
             if (i>0){
                 if (1==approveType){
                     try {
-                        wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),"TCxxHDaVJWWxKEhJEcpyOoOl4nB75WL9_87-52gmHUg","您好,审批已通过",teacherDO.getTeacherName(),"出差",format.format(new Date()),teacherMapper.get(oaApprove.getApprover()).getTeacherName(),"点击查看详情","https://school-wechat.ubtob.com/approvel-detail/true/"+oaApprove.getApproveId());
+                        wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),"TCxxHDaVJWWxKEhJEcpyOoOl4nB75WL9_87-52gmHUg","您好,审批已通过",teacherDO.getTeacherName(),"出差",format.format(new Date()),teacherMapper.get(oaApprove.getApprover()).getTeacherName(),"点击查看详情",wechatUrl + "/approvel-detail/true/"+oaApprove.getApproveId());
                     }catch (Exception e){
                         e.printStackTrace();
                     }
                 }else if (2==approveType){
                     try {
-                        wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),"TCxxHDaVJWWxKEhJEcpyOoOl4nB75WL9_87-52gmHUg","您好,审批已通过",teacherDO.getTeacherName(),"用品申请",format.format(new Date()),teacherMapper.get(oaApprove.getApprover()).getTeacherName(),"点击查看详情","https://school-wechat.ubtob.com/approvel-detail/true/"+oaApprove.getApproveId());
+                        wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),"TCxxHDaVJWWxKEhJEcpyOoOl4nB75WL9_87-52gmHUg","您好,审批已通过",teacherDO.getTeacherName(),"用品申请",format.format(new Date()),teacherMapper.get(oaApprove.getApprover()).getTeacherName(),"点击查看详情",wechatUrl + "/approvel-detail/true/"+oaApprove.getApproveId());
                     }catch (Exception e){
                         e.printStackTrace();
                     }
                 }else if (4==approveType){
                     try {
-                        wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),"TCxxHDaVJWWxKEhJEcpyOoOl4nB75WL9_87-52gmHUg","您好,审批已通过",teacherDO.getTeacherName(),"请假",format.format(new Date()),teacherMapper.get(oaApprove.getApprover()).getTeacherName(),"点击查看详情","https://school-wechat.ubtob.com/approvel-detail/true/"+oaApprove.getApproveId());
+                        wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),"TCxxHDaVJWWxKEhJEcpyOoOl4nB75WL9_87-52gmHUg","您好,审批已通过",teacherDO.getTeacherName(),"请假",format.format(new Date()),teacherMapper.get(oaApprove.getApprover()).getTeacherName(),"点击查看详情",wechatUrl + "/approvel-detail/true/"+oaApprove.getApproveId());
                     }catch (Exception e){
                         e.printStackTrace();
                     }
@@ -68,19 +80,19 @@ public class Manager extends Leader {
             if (i>0){
                 if (1==approveType){
                     try {
-                        wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),"Rs8AcmuluVWDd4uC9L08PDStVNYXJmZrsSCk9xiKxrI","抱歉,您的审批未通过","出差",teacherMapper.get(oaApprove.getApprover()).getTeacherName(),format.format(new Date()),"","点击查看详情","https://school-wechat.ubtob.com/approvel-detail/true/"+oaApprove.getApproveId());
+                        wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),"Rs8AcmuluVWDd4uC9L08PDStVNYXJmZrsSCk9xiKxrI","抱歉,您的审批未通过","出差",teacherMapper.get(oaApprove.getApprover()).getTeacherName(),format.format(new Date()),"","点击查看详情",wechatUrl + "/approvel-detail/true/"+oaApprove.getApproveId());
                     }catch (Exception e){
                         e.printStackTrace();
                     }
                 }else if(2==approveType){
                     try {
-                        wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),"Rs8AcmuluVWDd4uC9L08PDStVNYXJmZrsSCk9xiKxrI","抱歉,您的审批未通过","用品申请",teacherMapper.get(oaApprove.getApprover()).getTeacherName(),format.format(new Date()),"","点击查看详情","https://school-wechat.ubtob.com/approvel-detail/true/"+oaApprove.getApproveId());
+                        wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),"Rs8AcmuluVWDd4uC9L08PDStVNYXJmZrsSCk9xiKxrI","抱歉,您的审批未通过","用品申请",teacherMapper.get(oaApprove.getApprover()).getTeacherName(),format.format(new Date()),"","点击查看详情",wechatUrl + "/approvel-detail/true/"+oaApprove.getApproveId());
                     }catch (Exception e){
                         e.printStackTrace();
                     }
                 }else if (4==approveType){
                     try {
-                        wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),"Rs8AcmuluVWDd4uC9L08PDStVNYXJmZrsSCk9xiKxrI","抱歉,您的审批未通过","请假",teacherMapper.get(oaApprove.getApprover()).getTeacherName(),format.format(new Date()),"","点击查看详情","https://school-wechat.ubtob.com/approvel-detail/true/"+oaApprove.getApproveId());
+                        wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),"Rs8AcmuluVWDd4uC9L08PDStVNYXJmZrsSCk9xiKxrI","抱歉,您的审批未通过","请假",teacherMapper.get(oaApprove.getApprover()).getTeacherName(),format.format(new Date()),"","点击查看详情",wechatUrl + "/approvel-detail/true/"+oaApprove.getApproveId());
                     }catch (Exception e){
                         e.printStackTrace();
                     }

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

@@ -8,6 +8,7 @@ import com.usoftchina.smartschool.school.wxschool.mapper.WxSchoolMapper;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxTeacherMapper;
 import com.usoftchina.smartschool.wechat.api.WxPushApi;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -29,6 +30,10 @@ public class RemindTask extends TimerTask {
     @Autowired
     private WxTeacherMapper teacherMapper;
 
+
+    @Value("${smartschool.domain.wechat}")
+    private String wechatUrl;
+
     private MeetingDO meetingDO;
 
     private Integer i;
@@ -58,7 +63,7 @@ public class RemindTask extends TimerTask {
             SchoolDO schoolDO = wxSchoolMapper.get(meetingDO.getSchoolId());
             String openid = teacherMapper.get(teacherId).getOpenid();
             try {
-                wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(),openid , "_hX_lGEG1W1bJmW37VBaPYQoLrRrUAlNCSScezZQQWk", "您好,您有一条新的会议通知", meetingDO.getMeetingName(), simpleDateFormat.format(meetingDO.getStartDate()), meetingDO.getMeetingAddress(), "-", "点击查看详情", "https://school-wechat.ubtob.com/meet-detail/" + meetingDO.getMeetingId()+"?teacherId="+teacherId);
+                wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(),openid , "_hX_lGEG1W1bJmW37VBaPYQoLrRrUAlNCSScezZQQWk", "您好,您有一条新的会议通知", meetingDO.getMeetingName(), simpleDateFormat.format(meetingDO.getStartDate()), meetingDO.getMeetingAddress(), "-", "点击查看详情", wechatUrl + "/meet-detail/" + meetingDO.getMeetingId()+"?teacherId="+teacherId);
             } catch (Exception e) {
                 e.printStackTrace();
             }

+ 4 - 1
applications/school/school-server/src/main/resources/application.yml

@@ -87,4 +87,7 @@ hystrix:
                 enabled: true
               isolation:
                     thread:
-                        timeoutInMilliseconds: 4000
+                        timeoutInMilliseconds: 4000
+smartschool:
+  domain:
+    wechat: https://school-wechat.ubtob.com

+ 3 - 0
applications/school/school-server/src/main/resources/config/application-dev.yml

@@ -10,3 +10,6 @@ eureka:
     registryFetchIntervalSeconds: 5
     serviceUrl:
       defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:9500/eureka/
+smartschool:
+  domain:
+    wechat: https://school-wechat.ubtob.com

+ 4 - 1
applications/school/school-server/src/main/resources/config/application-docker-prod.yml

@@ -14,4 +14,7 @@ spring:
     password: select123***
   redis:
     host: 10.10.100.173
-    port: 6379
+    port: 6379
+smartschool:
+  domain:
+    wechat: https://school-wechat.ubtob.com

+ 10 - 0
framework/core/src/main/java/com/usoftchina/smartschool/context/SpringContextHolder.java

@@ -54,4 +54,14 @@ public class SpringContextHolder {
         Assert.notNull(context, "spring context not ready");
         return context.getEnvironment().getProperty("spring.application.name");
     }
+
+    /**
+     * 获取微信url
+     *
+     * @return
+     */
+    public static String getDomain() {
+        Assert.notNull(context, "spring context not ready");
+        return context.getEnvironment().getProperty("smartschool.domain.wechat");
+    }
 }