Переглянути джерело

Merge branch 'zx_online_update_1218' of http://git.dayaedu.com/yonge/cooleshow into zx_online_update_1218

刘俊驰 1 тиждень тому
батько
коміт
34cd62fe3f

+ 3 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/student/controller/StudentCourseScheduleController.java

@@ -8,6 +8,7 @@ import com.yonge.cooleshow.biz.dal.dto.search.PracticeTeacherSearch;
 import com.yonge.cooleshow.biz.dal.entity.CourseCalendarEntity;
 import com.yonge.cooleshow.biz.dal.entity.CourseScheduleReplied;
 import com.yonge.cooleshow.biz.dal.entity.TeacherSubjectPrice;
+import com.yonge.cooleshow.biz.dal.enums.CourseScheduleEnum;
 import com.yonge.cooleshow.biz.dal.service.*;
 import com.yonge.cooleshow.biz.dal.vo.*;
 import com.yonge.cooleshow.biz.dal.wrapper.TeacherFreeTimeWrapper;
@@ -105,12 +106,14 @@ public class StudentCourseScheduleController extends BaseController {
             @ApiImplicitParam(name = "classDate", dataType = "String", required = true, value = "年月"),
             @ApiImplicitParam(name = "courseState", dataType = "String", value = "课程状态 NOT_START未开始 ING进行中 COMPLETE已完成 CANCEL已取消"),
             @ApiImplicitParam(name = "subjectId", dataType = "Long", value = "声部id"),
+            @ApiImplicitParam(name = "courseType", dataType = "String", value = "课程类型"),
             @ApiImplicitParam(name = "page", dataType = "Integer", value = "页数"),
             @ApiImplicitParam(name = "rows", dataType = "Integer", value = "每页数量"),
     })
     @ApiOperation("学生-查询直播课")
     @PostMapping("/queryStudentLiveCourse")
     public HttpResponseResult<PageInfo<CourseStudent>> queryStudentLiveCourse(@RequestBody Map<String, Object> param) {
+        param.put("type", param.get("courseType") == null ? CourseScheduleEnum.LIVE.getCode() : param.get("courseType"));
         return succeed(courseScheduleService.queryStudentLiveCourse(param));
     }
 

+ 2 - 0
cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/CourseHomeworkController.java

@@ -143,7 +143,9 @@ public class CourseHomeworkController extends BaseController {
         list.add(CourseScheduleEnum.PIANO_ROOM_CLASS);
         list.add(CourseScheduleEnum.PRACTICE);
         list.add(CourseScheduleEnum.VIP);
+        list.add(CourseScheduleEnum.GROUP);
         query.setCourseType(list);
+        query.setClientType("TEACHER");
 
         IPage<CourseHomeworkVo> page = courseHomeworkService.selectPage(PageUtil.getPage(query), query);
         if (CollectionUtils.isNotEmpty(page.getRecords())) {

+ 4 - 95
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/HomeworkSearch.java

@@ -7,6 +7,7 @@ import com.yonge.cooleshow.common.enums.YesOrNoEnum;
 import com.yonge.toolset.base.page.QueryInfo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 
 import java.util.Date;
@@ -18,6 +19,7 @@ import java.util.List;
  * @author liujunchi
  * @date 2022-04-13
  */
+@Data
 @ApiModel("课后作业查询条件")
 public class HomeworkSearch extends QueryInfo {
 
@@ -61,99 +63,6 @@ public class HomeworkSearch extends QueryInfo {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date endTime;
 
-    public HomeworkStatusEnum getHomeworkStatus() {
-        return homeworkStatus;
-    }
-
-    public void setHomeworkStatus(HomeworkStatusEnum homeworkStatus) {
-        this.homeworkStatus = homeworkStatus;
-    }
-
-    public Long getCourseScheduleId() {
-        return courseScheduleId;
-    }
-
-    public void setCourseScheduleId(Long courseScheduleId) {
-        this.courseScheduleId = courseScheduleId;
-    }
-
-    public Long getTeacherId() {
-        return teacherId;
-    }
-
-    public void setTeacherId(Long teacherId) {
-        this.teacherId = teacherId;
-    }
-
-    public List<CourseScheduleEnum> getCourseType() {
-        return courseType;
-    }
-
-    public void setCourseType(List<CourseScheduleEnum> courseType) {
-        this.courseType = courseType;
-    }
-
-    public CourseScheduleEnum getCourseStatus() {
-        return courseStatus;
-    }
-
-    public void setCourseStatus(CourseScheduleEnum courseStatus) {
-        this.courseStatus = courseStatus;
-    }
-
-    public YesOrNoEnum getDecorate() {
-        return decorate;
-    }
-
-    public void setDecorate(YesOrNoEnum decorate) {
-        this.decorate = decorate;
-    }
-
-    public String getDate() {
-        return date;
-    }
-
-    public void setDate(String date) {
-        this.date = date;
-    }
-
-    public YesOrNoEnum getSubmit() {
-        return submit;
-    }
-
-    public void setSubmit(YesOrNoEnum submit) {
-        this.submit = submit;
-    }
-
-    public Long getStudentId() {
-        return studentId;
-    }
-
-    public void setStudentId(Long studentId) {
-        this.studentId = studentId;
-    }
-
-    public String getSearch() {
-        return search;
-    }
-
-    public void setSearch(String search) {
-        this.search = search;
-    }
-
-    public Date getStartTime() {
-        return startTime;
-    }
-
-    public void setStartTime(Date startTime) {
-        this.startTime = startTime;
-    }
-
-    public Date getEndTime() {
-        return endTime;
-    }
-
-    public void setEndTime(Date endTime) {
-        this.endTime = endTime;
-    }
+    @ApiModelProperty("客户端")
+    private String clientType;
 }

+ 1 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseGroupServiceImpl.java

@@ -426,7 +426,7 @@ public class CourseGroupServiceImpl extends ServiceImpl<CourseGroupDao, CourseGr
             Map<Long, com.yonge.cooleshow.biz.dal.entity.SysUser> userMap = sysUserService.getMapByIds(userIds);
             for (CourseGroupWrapper.TeacherCourseGroupDto e : records) {
                 e.setSubjectName(subjectMap.get(e.getSubjectId()));
-                if(StringUtils.equals(query.getCourseType(),"PIANO_ROOM_CLASS")){
+                if(StringUtils.equals(query.getCourseType(),"PIANO_ROOM_CLASS") || StringUtils.equals(query.getCourseType(),"GROUP")){
                     List<CourseScheduleStudentPayment> studentPayments = map.get(e.getCourseGroupId());
                     if(CollectionUtils.isNotEmpty(studentPayments)){
                         List<Long> studentIds = studentPayments.stream().map(CourseScheduleStudentPayment::getUserId).distinct().collect(Collectors.toList());

+ 12 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CourseScheduleServiceImpl.java

@@ -54,6 +54,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.text.SimpleDateFormat;
@@ -149,6 +150,8 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
     private TeacherAttendanceService teacherAttendanceService;
     @Autowired
     private SubjectService subjectService;
+    @Resource
+    private CoursePlanService coursePlanService;
 
     @Override
     public CourseScheduleDao getDao() {
@@ -1125,7 +1128,6 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
     @Override
     public PageInfo<CourseStudent> queryStudentLiveCourse(Map<String, Object> param) {
         //本月的最后一天
-        param.put("type", CourseScheduleEnum.LIVE.getCode());
         param.put("orderState", OrderStatusEnum.PAID.getCode());
         Page<CourseStudent> pageInfo = PageUtil.getPageInfo(param);
         return PageUtil.pageInfo(baseMapper.queryStudentLiveCourse(pageInfo, param));
@@ -2883,6 +2885,11 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
         List<CourseScheduleWrapper.MyCourseVo> courseVos = Lists.newArrayList();
         CourseGroup courseGroup = courseGroupService.lambdaQuery().eq(CourseGroup::getId, query.getCourseGroupId()).one();
         Subject subject = subjectService.get(courseGroup.getSubjectId());
+        List<LiveCourseInfoVo.PlanVo> planVos = coursePlanService.queryCoursePlanByGroupId(courseGroup.getId());
+        Map<Long, LiveCourseInfoVo.PlanVo> planMap = new HashMap<>();
+        if(CollectionUtils.isNotEmpty(planVos)){
+            planMap = planVos.stream().collect(Collectors.toMap(LiveCourseInfoVo.PlanVo::getId, Function.identity()));
+        }
         for (CourseSchedule courseSchedule : courseSchedules) {
             CourseScheduleWrapper.MyCourseVo courseVo = new CourseScheduleWrapper.MyCourseVo();
             courseVo.setCourseId(courseSchedule.getId());
@@ -2894,6 +2901,10 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleDao, Co
             courseVo.setCourseGroupName(courseGroup.getName() + "-第" + courseSchedule.getClassNum() + "课");
             courseVo.setSubjectId(courseGroup.getSubjectId());
             courseVo.setSubjectName(subject.getName());
+            LiveCourseInfoVo.PlanVo planVo = planMap.get(courseSchedule.getId());
+            if(planVo != null){
+                courseVo.setCoursePlan(planVo.getPlan());
+            }
             if(query.getAttendanceStatus() == null){
                 courseVo.setAttendanceStatus(attendanceList.stream().anyMatch(studentAttendance -> studentAttendance.getCourseScheduleId().equals(courseSchedule.getId())));
             }else {

+ 3 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/course/CourseScheduleWrapper.java

@@ -70,6 +70,9 @@ public class CourseScheduleWrapper {
         @ApiModelProperty(value = "声部名称")
         private String subjectName;
 
+        @ApiModelProperty(value = "课程规划")
+        private String coursePlan;
+
         @ApiModelProperty(value = "学员列表")
         private List<CourseStudentVo> courseStudentVos;
     }

+ 11 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseHomeworkMapper.xml

@@ -106,6 +106,14 @@
         left join course_homework ch on ch.course_schedule_id_ = cs.id_
         left join course_schedule_student_payment cssp on cssp.course_id_ = cs.id_
         left join student_course_homework sch  on sch.course_schedule_id_ = cssp.course_id_ and sch.student_id_ = cssp.user_id_
+        <if test="param.search != null and param.search != ''">
+            <if test="param.clientType == 'TEACHER'">
+                left join sys_user su on su.id_ = cs.teacher_id_
+            </if>
+            <if test="param.clientType == 'STUDENT'">
+                left join sys_user su on su.id_ = cssp.user_id_
+            </if>
+        </if>
         left join (select cssp.course_id_,
                 count(cssp.id_) as studentNum,
                 sum(if(sch.attachments_ is null or sch.attachments_ = '',0,1)) as commitNum,
@@ -128,6 +136,9 @@
                     and ch.id_ is not null
                 </if>
             </if>
+            <if test="param.search != null and param.search != ''">
+                and su.username_ like concat('%',#{param.search},'%')
+            </if>
             <if test="param.submit != null">
                 <if test="param.submit.code == 0">
                     and sch.id_ is null