Prechádzať zdrojové kódy

feat:教师端课酬

Joburgess 4 rokov pred
rodič
commit
62d4a52207

+ 9 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java

@@ -2208,20 +2208,25 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
             startDate = startDate.withMonth(3);
         }
 
+        result.put("total", BigDecimal.ZERO);
+        result.put("salary", BigDecimal.ZERO);
+        result.put("data", Collections.emptyList());
+
         if(startDate.compareTo(minDate)<0){
-            result.put("total", BigDecimal.ZERO);
-            result.put("salary", BigDecimal.ZERO);
-            result.put("data", Collections.emptyList());
             return result;
         }
 
         List<LocalDateBigDecimalMapDto> monthIncomeMapList = courseScheduleTeacherSalaryDao.teacherIncomeStat(teacherId, year, month);
 
+        if(CollectionUtils.isEmpty(monthIncomeMapList)){
+            return result;
+        }
+
         if(Objects.isNull(month)){
             Set<String> months = monthIncomeMapList.stream().map(e -> DateUtil.dateToString(e.getDate(), "yyyy-MM")).collect(Collectors.toSet());
 
             LocalDate now = LocalDate.now();
-            now.plusMonths(-1);
+            now = now.plusMonths(-1);
             DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM");
             while (startDate.compareTo(now)<=0&&year.equals(startDate.get(ChronoField.YEAR))){
                 String dateStr = dateFormatter.format(startDate);

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

@@ -1128,6 +1128,7 @@
 			<if test="year!=null">
 				AND YEAR ( cs.class_date_ ) = #{year}
 			</if>
+		  	AND csts.actual_salary_ &gt; 0
 			<if test="month!=null">
 				AND MONTH(cs.class_date_) = #{month}
 			</if>