dzx 1 год назад
Родитель
Сommit
b18057a7c0

+ 1 - 1
src/main/java/com/xjrsoft/module/classtime/controller/ClassTimeStatisticsController.java

@@ -131,7 +131,7 @@ public class ClassTimeStatisticsController {
                 new QueryWrapper<ClassTimeStatistics>().lambda().orderByDesc(ClassTimeStatistics::getEndDate)
         );
         if (list.isEmpty()) {
-            return RT.error("未查询到数据");
+            return RT.ok();
         }
         ClassTimeStatistics result = list.get(0);
         return RT.ok(result.getEndDate());

+ 9 - 3
src/main/java/com/xjrsoft/module/classtime/service/impl/ClassTimeStatisticsServiceImpl.java

@@ -35,6 +35,7 @@ import org.springframework.transaction.annotation.Transactional;
 import java.math.BigDecimal;
 import java.time.DayOfWeek;
 import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
@@ -186,6 +187,7 @@ public class ClassTimeStatisticsServiceImpl extends MPJBaseServiceImpl<ClassTime
                 //去重并存到map中
                 deleteMap.put(classId, new HashSet<>(dateList));
             }
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
 
             //查询所有老师发起顶课通过的数量(只查询事假、病假),也要分别计算早自习、晚自习、正课、如果日期出入课时删除中,也需要跳过
             List<CourseListVo> allSubstituteList = this.baseMapper.getSubstituteList(statistics);
@@ -247,12 +249,16 @@ public class ClassTimeStatisticsServiceImpl extends MPJBaseServiceImpl<ClassTime
                     }
 
                     if(courseListVo.getAdjustType() != null && !courseListVo.getAdjustType().isEmpty()){
-                        if(CourseAdjustTypeEnum.courseSubstitute.getCode().equals(courseListVo.getAdjustType())){
-                            classTime10 += weightSetMap.get(courseListVo.getShortName());
-                        }else if(CourseAdjustTypeEnum.courseExchange.getCode().equals(courseListVo.getAdjustType())){
+                        if(CourseAdjustTypeEnum.courseExchange.getCode().equals(courseListVo.getAdjustType())){
                             classTime11 += weightSetMap.get(courseListVo.getShortName());
                         }
                     }
+                    JsonObject courseJson = new JsonObject();
+                    courseJson.addProperty("type", courseListVo.getShortName());
+                    courseJson.addProperty("scheduleDate", courseListVo.getScheduleDate().format(formatter));
+                    courseJson.addProperty("content", courseListVo.getClassName() + "," + courseListVo.getCourseName());
+                    courseJson.addProperty("adjustType", courseListVo.getAdjustType());
+                    allClassTimeDataArray.add(courseJson);
                 }
                 record.setClassTime7(classTime7);
                 record.setClassTime8(classTime8);

+ 6 - 0
src/main/java/com/xjrsoft/module/classtime/vo/CourseListVo.java

@@ -36,4 +36,10 @@ public class CourseListVo {
     @ApiModelProperty("顶课老师")
     private Long exchangeTeacherId;
 
+    @ApiModelProperty("班级名称")
+    private String className;
+
+    @ApiModelProperty("课程名称")
+    private String courseName;
+
 }

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

@@ -558,7 +558,7 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
 
         JSONObject data = new JSONObject();
         String thing4 = "";
-        String thing1 = "";
+        String thing1 = "";
         if(AssessmentTypeEnum.CLASS.getCode().equals(inspection.getAssessmentType())){
             data.put("const3", new JSONObject() {{
                 put("value", AssessmentTypeEnum.CLASS.getValue());

+ 1 - 1
src/main/resources/mapper/classtime/ClassTimeStatisticsMapper.xml

@@ -17,7 +17,7 @@
     </select>
 
     <select id="getCourseList" parameterType="com.xjrsoft.module.classtime.entity.ClassTimeStatistics" resultType="com.xjrsoft.module.classtime.vo.CourseListVo">
-        SELECT t1.class_id, t1.teacher_id, t2.short_name,t1.adjust_type,t4.reason,t1.schedule_date FROM course_table t1
+        SELECT t1.class_id, t1.teacher_id, t2.short_name,t1.adjust_type,t4.reason,t1.schedule_date,t1.class_name,t1.course_name FROM course_table t1
         LEFT JOIN class_time t2 ON t1.time_period = t2.time_period AND t1.time_number = t2.number
         LEFT JOIN course_table_bak t3 ON t1.id = t3.id
         LEFT JOIN wf_course_adjust t4 ON t4.id = t3.wf_course_adjust_id