Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

zouxuan 4 vuotta sitten
vanhempi
commit
70f9b378d5

+ 17 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java

@@ -2179,6 +2179,9 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                 }
                 teacherIncomeInfo.setDeductReasons(teacherSalary.getDeductReasons());
                 teacherIncomeInfo.setTeacherAttendance(teacherAttendances.get(0));
+                if(Objects.nonNull(school)&&Objects.nonNull(teacherIncomeInfo.getTeacherAttendance())){
+                    teacherIncomeInfo.getTeacherAttendance().setSchoolLongitudeLatitude(school.getLongitudeLatitude());
+                }
                 teacherIncomeInfo.setBelongToDaya(teacherSalary.getBelongToDaya());
                 dataList.add(teacherIncomeInfo);
             }
@@ -2198,6 +2201,20 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
         result.put("total", BigDecimal.ZERO);
         result.put("salary", BigDecimal.ZERO);
 
+        LocalDate minDate = LocalDate.of(2021, 3, 1);
+        LocalDate startDate = LocalDate.of(year, Objects.isNull(month)?1:month, 1);
+
+        if(year<=2021&&Objects.isNull(month)){
+            startDate = startDate.withMonth(3);
+        }
+
+        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(Objects.isNull(month)){
@@ -2205,8 +2222,6 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
 
             LocalDate now = LocalDate.now();
             DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM");
-
-            LocalDate startDate = LocalDate.of(year, Objects.isNull(month)?1:month, 1);
             while (startDate.compareTo(now)<=0&&year.equals(startDate.get(ChronoField.YEAR))){
                 String dateStr = dateFormatter.format(startDate);
                 if(!months.contains(dateStr)){
@@ -2217,7 +2232,6 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
         }else{
             Set<String> dates = monthIncomeMapList.stream().map(e -> DateUtil.dateToString(e.getDate(), "yyyy-MM-dd")).collect(Collectors.toSet());
 
-            LocalDate startDate = LocalDate.of(year, Objects.isNull(month)?1:month, 1);
             Integer oldMonth = Objects.isNull(month)?new Integer(1):month;
             while (oldMonth.equals(startDate.get(ChronoField.MONTH_OF_YEAR))){
                 String dateStr = DateUtil.dateFormatter.format(startDate);

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

@@ -3774,6 +3774,7 @@
             ( cs.del_flag_ IS NULL OR cs.del_flag_ = 0 )
             AND (cs.is_lock_=0 OR cs.is_lock_ IS NULL)
             AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
+            AND cs.class_date_ &gt;= "2021-03-01"
             <if test="teacherId!=null">
                 AND csts.user_id_ = #{teacherId}
             </if>

+ 3 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/CourseScheduleTeacherSalaryController.java

@@ -9,6 +9,7 @@ import com.ym.mec.biz.service.CourseScheduleTeacherSalaryService;
 import com.ym.mec.biz.service.TeacherCourseRewardService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.util.date.DateUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
@@ -18,6 +19,8 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.time.LocalDate;
+
 /**
  * @Author Joburgess
  * @Date 2020/4/15