Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/dev' into dev

大数据与最优化研究所 8 mēneši atpakaļ
vecāks
revīzija
bd98535ff0
71 mainītis faili ar 1783 papildinājumiem un 654 dzēšanām
  1. 15 0
      src/main/java/com/xjrsoft/common/enums/EnrollTypeEnum.java
  2. 18 0
      src/main/java/com/xjrsoft/common/utils/LocalDateUtil.java
  3. 4 1
      src/main/java/com/xjrsoft/module/banding/service/IBandingTaskClassService.java
  4. 77 7
      src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassServiceImpl.java
  5. 16 21
      src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassStudentServiceImpl.java
  6. 73 35
      src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskServiceImpl.java
  7. 3 0
      src/main/java/com/xjrsoft/module/banding/vo/BandingTaskClassStudentListVo.java
  8. 11 2
      src/main/java/com/xjrsoft/module/base/controller/BaseCourseSubjectController.java
  9. 5 0
      src/main/java/com/xjrsoft/module/base/dto/BaseCourseSubjectPageDto.java
  10. 6 1
      src/main/java/com/xjrsoft/module/base/service/impl/BaseClassServiceImpl.java
  11. 2 0
      src/main/java/com/xjrsoft/module/classtime/controller/ClassTimeStatisticsController.java
  12. 3 3
      src/main/java/com/xjrsoft/module/form/service/impl/FormExecuteServiceImpl.java
  13. 2 0
      src/main/java/com/xjrsoft/module/job/ActivityInfoTask.java
  14. 2 0
      src/main/java/com/xjrsoft/module/job/AttenDanceWarnNoticeTask.java
  15. 2 0
      src/main/java/com/xjrsoft/module/job/AttendanceMessageTask.java
  16. 2 0
      src/main/java/com/xjrsoft/module/job/AttendanceRecordTask.java
  17. 4 0
      src/main/java/com/xjrsoft/module/job/BaseNewStudentTask.java
  18. 116 0
      src/main/java/com/xjrsoft/module/job/EnrollmentStatisticsInfoTask.java
  19. 2 0
      src/main/java/com/xjrsoft/module/job/EvaluateTask.java
  20. 2 0
      src/main/java/com/xjrsoft/module/job/ExamScoreDataTask.java
  21. 2 0
      src/main/java/com/xjrsoft/module/job/HikvisionBaseDataTask.java
  22. 2 0
      src/main/java/com/xjrsoft/module/job/HikvisionLeaveTask.java
  23. 2 0
      src/main/java/com/xjrsoft/module/job/HolidayTask.java
  24. 2 0
      src/main/java/com/xjrsoft/module/job/InsertOutInRecordTask.java
  25. 2 0
      src/main/java/com/xjrsoft/module/job/JianyuekbBaseDataTask.java
  26. 2 0
      src/main/java/com/xjrsoft/module/job/JianyuekbScheduleTask.java
  27. 2 0
      src/main/java/com/xjrsoft/module/job/ProcessNotProcessingAlertTask.java
  28. 2 0
      src/main/java/com/xjrsoft/module/job/ProcessTimeoutAlertTask.java
  29. 2 0
      src/main/java/com/xjrsoft/module/job/StudentDropOutTask.java
  30. 2 0
      src/main/java/com/xjrsoft/module/job/StudentLeaveNoticeTask.java
  31. 2 0
      src/main/java/com/xjrsoft/module/job/StudentReportPlanTask.java
  32. 3 2
      src/main/java/com/xjrsoft/module/job/WfCourseAdjustTask.java
  33. 2 0
      src/main/java/com/xjrsoft/module/job/WhitelistTask.java
  34. 16 15
      src/main/java/com/xjrsoft/module/liteflow/node/StudentDropOutNode.java
  35. 114 19
      src/main/java/com/xjrsoft/module/liteflow/node/StudentTransferNode.java
  36. 11 0
      src/main/java/com/xjrsoft/module/oa/controller/NewsController.java
  37. 59 0
      src/main/java/com/xjrsoft/module/schedule/controller/ScheduleController.java
  38. 32 0
      src/main/java/com/xjrsoft/module/schedule/vo/CourseNamesVo.java
  39. 319 337
      src/main/java/com/xjrsoft/module/student/controller/BaseNewStudentReportController.java
  40. 3 3
      src/main/java/com/xjrsoft/module/student/controller/PbCseFeeobjupdateController.java
  41. 29 3
      src/main/java/com/xjrsoft/module/student/controller/StudentReportPlanController.java
  42. 21 10
      src/main/java/com/xjrsoft/module/student/controller/StudentTryReadingReportController.java
  43. 3 0
      src/main/java/com/xjrsoft/module/student/dto/PbVXsxxsfytbPageDto.java
  44. 5 0
      src/main/java/com/xjrsoft/module/student/dto/StudentReportSignDto.java
  45. 8 0
      src/main/java/com/xjrsoft/module/student/dto/StudentTryReadingReportPageDto.java
  46. 91 0
      src/main/java/com/xjrsoft/module/student/entity/EnrollmentStatisticsInfo.java
  47. 2 1
      src/main/java/com/xjrsoft/module/student/entity/PbCseFeeobjupdate.java
  48. 0 5
      src/main/java/com/xjrsoft/module/student/entity/StudentTransfer.java
  49. 27 0
      src/main/java/com/xjrsoft/module/student/mapper/EnrollmentStatisticsInfoMapper.java
  50. 6 0
      src/main/java/com/xjrsoft/module/student/service/IPbCseFeeobjupdateService.java
  51. 2 0
      src/main/java/com/xjrsoft/module/student/service/IStudentReportPlanService.java
  52. 12 4
      src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentSchoolRollServiceImpl.java
  53. 242 160
      src/main/java/com/xjrsoft/module/student/service/impl/PbCseFeeobjupdateServiceImpl.java
  54. 4 2
      src/main/java/com/xjrsoft/module/student/service/impl/PbVXsxxsfytbServiceImpl.java
  55. 14 0
      src/main/java/com/xjrsoft/module/student/service/impl/StudentReportPlanServiceImpl.java
  56. 12 3
      src/main/java/com/xjrsoft/module/student/service/impl/StudentReportRecordServiceImpl.java
  57. 3 0
      src/main/java/com/xjrsoft/module/student/vo/BaseStudentInfoDetailVo.java
  58. 3 0
      src/main/java/com/xjrsoft/module/student/vo/BaseStudentInfoPageVo.java
  59. 4 0
      src/main/java/com/xjrsoft/module/student/vo/EnrollmentStatisticsInfoVo.java
  60. 1 1
      src/main/java/com/xjrsoft/module/student/vo/PbVXsxxsfytbPageVo.java
  61. 5 4
      src/main/java/com/xjrsoft/module/workflow/dto/MyExaminePageDto.java
  62. 9 9
      src/main/java/com/xjrsoft/module/workflow/utils/WorkFlowUtil.java
  63. 1 1
      src/main/resources/mapper/banding/BandingTaskClassMapper.xml
  64. 1 1
      src/main/resources/mapper/oa/NewsMapper.xml
  65. 3 1
      src/main/resources/mapper/student/BaseStudentSchoolRollMapper.xml
  66. 16 2
      src/main/resources/mapper/student/StudentReportRecordMapper.xml
  67. 9 0
      src/main/resources/mapper/workflow/WorkflowExtraMapper.xml
  68. 113 0
      src/test/java/com/xjrsoft/module/job/EnrollmentStatisticsInfoTaskTest.java
  69. 1 1
      src/test/java/com/xjrsoft/module/job/JianyuekbBaseDataTaskTest.java
  70. 65 0
      src/test/java/com/xjrsoft/module/job/WfCourseAdjustTaskTest.java
  71. 125 0
      src/test/java/com/xjrsoft/module/liteflow/node/StudentTransferNodeTest.java

+ 15 - 0
src/main/java/com/xjrsoft/common/enums/EnrollTypeEnum.java

@@ -1,5 +1,8 @@
 package com.xjrsoft.common.enums;
 
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * @description: 招生类型
  * @Author: SZS
@@ -19,6 +22,14 @@ public enum EnrollTypeEnum {
     final String code;
     final String value;
 
+    private static final Map<String, String> lookup = new HashMap<>();
+
+    static {
+        for (ArchivesStatusEnum s : ArchivesStatusEnum.values()) {
+            lookup.put(s.getCode(), s.getValue());
+        }
+    }
+
     public String getCode() {
         return this.code;
     }
@@ -31,4 +42,8 @@ public enum EnrollTypeEnum {
         this.code = code;
         this.value = message;
     }
+
+    public static String fromCode(String code) {
+        return lookup.get(code);
+    }
 }

+ 18 - 0
src/main/java/com/xjrsoft/common/utils/LocalDateUtil.java

@@ -1,6 +1,9 @@
 package com.xjrsoft.common.utils;
 
+import com.xjrsoft.common.exception.MyException;
+
 import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
 
 /**
  * @author dzx
@@ -19,4 +22,19 @@ public class LocalDateUtil {
         // 检查目标日期是否在开始日期和结束日期之间(包含边界)
         return !targetDate.isBefore(startDate) && !targetDate.isAfter(endDate);
     }
+
+
+    public static LocalDate getBirthDate(String idCardNumber){
+        // 获取出生日期前6位,即yyyyMM
+        String birthdayString = idCardNumber.substring(6, 14);
+
+        // 将字符串解析为LocalDate对象
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
+        try {
+            LocalDate parse = LocalDate.parse(birthdayString, formatter);
+            return parse;
+        }catch (Exception e){
+            throw new MyException("身份证号填写错误,无法提取出生日期");
+        }
+    }
 }

+ 4 - 1
src/main/java/com/xjrsoft/module/banding/service/IBandingTaskClassService.java

@@ -11,6 +11,7 @@ import com.xjrsoft.module.banding.vo.BandingTaskClassReportStatisticsVo;
 import com.xjrsoft.module.banding.vo.BandingTaskClassStudentListVo;
 import com.xjrsoft.module.banding.vo.BandingTaskClassSureListVo;
 import com.xjrsoft.module.base.entity.BaseClass;
+import com.xjrsoft.module.student.dto.StudentTryReadingReportPageDto;
 
 import java.util.List;
 import java.util.Map;
@@ -69,5 +70,7 @@ public interface IBandingTaskClassService extends MPJBaseService<BandingTaskClas
 
     Boolean deleteClass(List<Long> ids);
 
-    BandingTaskClassReportStatisticsVo getTryReadingReportClassStatistics(Long classId);
+    BandingTaskClassReportStatisticsVo getTryReadingReportClassStatistics(StudentTryReadingReportPageDto dto);
+
+    Boolean removeByBaseClass(BaseClass baseClass);
 }

+ 77 - 7
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassServiceImpl.java

@@ -5,13 +5,17 @@ import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.NumberUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.xjrsoft.common.constant.GlobalConstant;
 import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.enums.EnabledMark;
 import com.xjrsoft.common.enums.GenderDictionaryEnum;
+import com.xjrsoft.common.enums.RoleEnum;
 import com.xjrsoft.common.enums.YesOrNoEnum;
 import com.xjrsoft.common.exception.MyException;
+import com.xjrsoft.common.utils.RedisUtil;
 import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.banding.dto.BandingTaskClassPageDto;
 import com.xjrsoft.module.banding.dto.BandingTaskClassStudentPageDto;
@@ -36,6 +40,8 @@ import com.xjrsoft.module.base.mapper.BaseGradeMapper;
 import com.xjrsoft.module.base.service.IBaseClassroomService;
 import com.xjrsoft.module.base.service.IBaseMajorSetService;
 import com.xjrsoft.module.organization.entity.User;
+import com.xjrsoft.module.organization.entity.UserRoleRelation;
+import com.xjrsoft.module.organization.service.IUserRoleRelationService;
 import com.xjrsoft.module.organization.service.IUserService;
 import com.xjrsoft.module.student.dto.StudentTryReadingReportPageDto;
 import com.xjrsoft.module.student.entity.EnrollmentPlan;
@@ -61,6 +67,7 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.CompletableFuture;
 import java.util.stream.Collectors;
 
 /**
@@ -84,6 +91,8 @@ public class BandingTaskClassServiceImpl extends MPJBaseServiceImpl<BandingTaskC
     private final EnrollmentPlanMapper enrollmentPlanMapper;
     private final IStudentReportPlanService reportPlanService;
     private final BaseGradeMapper gradeMapper;
+    private final IUserRoleRelationService roleRelationService;
+    private final RedisUtil redisUtil;
 
 
     @Override
@@ -305,6 +314,23 @@ public class BandingTaskClassServiceImpl extends MPJBaseServiceImpl<BandingTaskC
                         baseClass.setCode(baseGrade.getTitle().replace("年", "") + String.format("%03d", i));
                     }
                     classMapper.updateById(baseClass);
+
+                    //给该老师添加班主任角色
+                    if (baseClass.getTeacherId() != null) {
+                        long count = roleRelationService.count(
+                                new QueryWrapper<UserRoleRelation>().lambda()
+                                        .eq(UserRoleRelation::getUserId, baseClass.getTeacherId())
+                                        .eq(UserRoleRelation::getRoleId, RoleEnum.CLASSTE.getCode())
+                        );
+                        if (count == 0) {
+                            roleRelationService.save(
+                                    new UserRoleRelation() {{
+                                        setRoleId(RoleEnum.CLASSTE.getCode());
+                                        setUserId(baseClass.getTeacherId());
+                                    }}
+                            );
+                        }
+                    }
                 }else{
                     i ++;
                     BaseClass baseClass = new BaseClass();
@@ -323,6 +349,22 @@ public class BandingTaskClassServiceImpl extends MPJBaseServiceImpl<BandingTaskC
                     baseClass.setCode(baseGrade.getTitle().replace("年", "") + String.format("%03d", i));
                     classMapper.insert(baseClass);
                     sourceObj.setBaseClassId(baseClass.getId());
+
+                    if (baseClass.getTeacherId() != null) {
+                        long count = roleRelationService.count(
+                                new QueryWrapper<UserRoleRelation>().lambda()
+                                        .eq(UserRoleRelation::getUserId, baseClass.getTeacherId())
+                                        .eq(UserRoleRelation::getRoleId, RoleEnum.CLASSTE.getCode())
+                        );
+                        if (count == 0) {
+                            roleRelationService.save(
+                                    new UserRoleRelation() {{
+                                        setRoleId(RoleEnum.CLASSTE.getCode());
+                                        setUserId(baseClass.getTeacherId());
+                                    }}
+                            );
+                        }
+                    }
                 }
                 if(sourceObj.getSortCode() == null){
                     updNullList.add(sourceObj);
@@ -350,6 +392,21 @@ public class BandingTaskClassServiceImpl extends MPJBaseServiceImpl<BandingTaskC
                 baseClass.setCreateDate(new Date());
                 baseClass.setCode(baseGrade.getTitle().replace("年", "") + String.format("%03d", i));
                 classMapper.insert(baseClass);
+                if (baseClass.getTeacherId() != null) {
+                    long count = roleRelationService.count(
+                            new QueryWrapper<UserRoleRelation>().lambda()
+                                    .eq(UserRoleRelation::getUserId, baseClass.getTeacherId())
+                                    .eq(UserRoleRelation::getRoleId, RoleEnum.CLASSTE.getCode())
+                    );
+                    if (count == 0) {
+                        roleRelationService.save(
+                                new UserRoleRelation() {{
+                                    setRoleId(RoleEnum.CLASSTE.getCode());
+                                    setUserId(baseClass.getTeacherId());
+                                }}
+                        );
+                    }
+                }
 
                 taskClass.setBaseClassId(baseClass.getId());
                 insList.add(taskClass);
@@ -363,11 +420,16 @@ public class BandingTaskClassServiceImpl extends MPJBaseServiceImpl<BandingTaskC
             this.updateNull(updNullList);
         }
 
+        CompletableFuture.runAsync(() -> {
+            List<UserRoleRelation> userRoleRelationList = roleRelationService.list(Wrappers.lambdaQuery(UserRoleRelation.class));
+            redisUtil.set(GlobalConstant.USER_ROLE_RELATION_CACHE_KEY, userRoleRelationList);
+        });
 
         this.saveBatch(insList);
         return this.updateBatchById(updList);
     }
 
+
     /**
      * 班级管理中,修改信息时同步修改新生分班中的班级信息
      */
@@ -491,10 +553,9 @@ public class BandingTaskClassServiceImpl extends MPJBaseServiceImpl<BandingTaskC
     }
 
     @Override
-    public BandingTaskClassReportStatisticsVo getTryReadingReportClassStatistics(Long classId) {
+    public BandingTaskClassReportStatisticsVo getTryReadingReportClassStatistics(StudentTryReadingReportPageDto dto) {
         BandingTaskClassReportStatisticsVo result = new BandingTaskClassReportStatisticsVo();
-        StudentTryReadingReportPageDto dto = new StudentTryReadingReportPageDto();
-        if(classId == 0L){
+        if(dto.getClassId() == 0L){
             StudentReportPlan plan = reportPlanService.getLastTryReadingPlan();
             BandingTask bandingTask = bandingTaskMapper.selectById(plan.getBandingTaskId());
             List<EnrollmentPlan> enrollmentPlans = enrollmentPlanMapper.selectList(
@@ -509,7 +570,7 @@ public class BandingTaskClassServiceImpl extends MPJBaseServiceImpl<BandingTaskC
                 dto.setEnrollmentPlanId(enrollmentPlans.get(0).getId());
             }
         }else{
-            BandingTaskClass taskClass = this.getById(classId);
+            BandingTaskClass taskClass = this.getById(dto.getClassId());
             BandingTask task = bandingTaskMapper.selectById(taskClass.getBandingTaskId());
             List<EnrollmentPlan> enrollmentPlanList = enrollmentPlanMapper.selectList(
                     new QueryWrapper<EnrollmentPlan>().lambda()
@@ -524,19 +585,19 @@ public class BandingTaskClassServiceImpl extends MPJBaseServiceImpl<BandingTaskC
             }
         }
 
-        dto.setClassId(classId);
+        dto.setClassId(dto.getClassId());
         List<StudentReportRecordPlanPageVo> tryReadingList = reportRecordMapper.getTryReadingList(dto);
 
         result.setAllCount(tryReadingList.size());
 
         //女生人数
         List<StudentReportRecordPlanPageVo> femaleList = tryReadingList.stream()
-                .filter(x -> x.getGender() != null && GenderDictionaryEnum.FEMALE.getValue().equals(x.getGender()))
+                .filter(x -> x.getGender() != null && GenderDictionaryEnum.MALE.getValue().equals(x.getGender()))
                 .collect(Collectors.toList());
         result.setMaleCount(femaleList.size());
         //男生人数
         List<StudentReportRecordPlanPageVo> maleList = tryReadingList.stream()
-                .filter(x -> x.getGender() != null && GenderDictionaryEnum.MALE.getValue().equals(x.getGender()))
+                .filter(x -> x.getGender() != null && GenderDictionaryEnum.FEMALE.getValue().equals(x.getGender()))
                 .collect(Collectors.toList());
         result.setFemaleCount(maleList.size());
         //已到人数
@@ -555,4 +616,13 @@ public class BandingTaskClassServiceImpl extends MPJBaseServiceImpl<BandingTaskC
 
         return result;
     }
+
+    @Override
+    public Boolean removeByBaseClass(BaseClass baseClass) {
+        boolean remove = this.remove(
+                new QueryWrapper<BandingTaskClass>().lambda()
+                        .eq(BandingTaskClass::getBaseClassId, baseClass.getId())
+        );
+        return remove;
+    }
 }

+ 16 - 21
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassStudentServiceImpl.java

@@ -12,6 +12,7 @@ import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.enums.EnabledMark;
 import com.xjrsoft.common.enums.RoleEnum;
 import com.xjrsoft.common.exception.MyException;
+import com.xjrsoft.common.utils.LocalDateUtil;
 import com.xjrsoft.common.utils.RedisUtil;
 import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.config.CommonPropertiesConfig;
@@ -184,13 +185,12 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
             }
         }
 
-
+        List<Long> studentIds = dataList.stream().map(BandingTaskClassStudent::getNewStudentId).collect(Collectors.toList());
+        List<BaseNewStudent> list = newStudentService.list(
+                new QueryWrapper<BaseNewStudent>().lambda()
+                        .in(BaseNewStudent::getId, studentIds)
+        );
         if(dto.getIsHandle() != null && dto.getIsHandle() == 1){
-            List<Long> studentIds = dataList.stream().map(BandingTaskClassStudent::getNewStudentId).collect(Collectors.toList());
-            List<BaseNewStudent> list = newStudentService.list(
-                    new QueryWrapper<BaseNewStudent>().lambda()
-                            .in(BaseNewStudent::getId, studentIds)
-            );
             List<BaseNewStudent> updateList = new ArrayList<>();
             for (BaseNewStudent student : list) {
                 student.setStatus(1);
@@ -292,7 +292,7 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
                         }
                         continue;
                     }
-                    LocalDate birthDate = getBirthDate(student.getCredentialNumber());
+                    LocalDate birthDate = LocalDateUtil.getBirthDate(student.getCredentialNumber());
                     User xjrUser = new User() {{
                         setCreateDate(now);
                         setPassword(BCrypt.hashpw(propertiesConfig.getDefaultPassword(), BCrypt.gensalt()));
@@ -361,24 +361,19 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
                 List<UserRoleRelation> userRoleRelationList = roleRelationService.list(Wrappers.lambdaQuery(UserRoleRelation.class));
                 redisUtil.set(GlobalConstant.USER_ROLE_RELATION_CACHE_KEY, userRoleRelationList);
             });
+        }else{
+            List<BaseNewStudent> updateList = new ArrayList<>();
+            for (BaseNewStudent student : list) {
+                student.setRemarks(dto.getRemarks());
+                updateList.add(student);
+            }
+            if(!updateList.isEmpty()){
+                newStudentService.updateBatchById(updateList);
+            }
         }
         return true;
     }
 
-    LocalDate getBirthDate(String idCardNumber){
-        // 获取出生日期前6位,即yyyyMM
-        String birthdayString = idCardNumber.substring(6, 14);
-
-        // 将字符串解析为LocalDate对象
-        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
-        try {
-            LocalDate parse = LocalDate.parse(birthdayString, formatter);
-            return parse;
-        }catch (Exception e){
-            throw new MyException("身份证号填写错误,无法提取出生日期");
-        }
-    }
-
     @Override
     @Transactional
     public Boolean removeStudent(ChangeClassDto dto) {

+ 73 - 35
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskServiceImpl.java

@@ -11,6 +11,7 @@ import com.xjrsoft.common.constant.GlobalConstant;
 import com.xjrsoft.common.enums.ArchivesStatusEnum;
 import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.enums.EnabledMark;
+import com.xjrsoft.common.enums.EnrollTypeEnum;
 import com.xjrsoft.common.enums.GenderDictionaryEnum;
 import com.xjrsoft.common.enums.RoleEnum;
 import com.xjrsoft.common.exception.MyException;
@@ -748,10 +749,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
         }
         BandingTask bandingTask = this.getById(dto.getId());
 
-        List<BaseNewStudent> list = newStudentService.list(
-                new QueryWrapper<BaseNewStudent>().lambda()
-                        .in(BaseNewStudent::getId, studentIds)
-        );
+        List<BaseNewStudent> list = newStudentService.listByIds(studentIds);
         List<BaseNewStudent> updateList = new ArrayList<>();
         for (BaseNewStudent student : list) {
             student.setStatus(1);
@@ -763,43 +761,83 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
             newStudentService.updateBatchById(updateList);
         }
 
-        //新增报到计划,如果有多个分班任务确认,需要保证试读报到计划只有一个
-        BaseSemester semester = semesterService.getCurrentSemester();
-        StudentReportPlan plan = reportPlanService.getOne(
-                new QueryWrapper<StudentReportPlan>().lambda()
-                        .eq(StudentReportPlan::getDeleteMark, DeleteMark.NODELETE.getCode())
-                        .eq(StudentReportPlan::getEnabledMark, EnabledMark.ENABLED.getCode())
-                        .eq(StudentReportPlan::getSemesterId, semester.getId())
-                        .eq(StudentReportPlan::getCategory, 2)
-                        .eq(StudentReportPlan::getBandingTaskId, dto.getBandingTaskId())
-        );
-        if(plan == null){
-            plan = new StudentReportPlan() {{
-                setName(bandingTask.getName());
-                setCategory(2);
-                setSemesterId(semester.getId());
-                setBandingTaskId(dto.getId());
-                setCreateDate(new Date());
-                setCreateUserId(StpUtil.getLoginIdAsLong());
-            }};
+        //新增试读报到计划,如果有多个分班任务确认,需要保证试读报到计划只有一个
+        {
+            BaseSemester semester = semesterService.getCurrentSemester();
+            StudentReportPlan plan = reportPlanService.getOne(
+                    new QueryWrapper<StudentReportPlan>().lambda()
+                            .eq(StudentReportPlan::getDeleteMark, DeleteMark.NODELETE.getCode())
+                            .eq(StudentReportPlan::getEnabledMark, EnabledMark.ENABLED.getCode())
+                            .eq(StudentReportPlan::getSemesterId, semester.getId())
+                            .eq(StudentReportPlan::getCategory, 2)
+                            .eq(StudentReportPlan::getBandingTaskId, dto.getId())
+            );
+            if(plan == null){
+                BaseGrade grade = gradeService.getById(bandingTask.getGradeId());
+                plan = new StudentReportPlan() {{
+                    setCategory(2);
+                    setName(grade.getName() + EnrollTypeEnum.fromCode(bandingTask.getEnrollType()) + "试读报到");
+                    setSemesterId(semester.getId());
+                    setBandingTaskId(dto.getId());
+                    setCreateDate(new Date());
+                    setCreateUserId(StpUtil.getLoginIdAsLong());
+                }};
 
-            reportPlanService.save(plan);
-        }
+                reportPlanService.save(plan);
+            }
 
 
-        //将新生数据初始化到报到表中
-        for (BaseNewStudent student : updateList) {
-            StudentReportRecord record = new StudentReportRecord();
-            record.setCreateDate(new Date());
-            record.setCreateUserId(StpUtil.getLoginIdAsLong());
-            record.setUserId(student.getId());
-            record.setStudentReportPlanId(plan.getId());
-            record.setDeleteMark(DeleteMark.NODELETE.getCode());
-            record.setEnabledMark(EnabledMark.ENABLED.getCode());
-            reportRecordMapper.insert(record);
+            //将新生数据初始化到报到表中
+            for (BaseNewStudent student : updateList) {
+                StudentReportRecord record = new StudentReportRecord();
+                record.setCreateDate(new Date());
+                record.setCreateUserId(StpUtil.getLoginIdAsLong());
+                record.setUserId(student.getId());
+                record.setStudentReportPlanId(plan.getId());
+                record.setDeleteMark(DeleteMark.NODELETE.getCode());
+                record.setEnabledMark(EnabledMark.ENABLED.getCode());
+                reportRecordMapper.insert(record);
+            }
         }
 
+        //新增新生报到计划,如果有多个分班任务确认,需要保证试读报到计划只有一个
+        {
+            BaseSemester semester = semesterService.getCurrentSemester();
+            StudentReportPlan plan = reportPlanService.getOne(
+                    new QueryWrapper<StudentReportPlan>().lambda()
+                            .eq(StudentReportPlan::getDeleteMark, DeleteMark.NODELETE.getCode())
+                            .eq(StudentReportPlan::getEnabledMark, EnabledMark.ENABLED.getCode())
+                            .eq(StudentReportPlan::getSemesterId, semester.getId())
+                            .eq(StudentReportPlan::getCategory, 3)
+                            .eq(StudentReportPlan::getBandingTaskId, dto.getId())
+            );
+            if(plan == null){
+                BaseGrade grade = gradeService.getById(bandingTask.getGradeId());
+                plan = new StudentReportPlan() {{
+                    setCategory(3);
+                    setName(grade.getName() + EnrollTypeEnum.fromCode(bandingTask.getEnrollType()) + "新生报到");
+                    setSemesterId(semester.getId());
+                    setBandingTaskId(dto.getId());
+                    setCreateDate(new Date());
+                    setCreateUserId(StpUtil.getLoginIdAsLong());
+                }};
+
+                reportPlanService.save(plan);
+            }
+
 
+            //将新生数据初始化到报到表中
+            for (BaseNewStudent student : updateList) {
+                StudentReportRecord record = new StudentReportRecord();
+                record.setCreateDate(new Date());
+                record.setCreateUserId(StpUtil.getLoginIdAsLong());
+                record.setUserId(student.getId());
+                record.setStudentReportPlanId(plan.getId());
+                record.setDeleteMark(DeleteMark.NODELETE.getCode());
+                record.setEnabledMark(EnabledMark.ENABLED.getCode());
+                reportRecordMapper.insert(record);
+            }
+        }
 
         bandingTask.setStatus(1);
         bandingTask.setModifyDate(new Date());

+ 3 - 0
src/main/java/com/xjrsoft/module/banding/vo/BandingTaskClassStudentListVo.java

@@ -56,4 +56,7 @@ public class BandingTaskClassStudentListVo {
     @ApiModelProperty("分数")
     private BigDecimal score;
 
+    @ApiModelProperty("分班备注")
+    private String remarks;
+
 }

+ 11 - 2
src/main/java/com/xjrsoft/module/base/controller/BaseCourseSubjectController.java

@@ -1,7 +1,9 @@
 package com.xjrsoft.module.base.controller;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.StrUtil;
 import com.alibaba.excel.EasyExcel;
 import com.alibaba.excel.support.ExcelTypeEnum;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -29,6 +31,7 @@ import javax.validation.Valid;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -55,7 +58,10 @@ public class BaseCourseSubjectController {
         MPJLambdaWrapper<BaseCourseSubject> queryWrapper = new MPJLambdaWrapper<>();
         queryWrapper
                 .orderByDesc(BaseCourseSubject::getId)
-                .select(BaseCourseSubject.class, x -> VoToColumnUtil.fieldsToColumns(BaseCourseSubjectPageVo.class).contains(x.getProperty()));
+                .select(BaseCourseSubject::getId)
+                .select(BaseCourseSubject.class, x -> VoToColumnUtil.fieldsToColumns(BaseCourseSubjectPageVo.class).contains(x.getProperty()))
+                .like(StrUtil.isNotEmpty(dto.getName()), BaseCourseSubject::getName, dto.getName())
+                .like(StrUtil.isNotEmpty(dto.getCode()), BaseCourseSubject::getCode, dto.getCode());
         IPage<BaseCourseSubject> page = baseCourseSubjectService.page(ConventPage.getPage(dto), queryWrapper);
         PageOutput<BaseCourseSubjectPageVo> pageOutput = ConventPage.getPageOutput(page, BaseCourseSubjectPageVo.class);
         return RT.ok(pageOutput);
@@ -80,6 +86,8 @@ public class BaseCourseSubjectController {
     @XjrLog(value = "新增课程学科")
     public RT<Boolean> add(@Valid @RequestBody AddBaseCourseSubjectDto dto) {
         BaseCourseSubject baseCourseSubject = BeanUtil.toBean(dto, BaseCourseSubject.class);
+        baseCourseSubject.setCreateDate(new Date());
+        baseCourseSubject.setCreateUserId(StpUtil.getLoginIdAsLong());
         boolean isSuccess = baseCourseSubjectService.add(baseCourseSubject);
         return RT.ok(isSuccess);
     }
@@ -89,8 +97,9 @@ public class BaseCourseSubjectController {
     @SaCheckPermission("basecoursesubject:edit")
     @XjrLog(value = "修改课程学科")
     public RT<Boolean> update(@Valid @RequestBody UpdateBaseCourseSubjectDto dto) {
-
         BaseCourseSubject baseCourseSubject = BeanUtil.toBean(dto, BaseCourseSubject.class);
+        baseCourseSubject.setModifyDate(new Date());
+        baseCourseSubject.setModifyUserId(StpUtil.getLoginIdAsLong());
         return RT.ok(baseCourseSubjectService.update(baseCourseSubject));
 
     }

+ 5 - 0
src/main/java/com/xjrsoft/module/base/dto/BaseCourseSubjectPageDto.java

@@ -1,6 +1,7 @@
 package com.xjrsoft.module.base.dto;
 
 import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -15,5 +16,9 @@ import lombok.EqualsAndHashCode;
 @EqualsAndHashCode(callSuper = false)
 public class BaseCourseSubjectPageDto extends PageInput {
 
+    @ApiModelProperty("课程学科名称")
+    private String name;
 
+    @ApiModelProperty("课程学科代码")
+    private String code;
 }

+ 6 - 1
src/main/java/com/xjrsoft/module/base/service/impl/BaseClassServiceImpl.java

@@ -233,7 +233,12 @@ public class BaseClassServiceImpl extends MPJBaseServiceImpl<BaseClassMapper, Ba
         baseClass.setModifyUserId(StpUtil.getLoginIdAsLong());
         boolean update = this.updateById(baseClass);
         if (update) {
-            bandingTaskClassService.updateByBaseClass(baseClass);
+            if(baseClass.getIsGraduate() != null && baseClass.getIsGraduate() == 1){
+                bandingTaskClassService.updateByBaseClass(baseClass);
+            }else{
+                bandingTaskClassService.removeByBaseClass(baseClass);
+            }
+
 
             BaseClassMajorSet majorSet = majorSetService.getOne(
                     new QueryWrapper<BaseClassMajorSet>().lambda()

+ 2 - 0
src/main/java/com/xjrsoft/module/classtime/controller/ClassTimeStatisticsController.java

@@ -144,6 +144,8 @@ public class ClassTimeStatisticsController {
             throw new MyException("未能查到数据");
         }
         statistics.setStatus(dto.getStatus());
+        statistics.setModifyDate(new Date());
+        statistics.setModifyUserId(StpUtil.getLoginIdAsLong());
         classTimeStatisticsService.updateById(statistics);
         if (dto.getStatus() != null && dto.getStatus() == 3) {
             classTimeStatisticsService.lockData(dto.getId());

+ 3 - 3
src/main/java/com/xjrsoft/module/form/service/impl/FormExecuteServiceImpl.java

@@ -1351,16 +1351,16 @@ public class FormExecuteServiceImpl implements IFormExecuteService {
                 formData.put(pk.getName(), keyValue);
                 //此时的formData 已经是剔除了子表单数据了
                 where.putAll(toSaveFormData);
-                System.out.println("insertOrUpdateFormDataByWorkflow 3.3");
+//                System.out.println("insertOrUpdateFormDataByWorkflow 3.3");
                 //如果有审计字段  默认填充值
                 putAuditEntityInsertData(where, columns);
-                System.out.println("insertOrUpdateFormDataByWorkflow 4");
+//                System.out.println("insertOrUpdateFormDataByWorkflow 4");
                 // 保存主表数据
                 Boolean result = SqlRunnerAdapter.db().dynamicInsert(tableName, where);
                 if (!result) {
                     throw new MyException("添加数据失败");
                 }
-                System.out.println("insertOrUpdateFormDataByWorkflow 5");
+//                System.out.println("insertOrUpdateFormDataByWorkflow 5");
 
                 // 保存子表数据
                 for (Map.Entry<String, List<Entity>> tableMap : childMaps.entrySet()) {

+ 2 - 0
src/main/java/com/xjrsoft/module/job/ActivityInfoTask.java

@@ -2,6 +2,7 @@ package com.xjrsoft.module.job;
 
 import com.xjrsoft.common.mybatis.SqlRunnerAdapter;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -13,6 +14,7 @@ import org.springframework.stereotype.Component;
 @Slf4j
 public class ActivityInfoTask {
 
+    @Async
     @Scheduled(cron = "0 */5 * * * ?")
     public void RefreshConnectionPool() {
 //        String active = SpringUtil.getActiveProfile();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/AttenDanceWarnNoticeTask.java

@@ -19,6 +19,7 @@ import com.xjrsoft.module.organization.service.IWeChatService;
 import com.xjrsoft.module.teacher.entity.XjrUser;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -56,6 +57,7 @@ public class AttenDanceWarnNoticeTask {
     @Autowired
     private IHolidayDateService holidayDateService;
 
+    @Async
     @Scheduled(cron = "0 */1 * * * ?")
     public void execute() {
         RefreshConnectionPool();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/AttendanceMessageTask.java

@@ -31,6 +31,7 @@ import com.xjrsoft.module.teacher.entity.BaseTeacher;
 import com.xjrsoft.module.teacher.entity.XjrUser;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -77,6 +78,7 @@ public class AttendanceMessageTask {
     @Autowired
     private WeChatUtil weChatUtil;
 
+    @Async
     @Scheduled(cron = "0 */1 * * * ?")
     public void RefreshConnectionPool() {
         String active = SpringUtil.getActiveProfile();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/AttendanceRecordTask.java

@@ -25,6 +25,7 @@ import com.xjrsoft.module.teacher.entity.WfTeacherleave;
 import com.xjrsoft.module.teacher.service.IWfTeacherleaveService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -68,6 +69,7 @@ public class AttendanceRecordTask {
     private IHolidayDateService holidayDateService;
 
 
+    @Async
     @Scheduled(cron = "0 */30 * * * ?")
     public void execute() {
         String active = SpringUtil.getActiveProfile();

+ 4 - 0
src/main/java/com/xjrsoft/module/job/BaseNewStudentTask.java

@@ -17,6 +17,7 @@ import com.xjrsoft.module.student.service.IPbCseFeeobjupdateService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -50,6 +51,7 @@ public class BaseNewStudentTask {
     @Autowired
     private IBaseMajorSetService majorSetService;
 
+    @Async
     @Scheduled(cron = "0 */15 * * * ?")
     public void execute() {
         doExecute();
@@ -139,6 +141,7 @@ public class BaseNewStudentTask {
                     }
                 }
                 existsNewStudent.setGraduateSchool(feeobjupdate.getGraduations());
+                existsNewStudent.setGraduateClass(feeobjupdate.getGradclass());
                 existsNewStudent.setStduyStatus(StudyStatusEnum.getCode(feeobjupdate.getQuartername()));
                 existsNewStudent.setSource(StudentTypeEnum.getCode(feeobjupdate.getResourcename()));
                 existsNewStudent.setMobile(feeobjupdate.getTelephone());
@@ -178,6 +181,7 @@ public class BaseNewStudentTask {
                             }
                         }
                         setGraduateSchool(feeobjupdate.getGraduations());
+                        setGraduateClass(feeobjupdate.getGradclass());
                         setStduyStatus(StudyStatusEnum.getCode(feeobjupdate.getQuartername()));
                         setSource(StudentTypeEnum.getCode(feeobjupdate.getResourcename()));
                         setMobile(feeobjupdate.getTelephone());

+ 116 - 0
src/main/java/com/xjrsoft/module/job/EnrollmentStatisticsInfoTask.java

@@ -0,0 +1,116 @@
+package com.xjrsoft.module.job;
+
+import com.xjrsoft.common.enums.DeleteMark;
+import com.xjrsoft.common.enums.EnabledMark;
+import com.xjrsoft.module.student.dto.EnrollmentStatisticsCalendarInfoDto;
+import com.xjrsoft.module.student.dto.EnrollmentStatisticsGraduationInfoDto;
+import com.xjrsoft.module.student.dto.EnrollmentStatisticsInfoDto;
+import com.xjrsoft.module.student.entity.EnrollmentStatisticsInfo;
+import com.xjrsoft.module.student.mapper.EnrollmentStatisticsInfoMapper;
+import com.xjrsoft.module.student.service.IPbCseFeeobjupdateService;
+import com.xjrsoft.module.student.vo.EnrollmentStatisticsCalendarInfoVo;
+import com.xjrsoft.module.student.vo.EnrollmentStatisticsGraduationInfoVo;
+import com.xjrsoft.module.student.vo.EnrollmentStatisticsInfoVo;
+import com.yomahub.liteflow.util.JsonUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.time.DayOfWeek;
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
+import java.time.temporal.TemporalAdjusters;
+import java.util.Date;
+
+/**
+ * 将招生计划数据固化
+ *
+ * @author dzx
+ * @date 2025年3月17日
+ */
+@Component
+@Slf4j
+public class EnrollmentStatisticsInfoTask {
+
+
+    @Autowired
+    private IPbCseFeeobjupdateService pbCseFeeobjupdateService;
+
+    @Autowired
+    private EnrollmentStatisticsInfoMapper enrollmentStatisticsInfoMapper;
+
+    @Async
+    @Scheduled(cron = "00 0/15 * * * ?")
+    public void execute() {
+        doExecute();
+    }
+
+    void doExecute() {
+        LocalDate now = LocalDate.now();
+        String dataDate = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+        EnrollmentStatisticsInfoDto dto = new EnrollmentStatisticsInfoDto();
+//        dto.setDay(now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
+        dto.setYear(now.getYear() + "");
+        EnrollmentStatisticsInfoVo info = pbCseFeeobjupdateService.getEnrollmentStatisticsInfo(dto);
+        if(info != null){
+//            enrollmentStatisticsInfoMapper.deleteDataByDate(dataDate);
+            EnrollmentStatisticsInfo infoData = new EnrollmentStatisticsInfo();
+            infoData.setEnabledMark(EnabledMark.ENABLED.getCode());
+            infoData.setDeleteMark(DeleteMark.NODELETE.getCode());
+            infoData.setCreateDate(new Date());
+            infoData.setCreateUserId(1000000000000000000L);
+            infoData.setDataJson(JsonUtil.toJsonString(info));
+            infoData.setDataType(1);
+            infoData.setDataDay(now);
+            enrollmentStatisticsInfoMapper.insert(infoData);
+        }
+
+        EnrollmentStatisticsGraduationInfoDto graduationInfoDto = new EnrollmentStatisticsGraduationInfoDto();
+        graduationInfoDto.setDay(dataDate);
+        EnrollmentStatisticsGraduationInfoVo graduationInfo = pbCseFeeobjupdateService.getEnrollmentStatisticsGraduationInfo(graduationInfoDto);
+
+        if(graduationInfo != null){
+//            enrollmentStatisticsInfoMapper.deleteGraduationDataByDate(dataDate);
+
+            EnrollmentStatisticsInfo infoData = new EnrollmentStatisticsInfo();
+            infoData.setEnabledMark(EnabledMark.ENABLED.getCode());
+            infoData.setDeleteMark(DeleteMark.NODELETE.getCode());
+            infoData.setCreateDate(new Date());
+            infoData.setCreateUserId(1000000000000000000L);
+            infoData.setDataJson(JsonUtil.toJsonString(graduationInfo));
+            infoData.setDataType(2);
+            infoData.setDataDay(now);
+            enrollmentStatisticsInfoMapper.insert(infoData);
+        }
+
+        LocalDate thisSaturday = now.with(TemporalAdjusters.nextOrSame(DayOfWeek.SATURDAY));
+        LocalDate thisMonday = now.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY));
+        LocalDate lastSunday = thisMonday.minusDays(1);
+
+        String thisSaturdayStr = thisSaturday.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+        String lastSundayStr = lastSunday.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+
+        EnrollmentStatisticsCalendarInfoDto calendarInfoDto = new EnrollmentStatisticsCalendarInfoDto();
+        calendarInfoDto.setStartDay(lastSundayStr);
+        calendarInfoDto.setEndDay(thisSaturdayStr);
+        EnrollmentStatisticsCalendarInfoVo calendarInfoVo = pbCseFeeobjupdateService.getEnrollmentStatisticsCalendarInfo(calendarInfoDto);
+
+        if(calendarInfoVo != null){
+//            enrollmentStatisticsInfoMapper.deleteCalendarDataByDate(lastSundayStr, thisSaturdayStr);
+
+            EnrollmentStatisticsInfo infoData = new EnrollmentStatisticsInfo();
+            infoData.setEnabledMark(EnabledMark.ENABLED.getCode());
+            infoData.setDeleteMark(DeleteMark.NODELETE.getCode());
+            infoData.setCreateDate(new Date());
+            infoData.setCreateUserId(1000000000000000000L);
+            infoData.setDataJson(JsonUtil.toJsonString(calendarInfoVo));
+            infoData.setDataType(3);
+            infoData.setDataStartDay(lastSunday);
+            infoData.setDataEndDay(thisSaturday);
+            infoData.setDataDay(now);
+            enrollmentStatisticsInfoMapper.insert(infoData);
+        }
+    }
+}

+ 2 - 0
src/main/java/com/xjrsoft/module/job/EvaluateTask.java

@@ -5,6 +5,7 @@ import com.xjrsoft.common.utils.DateUtils;
 import com.xjrsoft.common.utils.SqlRunnerAdapterUtil;
 import com.xjrsoft.module.evaluate.entity.EvaluateManage;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -22,6 +23,7 @@ public class EvaluateTask {
     /**
      * 需要重复评价的,每天凌晨1点自动生成新的评价提交记录
      */
+    @Async
     @Scheduled(cron = "0 0 1 * * ?")
     public void addSubmitRecord() {
         System.out.printf("定时新增评价提交记录:%s", DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN));

+ 2 - 0
src/main/java/com/xjrsoft/module/job/ExamScoreDataTask.java

@@ -7,6 +7,7 @@ import com.xjrsoft.module.xycxedu.service.IXycxeduExamListService;
 import com.xjrsoft.module.xycxedu.util.DataUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -27,6 +28,7 @@ public class ExamScoreDataTask {
     @Autowired
     private IBaseCourseSubjectService courseService;
 
+    @Async
     @Scheduled(cron = "0 */15 * * * ?")
     public void RefreshConnectionPool() {
         String active = SpringUtil.getActiveProfile();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/HikvisionBaseDataTask.java

@@ -9,6 +9,7 @@ import com.xjrsoft.module.hikvision.mapper.HikvisionDataMapper;
 import com.xjrsoft.module.hikvision.util.DataUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -25,6 +26,7 @@ public class HikvisionBaseDataTask {
     @Autowired
     private HikvisionDataMapper hikvisionDataMapper;
 
+    @Async
     @Scheduled(cron = "0 */15 * * * ?")
     public void execute() {
         String active = SpringUtil.getActiveProfile();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/HikvisionLeaveTask.java

@@ -15,6 +15,7 @@ import com.xjrsoft.module.teacher.entity.WfTeacherleave;
 import com.xjrsoft.module.teacher.service.IWfTeacherleaveService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -40,6 +41,7 @@ public class HikvisionLeaveTask {
     @Autowired
     private HikvisionDataMapper hikvisionDataMapper;
 
+    @Async
     @Scheduled(cron = "0 */15 * * * ?")
     public void execute() {
         doExecute();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/HolidayTask.java

@@ -4,6 +4,7 @@ import com.xjrsoft.common.utils.DateUtils;
 import com.xjrsoft.module.holiday.service.IHolidayDateService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -20,6 +21,7 @@ public class HolidayTask {
     /**
      * 定时拉取节假日数据
      */
+    @Async
     @Scheduled(cron = "0 0 1 * * ?")
     public void RefreshHoliday() {
         System.out.printf("定时拉取节假日数据:%s", DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN));

+ 2 - 0
src/main/java/com/xjrsoft/module/job/InsertOutInRecordTask.java

@@ -6,6 +6,7 @@ import com.xjrsoft.module.hikvision.util.OutInRecordUtil;
 import com.xjrsoft.module.teacher.mapper.FaceImportMapper;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -24,6 +25,7 @@ public class InsertOutInRecordTask {
     @Autowired
     private IHikvisionDataService hikvisionDataService;
 
+    @Async
     @Scheduled(cron = "0 */30 * * * ?")
     public void execute() {
         String active = SpringUtil.getActiveProfile();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/JianyuekbBaseDataTask.java

@@ -7,6 +7,7 @@ import com.xjrsoft.common.utils.SqlRunnerAdapterUtil;
 import com.xjrsoft.module.schedule.entity.JianyueData;
 import com.xjrsoft.module.schedule.util.DataUtil;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -21,6 +22,7 @@ import java.util.*;
 public class JianyuekbBaseDataTask {
 
 
+    @Async
     @Scheduled(cron = "0 */15 * * * ?")
     public void RefreshConnectionPool() {
         String active = SpringUtil.getActiveProfile();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/JianyuekbScheduleTask.java

@@ -61,6 +61,7 @@ import org.camunda.bpm.engine.runtime.ActivityInstance;
 import org.camunda.bpm.engine.runtime.ProcessInstance;
 import org.camunda.bpm.engine.task.Task;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -129,6 +130,7 @@ public class JianyuekbScheduleTask {
     @Autowired
     private IBaseGradeService gradeService;
 
+    @Async
     @Scheduled(cron = "0 */10 * * * ?")
     public void execute() {
         doExecute();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/ProcessNotProcessingAlertTask.java

@@ -8,6 +8,7 @@ import com.xjrsoft.common.utils.DateUtils;
 import com.xjrsoft.module.oa.utils.SendMessageUtil;
 import com.xjrsoft.module.workflow.entity.WorkflowExtra;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -27,6 +28,7 @@ public class ProcessNotProcessingAlertTask {
     /**
      * 流程未处理提醒
      */
+    @Async
     @Scheduled(cron = "0 0 14 * * ?")
     public void alertProcessNotProcessing() {
         System.out.printf("定时提醒流程未处理:%s", DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN));

+ 2 - 0
src/main/java/com/xjrsoft/module/job/ProcessTimeoutAlertTask.java

@@ -14,6 +14,7 @@ import org.camunda.bpm.engine.HistoryService;
 import org.camunda.bpm.engine.history.HistoricProcessInstance;
 import org.camunda.bpm.engine.history.HistoricProcessInstanceQuery;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -43,6 +44,7 @@ public class ProcessTimeoutAlertTask {
     @Autowired
     private IWorkflowAlertRecordService alertRecordService;
 
+    @Async
     @Scheduled(cron = "0 0 * * * ?")
     public void execute() {
         doExecute();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/StudentDropOutTask.java

@@ -15,6 +15,7 @@ import com.xjrsoft.module.personnel.service.IStundentFaceProcessService;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -34,6 +35,7 @@ public class StudentDropOutTask {
     @Autowired
     private IHikvisionDataService hikvisionDataService;
 
+    @Async
     @Scheduled(cron = "0 */30 * * * ?")
     public void execute() {
         String active = SpringUtil.getActiveProfile();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/StudentLeaveNoticeTask.java

@@ -19,6 +19,7 @@ import com.xjrsoft.module.student.vo.NoBackStudentInfoVo;
 import lombok.extern.slf4j.Slf4j;
 import me.zhyd.oauth.log.Log;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -43,6 +44,7 @@ public class StudentLeaveNoticeTask {
     @Autowired
     private IWeChatService weChatService;
 
+    @Async
     @Scheduled(cron = "0 */15 * * * ?")
     public void execute() {
         //doExecute();

+ 2 - 0
src/main/java/com/xjrsoft/module/job/StudentReportPlanTask.java

@@ -8,6 +8,7 @@ import com.xjrsoft.module.student.entity.StudentReportPlanClassRelation;
 import com.xjrsoft.module.student.service.IStudentReportPlanService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -28,6 +29,7 @@ public class StudentReportPlanTask {
     private IStudentReportPlanService planService;
 
 
+    @Async
     @Scheduled(cron = "0 */5 * * * ?")
     public void execute() {
         doExecute();

+ 3 - 2
src/main/java/com/xjrsoft/module/job/WfCourseAdjustTask.java

@@ -12,6 +12,7 @@ import com.xjrsoft.module.workflow.entity.WorkflowFormRelation;
 import lombok.extern.slf4j.Slf4j;
 import org.camunda.bpm.engine.history.HistoricProcessInstance;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -32,7 +33,7 @@ public class WfCourseAdjustTask {
     @Autowired
     private ICourseTableService courseTableService;
 
-
+    @Async
     @Scheduled(cron = "0 */10 * * * ?")
     public void execute() {
         List<WfCourseAdjust> list = wfCourseAdjustService.list(
@@ -53,7 +54,7 @@ public class WfCourseAdjustTask {
                     " AND t1.course_name = t2.course_name" +
                     " AND t1.site_id = t2.site_id" +
                     " AND t1.teacher_name = t2.teacher_name";
-            if(!SqlRunnerAdapter.db().selectList(sql).isEmpty()){
+            if(SqlRunnerAdapter.db().selectList(sql).isEmpty()){
                 continue;
             }
             courseTableService.adjustCourse(wfCourseAdjust);

+ 2 - 0
src/main/java/com/xjrsoft/module/job/WhitelistTask.java

@@ -6,6 +6,7 @@ import com.xjrsoft.module.base.entity.WhitelistManagement;
 import com.xjrsoft.module.base.service.IWhitelistManagementService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
@@ -27,6 +28,7 @@ public class WhitelistTask {
     @Autowired
     private RedisUtil redisUtil;
 
+    @Async
     @Scheduled(cron = "0 */15 * * * ?")
     public void execute() {
         doExecute();

+ 16 - 15
src/main/java/com/xjrsoft/module/liteflow/node/StudentDropOutNode.java

@@ -96,22 +96,23 @@ public class StudentDropOutNode extends NodeComponent {
                                         .eq(BaseStudentSchoolRoll::getUserId, studentDropOut.getStudentUserId())
                                         .eq(BaseStudentSchoolRoll::getDeleteMark, DeleteMark.NODELETE.getCode())
                         );
+                        if(schoolRoll != null){
+                            //记录异动
+                            changeRecordService.insertData(
+                                    ArchivesStatusEnum.fromCode(schoolRoll.getArchivesStatus()),
+                                    schoolRoll.getArchivesStatus(),
+                                    ArchivesStatusEnum.FB2904.getValue(),
+                                    ArchivesStatusEnum.FB2904.getCode(),
+                                    studentDropOut.getStudentUserId(),
+                                    studentDropOut.getCreateUserId(),
+                                    StudentChangeTypeEnum.ArchivesStatus.getCode(),
+                                    2
+                            );
 
-                        //记录异动
-                        changeRecordService.insertData(
-                                ArchivesStatusEnum.fromCode(schoolRoll.getArchivesStatus()),
-                                schoolRoll.getArchivesStatus(),
-                                ArchivesStatusEnum.FB2904.getValue(),
-                                ArchivesStatusEnum.FB2904.getCode(),
-                                studentDropOut.getStudentUserId(),
-                                studentDropOut.getCreateUserId(),
-                                StudentChangeTypeEnum.ArchivesStatus.getCode(),
-                                2
-                        );
-
-                        schoolRoll.setArchivesStatus(ArchivesStatusEnum.FB2904.getCode());
-                        studentSchoolRollService.updateById(schoolRoll);
-                        studentSchoolRollService.disableStudent(schoolRoll.getUserId(), studentDropOut.getCreateUserId());
+                            schoolRoll.setArchivesStatus(ArchivesStatusEnum.FB2904.getCode());
+                            studentSchoolRollService.updateById(schoolRoll);
+                            studentSchoolRollService.disableStudent(schoolRoll.getUserId(), studentDropOut.getCreateUserId());
+                        }
                     });
                 }
             });

+ 114 - 19
src/main/java/com/xjrsoft/module/liteflow/node/StudentTransferNode.java

@@ -1,22 +1,38 @@
 package com.xjrsoft.module.liteflow.node;
 
+import cn.dev33.satoken.secure.BCrypt;
 import cn.hutool.core.convert.Convert;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.xjrsoft.common.enums.ArchivesStatusEnum;
 import com.xjrsoft.common.enums.DeleteMark;
+import com.xjrsoft.common.enums.EnabledMark;
+import com.xjrsoft.common.enums.RoleEnum;
+import com.xjrsoft.common.utils.LocalDateUtil;
+import com.xjrsoft.config.CommonPropertiesConfig;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.mapper.BaseClassMapper;
+import com.xjrsoft.module.organization.dto.GetUserByParamDto;
+import com.xjrsoft.module.organization.entity.User;
+import com.xjrsoft.module.organization.entity.UserRoleRelation;
+import com.xjrsoft.module.organization.service.IUserRoleRelationService;
+import com.xjrsoft.module.organization.service.IUserService;
 import com.xjrsoft.module.student.entity.BaseClassMajorSet;
+import com.xjrsoft.module.student.entity.BaseNewStudent;
+import com.xjrsoft.module.student.entity.BaseStudent;
+import com.xjrsoft.module.student.entity.BaseStudentFamily;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
 import com.xjrsoft.module.student.entity.StudentTransfer;
 import com.xjrsoft.module.student.mapper.BaseClassMajorSetMapper;
 import com.xjrsoft.module.student.mapper.StudentTransferMapper;
+import com.xjrsoft.module.student.service.IBaseNewStudentService;
+import com.xjrsoft.module.student.service.IBaseStudentFamilyService;
 import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
-import com.xjrsoft.module.student.service.IStudentChangeRecordService;
+import com.xjrsoft.module.student.service.IBaseStudentService;
 import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.util.Map;
 
@@ -37,7 +53,22 @@ public class StudentTransferNode extends NodeComponent {
     private BaseClassMajorSetMapper baseClassMajorSetMapper;
 
     @Autowired
-    private IStudentChangeRecordService changeRecordService;
+    private IBaseNewStudentService newStudentService;
+
+    @Autowired
+    private IUserService userService;
+
+    @Autowired
+    private CommonPropertiesConfig propertiesConfig;
+
+    @Autowired
+    private IBaseStudentService studentService;
+
+    @Autowired
+    private IBaseStudentFamilyService familyService;
+
+    @Autowired
+    private IUserRoleRelationService roleRelationService;
 
     @Override
     public void process() throws Exception {
@@ -48,24 +79,88 @@ public class StudentTransferNode extends NodeComponent {
         if (formId != null) {
             //查询出数据
             StudentTransfer studentTransfer = studentTransferMapper.selectById(formId);
-            BaseClass baseClass = baseClassMapper.selectById(studentTransfer.getClassId());
-            BaseClassMajorSet majorSet = baseClassMajorSetMapper.selectOne(
-                    new QueryWrapper<BaseClassMajorSet>().lambda()
-                            .eq(BaseClassMajorSet::getClassId, studentTransfer.getClassId())
-                            .eq(BaseClassMajorSet::getDeleteMark, DeleteMark.NODELETE.getCode())
+
+            BaseNewStudent newStudent = newStudentService.getById(studentTransfer.getStudentUserId());
+            User user = userService.getUserByParam(
+                    new GetUserByParamDto() {{
+                        setCredentialNumber(newStudent.getCredentialNumber());
+                    }}
             );
-            BaseStudentSchoolRoll roll = new BaseStudentSchoolRoll();
-            roll.setStduyStatus(studentTransfer.getStudyStatus());
-            roll.setClassId(studentTransfer.getClassId());
-            roll.setEnrollType(baseClass.getEnrollType());
-            roll.setCreateDate(LocalDateTime.now());
-            roll.setGradeId(baseClass.getGradeId());
-            roll.setMajorSetId(majorSet.getMajorSetId());
-            roll.setCreateUserId(studentTransfer.getCreateUserId());
-            roll.setArchivesStatus(ArchivesStatusEnum.FB2901.getCode());
-            roll.setUserId(studentTransfer.getStudentUserId());
-            //新增学籍信息
-            studentSchoolRollService.save(roll);
+            LocalDate birthDate = LocalDateUtil.getBirthDate(newStudent.getCredentialNumber());
+            BaseClass baseClass = baseClassMapper.selectById(studentTransfer.getClassId());
+            LocalDateTime now = LocalDateTime.now();
+            if(user == null){
+                User xjrUser = new User() {{
+                    setCreateDate(now);
+                    setPassword(BCrypt.hashpw(propertiesConfig.getDefaultPassword(), BCrypt.gensalt()));
+                    setName(newStudent.getName());
+                    setUserName(newStudent.getCredentialNumber());
+                    setCredentialNumber(newStudent.getCredentialNumber());
+                    setCredentialType("ZZLS10007");
+                    setMobile(newStudent.getMobile());
+                    setEnabledMark(EnabledMark.ENABLED.getCode());
+                    setGender(newStudent.getGender());
+                    setIsChangePassword(1);
+                    setBirthDate(birthDate.atStartOfDay());
+                }};
+                userService.save(xjrUser);
+
+                UserRoleRelation userRoleRelation = new UserRoleRelation() {{
+                    setRoleId(RoleEnum.STUDENT.getCode());
+                    setUserId(xjrUser.getId());
+                }};
+                roleRelationService.save(userRoleRelation);
+
+                BaseStudent baseStudent = new BaseStudent() {{
+                    setUserId(xjrUser.getId());
+                    setCreateDate(now);
+                    setStudentId(newStudent.getCredentialNumber());
+                    if(newStudent.getHeight() != null){
+                        setHeight(newStudent.getHeight().doubleValue());
+                    }
+                    if(newStudent.getWeight() != null){
+                        setWeight(newStudent.getWeight().doubleValue());
+                    }
+                }};
+                studentService.save(baseStudent);
+
+                BaseClassMajorSet majorSet = baseClassMajorSetMapper.selectOne(
+                        new QueryWrapper<BaseClassMajorSet>().lambda()
+                                .eq(BaseClassMajorSet::getClassId, studentTransfer.getClassId())
+                                .eq(BaseClassMajorSet::getDeleteMark, DeleteMark.NODELETE.getCode())
+                );
+                BaseStudentSchoolRoll roll = new BaseStudentSchoolRoll();
+                roll.setStduyStatus(studentTransfer.getStudyStatus());
+                roll.setClassId(studentTransfer.getClassId());
+                roll.setEnrollType(baseClass.getEnrollType());
+                roll.setCreateDate(LocalDateTime.now());
+                roll.setGradeId(baseClass.getGradeId());
+                roll.setMajorSetId(majorSet.getMajorSetId());
+                roll.setCreateUserId(studentTransfer.getCreateUserId());
+                roll.setArchivesStatus(ArchivesStatusEnum.FB2901.getCode());
+                roll.setUserId(xjrUser.getId());
+                roll.setDeleteMark(DeleteMark.NODELETE.getCode());
+                roll.setEnabledMark(EnabledMark.ENABLED.getCode());
+                //新增学籍信息
+                studentSchoolRollService.save(roll);
+
+
+                BaseStudentFamily studentFamily = new BaseStudentFamily() {{
+                    setCreateDate(now);
+                    setUserId(xjrUser.getId());
+                    setTelephone(newStudent.getFamilyMobile());
+                    setAddress(newStudent.getFamilyAddress());
+                }};
+                familyService.save(studentFamily);
+
+            }else{
+                studentSchoolRollService.updateStudentClass(studentTransfer.getClassId(), user.getId());
+            }
+
+            newStudent.setRemarks("通过插班进入" + baseClass.getName());
+            newStudent.setStatus(1);
+            newStudent.setOperateMode(2);
+            newStudentService.updateById(newStudent);
         }
     }
 }

+ 11 - 0
src/main/java/com/xjrsoft/module/oa/controller/NewsController.java

@@ -13,6 +13,7 @@ import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.annotation.XjrLog;
 import com.xjrsoft.common.constant.GlobalConstant;
 import com.xjrsoft.common.enums.DeleteMark;
+import com.xjrsoft.common.enums.EnabledMark;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
@@ -365,6 +366,8 @@ public class NewsController {
                                 .eq(News::getStatus, 2)
                                 .eq(NewsRelation::getUserId, StpUtil.getLoginIdAsLong())
                                 .eq(News::getTypeId, typeId)
+                                .eq(News::getDeleteMark, DeleteMark.NODELETE.getCode())
+                                .eq(News::getEnabledMark, EnabledMark.ENABLED.getCode())
                                 .eq(NewsRelation::getReadMark, 0)
                                 .gt(News::getSendEndDate, LocalDateTime.now())
                 );
@@ -375,6 +378,8 @@ public class NewsController {
                         .eq(News::getTypeId, typeId)
                         .eq(News::getStatus, 2)
                         .gt(News::getSendEndDate, LocalDateTime.now())
+                        .eq(News::getDeleteMark, DeleteMark.NODELETE.getCode())
+                        .eq(News::getEnabledMark, EnabledMark.ENABLED.getCode())
                         .eq(News::getWfStatus, 1)
                         //.notInSql(News::getId, "select distinct news_id from xjr_oa_news_relation where read_mark = 1 and user_id = " + StpUtil.getLoginIdAsLong())
                         .orderByDesc(News::getReleaseTime)
@@ -390,6 +395,8 @@ public class NewsController {
                                 .eq(News::getStatus, 2)
                                 .eq(NewsRelation::getUserId, StpUtil.getLoginIdAsLong())
                                 .eq(News::getTypeId, typeId)
+                                .eq(News::getDeleteMark, DeleteMark.NODELETE.getCode())
+                                .eq(News::getEnabledMark, EnabledMark.ENABLED.getCode())
                                 .gt(News::getSendEndDate, LocalDateTime.now())
                                 .eq(NewsRelation::getReadMark, 0)
                 );
@@ -487,6 +494,8 @@ public class NewsController {
                         .eq(News::getStatus, 2)
                         .eq(NewsRelation::getUserId, StpUtil.getLoginIdAsLong())
                         .eq(NewsRelation::getReadMark, 0)
+                        .eq(News::getDeleteMark, DeleteMark.NODELETE.getCode())
+                        .eq(News::getEnabledMark, EnabledMark.ENABLED.getCode())
         );
 
         //公告发给非全体的
@@ -497,6 +506,8 @@ public class NewsController {
                         .eq(SystemUpdateMessage::getDeleteMark, DeleteMark.NODELETE.getCode())
                         .eq(SystemUpdateMessage::getStatus, 1)
                         .eq(SystemUpdateMessageNotice::getStatus, 0)
+                        .eq(SystemUpdateMessageNotice::getDeleteMark, DeleteMark.NODELETE.getCode())
+                        .eq(SystemUpdateMessageNotice::getEnabledMark, EnabledMark.ENABLED.getCode())
         );
 
         Long notReadCount = notReadCountNews + systemUpdateMessageCount;

+ 59 - 0
src/main/java/com/xjrsoft/module/schedule/controller/ScheduleController.java

@@ -26,6 +26,7 @@ import com.xjrsoft.module.schedule.service.IWfCourseAdjustService;
 import com.xjrsoft.module.schedule.util.ScheduleUtil;
 import com.xjrsoft.module.schedule.vo.ClassOptionVo;
 import com.xjrsoft.module.schedule.vo.CourseListVo;
+import com.xjrsoft.module.schedule.vo.CourseNamesVo;
 import com.xjrsoft.module.schedule.vo.CourseTableVo;
 import com.xjrsoft.module.schedule.vo.ScheduleWeekVo;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
@@ -50,7 +51,10 @@ import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
 
 /**
  * @title: 课表
@@ -264,6 +268,61 @@ public class ScheduleController {
     }
 
 
+    @GetMapping(value = "/getCourseInfo")
+    @ApiOperation(value = "根据课程id获取课程相关信息")
+    @SaCheckPermission("schedule:detail")
+    @XjrLog(value = "根据课程id获取课程相关信息", saveResponseData = true)
+    public RT<CourseNamesVo> getCourseInfo(String id) {
+        String[] split = id.split(",");
+        List<CourseTable> list = courseTableService.list(
+                new QueryWrapper<CourseTable>().lambda()
+                        .in(CourseTable::getId, Arrays.asList(split))
+        );
+        CourseNamesVo resultVo = new CourseNamesVo();
+
+        Set<Long> classSets = list.stream().map(CourseTable::getClassId).collect(Collectors.toSet());
+        if(classSets.size() > 1){
+            resultVo.setStatus(0);
+            return RT.ok(resultVo);
+        }
+
+        List<ClassTime> classTimeList = classTimeService.list();
+        String courseNames = "";
+        String timeNumbers = "";
+        Set<Long> classIdSet = new HashSet<>();
+        Set<String> classNameSet = new HashSet<>();
+        for (int i = 0; i < list.size(); i++) {
+            if (i > 0) {
+                courseNames += ",";
+                timeNumbers += ",";
+            }
+            CourseTable courseTable = list.get(i);
+
+            String courseName = courseTable.getCourseName();
+
+            ClassTime classTime = classTimeList.stream().filter(u -> u.getNumber().equals(courseTable.getTimeNumber())).findAny().orElse(null);
+
+            if (classTime != null) {
+                courseName += "(" + classTime.getShortName() + ")";
+            }
+
+            courseNames += courseName;
+            timeNumbers += courseTable.getTimeNumber();
+            classIdSet.add(courseTable.getClassId());
+            classNameSet.add(courseTable.getClassName());
+        }
+        resultVo.setCourseNames(courseNames);
+        resultVo.setTimeNumbers(timeNumbers);
+        resultVo.setClassIds(classIdSet.toString().replace("[", "").replace("]", "").replace(" ", ""));
+        resultVo.setClassNames(classNameSet.toString().replace("[", "").replace("]", "").replace(" ", ""));
+        resultVo.setStatus(1);
+
+        return RT.ok(resultVo);
+    }
+
+
+
+
     /**
      * 顶课预检查
      *

+ 32 - 0
src/main/java/com/xjrsoft/module/schedule/vo/CourseNamesVo.java

@@ -0,0 +1,32 @@
+package com.xjrsoft.module.schedule.vo;
+
+import com.xjrsoft.module.courseTable.entity.ClassTime;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalDate;
+import java.util.List;
+
+/**
+ * @author dzx
+ * @date 2024/1/29
+ */
+@Data
+public class CourseNamesVo {
+
+    @ApiModelProperty("课程名称")
+    private String courseNames;
+
+    @ApiModelProperty("节次数字")
+    private String timeNumbers;
+
+    @ApiModelProperty("班级ids")
+    private String classIds;
+
+    @ApiModelProperty("班级名称")
+    private String classNames;
+
+    @ApiModelProperty("是否同一个班级(1:是 0:否)")
+    private Integer status;
+
+}

+ 319 - 337
src/main/java/com/xjrsoft/module/student/controller/BaseNewStudentReportController.java

@@ -1,61 +1,77 @@
 package com.xjrsoft.module.student.controller;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
-import cn.dev33.satoken.secure.BCrypt;
 import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.StrUtil;
 import com.alibaba.excel.EasyExcel;
 import com.alibaba.excel.support.ExcelTypeEnum;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.xjrsoft.common.annotation.XjrLog;
-import com.xjrsoft.common.constant.GlobalConstant;
+import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.enums.EnabledMark;
+import com.xjrsoft.common.enums.EnrollTypeEnum;
+import com.xjrsoft.common.enums.GenderDictionaryEnum;
+import com.xjrsoft.common.enums.RoleCodeEnum;
+import com.xjrsoft.common.enums.StudyStatusEnum;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
-import com.xjrsoft.common.utils.RedisUtil;
 import com.xjrsoft.common.utils.VoToColumnUtil;
-import com.xjrsoft.config.CommonPropertiesConfig;
-import com.xjrsoft.module.base.entity.BaseSemester;
-import com.xjrsoft.module.base.entity.BaseUserStudent;
-import com.xjrsoft.module.base.entity.WhitelistManagement;
+import com.xjrsoft.module.banding.dto.BandingTaskClassPageDto;
+import com.xjrsoft.module.banding.entity.BandingTask;
+import com.xjrsoft.module.banding.service.IBandingTaskClassService;
+import com.xjrsoft.module.banding.service.IBandingTaskClassStudentService;
+import com.xjrsoft.module.banding.service.IBandingTaskService;
+import com.xjrsoft.module.banding.vo.BandingTaskClassPageVo;
+import com.xjrsoft.module.banding.vo.BandingTaskClassReportStatisticsVo;
+import com.xjrsoft.module.base.entity.BaseGrade;
+import com.xjrsoft.module.base.service.IBaseGradeService;
 import com.xjrsoft.module.base.service.IBaseSemesterService;
-import com.xjrsoft.module.base.service.IBaseUserStudentService;
-import com.xjrsoft.module.base.service.IWhitelistManagementService;
-import com.xjrsoft.module.organization.entity.User;
-import com.xjrsoft.module.organization.entity.UserRoleRelation;
-import com.xjrsoft.module.organization.service.IUserRoleRelationService;
+import com.xjrsoft.module.databoard.vo.ItemCountVo;
 import com.xjrsoft.module.organization.service.IUserService;
-import com.xjrsoft.module.student.dto.*;
-import com.xjrsoft.module.student.entity.BaseNewStudent;
-import com.xjrsoft.module.student.entity.BaseStudentFamilyMember;
+import com.xjrsoft.module.student.dto.StudentReportRecordPageDto;
+import com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto;
+import com.xjrsoft.module.student.dto.StudentTryReadingReportPageDto;
+import com.xjrsoft.module.student.entity.EnrollmentPlan;
+import com.xjrsoft.module.student.entity.StudentReportPlan;
 import com.xjrsoft.module.student.service.IBaseNewStudentService;
-import com.xjrsoft.module.student.service.IBaseStudentFamilyMemberService;
-import com.xjrsoft.module.student.vo.*;
+import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
+import com.xjrsoft.module.student.service.IEnrollmentPlanService;
+import com.xjrsoft.module.student.service.IStudentReportPlanService;
+import com.xjrsoft.module.student.service.IStudentReportRecordService;
+import com.xjrsoft.module.student.vo.StudentReportRecordExcelVo;
+import com.xjrsoft.module.student.vo.StudentReportRecordItemVo;
+import com.xjrsoft.module.student.vo.StudentReportRecordPlanPageVo;
+import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
 import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.*;
-import java.util.concurrent.CompletableFuture;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
- * @title: 新生维护信息
+ * @title: 新生报到信息
  * @Author dzx
- * @Date: 2024-06-27
+ * @Date: 2025年3月19日
  * @Version 1.0
  */
 @RestController
@@ -64,359 +80,325 @@ import java.util.concurrent.CompletableFuture;
 @AllArgsConstructor
 public class BaseNewStudentReportController {
 
-    private final IUserService userService;
-    private final IBaseNewStudentService baseNewStudentService;
-    private final IBaseStudentFamilyMemberService familyMemberService;
-    private final IWhitelistManagementService whitelistManagementService;
-    private final IUserRoleRelationService userRoleRelationService;
-    private final RedisUtil redisUtil;
-    private final IBaseUserStudentService userStudentService;
-    private final CommonPropertiesConfig propertiesConfig;
+    private final IStudentReportRecordService recordService;
+    private final IStudentReportPlanService reportPlanService;
+    private final IBandingTaskClassService bandingTaskClassService;
     private final IBaseSemesterService semesterService;
+    private final IBaseGradeService gradeService;
+    private final IEnrollmentPlanService enrollmentPlanService;
+    private final IBandingTaskService bandingTaskService;
 
     @GetMapping(value = "/page")
     @ApiOperation(value = "新生维护信息列表(分页)")
     @SaCheckPermission("basenewstudent:detail")
     @XjrLog(value = "新生维护信息列表(分页)")
-    public RT<PageOutput<BaseNewStudentPageVo>> page(@Valid BaseNewStudentPageDto dto) {
-
-        Page<BaseNewStudentPageVo> page = baseNewStudentService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
-        PageOutput<BaseNewStudentPageVo> pageOutput = ConventPage.getPageOutput(page, BaseNewStudentPageVo.class);
-        return RT.ok(pageOutput);
-    }
-
-    @GetMapping(value = "/report-page")
-    @ApiOperation(value = "新生报到(分页)")
-    @SaCheckPermission("basenewstudent:detail")
-    @XjrLog(value = "新生报到(分页)")
-    public RT<PageOutput<BaseNewStudentPageVo>> reportPage(@Valid BaseNewStudentPageDto dto) {
+    public RT<PageOutput<StudentReportRecordPlanPageVo>> page(@Valid StudentTryReadingReportPageDto dto){
+        dto.setReportCategory(3);
         List<String> roleList = StpUtil.getRoleList();
-        if (roleList.contains("CLASSTE") && roleList.contains("TEACHER") && dto.getTeacherId() == null) {
+        if(roleList.contains("CLASSTE") && roleList.contains("TEACHER")){
             dto.setTeacherId(StpUtil.getLoginIdAsLong());
         }
-        if (dto.getBaseSemesterId() == null) {
-            LambdaQueryWrapper<BaseSemester> queryWrapper = new LambdaQueryWrapper<>();
-            queryWrapper
-                    .orderByDesc(BaseSemester::getStartDate)
-                    .select(BaseSemester.class, x -> VoToColumnUtil.fieldsToColumns(BaseSemester.class).contains(x.getProperty()));
-            List<BaseSemester> semesterList = semesterService.list(queryWrapper);
-            if (!semesterList.isEmpty()) {
-                dto.setBaseSemesterId(semesterList.get(0).getId());
+        if(dto.getIsMoible() != null && dto.getIsMoible() == 1){
+            StudentReportPlan plan = reportPlanService.getLastNewStudentReportPlan();
+            dto.setStudentReportPlanId(plan.getId());
+            BandingTask bandingTask = bandingTaskService.getById(plan.getBandingTaskId());
+            List<EnrollmentPlan> enrollmentPlans = enrollmentPlanService.list(
+                    new QueryWrapper<EnrollmentPlan>().lambda()
+                            .eq(EnrollmentPlan::getDeleteMark, DeleteMark.NODELETE.getCode())
+                            .eq(EnrollmentPlan::getEnabledMark, EnabledMark.ENABLED.getCode())
+                            .eq(EnrollmentPlan::getEnrollType, bandingTask.getEnrollType())
+                            .eq(EnrollmentPlan::getEnrollType, bandingTask.getEnrollType())
+                            .eq(EnrollmentPlan::getGradeId, bandingTask.getGradeId())
+                            .orderByDesc(EnrollmentPlan::getId)
+            );
+            if(!enrollmentPlans.isEmpty()){
+                dto.setEnrollmentPlanId(enrollmentPlans.get(0).getId());
             }
         }
-        Page<BaseNewStudentPageVo> page = baseNewStudentService.getReportPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
-        PageOutput<BaseNewStudentPageVo> pageOutput = ConventPage.getPageOutput(page, BaseNewStudentPageVo.class);
+        Page<StudentReportRecordPlanPageVo> page = recordService.getTryReadingPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
+        PageOutput<StudentReportRecordPlanPageVo> pageOutput = ConventPage.getPageOutput(page, StudentReportRecordPlanPageVo.class);
         return RT.ok(pageOutput);
     }
 
-    @GetMapping(value = "/tree")
-    @ApiOperation(value = "新生维护信息树")
-    @SaCheckPermission("basenewstudent:detail")
-    @XjrLog(value = "新生维护信息树")
-    public RT<List<BaseNewStudentTreeVo>> tree() {
 
-        List<EnrollmentPlanGradeVo> gradeList = baseNewStudentService.getGradeList();
-        List<EnrollmentPlanTreeVo> list = baseNewStudentService.getEnrollmentPlanList();
+    @GetMapping(value = "/class-statistics")
+    @ApiOperation(value="班级数据统计")
+    @SaCheckPermission("studentreportrecord:detail")
+    @XjrLog(value = "班级数据统计")
+    public RT<BandingTaskClassReportStatisticsVo> classStatistics(@RequestParam Long classId){
+        return RT.ok(bandingTaskClassService.getTryReadingReportClassStatistics(new StudentTryReadingReportPageDto(){{
+            setClassId(classId);
+            setReportCategory(3);
+        }}));
+    }
 
-        List<BaseNewStudentTreeVo> result = new ArrayList<>();
-        for (EnrollmentPlanGradeVo gradeVo : gradeList) {
-            BaseNewStudentTreeVo treeVo = new BaseNewStudentTreeVo() {{
-                setId(gradeVo.getId());
-                setName(gradeVo.getName());
-                setTreeType(1);
-            }};
-            List<BaseNewStudentTreeVo> children = new ArrayList<>();
-            for (EnrollmentPlanTreeVo planTreeVo : list) {
-                if (planTreeVo.getGradeId().equals(gradeVo.getId())) {
-                    children.add(new BaseNewStudentTreeVo() {{
-                        setId(planTreeVo.getId());
-                        setName(planTreeVo.getEnrollTypeCn());
-                        setTreeType(2);
-                    }});
-                }
+    @GetMapping(value = "/statistics")
+    @ApiOperation(value="领导统计")
+    @SaCheckPermission("studentreportrecord:detail")
+    @XjrLog(value = "领导统计")
+    public RT<StudentReportRecordStatisticsVo> statistics(@Valid StudentReportRecordStatisticsDto dto){
+        if(dto.getGradeId() == null && (dto.getCategory() == null || dto.getCategory() == 1)){
+            LambdaQueryWrapper<BaseGrade> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper
+                    .orderByDesc(BaseGrade::getTitle)
+                    .select(BaseGrade.class,x -> VoToColumnUtil.fieldsToColumns(BaseGrade.class).contains(x.getProperty()));
+            List<BaseGrade> gradeList = gradeService.list(queryWrapper);
+            if(!gradeList.isEmpty()){
+                dto.setGradeId(gradeList.get(0).getId());
             }
-
-            treeVo.setChildren(children);
-            result.add(treeVo);
         }
-
-        return RT.ok(result);
-    }
-
-    @GetMapping(value = "/info")
-    @ApiOperation(value = "根据id查询新生维护信息信息")
-    @SaCheckPermission("basenewstudent:detail")
-    @XjrLog(value = "根据id查询新生维护信息信息", saveResponseData = true)
-    public RT<BaseNewStudentVo> info(@RequestParam Long id) {
-        BaseNewStudent baseNewStudent = baseNewStudentService.getById(id);
-        if (baseNewStudent == null) {
-            return RT.error("找不到此数据!");
+        if(dto.getEnrollType() == null || dto.getEnrollType().isEmpty()){
+            dto.setEnrollType(EnrollTypeEnum.AUTUMN_ENROLLMENT.getCode());
         }
-        return RT.ok(BeanUtil.toBean(baseNewStudent, BaseNewStudentVo.class));
-    }
-
-
-    @PostMapping
-    @ApiOperation(value = "新增新生维护信息")
-    @SaCheckPermission("basenewstudent:add")
-    @XjrLog(value = "新增新生维护信息", saveResponseData = true)
-    public RT<Boolean> add(@Valid @RequestBody AddBaseNewStudentDto dto) {
-        BaseNewStudent baseNewStudent = BeanUtil.toBean(dto, BaseNewStudent.class);
-        baseNewStudent.setFirstAmbitionId(Long.parseLong(dto.getFirstAmbition()));
-        baseNewStudent.setSecondAmbitionId(Long.parseLong(dto.getSecondAmbition()));
-        baseNewStudent.setCreateDate(new Date());
-        boolean isSuccess = baseNewStudentService.save(baseNewStudent);
-        return RT.ok(isSuccess);
-    }
-
-    @PutMapping
-    @ApiOperation(value = "修改新生维护信息")
-    @SaCheckPermission("basenewstudent:edit")
-    @XjrLog(value = "修改新生维护信息", saveResponseData = true)
-    public RT<Boolean> update(@Valid @RequestBody UpdateBaseNewStudentDto dto) {
-
-        BaseNewStudent baseNewStudent = BeanUtil.toBean(dto, BaseNewStudent.class);
-        return RT.ok(baseNewStudentService.updateById(baseNewStudent));
-
-    }
-
-    @DeleteMapping
-    @ApiOperation(value = "删除新生维护信息")
-    @SaCheckPermission("basenewstudent:delete")
-    @XjrLog(value = "删除新生维护信息", saveResponseData = true)
-    public RT<Boolean> delete(@Valid @RequestBody List<Long> ids) {
-        return RT.ok(baseNewStudentService.removeBatchByIds(ids));
-    }
-
-    @DeleteMapping("deleteByUserIds")
-    @ApiOperation(value = "删除新生(保留新生信息,删除基础信息)")
-    @SaCheckPermission("basenewstudent:delete")
-    @XjrLog(value = "删除新生(保留新生信息,删除基础信息)", saveResponseData = true)
-    public RT<Boolean> deleteByUserIds(@Valid @RequestBody DeleteNewStudentDto dto) {
-        return RT.ok(baseNewStudentService.deleteByUserIds(dto));
-    }
-
-
-    @PostMapping("/import")
-    @ApiOperation(value = "导入")
-    @XjrLog(value = "导入", saveRequestData = false, saveResponseData = true)
-    public RT<List<Map<String, String>>> importData(@RequestParam Long treeId, @RequestParam MultipartFile file) throws IOException {
-        List<Map<Integer, Object>> errorList = baseNewStudentService.importData(treeId, file);
-        List<Map<String, String>> result = new ArrayList<>();
-
-        for (Map<Integer, Object> objectMap : errorList) {
-            Map<String, String> object = new LinkedHashMap<>();
-            object.put("毕业学校", objectMap.get(0) == null ? "" : objectMap.get(0).toString());
-            object.put("学生姓名", objectMap.get(1) == null ? "" : objectMap.get(1).toString());
-            object.put("性别", objectMap.get(2) == null ? "" : objectMap.get(2).toString());
-            object.put("身份证号", objectMap.get(3) == null ? "" : objectMap.get(3).toString());
-            object.put("身高(cm)", objectMap.get(4) == null ? "" : objectMap.get(4).toString());
-            object.put("体重(kg)", objectMap.get(5) == null ? "" : objectMap.get(5).toString());
-            object.put("毕业班级", objectMap.get(6) == null ? "" : objectMap.get(6).toString());
-            object.put("学生来源", objectMap.get(7) == null ? "" : objectMap.get(7).toString());
-            object.put("住宿类型", objectMap.get(8) == null ? "" : objectMap.get(8).toString());
-            object.put("手机号", objectMap.get(9) == null ? "" : objectMap.get(9).toString());
-            object.put("第一志愿", objectMap.get(10) == null ? "" : objectMap.get(10).toString());
-            object.put("第二志愿", objectMap.get(11) == null ? "" : objectMap.get(11).toString());
-            object.put("是否可调配", objectMap.get(12) == null ? "" : objectMap.get(12).toString());
-            object.put("家庭电话", objectMap.get(13) == null ? "" : objectMap.get(13).toString());
-            object.put("家庭地址", objectMap.get(14) == null ? "" : objectMap.get(14).toString());
-            object.put("错误信息", objectMap.get(15) == null ? "" : objectMap.get(15).toString());
-            result.add(object);
+        if(dto.getCategory() != null && dto.getCategory() == 2 && dto.getBaseSemesterId() == null){
+            dto.setBaseSemesterId(semesterService.getLastSemester());
         }
-        return RT.ok(result);
-    }
 
-    @PostMapping("/score-import")
-    @ApiOperation(value = "成绩导入")
-    @XjrLog(value = "成绩导入", saveRequestData = false, saveResponseData = true)
-    public RT<List<Map<String, String>>> scoreImport(@RequestParam MultipartFile file) throws IOException {
-        List<BaseNewStudentScoreExcelVo> errorList = baseNewStudentService.scoreImport(file);
-        List<Map<String, String>> result = new ArrayList<>();
+        List<EnrollmentPlan> enrollmentPlanList = enrollmentPlanService.list(
+                new QueryWrapper<EnrollmentPlan>().lambda()
+                        .eq(EnrollmentPlan::getEnrollType, dto.getEnrollType())
+                        .eq(EnrollmentPlan::getGradeId, dto.getGradeId())
+                        .eq(EnrollmentPlan::getDeleteMark, DeleteMark.NODELETE.getCode())
+                        .eq(EnrollmentPlan::getEnabledMark, EnabledMark.ENABLED.getCode())
+                        .orderByDesc(EnrollmentPlan::getId)
+        );
+        if(enrollmentPlanList.isEmpty()){
+            return RT.ok(new StudentReportRecordStatisticsVo());
+        }
 
-        for (BaseNewStudentScoreExcelVo objectMap : errorList) {
-            Map<String, String> object = new LinkedHashMap<>();
-            object.put("毕业学校", objectMap.getGraduateSchool());
-            object.put("姓名", objectMap.getName());
-            object.put("性别", objectMap.getGender());
-            object.put("班级", objectMap.getGraduateClass());
-            object.put("总成绩", objectMap.getScore().intValue() + "");
-            object.put("错误信息", "未能查询到该学生或该学生存在多个");
-            result.add(object);
+        StudentTryReadingReportPageDto recordPageDto = new StudentTryReadingReportPageDto();
+        recordPageDto.setEnrollmentPlanId(enrollmentPlanList.get(0).getId());
+        recordPageDto.setReportCategory(3);
+        List<StudentReportRecordPlanPageVo> dataList = recordService.getTryReadingList(recordPageDto);
+        StudentReportRecordStatisticsVo statisticsVo = new StudentReportRecordStatisticsVo();
+        statisticsVo.setAllCount(dataList.stream().count());
+
+        statisticsVo.setArrivedCount(dataList.stream().filter(x -> x.getReportTime() != null).count());
+        statisticsVo.setNotArrivedCount(dataList.stream().filter(x -> x.getReportTime() == null).count());
+        statisticsVo.setArrivedMaleCount(dataList.stream().filter(x -> x.getReportTime() != null && GenderDictionaryEnum.MALE.getValue().equals(x.getGender())).count());
+        statisticsVo.setArrivedFemaleCount(dataList.stream().filter(x -> x.getReportTime() != null && GenderDictionaryEnum.FEMALE.getValue().equals(x.getGender())).count());
+
+        statisticsVo.setStayMaleCount(dataList.stream().filter(
+                x -> GenderDictionaryEnum.MALE.getValue().equals(x.getGender())
+                        && StudyStatusEnum.InResidence.getCode().equals(x.getStduyStatusCn())
+                        && x.getReportTime() != null
+        ).count());
+        statisticsVo.setStayFemaleCount(dataList.stream().filter(
+                x -> GenderDictionaryEnum.FEMALE.getValue().equals(x.getGender())
+                        && StudyStatusEnum.InResidence.getCode().equals(x.getStduyStatusCn())
+                        && x.getReportTime() != null
+        ).count());
+        statisticsVo.setNotStayMaleCount(dataList.stream().filter(
+                x -> GenderDictionaryEnum.MALE.getValue().equals(x.getGender())
+                        && StudyStatusEnum.AttendDaySchool.getCode().equals(x.getStduyStatusCn())
+                        && x.getReportTime() != null
+        ).count());
+        statisticsVo.setNotStayFemaleCount(dataList.stream().filter(
+                x -> GenderDictionaryEnum.FEMALE.getValue().equals(x.getGender())
+                        && StudyStatusEnum.AttendDaySchool.getCode().equals(x.getStduyStatusCn())
+                        && x.getReportTime() != null
+        ).count());
+
+        if(dto.getCategory() != null && dto.getCategory() == 3){
+            Map<String, List<StudentReportRecordPlanPageVo>> graduatedUniversityMap = dataList.stream().filter(x -> x.getReportTime() != null && x.getGraduateSchool() != null)
+                    .collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getGraduateSchool));
+            List<ItemCountVo> graduatedUniversityList = new ArrayList<>();
+            for (String graduatedUniversity : graduatedUniversityMap.keySet()) {
+                graduatedUniversityList.add(
+                        new ItemCountVo(){{
+                            setItem(graduatedUniversity);
+                            setCount(graduatedUniversityMap.get(graduatedUniversity).size());
+                        }}
+                );
+            }
+            statisticsVo.setGraduatedUniversityList(graduatedUniversityList);
         }
-        return RT.ok(result);
-    }
 
-    @PostMapping("/active-account")
-    @ApiOperation(value = "激活账号")
-    @XjrLog(value = "激活账号", saveResponseData = true)
-    public RT<Boolean> activeAccount(@Valid @RequestBody ActiveAccountDto dto) {
-        User user = userService.getById(dto.getId());
-        user.setMobile(dto.getMobile());
-        user.setEnabledMark(EnabledMark.ENABLED.getCode());
-        user.setModifyDate(LocalDateTime.now());
-        userService.updateById(user);
-        // 新增家庭成员信息
-        if (StrUtil.isNotEmpty(dto.getParentName()) && StrUtil.isNotEmpty(dto.getParentMobile())) {
-            List<BaseStudentFamilyMember> list = familyMemberService.list(
-                    new QueryWrapper<BaseStudentFamilyMember>().lambda()
-                            .eq(BaseStudentFamilyMember::getName, dto.getParentName())
-                            .eq(BaseStudentFamilyMember::getUserId, dto.getId())
-                            .eq(BaseStudentFamilyMember::getMobile, dto.getParentMobile())
+        Map<String, List<StudentReportRecordPlanPageVo>> classMap = dataList.stream().filter(x -> x.getReportTime() != null && x.getClassName() != null)
+                .collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getClassName));
+        Map<String, List<StudentReportRecordPlanPageVo>> classNotMap = dataList.stream().filter(x -> x.getReportTime() == null && x.getClassName() != null)
+                .collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getClassName));
+        List<StudentReportRecordItemVo> classList = new ArrayList<>();
+        for (String className : classMap.keySet()) {
+            classList.add(
+                    new StudentReportRecordItemVo(){{
+                        setItem(className);
+                        setCount(classMap.get(className).size());
+                        if(classNotMap.get(className) != null && !(classNotMap.get(className).isEmpty())){
+                            setCount2(classNotMap.get(className).size());
+                        }
+                    }}
             );
-            BaseStudentFamilyMember member;
-            if (list.isEmpty()) {
-                member = new BaseStudentFamilyMember();
-                member.setUserId(user.getId());
-                member.setName(dto.getParentName());
-                member.setMobile(dto.getParentMobile());
-                member.setCreateDate(LocalDateTime.now());
-                member.setCreateUserId(StpUtil.getLoginIdAsLong());
-                familyMemberService.save(member);
-            } else {
-                member = list.get(0);
-            }
-            List<User> parents = userService.list(
-                    new QueryWrapper<User>().lambda()
-                            .eq(User::getUserName, dto.getParentMobile())
-                            .or()
-                            .eq(User::getMobile, dto.getParentMobile())
+        }
+        statisticsVo.setClassList(classList);
+
+        Map<String, List<StudentReportRecordPlanPageVo>> classTypeMap = dataList.stream().filter(x -> x.getReportTime() != null && x.getClassType() != null)
+                .collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getClassType));
+        Map<String, List<StudentReportRecordPlanPageVo>> classTypeNotMap = dataList.stream().filter(x -> x.getReportTime() == null && x.getClassType() != null)
+                .collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getClassType));
+        List<StudentReportRecordItemVo> classTypeList = new ArrayList<>();
+        for (String classType : classTypeMap.keySet()) {
+            classTypeList.add(
+                    new StudentReportRecordItemVo(){{
+                        setItem(classType);
+                        setCount(classTypeMap.get(classType).size());
+                        if(classTypeNotMap.get(classType) != null && !(classTypeNotMap.get(classType).isEmpty())){
+                            setCount2(classTypeNotMap.get(classType).size());
+                        }
+                    }}
             );
-            if (parents.isEmpty()) {
-                User parentUser = new User() {{
-                    setUserName(dto.getParentMobile());
-                    setName(dto.getParentName());
-                    setIsChangePassword(1);
-                    setDeleteMark(0);
-                    setEnabledMark(1);
-                    setPassword(BCrypt.hashpw(propertiesConfig.getDefaultPassword(), BCrypt.gensalt()));
-                    setMobile(dto.getParentMobile());
-                }};
-                userService.save(parentUser);
-
-                userRoleRelationService.save(new UserRoleRelation() {{
-                    setUserId(parentUser.getId());
-                    setRoleId(4L);
-                }});
-
-                BaseUserStudent userStudent = new BaseUserStudent();
-                userStudent.setStudentId(user.getId());
-                userStudent.setStudentNane(user.getName());
-                userStudent.setStudentIdentity(user.getCredentialNumber());
-                userStudent.setCreateDate(new Date());
-                userStudent.setUserId(parentUser.getId());
-                userStudent.setStatus(1);
-                userStudentService.save(userStudent);
-            } else {
-                User parentUser = parents.get(0);
-                BaseUserStudent userStudent = new BaseUserStudent();
-                userStudent.setStudentId(user.getId());
-                userStudent.setStudentNane(user.getName());
-                userStudent.setStudentIdentity(user.getCredentialNumber());
-                userStudent.setCreateDate(new Date());
-                userStudent.setUserId(parentUser.getId());
-                userStudent.setStatus(1);
-                userStudentService.save(userStudent);
-            }
         }
+        statisticsVo.setClassTypeList(classTypeList);
+
+        Map<String, List<StudentReportRecordPlanPageVo>> majorMap = dataList.stream().filter(x -> x.getReportTime() != null && x.getMajorName() != null).collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getMajorName));
+        Map<String, List<StudentReportRecordPlanPageVo>> majorNotMap = dataList.stream().filter(x -> x.getReportTime() == null && x.getMajorName() != null).collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getMajorName));
+        List<StudentReportRecordItemVo> majorList = new ArrayList<>();
+        for (String majorName : majorMap.keySet()) {
+            majorList.add(
+                    new StudentReportRecordItemVo(){{
+                        setItem(majorName);
+                        setCount(majorMap.get(majorName).size());
+                        if(majorNotMap.get(majorName) != null && !(majorNotMap.get(majorName).isEmpty())){
+                            setCount2(majorNotMap.get(majorName).size());
+                        }
+                    }}
+            );
+        }
+        statisticsVo.setMajorList(majorList);
+
+        Map<String, List<StudentReportRecordPlanPageVo>> deptMap = dataList.stream().filter(x -> x.getReportTime() != null && x.getDeptName() != null).collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getDeptName));
+        List<ItemCountVo> deptList = new ArrayList<>();
+        for (String deptName : deptMap.keySet()) {
+            deptList.add(
+                    new ItemCountVo(){{
+                        setItem(deptName);
+                        setCount(deptMap.get(deptName).size());
+                    }}
+            );
+        }
+        statisticsVo.setDeptList(deptList);
 
-
-        //新增白名单信息
-        List<WhitelistManagement> managementList = whitelistManagementService.list(
-                new QueryWrapper<WhitelistManagement>().lambda()
-                        .eq(WhitelistManagement::getUserId, dto.getId())
+        BigDecimal divide = BigDecimal.ZERO;
+        if( statisticsVo.getAllCount() != 0){
+            divide = BigDecimal.valueOf(statisticsVo.getArrivedCount()).divide(BigDecimal.valueOf(statisticsVo.getAllCount()), 4, RoundingMode.HALF_UP);
+        }
+        statisticsVo.setReportRate(divide.doubleValue());
+
+        //查询年级趋势
+        List<BaseGrade> gradeList = gradeService.list(
+                new QueryWrapper<BaseGrade>().lambda()
+                        .eq(BaseGrade::getDeleteMark, DeleteMark.NODELETE.getCode())
+                        .eq(BaseGrade::getEnabledMark, EnabledMark.ENABLED.getCode())
+                        .eq(BaseGrade::getStatus, 1)
+                        .orderByDesc(BaseGrade::getTitle)
         );
-        if (managementList.isEmpty()) {
-            WhitelistManagement whitelistManagement = new WhitelistManagement() {{
-                setName(user.getName());
-                setUserId(user.getId());
-                setCreateDate(new Date());
-                setCredentialNumber(user.getCredentialNumber());
-                setPhone(user.getMobile());
-            }};
-            whitelistManagementService.save(whitelistManagement);
-        } else {
-            WhitelistManagement whitelistManagement = managementList.get(0);
-            whitelistManagement.setName(user.getName());
-            whitelistManagement.setUserId(user.getId());
-            whitelistManagement.setModifyDate(new Date());
-            whitelistManagement.setCredentialNumber(user.getCredentialNumber());
-            whitelistManagement.setPhone(user.getMobile());
-            whitelistManagementService.updateById(whitelistManagement);
+        List<ItemCountVo> gradeDataList = new ArrayList<>();
+        for (int i = 0; i < 3; i ++){
+            BaseGrade baseGrade = gradeList.get(i);
+
+            List<EnrollmentPlan> enrollmentPlans = enrollmentPlanService.list(
+                    new QueryWrapper<EnrollmentPlan>().lambda()
+                            .eq(EnrollmentPlan::getGradeId, baseGrade.getId())
+                            .eq(EnrollmentPlan::getDeleteMark, DeleteMark.NODELETE.getCode())
+                            .eq(EnrollmentPlan::getEnabledMark, EnabledMark.ENABLED.getCode())
+                            .orderByDesc(EnrollmentPlan::getId)
+            );
+            int gradeCount = 0;
+            for (EnrollmentPlan enrollmentPlan : enrollmentPlans) {
+                StudentTryReadingReportPageDto gradeRecordPageDto = new StudentTryReadingReportPageDto();
+                gradeRecordPageDto.setEnrollmentPlanId(enrollmentPlan.getId());
+                gradeRecordPageDto.setIsReport(1);
+                gradeRecordPageDto.setReportCategory(3);
+                gradeCount += recordService.getTryReadingList(gradeRecordPageDto).size();
+            }
+            ItemCountVo itemCountVo = new ItemCountVo();
+            itemCountVo.setItem(baseGrade.getName());
+            itemCountVo.setCount(gradeCount);
+            gradeDataList.add(itemCountVo);
         }
+        Collections.sort(gradeDataList, Comparator.comparing(ItemCountVo::getItem));
+        statisticsVo.setGradeList(gradeDataList);
 
-        CompletableFuture.runAsync(() -> {
-            List<User> userList = userService.list();
-            redisUtil.set(GlobalConstant.USER_CACHE_KEY, userList);
-
-            List<UserRoleRelation> userRoleRelationList = userRoleRelationService.list(Wrappers.lambdaQuery(UserRoleRelation.class));
-            redisUtil.set(GlobalConstant.USER_ROLE_RELATION_CACHE_KEY, userRoleRelationList);
-
-            whitelistManagementService.loadCaches();
-        });
-
-        return RT.ok(true);
+        return RT.ok(statisticsVo);
     }
 
-    @PostMapping("/report-export-query")
-    @ApiOperation(value = "导出")
+    @PostMapping(value = "/export-query")
+    @ApiOperation(value="导出")
+    @SaCheckPermission("studentreportrecord:detail")
     @XjrLog(value = "导出")
-    public ResponseEntity<byte[]> exportData(@Valid @RequestBody BaseNewStudentPageDto dto) {
-        if (dto.getBaseSemesterId() == null) {
-            LambdaQueryWrapper<BaseSemester> queryWrapper = new LambdaQueryWrapper<>();
-            queryWrapper
-                    .orderByDesc(BaseSemester::getStartDate)
-                    .select(BaseSemester.class, x -> VoToColumnUtil.fieldsToColumns(BaseSemester.class).contains(x.getProperty()));
-            List<BaseSemester> semesterList = semesterService.list(queryWrapper);
-            if (!semesterList.isEmpty()) {
-                dto.setBaseSemesterId(semesterList.get(0).getId());
-            }
-        }
+    public ResponseEntity<byte[]> exportQuerty(@Valid @RequestBody StudentTryReadingReportPageDto dto){
+        List<StudentReportRecordExcelVo> dataList = new ArrayList<>();
+
         List<String> roleList = StpUtil.getRoleList();
-        if (roleList.contains("CLASSTE") && roleList.contains("TEACHER") && dto.getTeacherId() == null) {
-            dto.setTeacherId(StpUtil.getLoginIdAsLong());
+        if(roleList.contains(RoleCodeEnum.TEACHER.getCode()) && roleList.contains(RoleCodeEnum.CLASSTE.getCode())){
+            if(dto.getClassId() == null){
+                dto.setTeacherId(StpUtil.getLoginIdAsLong());
+            }
         }
-        List<BaseNewStudentPageVo> reportList = baseNewStudentService.getReportList(dto);
-        List<BaseNewStudentExportVo> exportVos = new ArrayList<>();
-        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss");
-        for (BaseNewStudentPageVo el : reportList) {
-            BaseNewStudentExportVo vo = BeanUtil.toBean(el, BaseNewStudentExportVo.class);
-            if (el.getIsReport() == 1) {
-                vo.setReportStatus("是");
-            } else if (el.getIsReport() == 0) {
-                vo.setReportStatus("否");
+        dto.setReportCategory(3);
+        List<StudentReportRecordPlanPageVo> planPageList = recordService.getTryReadingList(dto);
+
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+        for (StudentReportRecordPlanPageVo pageVo : planPageList) {
+            StudentReportRecordExcelVo excelVo = BeanUtil.toBean(pageVo, StudentReportRecordExcelVo.class);
+            if(pageVo.getReportTime() != null){
+                excelVo.setReportTime(sdf.format(pageVo.getReportTime()));
             }
-            if (el.getReportTime() != null) {
-                vo.setReportTime(el.getReportTime().format(formatter));
+            excelVo.setIsReport("否");
+            if(pageVo.getIsReport() != null && pageVo.getIsReport() == 1){
+                excelVo.setIsReport("是");
             }
-            exportVos.add(vo);
+
+            dataList.add(excelVo);
         }
         ByteArrayOutputStream bot = new ByteArrayOutputStream();
-        EasyExcel.write(bot, BaseNewStudentExportVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(exportVos);
-
-        return RT.fileStream(bot.toByteArray(), "RoomBed" + ExcelTypeEnum.XLSX.getValue());
+        EasyExcel.write(bot, StudentReportRecordExcelVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(dataList);
+        String fileName = "exportQuerty" + ExcelTypeEnum.XLSX.getValue();
+        return RT.fileStream(bot.toByteArray(), fileName);
     }
 
-    @PostMapping("/change-banding-status")
-    @ApiOperation(value = "修改分班状态")
-    @SaCheckPermission("basenewstudent:add")
-    @XjrLog(value = "修改分班状态", saveResponseData = true)
-    public RT<Boolean> changeBandingStatus(@Valid @RequestBody List<ChangeBandingStatusDto> dto) {
-        for (ChangeBandingStatusDto el : dto) {
-            BaseNewStudent newStudent = baseNewStudentService.getById(el.getId());
-
-            UpdateWrapper<BaseNewStudent> updateWrapper = new UpdateWrapper<>();
-            updateWrapper.eq("id", newStudent.getId());
-            updateWrapper.setSql("is_can_banding = " + el.getIsCanBanding());
-            if (StrUtil.isNotEmpty(el.getRemarks())) {
-                updateWrapper.setSql("remarks = '" + el.getRemarks() + "'");
-            } else {
-                updateWrapper.setSql("remarks = null");
+    @GetMapping(value = "/class-list")
+    @ApiOperation(value="查询班级信息")
+    @SaCheckPermission("studentreportrecord:detail")
+    @XjrLog(value = "查询班级信息")
+    public RT<List<BandingTaskClassPageVo>> classList(@Valid StudentReportRecordPageDto dto){
+        BandingTaskClassPageDto classDto = new BandingTaskClassPageDto();
+        if(dto.getEnrollmentPlanId() == null){
+            if(dto.getTeacherId() != null){
+                classDto.setTeacherId(dto.getTeacherId());
+            }else{
+                classDto.setTeacherId(StpUtil.getLoginIdAsLong());
+            }
+            StudentReportPlan plan = reportPlanService.getLastNewStudentReportPlan();
+            if(plan == null){
+                return RT.ok(new ArrayList<>());
+            }
+            classDto.setBandingTaskId(plan.getBandingTaskId());
+        }else{
+            EnrollmentPlan enrollmentPlan = enrollmentPlanService.getById(dto.getEnrollmentPlanId());
+            if(enrollmentPlan != null){
+                List<BandingTask> list = bandingTaskService.list(
+                        new QueryWrapper<BandingTask>().lambda()
+                                .eq(BandingTask::getEnrollType, enrollmentPlan.getEnrollType())
+                                .eq(BandingTask::getGradeId, enrollmentPlan.getGradeId())
+                                .eq(BandingTask::getDeleteMark, DeleteMark.NODELETE.getCode())
+                                .eq(BandingTask::getEnabledMark, EnabledMark.ENABLED.getCode())
+                                .orderByDesc(BandingTask::getId)
+                );
+                if(!list.isEmpty()){
+                    classDto.setBandingTaskId(list.get(0).getId());
+                }
+            }
+            List<String> roleList = StpUtil.getRoleList();
+            if(roleList.contains("CLASSTE") && roleList.contains("TEACHER")){
+                classDto.setTeacherId(StpUtil.getLoginIdAsLong());
             }
-            baseNewStudentService.update(newStudent, updateWrapper);
         }
 
-        return RT.ok(true);
+        List<BandingTaskClassPageVo> list = bandingTaskClassService.getList(classDto);
+        return RT.ok(list);
     }
 
+
 }

+ 3 - 3
src/main/java/com/xjrsoft/module/student/controller/PbCseFeeobjupdateController.java

@@ -90,7 +90,7 @@ public class PbCseFeeobjupdateController {
     @SaCheckPermission("pbcsefeeobjupdate:detail")
     @XjrLog(value = "招生统计", saveResponseData = true)
     public RT<EnrollmentStatisticsInfoVo> getEnrollmentStatisticsInfo(@Valid EnrollmentStatisticsInfoDto dto) {
-        EnrollmentStatisticsInfoVo enrollmentStatisticsInfoVo = pbCseFeeobjupdateService.getEnrollmentStatisticsInfo(dto);
+        EnrollmentStatisticsInfoVo enrollmentStatisticsInfoVo = pbCseFeeobjupdateService.getLastEnrollmentStatisticsInfo(dto);
         return RT.ok(enrollmentStatisticsInfoVo);
     }
 
@@ -99,7 +99,7 @@ public class PbCseFeeobjupdateController {
     @SaCheckPermission("pbcsefeeobjupdate:detail")
     @XjrLog(value = "招生统计每日动态数据", saveResponseData = true)
     public RT<EnrollmentStatisticsCalendarInfoVo> getEnrollmentStatisticsCalendarInfo(@Valid EnrollmentStatisticsCalendarInfoDto dto) {
-        EnrollmentStatisticsCalendarInfoVo enrollmentStatisticsCalendarInfoVo = pbCseFeeobjupdateService.getEnrollmentStatisticsCalendarInfo(dto);
+        EnrollmentStatisticsCalendarInfoVo enrollmentStatisticsCalendarInfoVo = pbCseFeeobjupdateService.getLastEnrollmentStatisticsCalendarInfo(dto);
         return RT.ok(enrollmentStatisticsCalendarInfoVo);
     }
 
@@ -108,7 +108,7 @@ public class PbCseFeeobjupdateController {
     @SaCheckPermission("pbcsefeeobjupdate:detail")
     @XjrLog(value = "招生统计毕业学校数据", saveResponseData = true)
     public RT<EnrollmentStatisticsGraduationInfoVo> getEnrollmentStatisticsGraduationInfo(@Valid EnrollmentStatisticsGraduationInfoDto dto) {
-        EnrollmentStatisticsGraduationInfoVo enrollmentStatisticsGraduationInfoVo = pbCseFeeobjupdateService.getEnrollmentStatisticsGraduationInfo(dto);
+        EnrollmentStatisticsGraduationInfoVo enrollmentStatisticsGraduationInfoVo = pbCseFeeobjupdateService.getLastEnrollmentStatisticsGraduationInfo(dto);
         return RT.ok(enrollmentStatisticsGraduationInfoVo);
     }
 

+ 29 - 3
src/main/java/com/xjrsoft/module/student/controller/StudentReportPlanController.java

@@ -13,6 +13,7 @@ import com.xjrsoft.common.exception.MyException;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.common.utils.LocalDateTimeUtil;
 import com.xjrsoft.common.utils.TreeUtil;
 import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.banding.entity.BandingTask;
@@ -100,6 +101,7 @@ public class StudentReportPlanController {
     @XjrLog(value = "新增学生报到计划")
     public RT<Boolean> add(@Valid @RequestBody AddStudentReportPlanDto dto) {
         StudentReportPlan studentReportPlan = BeanUtil.toBean(dto, StudentReportPlan.class);
+        studentReportPlan.setCategory(1);
         boolean isSuccess = studentReportPlanService.add(studentReportPlan);
         return RT.ok(isSuccess);
     }
@@ -111,8 +113,10 @@ public class StudentReportPlanController {
     public RT<Boolean> update(@Valid @RequestBody UpdateStudentReportPlanDto dto) {
         StudentReportPlan reportPlan = studentReportPlanService.getById(dto.getId());
         BeanUtil.copyProperties(dto, reportPlan);
+        if((reportPlan.getCategory() == 2 || reportPlan.getCategory() == 3) && LocalDateTimeUtil.isDateTimeInRange(LocalDateTime.now(), reportPlan.getStartTime(), reportPlan.getEndTime())){
+            reportPlan.setStatus(1);
+        }
         return RT.ok(studentReportPlanService.update(reportPlan));
-
     }
 
     @DeleteMapping
@@ -230,9 +234,9 @@ public class StudentReportPlanController {
     }
 
     @GetMapping(value = "/try-reading-plan")
-    @ApiOperation(value = "根据分班任务id查询试读报到计划信息")
+    @ApiOperation(value = "根据招生计划id查询试读报到计划信息")
     @SaCheckPermission("bandingrule:try-reading-plan")
-    @XjrLog(value = "根据分班任务id查询试读报到计划信息")
+    @XjrLog(value = "根据招生计划id查询试读报到计划信息")
     public RT<StudentReportPlanVo> tryReadingPlan(@RequestParam Long id) {
         EnrollmentPlan enrollmentPlan = enrollmentPlanService.getById(id);
         StudentReportPlan plan = studentReportPlanService.getOne(
@@ -242,6 +246,28 @@ public class StudentReportPlanController {
                         .innerJoin(BandingTask.class, BandingTask::getId, StudentReportPlan::getBandingTaskId)
                         .eq(BandingTask::getEnrollType, enrollmentPlan.getEnrollType())
                         .eq(BandingTask::getGradeId, enrollmentPlan.getGradeId())
+                        .eq(StudentReportPlan::getCategory, 2)
+        );
+        if (plan == null) {
+            return RT.error("未能查询到有报到学生,无法设置");
+        }
+        return RT.ok(BeanUtil.toBean(plan, StudentReportPlanVo.class));
+    }
+
+    @GetMapping(value = "/new-student-plan")
+    @ApiOperation(value = "根据招生计划id查询新生报到计划信息")
+    @SaCheckPermission("bandingrule:new-student-plan")
+    @XjrLog(value = "根据招生计划id查询新生报到计划信息")
+    public RT<StudentReportPlanVo> newStudentPlan(@RequestParam Long id) {
+        EnrollmentPlan enrollmentPlan = enrollmentPlanService.getById(id);
+        StudentReportPlan plan = studentReportPlanService.getOne(
+                new MPJLambdaWrapper<StudentReportPlan>()
+                        .select(StudentReportPlan::getId)
+                        .select(StudentReportPlan.class, x -> VoToColumnUtil.fieldsToColumns(StudentReportPlan.class).contains(x.getProperty()))
+                        .innerJoin(BandingTask.class, BandingTask::getId, StudentReportPlan::getBandingTaskId)
+                        .eq(BandingTask::getEnrollType, enrollmentPlan.getEnrollType())
+                        .eq(BandingTask::getGradeId, enrollmentPlan.getGradeId())
+                        .eq(StudentReportPlan::getCategory, 3)
         );
         if (plan == null) {
             return RT.error("未能查询到有报到学生,无法设置");

+ 21 - 10
src/main/java/com/xjrsoft/module/student/controller/StudentTryReadingReportController.java

@@ -69,6 +69,8 @@ import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -103,12 +105,14 @@ public class StudentTryReadingReportController {
     @SaCheckPermission("tryreadingreport:detail")
     @XjrLog(value="试读报到(分页)")
     public RT<PageOutput<StudentReportRecordPlanPageVo>> page(@Valid StudentTryReadingReportPageDto dto){
+        dto.setReportCategory(2);
         List<String> roleList = StpUtil.getRoleList();
         if(roleList.contains("CLASSTE") && roleList.contains("TEACHER")){
             dto.setTeacherId(StpUtil.getLoginIdAsLong());
         }
         if(dto.getIsMoible() != null && dto.getIsMoible() == 1){
             StudentReportPlan plan = reportPlanService.getLastTryReadingPlan();
+            dto.setStudentReportPlanId(plan.getId());
             BandingTask bandingTask = bandingTaskService.getById(plan.getBandingTaskId());
             List<EnrollmentPlan> enrollmentPlans = enrollmentPlanService.list(
                     new QueryWrapper<EnrollmentPlan>().lambda()
@@ -167,6 +171,7 @@ public class StudentTryReadingReportController {
         for (Long id : ids) {
             recordService.tryReadingSign(new StudentReportSignDto(){{
                 setId(id);
+                setIsBatch(1);
             }});
         }
         return RT.ok(true);
@@ -212,6 +217,7 @@ public class StudentTryReadingReportController {
                 dto.setTeacherId(StpUtil.getLoginIdAsLong());
             }
         }
+        dto.setReportCategory(2);
         List<StudentReportRecordPlanPageVo> planPageList = recordService.getTryReadingList(dto);
 
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -266,10 +272,10 @@ public class StudentTryReadingReportController {
                     classDto.setBandingTaskId(list.get(0).getId());
                 }
             }
-        }
-        List<String> roleList = StpUtil.getRoleList();
-        if(roleList.contains("CLASSTE") && roleList.contains("TEACHER")){
-            dto.setTeacherId(StpUtil.getLoginIdAsLong());
+            List<String> roleList = StpUtil.getRoleList();
+            if(roleList.contains("CLASSTE") && roleList.contains("TEACHER")){
+                classDto.setTeacherId(StpUtil.getLoginIdAsLong());
+            }
         }
 
         List<BandingTaskClassPageVo> list = bandingTaskClassService.getList(classDto);
@@ -281,12 +287,16 @@ public class StudentTryReadingReportController {
     @SaCheckPermission("studentreportrecord:detail")
     @XjrLog(value = "班级数据统计")
     public RT<BandingTaskClassReportStatisticsVo> classStatistics(@RequestParam Long classId){
-        return RT.ok(bandingTaskClassService.getTryReadingReportClassStatistics(classId));
+        return RT.ok(bandingTaskClassService.getTryReadingReportClassStatistics(new StudentTryReadingReportPageDto(){{
+            setClassId(classId);
+            setReportCategory(2);
+        }}));
     }
 
     @GetMapping(value = "/statistics")
     @ApiOperation(value="领导统计")
     @SaCheckPermission("studentreportrecord:detail")
+    @XjrLog(value = "领导统计")
     public RT<StudentReportRecordStatisticsVo> statistics(@Valid StudentReportRecordStatisticsDto dto){
         if(dto.getGradeId() == null && (dto.getCategory() == null || dto.getCategory() == 1)){
             LambdaQueryWrapper<BaseGrade> queryWrapper = new LambdaQueryWrapper<>();
@@ -319,7 +329,7 @@ public class StudentTryReadingReportController {
 
         StudentTryReadingReportPageDto recordPageDto = new StudentTryReadingReportPageDto();
         recordPageDto.setEnrollmentPlanId(enrollmentPlanList.get(0).getId());
-
+        recordPageDto.setReportCategory(2);
         List<StudentReportRecordPlanPageVo> dataList = recordService.getTryReadingList(recordPageDto);
         StudentReportRecordStatisticsVo statisticsVo = new StudentReportRecordStatisticsVo();
         statisticsVo.setAllCount(dataList.stream().count());
@@ -351,7 +361,7 @@ public class StudentTryReadingReportController {
         ).count());
 
         if(dto.getCategory() != null && dto.getCategory() == 3){
-            Map<String, List<StudentReportRecordPlanPageVo>> graduatedUniversityMap = dataList.stream().filter(x -> x.getReportTime() != null)
+            Map<String, List<StudentReportRecordPlanPageVo>> graduatedUniversityMap = dataList.stream().filter(x -> x.getReportTime() != null && x.getGraduateSchool() != null)
                     .collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getGraduateSchool));
             List<ItemCountVo> graduatedUniversityList = new ArrayList<>();
             for (String graduatedUniversity : graduatedUniversityMap.keySet()) {
@@ -365,7 +375,7 @@ public class StudentTryReadingReportController {
             statisticsVo.setGraduatedUniversityList(graduatedUniversityList);
         }
 
-        Map<String, List<StudentReportRecordPlanPageVo>> classMap = dataList.stream().filter(x -> x.getReportTime() != null)
+        Map<String, List<StudentReportRecordPlanPageVo>> classMap = dataList.stream().filter(x -> x.getReportTime() != null && x.getClassName() != null)
                 .collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getClassName));
         Map<String, List<StudentReportRecordPlanPageVo>> classNotMap = dataList.stream().filter(x -> x.getReportTime() == null && x.getClassName() != null)
                 .collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getClassName));
@@ -383,7 +393,8 @@ public class StudentTryReadingReportController {
         }
         statisticsVo.setClassList(classList);
 
-        Map<String, List<StudentReportRecordPlanPageVo>> classTypeMap = dataList.stream().filter(x -> x.getReportTime() != null).collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getClassType));
+        Map<String, List<StudentReportRecordPlanPageVo>> classTypeMap = dataList.stream().filter(x -> x.getReportTime() != null && x.getClassType() != null)
+                .collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getClassType));
         Map<String, List<StudentReportRecordPlanPageVo>> classTypeNotMap = dataList.stream().filter(x -> x.getReportTime() == null && x.getClassType() != null)
                 .collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getClassType));
         List<StudentReportRecordItemVo> classTypeList = new ArrayList<>();
@@ -465,7 +476,7 @@ public class StudentTryReadingReportController {
             itemCountVo.setCount(gradeCount);
             gradeDataList.add(itemCountVo);
         }
-
+        Collections.sort(gradeDataList, Comparator.comparing(ItemCountVo::getItem));
         statisticsVo.setGradeList(gradeDataList);
 
         return RT.ok(statisticsVo);

+ 3 - 0
src/main/java/com/xjrsoft/module/student/dto/PbVXsxxsfytbPageDto.java

@@ -53,4 +53,7 @@ public class PbVXsxxsfytbPageDto extends PageInput {
 
     @ApiModelProperty("班主任id")
     private Long teacherId;
+
+    @ApiModelProperty("身份证")
+    private String credentialNumber;
 }

+ 5 - 0
src/main/java/com/xjrsoft/module/student/dto/StudentReportSignDto.java

@@ -1,5 +1,6 @@
 package com.xjrsoft.module.student.dto;
 
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -19,4 +20,8 @@ public class StudentReportSignDto {
 
     @ApiModelProperty("班级id")
     private Long classId;
+
+    @JsonIgnore
+    @ApiModelProperty("是否批量")
+    private Integer isBatch = 0;
 }

+ 8 - 0
src/main/java/com/xjrsoft/module/student/dto/StudentTryReadingReportPageDto.java

@@ -1,5 +1,6 @@
 package com.xjrsoft.module.student.dto;
 
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.xjrsoft.common.page.PageInput;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -37,6 +38,9 @@ public class StudentTryReadingReportPageDto extends PageInput {
     @ApiModelProperty("姓名")
     private String name;
 
+    @ApiModelProperty("性别")
+    private String gender;
+
     @ApiModelProperty("班级名称")
     private String className;
 
@@ -69,4 +73,8 @@ public class StudentTryReadingReportPageDto extends PageInput {
     @ApiModelProperty("是否移动端(1:是 0:否)")
     private Integer isMoible;
 
+    @JsonIgnore
+    @ApiModelProperty("报到类别")
+    private Integer reportCategory;
+
 }

+ 91 - 0
src/main/java/com/xjrsoft/module/student/entity/EnrollmentStatisticsInfo.java

@@ -0,0 +1,91 @@
+package com.xjrsoft.module.student.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDate;
+import java.util.Date;
+
+
+/**
+ * @title: 攀宝招生数据统计表
+ * @Author dzx
+ * @Date: 2025年3月17日
+ * @Version 1.0
+ */
+@Data
+@TableName("enrollment_statistics_info")
+@ApiModel(value = "enrollment_statistics_info", description = "攀宝招生数据统计表")
+public class EnrollmentStatisticsInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键编号
+     */
+    @ApiModelProperty("主键编号")
+    @TableId
+    private Long id;
+    /**
+     * 创建人
+     */
+    @ApiModelProperty("创建人")
+    @TableField(fill = FieldFill.INSERT)
+    private Long createUserId;
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty("创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createDate;
+    /**
+     * 修改人
+     */
+    @ApiModelProperty("修改人")
+    @TableField(fill = FieldFill.UPDATE)
+    private Long modifyUserId;
+    /**
+     * 修改时间
+     */
+    @ApiModelProperty("修改时间")
+    @TableField(fill = FieldFill.UPDATE)
+    private Date modifyDate;
+    /**
+     * 删除标记
+     */
+    @ApiModelProperty("删除标记")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleteMark;
+    /**
+     * 有效标志
+     */
+    @ApiModelProperty("有效标志")
+    @TableField(fill = FieldFill.INSERT)
+    private Integer enabledMark;
+    /**
+     * 数据
+     */
+    @ApiModelProperty("数据")
+    private String dataJson;
+
+    @ApiModelProperty("统计类别(1:总统计 2:毕业中学招生统计 3:日期招生数量统计)")
+    private Integer dataType;
+
+    @ApiModelProperty("统计日期")
+    private LocalDate dataDay;
+
+    @ApiModelProperty("一周开始日期")
+    private LocalDate dataStartDay;
+
+    @ApiModelProperty("一周结束日期")
+    private LocalDate dataEndDay;
+
+}

+ 2 - 1
src/main/java/com/xjrsoft/module/student/entity/PbCseFeeobjupdate.java

@@ -136,5 +136,6 @@ public class PbCseFeeobjupdate implements Serializable {
     @ApiModelProperty("更新时间")
     private String updatetime;
 
-
+    @ApiModelProperty("毕业班级")
+    private String gradclass;
 }

+ 0 - 5
src/main/java/com/xjrsoft/module/student/entity/StudentTransfer.java

@@ -65,11 +65,6 @@ public class StudentTransfer implements Serializable {
     @ApiModelProperty("有效标志")
     @TableField(fill = FieldFill.INSERT)
     private Integer enabledMark;
-    /**
-     * 序号
-     */
-    @ApiModelProperty("序号")
-    private Integer sortCode;
 
     @ApiModelProperty("学生id")
     private Long studentUserId;

+ 27 - 0
src/main/java/com/xjrsoft/module/student/mapper/EnrollmentStatisticsInfoMapper.java

@@ -0,0 +1,27 @@
+package com.xjrsoft.module.student.mapper;
+
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.student.entity.EnrollmentPlan;
+import com.xjrsoft.module.student.entity.EnrollmentStatisticsInfo;
+import org.apache.ibatis.annotations.Delete;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @title: 攀宝招生数据统计表
+ * @Author dzx
+ * @Date: 2025年3月17日
+ * @Version 1.0
+ */
+@Mapper
+public interface EnrollmentStatisticsInfoMapper extends MPJBaseMapper<EnrollmentStatisticsInfo> {
+
+    @Delete("delete from enrollment_statistics_info where delete_mark = 0 and data_day = #{dataDay} and data_type = 1")
+    Boolean deleteDataByDate(@Param("dataDay") String dataDay);
+
+    @Delete("delete from enrollment_statistics_info where delete_mark = 0 and data_day = #{dataDay} and data_type = 2")
+    Boolean deleteGraduationDataByDate(@Param("dataDay") String dataDay);
+
+    @Delete("delete from enrollment_statistics_info where delete_mark = 0 and data_start_day = #{dataStartDay} and data_end_day = #{dataEndDay} and data_type = 3")
+    Boolean deleteCalendarDataByDate(@Param("dataStartDay") String dataStartDay, @Param("dataEndDay") String dataEndDay);
+}

+ 6 - 0
src/main/java/com/xjrsoft/module/student/service/IPbCseFeeobjupdateService.java

@@ -22,4 +22,10 @@ public interface IPbCseFeeobjupdateService extends MPJBaseService<PbCseFeeobjupd
     EnrollmentStatisticsCalendarInfoVo getEnrollmentStatisticsCalendarInfo(EnrollmentStatisticsCalendarInfoDto dto);
 
     EnrollmentStatisticsGraduationInfoVo getEnrollmentStatisticsGraduationInfo(EnrollmentStatisticsGraduationInfoDto dto);
+
+    EnrollmentStatisticsInfoVo getLastEnrollmentStatisticsInfo(EnrollmentStatisticsInfoDto dto);
+
+    EnrollmentStatisticsGraduationInfoVo getLastEnrollmentStatisticsGraduationInfo(EnrollmentStatisticsGraduationInfoDto dto);
+
+    EnrollmentStatisticsCalendarInfoVo getLastEnrollmentStatisticsCalendarInfo(EnrollmentStatisticsCalendarInfoDto dto);
 }

+ 2 - 0
src/main/java/com/xjrsoft/module/student/service/IStudentReportPlanService.java

@@ -56,4 +56,6 @@ public interface IStudentReportPlanService extends MPJBaseService<StudentReportP
     List<StudentReportPlanClassRelation> getStudentReportPlanClassRelationList(Long id);
 
     StudentReportPlan getLastTryReadingPlan();
+
+    StudentReportPlan getLastNewStudentReportPlan();
 }

+ 12 - 4
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentSchoolRollServiceImpl.java

@@ -6,7 +6,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.enums.*;
+import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.mapper.BaseClassMapper;
 import com.xjrsoft.module.organization.entity.User;
@@ -277,8 +279,11 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
         userMapper.updateById(user);
 
         //将学籍信息改为在读
-        BaseStudentSchoolRoll schoolRoll = this.getOne(
-                new QueryWrapper<BaseStudentSchoolRoll>().lambda()
+        BaseStudentSchoolRoll schoolRoll = this.baseMapper.selectOne(
+                new MPJLambdaWrapper<BaseStudentSchoolRoll>()
+                        .disableLogicDel()
+                        .select(BaseStudentSchoolRoll::getId)
+                        .select(BaseStudentSchoolRoll.class, x -> VoToColumnUtil.fieldsToColumns(BaseStudentSchoolRoll.class).contains(x.getProperty()))
                         .eq(BaseStudentSchoolRoll::getUserId, userId)
         );
         schoolRoll.setDeleteMark(DeleteMark.NODELETE.getCode());
@@ -326,14 +331,17 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
 
         //将学籍信息改为在读
         BaseStudentSchoolRoll schoolRoll = this.getOne(
-                new QueryWrapper<BaseStudentSchoolRoll>().lambda()
+                new MPJLambdaWrapper<BaseStudentSchoolRoll>()
+                        .disableLogicDel()
+                        .select(BaseStudentSchoolRoll::getId)
+                        .select(BaseStudentSchoolRoll.class, x -> VoToColumnUtil.fieldsToColumns(BaseStudentSchoolRoll.class).contains(x.getProperty()))
                         .eq(BaseStudentSchoolRoll::getUserId, userId)
         );
         UpdateWrapper<BaseStudentSchoolRoll> updateRoll = new UpdateWrapper<>();
         updateRoll.eq("id", schoolRoll.getId());
         updateRoll.setSql("delete_mark = 1");
         updateRoll.setSql("enabled_mark = 0");
-        updateRoll.setSql("class_id = null");
+//        updateRoll.setSql("class_id = null");
         updateRoll.setSql("modify_user_id = " + modifyUserId);
         updateRoll.setSql("modify_date = now()");
         this.update(schoolRoll, updateRoll);

+ 242 - 160
src/main/java/com/xjrsoft/module/student/service/impl/PbCseFeeobjupdateServiceImpl.java

@@ -1,19 +1,36 @@
 package com.xjrsoft.module.student.service.impl;
 
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.xjrsoft.common.enums.DeleteMark;
+import com.xjrsoft.common.enums.EnabledMark;
+import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.base.entity.BaseMajorSet;
 import com.xjrsoft.module.student.dto.EnrollmentStatisticsCalendarInfoDto;
 import com.xjrsoft.module.student.dto.EnrollmentStatisticsGraduationInfoDto;
 import com.xjrsoft.module.student.dto.EnrollmentStatisticsInfoDto;
-import com.xjrsoft.module.student.entity.*;
+import com.xjrsoft.module.student.entity.BaseMajorCategor;
+import com.xjrsoft.module.student.entity.EnrollmentStatisticsInfo;
+import com.xjrsoft.module.student.entity.PbCseFeeitem2;
+import com.xjrsoft.module.student.entity.PbCseFeeobjupdate;
+import com.xjrsoft.module.student.entity.PbCseSpecplan;
+import com.xjrsoft.module.student.entity.PbVXssfdetail;
+import com.xjrsoft.module.student.mapper.EnrollmentStatisticsInfoMapper;
 import com.xjrsoft.module.student.mapper.PbCseFeeobjupdateMapper;
 import com.xjrsoft.module.student.mapper.PbVXsxxsfytbMapper;
 import com.xjrsoft.module.student.service.IPbCseFeeobjupdateService;
 import com.xjrsoft.module.student.service.IPbCseSpecplanService;
-import com.xjrsoft.module.student.vo.*;
+import com.xjrsoft.module.student.vo.ChargingSituationVo;
+import com.xjrsoft.module.student.vo.EnrollmentStatisticsCalendarInfoVo;
+import com.xjrsoft.module.student.vo.EnrollmentStatisticsGraduationInfoVo;
+import com.xjrsoft.module.student.vo.EnrollmentStatisticsInfoKeyValue;
+import com.xjrsoft.module.student.vo.EnrollmentStatisticsInfoVo;
+import com.xjrsoft.module.student.vo.PbVXsxxsfytbSpecnameCountVo;
+import com.xjrsoft.module.student.vo.ProfessionalHeadCoun;
+import com.yomahub.liteflow.util.JsonUtil;
 import lombok.AllArgsConstructor;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
@@ -21,7 +38,11 @@ import java.math.RoundingMode;
 import java.text.DecimalFormat;
 import java.time.LocalDate;
 import java.time.format.DateTimeFormatter;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 /**
@@ -34,9 +55,9 @@ import java.util.stream.Collectors;
 @AllArgsConstructor
 public class PbCseFeeobjupdateServiceImpl extends MPJBaseServiceImpl<PbCseFeeobjupdateMapper, PbCseFeeobjupdate> implements IPbCseFeeobjupdateService {
 
-    @Autowired
     private final IPbCseSpecplanService pbCseSpecplanService;
     private final PbVXsxxsfytbMapper pbVXsxxsfytbMapper;
+    private final EnrollmentStatisticsInfoMapper enrollmentStatisticsInfoMapper;
 
     @Override
     public EnrollmentStatisticsInfoVo getEnrollmentStatisticsInfo(EnrollmentStatisticsInfoDto dto) {
@@ -53,104 +74,107 @@ public class PbCseFeeobjupdateServiceImpl extends MPJBaseServiceImpl<PbCseFeeobj
                 .selectAs(PbCseFeeobjupdate::getQuartername, PbCseFeeobjupdate::getQuartername)
                 .selectAs(PbCseFeeobjupdate::getSex, PbCseFeeobjupdate::getSex)
                 .selectAs(PbCseFeeobjupdate::getGraduations, PbCseFeeobjupdate::getGraduations)
+                .select(PbCseFeeobjupdate.class, x -> VoToColumnUtil.fieldsToColumns(PbCseFeeobjupdate.class).contains(x.getProperty()))
                 .eq(dto.getYear() != null, PbCseFeeobjupdate::getEnteryear, dto.getYear())
         ;
 
         List<PbCseFeeobjupdate> pbCseFeeobjupdateList = this.selectJoinList(PbCseFeeobjupdate.class, pbCseFeeobjupdateMPJLambdaWrapper);
+        if(pbCseFeeobjupdateList.isEmpty()){
+            return null;
+        }
 
-        if (pbCseFeeobjupdateList != null && !pbCseFeeobjupdateList.isEmpty()) {
-            //专业排行
-            Map<String, Long> professionalHeadCount = pbCseFeeobjupdateList.stream().filter(x -> x.getSpecname() != null).collect(Collectors.groupingBy(PbCseFeeobjupdate::getSpecname, Collectors.counting()));
-            if (!professionalHeadCount.isEmpty()) {
-                professionalHeadCount = professionalHeadCount.entrySet().stream()
-                        .sorted(Map.Entry.<String, Long>comparingByValue().reversed())
-                        .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,
-                                (e1, e2) -> e1, LinkedHashMap::new));
-            }
-            //查询每个专业的缴费人数
-            List<PbVXsxxsfytbSpecnameCountVo> specnameCountVos = pbVXsxxsfytbMapper.getSpecnameCount(dto);
-            Map<String, Integer> specnameCountMap = new HashMap<>();
-            for (PbVXsxxsfytbSpecnameCountVo specnameCountVo : specnameCountVos) {
-                specnameCountMap.put(specnameCountVo.getSpecname(), specnameCountVo.getStudentCount());
-            }
+        //专业排行
+        Map<String, Long> professionalHeadCount = pbCseFeeobjupdateList.stream().filter(x -> x.getSpecname() != null).collect(Collectors.groupingBy(PbCseFeeobjupdate::getSpecname, Collectors.counting()));
+        if (!professionalHeadCount.isEmpty()) {
+            professionalHeadCount = professionalHeadCount.entrySet().stream()
+                    .sorted(Map.Entry.<String, Long>comparingByValue().reversed())
+                    .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,
+                            (e1, e2) -> e1, LinkedHashMap::new));
+        }
+        //查询每个专业的缴费人数
+        List<PbVXsxxsfytbSpecnameCountVo> specnameCountVos = pbVXsxxsfytbMapper.getSpecnameCount(dto);
+        Map<String, Integer> specnameCountMap = new HashMap<>();
+        for (PbVXsxxsfytbSpecnameCountVo specnameCountVo : specnameCountVos) {
+            specnameCountMap.put(specnameCountVo.getSpecname(), specnameCountVo.getStudentCount());
+        }
 
 
-            //专业计划人数,余数
-            MPJLambdaWrapper<PbCseSpecplan> pbCseSpecplanMPJLambdaWrapper = new MPJLambdaWrapper<>();
-            pbCseSpecplanMPJLambdaWrapper
-                    .disableSubLogicDel()
-                    .distinct()
-                    .select("ifnull(t2.name,t.specname) as kkey")
-                    .selectAs(PbCseSpecplan::getNum, EnrollmentStatisticsInfoKeyValue::getValue)
-                    .leftJoin(BaseMajorSet.class, BaseMajorSet::getName, PbCseSpecplan::getSpecname)
-                    .leftJoin(BaseMajorCategor.class, BaseMajorCategor::getId, BaseMajorSet::getMajorCategorId)
-                    .eq(dto.getYear() != null, PbCseSpecplan::getXyear, dto.getYear())
-            ;
-
-            List<EnrollmentStatisticsInfoKeyValue> pbCseSpecplanList = pbCseSpecplanService.selectJoinList(EnrollmentStatisticsInfoKeyValue.class, pbCseSpecplanMPJLambdaWrapper);
-
-            Map<String, Long> pbCseSpecplanSumMap = pbCseSpecplanList.stream().collect(Collectors.groupingBy(EnrollmentStatisticsInfoKeyValue::getKkey, Collectors.summingLong(EnrollmentStatisticsInfoKeyValue::getValue)));
-
-            List<ProfessionalHeadCoun> professionalHeadCountRes = new ArrayList<>();
-            for (Map.Entry<String, Long> entry : professionalHeadCount.entrySet()) {
-                professionalHeadCountRes.add(new ProfessionalHeadCoun() {{
-                    setKey(entry.getKey());
-                    setValue(entry.getValue());
-                    if (pbCseSpecplanSumMap.get(entry.getKey()) != null) {
-                        setPlannedNumber(pbCseSpecplanSumMap.get(entry.getKey()));
-                        setRemainder(pbCseSpecplanSumMap.get(entry.getKey()) - entry.getValue());
-                        setPaymentCount(specnameCountMap.get(entry.getKey()));
-                    }
-                    if (specnameCountMap.get(entry.getKey()) != null) {
-                        setPaymentCount(specnameCountMap.get(entry.getKey()));
-                    }
-                }});
-            }
+        //专业计划人数,余数
+        MPJLambdaWrapper<PbCseSpecplan> pbCseSpecplanMPJLambdaWrapper = new MPJLambdaWrapper<>();
+        pbCseSpecplanMPJLambdaWrapper
+                .disableSubLogicDel()
+                .distinct()
+                .select("ifnull(t2.name,t.specname) as kkey")
+                .selectAs(PbCseSpecplan::getNum, EnrollmentStatisticsInfoKeyValue::getValue)
+                .leftJoin(BaseMajorSet.class, BaseMajorSet::getName, PbCseSpecplan::getSpecname)
+                .leftJoin(BaseMajorCategor.class, BaseMajorCategor::getId, BaseMajorSet::getMajorCategorId)
+                .eq(dto.getYear() != null, PbCseSpecplan::getXyear, dto.getYear())
+        ;
+
+        List<EnrollmentStatisticsInfoKeyValue> pbCseSpecplanList = pbCseSpecplanService.selectJoinList(EnrollmentStatisticsInfoKeyValue.class, pbCseSpecplanMPJLambdaWrapper);
+
+        Map<String, Long> pbCseSpecplanSumMap = pbCseSpecplanList.stream().collect(Collectors.groupingBy(EnrollmentStatisticsInfoKeyValue::getKkey, Collectors.summingLong(EnrollmentStatisticsInfoKeyValue::getValue)));
+
+        List<ProfessionalHeadCoun> professionalHeadCountRes = new ArrayList<>();
+        for (Map.Entry<String, Long> entry : professionalHeadCount.entrySet()) {
+            professionalHeadCountRes.add(new ProfessionalHeadCoun() {{
+                setKey(entry.getKey());
+                setValue(entry.getValue());
+                if (pbCseSpecplanSumMap.get(entry.getKey()) != null) {
+                    setPlannedNumber(pbCseSpecplanSumMap.get(entry.getKey()));
+                    setRemainder(pbCseSpecplanSumMap.get(entry.getKey()) - entry.getValue());
+                    setPaymentCount(specnameCountMap.get(entry.getKey()));
+                }
+                if (specnameCountMap.get(entry.getKey()) != null) {
+                    setPaymentCount(specnameCountMap.get(entry.getKey()));
+                }
+            }});
+        }
 
-            //学生类型
+        //学生类型
 //            Map<String, Long> studentSource = pbCseFeeobjupdateList.stream().filter(x -> x.getResourcename() != null).collect(Collectors.groupingBy(PbCseFeeobjupdate::getResourcename, Collectors.counting()));
 //            List<EnrollmentStatisticsInfoKeyValue> studentSourceRes = new ArrayList<>();
 //            for (Map.Entry<String, Long> entry : studentSource.entrySet()) {
 //                studentSourceRes.add(new EnrollmentStatisticsInfoKeyValue(entry.getKey(), entry.getValue()));
 //            }
 
-            Map<String, Long> graduations = pbCseFeeobjupdateList.stream().filter(x -> x.getGraduations() != null).collect(Collectors.groupingBy(PbCseFeeobjupdate::getGraduations, Collectors.counting()));
-            List<EnrollmentStatisticsInfoKeyValue> graduationsRes = new ArrayList<>();
-            for (Map.Entry<String, Long> entry : graduations.entrySet()) {
-                graduationsRes.add(new EnrollmentStatisticsInfoKeyValue(entry.getKey(), entry.getValue()));
-            }
+        Map<String, Long> graduations = pbCseFeeobjupdateList.stream().filter(x -> x.getGraduations() != null).collect(Collectors.groupingBy(PbCseFeeobjupdate::getGraduations, Collectors.counting()));
+        List<EnrollmentStatisticsInfoKeyValue> graduationsRes = new ArrayList<>();
+        for (Map.Entry<String, Long> entry : graduations.entrySet()) {
+            graduationsRes.add(new EnrollmentStatisticsInfoKeyValue(entry.getKey(), entry.getValue()));
+        }
 
-            //住宿类型
-            Map<String, Long> accommodationType = pbCseFeeobjupdateList.stream().filter(x -> x.getQuartername() != null).collect(Collectors.groupingBy(PbCseFeeobjupdate::getQuartername, Collectors.counting()));
-            List<EnrollmentStatisticsInfoKeyValue> accommodationTypeRes = new ArrayList<>();
-            for (Map.Entry<String, Long> entry : accommodationType.entrySet()) {
-                accommodationTypeRes.add(new EnrollmentStatisticsInfoKeyValue(entry.getKey(), entry.getValue()));
-            }
+        //住宿类型
+        Map<String, Long> accommodationType = pbCseFeeobjupdateList.stream().filter(x -> x.getQuartername() != null).collect(Collectors.groupingBy(PbCseFeeobjupdate::getQuartername, Collectors.counting()));
+        List<EnrollmentStatisticsInfoKeyValue> accommodationTypeRes = new ArrayList<>();
+        for (Map.Entry<String, Long> entry : accommodationType.entrySet()) {
+            accommodationTypeRes.add(new EnrollmentStatisticsInfoKeyValue(entry.getKey(), entry.getValue()));
+        }
 
-            //性别
-            Map<String, Long> gender = pbCseFeeobjupdateList.stream().collect(Collectors.groupingBy(PbCseFeeobjupdate::getSex, Collectors.counting()));
-            List<EnrollmentStatisticsInfoKeyValue> genderRes = new ArrayList<>();
-            for (Map.Entry<String, Long> entry : gender.entrySet()) {
-                genderRes.add(new EnrollmentStatisticsInfoKeyValue(entry.getKey(), entry.getValue()));
-            }
+        //性别
+        Map<String, Long> gender = pbCseFeeobjupdateList.stream().collect(Collectors.groupingBy(PbCseFeeobjupdate::getSex, Collectors.counting()));
+        List<EnrollmentStatisticsInfoKeyValue> genderRes = new ArrayList<>();
+        for (Map.Entry<String, Long> entry : gender.entrySet()) {
+            genderRes.add(new EnrollmentStatisticsInfoKeyValue(entry.getKey(), entry.getValue()));
+        }
 
-            result.setRegistrationPopulation(pbCseFeeobjupdateList.size());
-            result.setProfessionalHeadCount(professionalHeadCountRes);
-            result.setStudentSource(graduationsRes);
-            result.setAccommodationType(accommodationTypeRes);
-            result.setGender(genderRes);
-
-            //获取所有学生的收费明细
-            MPJLambdaWrapper<PbCseFeeobjupdate> feeobjupdateXssfdetailMPJLambdaWrapper = new MPJLambdaWrapper<>();
-            feeobjupdateXssfdetailMPJLambdaWrapper
-                    .select("count(distinct t1.personalid) as payers")
-                    .selectSum(PbVXssfdetail::getMny, EnrollmentStatisticsInfoVo::getRecordedAmountOfMoney)
-                    .leftJoin(PbVXssfdetail.class, PbVXssfdetail::getPersonalid, PbCseFeeobjupdate::getPersonalid)
-                    .eq(dto.getYear() != null, PbCseFeeobjupdate::getEnteryear, dto.getYear())
-            ;
-            EnrollmentStatisticsInfoVo enrollmentStatisticsInfoVo = this.selectJoinOne(EnrollmentStatisticsInfoVo.class, feeobjupdateXssfdetailMPJLambdaWrapper);
-
-            //退费金额
+        result.setRegistrationPopulation(pbCseFeeobjupdateList.size());
+        result.setProfessionalHeadCount(professionalHeadCountRes);
+        result.setStudentSource(graduationsRes);
+        result.setAccommodationType(accommodationTypeRes);
+        result.setGender(genderRes);
+
+        //获取所有学生的收费明细
+        MPJLambdaWrapper<PbCseFeeobjupdate> feeobjupdateXssfdetailMPJLambdaWrapper = new MPJLambdaWrapper<>();
+        feeobjupdateXssfdetailMPJLambdaWrapper
+                .select("count(distinct t1.personalid) as payers")
+                .selectSum(PbVXssfdetail::getMny, EnrollmentStatisticsInfoVo::getRecordedAmountOfMoney)
+                .leftJoin(PbVXssfdetail.class, PbVXssfdetail::getPersonalid, PbCseFeeobjupdate::getPersonalid)
+                .eq(dto.getYear() != null, PbCseFeeobjupdate::getEnteryear, dto.getYear())
+        ;
+        EnrollmentStatisticsInfoVo enrollmentStatisticsInfoVo = this.selectJoinOne(EnrollmentStatisticsInfoVo.class, feeobjupdateXssfdetailMPJLambdaWrapper);
+
+        //退费金额
 //            MPJLambdaWrapper<PbCseFeeobjupdate> feeobjupdateXssfdetailMPJLambdaWrapper = new MPJLambdaWrapper<>();
 //            feeobjupdateXssfdetailMPJLambdaWrapper
 //                    .selectCount(PbVXssfdetail::getPersonalid, EnrollmentStatisticsInfoVo::getPayers)
@@ -160,53 +184,53 @@ public class PbCseFeeobjupdateServiceImpl extends MPJBaseServiceImpl<PbCseFeeobj
 //            ;
 //            EnrollmentStatisticsInfoVo enrollmentStatisticsInfoVo = this.selectJoinOne(EnrollmentStatisticsInfoVo.class, feeobjupdateXssfdetailMPJLambdaWrapper);
 
-            //缴费人数,入账金额
-            if (enrollmentStatisticsInfoVo != null) {
-                result.setPayers(enrollmentStatisticsInfoVo.getPayers());
-                if (enrollmentStatisticsInfoVo.getRecordedAmountOfMoney() != null) {
-                    result.setRecordedAmountOfMoney(enrollmentStatisticsInfoVo.getRecordedAmountOfMoney().setScale(2, RoundingMode.DOWN));
-                }
+        //缴费人数,入账金额
+        long count = pbCseFeeobjupdateList.stream().filter(x -> x.getPaymnystate() != null && "已缴费".equals(x.getPaymnystate())).count();
+        result.setPayers(Long.valueOf(count).intValue() );
+        if (enrollmentStatisticsInfoVo != null) {
+            if (enrollmentStatisticsInfoVo.getRecordedAmountOfMoney() != null) {
+                result.setRecordedAmountOfMoney(enrollmentStatisticsInfoVo.getRecordedAmountOfMoney().setScale(2, RoundingMode.DOWN));
             }
+        }
 
-            //获取所有学生的缴费详情
-            MPJLambdaWrapper<PbCseFeeobjupdate> feeobjupdateMPJLambdaWrapper = new MPJLambdaWrapper<>();
-            feeobjupdateMPJLambdaWrapper
-                    .selectAs(PbCseFeeitem2::getShortname, PbVXssfdetail::getFeeitemname)
-                    .selectAs(PbCseFeeobjupdate::getPersonalid, PbVXssfdetail::getPersonalid)
-                    .selectAs(PbVXssfdetail::getMny, PbVXssfdetail::getMny)
-                    .leftJoin(PbVXssfdetail.class, PbVXssfdetail::getPersonalid, PbCseFeeobjupdate::getPersonalid)
-                    .leftJoin(PbCseFeeitem2.class, PbCseFeeitem2::getFeeitemname, PbVXssfdetail::getFeeitemname)
-                    .eq(dto.getYear() != null, PbCseFeeobjupdate::getEnteryear, dto.getYear())
-                    .isNotNull(PbVXssfdetail::getFeeitemname)
-            ;
-            List<PbVXssfdetail> pbVXssfdetails = this.selectJoinList(PbVXssfdetail.class, feeobjupdateMPJLambdaWrapper);
-
-            //收费项目情况统计
-            Map<String, Long> pbVXssfdetailMap = pbVXssfdetails.stream().collect(Collectors.groupingBy(PbVXssfdetail::getFeeitemname, Collectors.counting()));
-            Map<String, BigDecimal> pbVXssfdetailSumMap = pbVXssfdetails.stream()
-                    .collect(Collectors.groupingBy(PbVXssfdetail::getFeeitemname,
-                            Collectors.mapping(PbVXssfdetail::getMny, Collectors.reducing(BigDecimal.ZERO, BigDecimal::add))));
-
-            List<ChargingSituationVo> chargingSituationVoRes = new ArrayList<>();
-            DecimalFormat df = new DecimalFormat("#.##");
-            for (Map.Entry<String, Long> entry : pbVXssfdetailMap.entrySet()) {
-                chargingSituationVoRes.add(new ChargingSituationVo() {{
-                    setFeeitemname(entry.getKey());
-                    setPaid(entry.getValue());
-                    if (entry.getKey().equals("普通中专、职业高中、成人中专普通宿舍") && !accommodationType.isEmpty() && accommodationType.get("住宿") != null) {
-                        setUnpaid(accommodationType.get("住宿") - entry.getValue());
-                        setRateOfPayment(df.format((double) entry.getValue() / accommodationType.get("住宿") * 100) + "%");
-                    } else {
-                        setUnpaid(result.getRegistrationPopulation() - entry.getValue());
-                        setRateOfPayment(df.format((double) entry.getValue() / result.getRegistrationPopulation() * 100) + "%");
-                    }
-                    if (pbVXssfdetailSumMap.get(entry.getKey()) != null) {
-                        setRecordedmoney(pbVXssfdetailSumMap.get(entry.getKey()).setScale(2, RoundingMode.DOWN));
-                    }
-                }});
-            }
-            result.setChargingSituationVoList(chargingSituationVoRes);
+        //获取所有学生的缴费详情
+        MPJLambdaWrapper<PbCseFeeobjupdate> feeobjupdateMPJLambdaWrapper = new MPJLambdaWrapper<>();
+        feeobjupdateMPJLambdaWrapper
+                .selectAs(PbCseFeeitem2::getShortname, PbVXssfdetail::getFeeitemname)
+                .selectAs(PbCseFeeobjupdate::getPersonalid, PbVXssfdetail::getPersonalid)
+                .selectAs(PbVXssfdetail::getMny, PbVXssfdetail::getMny)
+                .leftJoin(PbVXssfdetail.class, PbVXssfdetail::getPersonalid, PbCseFeeobjupdate::getPersonalid)
+                .leftJoin(PbCseFeeitem2.class, PbCseFeeitem2::getFeeitemname, PbVXssfdetail::getFeeitemname)
+                .eq(dto.getYear() != null, PbCseFeeobjupdate::getEnteryear, dto.getYear())
+                .isNotNull(PbVXssfdetail::getFeeitemname)
+        ;
+        List<PbVXssfdetail> pbVXssfdetails = this.selectJoinList(PbVXssfdetail.class, feeobjupdateMPJLambdaWrapper);
+
+        //收费项目情况统计
+        Map<String, Long> pbVXssfdetailMap = pbVXssfdetails.stream().collect(Collectors.groupingBy(PbVXssfdetail::getFeeitemname, Collectors.counting()));
+        Map<String, BigDecimal> pbVXssfdetailSumMap = pbVXssfdetails.stream()
+                .collect(Collectors.groupingBy(PbVXssfdetail::getFeeitemname,
+                        Collectors.mapping(PbVXssfdetail::getMny, Collectors.reducing(BigDecimal.ZERO, BigDecimal::add))));
+
+        List<ChargingSituationVo> chargingSituationVoRes = new ArrayList<>();
+        DecimalFormat df = new DecimalFormat("#.##");
+        for (Map.Entry<String, Long> entry : pbVXssfdetailMap.entrySet()) {
+            chargingSituationVoRes.add(new ChargingSituationVo() {{
+                setFeeitemname(entry.getKey());
+                setPaid(entry.getValue());
+                if (entry.getKey().equals("普通中专、职业高中、成人中专普通宿舍") && !accommodationType.isEmpty() && accommodationType.get("住宿") != null) {
+                    setUnpaid(accommodationType.get("住宿") - entry.getValue());
+                    setRateOfPayment(df.format((double) entry.getValue() / accommodationType.get("住宿") * 100) + "%");
+                } else {
+                    setUnpaid(result.getRegistrationPopulation() - entry.getValue());
+                    setRateOfPayment(df.format((double) entry.getValue() / result.getRegistrationPopulation() * 100) + "%");
+                }
+                if (pbVXssfdetailSumMap.get(entry.getKey()) != null) {
+                    setRecordedmoney(pbVXssfdetailSumMap.get(entry.getKey()).setScale(2, RoundingMode.DOWN));
+                }
+            }});
         }
+        result.setChargingSituationVoList(chargingSituationVoRes);
 
         return result;
     }
@@ -230,23 +254,24 @@ public class PbCseFeeobjupdateServiceImpl extends MPJBaseServiceImpl<PbCseFeeobj
         ;
 
         List<PbCseFeeobjupdate> pbCseFeeobjupdateByYearMonthList = this.selectJoinList(PbCseFeeobjupdate.class, pbCseFeeobjupdateByYearMonth);
+        if(pbCseFeeobjupdateByYearMonthList.isEmpty()){
+            return null;
+        }
 
-        if (pbCseFeeobjupdateByYearMonthList != null && !pbCseFeeobjupdateByYearMonthList.isEmpty()) {
-            //每日招生人数
-            Map<String, Long> cratetime = pbCseFeeobjupdateByYearMonthList.stream().collect(Collectors.groupingBy(pbCseFeeobjupdate -> pbCseFeeobjupdate.getCratetime().substring(0, 10), Collectors.counting()));
-            if (!cratetime.isEmpty()) {
-                cratetime = cratetime.entrySet().stream()
-                        .sorted(Map.Entry.comparingByKey())
-                        .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,
-                                (e1, e2) -> e1, LinkedHashMap::new));
-            }
-            List<EnrollmentStatisticsInfoKeyValue> cratetimeRes = new ArrayList<>();
-            for (Map.Entry<String, Long> entry : cratetime.entrySet()) {
-                cratetimeRes.add(new EnrollmentStatisticsInfoKeyValue(entry.getKey(), entry.getValue()));
-            }
-
-            result.setCratetimeList(cratetimeRes);
+        //每日招生人数
+        Map<String, Long> cratetime = pbCseFeeobjupdateByYearMonthList.stream().collect(Collectors.groupingBy(pbCseFeeobjupdate -> pbCseFeeobjupdate.getCratetime().substring(0, 10), Collectors.counting()));
+        if (!cratetime.isEmpty()) {
+            cratetime = cratetime.entrySet().stream()
+                    .sorted(Map.Entry.comparingByKey())
+                    .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,
+                            (e1, e2) -> e1, LinkedHashMap::new));
         }
+        List<EnrollmentStatisticsInfoKeyValue> cratetimeRes = new ArrayList<>();
+        for (Map.Entry<String, Long> entry : cratetime.entrySet()) {
+            cratetimeRes.add(new EnrollmentStatisticsInfoKeyValue(entry.getKey(), entry.getValue()));
+        }
+
+        result.setCratetimeList(cratetimeRes);
         return result;
     }
 
@@ -265,24 +290,81 @@ public class PbCseFeeobjupdateServiceImpl extends MPJBaseServiceImpl<PbCseFeeobj
                 .like(PbCseFeeobjupdate::getCratetime, day)
         ;
         List<PbCseFeeobjupdate> pbCseFeeobjupdateByDayList = this.selectJoinList(PbCseFeeobjupdate.class, pbCseFeeobjupdateByDay);
+        if(pbCseFeeobjupdateByDayList.isEmpty()){
+            return null;
+        }
 
-        if (pbCseFeeobjupdateByDayList != null && !pbCseFeeobjupdateByDayList.isEmpty()) {
-            //毕业学校排行
-            Map<String, Long> graduations = pbCseFeeobjupdateByDayList.stream().collect(Collectors.groupingBy(PbCseFeeobjupdate::getGraduations, Collectors.counting()));
-            if (!graduations.isEmpty()) {
-                graduations = graduations.entrySet().stream()
-                        .sorted(Map.Entry.<String, Long>comparingByValue().reversed())
-                        .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,
-                                (e1, e2) -> e1, LinkedHashMap::new));
-            }
-            List<EnrollmentStatisticsInfoKeyValue> graduationRes = new ArrayList<>();
-            for (Map.Entry<String, Long> entry : graduations.entrySet()) {
-                graduationRes.add(new EnrollmentStatisticsInfoKeyValue(entry.getKey(), entry.getValue()));
-            }
-
-            result.setGraduationList(graduationRes);
+        //毕业学校排行
+        Map<String, Long> graduations = pbCseFeeobjupdateByDayList.stream().collect(Collectors.groupingBy(PbCseFeeobjupdate::getGraduations, Collectors.counting()));
+        if (!graduations.isEmpty()) {
+            graduations = graduations.entrySet().stream()
+                    .sorted(Map.Entry.<String, Long>comparingByValue().reversed())
+                    .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,
+                            (e1, e2) -> e1, LinkedHashMap::new));
+        }
+        List<EnrollmentStatisticsInfoKeyValue> graduationRes = new ArrayList<>();
+        for (Map.Entry<String, Long> entry : graduations.entrySet()) {
+            graduationRes.add(new EnrollmentStatisticsInfoKeyValue(entry.getKey(), entry.getValue()));
         }
 
+        result.setGraduationList(graduationRes);
+
         return result;
     }
+
+    @Override
+    public EnrollmentStatisticsInfoVo getLastEnrollmentStatisticsInfo(EnrollmentStatisticsInfoDto dto) {
+        List<EnrollmentStatisticsInfo> list = enrollmentStatisticsInfoMapper.selectList(
+                new QueryWrapper<EnrollmentStatisticsInfo>().lambda()
+                        .eq(EnrollmentStatisticsInfo::getDeleteMark, DeleteMark.NODELETE.getCode())
+                        .eq(EnrollmentStatisticsInfo::getEnabledMark, EnabledMark.ENABLED.getCode())
+                        .eq(EnrollmentStatisticsInfo::getDataType, 1)
+                        .orderByDesc(EnrollmentStatisticsInfo::getCreateDate)
+        );
+        if(!list.isEmpty()){
+            EnrollmentStatisticsInfo result = list.get(0);
+            EnrollmentStatisticsInfoVo resultVo = JsonUtil.parseObject(result.getDataJson(), EnrollmentStatisticsInfoVo.class);
+            resultVo.setUpdateDate(result.getCreateDate());
+            return resultVo;
+        }
+        return null;
+    }
+
+    @Override
+    public EnrollmentStatisticsGraduationInfoVo getLastEnrollmentStatisticsGraduationInfo(EnrollmentStatisticsGraduationInfoDto dto) {
+        List<EnrollmentStatisticsInfo> list = enrollmentStatisticsInfoMapper.selectList(
+                new QueryWrapper<EnrollmentStatisticsInfo>().lambda()
+                        .eq(EnrollmentStatisticsInfo::getDeleteMark, DeleteMark.NODELETE.getCode())
+                        .eq(EnrollmentStatisticsInfo::getEnabledMark, EnabledMark.ENABLED.getCode())
+                        .eq(EnrollmentStatisticsInfo::getDataType, 2)
+                        .eq(StrUtil.isNotEmpty(dto.getDay()), EnrollmentStatisticsInfo::getDataDay, dto.getDay())
+                        .orderByDesc(EnrollmentStatisticsInfo::getCreateDate)
+        );
+        if(!list.isEmpty()){
+            EnrollmentStatisticsInfo result = list.get(0);
+            EnrollmentStatisticsGraduationInfoVo resultVo = JsonUtil.parseObject(result.getDataJson(), EnrollmentStatisticsGraduationInfoVo.class);
+            return resultVo;
+        }
+        return null;
+    }
+
+    @Override
+    public EnrollmentStatisticsCalendarInfoVo getLastEnrollmentStatisticsCalendarInfo(EnrollmentStatisticsCalendarInfoDto dto) {
+        List<EnrollmentStatisticsInfo> list = enrollmentStatisticsInfoMapper.selectList(
+                new QueryWrapper<EnrollmentStatisticsInfo>().lambda()
+                        .eq(EnrollmentStatisticsInfo::getDeleteMark, DeleteMark.NODELETE.getCode())
+                        .eq(EnrollmentStatisticsInfo::getEnabledMark, EnabledMark.ENABLED.getCode())
+                        .eq(EnrollmentStatisticsInfo::getDataType, 3)
+                        .eq(EnrollmentStatisticsInfo::getDataDay, LocalDate.now())
+                        .eq(StrUtil.isNotEmpty(dto.getStartDay()), EnrollmentStatisticsInfo::getDataStartDay, dto.getStartDay())
+                        .eq(StrUtil.isNotEmpty(dto.getEndDay()), EnrollmentStatisticsInfo::getDataEndDay, dto.getEndDay())
+                        .orderByDesc(EnrollmentStatisticsInfo::getCreateDate)
+        );
+        if(!list.isEmpty()){
+            EnrollmentStatisticsInfo result = list.get(0);
+            EnrollmentStatisticsCalendarInfoVo resultVo = JsonUtil.parseObject(result.getDataJson(), EnrollmentStatisticsCalendarInfoVo.class);
+            return resultVo;
+        }
+        return null;
+    }
 }

+ 4 - 2
src/main/java/com/xjrsoft/module/student/service/impl/PbVXsxxsfytbServiceImpl.java

@@ -119,8 +119,9 @@ public class PbVXsxxsfytbServiceImpl extends MPJBaseServiceImpl<PbVXsxxsfytbMapp
         pbVXsxxsfytbMPJLambdaWrapper
                 .disableSubLogicDel()
                 .like(dto.getFeeitemname() != null && !dto.getFeeitemname().isEmpty(), PbVXsxxsfytb::getFeeitemname, dto.getFeeitemname())
-                .like(dto.getName() != null && !dto.getName().isEmpty(), PbVXsxxsfytb::getFeeobjname, dto.getName())
-                .eq(dto.getStudentId() != null && !dto.getStudentId().isEmpty(), BaseStudent::getStudentId, dto.getStudentId())
+                .like(StrUtil.isNotEmpty(dto.getName()), PbVXsxxsfytb::getFeeobjname, dto.getName())
+                .eq(StrUtil.isNotEmpty(dto.getStudentId()), BaseStudent::getStudentId, dto.getStudentId())
+                .eq(StrUtil.isNotEmpty(dto.getCredentialNumber()), XjrUser::getCredentialNumber, dto.getCredentialNumber())
                 .in(dto.getClassIdList() != null && !dto.getClassIdList().isEmpty(), BaseStudentSchoolRoll::getClassId, dto.getClassIdList())
                 .eq(dto.getSemesterId() != null && dto.getSemesterId() > 0, PbSemesterConfig::getBaseSemesterId, dto.getSemesterId())
                 .like(dto.getJfzt() != null && !"".equals(dto.getJfzt()), PbVXsxxsfytb::getJfzt, dto.getJfzt())
@@ -138,6 +139,7 @@ public class PbVXsxxsfytbServiceImpl extends MPJBaseServiceImpl<PbVXsxxsfytbMapp
                 .selectAs(BaseSemester::getId, PbVXsxxsfytbPageVo::getBaseSemester)
                 .selectAs(XjrUser::getId, PbVXsxxsfytbPageVo::getUserId)
                 .selectAs(BaseClass::getName, PbVXsxxsfytbPageVo::getClassname)
+                .selectAs(PbVXsxxsfytb::getPersonalid, PbVXsxxsfytbPageVo::getCredentialNumber)
                 .selectAs(BaseSemester::getName, PbVXsxxsfytbPageVo::getBaseSemesterCn)
                 .select(PbVXsxxsfytb.class, x -> VoToColumnUtil.fieldsToColumns(PbVXsxxsfytbPageVo.class).contains(x.getProperty()))
         ;

+ 14 - 0
src/main/java/com/xjrsoft/module/student/service/impl/StudentReportPlanServiceImpl.java

@@ -257,4 +257,18 @@ public class StudentReportPlanServiceImpl extends MPJBaseServiceImpl<StudentRepo
         }
         return list.get(0);
     }
+
+    @Override
+    public StudentReportPlan getLastNewStudentReportPlan() {
+        List<StudentReportPlan> list = this.list(
+                new QueryWrapper<StudentReportPlan>().lambda()
+                        .eq(StudentReportPlan::getCategory, 3)
+                        .eq(StudentReportPlan::getStatus, 1)
+                        .orderByDesc(StudentReportPlan::getEndTime)
+        );
+        if (list.isEmpty()) {
+            return null;
+        }
+        return list.get(0);
+    }
 }

+ 12 - 3
src/main/java/com/xjrsoft/module/student/service/impl/StudentReportRecordServiceImpl.java

@@ -31,8 +31,10 @@ import com.xjrsoft.module.banding.service.IBandingTaskClassStudentService;
 import com.xjrsoft.module.banding.service.IBandingTaskService;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.entity.BaseGrade;
+import com.xjrsoft.module.base.entity.BaseMajorSet;
 import com.xjrsoft.module.base.mapper.BaseClassMapper;
 import com.xjrsoft.module.base.mapper.BaseGradeMapper;
+import com.xjrsoft.module.base.mapper.BaseMajorSetMapper;
 import com.xjrsoft.module.organization.dto.GetUserByParamDto;
 import com.xjrsoft.module.organization.entity.User;
 import com.xjrsoft.module.organization.entity.UserRoleRelation;
@@ -101,6 +103,7 @@ public class StudentReportRecordServiceImpl extends MPJBaseServiceImpl<StudentRe
     private final IBandingTaskClassService taskClassService;
     private final IBandingTaskService taskService;
     private final BaseGradeMapper gradeMapper;
+    private final BaseMajorSetMapper majorSetMapper;
 
 
     @Override
@@ -325,7 +328,7 @@ public class StudentReportRecordServiceImpl extends MPJBaseServiceImpl<StudentRe
         StudentReportRecord record = this.getById(dto.getId());
         LocalDateTime now = LocalDateTime.now();
         StudentReportPlan reportPlan = planMapper.selectById(record.getStudentReportPlanId());
-        if(!LocalDateTimeUtil.isDateTimeInRange(now, reportPlan.getStartTime(), reportPlan.getEndTime())){
+        if(dto.getIsBatch() == 0 && !LocalDateTimeUtil.isDateTimeInRange(now, reportPlan.getStartTime(), reportPlan.getEndTime())){
             throw new MyException("不在修改时间内,无法修改");
         }
 
@@ -375,8 +378,14 @@ public class StudentReportRecordServiceImpl extends MPJBaseServiceImpl<StudentRe
                     i ++;
                     baseClass.setCode(baseGrade.getTitle().replace("年", "") + String.format("%03d", i));
                 }
-
+                baseClass.setGradeId(task.getGradeId());
+                BaseMajorSet majorSet = majorSetMapper.selectById(baseClass.getMajorSetId());
+                baseClass.setOrgId(majorSet.getDepartmentId());
+                baseClass.setId(null);
                 classMapper.insert(baseClass);
+
+                taskClass.setBaseClassId(baseClass.getId());
+                taskClassService.updateById(taskClass);
             }
             //根据身份证号查询这个学生是否存在
             User user = userService.getOne(
@@ -397,7 +406,7 @@ public class StudentReportRecordServiceImpl extends MPJBaseServiceImpl<StudentRe
                     setCredentialNumber(student.getCredentialNumber());
                     setCredentialType("ZZLS10007");
                     setMobile(student.getMobile());
-                    setEnabledMark(EnabledMark.DISABLED.getCode());
+                    setEnabledMark(EnabledMark.ENABLED.getCode());
                     setGender(student.getGender());
                     setIsChangePassword(1);
                     setBirthDate(birthDate.atStartOfDay());

+ 3 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseStudentInfoDetailVo.java

@@ -126,4 +126,7 @@ public class BaseStudentInfoDetailVo {
 
     @ApiModelProperty("学生档案编号")
     private String archivesNumber;
+
+    @ApiModelProperty("身份证号")
+    private String credentialNumber;
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseStudentInfoPageVo.java

@@ -120,4 +120,7 @@ public class BaseStudentInfoPageVo {
 
     @ApiModelProperty("学生类别")
     private String studentForm;
+
+    @ApiModelProperty("身份证号")
+    private String credentialNumber;
 }

+ 4 - 0
src/main/java/com/xjrsoft/module/student/vo/EnrollmentStatisticsInfoVo.java

@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.math.BigDecimal;
+import java.util.Date;
 import java.util.List;
 
 @Data
@@ -49,4 +50,7 @@ public class EnrollmentStatisticsInfoVo {
      */
     @ApiModelProperty("性别")
     private List<EnrollmentStatisticsInfoKeyValue> gender;
+
+    @ApiModelProperty("最后更新时间")
+    private Date updateDate;
 }

+ 1 - 1
src/main/java/com/xjrsoft/module/student/vo/PbVXsxxsfytbPageVo.java

@@ -73,7 +73,7 @@ public class PbVXsxxsfytbPageVo {
      * 身份证号
      */
     @ApiModelProperty("身份证号")
-    private String personalid;
+    private String credentialNumber;
     /**
      * 招生老师
      */

+ 5 - 4
src/main/java/com/xjrsoft/module/workflow/dto/MyExaminePageDto.java

@@ -6,6 +6,7 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.springframework.format.annotation.DateTimeFormat;
 
+import java.time.LocalDate;
 import java.util.Date;
 import java.util.List;
 
@@ -23,14 +24,14 @@ public class MyExaminePageDto extends PageInput {
      * 开始时间
      */
     @ApiModelProperty("开始时间")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date startTime;
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private LocalDate startTime;
     /**
      * 结束时间
      */
     @ApiModelProperty("结束时间")
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    private Date endTime;
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private LocalDate endTime;
     /**
      * 模板名称
      */

+ 9 - 9
src/main/java/com/xjrsoft/module/workflow/utils/WorkFlowUtil.java

@@ -239,10 +239,10 @@ public class WorkFlowUtil {
      * @return
      */
     public static List<Long> getUserIdsByMemberConfig(List<MemberConfig> memberConfigs, List<Map<String, Object>> childNodeConfig, String processId) {
-        List<Long> result = new ArrayList<>();
+        Set<Long> result = new HashSet<>();
 
-        if (memberConfigs.size() == 0) {
-            return result;
+        if (memberConfigs.isEmpty()) {
+            return new ArrayList<>();
         }
 
         RedisUtil redisUtil = SpringUtil.getBean(RedisUtil.class);
@@ -330,7 +330,7 @@ public class WorkFlowUtil {
                 Optional<Map<String, Object>> nodeMap = childNodeConfig.stream().filter(x -> x.get(GlobalConstant.DEFAULT_PK).equals(leaderConfig.getNodeId())).findFirst();
 
                 if (!nodeMap.isPresent()) {
-                    return result;
+                    return new ArrayList<>(result);
                 }
 
                 //如果是开始节点
@@ -344,7 +344,7 @@ public class WorkFlowUtil {
                     //获取到发起人用户信息
                     Optional<User> startUserOp = users.stream().filter(x -> x.getId().equals(startUserId)).findFirst();
                     if (!startUserOp.isPresent()) {
-                        return result;
+                        return new ArrayList<>(result);
                     }
 
                     Long postId;
@@ -362,7 +362,7 @@ public class WorkFlowUtil {
 
                     Optional<Post> thisApproveOp = posts.stream().filter(x -> x.getId().equals(postId)).findFirst();
                     if (!thisApproveOp.isPresent()) {
-                        return result;
+                        return new ArrayList<>(result);
                     }
 
                     Post thisUserPost = thisApproveOp.get();
@@ -374,7 +374,7 @@ public class WorkFlowUtil {
 
                         //如果当前循环次数 找不到上级
                         if (!parentPostOp.isPresent()) {
-                            return result;
+                            return new ArrayList<>(result);
                         } else {
                             thisUserPost = parentPostOp.get();
                         }
@@ -405,7 +405,7 @@ public class WorkFlowUtil {
 //                            }
 //                        }
 //                    }
-                    return result;
+                    return new ArrayList<>(result);
 
                 } else {
                     //将map 转为 java类  默认只有用户任务节点才有审批人
@@ -496,7 +496,7 @@ public class WorkFlowUtil {
 
             }
         }
-        return result;
+        return new ArrayList<>(result);
     }
 
 

+ 1 - 1
src/main/resources/mapper/banding/BandingTaskClassMapper.xml

@@ -75,7 +75,7 @@
     </select>
 
     <select id="getClassStudent" parameterType="com.xjrsoft.module.banding.dto.BandingTaskClassStudentPageDto" resultType="com.xjrsoft.module.banding.vo.BandingTaskClassStudentListVo">
-        SELECT t1.id,t1.credential_number,t1.name,t4.name AS gender_cn,t1.graduate_school,t1.graduate_class,
+        SELECT t1.id,t1.credential_number,t1.name,t4.name AS gender_cn,t1.graduate_school,t1.graduate_class,t1.remarks,
         t5.name AS first_ambition, t6.name AS second_ambition,t7.name AS stduy_status_cn,t1.height,t1.weight,t1.score,t3.name AS class_name,
         t8.name AS teacher_name FROM base_new_student t1
         LEFT JOIN banding_task_class_student t2 ON t1.id = t2.new_student_id AND t2.delete_mark = 0

+ 1 - 1
src/main/resources/mapper/oa/NewsMapper.xml

@@ -34,7 +34,7 @@
         select t.*,t2.name as create_user_name from xjr_oa_news t
         left join xjr_user t2 on t.create_user_id = t2.id
         left join xjr_oa_news_relation t3 on t.id = t3.news_id
-        where t.delete_mark = 0
+        where t.delete_mark = 0 and t.enabled_mark = 1
         and (t.send_end_date > now() or t.send_end_date is null)
         and t.status = 2 and t3.user_id = #{dto.loginId}
         <if test="dto.type != null and dto.type == 1">

+ 3 - 1
src/main/resources/mapper/student/BaseStudentSchoolRollMapper.xml

@@ -31,7 +31,8 @@
             t8.name AS stduy_status,
             t13.name AS roll_modality,
             t11.name AS student_form,
-            CONCAT(t16.name, ' ', t15.room_name, ' ', t14.bed_number) AS bed_info
+            t2.credential_number,
+        CONCAT(t16.name, ' ', t15.room_name, ' ', t14.bed_number) AS bed_info
         FROM base_student t1
         INNER JOIN xjr_user t2 ON t1.user_id = t2.id
         INNER JOIN base_student_school_roll t3 ON t1.user_id = t3.user_id
@@ -76,6 +77,7 @@
         SELECT t2.id,
                t2.name AS student_name,
                t2.mobile AS phone,
+               t2.credential_number,
                t2.gender,
                t11.name AS genderCn,
                t1.student_id,

+ 16 - 2
src/main/resources/mapper/student/StudentReportRecordMapper.xml

@@ -243,8 +243,12 @@
         LEFT JOIN xjr_dictionary_detail t14 ON t5.class_type = t14.code and t14.delete_mark = 0
         LEFT JOIN xjr_department t15 ON t15.id = t13.department_id
         WHERE t1.delete_mark = 0 AND t1.enabled_mark = 1
-        and t12.status = 1
+        and t12.status in(1,2)
         and t3.enrollment_plan_id = #{dto.enrollmentPlanId}
+        and t12.category = #{dto.reportCategory}
+        <if test="dto.studentReportPlanId != null">
+            and t1.student_report_plan_id = #{dto.studentReportPlanId}
+        </if>
         <if test="dto.keyword != null and dto.keyword != ''">
             and t1.name like concat('%', #{dto.keyword},'%')
         </if>
@@ -274,6 +278,9 @@
         <if test="dto.archivesStatus != null and dto.archivesStatus != ''">
             and t3.archives_status = #{dto.archivesStatus}
         </if>
+        <if test="dto.gender != null and dto.gender != ''">
+            and t3.gender = #{dto.gender}
+        </if>
         <if test="dto.stduyStatus != null and dto.stduyStatus != ''">
             and t3.stduy_status = #{dto.stduyStatus}
         </if>
@@ -315,8 +322,12 @@
         LEFT JOIN xjr_dictionary_detail t14 ON t5.class_type = t14.code and t14.delete_mark = 0
         LEFT JOIN xjr_department t15 ON t15.id = t13.department_id
         WHERE t1.delete_mark = 0 AND t1.enabled_mark = 1
-        and t12.status = 1
+        and t12.status in(1,2)
         and t3.enrollment_plan_id = #{dto.enrollmentPlanId}
+        and t12.category = #{dto.reportCategory}
+        <if test="dto.studentReportPlanId != null">
+            and t1.student_report_plan_id = #{dto.studentReportPlanId}
+        </if>
         <if test="dto.keyword != null and dto.keyword != ''">
             and t1.name like concat('%', #{dto.keyword},'%')
         </if>
@@ -340,6 +351,9 @@
         <if test="dto.className != null and dto.className != ''">
             and t5.name like concat('%', #{dto.className}, '%')
         </if>
+        <if test="dto.gender != null and dto.gender != ''">
+            and t3.gender = #{dto.gender}
+        </if>
         <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
             and t3.credential_number like concat('%', #{dto.credentialNumber}, '%')
         </if>

+ 9 - 0
src/main/resources/mapper/workflow/WorkflowExtraMapper.xml

@@ -35,6 +35,15 @@
             or t.start_user_name like concat('%',#{dto.keyword}, '%')
             )
         </if>
+        <if test="dto.name != null and dto.name != ''">
+            and (t.task_name like concat('%',#{dto.name}, '%')
+            or t.process_name like concat('%',#{dto.name}, '%')
+            or t.schema_name like concat('%',#{dto.name}, '%')
+            )
+        </if>
+        <if test="dto.startTime != null and dto.endTime != null">
+            and date_format(t.start_time, '%Y-%m-%d') between #{dto.startTime} and #{dto.endTime}
+        </if>
     order by t.start_time DESC
     </select>
 

+ 113 - 0
src/test/java/com/xjrsoft/module/job/EnrollmentStatisticsInfoTaskTest.java

@@ -0,0 +1,113 @@
+package com.xjrsoft.module.job;
+
+import com.xjrsoft.XjrSoftApplication;
+import com.xjrsoft.common.enums.DeleteMark;
+import com.xjrsoft.common.enums.EnabledMark;
+import com.xjrsoft.module.student.dto.EnrollmentStatisticsCalendarInfoDto;
+import com.xjrsoft.module.student.dto.EnrollmentStatisticsGraduationInfoDto;
+import com.xjrsoft.module.student.dto.EnrollmentStatisticsInfoDto;
+import com.xjrsoft.module.student.entity.EnrollmentStatisticsInfo;
+import com.xjrsoft.module.student.mapper.EnrollmentStatisticsInfoMapper;
+import com.xjrsoft.module.student.service.IPbCseFeeobjupdateService;
+import com.xjrsoft.module.student.vo.EnrollmentStatisticsCalendarInfoVo;
+import com.xjrsoft.module.student.vo.EnrollmentStatisticsGraduationInfoVo;
+import com.xjrsoft.module.student.vo.EnrollmentStatisticsInfoVo;
+import com.yomahub.liteflow.util.JsonUtil;
+import org.junit.jupiter.api.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.time.DayOfWeek;
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
+import java.time.temporal.TemporalAdjusters;
+import java.util.Date;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+/**
+ * @author dzx
+ * @date 2025/3/17
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = XjrSoftApplication.class)
+class EnrollmentStatisticsInfoTaskTest {
+    @Autowired
+    private IPbCseFeeobjupdateService pbCseFeeobjupdateService;
+
+    @Autowired
+    private EnrollmentStatisticsInfoMapper enrollmentStatisticsInfoMapper;
+
+    @Test
+    public void execute() {
+        doExecute();
+    }
+
+    void doExecute() {
+        LocalDate now = LocalDate.now();
+        String dataDate = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+        EnrollmentStatisticsInfoDto dto = new EnrollmentStatisticsInfoDto();
+//        dto.setDay(now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
+        dto.setYear(now.getYear() + "");
+        EnrollmentStatisticsInfoVo info = pbCseFeeobjupdateService.getEnrollmentStatisticsInfo(dto);
+        if(info != null){
+//            enrollmentStatisticsInfoMapper.deleteDataByDate(dataDate);
+            EnrollmentStatisticsInfo infoData = new EnrollmentStatisticsInfo();
+            infoData.setEnabledMark(EnabledMark.ENABLED.getCode());
+            infoData.setDeleteMark(DeleteMark.NODELETE.getCode());
+            infoData.setCreateDate(new Date());
+            infoData.setCreateUserId(1000000000000000000L);
+            infoData.setDataJson(JsonUtil.toJsonString(info));
+            infoData.setDataType(1);
+            infoData.setDataDay(now);
+            enrollmentStatisticsInfoMapper.insert(infoData);
+        }
+
+        EnrollmentStatisticsGraduationInfoDto graduationInfoDto = new EnrollmentStatisticsGraduationInfoDto();
+        graduationInfoDto.setDay(dataDate);
+        EnrollmentStatisticsGraduationInfoVo graduationInfo = pbCseFeeobjupdateService.getEnrollmentStatisticsGraduationInfo(graduationInfoDto);
+
+        if(graduationInfo != null){
+//            enrollmentStatisticsInfoMapper.deleteGraduationDataByDate(dataDate);
+
+            EnrollmentStatisticsInfo infoData = new EnrollmentStatisticsInfo();
+            infoData.setEnabledMark(EnabledMark.ENABLED.getCode());
+            infoData.setDeleteMark(DeleteMark.NODELETE.getCode());
+            infoData.setCreateDate(new Date());
+            infoData.setCreateUserId(1000000000000000000L);
+            infoData.setDataJson(JsonUtil.toJsonString(graduationInfo));
+            infoData.setDataType(2);
+            infoData.setDataDay(now);
+            enrollmentStatisticsInfoMapper.insert(infoData);
+        }
+
+        LocalDate thisSaturday = now.with(TemporalAdjusters.nextOrSame(DayOfWeek.SATURDAY));
+        LocalDate thisMonday = now.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY));
+        LocalDate lastSunday = thisMonday.minusDays(1);
+
+        String thisSaturdayStr = thisSaturday.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+        String lastSundayStr = lastSunday.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+
+        EnrollmentStatisticsCalendarInfoDto calendarInfoDto = new EnrollmentStatisticsCalendarInfoDto();
+        calendarInfoDto.setStartDay(lastSundayStr);
+        calendarInfoDto.setEndDay(thisSaturdayStr);
+        EnrollmentStatisticsCalendarInfoVo calendarInfoVo = pbCseFeeobjupdateService.getEnrollmentStatisticsCalendarInfo(calendarInfoDto);
+
+        if(calendarInfoVo != null){
+//            enrollmentStatisticsInfoMapper.deleteCalendarDataByDate(lastSundayStr, thisSaturdayStr);
+
+            EnrollmentStatisticsInfo infoData = new EnrollmentStatisticsInfo();
+            infoData.setEnabledMark(EnabledMark.ENABLED.getCode());
+            infoData.setDeleteMark(DeleteMark.NODELETE.getCode());
+            infoData.setCreateDate(new Date());
+            infoData.setCreateUserId(1000000000000000000L);
+            infoData.setDataJson(JsonUtil.toJsonString(calendarInfoVo));
+            infoData.setDataType(3);
+            infoData.setDataStartDay(lastSunday);
+            infoData.setDataEndDay(thisSaturday);
+            enrollmentStatisticsInfoMapper.insert(infoData);
+        }
+    }
+}

+ 1 - 1
src/test/java/com/xjrsoft/module/job/JianyuekbBaseDataTaskTest.java

@@ -388,7 +388,7 @@ class JianyuekbBaseDataTaskTest {
             if(baseClass.getClassroomId() != null){
                 paramJson.addProperty("classRoomSerialNo", classroomMap.get(baseClass.getClassroomId().toString()));
             }
-            paramJson.addProperty("serialNo", classMap3.get(baseClass.getId().toString()));
+            paramJson.addProperty("serialNo", jianyueId);
             paramJson.addProperty("teacherSerialNo", teacherMap.get(baseClass.getTeacherId().toString()));
 
             timestamp = System.currentTimeMillis();

+ 65 - 0
src/test/java/com/xjrsoft/module/job/WfCourseAdjustTaskTest.java

@@ -0,0 +1,65 @@
+package com.xjrsoft.module.job;
+
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.xjrsoft.XjrSoftApplication;
+import com.xjrsoft.common.enums.DeleteMark;
+import com.xjrsoft.common.enums.EnabledMark;
+import com.xjrsoft.common.mybatis.SqlRunnerAdapter;
+import com.xjrsoft.common.utils.VoToColumnUtil;
+import com.xjrsoft.module.courseTable.service.ICourseTableService;
+import com.xjrsoft.module.schedule.entity.WfCourseAdjust;
+import com.xjrsoft.module.schedule.service.IWfCourseAdjustService;
+import com.xjrsoft.module.workflow.entity.WorkflowFormRelation;
+import org.camunda.bpm.engine.history.HistoricProcessInstance;
+import org.junit.jupiter.api.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.List;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+/**
+ * @author dzx
+ * @date 2025/3/17
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = XjrSoftApplication.class)
+class WfCourseAdjustTaskTest {
+    @Autowired
+    private IWfCourseAdjustService wfCourseAdjustService;
+
+    @Autowired
+    private ICourseTableService courseTableService;
+
+
+    @Test
+    public void execute() {
+        List<WfCourseAdjust> list = wfCourseAdjustService.list(
+                new MPJLambdaWrapper<WfCourseAdjust>()
+                        .select(WfCourseAdjust::getId)
+                        .select(WfCourseAdjust.class, x -> VoToColumnUtil.fieldsToColumns(WfCourseAdjust.class).contains(x.getProperty()))
+                        .innerJoin(WorkflowFormRelation.class, WorkflowFormRelation::getFormKeyValue, WfCourseAdjust::getId)
+                        .eq(WorkflowFormRelation::getCurrentState, HistoricProcessInstance.STATE_COMPLETED)
+                        .eq(WfCourseAdjust::getDeleteMark, DeleteMark.NODELETE.getCode())
+                        .eq(WfCourseAdjust::getEnabledMark, EnabledMark.ENABLED.getCode())
+        );
+
+        for (WfCourseAdjust wfCourseAdjust : list) {
+            String sql = "SELECT * FROM course_table t1" +
+                    " INNER JOIN course_table_bak t2 ON t1.id = t2.id" +
+                    " WHERE t2.wf_course_adjust_id = " + wfCourseAdjust.getId() +
+                    " AND t1.course_id = t2.course_id" +
+                    " AND t1.course_name = t2.course_name" +
+                    " AND t1.site_id = t2.site_id" +
+                    " AND t1.teacher_name = t2.teacher_name";
+            if(SqlRunnerAdapter.db().selectList(sql).isEmpty()){
+                continue;
+            }
+            courseTableService.adjustCourse(wfCourseAdjust);
+        }
+    }
+}

+ 125 - 0
src/test/java/com/xjrsoft/module/liteflow/node/StudentTransferNodeTest.java

@@ -0,0 +1,125 @@
+package com.xjrsoft.module.liteflow.node;
+
+import cn.dev33.satoken.secure.BCrypt;
+import cn.hutool.core.convert.Convert;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.xjrsoft.XjrSoftApplication;
+import com.xjrsoft.common.enums.ArchivesStatusEnum;
+import com.xjrsoft.common.enums.DeleteMark;
+import com.xjrsoft.common.enums.EnabledMark;
+import com.xjrsoft.common.utils.LocalDateUtil;
+import com.xjrsoft.config.CommonPropertiesConfig;
+import com.xjrsoft.module.base.entity.BaseClass;
+import com.xjrsoft.module.base.mapper.BaseClassMapper;
+import com.xjrsoft.module.organization.dto.GetUserByParamDto;
+import com.xjrsoft.module.organization.entity.User;
+import com.xjrsoft.module.organization.service.IUserService;
+import com.xjrsoft.module.student.entity.BaseClassMajorSet;
+import com.xjrsoft.module.student.entity.BaseNewStudent;
+import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
+import com.xjrsoft.module.student.entity.StudentTransfer;
+import com.xjrsoft.module.student.mapper.BaseClassMajorSetMapper;
+import com.xjrsoft.module.student.mapper.StudentTransferMapper;
+import com.xjrsoft.module.student.service.IBaseNewStudentService;
+import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
+import org.junit.jupiter.api.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.util.Map;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+/**
+ * @author dzx
+ * @date 2025/3/21
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = XjrSoftApplication.class)
+class StudentTransferNodeTest {
+    @Autowired
+    private StudentTransferMapper studentTransferMapper;
+    @Autowired
+    private IBaseStudentSchoolRollService studentSchoolRollService;
+
+    @Autowired
+    private BaseClassMapper baseClassMapper;
+
+    @Autowired
+    private BaseClassMajorSetMapper baseClassMajorSetMapper;
+
+    @Autowired
+    private IBaseNewStudentService newStudentService;
+
+    @Autowired
+    private IUserService userService;
+
+    @Autowired
+    private CommonPropertiesConfig propertiesConfig;
+
+    @Test
+    public void process() throws Exception {
+        // 获取表单中数据编号
+        Long formId = 1902955784296742912L;
+        if (formId != null) {
+            //查询出数据
+            StudentTransfer studentTransfer = studentTransferMapper.selectById(formId);
+
+            BaseNewStudent newStudent = newStudentService.getById(studentTransfer.getStudentUserId());
+            User user = userService.getUserByParam(
+                    new GetUserByParamDto() {{
+                        setCredentialNumber(newStudent.getCredentialNumber());
+                    }}
+            );
+            LocalDate birthDate = LocalDateUtil.getBirthDate(newStudent.getCredentialNumber());
+            BaseClass baseClass = baseClassMapper.selectById(studentTransfer.getClassId());
+            if(user == null){
+                User xjrUser = new User() {{
+                    setCreateDate(LocalDateTime.now());
+                    setPassword(BCrypt.hashpw(propertiesConfig.getDefaultPassword(), BCrypt.gensalt()));
+                    setName(newStudent.getName());
+                    setUserName(newStudent.getCredentialNumber());
+                    setCredentialNumber(newStudent.getCredentialNumber());
+                    setCredentialType("ZZLS10007");
+                    setMobile(newStudent.getMobile());
+                    setEnabledMark(EnabledMark.ENABLED.getCode());
+                    setGender(newStudent.getGender());
+                    setIsChangePassword(1);
+                    setBirthDate(birthDate.atStartOfDay());
+                }};
+                userService.save(xjrUser);
+
+                BaseClassMajorSet majorSet = baseClassMajorSetMapper.selectOne(
+                        new QueryWrapper<BaseClassMajorSet>().lambda()
+                                .eq(BaseClassMajorSet::getClassId, studentTransfer.getClassId())
+                                .eq(BaseClassMajorSet::getDeleteMark, DeleteMark.NODELETE.getCode())
+                );
+                BaseStudentSchoolRoll roll = new BaseStudentSchoolRoll();
+                roll.setStduyStatus(studentTransfer.getStudyStatus());
+                roll.setClassId(studentTransfer.getClassId());
+                roll.setEnrollType(baseClass.getEnrollType());
+                roll.setCreateDate(LocalDateTime.now());
+                roll.setGradeId(baseClass.getGradeId());
+                roll.setMajorSetId(majorSet.getMajorSetId());
+                roll.setCreateUserId(studentTransfer.getCreateUserId());
+                roll.setArchivesStatus(ArchivesStatusEnum.FB2901.getCode());
+                roll.setUserId(xjrUser.getId());
+                roll.setDeleteMark(DeleteMark.NODELETE.getCode());
+                roll.setEnabledMark(EnabledMark.ENABLED.getCode());
+                //新增学籍信息
+                studentSchoolRollService.save(roll);
+            }else{
+                studentSchoolRollService.updateStudentClass(studentTransfer.getClassId(), user.getId());
+            }
+
+            newStudent.setRemarks("通过插班进入" + baseClass.getName());
+            newStudent.setStatus(1);
+            newStudent.setOperateMode(2);
+            newStudentService.updateById(newStudent);
+        }
+    }
+}