Browse Source

Merge remote-tracking branch 'origin/master'

周箭河 5 years ago
parent
commit
a30d327d0b

+ 9 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -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);
                 }
             });
 

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/SubjectMapper.xml

@@ -122,7 +122,7 @@
             WHERE t.id_=#{teacherId}
     </select>
     <select id="findSubjectConditions" resultType="com.ym.mec.biz.dal.dto.ConditionDto">
-      select id_ id,name_ `name` from subject where parent_subject_id_=0
+      select id_ id,name_ `name` from subject where parent_subject_id_!=0
     </select>
     <select id="queryNameByIds" resultType="java.util.Map">
         select id_ `key`,name_ `value` FROM `subject` s WHERE FIND_IN_SET(s.id_,#{subjectIds})