Browse Source

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

RaoMeng 7 years ago
parent
commit
2a09a7ed7f
35 changed files with 437 additions and 83 deletions
  1. 12 2
      applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/listener/AccessControlListener.java
  2. 48 1
      applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/po/AccessControl.java
  3. 10 4
      applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/repository/AccessControlRepository.java
  4. 4 0
      applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/service/AccessControlService.java
  5. 3 1
      applications/device/device-client/src/main/resources/schema.sql
  6. 9 0
      applications/device/device-client/src/main/resources/static/index.html
  7. 1 0
      applications/device/device-client/src/main/resources/static/js/index.js
  8. 12 3
      applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/service/DahuaDataAnalyzeService.java
  9. 1 1
      applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/service/DahuaDeviceService.java
  10. 8 0
      applications/device/device-sdk/src/main/java/com/usoftchina/smartschool/device/dto/DeviceInfo.java
  11. 12 1
      applications/device/device-sdk/src/main/java/com/usoftchina/smartschool/device/event/AccessControlEvent.java
  12. 7 2
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/service/impl/AccessControlServiceImpl.java
  13. 3 1
      applications/device/device-server/src/main/resources/application.yml
  14. 3 1
      applications/device/device-server/src/main/resources/config/application-docker-cloud.yml
  15. 3 1
      applications/device/device-server/src/main/resources/config/application-docker-prod.yml
  16. 1 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/GradeServiceImpl.java
  17. 1 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/StudentServiceImpl.java
  18. 3 3
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/TeacherServiceImpl.java
  19. 4 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/OutInRecordDO.java
  20. 12 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/StuScoreDO.java
  21. 86 48
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxStuScoreServiceImpl.java
  22. 1 1
      applications/school/school-server/src/main/resources/mapper/WxOutInRecordMapper.xml
  23. 40 4
      applications/school/school-server/src/main/resources/mapper/WxStuScoreMapper.xml
  24. 1 1
      base-servers/account/account-server/src/main/resources/config/application-docker-cloud.yml
  25. 1 1
      base-servers/auth/auth-server/src/main/resources/config/application-docker-cloud.yml
  26. 1 1
      frontend/pc-web/app/view/Interaction/homework/Release.js
  27. 1 1
      frontend/pc-web/app/view/Interaction/notice/SchoolNotice.js
  28. 1 1
      frontend/pc-web/app/view/basic/staff/StaffDetail.js
  29. 1 1
      frontend/pc-web/app/view/core/form/field/ClassComboBox.js
  30. 23 0
      frontend/pc-web/app/view/setting/msgtemplate/Panel.js
  31. 116 0
      frontend/pc-web/app/view/setting/msgtemplate/PanelController.js
  32. 4 0
      frontend/pc-web/resources/json/navigation.json
  33. 1 0
      frontend/wechat-web/src/modules/hiPages/access-notice/AccessNotice.js
  34. 3 2
      frontend/wechat-web/src/modules/hiPages/access-notice/ItemComp.js
  35. BIN
      frontend/wechat-web/src/style/imgs/no_data.png

+ 12 - 2
applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/listener/AccessControlListener.java

@@ -1,6 +1,8 @@
 package com.usoftchina.smartschool.device.client.listener;
 
+import com.usoftchina.smartschool.device.client.po.AccessControl;
 import com.usoftchina.smartschool.device.client.service.AccessControlService;
+import com.usoftchina.smartschool.device.dto.AccessControlInfo;
 import com.usoftchina.smartschool.device.event.AccessControlEvent;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -28,9 +30,17 @@ public class AccessControlListener {
     @Async
     @EventListener(AccessControlEvent.class)
     public void onAccessControlEvent(AccessControlEvent event) {
+        AccessControlInfo info = event.getAccessControlInfo();
+        AccessControl accessControl = accessControlService.findById(event.getDeviceId());
+        // 通过门禁设备绑定的访问类型,来设置本次事件的访问类型
+        if (accessControl.isEntryType()) {
+            info.setEventType(AccessControlInfo.EventType.ENTRY);
+        } else {
+            info.setEventType(AccessControlInfo.EventType.EXIT);
+        }
         if(logger.isDebugEnabled()) {
-            logger.debug(event.getAccessControlInfo().toString());
+            logger.debug(info.toString());
         }
-        accessControlService.saveRecord(event.getAccessControlInfo());
+        accessControlService.saveRecord(info);
     }
 }

+ 48 - 1
applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/po/AccessControl.java

@@ -1,12 +1,15 @@
 package com.usoftchina.smartschool.device.client.po;
 
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.usoftchina.smartschool.device.dto.DeviceInfo;
 
+import java.util.Arrays;
+
 /**
  * @author yingp
  * @date 2019/3/11
  */
-public class AccessControl implements DeviceInfo{
+public class AccessControl implements DeviceInfo {
     private String id;
     /**
      * 名称
@@ -21,6 +24,11 @@ public class AccessControl implements DeviceInfo{
 
     private String password;
 
+    /**
+     * 闸机头绑定访问类型 1 进入 / 2 出去
+     */
+    private int accessType;
+
     public String getName() {
         return name;
     }
@@ -29,6 +37,7 @@ public class AccessControl implements DeviceInfo{
         this.name = name;
     }
 
+    @Override
     public String getId() {
         return id;
     }
@@ -72,4 +81,42 @@ public class AccessControl implements DeviceInfo{
     public void setPassword(String password) {
         this.password = password;
     }
+
+    public int getAccessType() {
+        return accessType;
+    }
+
+    public void setAccessType(int accessType) {
+        this.accessType = accessType;
+    }
+
+    /**
+     * 是否进门类型
+     *
+     * @return
+     */
+    @JsonIgnore
+    public boolean isEntryType() {
+        return AccessType.of(accessType) == AccessType.ENTRY;
+    }
+
+    public enum AccessType {
+        ENTRY(1),
+        EXIT(2);
+
+        private final int code;
+
+        AccessType(int code) {
+            this.code = code;
+        }
+
+        public static AccessType of(int code) {
+            for (AccessType type : values()) {
+                if (type.code == code) {
+                    return type;
+                }
+            }
+            return ENTRY;
+        }
+    }
 }

+ 10 - 4
applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/repository/AccessControlRepository.java

@@ -2,6 +2,8 @@ package com.usoftchina.smartschool.device.client.repository;
 
 import com.usoftchina.smartschool.device.client.po.AccessControl;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
 import org.springframework.dao.EmptyResultDataAccessException;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
@@ -38,6 +40,7 @@ public class AccessControlRepository {
         }
     }
 
+    @Cacheable(value = "accessControl", key = "#id")
     public AccessControl findById(String id) {
         try {
             return jdbcTemplate.queryForObject("select * from access_control where id=?",
@@ -47,20 +50,23 @@ public class AccessControlRepository {
         }
     }
 
+    @CacheEvict(value = "accessControl", key = "#accessControl.id")
     public boolean save(AccessControl accessControl) {
-        int ret = jdbcTemplate.update("insert into access_control(id, name,ip,port,username,password) values " +
+        int ret = jdbcTemplate.update("insert into access_control(id, name,ip,port,username,password,accessType) values " +
                         "(?,?,?,?,?,?)", accessControl.getId(), accessControl.getName(), accessControl.getIp(), accessControl.getPort(),
-                accessControl.getUsername(), accessControl.getPassword());
+                accessControl.getUsername(), accessControl.getPassword(), accessControl.getAccessType());
         return ret > 0;
     }
 
+    @CacheEvict(value = "accessControl", key = "#accessControl.id")
     public boolean update(AccessControl accessControl) {
-        int ret = jdbcTemplate.update("update access_control set name=?,ip=?,port=?,username=?,password=? where " +
+        int ret = jdbcTemplate.update("update access_control set name=?,ip=?,port=?,username=?,password=?,accessType=? where " +
                         "id=?", accessControl.getName(), accessControl.getIp(), accessControl.getPort(),
-                accessControl.getUsername(), accessControl.getPassword(), accessControl.getId());
+                accessControl.getUsername(), accessControl.getPassword(), accessControl.getAccessType(), accessControl.getId());
         return ret > 0;
     }
 
+    @CacheEvict(value = "accessControl", key = "#id")
     public boolean delete(String id) {
         return jdbcTemplate.update("delete from access_control where id=?", id) > 0;
     }

+ 4 - 0
applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/service/AccessControlService.java

@@ -94,6 +94,10 @@ public class AccessControlService {
         }
     }
 
+    public AccessControl findById(String id) {
+        return accessControlRepository.findById(id);
+    }
+
     /**
      * 远程保存门禁记录
      *

+ 3 - 1
applications/device/device-client/src/main/resources/schema.sql

@@ -22,4 +22,6 @@ port int not null,
 username varchar(30) not null,
 password varchar(50) not null,
 databaseName varchar(30) not null
-);
+);
+
+alter table access_control add column if not exists accessType int default 1;

+ 9 - 0
applications/device/device-client/src/main/resources/static/index.html

@@ -68,6 +68,13 @@
                         <input type="password" class="form-control" id="passwordInput" name="password"
                                required aria-describedby="passwordHelp" placeholder="登录密码">
                     </div>
+                    <div class="form-group">
+                        <label for="accessTypeInput">访问类型</label>
+                        <select class="form-control" id="accessTypeInput" name="accessType">
+                            <option value="1">进门</option>
+                            <option value="2">出门</option>
+                        </select>
+                    </div>
                 </form>
             </div>
             <div class="modal-footer">
@@ -83,6 +90,7 @@
         <th scope="col">名称</th>
         <th scope="col">IP</th>
         <th scope="col">端口</th>
+        <th scope="col">访问类型</th>
         <th scope="col">操作</th>
     </tr>
     </thead>
@@ -95,6 +103,7 @@
         <td><%=data[i].name%></td>
         <td><%=data[i].ip%></td>
         <td><%=data[i].port%></td>
+        <td><%=data[i].accessType == 1 ? '进门' : '出门'%></td>
         <td>
             <button type="button" class="btn btn-link btn-edit" data-index="<%=i%>" title="编辑"
                     data-toggle="modal" data-target="#formModal">

+ 1 - 0
applications/device/device-client/src/main/resources/static/js/index.js

@@ -21,6 +21,7 @@ $(document).ready(function () {
                                 $('#portInput').val(accessControl.port);
                                 $('#usernameInput').val(accessControl.username);
                                 $('#passwordInput').val(accessControl.password);
+                                $('#accessTypeInput').val(accessControl.accessType);
                             });
                             $('.btn-delete').click(function(){
                                 var index = $(this).data('index'),

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

@@ -39,13 +39,15 @@ public class DahuaDataAnalyzeService {
     /**
      * 启动智能数据监听
      *
+     * @param deviceId 门禁设备ID
      * @param loginHandle 登录句柄
      */
-    public void startListen(NativeLong loginHandle) {
+    public void startListen(String deviceId, NativeLong loginHandle) {
         long key = loginHandle.longValue();
         if (key != 0 && !analyzerHandles.containsKey(key)) {
             NativeLong lAnalyzerHandle = sdk.getInstance().CLIENT_RealLoadPictureEx(loginHandle, 0,
-                    DahuaEvents.EVENT_IVS_ALL, true, new AnalyzerDataCallBack(), new NativeLong(), null);
+                    DahuaEvents.EVENT_IVS_ALL, true, new AnalyzerDataCallBack(deviceId),
+                    new NativeLong(), null);
             analyzerHandles.put(key, lAnalyzerHandle);
         }
     }
@@ -54,6 +56,13 @@ public class DahuaDataAnalyzeService {
      * 智能分析数据回调
      */
     class AnalyzerDataCallBack implements fAnalyzerDataCallBack {
+        private final String deviceId;
+
+        public AnalyzerDataCallBack(String deviceId) {
+            super();
+            this.deviceId = deviceId;
+        }
+
         @Override
         public void invoke(NativeLong lAnalyzerHandle, int dwAlarmType, Pointer pAlarmInfo, Pointer pBuffer,
                            int dwBufSize, NativeLong dwUser, int nSequence, Pointer reserved) {
@@ -75,7 +84,7 @@ public class DahuaDataAnalyzeService {
                     accessControlInfo.setOpenMethod(convertOpenMethod(info.emOpenMethod));
                     accessControlInfo.setEventTime(info.UTC.toDate());
                     SpringContextHolder.getContext().publishEvent(new AccessControlEvent(this,
-                            accessControlInfo));
+                            deviceId, accessControlInfo));
                     // 其他地方可通过监听 AccessControlEvent 来扩展
                     break;
                 /**

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

@@ -44,7 +44,7 @@ public class DahuaDeviceService implements DeviceApi {
             NativeLong loginHandle = login(info.getIp(), info.getPort(), info.getUsername(), info.getPassword());
             loginHandles.put(id, loginHandle);
             // 开启智能事件监听
-            dataAnalyzeService.startListen(loginHandle);
+            dataAnalyzeService.startListen(info.getId(), loginHandle);
         }
     }
 

+ 8 - 0
applications/device/device-sdk/src/main/java/com/usoftchina/smartschool/device/dto/DeviceInfo.java

@@ -7,6 +7,14 @@ package com.usoftchina.smartschool.device.dto;
  * @date 2019/3/8
  */
 public interface DeviceInfo {
+
+    /**
+     * ID
+     *
+     * @return
+     */
+    String getId();
+
     /**
      * ip
      *

+ 12 - 1
applications/device/device-sdk/src/main/java/com/usoftchina/smartschool/device/event/AccessControlEvent.java

@@ -11,13 +11,24 @@ import org.springframework.context.ApplicationEvent;
  */
 public class AccessControlEvent extends ApplicationEvent {
 
+    private final String deviceId;
     private final AccessControlInfo accessControlInfo;
 
-    public AccessControlEvent(Object source, AccessControlInfo accessControlInfo) {
+    public AccessControlEvent(Object source, String deviceId, AccessControlInfo accessControlInfo) {
         super(source);
+        this.deviceId = deviceId;
         this.accessControlInfo = accessControlInfo;
     }
 
+    /**
+     * 产生事件的门禁设备ID
+     *
+     * @return
+     */
+    public String getDeviceId() {
+        return deviceId;
+    }
+
     public AccessControlInfo getAccessControlInfo() {
         return accessControlInfo;
     }

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

@@ -8,6 +8,7 @@ import com.usoftchina.smartschool.device.po.AccessControlRecord;
 import com.usoftchina.smartschool.device.po.StudentInfo;
 import com.usoftchina.smartschool.device.service.AccessControlService;
 import com.usoftchina.smartschool.file.api.FileApi;
+import com.usoftchina.smartschool.file.api.util.ByteArrayMultipartFile;
 import com.usoftchina.smartschool.file.dto.FileInfoDTO;
 import com.usoftchina.smartschool.file.dto.ImageFile;
 import com.usoftchina.smartschool.utils.DateUtils;
@@ -49,6 +50,9 @@ public class AccessControlServiceImpl implements AccessControlService{
     @Value("${wechat.template.accesscontrol}")
     private String accessControlTemplateId;
 
+    @Value("${smartschool.domain.wechat}")
+    private String wechatBaseUrl;
+
     @Override
     public void onAccessControlEvent(AccessControlInfo info) {
         String filePath = null;
@@ -72,8 +76,8 @@ public class AccessControlServiceImpl implements AccessControlService{
             ImageFile file = new ImageFile(information.get(0).getStuName(), imageData);
             Result<FileInfoDTO> fileInfo = null;
             try {
-                fileInfo = fileApi.imageUpload(file);
-                filePath = fileInfo.getData().getFullPath();
+                fileInfo = fileApi.upload(0L, new ByteArrayMultipartFile("file", information.get(0).getStuName() + ".jpg", "application/jpeg", imageData));
+                filePath = fileInfo.getData().getAccessPath();
             }catch (Exception ex) {
                 logger.error(ex.getMessage());
             }
@@ -102,6 +106,7 @@ public class AccessControlServiceImpl implements AccessControlService{
          * 3、推送消息到消息服务器(微信服务监听此消息发送微信消息)
          */
         MessageInfoDTO msg = new MessageInfoDTO();
+        msg.setUrl(wechatBaseUrl + "/accessnoticedetail/" + record.getRecord_id());
         msg.setAppId(studentInfo.getAppId());
         msg.setSecret(studentInfo.getSecret());
         msg.setTouser(studentInfo.getOpenId());

+ 3 - 1
applications/device/device-server/src/main/resources/application.yml

@@ -76,4 +76,6 @@ mybatis:
   mapper-locations: classpath:mapper/*.xml
 smartschool:
   wechat:
-    pushUrl: https://school-api.ubtob.com/api/wechat/send/Messages
+    pushUrl: https://school-api.ubtob.com/api/wechat/send/Messages
+  domain:
+    wechat: https://school-wechat.ubtob.com

+ 3 - 1
applications/device/device-server/src/main/resources/config/application-docker-cloud.yml

@@ -23,4 +23,6 @@ spring:
         connection-timeout: 30000
 smartschool:
   wechat:
-    pushUrl: https://school-api.ydyhz.com/api/wechat/send/Messages
+    pushUrl: https://school-api.ydyhz.com/api/wechat/send/Messages
+  domain:
+    wechat: https://school-wechat.ydyhz.com

+ 3 - 1
applications/device/device-server/src/main/resources/config/application-docker-prod.yml

@@ -15,4 +15,6 @@ spring:
     port: 6379
 smartschool:
   wechat:
-    pushUrl: https://school-api.ubtob.com/api/wechat/send/Messages
+    pushUrl: https://school-api.ubtob.com/api/wechat/send/Messages
+  domain:
+    wechat: https://school-wechat.ubtob.com

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

@@ -140,6 +140,7 @@ public class GradeServiceImpl implements GradeService{
                            detail.setGrade_id(grade_id);
                            detail.setClazz_status(1);
                            detail.setClazz_grade(grade.getGrade_name());
+                           detail.setSchool_id(schoolId);
                            detail.setClazz_nickname(grade.getGrade_name() + detail.getClazz_name());
                            clazzes.add(detail);
                         }

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

@@ -63,6 +63,7 @@ public class StudentServiceImpl implements StudentService{
         }
         SysStudent student = sysStudentMapper.selectByPrimaryKey(id);
         List<SysParents> parents = sysStudentMapper.selectParent(id);
+
         StudentForm studentForm = new StudentForm();
         studentForm.setMain(student);
         studentForm.setItems(parents);

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

@@ -144,11 +144,11 @@ public class TeacherServiceImpl implements TeacherService{
                             throw new BizException(BizExceptionCode.ILLEGAL_Gender);
                         }
 
-                        if ("婚".equals(json.get("teacher_marriage"))) {
+                        if ("婚".equals(json.get("teacher_marriage"))) {
                             json.put("teacher_marriage", 0);
-                        }else if ("婚".equals(json.get("teacher_marriage"))) {
+                        }else if ("婚".equals(json.get("teacher_marriage"))) {
                             json.put("teacher_marriage", 1);
-                        }else if (!"已婚".equals(json.get("teacher_marriage")) && !"未婚".equals(json.get("teacher_marriage"))) {
+                        }else if (!"未婚".equals(json.get("teacher_marriage")) && !"已婚".equals(json.get("teacher_marriage"))) {
                             throw new BizException(BizExceptionCode.ILLEGAL_MARRIAGE);
                         }
                     }

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

@@ -51,6 +51,9 @@ public class OutInRecordDO implements Serializable {
 	private String gradeClazz;
 	//学生性别 1男  2女
 	private Integer stuSex;
-
+	//类别    1: 入校  2: 出校  0:其他
+    private int recordType;
+	//出入校时间
+    private Date recordDate;
 
 }

+ 12 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/StuScoreDO.java

@@ -23,11 +23,13 @@ public class StuScoreDO implements Serializable {
 	private String scoreType;
 	//考试科目
 	private Long subjectId;
+	//科目名
 	private String subjectName;
 	//名称
 	private String scoreName;
 	//学生
 	private Long stuId;
+	//学生姓名
 	private String stuName;
 	//分值
 	private Double scoreTotal;
@@ -41,6 +43,16 @@ public class StuScoreDO implements Serializable {
 	private String scoreRemarks;
 	//学校
 	private Long schoolId;
+	//班级id
+	private Long classId;
+	//班级名
+	private String className;
+	//年级id
+	private Long gradeId;
+	//年级名
+	private String gradeName;
+	//标题
+	private String examTitle;
 
 
 }

+ 86 - 48
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxStuScoreServiceImpl.java

@@ -1,11 +1,11 @@
 package com.usoftchina.smartschool.school.wxschool.basic.service.impl;
 
-import com.usoftchina.smartschool.school.wxschool.mapper.WxClazzMapper;
-import com.usoftchina.smartschool.school.wxschool.mapper.WxStuScoreMapper;
-import com.usoftchina.smartschool.school.wxschool.mapper.WxStudentMapper;
 import com.usoftchina.smartschool.school.po.StuScoreDO;
 import com.usoftchina.smartschool.school.po.StudentDO;
 import com.usoftchina.smartschool.school.wxschool.basic.service.WxStuScoreService;
+import com.usoftchina.smartschool.school.wxschool.mapper.WxClazzMapper;
+import com.usoftchina.smartschool.school.wxschool.mapper.WxStuScoreMapper;
+import com.usoftchina.smartschool.school.wxschool.mapper.WxStudentMapper;
 import com.usoftchina.smartschool.school.wxschool.utils.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -43,57 +43,95 @@ public class WxStuScoreServiceImpl implements WxStuScoreService {
 		if (ObjectUtils.isNotEmpty(stuScoreDOS)){
 			List<Map> maps = new ArrayList<>();
 			List<Long> longs = new ArrayList<>();
-			List<StudentDO> studentDOS = studentMapper.listByClazzId(studentMapper.get(stuId).getClazzId());
-			if (ObjectUtils.isNotEmpty(studentDOS)){
-				for (StudentDO st:studentDOS) {
-					longs.add(st.getStuId());
-				}
-			}
+            StudentDO studentDO = studentMapper.get(stuId);
+            if (ObjectUtils.isNotEmpty(studentDO)){
+                Long clazzId = studentDO.getClazzId();
+                if (ObjectUtils.isNotEmpty(clazzId)){
+                    List<StudentDO> studentDOS = studentMapper.listByClazzId(clazzId);
+                    if (ObjectUtils.isNotEmpty(studentDOS)){
+                        for (StudentDO st:studentDOS) {
+                            longs.add(st.getStuId());
+                        }
+                    }
+                }
+            }
 			for (StuScoreDO ss:stuScoreDOS) {
 				Map<String, Object> map = new HashMap<>();
-				List<StuScoreDO> stuScoreDOS1 = stuScoreMapper.selectScoreListByStuId(longs, ss.getScoreType(), ss.getSubjectId());
-				if (ObjectUtils.isNotEmpty(stuScoreDOS1)) {
-					Double m = 0.0;
-					for (int j = 0; j < stuScoreDOS1.size(); j++) {
-						StuScoreDO score = stuScoreDOS1.get(j);
-						Long stuId1 = score.getStuId();
-						if (stuId.compareTo(stuId1) == 0) {
-							score.setStuName(studentMapper.get(stuId1).getStuName());
-							map.put("scoreBasic", score);
-							map.put("classRank", j + 1);
-							map.put("title", clazzMapper.get(studentMapper.get(stuId).getClazzId()).getClazzName() + score.getScoreName() + score.getScoreType());
-						}
-						m = m + score.getScoreNum();
-					}
-					map.put("classAverage", new BigDecimal(m / stuScoreDOS1.size()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
-					//一个班级
-					List<Long> clazzIds = clazzMapper.getByClazzId(studentMapper.get(stuId).getClazzId());
-					List<Long> list = new ArrayList<>();
-					for (Long clazzId:clazzIds) {
-						List<Long> stuIds = studentMapper.selectStuIdsByClazzId(clazzId);
-						list.addAll(stuIds);
-					}
-					List<StuScoreDO> scores = stuScoreMapper.selectScoreListByStuId(list,ss.getScoreType(), ss.getSubjectId());
-					Double n = 0.0;
-					for (int k = 0; k < scores.size(); k++) {
-						StuScoreDO score = scores.get(k);
-						if (stuId.compareTo(score.getStuId()) == 0) {
-							if ("全年级".equals(score.getScoreScope())) {
-								map.put("schoolRank", k + 1);
-							} else {
-								map.put("schoolRank", "-");
-							}
-						}
-						n = n + score.getScoreNum();
-					}
-					map.put("schoolAverage", new BigDecimal(n / scores.size()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
-					maps.add(map);
-				}
+				if (ObjectUtils.isNotEmpty(ss.getScoreType())&&ObjectUtils.isNotEmpty(ss.getSubjectId())){
+                    List<StuScoreDO> stuScoreDOS1 = stuScoreMapper.selectScoreListByStuId(longs, ss.getScoreType(), ss.getSubjectId());
+                    if (ObjectUtils.isNotEmpty(stuScoreDOS1)) {
+                        Double m = 0.0;
+                        for (int j = 0; j < stuScoreDOS1.size(); j++) {
+                            StuScoreDO score = stuScoreDOS1.get(j);
+                            Long stuId1 = score.getStuId();
+                            if (stuId.compareTo(stuId1) == 0) {
+                                score.setStuName(score.getStuName());
+                                map.put("scoreBasic", score);
+                                map.put("classRank", j + 1);
+                                map.put("title",score.getExamTitle());
+                            }
+                            m = m + score.getScoreNum();
+                        }
+                        map.put("classAverage", new BigDecimal(m / stuScoreDOS1.size()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
+                        //一个班级
+                        List<Long> clazzIds = clazzMapper.getByClazzId(studentMapper.get(stuId).getClazzId());
+                        List<Long> list = new ArrayList<>();
+                        for (Long clazzId:clazzIds) {
+                            List<Long> stuIds = studentMapper.selectStuIdsByClazzId(clazzId);
+                            list.addAll(stuIds);
+                        }
+                        List<StuScoreDO> scores = stuScoreMapper.selectScoreListByStuId(list,ss.getScoreType(), ss.getSubjectId());
+                        Double n = 0.0;
+                        for (int k = 0; k < scores.size(); k++) {
+                            StuScoreDO score = scores.get(k);
+                            if (stuId.compareTo(score.getStuId()) == 0) {
+                                if ("全年级".equals(score.getScoreScope())) {
+                                    map.put("schoolRank", k + 1);
+                                } else {
+                                    map.put("schoolRank", "-");
+                                }
+                            }
+                            n = n + score.getScoreNum();
+                        }
+                        map.put("schoolAverage", new BigDecimal(n / scores.size()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
+                        maps.add(map);
+                    }
+                }
 			}
 			return maps;
 		}else {
 			throw new Exception("暂无数据");
 		}
 	}
-	
+
+
+
+    /*public List<Map> getScoreList(Long stuId, Integer pageIndex, Integer pageSize) throws Exception{
+        Integer pageStart = (pageIndex-1)*pageSize;
+        List<StuScoreDO> stuScoreDOS = stuScoreMapper.listByStu(stuId, pageStart, pageSize);
+        if (ObjectUtils.isNotEmpty(stuScoreDOS)){
+            List<Long> list = new ArrayList<>();
+            for (StuScoreDO ss:stuScoreDOS) {
+                Long classId = ss.getClassId();
+                if (ObjectUtils.isNotEmpty(classId)){
+                    List<Long> longs = studentMapper.selectStuIdsByClazzId(classId);
+
+                    list.addAll(longs);
+                }
+            }
+
+        }
+    }*/
+
+
+
+    private static List removeDuplicate(List list){
+        List listTemp = new ArrayList();
+        for(int i=0;i<list.size();i++){
+            if(!listTemp.contains(list.get(i))){
+                listTemp.add(list.get(i));
+            }
+        }
+        return listTemp;
+    }
 }

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

@@ -4,7 +4,7 @@
 <mapper namespace="com.usoftchina.smartschool.school.wxschool.mapper.WxOutInRecordMapper">
 
     <sql id="OutInRecordVo">
-    select `record_id`,`record_name`,`out_date`,`in_date`,`record_details`,`record_remarks`,`stu_id`,`school_id`,`device_id`,`stu_number`,`stu_name`,`grade_id`,`grade_name`,`clazz_id`,`clazz_name`,`grade_clazz`,`stu_sex` from out_in_record
+    select `record_id`,`record_name`,`out_date`,`in_date`,`record_details`,`record_remarks`,`stu_id`,`school_id`,`device_id`,`stu_number`,`stu_name`,`grade_id`,`grade_name`,`clazz_id`,`clazz_name`,`grade_clazz`,`stu_sex`,`record_type`,`record_date` from out_in_record
     </sql>
 
 	<select id="get" resultType="com.usoftchina.smartschool.school.po.OutInRecordDO">

+ 40 - 4
applications/school/school-server/src/main/resources/mapper/WxStuScoreMapper.xml

@@ -4,7 +4,7 @@
 <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` 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` from stu_score
     </sql>
 
 	<select id="get" resultType="com.usoftchina.smartschool.school.po.StuScoreDO">
@@ -25,6 +25,14 @@
 		  		  <if test="scoreRemarks != null and scoreRemarks != ''"> and score_remarks = #{scoreRemarks} </if>
 		  		  <if test="schoolId != null and schoolId != ''"> and school_id = #{schoolId} </if>
 			<if test="subjectId != null and subjectId != ''"> and subject_id = #{subjectId} </if>
+			<if test="stuName != null and stuName != ''"> and stu_name = #{stuName} </if>
+			<if test="subjectName != null and subjectName != ''"> and subject_name = #{subjectName} </if>
+			<if test="classId != null and classId != ''"> and class_id = #{classId} </if>
+			<if test="className != null and className != ''"> and class_name = #{className} </if>
+			<if test="gradeId != null and gradeId != ''"> and grade_id = #{gradeId} </if>
+			<if test="gradeName != null and gradeName != ''"> and grade_name = #{gradeName} </if>
+			<if test="examTitle != null and examTitle != ''"> and exam_title = #{examTitle} </if>
+
 		  		</where>
         <choose>
             <when test="sort != null and sort.trim() != ''">
@@ -53,6 +61,13 @@
 		  		  <if test="scoreRemarks != null and scoreRemarks != ''"> and score_remarks = #{scoreRemarks} </if>
 		  		  <if test="schoolId != null and schoolId != ''"> and school_id = #{schoolId} </if>
 			 <if test="subjectId != null and subjectId != ''"> and subject_id = #{subjectId} </if>
+			 <if test="stuName != null and stuName != ''"> and stu_name = #{stuName} </if>
+			 <if test="subjectName != null and subjectName != ''"> and subject_name = #{subjectName} </if>
+			 <if test="classId != null and classId != ''"> and class_id = #{classId} </if>
+			 <if test="className != null and className != ''"> and class_name = #{className} </if>
+			 <if test="gradeId != null and gradeId != ''"> and grade_id = #{gradeId} </if>
+			 <if test="gradeName != null and gradeName != ''"> and grade_name = #{gradeName} </if>
+			 <if test="examTitle != null and examTitle != ''"> and exam_title = #{examTitle} </if>
 		  		</where>
 	</select>
 	 
@@ -68,7 +83,14 @@
 			`score_date`, 
 			`score_remarks`, 
 			`school_id`,
-			`subject_id`
+			`subject_id`,
+			`stu_name`,
+			`subject_name`,
+			`class_id`,
+			`class_name`,
+			`grade_id`,
+			`grade_name`,
+			`exam_title`
 		)
 		values
 		(
@@ -81,7 +103,14 @@
 			#{scoreDate}, 
 			#{scoreRemarks}, 
 			#{schoolId},
-			#{subjectId}
+			#{subjectId},
+			#{stuName},
+			#{subjectName},
+			#{classId},
+			#{className},
+			#{gradeId},
+			#{gradeName},
+			#{examTitle}
 		)
 	</insert>
 	 
@@ -97,7 +126,14 @@
 			<if test="scoreDate != null">`score_date` = #{scoreDate}, </if>
 			<if test="scoreRemarks != null">`score_remarks` = #{scoreRemarks}, </if>
 			<if test="schoolId != null">`school_id` = #{schoolId},</if>
-			<if test="subjectId != null and subjectId != ''"> subject_id = #{subjectId} </if>
+			<if test="subjectId != null"> `subject_id` = #{subjectId}, </if>
+			<if test="stuName != null "> `stu_name` = #{stuName}, </if>
+			<if test="subjectName != null"> `subject_name` = #{subjectName}, </if>
+			<if test="classId != null"> `class_id` = #{classId}, </if>
+			<if test="className != null "> `class_name` = #{className} ,</if>
+			<if test="gradeId != null "> `grade_id` = #{gradeId}, </if>
+			<if test="gradeName != null "> `grade_name` = #{gradeName}, </if>
+			<if test="examTitle != null "> `exam_title` = #{examTitle} </if>
 		</set>
 		where score_id = #{scoreId}
 	</update>

+ 1 - 1
base-servers/account/account-server/src/main/resources/config/application-docker-cloud.yml

@@ -1,6 +1,6 @@
 eureka:
   instance:
-    hostname: smartschool-school-server
+    hostname: smartschool-account-server
     prefer-ip-address: false
   client:
     serviceUrl:

+ 1 - 1
base-servers/auth/auth-server/src/main/resources/config/application-docker-cloud.yml

@@ -1,6 +1,6 @@
 eureka:
   instance:
-    hostname: smartschool-school-server
+    hostname: smartschool-auth-server
     prefer-ip-address: false
   client:
     serviceUrl:

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

@@ -29,7 +29,7 @@ Ext.define('school.view.interaction.homework.Release', {
                 xtype: "textfield",
                 name: "task_creator",
                 fieldLabel: "发布人id",
-                defaultValue: school.util.BaseUtil.getCurrentUser().id,
+                defaultValue: school.util.BaseUtil.getCurrentUser().teacher_id,
                 hidden: true
             }, {
                 xtype: "textfield",

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

@@ -29,7 +29,7 @@ Ext.define('school.view.interaction.notice.SchoolNotice', {
                 name: "notify_creator",
                 fieldLabel: "发布人id",
                 columnWidth: 0.5,
-                defaultValue: school.util.BaseUtil.getCurrentUser().id,
+                defaultValue: school.util.BaseUtil.getCurrentUser().teacher_id,
                 hidden: true
             }, {
                 xtype: "textfield",

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

@@ -74,7 +74,7 @@ Ext.define('school.view.basic.staff.StaffDetail', {
                 editable: false,
                 store: Ext.create('Ext.data.ArrayStore', {
                     fields: ['name', 'value'],
-                    data: [['未婚', 0], ['已婚', 1], ['离异', -1]]
+                    data: [['未婚', 0], ['已婚', 1]]
                 }),
                 minChars: 0,
                 queryMode: 'local'

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

@@ -20,7 +20,7 @@ Ext.define('school.view.core.form.field.ClassComboBox', {
     // template for the content inside text field
     displayTpl: Ext.create('Ext.XTemplate',
         '<tpl for=".">',
-        '{clazz_name} | {clazz_grade}',
+        '{clazz_name}',
         '</tpl>'
     ),
 

+ 23 - 0
frontend/pc-web/app/view/setting/msgtemplate/Panel.js

@@ -0,0 +1,23 @@
+Ext.define('school.view.setting.msgtemplate.Panel', {
+    extend: 'Ext.form.Panel',
+    xtype: 'setting-msgtemplate-panel',
+
+    controller: 'setting-msgtemplate-panel',
+
+    layout: 'column',
+    autoScroll: true,
+    bodyPadding: '8 12 8 12',
+
+    fieldDefaults: {
+        margin: '0 0 10 0',
+        labelAlign: 'right',
+        labelWidth: 90,
+        columnWidth: 1,
+    },
+
+    items: [],
+
+    listeners: {
+        afterrender: 'afterrender'
+    }
+});

+ 116 - 0
frontend/pc-web/app/view/setting/msgtemplate/PanelController.js

@@ -0,0 +1,116 @@
+Ext.define('school.view.setting.msgtemplate.PanelController', {
+    extend: 'Ext.app.ViewController',
+    alias: 'controller.setting-msgtemplate-panel',
+    
+    afterrender: function() {
+        let me = this,
+        view = me.getView();
+
+        view.setLoading(true);
+        school.util.BaseUtil.request({
+            // url: 'http://10.1.80.47:9520/api/school/template/list'
+            url: '/api/school/template/list'
+        }).then(function(res) {
+            view.setLoading(false);
+            let data = res.data.list.map(function(l) {
+                return {
+                    id: l.st_id,
+                    title: l.st_name,
+                    templateId: l.st_templateid
+                }
+            })
+            if(data.length > 0) {
+                me.addTemplate(data);
+            }else {
+                me.addEmptyText();
+            }
+        }).catch(function(e) {
+            view.setLoading(false);
+            me.addEmptyText();
+            school.util.BaseUtil.showErrorToast(e.message);
+        });
+    },
+
+    update: function(btn) {
+        let container = btn.up('fieldcontainer'),
+        items = container.items.items,
+        valueField = items[0],
+        titleField = items[1],
+        templateIdField = items[2],
+        id = valueField.value,
+        title = titleField.value,
+        templateId = templateIdField.value;
+
+        if(!templateIdField.isDirty()) {
+            school.util.BaseUtil.showErrorToast('数据无修改');
+            return;
+        }
+
+        container.setLoading(true);
+        school.util.BaseUtil.request({
+            // url: 'http://10.1.80.47:9520/api/school/template/save',
+            url: '/api/school/template/save',
+            method: 'POST',
+            params: JSON.stringify({
+                st_id: id,
+                st_name: title,
+                st_templateid: templateId
+            })
+        }).then(function(res) {
+            container.setLoading(false);
+            templateIdField.originalValue = templateId;
+            school.util.BaseUtil.showSuccessToast('更新成功');
+        }).catch(function(e) {
+            container.setLoading(false);
+            school.util.BaseUtil.showErrorToast('更新失败: ' + e.message);
+        });
+    },
+
+    addTemplate: function(datas) {
+        let me = this,
+        view = me.getView();
+
+        if(datas.length > 0) {
+            Ext.Array.each(datas, function(data) {
+                view.add(me.applyTemplate(data));
+            });
+        }
+    },
+
+    addEmptyText: function() {
+        let me = this,
+        view = me.getView();
+
+        view.setHtml('暂无数据');
+    },
+
+    applyTemplate: function(data) {
+        let template = {
+            xtype: 'fieldcontainer',
+            layout: 'hbox',
+            items: [{
+                xtype: 'hidden',
+                fieldLabel: 'ID',
+                name: 'id',
+                value: data.id
+            }, {
+                xtype: 'displayfield',
+                fieldLabel: '模板标题',
+                name: 'title',
+                value: data.title
+            }, {
+                xtype: 'textfield',
+                fieldLabel: '模板ID',
+                name: 'templateId',
+                value: data.templateId
+            }, {
+                xtype: 'button',
+                text: '保存',
+                handler: 'update'
+            }] 
+        };
+
+        return template;
+    }
+
+});

+ 4 - 0
frontend/pc-web/resources/json/navigation.json

@@ -54,6 +54,10 @@
     "text": "系统设置",
     "iconCls": "x-ss ss-nav-setting",
     "items": [{
+        "id": "setting-msgtemplate-panel",
+        "text": "消息模板设置",
+        "view": "setting-msgtemplate-panel"
+    }, {
         "id": "setting-device-list",
         "text": "设备参数",
         "view": "setting-device-list"

+ 1 - 0
frontend/wechat-web/src/modules/hiPages/access-notice/AccessNotice.js

@@ -40,6 +40,7 @@ class AccessNotice extends Component {
         })
         fetchPost(API.RecordOutgoingList, {
             stuId: stuId,
+            // stuId:10138,
             pageIndex: 1,
             pageSize: 10
         }).then((response) => {

+ 3 - 2
frontend/wechat-web/src/modules/hiPages/access-notice/ItemComp.js

@@ -15,7 +15,8 @@ export default class ItemComp extends Component{
    constructor(props){
         super(props);
         this.state = {
-            showTime1:(this.props.itemdata.inDate==''||this.props.itemdata.inDate==null) ? this.props.itemdata.outDate : this.props.itemdata.inDate,
+            // showTime1:(this.props.itemdata.inDate==''||this.props.itemdata.inDate==null) ? this.props.itemdata.outDate : this.props.itemdata.inDate,
+            showTime1:this.props.itemdata.recordDate
         }
     }
      render(){
@@ -28,7 +29,7 @@ export default class ItemComp extends Component{
                          style={{height: '100%', justifyContent: 'center', alignItems: 'center'}}>
                         {this.props.isFirst ? <div style={{flex: 1}}></div>
                             : <div style={{background: '#E9E9E9', flex: '1', width: '2px'}}></div>}
-                        {(this.props.itemdata.inDate==''||this.props.itemdata.inDate==null) ?
+                        { this.props.itemdata.recordType == 1  ?
                             <div className="item_in_out in">进</div> :
                             <div className="item_in_out out">出</div>
                         }

BIN
frontend/wechat-web/src/style/imgs/no_data.png