|
|
@@ -5,7 +5,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
|
import com.google.gson.JsonArray;
|
|
|
+import com.google.gson.JsonElement;
|
|
|
+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.EnabledMark;
|
|
|
import com.xjrsoft.module.classtime.dto.AddClassTimeStatisticsDto;
|
|
|
@@ -27,6 +30,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.time.LocalDate;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.HashSet;
|
|
|
@@ -134,9 +138,20 @@ public class ClassTimeStatisticsServiceImpl extends MPJBaseServiceImpl<ClassTime
|
|
|
|
|
|
//费用设置jsonArray
|
|
|
JsonArray costSetArray = parser.parse(statistics.getCostSetJson()).getAsJsonArray();
|
|
|
+ Map<String, Double> costSetMap = new HashMap<>();
|
|
|
+ for (JsonElement jsonElement : costSetArray) {
|
|
|
+ JsonObject object = jsonElement.getAsJsonObject();
|
|
|
+ costSetMap.put(object.get("field").getAsString(), object.get("value").getAsDouble());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//权重设置jsonArray
|
|
|
JsonArray weightSetArray = parser.parse(statistics.getWeightSetJson()).getAsJsonArray();
|
|
|
-
|
|
|
+ Map<String, Double> weightSetMap = new HashMap<>();
|
|
|
+ for (JsonElement jsonElement : weightSetArray) {
|
|
|
+ JsonObject object = jsonElement.getAsJsonObject();
|
|
|
+ weightSetMap.put(object.get("label").getAsString(), object.get("value").getAsDouble());
|
|
|
+ }
|
|
|
//查询课程数据
|
|
|
List<CourseListVo> allCourseList = this.baseMapper.getCourseList(statistics);
|
|
|
|
|
|
@@ -160,6 +175,8 @@ public class ClassTimeStatisticsServiceImpl extends MPJBaseServiceImpl<ClassTime
|
|
|
deleteMap.put(classId, new HashSet<>(dateList));
|
|
|
}
|
|
|
|
|
|
+ //查询所有老师发起顶课通过的数量(只查询事假、病假),也要分别计算早自习、晚自习、正课、如果日期出入课时删除中,也需要跳过
|
|
|
+ List<CourseListVo> substituteList = this.baseMapper.getSubstituteList(statistics);
|
|
|
|
|
|
//循环教师,准备开始计算
|
|
|
for (TeacherListVo teacher : teacherList) {
|
|
|
@@ -189,7 +206,11 @@ public class ClassTimeStatisticsServiceImpl extends MPJBaseServiceImpl<ClassTime
|
|
|
record.setClassTime6(sum);
|
|
|
}
|
|
|
}
|
|
|
+ //早自习、正课、晚辅、顶课、调课
|
|
|
+ Double classTime7 = 0D,classTime8 = 0D,classTime9 = 0D,classTime10 = 0D,classTime11 = 0D;
|
|
|
|
|
|
+ List<String> zkList = Arrays.asList("上1","上2","上3","上4","下1","下2","下3","下4");
|
|
|
+ List<String> wzxList = Arrays.asList("晚1","晚2","晚3");
|
|
|
//查询出老师的课程
|
|
|
List<CourseListVo> courseList = allCourseList.stream()
|
|
|
.filter(x -> x.getTeacherId().contains(teacher.getId().toString()))
|
|
|
@@ -201,8 +222,61 @@ public class ClassTimeStatisticsServiceImpl extends MPJBaseServiceImpl<ClassTime
|
|
|
if(deleteDates.contains(courseListVo.getScheduleDate())){
|
|
|
continue;
|
|
|
}
|
|
|
+ if("早自习".equals(courseListVo.getShortName())){
|
|
|
+ classTime7 ++;
|
|
|
+ }else if(zkList.contains(courseListVo.getShortName())){
|
|
|
+ classTime8 ++;
|
|
|
+ }else if(wzxList.contains(courseListVo.getShortName())){
|
|
|
+ classTime9 ++;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(courseListVo.getAdjustType() != null && !courseListVo.getAdjustType().isEmpty()){
|
|
|
+ if(CourseAdjustTypeEnum.courseSubstitute.getCode().equals(courseListVo.getAdjustType())){
|
|
|
+ classTime10 ++;
|
|
|
+ }else if(CourseAdjustTypeEnum.courseExchange.getCode().equals(courseListVo.getAdjustType())){
|
|
|
+ classTime11 ++;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ //计算总课时
|
|
|
+ allClassTime = allClassTime + classTime7 + classTime8 + classTime9;
|
|
|
record.setAllClassTime(allClassTime);
|
|
|
+
|
|
|
+ //计算费用,根据聘用类型判断费用问题
|
|
|
+ Double zzxCost = 0d;//早自习费用
|
|
|
+ if("FB1601".equals(teacher.getEmployType())){
|
|
|
+ zzxCost = costSetMap.get("cost1");
|
|
|
+ }else if("FB1602".equals(teacher.getEmployType())){
|
|
|
+ zzxCost = costSetMap.get("cost2");
|
|
|
+ }
|
|
|
+
|
|
|
+ Double zkCost = 0d;//正课费用
|
|
|
+ if("FB1601".equals(teacher.getEmployType())){
|
|
|
+ zkCost = costSetMap.get("cost3");
|
|
|
+ }else if("FB1602".equals(teacher.getEmployType())){
|
|
|
+ zkCost = costSetMap.get("cost4");
|
|
|
+ }
|
|
|
+
|
|
|
+ Double wzxCost = 0d;//晚自习费用
|
|
|
+ if("FB1601".equals(teacher.getEmployType())){
|
|
|
+ wzxCost = costSetMap.get("cost5");
|
|
|
+ }else if("FB1602".equals(teacher.getEmployType())){
|
|
|
+ wzxCost = costSetMap.get("cost6");
|
|
|
+ }
|
|
|
+
|
|
|
+ Double dkCost = 0d;//顶课费用,顶课老师加钱
|
|
|
+ if("FB1601".equals(teacher.getEmployType())){
|
|
|
+ dkCost = costSetMap.get("cost11");
|
|
|
+ }else if("FB1602".equals(teacher.getEmployType())){
|
|
|
+ dkCost = costSetMap.get("cost12");
|
|
|
+ }
|
|
|
+
|
|
|
+ Double bdkCost = 0d;//顶课费用,被顶课老师扣钱
|
|
|
+ if("FB1601".equals(teacher.getEmployType())){
|
|
|
+ bdkCost = costSetMap.get("cost13");
|
|
|
+ }else if("FB1602".equals(teacher.getEmployType())){
|
|
|
+ bdkCost = costSetMap.get("cost14");
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
return true;
|