Bläddra i källkod

删除运营指标列表studentManage/getOperatingStudents
删除运营指标导出export/operatingStudents

zouxuan 2 år sedan
förälder
incheckning
5bd947a648

+ 0 - 16
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java

@@ -36,22 +36,6 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
     int batchUpdate(@Param("studentList") List<Student> studentList);
 
     /**
-     * 查询运营学生列表
-     *
-     * @param params
-     * @return
-     */
-    List<Student4operating> getOperatingStudents(Map<String, Object> params);
-
-    /**
-     * 查询运营学生总数
-     *
-     * @param params
-     * @return
-     */
-    Integer countOperatingStudents(Map<String, Object> params);
-
-    /**
      * 批量获取老师体验学生数
      *
      * @param teacherIds

+ 0 - 9
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java

@@ -393,15 +393,6 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
      */
     List<OrderStatisDto> getOrganNormalStudent(Integer tenantId);
 
-    /**
-     * @param userIds:
-     * @return java.util.List<com.ym.mec.biz.dal.dto.UserGroupDto>
-     * @describe 获取学员关联乐团记录
-     * @author qnc99
-     * @date 2020/11/24 0024
-     */
-    List<UserGroupDto> getUserGroups(@Param("userIds") List<Integer> userIds);
-
 
     /**
      * 获取乐团未交费的学生

+ 3 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/StudentManageService.java

@@ -1,13 +1,13 @@
 package com.ym.mec.biz.service;
 
-import java.util.List;
-import java.util.Map;
-
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.Student;
 import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.common.page.PageInfo;
+
+import java.util.List;
+import java.util.Map;
 /**
  * @Author Joburgess
  * @Date 2019/9/19
@@ -175,13 +175,6 @@ public interface StudentManageService {
     Map<String,Integer> sumStudentAttendance(Integer courseScheduleId);
 
     /**
-     * 运营指标学生
-     * @param queryInfo
-     * @return
-     */
-    PageInfo<Student4operating> getOperatingStudents(StudentOperatingQueryInfo queryInfo);
-
-    /**
      * 乐团修改--学员缴费记录--可新增学员列表
      * @param musicGroupId
      * @param musicGroupPaymentCalenderId

+ 0 - 33
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java

@@ -796,39 +796,6 @@ public class StudentManageServiceImpl implements StudentManageService {
     }
 
     @Override
-    public PageInfo<Student4operating> getOperatingStudents(StudentOperatingQueryInfo queryInfo) {
-        PageInfo<Student4operating> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
-        Map<String, Object> params = new HashMap<>();
-        MapUtil.populateMap(params, queryInfo);
-        params.put("offset", pageInfo.getOffset());
-        Integer count = studentDao.countOperatingStudents(params);
-
-        List<Student4operating> dataList = new ArrayList<>();
-
-        if (count > 0) {
-            pageInfo.setTotal(count);
-            dataList = studentDao.getOperatingStudents(params);
-
-            Set<Integer> studentIds = dataList.stream().map(Student4operating::getStudentId).collect(Collectors.toSet());
-
-            List<UserGroupDto> allUserGroups = studentRegistrationDao.getUserGroups(new ArrayList<>(studentIds));
-            Map<Integer, List<UserGroupDto>> userGroupsMap = new HashMap<>();
-            if (!CollectionUtils.isEmpty(allUserGroups)) {
-                userGroupsMap = allUserGroups.stream().collect(Collectors.groupingBy(UserGroupDto::getUserId));
-            }
-
-            for (Student4operating student4operating : dataList) {
-                List<UserGroupDto> userGroupDtos = userGroupsMap.get(student4operating.getStudentId());
-                if (!CollectionUtils.isEmpty(userGroupDtos)) {
-                    student4operating.setGroupNames(userGroupDtos.stream().filter(ug -> StringUtils.isNotBlank(ug.getGroupName())).map(UserGroupDto::getGroupName).sorted().collect(Collectors.joining(",")));
-                }
-            }
-        }
-        pageInfo.setRows(dataList);
-        return pageInfo;
-    }
-
-    @Override
     public List<BasicUserDto> queryCanAddStudent(String musicGroupId, String batchNo, String search, Integer subjectId) {
         return studentManageDao.queryCanAddStudent(musicGroupId, batchNo, search, subjectId);
     }

+ 0 - 121
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -350,127 +350,6 @@
         </foreach>
     </update>
 
-    <resultMap id="student4operating" type="com.ym.mec.biz.dal.dto.Student4operating">
-        <result column="organ_name_" property="organName"/>
-        <result column="organ_id_" property="organId"/>
-        <result column="student_name_" property="studentName"/>
-        <result column="student_id_" property="studentId"/>
-        <result column="teacher_id_" property="teacherId"/>
-        <result column="teacher_name_" property="teacherName"/>
-        <result column="operating_tag_" property="operatingTag"/>
-        <result column="vip_times_" property="vipTimes"/>
-        <result column="free_practice_times_" property="freePracticeTimes"/>
-        <result column="buy_practice_times_" property="buyPracticeTimes"/>
-        <result column="music_netWork_times_" property="musicNetWorkTimes"/>
-        <result column="student_num_" property="studentNum"/>
-    </resultMap>
-
-    <select id="getOperatingStudents" resultMap="student4operating">
-        SELECT su.organ_id_,
-        o.name_ organ_name_,
-        su.username_ student_name_,
-        s.user_id_ student_id_,
-        tsu.id_ teacher_id_,
-        tsu.real_name_ teacher_name_,
-        s.operating_tag_,
-        a.vip_times_,
-        a.buy_practice_times_,
-        a.music_netWork_times_,
-        p.free_practice_times_,
-        su.phone_
-        FROM student s
-        LEFT JOIN sys_user su ON s.user_id_ = su.id_
-        LEFT JOIN sys_user tsu ON tsu.id_ = s.teacher_id_
-        LEFT JOIN organization o ON o.id_ = su.organ_id_
-        LEFT JOIN (
-        SELECT cssp.user_id_,
-        SUM(case when (cs.group_type_ = 'VIP' AND cs.teach_mode_='ONLINE') then 1 ELSE 0 END) vip_times_,
-        SUM(case when (pg.type_='CHARGE') then 1 ELSE 0 END) buy_practice_times_,
-        SUM(case when (cs.type_='MUSIC_NETWORK' OR cs.type_='HIGH_ONLINE') then 1 ELSE 0 END) music_netWork_times_
-        FROM course_schedule_student_payment cssp
-        LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
-        LEFT JOIN practice_group pg ON pg.`id_` = cs.`music_group_id_` AND cs.`group_type_` = 'PRACTICE'
-        WHERE cs.status_ IN ('NOT_START','UNDERWAY') AND (cs.is_lock_ IS NULL OR cs.is_lock_=0) AND (cs.del_flag_ IS NULL OR cs.del_flag_=0)
-        GROUP BY cssp.user_id_
-        ) a on a.user_id_ = s.user_id_
-        LEFT JOIN (
-        SELECT student_id_, count(id_) free_practice_times_
-        FROM practice_group
-        WHERE type_='FREE' AND group_status_ IN ('NORMAL', 'FINISH')
-        GROUP BY student_id_
-        ) p ON p.student_id_ = s.user_id_
-        <include refid="student4OperatingQueryCondition"/>
-        ORDER BY s.user_id_
-        <include refid="global.limit"/>
-    </select>
-
-    <select id="countOperatingStudents" resultType="int">
-        SELECT COUNT(s.user_id_) FROM student s
-        LEFT JOIN sys_user su ON s.user_id_ = su.id_
-        LEFT JOIN sys_user tsu ON tsu.id_ = s.teacher_id_
-        LEFT JOIN (
-        SELECT cssp.user_id_,
-        SUM(case when (cs.group_type_ = 'VIP' AND cs.teach_mode_='ONLINE') then 1 ELSE 0 END) vip_times_,
-        SUM(case when (pg.type_='CHARGE') then 1 ELSE 0 END) buy_practice_times_,
-        SUM(case when (cs.type_='MUSIC_NETWORK' OR cs.type_='HIGH_ONLINE') then 1 ELSE 0 END) music_netWork_times_
-        FROM course_schedule_student_payment cssp
-        LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
-        LEFT JOIN practice_group pg ON pg.`id_` = cs.`music_group_id_` AND cs.`group_type_` = 'PRACTICE'
-        WHERE cs.status_ IN ('NOT_START','UNDERWAY') AND (cs.is_lock_ IS NULL OR cs.is_lock_=0) AND (cs.del_flag_ IS NULL OR cs.del_flag_=0)
-        GROUP BY cssp.user_id_
-        ) a on a.user_id_ = s.user_id_
-        LEFT JOIN (
-        SELECT student_id_, count(id_) free_practice_times_
-        FROM practice_group
-        WHERE type_='FREE' AND group_status_ IN ('NORMAL', 'FINISH')
-        GROUP BY student_id_
-        ) p ON p.student_id_ = s.user_id_
-        <include refid="student4OperatingQueryCondition"/>
-    </select>
-
-    <sql id="student4OperatingQueryCondition">
-        <where>
-            su.user_type_ LIKE '%STUDENT%' and s.tenant_id_ = #{tenantId}
-            <if test="search != null and search != ''">
-                AND (su.phone_ LIKE CONCAT('%',#{search},'%') OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.id_
-                LIKE CONCAT('%',#{search},'%'))
-            </if>
-            <if test="organId != null and organId != ''">
-                AND FIND_IN_SET(su.organ_id_,#{organId})
-            </if>
-            <if test="teacherId!=null">
-                AND s.teacher_id_ = #{teacherId}
-            </if>
-            <if test="operatingTag !=null">
-                AND s.operating_tag_ = #{operatingTag}
-            </if>
-            <if test='hasVip != null and hasVip=="1"'>
-                AND a.vip_times_ >=1
-            </if>
-            <if test='hasVip != null and hasVip=="0"'>
-                AND (a.vip_times_ =0 OR a.vip_times_ IS NULL)
-            </if>
-            <if test='hasFreePractice != null and hasFreePractice=="1"'>
-                AND p.free_practice_times_ >=1
-            </if>
-            <if test='hasFreePractice != null and hasFreePractice=="0"'>
-                AND (p.free_practice_times_ =0 OR p.free_practice_times_ IS NULL)
-            </if>
-            <if test='hasBuyPractice != null and hasBuyPractice=="1"'>
-                AND a.buy_practice_times_ >=1
-            </if>
-            <if test='hasBuyPractice != null and hasBuyPractice=="0"'>
-                AND (a.buy_practice_times_ =0 OR a.buy_practice_times_ IS NULL)
-            </if>
-            <if test='hasMusicNetWork != null and hasMusicNetWork=="1"'>
-                AND a.music_netWork_times_ >=1
-            </if>
-            <if test='hasMusicNetWork != null and hasMusicNetWork=="0"'>
-                AND (a.music_netWork_times_ =0 OR a.music_netWork_times_ IS NULL)
-            </if>
-        </where>
-    </sql>
-
     <select id="getTeacherOperatingStudentsNum" resultType="java.util.Map">
         select teacher_id_ 'key', count(*) 'value'
         FROM student

+ 0 - 18
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -97,12 +97,6 @@
         <result column="subject_name_" property="subject.name"/>
     </resultMap>
 
-    <resultMap id="UserGroupDto" type="com.ym.mec.biz.dal.dto.UserGroupDto">
-        <result column="user_id_" property="userId"/>
-        <result column="group_id_" property="groupId"/>
-        <result column="group_name_" property="groupName"/>
-    </resultMap>
-
     <resultMap id="Mapper" type="com.ym.mec.biz.dal.dto.Mapper">
         <result column="key_" property="key"/>
         <result column="value_" property="value"/>
@@ -1089,18 +1083,6 @@
         WHERE sr.music_group_status_ = 'NORMAL' and sr.tenant_id_ = #{tenantId}
         GROUP BY mg.organ_id_
     </select>
-
-    <select id="getUserGroups" resultMap="UserGroupDto">
-        SELECT DISTINCT sr.user_id_, mg.id_ group_id_, mg.name_ group_name_
-        FROM student_registration sr
-        LEFT JOIN music_group mg ON sr.music_group_id_ = mg.id_
-        WHERE sr.payment_status_ = 2
-        AND sr.music_group_status_ = 'NORMAL'
-        AND sr.user_id_ IN
-        <foreach collection="userIds" item="userId" open="(" close=")" separator=",">
-            #{userId}
-        </foreach>
-    </select>
     <select id="getNoPaymentStudent" resultMap="StudentRegistration">
         SELECT *
         FROM student_registration

+ 0 - 65
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -1681,71 +1681,6 @@ public class ExportController extends BaseController {
     }
 
 
-    @ApiOperation(value = "运营指标管理导出")
-    @GetMapping("export/operatingStudents")
-    @PreAuthorize("@pcs.hasPermissions('export/operatingStudents')")
-    public void operatingStudents(StudentOperatingQueryInfo queryInfo, HttpServletResponse response) {
-        queryInfo.setPage(1);
-        queryInfo.setRows(49999);
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
-        PageInfo<Student4operating> PageOperatingStudents = studentManageService.getOperatingStudents(queryInfo);
-
-        if (PageOperatingStudents.getTotal() <= 0) {
-            throw new BizException("导出记录不存在");
-        }
-        List<Student4operating> rows = PageOperatingStudents.getRows();
-        for (Student4operating row : rows) {
-            if (row.getOperatingTag() != null && row.getOperatingTag() == 1) {
-                row.setOperatingTagStr("是");
-            } else {
-                row.setOperatingTagStr("否");
-            }
-            if (row.getVipTimes() != null && row.getVipTimes() > 0) {
-                row.setVipTimesStr("是");
-            } else {
-                row.setVipTimesStr("否");
-            }
-            if (row.getMusicNetWorkTimes() != null && row.getMusicNetWorkTimes() > 0) {
-                row.setMusicNetWorkTimesStr("是");
-            } else {
-                row.setMusicNetWorkTimesStr("否");
-            }
-            if (row.getFreePracticeTimes() != null && row.getFreePracticeTimes() > 0) {
-                row.setFreePracticeTimesStr("是");
-            } else {
-                row.setFreePracticeTimesStr("否");
-            }
-            if (row.getBuyPracticeTimes() != null && row.getBuyPracticeTimes() > 0) {
-                row.setBuyPracticeTimesStr("是");
-            } else {
-                row.setBuyPracticeTimesStr("否");
-            }
-        }
-        OutputStream ouputStream = null;
-        try {
-
-            HSSFWorkbook workbook = POIUtil.exportExcel(
-                    new String[]{"分部", "乐团名称", "学生", "学生编号", "指导老师", "指导老师id", "参与运营指标", "有线上VIP课", "参与免费网管课", "有付费网管课", "有乐团网管课"},
-                    new String[]{"organName", "groupNames", "studentName", "studentId", "teacherName", "teacherId",
-                            "operatingTagStr", "vipTimesStr", "freePracticeTimesStr", "buyPracticeTimesStr", "musicNetWorkTimesStr"}, rows);
-            response.setContentType("application/octet-stream");
-            response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
-            ouputStream = response.getOutputStream();
-            workbook.write(ouputStream);
-            ouputStream.flush();
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            if (ouputStream != null) {
-                try {
-                    ouputStream.close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-    }
-
     @ApiOperation(value = "vip评论列表导出")
     @RequestMapping("export/vipCourseReviews")
     @PreAuthorize("@pcs.hasPermissions('export/vipCourseReviews')")

+ 12 - 62
mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java

@@ -1,66 +1,24 @@
 package com.ym.mec.web.controller;
 
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.ym.mec.biz.dal.dto.ActivityCourseDetailDto;
-import com.ym.mec.biz.dal.dto.CloudStudyStudentDataDto;
-import com.ym.mec.biz.dal.dto.EduOrganStudentDataDto;
-import com.ym.mec.biz.dal.dto.IndexCloudStudyListDto;
-import com.ym.mec.biz.dal.dto.StatDto;
-import com.ym.mec.biz.dal.dto.StudentSubTotalCourseTimesDto;
-import com.ym.mec.biz.dal.dto.UpdateStudentFeeDto;
+import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.Organization;
 import com.ym.mec.biz.dal.entity.Student;
-import com.ym.mec.biz.dal.page.CloudTeacherActiveQueryInfo;
-import com.ym.mec.biz.dal.page.MusicGroupStudentQueryInfo;
-import com.ym.mec.biz.dal.page.OrganCloudStudyStudentDataQueryInfo;
-import com.ym.mec.biz.dal.page.StudentActivityQueryInfo;
-import com.ym.mec.biz.dal.page.StudentErrorLeaveQueryInfo;
-import com.ym.mec.biz.dal.page.StudentManageAttendanceQueryInfo;
-import com.ym.mec.biz.dal.page.StudentManageCourseQueryInfo;
-import com.ym.mec.biz.dal.page.StudentManageQueryInfo;
-import com.ym.mec.biz.dal.page.StudentManageVipClassQueryInfo;
-import com.ym.mec.biz.dal.page.StudentOperatingQueryInfo;
-import com.ym.mec.biz.dal.page.StudentQueryInfo;
-import com.ym.mec.biz.dal.page.StudentSignQueryInfo;
-import com.ym.mec.biz.dal.page.StudentSubTotalCourseTimesQueryInfo;
-import com.ym.mec.biz.dal.page.TeacherPaymentRecordInfo;
-import com.ym.mec.biz.dal.page.UserBasicQueryInfo;
-import com.ym.mec.biz.service.MusicGroupStudentFeeService;
-import com.ym.mec.biz.service.OrganizationService;
-import com.ym.mec.biz.service.StudentCourseHomeworkService;
-import com.ym.mec.biz.service.StudentManageService;
-import com.ym.mec.biz.service.StudentRegistrationService;
-import com.ym.mec.biz.service.StudentService;
+import com.ym.mec.biz.dal.page.*;
+import com.ym.mec.biz.service.*;
 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.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.*;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.util.CollectionUtils;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.*;
+import java.util.stream.Collectors;
 
 @Api(tags = "学生管理")
 @RestController
@@ -344,14 +302,6 @@ public class StudentManageController extends BaseController {
         return succeed(studentManageService.sumStudentAttendance(courseScheduleId));
     }
 
-    @ApiOperation(value = "获取运营指标列表")
-    @GetMapping("/getOperatingStudents")
-    @PreAuthorize("@pcs.hasPermissions('studentManage/getOperatingStudents')")
-    public Object getOperatingStudents(StudentOperatingQueryInfo queryInfo){
-        queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
-        return succeed(studentManageService.getOperatingStudents(queryInfo));
-    }
-
     @ApiOperation(value = "新增会员试用")
     @PostMapping("/updateMemberExperience")
     @PreAuthorize("@pcs.hasPermissions('studentManage/updateMemberExperience')")