浏览代码

Merge remote-tracking branch 'origin/master'

平常心 6 月之前
父节点
当前提交
29ed677432
共有 30 个文件被更改,包括 579 次插入46 次删除
  1. 1 1
      yudao-module-as/yudao-module-as-api/src/main/java/cn/iocoder/yudao/module/as/enums/ErrorCodeConstants.java
  2. 25 1
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentscollegemanage/AidingStudentsCollegeManageController.java
  3. 2 2
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentscollegemanage/vo/AidingStudentsCollegeManagePageReqVO.java
  4. 87 0
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentscollegemanage/vo/AidingStudentsCollegeManageProjectInfoPageRespVO.java
  5. 106 0
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentscollegemanage/vo/AidingStudentsCollegeManageProjectInfoRespVO.java
  6. 12 8
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentscollegemanage/vo/AidingStudentsCollegeManageRespVO.java
  7. 2 2
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentscollegemanage/vo/AidingStudentsCollegeManageSaveReqVO.java
  8. 3 4
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentsimportlist/AidingStudentsImportListController.java
  9. 101 0
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/dal/dataobject/aidingstudentscollegemanage/AidingStudentsCollegeManageProjectInfoPageRespDO.java
  10. 3 1
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/dal/dataobject/aidingstudentspersonmanage/AidingStudentsPersonManageDO.java
  11. 16 3
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/dal/mysql/aidingstudentscollegemanage/AidingStudentsCollegeManageMapper.java
  12. 5 1
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/service/aidingstudentscollegemanage/AidingStudentsCollegeManageService.java
  13. 72 6
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/service/aidingstudentscollegemanage/AidingStudentsCollegeManageServiceImpl.java
  14. 2 0
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/service/aidingstudentsmanage/AidingStudentsManageServiceImpl.java
  15. 1 1
      yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/service/aidingstudentspersonmanage/AidingStudentsPersonManageServiceImpl.java
  16. 7 0
      yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java
  17. 6 0
      yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/dto/DeptRespDTO.java
  18. 9 0
      yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApi.java
  19. 12 1
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java
  20. 11 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApiImpl.java
  21. 2 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApiImpl.java
  22. 17 6
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java
  23. 6 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java
  24. 6 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/DeptDO.java
  25. 0 1
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/user/AdminUserDO.java
  26. 18 3
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/DeptMapper.java
  27. 14 1
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java
  28. 23 3
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java
  29. 7 1
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceImpl.java
  30. 3 0
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java

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

@@ -7,7 +7,7 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode;
  */
 public interface ErrorCodeConstants {
     ErrorCode AIDING_STUDENTS_MANAGE_NOT_EXISTS = new ErrorCode( 2_009_000_001, "家庭困难认定项目管理不存在");
-    ErrorCode AIDING_STUDENTS_COLLEGE_MANAGE_NOT_EXISTS = new ErrorCode(2_009_000_002, "综测项目学院管理不存在");
+    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,  "自治区名单中该学生不存在");

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

@@ -1,5 +1,6 @@
 package cn.iocoder.yudao.module.as.controller.admin.aidingstudentscollegemanage;
 
+import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
 import org.springframework.web.bind.annotation.*;
 import javax.annotation.Resource;
 import org.springframework.validation.annotation.Validated;
@@ -8,7 +9,6 @@ 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.constraints.*;
 import javax.validation.*;
 import javax.servlet.http.*;
 import java.util.*;
@@ -42,6 +42,7 @@ public class AidingStudentsCollegeManageController {
     @Operation(summary = "创建家庭困难认定项目学院管理")
     @PreAuthorize("@ss.hasPermission('as:aiding-students-college-manage:create')")
     public CommonResult<Long> createAidingStudentsCollegeManage(@Valid @RequestBody AidingStudentsCollegeManageSaveReqVO createReqVO) {
+        //注意学校id和学院id的区别
         return success(aidingStudentsCollegeManageService.createAidingStudentsCollegeManage(createReqVO));
     }
 
@@ -67,10 +68,14 @@ public class AidingStudentsCollegeManageController {
     @Parameter(name = "id", description = "编号", required = true, example = "1024")
     @PreAuthorize("@ss.hasPermission('as:aiding-students-college-manage:get')")
     public CommonResult<AidingStudentsCollegeManageRespVO> getAidingStudentsCollegeManage(@RequestParam("id") Long id) {
+        //通过collegeId 和 manageId 获取,减少学院项目id的使用。
+
         AidingStudentsCollegeManageDO aidingStudentsCollegeManage = aidingStudentsCollegeManageService.getAidingStudentsCollegeManage(id);
         return success(BeanUtils.toBean(aidingStudentsCollegeManage, AidingStudentsCollegeManageRespVO.class));
     }
 
+    //@GetMapping("/")
+
     @GetMapping("/getCount")
     @Operation(summary = "获得家庭困难认定项目学院管理各个状态人数")
     @PreAuthorize("@ss.hasPermission('as:aiding-students-college-manage:get-count')")
@@ -79,6 +84,14 @@ public class AidingStudentsCollegeManageController {
         return success(map);
     }
 
+    @GetMapping("/getCollegeAllStudent")
+    @Operation(summary = "获得学院所有学生")
+    @PreAuthorize("@ss.hasPermission('as:aiding-students-college-manage:get-college-all-student')")
+    public CommonResult<List<AdminUserRespDTO>> getCollegeAllStudent() {
+        List<AdminUserRespDTO> list = aidingStudentsCollegeManageService.getCollegeAllStudent();
+        return success(list);
+    }
+
 
     @GetMapping("/page")
     @Operation(summary = "获得家庭困难认定项目学院管理分页")
@@ -87,6 +100,17 @@ public class AidingStudentsCollegeManageController {
         PageResult<AidingStudentsCollegeManageDO> pageResult = aidingStudentsCollegeManageService.getAidingStudentsCollegeManagePage(pageReqVO);
         return success(BeanUtils.toBean(pageResult, AidingStudentsCollegeManageRespVO.class));
     }
+    @GetMapping("/projectInfo")
+    @Operation(summary = "获得家庭困难认定项目学院管理项目详细信息分页")
+    @PreAuthorize("@ss.hasPermission('as:aiding-students-college-manage:query')")
+    public CommonResult<PageResult<AidingStudentsCollegeManageProjectInfoRespVO>> getProjectInfoPage(@Valid AidingStudentsCollegeManageProjectInfoPageRespVO pageReqVO) {
+
+        PageResult<AidingStudentsCollegeManageProjectInfoRespVO> pageResult = aidingStudentsCollegeManageService.getProjectInfoPage(pageReqVO);
+        return success(pageResult);
+    }
+
+
+
 
     @GetMapping("/export-excel")
     @Operation(summary = "导出家庭困难认定项目学院管理 Excel")

+ 2 - 2
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentscollegemanage/vo/AidingStudentsCollegeManagePageReqVO.java

@@ -45,10 +45,10 @@ public class AidingStudentsCollegeManagePageReqVO extends PageParam {
     private Long collegeId;
 
     @Schema(description = "学院通知文件")
-    private String collegeNoticeFile;
+    private String[] collegeNoticeFile;
 
     @Schema(description = "学院通知文件名称", example = "芋艿")
-    private String collegeNoticeFileName;
+    private String[] collegeNoticeFileName;
 
     @Schema(description = "上报时间")
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)

+ 87 - 0
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentscollegemanage/vo/AidingStudentsCollegeManageProjectInfoPageRespVO.java

@@ -0,0 +1,87 @@
+package cn.iocoder.yudao.module.as.controller.admin.aidingstudentscollegemanage.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;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDateTime;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 家庭困难认定项目学院项目信息管理分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class AidingStudentsCollegeManageProjectInfoPageRespVO extends PageParam {
+    @Schema(description = "学生提交时间段时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] submitTime;
+
+    @Schema(description = "班级民主评议时间段")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] evaluationTime;
+
+    @Schema(description = "学院审核时间段")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] auditTime;
+
+    @Schema(description = "公示时间段")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] publicityTime;
+
+    @Schema(description = "状态值,待发布0,评审中1,公示中2,,已上报3", example = "1")
+    private Integer comStatus;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+    @Schema(description = "项目管理id", example = "1134")
+    private Long manageId;
+
+    @Schema(description = "学院部门id", example = "32049")
+    private Long collegeId;
+
+    @Schema(description = "学院通知文件")
+    private String[] collegeNoticeFile;
+
+    @Schema(description = "学院通知文件名称", example = "芋艿")
+    private String[] collegeNoticeFileName;
+
+    @Schema(description = "上报时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] reportingTime;
+
+
+
+
+    @Schema(description = "项目标题", example = "赵六")
+    private String diName;
+
+    @Schema(description = "状态值,待发布0,进行中1,已完成2", example = "1")
+    private Integer diStatus;
+
+/*    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;*/
+
+    @Schema(description = "截止时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] diEndTime;
+
+    @Schema(description = "家庭经济困难学生认定项目通知富文本")
+    private String diNotice;
+
+    @Schema(description = "家庭经济困难学生认定项目评审规则文件")
+    private String diNoticeFile;
+
+    @Schema(description = "家庭经济困难学生认定项目评审规则文件名称", example = "芋艿")
+    private String diNoticeFileName;
+
+
+
+
+}

+ 106 - 0
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentscollegemanage/vo/AidingStudentsCollegeManageProjectInfoRespVO.java

@@ -0,0 +1,106 @@
+package cn.iocoder.yudao.module.as.controller.admin.aidingstudentscollegemanage.vo;
+
+import cn.iocoder.yudao.module.as.controller.admin.aidingstudentsmanage.vo.AidingStudentsManageRespVO;
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDateTime;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 家庭困难认定项目学院项目信息管理 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+public class AidingStudentsCollegeManageProjectInfoRespVO {
+    @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "2482")
+    @ExcelProperty("id")
+    private Long id;
+
+    @Schema(description = "学生提交时间段时间")
+    @ExcelProperty("学生提交时间段时间")
+    private String submitTime;
+
+    @Schema(description = "班级民主评议时间段")
+    @ExcelProperty("班级民主评议时间段")
+    private String evaluationTime;
+
+    @Schema(description = "学院审核时间段")
+    @ExcelProperty("学院审核时间段")
+    private String auditTime;
+
+    @Schema(description = "公示时间段")
+    @ExcelProperty("公示时间段")
+    private String publicityTime;
+
+    @Schema(description = "状态值,待发布0,评审中1,公示中2,,已上报3", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    @ExcelProperty("状态值,待发布0,评审中1,公示中2,,已上报3")
+    private Integer comStatus;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private String createTime;
+
+    @Schema(description = "项目管理id", example = "1134")
+    @ExcelProperty("项目管理id")
+    private Long manageId;
+
+    @Schema(description = "学院部门id", example = "32049")
+    @ExcelProperty("学院部门id")
+    private Long collegeId;
+
+    @Schema(description = "学院通知文件")
+    @ExcelProperty("学院通知文件")
+    private String collegeNoticeFile;
+
+    @Schema(description = "学院通知文件名称", example = "芋艿")
+    @ExcelProperty("学院通知文件名称")
+    private String collegeNoticeFileName;
+
+    @Schema(description = "上报时间")
+    @ExcelProperty("上报时间")
+    private String reportingTime;
+
+
+
+
+    @Schema(description = "项目标题", example = "赵六")
+    private String diName;
+
+    @Schema(description = "状态值,待发布0,进行中1,已完成2", example = "1")
+    private Integer diStatus;
+
+/*    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;*/
+
+    @Schema(description = "截止时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private String diEndTime;
+
+    @Schema(description = "家庭经济困难学生认定项目通知富文本")
+    private String diNotice;
+
+    @Schema(description = "家庭经济困难学生认定项目评审规则文件")
+    private String[] diNoticeFile;
+
+    @Schema(description = "家庭经济困难学生认定项目评审规则文件名称", example = "芋艿")
+    private String[] diNoticeFileName;
+
+    @Schema(description = "创建人")
+    private String creator;
+
+    /*@Schema(description = "助学项目管理vo类")
+    private AidingStudentsManageRespVO projectInfo;
+    @Schema(description = "助学项目学院管理vo类")
+    private AidingStudentsCollegeManageRespVO collegeInfo;*/
+}

+ 12 - 8
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentscollegemanage/vo/AidingStudentsCollegeManageRespVO.java

@@ -1,5 +1,6 @@
 package cn.iocoder.yudao.module.as.controller.admin.aidingstudentscollegemanage.vo;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.*;
 import java.util.*;
@@ -8,6 +9,9 @@ import org.springframework.format.annotation.DateTimeFormat;
 import java.time.LocalDateTime;
 import com.alibaba.excel.annotation.*;
 
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;
+
 @Schema(description = "管理后台 - 家庭困难认定项目学院管理 Response VO")
 @Data
 @ExcelIgnoreUnannotated
@@ -19,19 +23,19 @@ public class AidingStudentsCollegeManageRespVO {
 
     @Schema(description = "学生提交时间段时间")
     @ExcelProperty("学生提交时间段时间")
-    private LocalDateTime submitTime;
+    private String submitTime;
 
     @Schema(description = "班级民主评议时间段")
     @ExcelProperty("班级民主评议时间段")
-    private LocalDateTime evaluationTime;
+    private String evaluationTime;
 
     @Schema(description = "学院审核时间段")
     @ExcelProperty("学院审核时间段")
-    private LocalDateTime auditTime;
+    private String auditTime;
 
     @Schema(description = "公示时间段")
     @ExcelProperty("公示时间段")
-    private LocalDateTime publicityTime;
+    private String publicityTime;
 
     @Schema(description = "状态值,待发布0,评审中1,公示中2,,已上报3", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
     @ExcelProperty("状态值,待发布0,评审中1,公示中2,,已上报3")
@@ -39,7 +43,7 @@ public class AidingStudentsCollegeManageRespVO {
 
     @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
     @ExcelProperty("创建时间")
-    private LocalDateTime createTime;
+    private String createTime;
 
     @Schema(description = "项目管理id", example = "1134")
     @ExcelProperty("项目管理id")
@@ -51,14 +55,14 @@ public class AidingStudentsCollegeManageRespVO {
 
     @Schema(description = "学院通知文件")
     @ExcelProperty("学院通知文件")
-    private String collegeNoticeFile;
+    private String[] collegeNoticeFile;
 
     @Schema(description = "学院通知文件名称", example = "芋艿")
     @ExcelProperty("学院通知文件名称")
-    private String collegeNoticeFileName;
+    private String[] collegeNoticeFileName;
 
     @Schema(description = "上报时间")
     @ExcelProperty("上报时间")
-    private LocalDateTime reportingTime;
+    private String reportingTime;
 
 }

+ 2 - 2
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/aidingstudentscollegemanage/vo/AidingStudentsCollegeManageSaveReqVO.java

@@ -37,10 +37,10 @@ public class AidingStudentsCollegeManageSaveReqVO {
     private Long collegeId;
 
     @Schema(description = "学院通知文件")
-    private String collegeNoticeFile;
+    private String[] collegeNoticeFile;
 
     @Schema(description = "学院通知文件名称", example = "芋艿")
-    private String collegeNoticeFileName;
+    private String[] collegeNoticeFileName;
 
     @Schema(description = "上报时间")
     private LocalDateTime reportingTime;

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

@@ -85,9 +85,10 @@ public class AidingStudentsImportListController {
     @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 {
+    @RequestParam(value = "redisUUID") String redisUUID) throws Exception {
         return success(aidingStudentsImportListService.aidingStudentsImportExcelList( aidingStudentsManageId,redisUUID));
     }
 
@@ -101,8 +102,6 @@ public class AidingStudentsImportListController {
         return success(redisUUID);
     }
 
-
-
     @PostMapping("/reimport-excel")
     @Operation(summary = "重复导入家庭情况困难认定excel")
     @Parameters({
@@ -113,7 +112,7 @@ public class AidingStudentsImportListController {
     @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 {
+                                                                       @RequestParam(value = "strategyId",defaultValue = "1") Integer strategyId) throws Exception {
         List<AidingStudentsImportExcelVO> list = ExcelUtils.read(file, AidingStudentsImportExcelVO.class);
         aidingStudentsImportListService.aidingStudentsImportExcelReImport(list, aidingStudentsManageId, strategyId);
         return success(true);

+ 101 - 0
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/dal/dataobject/aidingstudentscollegemanage/AidingStudentsCollegeManageProjectInfoPageRespDO.java

@@ -0,0 +1,101 @@
+package cn.iocoder.yudao.module.as.dal.dataobject.aidingstudentscollegemanage;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDateTime;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 家庭困难认定项目学院项目信息管理分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class AidingStudentsCollegeManageProjectInfoPageRespDO extends PageParam {
+    @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "2482")
+    @ExcelProperty("id")
+    private Long id;
+
+    @Schema(description = "学生提交时间段时间")
+    @ExcelProperty("学生提交时间段时间")
+    private String submitTime;
+
+    @Schema(description = "班级民主评议时间段")
+    @ExcelProperty("班级民主评议时间段")
+    private String evaluationTime;
+
+    @Schema(description = "学院审核时间段")
+    @ExcelProperty("学院审核时间段")
+    private String auditTime;
+
+    @Schema(description = "公示时间段")
+    @ExcelProperty("公示时间段")
+    private String publicityTime;
+
+    @Schema(description = "状态值,待发布0,评审中1,公示中2,,已上报3", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    @ExcelProperty("状态值,待发布0,评审中1,公示中2,,已上报3")
+    private Integer comStatus;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private String createTime;
+
+    @Schema(description = "项目管理id", example = "1134")
+    @ExcelProperty("项目管理id")
+    private Long manageId;
+
+    @Schema(description = "学院部门id", example = "32049")
+    @ExcelProperty("学院部门id")
+    private Long collegeId;
+
+    @Schema(description = "学院通知文件")
+    @ExcelProperty("学院通知文件")
+    private String collegeNoticeFile;
+
+    @Schema(description = "学院通知文件名称", example = "芋艿")
+    @ExcelProperty("学院通知文件名称")
+    private String collegeNoticeFileName;
+
+    @Schema(description = "上报时间")
+    @ExcelProperty("上报时间")
+    private String reportingTime;
+
+
+
+
+    @Schema(description = "项目标题", example = "赵六")
+    private String diName;
+
+    @Schema(description = "状态值,待发布0,进行中1,已完成2", example = "1")
+    private Integer diStatus;
+
+/*    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;*/
+
+    @Schema(description = "截止时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private String diEndTime;
+
+    @Schema(description = "家庭经济困难学生认定项目通知富文本")
+    private String diNotice;
+
+    @Schema(description = "家庭经济困难学生认定项目评审规则文件")
+    private String[] diNoticeFile;
+
+    @Schema(description = "家庭经济困难学生认定项目评审规则文件名称", example = "芋艿")
+    private String[] diNoticeFileName;
+
+    @Schema(description = "创建人")
+    private String creator;
+
+    /*@Schema(description = "助学项目管理vo类")
+    private AidingStudentsManageRespVO projectInfo;
+    @Schema(description = "助学项目学院管理vo类")
+    private AidingStudentsCollegeManageRespVO collegeInfo;*/
+}

+ 3 - 1
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/dal/dataobject/aidingstudentspersonmanage/AidingStudentsPersonManageDO.java

@@ -25,6 +25,8 @@ public class AidingStudentsPersonManageDO extends BaseDO {
     // 序号
     @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
+
+
     //姓名
     private String nickname;
     // 困难类型
@@ -36,7 +38,7 @@ public class AidingStudentsPersonManageDO extends BaseDO {
     // 排序
     private Integer sort;
     // 学院id
-    private Integer collegeId;
+    private Long collegeId;
     // 项目ID
     private Integer manageId;
     // 学院项目主键ID

+ 16 - 3
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/dal/mysql/aidingstudentscollegemanage/AidingStudentsCollegeManageMapper.java

@@ -1,13 +1,16 @@
 package cn.iocoder.yudao.module.as.dal.mysql.aidingstudentscollegemanage;
 
-import java.util.*;
-
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
 import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
 import cn.iocoder.yudao.module.as.dal.dataobject.aidingstudentscollegemanage.AidingStudentsCollegeManageDO;
+import cn.iocoder.yudao.module.as.dal.dataobject.aidingstudentscollegemanage.AidingStudentsCollegeManageProjectInfoPageRespDO;
 import org.apache.ibatis.annotations.Mapper;
 import cn.iocoder.yudao.module.as.controller.admin.aidingstudentscollegemanage.vo.*;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
 
 /**
  * 家庭困难认定项目学院管理 Mapper
@@ -28,9 +31,19 @@ public interface AidingStudentsCollegeManageMapper extends BaseMapperX<AidingStu
                 .eqIfPresent(AidingStudentsCollegeManageDO::getManageId, reqVO.getManageId())
                 .eqIfPresent(AidingStudentsCollegeManageDO::getCollegeId, reqVO.getCollegeId())
                 .eqIfPresent(AidingStudentsCollegeManageDO::getCollegeNoticeFile, reqVO.getCollegeNoticeFile())
-                .likeIfPresent(AidingStudentsCollegeManageDO::getCollegeNoticeFileName, reqVO.getCollegeNoticeFileName())
+                //.likeIfPresent(AidingStudentsCollegeManageDO::getCollegeNoticeFileName, reqVO.getCollegeNoticeFileName())
                 .betweenIfPresent(AidingStudentsCollegeManageDO::getReportingTime, reqVO.getReportingTime())
                 .orderByDesc(AidingStudentsCollegeManageDO::getId));
     }
 
+    @Select("SELECT as_aiding_students_manage.id,di_name,di_status,di_notice,di_notice_file,di_notice_file_name,di_end_time, " +
+            "submit_time,evaluation_time,audit_time,publicity_time,com_status,manage_id,college_id,college_notice_file,college_notice_file_name,reporting_time,as_aiding_students_manage.create_time ,as_aiding_students_manage.creator " +
+            "FROM as_aiding_students_manage left join as_aiding_students_college_manage on  as_aiding_students_manage.id= as_aiding_students_college_manage.manage_id and as_aiding_students_college_manage.deleted=false " +
+            "where as_aiding_students_manage.deleted=false and as_aiding_students_manage.di_status!=0 " +
+            "ORDER BY as_aiding_students_manage.create_time DESC  limit #{pageSize} offset #{offset}")
+    List<AidingStudentsCollegeManageProjectInfoPageRespDO> selectProjectInfoPage(@Param("pageSize") Integer pageSize, @Param("offset") Integer offset);
+
+    @Select("SELECT count(1) FROM as_aiding_students_manage left join as_aiding_students_college_manage on  as_aiding_students_manage.id= as_aiding_students_college_manage.manage_id and as_aiding_students_college_manage.deleted=false " +
+            "where as_aiding_students_manage.deleted=false")
+    Long selectProjectInfoPageCount();
 }

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

@@ -5,7 +5,7 @@ import javax.validation.*;
 import cn.iocoder.yudao.module.as.controller.admin.aidingstudentscollegemanage.vo.*;
 import cn.iocoder.yudao.module.as.dal.dataobject.aidingstudentscollegemanage.AidingStudentsCollegeManageDO;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
 
 /**
  * 家庭困难认定项目学院管理 Service 接口
@@ -53,4 +53,8 @@ public interface AidingStudentsCollegeManageService {
     PageResult<AidingStudentsCollegeManageDO> getAidingStudentsCollegeManagePage(AidingStudentsCollegeManagePageReqVO pageReqVO);
 
     Map<String, Long> getAidingStudentsCollegeManageCount();
+
+    List<AdminUserRespDTO> getCollegeAllStudent();
+
+    PageResult<AidingStudentsCollegeManageProjectInfoRespVO> getProjectInfoPage(AidingStudentsCollegeManageProjectInfoPageRespVO pageReqVO);
 }

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

@@ -1,17 +1,24 @@
 package cn.iocoder.yudao.module.as.service.aidingstudentscollegemanage;
 
+import cn.iocoder.yudao.module.as.dal.dataobject.aidingstudentscollegemanage.AidingStudentsCollegeManageProjectInfoPageRespDO;
+import cn.iocoder.yudao.module.as.dal.dataobject.aidingstudentsmanage.AidingStudentsManageDO;
+import cn.iocoder.yudao.module.as.dal.mysql.aidingstudentsmanage.AidingStudentsManageMapper;
 import cn.iocoder.yudao.module.system.api.dept.DeptApi;
+import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
 import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
+import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import org.springframework.stereotype.Service;
+
 import javax.annotation.Resource;
+
 import org.springframework.validation.annotation.Validated;
-import org.springframework.transaction.annotation.Transactional;
 
 import java.util.*;
+
 import cn.iocoder.yudao.module.as.controller.admin.aidingstudentscollegemanage.vo.*;
 import cn.iocoder.yudao.module.as.dal.dataobject.aidingstudentscollegemanage.AidingStudentsCollegeManageDO;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.framework.common.pojo.PageParam;
 import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
 
 import cn.iocoder.yudao.module.as.dal.mysql.aidingstudentscollegemanage.AidingStudentsCollegeManageMapper;
@@ -32,6 +39,8 @@ public class AidingStudentsCollegeManageServiceImpl implements AidingStudentsCol
     @Resource
     private AidingStudentsCollegeManageMapper aidingStudentsCollegeManageMapper;
     @Resource
+    private AidingStudentsManageMapper aidingStudentsManageMapper;
+    @Resource
     private AdminUserApi adminUserApi;
     @Resource
     private DeptApi deptApi;
@@ -39,10 +48,11 @@ public class AidingStudentsCollegeManageServiceImpl implements AidingStudentsCol
     @Override
     public Long createAidingStudentsCollegeManage(AidingStudentsCollegeManageSaveReqVO createReqVO) {
         // 获得学院id
-        Long deptId = adminUserApi.getUser(getLoginUserId()).getDeptId();
+        /*Long deptId = adminUserApi.getUser(getLoginUserId()).getDeptId();
         Long collegeId =  deptApi.getCollegeId(deptId);
-        createReqVO.setCollegeId(collegeId);
-
+        createReqVO.setCollegeId(collegeId);*/
+        //改变状态
+        createReqVO.setComStatus(1);
         // 插入
         AidingStudentsCollegeManageDO aidingStudentsCollegeManage = BeanUtils.toBean(createReqVO, AidingStudentsCollegeManageDO.class);
         aidingStudentsCollegeManageMapper.insert(aidingStudentsCollegeManage);
@@ -97,10 +107,66 @@ public class AidingStudentsCollegeManageServiceImpl implements AidingStudentsCol
         //map.put("publicity", aidingStudentsCollegeManageMapper.selectCount(AidingStudentsCollegeManageDO::getComStatus, 2));
         //进行中
         map.put("ongoing", aidingStudentsCollegeManageMapper.selectCount(AidingStudentsCollegeManageDO::getComStatus, 1)
-                +aidingStudentsCollegeManageMapper.selectCount(AidingStudentsCollegeManageDO::getComStatus, 2));
+                + aidingStudentsCollegeManageMapper.selectCount(AidingStudentsCollegeManageDO::getComStatus, 2));
         //已完成
         map.put("completed", aidingStudentsCollegeManageMapper.selectCount(AidingStudentsCollegeManageDO::getComStatus, 3));
         return map;
     }
 
+    @Override
+    public List<AdminUserRespDTO> getCollegeAllStudent() {
+        //获得学院id
+        Long deptId = adminUserApi.getUser(getLoginUserId()).getDeptId();
+        Long collegeId = deptApi.getCollegeId(deptId);
+
+
+        List<DeptRespDTO> childDeptList = deptApi.getChildDeptList(collegeId);
+        List<Long> deptIds = new ArrayList<>();
+        deptIds.add(collegeId);
+        for (DeptRespDTO deptRespDTO : childDeptList) {
+            deptIds.add(deptRespDTO.getId());
+        }
+        List<AdminUserRespDTO> userList = adminUserApi.getUserListByDeptIds(deptIds);
+        return userList;
+    }
+
+    @Override
+    public PageResult<AidingStudentsCollegeManageProjectInfoRespVO> getProjectInfoPage(AidingStudentsCollegeManageProjectInfoPageRespVO pageReqVO) {
+        //获得分页信息
+        Integer pageNo = pageReqVO.getPageNo();
+        Integer pageSize = pageReqVO.getPageSize();
+        Integer offset = (pageNo - 1) *pageSize;
+        List<AidingStudentsCollegeManageProjectInfoPageRespDO> aidingStudentsCollegeManageProjectInfoRespDOS = aidingStudentsCollegeManageMapper.selectProjectInfoPage(pageSize,offset);
+        //转换
+        List<AidingStudentsCollegeManageProjectInfoRespVO> aidingStudentsCollegeManageProjectInfoRespVOS = BeanUtils.toBean(aidingStudentsCollegeManageProjectInfoRespDOS, AidingStudentsCollegeManageProjectInfoRespVO.class);
+        //判断
+        if (aidingStudentsCollegeManageProjectInfoRespVOS != null){
+            //获得学校项目创建人
+            aidingStudentsCollegeManageProjectInfoRespVOS.forEach(aidingStudentsCollegeManageProjectInfoRespVO -> {
+                aidingStudentsCollegeManageProjectInfoRespVO.setCreator(adminUserApi.getUser(Long.valueOf(aidingStudentsManageMapper.selectById(aidingStudentsCollegeManageProjectInfoRespVO.getId()).getCreator())).getNickname());
+            });
+            //返回项目信息
+            return new PageResult<>(aidingStudentsCollegeManageProjectInfoRespVOS,aidingStudentsCollegeManageMapper.selectProjectInfoPageCount());
+        }
+        return null;
+
+    }
+
+    /*private List<AidingStudentsCollegeManageProjectInfoRespVO> merge2AidingStudentsCollegeManageProjectInfoRespVO
+            (List<AidingStudentsManageDO> aidingStudentsManageDOS, List<AidingStudentsCollegeManageDO> aidingStudentsCollegeManageDOS) {
+        List<AidingStudentsCollegeManageProjectInfoRespVO> aidingStudentsCollegeManageProjectInfoRespVOS = new ArrayList<>();
+
+        aidingStudentsManageDOS.forEach(aidingStudentsManageDO -> {
+            List<AidingStudentsCollegeManageDO> aidingStudentsCollegeManageDO = aidingStudentsCollegeManageMapper.selectList(Wrappers.lambdaQuery(AidingStudentsCollegeManageDO.class)
+                    .eq(AidingStudentsCollegeManageDO::getManageId, aidingStudentsManageDO.getId()));
+            if (aidingStudentsCollegeManageDO == null){
+                aidingStudentsCollegeManageProjectInfoRespVOS.add(AidingStudentsCollegeManageProjectInfoRespVO.builder()
+                        .projectInfo(aidingStudentsManageDO)
+                        .aidingStudentsCollegeManageDO(null)
+                        .build());
+            }
+        });
+    }*/
+
+
 }

+ 2 - 0
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/service/aidingstudentsmanage/AidingStudentsManageServiceImpl.java

@@ -34,6 +34,8 @@ public class AidingStudentsManageServiceImpl implements AidingStudentsManageServ
         // 插入
         AidingStudentsManageDO aidingStudentsManage = BeanUtils.toBean(createReqVO, AidingStudentsManageDO.class);
         aidingStudentsManageMapper.insert(aidingStudentsManage);
+        //改变状态
+        aidingStudentsManage.setDiStatus(1);
         // 返回
         return aidingStudentsManage.getId();
     }

+ 1 - 1
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/service/aidingstudentspersonmanage/AidingStudentsPersonManageServiceImpl.java

@@ -88,7 +88,7 @@ public class AidingStudentsPersonManageServiceImpl extends ServiceImpl<AidingStu
 
         // 学院ID
         Long collegeId = deptApi.getCollegeId(user.getDeptId());
-        aDo.setCollegeId(Math.toIntExact(collegeId));
+        aDo.setCollegeId(collegeId);
         // 学院名称
         DeptRespDTO dept = deptApi.getDept(user.getDeptId());
         aDo.setCollegeName(dept.getName());

+ 7 - 0
yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java

@@ -67,6 +67,13 @@ public interface DeptApi {
      */
     Long getCollegeId(Long id);
 
+
+    /**
+     * 获取学院数量
+     * @return Long
+     */
+    Long getCollegeNum();
+
     /**
      *  获得子集部门
      *

+ 6 - 0
yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/dto/DeptRespDTO.java

@@ -34,4 +34,10 @@ public class DeptRespDTO {
      */
     private Integer status;
 
+    /**
+     * 部门状态
+     *
+     * 枚举 {@link CommonStatusEnum}
+     */
+    private String bs;
 }

+ 9 - 0
yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApi.java

@@ -1,10 +1,15 @@
 package cn.iocoder.yudao.module.system.api.permission;
 
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
 import cn.iocoder.yudao.module.system.api.permission.dto.DeptDataPermissionRespDTO;
+import org.springframework.validation.annotation.Validated;
 
 import java.util.Collection;
+import java.util.List;
 import java.util.Set;
 
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
 /**
  * 权限 API 接口
  *
@@ -46,4 +51,8 @@ public interface PermissionApi {
      */
     DeptDataPermissionRespDTO getDeptDataPermission(Long userId);
 
+    void assignUserRole(Long userId, Set<Long> roleIds);
+
+    Set<Long> getUserRoleIdListByUserId(Long userId);
+
 }

+ 12 - 1
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java

@@ -1,6 +1,7 @@
 package cn.iocoder.yudao.module.system.api.dept;
 
 import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
 import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
 import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
 import cn.iocoder.yudao.module.system.service.dept.DeptService;
@@ -29,6 +30,7 @@ public class DeptApiImpl implements DeptApi {
     }
 
     @Override
+    @DataPermission(enable = false)
     public List<DeptRespDTO> getDeptList(Collection<Long> ids) {
         List<DeptDO> depts = deptService.getDeptList(ids);
         return BeanUtils.toBean(depts, DeptRespDTO.class);
@@ -40,18 +42,27 @@ public class DeptApiImpl implements DeptApi {
     }
 
     @Override
+    @DataPermission(enable = false)
     public List<DeptRespDTO> getChildDeptList(Long id) {
         List<DeptDO> childDeptList = deptService.getChildDeptList(id);
         return BeanUtils.toBean(childDeptList, DeptRespDTO.class);
     }
 
     @Override
+    @DataPermission(enable = false) // 禁用数据权限,避免建立不正确的缓存
     public Long getCollegeId(Long id) {
         Long collegeId = deptService.getCollegeId(id);
         return collegeId;
     }
+    @Override
+    @DataPermission(enable = false) // 禁用数据权限,避免建立不正确的缓存
+    public Long getCollegeNum() {
+        Long collegeId = deptService.getCollegeNum();
+        return collegeId;
+    }
 
-
+    @Override
+    @DataPermission(enable = false)
     public List<DeptRespDTO> getChildDeptListByParent(Long id){
         List<DeptDO> deptList = deptService.getChildDeptListByParent(id);
         return BeanUtils.toBean(deptList, DeptRespDTO.class);

+ 11 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/permission/PermissionApiImpl.java

@@ -6,6 +6,7 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.util.Collection;
+import java.util.List;
 import java.util.Set;
 
 /**
@@ -39,4 +40,14 @@ public class PermissionApiImpl implements PermissionApi {
         return permissionService.getDeptDataPermission(userId);
     }
 
+    @Override
+    public void assignUserRole(Long userId, Set<Long> roleIds) {
+        permissionService.assignUserRole(userId,roleIds);
+    }
+
+    @Override
+    public Set<Long> getUserRoleIdListByUserId(Long userId) {
+        return permissionService.getUserRoleIdListByUserId(userId);
+    }
+
 }

+ 2 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApiImpl.java

@@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.system.api.user;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.ObjUtil;
 import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
 import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
 import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
 import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
@@ -66,6 +67,7 @@ public class AdminUserApiImpl implements AdminUserApi {
     }
 
     @Override
+    @DataPermission(enable = false)
     public List<AdminUserRespDTO> getUserList(Collection<Long> ids) {
         List<AdminUserDO> users = userService.getUserList(ids);
         return BeanUtils.toBean(users, AdminUserRespDTO.class);

+ 17 - 6
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java

@@ -3,6 +3,8 @@ package cn.iocoder.yudao.module.system.controller.admin.dept;
 import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
 import cn.iocoder.yudao.framework.common.pojo.CommonResult;
 import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.system.api.dept.DeptApi;
+import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
 import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
 import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptRespVO;
 import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptSaveReqVO;
@@ -15,12 +17,14 @@ import io.swagger.v3.oas.annotations.tags.Tag;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
-
+import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
 import javax.annotation.Resource;
 import javax.validation.Valid;
+import java.util.ArrayList;
 import java.util.List;
 
 import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
 
 @Tag(name = "管理后台 - 部门")
 @RestController
@@ -28,9 +32,16 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 @Validated
 public class DeptController {
 
+    @Resource
+    private AdminUserApi adminUserApi;
+    @Resource
+    private DeptApi deptApi;
     @Resource
     private DeptService deptService;
 
+    @Resource
+    private PermissionApi permissionApi;
+
     @PostMapping("create")
     @Operation(summary = "创建部门")
     @PreAuthorize("@ss.hasPermission('system:dept:create')")
@@ -67,15 +78,17 @@ public class DeptController {
     @GetMapping(value = {"/list-all-simple", "/simple-list"})
     @Operation(summary = "获取部门精简信息列表", description = "只包含被开启的部门,主要用于前端的下拉选项")
     public CommonResult<List<DeptSimpleRespVO>> getSimpleDeptList() {
-        List<DeptDO> list = deptService.getDeptList(
-                new DeptListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus()));
+        List<DeptDO> list;
+        list = deptService.getDeptList(new DeptListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus()));
         return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
     }
 
     @GetMapping(value = {"/list-all-simple-dept", "/simple-list-dept"})
     @Operation(summary = "获取子部门精简信息列表", description = "只包含被开启的部门,主要用于前端的下拉选项")
     public CommonResult<List<DeptSimpleRespVO>> getSimpleDeptListByDept(@RequestParam("id") Long id) {
-        List<DeptDO> list = deptService.getDeptListByDept(id);
+        Long deptId = adminUserApi.getUser(getLoginUserId()).getDeptId();
+        Long collegeId =  deptApi.getCollegeId(deptId);
+        List<DeptDO> list = deptService.getDeptListByDept(collegeId);
         return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
     }
 
@@ -89,6 +102,4 @@ public class DeptController {
     }
 
 
-
-
 }

+ 6 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java

@@ -7,6 +7,8 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
 import cn.iocoder.yudao.framework.common.pojo.PageParam;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
+import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
 import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.*;
 import cn.iocoder.yudao.module.system.convert.user.UserConvert;
 import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
@@ -34,6 +36,7 @@ import java.util.Map;
 import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
 import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
+import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
 
 @Tag(name = "管理后台 - 用户")
 @RestController
@@ -45,6 +48,8 @@ public class UserController {
     private AdminUserService userService;
     @Resource
     private DeptService deptService;
+    @Resource
+    private PermissionApi permissionApi;
 
     @PostMapping("/create")
     @Operation(summary = "新增用户")
@@ -91,6 +96,7 @@ public class UserController {
     @Operation(summary = "获得用户分页列表")
     @PreAuthorize("@ss.hasPermission('system:user:list')")
     public CommonResult<PageResult<UserRespVO>> getUserPage(@Valid UserPageReqVO pageReqVO) {
+
         // 获得用户分页列表
         PageResult<AdminUserDO> pageResult = userService.getUserPage(pageReqVO);
         if (CollUtil.isEmpty(pageResult.getList())) {

+ 6 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/dept/DeptDO.java

@@ -67,4 +67,10 @@ public class DeptDO extends TenantBaseDO {
      */
     private Integer status;
 
+    /**
+     * 部门状态
+     *
+     * 枚举 {@link CommonStatusEnum}
+     */
+    private String type;
 }

+ 0 - 1
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/user/AdminUserDO.java

@@ -33,7 +33,6 @@ public class AdminUserDO extends TenantBaseDO {
      */
     @TableId
     private Long id;
-
     /**
      * 学号
      */

+ 18 - 3
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/DeptMapper.java

@@ -17,7 +17,12 @@ public interface DeptMapper extends BaseMapperX<DeptDO> {
                 .likeIfPresent(DeptDO::getName, reqVO.getName())
                 .eqIfPresent(DeptDO::getStatus, reqVO.getStatus()));
     }
-
+    default List<DeptDO> selectList(Long collegeId,DeptListReqVO reqVO) {
+        return selectList(new LambdaQueryWrapperX<DeptDO>()
+                .likeIfPresent(DeptDO::getName, reqVO.getName())
+                .eqIfPresent(DeptDO::getStatus, reqVO.getStatus())
+        );
+    }
     default DeptDO selectByParentIdAndName(Long parentId, String name) {
         return selectOne(DeptDO::getParentId, parentId, DeptDO::getName, name);
     }
@@ -30,10 +35,20 @@ public interface DeptMapper extends BaseMapperX<DeptDO> {
         return selectList(DeptDO::getParentId, parentIds);
     }
 
-    default List<DeptDO> selectListByParentId(Long id) {
-        return selectList(DeptDO::getParentId, id);
+    default List<DeptDO> selectListByParentIdAndCollege(Long id) {
+        return selectList(
+                new LambdaQueryWrapperX<DeptDO>()
+                        .eqIfPresent(DeptDO::getParentId, id)
+                        .eqIfPresent(DeptDO::getType,"college")
+              );
     }
+    default List<DeptDO> selectListByParentId(Long id) {
+        return selectList(
+                new LambdaQueryWrapperX<DeptDO>()
+                        .eqIfPresent(DeptDO::getParentId, id)
 
+        );
+    }
     default List<DeptDO> selectListByParentIds(List<Long> ids) {
         return selectList(DeptDO::getParentId, ids);
     }

+ 14 - 1
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java

@@ -63,6 +63,14 @@ public interface DeptService {
      */
     List<DeptDO> getDeptList(DeptListReqVO reqVO);
 
+    /**
+     * 辅导员获取筛选学院部门列表
+     *
+     * @param reqVO 筛选条件请求 VO
+     * @return 部门列表
+     */
+    List<DeptDO> getDeptListByCollege(Long collegeId,DeptListReqVO reqVO);
+
     /**
      * 筛选部门列表
      * @param id 部门id
@@ -97,6 +105,12 @@ public interface DeptService {
      * @return 子部门列表
      */
     Long getCollegeId(Long id);
+    /**
+     * 获取学院数量
+     * @return Long
+     */
+    Long getCollegeNum();
+
 
     /**
      * 通过固定id查找学院id
@@ -133,5 +147,4 @@ public interface DeptService {
      */
     void validateDeptList(Collection<Long> ids);
 
-//    List<DeptDO> updateSchoolDept();
 }

+ 23 - 3
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java

@@ -164,6 +164,7 @@ public class DeptServiceImpl implements DeptService {
     }
 
     @Override
+    @DataPermission(enable = false)
     public List<DeptDO> getDeptList(Collection<Long> ids) {
         if (CollUtil.isEmpty(ids)) {
             return Collections.emptyList();
@@ -177,8 +178,15 @@ public class DeptServiceImpl implements DeptService {
         list.sort(Comparator.comparing(DeptDO::getSort));
         return list;
     }
+    @Override
+    public List<DeptDO> getDeptListByCollege(Long collegeId,DeptListReqVO reqVO) {
+        List<DeptDO> list = deptMapper.selectList(reqVO);
+        list.sort(Comparator.comparing(DeptDO::getSort));
+        return list;
+    }
 
     @Override
+    @DataPermission(enable = false)
     public List<DeptDO> getDeptListByDept(Long id) {
         List<DeptDO> list = getChildDeptList(id);
         list.sort(Comparator.comparing(DeptDO::getSort));
@@ -186,6 +194,7 @@ public class DeptServiceImpl implements DeptService {
     }
 
     @Override
+
     public List<DeptDO> getChildDeptList(Long id) {
         List<DeptDO> children = new LinkedList<>();
         // 遍历每一层
@@ -204,8 +213,15 @@ public class DeptServiceImpl implements DeptService {
         return children;
     }
 
+    @Override
+    @DataPermission(enable = false) // 禁用数据权限,避免建立不正确的缓存
+    public Long getCollegeNum() {
+        List<DeptDO> collegeList = getCollegeListByGlutID(0L);
+        return (long)collegeList.size();
+    }
 
     @Override
+    @DataPermission(enable = false) // 禁用数据权限,避免建立不正确的缓存
     public Long getCollegeId(Long id) {
         List<DeptDO> collegeList = getCollegeListByGlutID(id);
         if(collegeList.isEmpty()){
@@ -215,6 +231,10 @@ public class DeptServiceImpl implements DeptService {
 
         return findCollegeId(id,collegeIdSet);
     }
+
+
+
+    @DataPermission(enable = false) // 禁用数据权限,避免建立不正确的缓存
     public Long findCollegeId(Long id,Set<Long> collegeIdSet) {
         if(collegeIdSet.contains(id)){
             return id;
@@ -228,11 +248,13 @@ public class DeptServiceImpl implements DeptService {
         }
     }
     @Override
+    @DataPermission(enable = false) // 禁用数据权限,避免建立不正确的缓存
     public List<DeptDO> getCollegeListByGlutID(Long id) {
-        return deptMapper.selectListByParentId(0L);
+        return deptMapper.selectListByParentIdAndCollege(0L);
     }
 
     @Override
+    @DataPermission(enable = false)
     public List<DeptDO> getChildDeptListByParent(Long id) {
         return deptMapper.selectListByParentId(id);
     }
@@ -268,6 +290,4 @@ public class DeptServiceImpl implements DeptService {
         });
     }
 
-
-
 }

+ 7 - 1
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/PermissionServiceImpl.java

@@ -309,7 +309,13 @@ public class PermissionServiceImpl implements PermissionService {
             }
             // 情况四,DEPT_DEPT_AND_CHILD
             if (Objects.equals(role.getDataScope(), DataScopeEnum.DEPT_AND_CHILD.getScope())) {
-                CollUtil.addAll(result.getDeptIds(), deptService.getChildDeptIdListFromCache(userDeptId.get()));
+                if(hasAnyRoles(userId,"fudaoyuan")){
+                    Long collegeId = deptService.getCollegeId(userService.getUser(userId).getDeptId());
+                    CollUtil.addAll(result.getDeptIds(),deptService.getChildDeptIdListFromCache(collegeId));
+                    CollUtil.addAll(result.getDeptIds(),collegeId);
+                }else {
+                    CollUtil.addAll(result.getDeptIds(), deptService.getChildDeptIdListFromCache(userDeptId.get()));
+                }
                 // 添加本身部门编号
                 CollUtil.addAll(result.getDeptIds(), userDeptId.get());
                 continue;

+ 3 - 0
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java

@@ -9,6 +9,7 @@ import cn.iocoder.yudao.framework.common.exception.ServiceException;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
 import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
 import cn.iocoder.yudao.framework.datapermission.core.util.DataPermissionUtils;
 import cn.iocoder.yudao.module.infra.api.file.FileApi;
 import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO;
@@ -257,6 +258,7 @@ public class AdminUserServiceImpl implements AdminUserService {
     }
 
     @Override
+    @DataPermission(enable = false)
     public List<AdminUserDO> getUserListByDeptIds(Collection<Long> deptIds) {
         if (CollUtil.isEmpty(deptIds)) {
             return Collections.emptyList();
@@ -277,6 +279,7 @@ public class AdminUserServiceImpl implements AdminUserService {
     }
 
     @Override
+    @DataPermission(enable = false)
     public List<AdminUserDO> getUserList(Collection<Long> ids) {
         if (CollUtil.isEmpty(ids)) {
             return Collections.emptyList();