ソースを参照

学生管理部分模块

Joburgess 5 年 前
コミット
21887fa967

+ 6 - 0
mec-web/src/main/java/com/ym/mec/web/controller/system/StudentManageController.java

@@ -53,4 +53,10 @@ public class StudentManageController extends BaseController {
         return succeed(studentManageService.findStudentAttendances(queryInfo));
     }
 
+    @ApiOperation(value = "获取学生vip课")
+    @PostMapping("/findStudentVipGroups")
+    public Object findStudentVipGroups(Long userId){
+        return succeed(studentManageService.findStudentVipGroups(userId));
+    }
+
 }

+ 10 - 1
mec-web/src/main/java/com/ym/mec/web/dal/dao/VipGroupDao.java

@@ -1,9 +1,18 @@
 package com.ym.mec.web.dal.dao;
 
 import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.web.dal.dto.StudentManageVipGroupDto;
 import com.ym.mec.web.dal.entity.VipGroup;
 
+import java.util.List;
+
 public interface VipGroupDao extends BaseDAO<Long, VipGroup> {
 
-	
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/20
+     * 获取对应学生vip课
+     */
+	List<StudentManageVipGroupDto> findStudentVipGroups(Long userID);
+
 }

+ 22 - 0
mec-web/src/main/java/com/ym/mec/web/dal/dto/StudentManageVipGroupDto.java

@@ -0,0 +1,22 @@
+package com.ym.mec.web.dal.dto;
+
+import com.ym.mec.web.dal.entity.VipGroup;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/9/20
+ */
+public class StudentManageVipGroupDto extends VipGroup {
+
+    @ApiModelProperty(value = "课程类型",required = false)
+    private String vipGroupCategory;
+
+    public String getVipGroupCategory() {
+        return vipGroupCategory;
+    }
+
+    public void setVipGroupCategory(String vipGroupCategory) {
+        this.vipGroupCategory = vipGroupCategory;
+    }
+}

+ 11 - 0
mec-web/src/main/java/com/ym/mec/web/dal/page/StudentManageCourseQueryInfo.java

@@ -14,6 +14,9 @@ public class StudentManageCourseQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "学生id",required = true)
     private Long studentId;
 
+    @ApiModelProperty(value = "vip课程ID",required = false)
+    private Long vipGroupId;
+
     @ApiModelProperty(value = "乐团ID",required = true)
     private Long musicGroupId;
 
@@ -29,6 +32,14 @@ public class StudentManageCourseQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "老师名称",required = false)
     private String teacherName;
 
+    public Long getVipGroupId() {
+        return vipGroupId;
+    }
+
+    public void setVipGroupId(Long vipGroupId) {
+        this.vipGroupId = vipGroupId;
+    }
+
     public Long getStudentId() {
         return studentId;
     }

+ 8 - 0
mec-web/src/main/java/com/ym/mec/web/service/StudentManageService.java

@@ -3,6 +3,7 @@ package com.ym.mec.web.service;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.web.dal.dto.StudentManageBaseDto;
 import com.ym.mec.web.dal.dto.StudentManageBaseInfoOfMusicGroupDto;
+import com.ym.mec.web.dal.dto.StudentManageVipGroupDto;
 import com.ym.mec.web.dal.page.StudentManageAttendanceQueryInfo;
 import com.ym.mec.web.dal.page.StudentManageCourseQueryInfo;
 import com.ym.mec.web.dal.page.StudentManageQueryInfo;
@@ -50,4 +51,11 @@ public interface StudentManageService {
      */
     PageInfo findStudentAttendances(StudentManageAttendanceQueryInfo queryInfo);
 
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/20
+     * 获取学生vip课
+     */
+    List<StudentManageVipGroupDto> findStudentVipGroups(Long userID);
+
 }

+ 9 - 0
mec-web/src/main/java/com/ym/mec/web/service/impl/StudentManageServiceImpl.java

@@ -5,9 +5,11 @@ import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.web.dal.dao.StudentManageDao;
+import com.ym.mec.web.dal.dao.VipGroupDao;
 import com.ym.mec.web.dal.dto.StudentManageBaseDto;
 import com.ym.mec.web.dal.dto.StudentManageBaseInfoOfMusicGroupDto;
 import com.ym.mec.web.dal.dto.StudentManageListDto;
+import com.ym.mec.web.dal.dto.StudentManageVipGroupDto;
 import com.ym.mec.web.dal.page.StudentManageAttendanceQueryInfo;
 import com.ym.mec.web.dal.page.StudentManageCourseQueryInfo;
 import com.ym.mec.web.dal.page.StudentManageQueryInfo;
@@ -31,6 +33,8 @@ public class StudentManageServiceImpl implements StudentManageService {
     private StudentManageDao studentManageDao;
     @Autowired
     private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private VipGroupDao vipGroupDao;
 
     @Override
     public PageInfo findStudentsByOrganId(StudentManageQueryInfo queryInfo) {
@@ -108,4 +112,9 @@ public class StudentManageServiceImpl implements StudentManageService {
         pageInfo.setRows(dataList);
         return pageInfo;
     }
+
+    @Override
+    public List<StudentManageVipGroupDto> findStudentVipGroups(Long userID) {
+        return vipGroupDao.findStudentVipGroups(userID);
+    }
 }

+ 9 - 0
mec-web/src/main/resources/config/mybatis/StudentManageDao.xml

@@ -171,6 +171,9 @@
             <if test="teacherName!=null">
                 and su.username_ like CONCAT("%",#{teacherName},"%")
             </if>
+            <if test="vipGroupId!=null">
+                and vgcgm.vip_group_id_=#{vipGroupId}
+            </if>
         </where>
     </sql>
 
@@ -185,6 +188,9 @@
         FROM
             class_group cg
             LEFT JOIN class_group_student_mapper cgsm ON cg.id_=cgsm.class_group_id_
+            <if test="vipGroupId!=null">
+                LEFT JOIN vip_group_class_group_mapper vgcgm ON cgsm.class_group_id_=vgcgm.class_group_id_
+            </if>
             LEFT JOIN course_schedule cs ON cg.id_=cs.class_group_id_
             LEFT JOIN sys_user su ON cs.teacher_id_=su.id_
         <include refid="studentManageCourseQueryCondition"/>
@@ -198,6 +204,9 @@
         FROM
         class_group cg
         LEFT JOIN class_group_student_mapper cgsm ON cg.id_=cgsm.class_group_id_
+        <if test="vipGroupId!=null">
+            LEFT JOIN vip_group_class_group_mapper vgcgm ON cgsm.class_group_id_=vgcgm.class_group_id_
+        </if>
         LEFT JOIN course_schedule cs ON cg.id_=cs.class_group_id_
         LEFT JOIN sys_user su ON cs.teacher_id_=su.id_
         <include refid="studentManageCourseQueryCondition"/>

+ 16 - 0
mec-web/src/main/resources/config/mybatis/VipGroupMapper.xml

@@ -20,11 +20,27 @@
         <result column="offline_classes_num_" property="offlineClassesNum"/>
     </resultMap>
 
+    <resultMap id="studentManageVipGroup" type="com.ym.mec.web.dal.dto.StudentManageVipGroupDto" extends="VipGroup">
+        <result property="vipGroupCategory" column="vip_group_category_"/>
+    </resultMap>
+
     <!-- 根据主键查询一条记录 -->
     <select id="get" resultMap="VipGroup">
 		SELECT * FROM vip_group WHERE id_ = #{id} 
 	</select>
 
+    <select id="findStudentVipGroups" resultMap="studentManageVipGroup">
+        SELECT
+            vg.*,
+            vgc.name_ vip_group_category_
+        FROM
+            class_group_student_mapper cgsm
+            LEFT JOIN vip_group_class_group_mapper vgcgm ON cgsm.class_group_id_=vgcgm.class_group_id_
+            LEFT JOIN vip_group vg ON vgcgm.vip_group_id_=vg.id_
+            LEFT JOIN vip_group_category vgc ON vg.vip_group_category_id_=vgc.id_
+        WHERE cgsm.class_group_id_=vgcgm.class_group_id_ AND cgsm.user_id_=#{userID}
+    </select>
+
     <!-- 全查询 -->
     <select id="findAll" resultMap="VipGroup">
 		SELECT * FROM vip_group ORDER BY id_