|
@@ -185,10 +185,6 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
|
|
|
Date now=new Date();
|
|
|
|
|
|
int studentExitChargePractices = practiceGroupDao.checkStudentExitChargePractice(practiceGroupBuyParams.getStudentId());
|
|
|
- Integer buyMonths=practiceGroupBuyParams.getBuyMonths();
|
|
|
- if(!now.before(practicePromotionActivityStartDate)&&now.before(practiceBuyActivityExpireDate)&&studentExitChargePractices<=0){
|
|
|
- practiceGroupBuyParams.setBuyMonths(2);
|
|
|
- }
|
|
|
|
|
|
LocalDate courseStartDay=LocalDate.now();
|
|
|
LocalDate tempCourseLocalDate=LocalDate.parse("2020-03-01", DateUtil.dateFormatter);
|
|
@@ -291,7 +287,10 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
|
|
|
}else{
|
|
|
oneMonthPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceOriginalPrice():practiceGroupSellPrice.getTwiceOriginalPrice();
|
|
|
}
|
|
|
- BigDecimal amount= oneMonthPrice.multiply(new BigDecimal(buyMonths));
|
|
|
+ BigDecimal amount= oneMonthPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
|
|
|
+ if(!now.before(practicePromotionActivityStartDate)&&studentExitChargePractices<=0){
|
|
|
+ amount= oneMonthPrice.multiply(new BigDecimal(1));
|
|
|
+ }
|
|
|
|
|
|
practiceGroupBuyParams.setDrillTimesJson(drillTimesObject.toJSONString());
|
|
|
practiceGroupBuyParams.setOrganId(sysUser.getOrganId());
|
|
@@ -889,9 +888,6 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
|
|
|
weekNumApplyTimesMap.put(courseStartTime.getDayOfWeek().getValue(), applyTimeStrs);
|
|
|
}
|
|
|
}
|
|
|
- if(weekNumApplyTimesMap.size()<=1){
|
|
|
- weekNumApplyTimesMap=new HashMap<>();
|
|
|
- }
|
|
|
result.put("teacherFreeDays", weekNumApplyTimesMap);
|
|
|
return result;
|
|
|
}
|
|
@@ -919,6 +915,11 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
|
|
|
return BaseController.failed(HttpStatus.EXPECTATION_FAILED, "指定的学生已存在三组试听课");
|
|
|
}
|
|
|
|
|
|
+ int studentIngTrialPracticeNum = practiceGroupDao.countStudentIngTrialPractices(practiceGroupBuyParams.getStudentId());
|
|
|
+ if(studentIngTrialPracticeNum>0){
|
|
|
+ return BaseController.failed(HttpStatus.EXPECTATION_FAILED, "该学员存在进行中的试听课,无法创建");
|
|
|
+ }
|
|
|
+
|
|
|
int stn = practiceGroupDao.countStudentAndTeacherTrialPractices(practiceGroupBuyParams.getStudentId(), practiceGroupBuyParams.getUserId());
|
|
|
if(stn>0){
|
|
|
return BaseController.failed(HttpStatus.EXPECTATION_FAILED, "请给该学生分配不同的指导老师");
|
|
@@ -1140,6 +1141,16 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
|
|
|
+ List<ImGroupMember> imGroupMemberList = new ArrayList<>();
|
|
|
+ if(Objects.nonNull(practiceGroupBuyParams.getEducationalTeacherId())){
|
|
|
+ imGroupMemberList.add(new ImGroupMember(practiceGroupBuyParams.getEducationalTeacherId().toString()));
|
|
|
+ }
|
|
|
+ imGroupMemberList.add(new ImGroupMember(practiceGroupBuyParams.getUserId().toString()));
|
|
|
+ imGroupMemberList.add(new ImGroupMember(practiceGroupBuyParams.getStudentId().toString()));
|
|
|
+ ImGroupMember[] imGroupMembers = imGroupMemberList.toArray(new ImGroupMember[imGroupMemberList.size()]);
|
|
|
+ // 创建群组
|
|
|
+ imFeignService.groupCreate(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName()));
|
|
|
+
|
|
|
return BaseController.succeed();
|
|
|
}
|
|
|
|
|
@@ -1156,6 +1167,8 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
|
|
|
Map<String, Object> result=new HashMap<>();
|
|
|
result.put("existNoMemoGroup", existNoMemoGroup);
|
|
|
result.put("practices", studentTrialPractices);
|
|
|
+ int studentIngTrialPracticeNum = practiceGroupDao.countStudentIngTrialPractices(studentId);
|
|
|
+ result.put("existIngTrialPractices", studentIngTrialPracticeNum>0?1:0);
|
|
|
return result;
|
|
|
}
|
|
|
}
|