|
|
@@ -11,6 +11,7 @@ import com.google.gson.JsonObject;
|
|
|
import com.google.gson.JsonParser;
|
|
|
import com.xjrsoft.common.enums.CourseAdjustTypeEnum;
|
|
|
import com.xjrsoft.common.enums.CourseTimeTypeEnum;
|
|
|
+import com.xjrsoft.common.enums.DeleteMark;
|
|
|
import com.xjrsoft.common.exception.MyException;
|
|
|
import com.xjrsoft.common.mybatis.SqlRunnerAdapter;
|
|
|
import com.xjrsoft.module.classtime.dto.AddClassTimeStatisticsDto;
|
|
|
@@ -28,6 +29,8 @@ import com.xjrsoft.module.classtime.vo.CourseListVo;
|
|
|
import com.xjrsoft.module.classtime.vo.TeacherListVo;
|
|
|
import com.xjrsoft.module.classtime.vo.WeekTimeRangeVo;
|
|
|
import com.xjrsoft.module.oa.entity.WfTeacherCourseTime;
|
|
|
+import com.xjrsoft.module.system.entity.DictionaryDetail;
|
|
|
+import com.xjrsoft.module.system.service.IDictionarydetailService;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import me.zhyd.oauth.log.Log;
|
|
|
import org.apache.poi.ss.usermodel.Cell;
|
|
|
@@ -77,6 +80,7 @@ public class ClassTimeStatisticsServiceImpl extends MPJBaseServiceImpl<ClassTime
|
|
|
private final IClassTimeStatisticsSetService statisticsSetService;
|
|
|
|
|
|
private final IClassTimeDeleteService deleteService;
|
|
|
+ private final IDictionarydetailService dictionaryService;
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@@ -155,6 +159,12 @@ public class ClassTimeStatisticsServiceImpl extends MPJBaseServiceImpl<ClassTime
|
|
|
// 1、查询教师
|
|
|
List<TeacherListVo> teacherList = this.baseMapper.getTeacherList();
|
|
|
// 2、查询补课课时
|
|
|
+ List<DictionaryDetail> CourseTimeTypeList = dictionaryService.list(
|
|
|
+ new QueryWrapper<DictionaryDetail>().lambda()
|
|
|
+ .eq(DictionaryDetail::getItemId, 1833772737004875778L)
|
|
|
+ .eq(DictionaryDetail::getDeleteMark, DeleteMark.NODELETE.getCode())
|
|
|
+ );
|
|
|
+ Map<String, String> CourseTimeTypeMap = CourseTimeTypeList.stream().collect(Collectors.toMap(DictionaryDetail::getCode, DictionaryDetail::getName));
|
|
|
List<WfTeacherCourseTime> courseTimeList = this.baseMapper.getWfTeacherCourseTimeList(statistics);
|
|
|
//按照课时补充类型分类统计
|
|
|
Map<String, List<WfTeacherCourseTime>> courseTimeMap = courseTimeList.stream().collect(Collectors.groupingBy(WfTeacherCourseTime::getCourseTimeType));
|
|
|
@@ -218,90 +228,27 @@ public class ClassTimeStatisticsServiceImpl extends MPJBaseServiceImpl<ClassTime
|
|
|
|
|
|
Double allClassTime = 0D;
|
|
|
//计算补充课时,算作正课课时,但是计算超出课时时不计算这部分
|
|
|
- for (String courseTimeType : courseTimeMap.keySet()) {
|
|
|
+ JsonObject courseTimeTypeJson = new JsonObject();
|
|
|
+ Double courseTimeTypeTime = 0D;
|
|
|
+ for (String courseTimeType : CourseTimeTypeMap.keySet()) {
|
|
|
List<WfTeacherCourseTime> courseTimes = courseTimeMap.get(courseTimeType);
|
|
|
double sum = courseTimes.stream()
|
|
|
.filter(x -> x.getTeacherIds().contains(teacher.getId().toString()))
|
|
|
.mapToDouble(WfTeacherCourseTime::getCourseTime).sum();
|
|
|
allClassTime = allClassTime + sum;
|
|
|
- if(CourseTimeTypeEnum.CTT001.getCode().equals(courseTimeType)){
|
|
|
- record.setClassTime1(sum);
|
|
|
- for (LocalDate localDate : allDateList) {
|
|
|
- double sum1 = courseTimes.stream()
|
|
|
- .filter(x -> x.getTeacherIds().contains(teacher.getId().toString()) && localDate.equals(x.getScheduleDate()))
|
|
|
- .mapToDouble(WfTeacherCourseTime::getCourseTime).sum();
|
|
|
- JsonObject courseJson = new JsonObject();
|
|
|
- courseJson.addProperty("type", CourseTimeTypeEnum.CTT001.getValue());
|
|
|
- courseJson.addProperty("scheduleDate", localDate.format(formatter));
|
|
|
- courseJson.addProperty("content", sum1);
|
|
|
- courseJson.addProperty("adjustType", "");
|
|
|
- allClassTimeDataArray.add(courseJson);
|
|
|
- }
|
|
|
- }else if(CourseTimeTypeEnum.CTT002.getCode().equals(courseTimeType)){
|
|
|
- record.setClassTime2(sum);
|
|
|
- for (LocalDate localDate : allDateList) {
|
|
|
- double sum1 = courseTimes.stream()
|
|
|
- .filter(x -> x.getTeacherIds().contains(teacher.getId().toString()) && localDate.equals(x.getScheduleDate()))
|
|
|
- .mapToDouble(WfTeacherCourseTime::getCourseTime).sum();
|
|
|
- JsonObject courseJson = new JsonObject();
|
|
|
- courseJson.addProperty("type", CourseTimeTypeEnum.CTT001.getValue());
|
|
|
- courseJson.addProperty("scheduleDate", localDate.format(formatter));
|
|
|
- courseJson.addProperty("content", sum1);
|
|
|
- courseJson.addProperty("adjustType", "");
|
|
|
- allClassTimeDataArray.add(courseJson);
|
|
|
- }
|
|
|
- }else if(CourseTimeTypeEnum.CTT003.getCode().equals(courseTimeType)){
|
|
|
- record.setClassTime3(sum);
|
|
|
- for (LocalDate localDate : allDateList) {
|
|
|
- double sum1 = courseTimes.stream()
|
|
|
- .filter(x -> x.getTeacherIds().contains(teacher.getId().toString()) && localDate.equals(x.getScheduleDate()))
|
|
|
- .mapToDouble(WfTeacherCourseTime::getCourseTime).sum();
|
|
|
- JsonObject courseJson = new JsonObject();
|
|
|
- courseJson.addProperty("type", CourseTimeTypeEnum.CTT001.getValue());
|
|
|
- courseJson.addProperty("scheduleDate", localDate.format(formatter));
|
|
|
- courseJson.addProperty("content", sum1);
|
|
|
- courseJson.addProperty("adjustType", "");
|
|
|
- allClassTimeDataArray.add(courseJson);
|
|
|
- }
|
|
|
- }else if(CourseTimeTypeEnum.CTT004.getCode().equals(courseTimeType)){
|
|
|
- record.setClassTime4(sum);
|
|
|
- for (LocalDate localDate : allDateList) {
|
|
|
- double sum1 = courseTimes.stream()
|
|
|
- .filter(x -> x.getTeacherIds().contains(teacher.getId().toString()) && localDate.equals(x.getScheduleDate()))
|
|
|
- .mapToDouble(WfTeacherCourseTime::getCourseTime).sum();
|
|
|
- JsonObject courseJson = new JsonObject();
|
|
|
- courseJson.addProperty("type", CourseTimeTypeEnum.CTT001.getValue());
|
|
|
- courseJson.addProperty("scheduleDate", localDate.format(formatter));
|
|
|
- courseJson.addProperty("content", sum1);
|
|
|
- courseJson.addProperty("adjustType", "");
|
|
|
- allClassTimeDataArray.add(courseJson);
|
|
|
- }
|
|
|
- }else if(CourseTimeTypeEnum.CTT005.getCode().equals(courseTimeType)){
|
|
|
- record.setClassTime5(sum);
|
|
|
- for (LocalDate localDate : allDateList) {
|
|
|
- double sum1 = courseTimes.stream()
|
|
|
- .filter(x -> x.getTeacherIds().contains(teacher.getId().toString()) && localDate.equals(x.getScheduleDate()))
|
|
|
- .mapToDouble(WfTeacherCourseTime::getCourseTime).sum();
|
|
|
- JsonObject courseJson = new JsonObject();
|
|
|
- courseJson.addProperty("type", CourseTimeTypeEnum.CTT001.getValue());
|
|
|
- courseJson.addProperty("scheduleDate", localDate.format(formatter));
|
|
|
- courseJson.addProperty("content", sum1);
|
|
|
- courseJson.addProperty("adjustType", "");
|
|
|
- allClassTimeDataArray.add(courseJson);
|
|
|
- }
|
|
|
- }else if(CourseTimeTypeEnum.CTT006.getCode().equals(courseTimeType)){
|
|
|
- record.setClassTime6(sum);
|
|
|
- for (LocalDate localDate : allDateList) {
|
|
|
- double sum1 = courseTimes.stream()
|
|
|
- .filter(x -> x.getTeacherIds().contains(teacher.getId().toString()) && localDate.equals(x.getScheduleDate()))
|
|
|
- .mapToDouble(WfTeacherCourseTime::getCourseTime).sum();
|
|
|
- JsonObject courseJson = new JsonObject();
|
|
|
- courseJson.addProperty("type", CourseTimeTypeEnum.CTT001.getValue());
|
|
|
- courseJson.addProperty("scheduleDate", localDate.format(formatter));
|
|
|
- courseJson.addProperty("content", sum1);
|
|
|
- courseJson.addProperty("adjustType", "");
|
|
|
- allClassTimeDataArray.add(courseJson);
|
|
|
- }
|
|
|
+ courseTimeTypeTime = courseTimeTypeTime + sum;
|
|
|
+ courseTimeTypeJson.addProperty(courseTimeType, sum);
|
|
|
+
|
|
|
+ for (LocalDate localDate : allDateList) {
|
|
|
+ double sum1 = courseTimes.stream()
|
|
|
+ .filter(x -> x.getTeacherIds().contains(teacher.getId().toString()) && localDate.equals(x.getScheduleDate()))
|
|
|
+ .mapToDouble(WfTeacherCourseTime::getCourseTime).sum();
|
|
|
+ JsonObject courseJson = new JsonObject();
|
|
|
+ courseJson.addProperty("type", courseTimeType);
|
|
|
+ courseJson.addProperty("scheduleDate", localDate.format(formatter));
|
|
|
+ courseJson.addProperty("content", sum1);
|
|
|
+ courseJson.addProperty("adjustType", "");
|
|
|
+ allClassTimeDataArray.add(courseJson);
|
|
|
}
|
|
|
}
|
|
|
//早自习、正课、晚辅、顶课、调课
|
|
|
@@ -460,12 +407,7 @@ public class ClassTimeStatisticsServiceImpl extends MPJBaseServiceImpl<ClassTime
|
|
|
}
|
|
|
|
|
|
double classTime = classTime8
|
|
|
- + (record.getClassTime1() == null ? 0d:record.getClassTime1())
|
|
|
- + (record.getClassTime2() == null ? 0d:record.getClassTime2())
|
|
|
- + (record.getClassTime3() == null ? 0d:record.getClassTime3())
|
|
|
- + (record.getClassTime4() == null ? 0d:record.getClassTime4())
|
|
|
- + (record.getClassTime5() == null ? 0d:record.getClassTime5())
|
|
|
- + (record.getClassTime6() == null ? 0d:record.getClassTime6());
|
|
|
+ + courseTimeTypeTime;
|
|
|
classTimeAmount += BigDecimal.valueOf(classTime).multiply(zkCost).doubleValue();
|
|
|
|
|
|
BigDecimal wzxCost = BigDecimal.ZERO;//晚自习费用
|
|
|
@@ -620,6 +562,7 @@ public class ClassTimeStatisticsServiceImpl extends MPJBaseServiceImpl<ClassTime
|
|
|
rowData.add(recordVo.getClassTime4()==null?"":recordVo.getClassTime4().toString());//出题
|
|
|
rowData.add(recordVo.getClassTime5()==null?"":recordVo.getClassTime5().toString());//阅卷
|
|
|
rowData.add(recordVo.getClassTime6()==null?"":recordVo.getClassTime6().toString());//周末培优
|
|
|
+
|
|
|
rowData.add(recordVo.getClassTime7()==null?"":recordVo.getClassTime7().toString());//早自习
|
|
|
rowData.add(recordVo.getClassTime8()==null?"":recordVo.getClassTime8().toString());//正课(含调顶课时)
|
|
|
rowData.add(recordVo.getClassTime9()==null?"":recordVo.getClassTime9().toString());//晚辅(含调顶课时)
|