update 调整参数

develop
hhb@hotmail.com 3 weeks ago
parent 13d095d02b
commit 128a05e90a

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

@ -6,4 +6,5 @@ import lombok.Data;
public class GCDto { public class GCDto {
private String schoolId; private String schoolId;
private String periodId; private String periodId;
private Long time;
} }

@ -20,4 +20,5 @@ public class TeacherDto {
public String grade; public String grade;
@ApiModelProperty("科目信息") @ApiModelProperty("科目信息")
public String subjectId; public String subjectId;
public String semesterId;
} }

Loading…
Cancel
Save