Pārlūkot izejas kodu

Merge branch 'master' into cuidi

cuidi 1 gadu atpakaļ
vecāks
revīzija
a4a5ade0b2
24 mainītis faili ar 1167 papildinājumiem un 46 dzēšanām
  1. 2 0
      .gitignore
  2. 4 0
      common/pom.xml
  3. 7 0
      common/src/main/java/com/koobietech/eas/common/utils/FileManager.java
  4. 1 1
      common/src/main/java/com/koobietech/eas/common/utils/JwtManager.java
  5. 13 12
      controller/src/main/java/com/koobietech/eas/controller/AdminLoginController.java
  6. 27 0
      controller/src/main/java/com/koobietech/eas/controller/EasStuProfileController.java
  7. BIN
      controller/src/main/resources/Temp/StuRegistTemp.docx
  8. BIN
      controller/src/main/resources/Temp/kun1.jpeg
  9. BIN
      controller/src/main/resources/Temp/~$uRegistTemp.docx
  10. BIN
      controller/src/main/resources/temp/StuRegistTemp.docx
  11. 5 4
      controller/src/test/java/com/koobietech/eas/controller/ControllerApplicationTests.java
  12. 1 1
      dao/src/main/java/com/koobietech/eas/dao/Pojo/AdminPojo.java
  13. 31 0
      mbg/src/main/java/com/koobietech/eas/mbg/mapper/EasEduCltRelationMapper.java
  14. 6 0
      mbg/src/main/java/com/koobietech/eas/mbg/model/EasArcTlsStudents.java
  15. 2 2
      mbg/src/main/java/com/koobietech/eas/mbg/model/EasEduClass.java
  16. 116 0
      mbg/src/main/java/com/koobietech/eas/mbg/model/EasEduCltRelation.java
  17. 560 0
      mbg/src/main/java/com/koobietech/eas/mbg/model/EasEduCltRelationExample.java
  18. 226 0
      mbg/src/main/resources/com/koobietech/eas/mbg/mapper/EasEduCltRelationMapper.xml
  19. 29 24
      security/src/main/java/com/koobietech/eas/security/filter/EasSecurityFilter.java
  20. 4 0
      service/pom.xml
  21. 1 0
      service/src/main/java/com/koobietech/eas/service/AdminLoginService.java
  22. 10 0
      service/src/main/java/com/koobietech/eas/service/EasStuProfileService.java
  23. 17 2
      service/src/main/java/com/koobietech/eas/service/impl/AdminLoginServiceImpl.java
  24. 105 0
      service/src/main/java/com/koobietech/eas/service/impl/EasStuProfileServiceImpl.java

+ 2 - 0
.gitignore

@@ -11,6 +11,8 @@ sys-debug*
 sys-info*
 sys-error*
 
+temp/*
+
 ### STS ###
 .apt_generated
 .classpath

+ 4 - 0
common/pom.xml

@@ -14,6 +14,10 @@
     </parent>
 
     <dependencies>
+        <dependency>
+            <groupId>cn.afterturn</groupId>
+            <artifactId>easypoi-spring-boot-starter</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-data-redis</artifactId>

+ 7 - 0
common/src/main/java/com/koobietech/eas/common/utils/FileManager.java

@@ -0,0 +1,7 @@
+package com.koobietech.eas.common.utils;
+
+public class FileManager {
+//    public boolean saveDocument(XWPFDocument document, String savePath){
+//
+//    }
+}

+ 1 - 1
common/src/main/java/com/koobietech/eas/common/utils/JwtManager.java

@@ -70,7 +70,7 @@ public class JwtManager {
             jwtUserDto.setUsername(verify.getClaim("user").asString());
             jwtUserDto.setType(UserType.valueOf(verify.getClaim("type").asString()));
         } catch ( JWTVerificationException e){
-            //throw new EasException("token 不正确!");
+            throw new EasException("token 不正确!");
         }
         return jwtUserDto;
     }

+ 13 - 12
controller/src/main/java/com/koobietech/eas/controller/AdminLoginController.java

@@ -31,11 +31,24 @@ public class AdminLoginController {
     @Operation(summary = "管理员登录",  description = "用户名和密码为请求载荷,若登录成功,返回两token")
     public JsonResult adminLogin(@RequestBody AdminPojo adminPojo){
 
+        CaptchaVO captchaVO = new CaptchaVO();
+        captchaVO.setCaptchaVerification( adminPojo.getCaptchaVerification() );
+        ResponseModel response = captchaService.verification(captchaVO);
+        if (!response.isSuccess()) {
+            throw new EasException( response.getRepMsg() , Integer.parseInt(response.getRepCode()));
+        }
+
         LoginToken result = adminLoginService.adminLogin(adminPojo);
 
         return JsonResult.data(result);
     }
 
+    @GetMapping("getUserInfo")
+    @Operation(summary = "获取用户信息", description = "根据token获取用户信息")
+    public JsonResult getUserInfo(@RequestHeader("Authorization") String token) {
+        return JsonResult.data(adminLoginService.getUserInfo(token));
+    }
+
     @PostMapping("/refreshToken")
     @Operation(summary = "刷新token", description = "当token过期,在请求头中携带refresh token,若刷新成功,返回新的token和refresh token")
     public JsonResult refreshToken(@RequestHeader("Authorization") String refreshToken) {
@@ -55,16 +68,4 @@ public class AdminLoginController {
         return adminLoginService.verifyToJsonResult(captchaService.check(captchaVO));
     }
 
-    @PostMapping("/verify.judge")
-    @Operation(summary = "二次校验验证码", description = "校验滑动验证码结果,是否匹配上,传参:captchaVerification")
-    public JsonResult verify(@RequestBody CaptchaVO captchaVO) {
-        ResponseModel response = captchaService.verification(captchaVO);
-        if (!response.isSuccess()) {
-            throw new EasException( response.getRepMsg() , Integer.parseInt(response.getRepCode()));
-        }
-        return adminLoginService.verifyToJsonResult(response);
-    }
-
-
-
 }

+ 27 - 0
controller/src/main/java/com/koobietech/eas/controller/EasStuProfileController.java

@@ -0,0 +1,27 @@
+package com.koobietech.eas.controller;
+
+
+import com.koobietech.eas.common.result.JsonResult;
+import com.koobietech.eas.mbg.model.EasArcTlsStudents;
+import com.koobietech.eas.service.EasStuProfileService;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.io.FileNotFoundException;
+
+@RestController
+public class EasStuProfileController {
+
+    @Resource
+    private EasStuProfileService easStuProfileService;
+
+    @RequestMapping("/StuProfileDownload")
+    public JsonResult StuProfileDownload(@RequestBody  EasArcTlsStudents easArcTlsStudents) throws FileNotFoundException {
+
+        return easStuProfileService.StuProfileDownload(easArcTlsStudents);
+    }
+
+
+}

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


BIN
controller/src/main/resources/Temp/kun1.jpeg


BIN
controller/src/main/resources/Temp/~$uRegistTemp.docx


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


+ 5 - 4
controller/src/test/java/com/koobietech/eas/controller/ControllerApplicationTests.java

@@ -16,10 +16,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.test.context.SpringBootTest;
 
 import javax.annotation.Resource;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
+import java.io.*;
 import java.util.*;
 
 
@@ -28,6 +25,10 @@ class ControllerApplicationTests {
 
     @Test
     void contextLoads() throws IOException {
+
+        InputStream wordStream = this.getClass().getClassLoader().getResourceAsStream("\\temp\\StuRegistTemp.docx");
+        System.out.println( wordStream );
+
 //        List<Map> list = new ArrayList<>();
 //        Workbook workbook = null;
 //        ExportParams params = new ExportParams("大数据测试", "测试");

+ 1 - 1
dao/src/main/java/com/koobietech/eas/dao/Pojo/AdminPojo.java

@@ -6,5 +6,5 @@ import lombok.Data;
 public class AdminPojo {
     private String username;
     private String passwd;
-
+    private String captchaVerification;
 }

+ 31 - 0
mbg/src/main/java/com/koobietech/eas/mbg/mapper/EasEduCltRelationMapper.java

@@ -0,0 +1,31 @@
+package com.koobietech.eas.mbg.mapper;
+
+import com.koobietech.eas.mbg.model.EasEduCltRelation;
+import com.koobietech.eas.mbg.model.EasEduCltRelationExample;
+import io.swagger.v3.oas.annotations.media.Schema;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface EasEduCltRelationMapper {
+    long countByExample(EasEduCltRelationExample example);
+
+    int deleteByExample(EasEduCltRelationExample example);
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(EasEduCltRelation record);
+
+    int insertSelective(EasEduCltRelation record);
+
+    List<EasEduCltRelation> selectByExample(EasEduCltRelationExample example);
+
+    EasEduCltRelation selectByPrimaryKey(Integer id);
+
+    int updateByExampleSelective(@Param("record") EasEduCltRelation record, @Param("example") EasEduCltRelationExample example);
+
+    int updateByExample(@Param("record") EasEduCltRelation record, @Param("example") EasEduCltRelationExample example);
+
+    int updateByPrimaryKeySelective(EasEduCltRelation record);
+
+    int updateByPrimaryKey(EasEduCltRelation record);
+}

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

@@ -1,6 +1,9 @@
 package com.koobietech.eas.mbg.model;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.v3.oas.annotations.media.Schema;
+import org.springframework.format.annotation.DateTimeFormat;
+
 import java.io.Serializable;
 import java.util.Date;
 
@@ -51,6 +54,7 @@ public class EasArcTlsStudents implements Serializable {
      * @mbg.generated
      */
     @Schema(description = "学生出生日期")
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date birthdate;
 
     /**
@@ -83,6 +87,7 @@ public class EasArcTlsStudents implements Serializable {
      * @mbg.generated
      */
     @Schema(description = "学生入学进入培训班日期")
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date enrollmentDate;
 
     /**
@@ -91,6 +96,7 @@ public class EasArcTlsStudents implements Serializable {
      * @mbg.generated
      */
     @Schema(description = "学生在培训班毕业日期")
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date graduationDate;
 
     /**

+ 2 - 2
mbg/src/main/java/com/koobietech/eas/mbg/model/EasEduClass.java

@@ -6,11 +6,11 @@ import java.util.Date;
 
 public class EasEduClass implements Serializable {
     /**
-     * 学员ID
+     * 班级ID
      *
      * @mbg.generated
      */
-    @Schema(description = "学员ID")
+    @Schema(description = "班级ID")
     private Long id;
 
     /**

+ 116 - 0
mbg/src/main/java/com/koobietech/eas/mbg/model/EasEduCltRelation.java

@@ -0,0 +1,116 @@
+package com.koobietech.eas.mbg.model;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import java.io.Serializable;
+import java.util.Date;
+
+public class EasEduCltRelation implements Serializable {
+    private Integer id;
+
+    /**
+     * 班级ID
+     *
+     * @mbg.generated
+     */
+    @Schema(description = "班级ID")
+    private Long classId;
+
+    /**
+     * 学员ID
+     *
+     * @mbg.generated
+     */
+    @Schema(description = "学员ID")
+    private Integer studentId;
+
+    /**
+     * 创建时间
+     *
+     * @mbg.generated
+     */
+    @Schema(description = "创建时间")
+    private Date createTime;
+
+    /**
+     * 修改时间
+     *
+     * @mbg.generated
+     */
+    @Schema(description = "修改时间")
+    private Date modifyTime;
+
+    /**
+     * 创建用户ID
+     *
+     * @mbg.generated
+     */
+    @Schema(description = "创建用户ID")
+    private Integer createUid;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Long getClassId() {
+        return classId;
+    }
+
+    public void setClassId(Long classId) {
+        this.classId = classId;
+    }
+
+    public Integer getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Integer studentId) {
+        this.studentId = studentId;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getModifyTime() {
+        return modifyTime;
+    }
+
+    public void setModifyTime(Date modifyTime) {
+        this.modifyTime = modifyTime;
+    }
+
+    public Integer getCreateUid() {
+        return createUid;
+    }
+
+    public void setCreateUid(Integer createUid) {
+        this.createUid = createUid;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", classId=").append(classId);
+        sb.append(", studentId=").append(studentId);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", modifyTime=").append(modifyTime);
+        sb.append(", createUid=").append(createUid);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 560 - 0
mbg/src/main/java/com/koobietech/eas/mbg/model/EasEduCltRelationExample.java

@@ -0,0 +1,560 @@
+package com.koobietech.eas.mbg.model;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class EasEduCltRelationExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    public EasEduCltRelationExample() {
+        oredCriteria = new ArrayList<>();
+    }
+
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(Integer value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(Integer value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(Integer value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(Integer value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(Integer value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<Integer> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<Integer> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(Integer value1, Integer value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(Integer value1, Integer value2) {
+            addCriterion("id not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdIsNull() {
+            addCriterion("class_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdIsNotNull() {
+            addCriterion("class_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdEqualTo(Long value) {
+            addCriterion("class_id =", value, "classId");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdNotEqualTo(Long value) {
+            addCriterion("class_id <>", value, "classId");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdGreaterThan(Long value) {
+            addCriterion("class_id >", value, "classId");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("class_id >=", value, "classId");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdLessThan(Long value) {
+            addCriterion("class_id <", value, "classId");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdLessThanOrEqualTo(Long value) {
+            addCriterion("class_id <=", value, "classId");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdIn(List<Long> values) {
+            addCriterion("class_id in", values, "classId");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdNotIn(List<Long> values) {
+            addCriterion("class_id not in", values, "classId");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdBetween(Long value1, Long value2) {
+            addCriterion("class_id between", value1, value2, "classId");
+            return (Criteria) this;
+        }
+
+        public Criteria andClassIdNotBetween(Long value1, Long value2) {
+            addCriterion("class_id not between", value1, value2, "classId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdIsNull() {
+            addCriterion("student_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdIsNotNull() {
+            addCriterion("student_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdEqualTo(Integer value) {
+            addCriterion("student_id =", value, "studentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdNotEqualTo(Integer value) {
+            addCriterion("student_id <>", value, "studentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdGreaterThan(Integer value) {
+            addCriterion("student_id >", value, "studentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("student_id >=", value, "studentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdLessThan(Integer value) {
+            addCriterion("student_id <", value, "studentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdLessThanOrEqualTo(Integer value) {
+            addCriterion("student_id <=", value, "studentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdIn(List<Integer> values) {
+            addCriterion("student_id in", values, "studentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdNotIn(List<Integer> values) {
+            addCriterion("student_id not in", values, "studentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdBetween(Integer value1, Integer value2) {
+            addCriterion("student_id between", value1, value2, "studentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andStudentIdNotBetween(Integer value1, Integer value2) {
+            addCriterion("student_id not between", value1, value2, "studentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNull() {
+            addCriterion("create_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNotNull() {
+            addCriterion("create_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeEqualTo(Date value) {
+            addCriterion("create_time =", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotEqualTo(Date value) {
+            addCriterion("create_time <>", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThan(Date value) {
+            addCriterion("create_time >", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("create_time >=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThan(Date value) {
+            addCriterion("create_time <", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("create_time <=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIn(List<Date> values) {
+            addCriterion("create_time in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotIn(List<Date> values) {
+            addCriterion("create_time not in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
+            addCriterion("create_time between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("create_time not between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeIsNull() {
+            addCriterion("modify_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeIsNotNull() {
+            addCriterion("modify_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeEqualTo(Date value) {
+            addCriterion("modify_time =", value, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeNotEqualTo(Date value) {
+            addCriterion("modify_time <>", value, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeGreaterThan(Date value) {
+            addCriterion("modify_time >", value, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("modify_time >=", value, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeLessThan(Date value) {
+            addCriterion("modify_time <", value, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeLessThanOrEqualTo(Date value) {
+            addCriterion("modify_time <=", value, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeIn(List<Date> values) {
+            addCriterion("modify_time in", values, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeNotIn(List<Date> values) {
+            addCriterion("modify_time not in", values, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeBetween(Date value1, Date value2) {
+            addCriterion("modify_time between", value1, value2, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andModifyTimeNotBetween(Date value1, Date value2) {
+            addCriterion("modify_time not between", value1, value2, "modifyTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidIsNull() {
+            addCriterion("create_uid is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidIsNotNull() {
+            addCriterion("create_uid is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidEqualTo(Integer value) {
+            addCriterion("create_uid =", value, "createUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidNotEqualTo(Integer value) {
+            addCriterion("create_uid <>", value, "createUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidGreaterThan(Integer value) {
+            addCriterion("create_uid >", value, "createUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidGreaterThanOrEqualTo(Integer value) {
+            addCriterion("create_uid >=", value, "createUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidLessThan(Integer value) {
+            addCriterion("create_uid <", value, "createUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidLessThanOrEqualTo(Integer value) {
+            addCriterion("create_uid <=", value, "createUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidIn(List<Integer> values) {
+            addCriterion("create_uid in", values, "createUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidNotIn(List<Integer> values) {
+            addCriterion("create_uid not in", values, "createUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidBetween(Integer value1, Integer value2) {
+            addCriterion("create_uid between", value1, value2, "createUid");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateUidNotBetween(Integer value1, Integer value2) {
+            addCriterion("create_uid not between", value1, value2, "createUid");
+            return (Criteria) this;
+        }
+    }
+
+    public static class Criteria extends GeneratedCriteria {
+        protected Criteria() {
+            super();
+        }
+    }
+
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 226 - 0
mbg/src/main/resources/com/koobietech/eas/mbg/mapper/EasEduCltRelationMapper.xml

@@ -0,0 +1,226 @@
+<?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.mbg.mapper.EasEduCltRelationMapper">
+  <resultMap id="BaseResultMap" type="com.koobietech.eas.mbg.model.EasEduCltRelation">
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="class_id" jdbcType="BIGINT" property="classId" />
+    <result column="student_id" jdbcType="INTEGER" property="studentId" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
+    <result column="create_uid" jdbcType="INTEGER" property="createUid" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, class_id, student_id, create_time, modify_time, create_uid
+  </sql>
+  <select id="selectByExample" parameterType="com.koobietech.eas.mbg.model.EasEduCltRelationExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from eas_edu_clt_relation
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from eas_edu_clt_relation
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    delete from eas_edu_clt_relation
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.koobietech.eas.mbg.model.EasEduCltRelationExample">
+    delete from eas_edu_clt_relation
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.koobietech.eas.mbg.model.EasEduCltRelation">
+    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
+      SELECT LAST_INSERT_ID()
+    </selectKey>
+    insert into eas_edu_clt_relation (class_id, student_id, create_time, 
+      modify_time, create_uid)
+    values (#{classId,jdbcType=BIGINT}, #{studentId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{modifyTime,jdbcType=TIMESTAMP}, #{createUid,jdbcType=INTEGER})
+  </insert>
+  <insert id="insertSelective" parameterType="com.koobietech.eas.mbg.model.EasEduCltRelation">
+    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
+      SELECT LAST_INSERT_ID()
+    </selectKey>
+    insert into eas_edu_clt_relation
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="classId != null">
+        class_id,
+      </if>
+      <if test="studentId != null">
+        student_id,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="modifyTime != null">
+        modify_time,
+      </if>
+      <if test="createUid != null">
+        create_uid,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="classId != null">
+        #{classId,jdbcType=BIGINT},
+      </if>
+      <if test="studentId != null">
+        #{studentId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifyTime != null">
+        #{modifyTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createUid != null">
+        #{createUid,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.koobietech.eas.mbg.model.EasEduCltRelationExample" resultType="java.lang.Long">
+    select count(*) from eas_edu_clt_relation
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update eas_edu_clt_relation
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=INTEGER},
+      </if>
+      <if test="record.classId != null">
+        class_id = #{record.classId,jdbcType=BIGINT},
+      </if>
+      <if test="record.studentId != null">
+        student_id = #{record.studentId,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.modifyTime != null">
+        modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.createUid != null">
+        create_uid = #{record.createUid,jdbcType=INTEGER},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update eas_edu_clt_relation
+    set id = #{record.id,jdbcType=INTEGER},
+      class_id = #{record.classId,jdbcType=BIGINT},
+      student_id = #{record.studentId,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      modify_time = #{record.modifyTime,jdbcType=TIMESTAMP},
+      create_uid = #{record.createUid,jdbcType=INTEGER}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.koobietech.eas.mbg.model.EasEduCltRelation">
+    update eas_edu_clt_relation
+    <set>
+      <if test="classId != null">
+        class_id = #{classId,jdbcType=BIGINT},
+      </if>
+      <if test="studentId != null">
+        student_id = #{studentId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifyTime != null">
+        modify_time = #{modifyTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createUid != null">
+        create_uid = #{createUid,jdbcType=INTEGER},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.koobietech.eas.mbg.model.EasEduCltRelation">
+    update eas_edu_clt_relation
+    set class_id = #{classId,jdbcType=BIGINT},
+      student_id = #{studentId,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      modify_time = #{modifyTime,jdbcType=TIMESTAMP},
+      create_uid = #{createUid,jdbcType=INTEGER}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+</mapper>

+ 29 - 24
security/src/main/java/com/koobietech/eas/security/filter/EasSecurityFilter.java

@@ -1,5 +1,6 @@
 package com.koobietech.eas.security.filter;
 
+import com.koobietech.eas.common.exception.EasException;
 import com.koobietech.eas.common.pojo.JwtUserDto;
 import com.koobietech.eas.common.utils.JwtManager;
 import com.koobietech.eas.dao.adminLoginPojo.Permission;
@@ -38,39 +39,43 @@ public class EasSecurityFilter extends OncePerRequestFilter {
         //从请求里面拿到token
         String token = request.getHeader("Authorization");
         //判断token是否存在
-        if (StringUtils.hasText(token) && false) {
+        if (StringUtils.hasText(token)) {
             //解析token成JwtUserDto
-            JwtUserDto jwtUserDto = jwtManager.decodeJwt(token);
-            //判断token是否有效
-            UserDetail userDetail = loginRedisService.checkToken(jwtUserDto);
+            JwtUserDto jwtUserDto = null;
+            try {
+                //过滤器 允许 Token 不正确, 后面Security 会拦截处理
+                jwtUserDto = jwtManager.decodeJwt(token);
+            } catch ( EasException e) {}
+            if ( Objects.nonNull(jwtUserDto) ) {
+                //判断token是否有效
+                UserDetail userDetail = loginRedisService.checkToken(jwtUserDto);
 
-            // 获取当前的 SecurityContext 对象,用于保存当前用户的安全上下文信息
-            SecurityContext context = SecurityContextHolder.getContext();
+                // 获取当前的 SecurityContext 对象,用于保存当前用户的安全上下文信息
+                SecurityContext context = SecurityContextHolder.getContext();
 
-            if (Objects.nonNull(userDetail)) {
-                // 如果获取到了有效的用户对象
+                if (Objects.nonNull(userDetail)) {
+                    // 如果获取到了有效的用户对象
 
-                // 获取用户的权限列表
-                List<Permission> permission = userDetail.getPermissions();
+                    // 获取用户的权限列表
+                    List<Permission> permission = userDetail.getPermissions();
 
-                // 创建一个 ArrayList 集合,用于存储用户权限对应的 SimpleGrantedAuthority 权限对象
-                ArrayList<SimpleGrantedAuthority> objects = new ArrayList<>();
+                    // 创建一个 ArrayList 集合,用于存储用户权限对应的 SimpleGrantedAuthority 权限对象
+                    ArrayList<SimpleGrantedAuthority> objects = new ArrayList<>();
 
-                // 遍历用户的权限列表
-                for (Permission adminPermission : permission) {
-                    // 创建一个 SimpleGrantedAuthority 权限对象,并添加到集合中
-                    SimpleGrantedAuthority authority = new SimpleGrantedAuthority(adminPermission.getDescription());
-                    objects.add(authority);
-                }
+                    // 遍历用户的权限列表
+                    for (Permission adminPermission : permission) {
+                        // 创建一个 SimpleGrantedAuthority 权限对象,并添加到集合中
+                        SimpleGrantedAuthority authority = new SimpleGrantedAuthority(adminPermission.getDescription());
+                        objects.add(authority);
+                    }
 
-                // 使用用户的用户名、空凭证参数和权限对象集合创建一个 UsernamePasswordAuthenticationToken 身份验证令牌
-                UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(userDetail.getUsername(), null, objects);
+                    // 使用用户的用户名、空凭证参数和权限对象集合创建一个 UsernamePasswordAuthenticationToken 身份验证令牌
+                    UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(userDetail.getUsername(), null, objects);
 
-                // 将身份验证令牌设置到当前的 SecurityContext 中
-                context.setAuthentication(authenticationToken);
+                    // 将身份验证令牌设置到当前的 SecurityContext 中
+                    context.setAuthentication(authenticationToken);
+                }
             }
-            //放行
-            filterChain.doFilter(request, response);
         }
         filterChain.doFilter(request, response);
     }

+ 4 - 0
service/pom.xml

@@ -8,6 +8,10 @@
     <description>service</description>
 
     <dependencies>
+        <dependency>
+            <groupId>cn.afterturn</groupId>
+            <artifactId>easypoi-spring-boot-starter</artifactId>
+        </dependency>
         <dependency>
             <groupId>com.github.pagehelper</groupId>
             <artifactId>pagehelper-spring-boot-starter</artifactId>

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

@@ -15,4 +15,5 @@ public interface AdminLoginService {
     JsonResult verifyToJsonResult(ResponseModel responseModel);
 
 
+    UserDetail getUserInfo(String token);
 }

+ 10 - 0
service/src/main/java/com/koobietech/eas/service/EasStuProfileService.java

@@ -0,0 +1,10 @@
+package com.koobietech.eas.service;
+
+import com.koobietech.eas.common.result.JsonResult;
+import com.koobietech.eas.mbg.model.EasArcTlsStudents;
+
+import java.io.FileNotFoundException;
+
+public interface EasStuProfileService {
+    JsonResult StuProfileDownload(EasArcTlsStudents easArcTlsStudents) throws FileNotFoundException;
+}

+ 17 - 2
service/src/main/java/com/koobietech/eas/service/impl/AdminLoginServiceImpl.java

@@ -41,8 +41,8 @@ public class AdminLoginServiceImpl implements AdminLoginService {
     private JwtManager jwtManager;
 
     // token过期时间 单位:s
-    private final Integer token_expires = 30;
-    private final Integer refreshToken_expires = 60;
+    private final Integer token_expires = 60*3;
+    private final Integer refreshToken_expires = 60*7;
 
     @Override
     public LoginToken adminLogin(AdminPojo adminPojo) {
@@ -73,6 +73,8 @@ public class AdminLoginServiceImpl implements AdminLoginService {
             JwtUserDto jwtUserDto = new JwtUserDto(userDetailInRedis.getUsername(), userDetailInRedis.getId(), userType);
             String token = jwtManager.createJwt(jwtUserDto, token_expires);
             String refreshToken = jwtManager.createJwt(jwtUserDto, refreshToken_expires);
+            System.out.println("token:" + token);
+            System.out.println("refreshToken:" + refreshToken);
 
             // 生成redis key
             String redisTokenKey = loginRedisService.createJwtTokenKey(jwtUserDto);
@@ -130,6 +132,19 @@ public class AdminLoginServiceImpl implements AdminLoginService {
         return result;
     }
 
+    @Override
+    public UserDetail getUserInfo(String token) {
+
+        try {
+            // 解析token
+            JwtUserDto jwtUserDto = jwtManager.decodeJwt(token);
+            // 封装成字符以便在redis中查找
+            String tokenToRedisKey = loginRedisService.createJwtTokenKey(jwtUserDto);
+            return loginRedisService.loginGetCache(tokenToRedisKey);
+        } catch (Exception e) {
+            // 处理异常情况
+            throw new EasException("Token获取用户信息失败", e);
+        }}
 
 
     private EasSysUserinfo findAdminByUsername(String username, String password)  {

+ 105 - 0
service/src/main/java/com/koobietech/eas/service/impl/EasStuProfileServiceImpl.java

@@ -0,0 +1,105 @@
+package com.koobietech.eas.service.impl;
+
+import com.koobietech.eas.common.result.JsonResult;
+import com.koobietech.eas.mbg.model.EasArcTlsStudents;
+import com.koobietech.eas.service.EasStuProfileService;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.xwpf.usermodel.XWPFDocument;
+import org.apache.poi.xwpf.usermodel.XWPFTable;
+import org.apache.poi.xwpf.usermodel.XWPFTableCell;
+import org.apache.poi.xwpf.usermodel.XWPFTableRow;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import java.io.*;
+import java.util.*;
+
+@Service
+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/kun1.jpeg";
+    private static final String OUTPUT_PATH = "D:\\myDesk\\test.docx";
+
+    @Override
+    public JsonResult StuProfileDownload(EasArcTlsStudents easArcTlsStudents) {
+        LOGGER.info("开始学员档案导出:{}", easArcTlsStudents);
+
+        try (InputStream wordStream = getClass().getClassLoader().getResourceAsStream(TEMPLATE_PATH)) {
+            assert wordStream != null;
+            XWPFDocument doc = new XWPFDocument(wordStream);
+
+            Map<String, Object> map = new HashMap<>();
+            map.put("student_name", easArcTlsStudents.getStudentName());
+            map.put("gender", easArcTlsStudents.getGender());
+            map.put("major", easArcTlsStudents.getMajor());
+            map.put("grade", easArcTlsStudents.getGrade());
+            map.put("enrollment_date", easArcTlsStudents.getEnrollmentDate());
+            map.put("phone", easArcTlsStudents.getPhone());
+            map.put("university", easArcTlsStudents.getUniversity());
+
+            InputStream photo = getClass().getClassLoader().getResourceAsStream(PHOTO_PATH);
+            map.put("avatar", photo);
+
+            replacePlaceholders(doc, map);
+
+            saveDocument(doc);
+        } catch (IOException e) {
+            LOGGER.error("学员档案导出失败:{}", e.getMessage(), e);
+            return JsonResult.fail("学员档案导出失败!");
+        }
+
+        LOGGER.info("学员档案导出成功!");
+        return JsonResult.ok("学员档案导出成功!");
+    }
+
+    private void replacePlaceholders(XWPFDocument document, Map<String, Object> map) {
+        Iterator<XWPFTable> it = document.getTablesIterator();
+
+        while (it.hasNext()) {
+            XWPFTable table = it.next();
+            int rcount = table.getNumberOfRows();
+            for (int n = 0; n < rcount; n++) {
+                XWPFTableRow wrow = table.getRow(n);
+                List<XWPFTableCell> cells = wrow.getTableCells();
+                for (XWPFTableCell cell : cells) {
+                    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", 400000, 400000);
+                                } else {
+                                    cell.setText(cellText.replace(placeholder, value.toString()));
+                                }
+                            } catch (IOException | InvalidFormatException e) {
+                                throw new RuntimeException(e);
+                            }
+                        }
+                    });
+                }
+            }
+        }
+    }
+
+    private void saveDocument(XWPFDocument document) throws IOException {
+        try (FileOutputStream outputStream = new FileOutputStream(OUTPUT_PATH)) {
+            document.write(outputStream);
+        }
+    }
+
+
+}