Prechádzať zdrojové kódy

1、网管课初始类型

Joburgess 5 rokov pred
rodič
commit
3e40ef5994

+ 23 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/PracticeGroupDao.java

@@ -1,9 +1,6 @@
 package com.ym.mec.biz.dal.dao;
 
-import com.ym.mec.biz.dal.dto.CourseGroupExportDto;
-import com.ym.mec.biz.dal.dto.PracticeCourseDto;
-import com.ym.mec.biz.dal.dto.PracticeGroupDto;
-import com.ym.mec.biz.dal.dto.StudentBuyPracticeDto;
+import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.entity.CourseScheduleEvaluate;
 import com.ym.mec.biz.dal.entity.PracticeGroup;
@@ -236,4 +233,26 @@ public interface PracticeGroupDao extends com.ym.mec.common.dal.BaseDAO<Long, Pr
      * @return
      */
     List<CourseGroupExportDto> getPracticeGroupExport(@Param("organIds") String organIds);
+
+    /**
+     * @describe 获取转化失败的学员-之前有免费网管课,但是之后没有线上课的学员
+     * @author Joburgess
+     * @date 2020/4/23
+     * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>
+     */
+    List<SimpleUserDto> findConvertDefeatStudents(Map<String, Object> params);
+    int countConvertDefeatStudents(Map<String, Object> params);
+
+    /**
+     * @describe 获取可以指派试听课的老师列表
+     * @author Joburgess
+     * @date 2020/4/23
+     * @param studentOrganId: 学生分部编号
+     * @param subjectId: 声部编号
+     * @param studentId: 学生编号
+     * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>
+     */
+    List<SimpleUserDto> findEnableAssignTeachers(@Param("studentOrganId") Integer studentOrganId,
+                                                 @Param("subjectId") Integer subjectId,
+                                                 @Param("studentId") Integer studentId);
 }

+ 17 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/EduPracticeGroupService.java

@@ -1,8 +1,12 @@
 package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.dto.PracticeGroupBuyDto;
+import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
 import com.ym.mec.common.entity.HttpResponseResult;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * @Author Joburgess
@@ -29,4 +33,17 @@ public interface EduPracticeGroupService {
      */
     void orderCallback(StudentPaymentOrder order);
 
+    /**
+     * @describe 获取可以指派试听课的老师列表
+     * @author Joburgess
+     * @date 2020/4/23
+     * @param studentOrganId: 学生分部编号
+     * @param subjectId: 声部编号
+     * @param studentId: 学生编号
+     * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>
+     */
+    List<SimpleUserDto> findEnableAssignTeachers(@Param("studentOrganId") Integer studentOrganId,
+                                                 @Param("subjectId") Integer subjectId,
+                                                 @Param("studentId") Integer studentId);
+
 }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/PracticeGroupService.java

@@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.page.PracticeGroupQueryInfo;
 import com.ym.mec.biz.dal.page.StudentBuyPracticeQueryInfo;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.BaseService;
 
 import java.util.Date;
@@ -276,4 +277,13 @@ public interface PracticeGroupService extends BaseService<Long, PracticeGroup> {
 	 * @return
 	 */
 	PageInfo<StudentBuyPracticeDto> studentBuys(StudentBuyPracticeQueryInfo queryInfo);
+
+	/**
+	 * @describe 获取转化失败的学员列表
+	 * @author Joburgess
+	 * @date 2020/4/23
+	 * @param queryInfo:
+	 * @return com.ym.mec.common.page.PageInfo<com.ym.mec.biz.dal.dto.SimpleUserDto>
+	 */
+	PageInfo<SimpleUserDto> findConvertDefeatStudents(QueryInfo queryInfo);
 }

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

@@ -6,6 +6,7 @@ import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.PracticeDrillTimeDto;
 import com.ym.mec.biz.dal.dto.PracticeGroupBuyDto;
+import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.service.*;
@@ -585,4 +586,9 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
         imFeignService.groupCreate(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName()));
     }
 
+    @Override
+    public List<SimpleUserDto> findEnableAssignTeachers(Integer studentOrganId, Integer subjectId, Integer studentId) {
+        Teacher student = teacherDao.get(studentId);
+        return practiceGroupDao.findEnableAssignTeachers(student.getOrganId(), subjectId, studentId);
+    }
 }

+ 18 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java

@@ -20,6 +20,7 @@ import com.ym.mec.common.entity.ImGroupMember;
 import com.ym.mec.common.entity.ImGroupModel;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.IdGeneratorService;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.im.ImFeignService;
@@ -3590,4 +3591,21 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         pageInfo.setRows(dataList);
         return pageInfo;
     }
+
+    @Override
+    public PageInfo<SimpleUserDto> findConvertDefeatStudents(QueryInfo queryInfo) {
+        PageInfo pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+        Map<String, Object> params = new HashMap<>();
+        MapUtil.populateMap(params, queryInfo);
+
+        List<SimpleUserDto> dataList = new ArrayList<>();
+        int count = practiceGroupDao.countConvertDefeatStudents(params);
+        if (count > 0) {
+            pageInfo.setTotal(count);
+            params.put("offset", pageInfo.getOffset());
+            dataList = practiceGroupDao.findConvertDefeatStudents(params);
+        }
+        pageInfo.setRows(dataList);
+        return pageInfo;
+    }
 }

+ 47 - 0
mec-biz/src/main/resources/config/mybatis/PracticeGroupMapper.xml

@@ -502,4 +502,51 @@
         </if>
         GROUP BY pg.student_id_,o.id_
     </select>
+
+    <select id="findConvertDefeatStudents" resultType="com.ym.mec.biz.dal.dto.SimpleUserDto">
+        SELECT
+            DISTINCT su.id_ userId,su.username_ userName, su.avatar_ avatar, su.phone_ phone
+        FROM
+            practice_group pg
+            LEFT JOIN sys_user su ON pg.student_id_ = su.id_
+        WHERE
+            pg.type_='FREE'
+            <if test="search != null">
+                AND (su.username_ LIKE CONCAT('%', #{search}, '%') OR su.phone_ LIKE CONCAT('%', #{search}, '%'))
+            </if>
+            AND pg.student_id_ NOT IN (
+                SELECT student_id_ FROM practice_group WHERE type_='CHARGE'
+            )
+            AND NOT EXISTS (
+                SELECT user_id_ FROM course_schedule_student_payment cssp LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_ WHERE cssp.user_id_=pg.student_id_ AND cs.teach_mode_='ONLINE' AND cs.class_date_>'2020-05-01'
+            )
+        <include refid="global.limit"/>
+    </select>
+    <select id="countConvertDefeatStudents" resultType="int">
+        SELECT
+            COUNT(DISTINCT su.id_)
+        FROM
+            practice_group pg
+            LEFT JOIN sys_user su ON pg.student_id_ = su.id_
+        WHERE
+            pg.type_='FREE'
+            <if test="search != null">
+                AND (su.username_ LIKE CONCAT('%', #{search}, '%') OR su.phone_ LIKE CONCAT('%', #{search}, '%'))
+            </if>
+            AND pg.student_id_ NOT IN (
+                SELECT student_id_ FROM practice_group WHERE type_='CHARGE'
+            )
+            AND NOT EXISTS (
+                SELECT user_id_ FROM course_schedule_student_payment cssp LEFT JOIN course_schedule cs ON cs.id_=cssp.course_schedule_id_ WHERE cssp.user_id_=pg.student_id_ AND cs.teach_mode_='ONLINE' AND cs.class_date_>'2020-05-01'
+            )
+    </select>
+    <select id="findEnableAssignTeachers" resultType="com.ym.mec.biz.dal.dto.SimpleUserDto">
+        SELECT su.id_ userId,su.username_ userName,su.avatar_ avatar
+        FROM teacher t
+          LEFT JOIN sys_user su ON t.id_=su.id_
+        WHERE
+            FIND_IN_SET(#{subjectId}, t.subject_id_)
+            AND (t.organ_id_ = #{studentOrganId} OR FIND_IN_SET(#{studentOrganId},t.flow_organ_range_))
+            AND NOT EXISTS (SELECT user_id_ FROM practice_group WHERE student_id_=#{studentId} AND t.id_=user_id_ AND type_='TRIAL')
+    </select>
 </mapper>

+ 11 - 0
mec-web/src/main/java/com/ym/mec/web/controller/education/EduPracticeGroupController.java

@@ -13,6 +13,7 @@ import com.ym.mec.biz.service.StudentService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
@@ -181,4 +182,14 @@ public class EduPracticeGroupController extends BaseController {
         return practiceGroupService.cancelWaitPayOrder(studentId, groupId);
     }
 
+    @ApiOperation("获取转化失败的学员列表")
+    @GetMapping(value = "/findConvertDefeatStudents")
+    public HttpResponseResult findConvertDefeatStudents(QueryInfo queryInfo){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+        return succeed(practiceGroupService.findConvertDefeatStudents(queryInfo));
+    }
+
 }