dzx преди 1 година
родител
ревизия
2600631c08

+ 37 - 0
src/main/java/com/xjrsoft/module/student/controller/BaseNewStudentController.java

@@ -13,7 +13,10 @@ import com.xjrsoft.module.student.dto.UpdateBaseNewStudentDto;
 import com.xjrsoft.module.student.entity.BaseNewStudent;
 import com.xjrsoft.module.student.service.IBaseNewStudentService;
 import com.xjrsoft.module.student.vo.BaseNewStudentPageVo;
+import com.xjrsoft.module.student.vo.BaseNewStudentTreeVo;
 import com.xjrsoft.module.student.vo.BaseNewStudentVo;
+import com.xjrsoft.module.student.vo.EnrollmentPlanGradeVo;
+import com.xjrsoft.module.student.vo.EnrollmentPlanTreeVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
@@ -29,6 +32,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.validation.Valid;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -56,6 +60,39 @@ public class BaseNewStudentController {
         return RT.ok(pageOutput);
     }
 
+    @GetMapping(value = "/tree")
+    @ApiOperation(value="新生维护信息树")
+    @SaCheckPermission("basenewstudent:detail")
+    public RT<List<BaseNewStudentTreeVo>> tree(){
+
+        List<EnrollmentPlanGradeVo> gradeList = baseNewStudentService.getGradeList();
+        List<EnrollmentPlanTreeVo> list = baseNewStudentService.getEnrollmentPlanList();
+
+        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);
+                    }});
+                }
+            }
+
+            treeVo.setChildren(children);
+            result.add(treeVo);
+        }
+
+        return RT.ok(result);
+    }
+
     @GetMapping(value = "/info")
     @ApiOperation(value="根据id查询新生维护信息信息")
     @SaCheckPermission("basenewstudent:detail")

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

@@ -97,4 +97,7 @@ public class AddBaseNewStudentDto implements Serializable {
 
     @ApiModelProperty("是否可调配(0:否,1:是)")
     private Integer isAdjust;
+
+    @ApiModelProperty("招生计划id(enrollment_plan)")
+    private Long enrollmentPlanId;
 }

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

@@ -51,4 +51,7 @@ public class BaseNewStudentPageDto extends PageInput {
 
     @ApiModelProperty("班级状态(0:未分配, 1:已分配)")
     private Integer status;
+
+    @ApiModelProperty("招生计划id(enrollment_plan)")
+    private Long enrollmentPlanId;
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/student/entity/BaseNewStudent.java

@@ -148,4 +148,7 @@ public class BaseNewStudent implements Serializable {
 
     @ApiModelProperty("是否可调配(0:否,1:是)")
     private Integer isAdjust;
+
+    @ApiModelProperty("招生计划id(enrollment_plan)")
+    private Long enrollmentPlanId;
 }

+ 8 - 0
src/main/java/com/xjrsoft/module/student/mapper/BaseNewStudentMapper.java

@@ -5,8 +5,12 @@ import com.github.yulichang.base.MPJBaseMapper;
 import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
 import com.xjrsoft.module.student.entity.BaseNewStudent;
 import com.xjrsoft.module.student.vo.BaseNewStudentPageVo;
+import com.xjrsoft.module.student.vo.EnrollmentPlanGradeVo;
+import com.xjrsoft.module.student.vo.EnrollmentPlanTreeVo;
 import org.apache.ibatis.annotations.Mapper;
 
+import java.util.List;
+
 /**
 * @title: 新生维护信息
 * @Author dzx
@@ -17,4 +21,8 @@ import org.apache.ibatis.annotations.Mapper;
 public interface BaseNewStudentMapper extends MPJBaseMapper<BaseNewStudent> {
 
     Page<BaseNewStudentPageVo> getPage(Page<BaseNewStudentPageVo> page, BaseNewStudentPageDto dto);
+
+    List<EnrollmentPlanTreeVo> getEnrollmentPlanList();
+
+    List<EnrollmentPlanGradeVo> getGradeList();
 }

+ 9 - 0
src/main/java/com/xjrsoft/module/student/service/IBaseNewStudentService.java

@@ -5,6 +5,10 @@ import com.github.yulichang.base.MPJBaseService;
 import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
 import com.xjrsoft.module.student.entity.BaseNewStudent;
 import com.xjrsoft.module.student.vo.BaseNewStudentPageVo;
+import com.xjrsoft.module.student.vo.EnrollmentPlanGradeVo;
+import com.xjrsoft.module.student.vo.EnrollmentPlanTreeVo;
+
+import java.util.List;
 
 /**
 * @title: 新生维护信息
@@ -16,4 +20,9 @@ import com.xjrsoft.module.student.vo.BaseNewStudentPageVo;
 public interface IBaseNewStudentService extends MPJBaseService<BaseNewStudent> {
 
     Page<BaseNewStudentPageVo> getPage(Page<BaseNewStudentPageVo> page, BaseNewStudentPageDto dto);
+
+
+    List<EnrollmentPlanTreeVo> getEnrollmentPlanList();
+
+    List<EnrollmentPlanGradeVo> getGradeList();
 }

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

@@ -7,9 +7,13 @@ import com.xjrsoft.module.student.entity.BaseNewStudent;
 import com.xjrsoft.module.student.mapper.BaseNewStudentMapper;
 import com.xjrsoft.module.student.service.IBaseNewStudentService;
 import com.xjrsoft.module.student.vo.BaseNewStudentPageVo;
+import com.xjrsoft.module.student.vo.EnrollmentPlanGradeVo;
+import com.xjrsoft.module.student.vo.EnrollmentPlanTreeVo;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
 * @title: 新生维护信息
 * @Author dzx
@@ -23,4 +27,14 @@ public class BaseNewStudentServiceImpl extends MPJBaseServiceImpl<BaseNewStudent
     public Page<BaseNewStudentPageVo> getPage(Page<BaseNewStudentPageVo> page, BaseNewStudentPageDto dto) {
         return this.baseMapper.getPage(page, dto);
     }
+
+    @Override
+    public List<EnrollmentPlanTreeVo> getEnrollmentPlanList() {
+        return this.baseMapper.getEnrollmentPlanList();
+    }
+
+    @Override
+    public List<EnrollmentPlanGradeVo> getGradeList() {
+        return this.baseMapper.getGradeList();
+    }
 }

+ 32 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseNewStudentTreeVo.java

@@ -0,0 +1,32 @@
+package com.xjrsoft.module.student.vo;
+
+import com.xjrsoft.common.model.tree.ITreeNode;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author dzx
+ * @date 2024年6月27日
+ */
+@Data
+public class BaseNewStudentTreeVo implements ITreeNode<BaseNewStudentTreeVo, Long>, Serializable {
+
+    @ApiModelProperty("id")
+    private Long id;
+
+    @ApiModelProperty("name")
+    private String name;
+
+    @ApiModelProperty("disabled")
+    private Long parentId;
+
+    @ApiModelProperty("children")
+    private List<BaseNewStudentTreeVo> children;
+
+    @ApiModelProperty("类型(1:年级,2:春秋季)")
+    private Integer treeType;
+
+}

+ 15 - 0
src/main/java/com/xjrsoft/module/student/vo/EnrollmentPlanGradeVo.java

@@ -0,0 +1,15 @@
+package com.xjrsoft.module.student.vo;
+
+import lombok.Data;
+
+/**
+ * @author dzx
+ * @date 2024年6月27日
+ */
+@Data
+public class EnrollmentPlanGradeVo {
+    private Long id;
+
+    private String name;
+
+}

+ 27 - 0
src/main/java/com/xjrsoft/module/student/vo/EnrollmentPlanTreeVo.java

@@ -0,0 +1,27 @@
+package com.xjrsoft.module.student.vo;
+
+import com.xjrsoft.common.model.tree.ITreeNode;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author dzx
+ * @date 2024年6月27日
+ */
+@Data
+public class EnrollmentPlanTreeVo{
+    private Long id;
+
+    private String name;
+
+    private String enrollType;
+
+    private String enrollTypeCn;
+
+    private String gradeName;
+
+    private Long gradeId;
+}

+ 13 - 65
src/main/resources/mapper/student/BaseNewStudentMapper.xml

@@ -40,74 +40,22 @@
         <if test="dto.status != null">
             AND t1.status = #{dto.status}
         </if>
+        <if test="dto.enrollmentPlanId != null">
+            AND t1.enrollment_plan_id = #{dto.enrollmentPlanId}
+        </if>
     </select>
-
-    <select id="getInfo" resultType="com.xjrsoft.module.student.vo.BaseStudentBehaviorManageVo">
-        SELECT t.id, t2.score_type, t1.sort_code,
-               t.file_id, t.assessment_address, t3.name AS semester_name,
-               t.assessment_date, t.score, t.score_number, t.total_score, t4.name AS grade_name,
-               t.is_affect, t1.name AS behaviorCategoryName, t2.name AS behaviorProjectName,
-               (
-                   SELECT GROUP_CONCAT(b.name) FROM base_student_behavior_class_relation a
-                   LEFT JOIN base_class b ON a.class_id = b.id
-                   WHERE a.base_student_behavior_manage_id = t.id GROUP BY a.base_student_behavior_manage_id
-               ) AS asbinarysessment_class_names,
-               (
-                   SELECT name FROM xjr_user WHERE id = t.assessment_user_id
-               ) AS assessment_user_name
-        FROM base_student_behavior_manage t
-                 LEFT JOIN base_student_behavior_category t1 ON t1.id = t.base_student_behavior_category_id
-                 LEFT JOIN base_student_behavior_project t2 ON t2.id = t.base_student_behavior_project_id
-                 LEFT JOIN base_semester t3 ON t3.id = t.base_semester_id
-                 LEFT JOIN base_grade t4 ON t.grade_id = t4.id
-        WHERE t.delete_mark = 0 AND t1.delete_mark = 0 AND t2.delete_mark = 0 AND t.status = 1
-          AND t.id = #{id}
+    <select id="getEnrollmentPlanList" resultType="com.xjrsoft.module.student.vo.EnrollmentPlanTreeVo">
+        SELECT t1.enroll_type, t2.name AS enroll_type_cn,t3.name AS grade_name, t3.id as grade_id,t1.id FROM enrollment_plan t1
+        LEFT JOIN xjr_dictionary_detail t2 ON t1.enroll_type = t2.code AND t2.item_id = 2023000000000000027
+        LEFT JOIN base_grade t3 ON t1.grade_id = t3.id
+        WHERE t1.delete_mark = 0
     </select>
 
-    <select id="getMobilePage" parameterType="com.xjrsoft.module.student.dto.BaseStudentBehaviorManageMobilePageDto" resultType="com.xjrsoft.module.student.vo.BaseStudentBehaviorManageMobilePageVo">
-        SELECT t1.sort_code,t1.name,t1.class_name,t.assessment_date,
-        t3.name AS categoryName,t4.name AS projectName,t.score,t4.score_type,
-        t2.name AS assessmentUserName,
-        t.assessment_address,
-        t3.name AS behaviorCategoryName,
-        t4.name AS behaviorProjectName
-        FROM base_student_behavior_manage t
-        INNER JOIN base_student_behavior_student_relation t1 ON t1.base_student_behavior_manage_id = t.id
-        <if test="dto.studentName != null and dto.studentName != ''">
-            and t1.name like concat('%',#{dto.studentName},'%')
-        </if>
-        LEFT JOIN xjr_user t2 ON t2.id = t.assessment_user_id
-        LEFT JOIN base_student_behavior_category t3 ON t3.id = t.base_student_behavior_category_id
-        LEFT JOIN base_student_behavior_project t4 ON t4.id = t.base_student_behavior_project_id
-        LEFT JOIN base_student_school_roll t5 ON t1.user_id = t5.user_id
-        WHERE t.status = 1 AND t.delete_mark = 0 AND t3.delete_mark = 0
-        AND t5.class_id IN (
-        SELECT id FROM base_class WHERE teacher_id = #{dto.teacherId}
-        )
-        <if test="dto.gradeIds != null and dto.gradeIds.size() > 0">
-            AND t5.grade_id in
-            <foreach item="gradeId" index="index" collection="dto.gradeIds" open="(" close=")" separator=",">
-                #{gradeId}
-            </foreach>
-        </if>
-        <if test="dto.classIds != null and dto.classIds.size() > 0">
-            AND t5.class_id in
-            <foreach item="classId" index="index" collection="dto.classIds" open="(" close=")" separator=",">
-                #{classId}
-            </foreach>
-        </if>
-        <if test="dto.assessmentUserIds != null and dto.assessmentUserIds.size() > 0">
-            AND t.assessment_user_id in
-            <foreach item="assessmentUserId" index="index" collection="dto.assessmentUserIds" open="(" close=")" separator=",">
-                #{assessmentUserId}
-            </foreach>
-        </if>
-        <if test="dto.startDate != null and dto.startDate != ''">
-            and t.assessment_date &gt;= #{dto.startDate}
-        </if>
-        <if test="dto.endDate != null and dto.endDate != ''">
-            and t.assessment_date &lt;= #{dto.endDate}
-        </if>
+    <select id="getGradeList" resultType="com.xjrsoft.module.student.vo.EnrollmentPlanGradeVo">
+        SELECT DISTINCT t3.id, t3.name FROM enrollment_plan t1
+        LEFT JOIN xjr_dictionary_detail t2 ON t1.enroll_type = t2.code AND t2.item_id = 2023000000000000027
+        LEFT JOIN base_grade t3 ON t1.grade_id = t3.id
+        WHERE t1.delete_mark = 0
     </select>
 
 </mapper>