浏览代码

管乐迷需求迭代

zouxuan 2 年之前
父节点
当前提交
8a21278159

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

@@ -353,6 +353,22 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
                                                             @Param("endDate") String endDate,
                                                             @Param("organIds") List<Integer> organIds,@Param("tenantId") Integer tenantId);
 
+    List<IndexBaseMonthData> getFinanceBalanceDataWithTimelyByCoop(@Param("startDate") String startDate,
+                                                                   @Param("endDate") String endDate,
+                                                                   @Param("organId") Integer organId);
+
+    List<IndexBaseMonthData> getOrganFinanceBalanceDataWithTimelyByCoop(@Param("startDate") String startDate,
+                                                                        @Param("endDate") String endDate,
+                                                                        @Param("organId") Integer organId);
+
+    List<IndexBaseMonthData> getFinanceActualDataWithTimelyByCoop(@Param("startDate") String startDate,
+                                                                  @Param("endDate") String endDate,
+                                                                  @Param("organId") Integer organId);
+
+    List<IndexBaseMonthData> getOrganFinanceActualDataWithTimelyByCoop(@Param("startDate") String startDate,
+                                                                       @Param("endDate") String endDate,
+                                                                       @Param("organId") Integer organId);
+
     /**
      * @describe 各分部教师服务指标异常
      * @author Joburgess
@@ -403,6 +419,38 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
                                                             @Param("classGroupIds") List<Long> classGroupIds,
                                                             @Param("tenantId") Integer tenantId);
 
+    List<IndexBaseMonthData> getTotalAmountDataWithTimelyByCoop(@Param("startDate") String startDate,
+                                                                @Param("endDate") String endDate,
+                                                                @Param("organId") Integer organId);
+    List<IndexBaseMonthData> getOrganTotalAmountDataWithTimelyByCoop(@Param("startDate") String startDate,
+                                                                     @Param("endDate") String endDate,
+                                                                     @Param("organId") Integer organId);
+
+    List<IndexBaseMonthData> getTotalAmountDataWithTimelyDetailsByCoop(@Param("startDate") String startDate,
+                                                                 @Param("endDate") String endDate,
+                                                                 @Param("organId") Integer organId,
+                                                                 @Param("orderType") String orderType,
+                                                                 @Param("notOrderType") List<String> notOrderType);
+    List<IndexBaseMonthData> getOrganTotalAmountDataWithTimelyDetailsByCoop(@Param("startDate") String startDate,
+                                                                 @Param("endDate") String endDate,
+                                                                 @Param("organId") Integer organId,
+                                                                 @Param("orderType") String orderType,
+                                                                 @Param("notOrderType") List<String> notOrderType);
+
+    List<IndexBaseMonthData> getVipAmountDataWithTimelyDetailsByCoop(@Param("startDate") String startDate,
+                                                                     @Param("endDate") String endDate,
+                                                                     @Param("organId") Integer organId);
+    List<IndexBaseMonthData> getOrganVipAmountDataWithTimelyDetailsByCoop(@Param("startDate") String startDate,
+                                                                          @Param("endDate") String endDate,
+                                                                          @Param("organId") Integer organId);
+
+    List<IndexBaseMonthData> getOtherAmountDataWithTimelyDetailsByCoop(@Param("startDate") String startDate,
+                                                                 @Param("endDate") String endDate,
+                                                                 @Param("organId") Integer organId);
+    List<IndexBaseMonthData> getOrganOtherAmountDataWithTimelyDetailsByCoop(@Param("startDate") String startDate,
+                                                                 @Param("endDate") String endDate,
+                                                                 @Param("organId") Integer organId);
+
     int countStudentErrorLeave1(Map<String, Object> params);
 
     List<StudentErrorLeaveDto> queryStudentErrorLeave(Map<String, Object> params);

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

@@ -206,6 +206,8 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
      */
     int getOrgansTodayTotalCloudStudyStudentNum(@Param("organIds") List<Integer> organIds);
 
+    List<Map<Integer,Integer>> getOrgansTodayTotalCloudStudyStudentNumMap(@Param("organIds") List<Integer> organIds);
+
 
     int getCloudStudyLivelyStudentNum(@Param("organId") Integer organId);
     int getOrganTotalCloudStudyLivelyStudentNum(@Param("organIds") List<Integer> organIds, @Param("startTime") Date startTime, @Param("endTime") Date endTime);

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CloudTeacherSumDto.java

@@ -9,6 +9,9 @@ public class CloudTeacherSumDto {
     @ApiModelProperty(value = "分部")
     private String organName;
 
+    @ApiModelProperty(value = "分部")
+    private String teacherName;
+
     @ApiModelProperty(value = "在读人数")
     private BigDecimal normalNum = BigDecimal.ZERO;
 
@@ -42,6 +45,14 @@ public class CloudTeacherSumDto {
     @ApiModelProperty(value = ">240分钟")
     private Integer train4;
 
+    public String getTeacherName() {
+        return teacherName;
+    }
+
+    public void setTeacherName(String teacherName) {
+        this.teacherName = teacherName;
+    }
+
     public String getOrganName() {
         return organName;
     }

+ 13 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/IndexCloudStudySumDto.java

@@ -1,5 +1,7 @@
 package com.ym.mec.biz.dal.dto;
 
+import io.swagger.annotations.ApiModelProperty;
+
 public class IndexCloudStudySumDto {
 
 	private Integer organId;
@@ -33,6 +35,17 @@ public class IndexCloudStudySumDto {
 	//购买率
 	private double buyRate;
 
+	@ApiModelProperty("云教练今日使用人数")
+	private int cloudStudyTodayUseStudentNum;
+
+	public int getCloudStudyTodayUseStudentNum() {
+		return cloudStudyTodayUseStudentNum;
+	}
+
+	public void setCloudStudyTodayUseStudentNum(int cloudStudyTodayUseStudentNum) {
+		this.cloudStudyTodayUseStudentNum = cloudStudyTodayUseStudentNum;
+	}
+
 	public double getAgainBuyRate() {
 		return againBuyRate;
 	}

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/ExportEnum.java

@@ -85,6 +85,7 @@ public enum ExportEnum implements BaseEnum<String, ExportEnum> {
     EXPORT_PRE_COURSE_CONSUMER_DETAIL("EXPORT_PRE_COURSE_CONSUMER_DETAIL", "预计课耗学员详情导出"),
     EXPORT_COURSE_CONSUMER_SUM("EXPORT_COURSE_CONSUMER_SUM", "课耗统计导出"),
     EXPORT_CLOUD_TEACHER_SUM("EXPORT_CLOUD_TEACHER_SUM", "云教练统计导出"),
+    EXPORT_CLOUD_TEACHER_SUM_DETAIL("EXPORT_CLOUD_TEACHER_SUM_DETAIL", "云教练统计详情导出"),
     ;
 
     private String code;

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/ExportTypeEnum.java

@@ -24,7 +24,8 @@ public enum ExportTypeEnum implements BaseEnum<Integer, ExportTypeEnum> {
 	EXPORT_PRE_COURSE_CONSUMER_DETAIL(18, "预计课耗学员详情导出"),
 	EXPORT_COURSE_CONSUMER_SUM(19, "课耗统计导出"),
 	EXPORT_CLOUD_TEACHER_SUM(20, "云教练统计导出"),
-	CLASS_GROUP(21, "班级列表导出")
+	CLASS_GROUP(21, "班级列表导出"),
+	EXPORT_CLOUD_TEACHER_SUM_DETAIL(22, "云教练统计详情导出")
 	;
 
 	private Integer code;

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/IndexDataQueryInfo.java

@@ -12,12 +12,22 @@ public class IndexDataQueryInfo extends QueryInfo {
 
     private String dataTypes;
 
+    private String searchType;
+
     private String organId;
 
     private Date startDate;
 
     private Date endDate;
 
+    public String getSearchType() {
+        return searchType;
+    }
+
+    public void setSearchType(String searchType) {
+        this.searchType = searchType;
+    }
+
     public String getDataTypes() {
         return dataTypes;
     }

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentCourseConsumerQueryInfo.java

@@ -3,11 +3,15 @@ package com.ym.mec.biz.dal.page;
 import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.ApiModelProperty;
 
+import java.util.List;
+
 public class StudentCourseConsumerQueryInfo extends QueryInfo {
 
     @ApiModelProperty(value = "分部")
     private String organId;
 
+    private List<String> mondays;
+
     @ApiModelProperty(value = "月份")
     private String month;
 
@@ -20,6 +24,14 @@ public class StudentCourseConsumerQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "周数")
     private long weekBetween;
 
+    public List<String> getMondays() {
+        return mondays;
+    }
+
+    public void setMondays(List<String> mondays) {
+        this.mondays = mondays;
+    }
+
     public long getWeekBetween() {
         return weekBetween;
     }

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExportServiceImpl.java

@@ -376,6 +376,7 @@ public class ExportServiceImpl implements ExportService {
         exportManageFuncMap.put(ExportEnum.EXPORT_PRE_COURSE_CONSUMER_DETAIL, (info) -> exportPreCourseConsumerDetail(info));
         exportManageFuncMap.put(ExportEnum.EXPORT_COURSE_CONSUMER_SUM, (info) -> exportCourseConsumerSum(info));
         exportManageFuncMap.put(ExportEnum.EXPORT_CLOUD_TEACHER_SUM, (info) -> exportCloudTeacherSum(info));
+        exportManageFuncMap.put(ExportEnum.EXPORT_CLOUD_TEACHER_SUM_DETAIL, (info) -> exportCloudTeacherSumDetail(info));
         exportManageFuncMap.put(ExportEnum.CLASS_GROUP, info -> exportClassGroup(info));
     }
 
@@ -1559,6 +1560,17 @@ public class ExportServiceImpl implements ExportService {
                 managerDownload.getName());
     }
 
+    private HttpResponseResult exportCloudTeacherSumDetail(Map<String, Object> info){
+        StudentCourseConsumerQueryInfo queryInfo = JSONObject.parseObject(JSONObject.toJSONString(info), StudentCourseConsumerQueryInfo.class);
+        SysUser user = sysUserService.getUser();
+        queryInfo.setOrganId(organizationService.getEmployeeOrgan(user.getId(), queryInfo.getOrganId(), user.getIsSuperAdmin()));
+        List<CloudTeacherSumDto> rows = studentService.cloudTeacherSumDetail(queryInfo).getRows();
+        checkRows(rows);
+        ManagerDownload managerDownload = saveManagerDownload(ExportTypeEnum.EXPORT_CLOUD_TEACHER_SUM_DETAIL,user.getId());
+        return this.asyncExport(() -> this.initExportInfo(rows, managerDownload,ExportEnum.EXPORT_CLOUD_TEACHER_SUM),
+                managerDownload.getName());
+    }
+
     //导出训练统计
     private HttpResponseResult exportCompareRecord(Map<String, Object> info){
         ExportCompareQueryInfo queryInfo = JSONObject.parseObject(JSONObject.toJSONString(info), ExportCompareQueryInfo.class);

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

@@ -22,7 +22,6 @@ import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.ss.formula.functions.T;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -36,9 +35,6 @@ import java.util.*;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
-import java.util.function.Consumer;
-import java.util.function.Function;
-import java.util.function.Supplier;
 import java.util.stream.Collectors;
 
 import static com.ym.mec.biz.dal.enums.IndexDataType.*;
@@ -169,8 +165,13 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		//按分部汇总
 		if((CollectionUtils.isEmpty(dataTypes) || dataTypes.contains(ORGAN_FINANCE_BALANCE_AMOUNT.getCode()) ||
 				dataTypes.contains(ORGAN_FINANCE_AMOUNT.getCode())) && organIds != null){
-			//经营数据查询
-			this.syncOperation(startDate1,endDate1,arrayList,tenantId,result,typeDateMap);
+			if(StringUtils.equals(queryInfo.getSearchType(),"COOP")){
+				//经营数据查询
+				this.syncOperationCoop(startDate1,endDate1,Integer.parseInt(queryInfo.getOrganId()),result,typeDateMap);
+			}else {
+				//经营数据查询
+				this.syncOperation(startDate1,endDate1,arrayList,tenantId,result,typeDateMap);
+			}
 		}
 
 		if(CollectionUtils.isEmpty(dataTypes)||dataTypes.contains(MUSIC_GROUP_COURSE.getCode())||dataTypes.contains(VIP_GROUP_COURSE.getCode())
@@ -364,59 +365,86 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 
 	//异步处理经营数据查询
 	public void syncOperation(String startDate1,String endDate1,List<Integer> arrayList,Integer tenantId,List<IndexBaseDto> indexBaseDtoList,Map<IndexDataType, List<IndexBaseMonthData>> typeDateMap){
-		CompletableFuture future1 = CompletableFuture.supplyAsync(() -> {
+		CompletableFuture future1 = this.async(() -> {
 			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_RENEW_AMOUNT,indexBaseMonthDataDao.getOrganTotalAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,"RENEW",null,tenantId)));
 			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_VIP_AMOUNT,indexBaseMonthDataDao.getOrganVipAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,tenantId)));
-			return true;
-		},exportExecutorService);
-		CompletableFuture future2 = CompletableFuture.supplyAsync(() -> {
+		});
+		CompletableFuture future2 = this.async(() -> {
 			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_PRACTICE_AMOUNT,indexBaseMonthDataDao.getOrganTotalAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,"PRACTICE_GROUP_BUY,PRACTICE_GROUP_RENEW",null,tenantId)));
 			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_OTHER_AMOUNT,indexBaseMonthDataDao.getOrganOtherAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,tenantId)));
-			return true;
-		},exportExecutorService);
-		CompletableFuture future3 = CompletableFuture.supplyAsync(() -> {
+		});
+		CompletableFuture future3 = this.async(() -> {
 			indexBaseDtoList.add(this.getIndexBaseDto(IndexDataType.ORGAN_TOTAL_AMOUNT,indexBaseMonthDataDao.getOrganTotalAmountDataWithTimely(startDate1, endDate1, arrayList,tenantId)));
-			//经营报表细化
 			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_APPLY_AMOUNT,indexBaseMonthDataDao.getOrganTotalAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,"APPLY,ADD_STUDENT",null,tenantId)));
-			return true;
-		},exportExecutorService);
-		CompletableFuture future4 = CompletableFuture.supplyAsync(() -> {
+		});
+		CompletableFuture future4 = this.async(() -> {
 			indexBaseDtoList.add(this.getIndexBaseDto(IndexDataType.ORGAN_FINANCE_BALANCE_AMOUNT,indexBaseMonthDataDao.getOrganFinanceBalanceDataWithTimely(startDate1, endDate1, arrayList,tenantId)));
 			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_FINANCE_AMOUNT,indexBaseMonthDataDao.getOrganFinanceActualDataWithTimely(startDate1, endDate1, arrayList,tenantId)));
-			return true;
-		},exportExecutorService);
+		});
 
-		CompletableFuture future5 = CompletableFuture.supplyAsync(()->{
+		CompletableFuture future5 = this.async(()->{
 			typeDateMap.put(IndexDataType.FINANCE_BALANCE_AMOUNT,indexBaseMonthDataDao.getFinanceBalanceDataWithTimely(startDate1, endDate1, arrayList,tenantId));
 			typeDateMap.put(FINANCE_AMOUNT,indexBaseMonthDataDao.getFinanceActualDataWithTimely(startDate1, endDate1, arrayList,tenantId));
-			return true;
-		},exportExecutorService);
-		CompletableFuture future6 = CompletableFuture.supplyAsync(()->{
+		});
+		CompletableFuture future6 = this.async(()->{
 			List<IndexBaseMonthData> renewAmount = indexBaseMonthDataDao.getTotalAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,"RENEW",null,tenantId);
 			typeDateMap.put(RENEW_AMOUNT,renewAmount);
 			List<IndexBaseMonthData> vipAmount = indexBaseMonthDataDao.getVipAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,tenantId);
 			typeDateMap.put(VIP_AMOUNT,vipAmount);
-			return true;
-		},exportExecutorService);
-		CompletableFuture future7 = CompletableFuture.supplyAsync(()->{
-			List<IndexBaseMonthData> totalAmountDataWithTimely = indexBaseMonthDataDao.getTotalAmountDataWithTimely(startDate1, endDate1, arrayList,tenantId);
-			typeDateMap.put(IndexDataType.TOTAL_AMOUNT,totalAmountDataWithTimely);
-			//经营报表细化
-			List<IndexBaseMonthData> applyAmount = indexBaseMonthDataDao.getTotalAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,"APPLY,ADD_STUDENT",null,tenantId);
-			typeDateMap.put(APPLY_AMOUNT,applyAmount);
-			return true;
-		},exportExecutorService);
-		CompletableFuture future8 = CompletableFuture.supplyAsync(()->{
-			List<IndexBaseMonthData> practiceAmount = indexBaseMonthDataDao.getTotalAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,"PRACTICE_GROUP_BUY,PRACTICE_GROUP_RENEW",null,tenantId);
-			typeDateMap.put(PRACTICE_AMOUNT,practiceAmount);
-			List<IndexBaseMonthData> otherAmount = indexBaseMonthDataDao.getOtherAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,tenantId);
-			typeDateMap.put(OTHER_AMOUNT,otherAmount);
-			return true;
-		},exportExecutorService);
+		});
+		CompletableFuture future7 = this.async(()->{
+			typeDateMap.put(IndexDataType.TOTAL_AMOUNT,indexBaseMonthDataDao.getTotalAmountDataWithTimely(startDate1, endDate1, arrayList,tenantId));
+			typeDateMap.put(APPLY_AMOUNT,indexBaseMonthDataDao.getTotalAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,"APPLY,ADD_STUDENT",null,tenantId));
+		});
+		CompletableFuture future8 = this.async(()->{
+			typeDateMap.put(PRACTICE_AMOUNT,indexBaseMonthDataDao.getTotalAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,"PRACTICE_GROUP_BUY,PRACTICE_GROUP_RENEW",null,tenantId));
+			typeDateMap.put(OTHER_AMOUNT,indexBaseMonthDataDao.getOtherAmountDataWithTimelyDetails(startDate1, endDate1, arrayList,tenantId));
+		});
 		future1.join();future2.join();future3.join();future4.join();
 		future5.join();future6.join();future7.join();future8.join();
 	}
 
+	//异步处理经营数据查询
+	public void syncOperationCoop(String startDate1,String endDate1,Integer organId,List<IndexBaseDto> indexBaseDtoList,Map<IndexDataType, List<IndexBaseMonthData>> typeDateMap){
+//		CompletableFuture future1 = this.async(() -> {
+//			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_RENEW_AMOUNT,indexBaseMonthDataDao.getOrganTotalAmountDataWithTimelyDetailsByCoop(startDate1, endDate1, organId,"RENEW",null)));
+//			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_VIP_AMOUNT,indexBaseMonthDataDao.getOrganVipAmountDataWithTimelyDetailsByCoop(startDate1, endDate1, organId)));
+//		});
+//		CompletableFuture future2 = this.async(() -> {
+//			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_PRACTICE_AMOUNT,indexBaseMonthDataDao.getOrganTotalAmountDataWithTimelyDetailsByCoop(startDate1, endDate1, organId,"PRACTICE_GROUP_BUY,PRACTICE_GROUP_RENEW",null)));
+//			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_OTHER_AMOUNT,indexBaseMonthDataDao.getOrganOtherAmountDataWithTimelyDetailsByCoop(startDate1, endDate1, organId)));
+//		});
+//		CompletableFuture future3 = this.async(() -> {
+//			indexBaseDtoList.add(this.getIndexBaseDto(IndexDataType.ORGAN_TOTAL_AMOUNT,indexBaseMonthDataDao.getOrganTotalAmountDataWithTimelyByCoop(startDate1, endDate1, organId)));
+//			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_APPLY_AMOUNT,indexBaseMonthDataDao.getOrganTotalAmountDataWithTimelyDetailsByCoop(startDate1, endDate1, organId,"APPLY,ADD_STUDENT",null)));
+//		});
+//		CompletableFuture future4 = this.async(() -> {
+//			indexBaseDtoList.add(this.getIndexBaseDto(IndexDataType.ORGAN_FINANCE_BALANCE_AMOUNT,indexBaseMonthDataDao.getOrganFinanceBalanceDataWithTimelyByCoop(startDate1, endDate1, organId)));
+//			indexBaseDtoList.add(this.getIndexBaseDto(ORGAN_FINANCE_AMOUNT,indexBaseMonthDataDao.getOrganFinanceActualDataWithTimelyByCoop(startDate1, endDate1, organId)));
+//		});
+
+		CompletableFuture future5 = this.async(()->{
+			typeDateMap.put(IndexDataType.FINANCE_BALANCE_AMOUNT,indexBaseMonthDataDao.getFinanceBalanceDataWithTimelyByCoop(startDate1, endDate1, organId));
+			typeDateMap.put(FINANCE_AMOUNT,indexBaseMonthDataDao.getFinanceActualDataWithTimelyByCoop(startDate1, endDate1, organId));
+		});
+		CompletableFuture future6 = this.async(()->{
+			List<IndexBaseMonthData> renewAmount = indexBaseMonthDataDao.getTotalAmountDataWithTimelyDetailsByCoop(startDate1, endDate1, organId,"RENEW",null);
+			typeDateMap.put(RENEW_AMOUNT,renewAmount);
+			List<IndexBaseMonthData> vipAmount = indexBaseMonthDataDao.getVipAmountDataWithTimelyDetailsByCoop(startDate1, endDate1, organId);
+			typeDateMap.put(VIP_AMOUNT,vipAmount);
+		});
+		CompletableFuture future7 = this.async(()->{
+			typeDateMap.put(IndexDataType.TOTAL_AMOUNT,indexBaseMonthDataDao.getTotalAmountDataWithTimelyByCoop(startDate1, endDate1, organId));
+			typeDateMap.put(APPLY_AMOUNT,indexBaseMonthDataDao.getTotalAmountDataWithTimelyDetailsByCoop(startDate1, endDate1, organId,"APPLY,ADD_STUDENT",null));
+		});
+		CompletableFuture future8 = this.async(()->{
+			typeDateMap.put(PRACTICE_AMOUNT,indexBaseMonthDataDao.getTotalAmountDataWithTimelyDetailsByCoop(startDate1, endDate1, organId,"PRACTICE_GROUP_BUY,PRACTICE_GROUP_RENEW",null));
+			typeDateMap.put(OTHER_AMOUNT,indexBaseMonthDataDao.getOtherAmountDataWithTimelyDetailsByCoop(startDate1, endDate1, organId));
+		});
+//		future1.join();future2.join();future3.join();future4.join();
+		future5.join();future6.join();future7.join();future8.join();
+	}
+
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)

+ 23 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServiceImpl.java

@@ -1189,10 +1189,9 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
 
     @Override
     public List<CloudTeacherSumDto> cloudTeacherSum(StudentCourseConsumerQueryInfo queryInfo) {
-        Date date = DateUtil.stringToDate(queryInfo.getStartDate(), DateUtil.ISO_EXPANDED_DATE_FORMAT);
-        Date date2 = DateUtil.stringToDate(queryInfo.getEndDate(), DateUtil.ISO_EXPANDED_DATE_FORMAT);
-        long weekBetween = DateUtil.weekBetween(date, date2);
-        queryInfo.setWeekBetween(weekBetween);
+        List<String> mondays = this.getMondays(queryInfo.getStartDate(),queryInfo.getEndDate());
+        queryInfo.setWeekBetween(mondays.size());
+        queryInfo.setMondays(mondays);
         List<CloudTeacherSumDto> cloudTeacherSumDtos = studentDao.cloudTeacherSum(queryInfo);
         if(CollectionUtils.isEmpty(cloudTeacherSumDtos)){
             return cloudTeacherSumDtos;
@@ -1213,10 +1212,9 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
     @Override
     public PageInfo<CloudTeacherSumDto> cloudTeacherSumDetail(StudentCourseConsumerQueryInfo queryInfo) {
         PageInfo<CloudTeacherSumDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
-        Date date = DateUtil.stringToDate(queryInfo.getStartDate(), DateUtil.ISO_EXPANDED_DATE_FORMAT);
-        Date date2 = DateUtil.stringToDate(queryInfo.getEndDate(), DateUtil.ISO_EXPANDED_DATE_FORMAT);
-        long weekBetween = DateUtil.weekBetween(date, date2);
-        queryInfo.setWeekBetween(weekBetween);
+        List<String> mondays = this.getMondays(queryInfo.getStartDate(),queryInfo.getEndDate());
+        queryInfo.setWeekBetween(mondays.size());
+        queryInfo.setMondays(mondays);
         Map<String, Object> params = new HashMap<String, Object>();
         MapUtil.populateMap(params, queryInfo);
 
@@ -1244,6 +1242,21 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
         return pageInfo;
     }
 
+    private List<String> getMondays(String startDate,String endDate){
+        Date date = DateUtil.stringToDate(startDate, DateUtil.ISO_EXPANDED_DATE_FORMAT);
+        Date date2 = DateUtil.stringToDate(endDate, DateUtil.ISO_EXPANDED_DATE_FORMAT);
+        List<String> mondays = new ArrayList<>();
+        mondays.add(startDate);
+        while (true){
+            date = DateUtil.addDays(date, 7);
+            if(date.compareTo(date2) > 0){
+                break;
+            }
+            mondays.add(DateUtil.dateToString(date,DateUtil.ISO_EXPANDED_DATE_FORMAT));
+        }
+        return mondays;
+    }
+
     @Override
     public List<IndexCloudStudySumDto> getCloudStudyStudentOverViewList(List<Integer> organIdsList) {
         List<IndexCloudStudySumDto> list = studentDao.getCloudStudyStudentOverViewList(organIdsList);
@@ -1266,8 +1279,10 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
         Map<Integer,Long> activeMap = MapUtil.convertIntegerMap(studentDao.getOrganActiveCloudStudyStudentNum(organIdsList, startTime, endTime));
         //获取重复购买人数
         Map<Integer,Long> againBuyMap = MapUtil.convertIntegerMap(studentDao.getAgainBuyNum(organIdsList));
+        Map<Integer,Integer> todayStudyMap = MapUtil.convertIntegerMap(studentDao.getOrgansTodayTotalCloudStudyStudentNumMap(organIdsList));
         for (IndexCloudStudySumDto dto : list) {
             dto.setOrganName(organMap.get(dto.getOrganId()));
+            dto.setCloudStudyTodayUseStudentNum(todayStudyMap.get(dto.getOrganId()));
             Long aLong = waitMap.get(dto.getOrganId());
             dto.setWaitActivateVipStudentNum(aLong==null?0:aLong.intValue());
             Long aLong1 = againBuyMap.get(dto.getOrganId());

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

@@ -1399,6 +1399,7 @@
 		</if>
 		GROUP BY o.id_ ORDER BY percent_ DESC
 	</select>
+
 	<select id="getFinanceBalanceDataWithTimely" resultMap="IndexBaseMonthData">
 		SELECT spo.organ_id_,SUM(CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) total_num_,
 			   SUM(CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) activate_num_,
@@ -1413,6 +1414,7 @@
 		</if>
 		GROUP BY DATE_FORMAT(spo.pay_time_,'%Y-%m-%d')
 	</select>
+
 	<select id="getOrganFinanceBalanceDataWithTimely" resultMap="IndexBaseMonthData">
 		SELECT SUM(CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) percent_,
 		o.id_ organ_id_,o.name_ organ_name_
@@ -1428,6 +1430,7 @@
 		</if>
 		GROUP BY o.id_ ORDER BY percent_ DESC
 	</select>
+
 	<select id="getFinanceActualDataWithTimely" resultMap="IndexBaseMonthData">
 		SELECT spo.organ_id_,SUM(spo.actual_amount_) total_num_,
 			   SUM(spo.actual_amount_) activate_num_,
@@ -1442,6 +1445,7 @@
 		</if>
 		GROUP BY DATE_FORMAT(spo.pay_time_,'%Y-%m-%d')
 	</select>
+
 	<select id="getOrganFinanceActualDataWithTimely" resultMap="IndexBaseMonthData">
 		SELECT SUM(spo.actual_amount_) percent_,o.id_ organ_id_,o.name_ organ_name_
 		FROM organization o
@@ -1456,6 +1460,7 @@
 		</if>
 		GROUP BY o.id_ ORDER BY percent_ DESC
 	</select>
+
 	<select id="getTotalAmountDataWithTimely" resultMap="IndexBaseMonthData">
 		SELECT spo.organ_id_,SUM(CASE WHEN spo.actual_amount_ IS NULL THEN 0 ELSE spo.actual_amount_ END +
 		                         CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) total_num_,
@@ -1473,6 +1478,7 @@
 		</if>
 		GROUP BY DATE_FORMAT(spo.pay_time_,'%Y-%m-%d')
 	</select>
+
 	<select id="getOrganTotalAmountDataWithTimely" resultMap="IndexBaseMonthData">
 		SELECT SUM(CASE WHEN spo.actual_amount_ IS NULL THEN 0 ELSE spo.actual_amount_ END +
 		                         CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) percent_,
@@ -1489,6 +1495,7 @@
 		</if>
 		GROUP BY o.id_ ORDER BY percent_ DESC
 	</select>
+
 	<select id="getTotalAmountDataWithTimelyDetails" resultMap="IndexBaseMonthData">
 		SELECT spo.organ_id_,SUM(CASE WHEN spo.actual_amount_ IS NULL THEN 0 ELSE spo.actual_amount_ END +
 		                         CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) total_num_,
@@ -1687,6 +1694,231 @@
 		GROUP BY o.id_ ORDER BY percent_ DESC
 	</select>
 
+	<select id="getFinancePayDataWithTimelyByCoop"  resultMap="IndexBaseMonthData">
+		SELECT SUM(fe.amount_) total_num_,SUM(fe.amount_) activate_num_,SUM(fe.amount_) percent_,cop.organ_id_,DATE_FORMAT(fe.create_time_,'%Y-%m-%d') month_
+		FROM financial_expenditure fe
+				 left join (select sr.user_id_,mg.cooperation_organ_id_ organ_id_,co.name_ organ_name_ from
+			(select * from student_registration where id_ IN (select MAX(id_) from student_registration group by user_id_)) sr
+				left join music_group mg ON mg.id_ = sr.music_group_id_
+				left join cooperation_organ co ON co.id_ = mg.cooperation_organ_id_
+							where mg.organ_id_ = #{organId} group by sr.user_id_,mg.cooperation_organ_id_) cop ON cop.user_id_ = fe.apply_user_id_
+		WHERE DATE_FORMAT(fe.create_time_,'%Y-%m-%d') BETWEEN #{startDate} AND #{endDate}
+		  AND del_flag_ = 0 AND fe.apply_user_id_ = cop.user_id_
+		GROUP BY DATE_FORMAT(fe.create_time_,'%Y-%m-%d')
+	</select>
+
+	<select id="getOrganFinancePayDataWithTimelyByCoop"  resultMap="IndexBaseMonthData">
+		SELECT SUM(fe.amount_) percent_,cop.organ_id_,cop.organ_name_
+		FROM financial_expenditure fe
+		left join (select sr.user_id_,mg.cooperation_organ_id_ organ_id_,co.name_ organ_name_ from
+		(select * from student_registration where id_ IN (select MAX(id_) from student_registration group by user_id_)) sr
+		left join music_group mg ON mg.id_ = sr.music_group_id_
+		left join cooperation_organ co ON co.id_ = mg.cooperation_organ_id_
+		where mg.organ_id_ = #{organId} group by sr.user_id_,mg.cooperation_organ_id_) cop ON cop.user_id_ = fe.apply_user_id_
+		WHERE DATE_FORMAT(fe.create_time_,'%Y-%m-%d') BETWEEN #{startDate} AND #{endDate} AND fe.del_flag_ = 0
+		AND fe.apply_user_id_ = cop.user_id_
+		GROUP BY cop.organ_id_ ORDER BY percent_ DESC
+	</select>
+
+	<select id="getFinanceBalanceDataWithTimelyByCoop" resultMap="IndexBaseMonthData">
+		SELECT cop.organ_id_,SUM(CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) total_num_,
+			   SUM(CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) activate_num_,
+			   SUM(CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) percent_,DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') month_
+		FROM student_payment_order spo
+		<include refid="cooperationSql"/>
+		WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') BETWEEN #{startDate} AND #{endDate}
+		AND cop.user_id_ = spo.user_id_
+		GROUP BY DATE_FORMAT(spo.pay_time_,'%Y-%m-%d')
+	</select>
+
+	<select id="getOrganFinanceBalanceDataWithTimelyByCoop" resultMap="IndexBaseMonthData">
+		SELECT SUM(CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) percent_,
+		cop.organ_id_,cop.organ_name_
+		FROM student_payment_order spo
+		<include refid="cooperationSql"/>
+		WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') BETWEEN #{startDate} AND #{endDate}
+		AND cop.user_id_ = spo.user_id_
+		GROUP BY cop.organ_id_ ORDER BY percent_ DESC
+	</select>
+
+	<select id="getFinanceActualDataWithTimelyByCoop" resultMap="IndexBaseMonthData">
+		SELECT cop.organ_id_,SUM(spo.actual_amount_) total_num_,
+			   SUM(spo.actual_amount_) activate_num_,
+			   SUM(spo.actual_amount_) percent_,DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') month_
+		FROM student_payment_order spo
+		<include refid="cooperationSql"/>
+		WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') BETWEEN #{startDate} AND #{endDate}
+		AND cop.user_id_ = spo.user_id_
+		GROUP BY DATE_FORMAT(spo.pay_time_,'%Y-%m-%d')
+	</select>
+
+	<select id="getOrganFinanceActualDataWithTimelyByCoop" resultMap="IndexBaseMonthData">
+		SELECT SUM(spo.actual_amount_) percent_,cop.organ_id_,cop.organ_name_
+		FROM student_payment_order spo
+		<include refid="cooperationSql"/>
+		WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') BETWEEN #{startDate} AND #{endDate}
+		AND cop.user_id_ = spo.user_id_
+		GROUP BY cop.organ_id_ ORDER BY percent_ DESC
+	</select>
+
+	<sql id="cooperationSql">
+		left join (select sr.user_id_,mg.cooperation_organ_id_ organ_id_,co.name_ organ_name_ from
+		(select * from student_registration where id_ IN (select MAX(id_) from student_registration group by user_id_)) sr
+		left join music_group mg ON mg.id_ = sr.music_group_id_
+		left join cooperation_organ co ON co.id_ = mg.cooperation_organ_id_
+		 where mg.organ_id_ = #{organId} group by sr.user_id_,mg.cooperation_organ_id_) cop ON cop.user_id_ = spo.user_id_
+	</sql>
+
+	<select id="getTotalAmountDataWithTimelyByCoop" resultMap="IndexBaseMonthData">
+		SELECT cop.organ_id_,SUM(CASE WHEN spo.actual_amount_ IS NULL THEN 0 ELSE spo.actual_amount_ END +
+													  CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) total_num_,
+			   SUM(CASE WHEN spo.actual_amount_ IS NULL THEN 0 ELSE spo.actual_amount_ END +
+				   CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) activate_num_,
+			   SUM(CASE WHEN spo.actual_amount_ IS NULL THEN 0 ELSE spo.actual_amount_ END +
+				   CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) percent_,DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') month_
+		FROM student_payment_order spo
+		<include refid="cooperationSql"/>
+		WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') BETWEEN #{startDate} AND #{endDate}
+		  AND cop.user_id_ = spo.user_id_
+		GROUP BY DATE_FORMAT(spo.pay_time_,'%Y-%m-%d')
+	</select>
+
+	<select id="getOrganTotalAmountDataWithTimelyByCoop" resultMap="IndexBaseMonthData">
+		SELECT SUM(CASE WHEN spo.actual_amount_ IS NULL THEN 0 ELSE spo.actual_amount_ END +
+		                         CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) percent_,
+		cop.organ_id_,cop.organ_name_
+		FROM student_payment_order spo
+		<include refid="cooperationSql"/>
+		WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') BETWEEN #{startDate} AND #{endDate}
+		GROUP BY cop.organ_id_ ORDER BY percent_ DESC
+	</select>
+
+	<select id="getTotalAmountDataWithTimelyDetailsByCoop" resultMap="IndexBaseMonthData">
+		SELECT spo.organ_id_,SUM(CASE WHEN spo.actual_amount_ IS NULL THEN 0 ELSE spo.actual_amount_ END +
+		                         CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) total_num_,
+			   SUM(CASE WHEN spo.actual_amount_ IS NULL THEN 0 ELSE spo.actual_amount_ END +
+		CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) activate_num_,
+			   SUM(CASE WHEN spo.actual_amount_ IS NULL THEN 0 ELSE spo.actual_amount_ END +
+		CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) percent_,DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') month_
+		FROM student_payment_order spo
+		<include refid="cooperationSql"/>
+		WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') BETWEEN #{startDate} AND #{endDate}
+		<if test="orderType != null">
+			AND FIND_IN_SET(spo.type_,#{orderType})
+		</if>
+		<if test="notOrderType != null">
+			AND spo.type_ NOT IN
+			<foreach collection="notOrderType" open="(" close=")" item="item" separator=",">
+				#{item}
+			</foreach>
+		</if>
+		GROUP BY DATE_FORMAT(spo.pay_time_,'%Y-%m-%d')
+	</select>
+
+	<select id="getOrganTotalAmountDataWithTimelyDetailsByCoop" resultMap="IndexBaseMonthData">
+		SELECT SUM(CASE WHEN spo.actual_amount_ IS NULL THEN 0 ELSE spo.actual_amount_ END +
+		CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) percent_,
+		cop.organ_id_,cop.organ_name_
+		FROM student_payment_order spo
+		<include refid="cooperationSql"/>
+		AND spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') BETWEEN #{startDate} AND #{endDate}
+		<if test="orderType != null">
+			AND FIND_IN_SET(spo.type_,#{orderType})
+		</if>
+		<if test="notOrderType != null">
+			AND spo.type_ NOT IN
+			<foreach collection="notOrderType" open="(" close=")" item="item" separator=",">
+				#{item}
+			</foreach>
+		</if>
+		GROUP BY cop.organ_id_ ORDER BY percent_ DESC
+	</select>
+
+	<select id="getVipAmountDataWithTimelyDetailsByCoop" resultMap="IndexBaseMonthData">
+		SELECT c.organ_id_,SUM(c.total_num_) total_num_,SUM(c.total_num_) activate_num_,SUM(c.total_num_) percent_,month_ FROM (
+		SELECT cop.organ_id_,SUM(CASE WHEN spod.price_ IS NULL THEN 0 ELSE spod.price_ END) total_num_,DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') month_
+		FROM student_payment_order spo
+		<include refid="cooperationSql"/>
+		LEFT JOIN student_payment_order_detail spod ON spo.id_ = spod.payment_order_id_
+		WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') BETWEEN #{startDate} AND #{endDate}
+		AND spo.type_ = 'DEGREE' AND spod.type_ IN ('THEORY_COURSE','VIP')
+		GROUP BY DATE_FORMAT(spo.pay_time_,'%Y-%m-%d')
+		UNION ALL
+		SELECT cop.organ_id_,SUM(CASE WHEN spo.actual_amount_ IS NULL THEN 0 ELSE spo.actual_amount_ END +
+		CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) total_num_
+		,DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') month_
+		FROM student_payment_order spo
+		<include refid="cooperationSql"/>
+		WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') BETWEEN #{startDate} AND #{endDate}
+		AND spo.type_ = 'SMALL_CLASS_TO_BUY'
+		GROUP BY DATE_FORMAT(spo.pay_time_,'%Y-%m-%d')
+		)c GROUP BY DATE_FORMAT(c.month_,'%Y-%m-%d')
+	</select>
+
+	<select id="getOrganVipAmountDataWithTimelyDetailsByCoop" resultMap="IndexBaseMonthData">
+		SELECT c.organ_id_,c.organ_name_,SUM(c.total_num_) percent_ FROM
+		(SELECT cop.organ_id_,cop.organ_name_,SUM(CASE WHEN spod.price_ IS NULL THEN 0 ELSE spod.price_ END) total_num_
+		FROM student_payment_order spo
+		<include refid="cooperationSql"/>
+		LEFT JOIN student_payment_order_detail spod ON spo.id_ = spod.payment_order_id_
+		WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') BETWEEN #{startDate} AND #{endDate}
+		AND spo.type_ = 'DEGREE' AND spod.type_ IN ('THEORY_COURSE','VIP')
+		GROUP BY cop.organ_id_
+		UNION ALL
+		SELECT cop.organ_id_,cop.organ_name_,SUM(CASE WHEN spo.actual_amount_ IS NULL THEN 0 ELSE spo.actual_amount_ END +
+		CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) total_num_
+		FROM student_payment_order spo
+		<include refid="cooperationSql"/>
+		WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') BETWEEN #{startDate} AND #{endDate}
+		AND spo.type_ = 'SMALL_CLASS_TO_BUY'
+		GROUP BY cop.organ_id_
+		)c
+		GROUP BY c.organ_id_ ORDER BY percent_ DESC
+	</select>
+
+	<select id="getOtherAmountDataWithTimelyDetailsByCoop" resultMap="IndexBaseMonthData">
+		SELECT c.organ_id_,SUM(c.total_num_) total_num_,SUM(c.total_num_) activate_num_,SUM(c.total_num_) percent_,month_,c.type_ order_type_ FROM (
+		SELECT cop.organ_id_,SUM(CASE WHEN spo.actual_amount_ IS NULL THEN 0 ELSE spo.actual_amount_ END +
+							   CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) total_num_
+		   ,DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') month_,spo.type_
+		FROM student_payment_order spo
+		<include refid="cooperationSql"/>
+		WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') BETWEEN #{startDate} AND #{endDate}
+		AND spo.type_ NOT IN ('APPLY','RENEW','PRACTICE_GROUP_BUY','PRACTICE_GROUP_RENEW','SMALL_CLASS_TO_BUY','DEGREE')
+		GROUP BY DATE_FORMAT(spo.pay_time_,'%Y-%m-%d'),spo.type_
+		UNION ALL
+		SELECT cop.organ_id_,SUM(CASE WHEN spod.price_ IS NULL THEN 0 ELSE spod.price_ END) total_num_,DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') month_,spo.type_
+		FROM student_payment_order spo
+		<include refid="cooperationSql"/>
+		LEFT JOIN student_payment_order_detail spod ON spo.id_ = spod.payment_order_id_
+		WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') BETWEEN #{startDate} AND #{endDate}
+		AND spo.type_ = 'DEGREE' AND spod.type_ = 'DEGREE_REGISTRATION'
+		GROUP BY DATE_FORMAT(spo.pay_time_,'%Y-%m-%d'),spo.type_
+		)c GROUP BY DATE_FORMAT(c.month_,'%Y-%m-%d'),c.type_
+	</select>
+
+	<select id="getOrganOtherAmountDataWithTimelyDetailsByCoop" resultMap="IndexBaseMonthData">
+		SELECT c.organ_id_,c.organ_name_,SUM(c.total_num_) percent_ FROM
+		(
+		SELECT cop.organ_id_,cop.organ_name_,SUM(CASE WHEN spo.actual_amount_ IS NULL THEN 0 ELSE spo.actual_amount_ END +
+							   CASE WHEN spo.balance_payment_amount_ IS NULL THEN 0 ELSE spo.balance_payment_amount_ END) total_num_,spo.type_
+		FROM student_payment_order spo
+		<include refid="cooperationSql"/>
+		WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') BETWEEN #{startDate} AND #{endDate}
+		AND spo.type_ NOT IN ('APPLY','RENEW','PRACTICE_GROUP_BUY','PRACTICE_GROUP_RENEW','SMALL_CLASS_TO_BUY','DEGREE')
+		GROUP BY cop.organ_id_,spo.type_
+		UNION ALL
+		SELECT cop.organ_id_,cop.organ_name_,SUM(CASE WHEN spod.price_ IS NULL THEN 0 ELSE spod.price_ END) total_num_,spo.type_
+		FROM student_payment_order spo
+		<include refid="cooperationSql"/>
+		LEFT JOIN student_payment_order_detail spod ON spo.id_ = spod.payment_order_id_
+		WHERE spo.status_ = 'SUCCESS' AND DATE_FORMAT(spo.pay_time_,'%Y-%m-%d') BETWEEN #{startDate} AND #{endDate}
+		AND spo.type_ = 'DEGREE' AND spod.type_ = 'DEGREE_REGISTRATION'
+		GROUP BY cop.organ_id_,spo.type_
+		)c
+		GROUP BY c.organ_id_ ORDER BY percent_ DESC
+	</select>
+
 	<sql id="queryTeacherServeInfoCondition">
 		<where>
 			 sees.tenant_id_ = #{tenantId}

+ 28 - 10
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -632,6 +632,20 @@
             </foreach>
     </select>
 
+    <select id="getOrgansTodayTotalCloudStudyStudentNumMap" resultType="java.util.Map">
+        SELECT mg.organ_id_ 'key',COUNT(DISTINCT smcr.user_id_) 'value'
+        FROM sys_music_compare_record smcr
+        LEFT JOIN student_registration sr ON smcr.user_id_ = sr.user_id_
+        LEFT JOIN music_group mg ON mg.id_ = sr.music_group_id_
+        WHERE sr.music_group_status_ = 'NORMAL' AND mg.status_ IN ('PROGRESS','PAUSE')
+        AND smcr.create_time_ > date_sub(curdate(),INTERVAL 0 day)
+            AND mg.organ_id_ IN
+            <foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+                #{organId}
+            </foreach>
+        GROUP BY mg.organ_id_
+    </select>
+
     <select id="getOrganCloudStudyStudentNum" resultType="map">
         SELECT
             su.organ_id_ 'key',
@@ -1156,6 +1170,7 @@
     </select>
     <resultMap id="CloudTeacherSumDto" type="com.ym.mec.biz.dal.dto.CloudTeacherSumDto">
         <result property="organName" column="organ_name_"/>
+        <result property="teacherName" column="teacher_name_"/>
         <result property="normalNum" column="normal_num_"/>
         <result property="train0" column="train0"/>
         <result property="train1" column="train1"/>
@@ -1176,9 +1191,11 @@
         left join student_registration sr ON mg.id_ = sr.music_group_id_
         where mg.status_ IN ('PROGRESS','PAUSE') AND sr.music_group_status_ = 'NORMAL') mg
         left join student s ON mg.user_id_ = s.user_id_
-        left join (select smcr.user_id_,ROUND(SUM(smcr.play_time_)/60/#{queryInfo.weekBetween}) train_time_ from sys_music_compare_record smcr
-        where DATE_FORMAT(smcr.create_time_,'%Y-%m-%d') between #{queryInfo.startDate} AND #{queryInfo.endDate}
-        group by smcr.user_id_) smcr ON s.user_id_ = smcr.user_id_
+        left join (select smcr.user_id_,ROUND(SUM(smcr.train_time_)/60/#{queryInfo.weekBetween}) train_time_ from sys_music_compare_week_data smcr
+        where monday_ IN
+        <foreach collection="queryInfo.mondays" separator="," open="(" close=")" item="monday">
+            #{monday}
+        </foreach> group by smcr.user_id_) smcr ON s.user_id_ = smcr.user_id_
         left JOIN sys_user su ON su.id_ = mg.user_id_
         left join organization o ON o.id_ = su.organ_id_
         where s.membership_end_time_ >= NOW()
@@ -1200,7 +1217,7 @@
         </if>
     </select>
     <select id="queryCloudTeacherSumDetail" resultMap="CloudTeacherSumDto">
-        select COUNT(distinct s.user_id_) normal_num_,COUNT(distinct smcr.user_id_) train_student_num_,
+        select su.real_name_ teacher_name_,COUNT(distinct s.user_id_) normal_num_,COUNT(distinct smcr.user_id_) train_student_num_,
         COUNT(distinct CASE WHEN smcr.train_time_ &lt; 60 THEN smcr.user_id_ END) 'train1',
         COUNT(distinct CASE WHEN smcr.train_time_ >= 60 AND smcr.train_time_ &lt; 120 THEN smcr.user_id_ END) 'train2',
         COUNT(distinct CASE WHEN smcr.train_time_ >= 120 AND smcr.train_time_ &lt; 240 THEN smcr.user_id_ END) 'train3',
@@ -1211,14 +1228,15 @@
         left join student_registration sr ON mg.id_ = sr.music_group_id_
         where mg.status_ IN ('PROGRESS','PAUSE') AND sr.music_group_status_ = 'NORMAL') mg ON mg.user_id_ = stm.student_id_
         left join student s ON mg.user_id_ = s.user_id_
-        left join (select smcr.user_id_,ROUND(SUM(smcr.play_time_)/60/#{queryInfo.weekBetween}) train_time_ from sys_music_compare_record smcr
-        where DATE_FORMAT(smcr.create_time_,'%Y-%m-%d') between #{queryInfo.startDate} AND #{queryInfo.endDate}
+        left join (select smcr.user_id_,ROUND(SUM(smcr.train_time_)/60/#{queryInfo.weekBetween}) train_time_ from sys_music_compare_week_data smcr
+        where monday_ IN
+        <foreach collection="queryInfo.mondays" separator="," open="(" close=")" item="monday">
+            #{monday}
+        </foreach>
         group by smcr.user_id_) smcr ON s.user_id_ = smcr.user_id_
+        left JOIN teacher t ON t.id_ = stm.teacher_id_
         left JOIN sys_user su ON su.id_ = mg.user_id_
-        where s.membership_end_time_ >= NOW() AND stm.teacher_type_ = 'NORMAL'
-        <if test="queryInfo.organId != null and queryInfo.organId != ''">
-            AND FIND_IN_SET(su.organ_id_,#{queryInfo.organId})
-        </if>
+        where s.membership_end_time_ >= NOW() AND stm.teacher_type_ = 'NORMAL' AND t.organ_id_ = #{organId}
         group by stm.teacher_id_
         <include refid="global.limit"/>
     </select>

+ 4 - 0
mec-web/src/main/resources/exportColumnMapper.ini

@@ -326,6 +326,10 @@ fieldColumns = ["organName","normalNum","courseConsumerNum","courseSum","courseC
 headColumns = ["分部", "在读人数","练习人数","练习率","<60分钟", "60~120分钟","120~240分钟",">240分钟","平均练习时长","练习达标占比"]
 fieldColumns = ["organName","normalNum","trainStudentNum","trainRate+'%'","train1","train2","train3","train4","avgTrainTime","trainStandRate+'%'"]
 
+[云教练统计详情导出]
+headColumns = ["声部老师", "在读人数","练习人数","练习率","<60分钟", "60~120分钟","120~240分钟",">240分钟","平均练习时长","练习达标占比"]
+fieldColumns = ["teacherName","normalNum","trainStudentNum","trainRate+'%'","train1","train2","train3","train4","avgTrainTime","trainStandRate+'%'"]
+
 [班级列表导出]
 headColumns = ["课程组编号", "课程组名称", "分部名称", "班级名称","班级类型", "班级人数", "主教老师", "助教老师", "已上课时", "总课数"]
 fieldColumns = ["musicGroupId", "musicGroupName", "organName", "name","type.msg", "studentNum == NUll?0:studentNum", "bishopTeacherName", "teachingTeacherName", "currentClassTimes","totalClassTimes"]