|
|
@@ -57,6 +57,7 @@ import java.io.IOException;
|
|
|
import java.io.InputStream;
|
|
|
import java.time.DayOfWeek;
|
|
|
import java.time.Duration;
|
|
|
+import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.ZoneId;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
@@ -246,7 +247,7 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
|
|
|
CourseTableAdjustDto dto = new CourseTableAdjustDto();
|
|
|
if(adjustDate != null && !"".equals(adjustDate)){
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
- LocalDateTime localDateTime = LocalDateTime.parse(adjustDate, formatter);
|
|
|
+ LocalDate localDateTime = LocalDate.parse(adjustDate, formatter);
|
|
|
DayOfWeek dayOfWeek = localDateTime.getDayOfWeek();
|
|
|
dto.setWeek(dayOfWeek.getValue());
|
|
|
}
|
|
|
@@ -256,13 +257,15 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public String getPreCheck(String preCheckType, Long courseId, Long swapCourseId, Date swapDate, Long subTeacherId) {
|
|
|
+ public String getPreCheck(String preCheckType, String courseId, String swapCourseId, String swapDate, String subTeacherId) {
|
|
|
if(preCheckType != null && !"".equals(preCheckType)){
|
|
|
if(CourseAdjustTypeEnum.courseExchange.getCode().equals(preCheckType)){
|
|
|
CourseTable courseTable = courseTableMapper.selectById(courseId);
|
|
|
CourseTable swapCourseTable = courseTableMapper.selectById(swapCourseId);
|
|
|
try {
|
|
|
- JsonObject preCheck = getExtendPreCheck(swapDate, courseTable, swapCourseTable);
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
+ LocalDate localDateTime = LocalDate.parse(swapDate, formatter);
|
|
|
+ JsonObject preCheck = getExtendPreCheck(localDateTime, courseTable, swapCourseTable);
|
|
|
if(!preCheck.get("data").getAsBoolean() && !preCheck.get("msg").isJsonNull()){
|
|
|
return preCheck.get("msg").getAsString();
|
|
|
}
|
|
|
@@ -380,7 +383,7 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
|
|
|
* @param courseTable
|
|
|
* @return 检查结果
|
|
|
*/
|
|
|
- JsonObject substitutePreTestin(Long subTeacherId, CourseTable courseTable) throws Exception {
|
|
|
+ JsonObject substitutePreTestin(String subTeacherId, CourseTable courseTable) throws Exception {
|
|
|
JsonParser jsonParser = new JsonParser();
|
|
|
String url = ScheduleUtil.apiUrl + "RescheduleApply/Extend/Substitute/PreTesting";
|
|
|
JsonObject jsonObject = new JsonObject();
|
|
|
@@ -407,7 +410,7 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
|
|
|
* @param swapCourseTable 对调的课程
|
|
|
* @return 检查结果
|
|
|
*/
|
|
|
- JsonObject getExtendPreCheck(Date swapDate, CourseTable courseTable, CourseTable swapCourseTable) throws Exception {
|
|
|
+ JsonObject getExtendPreCheck(LocalDate swapDate, CourseTable courseTable, CourseTable swapCourseTable) throws Exception {
|
|
|
JsonParser jsonParser = new JsonParser();
|
|
|
String url = ScheduleUtil.apiUrl + "RescheduleApply/Extend/PreTesting";
|
|
|
JsonObject jsonObject = new JsonObject();
|
|
|
@@ -418,7 +421,7 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
|
|
|
// jsonObject.addProperty("dayOfweek", 5);
|
|
|
jsonObject.addProperty("numberOfday", swapCourseTable.getTimeNumber());
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
- jsonObject.addProperty("date", swapDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().format(formatter));
|
|
|
+ jsonObject.addProperty("date", swapDate.format(formatter));
|
|
|
jsonObject.addProperty("reschduleId", courseTable.getJianyueId());
|
|
|
|
|
|
//获取时间戳
|