瀏覽代碼

班级考核调整

dzx 1 年之前
父節點
當前提交
7447f8936b

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

@@ -92,6 +92,7 @@ public class BaseStudentAssessmentInspectionController {
     public RT<Boolean> add(@Valid @RequestBody AddBaseStudentAssessmentInspectionDto dto) {
         BaseStudentAssessmentInspection inspection = BeanUtil.toBean(dto, BaseStudentAssessmentInspection.class);
         inspection.setCreateDate(new Date());
+        inspection.setPersonalStudentUserIds(dto.getStudentUserIds());
         boolean isSuccess = inspectionService.save(inspection);
         inspectionService.dataHandle(inspection.getId());
         return RT.ok(isSuccess);

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

@@ -103,7 +103,7 @@ public class BaseStudentAssessmentInspection implements Serializable {
      * 学生Ids(多选)
      */
     @ApiModelProperty("学生Ids(多选)")
-    private String studentUserIds;
+    private String personalStudentUserIds;
     /**
     * 考核时间
     */

+ 4 - 0
src/main/java/com/xjrsoft/module/student/mapper/BaseStudentAssessmentInspectionMapper.java

@@ -7,6 +7,7 @@ import com.xjrsoft.module.student.dto.BaseStudentAssessmentInspectionPageDto;
 import com.xjrsoft.module.student.dto.QuantitativeAssessmentExcelDto;
 import com.xjrsoft.module.student.dto.QuantitativeAssessmentSingleScoreDto;
 import com.xjrsoft.module.student.entity.BaseStudentAssessmentInspection;
+import com.xjrsoft.module.student.entity.BaseStudentAssessmentStudentRelation;
 import com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionMobilePageVo;
 import com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionMobileVo;
 import com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionPageVo;
@@ -61,4 +62,7 @@ public interface BaseStudentAssessmentInspectionMapper extends MPJBaseMapper<Bas
 
     List<QuantitativeAssessmentSingleScoreVo> getParamilitaryList(@Param("dto") QuantitativeAssessmentSingleScoreDto dto);
 
+
+    List<BaseStudentAssessmentStudentRelation> getStudentListByInspectionId(Long id);
+
 }

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

@@ -139,11 +139,7 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
         result.setClassList(baseStudentAssessmentClassListVos);
 
         // 获取学生信息
-        List<BaseStudentAssessmentStudentRelation> baseStudentAssessmentStudentRelations = assessmentStudentRelationMapper.selectList(
-                Wrappers.<BaseStudentAssessmentStudentRelation>query().lambda()
-                        .eq(BaseStudentAssessmentStudentRelation::getBaseStudentAssessmentInspectionId, result.getId())
-        );
-        result.setStudentList(baseStudentAssessmentStudentRelations);
+        result.setStudentList(assessmentInspectionMapper.getStudentListByInspectionId(id));
 
         // 获取文件列表
         result.setFileInfos(fileService.list(Wrappers.<File>query().lambda().eq(File::getFolderId, result.getFileId())));
@@ -516,9 +512,9 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
             //同步数据到考核关联学生表
             if(baseStudentAssessmentInspection.getAssessmentType() != null
                     && baseStudentAssessmentInspection.getAssessmentType().equals("personal")
-                    && baseStudentAssessmentInspection.getStudentUserIds() != null
-                    && !baseStudentAssessmentInspection.getStudentUserIds().equals("")){
-                String[] studentIds = baseStudentAssessmentInspection.getStudentUserIds().split(",");
+                    && baseStudentAssessmentInspection.getPersonalStudentUserIds() != null
+                    && !baseStudentAssessmentInspection.getPersonalStudentUserIds().equals("")){
+                String[] studentIds = baseStudentAssessmentInspection.getPersonalStudentUserIds().split(",");
                 for (String studentId: studentIds) {
                     assessmentStudentRelationMapper.insert(new BaseStudentAssessmentStudentRelation(){{
                         MPJLambdaWrapper<BaseStudentSchoolRoll> baseStudentSchoolRollMPJLambdaWrapper = new MPJLambdaWrapper<>();
@@ -571,7 +567,7 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
             data.put("const3", new JSONObject() {{
                 put("value", AssessmentTypeEnum.PERSONAL.getValue());
             }});
-            String[] studentUsers = inspection.getStudentUserIds().split(",");
+            String[] studentUsers = inspection.getPersonalStudentUserIds().split(",");
             List<String> studentIds = new ArrayList<>();
             for (String studentUser : studentUsers) {
                 studentIds.add(studentUser.trim());

+ 10 - 0
src/main/resources/mapper/student/BaseStudentAssessmentInspectionMapper.xml

@@ -307,4 +307,14 @@
         </if>
         group by t.class_id;
     </select>
+    <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 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
+        INNER JOIN base_class t4 ON t4.id = t1.class_id
+        INNER JOIN base_major_set t5 ON t4.major_set_id = t5.id
+        LEFT JOIN xjr_dictionary_detail t6 ON t3.nation = t6.code
+        WHERE t1.base_student_assessment_inspection_id = #{id}
+    </select>
 </mapper>