Browse Source

字段补充

caozixuan 4 năm trước cách đây
mục cha
commit
2ca4e75a14

+ 12 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/entity/TAExamCourse.java

@@ -63,6 +63,10 @@ public class TAExamCourse implements Serializable {
     @TableField(value = "inspect_college_count")
     private Integer inspectCollegeCount;
 
+    @ApiModelProperty(value = "考查学院名称(','隔开)")
+    @TableField(value = "inspect_college_names")
+    private String inspectCollegeNames;
+
     @ApiModelProperty(value = "总体平均分")
     @TableField(value = "avg_score")
     private BigDecimal avgScore;
@@ -522,4 +526,12 @@ public class TAExamCourse implements Serializable {
     public void setCoefficient(BigDecimal coefficient) {
         this.coefficient = coefficient;
     }
+
+    public String getInspectCollegeNames() {
+        return inspectCollegeNames;
+    }
+
+    public void setInspectCollegeNames(String inspectCollegeNames) {
+        this.inspectCollegeNames = inspectCollegeNames;
+    }
 }

+ 8 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/AnalyzeForReportServiceImpl.java

@@ -19,6 +19,7 @@ import com.qmth.teachcloud.report.business.service.*;
 import com.qmth.teachcloud.report.business.utils.AnalyzeScopeUtil;
 import com.qmth.teachcloud.report.business.utils.ConversionUtils;
 import com.qmth.teachcloud.report.business.utils.MathUtil;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -253,6 +254,12 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
                 teachCollegeName = tbSchoolCollege.getName();
             }
             int inspectCollegeCount = inspectCollegeIdList.size();
+            if (inspectCollegeIdList.size() == 0){
+                throw ExceptionResultEnum.ERROR.exception("没有考察学院");
+            }
+            List<SysOrg> sysOrgList = sysOrgService.listByIds(inspectCollegeIdList);
+            String inspectCollegeNames = StringUtils.join(sysOrgList.stream().map(SysOrg::getName).collect(Collectors.toList()),',');
+
 
             /*
                 组装
@@ -268,6 +275,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
             taExamCourse.setTeachCollegeId(teachCollegeId);
             taExamCourse.setTeachCollegeName(teachCollegeName);
             taExamCourse.setInspectCollegeCount(inspectCollegeCount);
+            taExamCourse.setInspectCollegeNames(inspectCollegeNames);
             taExamCourse.setAvgScore(BigDecimal.valueOf(avgScore));
             taExamCourse.setPassCount((int) passCount);
             taExamCourse.setPassRate(passRate);

+ 2 - 1
teachcloud-report-business/src/main/resources/mapper/TAExamCourseMapper.xml

@@ -84,7 +84,8 @@
             a.reality_count realityCount,
             a.inspect_college_count inspectCollegeCount,
             a.absent_count absentCount,
-            a.teach_college_name teachCollegeName
+            a.teach_college_name teachCollegeName,
+            a.inspect_college_names inspectCollegeName
         FROM
             t_a_exam_course a
                 LEFT JOIN

+ 2 - 0
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/CourseController.java

@@ -132,4 +132,6 @@ public class CourseController {
                                      @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
         return ResultUtil.ok(taExamCourseService.surveyAspointsList(new Page<>(pageNumber, pageSize), Objects.isNull(schoolId) ? (Long) ServletUtil.getRequestHeaderSchoolId() : SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId), courseCode, publishStatus, semester));
     }
+
+
 }

+ 1 - 1
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/DataDriveController.java

@@ -61,7 +61,7 @@ public class DataDriveController {
         taExamTotalService.exportCourseSummary(semester, examId, response);
     }
 
-    @ApiOperation(value = "全校考试总览-全校考试概况")
+    @ApiOperation(value = "全校课程考试分析-全校考试概况")
     @RequestMapping(value = "/course/get_overview", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "全校考试总览-全校考试概况", response = TAExamCourse.class)})
     public Result getOverview(@ApiParam(value = "学期", required = true) @RequestParam String semester,

+ 1 - 1
teachcloud-report/src/test/java/com/qmth/teachcloud/report/AnalyzeForStudentServiceTest.java

@@ -21,7 +21,7 @@ public class AnalyzeForStudentServiceTest {
     @Test
     public void buildAnalyzeExamCourse() {
         Long examId = 1L;
-        String courseCode = "1013";
+        String courseCode = null;
         System.out.println(analyzeForReportService.buildAnalyzeExamCourse(examId,courseCode));
 
     }