Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	yudao-module-as/yudao-module-as-biz/pom.xml
#	yudao-module-bpm/yudao-module-bpm-biz/pom.xml
#	yudao-module-system/yudao-module-system-biz/pom.xml
平常心 6 months ago
parent
commit
b191771d06
17 changed files with 950 additions and 82 deletions
  1. 5 0
      yudao-module-as/yudao-module-as-api/src/main/java/cn/iocoder/yudao/module/as/enums/ErrorCodeConstants.java
  2. 1 81
      yudao-module-as/yudao-module-as-biz/pom.xml
  3. 10 1
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentscollegemanage/AidingStudentsCollegeManageController.java
  4. 122 0
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentsimportlist/AidingStudentsImportListController.java
  5. 23 0
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentsimportlist/vo/AidingStudentsImportExcelRespVO.java
  6. 51 0
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentsimportlist/vo/AidingStudentsImportExcelVO.java
  7. 51 0
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentsimportlist/vo/AidingStudentsImportListPageResqVO.java
  8. 48 0
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentsimportlist/vo/AidingStudentsImportListRespVO.java
  9. 48 0
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentsimportlist/vo/AidingStudentsImportListSaveReqVO.java
  10. 71 0
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/dal/dataobject/aidingstudentsimportlist/AidingStudentsImportExcelListDO.java
  11. 25 0
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/dal/mysql/aidingstudentsimportlist/AidingStudentsImportListMapper.java
  12. 5 0
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/dal/redis/RedisKeyConstants.java
  13. 111 0
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/dal/redis/aidingstudentsimportlist/AidingStudentsImportListRedisDAO.java
  14. 1 0
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/service/aidingstudentscollegemanage/AidingStudentsCollegeManageService.java
  15. 32 0
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/service/aidingstudentscollegemanage/AidingStudentsCollegeManageServiceImpl.java
  16. 60 0
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/service/aidingstudentsimportlist/AidingStudentsImportListService.java
  17. 286 0
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/service/aidingstudentsimportlist/AidingStudentsImportListServiceImpl.java

+ 5 - 0
yudao-module-as/yudao-module-as-api/src/main/java/cn/iocoder/yudao/module/as/enums/ErrorCodeConstants.java

@@ -10,5 +10,10 @@ public interface ErrorCodeConstants {
     ErrorCode AIDING_STUDENTS_COLLEGE_MANAGE_NOT_EXISTS = new ErrorCode(2_009_000_002, "综测项目学院管理不存在");
     ErrorCode FINANCIAL_AID_MANAGE_NOT_EXISTS = new ErrorCode(2_009_000_003, "助学金项目管理不存在");
     ErrorCode FINANCIAL_AID_COLLEGE_MANAGE_NOT_EXISTS = new ErrorCode(2_009_000_004,  "助学金评定项目学院管理不存在");
+    ErrorCode AIDING_STUDENTS_IMPORT_LIST_NOT_EXISTS = new ErrorCode(2_009_000_005,  "自治区名单中该学生不存在");
+    ErrorCode AIDING_STUDENTS_IMPORT_LIST_IS_NULL = new ErrorCode(2_009_000_006,  "excel表解析为空");
+    ErrorCode AIDING_STUDENTS_IMPORT_LIST_STUDENT_EXISTS = new ErrorCode(2_009_000_007,  "自治区名单中该学生已存在");
+    ErrorCode AIDING_STUDENTS_IMPORT_LIST_STUDENT_CODE_NOT_EXISTS = new ErrorCode(2_009_000_008,  "系统中不存在该学生学号");
+
 
 }

+ 1 - 81
yudao-module-as/yudao-module-as-biz/pom.xml

@@ -55,93 +55,13 @@
             <artifactId>yudao-spring-boot-starter-excel</artifactId>
         </dependency>
 
-        <!-- JSON-util -->
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>fastjson</artifactId>
-            <version>1.2.72</version>
-        </dependency>
-
-        <!-- framework(主要根据模板引擎导出word使用)  -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-freemarker</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>cn.afterturn</groupId>
-            <artifactId>easypoi-spring-boot-starter</artifactId>
-            <version>4.1.0</version>
-        </dependency>
-
-        <!--word 转 ptf -->
-        <dependency>
-            <groupId>org.apache.pdfbox</groupId>
-            <artifactId>pdfbox</artifactId>
-            <version>2.0.24</version> <!-- 版本号可以根据实际情况调整 -->
-        </dependency>
-        <dependency>
-            <groupId>com.itextpdf</groupId>
-            <artifactId>itextpdf</artifactId>
-            <version>5.5.13.1</version> <!-- Use the appropriate version -->
-        </dependency>
-
-        <!-- https://mvnrepository.com/artifact/org.apache.pdfbox/fontbox -->
-        <!--word转pdf-->
-        <dependency>
-            <groupId>com.documents4j</groupId>
-            <artifactId>documents4j-local</artifactId>
-            <version>1.1.12</version>
-        </dependency>
-        <dependency>
-            <groupId>com.documents4j</groupId>
-            <artifactId>documents4j-transformer-msoffice-word</artifactId>
-            <version>1.1.12</version>
-        </dependency>
-
-        <!-- https://mvnrepository.com/artifact/org.apache.pdfbox/pdfbox -->
-        <!-- pdf转图片和图片转pdf-->
-        <dependency>
-            <groupId>org.apache.pdfbox</groupId>
-            <artifactId>pdfbox</artifactId>
-            <version>2.0.29</version>
-        </dependency>
-
-        <!-- file 转 MultipartFile-->
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-test</artifactId>
-        </dependency>
-
-        <!--minio -->
-        <dependency>
-            <groupId>io.minio</groupId>
-            <artifactId>minio</artifactId>
-            <version>8.4.3</version>
-        </dependency>
-
-        <!-- 处理旧版本doc -->
-        <dependency>
-            <groupId>org.apache.poi</groupId>
-            <artifactId>poi-scratchpad</artifactId>
-            <version>4.1.2</version> <!-- 版本号可以根据实际情况调整 -->
-        </dependency>
-
-        <!--        xmlDoc转docx-->
-        <dependency>
-            <groupId>org.docx4j</groupId>
-            <artifactId>docx4j</artifactId>
-            <version>3.2.1</version>
-        </dependency>
-
+        <!--biz模块依赖-->
         <dependency>
             <groupId>cn.iocoder.boot</groupId>
             <artifactId>yudao-module-system-biz</artifactId>
             <version>2.1.0-jdk8-snapshot</version>
             <scope>compile</scope>
         </dependency>
-
-
-
     </dependencies>
 
 </project>

+ 10 - 1
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentscollegemanage/AidingStudentsCollegeManageController.java

@@ -65,12 +65,21 @@ public class AidingStudentsCollegeManageController {
     @GetMapping("/get")
     @Operation(summary = "获得家庭困难认定项目学院管理")
     @Parameter(name = "id", description = "编号", required = true, example = "1024")
-    @PreAuthorize("@ss.hasPermission('as:aiding-students-college-manage:query')")
+    @PreAuthorize("@ss.hasPermission('as:aiding-students-college-manage:get')")
     public CommonResult<AidingStudentsCollegeManageRespVO> getAidingStudentsCollegeManage(@RequestParam("id") Long id) {
         AidingStudentsCollegeManageDO aidingStudentsCollegeManage = aidingStudentsCollegeManageService.getAidingStudentsCollegeManage(id);
         return success(BeanUtils.toBean(aidingStudentsCollegeManage, AidingStudentsCollegeManageRespVO.class));
     }
 
+    @GetMapping("/getCount")
+    @Operation(summary = "获得家庭困难认定项目学院管理各个状态人数")
+    @PreAuthorize("@ss.hasPermission('as:aiding-students-college-manage:get-count')")
+    public CommonResult<Map<String, Long>> getAidingStudentsCollegeManageCount() {
+        Map<String, Long> map = aidingStudentsCollegeManageService.getAidingStudentsCollegeManageCount();
+        return success(map);
+    }
+
+
     @GetMapping("/page")
     @Operation(summary = "获得家庭困难认定项目学院管理分页")
     @PreAuthorize("@ss.hasPermission('as:aiding-students-college-manage:query')")

+ 122 - 0
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentsimportlist/AidingStudentsImportListController.java

@@ -0,0 +1,122 @@
+package cn.iocoder.yudao.module.as.controller.admin.aidingstudentsimportlist;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.as.controller.admin.aidingstudentsimportlist.vo.*;
+import cn.iocoder.yudao.module.as.dal.dataobject.aidingstudentsimportlist.AidingStudentsImportExcelListDO;
+import cn.iocoder.yudao.module.as.service.aidingstudentsimportlist.AidingStudentsImportListService;
+import io.swagger.v3.oas.annotations.Parameters;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.*;
+import java.util.*;
+
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+
+import org.springframework.web.multipart.MultipartFile;
+
+@Tag(name = "管理后台 - 贫困学生自治区名单导入")
+@RestController
+@RequestMapping("/as/aiding-students-import-list")
+@Validated
+public class AidingStudentsImportListController {
+
+    @Resource
+    private AidingStudentsImportListService aidingStudentsImportListService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建贫困学生自治区名单导入")
+    @PreAuthorize("@ss.hasPermission('as:aiding-students-import-list:create')")
+    public CommonResult<Long> createAidingStudentsImportList(@Valid @RequestBody AidingStudentsImportListSaveReqVO createReqVO,
+                                                             @RequestParam(value = "aidingStudentsManageId") Long aidingStudentsManageId) {
+        return success(aidingStudentsImportListService.createAidingStudentsImportList(createReqVO, aidingStudentsManageId));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新贫困学生自治区名单导入管理")
+    @PreAuthorize("@ss.hasPermission('as:aiding-students-import-list:update')")
+    public CommonResult<Boolean> updateAidingStudentsImportList(@Valid @RequestBody AidingStudentsImportListSaveReqVO updateReqVO) {
+        aidingStudentsImportListService.updateAidingStudentsImportList(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除贫困学生自治区名单导入管理")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('as:aiding-students-import-list:delete')")
+    public CommonResult<Boolean> deleteAidingStudentsImportList(@RequestParam("id") Long id) {
+        aidingStudentsImportListService.deleteAidingStudentsImportList(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "通过id获得贫困学生自治区名单导入中的学生")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('as:aiding-students-import-list:query')")
+    public CommonResult<AidingStudentsImportListRespVO> getAidingStudentsImportList(@RequestParam("id") Long id) {
+        AidingStudentsImportExcelListDO aidingStudentsImportList = aidingStudentsImportListService.getAidingStudentsImportList(id);
+        return success(BeanUtils.toBean(aidingStudentsImportList, AidingStudentsImportListRespVO.class));
+    }
+
+
+    @GetMapping("/page")
+    @Operation(summary = "获得贫困学生自治区名单导入管理分页")
+    @PreAuthorize("@ss.hasPermission('as:aiding-students-import-list:query')")
+    public CommonResult<PageResult<AidingStudentsImportListRespVO>> getAidingStudentsCollegeManagePage(@Valid AidingStudentsImportListPageResqVO pageReqVO) {
+        PageResult<AidingStudentsImportExcelListDO> pageResult =
+                aidingStudentsImportListService.getAidingStudentsImportListPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, AidingStudentsImportListRespVO.class));
+    }
+
+    @PostMapping("/import-excel")
+    @Operation(summary = "导入家庭情况困难认定学生 把Excel从redis导入到到mysql中")
+    @Parameters({
+            @Parameter(name = "aidingStudentsManageId", description = "助学学校项目id", example = "5")
+    })
+    @PreAuthorize("@ss.hasPermission('as:aiding-students-import-list:import')")
+    public CommonResult<AidingStudentsImportExcelRespVO> importExcel(@RequestParam(value = "aidingStudentsManageId", required = true) Long aidingStudentsManageId,
+    @RequestParam(value = "redisUUID") String redisUUID)throws Exception {
+        return success(aidingStudentsImportListService.aidingStudentsImportExcelList( aidingStudentsManageId,redisUUID));
+    }
+
+
+    @PostMapping("/import-excel-to-redis")
+    @Operation(summary = "导入家庭情况困难认定学生 Excel到redis中")
+    @PreAuthorize("@ss.hasPermission('as:aiding-students-import-list:importtoredis')")
+    public CommonResult<String> importExcelToRedis(@RequestParam("file") MultipartFile file) throws Exception {
+        List<AidingStudentsImportExcelVO> list = ExcelUtils.read(file, AidingStudentsImportExcelVO.class);
+        String redisUUID = aidingStudentsImportListService.aidingStudentsImportExcelToRedis(list);
+        return success(redisUUID);
+    }
+
+
+
+    @PostMapping("/reimport-excel")
+    @Operation(summary = "重复导入家庭情况困难认定excel")
+    @Parameters({
+            @Parameter(name = "aidingStudentsManageId", description = "助学学校项目id", example = "5"),
+            @Parameter(name = "file", description = "Excel文件", required = true),
+            @Parameter(name ="strategyId", description = "导入策略id", example = "1表示覆盖,2表示保持不变")
+    })
+    @PreAuthorize("@ss.hasPermission('as:aiding-students-import-list:reimport')")
+    public CommonResult<Boolean> reImportExcel(@RequestParam(value = "aidingStudentsManageId", required = true) Long aidingStudentsManageId,
+                                                                       @RequestParam("file") MultipartFile file,
+                                                                       @RequestParam("strategyId") Integer strategyId) throws Exception {
+        List<AidingStudentsImportExcelVO> list = ExcelUtils.read(file, AidingStudentsImportExcelVO.class);
+        aidingStudentsImportListService.aidingStudentsImportExcelReImport(list, aidingStudentsManageId, strategyId);
+        return success(true);
+    }
+
+}

+ 23 - 0
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentsimportlist/vo/AidingStudentsImportExcelRespVO.java

@@ -0,0 +1,23 @@
+package cn.iocoder.yudao.module.as.controller.admin.aidingstudentsimportlist.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Builder;
+import lombok.Data;
+
+import java.util.List;
+import java.util.Map;
+
+
+@Schema(description = "管理后台 - 贫困学生自治区名单导入 Response VO")
+@Data
+@Builder
+public class AidingStudentsImportExcelRespVO {
+    @Schema(description = "创建成功的学生名数组", requiredMode = Schema.RequiredMode.REQUIRED)
+    private List<String> createStudentNames;
+
+/*    @Schema(description = "更新成功的学生名数组", requiredMode = Schema.RequiredMode.REQUIRED)
+    private List<String> updateStudentNames;*/
+
+    @Schema(description = "导入失败的学生集合,key 为用户名,value 为失败原因", requiredMode = Schema.RequiredMode.REQUIRED)
+    private Map<String, String> failureStudentNames;
+}

+ 51 - 0
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentsimportlist/vo/AidingStudentsImportExcelVO.java

@@ -0,0 +1,51 @@
+package cn.iocoder.yudao.module.as.controller.admin.aidingstudentsimportlist.vo;
+
+import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
+import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
+import cn.iocoder.yudao.module.system.enums.DictTypeConstants;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+import org.hibernate.validator.constraints.Length;
+
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+@Accessors(chain = false) // 设置 chain = false,避免贫困学生导入有问题
+public class AidingStudentsImportExcelVO {
+    @Schema(description = "姓名")
+    @ExcelProperty("姓名")
+    private String studentName;
+
+    @Schema(description = "学号")
+    @ExcelProperty("学号")
+    private String studentCode;
+
+    @Schema(description = "性别,1表示男,2表示女,3表示未知")
+    @ExcelProperty(value = "性别", converter = DictConvert.class)
+    @DictFormat(DictTypeConstants.USER_SEX)
+    private Integer studentSex;
+
+    @Schema(description = "年龄")
+    @ExcelProperty("年龄")
+    private Integer studentAge;
+
+    @Schema(description = "身份证号")
+    @ExcelProperty("身份证号")
+    private String studentIdNumber;
+
+    @Schema(description = "家庭地址")
+    @ExcelProperty("家庭地址")
+    private String studentAddress;
+
+    @Schema(description = "类型")
+    @ExcelProperty("类型")
+    private String studentType;
+
+
+}

+ 51 - 0
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentsimportlist/vo/AidingStudentsImportListPageResqVO.java

@@ -0,0 +1,51 @@
+package cn.iocoder.yudao.module.as.controller.admin.aidingstudentsimportlist.vo;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+@Schema(description = "管理后台 - 贫困学生自治区名单导入分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class AidingStudentsImportListPageResqVO extends PageParam {
+
+
+    @Schema(description = "姓名")
+    private String studentName;
+
+
+    @Schema(description = "学号")
+    private String studentCode;
+
+
+    @Schema(description = "性别,1表示男,2表示女,3表示未知")
+    private Integer studentSex;
+
+
+
+    @Schema(description = "年龄")
+    private Integer studentAge;
+
+
+    @Schema(description = "身份证号")
+    private String studentIdNumber;
+
+
+    @Schema(description = "家庭地址")
+    private String studentAddress;
+
+
+    @Schema(description = "类型")
+    private String studentType;
+
+    @Schema(description = "助学学校项目id")
+    private Long asAidingStudentsManageId;
+
+    @Schema(description = "学院id")
+    private Long collegeId;
+
+
+}

+ 48 - 0
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentsimportlist/vo/AidingStudentsImportListRespVO.java

@@ -0,0 +1,48 @@
+package cn.iocoder.yudao.module.as.controller.admin.aidingstudentsimportlist.vo;
+
+
+import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
+import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
+import cn.iocoder.yudao.module.system.enums.DictTypeConstants;
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 贫困学生自治区名单导入 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class AidingStudentsImportListRespVO {
+    @Schema(description = "id")
+    private Long id;
+
+
+    @Schema(description = "姓名")
+    private String studentName;
+
+
+    @Schema(description = "学号")
+    private String studentCode;
+
+
+    @Schema(description = "性别,1表示男,2表示女,3表示未知")
+    private Integer studentSex;
+
+
+
+    @Schema(description = "年龄")
+    private Integer studentAge;
+
+
+    @Schema(description = "身份证号")
+    private String studentIdNumber;
+
+
+    @Schema(description = "家庭地址")
+    private String studentAddress;
+
+
+    @Schema(description = "类型")
+    private String studentType;
+
+}

+ 48 - 0
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentsimportlist/vo/AidingStudentsImportListSaveReqVO.java

@@ -0,0 +1,48 @@
+package cn.iocoder.yudao.module.as.controller.admin.aidingstudentsimportlist.vo;
+
+import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
+import cn.iocoder.yudao.module.system.enums.DictTypeConstants;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import org.hibernate.validator.constraints.Length;
+
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotBlank;
+
+@Schema(description = "管理后台 - 贫困学生自治区名单导入新增/修改 Request VO")
+@Data
+public class AidingStudentsImportListSaveReqVO {
+    @Schema(description = "id", example = "2482")
+    private Long id;
+
+    @Schema(description = "姓名")
+    @NotBlank(message = "姓名不能为空")
+    private String studentName;
+
+
+    @Schema(description = "学号")
+    @NotBlank(message = "学号不能为空")
+    @Length(min = 1, max = 30, message = "学号长度需在1到=30个字符之间")
+    private String studentCode;
+
+
+    @Schema(description = "性别,1表示男,2表示女,3表示未知")
+    private Integer studentSex;
+
+    @Min(value = 1, message = "年龄必须大于0")
+    @Max(value = 150, message = "年龄不能超过150岁")
+    @Schema(description = "年龄")
+    private Integer studentAge;
+
+
+    @Schema(description = "身份证号")
+    @Length(min = 18, max = 18, message = "身份证号长度必须 18 位")
+    private String studentIdNumber;
+
+    @Schema(description = "家庭地址")
+    private String studentAddress;
+
+    @Schema(description = "类型")
+    private String studentType;
+}

+ 71 - 0
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/dal/dataobject/aidingstudentsimportlist/AidingStudentsImportExcelListDO.java

@@ -0,0 +1,71 @@
+package cn.iocoder.yudao.module.as.dal.dataobject.aidingstudentsimportlist;
+
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+@TableName("as_aiding_students_import_list")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class AidingStudentsImportExcelListDO extends BaseDO {
+    /**
+     * id
+     */
+    @TableId
+    private Long id;
+
+    /**
+     * 助学项目管理ID,外键
+     */
+    private Long asAidingStudentsManageId;
+
+
+    /**
+     * 学院id
+     */
+    private Long collegeId;
+
+    /**
+     * 学生姓名
+     */
+    private String studentName;
+
+    /**
+     * 学号
+     */
+    private String studentCode;
+
+    /**
+     * 学生性别
+     * 枚举类 男生为1,女生为2,未知为3
+     */
+    private Integer studentSex;
+
+    /**
+     * 学生年龄
+     */
+    private Integer studentAge;
+
+    /**
+     * 学生身份证号
+     */
+    private String studentIdNumber;
+
+    /**
+     * 学生住址
+     */
+    private String studentAddress;
+
+    /**
+     * 贫困类型,如:建档立卡
+     */
+    private String studentType;
+
+
+
+}

+ 25 - 0
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/dal/mysql/aidingstudentsimportlist/AidingStudentsImportListMapper.java

@@ -0,0 +1,25 @@
+package cn.iocoder.yudao.module.as.dal.mysql.aidingstudentsimportlist;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.as.controller.admin.aidingstudentsimportlist.vo.AidingStudentsImportListPageResqVO;
+import cn.iocoder.yudao.module.as.dal.dataobject.aidingstudentsimportlist.AidingStudentsImportExcelListDO;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface AidingStudentsImportListMapper extends BaseMapperX<AidingStudentsImportExcelListDO> {
+    default PageResult<AidingStudentsImportExcelListDO> selectPage(AidingStudentsImportListPageResqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<AidingStudentsImportExcelListDO>()
+                .eqIfPresent(AidingStudentsImportExcelListDO::getCollegeId, reqVO.getCollegeId())
+                .eqIfPresent(AidingStudentsImportExcelListDO::getAsAidingStudentsManageId, reqVO.getAsAidingStudentsManageId())
+                .eqIfPresent(AidingStudentsImportExcelListDO::getStudentName, reqVO.getStudentName())
+                .eqIfPresent(AidingStudentsImportExcelListDO::getStudentSex, reqVO.getStudentSex())
+                .eqIfPresent(AidingStudentsImportExcelListDO::getStudentAge, reqVO.getStudentAge())
+                .eqIfPresent(AidingStudentsImportExcelListDO::getStudentCode, reqVO.getStudentCode())
+                .eqIfPresent(AidingStudentsImportExcelListDO::getStudentIdNumber, reqVO.getStudentIdNumber())
+                .likeIfPresent(AidingStudentsImportExcelListDO::getStudentAddress, reqVO.getStudentAddress())
+                .eqIfPresent(AidingStudentsImportExcelListDO::getStudentType, reqVO.getStudentType())
+                .orderByDesc(AidingStudentsImportExcelListDO::getId));
+    }
+}

+ 5 - 0
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/dal/redis/RedisKeyConstants.java

@@ -0,0 +1,5 @@
+package cn.iocoder.yudao.module.as.dal.redis;
+
+public interface RedisKeyConstants {
+    String AIDING_STUDENTS_IMPORT_LIST_KEY = "aiding_students_import_list:%s:%s";
+}

+ 111 - 0
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/dal/redis/aidingstudentsimportlist/AidingStudentsImportListRedisDAO.java

@@ -0,0 +1,111 @@
+package cn.iocoder.yudao.module.as.dal.redis.aidingstudentsimportlist;
+
+import cn.hutool.core.date.LocalDateTimeUtil;
+import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
+import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
+import cn.iocoder.yudao.module.as.dal.dataobject.aidingstudentsimportlist.AidingStudentsImportExcelListDO;
+import org.springframework.data.redis.core.Cursor;
+import org.springframework.data.redis.core.RedisCallback;
+import org.springframework.data.redis.core.ScanOptions;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.nio.charset.StandardCharsets;
+import java.time.LocalDateTime;
+import java.time.temporal.ChronoUnit;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Objects;
+import java.util.concurrent.TimeUnit;
+
+import static cn.iocoder.yudao.module.as.dal.redis.RedisKeyConstants.AIDING_STUDENTS_IMPORT_LIST_KEY;
+@Component
+public class AidingStudentsImportListRedisDAO {
+    @Resource
+    private StringRedisTemplate stringRedisTemplate;
+
+
+    public AidingStudentsImportExcelListDO get(String uniId,String studentCode) {
+        String redisKey = formatKey(uniId,studentCode);
+        return JsonUtils.parseObject(stringRedisTemplate.opsForValue().get(redisKey), AidingStudentsImportExcelListDO.class);
+    }
+
+
+
+
+
+    //找到redis中对应的内容
+    public List<AidingStudentsImportExcelListDO> getAllMatchingValues(String redisUUID) {
+        // 替换 %s 为实际的 redisUUID
+        String pattern = String.format("aiding_students_import_list:%s:*", redisUUID);
+
+        // 使用SCAN命令遍历匹配的键,ScanOptions.NONE表示使用默认配置
+        ScanOptions scanOptions = ScanOptions.scanOptions().match(pattern).build();
+
+        // 结果容器,用于收集所有匹配键对应的值
+        List<String> values = new ArrayList<>();
+        List<String> keys = new ArrayList<>();
+        List<AidingStudentsImportExcelListDO> result = new ArrayList<>();
+
+        // 执行 SCAN 命令并处理结果
+        stringRedisTemplate.execute((RedisCallback<Object>) connection -> {
+            Cursor<byte[]> cursor = connection.scan(scanOptions);
+            while (cursor.hasNext()) {
+                byte[] keyBytes = cursor.next();
+                String key = new String(keyBytes, StandardCharsets.UTF_8);
+                // 获取每个键对应的值
+                String value = stringRedisTemplate.opsForValue().get(key);
+                if (value != null) {
+                    values.add(value);
+                    keys.add(key);
+                }
+            }
+            cursor.close();
+            for (String value : values) {
+                result.add(JsonUtils.parseObject(value, AidingStudentsImportExcelListDO.class));
+            }
+            for (String key : keys){
+                stringRedisTemplate.delete(key);
+            }
+            return result;
+        });
+
+        return result;
+    }
+
+    public void setWithredisUUID(String redisUUID,AidingStudentsImportExcelListDO aidingStudentsImportExcelListDO) {
+        String redisKey = formatKey(redisUUID,aidingStudentsImportExcelListDO.getStudentCode());
+        // 清理多余字段,避免缓存
+        aidingStudentsImportExcelListDO.setUpdater(null).setUpdateTime(null).setCreateTime(null).setCreator(null).setDeleted(null);
+
+        stringRedisTemplate.opsForValue().set(redisKey, JsonUtils.toJsonString(aidingStudentsImportExcelListDO), 60*60*24, TimeUnit.SECONDS);
+
+    }
+
+
+
+
+
+
+    public void delete(String uniId,String studentCode) {
+        String redisKey = formatKey(uniId,studentCode);
+        stringRedisTemplate.delete(redisKey);
+    }
+
+
+    /*public void deleteList(String redisUUID,Collection<String> studentCodes) {
+        List<String> redisKeys = CollectionUtils.convertList(redisUUID, studentCodes,AidingStudentsImportListRedisDAO::formatKey);
+        stringRedisTemplate.delete(redisKeys);
+    }*/
+
+
+
+
+
+
+    private static String formatKey(String uniId,String studentCode) {
+        return String.format(AIDING_STUDENTS_IMPORT_LIST_KEY, uniId,studentCode);
+    }
+}

+ 1 - 0
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/service/aidingstudentscollegemanage/AidingStudentsCollegeManageService.java

@@ -52,4 +52,5 @@ public interface AidingStudentsCollegeManageService {
      */
     PageResult<AidingStudentsCollegeManageDO> getAidingStudentsCollegeManagePage(AidingStudentsCollegeManagePageReqVO pageReqVO);
 
+    Map<String, Long> getAidingStudentsCollegeManageCount();
 }

+ 32 - 0
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/service/aidingstudentscollegemanage/AidingStudentsCollegeManageServiceImpl.java

@@ -1,5 +1,7 @@
 package cn.iocoder.yudao.module.as.service.aidingstudentscollegemanage;
 
+import cn.iocoder.yudao.module.system.api.dept.DeptApi;
+import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
 import org.springframework.stereotype.Service;
 import javax.annotation.Resource;
 import org.springframework.validation.annotation.Validated;
@@ -15,6 +17,7 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
 import cn.iocoder.yudao.module.as.dal.mysql.aidingstudentscollegemanage.AidingStudentsCollegeManageMapper;
 
 import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId;
 import static cn.iocoder.yudao.module.as.enums.ErrorCodeConstants.*;
 
 /**
@@ -28,9 +31,18 @@ public class AidingStudentsCollegeManageServiceImpl implements AidingStudentsCol
 
     @Resource
     private AidingStudentsCollegeManageMapper aidingStudentsCollegeManageMapper;
+    @Resource
+    private AdminUserApi adminUserApi;
+    @Resource
+    private DeptApi deptApi;
 
     @Override
     public Long createAidingStudentsCollegeManage(AidingStudentsCollegeManageSaveReqVO createReqVO) {
+        // 获得学院id
+        Long deptId = adminUserApi.getUser(getLoginUserId()).getDeptId();
+        Long collegeId =  deptApi.getCollegeId(deptId);
+        createReqVO.setCollegeId(collegeId);
+
         // 插入
         AidingStudentsCollegeManageDO aidingStudentsCollegeManage = BeanUtils.toBean(createReqVO, AidingStudentsCollegeManageDO.class);
         aidingStudentsCollegeManageMapper.insert(aidingStudentsCollegeManage);
@@ -71,4 +83,24 @@ public class AidingStudentsCollegeManageServiceImpl implements AidingStudentsCol
         return aidingStudentsCollegeManageMapper.selectPage(pageReqVO);
     }
 
+    @Override
+
+    public Map<String, Long> getAidingStudentsCollegeManageCount() {
+        Map<String, Long> map = new LinkedHashMap<>();
+        //总人数
+        map.put("sum", aidingStudentsCollegeManageMapper.selectCount());
+        //未发布
+        map.put("unpublished", aidingStudentsCollegeManageMapper.selectCount(AidingStudentsCollegeManageDO::getComStatus, 0));
+        //审核中
+        //map.put("review", aidingStudentsCollegeManageMapper.selectCount(AidingStudentsCollegeManageDO::getComStatus, 1));
+        //公示中
+        //map.put("publicity", aidingStudentsCollegeManageMapper.selectCount(AidingStudentsCollegeManageDO::getComStatus, 2));
+        //进行中
+        map.put("ongoing", aidingStudentsCollegeManageMapper.selectCount(AidingStudentsCollegeManageDO::getComStatus, 1)
+                +aidingStudentsCollegeManageMapper.selectCount(AidingStudentsCollegeManageDO::getComStatus, 2));
+        //已完成
+        map.put("completed", aidingStudentsCollegeManageMapper.selectCount(AidingStudentsCollegeManageDO::getComStatus, 3));
+        return map;
+    }
+
 }

+ 60 - 0
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/service/aidingstudentsimportlist/AidingStudentsImportListService.java

@@ -0,0 +1,60 @@
+package cn.iocoder.yudao.module.as.service.aidingstudentsimportlist;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.as.controller.admin.aidingstudentsimportlist.vo.AidingStudentsImportExcelRespVO;
+import cn.iocoder.yudao.module.as.controller.admin.aidingstudentsimportlist.vo.AidingStudentsImportExcelVO;
+import cn.iocoder.yudao.module.as.controller.admin.aidingstudentsimportlist.vo.AidingStudentsImportListPageResqVO;
+import cn.iocoder.yudao.module.as.controller.admin.aidingstudentsimportlist.vo.AidingStudentsImportListSaveReqVO;
+import cn.iocoder.yudao.module.as.dal.dataobject.aidingstudentsimportlist.AidingStudentsImportExcelListDO;
+
+import javax.validation.Valid;
+import java.util.List;
+
+public interface AidingStudentsImportListService {
+    /**
+     * 创建贫困学生自治区名单管理
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createAidingStudentsImportList(@Valid AidingStudentsImportListSaveReqVO createReqVO, Long aidingStudentsManageId);
+
+
+    /**
+     * 更新贫困学生自治区名单管理
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateAidingStudentsImportList(@Valid AidingStudentsImportListSaveReqVO updateReqVO);
+
+    /**
+     * 删除贫困学生自治区名单
+     *
+     * @param id 编号
+     */
+    void deleteAidingStudentsImportList(Long id);
+
+    /**
+     * 获得贫困学生自治区名单
+     *
+     * @param id                     编号
+     * @return 贫困学生自治区名单
+     */
+    AidingStudentsImportExcelListDO getAidingStudentsImportList(Long id);
+
+    /**
+     * 获得贫困学生自治区名单分页
+     *
+     * @param //pageReqVO 分页查询
+     * @return 贫困学生自治区名单分页
+     */
+    PageResult<AidingStudentsImportExcelListDO> getAidingStudentsImportListPage(AidingStudentsImportListPageResqVO pageReqVO);
+
+    AidingStudentsImportExcelRespVO aidingStudentsImportExcelList(Long aidingStudentsManageId,String redisUUID);
+
+
+
+    String aidingStudentsImportExcelToRedis(List<AidingStudentsImportExcelVO> list);
+
+    void aidingStudentsImportExcelReImport(List<AidingStudentsImportExcelVO> list, Long aidingStudentsManageId, Integer strategyId);
+}

+ 286 - 0
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/service/aidingstudentsimportlist/AidingStudentsImportListServiceImpl.java

@@ -0,0 +1,286 @@
+package cn.iocoder.yudao.module.as.service.aidingstudentsimportlist;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.as.controller.admin.aidingstudentsimportlist.vo.AidingStudentsImportExcelRespVO;
+import cn.iocoder.yudao.module.as.controller.admin.aidingstudentsimportlist.vo.AidingStudentsImportExcelVO;
+import cn.iocoder.yudao.module.as.controller.admin.aidingstudentsimportlist.vo.AidingStudentsImportListPageResqVO;
+import cn.iocoder.yudao.module.as.controller.admin.aidingstudentsimportlist.vo.AidingStudentsImportListSaveReqVO;
+import cn.iocoder.yudao.module.as.dal.dataobject.aidingstudentsimportlist.AidingStudentsImportExcelListDO;
+import cn.iocoder.yudao.module.as.dal.mysql.aidingstudentsimportlist.AidingStudentsImportListMapper;
+import cn.iocoder.yudao.module.as.dal.redis.aidingstudentsimportlist.AidingStudentsImportListRedisDAO;
+
+import cn.iocoder.yudao.module.system.api.dept.DeptApi;
+import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
+import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
+import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
+import cn.iocoder.yudao.module.system.dal.mysql.dept.DeptMapper;
+import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.validation.annotation.Validated;
+
+import javax.annotation.Resource;
+import javax.validation.ValidationException;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.UUID;
+
+
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.iocoder.yudao.module.as.enums.ErrorCodeConstants.*;
+
+@Service
+@Validated
+@Slf4j
+public class AidingStudentsImportListServiceImpl implements AidingStudentsImportListService {
+    @Resource
+    private AidingStudentsImportListMapper aidingStudentsImportListMapper;
+    @Resource
+    private AidingStudentsImportListRedisDAO aidingStudentsImportListRedisDAO;
+    @Resource
+    private AdminUserMapper userMapper;
+    @Resource
+    private DeptApi deptApi;
+
+    @Override
+    public Long createAidingStudentsImportList(AidingStudentsImportListSaveReqVO createReqVO, Long aidingStudentsManageId) {
+        // 转换为DO
+        AidingStudentsImportExcelListDO aidingStudentsImportListDO = BeanUtils.toBean(createReqVO, AidingStudentsImportExcelListDO.class);
+        //set项目id和学院id
+        aidingStudentsImportListDO.setAsAidingStudentsManageId(aidingStudentsManageId);
+        aidingStudentsImportListDO.setCollegeId(getCollegeIdByStudentCode(aidingStudentsImportListDO.getStudentCode()));
+
+        if (checkStudentCodeExists(aidingStudentsImportListDO.getStudentCode(),aidingStudentsManageId)) {
+            throw exception(AIDING_STUDENTS_IMPORT_LIST_STUDENT_EXISTS);
+        }
+        aidingStudentsImportListMapper.insert(aidingStudentsImportListDO);
+        // 返回
+        return aidingStudentsImportListDO.getId();
+    }
+
+
+    @Override
+    public void updateAidingStudentsImportList(AidingStudentsImportListSaveReqVO updateReqVO) {
+        // 校验存在
+        validateAidingStudentsImportListExists(updateReqVO.getId());
+        // 更新
+        AidingStudentsImportExcelListDO updateObj = BeanUtils.toBean(updateReqVO, AidingStudentsImportExcelListDO.class);
+        aidingStudentsImportListMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteAidingStudentsImportList(Long id) {
+        // 校验存在
+        validateAidingStudentsImportListExists(id);
+        // 删除
+        aidingStudentsImportListMapper.deleteById(id);
+    }
+
+
+    // 根据id校验是否存在
+    private void validateAidingStudentsImportListExists(Long id) {
+        if (aidingStudentsImportListMapper.selectById(id) == null) {
+            throw exception(AIDING_STUDENTS_IMPORT_LIST_NOT_EXISTS);
+        }
+    }
+
+    //根据学号校验这次项目该学生是否已经导入
+    private boolean checkStudentCodeExists(String studentCode, Long asAidingStudentsManageId) {
+        //存在返回true,不存在返回false
+        return aidingStudentsImportListMapper.selectCount(
+                Wrappers.lambdaQuery(AidingStudentsImportExcelListDO.class)
+                                .eq(AidingStudentsImportExcelListDO::getStudentCode, studentCode)
+                                .eq(AidingStudentsImportExcelListDO::getAsAidingStudentsManageId, asAidingStudentsManageId)
+                ) > 0;
+
+
+    }
+
+    @Override
+    public AidingStudentsImportExcelListDO getAidingStudentsImportList(Long id) {
+        return aidingStudentsImportListMapper.selectById(id);
+    }
+
+
+    @Override
+    public PageResult<AidingStudentsImportExcelListDO> getAidingStudentsImportListPage(AidingStudentsImportListPageResqVO pageReqVO) {
+        return aidingStudentsImportListMapper.selectPage(pageReqVO);
+    }
+
+
+
+    //校验excel导入的内容
+    public String validateImportListForCreateOrUpdate(String studentName, String studentIdNumber, String studentCode, int studentAge, int studentSex) throws ValidationException {
+        String message = null;
+        // 验证学生姓名
+        if (studentName == null || studentName.isEmpty()) {
+            message="姓名不能为空";
+
+        }
+
+        // 验证学生学号
+        if (studentCode == null || studentCode.isEmpty()) {
+            message="学号不能为空";
+
+        }
+
+        // 验证学生性别
+        if (studentSex != 1 && studentSex != 2 && studentSex != 3) {
+            message="性别必须为 1(男)、2(女)或 3(未知)";
+
+        }
+
+        // 验证学生年龄
+        if (studentAge <= 0 || studentAge > 150) {
+            message="年龄必须大于0且不能超过150岁";
+
+        }
+
+        // 验证学生身份证号
+        if (studentIdNumber == null || studentIdNumber.length() != 18) {
+            message="身份证号长度必须为18位";
+
+        }
+        return message;
+
+    }
+
+
+
+//导入到数据库当中
+    @Override
+    @Transactional(rollbackFor = Exception.class) // 添加事务,异常则回滚所有导入
+    public AidingStudentsImportExcelRespVO aidingStudentsImportExcelList( Long asAidingStudentsManageId,String redisUUID) {
+        List<AidingStudentsImportExcelListDO> list = aidingStudentsImportListRedisDAO.getAllMatchingValues(redisUUID);
+        if (CollUtil.isEmpty(list)) {
+            throw exception(AIDING_STUDENTS_IMPORT_LIST_IS_NULL);
+        }
+        AidingStudentsImportExcelRespVO respVO = AidingStudentsImportExcelRespVO.builder().createStudentNames(new ArrayList<>())
+                .failureStudentNames(new LinkedHashMap<>()).build();
+        List<AidingStudentsImportExcelListDO> aidingStudentsImportEecleListDOS = BeanUtils.toBean(list, AidingStudentsImportExcelListDO.class);
+        aidingStudentsImportEecleListDOS.forEach(aidingStudentsImportEecleListDO -> {
+
+            // 校验,判断是否有不符合的原因
+
+            String result = validateImportListForCreateOrUpdate(aidingStudentsImportEecleListDO.getStudentName(), aidingStudentsImportEecleListDO.getStudentIdNumber(),
+                    aidingStudentsImportEecleListDO.getStudentCode(), aidingStudentsImportEecleListDO.getStudentAge(), aidingStudentsImportEecleListDO.getStudentSex());
+            if (result != null){
+                respVO.getFailureStudentNames().put(aidingStudentsImportEecleListDO.getStudentName(), result);
+                return;
+            }
+            //赋值给外键
+            aidingStudentsImportEecleListDO.setAsAidingStudentsManageId(asAidingStudentsManageId);
+            aidingStudentsImportEecleListDO.setCollegeId(getCollegeIdByStudentCode(aidingStudentsImportEecleListDO.getStudentCode()));
+
+            if (checkStudentCodeExists(aidingStudentsImportEecleListDO.getStudentCode(),asAidingStudentsManageId)) {
+                respVO.getFailureStudentNames().put(aidingStudentsImportEecleListDO.getStudentName(), "该学生已导入过一次");
+                return;
+            }
+            aidingStudentsImportEecleListDO.setAsAidingStudentsManageId(asAidingStudentsManageId);
+            aidingStudentsImportListMapper.insert(aidingStudentsImportEecleListDO);
+            respVO.getCreateStudentNames().add(aidingStudentsImportEecleListDO.getStudentName());
+        });
+        return respVO;
+    }
+
+
+    //导入到redis中
+    @Override
+    public String aidingStudentsImportExcelToRedis(List<AidingStudentsImportExcelVO> list) {
+        if (CollUtil.isEmpty(list)) {
+            throw exception(AIDING_STUDENTS_IMPORT_LIST_IS_NULL);
+        }
+        String redisUUID = String.valueOf(UUID.randomUUID());
+        try {
+            List<AidingStudentsImportExcelListDO> aidingStudentsImportEecleListDOS = BeanUtils.toBean(list, AidingStudentsImportExcelListDO.class);
+            aidingStudentsImportEecleListDOS.forEach(aidingStudentsImportEecleListDO -> {
+                aidingStudentsImportListRedisDAO.setWithredisUUID(redisUUID,aidingStudentsImportEecleListDO);
+            });
+        } catch (Exception e) {
+            log.error("导入redis失败", e);
+            throw new RuntimeException(e);
+
+        }
+        return redisUUID;
+    }
+
+
+
+
+    //重新导入
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void aidingStudentsImportExcelReImport(List<AidingStudentsImportExcelVO> list, Long aidingStudentsManageId, Integer strategyId) {
+        if (CollUtil.isEmpty(list)) {
+            throw exception(AIDING_STUDENTS_IMPORT_LIST_IS_NULL);
+        }
+
+        try {
+            List<AidingStudentsImportExcelListDO> aidingStudentsImportEecleListDOS = BeanUtils.toBean(list, AidingStudentsImportExcelListDO.class);
+            aidingStudentsImportEecleListDOS.forEach(aidingStudentsImportEecleListDO -> {
+                // 校验,判断是否有不符合的原因
+
+                String result = validateImportListForCreateOrUpdate(aidingStudentsImportEecleListDO.getStudentName(), aidingStudentsImportEecleListDO.getStudentIdNumber(),
+                        aidingStudentsImportEecleListDO.getStudentCode(), aidingStudentsImportEecleListDO.getStudentAge(), aidingStudentsImportEecleListDO.getStudentSex());
+                if (result != null){
+                    throw new ValidationException(aidingStudentsImportEecleListDO.getStudentName()+result);
+                }
+                // 赋值给外键
+                aidingStudentsImportEecleListDO.setAsAidingStudentsManageId(aidingStudentsManageId);
+                aidingStudentsImportEecleListDO.setCollegeId(getCollegeIdByStudentCode(aidingStudentsImportEecleListDO.getStudentCode()));
+
+                //数据库不存在,直接插入
+                if(!checkStudentCodeExists(aidingStudentsImportEecleListDO.getStudentCode(),aidingStudentsManageId)){
+                    aidingStudentsImportListMapper.insert(aidingStudentsImportEecleListDO);
+                    return;
+                }
+                // 数据库存在,判断策略,1表示覆盖
+                if(strategyId == 1){
+                    aidingStudentsImportListMapper.update(aidingStudentsImportEecleListDO,
+                            Wrappers.lambdaQuery(AidingStudentsImportExcelListDO.class)
+                                    .eq(AidingStudentsImportExcelListDO::getStudentCode, aidingStudentsImportEecleListDO.getStudentCode())
+                                    .eq(AidingStudentsImportExcelListDO::getAsAidingStudentsManageId, aidingStudentsManageId)
+                    );
+                    return ;
+                }
+                //数据库存在,判断策略,2表示不改变
+                if (strategyId == 2){
+                    return ;
+                }
+                throw new ValidationException("导入失败");
+            });
+        } catch (Exception e) {
+            log.error("导入失败", e);
+            throw new RuntimeException(e);
+        }
+
+    }
+
+    //根据学号查学院id
+    public Long getCollegeIdByStudentCode(String studentCode){
+        AdminUserDO adminUserDO = userMapper.selectByUsername(studentCode);
+        if (adminUserDO == null){
+            throw exception(AIDING_STUDENTS_IMPORT_LIST_STUDENT_CODE_NOT_EXISTS);
+        }
+
+        return deptApi.getCollegeId(adminUserDO.getDeptId());
+
+        //循环查询父级部门
+        /*DeptDO deptDO = new DeptDO();
+        Long parentId = deptMapper.selectById(adminUserDO.getDeptId()).getParentId();
+        while (parentId != 0) {
+             deptDO = deptMapper.selectById(parentId);
+            parentId= deptDO.getParentId();
+        }
+        return deptDO.getId();*/
+    }
+
+
+
+}