Browse Source

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

# Conflicts:
#	frontend/pc-web/app.json
guq 6 years ago
parent
commit
5b7ea87a48
41 changed files with 1049 additions and 295 deletions
  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. 21 2
      base-servers/file/file-server/src/main/java/com/usoftchina/smartschool/file/controller/FileController.java
  27. 7 1
      base-servers/file/file-server/src/main/resources/application.yml
  28. 1 1
      frontend/pc-web/app.json
  29. 10 3
      frontend/pc-web/app/view/Interaction/homework/Release.js
  30. 10 3
      frontend/pc-web/app/view/Interaction/notice/SchoolNotice.js
  31. 3 1
      frontend/pc-web/app/view/basic/class/ClassDetail.js
  32. 230 0
      frontend/pc-web/app/view/core/form/field/FileField.js
  33. 27 0
      frontend/pc-web/app/view/core/form/field/FileField.scss
  34. 120 0
      frontend/pc-web/app/view/core/form/field/TrashField.js
  35. BIN
      frontend/pc-web/resources/images/default/delete.png
  36. BIN
      frontend/pc-web/resources/images/default/download.png
  37. 1 0
      frontend/wechat-web/MP_verify_P40tTKo1dAMQh4CJ.txt
  38. 3 3
      frontend/wechat-web/src/configs/api.config.js
  39. 1 1
      frontend/wechat-web/src/modules/accountBind/BindMenu.jsx
  40. 12 8
      frontend/wechat-web/src/modules/principalMailbox/PrincipalMailbox.jsx
  41. 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>

+ 21 - 2
base-servers/file/file-server/src/main/java/com/usoftchina/smartschool/file/controller/FileController.java

@@ -30,6 +30,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.net.URLEncoder;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -93,7 +94,7 @@ public class FileController {
 
     @ApiOperation(value = "上传文件")
     @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
-    public Result<FileInfoDTO> upload(@RequestParam("folderId") Long folderId, @RequestPart(value = "com/usoftchina/smartschool/file") MultipartFile file) throws Exception {
+    public Result<FileInfoDTO> upload(@RequestParam("folderId") Long folderId, @RequestPart(value = "file") MultipartFile file) throws Exception {
         // 检查父文件夹
         FileInfo parent = checkFolder(folderId);
         FileInfo info = FileInfo.newFile(file).folder(parent.getId())
@@ -188,7 +189,7 @@ public class FileController {
     }
 
     @ApiOperation(value = "查看文件信息")
-    @GetMapping(value = "/info")
+    @GetMapping(value = "/info", params = "path")
     public Result<FileInfoDTO> getFileInfo(@RequestParam("path") String path) {
         FileInfo info = fileService.findByFullPath(path);
         if (null != info) {
@@ -197,6 +198,24 @@ public class FileController {
         return Result.error(ExceptionCode.FILE_NOT_EXISTS);
     }
 
+    @ApiOperation(value = "查看文件信息")
+    @GetMapping(value = "/info", params = "ids")
+    public Result<FileInfoDTO> getFileInfoList(String ids) {
+        if (StringUtils.isEmpty(ids)){
+            throw new BizException(ExceptionCode.ILLEGAL_ARGUMENTS);
+        }
+        List<FileInfo> fileInfoList = new ArrayList<>();
+        String[] idArr = ids.split(";");
+        for (int i = 0; i < idArr.length; i++) {
+            FileInfo info = fileService.findByPrimaryKey(Long.parseLong(idArr[i]));
+            fileInfoList.add(info);
+        }
+        if (!CollectionUtils.isEmpty(fileInfoList)) {
+            return Result.success(BeanMapper.mapList(fileInfoList, FileInfoDTO.class));
+        }
+        return Result.error(ExceptionCode.FILE_NOT_EXISTS);
+    }
+
     @ApiOperation(value = "查看子文件")
     @GetMapping(value = "/list")
     public Result<List<FileInfoDTO>> listFiles(@RequestParam(value = "folderId", required = false) Long folderId) {

+ 7 - 1
base-servers/file/file-server/src/main/resources/application.yml

@@ -41,6 +41,12 @@ spring:
     time-zone: GMT+8
   profiles:
     active: dev
+  servlet:
+    multipart:
+      enabled: true
+      #20971520 ->  20M
+      max-file-size: 20971520
+      max-request-size: 20971520
 eureka:
   instance:
     leaseRenewalIntervalInSeconds: 10
@@ -53,7 +59,7 @@ eureka:
   client:
     registryFetchIntervalSeconds: 5
     serviceUrl:
-      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@10.1.81.61:8510/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:9500/eureka/
 server:
   port: 9540
   tomcat:

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

@@ -336,7 +336,7 @@
             "delay": 250
         },
         "server": {
-            "basePath": "http://127.0.0.1:9520",
+            "basePath": "https://school-api.ubtob.com",
             "urlPattern": "^\/api\/"
         }
     },

+ 10 - 3
frontend/pc-web/app/view/Interaction/homework/Release.js

@@ -118,8 +118,8 @@ Ext.define('school.view.interaction.homework.Release', {
                 height: 250,
                 allowBlank: false
             }, {
-                xtype: 'textfield',
-                name: 'fj',
+                xtype: 'mfilefield',
+                name: 'accessory',
                 fieldLabel: '附件'
             }],
             toolBtns: [{
@@ -127,11 +127,18 @@ Ext.define('school.view.interaction.homework.Release', {
                 text: '发布',
                 hidden: true,
                 bind: {
-                    hidden: '{!task_id}'
+                    hidden: '{!task_id || task_status == 1}'
                 },
                 handler: 'onPublish'
             }]
         });
         this.callParent();
+    },
+    listeners: {
+        load: function(form, data) {
+            let fileField = form.down('mfilefield');
+            fileField.value = data.main.accessory
+            fileField.renderMF(fileField);
+        }
     }
 });

+ 10 - 3
frontend/pc-web/app/view/Interaction/notice/SchoolNotice.js

@@ -75,8 +75,8 @@ Ext.define('school.view.interaction.notice.SchoolNotice', {
                 columnWidth: 1,
                 allowBlank: false
             }, {
-                xtype: 'textfield',
-                name: 'fj',
+                xtype: 'mfilefield',
+                name: 'accessory',
                 fieldLabel: '附件'
             }],
             toolBtns: [{
@@ -84,11 +84,18 @@ Ext.define('school.view.interaction.notice.SchoolNotice', {
                 text: '发布',
                 hidden: true,
                 bind: {
-                    hidden: '{!notify_id}'
+                    hidden: '{!notify_id || notify_status == 1}'
                 },
                 handler: 'onPublish'
             }]
         });
         this.callParent();
+    },
+    listeners: {
+        load: function(form, data) {
+            let fileField = form.down('mfilefield');
+            fileField.value = data.main.accessory
+            fileField.renderMF(fileField);
+        }
     }
 });

+ 3 - 1
frontend/pc-web/app/view/basic/class/ClassDetail.js

@@ -30,16 +30,18 @@ Ext.define('school.view.basic.class.ClassDetail', {
                 fieldLabel: "班级名称",
                 columnWidth: 0.5,
                 group: '班级信息',
+                allowBlank: false
             }, {
             //     xtype: 'textfield',
             //     name: 'code',
             //     fieldLabel: '班级代码',
             // }, {
-                xtype: 'textfield',
+                xtype: 'gradecombo',
                 name: 'clazz_grade',
                 fieldLabel: '所属年级',
                 columnWidth: 0.5,
                 group: '班级信息',
+                allowBlank: false
             }, {
                 xtype: "textfield",
                 name: "clazz_adress",

+ 230 - 0
frontend/pc-web/app/view/core/form/field/FileField.js

@@ -0,0 +1,230 @@
+/**
+ * 多文件上传下载
+ */
+Ext.define('school.view.core.form.field.FileField', {
+	extend: 'Ext.form.FieldSet',
+	alias: 'widget.mfilefield',
+	minHeight: 22,
+	collapsible: true,
+	multi: true,
+	allowBlank:true,
+	initComponent: function() {
+		this.columnWidth = 1;//强制占一行
+		this.cls = '';
+		this.title = this.title || '附件';
+		this._title = this.title;
+		this.callParent(arguments);
+	},
+	layout:'column',
+	items: [{
+		xtype: 'form',
+		columnWidth: 1,
+		frame: false,
+		border: false,
+		minHeight: 22,
+		bodyStyle: 'padding:2px;background:#f7f7f7',
+		layout: 'hbox',
+		items: [{
+			xtype: 'filefield',
+			name: 'file',
+			cls:'x-form-filefield',
+			buttonText: '浏览文件(≤20MB)',
+			buttonOnly: true,
+			hideLabel: true,
+			buttonConfig:{
+				cls:'x-filefield-button'
+			},
+			createFileInput : function() {
+	            var me = this;
+	            me.fileInputEl = me.button.el.createChild({
+	            name: me.getName(),
+	            cls: Ext.baseCSSPrefix + 'form-file-input',
+	            tag: 'input',
+	            type: 'file',
+	            multiple:'multiple',
+	            size: 1
+	           }).on('change', me.onFileChange, me);
+	        },
+			listeners: {
+				change: function(field){
+					if(field.value != null){
+						field.ownerCt.ownerCt.upload(field.ownerCt, field);
+					}
+				}
+			}
+		}]
+	}],
+	setValue: function(value){
+		this.value = value;
+		this.dirty = true;
+		this.ownerCt.viewModel.data[this.name] = this.value
+	},
+	getValue: function (){
+		return this.down('hidden').value;
+	},
+	renderMF: function(f){
+		f.setHtml(null);
+		var form = f.ownerCt;			
+		if(f.value != null && f.value.toString().trim() != ''){
+			f.download(f.value,f.name);
+		}
+		if(typeof(form.readOnly)!="undefined"){
+			f.setReadOnly(form.readOnly);
+		}
+	},
+	/**
+	 * 上传附件
+	 */
+	upload: function(form, field){
+		var me = this;
+		var myForm = field.ownerCt;
+		var fileEl = field.fileInputEl.dom;
+		var fd = new FormData();
+		fd.append('file', fileEl.files[0]);
+		fd.append('folderId', 0);
+		form.setLoading(true);
+		Ext.Ajax.request({
+			// url: 'http://10.1.80.180:9520/api/file/upload',//这里是填写需要跨域访问的URL
+			url: '/api/file/upload',//这里是填写需要跨域访问的URL
+			cors: true,
+			useDefaultXhrHeader: false,
+			method: 'post',
+			rawData: fd,
+			headers: {
+				'Access-Control-Allow-Origin': '*',
+				'Authorization':  school.util.State.get('session').token,
+				//"Content-Type": 'multipart/form-data'  //文件上传的格式, 
+				"Content-Type":null
+			},
+			success: function (response, opts) {
+				form.setLoading(false);
+				var res = Ext.decode(response.responseText);
+				if(res.success){
+					school.util.BaseUtil.showSuccessToast('上传成功');
+					var data = res.data;
+					var name = data.name + "  (" + Ext.util.Format.fileSize(data.size) + ")";
+					var w = Math.min((me.getStrLength(name) + 25) / 200, .8);
+					if(data.id){
+						field = Ext.create('school.view.core.form.field.TrashField', {
+							fileName: data.name,
+							value: name,
+							columnWidth: w,
+							readOnly: false,
+							editable: false,
+							filepath: data.fullPath,
+							filesize: data.size,
+							_id:data.id,
+							fieldStyle: 'background:#E0EEEE;'
+						});
+						me.add(field);
+						var val = (me.value || '') + data.id + ';';
+						// //添加FilePath表的ID
+						me.setValue(val);
+					}
+				}else{
+					school.util.BaseUtil.showErrorToast('上传失败: ' + res.message);
+				}
+			},
+			failure: function (response, opts) {
+				form.setLoading(false);
+				var res = Ext.decode(response.responseText);
+				school.util.BaseUtil.showErrorToast('上传失败: ' + res.message);
+			}
+		});
+	},
+	/**
+	 * 根据id读取对应PATH
+	 * @param id{String} fp_id
+	 */
+	download: function(id,name){
+		var me = this;
+		me.clearAll();
+		var files = new Array();	
+		Ext.Ajax.request({
+			// url : 'http://10.1.80.180:9520/api/file/info',
+			url : '/api/file/info',
+			async: false,
+			params: {
+				ids:  id
+			},
+			method : 'GET',
+			callback : function(options,success,response){
+				var res = new Ext.decode(response.responseText);
+				if(res.exception || res.exceptionInfo){
+					showError(res.exceptionInfo);
+					return;
+				}
+				files = res.data != null ? res.data : [];
+			}
+		});		
+		Ext.each(files, function(f){
+			var name = f.name + "  (" + Ext.util.Format.fileSize(f.size) + ")";
+			var w = Math.min((me.getStrLength(name) + 25) / 200, .8);
+			me.addItem(Ext.create('school.view.core.form.field.TrashField', {
+				fileName: f.name,
+				value: name,
+				columnWidth: w,
+				readOnly: false,
+				editable: false,
+				filepath: f.fullPath,
+				filesize: f.size,
+				_id:f.id,
+				fieldStyle: 'background:#E0EEEE;'
+			}));
+		});
+	},
+	
+	checkUploadAmount:function(form){
+		var files = form.getEl().down('input[type=file]').dom.files;
+		var amounts = 0;
+		for (var i = 0; i < files.length; i++) {
+			amounts = amounts + files[i].size
+		}
+		if (amounts>104857600) {
+			Ext.MessageBox.alert("警告","对不起,上传文件总大小超过100m");
+			return false
+		}
+		return true;
+	},
+	addItem: function(item){
+		this.add(item);
+	},
+	setReadOnly: function(bool){
+		//只读情况下限制不允许上传
+		var f=this.down('filefield');
+		if(f.button&&f.fileInputEl){
+			//若界面配置字段可修改则允许传附件 
+			if(this.modify) bool=false;
+			f.button.setDisabled(bool);
+			if(bool) {
+				f.fileInputEl.dom.setAttribute('disabled',bool);	
+			}else f.fileInputEl.dom.removeAttribute('disabled');			
+		}
+	},
+	setFieldStyle: function(str) {
+
+	},
+	getStrLength: function(str) {
+		for (var len = str.length, c = 0, i = 0; i < len; i++) 
+        	str.charCodeAt(i) < 27 || str.charCodeAt(i) > 126 ? c += 2 : c++;
+        return c;
+	},
+	clearAll: function() {
+		var me = this, items = me.query('trashfield');
+		Ext.Array.each(items, function(item){
+			me.remove(item);
+		});
+		me.filesize = 0;
+	},
+	checkFile:function(fileName){
+		var arr=['php','php2','php3', 'php5', 'phtml', 'asp', 'aspx', 'ascx', 'jsp', 'cfm', 'cfc', 'pl','pl','bat',  'dll', 'reg', 'cgi','war'];
+	    var suffix=fileName.substring(fileName.lastIndexOf(".")+1);
+	    return Ext.Array.contains(arr,suffix);
+	},
+	isValid:function(){
+		return true;
+	},
+	isDirty:function(){
+		return this.dirty;
+	}
+});

+ 27 - 0
frontend/pc-web/app/view/core/form/field/FileField.scss

@@ -0,0 +1,27 @@
+
+.x-form-filefield{
+    .x-form-item-body{
+      .x-form-trigger-wrap{
+        .x-form-trigger{
+          background: #f7f7f7 !important;
+        }
+      } 
+    }
+  }
+  
+  .x-filefield-button{
+    margin-top: 8px !important
+  }
+  .x-form-download-trigger {
+      background: #fff url(../../../../../resources/images/default/download.png) no-repeat center
+      center !important;
+  }
+  .x-form-trash-trigger {
+      background: #fff url(../../../../../resources/images/default/delete.png) no-repeat center
+      center !important;
+  }
+  .x-fieldset{
+    .x-form-trigger-default:before{
+      content:""
+    }
+  }

+ 120 - 0
frontend/pc-web/app/view/core/form/field/TrashField.js

@@ -0,0 +1,120 @@
+/**
+ * 显示附件名称、大小;
+ * 附件删除、下载、显示
+ */
+Ext.define('school.view.core.form.field.TrashField', {
+	extend : 'Ext.form.field.Trigger',
+	alias : 'widget.trashfield',
+	trigger1Cls: 'x-form-download-trigger',
+    trigger2Cls: 'x-form-trash-trigger',
+    style:'margin:5px 0 0 0',
+	fieldStyle: 'background:#C6E2FF;color:#D9D9D9;',
+    autoShow: true,
+	initComponent : function() {
+		this.callParent(arguments);
+	},
+	listeners : {
+		afterrender : function() {
+			var me = this, c = Ext.Function.bind(me.onTrigger1Click, me);
+			Ext.EventManager.on(me.inputEl, {
+				click : c,
+				scope : me,
+				buffer : 100
+			});
+			Ext.DomHelper.applyStyles(me.inputEl.dom, 'border:none;');
+			//取消延时影藏trigger的写法 
+		/*	// 只读时,隐藏删除trigger
+			Ext.defer(function(){
+				var form = me.up('form');
+				if(me.ownerCt.readOnly) {
+					me.getEl().down("." + me.trigger2Cls).applyStyles({visibility: 'hidden'});
+				}
+			}, 200);*/
+		}
+	},
+	onTrigger1Click: function(e){
+        this.download();
+	},
+	onTrigger2Click: function(){
+		var me = this;
+		school.util.BaseUtil.warnMsg('确定删除' + me.value, function(btn){
+			if(btn == 'yes'){
+                var v = me.ownerCt.value.replace(me._id+';','')
+                me.ownerCt.setValue(v);
+                me.ownerCt.remove(me)
+				// var v = me.ownerCt.down('hidden').value.replace(me.filepath + ';', '');
+				// me.updateAttachField(v, '删除附件', function(){
+				// 	me.ownerCt.down('hidden').setValue(v);
+				// 	me.ownerCt.filesize -= me.filesize;
+				// 	me.ownerCt.setTitle('<img src="' + basePath + 'resource/images/icon/clip.png" width=20 height=20/>附件' + 
+				// 			'(总大小:' + Ext.util.Format.fileSize(me.ownerCt.filesize) + ")");
+				// });
+			}
+		});
+	},
+	download : function() {
+        var me = this;
+        var serverOptions = Ext.manifest.server;
+		window.location.href = (serverOptions.basePath.https?serverOptions.basePath.https:serverOptions.basePath) + '/api/file/download?path='+me.filepath;
+	},
+	showAttach : function() {
+		var me = this,src = basePath + 'common/download.action?path=' + me.realpath.replace(/\+/g, '%2B')+"&size="+me.filesize+"&fileName="+me.fileName;
+		var img = document.createElement("img");
+		img.src = src;		 		
+		myWindow=window.open(); 
+		myWindow.document.body.appendChild(img);
+		myWindow.focus();
+	},
+	isImage : function(path) {
+		if (Ext.isEmpty(path)) {
+			return false;
+		}
+		if (!/\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(path)) {
+			return false;
+		}
+		return true;
+	},
+	resetField:function(bool){		
+	    var me=this;
+		if(bool)
+		me.getEl().down("." + me.trigger2Cls).applyStyles({visibility: 'hidden'});
+		else{
+			 me.getEl().down("." + me.trigger2Cls).applyStyles({visibility: 'visible'});
+		}
+	},
+	updateAttachField: function(value, type, fn) {
+		var form = this.ownerCt.ownerCt;
+		if(form.keyField){
+			var field = this.ownerCt.name,me = this, val = Ext.getCmp(form.keyField).value;
+			if(!Ext.isEmpty(val)&&!(caller.indexOf("$")!=-1 && form.keyField=="cl_id")) {//通用变更单上的附件字段,删除附件时后台不删除
+				Ext.Ajax.request({
+					url: basePath + 'common/attach/update.action',
+					params: {
+						caller: caller,
+						table: form.tablename.toUpperCase().split("LEFT")[0],
+						update: field + '=\'' + value + '\'',
+						condition: form.keyField + "='" + val+"'",
+						type: type
+					},
+					callback: function(opt, s, r) {
+						var res = Ext.decode(r.responseText);
+						if(res.success) {
+							if(fn) {
+								fn.call();
+								me.destroy();
+							}
+						} else {
+							showError(res.exceptionInfo);
+						}
+					}
+				});
+			} else {
+				fn && fn.call();
+				this.destroy();
+			}
+		} else{
+				fn && fn.call();
+				this.destroy();
+		}
+	}
+});

BIN
frontend/pc-web/resources/images/default/delete.png


BIN
frontend/pc-web/resources/images/default/download.png


+ 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>