Browse Source

修复获得学院各个状态,增加助学金项目管理数据库字段

houlai 6 months ago
parent
commit
cbebcdab9f

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

@@ -17,8 +17,8 @@ public interface ErrorCodeConstants {
     ErrorCode AIDING_STUDENTS_IMPORT_LIST_FILE_IMPORT_ERROR = new ErrorCode(2_009_000_009,  "excel解析失败");
     ErrorCode AIDING_STUDENTS_IMPORT_LIST_FAILURE = new ErrorCode(2_009_000_010,  "自治区名单导入失败");
     ErrorCode FINANCIAL_AID_RETIREMENT_LIST_NOT_EXISTS = new ErrorCode(2_009_000_011, "家庭经济困难退役复学学生汇总不存在");
-    ErrorCode FINANCIAL_AID_RETIREMENT_LIST_EXCEL_ISNULL = new ErrorCode(2_009_000_011, "家庭经济困难退役复学学生汇总excel解析为空");
-
+    ErrorCode FINANCIAL_AID_RETIREMENT_LIST_EXCEL_ISNULL = new ErrorCode(2_009_000_012, "家庭经济困难退役复学学生汇总excel解析为空");
+    ErrorCode FINANCIAL_AID_RETIREMENT_LIST_EXISTS= new ErrorCode(2_009_000_013, "家庭经济困难退役复学学生汇总中该学生已存在");
 
 
     ErrorCode STUDENT_INFO_EXISTS = new ErrorCode(2_009_000_009,  "学生信息已存在");

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

@@ -90,8 +90,8 @@ public class AidingStudentsCollegeManageController {
     @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();
+    public CommonResult<Map<String, Long>> getAidingStudentsCollegeManageCount(@RequestParam("manageId") Long manageId) {
+        Map<String, Long> map = aidingStudentsCollegeManageService.getAidingStudentsCollegeManageCount(manageId);
         return success(map);
     }
 

+ 15 - 0
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/financialaidmanage/vo/FinancialAidManagePageReqVO.java

@@ -41,4 +41,19 @@ public class FinancialAidManagePageReqVO extends PageParam {
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private LocalDateTime[] createTime;
 
+    @Schema(description = "绑定家庭经济困难认定管理")
+    private Long asAidingStudentsManageId;
+
+    @Schema(description = "助学金总名额")
+    private Integer financialAidSumQuota;
+
+    @Schema(description = "退役复学总人数")
+    private Integer retirementSumCount;
+
+    @Schema(description = "退役复学excel文件")
+    private String retirementExcelFile;
+
+    @Schema(description = "退役复学excel文件名称")
+    private String retirementExcelFileName;
+
 }

+ 15 - 0
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/financialaidmanage/vo/FinancialAidManageRespVO.java

@@ -49,4 +49,19 @@ public class FinancialAidManageRespVO {
     @ExcelProperty("创建时间")
     private LocalDateTime createTime;
 
+    @Schema(description = "绑定家庭经济困难认定管理")
+    private Long asAidingStudentsManageId;
+
+    @Schema(description = "助学金总名额")
+    private Integer financialAidSumQuota;
+
+    @Schema(description = "退役复学总人数")
+    private Integer retirementSumCount;
+
+    @Schema(description = "退役复学excel文件")
+    private String retirementExcelFile;
+
+    @Schema(description = "退役复学excel文件名称")
+    private String retirementExcelFileName;
+
 }

+ 13 - 1
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/controller/admin/financialaidmanage/vo/FinancialAidManageSaveReqVO.java

@@ -36,6 +36,18 @@ public class FinancialAidManageSaveReqVO {
     private FinancialAidQuota financialAidQuota;
 
     @Schema(description = "绑定家庭经济困难认定管理")
-    private Integer studentManageId;
+    private Long asAidingStudentsManageId;
+
+    @Schema(description = "助学金总名额")
+    private Integer financialAidSumQuota;
+
+    @Schema(description = "退役复学总人数")
+    private Integer retirementSumCount;
+
+    @Schema(description = "退役复学excel文件")
+    private String retirementExcelFile;
+
+    @Schema(description = "退役复学excel文件名称")
+    private String retirementExcelFileName;
 
 }

+ 23 - 0
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/dal/dataobject/financialaidmanage/FinancialAidManageDO.java

@@ -3,10 +3,12 @@ package cn.iocoder.yudao.module.as.dal.dataobject.financialaidmanage;
 import cn.iocoder.yudao.module.as.controller.admin.financialaidmanage.vo.FinancialAidQuota;
 import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
 import lombok.*;
+
 import java.util.*;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
+
 import com.baomidou.mybatisplus.annotation.*;
 import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
 
@@ -60,4 +62,25 @@ public class FinancialAidManageDO extends BaseDO {
     @TableField(typeHandler = JacksonTypeHandler.class)
     private FinancialAidQuota financialAidQuota;
 
+    /*
+     *家庭困难管理外键
+     */
+    private Long asAidingStudentsManageId;
+    /**
+     * 助学金总名额
+     */
+    private Integer financialAidSumQuota;
+    /**
+     * 退役复学总人数
+     */
+    private Integer retirementSumCount;
+    /**
+     * 退役复学excel文件
+     */
+    private String retirementExcelFile;
+    /**
+     * 退役复学excel文件名称
+     */
+    private String retirementExcelFileName;
+
 }

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

@@ -52,7 +52,7 @@ public interface AidingStudentsCollegeManageService {
      */
     PageResult<AidingStudentsCollegeManageDO> getAidingStudentsCollegeManagePage(AidingStudentsCollegeManagePageReqVO pageReqVO);
 
-    Map<String, Long> getAidingStudentsCollegeManageCount();
+    Map<String, Long> getAidingStudentsCollegeManageCount(Long manageId);
 
     List<AdminUserRespDTO> getCollegeAllStudent();
 

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

@@ -102,22 +102,29 @@ public class AidingStudentsCollegeManageServiceImpl implements AidingStudentsCol
     }
 
     @Override
-
-    public Map<String, Long> getAidingStudentsCollegeManageCount() {
+    public Map<String, Long> getAidingStudentsCollegeManageCount(Long manageId) {
         Map<String, Long> map = new LinkedHashMap<>();
-        //总人数
-        map.put("sum", aidingStudentsCollegeManageMapper.selectCount());
+        //学院数
+        Long collegeNum = deptApi.getCollegeNum();
+        //各个状态学院数
+        Long ongoing = aidingStudentsCollegeManageMapper.selectCount(Wrappers.lambdaQuery(AidingStudentsCollegeManageDO.class)
+                .eq(AidingStudentsCollegeManageDO::getManageId, manageId)
+                .eq(AidingStudentsCollegeManageDO::getComStatus, 1))
+                +aidingStudentsCollegeManageMapper.selectCount(Wrappers.lambdaQuery(AidingStudentsCollegeManageDO.class)
+                .eq(AidingStudentsCollegeManageDO::getManageId, manageId)
+                .eq(AidingStudentsCollegeManageDO::getComStatus, 2));
+        Long completed = aidingStudentsCollegeManageMapper.selectCount(Wrappers.lambdaQuery(AidingStudentsCollegeManageDO.class)
+                .eq(AidingStudentsCollegeManageDO::getManageId, manageId)
+                .eq(AidingStudentsCollegeManageDO::getComStatus, 3));
+        Long unpublished=collegeNum-ongoing-completed;
+        //总学院数
+        map.put("sum", collegeNum);
         //未发布
-        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("unpublished", unpublished);
         //进行中
-        map.put("ongoing", aidingStudentsCollegeManageMapper.selectCount(AidingStudentsCollegeManageDO::getComStatus, 1)
-                + aidingStudentsCollegeManageMapper.selectCount(AidingStudentsCollegeManageDO::getComStatus, 2));
+        map.put("ongoing", ongoing);
         //已完成
-        map.put("completed", aidingStudentsCollegeManageMapper.selectCount(AidingStudentsCollegeManageDO::getComStatus, 3));
+        map.put("completed", completed);
         return map;
     }
 

+ 4 - 0
yudao-module-as/yudao-module-as-biz/src/main/java/cn/iocoder/yudao/module/as/service/financialaidretirementlist/FinancialAidRetirementListServiceImpl.java

@@ -41,6 +41,10 @@ public class FinancialAidRetirementListServiceImpl implements FinancialAidRetire
     public Long createFinancialAidRetirementList(FinancialAidRetirementListSaveReqVO createReqVO) {
         // 插入
         FinancialAidRetirementListDO financialAidRetirementList = BeanUtils.toBean(createReqVO, FinancialAidRetirementListDO.class);
+        //判断是否已经存在
+        if (checkStudentCodeExists(financialAidRetirementList.getStudentCode(), financialAidRetirementList.getAsFinancialAidManageId())) {
+            throw exception(FINANCIAL_AID_RETIREMENT_LIST_EXISTS);
+        }
         financialAidRetirementListMapper.insert(financialAidRetirementList);
         // 返回
         return financialAidRetirementList.getId();