소스 검색

feat:教务端学员云教练数据统计

Joburgess 3 년 전
부모
커밋
1f2f448a74

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/IndexBaseMonthDataDao.java

@@ -42,6 +42,11 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
                                               @Param("startMonth") String startMonth,
                                               @Param("endMonth") String endMonth);
 
+	List<IndexBaseMonthData> getAllIndexBaseData(@Param("organIds") Set<Integer> organIds,
+                                                 @Param("dataTypes") Set<String> dataTypes,
+                                                 @Param("startMonth") String startMonth,
+                                                 @Param("endMonth") String endMonth);
+
     List<IndexBaseMonthData> getVipCourseDataList(@Param("organIds") Set<Integer> organIds,
                                               @Param("dataTypes") Set<String> dataTypes,
                                               @Param("startMonth") String startMonth,

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java

@@ -1241,7 +1241,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			add(ORGAN_TOTAL_STUDENT_NUM.getCode());add(CLOUD_STUDY_NEW_STUDENT_NUM.getCode());}};
 
 
-		List<IndexBaseMonthData> indexBaseDatas = indexBaseMonthDataDao.getIndexBaseData(new HashSet<>(organIds), dataTypes, queryInfo.getDate(), queryInfo.getDate());
+		List<IndexBaseMonthData> indexBaseDatas = indexBaseMonthDataDao.getAllIndexBaseData(new HashSet<>(organIds), dataTypes, queryInfo.getDate(), queryInfo.getDate());
 
 		Map<Integer, Integer> organsStudentNumMap = indexBaseDatas.stream().filter(i->ORGAN_TOTAL_STUDENT_NUM.equals(i.getDataType())).collect(Collectors.toMap(IndexBaseMonthData::getOrganId, i->i.getActivateNum().intValue(), (i1, i2)->i1));
 

+ 26 - 0
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -149,6 +149,32 @@
 		GROUP BY month_,data_type_
 	</select>
 
+	<select id="getAllIndexBaseData" resultMap="IndexBaseMonthData">
+		SELECT
+			*
+		FROM index_base_month_data
+		<where>
+			<if test="dataTypes!=null and dataTypes.size()>0">
+				AND data_type_ IN
+				<foreach collection="dataTypes" item="dataType" open="(" close=")" separator=",">
+					#{dataType}
+				</foreach>
+			</if>
+			<if test="organIds!=null and organIds.size()>0">
+				AND organ_id_ IN
+				<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+					#{organId}
+				</foreach>
+			</if>
+			<if test="startMonth!=null and startMonth!=''">
+				AND month_&gt;=#{startMonth}
+			</if>
+			<if test="endMonth!=null and endMonth!=''">
+				AND month_&lt;=#{endMonth}
+			</if>
+		</where>
+	</select>
+
 	<select id="getVipCourseDataList" resultMap="IndexBaseMonthData">
 		SELECT
 			month_,

+ 5 - 4
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -3119,7 +3119,7 @@ public class ExportController extends BaseController {
         try {
             String[] header = {"老师编号", "老师姓名", "学员总数", "付费学员数量",
                     "试用会员", "会员占比"};
-            String[] body = {"teacherId", "teacherName", "totalStudentNum", "vipStudentNum", "eVipStudentNum", "vipStudentDuty"};
+            String[] body = {"teacherId", "teacherName", "totalStudentNum", "vipStudentNum", "eVipStudentNum", "vipStudentDuty+\"%\""};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, rows);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=employeeInfo-" + DateUtil.getDate(new Date()) + ".xls");
@@ -3171,7 +3171,7 @@ public class ExportController extends BaseController {
         OutputStream outputStream = response.getOutputStream();
         try {
             String[] header = {"分部", "学员总数", "付费会员数量","会员占比"};
-            String[] body = {"organName", "totalStudentNum", "vipStudentNum", "vipStudentDuty"};
+            String[] body = {"organName", "totalStudentNum", "vipStudentNum", "vipStudentDuty+\"%\""};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, rows);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=employeeInfo-" + DateUtil.getDate(new Date()) + ".xls");
@@ -3222,8 +3222,9 @@ public class ExportController extends BaseController {
         }
         OutputStream outputStream = response.getOutputStream();
         try {
-            String[] header = {"排名", "分部", "学员总数", "付费会员数量","会员占比"};
-            String[] body = {"index", "organName", "totalStudentNum", "vipStudentNum", "vipStudentDuty"};
+            String[] header = {"排名", "分部", "学员总数", "活跃人数", "活跃人数占比", "使用人数", "使用人数占比", "付费会员数量","付费会员占比", "新增付费会员"};
+            String[] body = {"index", "organName", "totalStudentNum", "cloudStudyLivelyStudentNum", "cloudStudyLivelyStudentDuty+\"%\"",
+                    "cloudStudyUseStudentNum", "cloudStudyUseStudentDuty+\"%\"", "vipStudentNum", "vipStudentDuty+\"%\"", "newCloudStudyStudentNum"};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, rows);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=employeeInfo-" + DateUtil.getDate(new Date()) + ".xls");