ソースを参照

班级考核汇总增加学生作废功能

dzx 11 ヶ月 前
コミット
7314376c61

+ 12 - 0
src/main/java/com/xjrsoft/module/student/controller/BaseStudentAssessmentInspectionController.java

@@ -13,9 +13,11 @@ import com.xjrsoft.module.student.dto.AddBaseStudentAssessmentInspectionDto;
 import com.xjrsoft.module.student.dto.BaseStudentAssessmentInspectionMobilePageDto;
 import com.xjrsoft.module.student.dto.BaseStudentAssessmentInspectionPageDto;
 import com.xjrsoft.module.student.dto.CalssQuantitativeAssessmentPageDto;
+import com.xjrsoft.module.student.dto.CancelStudentDto;
 import com.xjrsoft.module.student.dto.UpdateBaseStudentAssessmentInspectionDto;
 import com.xjrsoft.module.student.entity.BaseStudentAssessmentInspection;
 import com.xjrsoft.module.student.service.IBaseStudentAssessmentInspectionService;
+import com.xjrsoft.module.student.service.IBaseStudentAssessmentStudentRelationService;
 import com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionMobilePageVo;
 import com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionMobileVo;
 import com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionPageVo;
@@ -53,6 +55,8 @@ public class BaseStudentAssessmentInspectionController {
 
     private final IBaseStudentAssessmentInspectionService inspectionService;
 
+    private final IBaseStudentAssessmentStudentRelationService studentRelationService;
+
     @GetMapping(value = "/page")
     @ApiOperation(value = "学生班级巡查考核列表(分页)")
     @SaCheckPermission("basestudentassessmentinspection:detail")
@@ -140,4 +144,12 @@ public class BaseStudentAssessmentInspectionController {
         String fileName = "recordExport" + ExcelTypeEnum.XLSX.getValue();
         return RT.fileStream(bytes, fileName);
     }
+
+
+    @PostMapping("/cancel-student")
+    @ApiOperation(value = "作废学生")
+    public RT<Boolean>  cancelStudent(@RequestBody CancelStudentDto dto){
+        boolean remove = studentRelationService.removeById(dto.getId());
+        return RT.ok(remove);
+    }
 }

+ 21 - 0
src/main/java/com/xjrsoft/module/student/dto/CancelStudentDto.java

@@ -0,0 +1,21 @@
+package com.xjrsoft.module.student.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+* @title: 班级考核删除学生
+* @Author dzx
+* @Date: 2024年12月26日
+* @Version 1.0
+*/
+@Data
+public class CancelStudentDto implements Serializable {
+
+    @ApiModelProperty("主键")
+    private Long id;
+
+}

+ 14 - 0
src/main/java/com/xjrsoft/module/student/entity/BaseStudentAssessmentStudentRelation.java

@@ -1,6 +1,9 @@
 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;
@@ -82,4 +85,15 @@ public class BaseStudentAssessmentStudentRelation implements Serializable {
 
     @ApiModelProperty("被扣分数")
     private Double score;
+
+    @ApiModelProperty("删除标记")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleteMark;
+    /**
+     * 有效标志
+     */
+    @ApiModelProperty("有效标志")
+    @TableField(fill = FieldFill.INSERT)
+    private Integer enabledMark;
 }

+ 12 - 11
src/main/resources/mapper/student/BaseStudentAssessmentInspectionMapper.xml

@@ -59,15 +59,15 @@
         left join xjr_user t5 on t.assessment_user_id=t5.id
         left join xjr_dictionary_detail t6 on t6.code=t.score_type
         left join xjr_user t7 on t.create_user_id=t7.id
-        where t.id=#{id} and t.delete_mark=0 and t1.delete_mark=0  and t2.delete_mark=0;
+        where t.id = #{id} and t.delete_mark = 0 and t1.delete_mark = 0 and t2.delete_mark = 0
     </select>
 
     <select id="getMobilePage" parameterType="com.xjrsoft.module.student.dto.BaseStudentAssessmentInspectionMobilePageDto" resultType="com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionMobilePageVo">
         select t.id,t1.assessment_date,t2.name as assessment_category_name,t3.name as assessment_project_name,t5.name as
         assessment_class_name,t1.reason,t1.score,t1.score_type,t4.name as score_type_cn,
         (
-            SELECT count(*) FROM base_student_assessment_student_relation WHERE base_student_assessment_inspection_id =
-            t1.id and class_id=t.class_id
+            SELECT count(*) FROM base_student_assessment_student_relation WHERE
+            base_student_assessment_inspection_id = t1.id and class_id = t.class_id and delete_mark = 0
         ) as student_count,t1.assessment_type
         from base_student_assessment_class_relation t
         left join base_student_assessment_inspection t1 on t1.id=t.base_student_assessment_inspection_id
@@ -104,7 +104,7 @@
         left join base_class t5 on t5.id=t.class_id
         left join xjr_user t6 on t1.assessment_user_id=t6.id
         left join xjr_user t7 on t1.create_user_id=t7.id
-        where t.id=#{id};
+        where t.id = #{id};
     </select>
 
     <select id="getStudentIndividualBehaviorExcelVoList" parameterType="com.xjrsoft.module.student.dto.QuantitativeAssessmentExcelDto" resultType="com.xjrsoft.module.student.vo.QuantitativeAssessmentSubTableExcelVo">
@@ -114,7 +114,7 @@
         sum(if(t1.score_type = 'score_add', t1.score, -1 * t1.score)) as finalScore
         from base_student_assessment_student_relation t
         left join base_student_assessment_inspection t1 on t1.id = t.base_student_assessment_inspection_id
-        where t1.delete_mark = 0
+        where t1.delete_mark = 0 and t.delete_mark = 0
         <if test="dto.yearAndMonth != null and dto.yearAndMonth != ''">
             and date_format(t1.assessment_date, '%Y-%m') = #{dto.yearAndMonth}
         </if>
@@ -142,7 +142,7 @@
         left join xjr_user t4 on t4.id = t3.teacher_id
         left join base_student_assessment_base_score t5 on t5.base_semester_id = t1.base_semester_id
         left join total_score t6 on t6.studentUserId = t.user_id
-        where t1.delete_mark = 0
+        where t1.delete_mark = 0 and t.delete_mark = 0
         <if test="dto.yearAndMonth != null and dto.yearAndMonth != ''">
             and date_format(t1.assessment_date, '%Y-%m') = #{dto.yearAndMonth}
         </if>
@@ -155,7 +155,7 @@
         from base_student_assessment_student_relation t
         left join base_student_assessment_inspection t1
         on t1.id = t.base_student_assessment_inspection_id
-        where t1.delete_mark = 0
+        where t1.delete_mark = 0 and t.delete_mark = 0
         and t1.base_student_assessment_category_id = #{dto.baseStudentAssessmentCategoryId}
         <if test="dto.classIdList != null and !dto.classIdList.isEmpty()">
             and t1.class_ids in
@@ -197,7 +197,7 @@
         left join xjr_user t4 on t4.id = t3.teacher_id
         left join base_student_assessment_base_score t5 on t5.base_semester_id = t1.base_semester_id
         left join total_score t6 on t6.studentUserId = t.user_id
-        where t1.delete_mark = 0
+        where t1.delete_mark = 0 and t.delete_mark = 0
         and t1.base_student_assessment_category_id = #{dto.baseStudentAssessmentCategoryId}
         <if test="dto.classIdList != null and !dto.classIdList.isEmpty()">
             and t1.class_ids in
@@ -257,7 +257,7 @@
         from base_student_assessment_class_relation t
                  left join base_student_assessment_inspection t1 on t1.id = t.base_student_assessment_inspection_id
                  left join base_student_assessment_category t2 on t2.id = t1.base_student_assessment_category_id
-        where t1.base_student_assessment_category_id = 1754411705233838080
+        where t2.code = 'convention_manage'
           and t.class_id in
         <foreach item="classId" index="index" collection="dto.classIdList" open="(" close=")" separator=",">
             #{classId}
@@ -278,7 +278,7 @@
         from base_student_assessment_student_relation t
                 left join base_student_assessment_inspection t1 on t1.id = t.base_student_assessment_inspection_id
                 left join base_student_assessment_category t2 on t2.id = t1.base_student_assessment_category_id
-        where t1.base_student_assessment_category_id = 1754412347985760256
+        where t2.code = 'awards_and_honors' and t.delete_mark = 0
         and t.class_id in
         <foreach item="classId" index="index" collection="dto.classIdList" open="(" close=")" separator=",">
             #{classId}
@@ -299,7 +299,7 @@
         from base_student_assessment_student_relation t
         left join base_student_assessment_inspection t1 on t1.id = t.base_student_assessment_inspection_id
         left join base_student_assessment_category t2 on t2.id = t1.base_student_assessment_category_id
-        where t1.base_student_assessment_category_id = 1754412347985760256
+        where t2.code = 'militarize_manage' and t.delete_mark = 0
         and t.class_id in
         <foreach item="classId" index="index" collection="dto.classIdList" open="(" close=")" separator=",">
             #{classId}
@@ -324,5 +324,6 @@
         LEFT JOIN xjr_dictionary_detail t6 ON t3.nation = t6.code
         LEFT JOIN xjr_dictionary_detail t7 ON t2.gender = t7.code
         WHERE t1.base_student_assessment_inspection_id = #{id}
+        and t1.delete_mark = 0
     </select>
 </mapper>