|
@@ -3835,17 +3835,19 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
for (PracticeCourseDto userPracticeGroup : userPracticeGroups) {
|
|
for (PracticeCourseDto userPracticeGroup : userPracticeGroups) {
|
|
JSONArray coursesArry = new JSONArray();
|
|
JSONArray coursesArry = new JSONArray();
|
|
JSONObject courseJson = JSON.parseObject(userPracticeGroup.getDrillTimesJson());
|
|
JSONObject courseJson = JSON.parseObject(userPracticeGroup.getDrillTimesJson());
|
|
- for (String weekNumStr : courseJson.keySet()) {
|
|
|
|
- JSONObject newCourseJson = new JSONObject();
|
|
|
|
- newCourseJson.put("weekName", DateUtil.weekNumNormalWeekNameMap.get(Integer.parseInt(weekNumStr)));
|
|
|
|
- LocalTime courseStartTime = LocalTime.parse(courseJson.getString(weekNumStr), DateUtil.timeFormatter);
|
|
|
|
- LocalTime courseEndTime = courseStartTime.plusMinutes(practiceCourseMinutes);
|
|
|
|
- if(PracticeGroupType.COME_ON_PACKAGE.equals(userPracticeGroup.getType())){
|
|
|
|
- courseEndTime = courseStartTime.plusMinutes(2*practiceCourseMinutes);
|
|
|
|
|
|
+ if(courseJson != null){
|
|
|
|
+ for (String weekNumStr : courseJson.keySet()) {
|
|
|
|
+ JSONObject newCourseJson = new JSONObject();
|
|
|
|
+ newCourseJson.put("weekName", DateUtil.weekNumNormalWeekNameMap.get(Integer.parseInt(weekNumStr)));
|
|
|
|
+ LocalTime courseStartTime = LocalTime.parse(courseJson.getString(weekNumStr), DateUtil.timeFormatter);
|
|
|
|
+ LocalTime courseEndTime = courseStartTime.plusMinutes(practiceCourseMinutes);
|
|
|
|
+ if(PracticeGroupType.COME_ON_PACKAGE.equals(userPracticeGroup.getType())){
|
|
|
|
+ courseEndTime = courseStartTime.plusMinutes(2*practiceCourseMinutes);
|
|
|
|
+ }
|
|
|
|
+ newCourseJson.put("startTime", courseStartTime.format(DateUtil.timeFormatter));
|
|
|
|
+ newCourseJson.put("endTime", courseEndTime.format(DateUtil.timeFormatter));
|
|
|
|
+ coursesArry.add(newCourseJson);
|
|
}
|
|
}
|
|
- newCourseJson.put("startTime", courseStartTime.format(DateUtil.timeFormatter));
|
|
|
|
- newCourseJson.put("endTime", courseEndTime.format(DateUtil.timeFormatter));
|
|
|
|
- coursesArry.add(newCourseJson);
|
|
|
|
}
|
|
}
|
|
userPracticeGroup.setDrillTimesJson(coursesArry.toJSONString());
|
|
userPracticeGroup.setDrillTimesJson(coursesArry.toJSONString());
|
|
}
|
|
}
|