|
@@ -11,6 +11,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
|
import com.ym.mec.biz.dal.dto.*;
|
|
|
+import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.enums.GroupType;
|
|
|
import com.ym.mec.biz.dal.enums.ImSendTypeEnum;
|
|
|
import com.ym.mec.common.entity.ImPrivateMessage;
|
|
@@ -24,15 +25,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
-import com.ym.mec.biz.dal.entity.ClassGroup;
|
|
|
-import com.ym.mec.biz.dal.entity.CourseHomework;
|
|
|
-import com.ym.mec.biz.dal.entity.CourseSchedule;
|
|
|
-import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
|
|
|
-import com.ym.mec.biz.dal.entity.CourseScheduleReview;
|
|
|
-import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
|
|
|
-import com.ym.mec.biz.dal.entity.PracticeGroup;
|
|
|
-import com.ym.mec.biz.dal.entity.StudentCourseHomework;
|
|
|
-import com.ym.mec.biz.dal.entity.Teacher;
|
|
|
import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.YesOrNoEnum;
|
|
|
import com.ym.mec.biz.dal.page.CourseReview4EduQueryInfo;
|
|
@@ -104,7 +96,7 @@ public class CourseReviewServiceImpl extends BaseServiceImpl<Integer, CourseSche
|
|
|
private SysConfigDao sysConfigDao;
|
|
|
|
|
|
@Autowired
|
|
|
- private RedisCache<String, Object> redisCache;
|
|
|
+ private VipGroupDao vipGroupDao;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Integer, CourseScheduleReview> getDAO() {
|
|
@@ -114,7 +106,7 @@ public class CourseReviewServiceImpl extends BaseServiceImpl<Integer, CourseSche
|
|
|
|
|
|
@Override
|
|
|
public PageInfo<CourseReviewDto> findPracticeGroupReviews(CourseReviewQueryInfo queryInfo) {
|
|
|
- PageInfo pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
+ PageInfo<CourseReviewDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
MapUtil.populateMap(params, queryInfo);
|
|
|
|
|
@@ -178,15 +170,24 @@ public class CourseReviewServiceImpl extends BaseServiceImpl<Integer, CourseSche
|
|
|
|
|
|
studentDao.lockUser(courseScheduleReview.getTeacherId());
|
|
|
|
|
|
- PracticeGroup practiceGroup = practiceGroupDao.get(Long.parseLong(courseSchedule.getMusicGroupId()));
|
|
|
+ Integer studentId = null;
|
|
|
+ Integer educationalTeacherId = null;
|
|
|
|
|
|
- CourseScheduleReview hasReview = courseScheduleReviewDao.findByCourseScheduleAndStudent(courseScheduleId.longValue(), practiceGroup.getStudentId());
|
|
|
+ if(courseSchedule.getType().equals(CourseSchedule.CourseScheduleType.PRACTICE)){
|
|
|
+ PracticeGroup practiceGroup = practiceGroupDao.get(Long.parseLong(courseSchedule.getMusicGroupId()));
|
|
|
+ studentId = practiceGroup.getStudentId();
|
|
|
+ educationalTeacherId = practiceGroup.getEducationalTeacherId();
|
|
|
+ }else if(courseSchedule.getType().equals(CourseSchedule.CourseScheduleType.VIP)){
|
|
|
+ VipGroup vipGroup = vipGroupDao.get(Long.parseLong(courseSchedule.getMusicGroupId()));
|
|
|
+ educationalTeacherId = vipGroup.getEducationalTeacherId();
|
|
|
+ }
|
|
|
+ CourseScheduleReview hasReview = courseScheduleReviewDao.findByCourseScheduleAndStudent(courseScheduleId.longValue(), studentId);
|
|
|
if (hasReview != null) {
|
|
|
throw new BizException("评论已提交,请勿重复提交");
|
|
|
}
|
|
|
courseScheduleReview.setClassGroupId(courseSchedule.getClassGroupId());
|
|
|
- courseScheduleReview.setEducationalTeacherId(practiceGroup.getEducationalTeacherId());
|
|
|
- courseScheduleReview.setStudentId(practiceGroup.getStudentId());
|
|
|
+ courseScheduleReview.setEducationalTeacherId(educationalTeacherId);
|
|
|
+ courseScheduleReview.setStudentId(studentId);
|
|
|
courseScheduleReview.setCreateTime(date);
|
|
|
courseScheduleReview.setUpdateTime(date);
|
|
|
long num = courseScheduleReviewDao.insert(courseScheduleReview);
|
|
@@ -508,4 +509,24 @@ public class CourseReviewServiceImpl extends BaseServiceImpl<Integer, CourseSche
|
|
|
}
|
|
|
return reviewInfoDto;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageInfo<CourseReviewDto> findOnlineCourseReviews(CourseReviewQueryInfo queryInfo) {
|
|
|
+ PageInfo<CourseReviewDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ MapUtil.populateMap(params, queryInfo);
|
|
|
+
|
|
|
+ List<CourseReviewDto> dataList = null;
|
|
|
+ int count = courseScheduleReviewDao.countOnlineCourseReviews(params);
|
|
|
+ if (count > 0) {
|
|
|
+ pageInfo.setTotal(count);
|
|
|
+ params.put("offset", pageInfo.getOffset());
|
|
|
+ dataList = courseScheduleReviewDao.getOnlineCourseReviewList(params);
|
|
|
+ }
|
|
|
+ if (count == 0) {
|
|
|
+ dataList = new ArrayList<>();
|
|
|
+ }
|
|
|
+ pageInfo.setRows(dataList);
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
}
|