Prechádzať zdrojové kódy

课时统计,课时补充冬天增加兼容

dzx 17 hodín pred
rodič
commit
3225d1d02f

+ 5 - 4
src/main/java/com/xjrsoft/module/classtime/service/impl/ClassTimeStatisticsServiceImpl.java

@@ -71,11 +71,13 @@ import java.time.format.DateTimeFormatter;
 import java.time.temporal.ChronoUnit;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.concurrent.CompletableFuture;
 import java.util.stream.Collectors;
 
@@ -560,7 +562,7 @@ public class ClassTimeStatisticsServiceImpl extends MPJBaseServiceImpl<ClassTime
                 //计算总金额,课时费+超课时费
                 Double totalAmount = classTimeAmount + beyondClassTimeAmount + reduceTimeAmount.doubleValue();
                 record.setTotalAmount(totalAmount);
-                record.setAllClassTimeData(calculateClassTime(allClassTimeDataArray, weightSetMap, allDateList));
+                record.setAllClassTimeData(calculateClassTime(allClassTimeDataArray, weightSetMap, allDateList, new ArrayList<>(CourseTimeTypeMap.values())));
                 record.setCreateDate(new Date());
 
                 insertList.add(record);
@@ -1220,7 +1222,7 @@ public class ClassTimeStatisticsServiceImpl extends MPJBaseServiceImpl<ClassTime
         return dates;
     }
 
-    String calculateClassTime(JsonArray allClassTimeDataArray, Map<String, Double> weightSetMap, List<LocalDate> allDateList){
+    String calculateClassTime(JsonArray allClassTimeDataArray, Map<String, Double> weightSetMap, List<LocalDate> allDateList, List<String> CourseTimeTypeSet){
         JsonObject result = new JsonObject();
         //计算纵向的合计
         Double allClassTime = 0d;
@@ -1279,8 +1281,7 @@ public class ClassTimeStatisticsServiceImpl extends MPJBaseServiceImpl<ClassTime
             columnTitleJson.addProperty("adjustType", "");
             columnTitle.add(columnTitleJson);
         }
-        String[] courseTimeTypes = CourseTimeTypeEnum.getValues();
-        for (String courseTimeType : courseTimeTypes) {
+        for (String courseTimeType : CourseTimeTypeSet) {
             double sum = 0d;
             JsonObject columnTitleJson = new JsonObject();
             for (JsonElement jsonElement : allClassTimeDataArray) {