|
|
|
@ -12,11 +12,14 @@ import cn.teammodel.repository.CommentRepository;
|
|
|
|
|
import cn.teammodel.repository.SchoolRepository;
|
|
|
|
|
import cn.teammodel.utils.MonthToNumberConverter;
|
|
|
|
|
import com.azure.cosmos.models.PartitionKey;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.time.Instant;
|
|
|
|
|
import java.time.LocalDate;
|
|
|
|
|
import java.time.Month;
|
|
|
|
|
import java.time.ZoneId;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
@ -38,10 +41,20 @@ public class CommonServiceImpl implements CommonService {
|
|
|
|
|
//获取当前学校该学段下详细信息
|
|
|
|
|
List<School.Period> period = schoolRepository.findPeriodById(gcDto.getSchoolId(), gcDto.getPeriodId());
|
|
|
|
|
List<ClassInfo> classes = classRepository.findClassBySchoolIdAndPeriodId(gcDto.getPeriodId());
|
|
|
|
|
int year = now().getYear();
|
|
|
|
|
Month month = now().getMonth();
|
|
|
|
|
int mon = MonthToNumberConverter.convertMonthToNumber(month.name());
|
|
|
|
|
int day = now().getDayOfMonth();
|
|
|
|
|
int year = 0;
|
|
|
|
|
int mon = 0;
|
|
|
|
|
int day = 0;
|
|
|
|
|
if (gcDto.getTime() != null && gcDto.getTime() != 0L) {
|
|
|
|
|
LocalDate date = Instant.ofEpochMilli(gcDto.getTime()).atZone(ZoneId.systemDefault()).toLocalDate();
|
|
|
|
|
year = date.getYear();
|
|
|
|
|
mon = date.getMonthValue();
|
|
|
|
|
day = date.getDayOfMonth();
|
|
|
|
|
}else {
|
|
|
|
|
year = now().getYear();
|
|
|
|
|
Month month = now().getMonth();
|
|
|
|
|
mon = MonthToNumberConverter.convertMonthToNumber(month.name());
|
|
|
|
|
day = now().getDayOfMonth();
|
|
|
|
|
}
|
|
|
|
|
//处理年级ID
|
|
|
|
|
for (ClassInfo classInfo : classes) {
|
|
|
|
|
if(period.get(0).getId().equalsIgnoreCase(classInfo.getPeriodId())) {
|
|
|
|
|