Browse Source

教务端试听课安排

Joburgess 5 years ago
parent
commit
c4eb6b5f49

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/DemoGroupDao.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.dao;
 
+import com.ym.mec.biz.dal.dto.EducationDemoGroupListDto;
 import com.ym.mec.biz.dal.dto.StudentDemoGroupListDto;
 import com.ym.mec.biz.dal.dto.TeacherManageDemoGroupListDto;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
@@ -84,5 +85,12 @@ public interface DemoGroupDao extends BaseDAO<Long, DemoGroup> {
      * 统计老师试听课安排
      */
     int countTeacherDemoGroups(Map<String,Object> params);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/27
+     * 根据老师获取本周内的试听课安排
+     */
+    List<EducationDemoGroupListDto> findDemoGroupStartClassTimesWithWeekByTeacherId(Long teacherId);
 	
 }

+ 34 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/EducationDemoGroupListDto.java

@@ -0,0 +1,34 @@
+package com.ym.mec.biz.dal.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/9/27
+ */
+public class EducationDemoGroupListDto {
+
+    @ApiModelProperty(value = "上课日期",required = false)
+    private Date classDate;
+
+    @ApiModelProperty(value = "上课时间",required = false)
+    private String startClassTimes;
+
+    public Date getClassDate() {
+        return classDate;
+    }
+
+    public void setClassDate(Date classDate) {
+        this.classDate = classDate;
+    }
+
+    public String getStartClassTimes() {
+        return startClassTimes;
+    }
+
+    public void setStartClassTimes(String startClassTimes) {
+        this.startClassTimes = startClassTimes;
+    }
+}

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/DemoGroupService.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.dto.DemoGroupApplyDto;
+import com.ym.mec.biz.dal.dto.EducationDemoGroupListDto;
 import com.ym.mec.biz.dal.dto.TeacherManageDemoGroupListDto;
 import com.ym.mec.biz.dal.entity.DemoGroup;
 import com.ym.mec.biz.dal.page.StudentDemoGroupQueryInfo;
@@ -8,6 +9,9 @@ import com.ym.mec.biz.dal.page.TeacherManageDemoGroupQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.BaseService;
+import org.hibernate.validator.constraints.EAN;
+
+import java.util.List;
 
 public interface DemoGroupService extends BaseService<Long, DemoGroup> {
 
@@ -46,4 +50,11 @@ public interface DemoGroupService extends BaseService<Long, DemoGroup> {
      */
     PageInfo findTeacherDemoGroups(TeacherManageDemoGroupQueryInfo queryInfo);
 
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/27
+     *
+     */
+    List<EducationDemoGroupListDto> findDemoGroupStartClassTimesWithWeekByTeacherId(Long teacherID);
+
 }

+ 6 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/DemoGroupServiceImpl.java

@@ -4,6 +4,7 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.DemoGroupApplyDto;
+import com.ym.mec.biz.dal.dto.EducationDemoGroupListDto;
 import com.ym.mec.biz.dal.dto.TeacherManageDemoGroupListDto;
 import com.ym.mec.biz.dal.dto.VipGroupApplyBaseInfoDto;
 import com.ym.mec.biz.dal.entity.*;
@@ -164,4 +165,9 @@ public class DemoGroupServiceImpl extends BaseServiceImpl<Long, DemoGroup>  impl
 		pageInfo.setRows(dataList);
 		return pageInfo;
 	}
+
+	@Override
+	public List<EducationDemoGroupListDto> findDemoGroupStartClassTimesWithWeekByTeacherId(Long teacherID) {
+		return demoGroupDao.findDemoGroupStartClassTimesWithWeekByTeacherId(teacherID);
+	}
 }

+ 12 - 0
mec-biz/src/main/resources/config/mybatis/DemoGroupMapper.xml

@@ -218,4 +218,16 @@ create_time_ = #{createTime},
 		<include refid="teacherDemoGroupsQueryCondition"/>
 		GROUP BY cs.class_date_
 	</select>
+
+	<select id="findDemoGroupStartClassTimesWithWeekByTeacherId" resultType="com.ym.mec.biz.dal.dto.EducationDemoGroupListDto">
+		SELECT
+			class_date_ classDate,
+			GROUP_CONCAT(start_class_time_) startClassTimes
+		FROM
+			course_schedule
+		WHERE
+			YEARWEEK(class_date_) = YEARWEEK( now( ) )
+		GROUP BY class_date_
+	</select>
+
 </mapper>

+ 5 - 0
mec-education/pom.xml

@@ -98,6 +98,11 @@
 			</exclusions>
 		</dependency>
 
+		<dependency>
+			<groupId>com.ym</groupId>
+			<artifactId>mec-biz</artifactId>
+		</dependency>
+
 	</dependencies>
 	<build>
 		<plugins>

+ 32 - 0
mec-education/src/main/java/com/ym/mec/education/controller/EducationDemoGroupController.java

@@ -0,0 +1,32 @@
+package com.ym.mec.education.controller;
+
+import com.ym.mec.biz.dal.page.StudentDemoGroupQueryInfo;
+import com.ym.mec.biz.service.DemoGroupService;
+import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/9/27
+ */
+
+@Api(tags = "试听课-教务端")
+@RequestMapping("educationDemoGroup")
+@RestController
+public class EducationDemoGroupController extends BaseController {
+
+    @Autowired
+    private DemoGroupService demoGroupService;
+
+    @ApiOperation(value = "试听课安排")
+    @PostMapping("/queryStudentDemoGroups")
+    public Object queryTeacherDemoGroups(Long teacherId){
+        return succeed(demoGroupService.findDemoGroupStartClassTimesWithWeekByTeacherId(teacherId));
+    }
+
+}

+ 16 - 0
mec-student/src/main/java/com/ym/mec/student/controller/StudentCourseScheduleController.java

@@ -6,10 +6,13 @@ import com.ym.mec.biz.service.StudentAttendanceService;
 import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
+
 /**
  * @Author Joburgess
  * @Date 2019/9/24
@@ -24,6 +27,19 @@ public class StudentCourseScheduleController extends BaseController {
     @Autowired
     private StudentAttendanceService studentAttendanceService;
 
+    @ApiOperation(value = "根据月份获取乐团在该月有课的日期")
+    @GetMapping("/getCourseScheduleDateByMonth")
+    public Object getCourseScheduleDateByMonth(@ApiParam(value = "乐团编号", required = true) @RequestParam Long musicGroupID,
+                                               @ApiParam(value = "月份", required = true) @RequestParam Date month) {
+        return succeed(scheduleService.getCourseScheduleDateByMonth(musicGroupID,month));
+    }
+
+    @ApiOperation(value = "根据日期获取当日排课")
+    @GetMapping("/getCourseSchedulesWithDate")
+    public Object getCourseSchedulesWithDate(@ApiParam(value = "日期", required = true) Date date){
+        return succeed(scheduleService.getCourseSchedulesWithDate(date));
+    }
+
     @ApiOperation(value = "课时调整")
     @PostMapping(value = "/classStartDateAdjust",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
     public Object classStartDateAdjust(ClassDateAdjustDto classDateAdjustDto){