|
|
@@ -3,11 +3,13 @@ package com.xjrsoft.module.job;
|
|
|
import com.xjrsoft.XjrSoftApplication;
|
|
|
import com.xjrsoft.common.enums.DeleteMark;
|
|
|
import com.xjrsoft.common.enums.EnabledMark;
|
|
|
+import com.xjrsoft.module.student.dto.EnrollmentStatisticsCalendarInfoDto;
|
|
|
import com.xjrsoft.module.student.dto.EnrollmentStatisticsGraduationInfoDto;
|
|
|
import com.xjrsoft.module.student.dto.EnrollmentStatisticsInfoDto;
|
|
|
import com.xjrsoft.module.student.entity.EnrollmentStatisticsInfo;
|
|
|
import com.xjrsoft.module.student.mapper.EnrollmentStatisticsInfoMapper;
|
|
|
import com.xjrsoft.module.student.service.IPbCseFeeobjupdateService;
|
|
|
+import com.xjrsoft.module.student.vo.EnrollmentStatisticsCalendarInfoVo;
|
|
|
import com.xjrsoft.module.student.vo.EnrollmentStatisticsGraduationInfoVo;
|
|
|
import com.xjrsoft.module.student.vo.EnrollmentStatisticsInfoVo;
|
|
|
import com.yomahub.liteflow.util.JsonUtil;
|
|
|
@@ -17,8 +19,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
|
|
+import java.time.DayOfWeek;
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
+import java.time.temporal.TemporalAdjusters;
|
|
|
import java.util.Date;
|
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.*;
|
|
|
@@ -77,5 +81,32 @@ class EnrollmentStatisticsInfoTaskTest {
|
|
|
infoData.setDataDay(now);
|
|
|
enrollmentStatisticsInfoMapper.insert(infoData);
|
|
|
}
|
|
|
+
|
|
|
+ LocalDate thisSaturday = now.with(TemporalAdjusters.nextOrSame(DayOfWeek.SATURDAY));
|
|
|
+ LocalDate thisMonday = now.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY));
|
|
|
+ LocalDate lastSunday = thisMonday.minusDays(1);
|
|
|
+
|
|
|
+ String thisSaturdayStr = thisSaturday.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
|
+ String lastSundayStr = lastSunday.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
|
+
|
|
|
+ EnrollmentStatisticsCalendarInfoDto calendarInfoDto = new EnrollmentStatisticsCalendarInfoDto();
|
|
|
+ calendarInfoDto.setStartDay(lastSundayStr);
|
|
|
+ calendarInfoDto.setEndDay(thisSaturdayStr);
|
|
|
+ EnrollmentStatisticsCalendarInfoVo calendarInfoVo = pbCseFeeobjupdateService.getEnrollmentStatisticsCalendarInfo(calendarInfoDto);
|
|
|
+
|
|
|
+ if(calendarInfoVo != null){
|
|
|
+ enrollmentStatisticsInfoMapper.deleteCalendarDataByDate(lastSundayStr, thisSaturdayStr);
|
|
|
+
|
|
|
+ EnrollmentStatisticsInfo infoData = new EnrollmentStatisticsInfo();
|
|
|
+ infoData.setEnabledMark(EnabledMark.ENABLED.getCode());
|
|
|
+ infoData.setDeleteMark(DeleteMark.NODELETE.getCode());
|
|
|
+ infoData.setCreateDate(new Date());
|
|
|
+ infoData.setCreateUserId(1000000000000000000L);
|
|
|
+ infoData.setDataJson(JsonUtil.toJsonString(calendarInfoVo));
|
|
|
+ infoData.setDataType(3);
|
|
|
+ infoData.setDataStartDay(lastSunday);
|
|
|
+ infoData.setDataEndDay(thisSaturday);
|
|
|
+ enrollmentStatisticsInfoMapper.insert(infoData);
|
|
|
+ }
|
|
|
}
|
|
|
}
|