Ver Fonte

Merge branches 'dev', 'feature-cloud' and 'master' of ssh://10.10.100.21/source/smartschool-platform into dev

RaoMeng há 7 anos atrás
pai
commit
f658b74106
73 ficheiros alterados com 1886 adições e 945 exclusões
  1. 1 21
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/SchoolApplication.java
  2. 1 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/controller/ClassController.java
  3. 4 5
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/StudentServiceImpl.java
  4. 1 3
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/controller/InOutRecordController.java
  5. 33 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/controller/PrincipalMailController.java
  6. 8 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/PrincipalMailService.java
  7. 46 3
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/impl/PrincipalMailServiceImpl.java
  8. 0 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/interceptor/AuthRestInterceptor.java
  9. 23 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/interceptor/InterceptorConfig.java
  10. 14 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/PrincipalMailboxMapper.java
  11. 2 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/SysStudentMapper.java
  12. 3 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/HomeWork.java
  13. 11 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/Notify.java
  14. 53 13
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/OutInRecord.java
  15. 49 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/PrincipalMail.java
  16. 15 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/PrincipalMailboxDO.java
  17. 8 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/SysParents.java
  18. 40 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/TemplateDO.java
  19. 8 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/controller/WxUserController.java
  20. 20 12
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxMeetingServiceImpl.java
  21. 31 8
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxNotifyServiceImpl.java
  22. 41 24
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxOaApproveServiceImpl.java
  23. 16 4
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxOaLeaveServiceImpl.java
  24. 16 9
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxPrincipalMailboxServiceImpl.java
  25. 21 8
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxTaskNotifyServiceImpl.java
  26. 20 7
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxVoteServiceImpl.java
  27. 20 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/mapper/WxTemplateMapper.java
  28. 3 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/oaBean/Director.java
  29. 3 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/oaBean/GeneralManager.java
  30. 3 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/oaBean/Leader.java
  31. 13 12
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/oaBean/Manager.java
  32. 22 5
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/support/RemindTask.java
  33. 185 154
      applications/school/school-server/src/main/resources/mapper/HomeWorkMapper.xml
  34. 15 3
      applications/school/school-server/src/main/resources/mapper/NotifyMapper.xml
  35. 23 8
      applications/school/school-server/src/main/resources/mapper/OutInRecordMapper.xml
  36. 40 11
      applications/school/school-server/src/main/resources/mapper/PrincipalMailboxMapper.xml
  37. 10 3
      applications/school/school-server/src/main/resources/mapper/SysStudentMapper.xml
  38. 39 4
      applications/school/school-server/src/main/resources/mapper/WxPrincipalMailboxMapper.xml
  39. 14 0
      applications/school/school-server/src/main/resources/mapper/WxTemplateMapper.xml
  40. 1 1
      base-servers/file/file-server/src/main/java/com/usoftchina/smartschool/file/controller/FileController.java
  41. 7 1
      base-servers/file/file-server/src/main/resources/application.yml
  42. 9 2
      frontend/pc-web/app/Application.js
  43. 3 0
      frontend/pc-web/app/model/Session.js
  44. 2 2
      frontend/pc-web/app/model/Subject.js
  45. 7 7
      frontend/pc-web/app/model/Timetable.js
  46. 12 0
      frontend/pc-web/app/store/Class.js
  47. 5 3
      frontend/pc-web/app/store/Grade.js
  48. 59 47
      frontend/pc-web/app/store/Subject.js
  49. 37 69
      frontend/pc-web/app/view/Interaction/access/List.js
  50. 56 91
      frontend/pc-web/app/view/Interaction/homework/List.js
  51. 54 16
      frontend/pc-web/app/view/Interaction/homework/Release.js
  52. 132 77
      frontend/pc-web/app/view/Interaction/mailbox/List.js
  53. 195 0
      frontend/pc-web/app/view/Interaction/mailbox/ListController.js
  54. 25 89
      frontend/pc-web/app/view/Interaction/notice/List.js
  55. 19 5
      frontend/pc-web/app/view/Interaction/notice/SchoolNotice.js
  56. 40 21
      frontend/pc-web/app/view/Interaction/score/List.js
  57. 52 10
      frontend/pc-web/app/view/Interaction/timetable/Detail.js
  58. 40 15
      frontend/pc-web/app/view/Interaction/timetable/List.js
  59. 2 2
      frontend/pc-web/app/view/basic/class/ClassInfo.js
  60. 4 2
      frontend/pc-web/app/view/basic/class/ClassInfoController.js
  61. 1 1
      frontend/pc-web/app/view/basic/class/ListCard.js
  62. 1 1
      frontend/pc-web/app/view/basic/class/ListCardController.js
  63. 14 6
      frontend/pc-web/app/view/basic/staff/StaffDetail.js
  64. 71 16
      frontend/pc-web/app/view/basic/student/StudentDetail.js
  65. 46 73
      frontend/pc-web/app/view/basic/student/StudentList.js
  66. 9 11
      frontend/pc-web/app/view/core/base/BasePanel.js
  67. 22 18
      frontend/pc-web/app/view/core/form/FormPanelController.js
  68. 20 0
      frontend/pc-web/app/view/core/form/field/ClassComboBox.js
  69. 20 0
      frontend/pc-web/app/view/core/form/field/GradeComboBox.js
  70. 21 0
      frontend/pc-web/app/view/core/form/field/SubjectComboBox.js
  71. 6 11
      frontend/pc-web/app/view/core/grid/column/SubjectColumn.js
  72. 1 1
      frontend/pc-web/app/view/viewport/ViewportController.js
  73. 18 11
      frontend/pc-web/app/view/viewport/ViewportModel.js

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

@@ -1,15 +1,11 @@
 package com.usoftchina.smartschool.school;
 
-import com.usoftchina.smartschool.school.interceptor.AuthRestInterceptor;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.web.servlet.ServletComponentScan;
 import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
 import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.transaction.annotation.EnableTransactionManagement;
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
-import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
 
 /**
  * @author: guq
@@ -20,24 +16,8 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
 @ServletComponentScan
 @EnableEurekaClient
 @EnableFeignClients("com.usoftchina.smartschool")
-public class SchoolApplication extends WebMvcConfigurerAdapter{
+public class SchoolApplication {
     public static void main(String[] args) {
         SpringApplication.run(SchoolApplication.class, args);
     }
-
-    @Override
-    public void addCorsMappings(CorsRegistry registry) {
-
-        registry.addMapping("/**")
-                .allowCredentials(true)
-                .allowedHeaders("*")
-                .allowedOrigins("*")
-                .allowedMethods("*");
-    }
-
-    @Override
-    public void addInterceptors(InterceptorRegistry registry){
-        registry.addInterceptor(new AuthRestInterceptor()).addPathPatterns("/**");
-        super.addInterceptors(registry);
-    }
 }

+ 1 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/controller/ClassController.java

@@ -33,6 +33,7 @@ public class ClassController {
     @PostMapping("/delete/{id}")
     public Result delete(@PathVariable("id") Long id) {
         classService.delete(id);
+
         return Result.success();
     }
 

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

@@ -42,7 +42,6 @@ public class StudentServiceImpl implements StudentService{
     public PageInfo<SysStudent> getListData(PageRequest page, ListReqDTO listReqDTO) {
         PageHelper.startPage(page.getNumber(), page.getSize());
         Long schoolId = BaseContextHolder.getSchoolId();
-        schoolId = 1l;
         //condition语句
         String condition = listReqDTO.getFinalCondition();
         if(condition == null){
@@ -91,7 +90,7 @@ public class StudentServiceImpl implements StudentService{
                     item.setSchool_id(schoolid);
                     sysStudentMapper.insertparent(item);
                     pr_id = item.getParent_id();
-                    sysStudentMapper.insertrelation(id, pr_id);
+                    sysStudentMapper.insertrelation(id, pr_id, item.getPs_relation());
                 }
             }
             return new DocBaseDTO(id, null, "student");
@@ -115,17 +114,17 @@ public class StudentServiceImpl implements StudentService{
                 item.setSchool_id(schoolid);
                 sysStudentMapper.insertparent(item);
                 pr_id = item.getParent_id();
-                sysStudentMapper.insertrelation(id, pr_id);
+                sysStudentMapper.insertrelation(id, pr_id, item.getPs_relation());
             }
         }
         //更新从表
         if (updateDetails.size() > 0) {
             sysStudentMapper.updateParents(updateDetails);
             for (SysParents item : updateDetails) {
-                sysStudentMapper.updateRelation(item.getParent_id(), id, item.getPr_relation());
+                sysStudentMapper.updateRelation(item.getParent_stu_id(), item.getPs_relation());
             }
         }
-        return new DocBaseDTO(id, null, "student");
+        return new DocBaseDTO(id);
     }
 
     @Override

+ 1 - 3
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/controller/InOutRecordController.java

@@ -8,9 +8,7 @@ import com.usoftchina.smartschool.school.business.service.InOutRecordService;
 import com.usoftchina.smartschool.school.dto.ListReqDTO;
 import com.usoftchina.smartschool.school.po.OutInRecord;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * @author: guq

+ 33 - 2
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/controller/PrincipalMailController.java

@@ -7,7 +7,7 @@ import com.usoftchina.smartschool.page.PageRequest;
 import com.usoftchina.smartschool.school.business.service.PrincipalMailService;
 import com.usoftchina.smartschool.school.dto.BatchDealBaseDTO;
 import com.usoftchina.smartschool.school.dto.ListReqDTO;
-import com.usoftchina.smartschool.school.po.PrincipalMailboxDO;
+import com.usoftchina.smartschool.school.po.PrincipalMail;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -25,7 +25,7 @@ public class PrincipalMailController {
 
     @GetMapping("/list")
     public Result getList(@PageDefault PageRequest page, ListReqDTO listReqDTO) {
-        PageInfo<PrincipalMailboxDO> data = principalMailService.getListData(page, listReqDTO);
+        PageInfo<PrincipalMail> data = principalMailService.getListData(page, listReqDTO);
         return Result.success(data);
     }
 
@@ -40,4 +40,35 @@ public class PrincipalMailController {
         return Result.success();
     }
 
+
+    /**
+     * @param baseDTOs
+     * @return
+     */
+    @PostMapping("/batchIgnore")
+    public Result batchIgnore(@RequestBody BatchDealBaseDTO baseDTOs) {
+        principalMailService.batchIgnore(baseDTOs);
+        return Result.success();
+    }
+
+    /**
+     * @param baseDTOs
+     * @return
+     */
+    @PostMapping("/batchUnIgnore")
+    public Result batchUnIgnore(@RequestBody BatchDealBaseDTO baseDTOs) {
+        principalMailService.batchUnIgnore(baseDTOs);
+        return Result.success();
+    }
+
+
+    /**
+     * @return
+     */
+    @PostMapping("/reply")
+    public Result reply(String msg, Long id) {
+        principalMailService.reply(msg, id);
+        return Result.success();
+    }
+
 }

+ 8 - 2
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/PrincipalMailService.java

@@ -4,10 +4,16 @@ import com.github.pagehelper.PageInfo;
 import com.usoftchina.smartschool.page.PageRequest;
 import com.usoftchina.smartschool.school.dto.BatchDealBaseDTO;
 import com.usoftchina.smartschool.school.dto.ListReqDTO;
-import com.usoftchina.smartschool.school.po.PrincipalMailboxDO;
+import com.usoftchina.smartschool.school.po.PrincipalMail;
 
 public interface PrincipalMailService {
-    PageInfo<PrincipalMailboxDO> getListData(PageRequest page, ListReqDTO listReqDTO);
+    PageInfo<PrincipalMail> getListData(PageRequest page, ListReqDTO listReqDTO);
 
     void batchDelete(BatchDealBaseDTO baseDTOs);
+
+    void batchIgnore(BatchDealBaseDTO baseDTOs);
+
+    void batchUnIgnore(BatchDealBaseDTO baseDTOs);
+
+    void reply(String msg, Long id);
 }

+ 46 - 3
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/impl/PrincipalMailServiceImpl.java

@@ -3,16 +3,22 @@ package com.usoftchina.smartschool.school.business.service.impl;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.smartschool.context.BaseContextHolder;
+import com.usoftchina.smartschool.exception.BizException;
 import com.usoftchina.smartschool.page.PageRequest;
 import com.usoftchina.smartschool.school.business.service.PrincipalMailService;
 import com.usoftchina.smartschool.school.dto.BatchDealBaseDTO;
 import com.usoftchina.smartschool.school.dto.DocBaseDTO;
 import com.usoftchina.smartschool.school.dto.ListReqDTO;
+import com.usoftchina.smartschool.school.exception.BizExceptionCode;
 import com.usoftchina.smartschool.school.mapper.PrincipalMailboxMapper;
+import com.usoftchina.smartschool.school.po.PrincipalMail;
 import com.usoftchina.smartschool.school.po.PrincipalMailboxDO;
+import com.usoftchina.smartschool.school.po.PrincipalReplyDO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -26,7 +32,7 @@ public class PrincipalMailServiceImpl implements PrincipalMailService {
     private PrincipalMailboxMapper principalMailboxMapper;
 
     @Override
-    public PageInfo<PrincipalMailboxDO> getListData(PageRequest page, ListReqDTO listReqDTO) {
+    public PageInfo<PrincipalMail> getListData(PageRequest page, ListReqDTO listReqDTO) {
         PageHelper.startPage(page.getNumber(), page.getSize());
         Long schoolId = BaseContextHolder.getSchoolId();
         schoolId = 1l;
@@ -35,8 +41,8 @@ public class PrincipalMailServiceImpl implements PrincipalMailService {
         if(condition == null){
             condition = "1=1";
         }
-        List<PrincipalMailboxDO> data = principalMailboxMapper.selectByConditon(condition, schoolId);
-        PageInfo<PrincipalMailboxDO> list = new PageInfo<>(data);
+        List<PrincipalMail> data = principalMailboxMapper.selectByConditon(condition, schoolId);
+        PageInfo<PrincipalMail> list = new PageInfo<>(data);
         return list;
     }
 
@@ -52,7 +58,44 @@ public class PrincipalMailServiceImpl implements PrincipalMailService {
         }
     }
 
+    @Override
+    public void batchIgnore(BatchDealBaseDTO baseDTOs) {
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return;
+        }
+        List<DocBaseDTO> base = baseDTOs.getBaseDTOs();
+        principalMailboxMapper.batchIgnore(base);
+    }
+
+    @Override
+    public void batchUnIgnore(BatchDealBaseDTO baseDTOs) {
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return;
+        }
+        List<DocBaseDTO> base = baseDTOs.getBaseDTOs();
+        principalMailboxMapper.batchUnIgnore(base);
+    }
+
+    @Override
+    public void reply(String msg, Long id) {
+        if (StringUtils.isEmpty(msg) || StringUtils.isEmpty(id)) {
+            throw new BizException(BizExceptionCode.USELESS_DATA);
+        }
+        //更新主表
+        principalMailboxMapper.updateReply(msg, id);
+
+        PrincipalReplyDO replyDO = new PrincipalReplyDO();
+        replyDO.setMailboxId(id);
+        replyDO.setReplyContent(msg);
+        replyDO.setReplyDate(new Date());
+        //插入从表
+        principalMailboxMapper.insertDetail(replyDO);
+    }
+
     private void singleDelete(Long id) {
         principalMailboxMapper.deleteByPrimaryKey(id);
     }
+
 }

+ 0 - 2
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/interceptor/AuthRestInterceptor.java

@@ -19,8 +19,6 @@ import java.util.Enumeration;
  * @author chenwei
  * @date 2019/2/18
  */
-@Component
-@Configuration
 public class AuthRestInterceptor extends HandlerInterceptorAdapter {
 
     private static final Logger logger = LoggerFactory.getLogger(AuthRestInterceptor.class);

+ 23 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/interceptor/InterceptorConfig.java

@@ -0,0 +1,23 @@
+package com.usoftchina.smartschool.school.interceptor;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+/**
+ * @author: guq
+ * @create: 2019-03-01 16:00
+ **/
+@Configuration
+public class InterceptorConfig implements WebMvcConfigurer {
+    @Bean
+    public AuthRestInterceptor authRestInterceptor() {
+        return new AuthRestInterceptor();
+    }
+
+    @Override
+    public void addInterceptors(InterceptorRegistry registry) {
+        registry.addInterceptor(authRestInterceptor());
+    }
+}

+ 14 - 2
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/PrincipalMailboxMapper.java

@@ -1,6 +1,8 @@
 package com.usoftchina.smartschool.school.mapper;
 
-import com.usoftchina.smartschool.school.po.PrincipalMailboxDO;
+import com.usoftchina.smartschool.school.dto.DocBaseDTO;
+import com.usoftchina.smartschool.school.po.PrincipalMail;
+import com.usoftchina.smartschool.school.po.PrincipalReplyDO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -15,5 +17,15 @@ public interface PrincipalMailboxMapper {
 
     PrincipalMailboxDO selectByPrimaryKey(Long mailbox_id);*/
 
-    List<PrincipalMailboxDO> selectByConditon(@Param("con") String condition, @Param("school_id") Long schoolId);
+    List<PrincipalMail> selectByConditon(@Param("con") String condition, @Param("school_id") Long schoolId);
+
+    //void ignore(Long id);
+
+  void batchIgnore(List<DocBaseDTO> baseDTOs);
+
+  void batchUnIgnore(List<DocBaseDTO> base);
+
+  void updateReply(@Param("msg") String msg, @Param("id") Long id);
+
+  void insertDetail(PrincipalReplyDO replyDO);
 }

+ 2 - 2
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/SysStudentMapper.java

@@ -27,11 +27,11 @@ public interface SysStudentMapper {
 
     void insertparent(SysParents item);
 
-    void insertrelation(@Param("id") Long id, @Param("pr_id") Long pr_id);
+    void insertrelation(@Param("id") Long id, @Param("pr_id") Long pr_id, @Param("relation") String relation);
 
     void updateParents(List<SysParents> updateDetails);
 
-    void updateRelation(@Param("parent_id") Long parent_id, @Param("id") Long id, @Param("relation") String relation);
+    void updateRelation(@Param("id") Long id, @Param("relation") String relation);
 
     SysStudent selectByCode(@Param("code") String code, @Param("schoolId") Long schoolId);
 

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

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

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

@@ -27,7 +27,9 @@ public class Notify implements Serializable{
 
     private String notify_stu;
 
-    private Date publish_date;
+    private Date publish_date;  //发布时间
+
+    private String creator; //创建人姓名
 
     public String getNotify_details() {
         return notify_details;
@@ -132,4 +134,12 @@ public class Notify implements Serializable{
     public void setPublish_date(Date publish_date) {
         this.publish_date = publish_date;
     }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
 }

+ 53 - 13
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/OutInRecord.java

@@ -4,31 +4,39 @@ import java.io.Serializable;
 import java.util.Date;
 
 public class OutInRecord implements Serializable{
-    private Long record_id;
+    private Long record_id;         //编号
 
-    private String record_name;
+    private String record_name;     //记录名
 
-    private Date out_date;
+    private Date out_date;          //出校时间
 
-    private Date in_date;
+    private Date in_date;           //入校时间
 
-    private String record_details;
+    private String record_details;  //详情
 
-    private String record_remarks;
+    private String record_remarks;  //备注
 
-    private String device_id;
+    private String device_id;       //设备标识
 
-    private Long stu_id;
+    private Long stu_id;            //学生编号
 
-    private Long school_id;
+    private Long school_id;         //学校编号
 
-    private String stu_name;
+    private Integer stu_sex;        //学生性别
 
-    private Integer stu_sex;
+    private String stu_number;      //学号
 
-    private String stu_number;
+    private String stu_name;	    //学生姓名
 
-    private String clazz_name;
+    private Long grade_id;	        //年级编号
+
+    private String grade_name;	    //年级名
+
+    private Long clazz_id;	        //班级编号
+
+    private String clazz_name;	    //班级名
+
+    private String grade_clazz;	    //年级加班级名
 
     public String getStu_name() {
         return stu_name;
@@ -133,4 +141,36 @@ public class OutInRecord implements Serializable{
     public void setSchool_id(Long school_id) {
         this.school_id = school_id;
     }
+
+    public Long getGrade_id() {
+        return grade_id;
+    }
+
+    public void setGrade_id(Long grade_id) {
+        this.grade_id = grade_id;
+    }
+
+    public String getGrade_name() {
+        return grade_name;
+    }
+
+    public void setGrade_name(String grade_name) {
+        this.grade_name = grade_name;
+    }
+
+    public Long getClazz_id() {
+        return clazz_id;
+    }
+
+    public void setClazz_id(Long clazz_id) {
+        this.clazz_id = clazz_id;
+    }
+
+    public String getGrade_clazz() {
+        return grade_clazz;
+    }
+
+    public void setGrade_clazz(String grade_clazz) {
+        this.grade_clazz = grade_clazz;
+    }
 }

+ 49 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/PrincipalMail.java

@@ -0,0 +1,49 @@
+package com.usoftchina.smartschool.school.po;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author: guq
+ * @create: 2019-03-01 09:41
+ **/
+@Data
+public class PrincipalMail implements Serializable{
+    private Long mailbox_id;
+
+    private String mailbox_title;
+
+    private Integer is_anonymity;
+
+    private Date create_date;
+
+    private Long mailbox_creator;
+
+    private Date read_date;
+
+    private Integer mailbox_status;
+
+    private Long notifier;
+
+    private Long school_id;
+
+    private Long mb_stuid;
+
+    private String mb_student;
+
+    private String mb_grade;
+
+    private String mb_class;
+
+    private Integer mb_ignore;
+
+    private String mailbox_context;
+
+    private String mailbox_files;
+
+    private String mb_reply;
+
+    private String mb_creatorname;
+}

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

+ 8 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/SysParents.java

@@ -44,6 +44,14 @@ public class SysParents {
 
     private String ps_relation;
 
+    public String getPs_relation() {
+        return ps_relation;
+    }
+
+    public void setPs_relation(String ps_relation) {
+        this.ps_relation = ps_relation;
+    }
+
     public Long getParent_stu_id() {
         return parent_stu_id;
     }

+ 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);
 	}
 

+ 20 - 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,27 @@ 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);
+
+							}
+
+						}
+					}
 
 				}
 			}

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

+ 185 - 154
applications/school/school-server/src/main/resources/mapper/HomeWorkMapper.xml

@@ -1,164 +1,192 @@
 <?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.HomeWorkMapper" >
-  <resultMap id="BaseResultMap" type="com.usoftchina.smartschool.school.po.HomeWork" >
-    <id column="task_id" property="task_id" jdbcType="BIGINT" />
-    <result column="subject_id" property="subject_id" jdbcType="BIGINT" />
-    <result column="task_title" property="task_title" jdbcType="VARCHAR" />
-    <result column="task_status" property="task_status" jdbcType="INTEGER" />
-    <result column="create_date" property="create_date" jdbcType="TIMESTAMP" />
-    <result column="start_date" property="start_date" jdbcType="TIMESTAMP" />
-    <result column="end_date" property="end_date" jdbcType="TIMESTAMP" />
-    <result column="task_creator" property="task_creator" jdbcType="BIGINT" />
-    <result column="school_id" property="school_id" jdbcType="BIGINT" />
-    <result column="task_context" property="task_context" jdbcType="LONGVARCHAR" />
-    <result column="task_files" property="task_files" jdbcType="LONGVARCHAR" />
-    <result column="task_notifier" property="task_notifier" jdbcType="LONGVARCHAR" />
-    <result column="classz_name" property="classz_name" jdbcType="VARCHAR" />
-    <result column="grade_name" property="grade_name" jdbcType="VARCHAR" />
-    <result column="publish_date" property="publish_date" jdbcType="TIMESTAMP" />
-  </resultMap>
+<mapper namespace="com.usoftchina.smartschool.school.mapper.HomeWorkMapper">
+    <resultMap id="BaseResultMap" type="com.usoftchina.smartschool.school.po.HomeWork">
+        <id column="task_id" property="task_id" jdbcType="BIGINT"/>
+        <result column="subject_id" property="subject_id" jdbcType="BIGINT"/>
+        <result column="task_title" property="task_title" jdbcType="VARCHAR"/>
+        <result column="task_status" property="task_status" jdbcType="INTEGER"/>
+        <result column="create_date" property="create_date" jdbcType="TIMESTAMP"/>
+        <result column="start_date" property="start_date" jdbcType="TIMESTAMP"/>
+        <result column="end_date" property="end_date" jdbcType="TIMESTAMP"/>
+        <result column="task_creator" property="task_creator" jdbcType="BIGINT"/>
+        <result column="school_id" property="school_id" jdbcType="BIGINT"/>
+        <result column="task_context" property="task_context" jdbcType="LONGVARCHAR"/>
+        <result column="task_files" property="task_files" jdbcType="LONGVARCHAR"/>
+        <result column="task_notifier" property="task_notifier" jdbcType="LONGVARCHAR"/>
+        <result column="classz_name" property="classz_name" jdbcType="VARCHAR"/>
+        <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"/>
+    </resultMap>
 
-  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">
     select 
     *
     from task_notify
     where task_id = #{task_id,jdbcType=BIGINT}
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     delete from task_notify
     where task_id = #{task_id,jdbcType=BIGINT}
   </delete>
-  <insert id="insert" parameterType="com.usoftchina.smartschool.school.po.HomeWork" >
+    <insert id="insert" parameterType="com.usoftchina.smartschool.school.po.HomeWork">
     insert into task_notify (subject_id, task_title,
       task_status, create_date, start_date, 
       end_date, task_creator, school_id, 
       task_context, task_files, task_notifier,
-      classz_name, grade_name
+      classz_name, grade_name,creator
       )
     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}
+      #{task_title,jdbcType=VARCHAR},#{task_title,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR}
       )
   </insert>
-  <insert id="insertSelective" parameterType="com.usoftchina.smartschool.school.po.HomeWork" >
-    <selectKey  resultType="java.lang.Long" keyProperty="task_id">
-      SELECT LAST_INSERT_ID() AS ID
-    </selectKey>
-    insert into task_notify
-    <trim prefix="(" suffix=")" suffixOverrides="," >
-      <if test="subject_id != null" >
-        subject_id,
-      </if>
-      <if test="task_title != null" >
-        task_title,
-      </if>
-      <if test="task_status != null" >
-        task_status,
-      </if>
-      <if test="create_date != null" >
-        create_date,
-      </if>
-      <if test="start_date != null" >
-        start_date,
-      </if>
-      <if test="end_date != null" >
-        end_date,
-      </if>
-      <if test="task_creator != null" >
-        task_creator,
-      </if>
-      <if test="school_id != null" >
-        school_id,
-      </if>
-      <if test="task_context != null" >
-        task_context,
-      </if>
-      <if test="task_files != null" >
-        task_files,
-      </if>
-      <if test="task_notifier != null" >
-        task_notifier,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides="," >
-      <if test="subject_id != null" >
-        #{subject_id,jdbcType=BIGINT},
-      </if>
-      <if test="task_title != null" >
-        #{task_title,jdbcType=VARCHAR},
-      </if>
-      <if test="task_status != null" >
-        #{task_status,jdbcType=INTEGER},
-      </if>
-      <if test="create_date != null" >
-        #{create_date,jdbcType=TIMESTAMP},
-      </if>
-      <if test="start_date != null" >
-        #{start_date,jdbcType=TIMESTAMP},
-      </if>
-      <if test="end_date != null" >
-        #{end_date,jdbcType=TIMESTAMP},
-      </if>
-      <if test="task_creator != null" >
-        #{task_creator,jdbcType=BIGINT},
-      </if>
-      <if test="school_id != null" >
-        #{school_id,jdbcType=BIGINT},
-      </if>
-      <if test="task_context != null" >
-        #{task_context,jdbcType=LONGVARCHAR},
-      </if>
-      <if test="task_files != null" >
-        #{task_files,jdbcType=LONGVARCHAR},
-      </if>
-      <if test="task_notifier != null" >
-        #{task_notifier,jdbcType=LONGVARCHAR},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.smartschool.school.po.HomeWork" >
-    update task_notify
-    <set >
-      <if test="subject_id != null" >
-        subject_id = #{subject_id,jdbcType=BIGINT},
-      </if>
-      <if test="task_title != null" >
-        task_title = #{task_title,jdbcType=VARCHAR},
-      </if>
-      <if test="task_status != null" >
-        task_status = #{task_status,jdbcType=INTEGER},
-      </if>
-      <if test="create_date != null" >
-        create_date = #{create_date,jdbcType=TIMESTAMP},
-      </if>
-      <if test="start_date != null" >
-        start_date = #{start_date,jdbcType=TIMESTAMP},
-      </if>
-      <if test="end_date != null" >
-        end_date = #{end_date,jdbcType=TIMESTAMP},
-      </if>
-      <if test="task_creator != null" >
-        task_creator = #{task_creator,jdbcType=BIGINT},
-      </if>
-      <if test="school_id != null" >
-        school_id = #{school_id,jdbcType=BIGINT},
-      </if>
-      <if test="task_context != null" >
-        task_context = #{task_context,jdbcType=LONGVARCHAR},
-      </if>
-      <if test="task_files != null" >
-        task_files = #{task_files,jdbcType=LONGVARCHAR},
-      </if>
-      <if test="task_notifier != null" >
-        task_notifier = #{task_notifier,jdbcType=LONGVARCHAR},
-      </if>
-    </set>
-    where task_id = #{task_id,jdbcType=BIGINT}
-  </update>
-  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.smartschool.school.po.HomeWork" >
+    <insert id="insertSelective" parameterType="com.usoftchina.smartschool.school.po.HomeWork">
+        <selectKey resultType="java.lang.Long" keyProperty="task_id">
+            SELECT LAST_INSERT_ID() AS ID
+        </selectKey>
+        insert into task_notify
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="subject_id != null">
+                subject_id,
+            </if>
+            <if test="task_title != null">
+                task_title,
+            </if>
+            <if test="task_status != null">
+                task_status,
+            </if>
+            <if test="create_date != null">
+                create_date,
+            </if>
+            <if test="start_date != null">
+                start_date,
+            </if>
+            <if test="end_date != null">
+                end_date,
+            </if>
+            <if test="task_creator != null">
+                task_creator,
+            </if>
+            <if test="school_id != null">
+                school_id,
+            </if>
+            <if test="task_context != null">
+                task_context,
+            </if>
+            <if test="task_files != null">
+                task_files,
+            </if>
+            <if test="task_notifier != null">
+                task_notifier,
+            </if>
+            <if test="classz_name != null">
+                classz_name,
+            </if>
+            <if test="grade_name != null">
+                grade_name,
+            </if>
+            <if test="creator != null">
+                creator,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="subject_id != null">
+                #{subject_id,jdbcType=BIGINT},
+            </if>
+            <if test="task_title != null">
+                #{task_title,jdbcType=VARCHAR},
+            </if>
+            <if test="task_status != null">
+                #{task_status,jdbcType=INTEGER},
+            </if>
+            <if test="create_date != null">
+                #{create_date,jdbcType=TIMESTAMP},
+            </if>
+            <if test="start_date != null">
+                #{start_date,jdbcType=TIMESTAMP},
+            </if>
+            <if test="end_date != null">
+                #{end_date,jdbcType=TIMESTAMP},
+            </if>
+            <if test="task_creator != null">
+                #{task_creator,jdbcType=BIGINT},
+            </if>
+            <if test="school_id != null">
+                #{school_id,jdbcType=BIGINT},
+            </if>
+            <if test="task_context != null">
+                #{task_context,jdbcType=LONGVARCHAR},
+            </if>
+            <if test="task_files != null">
+                #{task_files,jdbcType=LONGVARCHAR},
+            </if>
+            <if test="task_notifier != null">
+                #{task_notifier,jdbcType=LONGVARCHAR},
+            </if>
+            <if test="classz_name != null">
+                #{classz_name,jdbcType=VARCHAR},
+            </if>
+            <if test="grade_name != null">
+                #{grade_name,jdbcType=VARCHAR},
+            </if>
+            <if test="creator != null">
+                #{creator,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.smartschool.school.po.HomeWork">
+        update task_notify
+        <set>
+            <if test="subject_id != null">
+                subject_id = #{subject_id,jdbcType=BIGINT},
+            </if>
+            <if test="task_title != null">
+                task_title = #{task_title,jdbcType=VARCHAR},
+            </if>
+            <if test="task_status != null">
+                task_status = #{task_status,jdbcType=INTEGER},
+            </if>
+            <if test="create_date != null">
+                create_date = #{create_date,jdbcType=TIMESTAMP},
+            </if>
+            <if test="start_date != null">
+                start_date = #{start_date,jdbcType=TIMESTAMP},
+            </if>
+            <if test="end_date != null">
+                end_date = #{end_date,jdbcType=TIMESTAMP},
+            </if>
+            <if test="task_creator != null">
+                task_creator = #{task_creator,jdbcType=BIGINT},
+            </if>
+            <if test="school_id != null">
+                school_id = #{school_id,jdbcType=BIGINT},
+            </if>
+            <if test="task_context != null">
+                task_context = #{task_context,jdbcType=LONGVARCHAR},
+            </if>
+            <if test="task_files != null">
+                task_files = #{task_files,jdbcType=LONGVARCHAR},
+            </if>
+            <if test="task_notifier != null">
+                task_notifier = #{task_notifier,jdbcType=LONGVARCHAR},
+            </if>
+            <if test="classz_name != null">
+                classz_name = #{classz_name,jdbcType=VARCHAR},
+            </if>
+            <if test="grade_name != null">
+                grade_name = #{grade_name,jdbcType=VARCHAR},
+            </if>
+            <if test="creator != null">
+                creator = #{creator,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where task_id = #{task_id,jdbcType=BIGINT}
+    </update>
+    <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.smartschool.school.po.HomeWork">
     update task_notify
     set subject_id = #{subject_id,jdbcType=BIGINT},
       task_title = #{task_title,jdbcType=VARCHAR},
@@ -170,10 +198,13 @@
       school_id = #{school_id,jdbcType=BIGINT},
       task_context = #{task_context,jdbcType=LONGVARCHAR},
       task_files = #{task_files,jdbcType=LONGVARCHAR},
-      task_notifier = #{task_notifier,jdbcType=LONGVARCHAR}
+      task_notifier = #{task_notifier,jdbcType=LONGVARCHAR},
+      classz_name = #{classz_name,jdbcType=VARCHAR},
+      grade_name = #{grade_name,jdbcType=VARCHAR},
+      creator = #{creator,jdbcType=VARCHAR}
     where task_id = #{task_id,jdbcType=BIGINT}
   </update>
-  <update id="updateByPrimaryKey" parameterType="com.usoftchina.smartschool.school.po.HomeWork" >
+    <update id="updateByPrimaryKey" parameterType="com.usoftchina.smartschool.school.po.HomeWork">
     update task_notify
     set subject_id = #{subject_id,jdbcType=BIGINT},
       task_title = #{task_title,jdbcType=VARCHAR},
@@ -186,19 +217,19 @@
     where task_id = #{task_id,jdbcType=BIGINT}
   </update>
 
-  <select id="selectByConditon" resultMap="BaseResultMap">
-    select * from task_notify
-    <where>
-      <if test="con != null">
-        ${con}
-      </if>
-      <if test="school_id != null">
-        and school_id=#{school_id}
-      </if>
-    </where>
-    ORDER BY task_id DESC
-  </select>
-  <update id="updateByPublish" parameterType="java.lang.Long">
+    <select id="selectByConditon" resultMap="BaseResultMap">
+        select * from task_notify
+        <where>
+            <if test="con != null">
+                ${con}
+            </if>
+            <if test="school_id != null">
+                and school_id=#{school_id}
+            </if>
+        </where>
+        ORDER BY task_id DESC
+    </select>
+    <update id="updateByPublish" parameterType="java.lang.Long">
     update task_notify
     set task_status = 1 ,
       publish_date = now()

+ 15 - 3
applications/school/school-server/src/main/resources/mapper/NotifyMapper.xml

@@ -15,6 +15,7 @@
     <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" >
     select *
@@ -29,12 +30,13 @@
     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
+      notify_files, notify_teacher, notify_stu, creator
       )
     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}
+      #{notify_files,jdbcType=LONGVARCHAR}, #{notify_teacher,jdbcType=LONGVARCHAR}, #{notify_stu,jdbcType=LONGVARCHAR},
+      #{creator,jdbcType=VARCHAR}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.smartschool.school.po.Notify" >
@@ -76,6 +78,9 @@
       <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" >
@@ -111,6 +116,9 @@
       <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" >
@@ -149,6 +157,9 @@
       <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>
@@ -164,7 +175,8 @@
       notify_details = #{notify_details,jdbcType=LONGVARCHAR},
       notify_files = #{notify_files,jdbcType=LONGVARCHAR},
       notify_teacher = #{notify_teacher,jdbcType=LONGVARCHAR},
-      notify_stu = #{notify_stu,jdbcType=LONGVARCHAR}
+      notify_stu = #{notify_stu,jdbcType=LONGVARCHAR},
+      creator = #{creator,jdbcType=VARCHAR}
     where notify_id = #{notify_id,jdbcType=BIGINT}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.usoftchina.smartschool.school.po.Notify" >

+ 23 - 8
applications/school/school-server/src/main/resources/mapper/OutInRecordMapper.xml

@@ -8,16 +8,22 @@
     <result column="in_date" property="in_date" jdbcType="TIMESTAMP" />
     <result column="record_details" property="record_details" jdbcType="VARCHAR" />
     <result column="record_remarks" property="record_remarks" jdbcType="VARCHAR" />
+    <result column="device_id" property="device_id" jdbcType="BIGINT" />
     <result column="stu_id" property="stu_id" jdbcType="BIGINT" />
     <result column="school_id" property="school_id" jdbcType="BIGINT" />
-    <result column="clazz_name" property="clazz_name" jdbcType="VARCHAR"/>
-    <result column="stu_name" property="stu_name" jdbcType="VARCHAR"/>
     <result column="stu_sex" property="stu_sex" jdbcType="INTEGER"/>
     <result column="stu_number" property="stu_number" jdbcType="VARCHAR"/>
+    <result column="stu_name" property="stu_name" jdbcType="VARCHAR"/>
+    <result column="grade_id" property="grade_id" jdbcType="BIGINT" />
+    <result column="grade_name" property="grade_name" jdbcType="VARCHAR"/>
+    <result column="clazz_id" property="clazz_id" jdbcType="BIGINT" />
+    <result column="clazz_name" property="clazz_name" jdbcType="VARCHAR"/>
+    <result column="grade_clazz" property="grade_clazz" jdbcType="VARCHAR"/>
   </resultMap>
   <sql id="Base_Column_List" >
-    record_id, record_name, out_date, in_date, record_details, record_remarks,
-    stu_id, school_id
+    record_id, record_name, out_date, in_date, record_details, record_remarks,device_id,
+    stu_id, school_id, stu_sex, stu_number, stu_name, grade_id, grade_name,
+    clazz_id, clazz_name, grade_clazz
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
     select 
@@ -31,10 +37,14 @@
   </delete>
   <insert id="insert" parameterType="com.usoftchina.smartschool.school.po.OutInRecord" >
     insert into out_in_record (record_id, record_name, out_date, 
-      in_date, record_details, record_remarks, stu_id, school_id
+      in_date, record_details, record_remarks, device_id, stu_id, school_id,
+      stu_sex, stu_number, stu_name, grade_id, grade_name,clazz_id, clazz_name, grade_clazz
       )
     values (#{record_id,jdbcType=BIGINT}, #{record_name,jdbcType=VARCHAR}, #{out_date,jdbcType=TIMESTAMP}, 
-      #{in_date,jdbcType=TIMESTAMP}, #{record_details,jdbcType=VARCHAR}, #{record_remarks,jdbcType=VARCHAR},#{stu_id,jdbcType=BIGINT}, #{school_id,jdbcType=BIGINT}
+      #{in_date,jdbcType=TIMESTAMP}, #{record_details,jdbcType=VARCHAR}, #{record_remarks,jdbcType=VARCHAR}, #{device_id,jdbcType=BIGINT},
+      #{stu_id,jdbcType=BIGINT}, #{school_id,jdbcType=BIGINT}, #{stu_sex,jdbcType=INTEGER}, #{stu_number,jdbcType=VARCHAR},
+      #{stu_name,jdbcType=VARCHAR}, #{grade_id,jdbcType=BIGINT}, #{grade_name,jdbcType=VARCHAR}, #{clazz_id,jdbcType=BIGINT},
+      #{clazz_name,jdbcType=VARCHAR}, #{grade_clazz,jdbcType=VARCHAR}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.usoftchina.smartschool.school.po.OutInRecord" >
@@ -58,6 +68,9 @@
       <if test="record_remarks != null" >
         record_remarks,
       </if>
+      <if test="device_id != null" >
+        device_id,
+      </if>
       <if test="stu_id != null" >
         stu_id,
       </if>
@@ -84,6 +97,9 @@
       <if test="record_remarks != null" >
         #{record_remarks,jdbcType=VARCHAR},
       </if>
+      <if test="device_id != null" >
+        #{device_id,jdbcType=BIGINT},
+      </if>
       <if test="stu_id != null" >
         #{stu_id,jdbcType=BIGINT},
       </if>
@@ -132,8 +148,7 @@
   </update>
 
   <select id="selectByConditon" resultMap="BaseResultMap">
-    select * from out_in_record left join sys_student on out_in_record.stu_id = sys_student.stu_id
-    left join sys_clazz on sys_student.clazz_id = sys_clazz.clazz_id
+    select * from out_in_record
     <where>
       <if test="con != null">
         ${con}

+ 40 - 11
applications/school/school-server/src/main/resources/mapper/PrincipalMailboxMapper.xml

@@ -1,18 +1,25 @@
 <?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.PrincipalMailboxMapper" >
-  <resultMap id="BaseResultMap" type="com.usoftchina.smartschool.school.po.PrincipalMailboxDO" >
-    <id column="mailbox_id" property="mailboxId" jdbcType="BIGINT" />
-    <result column="mailbox_title" property="mailboxTitle" jdbcType="VARCHAR" />
-    <result column="is_anonymity" property="isAnonymity" jdbcType="INTEGER" />
-    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
-    <result column="mailbox_creator" property="mailboxCreator" jdbcType="BIGINT" />
-    <result column="read_date" property="readDate" jdbcType="TIMESTAMP" />
-    <result column="mailbox_status" property="mailboxStatus" jdbcType="INTEGER" />
+  <resultMap id="BaseResultMap" type="com.usoftchina.smartschool.school.po.PrincipalMail" >
+    <id column="mailbox_id" property="mailbox_id" jdbcType="BIGINT" />
+    <result column="mailbox_title" property="mailbox_title" jdbcType="VARCHAR" />
+    <result column="is_anonymity" property="is_anonymity" jdbcType="INTEGER" />
+    <result column="create_date" property="create_date" jdbcType="TIMESTAMP" />
+    <result column="mailbox_creator" property="mailbox_creator" jdbcType="BIGINT" />
+    <result column="read_date" property="read_date" jdbcType="TIMESTAMP" />
+    <result column="mailbox_status" property="mailbox_status" jdbcType="INTEGER" />
     <result column="notifier" property="notifier" jdbcType="BIGINT" />
-    <result column="school_id" property="schoolId" jdbcType="BIGINT" />
-    <result column="mailbox_context" property="mailboxContext" jdbcType="LONGVARCHAR" />
-    <result column="mailbox_files" property="mailboxFiles" jdbcType="LONGVARCHAR" />
+    <result column="school_id" property="school_id" jdbcType="BIGINT" />
+    <result column="mb_stuid" property="mb_stuid" jdbcType="BIGINT" />
+    <result column="mb_student" property="mb_student" jdbcType="VARCHAR" />
+    <result column="mb_grade" property="mb_grade" jdbcType="VARCHAR" />
+    <result column="mb_class" property="mb_class" jdbcType="VARCHAR" />
+    <result column="mb_ignore" property="mb_ignore" jdbcType="INTEGER" />
+    <result column="mailbox_context" property="mailbox_context" jdbcType="LONGVARCHAR" />
+    <result column="mailbox_files" property="mailbox_files" jdbcType="LONGVARCHAR" />
+    <result column="mb_reply" property="mb_reply" jdbcType="LONGVARCHAR" />
+    <result column="mb_creatorname" property="mb_creatorname" jdbcType="VARCHAR"/>
   </resultMap>
 
   <select id="selectByConditon" resultMap="BaseResultMap">
@@ -33,4 +40,26 @@
     where mailbox_id = #{mailbox_id,jdbcType=BIGINT}
   </delete>
 
+  <update id="batchIgnore" parameterType="com.usoftchina.smartschool.school.dto.DocBaseDTO">
+    <foreach collection="list" item="item" index="index" open="" close="" separator=";">
+      update principal_mailbox set mb_ignore = 1 where mailbox_id = #{item.id}
+    </foreach>
+  </update>
+
+
+  <update id="batchUnIgnore" parameterType="com.usoftchina.smartschool.school.dto.DocBaseDTO">
+    <foreach collection="list" item="item" index="index" open="" close="" separator=";">
+      update principal_mailbox set mb_ignore = 0 where mailbox_id = #{item.id}
+    </foreach>
+  </update>
+  
+  <update id="updateReply">
+    update principal_mailbox set mailbox_status=3,mb_reply=#{msg} where mailbox_id=#{id}
+  </update>
+
+  <insert id="insertDetail" parameterType="com.usoftchina.smartschool.school.po.PrincipalReplyDO">
+    insert into principal_reply (mailbox_id,reply_content,reply_date)
+    values (#{mailboxId,jdbcType=BIGINT}, #{replyContent,jdbcType=VARCHAR}, #{replyDate,jdbcType=TIMESTAMP})
+  </insert>
+
 </mapper>

+ 10 - 3
applications/school/school-server/src/main/resources/mapper/SysStudentMapper.xml

@@ -297,6 +297,7 @@
     <result column="parents_remarks" property="parents_remarks" jdbcType="VARCHAR" />
     <result column="ps_relation" property="ps_relation" jdbcType="VARCHAR" />
     <result column="parent_stu_id" property="parent_stu_id" jdbcType="BIGINT" />
+    <result property="pa_phone" column="pa_phone" jdbcType="VARCHAR"/>
   </resultMap>
   <resultMap id="ResultMapWithBLOBs" type="com.usoftchina.smartschool.school.po.SysParents" extends="parentMap" >
     <result column="parents_photo" property="parents_photo" jdbcType="LONGVARCHAR" />
@@ -346,6 +347,9 @@
       <if test="parents_remarks != null" >
         parents_remarks,
       </if>
+      <if test="pa_phone != null" >
+        pa_phone,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="user_id != null" >
@@ -381,24 +385,27 @@
       <if test="parents_remarks != null" >
         #{parents_remarks,jdbcType=VARCHAR},
       </if>
+      <if test="pa_phone != null" >
+        #{pa_phone,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
 
   <insert id="insertrelation">
-    insert into sys_parents_stu (stu_id,parent_id) VALUES (#{id},#{pr_id})
+    insert into sys_parents_stu (stu_id,parent_id,ps_relation) VALUES (#{id},#{pr_id},#{relation})
   </insert>
 
   <update id="updateParents" parameterType="com.usoftchina.smartschool.school.po.SysParents" >
     <foreach collection="list" item="item" index="index" open="" close="" separator=";">
       update sys_parents <set>
-      parents_name = #{item.parents_name,jdbcType=VARCHAR}
+      parents_name = #{item.parents_name,jdbcType=VARCHAR},pa_phone = #{item.pa_phone,jdbcType=VARCHAR}
     </set>
       where parent_id = #{item.parent_id,jdbcType=BIGINT}
     </foreach>
   </update>
 
   <update id="updateRelation">
-    update sys_parents_stu set ps_relation=#{relation} where parent_id=#{parent_id} and stu_id =#{id}
+    update sys_parents_stu set ps_relation=#{relation} where parent_stu_id =#{id}
   </update>
 
   <select id="selectByCode" resultMap="BaseResultMap">

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

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

@@ -93,7 +93,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())

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

+ 9 - 2
frontend/pc-web/app/Application.js

@@ -11,10 +11,17 @@ Ext.define('school.Application', {
 
     mainView: 'school.view.viewport.Viewport',
 
+    stores: [
+        // TODO: add global / shared stores here
+        'school.store.Grade',
+        'school.store.Class',
+        'school.store.Subject'
+    ],
+
     defaultToken: 'main',
 
-    launch: function(profile) {
+    launch: function (profile) {
         Ext.getBody().removeCls('launching');
         this.callParent([profile]);
     }
-});
+});

+ 3 - 0
frontend/pc-web/app/model/Session.js

@@ -12,6 +12,9 @@ Ext.define('school.model.Session', {
     statics: {
         login: function(username, password) {
             return new Ext.Promise(function (resolve, reject) {
+                Ext.getCmp('rootView').getController().setRequestToken(null);
+                Ext.getCmp('rootView').getController().saveSession(null);
+
 				Ext.Ajax.request({
                     // url: 'http://10.1.80.23:9520/api/auth/authorize',
                     url: '/api/auth/authorize',

+ 2 - 2
frontend/pc-web/app/model/Subject.js

@@ -4,10 +4,10 @@
 Ext.define('school.model.Subject', {
     extend: 'school.model.Base',
     fields: [{
-        name: 'code', // 学科代码
+        name: 'subject_id', // 学科代码
         type: 'string'
     }, {
-        name: 'name', // 学科名称
+        name: 'subject_name', // 学科名称
         type: 'string'
     }]
 });

+ 7 - 7
frontend/pc-web/app/model/Timetable.js

@@ -4,19 +4,19 @@
 Ext.define('school.model.Timetable', {
     extend: 'school.model.Base',
     fields: [{
-        name: 'mon', type: 'string'
+        name: 'mon', type: 'int'
     }, {
-        name: 'tues', type: 'string'
+        name: 'tues', type: 'int'
     }, {
-        name: 'wed', type: 'string'
+        name: 'wed', type: 'int'
     }, {
-        name: 'thur', type: 'string'
+        name: 'thur', type: 'int'
     }, {
-        name: 'fri', type: 'string'
+        name: 'fri', type: 'int'
     }, {
-        name: 'sat', type: 'string'
+        name: 'sat', type: 'int'
     }, {
-        name: 'sunday', type: 'string'
+        name: 'sunday', type: 'int'
     }, {
         name: 'startTime', type: 'string',
     }, {

+ 12 - 0
frontend/pc-web/app/store/Class.js

@@ -0,0 +1,12 @@
+/**
+ * 班级
+ */
+Ext.define('school.store.Class', {
+    extend: 'Ext.data.Store',
+    alias: 'store.store_class',
+
+    storeId: 'store_class',
+
+    fields: ['name', 'value'],
+    data: []
+});

+ 5 - 3
frontend/pc-web/app/store/Grade.js

@@ -1,11 +1,13 @@
 /**
- * 学科
+ * 年级
  */
 Ext.define('school.store.Grade', {
     extend: 'Ext.data.Store',
-    alias: 'store.subject',
+    alias: 'store.store_grade',
 
-    model: 'school.model.Grade',
+    storeId: 'store_grade',
+
+    fields: ['name', 'value'],
 
     data: []
 });

+ 59 - 47
frontend/pc-web/app/store/Subject.js

@@ -3,54 +3,66 @@
  */
 Ext.define('school.store.Subject', {
     extend: 'Ext.data.Store',
-    alias: 'store.subject',
+    alias: 'store.store_subject',
+    storeId: 'store_subject',
 
     model: 'school.model.Subject',
+    autoLoad: false,
+    proxy: {
+        type: 'ajax',
+        url: '/api/school/subject/list',
+        reader: {
+            type: 'json',
+            rootProperty: 'data.list'
+        }
+    },
+    // fields: ['subject_id', 'subject_name'],
+    // data: []
 
-    data: [{
-        code: '1',
-        name: '语文'
-    }, {
-        code: '2',
-        name: '数学'
-    }, {
-        code: '3',
-        name: '英语'
-    }, {
-        code: '4',
-        name: '物理'
-    }, {
-        code: '5',
-        name: '化学'
-    }, {
-        code: '6',
-        name: '生物'
-    }, {
-        code: '7',
-        name: '政治'
-    }, {
-        code: '8',
-        name: '历史'
-    }, {
-        code: '9',
-        name: '地理'
-    }, {
-        code: '10',
-        name: '体育'
-    }, {
-        code: '11',
-        name: '书法'
-    }, {
-        code: '12',
-        name: '美工'
-    }, {
-        code: '13',
-        name: '画画'
-    }, {
-        code: '14',
-        name: '自然'
-    }, {
-        code: '15',
-        name: '思想品德'
-    }]
+    // data: [{
+    //     code: '1',
+    //     name: '语文'
+    // }, {
+    //     code: '2',
+    //     name: '数学'
+    // }, {
+    //     code: '3',
+    //     name: '英语'
+    // }, {
+    //     code: '4',
+    //     name: '物理'
+    // }, {
+    //     code: '5',
+    //     name: '化学'
+    // }, {
+    //     code: '6',
+    //     name: '生物'
+    // }, {
+    //     code: '7',
+    //     name: '政治'
+    // }, {
+    //     code: '8',
+    //     name: '历史'
+    // }, {
+    //     code: '9',
+    //     name: '地理'
+    // }, {
+    //     code: '10',
+    //     name: '体育'
+    // }, {
+    //     code: '11',
+    //     name: '书法'
+    // }, {
+    //     code: '12',
+    //     name: '美工'
+    // }, {
+    //     code: '13',
+    //     name: '画画'
+    // }, {
+    //     code: '14',
+    //     name: '自然'
+    // }, {
+    //     code: '15',
+    //     name: '思想品德'
+    // }]
 });

+ 37 - 69
frontend/pc-web/app/view/Interaction/access/List.js

@@ -5,6 +5,7 @@ Ext.define('school.view.interaction.access.List', {
     extend: 'school.view.core.base.BasePanel',
     xtype: 'interaction-access-list',
 
+    // dataUrl: 'http://10.1.80.180:9520/api/school/record/list',
     dataUrl: '/api/school/record/list',
     initComponent: function () {
         var me = this;
@@ -13,6 +14,39 @@ Ext.define('school.view.interaction.access.List', {
                 xtype: 'textfield',
                 name: 'keyword',
                 fieldLabel: '姓名'
+            }, {
+                xtype: 'gradecombo',
+                name: 'grade_name',
+                fieldLabel: '年级',
+                listeners: {
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('clazz_name').setValue(null);
+                    }
+                }
+            }, {
+                xtype: 'classcombo',
+                name: 'clazz_name',
+                fieldLabel: '班级',
+                listeners: {
+                    expand: function (combo, eOpts) {
+                        combo.store.clearFilter();
+
+                        var gradeCombo = combo.up('form').getForm().findField('grade_name');
+                        var gradeName = gradeCombo.getValue();
+
+                        var filter = new Ext.util.Filter({
+                            property: 'gradeName',
+                            value: gradeName
+                        });
+
+                        if (!!gradeName) {
+                            combo.store.setFilters([filter]);
+                        }
+                    },
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('grade_name').setValue(record.get('gradeName'));
+                    }
+                }
             }],
 
             caller: null,
@@ -33,12 +67,10 @@ Ext.define('school.view.interaction.access.List', {
                 totalProperty: 'data.total',
                 actionColumn: [],
                 selModel: {
-                    checkOnly: true,
-                    type: 'checkboxmodel',
-                    mode: "MULTI",
-                    ignoreRightMouseSelection: false
+                    type: 'cellmodel'
                 },
                 hiddenTools: true,
+                disableDetail: true,
                 toolBtns: [],
                 columns: [{
                     text: 'id',
@@ -76,69 +108,5 @@ Ext.define('school.view.interaction.access.List', {
             },
         });
         this.callParent(arguments);
-    },
-
-    /**
-     * 处理部分字段值
-     */
-    getConditionValue: function (field, value) {
-        var me = this,
-            xtypes = field.getXTypes().split('/'),
-            conditionValue;
-        if (me.isContainsAny(xtypes, ['datefield'])) {
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
-        } else if (me.isContainsAny(xtypes, ['conmonthfield'])) {
-            var from = value.from,
-                to = value.to;
-
-            conditionValue = from + ',' + to;
-        } else if (me.isContainsAny(xtypes, ['condatefield'])) {
-            var from = value.from,
-                to = value.to;
-
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
-        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
-            conditionValue = value;
-        } else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
-            conditionValue = value;
-        } else if (me.isContainsAny(xtypes, ['multicombo'])) {
-            conditionValue = value.map ? value.map(function (v) {
-                return v.value;
-            }).join(',') : '';
-        } else {
-            conditionValue = value;
-        }
-
-        return conditionValue;
-    },
-
-    getExtraParams: function (store, op, condition) {
-        var temp = {};
-
-        for (let x = 0; x < condition.length; x++) {
-            let c = condition[x];
-            if (c.field == 'keyword') {
-                temp.keyword = c.value;
-            } else if (c.field == 'date') {
-                temp.fromDate = new Date(c.value.split(',')[0]).getTime();
-                temp.endDate = new Date(c.value.split(',')[1]).getTime();
-            } else if (c.field == 'quoted') {
-                temp.quoted = c.value == 'all' ? null : c.value;
-            } else if (c.field == 'closed') {
-                // temp.endDate = c.value == 'all' ? null : (
-                //     c.value == '0' ? 
-                // );
-            }
-        }
-        let obj = {
-            pageNumber: store.exportNumber ? store.exportNumber : op._page,
-            pageSize: store.exportPageSize ? store.exportPageSize : store.pageSize
-        };
-        for (let k in temp) {
-            if (!!temp[k]) {
-                obj[k] = temp[k];
-            }
-        }
-        return obj;
-    },
+    }
 });

+ 56 - 91
frontend/pc-web/app/view/Interaction/homework/List.js

@@ -5,7 +5,7 @@ Ext.define('school.view.interaction.homework.List', {
     extend: 'school.view.core.base.BasePanel',
     xtype: 'interaction-homework-list',
 
-    // dataUrl: 'http://10.1.80.47:9560/homework/list',
+    // dataUrl: 'http://10.1.80.180:9520/api/school/homework/list',
     dataUrl: '/api/school/homework/list',
     _title: '作业发布',
 
@@ -20,12 +20,41 @@ Ext.define('school.view.interaction.homework.List', {
                     return ' (task_title like\'%' + value + '%\' or task_context like \'%' + value + '%\') ';
                 }
             }, {
-                xtype: 'textfield',
-                name: 'bj',
-                fieldLabel: '班级'
+                xtype: 'gradecombo',
+                name: 'grade_name',
+                fieldLabel: '年级',
+                listeners: {
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('classz_name').setValue(null);
+                    }
+                }
+            }, {
+                xtype: 'classcombo',
+                name: 'classz_name',
+                fieldLabel: '班级',
+                listeners: {
+                    expand: function (combo, eOpts) {
+                        combo.store.clearFilter();
+
+                        var gradeCombo = combo.up('form').getForm().findField('grade_name');
+                        var gradeName = gradeCombo.getValue();
+
+                        var filter = new Ext.util.Filter({
+                            property: 'gradeName',
+                            value: gradeName
+                        });
+
+                        if (!!gradeName) {
+                            combo.store.setFilters([filter]);
+                        }
+                    },
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('grade_name').setValue(record.get('gradeName'));
+                    }
+                }
             }, {
                 xtype: 'textfield',
-                name: 'task_creator',
+                name: 'creator',
                 fieldLabel: '发布人'
             }, {
                 xtype: 'combobox',
@@ -43,18 +72,18 @@ Ext.define('school.view.interaction.homework.List', {
                 }),
                 minChars: 0,
                 queryMode: 'local'
-            }, {
-                xtype: 'condatefield',
-                name: 'publish_date',
-                fieldLabel: '发布时间',
-                columnWidth: 0.5
+            // }, {
+            //     xtype: 'condatefield',
+            //     name: 'publish_date',
+            //     fieldLabel: '发布时间',
+            //     columnWidth: 0.5
             }],
 
             gridConfig: {
                 addTitle: '作业发布',
                 addXtype: 'interaction-homework-release',
                 idField: 'task_id',
-                codeField: null,
+                codeField: 'task_title',
                 dataUrl: me.dataUrl,
                 caller: null,
                 rootProperty: 'data.list',
@@ -68,6 +97,12 @@ Ext.define('school.view.interaction.homework.List', {
                 },
                 hiddenTools: false,
                 toolBtns: [{
+                    xtype: 'button',
+                    text: '新增',
+                    handler: function () {
+                        school.util.BaseUtil.openTab('interaction-homework-release', '新增作业', 'interaction-homework-release-add');
+                    }
+                }, {
                     xtype: 'button',
                     text: '删除',
                     handler: function () {
@@ -103,12 +138,6 @@ Ext.define('school.view.interaction.homework.List', {
                             school.util.BaseUtil.showErrorToast('删除失败: ' + e.message);
                         });
                     }
-                }, {
-                    xtype: 'button',
-                    text: '新增',
-                    handler: function () {
-                        school.util.BaseUtil.openTab('interaction-homework-release', '新增作业', 'interaction-homework-release-add');
-                    }
                 }],
                 columns: [{
                     text: 'id',
@@ -124,22 +153,22 @@ Ext.define('school.view.interaction.homework.List', {
                     text: '标题',
                     dataIndex: 'task_title',
                     width: 120,
-                    tdCls: 'x-detail-column',
-                    listeners: {
-                        click: function (view, td, row, col, e, record, tr, eOpts, event) {
-                            let gridConfig = me.gridConfig;
-                            school.util.BaseUtil.openTab(gridConfig.addXtype, gridConfig.addTitle + '(' + record.get('task_title') + ')', gridConfig.addXtype + '-' + record.get(gridConfig.idField), {
-                                initId: record.get(gridConfig.idField)
-                            });
-                        }
-                    }
+                    // tdCls: 'x-detail-column',
+                    // listeners: {
+                    //     click: function (view, td, row, col, e, record, tr, eOpts, event) {
+                    //         let gridConfig = me.gridConfig;
+                    //         school.util.BaseUtil.openTab(gridConfig.addXtype, gridConfig.addTitle + '(' + record.get('task_title') + ')', gridConfig.addXtype + '-' + record.get(gridConfig.idField), {
+                    //             initId: record.get(gridConfig.idField)
+                    //         });
+                    //     }
+                    // }
                 }, {
                     text: '内容',
                     dataIndex: 'task_context',
                     width: 300
                 }, {
                     text: '发布人',
-                    dataIndex: 'task_creator',
+                    dataIndex: 'creator',
                     width: 150
                 }, {
                     text: '发布状态',
@@ -156,69 +185,5 @@ Ext.define('school.view.interaction.homework.List', {
             },
         });
         this.callParent(arguments);
-    },
-
-    /**
-     * 处理部分字段值
-     */
-    getConditionValue: function (field, value) {
-        var me = this,
-            xtypes = field.getXTypes().split('/'),
-            conditionValue;
-        if (me.isContainsAny(xtypes, ['datefield'])) {
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
-        } else if (me.isContainsAny(xtypes, ['conmonthfield'])) {
-            var from = value.from,
-                to = value.to;
-
-            conditionValue = from + ',' + to;
-        } else if (me.isContainsAny(xtypes, ['condatefield'])) {
-            var from = value.from,
-                to = value.to;
-
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
-        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
-            conditionValue = value;
-        } else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
-            conditionValue = value;
-        } else if (me.isContainsAny(xtypes, ['multicombo'])) {
-            conditionValue = value.map ? value.map(function (v) {
-                return v.value;
-            }).join(',') : '';
-        } else {
-            conditionValue = value;
-        }
-
-        return conditionValue;
-    },
-
-    getExtraParams: function (store, op, condition) {
-        var temp = {};
-
-        for (let x = 0; x < condition.length; x++) {
-            let c = condition[x];
-            if (c.field == 'keyword') {
-                temp.keyword = c.value;
-            } else if (c.field == 'date') {
-                temp.fromDate = new Date(c.value.split(',')[0]).getTime();
-                temp.endDate = new Date(c.value.split(',')[1]).getTime();
-            } else if (c.field == 'quoted') {
-                temp.quoted = c.value == 'all' ? null : c.value;
-            } else if (c.field == 'closed') {
-                // temp.endDate = c.value == 'all' ? null : (
-                //     c.value == '0' ? 
-                // );
-            }
-        }
-        let obj = {
-            pageNumber: store.exportNumber ? store.exportNumber : op._page,
-            pageSize: store.exportPageSize ? store.exportPageSize : store.pageSize
-        };
-        for (let k in temp) {
-            if (!!temp[k]) {
-                obj[k] = temp[k];
-            }
-        }
-        return obj;
     }
 });

+ 54 - 16
frontend/pc-web/app/view/Interaction/homework/Release.js

@@ -12,9 +12,9 @@ Ext.define('school.view.interaction.homework.Release', {
     _title: '作业发布',
     _idField: 'task_id',
     _codeField: null,
-    // _readUrl: 'http://10.1.80.47:9560/homework/read',
+    // _readUrl: 'http://10.1.80.180:9520/api/school/homework/read',
     _readUrl: '/api/school/homework/read',
-    // _saveUrl: 'http://10.1.80.47:9560/homework/save',
+    // _saveUrl: 'http://10.1.80.180:9520/api/school/homework/save',
     _saveUrl: '/api/school/homework/save',
     _deleteUrl: '/api/school/homework/delete',
     initId: 0,
@@ -27,32 +27,60 @@ Ext.define('school.view.interaction.homework.Release', {
             }, {
                 xtype: "textfield",
                 name: "task_creator",
+                fieldLabel: "发布人id",
+                defaultValue: school.util.BaseUtil.getCurrentUser().id,
+                hidden: true
+            }, {
+                xtype: "textfield",
+                name: "creator",
                 fieldLabel: "发布人",
-                columnWidth: 0.5
+                defaultValue: school.util.BaseUtil.getCurrentUser().username,
+                readOnly: true
             }, {
-                xtype: 'textfield',
+                xtype: 'gradecombo',
                 name: 'grade_name',
-                fieldLabel: '年级'
+                fieldLabel: '年级',
+                listeners: {
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('classz_name').setValue(null);
+                    }
+                },
+                allowBlank: false
             }, {
-                xtype: 'textfield',
+                xtype: 'classcombo',
                 name: 'classz_name',
-                fieldLabel: '班级'
+                fieldLabel: '班级',
+                listeners: {
+                    expand: function (combo, eOpts) {
+                        combo.store.clearFilter();
+
+                        var gradeCombo = combo.up('form').getForm().findField('grade_name');
+                        var gradeName = gradeCombo.getValue();
+
+                        var filter = new Ext.util.Filter({
+                            property: 'gradeName',
+                            value: gradeName
+                        });
+
+                        if (!!gradeName) {
+                            combo.store.setFilters([filter]);
+                        }
+                    },
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('grade_name').setValue(record.get('gradeName'));
+                    }
+                },
+                allowBlank: false
             }, {
                 xtype: 'datefield',
                 name: 'start_date',
                 fieldLabel: '开始时间',
-                columnWidth: 0.5,
                 defaultValue: new Date()
             }, {
                 xtype: 'datefield',
                 name: 'end_date',
                 fieldLabel: '截止时间',
-                columnWidth: 0.5
-            }, {
-                xtype: "textfield",
-                name: "task_title",
-                fieldLabel: "标题",
-                columnWidth: 1
+                allowBlank: false
             }, {
                 xtype: 'combobox',
                 name: 'task_status',
@@ -73,13 +101,22 @@ Ext.define('school.view.interaction.homework.Release', {
                 name: 'publish_date',
                 fieldLabel: '发布时间',
                 readOnly: true,
-                format: 'Y-m-d H:i:s'
+                format: 'Y-m-d H:i:s',
+                defaultValue: new Date(),
+                readOnly: true
+            }, {
+                xtype: "textfield",
+                name: "task_title",
+                fieldLabel: "标题",
+                columnWidth: 1,
+                allowBlank: false
             }, {
                 xtype: "textareafield",
                 name: 'task_context',
                 fieldLabel: "内容",
                 columnWidth: 1,
-                height: 250
+                height: 250,
+                allowBlank: false
             }, {
                 xtype: 'textfield',
                 name: 'fj',
@@ -88,6 +125,7 @@ Ext.define('school.view.interaction.homework.Release', {
             toolBtns: [{
                 xtype: 'button',
                 text: '发布',
+                hidden: true,
                 bind: {
                     hidden: '{!task_id}'
                 },

+ 132 - 77
frontend/pc-web/app/view/Interaction/mailbox/List.js

@@ -5,6 +5,9 @@ Ext.define('school.view.interaction.mailbox.List', {
     extend: 'school.view.core.base.BasePanel',
     xtype: 'interaction-mailbox-list',
 
+    controller: 'interaction-mailbox-list',
+
+    // dataUrl: 'http://10.1.80.47:9520/api/school/principal/list',
     dataUrl: '/api/school/principal/list',
     initComponent: function() {
         var me = this;
@@ -12,11 +15,80 @@ Ext.define('school.view.interaction.mailbox.List', {
             searchField: [{
                 xtype: 'textfield',
                 name: 'keyword',
-                fieldLabel: '关键字'
+                fieldLabel: '关键字',
+                getCondition: function (value) {
+                    return ' (mailbox_title like\'%' + value + '%\' or mailbox_context like \'%' + value + '%\') ';
+                }
+            }, {
+                xtype: 'gradecombo',
+                name: 'mb_grade',
+                fieldLabel: '年级',
+                listeners: {
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('mb_class').setValue(null);
+                    }
+                }
+            }, {
+                xtype: 'classcombo',
+                name: 'mb_class',
+                fieldLabel: '班级',
+                listeners: {
+                    expand: function (combo, eOpts) {
+                        combo.store.clearFilter();
+
+                        var gradeCombo = combo.up('form').getForm().findField('mb_grade');
+                        var gradeName = gradeCombo.getValue();
+
+                        var filter = new Ext.util.Filter({
+                            property: 'gradeName',
+                            value: gradeName
+                        });
+
+                        if (!!gradeName) {
+                            combo.store.setFilters([filter]);
+                        }
+                    },
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('mb_grade').setValue(record.get('gradeName'));
+                    }
+                }
+            }, {
+                xtype: 'combobox',
+                fieldLabel: '回复状态',
+                name: 'mb_reply',
+                displayField: 'name',
+                valueField: 'value',
+                editable: true,
+                store: Ext.create('Ext.data.ArrayStore', {
+                    fields: ['name', 'value'],
+                    data: [['已回复', 3], ['未回复', 0]]
+                }),
+                minChars: 0,
+                queryMode: 'local',
+                getCondition: function(v) {
+                    return v == 3 ? ('mailbox_status = 3') : ('mailbox_status != 3 or mailbox_status is null')
+                }
+            }, {
+                xtype: 'combobox',
+                fieldLabel: '忽略状态',
+                name: 'mb_ignore',
+                displayField: 'name',
+                valueField: 'value',
+                editable: false,
+                value: '0',
+                store: Ext.create('Ext.data.ArrayStore', {
+                    fields: ['name', 'value'],
+                    data: [['已忽略', 1], ['正常', 0]]
+                }),
+                minChars: 0,
+                queryMode: 'local',
+                getCondition: function(v) {
+                    return v == 1 ? ('mb_ignore = 1') : ('mb_ignore != 1 or mb_ignore is null')
+                }
             }],
 
             gridConfig: {
-                idField: null,
+                idField: 'mailbox_id',
                 codeField: null,
                 statusCodeField: null,
                 dataUrl: me.dataUrl,
@@ -25,105 +97,88 @@ Ext.define('school.view.interaction.mailbox.List', {
                 totalProperty: 'data.total',
                 actionColumn: [],
                 selModel: {
-                    checkOnly:true,
-                    type:'checkboxmodel',
-                    mode : "MULTI" ,
-                    ignoreRightMouseSelection : false
+                    checkOnly: true,
+                    type: 'checkboxmodel',
+                    mode: "MULTI",
+                    ignoreRightMouseSelection: false
                 },
                 hiddenTools: false,
+                disableDetail: true,
                 toolBtns: [{
                     xtype: 'button',
-                    text: '导出'
+                    text: '忽略',
+                    handler: 'onIgnoreClick'
                 }, {
                     xtype: 'button',
-                    text: '批量回复'
+                    text: '取消忽略',
+                    handler: 'onUnIgnoreClick'
                 }, {
                     xtype: 'button',
                     text: '删除'
                 }],
                 columns : [{
+                    text: 'ID',
+                    dataIndex: 'mailbox_id',
+                    hidden: true
+                }, {
                     text: '标题',
-                    dataIndex: 'mailboxTitle',
+                    dataIndex: 'mailbox_title',
                     width: 120
                 }, {
                     text: '内容',
-                    dataIndex: 'mailboxContext',
+                    dataIndex: 'mailbox_context',
                     width: 300
                 }, {
                     xtype: 'datecolumn',
                     text: '日期',
-                    dataIndex: 'createDate'
+                    dataIndex: 'create_date',
+                    width: 150
                 }, {
                     text: '提出人',
-                    dataIndex: 'mailboxCreator',
+                    dataIndex: 'mb_creatorname',
                     width: 120
+                }, {
+                    text: '年级',
+                    dataIndex: 'mb_grade'
+                }, {
+                    text: '班级',
+                    dataIndex: 'mb_class'
+                }, {
+                    text: '学生',
+                    dataIndex: 'mb_student'
+                }, {
+                    text: '回复状态',
+                    dataIndex: 'mailbox_status',
+                    renderer: function(v, m, r) {
+                        return v == 3 ? '已回复' : '未回复';
+                    }
+                }, {
+                    text: '忽略状态',
+                    dataIndex: 'mb_ignore',
+                    renderer: function(v, m, r) {
+                        return v == 1 ? '已忽略' : '正常';
+                    }
+                }, {
+                    text: '回复信息',
+                    dataIndex: 'mb_reply',
+                    width: 250
+                }, {
+                    xtype:'actioncolumn',
+                    width:70,
+                    dataIndex:'actioncolumn',
+                    text:'操作',
+                    align: 'center',
+                    items: [{
+                        tooltip: '回复',
+                        iconCls: 'x-fa fa-pencil fa-fw',
+                        scope:this
+                    }],
+                    listeners: {
+                        click: 'onActionClick'
+                    }
                 }]
             },
         });
         this.callParent(arguments);
-    },
-
-    /**
-     * 处理部分字段值
-     */
-    getConditionValue: function (field, value) {
-        var me = this,
-            xtypes = field.getXTypes().split('/'),
-            conditionValue;
-        if (me.isContainsAny(xtypes, ['datefield'])) {
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
-        } else if (me.isContainsAny(xtypes, ['conmonthfield'])) {
-            var from = value.from,
-                to = value.to;
-
-            conditionValue = from + ',' + to;
-        } else if (me.isContainsAny(xtypes, ['condatefield'])) {
-            var from = value.from,
-                to = value.to;
-
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
-        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
-            conditionValue = value;
-        } else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
-            conditionValue = value;
-        } else if (me.isContainsAny(xtypes, ['multicombo'])) {
-            conditionValue = value.map ? value.map(function (v) {
-                return v.value;
-            }).join(',') : '';
-        } else {
-            conditionValue = value;
-        }
-
-        return conditionValue;
-    },
-
-    getExtraParams: function(store, op, condition) {
-        var temp = {};
-
-        for(let x = 0; x < condition.length; x++) {
-            let c = condition[x];
-            if(c.field == 'keyword') {
-                temp.keyword = c.value;
-            }else if(c.field == 'date') {
-                temp.fromDate = new Date(c.value.split(',')[0]).getTime();
-                temp.endDate = new Date(c.value.split(',')[1]).getTime();
-            }else if(c.field == 'quoted') {
-                temp.quoted = c.value == 'all' ? null : c.value;
-            }else if(c.field == 'closed') {
-                // temp.endDate = c.value == 'all' ? null : (
-                //     c.value == '0' ? 
-                // );
-            }
-        }
-        let obj = {
-            pageNumber: store.exportNumber?store.exportNumber:op._page,
-            pageSize: store.exportPageSize?store.exportPageSize:store.pageSize
-        };
-        for(let k in temp) {
-            if(!!temp[k]) {
-                obj[k] = temp[k];
-            }
-        }
-        return obj;
-     },
+    }
 });

+ 195 - 0
frontend/pc-web/app/view/Interaction/mailbox/ListController.js

@@ -0,0 +1,195 @@
+Ext.define('school.view.interaction.mailbox.ListController', {
+    extend: 'school.view.core.base.BasePanelController',
+    alias: 'controller.interaction-mailbox-list',
+
+    onActionClick: function(tableView, td, row, col, e, record, tr) {
+        let me = this;
+        me.onReply(record.data);
+        // let targetCls = event.target.classList;
+        // if(targetCls.contains('fa-pencil')) {
+        //     me.modifyClick(record.data);
+        // }else if(targetCls.contains('fa-trash-o')) {
+        //     me.onDeleteClick(record.data.subject_id);
+        // }
+    },
+
+    onReply: function (data) {
+        let me = this,
+        tab = school.util.BaseUtil.getCurrentTab(),
+        view = me.getView(),
+        win = Ext.getCmp('reply-win');
+
+        if (!win) {
+            win = Ext.create('Ext.window.Window', {
+                title: '回复',
+                width: tab.getBox().width * 0.8,
+                height: tab.getBox().height * 0.8,
+                id: 'reply-win',
+                constrain: true,
+                modal: true,
+                bodyPadding: 10,
+                layout: 'fit',
+                scrollable: true,
+                items: [{
+                    xtype: 'form',
+                    layout: 'column',
+                    defaults: {
+                        margin: '0 0 10 0',
+                        columnWidth: 1
+                    },
+                    items: [{
+                        xtype: 'hidden',
+                        name: 'id',
+                    }, {
+                        xtype: 'textareafield',
+                        name: 'content',
+                        fieldLabel: '内容',
+                        readOnly: true,
+                    }, {
+                        xtype: 'textareafield',
+                        name: 'text',
+                        fieldLabel: '回复',
+                        allowBlank: false,
+                        maxLength: 500
+                    }],
+                    buttonAlign: 'center',
+                    buttons: [{
+                        text: '确定',
+                        formBind: true,
+                        handler: function () {
+                            let form = this.up('form');
+                            let id = form.getValues().id;
+                            let text = form.getValues().text;
+                            let url, params, headers;
+                            
+                            params = {
+                                id: id,
+                                msg: text
+                            };
+
+                            headers = {
+                                "Content-Type": 'application/x-www-form-urlencoded; charset=UTF-8'
+                            }
+
+                            view.setLoading(true);
+                            school.util.BaseUtil.request({
+                                // url: 'http://10.1.80.47:9520/api/school/principal/reply',
+                                url: '/api/school/principal/reply',
+                                method: 'POST',
+                                params: params,
+                                headers: headers
+                            }).then(function (res) {
+                                view.setLoading(false);
+                                win.close();
+                                school.util.BaseUtil.showSuccessToast('添加成功');
+                                view.refresh();
+                            }).catch(function (e) {
+                                view.setLoading(false);
+                                school.util.BaseUtil.showErrorToast('添加失败: ' + e.message);
+                            });
+                        }
+                    }]
+                }]
+            });
+            tab.add(win);
+            win.setTitle(data.mailbox_title);
+            win.down('form').getForm().findField('id').setValue(data.mailbox_id);
+            win.down('form').getForm().findField('content').setValue(data.mailbox_context);
+            win.down('form').getForm().findField('text').setValue(data.mb_reply);
+        }
+        win.show();
+    },
+
+    onIgnoreClick: function() {
+        let me = this,
+        view = me.getView();
+
+        let grid = view.down('grid'),
+        selectedRecords = grid.getSelection();
+        let data, flag = false;
+
+        data = selectedRecords.map(function(r) {
+            if(r.get('mb_ignore') == 1) {
+                flag = true;
+                return;
+            }
+            return {
+                id: r.get('mailbox_id')
+            };
+        });
+
+        if(data.length == 0) {
+            school.util.BaseUtil.showErrorToast('请先勾选需要删除的记录');
+            return;
+        }
+
+        if(flag) {
+            school.util.BaseUtil.showErrorToast('不可包含已忽略记录');
+            return;
+        }
+
+        grid.setLoading(true);
+        school.util.BaseUtil.request({
+            // url: 'http://10.1.80.47:9520/api/school/principal/batchIgnore',
+            url: '/api/school/principal/batchIgnore',
+            method: 'POST',
+            params: JSON.stringify({
+                baseDTOs: data
+            })
+        }).then(function(res) {
+            grid.setLoading(false);
+            school.util.BaseUtil.showSuccessToast('已忽略' + data.length + '条记录');
+            grid.store.loadPage(grid.store.currentPage);
+        }).catch(function(e) {
+            grid.setLoading(false);
+            school.util.BaseUtil.showErrorToast('添加忽略失败: ' + e.message);
+        });
+    },
+
+    onUnIgnoreClick: function() {
+        let me = this,
+        view = me.getView();
+
+        let grid = view.down('grid'),
+        selectedRecords = grid.getSelection();
+        let data, flag = false;
+
+        data = selectedRecords.map(function(r) {
+            if(r.get('mb_ignore') != 1) {
+                flag = true;
+                return;
+            }
+            return {
+                id: r.get('mailbox_id')
+            };
+        });
+
+        if(data.length == 0) {
+            school.util.BaseUtil.showErrorToast('请先勾选需要删除的记录');
+            return;
+        }
+
+        if(!!flag) {
+            school.util.BaseUtil.showErrorToast('不可包含未忽略记录');
+            return;
+        }
+
+        grid.setLoading(true);
+        school.util.BaseUtil.request({
+            // url: 'http://10.1.80.47:9520/api/school/principal/batchUnIgnore',
+            url: '/api/school/principal/batchUnIgnore',
+            method: 'POST',
+            params: JSON.stringify({
+                baseDTOs: data
+            })
+        }).then(function(res) {
+            grid.setLoading(false);
+            school.util.BaseUtil.showSuccessToast('取消忽略' + data.length + '条记录');
+            grid.store.loadPage(grid.store.currentPage);
+        }).catch(function(e) {
+            grid.setLoading(false);
+            school.util.BaseUtil.showErrorToast('添加忽略失败: ' + e.message);
+        });
+    },
+
+});

+ 25 - 89
frontend/pc-web/app/view/Interaction/notice/List.js

@@ -5,7 +5,7 @@ Ext.define('school.view.interaction.notice.List', {
     extend: 'school.view.core.base.BasePanel',
     xtype: 'interaction-notice-list',
 
-    // dataUrl: 'http://10.1.80.47:9560/notice/list',
+    // dataUrl: 'http://10.1.80.180:9520/api/school/notice/list',
     dataUrl: '/api/school/notice/list',
     _title: '学校通知',
 
@@ -21,7 +21,7 @@ Ext.define('school.view.interaction.notice.List', {
                 }
             }, {
                 xtype: 'textfield',
-                name: 'notify_creator',
+                name: 'creator',
                 fieldLabel: '发布人'
             }, {
                 xtype: 'combobox',
@@ -36,18 +36,18 @@ Ext.define('school.view.interaction.notice.List', {
                 }),
                 minChars: 0,
                 queryMode: 'local'
-            }, {
-                xtype: 'condatefield',
-                name: 'publish_date',
-                fieldLabel: '发布时间',
-                columnWidth: 0.5
+            // }, {
+            //     xtype: 'condatefield',
+            //     name: 'publish_date',
+            //     fieldLabel: '发布时间',
+            //     columnWidth: 0.5
             }],
         
             gridConfig: {
                 addTitle: '学校通知',
                 addXtype: 'interaction-notice-schoolnotice',
                 idField: 'notify_id',
-                codeField: null,
+                codeField: 'notify_title',
                 detailField: 'notify_title',
                 dataUrl: me.dataUrl,
                 caller: null,
@@ -62,6 +62,12 @@ Ext.define('school.view.interaction.notice.List', {
                 },
                 hiddenTools: false,
                 toolBtns: [{
+                    xtype: 'button',
+                    text: '新增',
+                    handler: function() {
+                        school.util.BaseUtil.openTab('interaction-notice-schoolnotice', '新增学校通知', 'interaction-notice-schoolnotice-add');
+                    }
+                }, {
                     xtype: 'button',
                     text: '删除',
                     handler: function() {
@@ -97,12 +103,6 @@ Ext.define('school.view.interaction.notice.List', {
                             school.util.BaseUtil.showErrorToast('删除失败: ' + e.message);
                         });
                     }
-                }, {
-                    xtype: 'button',
-                    text: '新增',
-                    handler: function() {
-                        school.util.BaseUtil.openTab('interaction-notice-schoolnotice', '新增学校通知', 'interaction-notice-schoolnotice-add');
-                    }
                 }],
                 columns : [{
                     text: 'id',
@@ -112,22 +112,22 @@ Ext.define('school.view.interaction.notice.List', {
                     text: '标题',
                     dataIndex: 'notify_title',
                     width: 120,
-                    tdCls: 'x-detail-column',
-                    listeners: {
-                        click: function(view, td, row, col, e, record, tr, eOpts, event) {
-                            let gridConfig = me.gridConfig;
-                            school.util.BaseUtil.openTab(gridConfig.addXtype, gridConfig.addTitle + '(' + record.get('notify_title') + ')', gridConfig.addXtype + record.get(gridConfig.idField), {
-                                initId: record.get(gridConfig.idField)
-                            });
-                        }
-                    }
+                    // tdCls: 'x-detail-column',
+                    // listeners: {
+                    //     click: function(view, td, row, col, e, record, tr, eOpts, event) {
+                    //         let gridConfig = me.gridConfig;
+                    //         school.util.BaseUtil.openTab(gridConfig.addXtype, gridConfig.addTitle + '(' + record.get('notify_title') + ')', gridConfig.addXtype + record.get(gridConfig.idField), {
+                    //             initId: record.get(gridConfig.idField)
+                    //         });
+                    //     }
+                    // }
                 }, {
                     text: '内容',
                     dataIndex: 'notify_details',
                     width: 300
                 }, {
                     text: '发布人',
-                    dataIndex: 'notify_creator',
+                    dataIndex: 'creator',
                     width: 150
                 }, {
                     text: '发布状态',
@@ -146,69 +146,5 @@ Ext.define('school.view.interaction.notice.List', {
             },
         });
         this.callParent(arguments);
-    },
-
-    /**
-     * 处理部分字段值
-     */
-    getConditionValue: function (field, value) {
-        var me = this,
-            xtypes = field.getXTypes().split('/'),
-            conditionValue;
-        if (me.isContainsAny(xtypes, ['datefield'])) {
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
-        } else if (me.isContainsAny(xtypes, ['conmonthfield'])) {
-            var from = value.from,
-                to = value.to;
-
-            conditionValue = from + ',' + to;
-        } else if (me.isContainsAny(xtypes, ['condatefield'])) {
-            var from = value.from,
-                to = value.to;
-
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
-        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
-            conditionValue = value;
-        } else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
-            conditionValue = value;
-        } else if (me.isContainsAny(xtypes, ['multicombo'])) {
-            conditionValue = value.map ? value.map(function (v) {
-                return v.value;
-            }).join(',') : '';
-        } else {
-            conditionValue = value;
-        }
-
-        return conditionValue;
-    },
-
-    getExtraParams: function(store, op, condition) {
-        var temp = {};
-
-        for(let x = 0; x < condition.length; x++) {
-            let c = condition[x];
-            if(c.field == 'keyword') {
-                temp.keyword = c.value;
-            }else if(c.field == 'date') {
-                temp.fromDate = new Date(c.value.split(',')[0]).getTime();
-                temp.endDate = new Date(c.value.split(',')[1]).getTime();
-            }else if(c.field == 'quoted') {
-                temp.quoted = c.value == 'all' ? null : c.value;
-            }else if(c.field == 'closed') {
-                // temp.endDate = c.value == 'all' ? null : (
-                //     c.value == '0' ? 
-                // );
-            }
-        }
-        let obj = {
-            pageNumber: store.exportNumber?store.exportNumber:op._page,
-            pageSize: store.exportPageSize?store.exportPageSize:store.pageSize
-        };
-        for(let k in temp) {
-            if(!!temp[k]) {
-                obj[k] = temp[k];
-            }
-        }
-        return obj;
-     },
+    }
 });

+ 19 - 5
frontend/pc-web/app/view/Interaction/notice/SchoolNotice.js

@@ -12,9 +12,9 @@ Ext.define('school.view.interaction.notice.SchoolNotice', {
     _title: '学校通知',
     _idField: 'notify_id',
     _codeField: null,
-    // _readUrl: 'http://10.1.80.47:9560/notice/read',
+    // _readUrl: 'http://10.1.80.180:9520/api/school/notice/read',
     _readUrl: '/api/school/notice/read',
-    // _saveUrl: 'http://10.1.80.47:9560/notice/save',
+    // _saveUrl: 'http://10.1.80.180:9520/api/school/notice/save',
     _saveUrl: '/api/school/notice/save',
     _deleteUrl: '/api/school/notice/delete',
     initId: 0,
@@ -27,8 +27,17 @@ Ext.define('school.view.interaction.notice.SchoolNotice', {
             }, {
                 xtype: "textfield",
                 name: "notify_creator",
+                fieldLabel: "发布人id",
+                columnWidth: 0.5,
+                defaultValue: school.util.BaseUtil.getCurrentUser().id,
+                hidden: true
+            }, {
+                xtype: "textfield",
+                name: "creator",
                 fieldLabel: "发布人",
-                columnWidth: 0.5
+                columnWidth: 0.5,
+                defaultValue: school.util.BaseUtil.getCurrentUser().username,
+                readOnly: true
             }, {
                 xtype: 'combobox',
                 name: 'notify_status',
@@ -49,18 +58,22 @@ Ext.define('school.view.interaction.notice.SchoolNotice', {
                 name: 'publish_date',
                 fieldLabel: '发布时间',
                 readOnly: true,
-                format: 'Y-m-d H:i:s'
+                format: 'Y-m-d H:i:s',
+                defaultValue: new Date(),
+                readOnly: true
             }, {
                 xtype: "textfield",
                 name: "notify_title",
                 fieldLabel: "标题",
-                columnWidth: 1
+                columnWidth: 1,
+                allowBlank: false
             }, {
                 xtype: "textareafield",//文本域
                 name: 'notify_details',
                 fieldLabel: "内容",
                 height: 300,
                 columnWidth: 1,
+                allowBlank: false
             }, {
                 xtype: 'textfield',
                 name: 'fj',
@@ -69,6 +82,7 @@ Ext.define('school.view.interaction.notice.SchoolNotice', {
             toolBtns: [{
                 xtype: 'button',
                 text: '发布',
+                hidden: true,
                 bind: {
                     hidden: '{!notify_id}'
                 },

+ 40 - 21
frontend/pc-web/app/view/Interaction/score/List.js

@@ -17,13 +17,38 @@ Ext.define('school.view.interaction.score.List', {
                 name: 'term',
                 fieldLabel: '学期'
             }, {
-                xtype: 'textfield',
+                xtype: 'gradecombo',
                 name: 'grade',
-                fieldLabel: '年级'
+                fieldLabel: '年级',
+                listeners: {
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('class').setValue(null);
+                    }
+                }
             }, {
-                xtype: 'textfield',
+                xtype: 'classcombo',
                 name: 'class',
-                fieldLabel: '班级'
+                fieldLabel: '班级',
+                listeners: {
+                    expand: function (combo, eOpts) {
+                        combo.store.clearFilter();
+
+                        var gradeCombo = combo.up('form').getForm().findField('grade');
+                        var gradeName = gradeCombo.getValue();
+
+                        var filter = new Ext.util.Filter({
+                            property: 'gradeName',
+                            value: gradeName
+                        });
+
+                        if (!!gradeName) {
+                            combo.store.setFilters([filter]);
+                        }
+                    },
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('grade').setValue(record.get('gradeName'));
+                    }
+                }
             }],
 
             caller: null,
@@ -54,41 +79,35 @@ Ext.define('school.view.interaction.score.List', {
                 hiddenTools: false,
                 toolBtns: [{
                     xtype: 'button',
-                    text: '导入'
+                    text: '新增',
+                    handler: 'onAddClick'
                 }, {
                     xtype: 'button',
-                    text: '删除'
+                    text: '导入'
                 }, {
                     xtype: 'button',
-                    text: '新增',
-                    // handler: 'onAddClick'
+                    text: '删除'
                 }],
                 columns: [{
                     text: 'ID',
                     dataIndex: 'score_id',
                     hidden: true
                 }, {
-                    text: '编号',
-                    dataIndex: 'score_num',
-                    width: 150
-                }, {
-                    text: '成绩类型',
-                    dataIndex: 'score_name',
-                    width: 120
+                    text: '考试标题',
+                    dataIndex: 'score_name'
                 }, {
                     text: '考试时间',
                     dataIndex: 'score_date',
                     width: 150
                 }, {
-                    text: '年级',
+                    text: '考试范围',
                     dataIndex: 'score_scope'
                 }, {
-                    text: '类型',
-                    dataIndex: 'score_type'
+                    text: '年级',
+                    dataIndex: ''
                 }, {
-                    text: '备注',
-                    dataIndex: 'score_remarks',
-                    width: 120
+                    text: '班级',
+                    dataIndex: ''
                 }]
             },
         });

+ 52 - 10
frontend/pc-web/app/view/Interaction/timetable/Detail.js

@@ -7,9 +7,9 @@ Ext.define('school.view.interaction.timetable.Detail', {
     _title: '课程表',
     _idField: 'id',
     _codeField: null,
-    // _readUrl: 'http://10.1.80.36:9520/api/school/curriculum/read',
+    // _readUrl: 'http://10.1.80.47:9520/api/school/curriculum/read',
     _readUrl: '/api/school/curriculum/read',
-    // _saveUrl: 'http://10.1.80.36:9520/api/school/curriculum/save',
+    // _saveUrl: 'http://10.1.80.47:9520/api/school/curriculum/save',
     _saveUrl: '/api/school/curriculum/save',
     _deleteUrl: '/api/school/curriculum/delete',
     initId: 0,
@@ -34,36 +34,74 @@ Ext.define('school.view.interaction.timetable.Detail', {
             }, {
                 xtype: 'numberfield',
                 name: 'gradeId',
-                fieldLabel: '年级ID'
+                fieldLabel: '年级ID',
+                hidden: true
             }, {
-                xtype: 'textfield',
+                xtype: 'gradecombo',
                 name: 'gradeName',
                 fieldLabel: '年级',
+                allowBlank: false,
+                listeners: {
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('gradeId').setValue(record.get('value'));
+                        combo.up('form').getForm().findField('clazzId').setValue(null);
+                        combo.up('form').getForm().findField('clazzName').setValue(null);
+                    }
+                }
             }, {
                 xtype: 'numberfield',
                 name: 'clazzId',
-                fieldLabel: '班级ID'
+                fieldLabel: '班级ID',
+                hidden: true
             }, {
-                xtype: 'textfield',
+                xtype: 'classcombo',
                 name: 'clazzName',
                 fieldLabel: '班级',
+                allowBlank: false,
+                listeners: {
+                    expand: function (combo, eOpts) {
+                        combo.store.clearFilter();
+
+                        var gradeCombo = combo.up('form').getForm().findField('gradeName');
+                        var gradeName = gradeCombo.getValue();
+
+                        var filter = new Ext.util.Filter({
+                            property: 'gradeName',
+                            value: gradeName
+                        });
+
+                        if (!!gradeName) {
+                            combo.store.setFilters([filter]);
+                        }
+                    },
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('clazzId').setValue(record.get('value'));
+                        combo.up('form').getForm().findField('gradeName').setValue(record.get('gradeName'));
+                    }
+                }
             }, {
                 xtype: 'textfield',
                 name: 'termPart',
-                fieldLabel: '学年'
+                fieldLabel: '学年',
+                allowBlank: false
             }, {
                 xtype: "textfield",
                 name: "termName",
-                fieldLabel: "学期"
+                fieldLabel: "学期",
+                allowBlank: false
             }, {
                 xtype: "textfield",
                 name: "creatorName",
-                fieldLabel: "录入人"
+                fieldLabel: "录入人",
+                defaultValue: school.util.BaseUtil.getCurrentUser().username,
+                readOnly: true
             }, {
                 xtype: 'datefield',
                 name: 'createTime',
                 fieldLabel: '录入时间',
-                format: 'Y-m-d H:i:s'
+                format: 'Y-m-d H:i:s',
+                defaultValue: new Date(),
+                readOnly: true
             }, {
                 xtype: 'textfield',
                 name: 'status',
@@ -215,5 +253,9 @@ Ext.define('school.view.interaction.timetable.Detail', {
         menu.setVisible(false);
         let classTime = Math.abs(Ext.Date.diff(me.currentRecord.get('_time1'), record.get('date'), Ext.Date.MINUTE));
         me.CLASS_TIME = classTime;
+    },
+
+    refresh: function() {
+        Ext.StoreMgr.get('store_subject').load();
     }
 });

+ 40 - 15
frontend/pc-web/app/view/Interaction/timetable/List.js

@@ -7,7 +7,7 @@ Ext.define('school.view.interaction.timetable.List', {
 
     controller: 'interaction-timetable-list',
 
-    // dataUrl: 'http://10.1.80.36:9520/api/school/curriculum/list',
+    // dataUrl: 'http://10.1.80.47:9520/api/school/curriculum/list',
     dataUrl: '/api/school/curriculum/list',
     _title: '课程表',
     caller: 'Curriculum',
@@ -21,13 +21,38 @@ Ext.define('school.view.interaction.timetable.List', {
                 name: 'mcur_name',
                 fieldLabel: '课表名称'
             }, {
-                xtype: 'textfield',
+                xtype: 'gradecombo',
                 name: 'grade_name',
-                fieldLabel: '年级'
+                fieldLabel: '年级',
+                listeners: {
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('clazz_name').setValue(null);
+                    }
+                }
             }, {
-                xtype: 'textfield',
+                xtype: 'classcombo',
                 name: 'clazz_name',
-                fieldLabel: '班级'
+                fieldLabel: '班级',
+                listeners: {
+                    expand: function (combo, eOpts) {
+                        combo.store.clearFilter();
+
+                        var gradeCombo = combo.up('form').getForm().findField('grade_name');
+                        var gradeName = gradeCombo.getValue();
+
+                        var filter = new Ext.util.Filter({
+                            property: 'gradeName',
+                            value: gradeName
+                        });
+
+                        if (!!gradeName) {
+                            combo.store.setFilters([filter]);
+                        }
+                    },
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('grade_name').setValue(record.get('gradeName'));
+                    }
+                }
             }, {
                 xtype: 'textfield',
                 name: 'mcur_term_part',
@@ -42,7 +67,7 @@ Ext.define('school.view.interaction.timetable.List', {
                 addTitle: '课程表',
                 addXtype: 'interaction-timetable-detail',
                 idField: 'id',
-                codeField: null,
+                codeField: 'id',
                 detailField: 'name',
                 dataUrl: me.dataUrl,
                 caller: null,
@@ -115,15 +140,15 @@ Ext.define('school.view.interaction.timetable.List', {
                     text: '课表名称',
                     dataIndex: 'name',
                     width: 120,
-                    tdCls: 'x-detail-column',
-                    listeners: {
-                        click: function(view, td, row, col, e, record, tr, eOpts, event) {
-                            let gridConfig = me.gridConfig;
-                            school.util.BaseUtil.openTab(gridConfig.addXtype, gridConfig.addTitle + '(' + record.get('id') + ')', gridConfig.addXtype + record.get(gridConfig.idField), {
-                                initId: record.get(gridConfig.idField)
-                            });
-                        }
-                    }
+                    // tdCls: 'x-detail-column',
+                    // listeners: {
+                    //     click: function(view, td, row, col, e, record, tr, eOpts, event) {
+                    //         let gridConfig = me.gridConfig;
+                    //         school.util.BaseUtil.openTab(gridConfig.addXtype, gridConfig.addTitle + '(' + record.get('id') + ')', gridConfig.addXtype + record.get(gridConfig.idField), {
+                    //             initId: record.get(gridConfig.idField)
+                    //         });
+                    //     }
+                    // }
                 }, {
                     text: '年级',
                     dataIndex: 'gradeName'

+ 2 - 2
frontend/pc-web/app/view/basic/class/ClassInfo.js

@@ -29,7 +29,7 @@ Ext.define('school.view.basic.class.ClassInfo', {
                 xtype: 'treepanel',
                 reference: 'treelist',
                 bind: {
-                    store: '{store_grade}',
+                    store: '{store_gradeclass}',
                     width: '{treeWidth}'
                 },
                 // viewConfig: {
@@ -83,7 +83,7 @@ Ext.define('school.view.basic.class.ClassInfo', {
                     onSuccess: function() {
                         let viewModel = me.getViewModel();
         
-                        viewModel.get('store_grade').load();
+                        viewModel.get('store_gradeclass').load();
                     }
                 }, '->'],
                 listeners: {

+ 4 - 2
frontend/pc-web/app/view/basic/class/ClassInfoController.js

@@ -7,7 +7,7 @@ Ext.define('school.view.basic.class.ClassInfoController', {
         view = me.getView(),
         viewModel = me.getViewModel();
 
-        viewModel.get('store_grade').load();
+        viewModel.get('store_gradeclass').load();
     },
 
     onItemMouseEnter: function(tree, record, item, index, e, eOpts)  {
@@ -209,7 +209,7 @@ Ext.define('school.view.basic.class.ClassInfoController', {
                             let url, params, headers;
                             if(type == 'SCHOOL') {
                                 currentNode = rootNode;
-                                childNode.leaf = false;
+                                childNode.leaf = true;
                                 childNode.children = [];
                                 // url = 'http://10.1.80.47:9560/grade/save';
                                 url = '/api/school/grade/save';
@@ -328,8 +328,10 @@ Ext.define('school.view.basic.class.ClassInfoController', {
                             }).then(function(res) {
                                 view.setLoading(false);
                                 currentNode.set('text', text);
+                                currentNode.set('pathText', text);
                                 currentNode.commit();
                                 win.close();
+                                listCard.showNode(currentNode);
                             }).catch(function(e) {
                                 view.setLoading(false);
                                 school.util.BaseUtil.showErrorToast(e.message);

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

@@ -87,7 +87,7 @@ Ext.define('school.view.basic.class.ListCard', {
             if(node.data.type == 'GRADE') {
                 list = node.childNodes.map(function(c) {
                     return Ext.Object.merge(c.data, {
-                        pathText: node.data.text + c.data.text
+                        pathText: node.data.text + ' ' + c.data.text
                     })
                 });
             }else {

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

@@ -6,7 +6,7 @@ Ext.define('school.view.basic.class.ListCardController', {
         var me = this,
         view = me.view,
         viewModel = me.getViewModel(),
-        grade = viewModel.get('store_grade');
+        grade = viewModel.get('store_gradeclass');
 
         view.showNode(grade.getRootNode());
     },

+ 14 - 6
frontend/pc-web/app/view/basic/staff/StaffDetail.js

@@ -30,19 +30,24 @@ Ext.define('school.view.basic.staff.StaffDetail', {
             },{
                 xtype: 'textfield',
                 name: 'teacher_number',
-                fieldLabel: '工号'
+                fieldLabel: '工号',
+                allowBlank: false
             }, {
                 xtype: 'textfield',
                 name: 'teacher_name',
-                fieldLabel: '姓名'
+                fieldLabel: '姓名',
+                allowBlank: false
             }, {
                 xtype: 'gendercombo',
                 name: 'teacher_sex',
                 fieldLabel: '性别',
+                allowBlank: false
             }, {
                 xtype: 'textfield',
                 name: 'teacher_phone',
-                fieldLabel: '手机号'
+                fieldLabel: '手机号',
+                maxLength: 25,
+                allowBlank: false
             }, {
                 xtype: 'textfield',
                 name: 'teacher_email',
@@ -102,16 +107,19 @@ Ext.define('school.view.basic.staff.StaffDetail', {
                     data: [['博士后'], ['博士'], ['硕士'], ['研究生'], ['本科(统招)'], ['本科(成人高考)'], ['本科(专升本)'], ['大专'], ['高中'], ['职高'], ['初中'], ['小学']]
                 }),
                 minChars: 0,
-                queryMode: 'local'
+                queryMode: 'local',
+                allowBlank: false
             }, {
                 xtype: 'textfield',
                 name: 'teacher_major',
-                fieldLabel: '专业'
+                fieldLabel: '专业',
+                allowBlank: false
             }, {
                 xtype: 'textfield',
                 name: 'teacher_address',
                 fieldLabel: '现居住址',
-                columnWidth: 0.5
+                columnWidth: 0.5,
+                allowBlank: false
             }, {
                 name: "detailGridField",
                 xtype: "detailGridField",

+ 71 - 16
frontend/pc-web/app/view/basic/student/StudentDetail.js

@@ -30,11 +30,13 @@ Ext.define('school.view.basic.student.StudentDetail', {
             }, {
                 xtype: 'textfield',
                 name: 'stu_number',
-                fieldLabel: '学号'
+                fieldLabel: '学号',
+                allowBlank: false
             }, {
                 xtype: 'textfield',
                 name: 'stu_name',
-                fieldLabel: '姓名'
+                fieldLabel: '姓名',
+                allowBlank: false
             }, {
                 xtype: 'combobox',
                 name: 'stu_sex',
@@ -46,7 +48,8 @@ Ext.define('school.view.basic.student.StudentDetail', {
                     type: 'store_gender'
                 },
                 minChars: 0,
-                queryMode: 'local'
+                queryMode: 'local',
+                allowBlank: false
             }, {
                 xtype: 'textfield',
                 name: 'stu_native',
@@ -64,14 +67,20 @@ Ext.define('school.view.basic.student.StudentDetail', {
                 editable: false,
                 store: Ext.create('Ext.data.ArrayStore', {
                     fields: ['name'],
-                    data: [['中共党员'], ['中共预备党员'], ['共青团员'], ['群众']]
+                    data: [
+                        ['中共党员'],
+                        ['中共预备党员'],
+                        ['共青团员'],
+                        ['群众']
+                    ]
                 }),
                 minChars: 0,
                 queryMode: 'local'
             }, {
                 xtype: 'datefield',
                 name: 'stu_birthday',
-                fieldLabel: '出生日期'
+                fieldLabel: '出生日期',
+                allowBlank: false
             }, {
                 xtype: 'numberfield',
                 name: 'stu_age',
@@ -80,24 +89,58 @@ Ext.define('school.view.basic.student.StudentDetail', {
                 xtype: "textfield",
                 name: "stu_address",
                 fieldLabel: "家庭住址",
-                columnWidth: 0.5
+                columnWidth: 0.5,
+                allowBlank: false
             }, {
                 xtype: 'datefield',
                 name: 'stu_enroll_date',
-                fieldLabel: '入学日期'
+                fieldLabel: '入学日期',
+                allowBlank: false
             }, {
-                xtype: 'textfield',
+                xtype: 'gradecombo',
                 name: 'stu_grade',
-                fieldLabel: '年级'
+                valueField: 'name',
+                fieldLabel: '年级',
+                listeners: {
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('clazz_id').setValue(null);
+                        combo.up('form').getForm().findField('stu_class').setValue(null);
+                    }
+                },
+                allowBlank: false
             }, {
                 xtype: 'textfield',
                 name: 'clazz_id',
                 fieldLabel: '班级id',
-                hidden: true
+                hidden: true,
+                allowBlank: false
             }, {
-                xtype: 'textfield',
+                xtype: 'classcombo',
                 name: 'stu_class',
-                fieldLabel: '班级'
+                fieldLabel: '班级',
+                valueField: 'name',
+                listeners: {
+                    expand: function (combo, eOpts) {
+                        combo.store.clearFilter();
+
+                        var gradeCombo = combo.up('form').getForm().findField('stu_grade');
+                        var gradeName = gradeCombo.getValue();
+
+                        var filter = new Ext.util.Filter({
+                            property: 'gradeName',
+                            value: gradeName
+                        });
+
+                        if (!!gradeName) {
+                            combo.store.setFilters([filter]);
+                        }
+                    },
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('clazz_id').setValue(record.get('value'));
+                        combo.up('form').getForm().findField('stu_grade').setValue(record.get('gradeName'));
+                    }
+                },
+                allowBlank: false
             }, {
                 name: "parent",
                 xtype: "detailGridField",
@@ -109,9 +152,13 @@ Ext.define('school.view.basic.student.StudentDetail', {
                 allowEmpty: true,
                 showCount: false,
                 columns: [{
-                    text: '家长姓名',
+                    text: '关系id',
                     dataIndex: 'parent_stu_id',
                     hidden: true
+                }, {
+                    text: '家长id',
+                    dataIndex: 'parent_id',
+                    hidden: true
                 }, {
                     text: '家长姓名',
                     dataIndex: 'parents_name',
@@ -126,10 +173,18 @@ Ext.define('school.view.basic.student.StudentDetail', {
                     }
                 }, {
                     text: '关系',
-                    dataIndex: 'parent_rel',
+                    dataIndex: 'ps_relation',
                     editor: {
-                        xtype: 'textfield'
-                    }
+                        xtype: 'combobox',
+                        displayField: 'name',
+                        valueField: 'name',
+                        editable: true,
+                        store: Ext.create('Ext.data.ArrayStore', {
+                            fields: ['name'],
+                            data: [['父子'], ['母子'], ['兄弟'], ['兄妹'], ['姐弟'], ['姐妹'], ['祖孙'], ['其他']]
+                        }),
+                        queryMode: 'local'
+                    },
                 }]
             }],
         });

+ 46 - 73
frontend/pc-web/app/view/basic/student/StudentList.js

@@ -6,6 +6,7 @@ Ext.define('school.view.basic.student.StudentList', {
     xtype: 'basic-student-studentlist',
 
     dataUrl: '/api/school/student/list',
+    // dataUrl: 'http:/api/school/student/list',
     _title: '学生信息',
     caller: 'Student',
     pathKey: 'student',
@@ -14,13 +15,40 @@ Ext.define('school.view.basic.student.StudentList', {
         var me = this;
         Ext.apply(this, {
             searchField: [{
-                xtype: 'textfield',
-                name: 'grade',
-                fieldLabel: '年级'
+                xtype: 'gradecombo',
+                name: 'stu_grade',
+                fieldLabel: '年级',
+                valueField: 'name',
+                listeners: {
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('stu_class').setValue(null);
+                    }
+                }
             }, {
-                xtype: 'textfield',
-                name: 'class',
-                fieldLabel: '班级'
+                xtype: 'classcombo',
+                name: 'stu_class',
+                fieldLabel: '班级',
+                valueField: 'name',
+                listeners: {
+                    expand: function (combo, eOpts) {
+                        combo.store.clearFilter();
+
+                        var gradeCombo = combo.up('form').getForm().findField('stu_grade');
+                        var gradeName = gradeCombo.getValue();
+
+                        var filter = new Ext.util.Filter({
+                            property: 'gradeName',
+                            value: gradeName
+                        });
+
+                        if (!!gradeName) {
+                            combo.store.setFilters([filter]);
+                        }
+                    },
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('stu_grade').setValue(record.get('gradeName'));
+                    }
+                }
             }, {
                 xtype: 'textfield',
                 name: 'stu_number',
@@ -128,10 +156,19 @@ Ext.define('school.view.basic.student.StudentList', {
                     }
                 }, {
                     text: '年级',
-                    dataIndex: 'grade'
+                    dataIndex: 'stu_grade',
+                    editor: {
+                        xtype: 'combobox',
+                        displayField: 'name',
+                        valueField: 'value',
+                        store: {
+                            type: 'store_grade'
+                        },
+                        queryMode: 'local'
+                    },
                 }, {
                     text: '班级',
-                    dataIndex: 'class'
+                    dataIndex: 'stu_class'
                 }, {
                     text: '入学日期',
                     dataIndex: 'stu_enroll_date',
@@ -147,69 +184,5 @@ Ext.define('school.view.basic.student.StudentList', {
             },
         });
         this.callParent(arguments);
-    },
-
-    /**
-     * 处理部分字段值
-     */
-    getConditionValue: function (field, value) {
-        var me = this,
-            xtypes = field.getXTypes().split('/'),
-            conditionValue;
-        if (me.isContainsAny(xtypes, ['datefield'])) {
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
-        } else if (me.isContainsAny(xtypes, ['conmonthfield'])) {
-            var from = value.from,
-                to = value.to;
-
-            conditionValue = from + ',' + to;
-        } else if (me.isContainsAny(xtypes, ['condatefield'])) {
-            var from = value.from,
-                to = value.to;
-
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
-        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
-            conditionValue = value;
-        } else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
-            conditionValue = value;
-        } else if (me.isContainsAny(xtypes, ['multicombo'])) {
-            conditionValue = value.map ? value.map(function (v) {
-                return v.value;
-            }).join(',') : '';
-        } else {
-            conditionValue = value;
-        }
-
-        return conditionValue;
-    },
-
-    getExtraParams: function(store, op, condition) {
-        var temp = {};
-
-        for(let x = 0; x < condition.length; x++) {
-            let c = condition[x];
-            if(c.field == 'keyword') {
-                temp.keyword = c.value;
-            }else if(c.field == 'date') {
-                temp.fromDate = new Date(c.value.split(',')[0]).getTime();
-                temp.endDate = new Date(c.value.split(',')[1]).getTime();
-            }else if(c.field == 'quoted') {
-                temp.quoted = c.value == 'all' ? null : c.value;
-            }else if(c.field == 'closed') {
-                // temp.endDate = c.value == 'all' ? null : (
-                //     c.value == '0' ? 
-                // );
-            }
-        }
-        let obj = {
-            pageNumber: store.exportNumber?store.exportNumber:op._page,
-            pageSize: store.exportPageSize?store.exportPageSize:store.pageSize
-        };
-        for(let k in temp) {
-            if(!!temp[k]) {
-                obj[k] = temp[k];
-            }
-        }
-        return obj;
-     },
+    }
 });

+ 9 - 11
frontend/pc-web/app/view/core/base/BasePanel.js

@@ -43,16 +43,14 @@ Ext.define('school.view.core.base.BasePanel', {
             xtype: 'core-base-gridpanel',
             padding: '8 12',
             _columns: gridColumns.map(function(c) {
-                if(c.dataIndex == gridConfig.detailField) {
-                    c.listeners = c.listeners || {};
-                    if(!c.listeners['click']) {
-                        c.tdCls = c.tdCls ? (c.tdCls + ' x-detail-column') : 'x-detail-column'
-                        c.listeners['click'] = function(view, td, row, col, e, record, tr, eOpts, event) {
-                            school.util.BaseUtil.openTab(gridConfig.addXtype, gridConfig.addTitle + '(' + record.get(gridConfig.codeField) + ')', gridConfig.addXtype + record.get(gridConfig.idField), {
-                                initId: record.get(gridConfig.idField)
-                            });
-                        };
-                    }
+                c.listeners = c.listeners || {};
+                if(!gridConfig.disableDetail && !c.listeners['click']) {
+                    // c.tdCls = c.tdCls ? (c.tdCls + ' x-detail-column') : 'x-detail-column'
+                    c.listeners['click'] = function(view, td, row, col, e, record, tr, eOpts, event) {
+                        school.util.BaseUtil.openTab(gridConfig.addXtype, gridConfig.addTitle + '(' + record.get(gridConfig.codeField) + ')', gridConfig.addXtype + record.get(gridConfig.idField), {
+                            initId: record.get(gridConfig.idField)
+                        });
+                    };
                 }
                 return Object.assign({}, c);
             }),
@@ -136,7 +134,7 @@ Ext.define('school.view.core.base.BasePanel', {
             value = item.value,
             condition;
 
-            if(value&&value!=''){
+            if(value !== undefined && value !== null && value !== ''){
                 if(typeof func == 'function') {
                     condition = {
                         type: 'condition',

+ 22 - 18
frontend/pc-web/app/view/core/form/FormPanelController.js

@@ -13,24 +13,28 @@ Ext.define('school.view.core.form.FormPanelController', {
     },
 
     refresh: function() {
-        var me = this,
-        form = me.getView(),
-        xtype = form.xtype,
-        _config = {
-            initId: form.initId,
-        },
-        currentTab = school.util.BaseUtil.getCurrentTab();
-        
-        var view = {
-            _config: _config,
-            xtype: xtype
-        };
-        Ext.apply(view, _config);
-        
-        Ext.suspendLayouts();
-        currentTab.removeAll();
-        currentTab.add(view);
-        Ext.resumeLayouts(true);
+        try {
+            var me = this,
+            form = me.getView(),
+            xtype = form.xtype,
+            _config = {
+                initId: form.initId,
+            },
+            currentTab = school.util.BaseUtil.getCurrentTab();
+            
+            var view = {
+                _config: _config,
+                xtype: xtype
+            };
+            Ext.apply(view, _config);
+            
+            Ext.suspendLayouts();
+            currentTab.removeAll();
+            currentTab.add(view);
+            Ext.resumeLayouts(true);
+        }catch(e) {
+            console.error(e);
+        }
     },
 
     add: function(){

+ 20 - 0
frontend/pc-web/app/view/core/form/field/ClassComboBox.js

@@ -0,0 +1,20 @@
+Ext.define('school.view.core.form.field.ClassComboBox', {
+    extend: 'Ext.form.field.ComboBox',
+    alias: 'widget.classcombo',
+
+    fieldLabel: '班级',
+    displayField: 'name',
+    valueField: 'name',
+    editable: true,
+    minChars: 0,
+    queryMode: 'local',
+    initComponent: function() {
+        var me = this;
+
+        Ext.apply(me, {
+            store: Ext.StoreMgr.get('store_class'),
+        });
+
+        me.callParent(arguments);
+    }
+});

+ 20 - 0
frontend/pc-web/app/view/core/form/field/GradeComboBox.js

@@ -0,0 +1,20 @@
+Ext.define('school.view.core.form.field.GradeComboBox', {
+    extend: 'Ext.form.field.ComboBox',
+    alias: 'widget.gradecombo',
+
+    fieldLabel: '年级',
+    displayField: 'name',
+    valueField: 'name',
+    editable: true,
+    minChars: 0,
+    queryMode: 'local',
+    initComponent: function() {
+        var me = this;
+
+        Ext.apply(me, {
+            store: Ext.StoreMgr.get('store_grade'),
+        });
+
+        me.callParent(arguments);
+    }
+});

+ 21 - 0
frontend/pc-web/app/view/core/form/field/SubjectComboBox.js

@@ -0,0 +1,21 @@
+Ext.define('school.view.core.form.field.SubjectComboBox', {
+    extend: 'Ext.form.field.ComboBox',
+    alias: 'widget.subjectcombo',
+
+    fieldLabel: '学科',
+    displayField: 'subject_name',
+    valueField: 'subject_id',
+    editable: true,
+    minChars: 0,
+    queryMode: 'local',
+    initComponent: function() {
+        var me = this;
+        var store = Ext.StoreMgr.get('store_subject');
+        store.load();
+        Ext.apply(me, {
+            store: store,
+        });
+
+        me.callParent(arguments);
+    }
+});

+ 6 - 11
frontend/pc-web/app/view/core/grid/column/SubjectColumn.js

@@ -6,23 +6,18 @@ Ext.define('school.view.core.grid.column.SubjectColumn', {
     xtype: 'subjectcolumn',
 
     editor: {
-        xtype: 'combobox',
-        displayField: 'name',
-        valueField: 'code',
-        store: {
-            type: 'subject'
-        },
-        queryMode: 'local'
+        xtype: 'subjectcombo',
+        fieldLabel: null
     },
     renderer: function(v, m , r) {
         let store = m.column.getEditor().store;
-        let idx = store.find('code', v);
+        let idx = store.find('subject_id', v);
 
         if(idx != -1) {
             let subject = store.getAt(idx);
-            v = subject.get('name');
+            return subject.get('subject_name');
+        }else {
+            return null
         }
-
-        return v;
     }
 });

+ 1 - 1
frontend/pc-web/app/view/viewport/ViewportController.js

@@ -63,7 +63,7 @@ Ext.define('school.view.viewport.ViewportController', {
                     schoolSecret: res.data.school_secret,
                 };
                 me.getViewModel().setData(d);
-                me.getViewModel().get('store_grade').load();
+                me.getViewModel().get('store_gradeclass').load();
             }
         })
         .catch(function(e) {

+ 18 - 11
frontend/pc-web/app/view/viewport/ViewportModel.js

@@ -25,7 +25,7 @@ Ext.define('school.view.viewport.ViewportModel', {
                 }
             }
         },
-        store_grade: {
+        store_gradeclass: {
             type: 'tree',
             autoLoad: false,
             // model: 'school.model.Grade',
@@ -64,18 +64,25 @@ Ext.define('school.view.viewport.ViewportModel', {
             },
             listeners: {
                 load: function(store, records) {
-                    let stores = school.store;
-                    let mainModel = Ext.getCmp('mainView').getViewModel();
-                    let gradeStore = Ext.create('school.store.Grade', {
-                        data: records.map(function(r) {
-                            let d = r.data;
+                    let classData = [];
+                    let gradeData = records.map(function(r) {
+                        let d = r.data;
+                        let c = d.children.map(function(h) {
                             return {
-                                grade_id: d._id,
-                                grade_name: d.text,
+                                value: h._id,
+                                name: h.text,
+                                gradeId: d._id,
+                                gradeName: d.text
                             }
-                        })
-                    });
-                    mainModel.set('grade_store', gradeStore);
+                        });
+                        classData = classData.concat(c);
+                        return {
+                            value: d._id,
+                            name: d.text,
+                        }
+                    })
+                    Ext.StoreMgr.get('store_grade').loadData(gradeData);
+                    Ext.StoreMgr.get('store_class').loadData(classData);
                 }
             }
         }