wuheng 1 an în urmă
părinte
comite
873488a086
46 a modificat fișierele cu 735 adăugiri și 84 ștergeri
  1. 2 2
      common/src/main/java/com/koobietech/eas/common/utils/ArchiveManager.java
  2. 19 0
      controller/src/main/java/com/koobietech/eas/controller/EasArcTlsFileDownloadController.java
  3. 2 2
      controller/src/main/java/com/koobietech/eas/controller/EasEduClassroomController.java
  4. 14 4
      controller/src/main/java/com/koobietech/eas/controller/EasSysDepartmentController.java
  5. 1 1
      controller/src/main/java/com/koobietech/eas/controller/EasSysStudentController.java
  6. 15 0
      controller/src/main/java/com/koobietech/eas/controller/EasSysUserInfoController.java
  7. 19 0
      controller/src/main/java/com/koobietech/eas/controller/EasSysUsersLoginController.java
  8. 19 1
      controller/src/main/resources/application-dev.yaml
  9. 18 0
      controller/src/main/resources/application-local.yaml
  10. 16 0
      controller/src/main/resources/application-wheng.yaml
  11. 5 2
      controller/src/main/resources/application.yaml
  12. BIN
      controller/src/main/resources/temp/StuRegistTemp.docx
  13. BIN
      controller/src/main/resources/temp/avatar.jpeg
  14. BIN
      controller/src/main/resources/temp/kun.jpeg
  15. 11 0
      dao/src/main/java/com/koobietech/eas/dao/mapper/RoleMapper.java
  16. 14 0
      dao/src/main/java/com/koobietech/eas/dao/mapper/UserProFileMapper.java
  17. 11 4
      dao/src/main/java/com/koobietech/eas/dao/pojo/EasArcTlsScoresPojo.java
  18. 13 0
      dao/src/main/java/com/koobietech/eas/dao/pojo/RolePojo.java
  19. 12 0
      dao/src/main/java/com/koobietech/eas/dao/pojo/UserProFilePojo.java
  20. 30 0
      dao/src/main/resources/com/koobietech/eas/dao/mapper/RoleMapper.xml
  21. 49 0
      dao/src/main/resources/com/koobietech/eas/dao/mapper/UserProFileMapper.xml
  22. 11 0
      mbg/src/main/java/com/koobietech/eas/mbg/model/EasArcTlsStudents.java
  23. 70 0
      mbg/src/main/java/com/koobietech/eas/mbg/model/EasArcTlsStudentsExample.java
  24. 22 5
      mbg/src/main/resources/com/koobietech/eas/mbg/mapper/EasArcTlsStudentsMapper.xml
  25. 2 0
      security/src/main/java/com/koobietech/eas/security/exception/EasAuthenticationEntryPoint.java
  26. 10 2
      security/src/main/java/com/koobietech/eas/security/service/impl/SecurityAccessServiceImpl.java
  27. 20 1
      service/src/main/java/com/koobietech/eas/service/EasArchivesFilesService.java
  28. 3 1
      service/src/main/java/com/koobietech/eas/service/EasStuProfileService.java
  29. 8 1
      service/src/main/java/com/koobietech/eas/service/EasSysAdminLoginService.java
  30. 4 0
      service/src/main/java/com/koobietech/eas/service/EasSysDepartmentService.java
  31. 5 0
      service/src/main/java/com/koobietech/eas/service/EasSysUserInfoService.java
  32. 1 1
      service/src/main/java/com/koobietech/eas/service/EasSysUserLoginRedisService.java
  33. 0 1
      service/src/main/java/com/koobietech/eas/service/config/EasAuthorityConfig.java
  34. 1 1
      service/src/main/java/com/koobietech/eas/service/impl/EasArcTlsAttendanceServiceImpl.java
  35. 1 1
      service/src/main/java/com/koobietech/eas/service/impl/EasArcTlsScoresServiceImpl.java
  36. 34 4
      service/src/main/java/com/koobietech/eas/service/impl/EasArchivesFilesServiceImpl.java
  37. 1 1
      service/src/main/java/com/koobietech/eas/service/impl/EasEduCategoryServiceImpl.java
  38. 1 1
      service/src/main/java/com/koobietech/eas/service/impl/EasEduScheduleServiceImpl.java
  39. 1 1
      service/src/main/java/com/koobietech/eas/service/impl/EasEduSubjectsServiceImpl.java
  40. 151 41
      service/src/main/java/com/koobietech/eas/service/impl/EasStuProfileServiceImpl.java
  41. 55 0
      service/src/main/java/com/koobietech/eas/service/impl/EasSysAdminLoginServiceImpl.java
  42. 34 1
      service/src/main/java/com/koobietech/eas/service/impl/EasSysDepartmentServiceImpl.java
  43. 1 1
      service/src/main/java/com/koobietech/eas/service/impl/EasSysPermissionServiceImpl.java
  44. 3 1
      service/src/main/java/com/koobietech/eas/service/impl/EasSysStudentLoginServiceImpl.java
  45. 20 1
      service/src/main/java/com/koobietech/eas/service/impl/EasSysUserInfoServiceImpl.java
  46. 6 2
      service/src/main/java/com/koobietech/eas/service/impl/EasSysUserLoginRedisServiceImpl.java

+ 2 - 2
common/src/main/java/com/koobietech/eas/common/utils/ArchiveManager.java

@@ -178,7 +178,7 @@ public class ArchiveManager {
      */
     private static LocalDate getStudentGraduationDate(LocalDate enrollmentDate) {
         // 假设毕业时间为入学时间的四年后
-        return enrollmentDate.plusYears(4);
+        return enrollmentDate.plusYears(2);
     }
 
     /**
@@ -186,7 +186,7 @@ public class ArchiveManager {
      * @param idCard
      * @return
      */
-    private static LocalDate extractBirthDate(String idCard) {
+    public static LocalDate extractBirthDate(String idCard) {
         // 提取身份证号码中的出生日期部分
         String birthdate = idCard.substring(6, 14);
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");

+ 19 - 0
controller/src/main/java/com/koobietech/eas/controller/EasArcTlsFileDownloadController.java

@@ -5,6 +5,7 @@ import com.koobietech.eas.common.utils.SecurityManager;
 import com.koobietech.eas.mbg.model.EasArcArchives;
 import com.koobietech.eas.service.EasArcArchivesService;
 import com.koobietech.eas.service.EasArchiveFileDownloadService;
+import com.koobietech.eas.service.EasArchivesFilesService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import org.springframework.web.bind.annotation.*;
@@ -27,6 +28,24 @@ public class EasArcTlsFileDownloadController {
     @Resource
     EasArcArchivesService easArcArchivesService;
 
+    @Resource
+    EasArchivesFilesService easArchivesFilesService;;
+
+
+    @GetMapping("/refreshArchive")
+    @Operation(summary = "刷新档案", description = "刷新档案")
+    public JsonResult refreshArchive(@RequestParam(required = false) String studentNumber) {
+
+        if ( SecurityManager.isStudentUser() ) {
+            easArchivesFilesService.refreshProfile(SecurityManager.getStudentNumber());
+            return JsonResult.ok();
+        }
+
+        easArchivesFilesService.refreshProfile(studentNumber);
+
+        return JsonResult.ok();
+    }
+
     @GetMapping("/getTokenByArchiveNumber")
     @Operation(summary = "获取下载token", description = "前端传入archiveId,后端返回下载token")
     public JsonResult getFile(@RequestParam String archiveNumber) {

+ 2 - 2
controller/src/main/java/com/koobietech/eas/controller/EasEduClassroomController.java

@@ -40,9 +40,9 @@ public class EasEduClassroomController {
     }
 
 
-    @DeleteMapping("/delete")
+    @DeleteMapping("/delete/{id}")
     @Operation(summary = "删除教室", description = "删除教室信息表数据根据ID")
-    public JsonResult delete(@RequestParam Integer id) {
+    public JsonResult delete(@PathVariable Integer id) {
         Boolean ret = easEduClassroomService.delete(id);
         if (ret) {
             return JsonResult.ok();

+ 14 - 4
controller/src/main/java/com/koobietech/eas/controller/EasSysDepartmentController.java

@@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import java.util.List;
 
 
 @RestController
@@ -45,11 +46,13 @@ public class EasSysDepartmentController {
     @DeleteMapping("/delete")
     @Operation(summary = "删除部门", description = "删除部门表数据根据ID")
     public JsonResult delete(@RequestParam Long id) {
-        Boolean ret = easSysDepartmentService.delete(id);
-        if (ret) {
-            return JsonResult.ok();
-        }
+        //部门禁止编辑
         return JsonResult.fail();
+//        Boolean ret = easSysDepartmentService.delete(id);
+//        if (ret) {
+//            return JsonResult.ok();
+//        }
+//        return JsonResult.fail();
     }
 
 
@@ -63,5 +66,12 @@ public class EasSysDepartmentController {
         return JsonResult.fail();
     }
 
+    @PutMapping("/updateDepartmentUsers/{departmentId}")
+    @Operation(summary = "更新部门用户", description = "更新部门用户")
+    public JsonResult updateDepartmentUsers(
+            @RequestBody List<String> departmentUsers, @PathVariable  Long departmentId) {
+        Boolean ret = easSysDepartmentService.updateDepartmentUsers(departmentId, departmentUsers);
+        return JsonResult.bool(ret);
+    }
 
 }

+ 1 - 1
controller/src/main/java/com/koobietech/eas/controller/EasSysStuProfileController.java → controller/src/main/java/com/koobietech/eas/controller/EasSysStudentController.java

@@ -30,7 +30,7 @@ import java.util.List;
 @Tag(name = "学生档案下载模块")
 @RestController
 @RequestMapping("/student")
-public class EasSysStuProfileController {
+public class EasSysStudentController {
 
     @Resource
     private EasStuProfileService easStuProfileService;

+ 15 - 0
controller/src/main/java/com/koobietech/eas/controller/EasSysUserInfoController.java

@@ -4,6 +4,7 @@ import com.github.pagehelper.PageHelper;
 import com.koobietech.eas.common.result.JsonPageResult;
 import com.koobietech.eas.common.result.JsonResult;
 import com.koobietech.eas.common.result.PageDataResult;
+import com.koobietech.eas.dao.pojo.RolePojo;
 import com.koobietech.eas.mbg.model.EasSysUserinfo;
 import com.koobietech.eas.service.EasSysUserInfoService;
 import io.swagger.v3.oas.annotations.Operation;
@@ -21,6 +22,20 @@ public class EasSysUserInfoController {
     @Resource
     EasSysUserInfoService easSysUserInfoService;
 
+    @PostMapping("/queryUserByRoleId/{departmentId}")
+    @Operation(summary = "查询用户信息根据角色ID", description = "查询用户信息根据角色ID")
+    public JsonResult queryUserByRoleId(@PathVariable int departmentId) {
+        List<RolePojo> ret = easSysUserInfoService.queryUserByRoleId(departmentId);
+        return JsonResult.data(ret);
+    }
+
+    @PostMapping("/getAllUsers")
+    @Operation(summary = "查询用户信息所有", description = "查询用户信息所有")
+    public JsonResult getAllUser() {
+        List<RolePojo> ret = easSysUserInfoService.getAllUsers();
+        return JsonResult.data(ret);
+    }
+
     @PostMapping("/add")
     @Operation(summary = "添加用户信息", description = "录入基本用户信息")
     public JsonResult add(@RequestBody EasSysUserinfo userinfo) {

+ 19 - 0
controller/src/main/java/com/koobietech/eas/controller/EasSysUsersLoginController.java

@@ -8,6 +8,7 @@ import com.koobietech.eas.common.exception.EasException;
 import com.koobietech.eas.common.result.JsonResult;
 import com.koobietech.eas.dao.pojo.AdminPojo;
 import com.koobietech.eas.dao.dto.LoginTokenDto;
+import com.koobietech.eas.dao.pojo.UserProFilePojo;
 import com.koobietech.eas.service.EasSysAdminLoginService;
 import com.koobietech.eas.service.EasSysStudentLoginService;
 import io.swagger.v3.oas.annotations.Operation;
@@ -89,4 +90,22 @@ public class EasSysUsersLoginController {
         return adminLoginService.verifyToJsonResult(captchaService.check(captchaVO));
     }
 
+    @GetMapping("/getUserProFile")
+    @Operation(summary = "获取用户信息可修改信息", description = "获取用户信息可修改信息")
+    public JsonResult getUserProFile() {
+        return JsonResult.data(adminLoginService.getUserProFile());
+    }
+
+    @PutMapping("/userProFile")
+    @Operation(summary = "更新用户信息", description = "更新用户信息")
+    public JsonResult userProFile(@RequestBody UserProFilePojo  userProFilePojo) {
+        return JsonResult.data(adminLoginService.uploadUserProFile(userProFilePojo));
+    }
+
+    @PutMapping("/logout")
+    @Operation(summary = "注销", description = "注销")
+    public JsonResult logout() {
+        return JsonResult.bool(adminLoginService.logout());
+    }
+
 }

+ 19 - 1
controller/src/main/resources/application-dev.yaml

@@ -25,8 +25,26 @@ knife4j:
   enable: true
   setting:
     language: zh_cn
+
+security:
+  url:
+    ignored:
+      - /swagger-ui/*
+      - /v3/api-docs/**
+      - /doc.html
+      - /webjars/**
+      - /login/adminLogin
+      - /login/studentLogin
+      - /login/verify/get
+      - /login/verify/check
+      - /favicon.ico
+
 logging:
   level:
     com.koobietech.eas.*: TRACE
 project:
-  path: ${user.home}/archivesFiles
+  path: ${user.home}/archivesFiles
+  cache:
+    path: ${user.home}/archivesCache
+authority:
+  path: ${user.home}/authorityFile/authority.json

+ 18 - 0
controller/src/main/resources/application-local.yaml

@@ -25,8 +25,26 @@ knife4j:
   enable: true
   setting:
     language: zh_cn
+
+security:
+  url:
+    ignored:
+      - /swagger-ui/*
+      - /v3/api-docs/**
+      - /doc.html
+      - /webjars/**
+      - /login/adminLogin
+      - /login/studentLogin
+      - /login/verify/get
+      - /login/verify/check
+      - /favicon.ico
+
 logging:
   level:
     com.koobietech.eas.*: TRACE
 project:
   path: ${user.home}/archivesFiles
+  cache:
+    path: ${user.home}/archivesCache
+authority:
+  path: ${user.home}/authorityFile/authority.json

+ 16 - 0
controller/src/main/resources/application-wheng.yaml

@@ -25,10 +25,26 @@ knife4j:
   enable: true
   setting:
     language: zh_cn
+
+security:
+  url:
+    ignored:
+      - /swagger-ui/*
+      - /v3/api-docs/**
+      - /doc.html
+      - /webjars/**
+      - /login/adminLogin
+      - /login/studentLogin
+      - /login/verify/get
+      - /login/verify/check
+      - /favicon.ico
+
 logging:
   level:
     com.koobietech.eas.*: TRACE
 project:
   path: ${user.home}/archivesFiles
+  cache:
+    path: ${user.home}/archivesCache
 authority:
   path: ${user.home}/authorityFile/authority.json

+ 5 - 2
controller/src/main/resources/application.yaml

@@ -33,9 +33,8 @@ security:
       - /login/studentLogin
       - /login/verify/get
       - /login/verify/check
+      - /archive/getFileByToken
       - /favicon.ico
-project:
-  path: ${user.home}/archivesFiles
 
 pagehelper:
   helperDialect: mysql
@@ -48,5 +47,9 @@ eas:
   jwt-expires-date: 2
   password-sign-key: eas-key-password
 
+project:
+  path: ${user.home}/archivesFiles
+  cache:
+    path: ${user.home}/archivesCache
 authority:
   path: ${user.home}/authorityFile/authority.json

BIN
controller/src/main/resources/temp/StuRegistTemp.docx


BIN
controller/src/main/resources/temp/avatar.jpeg


BIN
controller/src/main/resources/temp/kun.jpeg


+ 11 - 0
dao/src/main/java/com/koobietech/eas/dao/mapper/RoleMapper.java

@@ -0,0 +1,11 @@
+package com.koobietech.eas.dao.mapper;
+
+import com.koobietech.eas.dao.pojo.RolePojo;
+
+import java.util.List;
+
+public interface RoleMapper {
+
+    List<RolePojo> getAllUsers();
+    List<RolePojo> queryUserByRoleId(int departmentId);
+}

+ 14 - 0
dao/src/main/java/com/koobietech/eas/dao/mapper/UserProFileMapper.java

@@ -0,0 +1,14 @@
+package com.koobietech.eas.dao.mapper;
+
+import com.koobietech.eas.dao.pojo.UserProFilePojo;
+
+public interface UserProFileMapper {
+
+    UserProFilePojo getUserProFile(Integer uid);
+
+    UserProFilePojo getStudentProFile(Integer uid);
+
+    int  updateUserProFile(UserProFilePojo userProFile);
+
+    int  updateStudentProFile(UserProFilePojo userProFile);
+}

+ 11 - 4
dao/src/main/java/com/koobietech/eas/dao/pojo/EasArcTlsScoresPojo.java

@@ -1,6 +1,7 @@
 package com.koobietech.eas.dao.pojo;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelIgnore;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -12,13 +13,19 @@ public class EasArcTlsScoresPojo implements Serializable {
     @Excel(name = "学员档案")
     private String studentNumber;
 
-    @Excel(name = "类目ID" )
+    @ExcelIgnore
     private Integer categoryId;
 
-    @Excel(name = "科目ID" )
+    @ExcelIgnore
     private Integer subjectId;
 
-    @Excel(name = "考试时间" )
+    @Excel(name = "类目" )
+    private String categoryName;
+
+    @Excel(name = "科目" )
+    private String subjectsName;
+
+    @Excel(name = "考试时间", format = "yyyy-MM-dd HH:mm", width = 20 )
     private Date testDate;
 
     @Excel(name = "分数")
@@ -30,7 +37,7 @@ public class EasArcTlsScoresPojo implements Serializable {
     @Excel(name = "及格率")
     private BigDecimal excelRate;
 
-    @Excel(name = "创建时间", format = "yyyy-MM-dd")
+    @Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm")
     private Date createTime;
 
     @Excel(name = "考试备注信息")

+ 13 - 0
dao/src/main/java/com/koobietech/eas/dao/pojo/RolePojo.java

@@ -0,0 +1,13 @@
+package com.koobietech.eas.dao.pojo;
+
+import lombok.Data;
+
+/**
+ * @author lc
+ */
+@Data
+public class RolePojo {
+    private int id;
+    private String type;
+    private String username;
+}

+ 12 - 0
dao/src/main/java/com/koobietech/eas/dao/pojo/UserProFilePojo.java

@@ -0,0 +1,12 @@
+package com.koobietech.eas.dao.pojo;
+
+import lombok.Data;
+
+@Data
+public class UserProFilePojo {
+    private Integer id;
+    private String name;
+    private String email;
+    private String phone;
+    private String passwd;
+}

+ 30 - 0
dao/src/main/resources/com/koobietech/eas/dao/mapper/RoleMapper.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.koobietech.eas.dao.mapper.RoleMapper">
+
+
+    <select id="getAllUsers" resultType="com.koobietech.eas.dao.pojo.RolePojo">
+        SELECT
+            id, '用户' AS type, relname AS username
+        FROM
+            eas_sys_userinfo  WHERE disabled = 'N'
+        UNION ALL
+        SELECT
+            id, '学生' AS type, student_name AS username
+        FROM
+            eas_sys_student WHERE disabled = 'N'
+    </select>
+
+    <select id="queryUserByRoleId" resultType="com.koobietech.eas.dao.pojo.RolePojo">
+        SELECT
+            eas_sys_roleusers.*
+        FROM
+            eas_sys_dep_relation
+        JOIN eas_sys_roleusers ON eas_sys_roleusers.id =
+                   IF( eas_sys_dep_relation.user_id > 0,
+                       eas_sys_dep_relation.user_id, eas_sys_dep_relation.student_id )
+        WHERE
+            eas_sys_dep_relation.department_id = #{departmentId}
+    </select>
+
+</mapper>

+ 49 - 0
dao/src/main/resources/com/koobietech/eas/dao/mapper/UserProFileMapper.xml

@@ -0,0 +1,49 @@
+<?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.koobietech.eas.dao.mapper.UserProFileMapper">
+
+    <update id="updateUserProFile" parameterType="com.koobietech.eas.dao.pojo.UserProFilePojo">
+        UPDATE eas_sys_userinfo SET
+            relname = #{name},
+            email = #{email},
+        <if test="passwd != null">
+            passwd = #{passwd},
+        </if>
+            phone = #{phone}
+        WHERE id = #{id}
+    </update>
+
+    <select id="getUserProFile" resultType="com.koobietech.eas.dao.pojo.UserProFilePojo">
+        SELECT
+            id,
+            relname AS `name`,
+            email,
+            phone
+        FROM
+            eas_sys_userinfo
+        WHERE id = #{uid}
+    </select>
+
+    <select id="getStudentProFile" resultType="com.koobietech.eas.dao.pojo.UserProFilePojo">
+        SELECT
+            id,
+            student_name AS `name`,
+            email,
+            phone
+        FROM
+            eas_sys_student
+        WHERE id = #{uid}
+    </select>
+
+    <update id="updateStudentProFile" parameterType="com.koobietech.eas.dao.pojo.UserProFilePojo">
+        UPDATE eas_sys_student SET
+            student_name = #{name},
+            email = #{email},
+        <if test="passwd != null">
+            passwd = #{passwd},
+        </if>
+            phone = #{phone}
+        WHERE id = #{id}
+    </update>
+
+</mapper>

+ 11 - 0
mbg/src/main/java/com/koobietech/eas/mbg/model/EasArcTlsStudents.java

@@ -179,6 +179,8 @@ public class EasArcTlsStudents implements Serializable {
     @Schema(description = "学生身份证号")
     private String studentIdnumber;
 
+    private String graduation;
+
     private static final long serialVersionUID = 1L;
 
     public Integer getId() {
@@ -349,6 +351,14 @@ public class EasArcTlsStudents implements Serializable {
         this.studentIdnumber = studentIdnumber == null ? null : studentIdnumber.trim();
     }
 
+    public String getGraduation() {
+        return graduation;
+    }
+
+    public void setGraduation(String graduation) {
+        this.graduation = graduation == null ? null : graduation.trim();
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -376,6 +386,7 @@ public class EasArcTlsStudents implements Serializable {
         sb.append(", managerId=").append(managerId);
         sb.append(", createUid=").append(createUid);
         sb.append(", studentIdnumber=").append(studentIdnumber);
+        sb.append(", graduation=").append(graduation);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 70 - 0
mbg/src/main/java/com/koobietech/eas/mbg/model/EasArcTlsStudentsExample.java

@@ -1501,6 +1501,76 @@ public class EasArcTlsStudentsExample {
             addCriterion("student_idnumber not between", value1, value2, "studentIdnumber");
             return (Criteria) this;
         }
+
+        public Criteria andGraduationIsNull() {
+            addCriterion("graduation is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andGraduationIsNotNull() {
+            addCriterion("graduation is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andGraduationEqualTo(String value) {
+            addCriterion("graduation =", value, "graduation");
+            return (Criteria) this;
+        }
+
+        public Criteria andGraduationNotEqualTo(String value) {
+            addCriterion("graduation <>", value, "graduation");
+            return (Criteria) this;
+        }
+
+        public Criteria andGraduationGreaterThan(String value) {
+            addCriterion("graduation >", value, "graduation");
+            return (Criteria) this;
+        }
+
+        public Criteria andGraduationGreaterThanOrEqualTo(String value) {
+            addCriterion("graduation >=", value, "graduation");
+            return (Criteria) this;
+        }
+
+        public Criteria andGraduationLessThan(String value) {
+            addCriterion("graduation <", value, "graduation");
+            return (Criteria) this;
+        }
+
+        public Criteria andGraduationLessThanOrEqualTo(String value) {
+            addCriterion("graduation <=", value, "graduation");
+            return (Criteria) this;
+        }
+
+        public Criteria andGraduationLike(String value) {
+            addCriterion("graduation like", value, "graduation");
+            return (Criteria) this;
+        }
+
+        public Criteria andGraduationNotLike(String value) {
+            addCriterion("graduation not like", value, "graduation");
+            return (Criteria) this;
+        }
+
+        public Criteria andGraduationIn(List<String> values) {
+            addCriterion("graduation in", values, "graduation");
+            return (Criteria) this;
+        }
+
+        public Criteria andGraduationNotIn(List<String> values) {
+            addCriterion("graduation not in", values, "graduation");
+            return (Criteria) this;
+        }
+
+        public Criteria andGraduationBetween(String value1, String value2) {
+            addCriterion("graduation between", value1, value2, "graduation");
+            return (Criteria) this;
+        }
+
+        public Criteria andGraduationNotBetween(String value1, String value2) {
+            addCriterion("graduation not between", value1, value2, "graduation");
+            return (Criteria) this;
+        }
     }
 
     public static class Criteria extends GeneratedCriteria {

+ 22 - 5
mbg/src/main/resources/com/koobietech/eas/mbg/mapper/EasArcTlsStudentsMapper.xml

@@ -23,6 +23,7 @@
     <result column="manager_id" jdbcType="INTEGER" property="managerId" />
     <result column="create_uid" jdbcType="INTEGER" property="createUid" />
     <result column="student_idnumber" jdbcType="VARCHAR" property="studentIdnumber" />
+    <result column="graduation" jdbcType="CHAR" property="graduation" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <where>
@@ -85,7 +86,7 @@
   <sql id="Base_Column_List">
     id, archive_number, student_number, student_name, gender, birthdate, address, phone, 
     email, enrollment_date, graduation_date, grade, major, minor, university, create_time, 
-    modify_time, admissions_id, manager_id, create_uid, student_idnumber
+    modify_time, admissions_id, manager_id, create_uid, student_idnumber, graduation
   </sql>
   <select id="selectByExample" parameterType="com.koobietech.eas.mbg.model.EasArcTlsStudentsExample" resultMap="BaseResultMap">
     select
@@ -127,14 +128,16 @@
       graduation_date, grade, major, 
       minor, university, create_time, 
       modify_time, admissions_id, manager_id, 
-      create_uid, student_idnumber)
+      create_uid, student_idnumber, graduation
+      )
     values (#{archiveNumber,jdbcType=VARCHAR}, #{studentNumber,jdbcType=VARCHAR}, #{studentName,jdbcType=VARCHAR}, 
       #{gender,jdbcType=CHAR}, #{birthdate,jdbcType=DATE}, #{address,jdbcType=VARCHAR}, 
       #{phone,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{enrollmentDate,jdbcType=DATE}, 
       #{graduationDate,jdbcType=DATE}, #{grade,jdbcType=INTEGER}, #{major,jdbcType=VARCHAR}, 
       #{minor,jdbcType=VARCHAR}, #{university,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
       #{modifyTime,jdbcType=TIMESTAMP}, #{admissionsId,jdbcType=INTEGER}, #{managerId,jdbcType=INTEGER}, 
-      #{createUid,jdbcType=INTEGER}, #{studentIdnumber,jdbcType=VARCHAR})
+      #{createUid,jdbcType=INTEGER}, #{studentIdnumber,jdbcType=VARCHAR}, #{graduation,jdbcType=CHAR}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.koobietech.eas.mbg.model.EasArcTlsStudents">
     <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
@@ -202,6 +205,9 @@
       <if test="studentIdnumber != null">
         student_idnumber,
       </if>
+      <if test="graduation != null">
+        graduation,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="archiveNumber != null">
@@ -264,6 +270,9 @@
       <if test="studentIdnumber != null">
         #{studentIdnumber,jdbcType=VARCHAR},
       </if>
+      <if test="graduation != null">
+        #{graduation,jdbcType=CHAR},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.koobietech.eas.mbg.model.EasArcTlsStudentsExample" resultType="java.lang.Long">
@@ -338,6 +347,9 @@
       <if test="record.studentIdnumber != null">
         student_idnumber = #{record.studentIdnumber,jdbcType=VARCHAR},
       </if>
+      <if test="record.graduation != null">
+        graduation = #{record.graduation,jdbcType=CHAR},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -365,7 +377,8 @@
       admissions_id = #{record.admissionsId,jdbcType=INTEGER},
       manager_id = #{record.managerId,jdbcType=INTEGER},
       create_uid = #{record.createUid,jdbcType=INTEGER},
-      student_idnumber = #{record.studentIdnumber,jdbcType=VARCHAR}
+      student_idnumber = #{record.studentIdnumber,jdbcType=VARCHAR},
+      graduation = #{record.graduation,jdbcType=CHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -433,6 +446,9 @@
       <if test="studentIdnumber != null">
         student_idnumber = #{studentIdnumber,jdbcType=VARCHAR},
       </if>
+      <if test="graduation != null">
+        graduation = #{graduation,jdbcType=CHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -457,7 +473,8 @@
       admissions_id = #{admissionsId,jdbcType=INTEGER},
       manager_id = #{managerId,jdbcType=INTEGER},
       create_uid = #{createUid,jdbcType=INTEGER},
-      student_idnumber = #{studentIdnumber,jdbcType=VARCHAR}
+      student_idnumber = #{studentIdnumber,jdbcType=VARCHAR},
+      graduation = #{graduation,jdbcType=CHAR}
     where id = #{id,jdbcType=INTEGER}
   </update>
 </mapper>

+ 2 - 0
security/src/main/java/com/koobietech/eas/security/exception/EasAuthenticationEntryPoint.java

@@ -14,6 +14,8 @@ public class EasAuthenticationEntryPoint implements AuthenticationEntryPoint {
     @Override
     public void commence(HttpServletRequest request, HttpServletResponse response,
                          AuthenticationException authException) {
+        System.out.println( authException.getMessage() );
+        authException.printStackTrace();
         ResponseManager.printResponse(response, "不允许访问", 403);
     }
 }

+ 10 - 2
security/src/main/java/com/koobietech/eas/security/service/impl/SecurityAccessServiceImpl.java

@@ -4,8 +4,9 @@ import com.koobietech.eas.common.utils.SecurityManager;
 import com.koobietech.eas.security.service.SecurityAccessService;
 import org.springframework.security.core.Authentication;
 import org.springframework.security.core.GrantedAuthority;
-import org.springframework.security.core.authority.SimpleGrantedAuthority;
 import org.springframework.stereotype.Service;
+import org.springframework.util.AntPathMatcher;
+import org.springframework.util.PathMatcher;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.Collection;
@@ -15,13 +16,20 @@ import java.util.Collection;
  */
 @Service("SecurityAccessService")
 public class SecurityAccessServiceImpl implements SecurityAccessService {
+
+    private PathMatcher pathMatcher = new AntPathMatcher();
+
     @Override
     public Boolean hasPermission(HttpServletRequest request, Authentication authentication) {
         Authentication userAuthentication= SecurityManager.getAuthentication();
         if ( userAuthentication != null ) {
             Collection<? extends GrantedAuthority> authorities = userAuthentication.getAuthorities();
             System.out.println( "URI:" + request.getRequestURI() );
-            return authorities.contains(new SimpleGrantedAuthority(request.getRequestURI()));
+            for (GrantedAuthority authority : authorities) {
+                if ( pathMatcher.match( authority.getAuthority(), request.getRequestURI() ) ) {
+                    return true;
+                }
+            }
         }
         return false;
     }

+ 20 - 1
service/src/main/java/com/koobietech/eas/service/EasArchivesFilesService.java

@@ -42,6 +42,15 @@ public interface EasArchivesFilesService {
      */
     ArchivesDto saveArchiveStudentsFile(String studentNumber, XWPFDocument document);
 
+    /**
+     * 保存其他档案文件路径
+     * @param studentNumber
+     * @param archiveCode
+     * @param type
+     * @return
+     */
+    String getArchiveSavePath(String studentNumber, String archiveCode, String type);
+
     /**
      * 保存其他档案文件
      * @param studentNumber
@@ -51,6 +60,16 @@ public interface EasArchivesFilesService {
      */
     ArchivesDto saveArchiveFile(String studentNumber, InputStream stream, String type);
 
+
+    /**
+     * 保存其他档案文件
+     * @param studentNumber
+     * @param stream
+     * @param type
+     * @return
+     */
+    ArchivesDto saveArchiveFileTemp(String studentNumber, InputStream stream, String type);
+
     /**
      * 保存 Excel
      * @param studentNumber
@@ -90,7 +109,7 @@ public interface EasArchivesFilesService {
     /**
      * 刷新档案
      */
-    boolean refreshProfile();
+    boolean refreshProfile(String studentNumber);
 
     String createZipArchives(String studentNumber);
 }

+ 3 - 1
service/src/main/java/com/koobietech/eas/service/EasStuProfileService.java

@@ -26,9 +26,11 @@ public interface EasStuProfileService {
 
     List<EasSysStudent> getAll();
 
+    List<EasSysStudent> getAllOrStudentNumber(String studentNumber);
+
     List<EasSysStudent> getStudentByKeyword(String keyword);
 
-    ArchivesDto saveUserFile(EasArcTlsStudents easArcTlsStudents);
+    ArchivesDto saveUserFile(EasArcTlsStudents easArcTlsStudents, String avatar);
 
     ArchivesDto upload(MultipartFile file, String studentNumber, String fileType);
 

+ 8 - 1
service/src/main/java/com/koobietech/eas/service/EasSysAdminLoginService.java

@@ -2,9 +2,10 @@ package com.koobietech.eas.service;
 
 import com.anji.captcha.model.common.ResponseModel;
 import com.koobietech.eas.common.result.JsonResult;
+import com.koobietech.eas.dao.dto.LoginTokenDto;
 import com.koobietech.eas.dao.pojo.AdminPojo;
 import com.koobietech.eas.dao.pojo.UserDetailPojo;
-import com.koobietech.eas.dao.dto.LoginTokenDto;
+import com.koobietech.eas.dao.pojo.UserProFilePojo;
 
 public interface EasSysAdminLoginService {
     LoginTokenDto adminLogin(AdminPojo adminPojo);
@@ -16,4 +17,10 @@ public interface EasSysAdminLoginService {
 
 
     UserDetailPojo getUserInfo(String token);
+
+    UserProFilePojo getUserProFile();
+
+    boolean uploadUserProFile(UserProFilePojo userProFilePojo);
+
+    boolean logout();
 }

+ 4 - 0
service/src/main/java/com/koobietech/eas/service/EasSysDepartmentService.java

@@ -3,6 +3,8 @@ package com.koobietech.eas.service;
 import com.koobietech.eas.common.result.PageDataResult;
 import com.koobietech.eas.mbg.model.EasSysDepartment;
 
+import java.util.List;
+
 
 public interface EasSysDepartmentService {
 
@@ -13,4 +15,6 @@ public interface EasSysDepartmentService {
     Boolean delete(Long id);
 
     PageDataResult query(EasSysDepartment department);
+
+    Boolean updateDepartmentUsers(Long departmentId, List<String> departmentUsers);
 }

+ 5 - 0
service/src/main/java/com/koobietech/eas/service/EasSysUserInfoService.java

@@ -1,6 +1,7 @@
 package com.koobietech.eas.service;
 
 import com.koobietech.eas.common.result.PageDataResult;
+import com.koobietech.eas.dao.pojo.RolePojo;
 import com.koobietech.eas.mbg.model.EasSysUserinfo;
 
 import java.util.List;
@@ -20,4 +21,8 @@ public interface EasSysUserInfoService {
     List<EasSysUserinfo> queryByRealname(String realname);
 
     List<EasSysUserinfo> queryAll();
+
+    List<RolePojo> queryUserByRoleId(int departmentId);
+
+    List<RolePojo> getAllUsers();
 }

+ 1 - 1
service/src/main/java/com/koobietech/eas/service/EasSysUserLoginRedisService.java

@@ -18,5 +18,5 @@ public interface EasSysUserLoginRedisService {
 
     String createJwtRefreshTokenKey(JwtUserPojo jwtUserPojo);
 
-    Boolean loginDeleteCache(String newRedisRefreshTokenKey);
+    Boolean loginDeleteCache(JwtUserPojo jwtUserPojo);
 }

+ 0 - 1
service/src/main/java/com/koobietech/eas/service/config/EasAuthorityConfig.java

@@ -17,7 +17,6 @@ import java.util.List;
  */
 @Data
 public class EasAuthorityConfig {
-    private List<String> authorization = new ArrayList<>();
     private List<String> student = new ArrayList<>();
     private List<String> teacher = new ArrayList<>();
     private List<String> easgroup = new ArrayList<>();

+ 1 - 1
service/src/main/java/com/koobietech/eas/service/impl/EasArcTlsAttendanceServiceImpl.java

@@ -226,7 +226,7 @@ public class EasArcTlsAttendanceServiceImpl implements EasArcTlsAttendanceServic
         easArcArchives.setArctype(FileType.XLSX.name());
         easArcArchives.setManagerId( SecurityManager.getLoginUid().intValue() );
         easArcArchives.setValidityTime( new Date(LocalDate.now().plusMonths(20)
-                .atStartOfDay().toInstant(ZoneOffset.UTC).toEpochMilli()) );
+                .atStartOfDay().toInstant(ZoneOffset.of("+8")).toEpochMilli()) );
         int insert = arcArchivesMapper.insert(easArcArchives);
         return insert == 1;
     }

+ 1 - 1
service/src/main/java/com/koobietech/eas/service/impl/EasArcTlsScoresServiceImpl.java

@@ -109,7 +109,7 @@ public class EasArcTlsScoresServiceImpl implements EasArcTlsScoresService {
         easArcArchives.setArctype(FileType.XLSX.name());
         easArcArchives.setManagerId( SecurityManager.getLoginUid().intValue() );
         easArcArchives.setValidityTime( new Date(LocalDate.now().plusMonths(20)
-                .atStartOfDay().toInstant(ZoneOffset.UTC).toEpochMilli()) );
+                .atStartOfDay().toInstant(ZoneOffset.of("+8")).toEpochMilli()) );
         int insert = arcArchivesMapper.insert(easArcArchives);
         return insert == 1;
     }

+ 34 - 4
service/src/main/java/com/koobietech/eas/service/impl/EasArchivesFilesServiceImpl.java

@@ -31,6 +31,9 @@ import java.util.Objects;
 @Service
 public class EasArchivesFilesServiceImpl implements EasArchivesFilesService {
 
+    @Value("${project.cache.path}")
+    String archivesSaveCachePath;
+
     @Value("${project.path}")
     String archivesSavePath;
 
@@ -85,6 +88,14 @@ public class EasArchivesFilesServiceImpl implements EasArchivesFilesService {
         return saveArchiveWorkbookFile(studentNumber, workbook, FileType.XLSX.name());
     }
 
+    @Override
+    /**
+     * 保存凄其他资料
+     */
+    public String getArchiveSavePath(String studentNumber, String archiveCode, String type) {
+        return getArchivePath(studentNumber, archiveCode, FileType.valueOf(type).getSuffix(), "other");
+    }
+
     @Override
     /**
      * 保存凄其他资料
@@ -96,6 +107,18 @@ public class EasArchivesFilesServiceImpl implements EasArchivesFilesService {
         return new ArchivesDto(path, status, archiveCode, type);
     }
 
+    @Override
+    /**
+     * 保存凄其他资料
+     */
+    public ArchivesDto saveArchiveFileTemp(String studentNumber, InputStream stream, String type) {
+        String archiveCode = getArchiveCode(studentNumber, String.valueOf(FileType.valueOf(type).getValue()));
+        String path = getArchivePathTemp(studentNumber,  archiveCode, FileType.valueOf(type).getSuffix());
+        boolean status = fileManager.saveFile(stream, path);
+        return new ArchivesDto(path, status, archiveCode, type);
+    }
+
+
     @Override
     /**
      * 删除文件
@@ -152,16 +175,17 @@ public class EasArchivesFilesServiceImpl implements EasArchivesFilesService {
         return ret;
     }
 
-    @Override
     /**
      * 刷新档案
      */
-    public boolean refreshProfile() {
+
+    @Override
+    public boolean refreshProfile(String studentNumber) {
 
         /**
          * 查询所有学员
          */
-        List<EasSysStudent> all = easStuProfileService.getAll();
+        List<EasSysStudent> all = easStuProfileService.getAllOrStudentNumber(studentNumber);
 
         /**
          * 查询学员考核
@@ -187,7 +211,7 @@ public class EasArchivesFilesServiceImpl implements EasArchivesFilesService {
                 EasArcTlsStudents arcStudent = (EasArcTlsStudents) query.getData()
                         .stream().findFirst().orElse(null);
                 if (Objects.nonNull(arcStudent)) {
-                    easStuProfileService.saveUserFile(arcStudent);
+                    easStuProfileService.saveUserFile( arcStudent, student.getAvatar() );
                 }
             }
         }
@@ -226,6 +250,12 @@ public class EasArchivesFilesServiceImpl implements EasArchivesFilesService {
         return ArchiveManager.generateArchiveCode(studentNumber, fileCode);
     }
 
+    private String getArchivePathTemp(String studentNumber, String archiveCode, String suffix){
+        String path = archivesSaveCachePath + separator + studentNumber;
+        fileManager.createPath(path);
+        return path + separator + archiveCode + suffix;
+    }
+
     private String getArchivePath(String studentNumber, String archiveCode, String suffix) {
         return getArchivePath(studentNumber,  archiveCode, suffix, null);
     }

+ 1 - 1
service/src/main/java/com/koobietech/eas/service/impl/EasEduCategoryServiceImpl.java

@@ -28,7 +28,7 @@ public class EasEduCategoryServiceImpl implements EasEduCategoryService {
 
     @Override
     public int updateEasEduCategory(EasEduCategory easEduCategory) {
-        return easEduCategoryMapper.updateByPrimaryKey( easEduCategory );
+        return easEduCategoryMapper.updateByPrimaryKeySelective( easEduCategory );
     }
 
     @Override

+ 1 - 1
service/src/main/java/com/koobietech/eas/service/impl/EasEduScheduleServiceImpl.java

@@ -35,7 +35,7 @@ public class EasEduScheduleServiceImpl implements EasEduScheduleService {
     @Override
     public Boolean update(EasEduSchedule schedule) {
         schedule.setModifyTime(new Date());
-        return easEduScheduleMapper.updateByPrimaryKey(schedule) == 1;
+        return easEduScheduleMapper.updateByPrimaryKeySelective (schedule) == 1;
     }
 
     @Override

+ 1 - 1
service/src/main/java/com/koobietech/eas/service/impl/EasEduSubjectsServiceImpl.java

@@ -28,7 +28,7 @@ public class EasEduSubjectsServiceImpl implements EasEduSubjectsService {
 
     @Override
     public int updateSubjects(EasEduSubjects easEduSubjects) {
-        return easEduSubjectsMapper.updateByPrimaryKey(easEduSubjects);
+        return easEduSubjectsMapper.updateByPrimaryKeySelective(easEduSubjects);
     }
 
     @Override

+ 151 - 41
service/src/main/java/com/koobietech/eas/service/impl/EasStuProfileServiceImpl.java

@@ -9,6 +9,7 @@ import com.koobietech.eas.common.exception.EasException;
 import com.koobietech.eas.common.result.PageDataResult;
 import com.koobietech.eas.common.utils.ArchiveManager;
 import com.koobietech.eas.common.utils.DateManager;
+import com.koobietech.eas.common.utils.FileManager;
 import com.koobietech.eas.common.utils.SecurityManager;
 import com.koobietech.eas.dao.dto.ArchivesDto;
 import com.koobietech.eas.dao.dto.EasArcTlsStudentsDto;
@@ -19,6 +20,7 @@ import com.koobietech.eas.mbg.model.*;
 import com.koobietech.eas.service.EasArchiveFileDownloadService;
 import com.koobietech.eas.service.EasArchivesFilesService;
 import com.koobietech.eas.service.EasStuProfileService;
+import com.koobietech.eas.service.EasSysUserInfoService;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.util.Units;
 import org.apache.poi.xwpf.usermodel.XWPFDocument;
@@ -34,6 +36,8 @@ import org.springframework.util.StringUtils;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
+import java.io.File;
+import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.time.LocalDate;
@@ -50,7 +54,7 @@ public class EasStuProfileServiceImpl implements EasStuProfileService {
     private static final Logger logger = LoggerFactory.getLogger(EasStuProfileServiceImpl.class);
 
     private static final String TEMPLATE_PATH = "temp/StuRegistTemp.docx";
-    private static final String PHOTO_PATH = "temp/kun.jpeg";
+    private static final String PHOTO_PATH = "temp/avatar.jpeg";
     @Resource
     private EasArcTlsStudentsMapper easArcTlsStudentsMapper;
     @Resource
@@ -63,12 +67,29 @@ public class EasStuProfileServiceImpl implements EasStuProfileService {
     private EasArchivesFilesService easArchivesFilesService;
     @Resource
     private EasArchiveFileDownloadService  easArchiveFileDownloadService;
+    @Resource
+    private EasSysUserInfoService easSysUserInfoService;
 
     final String FILETYPE = "prefile";
 
     @Override
-    public ArchivesDto saveUserFile(EasArcTlsStudents easArcTlsStudents){
-        ArchivesDto archivesDto = null;
+    public ArchivesDto saveUserFile(EasArcTlsStudents easArcTlsStudents, String avatar){
+
+        if ( Objects.isNull(easArcTlsStudents.getEnrollmentDate()) ) {
+            easArcTlsStudents.setEnrollmentDate(new Date());
+        }
+        if ( Objects.isNull(easArcTlsStudents.getGraduationDate()) ) {
+            easArcTlsStudents.setGraduationDate(new Date(LocalDate.now().plusYears(2)
+                    .atStartOfDay().toInstant(ZoneOffset.of("+8")).toEpochMilli()));
+        }
+        if ( Objects.isNull(easArcTlsStudents.getBirthdate()) ) {
+            easArcTlsStudents.setBirthdate(
+                    new Date(ArchiveManager.extractBirthDate(
+                                    easArcTlsStudents.getStudentIdnumber()
+                            ).atStartOfDay()
+                                    .toInstant(ZoneOffset.of("+8")).toEpochMilli()) );
+        }
+        ArchivesDto archivesDto;
         try (InputStream wordStream = getClass().getClassLoader().getResourceAsStream(TEMPLATE_PATH)) {
             assert wordStream != null;
             try (XWPFDocument doc = new XWPFDocument(wordStream)) {
@@ -81,7 +102,7 @@ public class EasStuProfileServiceImpl implements EasStuProfileService {
                     studentNumber = easArcTlsStudents.getStudentNumber();
                 }
 
-                Map<String, Object> map = generateDataMap(easArcTlsStudents, studentNumber);
+                Map<String, Object> map = generateDataMap(easArcTlsStudents, studentNumber, avatar);
                 replacePlaceholders(doc, map);
                 //这里会生成一个学生档案保存本地 目前这里有bug保存不成功 而且文件后缀有错误
                 archivesDto = insertEasArcArchives(easArcTlsStudents, doc);
@@ -114,7 +135,23 @@ public class EasStuProfileServiceImpl implements EasStuProfileService {
             catch (IllegalArgumentException e) {
                 type = FileType.FILE.toString();
             }
-            archivesDto = easArchivesFilesService.saveArchiveFile(studentNumber, inputStream, type);
+            archivesDto = easArchivesFilesService.saveArchiveFileTemp(studentNumber, inputStream, type);
+            if (archivesDto.isStatus()) {
+                if ( fileType.equals("avatar") ) {
+                    EasSysStudentExample easSysStudentExample = new EasSysStudentExample();
+                    easSysStudentExample.createCriteria().andStudentNumberEqualTo(studentNumber);
+                    EasSysStudent easSysStudent = new EasSysStudent();
+                    easSysStudent.setAvatar(archivesDto.getPath());
+                    easSysStudentMapper.updateByExampleSelective(easSysStudent, easSysStudentExample);
+                }
+                EasArcTlsStudentsExample easArcTlsStudentsExample = new EasArcTlsStudentsExample();
+                easArcTlsStudentsExample.createCriteria().andStudentNumberEqualTo(studentNumber);
+                List<EasArcTlsStudents> easArcTlsStudents = easArcTlsStudentsMapper.selectByExample(easArcTlsStudentsExample);
+                EasArcTlsStudents arcStudent = easArcTlsStudents.stream().findFirst().orElse(null);
+                if ( Objects.nonNull(arcStudent) ) {
+                    saveUserFile(arcStudent, archivesDto.getPath() );
+                }
+            }
         } catch (IOException ignore) {
         } finally {
             if (inputStream != null) {
@@ -141,21 +178,38 @@ public class EasStuProfileServiceImpl implements EasStuProfileService {
     }
     @Override
     public boolean addArchives(EasArcArchives arc) {
-        String arctype = "";
+
+        FileManager fileManager = new FileManager();
+
+        if ( Objects.isNull(arc) || Objects.isNull(arc.getFilePath()) ||
+                !StringUtils.hasText(arc.getFilePath()) || !fileManager.isFileExists(arc.getFilePath()) ) {
+            throw new EasException("档案不能为空");
+        }
+        String fileType = arc.getFilePath().substring(arc.getFilePath().lastIndexOf(".") + 1).toUpperCase();
+        String arctype = fileType;
         if ( isImage(arc.getFilePath()) ) {
             arctype =  "IMAGE";
-        } else {
-            arctype = arc.getFilePath().substring(arc.getFilePath().lastIndexOf(".") + 1).toUpperCase();
+        }
+        try {
+            //如果抛异常 则类型不识别
+            FileType.valueOf(fileType);
+        }catch (IllegalArgumentException e) {
+            arctype = FileType.FILE.toString();
         }
         String archiveNumber = arc.getFilePath().substring(
                 arc.getFilePath().lastIndexOf("\\") + 1,
                 arc.getFilePath().lastIndexOf("."));
+
+        String archiveSavePath = easArchivesFilesService.getArchiveSavePath(arc.getStudentNumber(), archiveNumber, fileType);
+        fileManager.moveFile( arc.getFilePath(), archiveSavePath, true );
+
+        arc.setFilePath( archiveSavePath );
         arc.setArctype(arctype);
         arc.setCreateTime(new Date());
         arc.setModifyTime(new Date());
         arc.setArchiveNumber( archiveNumber );
         arc.setValidityTime( new Date(LocalDate.now().plusMonths(20)
-                .atStartOfDay().toInstant(ZoneOffset.UTC).toEpochMilli()) );
+                .atStartOfDay().toInstant(ZoneOffset.of("+8")).toEpochMilli()) );
         arc.setManagerId( SecurityManager.getLoginUid().intValue() );
         arc.setCreateUid( SecurityManager.getLoginUid().intValue() );
         arc.setCreateDate(new Date());
@@ -194,7 +248,7 @@ public class EasStuProfileServiceImpl implements EasStuProfileService {
     @Override
     public boolean add(EasArcTlsStudents easArcTlsStudents) {
 
-        ArchivesDto archivesDto = saveUserFile(easArcTlsStudents);
+        ArchivesDto archivesDto = saveUserFile(easArcTlsStudents, PHOTO_PATH);
 
         //将easArcTlsStudents 保存到数据库
         easArcTlsStudents.setArchiveNumber(archivesDto.getArchiveCode());
@@ -206,7 +260,6 @@ public class EasStuProfileServiceImpl implements EasStuProfileService {
         if (!isSysStudentsInsert) {
             throw new EasException("EasSysStudents保存失败", 8001);
         }
-
         return true;
     }
 
@@ -251,12 +304,29 @@ public class EasStuProfileServiceImpl implements EasStuProfileService {
 
     @Override
     public boolean update(EasArcTlsStudents studentDto) {
-        return easArcTlsStudentsMapper.updateByPrimaryKey(studentDto) == 1;
+        EasSysStudent easSysStudent = new EasSysStudent();
+        if ( studentDto.getGraduation().equals("Y") ) {
+            easSysStudent.setDisabled("Y");
+        } else {
+            easSysStudent.setDisabled("N");
+        }
+        EasSysStudentExample easSysStudentExample = new EasSysStudentExample();
+        easSysStudentExample.createCriteria().andStudentNumberEqualTo(studentDto.getStudentNumber());
+        easSysStudentMapper.updateByExampleSelective(easSysStudent, easSysStudentExample);
+        return easArcTlsStudentsMapper.updateByPrimaryKeySelective (studentDto) == 1;
     }
 
     @Override
     public boolean delete(int id) {
-        return easArcTlsStudentsMapper.deleteByPrimaryKey(id) == 1;
+        EasArcTlsStudents easArcTlsStudents = easArcTlsStudentsMapper.selectByPrimaryKey(id);
+        if ( Objects.nonNull(easArcTlsStudents) ) {
+            EasSysStudentExample easSysStudentExample = new EasSysStudentExample();
+            easSysStudentExample.createCriteria().andStudentNumberEqualTo( easArcTlsStudents.getStudentNumber() );
+            int i = easSysStudentMapper.deleteByExample(easSysStudentExample);
+            int i1 = easArcTlsStudentsMapper.deleteByPrimaryKey(id);
+            return i == 1 && i1 == 1;
+        }
+        return false;
     }
 
     @Override
@@ -290,7 +360,21 @@ public class EasStuProfileServiceImpl implements EasStuProfileService {
 
     @Override
     public List<EasSysStudent> getAll() {
-        return easSysStudentMapper.selectByExample(null);
+        EasSysStudentExample easSysStudentExample = new EasSysStudentExample();
+        EasSysStudentExample.Criteria criteria = easSysStudentExample.createCriteria();
+        criteria.andDisabledEqualTo("N");
+        return easSysStudentMapper.selectByExample(easSysStudentExample);
+    }
+
+    @Override
+    public List<EasSysStudent> getAllOrStudentNumber(String studentNumber){
+        EasSysStudentExample easSysStudentExample = new EasSysStudentExample();
+        EasSysStudentExample.Criteria criteria = easSysStudentExample.createCriteria();
+        criteria.andDisabledEqualTo("N");
+        if ( Objects.nonNull(studentNumber) ) {
+            criteria.andStudentNumberEqualTo(studentNumber);
+        }
+        return easSysStudentMapper.selectByExample(easSysStudentExample);
     }
 
     @Override
@@ -321,18 +405,23 @@ public class EasStuProfileServiceImpl implements EasStuProfileService {
         return matcher.matches();
     }
 
-    private Map<String, Object> generateDataMap(EasArcTlsStudents easArcTlsStudents, String studentNumber) {
+    private Map<String, Object> generateDataMap(EasArcTlsStudents easArcTlsStudents, String studentNumber, String avatar) {
+        EasSysUserinfo easSysUserinfo = null;
+        if ( Objects.nonNull(easArcTlsStudents.getAdmissionsId()) ) {
+            easSysUserinfo = easSysUserInfoService.queryByUid(easArcTlsStudents.getAdmissionsId().longValue());
+        }
         Map<String, Object> map = new HashMap<>();
         map.put("student_name", easArcTlsStudents.getStudentName());
         map.put("gender", convertToGender(easArcTlsStudents.getGender()));
-        map.put("major", easArcTlsStudents.getMajor());
-        map.put("grade", easArcTlsStudents.getGrade());
         map.put("enrollment_date", DateManager.convertToYearMonthDay(easArcTlsStudents.getEnrollmentDate()));
+        map.put("graduation_date", DateManager.convertToYearMonthDay(easArcTlsStudents.getGraduationDate()));
         map.put("phone", easArcTlsStudents.getPhone());
         map.put("university", easArcTlsStudents.getUniversity());
         map.put("student_idnumber", easArcTlsStudents.getStudentIdnumber());
-        map.put("avatar", getClass().getClassLoader().getResourceAsStream(PHOTO_PATH));
+        map.put("avatar", avatar);
         map.put("student_number", studentNumber);
+        map.put("birthdate", DateManager.convertToYearMonthDay(easArcTlsStudents.getBirthdate()));
+        map.put("admissionsd", ( Objects.nonNull(easSysUserinfo) && Objects.nonNull(easSysUserinfo.getRelname()) ) ? easSysUserinfo.getRelname() : "");
         return map;
     }
 
@@ -403,6 +492,9 @@ public class EasStuProfileServiceImpl implements EasStuProfileService {
 
     private String generateStudentNumber(EasArcTlsStudents easArcTlsStudents) {
         Calendar calendar = Calendar.getInstance();
+        if ( Objects.isNull(easArcTlsStudents.getEnrollmentDate()) ) {
+            easArcTlsStudents.setEnrollmentDate(new Date());
+        }
         calendar.setTime(easArcTlsStudents.getEnrollmentDate());
         String year = String.valueOf(calendar.get(Calendar.YEAR));
 
@@ -415,33 +507,51 @@ public class EasStuProfileServiceImpl implements EasStuProfileService {
     }
 
     private void replacePlaceholders(XWPFDocument document, Map<String, Object> map) {
-        for (XWPFTable table : document.getTables()) {
-            for (XWPFTableRow row : table.getRows()) {
-                for (XWPFTableCell cell : row.getTableCells()) {
-                    String cellText = cell.getText();
-                    if (!cellText.contains("${")) {
-                        continue;
-                    }
-                    map.forEach((key, value) -> {
-                        String placeholder = "${" + key + "}";
-                        if (cellText.contains(placeholder) && Objects.nonNull(value)) {
-                            try {
-                                cell.removeParagraph(0);
-                                if (value instanceof InputStream) {
-                                    cell.addParagraph().createRun().addPicture((InputStream) value,
-                                            XWPFDocument.PICTURE_TYPE_JPEG, "avatar.jpg",
-                                            Units.pixelToEMU(110), Units.pixelToEMU(140));
-                                } else {
-                                    cell.setText(cellText.replace(placeholder, value.toString()));
-                                }
-                            } catch (IOException | InvalidFormatException e) {
-                                throw new EasException("学员导入失败");
+        InputStream resourceAsStream = null;
+        FileManager fileManager = new FileManager();
+        try {
+            if (map.get("avatar").toString().equals(PHOTO_PATH)
+                    || Objects.isNull(map.get("avatar"))
+                    || map.get("avatar").toString().equals("") ) {
+                resourceAsStream = getClass().getClassLoader().getResourceAsStream(PHOTO_PATH);
+            } else if ( fileManager.isFileExists(map.get("avatar").toString()) ) {
+                resourceAsStream = new FileInputStream(new File(map.get("avatar").toString()));
+            }
+            map.put("avatar", resourceAsStream);
+            for (XWPFTable table : document.getTables()) {
+                for (XWPFTableRow row : table.getRows()) {
+                    for (XWPFTableCell cell : row.getTableCells()) {
+                        String cellText = cell.getText();
+                        if (!cellText.contains("${")) {
+                            continue;
+                        }
+                        map.forEach((key, value) -> {
+                            String placeholder = "${" + key + "}";
+                            if (cellText.contains(placeholder) && Objects.nonNull(value)) {
+                                try {
+                                    cell.removeParagraph(0);
+                                    if (value instanceof InputStream) {
+                                        cell.addParagraph().createRun().addPicture((InputStream) value,
+                                                XWPFDocument.PICTURE_TYPE_JPEG, "avatar.jpg",
+                                                Units.pixelToEMU(110), Units.pixelToEMU(140));
+                                    } else {
+                                        cell.setText(cellText.replace(placeholder, value.toString()));
+                                    }
+                                } catch (IOException | InvalidFormatException e) {
+                                    throw new EasException("学员导入失败");
 
+                                }
                             }
-                        }
-                    });
+                        });
+                    }
                 }
             }
+        } catch (Exception ignored) {} finally {
+            if ( Objects.nonNull(resourceAsStream) ) {
+                try {
+                    resourceAsStream.close();
+                } catch (IOException ignored) {}
+            }
         }
     }
 }

+ 55 - 0
service/src/main/java/com/koobietech/eas/service/impl/EasSysAdminLoginServiceImpl.java

@@ -8,13 +8,16 @@ import com.koobietech.eas.common.result.JsonResult;
 import com.koobietech.eas.common.utils.FileManager;
 import com.koobietech.eas.common.utils.JwtManager;
 import com.koobietech.eas.common.utils.PasswordManager;
+import com.koobietech.eas.common.utils.SecurityManager;
 import com.koobietech.eas.dao.constant.JwtType;
 import com.koobietech.eas.dao.constant.UserType;
 import com.koobietech.eas.dao.dto.LoginTokenDto;
 import com.koobietech.eas.dao.mapper.AdminLoginMapper;
+import com.koobietech.eas.dao.mapper.UserProFileMapper;
 import com.koobietech.eas.dao.pojo.AdminPojo;
 import com.koobietech.eas.dao.pojo.DepartmentPojo;
 import com.koobietech.eas.dao.pojo.UserDetailPojo;
+import com.koobietech.eas.dao.pojo.UserProFilePojo;
 import com.koobietech.eas.mbg.mapper.EasSysUserinfoMapper;
 import com.koobietech.eas.mbg.model.EasSysUserinfo;
 import com.koobietech.eas.mbg.model.EasSysUserinfoExample;
@@ -25,6 +28,7 @@ import org.apache.commons.io.IOUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.security.crypto.password.PasswordEncoder;
 import org.springframework.stereotype.Service;
+import org.springframework.util.ObjectUtils;
 
 import javax.annotation.Resource;
 import java.io.File;
@@ -49,6 +53,10 @@ public class EasSysAdminLoginServiceImpl implements EasSysAdminLoginService {
     private EasSysUserinfoMapper easSysUserinfoMapper;
     @Resource
     private EasSysUserLoginRedisService loginRedisService;
+
+    @Resource
+    private UserProFileMapper userProFileMapper;
+
     @Resource
     private JwtManager jwtManager;
     @Resource
@@ -202,6 +210,53 @@ public class EasSysAdminLoginServiceImpl implements EasSysAdminLoginService {
             throw new EasException("Token获取用户信息失败", e);
         }}
 
+    @Override
+    public UserProFilePojo getUserProFile() {
+        UserProFilePojo userProFilePojo;
+        if ( SecurityManager.isStudentUser() ) {
+            userProFilePojo = userProFileMapper
+                    .getStudentProFile(SecurityManager.getLoginSid().intValue());
+        } else {
+            userProFilePojo = userProFileMapper
+                    .getUserProFile(SecurityManager.getLoginUid().intValue());
+        }
+        return  userProFilePojo;
+    }
+
+    @Override
+    public boolean uploadUserProFile(UserProFilePojo userProFilePojo) {
+        boolean success;
+        if ( ObjectUtils.isEmpty(userProFilePojo)) {
+            throw new EasException("上传用户错误!",9000);
+        }
+        //强制密码规则 限制对密码试探
+        if ( Objects.nonNull(userProFilePojo.getPasswd())
+                && !"".equals(userProFilePojo.getPasswd())) {
+            userProFilePojo.setPasswd(passwordEncoder.encode(userProFilePojo.getPasswd()));;
+        } else {
+            userProFilePojo.setPasswd(null);
+        }
+        if ( SecurityManager.isStudentUser() ) {
+            userProFilePojo.setId( SecurityManager.getLoginSid().intValue() );
+            int i = userProFileMapper.updateStudentProFile(userProFilePojo);
+            success = i > 0;
+        } else {
+            userProFilePojo.setId( SecurityManager.getLoginUid().intValue() );
+            int i = userProFileMapper.updateUserProFile(userProFilePojo);
+            success = i > 0;
+        }
+        return success;
+    }
+
+    @Override
+    public boolean logout() {
+        JwtUserPojo jwtUserPojo = new JwtUserPojo();
+        jwtUserPojo.setType(SecurityManager.getUserType());
+        jwtUserPojo.setUsername(SecurityManager.getLoginUserName());
+        jwtUserPojo.setId( SecurityManager.isStudentUser() ? SecurityManager.getLoginSid() : SecurityManager.getLoginUid() );
+        return loginRedisService.loginDeleteCache(jwtUserPojo);
+    }
+
 
     private EasSysUserinfo findAdminByUsername(String username, String password)  {
         EasSysUserinfoExample easSysUserinfoExample = new EasSysUserinfoExample();

+ 34 - 1
service/src/main/java/com/koobietech/eas/service/impl/EasSysDepartmentServiceImpl.java

@@ -1,7 +1,11 @@
 package com.koobietech.eas.service.impl;
 
 import com.koobietech.eas.common.result.PageDataResult;
+import com.koobietech.eas.common.utils.SecurityManager;
+import com.koobietech.eas.mbg.mapper.EasSysDepRelationMapper;
 import com.koobietech.eas.mbg.mapper.EasSysDepartmentMapper;
+import com.koobietech.eas.mbg.model.EasSysDepRelation;
+import com.koobietech.eas.mbg.model.EasSysDepRelationExample;
 import com.koobietech.eas.mbg.model.EasSysDepartment;
 import com.koobietech.eas.mbg.model.EasSysDepartmentExample;
 import com.koobietech.eas.service.EasSysDepartmentService;
@@ -19,11 +23,13 @@ public class EasSysDepartmentServiceImpl implements EasSysDepartmentService {
 
     @Resource
     EasSysDepartmentMapper easSysDepartmentMapper;
+    @Resource
+    EasSysDepRelationMapper  easSysDepRelationMapper;
 
     @Override
     public Boolean update(EasSysDepartment department) {
         department.setModifyTime(new Date());
-        return easSysDepartmentMapper.updateByPrimaryKey(department) == 1;
+        return easSysDepartmentMapper.updateByPrimaryKeySelective(department) == 1;
     }
 
     @Override
@@ -93,4 +99,31 @@ public class EasSysDepartmentServiceImpl implements EasSysDepartmentService {
         ret.setTotal(l);
         return ret;
     }
+
+    @Override
+    public Boolean updateDepartmentUsers(Long departmentId, List<String> departmentUsers) {
+        EasSysDepRelationExample easSysDepRelationExample = new EasSysDepRelationExample();
+        easSysDepRelationExample.createCriteria().andDepartmentIdEqualTo(departmentId.intValue());
+        easSysDepRelationMapper.deleteByExample(easSysDepRelationExample);
+
+        departmentUsers.forEach(userPojo -> {
+            String[] split = userPojo.split("-");
+            if ( split.length == 2 ) {
+                int userId =  Integer.parseInt(split[0].trim());
+                String userType = String.valueOf(split[1].trim());
+                EasSysDepRelation easSysDepRelation = new EasSysDepRelation();
+                if (userType.equals("用户")) {
+                    easSysDepRelation.setUserId(userId);
+                    easSysDepRelation.setStudentId(0);
+                } else {
+                    easSysDepRelation.setUserId(0);
+                    easSysDepRelation.setStudentId(userId);
+                }
+                easSysDepRelation.setDepartmentId(departmentId.intValue());
+                easSysDepRelation.setCreateUid(SecurityManager.getLoginUid().intValue());
+                easSysDepRelationMapper.insert(easSysDepRelation);
+            }
+        });
+        return true;
+    }
 }

+ 1 - 1
service/src/main/java/com/koobietech/eas/service/impl/EasSysPermissionServiceImpl.java

@@ -22,7 +22,7 @@ public class EasSysPermissionServiceImpl implements EasSysPermissionService {
     @Override
     public Boolean update(EasSysPermission permission) {
         permission.setModifyTime(new Date());
-        return easSysPermissionMapper.updateByPrimaryKey(permission) == 1;
+        return easSysPermissionMapper.updateByPrimaryKeySelective(permission) == 1;
     }
 
     @Override

+ 3 - 1
service/src/main/java/com/koobietech/eas/service/impl/EasSysStudentLoginServiceImpl.java

@@ -92,7 +92,9 @@ public class EasSysStudentLoginServiceImpl implements EasSysStudentLoginService
         String jsonStr = "";
         try {
             jsonStr = IOUtils.toString(archiveFile, "UTF-8");
-        } catch (IOException ignored) {}
+        } catch (IOException ignored) {} finally {
+            IOUtils.closeQuietly(archiveFile);
+        }
 
         EasAuthorityConfig easAuthorityConfig = JSON.parseObject(jsonStr, EasAuthorityConfig.class);
         if (easAuthorityConfig == null) {

+ 20 - 1
service/src/main/java/com/koobietech/eas/service/impl/EasSysUserInfoServiceImpl.java

@@ -1,10 +1,13 @@
 package com.koobietech.eas.service.impl;
 
 import com.koobietech.eas.common.result.PageDataResult;
+import com.koobietech.eas.dao.mapper.RoleMapper;
+import com.koobietech.eas.dao.pojo.RolePojo;
 import com.koobietech.eas.mbg.mapper.EasSysUserinfoMapper;
 import com.koobietech.eas.mbg.model.EasSysUserinfo;
 import com.koobietech.eas.mbg.model.EasSysUserinfoExample;
 import com.koobietech.eas.service.EasSysUserInfoService;
+import org.springframework.security.crypto.password.PasswordEncoder;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 
@@ -20,12 +23,18 @@ public class EasSysUserInfoServiceImpl implements EasSysUserInfoService {
     @Resource
     EasSysUserinfoMapper easSysUserinfoMapper;
 
+    @Resource
+    RoleMapper  roleMapper;
+
+    @Resource
+    PasswordEncoder passwordEncoder;
+
     final String userInfoName = "admin";
 
     @Override
     public Boolean add(EasSysUserinfo userinfo) {
         //给用户信息设置默认密码
-        userinfo.setPasswd("123456");
+        userinfo.setPasswd(passwordEncoder.encode("123456"));
         userinfo.setCreateTime(new Date());
         userinfo.setModifyTime(new Date());
         return easSysUserinfoMapper.insert(userinfo) == 1;
@@ -133,4 +142,14 @@ public class EasSysUserInfoServiceImpl implements EasSysUserInfoService {
     public List<EasSysUserinfo> queryAll() {
         return easSysUserinfoMapper.selectByExample(null);
     }
+
+    @Override
+    public List<RolePojo> queryUserByRoleId(int departmentId) {
+        return roleMapper.queryUserByRoleId(departmentId);
+    }
+
+    @Override
+    public List<RolePojo> getAllUsers() {
+        return roleMapper.getAllUsers();
+    }
 }

+ 6 - 2
service/src/main/java/com/koobietech/eas/service/impl/EasSysUserLoginRedisServiceImpl.java

@@ -69,7 +69,11 @@ public class EasSysUserLoginRedisServiceImpl implements EasSysUserLoginRedisServ
     }
 
     @Override
-    public Boolean loginDeleteCache(String newRedisRefreshTokenKey) {
-        return redisService.del(newRedisRefreshTokenKey);
+    public Boolean loginDeleteCache(JwtUserPojo jwtUserPojo) {
+        String jwtRefreshTokenKey = createJwtRefreshTokenKey(jwtUserPojo);
+        String jwtTokenKey = createJwtTokenKey(jwtUserPojo);
+        redisService.del(jwtRefreshTokenKey);
+        redisService.del(jwtTokenKey);
+        return true;
     }
 }