Browse Source

1、新生数据同步,根据缴费状态来设置是否可以分班
2、分班功能增加新规则并调整自动分班逻辑

dzx 6 months ago
parent
commit
3fd0e39fde

+ 27 - 5
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskServiceImpl.java

@@ -281,7 +281,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
 
         Map<Long, List<BaseNewStudent>> classStudentMap = new HashMap<>();
         if(ruleCodes.contains("BR0002")){
-            classStudentMap.putAll(divideStudentByScore(classConditionMap, baseNewStudents, classList));
+            classStudentMap.putAll(divideStudentByScore(classConditionMap, baseNewStudents, classList, ruleCodes));
         }
 
         //存班级和学生的关系
@@ -344,7 +344,14 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
                     continue;
                 }
                 //专业不匹配,直接跳过
-                if(!Objects.equals(taskClass.getMajorSetId(), newStudent.getFirstAmbitionId()) && !Objects.equals(taskClass.getMajorSetId(), newStudent.getSecondAmbitionId())){
+                if(
+                        !Objects.equals(taskClass.getMajorSetId(), newStudent.getFirstAmbitionId()) &&
+                        (
+                                !ruleCodes.contains("BR0006") &&
+                                !Objects.equals(taskClass.getMajorSetId(), newStudent.getSecondAmbitionId())
+                        )
+                )
+                {
                     continue;
                 }
                 //判断该班性别是否已满,如果设置了排序,即使性别满了班级人数没满继续分班
@@ -419,7 +426,14 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
                     continue;
                 }
                 //专业不匹配,直接跳过
-                if(!Objects.equals(taskClass.getMajorSetId(), newStudent.getFirstAmbitionId()) && !Objects.equals(taskClass.getMajorSetId(), newStudent.getSecondAmbitionId())){
+                //专业不匹配,直接跳过
+                if(
+                        !Objects.equals(taskClass.getMajorSetId(), newStudent.getFirstAmbitionId()) &&
+                                (
+                                        !ruleCodes.contains("BR0006") &&
+                                                !Objects.equals(taskClass.getMajorSetId(), newStudent.getSecondAmbitionId())
+                                )
+                ){
                     continue;
                 }
                 //判断该班性别是否已满
@@ -477,7 +491,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
      * @return 班级id和学生
      */
     Map<Long, List<BaseNewStudent>> divideStudentByScore(Map<Long, BandingTaskMajorCondition> classConditionMap, List<BaseNewStudent> baseNewStudents,
-                                                         List<BandingTaskClass> classList){
+                                                         List<BandingTaskClass> classList, List<String> ruleCodes){
         Map<Long, List<BaseNewStudent>> classStudentMap = new HashMap<>();
         for (Long majorSetId : classConditionMap.keySet()) {
             //查询该专业下面有几个班级,把这部分学生按照成绩均匀分组
@@ -493,7 +507,15 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
             List<BaseNewStudent> stuList = new ArrayList<>();
 
             for (BaseNewStudent newStudent : baseNewStudents) {
-                if(!Objects.equals(majorSetId, newStudent.getFirstAmbitionId()) && !Objects.equals(majorSetId, newStudent.getSecondAmbitionId())){
+                //专业不匹配,直接跳过
+                if(
+                        !Objects.equals(majorSetId, newStudent.getFirstAmbitionId()) &&
+                                (
+                                        !ruleCodes.contains("BR0006") &&
+                                                !Objects.equals(majorSetId, newStudent.getSecondAmbitionId())
+                                )
+                )
+                {
                     continue;
                 }
 

+ 10 - 1
src/main/java/com/xjrsoft/module/job/BaseNewStudentTask.java

@@ -128,6 +128,11 @@ public class BaseNewStudentTask {
             if (existsNewStudent != null) {
                 existsNewStudent.setName(feeobjupdate.getFeeobjname());
                 existsNewStudent.setPaymnystate(feeobjupdate.getPaymnystate());
+                if("未交费".equals(feeobjupdate.getPaymnystate())){
+                    existsNewStudent.setIsCanBanding(0);
+                }else{
+                    existsNewStudent.setIsCanBanding(1);
+                }
                 existsNewStudent.setPrevious(feeobjupdate.getPrevious());
                 existsNewStudent.setProvince(feeobjupdate.getProvince());
                 existsNewStudent.setCity(feeobjupdate.getCity());
@@ -199,7 +204,11 @@ public class BaseNewStudentTask {
                         setEnrollmentPlanId(planId);
                         setCreateDate(new Date());
                         setStatus(0);
-                        setIsCanBanding(1);
+                        if("未交费".equals(feeobjupdate.getPaymnystate())){
+                            setIsCanBanding(0);
+                        }else{
+                            setIsCanBanding(1);
+                        }
                     }}
             );
             insCredentialNumber.add(feeobjupdate.getPersonalid());