Explorar o código

Merge branch 'dev' of ssh://10.10.100.21/source/smartschool-platform into dev

chenw %!s(int64=7) %!d(string=hai) anos
pai
achega
095d212c40
Modificáronse 31 ficheiros con 622 adicións e 286 borrados
  1. 3 3
      README.md
  2. 0 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/ClassServiceImpl.java
  3. 3 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/HomeWork.java
  4. 11 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/Notify.java
  5. 15 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/PrincipalMailboxDO.java
  6. 40 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/TemplateDO.java
  7. 8 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/controller/WxUserController.java
  8. 21 12
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxMeetingServiceImpl.java
  9. 31 8
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxNotifyServiceImpl.java
  10. 41 24
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxOaApproveServiceImpl.java
  11. 16 4
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxOaLeaveServiceImpl.java
  12. 16 9
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxPrincipalMailboxServiceImpl.java
  13. 21 8
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxTaskNotifyServiceImpl.java
  14. 20 7
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxVoteServiceImpl.java
  15. 20 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/mapper/WxTemplateMapper.java
  16. 3 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/oaBean/Director.java
  17. 3 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/oaBean/GeneralManager.java
  18. 3 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/oaBean/Leader.java
  19. 13 12
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/oaBean/Manager.java
  20. 22 5
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/support/RemindTask.java
  21. 4 1
      applications/school/school-server/src/main/resources/config/application-docker-cloud.yml
  22. 14 3
      applications/school/school-server/src/main/resources/mapper/HomeWorkMapper.xml
  23. 173 161
      applications/school/school-server/src/main/resources/mapper/NotifyMapper.xml
  24. 39 4
      applications/school/school-server/src/main/resources/mapper/WxPrincipalMailboxMapper.xml
  25. 14 0
      applications/school/school-server/src/main/resources/mapper/WxTemplateMapper.xml
  26. 2 2
      frontend/pc-web/app.json
  27. 1 0
      frontend/wechat-web/MP_verify_P40tTKo1dAMQh4CJ.txt
  28. 3 3
      frontend/wechat-web/src/configs/api.config.js
  29. 1 1
      frontend/wechat-web/src/modules/accountBind/BindMenu.jsx
  30. 12 8
      frontend/wechat-web/src/modules/principalMailbox/PrincipalMailbox.jsx
  31. 49 1
      pom.xml

+ 3 - 3
README.md

@@ -105,9 +105,9 @@
 * [jenkins](http://10.10.100.200:5001/view/DevelopmentCenter/job/school/) **账号** admin **密码** select123***
 
 #接口环境
-[智慧校园接口地址](https://school-api.ubtob.com)
-[微信端web](https://school-wechat.ubtob.com)
-[pc端web地址](https://school.ubtob.com)
+[智慧校园接口地址](https://school-api.ydyhz.com)
+[微信端web](https://school-wechat.ydyhz.com)
+[pc端web地址](https://school.ydyhz.com)
 
 
 #程序发布

+ 0 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/ClassServiceImpl.java

@@ -40,7 +40,6 @@ public class ClassServiceImpl implements ClassService{
         cf.setMain(clazz);
         cf.setItems1(students);
         cf.setItems2(teacherDetails);
-
         return cf;
     }
 

+ 3 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/HomeWork.java

@@ -42,6 +42,8 @@ public class HomeWork implements Serializable{
 
     private Date publish_date;  //作业发布时间
 
-    private String creator;      //发布人姓名
+    private String creator;     //发布人姓名
+
+    private String accessory;   //附件
 
 }

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

@@ -29,7 +29,9 @@ public class Notify implements Serializable{
 
     private Date publish_date;  //发布时间
 
-    private String creator; //创建人姓名
+    private String creator;     //创建人姓名
+
+    private String accessory;   //附件
 
     public String getNotify_details() {
         return notify_details;
@@ -142,4 +144,12 @@ public class Notify implements Serializable{
     public void setCreator(String creator) {
         this.creator = creator;
     }
+
+    public String getAccessory() {
+        return accessory;
+    }
+
+    public void setAccessory(String accessory) {
+        this.accessory = accessory;
+    }
 }

+ 15 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/PrincipalMailboxDO.java

@@ -31,14 +31,28 @@ public class PrincipalMailboxDO implements Serializable {
 	private Date createDate;
 	//创建人
 	private Long mailboxCreator;
+	//创建人姓名
+	private String mbCreatorname;
 	//读取时间
 	private Date readDate;
 	//状态   1草稿   2查看   3回复
 	private Integer mailboxStatus;
 	//通知人
 	private Long notifier;
-
+	//学校
 	private Long schoolId;
+	//学生id
+	private Long mbStuid;
+	//学生名
+	private String mbStudent;
+	//年级
+	private String mbGrade;
+	//班级
+	private String mbClass;
+	//是否忽略
+	private Integer mbIgnore;
+	//回复内容
+	private String mbReply;
 
 
 }

+ 40 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/TemplateDO.java

@@ -0,0 +1,40 @@
+package com.usoftchina.smartschool.school.po;
+
+import lombok.Data;
+
+/**
+ * @author kl
+ * @email koul@usoftchina.com
+ * @date 2019-03-01 15:57
+ */
+@Data
+public class TemplateDO {
+
+    //编号
+    private Long temId;
+    //appid
+    private String temAppid;
+    //出入校模板
+    private String temOutIn;
+    //通知模板
+    private String temNotify;
+    //作业模板
+    private String temTask;
+    //投票模板
+    private String temVote;
+    //成绩通知
+    private String temScore;
+    //申请
+    private String temApply;
+    //同意
+    private String temAgree;
+    //拒绝
+    private String temRefuse;
+    //学生请假
+    private String temLeave;
+    //会议
+    private String temMeeting;
+    //备注
+    private String temRemarks;
+
+}

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

@@ -9,6 +9,8 @@ import com.usoftchina.smartschool.school.wxschool.basic.service.WxUserService;
 import com.usoftchina.smartschool.school.wxschool.utils.ObjectUtils;
 import com.usoftchina.smartschool.school.wxschool.utils.ResultBean;
 import org.apache.ibatis.annotations.Param;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.util.Assert;
@@ -49,6 +51,8 @@ public class WxUserController {
 
 	@Value("${smartschool.domain.wechat}")
 	private String wechatUrl;
+
+	private  final Logger logger = LoggerFactory.getLogger(this.getClass());
 	/**
 	 * 发送验证码
 	 */
@@ -156,6 +160,10 @@ public class WxUserController {
 		} catch (UnsupportedEncodingException e) {
 			e.printStackTrace();
 		}
+
+		logger.error("result={}", result);
+		logger.error("body={}", body);
+		logger.error("redirect:" + wechatUrl + "/bindMenu/open/"+openid+"/"+encode);
 		return  new ModelAndView("redirect:" + wechatUrl + "/bindMenu/open/"+openid+"/"+encode);
 	}
 

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

@@ -2,15 +2,9 @@ package com.usoftchina.smartschool.school.wxschool.basic.service.impl;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
-import com.usoftchina.smartschool.school.po.MeetingDO;
-import com.usoftchina.smartschool.school.po.MeetingRecordsDO;
-import com.usoftchina.smartschool.school.po.SchoolDO;
-import com.usoftchina.smartschool.school.po.TeacherDO;
+import com.usoftchina.smartschool.school.po.*;
 import com.usoftchina.smartschool.school.wxschool.basic.service.WxMeetingService;
-import com.usoftchina.smartschool.school.wxschool.mapper.WxMeetingMapper;
-import com.usoftchina.smartschool.school.wxschool.mapper.WxMeetingRecordsMapper;
-import com.usoftchina.smartschool.school.wxschool.mapper.WxSchoolMapper;
-import com.usoftchina.smartschool.school.wxschool.mapper.WxTeacherMapper;
+import com.usoftchina.smartschool.school.wxschool.mapper.*;
 import com.usoftchina.smartschool.school.wxschool.support.RemindTask;
 import com.usoftchina.smartschool.school.wxschool.utils.DateFormatUtil;
 import com.usoftchina.smartschool.school.wxschool.utils.ObjectUtils;
@@ -40,6 +34,9 @@ public class WxMeetingServiceImpl implements WxMeetingService {
 	@Autowired
 	private WxSchoolMapper wxSchoolMapper;
 
+	@Autowired
+	private WxTemplateMapper wxTemplateMapper;
+
 	@Value("${smartschool.domain.wechat}")
 	private String wechatUrl;
 
@@ -86,16 +83,28 @@ public class WxMeetingServiceImpl implements WxMeetingService {
 				meetingRecordsMapper.save(meetingRecordsDO);
 			}
 			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(wxTemplateMapper,teacherMapper,wxSchoolMapper,wxPushApi,meetingMapper,1,meetingDO), startDate);
+			timer.schedule(new RemindTask(wxTemplateMapper,teacherMapper,wxSchoolMapper,wxPushApi,meetingMapper,2,meetingDO), endDate);
 			if (new Date().getTime()<reminderDate.getTime()) {
-				timer.schedule(new RemindTask(teacherMapper, wxSchoolMapper, wxPushApi, meetingMapper, 3, meetingDO), reminderDate);
+				timer.schedule(new RemindTask(wxTemplateMapper,teacherMapper, wxSchoolMapper, wxPushApi, meetingMapper, 3, meetingDO), reminderDate);
 			}else {
 				for (Long l:list) {
 					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(), "-", "点击查看详情",  wechatUrl + "/meet-detail/" + meetingDO.getMeetingId()+"?teacherId="+l);
+					if (ObjectUtils.isNotEmpty(schoolDO)){
+						String schoolAppid = schoolDO.getSchoolAppid();
+						if (ObjectUtils.isNotEmpty(schoolAppid)){
+							TemplateDO templateDO = wxTemplateMapper.getByAppid(schoolAppid);
+							if (ObjectUtils.isNotEmpty(templateDO)){
+								String temMeeting = templateDO.getTemMeeting();
+								wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(),openid , temMeeting, "您好,您有一条新的会议通知", meetingDO.getMeetingName(), simpleDateFormat.format(meetingDO.getStartDate()), meetingDO.getMeetingAddress(), "-", "点击查看详情",  wechatUrl + "/meet-detail/" + meetingDO.getMeetingId()+"?teacherId="+l);
+
+							}
+
+						}
+					}
+
 				}
 			}
 			return "创建成功";

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

@@ -41,6 +41,9 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 	@Autowired
 	private WxParentsStuMapper wxParentsStuMapper;
 
+	@Autowired
+	private WxTemplateMapper wxTemplateMapper;
+
 
 	@Value("${smartschool.domain.wechat}")
 	private String wechatUrl;
@@ -100,11 +103,21 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 					TeacherDO teacherDO = teacherMapper.get(l);
 					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, "点击查看详情", wechatUrl + "/notifyDetail/teacher/"+notifyDO.getNotifyId()+"?teacherId="+l);
-					}catch (Exception e){
-						e.printStackTrace();
+					if (ObjectUtils.isNotEmpty(schoolDO)){
+						String schoolAppid = schoolDO.getSchoolAppid();
+						if (ObjectUtils.isNotEmpty(schoolAppid)){
+							TemplateDO templateDO = wxTemplateMapper.getByAppid(schoolAppid);
+							if (ObjectUtils.isNotEmpty(templateDO)){
+								String temNotify = templateDO.getTemNotify();
+								try {
+									wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(), temNotify, "您好,您有一条通知", schoolDO.getSchoolName(),teacherName,format.format(new Date()),notifyDetails, "点击查看详情", wechatUrl + "/notifyDetail/teacher/"+notifyDO.getNotifyId()+"?teacherId="+l);
+								}catch (Exception e){
+									e.printStackTrace();
+								}
+							}
+						}
 					}
+
 				}
 			}
 			List<Long> stuIds = JSON.parseArray(notifyStu, Long.class);
@@ -122,11 +135,21 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 							ParentsDO parentsDO = wxParentsMapper.get(ps.getParentId());
 							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, "点击查看详情",  wechatUrl + "/notifyDetail/parent/"+notifyDO.getNotifyId()+"?stuId="+l);
-							}catch (Exception e){
-								e.printStackTrace();
+							if (ObjectUtils.isNotEmpty(schoolDO)){
+								String schoolAppid = schoolDO.getSchoolAppid();
+								if (ObjectUtils.isNotEmpty(schoolAppid)){
+									TemplateDO templateDO = wxTemplateMapper.getByAppid(schoolAppid);
+									if (ObjectUtils.isNotEmpty(templateDO)){
+										String temNotify = templateDO.getTemNotify();
+										try {
+											wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),parentsDO.getOpenid(), temNotify, "您好,您有一条通知", schoolDO.getSchoolName(),teacherName,format.format(new Date()),notifyDetails, "点击查看详情",  wechatUrl + "/notifyDetail/parent/"+notifyDO.getNotifyId()+"?stuId="+l);
+										}catch (Exception e){
+											e.printStackTrace();
+										}
+									}
+								}
 							}
+
 						}
 					}
 				}

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

@@ -2,17 +2,11 @@ package com.usoftchina.smartschool.school.wxschool.basic.service.impl;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
-import com.usoftchina.smartschool.school.po.OaApproveDO;
-import com.usoftchina.smartschool.school.po.OaArticlesDO;
-import com.usoftchina.smartschool.school.po.SchoolDO;
-import com.usoftchina.smartschool.school.po.TeacherDO;
-import com.usoftchina.smartschool.school.wxschool.mapper.WxOaApproveMapper;
-import com.usoftchina.smartschool.school.wxschool.mapper.WxOaArticlesMapper;
-import com.usoftchina.smartschool.school.wxschool.mapper.WxSchoolMapper;
-import com.usoftchina.smartschool.school.wxschool.mapper.WxTeacherMapper;
+import com.usoftchina.smartschool.school.po.*;
+import com.usoftchina.smartschool.school.wxschool.basic.service.WxOaApproveService;
+import com.usoftchina.smartschool.school.wxschool.mapper.*;
 import com.usoftchina.smartschool.school.wxschool.oaBean.Leader;
 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.api.WxPushApi;
@@ -41,6 +35,9 @@ public class WxOaApproveServiceImpl implements WxOaApproveService {
     @Autowired
     private WxSchoolMapper wxSchoolMapper;
 
+    @Autowired
+    private WxTemplateMapper wxTemplateMapper;
+
 
     @Value("${smartschool.domain.wechat}")
     private String wechatUrl;
@@ -90,23 +87,43 @@ public class WxOaApproveServiceImpl implements WxOaApproveService {
                         oaArticlesMapper.save(articles);
                     }
                 }
-                try {
-                    wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(), teacherDO.getOpenid(),
-                            "ohqfldHKfEmZPrLthLYt3h5SEjqd0AY7UFdngTDLTFY", "您有一个待审批事项", approveTitle,
-                            teacher.getTeacherName(), format.format(new Date()), approveDetails, "点击查看详情",
-                             wechatUrl + "/approvel-detail/false/" +oaApprove.getApproveId());
-                }catch (Exception e){
-                    e.printStackTrace();
+                if (ObjectUtils.isNotEmpty(schoolDO)){
+                    String schoolAppid = schoolDO.getSchoolAppid();
+                    if (ObjectUtils.isNotEmpty(schoolAppid)){
+                        TemplateDO templateDO = wxTemplateMapper.getByAppid(schoolAppid);
+                        if (ObjectUtils.isNotEmpty(templateDO)){
+                            String temApply = templateDO.getTemApply();
+                            try {
+                                wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(), teacherDO.getOpenid(),
+                                        temApply, "您有一个待审批事项", approveTitle,
+                                        teacher.getTeacherName(), format.format(new Date()), approveDetails, "点击查看详情",
+                                        wechatUrl + "/approvel-detail/false/" +oaApprove.getApproveId());
+                            }catch (Exception e){
+                                e.printStackTrace();
+                            }
+                        }
+                    }
                 }
+
             } else {
-                try {
-                    wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(), teacherDO.getOpenid(),
-                            "ohqfldHKfEmZPrLthLYt3h5SEjqd0AY7UFdngTDLTFY", "您有一个待审批事项", approveTitle,
-                            teacher.getTeacherName(), format.format(new Date()), approveDetails, "点击查看详情",
-                             wechatUrl + "/approvel-detail/false/" +oaApprove.getApproveId());
-                }catch (Exception e){
-                    e.printStackTrace();
+                if (ObjectUtils.isNotEmpty(schoolDO)){
+                    String schoolAppid = schoolDO.getSchoolAppid();
+                    if (ObjectUtils.isNotEmpty(schoolAppid)){
+                        TemplateDO templateDO = wxTemplateMapper.getByAppid(schoolAppid);
+                        if (ObjectUtils.isNotEmpty(templateDO)){
+                            String temApply = templateDO.getTemApply();
+                            try {
+                                wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(), teacherDO.getOpenid(),
+                                        temApply, "您有一个待审批事项", approveTitle,
+                                        teacher.getTeacherName(), format.format(new Date()), approveDetails, "点击查看详情",
+                                        wechatUrl + "/approvel-detail/false/" +oaApprove.getApproveId());
+                            }catch (Exception e){
+                                e.printStackTrace();
+                            }
+                        }
+                    }
                 }
+
             }
             return i;
         } else {
@@ -195,7 +212,7 @@ public class WxOaApproveServiceImpl implements WxOaApproveService {
             if (ObjectUtils.isNotEmpty(approver)) {
                 if (approver.compareTo(teacherId) == 0) {
                     Leader a = new Manager(teacherMapper.get(teacherId).getTeacherName());
-                    String s = a.handleRequest(wxSchoolMapper,wxPushApi,teacherMapper, oaApproveMapper, oaApproveDO, status, approveOpinion);
+                    String s = a.handleRequest(wxTemplateMapper,wxSchoolMapper,wxPushApi,teacherMapper, oaApproveMapper, oaApproveDO, status, approveOpinion);
                     return s;
                 } else {
                     throw new Exception("这个单据您没有资格审批,请联系管理员");

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

@@ -38,6 +38,9 @@ public class WxOaLeaveServiceImpl implements WxOaLeaveService {
     @Autowired
     private WxSchoolMapper wxSchoolMapper;
 
+    @Autowired
+    private WxTemplateMapper wxTemplateMapper;
+
     @Value("${smartschool.domain.wechat}")
     private String wechatUrl;
 
@@ -80,10 +83,19 @@ public class WxOaLeaveServiceImpl implements WxOaLeaveService {
                     String stuName = studentMapper.get(lvProposer).getStuName();
                     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(), "-", "点击查看详情", wechatUrl + "/leavedetail/teacher/" + leave.getLvId());
-                    }catch (Exception e){
-                        e.printStackTrace();
+                    if (ObjectUtils.isNotEmpty(schoolDO)){
+                        String schoolAppid = schoolDO.getSchoolAppid();
+                        if (ObjectUtils.isNotEmpty(schoolAppid)){
+                            TemplateDO templateDO = wxTemplateMapper.getByAppid(schoolAppid);
+                            if (ObjectUtils.isNotEmpty(templateDO)){
+                                String temLeave = templateDO.getTemLeave();
+                                try {
+                                    wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(), teacherDO.getOpenid(), temLeave,"您好,学生的请假申请", stuName, date, leave.getLvDetails(), "-", "点击查看详情", wechatUrl + "/leavedetail/teacher/" + leave.getLvId());
+                                }catch (Exception e){
+                                    e.printStackTrace();
+                                }
+                            }
+                        }
                     }
                 }
                 return "申请成功";

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

@@ -39,6 +39,9 @@ public class WxPrincipalMailboxServiceImpl implements WxPrincipalMailboxService
 	@Autowired
 	private WxPushApi wxPushApi;
 
+	@Autowired
+	private WxTemplateMapper wxTemplateMapper;
+
 	/**
 	 * 校长信箱创建
 	 * @return
@@ -55,10 +58,19 @@ public class WxPrincipalMailboxServiceImpl implements WxPrincipalMailboxService
 			SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
 			SchoolDO schoolDO = schoolMapper.get(schoolId);
 			TeacherDO teacherDO = teacherMapper.get(principalMailboxDO.getNotifier());
-			try {
-				wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(), "h0BkcnTo24b2jsficMeVO0B17GvE-VzlPvF0fVXea4w", "您有一个新的邮件通知",schoolDO.getSchoolName(),parentsMapper.get(principalMailboxDO.getMailboxCreator()).getParentsName(), simpleDateFormat.format(new Date()), principalMailboxDO.getMailboxContext(),"点击查看详情", "");
-			}catch (Exception e){
-				e.printStackTrace();
+			if (ObjectUtils.isNotEmpty(schoolDO)){
+				String schoolAppid = schoolDO.getSchoolAppid();
+				if (ObjectUtils.isNotEmpty(schoolAppid)){
+					TemplateDO templateDO = wxTemplateMapper.getByAppid(schoolAppid);
+					if (ObjectUtils.isNotEmpty(templateDO)){
+						String temNotify = templateDO.getTemNotify();
+						try {
+							wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(), temNotify, "您有一个新的邮件通知",schoolDO.getSchoolName(),parentsMapper.get(principalMailboxDO.getMailboxCreator()).getParentsName(), simpleDateFormat.format(new Date()), principalMailboxDO.getMailboxContext(),"点击查看详情", "");
+						}catch (Exception e){
+							e.printStackTrace();
+						}
+					}
+				}
 			}
 			return principalMailboxDO.getMailboxId();
 		}else {
@@ -169,11 +181,6 @@ public class WxPrincipalMailboxServiceImpl implements WxPrincipalMailboxService
 			map.put("teacherName",teacherDO.getTeacherName());
 			map.put("teacherPhoto",teacherDO.getTeacherPhoto());
 			List<PrincipalReplyDO> principalReplyDOS = principalReplyMapper.listByMailboxId(principalMailboxDO.getMailboxId());
-			/*if (ObjectUtils.isNotEmpty(principalReplyDOS)){
-				for (PrincipalReplyDO pr:principalReplyDOS) {
-
-				}
-			}*/
 			map.put("principalReplyDOS",principalReplyDOS);
 			return map;
 		}else {

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

@@ -48,6 +48,9 @@ public class WxTaskNotifyServiceImpl implements WxTaskNotifyService {
     @Autowired
     private WxSubjectMapper wxSubjectMapper;
 
+    @Autowired
+    private WxTemplateMapper wxTemplateMapper;
+
     /**
      * 发布作业
      *
@@ -89,15 +92,25 @@ public class WxTaskNotifyServiceImpl implements WxTaskNotifyService {
                             for (ParentsStuDO ps : parentsStuDOS) {
                                 ParentsDO parentsDO = parentsMapper.get(ps.getParentId());
                                 String subjectName = wxSubjectMapper.get(subjectId).getSubjectName();
-                                try {
-                                    wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(),
-                                            parentsDO.getOpenid(), "WwKtiHd4lso9axuavfLdpHIVbzTiopOTyh_uCsL3ZI8", taskTitle,
-                                            subjectName, format.format(new Date()),
-                                            taskContext, "-", "点击查看详情", "https://school-wechat.ubtob" +
-                                                    ".com/assignmentDetail/parent/" + taskNotifyDO.getTaskId());
-                                }catch (Exception e){
-                                    e.printStackTrace();
+                                if (ObjectUtils.isNotEmpty(schoolDO)){
+                                    String schoolAppid = schoolDO.getSchoolAppid();
+                                    if (ObjectUtils.isNotEmpty(schoolAppid)){
+                                        TemplateDO templateDO = wxTemplateMapper.getByAppid(schoolAppid);
+                                        if (ObjectUtils.isNotEmpty(templateDO)){
+                                            String temTask = templateDO.getTemTask();
+                                            try {
+                                                wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(),
+                                                        parentsDO.getOpenid(), temTask, taskTitle,
+                                                        subjectName, format.format(new Date()),
+                                                        taskContext, "-", "点击查看详情", "https://school-wechat.ubtob" +
+                                                                ".com/assignmentDetail/parent/" + taskNotifyDO.getTaskId());
+                                            }catch (Exception e){
+                                                e.printStackTrace();
+                                            }
+                                        }
+                                    }
                                 }
+
                             }
                         }
                     }

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

@@ -47,6 +47,9 @@ public class WxVoteServiceImpl implements WxVoteService {
     @Autowired
     private WxParentsMapper wxParentsMapper;
 
+    @Autowired
+    private WxTemplateMapper wxTemplateMapper;
+
 
     @Value("${smartschool.domain.wechat}")
     private String wechatUrl;
@@ -109,14 +112,24 @@ public class WxVoteServiceImpl implements WxVoteService {
                     SchoolDO schoolDO = wxSchoolMapper.get(teacherDO.getSchoolId());
                     SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
                     String teacherName = teacherMapper.get(creator).getTeacherName();
-                    try {
-                        wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(), teacherDO.getOpenid(),
-                                "h0BkcnTo24b2jsficMeVO0B17GvE-VzlPvF0fVXea4w", "有一个投票单需要您的支持", schoolDO.getSchoolName(),
-                                teacherName, format.format(new Date()), vote.getVoteName()
-                                , "点击查看详情", wechatUrl + "/voteDetail/teacher/" + vote.getVoteId()+"?teacherId="+ll);
-                    }catch (Exception e){
-                        e.printStackTrace();
+                    if (ObjectUtils.isNotEmpty(schoolDO)){
+                        String schoolAppid = schoolDO.getSchoolAppid();
+                        if (ObjectUtils.isNotEmpty(schoolAppid)){
+                            TemplateDO templateDO = wxTemplateMapper.getByAppid(schoolAppid);
+                            if (ObjectUtils.isNotEmpty(templateDO)){
+                                String temVote = templateDO.getTemVote();
+                                try {
+                                    wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(), teacherDO.getOpenid(),
+                                            temVote, "有一个投票单需要您的支持", schoolDO.getSchoolName(),
+                                            teacherName, format.format(new Date()), vote.getVoteName()
+                                            , "点击查看详情", wechatUrl + "/voteDetail/teacher/" + vote.getVoteId()+"?teacherId="+ll);
+                                }catch (Exception e){
+                                    e.printStackTrace();
+                                }
+                            }
+                        }
                     }
+
                 }
             }
             List<Long> stuId = JSON.parseArray(stuIds, Long.class);

+ 20 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/mapper/WxTemplateMapper.java

@@ -0,0 +1,20 @@
+package com.usoftchina.smartschool.school.wxschool.mapper;
+
+import com.usoftchina.smartschool.school.po.TemplateDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @author kl
+ * @email koul@usoftchina.com
+ * @date 2019-03-01 16:06
+ */
+@Mapper
+public interface WxTemplateMapper {
+
+    /**
+     * 通过appid获得所有模板id
+     * @param temAppid
+     * @return
+     */
+    TemplateDO getByAppid(String temAppid);
+}

+ 3 - 2
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/oaBean/Director.java

@@ -1,10 +1,11 @@
 package com.usoftchina.smartschool.school.wxschool.oaBean;
 
 
+import com.usoftchina.smartschool.school.po.OaApproveDO;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxOaApproveMapper;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxSchoolMapper;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxTeacherMapper;
-import com.usoftchina.smartschool.school.po.OaApproveDO;
+import com.usoftchina.smartschool.school.wxschool.mapper.WxTemplateMapper;
 import com.usoftchina.smartschool.wechat.api.WxPushApi;
 
 /**
@@ -19,7 +20,7 @@ public class Director extends Leader {
     }
 
     @Override
-   public String handleRequest(WxSchoolMapper wxSchoolMapper, WxPushApi wxPushApi, WxTeacherMapper teacherMapper, WxOaApproveMapper oaApproveMapper, OaApproveDO oaApprove, Integer status, String approveOpinion) throws Exception {
+   public String handleRequest(WxTemplateMapper wxTemplateMapper, WxSchoolMapper wxSchoolMapper, WxPushApi wxPushApi, WxTeacherMapper teacherMapper, WxOaApproveMapper oaApproveMapper, OaApproveDO oaApprove, Integer status, String approveOpinion) throws Exception {
         return null;
     }
 }

+ 3 - 2
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/oaBean/GeneralManager.java

@@ -1,10 +1,11 @@
 package com.usoftchina.smartschool.school.wxschool.oaBean;
 
 
+import com.usoftchina.smartschool.school.po.OaApproveDO;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxOaApproveMapper;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxSchoolMapper;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxTeacherMapper;
-import com.usoftchina.smartschool.school.po.OaApproveDO;
+import com.usoftchina.smartschool.school.wxschool.mapper.WxTemplateMapper;
 import com.usoftchina.smartschool.wechat.api.WxPushApi;
 
 /**
@@ -19,7 +20,7 @@ public class GeneralManager extends Leader {
     }
 
     @Override
-    public String handleRequest(WxSchoolMapper wxSchoolMapper, WxPushApi wxPushApi, WxTeacherMapper teacherMapper, WxOaApproveMapper oaApproveMapper, OaApproveDO oaApprove, Integer status, String approveOpinion) throws Exception {
+    public String handleRequest(WxTemplateMapper wxTemplateMapper, WxSchoolMapper wxSchoolMapper, WxPushApi wxPushApi, WxTeacherMapper teacherMapper, WxOaApproveMapper oaApproveMapper, OaApproveDO oaApprove, Integer status, String approveOpinion) throws Exception {
         return null;
     }
 }

+ 3 - 2
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/oaBean/Leader.java

@@ -1,10 +1,11 @@
 package com.usoftchina.smartschool.school.wxschool.oaBean;
 
 
+import com.usoftchina.smartschool.school.po.OaApproveDO;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxOaApproveMapper;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxSchoolMapper;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxTeacherMapper;
-import com.usoftchina.smartschool.school.po.OaApproveDO;
+import com.usoftchina.smartschool.school.wxschool.mapper.WxTemplateMapper;
 import com.usoftchina.smartschool.wechat.api.WxPushApi;
 
 /**
@@ -29,5 +30,5 @@ public abstract class Leader {
     }
 
     //处理请求核心业务方法
-   public abstract String handleRequest(WxSchoolMapper wxSchoolMapper,WxPushApi wxPushApi, WxTeacherMapper teacherMapper, WxOaApproveMapper oaApproveMapper, OaApproveDO oaApprove, Integer status, String approveOpinion) throws Exception;
+   public abstract String handleRequest(WxTemplateMapper wxTemplateMapper, WxSchoolMapper wxSchoolMapper, WxPushApi wxPushApi, WxTeacherMapper teacherMapper, WxOaApproveMapper oaApproveMapper, OaApproveDO oaApprove, Integer status, String approveOpinion) throws Exception;
 }

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

@@ -1,14 +1,14 @@
 package com.usoftchina.smartschool.school.wxschool.oaBean;
 
 
-
 import com.usoftchina.smartschool.context.SpringContextHolder;
+import com.usoftchina.smartschool.school.po.OaApproveDO;
 import com.usoftchina.smartschool.school.po.SchoolDO;
+import com.usoftchina.smartschool.school.po.TeacherDO;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxOaApproveMapper;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxSchoolMapper;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxTeacherMapper;
-import com.usoftchina.smartschool.school.po.OaApproveDO;
-import com.usoftchina.smartschool.school.po.TeacherDO;
+import com.usoftchina.smartschool.school.wxschool.mapper.WxTemplateMapper;
 import com.usoftchina.smartschool.wechat.api.WxPushApi;
 
 import java.text.SimpleDateFormat;
@@ -31,8 +31,9 @@ public class Manager extends Leader {
     }
 
     @Override
-    public String handleRequest(WxSchoolMapper wxSchoolMapper,WxPushApi wxPushApi, WxTeacherMapper teacherMapper, WxOaApproveMapper oaApproveMapper, OaApproveDO oaApprove, Integer status, String approveOpinion) throws Exception {
+    public String handleRequest(WxTemplateMapper wxTemplateMapper, WxSchoolMapper wxSchoolMapper, WxPushApi wxPushApi, WxTeacherMapper teacherMapper, WxOaApproveMapper oaApproveMapper, OaApproveDO oaApprove, Integer status, String approveOpinion) throws Exception {
         String wechatUrl = SpringContextHolder.getDomain();
+        SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
         if (status==1){
             oaApprove.setApproveDate(new Date());
             oaApprove.setApproveStatus(2);
@@ -41,23 +42,23 @@ public class Manager extends Leader {
             TeacherDO teacherDO = teacherMapper.get(oaApprove.getProposer());
             SchoolDO schoolDO = wxSchoolMapper.get(teacherDO.getSchoolId());
             Integer approveType = oaApprove.getApproveType();
-            SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
+            String temAgree = wxTemplateMapper.getByAppid(schoolDO.getSchoolAppid()).getTemAgree();
             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(),"点击查看详情",wechatUrl + "/approvel-detail/true/"+oaApprove.getApproveId());
+                        wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),temAgree,"您好,审批已通过",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(),"点击查看详情",wechatUrl + "/approvel-detail/true/"+oaApprove.getApproveId());
+                        wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),temAgree,"您好,审批已通过",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(),"点击查看详情",wechatUrl + "/approvel-detail/true/"+oaApprove.getApproveId());
+                        wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),temAgree,"您好,审批已通过",teacherDO.getTeacherName(),"请假",format.format(new Date()),teacherMapper.get(oaApprove.getApprover()).getTeacherName(),"点击查看详情",wechatUrl + "/approvel-detail/true/"+oaApprove.getApproveId());
                     }catch (Exception e){
                         e.printStackTrace();
                     }
@@ -76,23 +77,23 @@ public class Manager extends Leader {
             TeacherDO teacherDO = teacherMapper.get(oaApprove.getProposer());
             SchoolDO schoolDO = wxSchoolMapper.get(teacherDO.getSchoolId());
             Integer approveType = oaApprove.getApproveType();
-            SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
+            String temRefuse = wxTemplateMapper.getByAppid(schoolDO.getSchoolAppid()).getTemRefuse();
             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()),"","点击查看详情",wechatUrl + "/approvel-detail/true/"+oaApprove.getApproveId());
+                        wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),temRefuse,"抱歉,您的审批未通过","出差",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()),"","点击查看详情",wechatUrl + "/approvel-detail/true/"+oaApprove.getApproveId());
+                        wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),temRefuse,"抱歉,您的审批未通过","用品申请",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()),"","点击查看详情",wechatUrl + "/approvel-detail/true/"+oaApprove.getApproveId());
+                        wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(),temRefuse,"抱歉,您的审批未通过","请假",teacherMapper.get(oaApprove.getApprover()).getTeacherName(),format.format(new Date()),"","点击查看详情",wechatUrl + "/approvel-detail/true/"+oaApprove.getApproveId());
                     }catch (Exception e){
                         e.printStackTrace();
                     }

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

@@ -3,9 +3,12 @@ package com.usoftchina.smartschool.school.wxschool.support;
 import com.alibaba.fastjson.JSON;
 import com.usoftchina.smartschool.school.po.MeetingDO;
 import com.usoftchina.smartschool.school.po.SchoolDO;
+import com.usoftchina.smartschool.school.po.TemplateDO;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxMeetingMapper;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxSchoolMapper;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxTeacherMapper;
+import com.usoftchina.smartschool.school.wxschool.mapper.WxTemplateMapper;
+import com.usoftchina.smartschool.school.wxschool.utils.ObjectUtils;
 import com.usoftchina.smartschool.wechat.api.WxPushApi;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -30,6 +33,9 @@ public class RemindTask extends TimerTask {
     @Autowired
     private WxTeacherMapper teacherMapper;
 
+    @Autowired
+    private WxTemplateMapper wxTemplateMapper;
+
 
     @Value("${smartschool.domain.wechat}")
     private String wechatUrl;
@@ -38,7 +44,8 @@ public class RemindTask extends TimerTask {
 
     private Integer i;
 
-    public RemindTask(WxTeacherMapper teacherM,WxSchoolMapper wxSchool,WxPushApi wxPushs,WxMeetingMapper nm, Integer ll, MeetingDO meet){//关键点解决 null指针错误,
+    public RemindTask(WxTemplateMapper wxTemplateM,WxTeacherMapper teacherM, WxSchoolMapper wxSchool, WxPushApi wxPushs, WxMeetingMapper nm, Integer ll, MeetingDO meet){//关键点解决 null指针错误,
+        wxTemplateMapper=wxTemplateM;
         teacherMapper = teacherM;
         wxSchoolMapper = wxSchool;
         meetingMapper=nm;
@@ -62,11 +69,21 @@ public class RemindTask extends TimerTask {
         for (Long teacherId:list) {
             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(), "-", "点击查看详情", wechatUrl + "/meet-detail/" + meetingDO.getMeetingId()+"?teacherId="+teacherId);
-            } catch (Exception e) {
-                e.printStackTrace();
+            if (ObjectUtils.isNotEmpty(schoolDO)){
+                String schoolAppid = schoolDO.getSchoolAppid();
+                if (ObjectUtils.isNotEmpty(schoolAppid)){
+                    TemplateDO byAppid = wxTemplateMapper.getByAppid(schoolAppid);
+                    if (ObjectUtils.isNotEmpty(byAppid)){
+                        String temMeeting = byAppid.getTemMeeting();
+                        try {
+                            wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(),openid , temMeeting, "您好,您有一条新的会议通知", meetingDO.getMeetingName(), simpleDateFormat.format(meetingDO.getStartDate()), meetingDO.getMeetingAddress(), "-", "点击查看详情", wechatUrl + "/meet-detail/" + meetingDO.getMeetingId()+"?teacherId="+teacherId);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
             }
+
         }
         }else {
 

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

@@ -20,4 +20,7 @@ spring:
         maximum-pool-size: 50
         idle-timeout: 30000
         max-lifetime: 1800000
-        connection-timeout: 30000
+        connection-timeout: 30000
+smartschool:
+  domain:
+    wechat: https://school-wechat.ydyhz.com

+ 14 - 3
applications/school/school-server/src/main/resources/mapper/HomeWorkMapper.xml

@@ -18,6 +18,7 @@
         <result column="grade_name" property="grade_name" jdbcType="VARCHAR"/>
         <result column="publish_date" property="publish_date" jdbcType="TIMESTAMP"/>
         <result column="creator" property="creator" jdbcType="VARCHAR"/>
+        <result column="accessory" property="accessory" jdbcType="VARCHAR"/>
     </resultMap>
 
     <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">
@@ -35,13 +36,13 @@
       task_status, create_date, start_date, 
       end_date, task_creator, school_id, 
       task_context, task_files, task_notifier,
-      classz_name, grade_name,creator
+      classz_name, grade_name,creator,accessory
       )
     values (#{subject_id,jdbcType=BIGINT}, #{task_title,jdbcType=VARCHAR},
       #{task_status,jdbcType=INTEGER}, #{create_date,jdbcType=TIMESTAMP}, #{start_date,jdbcType=TIMESTAMP}, 
       #{end_date,jdbcType=TIMESTAMP}, #{task_creator,jdbcType=BIGINT}, #{school_id,jdbcType=BIGINT}, 
       #{task_context,jdbcType=LONGVARCHAR}, #{task_files,jdbcType=LONGVARCHAR}, #{task_notifier,jdbcType=LONGVARCHAR},
-      #{task_title,jdbcType=VARCHAR},#{task_title,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR}
+      #{task_title,jdbcType=VARCHAR},#{task_title,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR},#{accessory,jdbcType=VARCHAR}
       )
   </insert>
     <insert id="insertSelective" parameterType="com.usoftchina.smartschool.school.po.HomeWork">
@@ -92,6 +93,9 @@
             <if test="creator != null">
                 creator,
             </if>
+            <if test="accessory != null">
+                accessory,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="subject_id != null">
@@ -136,6 +140,9 @@
             <if test="creator != null">
                 #{creator,jdbcType=VARCHAR},
             </if>
+            <if test="accessory != null">
+                #{accessory,jdbcType=VARCHAR},
+            </if>
         </trim>
     </insert>
     <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.smartschool.school.po.HomeWork">
@@ -183,6 +190,9 @@
             <if test="creator != null">
                 creator = #{creator,jdbcType=VARCHAR},
             </if>
+            <if test="accessory != null">
+                accessory = #{accessory,jdbcType=VARCHAR},
+            </if>
         </set>
         where task_id = #{task_id,jdbcType=BIGINT}
     </update>
@@ -201,7 +211,8 @@
       task_notifier = #{task_notifier,jdbcType=LONGVARCHAR},
       classz_name = #{classz_name,jdbcType=VARCHAR},
       grade_name = #{grade_name,jdbcType=VARCHAR},
-      creator = #{creator,jdbcType=VARCHAR}
+      creator = #{creator,jdbcType=VARCHAR},
+      accessory = #{accessory,jdbcType=VARCHAR}
     where task_id = #{task_id,jdbcType=BIGINT}
   </update>
     <update id="updateByPrimaryKey" parameterType="com.usoftchina.smartschool.school.po.HomeWork">

+ 173 - 161
applications/school/school-server/src/main/resources/mapper/NotifyMapper.xml

@@ -1,169 +1,180 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="com.usoftchina.smartschool.school.mapper.NoticeMapper" >
-  <resultMap id="BaseResultMap" type="com.usoftchina.smartschool.school.po.Notify" >
-    <id column="notify_id" property="notify_id" jdbcType="BIGINT" />
-    <result column="notify_title" property="notify_title" jdbcType="VARCHAR" />
-    <result column="notify_type" property="notify_type" jdbcType="INTEGER" />
-    <result column="notify_creator" property="notify_creator" jdbcType="BIGINT" />
-    <result column="create_date" property="create_date" jdbcType="TIMESTAMP" />
-    <result column="notify_status" property="notify_status" jdbcType="INTEGER" />
-    <result column="notify_remarks" property="notify_remarks" jdbcType="VARCHAR" />
-    <result column="school_id" property="school_id" jdbcType="BIGINT" />
-    <result column="notify_details" property="notify_details" jdbcType="LONGVARCHAR" />
-    <result column="notify_files" property="notify_files" jdbcType="LONGVARCHAR" />
-    <result column="notify_teacher" property="notify_teacher" jdbcType="LONGVARCHAR" />
-    <result column="notify_stu" property="notify_stu" jdbcType="LONGVARCHAR" />
-    <result column="publish_date" property="publish_date" jdbcType="TIMESTAMP" />
-    <result column="creator" property="creator" jdbcType="VARCHAR" />
-  </resultMap>
-  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
+<mapper namespace="com.usoftchina.smartschool.school.mapper.NoticeMapper">
+    <resultMap id="BaseResultMap" type="com.usoftchina.smartschool.school.po.Notify">
+        <id column="notify_id" property="notify_id" jdbcType="BIGINT"/>
+        <result column="notify_title" property="notify_title" jdbcType="VARCHAR"/>
+        <result column="notify_type" property="notify_type" jdbcType="INTEGER"/>
+        <result column="notify_creator" property="notify_creator" jdbcType="BIGINT"/>
+        <result column="create_date" property="create_date" jdbcType="TIMESTAMP"/>
+        <result column="notify_status" property="notify_status" jdbcType="INTEGER"/>
+        <result column="notify_remarks" property="notify_remarks" jdbcType="VARCHAR"/>
+        <result column="school_id" property="school_id" jdbcType="BIGINT"/>
+        <result column="notify_details" property="notify_details" jdbcType="LONGVARCHAR"/>
+        <result column="notify_files" property="notify_files" jdbcType="LONGVARCHAR"/>
+        <result column="notify_teacher" property="notify_teacher" jdbcType="LONGVARCHAR"/>
+        <result column="notify_stu" property="notify_stu" jdbcType="LONGVARCHAR"/>
+        <result column="publish_date" property="publish_date" jdbcType="TIMESTAMP"/>
+        <result column="creator" property="creator" jdbcType="VARCHAR"/>
+        <result column="accessory" property="accessory" jdbcType="VARCHAR"/>
+    </resultMap>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">
     select *
     from notify
     where notify_id = #{notify_id,jdbcType=BIGINT}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     delete from notify
     where notify_id = #{notify_id,jdbcType=BIGINT}
   </delete>
-  <insert id="insert" parameterType="com.usoftchina.smartschool.school.po.Notify" >
+    <insert id="insert" parameterType="com.usoftchina.smartschool.school.po.Notify">
     insert into notify (notify_id, notify_title, notify_type, 
       notify_creator, create_date, notify_status, 
       notify_remarks, school_id, notify_details, 
-      notify_files, notify_teacher, notify_stu, creator
+      notify_files, notify_teacher, notify_stu, creator,
+      accessory
       )
     values (#{notify_id,jdbcType=BIGINT}, #{notify_title,jdbcType=VARCHAR}, #{notify_type,jdbcType=INTEGER}, 
       #{notify_creator,jdbcType=BIGINT}, #{create_date,jdbcType=TIMESTAMP}, #{notify_status,jdbcType=INTEGER}, 
       #{notify_remarks,jdbcType=VARCHAR}, #{school_id,jdbcType=BIGINT}, #{notify_details,jdbcType=LONGVARCHAR}, 
       #{notify_files,jdbcType=LONGVARCHAR}, #{notify_teacher,jdbcType=LONGVARCHAR}, #{notify_stu,jdbcType=LONGVARCHAR},
-      #{creator,jdbcType=VARCHAR}
+      #{creator,jdbcType=VARCHAR}, #{accessory,jdbcType=VARCHAR}
       )
   </insert>
-  <insert id="insertSelective" parameterType="com.usoftchina.smartschool.school.po.Notify" >
-    <selectKey  resultType="java.lang.Long" keyProperty="notify_id">
-      SELECT LAST_INSERT_ID() AS ID
-    </selectKey>
-    insert into notify
-    <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="notify_title != null" >
-        notify_title,
-      </if>
-      <if test="notify_type != null" >
-        notify_type,
-      </if>
-      <if test="notify_creator != null" >
-        notify_creator,
-      </if>
-      <if test="create_date != null" >
-        create_date,
-      </if>
-      <if test="notify_status != null" >
-        notify_status,
-      </if>
-      <if test="notify_remarks != null" >
-        notify_remarks,
-      </if>
-      <if test="school_id != null" >
-        school_id,
-      </if>
-      <if test="notify_details != null" >
-        notify_details,
-      </if>
-      <if test="notify_files != null" >
-        notify_files,
-      </if>
-      <if test="notify_teacher != null" >
-        notify_teacher,
-      </if>
-      <if test="notify_stu != null" >
-        notify_stu,
-      </if>
-      <if test="creator != null" >
-        creator,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="notify_title != null" >
-        #{notify_title,jdbcType=VARCHAR},
-      </if>
-      <if test="notify_type != null" >
-        #{notify_type,jdbcType=INTEGER},
-      </if>
-      <if test="notify_creator != null" >
-        #{notify_creator,jdbcType=BIGINT},
-      </if>
-      <if test="create_date != null" >
-        #{create_date,jdbcType=TIMESTAMP},
-      </if>
-      <if test="notify_status != null" >
-        #{notify_status,jdbcType=INTEGER},
-      </if>
-      <if test="notify_remarks != null" >
-        #{notify_remarks,jdbcType=VARCHAR},
-      </if>
-      <if test="school_id != null" >
-        #{school_id,jdbcType=BIGINT},
-      </if>
-      <if test="notify_details != null" >
-        #{notify_details,jdbcType=LONGVARCHAR},
-      </if>
-      <if test="notify_files != null" >
-        #{notify_files,jdbcType=LONGVARCHAR},
-      </if>
-      <if test="notify_teacher != null" >
-        #{notify_teacher,jdbcType=LONGVARCHAR},
-      </if>
-      <if test="notify_stu != null" >
-        #{notify_stu,jdbcType=LONGVARCHAR},
-      </if>
-      <if test="creator != null" >
-        #{creator,jdbcType=VARCHAR},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.smartschool.school.po.Notify" >
-    update notify
-    <set >
-      <if test="notify_title != null" >
-        notify_title = #{notify_title,jdbcType=VARCHAR},
-      </if>
-      <if test="notify_type != null" >
-        notify_type = #{notify_type,jdbcType=INTEGER},
-      </if>
-      <if test="notify_creator != null" >
-        notify_creator = #{notify_creator,jdbcType=BIGINT},
-      </if>
-      <if test="create_date != null" >
-        create_date = #{create_date,jdbcType=TIMESTAMP},
-      </if>
-      <if test="notify_status != null" >
-        notify_status = #{notify_status,jdbcType=INTEGER},
-      </if>
-      <if test="notify_remarks != null" >
-        notify_remarks = #{notify_remarks,jdbcType=VARCHAR},
-      </if>
-      <if test="school_id != null" >
-        school_id = #{school_id,jdbcType=BIGINT},
-      </if>
-      <if test="notify_details != null" >
-        notify_details = #{notify_details,jdbcType=LONGVARCHAR},
-      </if>
-      <if test="notify_files != null" >
-        notify_files = #{notify_files,jdbcType=LONGVARCHAR},
-      </if>
-      <if test="notify_teacher != null" >
-        notify_teacher = #{notify_teacher,jdbcType=LONGVARCHAR},
-      </if>
-      <if test="notify_stu != null" >
-        notify_stu = #{notify_stu,jdbcType=LONGVARCHAR},
-      </if>
-      <if test="creator != null" >
-        creator = #{creator,jdbcType=VARCHAR},
-      </if>
-    </set>
-    where notify_id = #{notify_id,jdbcType=BIGINT}
-  </update>
-  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.smartschool.school.po.Notify" >
+    <insert id="insertSelective" parameterType="com.usoftchina.smartschool.school.po.Notify">
+        <selectKey resultType="java.lang.Long" keyProperty="notify_id">
+            SELECT LAST_INSERT_ID() AS ID
+        </selectKey>
+        insert into notify
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="notify_title != null">
+                notify_title,
+            </if>
+            <if test="notify_type != null">
+                notify_type,
+            </if>
+            <if test="notify_creator != null">
+                notify_creator,
+            </if>
+            <if test="create_date != null">
+                create_date,
+            </if>
+            <if test="notify_status != null">
+                notify_status,
+            </if>
+            <if test="notify_remarks != null">
+                notify_remarks,
+            </if>
+            <if test="school_id != null">
+                school_id,
+            </if>
+            <if test="notify_details != null">
+                notify_details,
+            </if>
+            <if test="notify_files != null">
+                notify_files,
+            </if>
+            <if test="notify_teacher != null">
+                notify_teacher,
+            </if>
+            <if test="notify_stu != null">
+                notify_stu,
+            </if>
+            <if test="creator != null">
+                creator,
+            </if>
+            <if test="creator != null">
+                accessory,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="notify_title != null">
+                #{notify_title,jdbcType=VARCHAR},
+            </if>
+            <if test="notify_type != null">
+                #{notify_type,jdbcType=INTEGER},
+            </if>
+            <if test="notify_creator != null">
+                #{notify_creator,jdbcType=BIGINT},
+            </if>
+            <if test="create_date != null">
+                #{create_date,jdbcType=TIMESTAMP},
+            </if>
+            <if test="notify_status != null">
+                #{notify_status,jdbcType=INTEGER},
+            </if>
+            <if test="notify_remarks != null">
+                #{notify_remarks,jdbcType=VARCHAR},
+            </if>
+            <if test="school_id != null">
+                #{school_id,jdbcType=BIGINT},
+            </if>
+            <if test="notify_details != null">
+                #{notify_details,jdbcType=LONGVARCHAR},
+            </if>
+            <if test="notify_files != null">
+                #{notify_files,jdbcType=LONGVARCHAR},
+            </if>
+            <if test="notify_teacher != null">
+                #{notify_teacher,jdbcType=LONGVARCHAR},
+            </if>
+            <if test="notify_stu != null">
+                #{notify_stu,jdbcType=LONGVARCHAR},
+            </if>
+            <if test="creator != null">
+                #{creator,jdbcType=VARCHAR},
+            </if>
+            <if test="accessory != null">
+                #{accessory,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.smartschool.school.po.Notify">
+        update notify
+        <set>
+            <if test="notify_title != null">
+                notify_title = #{notify_title,jdbcType=VARCHAR},
+            </if>
+            <if test="notify_type != null">
+                notify_type = #{notify_type,jdbcType=INTEGER},
+            </if>
+            <if test="notify_creator != null">
+                notify_creator = #{notify_creator,jdbcType=BIGINT},
+            </if>
+            <if test="create_date != null">
+                create_date = #{create_date,jdbcType=TIMESTAMP},
+            </if>
+            <if test="notify_status != null">
+                notify_status = #{notify_status,jdbcType=INTEGER},
+            </if>
+            <if test="notify_remarks != null">
+                notify_remarks = #{notify_remarks,jdbcType=VARCHAR},
+            </if>
+            <if test="school_id != null">
+                school_id = #{school_id,jdbcType=BIGINT},
+            </if>
+            <if test="notify_details != null">
+                notify_details = #{notify_details,jdbcType=LONGVARCHAR},
+            </if>
+            <if test="notify_files != null">
+                notify_files = #{notify_files,jdbcType=LONGVARCHAR},
+            </if>
+            <if test="notify_teacher != null">
+                notify_teacher = #{notify_teacher,jdbcType=LONGVARCHAR},
+            </if>
+            <if test="notify_stu != null">
+                notify_stu = #{notify_stu,jdbcType=LONGVARCHAR},
+            </if>
+            <if test="creator != null">
+                creator = #{creator,jdbcType=VARCHAR},
+            </if>
+            <if test="accessory != null">
+                accessory = #{accessory,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where notify_id = #{notify_id,jdbcType=BIGINT}
+    </update>
+    <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.smartschool.school.po.Notify">
     update notify
     set notify_title = #{notify_title,jdbcType=VARCHAR},
       notify_type = #{notify_type,jdbcType=INTEGER},
@@ -177,9 +188,10 @@
       notify_teacher = #{notify_teacher,jdbcType=LONGVARCHAR},
       notify_stu = #{notify_stu,jdbcType=LONGVARCHAR},
       creator = #{creator,jdbcType=VARCHAR}
+      accessory = #{accessory,jdbcType=VARCHAR}
     where notify_id = #{notify_id,jdbcType=BIGINT}
   </update>
-  <update id="updateByPrimaryKey" parameterType="com.usoftchina.smartschool.school.po.Notify" >
+    <update id="updateByPrimaryKey" parameterType="com.usoftchina.smartschool.school.po.Notify">
     update notify
     set notify_title = #{notify_title,jdbcType=VARCHAR},
       notify_type = #{notify_type,jdbcType=INTEGER},
@@ -191,19 +203,19 @@
     where notify_id = #{notify_id,jdbcType=BIGINT}
   </update>
 
-  <select id="selectByConditon" resultMap="BaseResultMap">
-    select * from notify
-    <where>
-      <if test="con != null">
-        ${con}
-      </if>
-      <if test="school_id != null">
-        and school_id=#{school_id}
-      </if>
-    </where>
-    ORDER BY notify_id DESC
-  </select>
-  <update id="updateByPublish" parameterType="java.lang.Long">
+    <select id="selectByConditon" resultMap="BaseResultMap">
+        select * from notify
+        <where>
+            <if test="con != null">
+                ${con}
+            </if>
+            <if test="school_id != null">
+                and school_id=#{school_id}
+            </if>
+        </where>
+        ORDER BY notify_id DESC
+    </select>
+    <update id="updateByPublish" parameterType="java.lang.Long">
     update notify
     set notify_status = 1 ,
       publish_date = now()

+ 39 - 4
applications/school/school-server/src/main/resources/mapper/WxPrincipalMailboxMapper.xml

@@ -4,7 +4,7 @@
 <mapper namespace="com.usoftchina.smartschool.school.wxschool.mapper.WxPrincipalMailboxMapper">
 
     <sql id="PrincipalMailboxVo">
-    select `mailbox_id`,`mailbox_title`,`mailbox_context`,`mailbox_files`,`is_anonymity`,`create_date`,`mailbox_creator`,`read_date`,`mailbox_status`,`notifier`,`school_id` from principal_mailbox
+    select `mailbox_id`,`mailbox_title`,`mailbox_context`,`mailbox_files`,`is_anonymity`,`create_date`,`mailbox_creator`,`read_date`,`mailbox_status`,`notifier`,`school_id`,`mb_stuid`,`mb_student`,`mb_grade`,`mb_class`,`mb_ignore`,`mb_reply`,`mb_creatorname` from principal_mailbox
     </sql>
 
 	<select id="get" resultType="com.usoftchina.smartschool.school.po.PrincipalMailboxDO">
@@ -25,6 +25,13 @@
 		  		  <if test="mailboxStatus != null and mailboxStatus != ''"> and mailbox_status = #{mailboxStatus} </if>
 		  		  <if test="notifier != null and notifier != ''"> and notifier = #{notifier} </if>
 			<if test="schoolId != null and schoolId != ''"> and school_id = #{schoolId} </if>
+			<if test="mbStuid != null and mbStuid != ''"> and mb_stuid = #{mbStuid} </if>
+			<if test="mbStudent != null and mbStudent != ''"> and mb_student = #{mbStudent} </if>
+			<if test="mbGrade != null and mbGrade != ''"> and mb_grade = #{mbGrade} </if>
+			<if test="mbClass != null and mbClass != ''"> and mb_class = #{mbClass} </if>
+			<if test="mbIgnore != null and mbIgnore != ''"> and mb_ignore = #{mbIgnore} </if>
+			<if test="mbReply != null and mbReply != ''"> and mb_reply = #{mbReply} </if>
+			<if test="mbCreatorname != null and mbCreatorname != ''"> and mb_creatorname = #{mbCreatorname} </if>
 		  		</where>
         <choose>
             <when test="sort != null and sort.trim() != ''">
@@ -53,6 +60,13 @@
 		  		  <if test="mailboxStatus != null and mailboxStatus != ''"> and mailbox_status = #{mailboxStatus} </if>
 		  		  <if test="notifier != null and notifier != ''"> and notifier = #{notifier} </if>
 			 <if test="schoolId != null and schoolId != ''"> and school_id = #{schoolId} </if>
+			 <if test="mbStuid != null and mbStuid != ''"> and mb_stuid = #{mbStuid} </if>
+			 <if test="mbStudent != null and mbStudent != ''"> and mb_student = #{mbStudent} </if>
+			 <if test="mbGrade != null and mbGrade != ''"> and mb_grade = #{mbGrade} </if>
+			 <if test="mbClass != null and mbClass != ''"> and mb_class = #{mbClass} </if>
+			 <if test="mbIgnore != null and mbIgnore != ''"> and mb_ignore = #{mbIgnore} </if>
+			 <if test="mbReply != null and mbReply != ''"> and mb_reply = #{mbReply} </if>
+			 <if test="mbCreatorname != null and mbCreatorname != ''"> and mb_creatorname = #{mbCreatorname} </if>
 		  		</where>
 	</select>
 	 
@@ -68,7 +82,14 @@
 			`read_date`, 
 			`mailbox_status`, 
 			`notifier`,
-			`school_id`
+			`school_id`,
+			`mb_stuid`,
+			`mb_student`,
+			`mb_grade`,
+			`mb_class`,
+			`mb_ignore`,
+			`mb_reply`,
+			`mb_creatorname`
 		)
 		values
 		(
@@ -81,7 +102,14 @@
 			#{readDate}, 
 			#{mailboxStatus}, 
 			#{notifier},
-			#{schoolId}
+			#{schoolId},
+			#{mb_stuid},
+			#{mb_student},
+			#{mb_grade},
+			#{mb_class},
+			#{mb_ignore},
+			#{mb_reply},
+			#{mbCreatorname}
 		)
 	</insert>
 	 
@@ -97,7 +125,14 @@
 			<if test="readDate != null">`read_date` = #{readDate}, </if>
 			<if test="mailboxStatus != null">`mailbox_status` = #{mailboxStatus}, </if>
 			<if test="notifier != null">`notifier` = #{notifier},</if>
-			<if test="schoolId != null and schoolId != ''"> `school_id` = #{schoolId} </if>
+			<if test="schoolId != null"> `school_id` = #{schoolId}, </if>
+			<if test="mbStuid != null"> mb_stuid = #{mbStuid}, </if>
+			<if test="mbStudent != null"> mb_student = #{mbStudent}, </if>
+			<if test="mbGrade != null"> mb_grade = #{mbGrade}, </if>
+			<if test="mbClass != null"> mb_class = #{mbClass}, </if>
+			<if test="mbIgnore != null"> mb_ignore = #{mbIgnore}, </if>
+			<if test="mbReply != null"> mb_reply = #{mbReply}, </if>
+			<if test="mbCreatorname != null">mb_creatorname = #{mbCreatorname} </if>
 		</set>
 		where mailbox_id = #{mailboxId}
 	</update>

+ 14 - 0
applications/school/school-server/src/main/resources/mapper/WxTemplateMapper.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.usoftchina.smartschool.school.wxschool.mapper.WxTemplateMapper">
+
+    <sql id="TemplateVo">
+    select `tem_id` ,`tem_appid`,`tem_out_in`,`tem_notify`,`tem_task`,`tem_vote`,`tem_score`,`tem_apply`,`tem_agree`,`tem_refuse`,`tem_leave`,`tem_meeting`,`tem_remarks` from sys_template
+    </sql>
+
+	<select id="getByAppid" resultType="com.usoftchina.smartschool.school.po.TemplateDO">
+		<include refid="TemplateVo"/> where tem_appid = #{temAppid}
+	</select>
+
+</mapper>

+ 2 - 2
frontend/pc-web/app.json

@@ -298,7 +298,7 @@
             "type": "yui"
         },
         "server": {
-            "basePath": "https://school-api.ubtob.com",
+            "basePath": "https://school-api.ydyhz.com",
             "urlPattern": "^\/api\/"
         }
     },
@@ -336,7 +336,7 @@
             "delay": 250
         },
         "server": {
-            "basePath": "https://school-api.ubtob.com",
+            "basePath": "https://school-api.ydyhz.com",
             "urlPattern": "^\/api\/"
         }
     },

+ 1 - 0
frontend/wechat-web/MP_verify_P40tTKo1dAMQh4CJ.txt

@@ -0,0 +1 @@
+P40tTKo1dAMQh4CJ

+ 3 - 3
frontend/wechat-web/src/configs/api.config.js

@@ -7,10 +7,10 @@ import store from './../redux/store/store'
  * Created by RaoMeng on 2018/11/21
  * Desc: 项目接口
  */
-// export const _baseURL = 'https://tmobile.ubtob.com/school'
+// export const _baseURL = 'https://tmobile.ydyhz.com/school'
 // export const _baseURL = 'http://10.1.80.101:9560'
-export const _baseURL = 'https://school-api.ubtob.com/api/school'
-// export const _baseURL = 'https://school-api.ubtob.com/api/school/grade/read/1'
+export const _baseURL = 'https://school-api.ydyhz.com/api/school'
+// export const _baseURL = 'https://school-api.ydyhz.com/api/school/grade/read/1'
 
 export const API = {
     //获取openId

+ 1 - 1
frontend/wechat-web/src/modules/accountBind/BindMenu.jsx

@@ -49,7 +49,7 @@ class BindMenu extends Component {
                 })
                 window.location.href =
                     'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' +
-                    this.paramId + '&redirect_uri=https%3a%2f%2fschool-api.ubtob.com%2fapi%2fschool%2fwxSchool%2fuser%2fuserLogin&response_type=code&scope=snsapi_userinfo&state=' +
+                    this.paramId + '&redirect_uri=https%3a%2f%2fschool-api.ydyhz.com%2fapi%2fschool%2fwxSchool%2fuser%2fuserLogin&response_type=code&scope=snsapi_userinfo&state=' +
                     this.paramId + '&connect_redirect=1#wechat_redirect'
             }
 

+ 12 - 8
frontend/wechat-web/src/modules/principalMailbox/PrincipalMailbox.jsx

@@ -14,6 +14,7 @@ import {fetchPost} from "../../utils/fetchRequest";
 import {connect} from 'react-redux'
 
 const {TextArea} = Input
+
 class PrincipalMailbox extends Component {
 
     constructor() {
@@ -88,16 +89,19 @@ class PrincipalMailbox extends Component {
         }
 
         let params = {
-                mailboxTitle: "校长信箱",
-                mailboxContext: suggest,
-                mailboxFiles: JSON.stringify(fileUrls),
-                mailboxCreator: this.props.userInfo.user.userFunId,
-                isAnonymity: isAnonymous ? 2 : 1,
-                mailboxStatus:1
+            mailboxTitle: "校长信箱",
+            mailboxContext: suggest,
+            mailboxFiles: JSON.stringify(fileUrls),
+            mailboxCreator: this.props.userInfo.user.userFunId,
+            isAnonymity: isAnonymous ? 2 : 1,
+            mailboxStatus: 1,
+            mbStuid:this.props.userInfo.user.student.stuId,
+            mbStudent:this.props.userInfo.user.student.stuName,
+
         }
-        console.log("params",params)
+        console.log("params", params)
         fetchPost(API.PRINCIPAL_MAILBOX, {
-            mailboxString:JSON.stringify(params)
+            mailboxString: JSON.stringify(params)
         }).then(response => {
             Toast.hide()
             Toast.success('提交成功,谢谢您的建议!')

+ 49 - 1
pom.xml

@@ -41,7 +41,7 @@
         <feign.form.version>3.0.3</feign.form.version>
         <commons.fileupload.version>1.3.3</commons.fileupload.version>
         <commons.compress.version>1.18</commons.compress.version>
-        <docker.repository>10.1.81.1:4000</docker.repository>
+        <docker.repository>10.10.100.200:5000</docker.repository>
         <docker.registry.name>smartschool</docker.registry.name>
         <guava.version>18.0</guava.version>
         <fastdfs.client.version>1.26.3</fastdfs.client.version>
@@ -538,6 +538,54 @@
                 </pluginManagement>
             </build>
         </profile>
+        <profile>
+            <!-- mvn deploy -P docker-prod -->
+            <id>docker-cloud</id>
+            <properties>
+                <docker.registry.name>smartschool-cloud</docker.registry.name>
+            </properties>
+            <build>
+                <pluginManagement>
+                    <plugins>
+                        <!-- Docker maven plugin -->
+                        <plugin>
+                            <groupId>com.spotify</groupId>
+                            <artifactId>docker-maven-plugin</artifactId>
+                            <version>1.0.0</version>
+                            <configuration>
+                                <dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
+                                <registryUrl>${docker.repository}</registryUrl>
+                                <pushImage>true</pushImage>
+                                <forceTags>true</forceTags>
+                                <imageName>
+                                    ${docker.repository}/${docker.registry.name}/${project.artifactId}:${project.version}
+                                </imageName>
+                                <imageTags>
+                                    <imageTag>latest</imageTag>
+                                </imageTags>
+                                <resources>
+                                    <resource>
+                                        <targetPath>/</targetPath>
+                                        <directory>${project.build.directory}</directory>
+                                        <include>${project.build.finalName}.jar</include>
+                                    </resource>
+                                </resources>
+                            </configuration>
+                            <executions>
+                                <execution>
+                                    <id>build-image</id>
+                                    <phase>package</phase>
+                                    <goals>
+                                        <goal>build</goal>
+                                    </goals>
+                                </execution>
+                            </executions>
+                        </plugin>
+                        <!-- Docker maven plugin -->
+                    </plugins>
+                </pluginManagement>
+            </build>
+        </profile>
     </profiles>
 
 </project>