Browse Source

Merge remote-tracking branch 'origin/dev' into qcloud

chenw 6 years ago
parent
commit
3dd8038329
100 changed files with 1607 additions and 288 deletions
  1. 0 1
      applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/lib/DahuaLibrary.java
  2. 6 0
      applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/lib/DahuaSdk.java
  3. 18 8
      applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/service/DahuaDataAnalyzeService.java
  4. 3 1
      applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/service/DahuaDeviceService.java
  5. 3 0
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/mapper/StudentInfoMapper.java
  6. 2 0
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/po/StudentInfo.java
  7. 4 0
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/service/impl/AccessControlServiceImpl.java
  8. 6 1
      applications/device/device-server/src/main/resources/mapper/StudentInfoMapper.xml
  9. 14 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/ClassServiceImpl.java
  10. 3 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/GradeServiceImpl.java
  11. 33 7
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/StudentServiceImpl.java
  12. 13 4
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/TeacherServiceImpl.java
  13. 7 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/controller/HomeWorkController.java
  14. 7 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/controller/NoticeController.java
  15. 5 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/controller/PrincipalMailController.java
  16. 2 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/PrincipalMailService.java
  17. 9 5
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/impl/NoticeServiceImpl.java
  18. 8 6
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/impl/PrincipalMailServiceImpl.java
  19. 6 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/impl/ScoreServiceImpl.java
  20. 26 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/common/controller/PortalController.java
  21. 17 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/common/service/PortalService.java
  22. 36 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/common/service/impl/PortalServiceImpl.java
  23. 51 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/PortalMapper.java
  24. 2 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/PrincipalMailboxMapper.java
  25. 5 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/SysClazzMapper.java
  26. 7 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/SysStudentMapper.java
  27. 4 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/MeetingDO.java
  28. 2 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/ParentsDO.java
  29. 20 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/ScoreImportdetail.java
  30. 40 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/StuScore.java
  31. 8 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/StuScoreDO.java
  32. 20 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/SysSchool.java
  33. 1 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/TeacherDO.java
  34. 2 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/controller/WxClazzPictureController.java
  35. 33 15
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/controller/WxNotifyController.java
  36. 68 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/controller/WxUserController.java
  37. 1 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/WxClazzPictureService.java
  38. 6 5
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/WxNotifyService.java
  39. 9 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/WxUserService.java
  40. 8 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxClazzPictureServiceImpl.java
  41. 5 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxMeetingServiceImpl.java
  42. 37 11
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxNotifyServiceImpl.java
  43. 9 3
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxOaApproveServiceImpl.java
  44. 2 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxPrincipalMailboxServiceImpl.java
  45. 57 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxUserServiceImpl.java
  46. 1 0
      applications/school/school-server/src/main/resources/application.yml
  47. BIN
      applications/school/school-server/src/main/resources/auth/pri.key
  48. 1 4
      applications/school/school-server/src/main/resources/config/application-docker-prod.yml
  49. 5 5
      applications/school/school-server/src/main/resources/mapper/NotifyMapper.xml
  50. 32 0
      applications/school/school-server/src/main/resources/mapper/PortalMapper.xml
  51. 18 1
      applications/school/school-server/src/main/resources/mapper/PrincipalMailboxMapper.xml
  52. 61 9
      applications/school/school-server/src/main/resources/mapper/ScoreMapper.xml
  53. 19 0
      applications/school/school-server/src/main/resources/mapper/SysClazzMapper.xml
  54. 1 1
      applications/school/school-server/src/main/resources/mapper/SysGradeMapper.xml
  55. 9 4
      applications/school/school-server/src/main/resources/mapper/SysSchoolMapper.xml
  56. 3 0
      applications/school/school-server/src/main/resources/mapper/SysStudentMapper.xml
  57. 4 2
      applications/school/school-server/src/main/resources/mapper/WxParentsMapper.xml
  58. 3 1
      applications/school/school-server/src/main/resources/mapper/WxStuScoreMapper.xml
  59. 3 2
      applications/school/school-server/src/main/resources/mapper/WxTeacherMapper.xml
  60. 16 4
      base-servers/gateway-server/src/main/java/com/usoftchina/smartschool/gateway/config/AuthFilter.java
  61. 14 0
      base-servers/gateway-server/src/main/resources/application.yml
  62. 15 0
      frontend/pc-web/app/model/Score.js
  63. 109 0
      frontend/pc-web/app/view/Interaction/mailbox/Detail.js
  64. 90 0
      frontend/pc-web/app/view/Interaction/mailbox/DetailController.js
  65. 26 0
      frontend/pc-web/app/view/Interaction/mailbox/DetailModel.js
  66. 4 16
      frontend/pc-web/app/view/Interaction/mailbox/List.js
  67. 2 2
      frontend/pc-web/app/view/Interaction/mailbox/ListController.js
  68. 2 1
      frontend/pc-web/app/view/Interaction/notice/SchoolNotice.js
  69. 57 4
      frontend/pc-web/app/view/Interaction/score/Detail.js
  70. 0 2
      frontend/pc-web/app/view/Interaction/score/DetailController.js
  71. 4 2
      frontend/pc-web/app/view/Interaction/score/List.js
  72. 56 4
      frontend/pc-web/app/view/basic/school/SchoolInfo.js
  73. 3 1
      frontend/pc-web/app/view/basic/student/StudentDetail.js
  74. 3 2
      frontend/pc-web/app/view/core/form/FormPanel.js
  75. 26 9
      frontend/pc-web/app/view/core/form/field/FileField.js
  76. 4 0
      frontend/pc-web/app/view/core/form/field/RemoteImgField.js
  77. 39 4
      frontend/pc-web/app/view/core/form/field/TrashField.js
  78. 2 10
      frontend/pc-web/app/view/home/Home.js
  79. 37 0
      frontend/pc-web/app/view/home/HomeModel.js
  80. 12 24
      frontend/pc-web/app/view/home/InfoCard.js
  81. 1 0
      frontend/pc-web/app/view/home/InfoCard.scss
  82. 105 0
      frontend/pc-web/app/view/home/charts/InOutRecord.js
  83. 3 1
      frontend/pc-web/app/view/viewport/ViewportController.js
  84. 2 1
      frontend/pc-web/ext/packages/modern-locale/overrides/zh_CN/field/Text.js
  85. 13 7
      frontend/wechat-web/src/components/PrincipalItem.jsx
  86. 15 1
      frontend/wechat-web/src/components/UploadEnclosure.jsx
  87. 14 8
      frontend/wechat-web/src/configs/api.config.js
  88. 1 1
      frontend/wechat-web/src/configs/router.config.js
  89. 3 0
      frontend/wechat-web/src/modules/accountBind/AccountBind.jsx
  90. 6 4
      frontend/wechat-web/src/modules/accountBind/BindMenu.jsx
  91. 8 2
      frontend/wechat-web/src/modules/album/PictureList.jsx
  92. 2 0
      frontend/wechat-web/src/modules/album/UploadImage.css
  93. 42 6
      frontend/wechat-web/src/modules/album/UploadImage.jsx
  94. 12 32
      frontend/wechat-web/src/modules/announce/AnnounceRelease.jsx
  95. 13 3
      frontend/wechat-web/src/modules/hiPages/LeaveDetail/LeaveDetail.js
  96. 33 4
      frontend/wechat-web/src/modules/hiPages/approvel-detail/ApprovelDetail.js
  97. 5 1
      frontend/wechat-web/src/modules/hiPages/approvel-detail/ItemApprovel.js
  98. 4 4
      frontend/wechat-web/src/modules/hiPages/approvel/Approvel.js
  99. 1 1
      frontend/wechat-web/src/modules/hiPages/field-trip/FieldTrip.css
  100. 18 10
      frontend/wechat-web/src/modules/hiPages/meet-detail/MeetDetail.js

+ 0 - 1
applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/lib/DahuaLibrary.java

@@ -776,7 +776,6 @@ public interface DahuaLibrary extends Library {
                     ", byLeftLogTimes=" + (byLeftLogTimes & 0xff) +
                     ", bReserved=" + new String(bReserved) +
                     ", nLockLeftTime=" + nLockLeftTime +
-                    ", Reserved=" + Arrays.toString(Reserved) +
                     '}';
         }
     }

+ 6 - 0
applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/lib/DahuaSdk.java

@@ -39,6 +39,10 @@ public class DahuaSdk {
      */
     private int tryTimes = 1;
 
+    private fDisConnect disConnect;
+
+    private fHaveReConnect haveReConnect;
+
     /**
      * 拷贝DLL资源到临时目录,解决fat jar无法加载DLL问题
      *
@@ -95,6 +99,8 @@ public class DahuaSdk {
      * @return
      */
     public boolean init(fDisConnect disConnect, fHaveReConnect haveReConnect) {
+        this.disConnect = disConnect;
+        this.haveReConnect = haveReConnect;
         initialized = instance.CLIENT_Init(disConnect, new NativeLong());
         if (!initialized) {
             logger.error("SDK initialize failed");

+ 18 - 8
applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/service/DahuaDataAnalyzeService.java

@@ -29,12 +29,12 @@ public class DahuaDataAnalyzeService {
     /**
      * 多个登录设备的监听句柄
      */
-    private Map<Long, NativeLong> analyzerHandles;
+    private Map<Long, AnalyzerData> analyzers;
     private final Logger logger = LoggerFactory.getLogger(DahuaDataAnalyzeService.class);
 
     public DahuaDataAnalyzeService(DahuaSdk sdk) {
         this.sdk = sdk;
-        this.analyzerHandles = new HashMap<>();
+        this.analyzers = new HashMap<>();
     }
 
     /**
@@ -45,11 +45,21 @@ public class DahuaDataAnalyzeService {
      */
     public void startListen(DeviceInfo device, NativeLong loginHandle) {
         long key = loginHandle.longValue();
-        if (key != 0 && !analyzerHandles.containsKey(key)) {
+        if (key != 0 && !analyzers.containsKey(key)) {
+            fAnalyzerDataCallBack callback = new AnalyzerDataCallBack(device);
             NativeLong lAnalyzerHandle = sdk.getInstance().CLIENT_RealLoadPictureEx(loginHandle, 0,
-                    DahuaEvents.EVENT_IVS_ALL, true, new AnalyzerDataCallBack(device),
-                    new NativeLong(), null);
-            analyzerHandles.put(key, lAnalyzerHandle);
+                    DahuaEvents.EVENT_IVS_ALL, true, callback, new NativeLong(), null);
+            analyzers.put(key, new AnalyzerData(lAnalyzerHandle, callback));
+        }
+    }
+
+    class AnalyzerData {
+        public NativeLong handle;
+        public fAnalyzerDataCallBack callback;
+
+        public AnalyzerData(NativeLong handle, fAnalyzerDataCallBack callback) {
+            this.handle = handle;
+            this.callback = callback;
         }
     }
 
@@ -104,8 +114,8 @@ public class DahuaDataAnalyzeService {
      */
     public void stopListen(NativeLong loginHandle) {
         long key = loginHandle.longValue();
-        if (key != 0 && analyzerHandles.containsKey(key)) {
-            boolean bRet = sdk.getInstance().CLIENT_StopLoadPic(analyzerHandles.get(key));
+        if (key != 0 && analyzers.containsKey(key)) {
+            boolean bRet = sdk.getInstance().CLIENT_StopLoadPic(analyzers.get(key).handle);
             if (!bRet) {
                 throw new DahuaSdkException(sdk.getLastError());
             }

+ 3 - 1
applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/service/DahuaDeviceService.java

@@ -28,6 +28,7 @@ public class DahuaDeviceService implements DeviceApi {
      * 多个设备的登录句柄
      */
     private Map<DeviceId, NativeLong> loginHandles;
+    private NET_DEVICEINFO_Ex deviceInfo;
     private final Logger logger = LoggerFactory.getLogger(DahuaDeviceService.class);
     private final DahuaDataAnalyzeService dataAnalyzeService;
 
@@ -59,8 +60,9 @@ public class DahuaDeviceService implements DeviceApi {
      */
     private NativeLong login(String m_strIp, int m_nPort, String m_strUser, String m_strPassword) {
         IntByReference nError = new IntByReference(0);
+        deviceInfo = new NET_DEVICEINFO_Ex();
         NativeLong m_hLoginHandle = sdk.getInstance().CLIENT_LoginEx2(m_strIp, m_nPort, m_strUser, m_strPassword,
-                0, null, new NET_DEVICEINFO_Ex(), nError);
+                EM_LOGIN_SPAC_CAP_TYPE.EM_LOGIN_SPEC_CAP_TCP, null, deviceInfo, nError);
         if (m_hLoginHandle.longValue() == 0) {
             DahuaSdkError error = sdk.getLastError();
             logger.error("Device[{}] Port[{}] Login Failed. Last Error[{}]", m_strIp, m_nPort, error);

+ 3 - 0
applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/mapper/StudentInfoMapper.java

@@ -2,6 +2,7 @@ package com.usoftchina.smartschool.device.mapper;
 
 import com.usoftchina.smartschool.device.po.StudentInfo;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -12,4 +13,6 @@ import java.util.List;
 @Mapper
 public interface StudentInfoMapper {
     List<StudentInfo> selectInfoByCardNo(String cardNo);
+
+    void updatePhoto(@Param("photo") String photo, @Param("stuId") Long stuId);
 }

+ 2 - 0
applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/po/StudentInfo.java

@@ -35,4 +35,6 @@ public class StudentInfo implements Serializable{
 
     private int stuSex;
 
+    private String stuPhoto;
+
 }

+ 4 - 0
applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/service/impl/AccessControlServiceImpl.java

@@ -82,6 +82,10 @@ public class AccessControlServiceImpl implements AccessControlService{
             try {
                 fileInfo = fileApi.upload(0L, new ByteArrayMultipartFile("file", information.get(0).getStuName() + ".jpg", "application/jpeg", imageData));
                 filePath = fileInfo.getData().getAccessPath();
+                StudentInfo studentInfo = information.get(0);
+                if (StringUtils.isEmpty(studentInfo.getStuPhoto())) {
+                    studentInfoMapper.updatePhoto(studentInfo.getStuPhoto(), studentInfo.getStuId());
+                }
             }catch (Exception ex) {
                 logger.error(ex.getMessage());
             }

+ 6 - 1
applications/device/device-server/src/main/resources/mapper/StudentInfoMapper.xml

@@ -3,11 +3,15 @@
 <mapper namespace="com.usoftchina.smartschool.device.mapper.StudentInfoMapper" >
     <select id="selectInfoByCardNo" parameterType="string" resultMap="studentInfo">
         select school_appid,school_secret,sys_parents.openid,sys_student.stu_name,sys_student.stu_id,sys_school.school_id,
-         stu_number,sys_student.clazz_id,stu_class,stu_grade,stu_classnickname,stu_sex from sys_student left join sys_school on sys_student.school_id=sys_school.school_id
+         stu_number,sys_student.clazz_id,stu_class,stu_grade,stu_classnickname,stu_sex,stu_photo from sys_student left join sys_school on sys_student.school_id=sys_school.school_id
         left join sys_parents_stu on sys_student.stu_id=sys_parents_stu.stu_id left join sys_parents on sys_parents.parent_id =
         sys_parents_stu.parent_id where stu_cardNo = #{cardNo} and  ifnull(openid,'') != ''
     </select>
 
+    <update id="updatePhoto">
+      update sys_student set stu_photo = #{photo} where stu_id = #{stuId}
+    </update>
+
     <resultMap id="studentInfo" type="com.usoftchina.smartschool.device.po.StudentInfo" >
         <result column="school_appid" property="appId" jdbcType="VARCHAR" />
         <result column="school_secret" property="secret" jdbcType="VARCHAR" />
@@ -21,5 +25,6 @@
         <result column="stu_grade" property="stuGrade" jdbcType="VARCHAR" />
         <result column="stu_classnickname" property="stuClassnickname" jdbcType="VARCHAR"/>
         <result column="stu_sex" property="stuSex" jdbcType="INTEGER"/>
+        <result column="stu_photo" property="stuPhoto" jdbcType="VARCHAR"/>
     </resultMap>
 </mapper>

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

@@ -95,13 +95,26 @@ public class ClassServiceImpl implements ClassService{
         for (SysTeacherClazz detail : teachers) {
             detail.setClazz_id(clazz.getClazz_id());
             Integer count = 0;
-            count = sysClazzMapper.teacherClazz(detail.getSubject_name(),clazz.getClazz_id());
+            count = sysClazzMapper.teacherClazz(detail.getSubject_name(),detail.getTeacher_name(), clazz.getClazz_id());
             if(count > 0){
                 throw new BizException(BizExceptionCode.REPEAT_SUBJECTS);
             }
             if (StringUtils.isEmpty(detail.getTeacher_clazz_id()) || "0".equals(detail.getTeacher_clazz_id().toString())) {
+                count = sysClazzMapper.teacherSubject(detail.getSubject_name(), clazz.getClazz_id());
+                if(count > 0){
+                    throw new BizException(BizExceptionCode.REPEAT_SUBJECTS);
+                }
                 insertDetails.add(detail);
             } else {
+                count = sysClazzMapper.teacherSubject(detail.getSubject_name(), clazz.getClazz_id());
+                List<SysTeacherClazz> teacherName = sysClazzMapper.selectTeacherSubject(detail.getTeacher_clazz_id());
+                for(SysTeacherClazz teacherNames:teacherName){
+                    if(count > 0 && teacherNames.getTeacher_name() == detail.getTeacher_name()){
+                        if(teacherNames.getTeacher_name() == detail.getTeacher_name()){
+                            throw new BizException(BizExceptionCode.REPEAT_SUBJECTS);
+                        }
+                    }
+                }
                 updateDetails.add(detail);
             }
         }

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

@@ -266,7 +266,9 @@ public class GradeServiceImpl implements GradeService{
         SysGrade oldGrade = sysGradeMapper.selectByPrimaryKey(grade.getGrade_id());
         if (!oldGrade.getGrade_name().equals(grade.getGrade_name())) {
             List<SysClazz> clazzList = sysClazzMapper.selectBygrade(grade.getGrade_id());
-            sysStudentMapper.updateGradeName(grade.getGrade_name(), clazzList);
+            if (!CollectionUtils.isEmpty(clazzList)) {
+                sysStudentMapper.updateGradeName(grade.getGrade_name(), clazzList);
+            }
         }
         DocBaseDTO docBaseDTO = new DocBaseDTO(grade.getGrade_id(), CODE,  NAME);
         sysGradeMapper.updateByPrimaryKeySelective(grade);

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

@@ -15,11 +15,9 @@ 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.DataImportMapper;
-import com.usoftchina.smartschool.school.mapper.SysClazzMapper;
-import com.usoftchina.smartschool.school.mapper.SysGradeMapper;
-import com.usoftchina.smartschool.school.mapper.SysStudentMapper;
+import com.usoftchina.smartschool.school.mapper.*;
 import com.usoftchina.smartschool.school.po.*;
+import com.usoftchina.smartschool.school.wxschool.mapper.WxUserMapper;
 import com.usoftchina.smartschool.utils.CollectionUtils;
 import com.usoftchina.smartschool.utils.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -47,9 +45,13 @@ public class StudentServiceImpl implements StudentService{
     @Autowired
     private SysGradeMapper sysGradeMapper;
     @Autowired
+    private SysTeacherMapper sysTeacherMapper;
+    @Autowired
     private SysClazzMapper sysClazzMapper;
     @Autowired
     private MessageLogService messageLogService;
+    @Autowired
+    private WxUserMapper userMapper;
 
     private static final String CODE = "Student";
     private static final String NAME = "学生信息";
@@ -168,15 +170,39 @@ public class StudentServiceImpl implements StudentService{
         }
         //更新从表
         if (updateDetails.size() > 0) {
+            //更新账户信息表的手机号
+            for (SysParents item : updateDetails) {
+                SysParents sysParents = sysStudentMapper.selectParentById(item.getParent_id());
+                if (!ObjectUtils.isEmpty(sysParents)) {
+                    if (!item.getPa_phone().equals(sysParents.getPa_phone())) {
+                        UserDO userDO = new UserDO();
+                        UserDO oldUserDO = userMapper.selectUserByPhone(sysParents.getPa_phone());
+                        if (!ObjectUtils.isEmpty(oldUserDO)) {
+                            userDO.setUserId(oldUserDO.getUserId());
+                            userDO.setUserPhone(item.getPa_phone());
+                            userMapper.update(userDO);
+                            SysTeacher oldSysTeacher = sysTeacherMapper.selectByPhone(sysParents.getPa_phone(), schoolid);
+                            if (!ObjectUtils.isEmpty(oldSysTeacher)){
+                                SysTeacher sysTeacher = new SysTeacher();
+                                sysTeacher.setTeacher_phone(item.getPa_phone());
+                                sysTeacher.setTeacher_id(oldSysTeacher.getTeacher_id());
+                                sysTeacherMapper.updateByPrimaryKeySelective(sysTeacher);
+                            }
+                        }
+                    }
+                }
+            }
+            //更新明细表
             sysStudentMapper.updateParents(updateDetails);
             for (SysParents item : updateDetails) {
-                SysParents sysParents = sysStudentMapper.selectParentByPhone(item.getPa_phone(), schoolid);
+                /*SysParents sysParents = sysStudentMapper.selectParentByPhone(item.getPa_phone(), schoolid);
                 if (ObjectUtils.isEmpty(sysParents)) {
                     //自动创建家长账户
                     if (!StringUtils.isEmpty(item.getPa_phone())) {
-                        Long userId = createAccount(item.getPa_phone());
+                        //更新账户信息表的手机号
+
                     }
-                }
+                }*/
                 sysStudentMapper.updateRelation(item.getParent_stu_id(), item.getPs_relation());
             }
         }

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

@@ -17,10 +17,8 @@ import com.usoftchina.smartschool.school.dto.ListReqDTO;
 import com.usoftchina.smartschool.school.exception.BizExceptionCode;
 import com.usoftchina.smartschool.school.mapper.DataImportMapper;
 import com.usoftchina.smartschool.school.mapper.SysTeacherMapper;
-import com.usoftchina.smartschool.school.po.DataImportDetail;
-import com.usoftchina.smartschool.school.po.SysTeacher;
-import com.usoftchina.smartschool.school.po.TeacherDetail;
-import com.usoftchina.smartschool.school.po.TeacherForm;
+import com.usoftchina.smartschool.school.po.*;
+import com.usoftchina.smartschool.school.wxschool.mapper.WxUserMapper;
 import com.usoftchina.smartschool.utils.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -45,6 +43,8 @@ public class TeacherServiceImpl implements TeacherService{
     private AccountApi accountApi;
     @Autowired
     private MessageLogService messageLogService;
+    @Autowired
+    private WxUserMapper userMapper;
 
     private static final String CODE = "Teacher";
     private static final String NAME = "教职工信息";
@@ -104,6 +104,15 @@ public class TeacherServiceImpl implements TeacherService{
                     !(sysTeacherMapper.selectNumberByKey(formdata.getTeacher_number()).getTeacher_id().equals(formdata.getTeacher_id()))){
                 throw new BizException(BizExceptionCode.REPEAT_TEACHER_NUMBER);
             }
+            //如果手机号发生变更时,更新手机账户表的手机号
+            SysTeacher sysTeacher = sysTeacherMapper.selectByPrimaryKey(formdata.getTeacher_id());
+            String oldPhone = sysTeacher.getTeacher_phone();
+            if (!oldPhone.equals(formdata.getTeacher_phone())){
+                UserDO userDO = new UserDO();
+                userDO.setUserId(sysTeacher.getUser_id());
+                userDO.setUserPhone(formdata.getTeacher_phone());
+                userMapper.update(userDO);
+            }
             sysTeacherMapper.updateByPrimaryKeySelective(formdata);
             docBaseDTO = new DocBaseDTO(formdata.getTeacher_id(), CODE,  NAME);
             messageLogService.update(docBaseDTO);

+ 7 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/controller/HomeWorkController.java

@@ -58,4 +58,11 @@ public class HomeWorkController {
         homeWorkService.publish(id);
         return Result.success();
     }
+
+    @PostMapping("/savePublish")
+    public Result saveAndPublish(@RequestBody HomeWork data){
+        DocBaseDTO docBaseDTO = homeWorkService.save(data);
+        homeWorkService.publish(docBaseDTO.getId());
+        return Result.success();
+    }
 }

+ 7 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/controller/NoticeController.java

@@ -60,4 +60,11 @@ public class NoticeController {
         return Result.success();
     }
 
+    @PostMapping("/savePublish")
+    public Result savePublish(@RequestBody Notify data){
+        DocBaseDTO baseDTO = noticeService.save(data);
+        noticeService.publish(baseDTO.getId());
+        return Result.success();
+    }
+
 }

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

@@ -29,6 +29,11 @@ public class PrincipalMailController {
         return Result.success(data);
     }
 
+    @GetMapping("/read/{id}")
+    public Result getFormdata(@PathVariable("id") Long id) {
+        PrincipalMail formdata = principalMailService.getFormdata(id);
+        return Result.success(formdata);
+    }
 
     /**
      * @param baseDTOs

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

@@ -16,4 +16,6 @@ public interface PrincipalMailService {
     void batchUnIgnore(BatchDealBaseDTO baseDTOs);
 
     void reply(String msg, Long id);
+
+    PrincipalMail getFormdata(Long id);
 }

+ 9 - 5
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/impl/NoticeServiceImpl.java

@@ -151,9 +151,9 @@ public class NoticeServiceImpl implements NoticeService{
         List<SchoolNoticer> noticerList = new ArrayList<>();
         noticers.forEach(noticer -> {
             MessageInfoDTO msg = new MessageInfoDTO();
-            String endUrl = null;
+            String url = null;
             if (!StringUtils.isEmpty(noticer.getType()) && !StringUtils.isEmpty(noticer.getPersonId())) {
-                if ("1".equals(noticer.getType().split(",")[0])) {
+                /*if ("1".equals(noticer.getType().split(",")[0])) {
                     endUrl = "/parent/" + id + "?stuId=" + noticer.getPersonId().split(",")[0];
                     noticer.setType("1");
                     noticer.setPersonId(noticer.getPersonId().split(",")[0]);
@@ -161,9 +161,12 @@ public class NoticeServiceImpl implements NoticeService{
                     endUrl = "/teacher/" + id + "?teacherId=" + noticer.getPersonId().split(",")[0];
                     noticer.setType("0");
                     noticer.setPersonId(noticer.getPersonId().split(",")[0]);
-                }
-                noticerList.add(noticer);
-                String url = baseWechatUrl + "/notifyDetail" + endUrl;
+                }*/
+
+                url = baseWechatUrl + "/notifyDetail/person/" + id + "?personId=" + noticer.getPersonId().split(",")[0] +
+                        "&type=" + noticer.getType().split(",")[0];
+                noticer.setType(noticer.getType().split(",")[0]);
+                noticer.setPersonId(noticer.getPersonId().split(",")[0]);
                 msg.setUrl(url);
                 msg.setTitle(data.getNotify_title());
                 msg.setKeyword1(school.getSchool_name());
@@ -176,6 +179,7 @@ public class NoticeServiceImpl implements NoticeService{
                 msg.setAppId(school.getSchool_appid());
                 msg.setSecret(school.getSchool_secret());
                 msgs.add(msg);
+                noticerList.add(noticer);
             }
         });
         noticeMapper.insertDetailBySelective(noticerList, id);

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

@@ -84,13 +84,15 @@ public class PrincipalMailServiceImpl implements PrincipalMailService {
         }
         //更新主表
         principalMailboxMapper.updateReply(msg, id);
+    }
 
-        PrincipalReplyDO replyDO = new PrincipalReplyDO();
-        replyDO.setMailboxId(id);
-        replyDO.setReplyContent(msg);
-        replyDO.setReplyDate(new Date());
-        //插入从表
-        principalMailboxMapper.insertDetail(replyDO);
+    @Override
+    public PrincipalMail getFormdata(Long id) {
+        if (StringUtils.isEmpty(id) || "0".equals(id)) {
+            throw new BizException(BizExceptionCode.USELESS_DATA);
+        }
+        PrincipalMail data = principalMailboxMapper.selectByPrimaryKey(id);
+        return data;
     }
 
     private void singleDelete(Long id) {

+ 6 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/impl/ScoreServiceImpl.java

@@ -262,6 +262,11 @@ public class ScoreServiceImpl implements ScoreService{
             appScore.setStu_id(detail.getSd_stuid());
             appScore.setStu_name(detail.getSd_stu());
             appScore.setScore_type(main.getSi_examtitle());
+            appScore.setScore_total(detail.getSd_total().doubleValue());
+            appScore.setClass_rank(detail.getSd_class_rank());
+            appScore.setGrade_rank(detail.getSd_grade_rank());
+            appScore.setClass_average(detail.getSd_class_average());
+            appScore.setGrade_average(detail.getSd_grade_average());
             appScores.add(appScore);
         }
         scoreMapper.batchInsert(appScores);
@@ -283,7 +288,7 @@ public class ScoreServiceImpl implements ScoreService{
             msg.setKeyword3(main.getSi_examtitle());
             msg.setKeyword4(DateUtils.format(main.getSi_examdate(),"yyyy-MM-dd"));
             msg.setKeyword5(school.getSchool_name());
-            msg.setRemark(noticer.getSubject()+ "成绩为:" + new BigDecimal(noticer.getScore()).toPlainString());
+            msg.setRemark(noticer.getSubject()+ "成绩为:" + new BigDecimal(noticer.getScore()).setScale(2, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString());
             msg.setTemplateId(template.getSt_templateid());
             msg.setTouser(noticer.getOpenid());
             msg.setAppId(school.getSchool_appid());

+ 26 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/common/controller/PortalController.java

@@ -0,0 +1,26 @@
+package com.usoftchina.smartschool.school.common.controller;
+
+import com.usoftchina.smartschool.base.Result;
+import com.usoftchina.smartschool.school.common.service.PortalService;
+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;
+
+/**
+ * @Author chenwei
+ * @Date 2019-03-28
+ */
+@RestController
+@RequestMapping("/portal")
+public class PortalController {
+
+    @Autowired
+    private PortalService portalService;
+
+    @GetMapping("/home")
+    public Result getHomeData(){
+        return Result.success(portalService.getHomeData());
+    }
+
+}

+ 17 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/common/service/PortalService.java

@@ -0,0 +1,17 @@
+package com.usoftchina.smartschool.school.common.service;
+
+import java.util.Map;
+
+/**
+ * @Author chenwei
+ * @Date 2019-03-28
+ */
+public interface PortalService {
+
+    /**
+     * 获取首页图表数据
+     * @return
+     */
+    Map<String, Object> getHomeData();
+
+}

+ 36 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/common/service/impl/PortalServiceImpl.java

@@ -0,0 +1,36 @@
+package com.usoftchina.smartschool.school.common.service.impl;
+
+import com.usoftchina.smartschool.context.BaseContextHolder;
+import com.usoftchina.smartschool.school.common.service.PortalService;
+import com.usoftchina.smartschool.school.mapper.PortalMapper;
+import com.usoftchina.smartschool.utils.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Author chenwei
+ * @Date 2019-03-28
+ */
+@Service
+public class PortalServiceImpl implements PortalService {
+
+    @Autowired
+    private PortalMapper portalMapper;
+
+    @Override
+    public Map<String, Object> getHomeData() {
+        Map<String, Object> result = new HashMap<>();
+        Long schoolId = BaseContextHolder.getSchoolId();
+        result.put("student", portalMapper.getStudentsCount(schoolId));
+        result.put("parent", portalMapper.getParentsCount(schoolId));
+        result.put("teacher", portalMapper.getTeachersCount(schoolId));
+        result.put("grade", portalMapper.getGradeCount(schoolId));
+        result.put("class", portalMapper.getClassCount(schoolId));
+        result.put("inoutRecord", portalMapper.getInOutRecord(schoolId));
+        return result;
+    }
+}

+ 51 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/PortalMapper.java

@@ -0,0 +1,51 @@
+package com.usoftchina.smartschool.school.mapper;
+
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Author chenwei
+ * @Date 2019-03-28
+ */
+@Mapper
+public interface PortalMapper {
+
+    /**
+     * 获取学生人数,状态为1(正常)
+     * @return
+     */
+    int getStudentsCount(Long schoolId);
+
+    /**
+     * 获取教师人数,状态为1(使用中)
+     * @return
+     */
+    int getTeachersCount(Long schoolId);
+
+    /**
+     * 获取家长人数,状态为1(使用中)
+     * @return
+     */
+    int getParentsCount(Long schoolId);
+
+    /**
+     * 获取年级个数,状态为1(使用中)
+     * @return
+     */
+    int getGradeCount(Long schoolId);
+
+    /**
+     * 获取班级个数,状态为1(使用中)
+     * @return
+     */
+    int getClassCount(Long schoolId);
+
+    /**
+     * 出入校记录
+     * @param schoolId
+     * @return
+     */
+    List<Map<String, String>> getInOutRecord(Long schoolId);
+}

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

@@ -13,9 +13,9 @@ public interface PrincipalMailboxMapper {
   int deleteByPrimaryKey(Long mailbox_id);
   /*  int insert(PrincipalMailboxDO record);
 
-    int insertSelective(PrincipalMailboxDO record);
+    int insertSelective(PrincipalMailboxDO record);*/
 
-    PrincipalMailboxDO selectByPrimaryKey(Long mailbox_id);*/
+    PrincipalMail selectByPrimaryKey(Long mailbox_id);
 
     List<PrincipalMail> selectByConditon(@Param("con") String condition, @Param("school_id") Long schoolId);
 

+ 5 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/SysClazzMapper.java

@@ -35,7 +35,11 @@ public interface SysClazzMapper {
 
     int countClazz(@Param("clazz_name") String clazz_name, @Param("clazz_grade") String clazz_grade, @Param("school_id") Long school_id);
 
-    Integer teacherClazz(@Param("subject_name") String subject_name, @Param("clazz_id") Long clazz_id);
+    Integer teacherClazz(@Param("subject_name") String subject_name, @Param("teacher_name") String teacher_name, @Param("clazz_id") Long clazz_id);
+
+    Integer teacherSubject(@Param("subject_name") String subject_name, @Param("clazz_id") Long clazz_id);
+
+    List<SysTeacherClazz> selectTeacherSubject(@Param("clazz_id") Long clazz_id);
 
     SysClazz selectByClazzName(@Param("clazz_grade") String clazz_grade, @Param("clazz_name") String clazz_name, @Param("school_id") Long school_id);
 }

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

@@ -104,4 +104,11 @@ public interface SysStudentMapper {
      * @return
      */
     int countName(@Param("stu_name") String stu_name, @Param("school_id") Long school_id);
+
+    /**
+     * 通过id查找parent
+     * @param id
+     * @return
+     */
+    SysParents selectParentById(Long id);
 }

+ 4 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/MeetingDO.java

@@ -55,5 +55,8 @@ public class MeetingDO implements Serializable {
 	private List<MeetingRecordsDO> sign;
 
 	private List<MeetingRecordsDO> unSign;
-
+    //与会人员
+	private List<MeetingRecordsDO> meetingPerson;
+    //已签到人数
+    private Integer signCount;
 }

+ 2 - 2
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/ParentsDO.java

@@ -45,6 +45,6 @@ public class ParentsDO implements Serializable {
 	private String parentsHonor;
 	//备注
 	private String parentsRemarks;
-
-
+    //手机号
+    private String paPhone;
 }

+ 20 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/ScoreImportdetail.java

@@ -23,4 +23,24 @@ public class ScoreImportdetail implements Serializable{
     private Long school_id;
 
     private String sd_stuNumber;
+    /**
+     * 总分
+     */
+    private Long sd_total;
+    /**
+     * 班级排名
+     */
+    private Long sd_class_rank;
+    /**
+     * 年级排名
+     */
+    private Long sd_grade_rank;
+    /**
+     * 班级平均分
+     */
+    private Double sd_class_average;
+    /**
+     * 年级平均分
+     */
+    private Double sd_grade_average;
 }

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

@@ -41,6 +41,46 @@ public class StuScore {
 
     private String exam_title;
 
+    private Long class_rank;
+
+    private Long grade_rank;
+
+    private Double class_average;
+
+    private Double grade_average;
+
+    public Long getClass_rank() {
+        return class_rank;
+    }
+
+    public void setClass_rank(Long class_rank) {
+        this.class_rank = class_rank;
+    }
+
+    public Long getGrade_rank() {
+        return grade_rank;
+    }
+
+    public void setGrade_rank(Long grade_rank) {
+        this.grade_rank = grade_rank;
+    }
+
+    public Double getClass_average() {
+        return class_average;
+    }
+
+    public void setClass_average(Double class_average) {
+        this.class_average = class_average;
+    }
+
+    public Double getGrade_average() {
+        return grade_average;
+    }
+
+    public void setGrade_average(Double grade_average) {
+        this.grade_average = grade_average;
+    }
+
     public Long getScore_id() {
         return score_id;
     }

+ 8 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/StuScoreDO.java

@@ -53,6 +53,13 @@ public class StuScoreDO implements Serializable {
 	private String gradeName;
 	//标题
 	private String examTitle;
-
+    //班级排名
+	private Integer classRank;
+    //年级排名
+	private Integer gradeRank;
+    //班级平均分
+	private Double classAverage;
+    //年级平均分
+	private Double gradeAverage;
 
 }

+ 20 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/SysSchool.java

@@ -27,10 +27,30 @@ public class SysSchool implements Serializable{
 
     private String school_accesssecret;
 
+    private Long teacher_id;
+
+    private String teacher_name;
+
     private List<SysGrade> children;
 
     private Boolean leaf = false;
 
+    public String getTeacher_name() {
+        return teacher_name;
+    }
+
+    public void setTeacher_name(String teacher_name) {
+        this.teacher_name = teacher_name;
+    }
+
+    public Long getTeacher_id() {
+        return teacher_id;
+    }
+
+    public void setTeacher_id(Long teacher_id) {
+        this.teacher_id = teacher_id;
+    }
+
     public String getSchool_accesssecret() {
         return school_accesssecret;
     }

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

@@ -52,5 +52,5 @@ public class TeacherDO implements Serializable {
 	//备注
 	private String teacherRemarks;
 
-
+    private String teacherPhone;
 }

+ 2 - 2
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/controller/WxClazzPictureController.java

@@ -30,9 +30,9 @@ public class WxClazzPictureController {
 	 * @return
 	 */
 	@PostMapping("/savePicture")
-	public ResultBean savePicture(@Param("albumId") Long albumId, @Param("pictureUrls") String pictureUrls){
+	public ResultBean savePicture(Long albumId,String pictureUrls, String albumTitle, String albumRemarks){
 		try {
-			String s = clazzPictureService.savePicture(albumId, pictureUrls);
+			String s = clazzPictureService.savePicture(albumId, pictureUrls, albumTitle, albumRemarks);
 			return new ResultBean(s);
 		}catch (Exception e){
 			return new ResultBean(e);

+ 33 - 15
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/controller/WxNotifyController.java

@@ -1,6 +1,9 @@
 package com.usoftchina.smartschool.school.wxschool.basic.controller;
 
 
+import com.usoftchina.smartschool.base.Result;
+import com.usoftchina.smartschool.exception.BizException;
+import com.usoftchina.smartschool.school.exception.BizExceptionCode;
 import com.usoftchina.smartschool.school.po.NotifyDO;
 import com.usoftchina.smartschool.school.wxschool.basic.service.WxNotifyService;
 import com.usoftchina.smartschool.school.wxschool.utils.ResultBean;
@@ -70,7 +73,7 @@ public class WxNotifyController {
 	 * @param notifyStatus
 	 * @param pageIndex
 	 * @param pageSize
-	 */
+	 *//*
 	@PostMapping("/notifyListByTeacher")
 	public ResultBean notifyListByTeacher(@Param("teacherId")Long teacherId, @Param("notifyStatus")Integer notifyStatus, @Param("pageIndex")Integer pageIndex, @Param("pageSize")Integer pageSize){
 		try {
@@ -79,31 +82,29 @@ public class WxNotifyController {
 		}catch (Exception e){
 			return new ResultBean(e);
 		}
-	}
+	}*/
 
 	/**
-	 * 家长分页显示
-	 * @param stuId
+	 * 分页显示 获取通知 type 0 家长 1 教师
 	 * @param notifyStatus
 	 * @param pageIndex
 	 * @param pageSize
 	 */
-	@PostMapping("/notifyListByStu")
-	public ResultBean notifyListByStu(@Param("stuId")Long stuId, @Param("notifyStatus")Integer notifyStatus, @Param("pageIndex")Integer pageIndex, @Param("pageSize")Integer pageSize){
-		try {
-			List<NotifyDO> notifyDOS = notifyService.notifyListByStu(stuId, notifyStatus, pageIndex, pageSize);
-			return new ResultBean(notifyDOS);
-		}catch (Exception e){
-			return new ResultBean(e);
+	@GetMapping("/notifyList")
+	public Result notifyList(Long personId, Integer notifyStatus, Integer pageIndex, Integer pageSize, Integer type){
+		if (null == type || null == personId) {
+			throw new BizException(BizExceptionCode.USELESS_DATA);
 		}
+		Object data = notifyService.notifyList(personId, notifyStatus, pageIndex, pageSize, type);
+		return Result.success(data);
 	}
 
-	/**
+/*	*//**
 	 * 家长端获取通知详情
 	 * @param notifyId
 	 * @param
 	 * @return
-	 */
+	 *//*
 	@PostMapping("/getNotifyDetails")
 	public ResultBean getNotifyDetails(@Param("notifyId")Long notifyId,@Param("stuId") Long stuId){
 		try {
@@ -114,12 +115,12 @@ public class WxNotifyController {
 		}
 	}
 
-	/**
+	*//**
 	 * 教师端获取通知详情
 	 * @param notifyId
 	 * @param teacherId
 	 * @return
-	 */
+	 *//*
 	@PostMapping("/getNotifyDetailsByTeacher")
 	public ResultBean getNotifyDetailsByTeacher(@Param("notifyId")Long notifyId, @Param("teacherId")Long teacherId){
 		try {
@@ -128,8 +129,25 @@ public class WxNotifyController {
 		}catch (Exception e){
 			return new ResultBean(e);
 		}
+	}*/
+
+	/**
+	* @Description 获取通知 type 0 家长 1 教师
+	* @Param: [notifyId, personId, type]
+	* @return: com.usoftchina.smartschool.base.Result
+	* @Author: guq
+	* @Date: 2019/3/27
+	*/
+	@GetMapping("/getNotify")
+	public Result<NotifyDO> getNotify(Long notifyId, Long personId, Integer type) {
+		if (null == type || null == notifyId || null == personId) {
+			throw new BizException(BizExceptionCode.USELESS_DATA);
+		}
+		NotifyDO data = notifyService.getNotify(notifyId, personId, type);
+		return Result.success(data);
 	}
 
+
 	/**
 	 * 删除创建的通知
 	 * @param notifyId

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

@@ -2,12 +2,18 @@ package com.usoftchina.smartschool.school.wxschool.basic.controller;
 
 import com.alibaba.fastjson.JSON;
 import com.github.kevinsawicki.http.HttpRequest;
+import com.usoftchina.smartschool.auth.dto.TokenDTO;
+import com.usoftchina.smartschool.auth.jwt.JwtHelper;
+import com.usoftchina.smartschool.auth.jwt.JwtInfo;
+import com.usoftchina.smartschool.auth.jwt.JwtToken;
+import com.usoftchina.smartschool.school.po.ParentsDO;
 import com.usoftchina.smartschool.school.po.SchoolDO;
 import com.usoftchina.smartschool.school.po.TeacherDO;
 import com.usoftchina.smartschool.school.wxschool.basic.service.WxSchoolService;
 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 com.usoftchina.smartschool.utils.BeanMapper;
 import org.apache.ibatis.annotations.Param;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -48,6 +54,11 @@ public class WxUserController {
 	@Autowired
 	private WxSchoolService schoolService;
 
+    @Value("${auth.private-key}")
+    private String privateKeyPath;
+
+    @Value("${auth.expire:72000}")
+    private int expire;
 
 	@Value("${smartschool.domain.wechat}")
 	private String wechatUrl;
@@ -79,6 +90,16 @@ public class WxUserController {
 			Assert.notNull(code,"请输入验证码");
 			Assert.notNull(openid,"openid不能为空");
 			Map<String, Object> map = userService.bindOpenid(userPhone, code, openid,headimgurl);
+            Object teacherDOS =  map.get("teacherDOS");
+            Object parentsDOS = map.get("parentsDOS");
+            TokenDTO tokenDTO = null;
+            //如果家长存在,APP进入后默认是家长身份
+            if (ObjectUtils.isNotEmpty(parentsDOS)) {
+                tokenDTO = generateToken(((List<ParentsDO>) parentsDOS).get(0));
+            }else {
+                tokenDTO = generateToken(((List<TeacherDO>) teacherDOS).get(0));
+            }
+            map.put("token", tokenDTO);
 			return new ResultBean(map);
 		}catch (Exception e){
 			return new ResultBean(e);
@@ -95,6 +116,14 @@ public class WxUserController {
 			if (ObjectUtils.isEmpty(teacherDOS)&&ObjectUtils.isEmpty(parentsDOS)){
 				return new ResultBean(false);
 			}else {
+                TokenDTO tokenDTO = null;
+			    //如果家长存在,APP进入后默认是家长身份
+			    if (ObjectUtils.isNotEmpty(parentsDOS)) {
+                    tokenDTO = generateToken(((List<ParentsDO>) parentsDOS).get(0));
+                }else {
+			        tokenDTO = generateToken(((List<TeacherDO>) teacherDOS).get(0));
+                }
+                map.put("token", tokenDTO);
 				return new ResultBean(map);
 			}
 		}catch (Exception e){
@@ -102,6 +131,45 @@ public class WxUserController {
 		}
 	}
 
+    /**
+     * 身份切换
+     * @param personId  用户ID
+     * @param type      1: 教师   0:家长
+     * @return
+     */
+    @PostMapping("/switchIdentity")
+    public ResultBean switchIdentify(Long personId, Long type){
+        return new ResultBean(userService.switchIdentify(personId, type, privateKeyPath, expire));
+    }
+
+    /**
+     * 创建token
+     * @param object
+     * @return
+     */
+	private TokenDTO generateToken(Object object){
+        Long schoolId = -1L, userId = -1L;
+        String username = null, mobile = null;
+	    if (object instanceof ParentsDO) {
+            ParentsDO parentsDO = ((ParentsDO) object);
+            schoolId = parentsDO.getSchoolId();
+            userId = parentsDO.getUserId();
+            username = parentsDO.getParentsName();
+            mobile = parentsDO.getPaPhone();
+        }else if (object instanceof TeacherDO) {
+            TeacherDO teacherDO = ((TeacherDO) object);
+            schoolId = teacherDO.getSchoolId();
+            userId = teacherDO.getUserId();
+            username = teacherDO.getTeacherName();
+            mobile = teacherDO.getTeacherPhone();
+        }else {
+	        return null;
+        }
+        JwtInfo jwtInfo = new JwtInfo("school", schoolId, userId, username, mobile);
+        JwtToken jwtToken = JwtHelper.generateToken(jwtInfo, privateKeyPath, expire);
+        return BeanMapper.map(jwtToken, TokenDTO.class);
+    }
+
 	/**
 	 * 首页数据
 	 * @param schoolId

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

@@ -18,7 +18,7 @@ public interface WxClazzPictureService {
 	 * @param pictureUrls
 	 * @return
 	 */
-	public String savePicture(@Param("albumId") Long albumId, @Param("pictureUrls") String pictureUrls);
+	public String savePicture(Long albumId,String pictureUrls, String albumTitle, String albumRemarks);
 
 	/**
 	 * 分页获取相片

+ 6 - 5
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/WxNotifyService.java

@@ -31,14 +31,14 @@ public interface WxNotifyService {
 	public String createNotify(String jsonNotify) throws Exception;
 
 
-	/**
+/*	*//**
 	 * 教师分页显示
 	 * @param teacherId
 	 * @param notifyStatus
 	 * @param pageIndex
 	 * @param pageSize
-	 */
-	public Map<String, Object> notifyListByTeacher(@Param("teacherId") Long teacherId, @Param("notifyStatus") Integer notifyStatus, @Param("pageIndex") Integer pageIndex, @Param("pageSize") Integer pageSize);
+	 *//*
+	public Map<String, Object> notifyListByTeacher(Long teacherId, Integer notifyStatus, Integer pageIndex, Integer pageSize);*/
 
 	/**
 	 * 家长分页显示
@@ -47,7 +47,7 @@ public interface WxNotifyService {
 	 * @param pageIndex
 	 * @param pageSize
 	 */
-	public List<NotifyDO> notifyListByStu(@Param("stuId") Long stuId, @Param("notifyStatus") Integer notifyStatus, @Param("pageIndex") Integer pageIndex, @Param("pageSize") Integer pageSize) throws Exception;
+	public Object notifyList(Long stuId, Integer notifyStatus, Integer pageIndex, Integer pageSize, Integer type);
 
 	/**
 	 * 家长端获取通知详情
@@ -55,7 +55,7 @@ public interface WxNotifyService {
 	 * @param
 	 * @return
 	 */
-	public NotifyDO getNotifyDetails(@Param("stuId") Long stuId,@Param("notifyId") Long notifyId) throws Exception;
+	public NotifyDO getNotifyDetails( Long stuId, Long notifyId) throws Exception;
 
 	/**
 	 * 教师端获取通知详情
@@ -74,4 +74,5 @@ public interface WxNotifyService {
 	 */
 	public int deleteNotify(@Param("notifyId") Long notifyId, @Param("teacherId") Long teacherId) throws Exception;
 
+	NotifyDO getNotify(Long notifyId, Long personId, Integer type);
 }

+ 9 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/WxUserService.java

@@ -1,6 +1,7 @@
 package com.usoftchina.smartschool.school.wxschool.basic.service;
 
 import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
+import com.usoftchina.smartschool.auth.dto.TokenDTO;
 import com.usoftchina.smartschool.school.po.TeacherDO;
 import org.apache.ibatis.annotations.Param;
 
@@ -98,4 +99,12 @@ public interface WxUserService {
 	 */
 	public int updatePhone(@Param("userPhone") String userPhone, @Param("openid") String openid, @Param("code") String code) throws Exception;
 
+    /**
+     * 切换token
+     * @param personId
+     * @param type
+     * @return
+     */
+    TokenDTO switchIdentify(Long personId, Long type, String privateKeyPath, int expire);
+
 }

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

@@ -32,8 +32,15 @@ public class WxClazzPictureServiceImpl implements WxClazzPictureService {
 	 * @param pictureUrls
 	 * @return
 	 */
-	public String savePicture(Long albumId, String pictureUrls){
+	public String savePicture(Long albumId, String pictureUrls, String albumTitle, String albumRemarks){
 		List<ClazzPictureDO> clazzPictureDOS = clazzPictureMapper.listByAlbumId(albumId);
+		//更新相册名称、备注
+        ClazzAlbumDO clazzAlbumDO = new ClazzAlbumDO();
+        clazzAlbumDO.setAlbumId(albumId);
+        clazzAlbumDO.setAlbumTitle(albumTitle);
+        clazzAlbumDO.setAlbumRemarks(albumRemarks);
+        clazzAlbumMapper.update(clazzAlbumDO);
+        //更新相册图片
 		if (ObjectUtils.isNotEmpty(clazzPictureDOS)) {
 			for (int i = 0; i < clazzPictureDOS.size(); i++) {
 				ClazzPictureDO clazzPictureDO = clazzPictureDOS.get(i);

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

@@ -238,6 +238,7 @@ public class WxMeetingServiceImpl implements WxMeetingService {
 				List<MeetingRecordsDO> list = meetingRecordsMapper.list(map);
 				List<MeetingRecordsDO> signs = new ArrayList<>();
 				List<MeetingRecordsDO> unSigns = new ArrayList<>();
+				List<MeetingRecordsDO> meetingRecordsResultList = new ArrayList<>();
 				for (MeetingRecordsDO mr:list) {
 					Long teacherId1 = mr.getTeacherId();
 					if (ObjectUtils.isNotEmpty(teacherId1)){
@@ -256,8 +257,10 @@ public class WxMeetingServiceImpl implements WxMeetingService {
 						unSigns.add(mr);
 					}
 				}
-				meetingDO.setSign(signs);
-				meetingDO.setUnSign(unSigns);
+                meetingRecordsResultList.addAll(signs);
+                meetingRecordsResultList.addAll(unSigns);
+                meetingDO.setMeetingPerson(meetingRecordsResultList);
+                meetingDO.setSignCount(signs.size());
 			}
 		}
 		return meetingDO;

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

@@ -199,6 +199,7 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 		return hashMap;
 	}
 
+
 	/**
 	 * 家长分页显示
 	 * @param stuId
@@ -206,22 +207,40 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 	 * @param pageIndex
 	 * @param pageSize
 	 */
-	public List<NotifyDO> notifyListByStu(Long stuId, Integer notifyStatus, Integer pageIndex, Integer pageSize) throws Exception {
+	public List<NotifyDO> notifyListByStu(Long stuId, Integer notifyStatus, Integer pageIndex, Integer pageSize) {
 		Integer pageStart = (pageIndex-1)*pageSize;
 		StudentDO studentDO = studentMapper.get(stuId);
+		List<NotifyDO> notifyList = new ArrayList<>();
 		if (ObjectUtils.isNotEmpty(studentDO)){
-			List<NotifyDO> notifyList = new ArrayList<>();
 			List<NotifyDO> notifyDOS = notifyMapper.selectNotifyListSchoolId(studentDO.getSchoolId(), notifyStatus,
 					pageStart, pageSize);
 			for (NotifyDO nt:notifyDOS) {
 				NotifyDO notifyDetail = getNotifyDetail(stuId, 0L, nt);
 				notifyList.add(notifyDetail);
 			}
-			return notifyList;
-		}else {
-			throw new Exception("该学生暂时不存在");
 		}
+		return notifyList;
+	}
 
+	/**
+	 * 分页显示
+	 * @param personId
+	 * @param notifyStatus
+	 * @param pageIndex
+	 * @param pageSize
+	 */
+	public Object notifyList(Long personId, Integer notifyStatus, Integer pageIndex, Integer pageSize, Integer type) {
+		if (null == pageIndex) {
+			pageIndex = 1;
+		}
+		if (null == pageSize) {
+			pageIndex = 10;
+		}
+		if (0 == type) {
+			return notifyListByStu(personId, notifyStatus, pageIndex, pageSize);
+		} else {
+			return notifyListByTeacher(personId, notifyStatus, pageIndex, pageSize);
+		}
 	}
 
 	/**
@@ -230,7 +249,7 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 	 * @param
 	 * @return
 	 */
-	public NotifyDO getNotifyDetails(Long stuId,Long notifyId) throws Exception {
+	public NotifyDO getNotifyDetails(Long stuId,Long notifyId){
 		NotifyDO notifyDO = notifyMapper.get(notifyId);
 		List<NotifyrecordsDO> byStu = notifyrecordsMapper.getByStu(stuId, notifyId);
 		if (CollectionUtils.isNotEmpty(byStu)){
@@ -239,8 +258,6 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 			int update = notifyrecordsMapper.update(notifyrecordsDO);
 			if (update>0){
 				return getNotifyDetail(stuId,0L,notifyDO);
-			}else {
-				throw new Exception("系统内部错误,请联系管理员");
 			}
 		}
 		return getNotifyDetail(stuId,0L,notifyDO);
@@ -252,7 +269,7 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 	 * @param teacherId
 	 * @return
 	 */
-	public NotifyDO getNotifyDetailsByTeacher(Long notifyId, Long teacherId) throws Exception {
+	public NotifyDO getNotifyDetailsByTeacher(Long notifyId, Long teacherId) {
 		NotifyDO notifyDO = notifyMapper.get(notifyId);
         List<NotifyrecordsDO> byTeacher = notifyrecordsMapper.getByTeacher(notifyId, teacherId);
 		if (CollectionUtils.isNotEmpty(byTeacher)){
@@ -261,8 +278,6 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 			int update = notifyrecordsMapper.update(notifyrecordsDO);
 			if (update>0){
 				return getNotifyDetail(0L,teacherId,notifyDO);
-			}else {
-				throw new Exception("系统内部错误,请联系管理员");
 			}
 		}
 		return getNotifyDetail(0L,teacherId,notifyDO);
@@ -284,6 +299,17 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 		}
 	}
 
+	@Override
+	public NotifyDO getNotify(Long notifyId, Long personId, Integer type) {
+		NotifyDO notifyDO = null;
+		if (type == 0) {
+			notifyDO = getNotifyDetails(personId, notifyId);
+		}else {
+			notifyDO = getNotifyDetailsByTeacher(notifyId, personId);
+		}
+		return notifyDO;
+	}
+
 
 	private NotifyDO getNotifyDetail(Long stuId, Long teacherId, NotifyDO notifyDO){
 		TeacherDO teacherDO = teacherMapper.get(notifyDO.getNotifyCreator());

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

@@ -230,9 +230,11 @@ public class WxOaApproveServiceImpl implements WxOaApproveService {
                 //出差
                 Long proposer = oaApprove.getProposer();
                 if (proposer > 0) {
+                    TeacherDO teacherDO = teacherMapper.get(proposer);
                     Map<String, Object> map = new HashMap<>();
                     map.put("key", "申请人");
-                    map.put("value", teacherMapper.get(proposer).getTeacherName());
+                    map.put("value", teacherDO.getTeacherName());
+                    map.put("photo", teacherDO.getTeacherPhoto());
                     maps.put("proposer", map);
                 }
                 List<Map<String, Object>> map2 = new ArrayList<>();
@@ -303,9 +305,11 @@ public class WxOaApproveServiceImpl implements WxOaApproveService {
                 //用品
                 Long proposer = oaApprove.getProposer();
                 if (proposer > 0) {
+                    TeacherDO teacherDO = teacherMapper.get(proposer);
                     Map<String, Object> map = new HashMap<>();
                     map.put("key", "申请人");
-                    map.put("value", teacherMapper.get(proposer).getTeacherName());
+                    map.put("value", teacherDO.getTeacherName());
+                    map.put("photo", teacherDO.getTeacherPhoto());
                     maps.put("proposer", map);
                 }
 
@@ -384,9 +388,11 @@ public class WxOaApproveServiceImpl implements WxOaApproveService {
                 //请假
                 Long proposer = oaApprove.getProposer();
                 if (proposer > 0) {
+                    TeacherDO teacherDO = teacherMapper.get(proposer);
                     Map<String, Object> map = new HashMap<>();
                     map.put("key", "申请人");
-                    map.put("value", teacherMapper.get(proposer).getTeacherName());
+                    map.put("value", teacherDO.getTeacherName());
+                    map.put("photo", teacherDO.getTeacherPhoto());
                     maps.put("proposer", map);
                 }
                 List<Map<String, Object>> map2 = new ArrayList<>();

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

@@ -197,8 +197,8 @@ public class WxPrincipalMailboxServiceImpl implements WxPrincipalMailboxService
 			TeacherDO teacherDO = teacherMapper.get(principalMailboxDO.getNotifier());
 			map.put("teacherName",teacherDO.getTeacherName());
 			map.put("teacherPhoto",teacherDO.getTeacherPhoto());
-			List<PrincipalReplyDO> principalReplyDOS = principalReplyMapper.listByMailboxId(principalMailboxDO.getMailboxId());
-			map.put("principalReplyDOS",principalReplyDOS);
+			//List<PrincipalReplyDO> principalReplyDOS = principalReplyMapper.listByMailboxId(principalMailboxDO.getMailboxId());
+			map.put("reply", principalMailboxDO.getMbReply());
 			return map;
 		}else {
 			throw new Exception("暂无数据");

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

@@ -1,12 +1,17 @@
 package com.usoftchina.smartschool.school.wxschool.basic.service.impl;
 
 import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
+import com.usoftchina.smartschool.auth.dto.TokenDTO;
+import com.usoftchina.smartschool.auth.jwt.JwtHelper;
+import com.usoftchina.smartschool.auth.jwt.JwtInfo;
+import com.usoftchina.smartschool.auth.jwt.JwtToken;
 import com.usoftchina.smartschool.school.po.*;
 import com.usoftchina.smartschool.school.wxschool.basic.service.WxUserService;
 import com.usoftchina.smartschool.school.wxschool.config.CodeConfig;
 import com.usoftchina.smartschool.school.wxschool.mapper.*;
 import com.usoftchina.smartschool.school.wxschool.support.CodeTask;
 import com.usoftchina.smartschool.school.wxschool.utils.*;
+import com.usoftchina.smartschool.utils.BeanMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -611,10 +616,35 @@ public class WxUserServiceImpl implements WxUserService {
 			List<ParentsDO> parentsDOS = parentsMapper.list(map);
 			List<TeacherDO> teacherDOS = teacherMapper.list(map);
 			if (ObjectUtils.isNotEmpty(parentsDOS)){
-				UserDO userDO = userMapper.get(parentsDOS.get(0).getUserId());
+
+                //如果存在老师身份
+                if (ObjectUtils.isNotEmpty(teacherDOS)) {
+                    TeacherDO teacherDO = teacherDOS.get(0);
+                    UserDO userDO = userMapper.get(teacherDO.getUserId());
+                    if (ObjectUtils.isNotEmpty(userDO)) {
+                        if (code.equals(userDO.getUserCode())) {
+                            //更新教师资料表的手机号
+                            TeacherDO updateTeacherDO = new TeacherDO();
+                            updateTeacherDO.setTeacherId(teacherDO.getTeacherId());
+                            updateTeacherDO.setTeacherPhone(userPhone);
+                            teacherMapper.update(updateTeacherDO);
+                        }else {
+                            throw new Exception("验证码错误,请核实");
+                        }
+                    }
+                }
+
+                ParentsDO parentsDO = parentsDOS.get(0);
+				UserDO userDO = userMapper.get(parentsDO.getUserId());
 				if (ObjectUtils.isNotEmpty(userDO)) {
 					if (code.equals(userDO.getUserCode())) {
 						userDO.setUserPhone(userPhone);
+						//更新家长信息表中的手机号
+						ParentsDO updateParentsDO = new ParentsDO();
+                        updateParentsDO.setParentId(parentsDO.getParentId());
+                        updateParentsDO.setPaPhone(userPhone);
+						parentsMapper.update(updateParentsDO);
+						//更新账户的手机号
 						return userMapper.update(userDO);
 					}else {
 						throw new Exception("验证码错误,请核实");
@@ -627,6 +657,12 @@ public class WxUserServiceImpl implements WxUserService {
 					UserDO userDO = userMapper.get(teacherDOS.get(0).getUserId());
 					if (ObjectUtils.isNotEmpty(userDO)) {
 						if (code.equals(userDO.getUserCode())) {
+                            //更新教师资料表的手机号
+                            TeacherDO updateTeacherDO = new TeacherDO();
+                            updateTeacherDO.setTeacherId(teacherDOS.get(0).getTeacherId());
+                            updateTeacherDO.setTeacherPhone(userPhone);
+                            teacherMapper.update(updateTeacherDO);
+                            //更新账户的手机号
 							userDO.setUserPhone(userPhone);
 							return userMapper.update(userDO);
 						}else {
@@ -644,7 +680,26 @@ public class WxUserServiceImpl implements WxUserService {
 		}
 	}
 
-	private static List removeDuplicate(List list){
+    @Override
+    public TokenDTO switchIdentify(Long personId, Long type, String privateKeyPath, int expire) {
+	    if (type == 0) {    //家长切换到老师身份
+            ParentsDO parentsDO = parentsMapper.get(personId);
+            TeacherDO teacherDO = teacherMapper.getBySchoolAndOpenid(parentsDO.getSchoolId(), parentsDO.getOpenid());
+            JwtInfo jwtInfo = new JwtInfo("school", teacherDO.getSchoolId(), teacherDO.getUserId(), teacherDO.getTeacherName(), teacherDO.getTeacherPhone());
+            JwtToken jwtToken = JwtHelper.generateToken(jwtInfo, privateKeyPath, expire);
+            return BeanMapper.map(jwtToken, TokenDTO.class);
+        }
+        if (type == 1) {    //老师切换到家长身份
+            TeacherDO teacherDO = teacherMapper.get(personId);
+            ParentsDO parentsDO = parentsMapper.getBySchoolAndOpenid(teacherDO.getSchoolId(), teacherDO.getOpenid());
+            JwtInfo jwtInfo = new JwtInfo("school", parentsDO.getSchoolId(), parentsDO.getUserId(), parentsDO.getParentsName(), parentsDO.getPaPhone());
+            JwtToken jwtToken = JwtHelper.generateToken(jwtInfo, privateKeyPath, expire);
+            return BeanMapper.map(jwtToken, TokenDTO.class);
+        }
+        return null;
+    }
+
+    private static List removeDuplicate(List list){
 		List listTemp = new ArrayList();
 		for(int i=0;i<list.size();i++){
 			if(!listTemp.contains(list.get(i))){

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

@@ -73,6 +73,7 @@ mybatis:
   mapper-locations: classpath:mapper/*.xml
 auth:
   public-key: auth/pub.key
+  private-key: auth/pri.key
 ribbon:
   ReadTimeout: 10000
   ConnectTimeout: 10000

BIN
applications/school/school-server/src/main/resources/auth/pri.key


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

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

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

@@ -227,9 +227,9 @@
   </select>
 
   <select id="selectNoticer" parameterType="long" resultType="com.usoftchina.smartschool.school.po.SchoolNoticer">
-      select openid,noticer,GROUP_CONCAT(personId) personId,GROUP_CONCAT(type) type from (
-      select openid,parents_name noticer,parentstu.stu_id personId,'1' type from sys_parents parent left join sys_parents_stu parentstu on parent.parent_id = parentstu.parent_id where school_id=#{schoolId} and ifnull(openid,'') != '' and parents_status=1  union
-      select openid,teacher_name noticer,teacher_id personId, '0' type from sys_teacher where school_id=#{schoolId} and ifnull(openid,'') != '' and teacher_status=1 ) tab_  GROUP BY openid,noticer
+     select openid,noticer,GROUP_CONCAT(personId) personId,GROUP_CONCAT(type) type from (
+      select openid,parents_name noticer,parentstu.stu_id personId,'0' type from sys_parents parent left join sys_parents_stu parentstu on parent.parent_id = parentstu.parent_id where school_id=#{schoolId} and ifnull(openid,'') != '' and parents_status=1  union
+      select openid,teacher_name noticer,teacher_id personId, '1' type from sys_teacher where school_id=#{schoolId} and ifnull(openid,'') != '' and teacher_status=1 ) tab_  GROUP BY openid,noticer
   </select>
 
   <insert id="insertDetailBySelective">
@@ -238,7 +238,7 @@
       (
       #{notice_id,jdbcType=VARCHAR},
       <choose>
-        <when test='item.type == "1"'>
+        <when test='item.type == "0"'>
           #{item.personId,jdbcType=VARCHAR},
         </when>
         <otherwise>
@@ -246,7 +246,7 @@
         </otherwise>
       </choose>
       <choose>
-        <when test='item.type == "0"'>
+        <when test='item.type == "1"'>
           #{item.personId,jdbcType=VARCHAR},
         </when>
         <otherwise>

+ 32 - 0
applications/school/school-server/src/main/resources/mapper/PortalMapper.xml

@@ -0,0 +1,32 @@
+<?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.PortalMapper">
+  <select id="getStudentsCount" resultType="int">
+    select count(*) from sys_student where school_id = #{schoolId} and stu_status = 1
+  </select>
+
+  <select id="getTeachersCount" resultType="int">
+    select count(*) from sys_teacher where school_id = #{schoolId} and teacher_status = 1
+  </select>
+
+  <select id="getParentsCount" resultType="int">
+    SELECT COUNT(*) FROM  (
+      SELECT DISTINCT PARENTSTU.PARENT_ID FROM SYS_PARENTS_STU PARENTSTU LEFT JOIN SYS_STUDENT STU ON PARENTSTU.STU_ID = STU.STU_ID
+      WHERE STU.SCHOOL_ID = #{schoolId} GROUP BY PARENT_ID) RESOURCE
+  </select>
+
+  <select id="getGradeCount" resultType="int">
+    select count(*) from sys_grade where school_id = #{schoolId} and grade_status = 1
+  </select>
+
+  <select id="getClassCount" resultType="int">
+    select count(*) from sys_clazz where school_id = #{schoolId} and clazz_status = 1
+  </select>
+
+  <select id="getInOutRecord" resultType="java.util.Map">
+    SELECT COUNT(*) count,RECORD_TYPE type,RECORD_DATE date FROM (
+    SELECT RECORD_TYPE,DATE_FORMAT(RECORD_DATE,'%Y-%m-%d %H:%i') RECORD_DATE FROM OUT_IN_RECORD WHERE DATE_FORMAT(RECORD_DATE,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d')
+    AND SCHOOL_ID = #{schoolId}
+    ) SOURCE GROUP BY RECORD_TYPE,RECORD_DATE ORDER BY DATE
+  </select>
+</mapper>

+ 18 - 1
applications/school/school-server/src/main/resources/mapper/PrincipalMailboxMapper.xml

@@ -23,7 +23,13 @@
   </resultMap>
 
   <select id="selectByConditon" resultMap="BaseResultMap">
-    select * from principal_mailbox
+    select mailbox_id,mailbox_title,is_anonymity,create_date,mailbox_creator,read_date,mailbox_status,notifier,school_id,mb_stuid,
+    case is_anonymity when 1 then '匿名' else mb_student end mb_student,
+    case is_anonymity when 1 then null else mb_grade end mb_grade,
+    case is_anonymity when 1 then null else mb_class end mb_class,
+    case is_anonymity when 1 then '匿名' else mb_creatorname end mb_creatorname,
+    mailbox_context,mailbox_files,mb_reply,mb_ignore
+    from principal_mailbox
     <where>
       <if test="con != null">
         ${con}
@@ -62,4 +68,15 @@
     values (#{mailboxId,jdbcType=BIGINT}, #{replyContent,jdbcType=VARCHAR}, #{replyDate,jdbcType=TIMESTAMP})
   </insert>
 
+  <select id="selectByPrimaryKey" parameterType="long" resultMap="BaseResultMap">
+    select
+     mailbox_id,mailbox_title,is_anonymity,create_date,mailbox_creator,read_date,mailbox_status,notifier,school_id,mb_stuid,
+    case is_anonymity when 1 then '匿名' else mb_student end mb_student,
+    case is_anonymity when 1 then null else mb_grade end mb_grade,
+    case is_anonymity when 1 then null else mb_class end mb_class,
+    case is_anonymity when 1 then '匿名' else mb_creatorname end mb_creatorname,
+    mailbox_context,mailbox_files,mb_reply,mb_ignore
+     from principal_mailbox where mailbox_id = #{id}
+  </select>
+
 </mapper>

+ 61 - 9
applications/school/school-server/src/main/resources/mapper/ScoreMapper.xml

@@ -302,6 +302,21 @@
       <if test="sd_stuNumber != null" >
         sd_stunumber,
       </if>
+      <if test="sd_total != null" >
+        sd_total,
+      </if>
+      <if test="sd_class_rank != null" >
+        sd_class_rank,
+      </if>
+      <if test="sd_grade_rank != null" >
+        sd_grade_rank,
+      </if>
+      <if test="sd_class_average != null" >
+        sd_class_average,
+      </if>
+      <if test="sd_grade_average != null" >
+        sd_grade_average,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="sd_siid != null" >
@@ -314,7 +329,7 @@
         #{sd_stu,jdbcType=VARCHAR},
       </if>
       <if test="sd_score != null" >
-        #{sd_score,jdbcType=INTEGER},
+        #{sd_score,jdbcType=DOUBLE},
       </if>
       <if test="sd_subject != null" >
         #{sd_subject,jdbcType=VARCHAR},
@@ -328,6 +343,21 @@
       <if test="sd_stuNumber != null" >
         #{sd_stuNumber,jdbcType=VARCHAR},
       </if>
+      <if test="sd_total != null" >
+        #{sd_total,jdbcType=INTEGER},
+      </if>
+      <if test="sd_class_rank != null" >
+        #{sd_class_rank,jdbcType=INTEGER},
+      </if>
+      <if test="sd_grade_rank != null" >
+        #{sd_grade_rank,jdbcType=INTEGER},
+      </if>
+      <if test="sd_class_average != null" >
+        #{sd_class_average,jdbcType=DOUBLE},
+      </if>
+      <if test="sd_grade_average != null" >
+        #{sd_grade_average,jdbcType=DOUBLE},
+      </if>
     </trim>
   </insert>
 
@@ -340,11 +370,16 @@
     <result column="sd_siid" property="sd_siid" jdbcType="BIGINT" />
     <result column="sd_stuid" property="sd_stuid" jdbcType="BIGINT" />
     <result column="sd_stu" property="sd_stu" jdbcType="VARCHAR" />
-    <result column="sd_score" property="sd_score" jdbcType="INTEGER" />
+    <result column="sd_score" property="sd_score" jdbcType="DOUBLE" />
     <result column="sd_subject" property="sd_subject" jdbcType="VARCHAR" />
     <result column="sd_remark" property="sd_remark" jdbcType="VARCHAR" />
     <result column="school_id" property="school_id" jdbcType="BIGINT" />
     <result column="sd_stunumber" property="sd_stuNumber" jdbcType="VARCHAR" />
+    <result column="sd_total" property="sd_total" jdbcType="INTEGER" />
+    <result column="sd_class_rank" property="sd_class_rank" jdbcType="INTEGER" />
+    <result column="sd_grade_rank" property="sd_grade_rank" jdbcType="INTEGER" />
+    <result column="sd_class_average" property="sd_class_average" jdbcType="DOUBLE" />
+    <result column="sd_grade_average" property="sd_grade_average" jdbcType="DOUBLE" />
   </resultMap>
 
   <insert id="batchInsert" parameterType="java.util.List">
@@ -353,7 +388,7 @@
       score_scope, score_date, score_remarks,
       school_id, subject_id, stu_name,
       class_id, class_name, grade_id,
-      grade_name, exam_title) VALUES
+      grade_name, exam_title, class_rank, grade_rank, class_average, grade_average) VALUES
     <foreach collection="list" item="item" index="index" open="" close="" separator=",">
       (
       #{item.score_type,jdbcType=VARCHAR}, #{item.score_name,jdbcType=VARCHAR},
@@ -361,7 +396,8 @@
       #{item.score_scope,jdbcType=VARCHAR}, #{item.score_date,jdbcType=TIMESTAMP}, #{item.score_remarks,jdbcType=VARCHAR},
       #{item.school_id,jdbcType=BIGINT}, #{item.subject_id,jdbcType=BIGINT}, #{item.stu_name,jdbcType=VARCHAR},
       #{item.class_id,jdbcType=BIGINT}, #{item.class_name,jdbcType=VARCHAR}, #{item.grade_id,jdbcType=BIGINT},
-      #{item.grade_name,jdbcType=VARCHAR}, #{item.exam_title,jdbcType=VARCHAR}
+      #{item.grade_name,jdbcType=VARCHAR}, #{item.exam_title,jdbcType=VARCHAR}, #{item.class_rank,jdbcType=INTEGER},
+      #{item.grade_rank,jdbcType=INTEGER}, #{item.class_average,jdbcType=DOUBLE}, #{item.grade_average,jdbcType=DOUBLE}
       )
     </foreach>
   </insert>
@@ -391,7 +427,7 @@
     <result column="sd_siid" property="sd_siid" jdbcType="BIGINT" />
     <result column="sd_stuid" property="sd_stuid" jdbcType="BIGINT" />
     <result column="sd_stu" property="sd_stu" jdbcType="VARCHAR" />
-    <result column="sd_score" property="sd_score" jdbcType="INTEGER" />
+    <result column="sd_score" property="sd_score" jdbcType="DOUBLE" />
     <result column="sd_subject" property="sd_subject" jdbcType="VARCHAR" />
     <result column="sd_remark" property="sd_remark" jdbcType="VARCHAR" />
     <result column="sd_stunumber" property="sd_stunumber" jdbcType="VARCHAR" />
@@ -485,12 +521,13 @@
   <insert id="insertDetailSelective" parameterType="java.util.List">
     insert into score_importdetail
     (sd_siid,sd_stuid,sd_stu,sd_score,
-    sd_subject,sd_remark,school_id,sd_stuNumber
+    sd_subject,sd_remark,school_id,sd_stuNumber,sd_total,sd_class_rank,sd_grade_rank,sd_class_average,sd_grade_average
     ) values
       <foreach collection="list" item="item" index="index" open="" close="" separator=",">
       (
-      #{item.sd_siid, jdbcType=BIGINT},#{item.sd_stuid,jdbcType=BIGINT},#{item.sd_stu,jdbcType=VARCHAR},#{item.sd_score,jdbcType=INTEGER},#{item.sd_subject,jdbcType=VARCHAR},
-      #{item.sd_remark,jdbcType=VARCHAR},#{item.school_id,jdbcType=BIGINT},#{item.sd_stuNumber,jdbcType=VARCHAR}
+      #{item.sd_siid, jdbcType=BIGINT},#{item.sd_stuid,jdbcType=BIGINT},#{item.sd_stu,jdbcType=VARCHAR},#{item.sd_score,jdbcType=DOUBLE},#{item.sd_subject,jdbcType=VARCHAR},
+      #{item.sd_remark,jdbcType=VARCHAR},#{item.school_id,jdbcType=BIGINT},#{item.sd_stuNumber,jdbcType=VARCHAR},#{sd_total,jdbcType=INTEGER},
+      #{sd_class_rank,jdbcType=INTEGER},#{sd_grade_rank,jdbcType=INTEGER},#{sd_class_average,jdbcType=DOUBLE},#{sd_grade_average,jdbcType=DOUBLE}
       )
       </foreach>
   </insert>
@@ -509,7 +546,7 @@
           sd_stu = #{item.sd_stu,jdbcType=VARCHAR},
         </if>
         <if test="item.sd_score != null">
-          sd_score = #{item.sd_score,jdbcType=INTEGER},
+          sd_score = #{item.sd_score,jdbcType=DOUBLE},
         </if>
         <if test="item.sd_subject != null">
           sd_subject = #{item.sd_subject,jdbcType=VARCHAR},
@@ -523,6 +560,21 @@
         <if test="item.sd_stuNumber != null">
           sd_stuNumber = #{item.sd_stuNumber,jdbcType=VARCHAR},
         </if>
+        <if test="item.sd_total != null" >
+          sd_total = #{item.sd_total,jdbcType=INTEGER},
+        </if>
+        <if test="item.sd_class_rank != null" >
+          sd_class_rank = #{item.sd_class_rank,jdbcType=INTEGER},
+        </if>
+        <if test="item.sd_grade_rank != null" >
+          sd_grade_rank = #{item.sd_grade_rank,jdbcType=INTEGER},
+        </if>
+        <if test="item.sd_class_average != null" >
+          sd_class_average = #{item.sd_class_average,jdbcType=DOUBLE},
+        </if>
+        <if test="item.sd_grade_average != null" >
+          sd_grade_average = #{item.sd_grade_average,jdbcType=DOUBLE},
+        </if>
       </set>
       WHERE sd_id= #{item.sd_id,jdbcType=BIGINT}
     </foreach>

+ 19 - 0
applications/school/school-server/src/main/resources/mapper/SysClazzMapper.xml

@@ -249,6 +249,21 @@
   </select>
 
   <select id="teacherClazz" resultType="int">
+    select count(*) from sys_teacher_clazz
+    <where>
+      <if test="subject_name != null">
+        subject_name=#{subject_name}
+      </if>
+      <if test="teacher_name != null">
+        and teacher_name=#{teacher_name}
+      </if>
+      <if test="clazz_id != null">
+        and clazz_id=#{clazz_id}
+      </if>
+    </where>
+  </select>
+
+  <select id="teacherSubject" resultType="int">
     select count(*) from sys_teacher_clazz
     <where>
       <if test="subject_name != null">
@@ -260,6 +275,10 @@
     </where>
   </select>
 
+  <select id="selectTeacherSubject" parameterType="long" resultMap="teacherMap">
+    select * from sys_teacher_clazz where clazz_id = #{clazz_id}
+  </select>
+
   <select id="selectByClazzName" resultMap="BaseResultMap">
     select * from sys_clazz where clazz_grade=#{clazz_grade} and clazz_name=#{clazz_name} and school_id=#{school_id}
   </select>

+ 1 - 1
applications/school/school-server/src/main/resources/mapper/SysGradeMapper.xml

@@ -109,7 +109,7 @@
     <selectKey  resultType="java.lang.Long" keyProperty="grade_id">
       SELECT LAST_INSERT_ID() AS ID
     </selectKey>
-    insert into sys_grade (grade_name,grade_no,school_id) select #{grade_name},#{grade_no},#{school_id} from dual where
+    insert into sys_grade (grade_name,grade_no,school_id,grade_status) select #{grade_name},#{grade_no},#{school_id},#{grade_status} from dual where
     not  exists (select 1 from sys_grade where grade_name = #{grade_name} and school_id = #{school_id})
   </insert>
 

+ 9 - 4
applications/school/school-server/src/main/resources/mapper/SysSchoolMapper.xml

@@ -11,16 +11,18 @@
     <result column="school_appid" property="school_appid" jdbcType="VARCHAR" />
     <result column="school_secret" property="school_secret" jdbcType="VARCHAR" />
     <result column="school_accesssecret" property="school_accesssecret" jdbcType="VARCHAR" />
+    <result column="teacher_id" property="teacher_id" jdbcType="INTEGER" />
+    <result column="teacher_name" property="teacher_name" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
     school_id, school_name, school_status, school_remarks, school_address, school_phone, 
     school_appid, school_secret
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
-    select 
-    <include refid="Base_Column_List" />
-    from sys_school
-    where school_id = #{school_id,jdbcType=BIGINT}
+    select school.school_id, school_name, school_status, school_remarks, school_address, school_phone,
+    school_appid, school_secret, school.teacher_id, teacher.teacher_name
+    from sys_school school left join sys_teacher teacher on teacher.teacher_id = school.teacher_id
+    where school.school_id = #{school_id,jdbcType=BIGINT}
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
     delete from sys_school
@@ -113,6 +115,9 @@
       <if test="school_secret != null" >
         school_secret = #{school_secret,jdbcType=VARCHAR},
       </if>
+      <if test="teacher_id != null" >
+        teacher_id = #{teacher_id,jdbcType=INTEGER},
+      </if>
     </set>
     where school_id = #{school_id,jdbcType=BIGINT}
   </update>

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

@@ -530,4 +530,7 @@
             </if>
         </where>
     </select>
+  <select id="selectParentById" resultMap="parentMap">
+    select * from sys_parents where parent_id = #{id}
+  </select>
 </mapper>

+ 4 - 2
applications/school/school-server/src/main/resources/mapper/WxParentsMapper.xml

@@ -4,7 +4,7 @@
 <mapper namespace="com.usoftchina.smartschool.school.wxschool.mapper.WxParentsMapper">
 
     <sql id="ParentsVo">
-    select `parent_id`,`user_id`,`openid`,`school_id`,`parents_name`,`parents_birthday`,`parents_sex`,`parents_photo`,`parents_status`,`parents_job`,`parents_address`,`parents_honor`,`parents_remarks` from sys_parents
+    select `parent_id`,`user_id`,`openid`,`school_id`,`parents_name`,`parents_birthday`,`parents_sex`,`parents_photo`,`parents_status`,`parents_job`,`parents_address`,`parents_honor`,`parents_remarks`,`pa_phone` from sys_parents
     </sql>
 
 	<select id="get" resultType="com.usoftchina.smartschool.school.po.ParentsDO">
@@ -27,6 +27,7 @@
 		  		  <if test="parentsAddress != null and parentsAddress != ''"> and parents_address = #{parentsAddress} </if>
 		  		  <if test="parentsHonor != null and parentsHonor != ''"> and parents_honor = #{parentsHonor} </if>
 		  		  <if test="parentsRemarks != null and parentsRemarks != ''"> and parents_remarks = #{parentsRemarks} </if>
+		  		  <if test="paPhone != null and paPhone != ''"> and pa_phone = #{paPhone} </if>
 		  		</where>
         <choose>
             <when test="sort != null and sort.trim() != ''">
@@ -107,7 +108,8 @@
 			<if test="parentsJob != null">`parents_job` = #{parentsJob}, </if>
 			<if test="parentsAddress != null">`parents_address` = #{parentsAddress}, </if>
 			<if test="parentsHonor != null">`parents_honor` = #{parentsHonor}, </if>
-			<if test="parentsRemarks != null">`parents_remarks` = #{parentsRemarks}</if>
+			<if test="parentsRemarks != null">`parents_remarks` = #{parentsRemarks},</if>
+			<if test="paPhone != null">`pa_phone` = #{paPhone}</if>
 		</set>
 		where parent_id = #{parentId}
 	</update>

+ 3 - 1
applications/school/school-server/src/main/resources/mapper/WxStuScoreMapper.xml

@@ -4,7 +4,9 @@
 <mapper namespace="com.usoftchina.smartschool.school.wxschool.mapper.WxStuScoreMapper">
 
     <sql id="StuScoreVo">
-    select `score_id`,`score_type`,`score_name`,`stu_id`,`score_total`,`score_num`,`score_scope`,`score_date`,`score_remarks`,`school_id`,`subject_id`,`stu_name`,`subject_name`,`class_id`,`class_name`,`grade_id`,`grade_name`,`exam_title` from stu_score
+    select `score_id`,`score_type`,`score_name`,`stu_id`,`score_total`,`score_num`,`score_scope`,`score_date`,`score_remarks`,`school_id`,`subject_id`,`stu_name`,`subject_name`,`class_id`,`class_name`,`grade_id`,`grade_name`,`exam_title`,
+    `class_rank`, grade_rank, class_average, grade_average
+    from stu_score
     </sql>
 
 	<select id="get" resultType="com.usoftchina.smartschool.school.po.StuScoreDO">

+ 3 - 2
applications/school/school-server/src/main/resources/mapper/WxTeacherMapper.xml

@@ -4,7 +4,7 @@
 <mapper namespace="com.usoftchina.smartschool.school.wxschool.mapper.WxTeacherMapper">
 
     <sql id="TeacherVo">
-    select `teacher_id`,`user_id`,`openid`,`school_id`,`teacher_number`,`teacher_name`,`teacher_sex`,`teacher_birthday`,`teacher_photo`,`teacher_working_age`,`teacher_experience`,`teacher_status`,`teacher_address`,`teacher_entry`,`teacher_honor`,`teacher_remarks` from sys_teacher
+    select `teacher_id`,`user_id`,`openid`,`school_id`,`teacher_number`,`teacher_name`,`teacher_sex`,`teacher_birthday`,`teacher_photo`,`teacher_working_age`,`teacher_experience`,`teacher_status`,`teacher_address`,`teacher_entry`,`teacher_honor`,`teacher_remarks`,`teacher_phone` from sys_teacher
     </sql>
 
 	<select id="get" resultType="com.usoftchina.smartschool.school.po.TeacherDO">
@@ -130,7 +130,8 @@
 			<if test="teacherAddress != null">`teacher_address` = #{teacherAddress}, </if>
 			<if test="teacherEntry != null">`teacher_entry` = #{teacherEntry}, </if>
 			<if test="teacherHonor != null">`teacher_honor` = #{teacherHonor}, </if>
-			<if test="teacherRemarks != null">`teacher_remarks` = #{teacherRemarks}</if>
+			<if test="teacherRemarks != null">`teacher_remarks` = #{teacherRemarks},</if>
+			<if test="teacherPhone != null">`teacher_phone` = #{teacherPhone}</if>
 		</set>
 		where teacher_id = #{teacherId}
 	</update>

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

@@ -7,6 +7,7 @@ import com.usoftchina.smartschool.auth.jwt.JwtInfo;
 import com.usoftchina.smartschool.context.BaseContextHolder;
 import com.usoftchina.smartschool.exception.BizException;
 import com.usoftchina.smartschool.exception.ExceptionCode;
+import com.usoftchina.smartschool.gateway.util.AntPathRequestMatcher;
 import com.usoftchina.smartschool.utils.CollectionUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -39,10 +40,10 @@ public class AuthFilter implements GlobalFilter, Ordered {
     @Override
     public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
         try {
-            // 鉴别身份信息
-            String token = getAuthToken(exchange.getRequest());
-            JwtInfo jwt = null;
-            if (token != null) {
+            if (!isIgnore(exchange.getRequest())) {
+                // 鉴别身份信息
+                String token = getAuthToken(exchange.getRequest());
+                JwtInfo jwt = null;
                 try {
                     jwt = JwtHelper.getInfoFromToken(token, authConfig.getPublicKey());
                 } catch (BizException e) {
@@ -72,6 +73,17 @@ public class AuthFilter implements GlobalFilter, Ordered {
         return null;
     }
 
+    /**
+     * 是否设置为忽略鉴权的请求
+     *
+     * @param request
+     * @return
+     */
+    private boolean isIgnore(ServerHttpRequest request) {
+        return authConfig.getIgnores().stream().anyMatch(ignore ->
+                new AntPathRequestMatcher(ignore).matches(request));
+    }
+
     @Override
     public int getOrder() {
         return -100;

+ 14 - 0
base-servers/gateway-server/src/main/resources/application.yml

@@ -135,3 +135,17 @@ auth:
   ignores:
     - /api/auth/authorize
     - /api/account/account/register
+    - /api/school/wxSchool/user/bindOpenid*
+    - /api/school/wxSchool/user/isBinding*
+    - /api/school/wxSchool/user/sendCodeUpdate*
+    - /api/school/wxSchool/user/sendCode*
+    - /api/school/wxSchool/user/userLogin*
+    - /api/school/wxSchool/user/sendCodeUpdate*
+    - /api/school/wxSchool/meeting/getMeetingDetails*
+    - /api/school/wxSchool/notify/getNotify*
+    - /api/school/wxSchool/stuScore/getScoreByStu*
+    - /api/school/wxSchool/taskNotify/taskDetail*
+    - /api/school/wxSchool/outInRecord/inout/detail*
+    - /api/device/**
+    - /api/file/download*
+    - /api/school/excel/**

+ 15 - 0
frontend/pc-web/app/model/Score.js

@@ -18,5 +18,20 @@ Ext.define('school.model.Score', {
     }, {
         name: 'sd_remark',
         type: 'string'
+    }, {
+        name: 'sd_total',
+        type: 'float'
+    }, {
+        name: 'sd_grade_average',
+        type: 'float'
+    }, {
+        name: 'sd_grade_rank',
+        type: 'int'
+    }, {
+        name: 'sd_class_average',
+        type: 'float'
+    }, {
+        name: 'sd_class_rank',
+        type: 'int'
     }]
 });

+ 109 - 0
frontend/pc-web/app/view/Interaction/mailbox/Detail.js

@@ -0,0 +1,109 @@
+Ext.define('school.view.interaction.maibox.Detail', {
+    extend: 'school.view.core.form.FormPanel',
+    xtype: 'interaction-maibox-Detail',
+
+    controller: 'interaction-maibox-Detail',
+    viewModel: 'interaction-maibox-Detail',
+
+    _title: '校长信箱',
+    _idField: 'mailbox_id',
+    _codeField: null,
+    // _readUrl: 'http://10.1.80.47:9520/api/school/principal/read',
+    _readUrl: '/api/school/principal/read',
+    initId: 0,
+
+    initComponent: function () {
+        Ext.apply(this, {
+            defaultItems: [{
+                xtype: 'hidden',
+                name: 'mailbox_id',
+                fieldLabel: 'id'
+            }, {
+                xtype: "textfield",
+                name: "mailbox_title",
+                fieldLabel: "标题",
+                columnWidth: 0.5,
+                readOnly: true
+            }, {
+                xtype: 'textfield',
+                name: 'mb_creatorname',
+                fieldLabel: '提出人',
+                readOnly: true
+            }, {
+                xtype: 'textfield',
+                name: 'mb_grade',
+                fieldLabel: '年级',
+                readOnly: true
+            }, {
+                xtype: 'textfield',
+                name: 'mb_class',
+                fieldLabel: '班级',
+                readOnly: true
+            }, {
+                xtype: 'datefield',
+                name: 'create_date',
+                fieldLabel: '提出时间',
+                readOnly: true
+            }, {
+                xtype: 'textfield',
+                name: 'mailbox_status_text',
+                fieldLabel: '回复状态',
+                readOnly: true,
+            }, {
+                xtype: 'textfield',
+                name: 'mb_ignore_text',
+                fieldLabel: '忽略状态',
+                readOnly: true,
+            }, {
+                xtype: "textareafield",
+                name: "mailbox_context",
+                fieldLabel: "内容",
+                columnWidth: 1,
+                readOnly: true
+            }, {
+                xtype: 'mfilefield',
+                name: 'mailbox_files',
+                fieldLabel: '附件',
+                readOnly: true
+            }, {
+                xtype: 'textareafield',
+                name: 'mb_reply',
+                fieldLabel: '回复内容',
+                columnWidth: 1,
+                allowBlank: false
+            }],
+            toolBtns: [{
+                xtype: 'button',
+                text: '回复',
+                handler: 'onReply',
+                bind: {
+                    disabled: '{!base.valid}'
+                }
+            }, {
+                xtype: 'button',
+                text: '忽略',
+                handler: 'onIgnore',
+                hidden: true,
+                bind: {
+                    hidden: '{!!mb_ignore}'
+                }
+            }, {
+                xtype: 'button',
+                text: '取消忽略',
+                handler: 'onUnIgnore',
+                hidden: true,
+                bind: {
+                    hidden: '{!mb_ignore}'
+                }
+            }]
+        });
+        this.callParent();
+    },
+    listeners: {
+        load: function(form, data) {
+            let fileField = form.down('mfilefield');
+            fileField.value = data.main.mailbox_files
+            fileField.renderMF(fileField);
+        }
+    }
+});

+ 90 - 0
frontend/pc-web/app/view/Interaction/mailbox/DetailController.js

@@ -0,0 +1,90 @@
+Ext.define('school.view.interaction.mailbox.DetailController', {
+    extend: 'school.view.core.form.FormPanelController',
+    alias: 'controller.interaction-maibox-Detail',
+
+    onReply: function () {
+        let me = this,
+        view = me.getView(),
+        viewModel = me.getViewModel(),
+        data = viewModel.data,
+        params, headers;
+        
+        params = {
+            id: data.mailbox_id,
+            msg: data.mb_reply
+        };
+
+        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);
+            school.util.BaseUtil.showSuccessToast('回复成功');
+            me.refresh();
+        }).catch(function (e) {
+            view.setLoading(false);
+            school.util.BaseUtil.showErrorToast('回复失败: ' + e.message);
+        });
+    },
+
+    onIgnore: function() {
+        let me = this,
+        view = me.getView(),
+        viewModel = me.getViewModel(),
+        id = viewModel.get('mailbox_id');
+
+        view.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: [{
+                    id: id
+                }]
+            })
+        }).then(function(res) {
+            view.setLoading(false);
+            school.util.BaseUtil.showSuccessToast('设置忽略成功');
+            me.refresh();
+        }).catch(function(e) {
+            view.setLoading(false);
+            school.util.BaseUtil.showErrorToast('设置忽略失败: ' + e.message);
+        });
+    },
+
+    onUnIgnore: function() {
+
+        let me = this,
+        view = me.getView(),
+        viewModel = me.getViewModel(),
+        id = viewModel.get('mailbox_id');
+
+        view.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: [{
+                    id: id
+                }]
+            })
+        }).then(function(res) {
+            view.setLoading(false);
+            school.util.BaseUtil.showSuccessToast('取消忽略成功');
+            me.refresh();
+        }).catch(function(e) {
+            view.setLoading(false);
+            school.util.BaseUtil.showErrorToast('取消忽略失败: ' + e.message);
+        });
+    },
+});

+ 26 - 0
frontend/pc-web/app/view/Interaction/mailbox/DetailModel.js

@@ -0,0 +1,26 @@
+Ext.define('school.view.interaction.mailbox.DetailModel', {
+    extend: 'school.view.core.form.FormPanelModel',
+    alias: 'viewmodel.interaction-maibox-Detail',
+
+    data: {
+        showAddBtn: false,
+        showSaveBtn: false,
+        showDeleteBtn: false
+    },
+
+    formulas: {
+        mb_ignore_text: {
+            bind: '{mb_ignore}',
+            get: function(v) {
+                return v == 1 ? '已忽略' : '正常'
+            }
+        },
+        mailbox_status_text: {
+            bind: '{mailbox_status}',
+            get: function(v) {
+                return v == 3 ? '已回复' : '未回复'
+            }
+        }
+    }
+
+});

+ 4 - 16
frontend/pc-web/app/view/Interaction/mailbox/List.js

@@ -91,7 +91,9 @@ Ext.define('school.view.interaction.mailbox.List', {
 
             gridConfig: {
                 idField: 'mailbox_id',
-                codeField: null,
+                codeField: 'mailbox_title',
+                addTitle: '校长信箱',
+                addXtype: 'interaction-maibox-Detail',
                 statusCodeField: null,
                 dataUrl: me.dataUrl,
                 caller: null,
@@ -105,7 +107,7 @@ Ext.define('school.view.interaction.mailbox.List', {
                     ignoreRightMouseSelection: false
                 },
                 hiddenTools: false,
-                disableDetail: true,
+                disableDetail: false,
                 toolBtns: [{
                     xtype: 'button',
                     text: '忽略',
@@ -138,20 +140,6 @@ Ext.define('school.view.interaction.mailbox.List', {
                     renderer: function(v, m, r) {
                         return v == 3 ? '已回复' : '未回复';
                     }
-                }, {
-                    xtype:'actioncolumn',
-                    width:70,
-                    dataIndex:'actioncolumn',
-                    text:'回复',
-                    align: 'center',
-                    items: [{
-                        tooltip: '回复',
-                        iconCls: 'x-ss ss-reply fa-fw',
-                        scope:this
-                    }],
-                    listeners: {
-                        click: 'onActionClick'
-                    }
                 }, {
                     text: '回复信息',
                     dataIndex: 'mb_reply',

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

@@ -81,11 +81,11 @@ Ext.define('school.view.interaction.mailbox.ListController', {
                             }).then(function (res) {
                                 view.setLoading(false);
                                 win.close();
-                                school.util.BaseUtil.showSuccessToast('添加成功');
+                                school.util.BaseUtil.showSuccessToast('回复成功');
                                 view.refresh();
                             }).catch(function (e) {
                                 view.setLoading(false);
-                                school.util.BaseUtil.showErrorToast('添加失败: ' + e.message);
+                                school.util.BaseUtil.showErrorToast('回复失败: ' + e.message);
                             });
                         }
                     }]

+ 2 - 1
frontend/pc-web/app/view/Interaction/notice/SchoolNotice.js

@@ -72,7 +72,8 @@ Ext.define('school.view.interaction.notice.SchoolNotice', {
                 fieldLabel: "内容",
                 height: 300,
                 columnWidth: 1,
-                allowBlank: false
+                allowBlank: false,
+                maxLength: 5000
             }, {
                 xtype: 'mfilefield',
                 name: 'notify_files',

+ 57 - 4
frontend/pc-web/app/view/Interaction/score/Detail.js

@@ -11,7 +11,7 @@ Ext.define('school.view.interaction.score.Detail', {
 
     // _readUrl: 'http://10.1.80.36:9520/api/school/score/read',
     _readUrl: '/api/school/score/read',
-    // _saveUrl: 'http://10.1.80.47:9520/api/school/score/save',
+    // _saveUrl: 'http://10.1.80.36:9520/api/school/score/save',
     _saveUrl: '/api/school/score/save',
     // _deleteUrl: 'http://10.1.80.47:9520/api/school/score/delete',
     _deleteUrl: '/api/school/score/delete',
@@ -27,16 +27,33 @@ Ext.define('school.view.interaction.score.Detail', {
             }, {
                 xtype: 'textfield',
                 name: 'si_examtitle',
-                fieldLabel: '考试标题'
+                fieldLabel: '考试标题',
+                allowBlank: false
             }, {
                 xtype: 'datefield',
                 name: 'si_examdate',
                 fieldLabel: '考试时间',
                 allowBlank: false
             }, {
-                xtype: 'textfield',
+            //     xtype: 'textfield',
+            //     name: 'si_examscope',
+            //     fieldLabel: '考试范围'
+            // }, {
+                xtype: 'combobox',
                 name: 'si_examscope',
-                fieldLabel: '考试范围'
+                fieldLabel: '考试范围',
+                editable: false,
+                queryModel: 'local',
+                valueField: 'name',
+                displayField: 'name',
+                store: Ext.create('Ext.data.Store', {
+                    fields: ['name'],
+                    data: [
+                        {name: '全年级'},
+                        {name: '班级'}
+                    ]
+                }),
+                defaultValue: '班级'
             }, {
             //     xtype: 'hidden',
             //     name: 'task_gradeid',
@@ -147,6 +164,42 @@ Ext.define('school.view.interaction.score.Detail', {
                         xtype: 'numberfield',
                         minValue: 0
                     }
+                }, {
+                    text: '满分',
+                    dataIndex: 'sd_total',
+                    allowBlank: false,
+                    editor: {
+                        xtype: 'numberfield',
+                        minValue: 0
+                    }
+                }, {
+                    text: '年级平均分',
+                    dataIndex: 'sd_grade_average',
+                    editor: {
+                        xtype: 'numberfield',
+                        minValue: 0
+                    }
+                }, {
+                    text: '年级排名',
+                    dataIndex: 'sd_grade_rank',
+                    editor: {
+                        xtype: 'numberfield',
+                        minValue: 0
+                    }
+                }, {
+                    text: '班级平均分',
+                    dataIndex: 'sd_class_average',
+                    editor: {
+                        xtype: 'numberfield',
+                        minValue: 0
+                    }
+                }, {
+                    text: '班级排名',
+                    dataIndex: 'sd_class_rank',
+                    editor: {
+                        xtype: 'numberfield',
+                        minValue: 0
+                    }
                 }, {
                     text: '备注',
                     dataIndex: 'sd_remark',

+ 0 - 2
frontend/pc-web/app/view/Interaction/score/DetailController.js

@@ -72,8 +72,6 @@ Ext.define('school.view.interaction.score.DetailController', {
 
     getDefaultCondition: function(idx) {
         var me = this,
-        form = me.getView(),
-        formItems = form.formItems,
         viewModel = me.getViewModel(),
         gradeName = viewModel.get('si_grade'),
         clazzName = viewModel.get('si_class');

+ 4 - 2
frontend/pc-web/app/view/Interaction/score/List.js

@@ -7,7 +7,7 @@ Ext.define('school.view.interaction.score.List', {
 
     controller: 'interaction-score-list',
 
-    // dataUrl: 'http://10.1.80.47:9520/api/school/score/list',
+    // dataUrl: 'http://10.1.80.36:9520/api/school/score/list',
     dataUrl: '/api/school/score/list',
     caller: 'ScorePublish',
     pathKey: 'score',
@@ -162,9 +162,11 @@ Ext.define('school.view.interaction.score.List', {
                     dataIndex: 'si_examtitle',
                     width: 200
                 }, {
+                    xtype: 'datecolumn',
                     text: '考试时间',
                     dataIndex: 'si_examdate',
-                    width: 150
+                    width: 150,
+                    formate: 'Y-m-d',
                 }, {
                     text: '考试范围',
                     dataIndex: 'si_examscope'

+ 56 - 4
frontend/pc-web/app/view/basic/school/SchoolInfo.js

@@ -9,7 +9,7 @@ Ext.define('school.view.basic.school.SchoolInfo', {
     // controller: 'purchase-purchase-formpanel',
     // viewModel: 'purchase-purchase-formpanel',
 
-    // readUrl: 'http://10.1.80.35:9560/school/read',
+    // readUrl: 'http://10.1.80.36:9520/api/school/school/read',
     readUrl: '/api/school/school/read',
 
     layout: 'column',
@@ -40,11 +40,12 @@ Ext.define('school.view.basic.school.SchoolInfo', {
                 }, '->'],
             }],
             items: [{
-                xtype: 'hidden',
+                xtype: 'textfield',
                 name: 'school_id',
                 bind: '{schoolId}',
-                fieldLabel: 'id',
-                columnWidth: 1
+                fieldLabel: '学校ID',
+                columnWidth: 1,
+                readOnly: true
             }, {
                 xtype: "textfield",
                 name: "school_name",
@@ -53,6 +54,57 @@ Ext.define('school.view.basic.school.SchoolInfo', {
                 allowBlank: false,
                 columnWidth: 1,
                 maxLength: 100
+            }, {
+                xtype: "hidden",
+                name: 'teacher_id',
+                bind: '{TeacherId}',
+                fieldLabel: '校长ID',
+                columnWidth: 1
+            }, {
+                name: 'teacher_name',
+                bind: '{TeacherName}',
+                fieldLabel: '校长',
+                columnWidth: 1,
+                maxLength: 20,
+                addTitle: '教师',
+                xtype: 'dbfindtrigger',
+                //数据接口
+                dataUrl:'/api/school/mirror/findTeacher',
+                //联想设置
+                dbtpls:[{
+                    field:'teacher_name',width:150
+                }],
+                dbfinds:[{
+                    from: 'teacher_name', to: 'teacher_name',
+                }, {
+                    from: 'teacher_id', to: 'teacher_id'
+                }],
+                defaultCondition: "1=1",
+                dbSearchFields:[{
+                    emptyText:'请输入教师工号或姓名',
+                    xtype : "textfield", 
+                    name : "search", 
+                    getCondition: function(v) {
+                        return "(upper(teacher_name) like '%"+v.toUpperCase()+"%' or upper(teacher_number) like '%"+v.toUpperCase()+"%')";
+                    },
+                    allowBlank : true, 
+                    width:300
+                }],
+                //放大镜窗口列表
+                dbColumns:[{
+                    text: "ID",
+                    dataIndex: "teacher_id",
+                    hidden:true,
+                    xtype: "numbercolumn"
+                }, {
+                    text: '工号',
+                    dataIndex: 'teacher_number',
+                    width: 110
+                }, {
+                    text: "姓名",
+                    dataIndex: "teacher_name",
+                    width: 110
+                }]
             }, {
                 xtype: "textfield",
                 name: 'school_phone',

+ 3 - 1
frontend/pc-web/app/view/basic/student/StudentDetail.js

@@ -177,7 +177,9 @@ Ext.define('school.view.basic.student.StudentDetail', {
                     dataIndex: 'pa_phone',
                     width: 180,
                     editor: {
-                        xtype: 'numberfield'
+                        xtype: 'numberfield',
+                        maxLength: 11,
+                        minLength: 11,
                     }
                 }, {
                     text: '关系',

+ 3 - 2
frontend/pc-web/app/view/core/form/FormPanel.js

@@ -328,7 +328,7 @@ Ext.define('school.view.core.form.FormPanel', {
     clearDirty: function() {
         let me = this;
         let detailGrids = me.query('detailGridField');
-        let fields = me.getForm().getFields().items;
+        let fields = me.formItems;
         
         Ext.Array.each(fields, function(f) {
             f.resetOriginalValue ? f.resetOriginalValue() : '';
@@ -341,7 +341,8 @@ Ext.define('school.view.core.form.FormPanel', {
     setEditable: function(able) {
         let me = this,
         viewModel = me.getViewModel(),
-        items = me.getForm().getFields().items;
+        // items = me.getForm().getFields().items;
+        items = me.formItems;
 
         let detailGrids = me.query('detailGridField');
 

+ 26 - 9
frontend/pc-web/app/view/core/form/field/FileField.js

@@ -57,6 +57,10 @@ Ext.define('school.view.core.form.field.FileField', {
         return this.getValueField().value;
     },
 
+	resetOriginalValue: function() {
+		this.getValueField().resetOriginalValue();
+	},
+	
     getValueField: function () {
         return this.items.items[0].items.items[0];
     },
@@ -69,12 +73,11 @@ Ext.define('school.view.core.form.field.FileField', {
     },
 	renderMF: function(f){
 		f.setHtml(null);
-		var form = f.ownerCt;			
 		if(f.value != null && f.value.toString().trim() != ''){
 			f.download(f.value,f.name);
 		}
-		if(typeof(form.readOnly)!="undefined"){
-			f.setReadOnly(form.readOnly);
+		if(typeof(f.readOnly)!="undefined"){
+			f.setReadOnly(f.readOnly);
 		}
 	},
 	/**
@@ -124,9 +127,15 @@ Ext.define('school.view.core.form.field.FileField', {
 						});
 						me.add(field);
 						var oldValue = me.value;
-						var arr = oldValue ? oldValue.replace(/[ \[ | \" | \" | \] ]/g, '').split(',') : [];
+						var arr = oldValue ? oldValue.replace(/[ \[ | \" | \] ]/g, '').split(',') : [];
+						// 去掉空字符串等无效记录
+						for(let i = arr.length - 1;i >= 0; i--) {
+							if(!arr[i]) {
+								arr.splice(i, 1);
+							}
+						}
 						arr.push(data.accessPath);
-						var val = '["' + arr.join(',') + '"]';
+						var val = '["' + arr.join('","') + '"]';
 						me.setValue(val);
 					}
 					field.reset();
@@ -149,13 +158,15 @@ Ext.define('school.view.core.form.field.FileField', {
 	download: function(paths,name){
 		var me = this;
 		me.clearAll();
-		var files = new Array();	
+		var files = new Array();
+		var accessPath = paths.replace(/[ \[ | \" | \" | \] ]/g, '');
+		accessPath = accessPath == 'null' ? null : accessPath;
 		Ext.Ajax.request({
 			// url : 'http://10.1.80.101:9520/api/file/info',
 			url : '/api/file/info',
 			async: false,
 			params: {
-				accessPath:  paths.replace(/[ \[ | \" | \" | \] ]/g, '')
+				accessPath: accessPath
 			},
 			method : 'GET',
 			callback : function(options,success,response){
@@ -174,12 +185,13 @@ Ext.define('school.view.core.form.field.FileField', {
 				fileName: f.name,
 				value: name,
 				columnWidth: w,
-				readOnly: false,
 				editable: false,
 				filepath: f.fullPath,
+				accessPath: f.accessPath,
 				filesize: f.size,
 				_id:f.id,
-				fieldStyle: 'background:#E0EEEE;'
+				fieldStyle: 'background:#E0EEEE;',
+				readOnly: me.readOnly
 			}));
 		});
 		me.dirty = false;
@@ -202,6 +214,7 @@ Ext.define('school.view.core.form.field.FileField', {
 	},
 	setReadOnly: function(bool){
 		//只读情况下限制不允许上传
+		this.readOnly = bool;
 		var f=this.down('filefield');
 		if(f.button&&f.fileInputEl){
 			//若界面配置字段可修改则允许传附件 
@@ -211,6 +224,10 @@ Ext.define('school.view.core.form.field.FileField', {
 				f.fileInputEl.dom.setAttribute('disabled',bool);	
 			}else f.fileInputEl.dom.removeAttribute('disabled');			
 		}
+		let files = this.query('trashfield');
+		Ext.Array.each(files, function(fe) {
+			fe.setReadOnly(bool);
+		});
 	},
 	setFieldStyle: function(str) {
 

+ 4 - 0
frontend/pc-web/app/view/core/form/field/RemoteImgField.js

@@ -126,6 +126,10 @@ Ext.define('school.view.core.form.field.RemoteImgField', {
         fileField.button.setDisabled(val);
     },
 
+    resetOriginalValue: function() {
+		this.getValueField().resetOriginalValue();
+	},
+
     /**
      * 上传附件
      */

+ 39 - 4
frontend/pc-web/app/view/core/form/field/TrashField.js

@@ -7,13 +7,34 @@ Ext.define('school.view.core.form.field.TrashField', {
 	alias : 'widget.trashfield',
     style:'margin:5px 0 0 0',
 	fieldStyle: 'background:#C6E2FF;color:#D9D9D9;',
-    autoShow: true,
+	autoShow: true,
+	maxLength: 200,
 	initComponent : function() {
 		this.callParent(arguments);
 	},
 	triggers: {
 		foo: {
 			cls: 'x-form-download-trigger',
+			hideOnReadOnly: false,
+			/**
+			 * onClick和handler的区别:
+			 * onClick要先于handler触发,并且handler的触发是在onClick中进行的
+			 */
+			onClick: function() {
+				var me = this,
+					args = arguments,
+					e = me.clickRepeater ? args[1] : args[0],
+					handler = me.handler,
+					field = me.field;
+				// 这里去掉了 !field.readOnly 条件以保证只读下也能点击下载
+				if (handler &&  me.isFieldEnabled()) {
+					Ext.callback(me.handler, me.scope, [
+						field,
+						me,
+						e
+					], 0, field);
+				}
+			},
 			handler: function(e){
 				this.download();
 			},
@@ -24,9 +45,22 @@ Ext.define('school.view.core.form.field.TrashField', {
 				var me = this;
 				school.util.BaseUtil.warnMsg('确定删除' + me.value, function(btn){
 					if(btn == 'yes'){
-						var v = me.ownerCt.value.replace(me._id+';','')
+						var arr = me.ownerCt.value.replace(/[ \[ | \" | \] ]/g, '').split(',');
+						var val;
+						for(let i = 0; i < arr.length; i++) {
+							if(arr[i] == me.accessPath) {
+								arr.splice(i,1);
+								break;
+							}
+						}
+						if(arr.length > 0) {
+							val = '["' + arr.join('","') + '"]';
+						}else{
+							val = '[]'
+						}
+						
 						
-						me.ownerCt.setValue(v);
+						me.ownerCt.setValue(val);
 						// if(v == '') {
 						// 	me.ownerCt.dirty = false;
 						// }
@@ -59,7 +93,8 @@ Ext.define('school.view.core.form.field.TrashField', {
 	download : function() {
         var me = this;
         var serverOptions = Ext.manifest.server;
-		window.location.href = (serverOptions.basePath.https?serverOptions.basePath.https:serverOptions.basePath) + '/api/file/download?path='+me.filepath;
+		var rul = (serverOptions.basePath.https?serverOptions.basePath.https:serverOptions.basePath) + '/api/file/download?path='+me.filepath;
+		window.open(rul);
 	},
 	showAttach : function() {
 		var me = this,src = basePath + 'common/download.action?path=' + me.realpath.replace(/\+/g, '%2B')+"&size="+me.filesize+"&fileName="+me.fileName;

+ 2 - 10
frontend/pc-web/app/view/home/Home.js

@@ -39,16 +39,11 @@ Ext.define('school.view.home.Home', {
 
         latyout: 'responsivecolumn',
         defaults: {
-            userCls: 'x-home-chart big-50 small-50',
+            userCls: 'x-home-chart big-100 small-100',
         },
         items: [{
-            xtype: 'studentgender',
+            xtype: 'inoutrecord',
             padding: '0 0 0 14',
-            margin: '0 16 0 0',
-        }, {
-            xtype: 'chinessavg',
-            padding: '0 0 0 14',
-            margin: 0,
         }]
     }],
 
@@ -59,18 +54,15 @@ Ext.define('school.view.home.Home', {
 
     listeners: {
         onTabActivate: function(p) {
-            return;
             p.refreshId = window.setInterval((p.refreshStores.bind(p)()).bind(p), p.REFRESH_INTERVALS);
         },
         onTabDeactivate: function(p) {
-            return;
             p.lastTime = 0;
             window.clearInterval(p.refreshId);
         }
     },
 
     refreshStores: function() {
-        return;
         var me = this,
         lastTime = me.lastTime || 0,
         now = Ext.Date.now(),

+ 37 - 0
frontend/pc-web/app/view/home/HomeModel.js

@@ -6,6 +6,43 @@ Ext.define('school.view.home.HomeModel', {
     },
 
     stores: {
+        infoData: {
+            fields: [],
+            autoLoad: true,
+            proxy: {
+                type: 'ajax',
+                // url: 'http://10.1.80.36:9520/api/school/portal/home',
+                url: '/api/school/portal/home',
+                timeout: 8000,
+                actionMethods: {
+                    read: 'GET'
+                },
+                reader: {
+                    type: 'json'
+                },
+                listeners: {
+                    exception: function(proxy, response, operation, eOpts) {
+                        var p = Ext.getCmp('infocard');
+                        p && p.setLoading(false);
+                    }
+                }
+            },
+            listeners: {
+                beforeload: function() {
+                    var p = Ext.getCmp('infocard');
+                        p && p.setLoading(true);
+                },
+                load: function(s, d) {
+                    var p = Ext.getCmp('infocard');
+                        p && p.setLoading(false);
+
+                    if(!d) return;
+                    var res = d[0] ? (d[0].data ? (d[0].data.data || {}) : {}) : {};
+
+                    Ext.getCmp('infocard').addCardItems(res);
+                }
+            }
+        },
         studentgender: {
             fields: ['x', 'y'],
             data: [{

+ 12 - 24
frontend/pc-web/app/view/home/InfoCard.js

@@ -34,15 +34,20 @@ Ext.define('school.view.home.InfoCard', {
 
         Ext.apply(me, {
             cards: {
-                staff: {
-                    title: '职工人数',
+                student: {
+                    title: '学生人数',
+                    color: 'blue',
+                    viewType: 'home-infocardlist-unauditcheckin',
+                },
+                teacher: {
+                    title: '教职工人数',
                     color: 'yellow',
                     viewType: 'home-infocardlist-saleout',
                 },
-                teacher: {
-                    title: '教师人数',
-                    color: 'purple',
-                    viewType: 'home-infocardlist-purchasein',
+                parent: {
+                    title: '家长人数',
+                    color: 'default',
+                    viewType: 'home-infocardlist-unauditsaleout',
                 },
                 grade: {
                     title: '年级',
@@ -53,16 +58,6 @@ Ext.define('school.view.home.InfoCard', {
                     title: '班级',
                     color: 'pink',
                     viewType: 'home-infocardlist-recment',
-                },
-                student: {
-                    title: '学生人数',
-                    color: 'blue',
-                    viewType: 'home-infocardlist-unauditcheckin',
-                },
-                parent: {
-                    title: '家长人数',
-                    color: 'default',
-                    viewType: 'home-infocardlist-unauditsaleout',
                 }
             },
             userCls: 'x-info-card ' + me.userCls,
@@ -97,14 +92,7 @@ Ext.define('school.view.home.InfoCard', {
     },
 
     initCardItems: function() {
-        this.addCardItems({
-            staff: 39,
-            teacher: 89,
-            grade: 6,
-            class: 36,
-            student: 980,
-            parent: 1783
-        });
+        this.addCardItems({});
     },
 
     addCardItems: function(infoData) {

+ 1 - 0
frontend/pc-web/app/view/home/InfoCard.scss

@@ -80,6 +80,7 @@ $card-box-height: 110px;
     }
 
     .x-mask {
+        border: none !important;
         background-color: transparent;
     }
 }

+ 105 - 0
frontend/pc-web/app/view/home/charts/InOutRecord.js

@@ -0,0 +1,105 @@
+Ext.define('school.view.home.charts.InOutRecord', {
+    extend: 'school.view.core.chart.ChartBase',
+    xtype: 'inoutrecord',
+
+    id: 'inoutrecord',
+
+    title: '学生出入校数据',
+
+    initComponent: function () {
+        var me = this;
+
+        Ext.apply(me, {
+            items: [{
+                xtype: 'echartsbase',
+                bind: {
+                    store: '{infoData}',
+                },
+                createOption: me.createOption
+            }]
+        });
+
+        me.callParent(arguments);
+    },
+
+    createOption: function (store) {
+        var inData = [],
+            outData = [];
+
+        Ext.Array.each(store.getData().items[0].data.data.inoutRecord, function (d) {
+            if(d.type == 1) {
+                inData.push([
+                    d.date, d.count
+                ]);
+            }else {
+                outData.push([
+                    d.date, d.count
+                ]);
+            }
+        });
+
+        return {
+            color: [
+                '#64B0E4',
+                '#FF1038'
+            ],
+            tooltip: {
+                trigger: 'axis'
+            },
+            legend: {
+                left: 0,
+                data: ['入校', '出校'],
+                icon: 'rect',
+                itemWidth: 10,
+                itemHeight: 2
+            },
+            grid: {
+                left: 0,
+                right: 16,
+                bottom: 5,
+                top: 40,
+                borderColor: '#E5EAEF',
+                containLabel: true
+            },
+            xAxis: {
+                type: 'time',
+                boundaryGap: false,
+                axisLine: {
+                    lineStyle: {
+                        color: '#E5EAEF',
+                    }
+                },
+                axisLabel: {
+                    color: '#485465'
+                },
+            },
+            yAxis: {
+                type: 'value',
+                axisLine: {
+                    lineStyle: {
+                        color: '#E5EAEF',
+                    }
+                },
+                splitLine: {
+                    lineStyle: {
+                        color: ['#E5EAEF']
+                    }
+                },
+                axisLabel: {
+                    color: '#485465'
+                }
+            },
+            series: [{
+                name: '入校',
+                showSymbol: true,
+                type: 'line',
+                data: inData
+            }, {
+                name: '出校',
+                showSymbol: true,
+                type: 'line',
+                data: outData
+            }]
+        }
+    }
+});

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

@@ -48,7 +48,7 @@ Ext.define('school.view.viewport.ViewportController', {
         var schoolId = school.util.BaseUtil.getCurrentUser().school_id;
         //读取学校
         school.util.BaseUtil.request({
-            // url:'http://10.1.80.35:9560/school/read/1'
+            // url:'http://10.1.80.36:9520/api/school/school/read/' + schoolId
             url:'/api/school/school/read/' + schoolId
         })
         .then(function(res) {
@@ -56,6 +56,8 @@ Ext.define('school.view.viewport.ViewportController', {
                 let d = {
                     schoolId: res.data.school_id,
                     schoolName: res.data.school_name,
+                    TeacherId: res.data.teacher_id,
+                    TeacherName: res.data.teacher_name,
                     schoolPhone: res.data.school_phone,
                     schoolRemarks: res.data.school_remarks,
                     schoolAppId: res.data.school_appid,

+ 2 - 1
frontend/pc-web/ext/packages/modern-locale/overrides/zh_CN/field/Text.js

@@ -5,7 +5,8 @@
 Ext.define('Ext.locale.zh_CN.field.Text', {
     override: 'Ext.form.field.Text',
 
-    maxLengthText: '字段长度不能超过 {0}个字符',
+    maxLengthText: '字段长度不能大于 {0}个字符',
+    minLengthText: '字段长度不能小于 {0}个字符',
 
     config: {
         requiredMessage: '必填项',

+ 13 - 7
frontend/wechat-web/src/components/PrincipalItem.jsx

@@ -35,20 +35,20 @@ export default class PrincipalItem extends Component {
         if (!isObjEmpty(principalBean.enclosure) && principalBean.enclosure != '[]') {
             enclosureItem =
                 <div className='principal-enclosure-layout'>
-                    <img src={_baseURL + principalBean.enclosure[0]} className='principal-enclosure-img'
+                    <img src={ principalBean.enclosure[0]} className='principal-enclosure-img'
                          onClick={this.handlePreview}/>
                     <span className='principal-enclosure-count'>({principalBean.enclosure.length}张)</span>
                 </div>
 
             try {
                 principalBean.enclosure.forEach((enclosure, index) => {
-                    pictureUrls.push(_baseURL + enclosure)
+                    pictureUrls.push( enclosure)
                 })
             } catch (e) {
 
             }
         }
-        let replayItem = <span></span>
+        let replayItem = null
         if (principalBean.reply) {
             replayItem = <pre className='common-font-family'
                               style={{
@@ -58,7 +58,8 @@ export default class PrincipalItem extends Component {
                                   marginTop: '10px',
                                   borderTop: '1px solid #d0d0d0',
                                   padding: '10px',
-                                  whiteSpace: 'pre-line'
+                                  whiteSpace: 'pre-line',
+                                  border:'none'
                               }}>{principalBean.reply}</pre>
         }
 
@@ -68,9 +69,9 @@ export default class PrincipalItem extends Component {
                     <div className='principal-item-root'>
                         <div className='principal-item-top'>
                             <div className='principal-item-time'>{principalBean.time}</div>
-                            <span className={principalBean.status == '已查阅' ?
+                         {/*   <span className={principalBean.status == '已查阅' ?
                                 'principal-item-status-done' :
-                                'principal-item-status-todo'}>{principalBean.status}</span>
+                                'principal-item-status-todo'}>{principalBean.status}</span>*/}
                         </div>
                         <div className='principal-item-content'>{principalBean.suggest}</div>
                         {enclosureItem}
@@ -78,7 +79,12 @@ export default class PrincipalItem extends Component {
                         <span className='principal-item-delete'
                               onClick={this.onDeleteEvent}>删除</span>
                         </div>
-                        {replayItem}
+                        {
+                            replayItem != null ? <div>
+                                <div>校长回复</div>
+                                {replayItem}
+                            </div> : ''
+                        }
                     </div>
                 </div>
 

+ 15 - 1
frontend/wechat-web/src/components/UploadEnclosure.jsx

@@ -11,6 +11,7 @@ import ImagesViewer from '../components/imagesVIewer/index'
 import PropTypes from 'prop-types';
 import 'css/upload.css'
 import {_baseURL} from "../configs/api.config";
+import store from './../redux/store/store'
 
 let uploadFail = false;
 export default class UploadEnclosure extends Component {
@@ -18,6 +19,7 @@ export default class UploadEnclosure extends Component {
     static propTypes = {
         action: PropTypes.string.isRequired,//上传地址
         data: PropTypes.object,//上传所需参数
+        headers: PropTypes.object,//上传所需头部参数
         accept: PropTypes.string,//接受上传的文件类型
         listType: PropTypes.string,//附件列表格式,默认picture-card
         count: PropTypes.number,//附件限制数量,默认为1
@@ -36,6 +38,9 @@ export default class UploadEnclosure extends Component {
         count: 1,
         data: {
             folderId: 0
+        },
+        headers: {
+
         },
         multiple: false,
         title: '附件',
@@ -70,7 +75,7 @@ export default class UploadEnclosure extends Component {
         const {fileList} = this.state
         const {
             action, listType, count, multiple,
-            title, needPoint, limit, accept, data
+            title, needPoint, limit, accept, data, headers
         } = this.props
 
         const imgs = []
@@ -84,6 +89,13 @@ export default class UploadEnclosure extends Component {
         if (imgs.length > 9) {
             pointAble = false
         }
+        const userInfo = store.getState().redUserInfo
+
+        const headerParams = {
+            // headers?...headers:{},
+            "Authorization": userInfo.token,
+            ...headers,
+        }
 
         const uploadButton = (
             <div>
@@ -106,6 +118,8 @@ export default class UploadEnclosure extends Component {
                         listType={listType}
                         fileList={fileList}
                         multiple={multiple}
+                        withCredentials={true}
+                        headers={headerParams}
                         beforeUpload={this.beforeUpload}
                         onPreview={this.handlePreview}
                         onChange={this.handleChange}

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

@@ -9,7 +9,9 @@ import store from './../redux/store/store'
  */
 export const _host = 'https://school-api.ydyhz.com'
 // export const _host = 'http://10.1.80.36:9520'
+
 export const _baseURL = _host + '/api/school'
+// export const _baseURL = _host
 
 export const API = {
     //获取openId
@@ -137,7 +139,7 @@ export const API = {
     //出入校单次记录详情
     INOUT_RECORD_DETAIL: _baseURL + '/wxSchool/outInRecord/inout/detail',
 
-    //更改手机号获取验证码
+    //更改手机号时间获取验证码
     SEND_CODEUPDATE: _baseURL + '/wxSchool/user/sendCodeUpdate',
 
     ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -174,15 +176,15 @@ export const API = {
     GET_PICTURE_LIST: _baseURL + '/wxSchool/clazzPicture/getPictureByAlbum',
 
     //创建通知公告
-    NOTIFY_CREATE: _baseURL + '/wxSchool/notify/createNotify',
+    NOTIFY_CREATE: _baseURL + '/notice/savePublish',
     //通知公告列表家长端
-    NOTIFY_LIST_PARENT: _baseURL + '/wxSchool/notify/notifyListByStu',
+    NOTIFY_LIST_PARENT: _baseURL + '/wxSchool/notify/notifyList',
     //通知公告列表教师端
-    NOTIFY_LIST_TEACHER: _baseURL + '/wxSchool/notify/notifyListByTeacher',
+    NOTIFY_LIST_TEACHER: _baseURL + '/wxSchool/notify/notifyList',
     //通知公告详情家长端
-    NOTIFY_DETAIL_PARENT: _baseURL + '/wxSchool/notify/getNotifyDetails',
+    NOTIFY_DETAIL_PARENT: _baseURL + '/wxSchool/notify/getNotify',
     //通知公告详情教师端
-    NOTIFY_DETAIL_TEACHER: _baseURL + '/wxSchool/notify/getNotifyDetailsByTeacher',
+    NOTIFY_DETAIL_TEACHER: _baseURL + '/wxSchool/notify/getNotify',
 
 
     //获取所有老师手机号
@@ -200,14 +202,18 @@ export const API = {
     //作业列表教师端
     HOMEWORK_LIST_TEACHER: _baseURL + '/wxSchool/taskNotify/listTaskTeacher',
     //创建作业发布
-    homeWorkAdd: _baseURL + "/wxSchool/taskNotify/createTask",
+    // homeWorkAdd: _baseURL + "/wxSchool/taskNotify/createTask",
+    homeWorkAdd: _baseURL + "/homework/savePublish",
     //作业详情
     HOMEWORK_DETAIL: _baseURL + '/wxSchool/taskNotify/taskDetail',
     //作业回复
     HOMEWORK_REPLY: _baseURL + '/wxSchool/taskNotify/taskReply',
 
     //获取科目列表
-    SUBJECT_LIST: _baseURL + '/wxSchool/taskNotify/subjectDOList'
+    SUBJECT_LIST: _baseURL + '/wxSchool/taskNotify/subjectDOList',
+
+    //身份切换时获取token
+    SWITCH_IDENTITY :_baseURL + '/wxSchool/user/switchIdentity'
 }
 
 

+ 1 - 1
frontend/wechat-web/src/configs/router.config.js

@@ -94,7 +94,7 @@ class RouteConfig extends Component {
                         <Route path='/phonesSearch/:type' component={PhonesSearch}/>{/*通讯录搜索页面*/}
 
                         <Route path='/principalMailbox' component={PrincipalMailbox}/>{/*校长信箱*/}
-                        <Route path='/meetingSignIn' component={MeetingSignIn}/>{/*会议列表*/}
+                         <Route path='/meetingSignIn' component={MeetingSignIn}/>{/*会议列表*/}
                         <Route path='/systemMessage' component={SystemMessage}/>{/*系统消息*/}
                         <Route path='/useHelp' component={UseHelp}/>{/*使用帮助*/}
                         <Route path='/wonderMoment/:type?' component={WonderMoment}/>{/*精彩瞬间*/}

+ 3 - 0
frontend/wechat-web/src/modules/accountBind/AccountBind.jsx

@@ -213,6 +213,9 @@ class AccountBind extends Component {
             }
 
             if (response && response.data) {
+                switchUser({
+                    token: response.data.token ? response.data.token.token : ''
+                })()
                 if (response.data.teacherDOS) {
                     const teacherDOS = response.data.teacherDOS[0]
 

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

@@ -88,10 +88,12 @@ class BindMenu extends Component {
             schoolId: 1,//学校id暂时写死,后续需要添加选择学校的步骤
             headimgurl: decodeURIComponent(this.wxAvatar),
         }).then(response => {
-            switchUser({
-                userOpenid: this.openid,
-            })()
             if (response.data) {
+                switchUser({
+                    userOpenid: this.openid,
+                    token: response.data.token ? response.data.token.token : ''
+                })()
+
                 if (!isObjEmpty(response.data.teacherDOS)) {
                     const teacherDOS = response.data.teacherDOS[0]
 
@@ -194,7 +196,7 @@ class BindMenu extends Component {
                 <Button type="primary" block
                         style={{
                             marginTop: '20px', letterSpacing: '10px',
-                            borderRadius: '9px', fontSize: '14px',borderRadius: '30px',
+                            borderRadius: '9px', fontSize: '14px', borderRadius: '30px',
                         }}
                         onClick={this.parentBind}>我是家长</Button>
                 <Button type="primary" block

+ 8 - 2
frontend/wechat-web/src/modules/album/PictureList.jsx

@@ -122,7 +122,12 @@ export default class PictureList extends Component {
                     this.setState({
                         description: getStrValue(dataObject, 'albumRemarks')
                     })
-
+                    // console.log('dataObject.albumTitle',dataObject.albumTitle)
+                    if (dataObject.albumTitle != null &&
+                        dataObject.albumTitle != '' &&
+                        dataObject.albumTitle.length > 0) {
+                        document.title = dataObject.albumTitle
+                    }
                     const pictures = dataObject.clazzPictureDOS
                     if (pictures) {
                         pictures.forEach((picture, index) => {
@@ -147,12 +152,13 @@ export default class PictureList extends Component {
                     }
                 }
             }
-
             this.setState({pictureList})
         }).catch(error => {
             Toast.hide()
             if (typeof error === 'string') {
                 Toast.fail(error)
+            } else {
+                Toast.fail("请求异常")
             }
         })
     }

+ 2 - 0
frontend/wechat-web/src/modules/album/UploadImage.css

@@ -0,0 +1,2 @@
+.textarea_sty1{border:none; font-size:15px; color:#333333;color: #B2B2B2;}
+.left_title1{width:50px;font-size:15px;color:#333333;}

+ 42 - 6
frontend/wechat-web/src/modules/album/UploadImage.jsx

@@ -12,6 +12,7 @@ import {_baseURL, API} from "../../configs/api.config";
 import {fetchGet, fetchPost} from "../../utils/fetchRequest";
 import PictureBean from "../../model/PictureBean";
 import {getStrValue} from "../../utils/common";
+import './UploadImage.css';
 
 export default class UploadImage extends Component {
 
@@ -21,7 +22,6 @@ export default class UploadImage extends Component {
 
     componentDidMount() {
         document.title = '编辑相册'
-
         Toast.loading('', 0)
         this.getPictureList(this.albumId)
     }
@@ -35,6 +35,8 @@ export default class UploadImage extends Component {
             previewVisible: false,
             previewImage: '',
             fileList: [],
+            albumTitle:'',
+            albumRemarks:""
         }
     }
 
@@ -42,7 +44,7 @@ export default class UploadImage extends Component {
         const {fileList} = this.state;
 
         return (
-            <div className='pageLayout'>
+            <div className='pageLayout' onChange={this.handelValueCom}>
                 <div className='gray-line'></div>
                 <div style={{flex: '1'}}>
                     <UploadEnclosure
@@ -56,7 +58,14 @@ export default class UploadImage extends Component {
                         handleRemove={this.handleRemove.bind(this)}
                     />
                 </div>
-
+                <div className="item_sty">
+                    <div className="left_title1">标题:</div>
+                    <input ref='albumTitle'  className="right_input" style={{marginLeft:10}} type="text" placeholder="请输入" maxLength={20} value={this.state.albumTitle}/>
+                </div>
+                <div className="item_sty">
+                    <div className="left_title1">描述:</div>
+                    <textarea ref='albumRemarks'  className="form-control textarea_sty" rows="3"  placeholder="请输入" maxLength={100}  value={this.state.albumRemarks}/>
+                </div>
                 <div className='uploadLayout'>
                     <Button className='commonButton' type="primary" block style={{borderRadius:30}}
                             onClick={this.releaseEvent}>更新</Button>
@@ -72,12 +81,17 @@ export default class UploadImage extends Component {
             pageSize: 1000,
         }).then(response => {
             Toast.hide()
-
             const {fileList} = this.state
             fileList.length = 0
 
             if (response) {
                 const dataArray = response.data.clazzPictureDOS
+                if(response.data.albumTitle && response.data.albumRemarks){
+                    this.setState({
+                        albumTitle:response.data.albumTitle,
+                        albumRemarks:response.data.albumRemarks
+                    })
+                }
                 if (dataArray) {
                     dataArray.forEach((picture, index) => {
                         const pictureBean = new PictureBean()
@@ -120,7 +134,16 @@ export default class UploadImage extends Component {
     handleBefore = (file, fileList) => {
 
     }
-
+    handelValueCom = (event)=>{
+        //获取用户名的值
+        let albumTitle = this.refs.albumTitle.value;
+        let albumRemarks = this.refs.albumRemarks.value;
+        //获得内容的值
+        this.setState({
+            albumTitle:albumTitle,
+            albumRemarks:albumRemarks
+        })
+    }
     handleRemove = (file) => {
         console.log(file)
         /*fetchPost(API.DELETE_FILE, {
@@ -151,9 +174,22 @@ export default class UploadImage extends Component {
         }
         console.log(fileUrls)
 
+        let albumTitle = this.state.albumTitle
+        let albumRemarks = this.state.albumRemarks
+        if(albumTitle == '' || albumTitle.length == 0){
+            Toast.fail('请输入相册标题')
+            return
+        }
+        if(albumRemarks == '' || albumRemarks.length == 0){
+            Toast.fail('请输入相册描述')
+            return
+        }
+
         fetchPost(API.UPDATE_ALBUM, {
             pictureUrls: JSON.stringify(fileUrls),
-            albumId: this.albumId
+            albumId: this.albumId,
+            albumTitle:albumTitle,
+            albumRemarks:albumRemarks
         }).then(response => {
             Toast.hide()
             Toast.success('更新成功')

+ 12 - 32
frontend/wechat-web/src/modules/announce/AnnounceRelease.jsx

@@ -9,7 +9,7 @@ import 'css/announce.css'
 import {Toast} from 'antd-mobile'
 import TargetSelect from 'components/TargetSelect'
 import UploadEnclosure from 'components/UploadEnclosure'
-import {fetchGet, fetchPost} from "../../utils/fetchRequest";
+import {fetchGet, fetchPost,fetchPostObj} from "../../utils/fetchRequest";
 import {_baseURL, API} from "../../configs/api.config";
 import {getIntValue, getStrValue, isObjEmpty} from "../../utils/common";
 import {connect} from 'react-redux'
@@ -172,7 +172,6 @@ class AnnounceRelease extends Component {
         if (this.isRequesting == true) {
             return
         }
-
         const {announceTitle, announceContent, fileList} = this.state
 
         if (isObjEmpty(announceTitle)) {
@@ -183,11 +182,6 @@ class AnnounceRelease extends Component {
             Toast.fail('请输入通知内容')
             return
         }
-        // if (isObjEmpty(this.checkNodes)) {
-        //     Toast.fail('请选择通知对象')
-        //     return
-        // }
-
         if (announceTitle.length > 50) {
             Toast.fail('通知标题过长')
             return
@@ -206,36 +200,22 @@ class AnnounceRelease extends Component {
                 }
             })
         }
-        // const stuList = [], teacherList = []
-        // if (!isObjEmpty(this.checkNodes)) {
-        //     this.checkNodes.forEach((node, index) => {
-        //         if (node.value.startWith('0')) {
-        //             teacherList.push(node.userId)
-        //         } else if (node.value.startWith('2')) {
-        //             stuList.push(node.userId)
-        //         }
-        //     })
-        // }
-
         const paramObj = {
-            notifyTitle: announceTitle,
-            notifyType: 3,
-            notifyDetails: announceContent,
-            notifyCreator: this.props.userInfo.user.userFunId,
-            notifyStatus: 1,
-            notifyFiles: JSON.stringify(fileUrls),
-            notifyRemarks: '',
-            // notifyTeacher: JSON.stringify(teacherList),
-            // notifyStu: JSON.stringify(stuList),
+            notify_title:announceTitle,
+            notify_details:announceContent,
+            notify_status:1,
+            notify_creator:this.props.userInfo.user.userFunId,
+            creator:this.props.userInfo.user.userName,
+            notify_files:JSON.stringify(fileUrls)
         }
-
-        console.log(paramObj)
+        console.log('fileList',fileList)
+        console.log('paramObj',paramObj)
 
         this.isRequesting = true
         Toast.loading('正在发布...', 0)
-        fetchPost(API.NOTIFY_CREATE, {
-            jsonNotify: JSON.stringify(paramObj)
-        }).then(response => {
+        fetchPostObj(API.NOTIFY_CREATE,
+            JSON.stringify(paramObj),
+            {"Content-Type": 'application/json;charset=UTF-8'}).then(response => {
             Toast.hide()
             Toast.success('发布成功', 1)
             clearListState()()

+ 13 - 3
frontend/wechat-web/src/modules/hiPages/LeaveDetail/LeaveDetail.js

@@ -15,6 +15,7 @@ import LazyLoad from 'react-lazyload';
 import ImagesViewer from '../../../components/imagesVIewer/index';
 import {Toast} from 'antd-mobile';
 import {getIntValue, getStrValue, isObjEmpty,getSearchParams} from "../../../utils/common";
+import {saveListState} from "../../../redux/actions/listState";
 
 class LeaveDetail extends Component {
     constructor(props) {
@@ -181,13 +182,21 @@ class LeaveDetail extends Component {
             if (response.success) {
                 Toast.hide()
                 Toast.info("回复成功!");
+
+                // this.backTask = setTimeout(() => {
+                //     this.props.history.goBack();
+                // }, 2000)
+
+                if (this.props.listState && !isObjEmpty(this.props.listState.listData)) {
+                    this.props.listState.listData[this.props.listState.itemIndex].leaveMessages = this.state.messageContent
+                    saveListState({
+                        listData: this.props.listState.listData,
+                    })()
+                }
                 this.setState({
                     messageContent: ""
                 })
                 this.getleaveDetail(this.state.itemdetail.lvId)
-                // this.backTask = setTimeout(() => {
-                //     this.props.history.goBack();
-                // }, 2000)
             }
         }).catch((error) => {
             Toast.fail(error)
@@ -243,6 +252,7 @@ class LeaveDetail extends Component {
 }
 
 let mapStateToProps = (state) => ({
+    listState: {...state.redListState},
     userInfo: {...state.redUserInfo}
 })
 

+ 33 - 4
frontend/wechat-web/src/modules/hiPages/approvel-detail/ApprovelDetail.js

@@ -17,11 +17,14 @@ import {API,_baseURL} from '../../../configs/api.config';
 import {Toast} from 'antd-mobile';
 import {connect} from 'react-redux';
 import ImagesViewer from '../../../components/imagesVIewer/index';
+import {saveListState} from "../../../redux/actions/listState";
 
 class ApprovelDetail extends Component{
     constructor(){
         super();
         this.state = {
+            applyHeader:'',
+            approveOpinion:'',
             showButton:false,
             AMvisible: false,
             AMTitle:null,
@@ -79,7 +82,7 @@ class ApprovelDetail extends Component{
         return(
             <div ref={node => this.node = node}>
                 <div className="headerDiv">
-                    <img className="headerImg" src={hi1_img} alt=""/>
+                    <img className="headerImg" src={this.state.applyHeader} alt=""/>
                     <div style={{marginTop:10}}>
                         <div style={{color:"#333333",fontSize:18}}>{this.state.docModel.proposer.value}</div>
                         <div style={{color:"#666666",fontSize:12,marginTop:10}}>{this.state.docModel.oaApprove.creatDate}</div>
@@ -103,8 +106,9 @@ class ApprovelDetail extends Component{
                         </TransitionGroup>
                     </div>
                 </div>
-
-                <div className="comhline_sty"></div>
+                {
+                    pictureItems.length > 0 ? <div className="comhline_sty"></div> : ''
+                }
 
                 <div style={{marginBottom:50}}>
                     {/*{this.state.docModel.approver.map((itemdata,index) => <ItemApprovel key ={index} itemdata = {itemdata}></ItemApprovel>)}*/}
@@ -132,7 +136,7 @@ class ApprovelDetail extends Component{
                     onCancel={this.doApprovel.bind(this,0)}>
                     <div onChange={this.handelValueCom}>
                         <div style={{textAlign:'center',fontSize:15,color:'#292929',marginBottom:10}}>{this.state.AMTitle}</div>
-                        <textarea autoFocus="autoFocus" ref='approveOpinion' className="form-control" rows="5" placeholder="填写意见说明(非必填)"  maxLength={50}></textarea>
+                        <textarea autoFocus="autoFocus" ref='approveOpinion'  value={this.state.approveOpinion} className="form-control" rows="5" placeholder="填写意见说明(非必填)"  maxLength={50}></textarea>
                        <div style={{display:'flex',flexDirection:'row',marginTop:20}}>
                            <div style={{width:'50%',textAlign:'center'}}>
                                <Button className="disagree_sty"  style={{borderRadius:5}} onClick={this.doApprovel.bind(this,0)} >取消</Button>
@@ -179,6 +183,11 @@ class ApprovelDetail extends Component{
         if(order == 0){
             return
         }
+        if(this.state.approveOpinion == '' || this.state.approveOpinion.length == 0){
+            this.setState({
+                approveOpinion:'-'
+            })
+        }
         let params = {
             teacherId:this.teacherId,
             approveId:this.state.approveId,
@@ -192,6 +201,12 @@ class ApprovelDetail extends Component{
                 this.setState({
                     showButton:false
                 })
+                if (this.props.listState && !isObjEmpty(this.props.listState.listData2)) {
+                    this.props.listState.listData2[this.props.listState.itemIndex].approveStatus = 2
+                    saveListState({
+                        listData2: this.props.listState.listData2,
+                    })()
+                }
                 this.backTask = setTimeout(()=>{
                     // this.props.history.push("/approvel")
                     this.props.history.goBack()
@@ -231,6 +246,7 @@ class ApprovelDetail extends Component{
             approveId:this.props.match.params.approveId,
             isMyApply:this.props.match.params.isMyApply
         },function () {
+
             if(this.state.approveId == null || this.state.approveId == ''){
                 return
             }else {
@@ -263,6 +279,18 @@ class ApprovelDetail extends Component{
                             pictureList:pictureList
                         },function () {
                             console.log('pictureList',this.state.pictureList)
+                            if(this.state.isMyApply == true){
+                                let  applyHeader = this.props.userInfo.userAvatar.length > 0 ? this.props.userInfo.userAvatar : hi1_img
+                                this.setState({applyHeader})
+                            }else {
+                                let applyHeader
+                                if(response.data.proposer && response.data.proposer.photo){
+                                    applyHeader = response.data.proposer.photo
+                                }else {
+                                    applyHeader = hi1_img
+                                }
+                                this.setState({applyHeader})
+                            }
                         })
                         // console.log('showbutton',showbutton)
                         // console.log('approveStatus',approveStatus)
@@ -276,6 +304,7 @@ class ApprovelDetail extends Component{
     }
 }
 let mapStateToProps = (state) => ({
+    listState: {...state.redListState},
     userInfo: {...state.redUserInfo}
 })
 

+ 5 - 1
frontend/wechat-web/src/modules/hiPages/approvel-detail/ItemApprovel.js

@@ -21,7 +21,11 @@ export default class ItemApprovel extends Component{
                     <div style={{width:10,height:10,background:'#BDBDBD',borderRadius:'30px'}}></div>
                     <div style={{marginLeft:10,width:"62%"}}>
                         <div ><span style={{color:'#000000',fontSize:15}}>{this.props.itemdata.value }</span><span style={{color:'#666666',fontSize:12,marginLeft:10}}>{this.props.approveDate}</span></div>
-                        <div style={{color:"#666666",fontSize:12,marginTop:5,wordWrap:'break-word'}}><span>{(this.props.suggest.value==null || this.props.suggest.value==undefined)?"":"(审批语:"+this.props.suggest.value+")"}</span></div>
+                        {
+                            this.props.approveStatus == 2 ?
+                                <div style={{color:"#666666",fontSize:12,marginTop:5,wordWrap:'break-word'}}><span>{(this.props.suggest.value == null || this.props.suggest.value == undefined || this.props.suggest.value == '')?"(审批语:无)":"(审批语:"+this.props.suggest.value+")"}</span></div>
+                                : ''
+                        }
                     </div>
                     <div style={{fontSize:12,textAlign:'right'}} className={this.props.approveStatus == 1?'doing':'done'}>
                         {this.props.approveStatus == 1 ? '等待审批' : (this.props.approveStatus == 2 ? '已同意' : '已拒绝')}</div>

+ 4 - 4
frontend/wechat-web/src/modules/hiPages/approvel/Approvel.js

@@ -146,7 +146,7 @@ class Approvel extends Component {
                         <List dataSource={this.state.approvelList}
                         renderItem={(approvelListBean,index) => (
                         <List.Item>
-                            <ApprovelItem itemdata={approvelListBean}isMyApply={false}  index={index} onItemClick={this.onItemClick.bind(this)}/>
+                            <ApprovelItem itemdata={approvelListBean} isMyApply={false}  index={index} onItemClick={this.onItemClick.bind(this)}/>
                         </List.Item>
                     )}/>
                     }
@@ -206,7 +206,7 @@ class Approvel extends Component {
             applyList.length = 0
             applyIndex = 0
             applyScroll = 0
-        } else {
+        } else if(applyList.length > 10){
             applyIndex = myApplypageIndex
             applyScroll = ReactDOM.findDOMNode(this.myApplyTab).scrollTop
         }
@@ -214,7 +214,7 @@ class Approvel extends Component {
             approvelList.length = 0
             approveleIndex = 0
             approvelScroll = 0
-        } else {
+        } else if (approvelList.length > 10){
             approveleIndex = myApprovepageIndex
             approvelScroll = ReactDOM.findDOMNode(this.myApproveTab).scrollTop
         }
@@ -226,7 +226,7 @@ class Approvel extends Component {
             scrollTop2: approvelScroll,
             listData2: approvelList,
             pageIndex2: approveleIndex,
-            itemIndex: itemIndex
+            itemIndex: itemIndex || this.props.listState.itemIndex
         })()
     }
     getMyApplyData = () => {

+ 1 - 1
frontend/wechat-web/src/modules/hiPages/field-trip/FieldTrip.css

@@ -3,6 +3,6 @@
 .item_sty{padding:10px 15px; display: flex;fontSize:12px;}
 .comBtn_sty{width:302px;height:36px;margin-top: 40px;font-size:15px}
 .textarea_sty{border:none;fontSize:15px; color:#333333;padding:10px 20px;}
-.nextarr_sty{height:15px;width:8px;margin-left:5px;}
+.nextarr_sty{height:15px;width:8px;}
 
 

+ 18 - 10
frontend/wechat-web/src/modules/hiPages/meet-detail/MeetDetail.js

@@ -18,8 +18,13 @@ import {saveListState} from "../../../redux/actions/listState";
 function SignItem(props) {
     return(
         <div style={{display:'flex',flexDirection:'column',margin:8,textAlign:"center"}}>
-            <div> <img src={props.itemdata.userPhoto == "" || props.itemdata.userPhoto == null ? hi0_img : props.itemdata.userPhoto} alt="" style={{width:40,height:40,borderRadius:25}}/></div>
-            <div  style={{fontSize:12,color:'#333333',marginTop:10}}> <span>{props.itemdata.teacherName}</span></div>
+            <div> <img src={props.itemdata.teacherPhoto == "" || props.itemdata.teacherPhoto == null
+            || props.itemdata.teacherPhoto == undefined || props.itemdata.teacherPhoto == 'undefined' ? hi0_img : props.itemdata.teacherPhoto} alt="" style={{width:40,height:40,borderRadius:25}}/></div>
+            {
+                props.itemdata.isRead == 3 ?
+                    <div  style={{fontSize:12,color:'#333333',marginTop:10}}> <span>{props.itemdata.teacherName}</span></div> :
+                    <div  style={{fontSize:12,color:'#000',marginTop:10}}> <span>{props.itemdata.teacherName}</span></div>
+            }
         </div>
     )
 }
@@ -35,10 +40,11 @@ class MeetDetail extends Component {
             unsignList: [],
             notifyStatus: null,//1是草稿 2是已发布 3是进行中 4结束
             showEndBtn: true, //是否显示结束会议按钮
+            meetingPerson: [],//改动后的会议人员
+            signCount: '',//已签到人数
         }
     }
-
-    render() {
+    render(){
         const {meetingSignData} = this.state
         return (
             <div>
@@ -70,17 +76,17 @@ class MeetDetail extends Component {
                 </div>
                 <div className="comhline_sty"></div>
 
-                <div style={{fontSize: 14, color: '#252525', marginTop: 10, marginLeft: 20}}>签到
+                <div style={{fontSize: 14, color: '#252525', marginTop: 10, marginLeft: 20}}>签到明细
                     <span style={{
                         fontSize: 12,
                         color: '#666666',
                         marginLeft: 10
-                    }}>({this.state.signList.length}/{this.state.signList.length + this.state.unsignList.length}人)</span>
+                    }}>({this.state.signCount}/{this.state.meetingPerson.length})</span>
                 </div>
                 <div style={{marginTop: 10, marginLeft: 20, display: 'flex', flexDirection: 'row', flexWrap: 'wrap'}}>
-                    {this.state.signList.map((itemdata, index) => <SignItem itemdata={itemdata}></SignItem>)}
+                    {this.state.meetingPerson.map((itemdata, index) => <SignItem itemdata={itemdata}></SignItem>)}
                 </div>
-                <div className="comhline_sty1"></div>
+               {/* <div className="comhline_sty1"></div>
                 <div style={{fontSize:14,color:'#252525',marginTop:10,marginLeft:20}}>未签到
                     <span style={{fontSize:12,color:'#666666',marginLeft:10}}>({this.state.unsignList.length}/{this.state.signList.length+this.state.unsignList.length}人)</span>
                 </div>
@@ -91,7 +97,7 @@ class MeetDetail extends Component {
                         <Button  className='end_sty' style={{color:'#FFFFFF',backgroundColor:'#929292',borderRadius:30}}>已结束</Button>
                     </div> : <div style={{textAlign:'center',marginTop:20,marginBottom:20}}>
                         {this.state.showEndBtn == true ? <Button type="primary"  className='end_sty ' onClick={this.EndMeetting}>结束会议</Button> : ""}
-                    </div>}
+                    </div>}*/}
             </div>
         )
     }
@@ -183,7 +189,9 @@ class MeetDetail extends Component {
                         meetingSignData: meetBean1,
                         signList: response.data.sign,
                         unsignList: response.data.unSign,
-                        notifyStatus: response.data.meetingStatus
+                        notifyStatus: response.data.meetingStatus,
+                        meetingPerson:response.data.meetingPerson,
+                        signCount:response.data.signCount
                     })
                     this.setState({
                         showEndBtn: this.props.userInfo.user.userFunId == "" ? false : this.props.userInfo.user.userFunId == response.data.meetingCreator ? true : false

Some files were not shown because too many files changed in this diff