Sfoglia il codice sorgente

班级考核功能调整

dzx 11 mesi fa
parent
commit
6133c920cd

+ 8 - 2
src/main/java/com/xjrsoft/module/student/controller/BaseStudentAssessmentInspectionController.java

@@ -6,6 +6,7 @@ import cn.hutool.core.bean.BeanUtil;
 import com.alibaba.excel.support.ExcelTypeEnum;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+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;
@@ -16,6 +17,7 @@ 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.entity.BaseStudentAssessmentStudentRelation;
 import com.xjrsoft.module.student.service.IBaseStudentAssessmentInspectionService;
 import com.xjrsoft.module.student.service.IBaseStudentAssessmentStudentRelationService;
 import com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionMobilePageVo;
@@ -41,6 +43,8 @@ import java.io.IOException;
 import java.util.Date;
 import java.util.List;
 
+import static com.alibaba.fastjson.JSONPatch.OperationType.remove;
+
 /**
  * @title: 学生班级巡查考核
  * @Author dzx
@@ -149,7 +153,9 @@ public class BaseStudentAssessmentInspectionController {
     @PostMapping("/cancel-student")
     @ApiOperation(value = "作废学生")
     public RT<Boolean>  cancelStudent(@RequestBody CancelStudentDto dto){
-        boolean remove = studentRelationService.removeById(dto.getId());
-        return RT.ok(remove);
+        BaseStudentAssessmentStudentRelation relation = studentRelationService.getById(dto.getId());
+        relation.setEnabledMark(EnabledMark.DISABLED.getCode());
+        boolean update = studentRelationService.updateById(relation);
+        return RT.ok(update);
     }
 }

+ 0 - 5
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentAssessmentInspectionServiceImpl.java

@@ -146,11 +146,6 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
     @Override
     public BaseStudentAssessmentInspectionVo getInfo(Long id) {
         BaseStudentAssessmentInspectionVo result = assessmentInspectionMapper.getInfo(id);
-        // 处理加减分
-        if (result.getScoreType() != null && result.getScoreType().equals(ScoreTypeEnum.ScoreMinus.getCode())) {
-            result.setScore(result.getScore() * -1);
-        }
-
         // 获取班级信息
         List<BaseStudentAssessmentClassListVo> baseStudentAssessmentClassListVos = assessmentClassRelationMapper.selectJoinList(BaseStudentAssessmentClassListVo.class,
                 MPJWrappers.<BaseStudentAssessmentClassRelation>lambdaJoin()

+ 9 - 9
src/main/resources/mapper/student/BaseStudentAssessmentInspectionMapper.xml

@@ -67,11 +67,11 @@
         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 AND delete_mark = 0
+        base_student_assessment_inspection_id = t1.id AND class_id = t.class_id AND delete_mark = 0 and enabled_mark = 1
         ) AS student_count,t1.assessment_type,
         (
         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
+        t1.id AND class_id = t.class_id AND delete_mark = 0 and enabled_mark = 1
         ) AS student_count,t1.assessment_type,t6.name AS assessment_item_name
         FROM base_student_assessment_class_relation t
         LEFT JOIN base_student_assessment_inspection t1 ON t1.id=t.base_student_assessment_inspection_id
@@ -120,7 +120,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 and t.delete_mark = 0
+        where t1.delete_mark = 0 and t.delete_mark = 0 and t.enabled_mark = 1
         <if test="dto.yearAndMonth != null and dto.yearAndMonth != ''">
             and date_format(t1.assessment_date, '%Y-%m') = #{dto.yearAndMonth}
         </if>
@@ -148,7 +148,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 and t.delete_mark = 0
+        where t1.delete_mark = 0 and t.delete_mark = 0 and t.enabled_mark = 1
         <if test="dto.yearAndMonth != null and dto.yearAndMonth != ''">
             and date_format(t1.assessment_date, '%Y-%m') = #{dto.yearAndMonth}
         </if>
@@ -161,7 +161,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 and t.delete_mark = 0
+        where t1.delete_mark = 0 and t.delete_mark = 0 and t.enabled_mark = 1
         and t1.base_student_assessment_category_id = #{dto.baseStudentAssessmentCategoryId}
         <if test="dto.classIdList != null and !dto.classIdList.isEmpty()">
             and t1.class_ids in
@@ -203,7 +203,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 and t.delete_mark = 0
+        where t1.delete_mark = 0 and t.delete_mark = 0 and t.enabled_mark = 1
         and t1.base_student_assessment_category_id = #{dto.baseStudentAssessmentCategoryId}
         <if test="dto.classIdList != null and !dto.classIdList.isEmpty()">
             and t1.class_ids in
@@ -285,7 +285,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.enabled_mark = 1
         and t.class_id in
         <foreach item="classId" index="index" collection="dto.classIdList" open="(" close=")" separator=",">
             #{classId}
@@ -306,7 +306,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 t2.code = 'militarize_manage' and t.delete_mark = 0
+        where t2.code = 'militarize_manage' and t.delete_mark = 0 and t.enabled_mark = 1
         and t.class_id in
         <foreach item="classId" index="index" collection="dto.classIdList" open="(" close=")" separator=",">
             #{classId}
@@ -322,7 +322,7 @@
     <select id="getStudentListByInspectionId"
             resultType="com.xjrsoft.module.student.entity.BaseStudentAssessmentStudentRelation">
         SELECT t1.id,t1.user_id,t1.class_id,t3.student_id,t2.name,t6.name AS nation,t4.name AS class_name,
-               t5.name AS major_name,t7.name as gender,t1.score
+               t5.name AS major_name,t7.name as gender,t1.score,t1.enabled_mark
         FROM base_student_assessment_student_relation t1
         INNER JOIN xjr_user t2 ON t1.user_id = t2.id
         INNER JOIN base_student t3 ON t2.id = t3.user_id