|
@@ -20,7 +20,6 @@ import com.ym.mec.common.page.QueryInfo;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
|
import com.ym.mec.util.date.DateUtil;
|
|
|
-
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -34,8 +33,6 @@ import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
-import static com.timevale.tgtext.text.pdf.df.*;
|
|
|
-
|
|
|
@Service
|
|
|
public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup> implements ClassGroupService {
|
|
|
|
|
@@ -329,10 +326,16 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
|
|
|
if (Objects.isNull(totalClassTimes)) {
|
|
|
vipGroup.setMonthAvg(Float.parseFloat("0.0"));
|
|
|
} else {
|
|
|
- BigDecimal overCoursesOfMonth = new BigDecimal(overCourses), allClassTimes = new BigDecimal(totalClassTimes);
|
|
|
+ if(overCourses<=0){
|
|
|
+ vipGroup.setMonthAvg(0);
|
|
|
+ }else{
|
|
|
+ BigDecimal overCoursesOfMonth = new BigDecimal(overCourses), allClassTimes = new BigDecimal(totalClassTimes);
|
|
|
+
|
|
|
+ Float monthConsumeRate = overCoursesOfMonth.divide(overCoursesOfMonth, 2, BigDecimal.ROUND_HALF_UP).floatValue();
|
|
|
+
|
|
|
+ vipGroup.setMonthAvg(monthConsumeRate);
|
|
|
+ }
|
|
|
|
|
|
- Float monthConsumeRate = overCoursesOfMonth.divide(overCoursesOfMonth, 2, BigDecimal.ROUND_HALF_UP).floatValue();
|
|
|
- vipGroup.setMonthAvg(monthConsumeRate);
|
|
|
}
|
|
|
});
|
|
|
|