瀏覽代碼

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

FANGLH 6 年之前
父節點
當前提交
b99fde0fb0
共有 50 個文件被更改,包括 821 次插入103 次删除
  1. 3 0
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/mapper/StudentInfoMapper.java
  2. 2 0
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/po/StudentInfo.java
  3. 4 0
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/service/impl/AccessControlServiceImpl.java
  4. 6 1
      applications/device/device-server/src/main/resources/mapper/StudentInfoMapper.xml
  5. 14 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/ClassServiceImpl.java
  6. 20 3
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/StudentServiceImpl.java
  7. 13 4
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/TeacherServiceImpl.java
  8. 7 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/controller/NoticeController.java
  9. 5 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/controller/PrincipalMailController.java
  10. 2 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/PrincipalMailService.java
  11. 7 5
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/impl/NoticeServiceImpl.java
  12. 8 6
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/impl/PrincipalMailServiceImpl.java
  13. 5 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/impl/ScoreServiceImpl.java
  14. 26 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/common/controller/PortalController.java
  15. 17 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/common/service/PortalService.java
  16. 36 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/common/service/impl/PortalServiceImpl.java
  17. 51 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/PortalMapper.java
  18. 2 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/PrincipalMailboxMapper.java
  19. 5 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/SysClazzMapper.java
  20. 7 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/SysStudentMapper.java
  21. 2 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/ParentsDO.java
  22. 20 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/ScoreImportdetail.java
  23. 40 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/StuScore.java
  24. 8 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/StuScoreDO.java
  25. 1 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/TeacherDO.java
  26. 2 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/controller/WxClazzPictureController.java
  27. 33 15
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/controller/WxNotifyController.java
  28. 1 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/WxClazzPictureService.java
  29. 6 5
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/WxNotifyService.java
  30. 6 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxClazzPictureServiceImpl.java
  31. 37 11
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxNotifyServiceImpl.java
  32. 6 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxOaApproveServiceImpl.java
  33. 37 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxUserServiceImpl.java
  34. 3 3
      applications/school/school-server/src/main/resources/mapper/NotifyMapper.xml
  35. 30 0
      applications/school/school-server/src/main/resources/mapper/PortalMapper.xml
  36. 18 1
      applications/school/school-server/src/main/resources/mapper/PrincipalMailboxMapper.xml
  37. 56 4
      applications/school/school-server/src/main/resources/mapper/ScoreMapper.xml
  38. 19 0
      applications/school/school-server/src/main/resources/mapper/SysClazzMapper.xml
  39. 3 0
      applications/school/school-server/src/main/resources/mapper/SysStudentMapper.xml
  40. 2 1
      applications/school/school-server/src/main/resources/mapper/WxParentsMapper.xml
  41. 3 1
      applications/school/school-server/src/main/resources/mapper/WxStuScoreMapper.xml
  42. 2 1
      applications/school/school-server/src/main/resources/mapper/WxTeacherMapper.xml
  43. 93 0
      frontend/pc-web/app/view/Interaction/mailbox/Detail.js
  44. 90 0
      frontend/pc-web/app/view/Interaction/mailbox/DetailController.js
  45. 26 0
      frontend/pc-web/app/view/Interaction/mailbox/DetailModel.js
  46. 4 16
      frontend/pc-web/app/view/Interaction/mailbox/List.js
  47. 2 2
      frontend/pc-web/app/view/Interaction/mailbox/ListController.js
  48. 4 3
      frontend/pc-web/app/view/basic/school/SchoolInfo.js
  49. 12 4
      frontend/pc-web/app/view/core/form/field/FileField.js
  50. 15 2
      frontend/pc-web/app/view/core/form/field/TrashField.js

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

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

@@ -20,6 +20,7 @@ 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.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;
@@ -50,6 +51,8 @@ public class StudentServiceImpl implements StudentService{
     private SysClazzMapper sysClazzMapper;
     @Autowired
     private MessageLogService messageLogService;
+    @Autowired
+    private WxUserMapper userMapper;
 
     private static final String CODE = "Student";
     private static final String NAME = "学生信息";
@@ -168,15 +171,29 @@ 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.setUserId(item.getUser_id());
+                        userDO.setUserPhone(item.getPa_phone());
+                        userMapper.update(userDO);
+                    }
+                }
+            }
+            //更新明细表
             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/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);
 }

+ 7 - 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,10 @@ 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];
                 msg.setUrl(url);
                 msg.setTitle(data.getNotify_title());
                 msg.setKeyword1(school.getSchool_name());
@@ -176,6 +177,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) {

+ 5 - 0
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);

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

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

+ 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

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

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

@@ -32,7 +32,7 @@ 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);
 		if (ObjectUtils.isNotEmpty(clazzPictureDOS)) {
 			for (int i = 0; i < clazzPictureDOS.size(); i++) {
@@ -52,6 +52,11 @@ public class WxClazzPictureServiceImpl implements WxClazzPictureService {
 					clazzPictureMapper.save(clazzPictureDO);
 				}
 			}
+            ClazzAlbumDO clazzAlbumDO = new ClazzAlbumDO();
+			clazzAlbumDO.setAlbumId(albumId);
+			clazzAlbumDO.setAlbumTitle(albumTitle);
+			clazzAlbumDO.setAlbumRemarks(albumRemarks);
+            clazzAlbumMapper.update(clazzAlbumDO);
 			return "更新成功";
 		} else {
 			List<String> strings = JSON.parseArray(pictureUrls, String.class);

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

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

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

@@ -611,10 +611,40 @@ 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);
+                            //更新账户的手机号
+                            userDO.setUserPhone(userPhone);
+                            return userMapper.update(userDO);
+                        }else {
+                            throw new Exception("验证码错误,请核实");
+                        }
+                    }
+                }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 {

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

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

@@ -0,0 +1,30 @@
+<?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 sys_parents where school_id = #{schoolId} and parents_status = 1
+  </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,'%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>

+ 56 - 4
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" >
@@ -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>
 
@@ -345,6 +375,11 @@
     <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>
@@ -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_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>
@@ -523,6 +560,21 @@
         <if test="item.sd_stuNumber != null">
           sd_stuNumber = #{item.sd_stuNumber,jdbcType=VARCHAR},
         </if>
+        <if test="sd_total != null" >
+          sd_total = #{sd_total,jdbcType=INTEGER}
+        </if>
+        <if test="sd_class_rank != null" >
+          sd_class_rank = #{sd_class_rank,jdbcType=INTEGER},
+        </if>
+        <if test="sd_grade_rank != null" >
+          sd_grade_rank = #{sd_grade_rank,jdbcType=INTEGER},
+        </if>
+        <if test="sd_class_average != null" >
+          sd_class_average = #{sd_class_average,jdbcType=DOUBLE},
+        </if>
+        <if test="sd_grade_average != null" >
+          sd_grade_average = #{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>

+ 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_parent where parent_id = #{id}
+  </select>
 </mapper>

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

@@ -107,7 +107,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">

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

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

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

@@ -0,0 +1,93 @@
+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: 'textareafield',
+                name: 'mb_reply',
+                fieldLabel: '回复内容',
+                columnWidth: 1
+            }],
+            toolBtns: [{
+                xtype: 'button',
+                text: '回复',
+                handler: 'onReply'
+            }, {
+                xtype: 'button',
+                text: '忽略',
+                handler: 'onIgnore',
+                hidden: true,
+                bind: {
+                    hidden: '{!!mb_ignore}'
+                }
+            }, {
+                xtype: 'button',
+                text: '取消忽略',
+                handler: 'onUnIgnore',
+                hidden: true,
+                bind: {
+                    hidden: '{!mb_ignore}'
+                }
+            }]
+        });
+        this.callParent();
+    }
+});

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

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

@@ -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",

+ 12 - 4
frontend/pc-web/app/view/core/form/field/FileField.js

@@ -124,9 +124,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 +155,14 @@ 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, '');
 		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){
@@ -177,6 +184,7 @@ Ext.define('school.view.core.form.field.FileField', {
 				readOnly: false,
 				editable: false,
 				filepath: f.fullPath,
+				accessPath: f.accessPath,
 				filesize: f.size,
 				_id:f.id,
 				fieldStyle: 'background:#E0EEEE;'

+ 15 - 2
frontend/pc-web/app/view/core/form/field/TrashField.js

@@ -24,9 +24,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;
 						// }