瀏覽代碼

一堆导出需求

zouxuan 1 年之前
父節點
當前提交
5f9d7ba547
共有 21 個文件被更改,包括 885 次插入343 次删除
  1. 0 5
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleStudentPaymentDao.java
  2. 37 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ExportDao.java
  3. 247 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ExportWrapper.java
  4. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/ExportEnum.java
  5. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/ExportTypeEnum.java
  6. 15 12
      mec-biz/src/main/java/com/ym/mec/biz/service/ExportService.java
  7. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderService.java
  8. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupService.java
  9. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupSubjectGoodsGroupService.java
  10. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/service/PracticeGroupService.java
  11. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/service/SellOrderService.java
  12. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/service/VipGroupService.java
  13. 267 218
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExportServiceImpl.java
  14. 4 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java
  15. 50 52
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  16. 4 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupSubjectGoodsGroupServiceImpl.java
  17. 4 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java
  18. 4 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SellOrderServiceImpl.java
  19. 5 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  20. 0 56
      mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml
  21. 218 0
      mec-biz/src/main/resources/config/mybatis/ExportMapper.xml

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

@@ -6,7 +6,6 @@ import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
 import com.ym.mec.biz.dal.entity.CourseScheduleStudentPaymentDto;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.common.dal.BaseDAO;
-
 import org.apache.ibatis.annotations.Param;
 
 import java.math.BigDecimal;
@@ -585,10 +584,6 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
     List<Mapper> queryUserMusicGroupCourseNumByClassTime(@Param("groupType") GroupType groupType, @Param("musicGroupIds") Set<String> musicGroupIds,
 			@Param("userId") Integer userId, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
 
-	Boolean hasStudentMusicTheoryCourseInfo(@Param("organId") String organId, @Param("tenantId") Integer tenantId, @Param("groupType") String groupType);
-
-    List<ExportStudentCourseInfoDto> queryStudentCourseInfo(@Param("organId") String organId, @Param("tenantId") Integer tenantId, @Param("groupType") String groupType);
-
     /**
     * @description: 获取学员第一个课程组编号
      * @param groupType

+ 37 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ExportDao.java

@@ -0,0 +1,37 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.dto.ExportStudentCourseInfoDto;
+import com.ym.mec.biz.dal.dto.ExportWrapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface ExportDao {
+
+    //平衡关系-乐团课
+    List<ExportWrapper.ExportBalancedRelationshipMusicCourse> exportBalancedRelationshipMusicCourse(@Param("month") String month);
+
+    //平衡关系-VIP已排课
+    List<ExportWrapper.ExportBalancedRelationshipVipCourse> exportBalancedRelationshipVipCourse(@Param("month") String month);
+
+    //平衡关系-VIP未排课
+    List<ExportWrapper.ExportBalancedRelationshipVipNoCourse> exportBalancedRelationshipVipNoCourse(@Param("month") String month);
+
+    //平衡关系-乐团课剩余时长
+    List<ExportWrapper.ExportBalancedRelationshipMusicSubCourse> exportBalancedRelationshipMusicSubCourse(@Param("month") String month);
+
+    //平衡关系-学员情况总表
+    List<ExportWrapper.ExportBalancedRelationshipStudentInfo> exportBalancedRelationshipStudentInfo(@Param("month") String month);
+
+    //平衡关系(分表)-乐团在读学员
+    List<ExportWrapper.ExportBalancedRelationshipStudentNormalDetail> exportBalancedRelationshipStudentNormalDetail();
+
+    //平衡关系(分表)-乐团退团学员
+    List<ExportWrapper.ExportBalancedRelationshipStudentQuitDetail> exportBalancedRelationshipStudentQuitDetail(@Param("month") String month);
+
+    //小组课学员课程导出
+    Boolean hasStudentMusicTheoryCourseInfo(@Param("organId") String organId, @Param("tenantId") Integer tenantId, @Param("groupType") String groupType);
+
+    //小组课学员课程导出
+    List<ExportStudentCourseInfoDto> queryStudentCourseInfo(@Param("organId") String organId, @Param("tenantId") Integer tenantId, @Param("groupType") String groupType);
+}

+ 247 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ExportWrapper.java

@@ -4,6 +4,9 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+/**
+ * @author zx
+ */
 @ApiModel(description = "导出对象")
 public class ExportWrapper {
 
@@ -49,7 +52,251 @@ public class ExportWrapper {
 
         @ApiModelProperty("集训单技课")
         private Integer trainingSingle;
+    }
+
+    @Data
+    @ApiModel("平衡关系(分表)-乐团退团")
+    public static class ExportBalancedRelationshipStudentQuitDetail {
+        @ApiModelProperty("分部")
+        private String organName;
+
+        @ApiModelProperty("乐团编号")
+        private String musicGroupId;
+
+        @ApiModelProperty("乐团名称")
+        private String musicGroupName;
+
+        @ApiModelProperty("学员编号")
+        private String studentId;
+
+        @ApiModelProperty("学员姓名")
+        private String studentName;
+    }
+
+    @Data
+    @ApiModel("平衡关系(分表)-乐团新增")
+    public static class ExportBalancedRelationshipStudentAddDetail {
+        @ApiModelProperty("分部")
+        private String organName;
+
+        @ApiModelProperty("乐团编号")
+        private String musicGroupId;
+
+        @ApiModelProperty("乐团名称")
+        private String musicGroupName;
+
+        @ApiModelProperty("学员编号")
+        private String studentId;
+
+        @ApiModelProperty("学员姓名")
+        private String studentName;
+    }
+
+    @Data
+    @ApiModel("平衡关系(分表)-乐团在读学员")
+    public static class ExportBalancedRelationshipStudentNormalDetail {
+        @ApiModelProperty("分部")
+        private String organName;
+
+        @ApiModelProperty("乐团编号")
+        private String musicGroupId;
+
+        @ApiModelProperty("乐团名称")
+        private String musicGroupName;
+
+        @ApiModelProperty("学员编号")
+        private String studentId;
+
+        @ApiModelProperty("学员名称")
+        private String studentName;
+    }
+
+    @Data
+    @ApiModel("平衡关系-学员情况总表")
+    public static class ExportBalancedRelationshipStudentInfo {
+        @ApiModelProperty("分部")
+        private String organName;
+
+        @ApiModelProperty("进行中乐团数")
+        private Integer musicGroupCount;
+
+        @ApiModelProperty("当月在读学员总数")
+        private Integer currentMonthStudentCount;
+
+        @ApiModelProperty("当月新增学员")
+        private Integer currentMonthAddStudentCount;
+
+        @ApiModelProperty("当月退团学员")
+        private Integer currentMonthQuitStudentCount;
+    }
+
+    @Data
+    @ApiModel("平衡关系-乐团课剩余时长")
+    public static class ExportBalancedRelationshipMusicSubCourse {
+        @ApiModelProperty("分部")
+        private String organName;
+
+        @ApiModelProperty("乐团编号")
+        private String musicGroupId;
+
+        @ApiModelProperty("乐团名称")
+        private String musicGroupName;
+
+        @ApiModelProperty("缴费批次号")
+        private String paymentBatchNo;
+
+        @ApiModelProperty("缴费收费金额")
+        private String paymentAmount;
+
+        @ApiModelProperty("学员编号")
+        private String studentId;
+
+        @ApiModelProperty("课堂课")
+        private Integer classroom;
+
+        @ApiModelProperty("综合课")
+        private Integer comprehensive;
+
+        @ApiModelProperty("基础技能课")
+        private Integer high;
+
+        @ApiModelProperty("线上基础技能课")
+        private Integer highOnline;
+
+        @ApiModelProperty("合奏课")
+        private Integer mix;
+
+        @ApiModelProperty("单技课")
+        private Integer single;
+
+        @ApiModelProperty("集训合奏课")
+        private Integer trainingMix;
+
+        @ApiModelProperty("集训单技课")
+        private Integer trainingSingle;
+
+    }
+
+    @Data
+    @ApiModel("平衡关系-VIP未排课")
+    public static class ExportBalancedRelationshipVipNoCourse {
+        @ApiModelProperty("分部")
+        private String organName;
+
+        @ApiModelProperty("学员姓名")
+        private String studentName;
+
+        @ApiModelProperty("学员编号")
+        private String studentId;
+
+        @ApiModelProperty("课程类型")
+        private String courseType;
+
+        @ApiModelProperty("未排课时")
+        private Integer noCourse;
+
+        @ApiModelProperty("当月新增课时")
+        private Integer addCourse;
+    }
+
+    @Data
+    @ApiModel("平衡关系-VIP已排课")
+    public static class ExportBalancedRelationshipVipCourse {
+        @ApiModelProperty("分部")
+        private String organName;
+
+        @ApiModelProperty("学员姓名")
+        private String studentName;
+
+        @ApiModelProperty("学员编号")
+        private String studentId;
+
+        @ApiModelProperty("课程类型")
+        private String courseType;
+
+        @ApiModelProperty("当月剩余课时")
+        private Integer surplusCourse;
+
+        @ApiModelProperty("当月已上课时")
+        private Integer alreadyCourse;
+
+        @ApiModelProperty("当月消耗课时")
+        private Integer consumeCourse;
+
+        @ApiModelProperty("当月新增课时")
+        private Integer addCourse;
+    }
+
+    @Data
+    @ApiModel("平衡关系-乐团课")
+    public static class ExportBalancedRelationshipMusicCourse {
+        @ApiModelProperty("分部")
+        private String organName;
+
+        @ApiModelProperty("乐团名称")
+        private String musicGroupName;
+
+        @ApiModelProperty("乐团编号")
+        private String musicGroupId;
+
+        @ApiModelProperty("班级名称")
+        private String className;
+
+        @ApiModelProperty("班级类型")
+        private String classType;
+
+        @ApiModelProperty("班级编号")
+        private String classId;
+
+        @ApiModelProperty("课程类型")
+        private String courseType;
+
+        @ApiModelProperty("剩余课次")
+        private Integer surplusCourse;
+
+        @ApiModelProperty("剩余课次课酬")
+        private String surplusCourseReward;
+
+        @ApiModelProperty("剩余被合并课次")
+        private Integer surplusMergedCourse;
+
+        @ApiModelProperty("剩余被合并课次课酬")
+        private String surplusMergedCourseReward;
+
+        @ApiModelProperty("已上课次")
+        private Integer alreadyCourse;
+
+        @ApiModelProperty("已上课次课酬")
+        private String alreadyCourseReward;
+
+        @ApiModelProperty("已上被合并课次")
+        private Integer alreadyMergedCourse;
+
+        @ApiModelProperty("已上被合并课次课酬")
+        private String alreadyMergedCourseReward;
+
+        @ApiModelProperty("当月新增")
+        private Integer currentMonthAdd;
+
+        @ApiModelProperty("当月新增课酬")
+        private String currentMonthAddReward;
+
+        @ApiModelProperty("当月被合并新增")
+        private Integer currentMonthMergedAdd;
+
+        @ApiModelProperty("当月被合并新增课酬")
+        private String currentMonthMergedAddReward;
+
+        @ApiModelProperty("当月消耗")
+        private Integer currentMonthConsume;
+
+        @ApiModelProperty("当月消耗课酬")
+        private String currentMonthConsumeReward;
 
+        @ApiModelProperty("当月被合并消耗")
+        private Integer currentMonthMergedConsume;
 
+        @ApiModelProperty("当月被合并消耗课酬")
+        private String currentMonthMergedConsumeReward;
     }
 }

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

@@ -96,6 +96,13 @@ public enum ExportEnum implements BaseEnum<String, ExportEnum> {
     EXPORT_MUSIC_GROUP_ECHELON_DATA("EXPORT_MUSIC_GROUP_ECHELON_DATA","乐团梯队数据导出"),
     EXPORT_CLOUD_TEACHER_ORDER_INACTIVE("EXPORT_CLOUD_TEACHER_ORDER_INACTIVE","云教练待激活明细"),
     EXPORT_MUSIC_GROUP_NO_COURSE("EXPORT_MUSIC_GROUP_NO_COURSE","乐团未排课时长"),
+    EXPORT_BALANCED_RELATIONSHIP_MUSIC_COURSE("EXPORT_MUSIC_GROUP_NO_COURSE","平衡关系-乐团课"),
+    EXPORT_BALANCED_RELATIONSHIP_VIP_COURSE("EXPORT_BALANCED_RELATIONSHIP_VIP_COURSE","平衡关系-VIP已排课"),
+    EXPORT_BALANCED_RELATIONSHIP_VIP_NO_COURSE("EXPORT_BALANCED_RELATIONSHIP_VIP_NO_COURSE","平衡关系-VIP未排课"),
+    EXPORT_BALANCED_RELATIONSHIP_MUSIC_SUB_COURSE("EXPORT_BALANCED_RELATIONSHIP_MUSIC_SUB_COURSE","平衡关系-乐团课剩余时长"),
+    EXPORT_BALANCED_RELATIONSHIP_STUDENT_INFO("EXPORT_BALANCED_RELATIONSHIP_STUDENT_INFO","平衡关系-学员情况总表"),
+    EXPORT_BALANCED_RELATIONSHIP_STUDENT_NORMAL_DETAIL("EXPORT_BALANCED_RELATIONSHIP_STUDENT_NORMAL_DETAIL","平衡关系(分表)-乐团在读学员"),
+    EXPORT_BALANCED_RELATIONSHIP_STUDENT_QUIT_DETAIL("EXPORT_BALANCED_RELATIONSHIP_STUDENT_QUIT_DETAIL","平衡关系(分表)-乐团退团学员"),
     ;
 
     private String code;

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/ExportTypeEnum.java

@@ -34,6 +34,13 @@ public enum ExportTypeEnum implements BaseEnum<Integer, ExportTypeEnum> {
 	CLOUD_COACH_ACTIVATION_DETAILS(27,"云教练激活明细"),
 	EXPORT_COURSE_INCOME(28,"课程收入明细导出"),
 	EXPORT_MUSIC_GROUP_ECHELON_DATA(29,"乐团梯队数据导出"),
+	EXPORT_BALANCED_RELATIONSHIP_MUSIC_COURSE(30,"平衡关系-乐团课"),
+	EXPORT_BALANCED_RELATIONSHIP_VIP_COURSE(31,"平衡关系-VIP已排课"),
+	EXPORT_BALANCED_RELATIONSHIP_VIP_NO_COURSE(32,"平衡关系-VIP未排课"),
+	EXPORT_BALANCED_RELATIONSHIP_MUSIC_SUB_COURSE(33,"平衡关系-乐团课剩余时长"),
+	EXPORT_BALANCED_RELATIONSHIP_STUDENT_INFO(34,"平衡关系-学员情况总表"),
+	EXPORT_BALANCED_RELATIONSHIP_STUDENT_NORMAL_DETAIL(35,"平衡关系(分表)-乐团在读学员"),
+	EXPORT_BALANCED_RELATIONSHIP_STUDENT_QUIT_DETAIL(36,"平衡关系(分表)-乐团退团学员"),
 	;
 
 	private Integer code;

+ 15 - 12
mec-biz/src/main/java/com/ym/mec/biz/service/ExportService.java

@@ -19,6 +19,9 @@ import java.util.function.BiFunction;
 import java.util.function.Function;
 
 
+/**
+ * @author zx
+ */
 public interface ExportService {
 
     Map<String,String> getExportMap(ExportDto exportDto) throws IOException;
@@ -27,7 +30,7 @@ public interface ExportService {
 
     <T> void export(HttpServletResponse response, List<T> rows, ExportDto exportDto) throws IOException;
 
-    Map<ExportEnum, Function<Map<String, Object>, HttpResponseResult>> getExportManageFuncMap();
+    Map<ExportEnum, Function<Map<String, Object>, HttpResponseResult<String>>> getExportManageFuncMap();
 
     Map<ExportEnum, Function<Map<String, Object>, List>> getExportFuncMap();
 
@@ -234,31 +237,31 @@ public interface ExportService {
     void musicGroupRegister(HttpServletResponse response, ExportDto exportDto) throws IOException;
 
     //财务管理导出
-    HttpResponseResult routeOrderList(Map<String, Object> info);
-    HttpResponseResult routeMallOrderList(Map<String, Object> info);
+    HttpResponseResult<String> routeOrderList(Map<String, Object> info);
+    HttpResponseResult<String> routeMallOrderList(Map<String, Object> info);
 
     //学员小课记录导出
-    HttpResponseResult exportStudentVipPractice(Map<String, Object> info);
+    HttpResponseResult<String> exportStudentVipPractice(Map<String, Object> info);
 
     //学员小课记录导出
-    HttpResponseResult exportStudentVipCourseInfo(Map<String, Object> info);
+    HttpResponseResult<String> exportStudentVipCourseInfo(Map<String, Object> info);
 
     //vip学员课程管理
-    HttpResponseResult exportVipStudentCourseManage(Map<String, Object> info) throws Exception;
+    HttpResponseResult<String> exportVipStudentCourseManage(Map<String, Object> info) throws Exception;
 
     //导出活动资格
-    HttpResponseResult exportStudentSubCourse(Map<String, Object> info);
+    HttpResponseResult<String> exportStudentSubCourse(Map<String, Object> info);
 
     //学员小课记录导出
-    HttpResponseResult exportStudentMusicTheoryCourseInfo(Map<String, Object> info);
+    HttpResponseResult<String> exportStudentMusicTheoryCourseInfo(Map<String, Object> info);
 
     //订单列表导出
-    HttpResponseResult orderList(Map<String, Object> info);
+    HttpResponseResult<String> orderList(Map<String, Object> info);
 
-    HttpResponseResult mallOrderList(Map<String, Object> info);
+    HttpResponseResult<String> mallOrderList(Map<String, Object> info);
 
     //订单列表汇总导出
-    HttpResponseResult orderListSum(Map<String, Object> info);
+    HttpResponseResult<String> orderListSum(Map<String, Object> info);
 
     //保存下载记录
     ManagerDownload saveManagerDownload(ExportTypeEnum exportTypeEnum, Integer userId);
@@ -292,5 +295,5 @@ public interface ExportService {
 
     void exportMusicGroupCourseList(ManagerDownload managerDownload, ExportUserAccountQueryInfo queryInfo);
 
-    HttpResponseResult asyncExport(Runnable runnable,String excelName);
+    HttpResponseResult<String> asyncExport(Runnable runnable,String excelName);
 }

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderService.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service;
 
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
@@ -19,6 +20,8 @@ import java.util.Set;
 
 public interface MusicGroupPaymentCalenderService extends BaseService<Long, MusicGroupPaymentCalender> {
 
+	MusicGroupPaymentCalenderDao getDao();
+
 	/**
 	 * 创建缴费信息(目前只支持合班缴费)
 	 * @param musicGroupPaymentCalenderDto

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupService.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service;
 
+import com.ym.mec.biz.dal.dao.MusicGroupDao;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.SysUserRoleEnum;
@@ -21,6 +22,7 @@ import java.util.Map;
 import java.util.Set;
 
 public interface MusicGroupService extends BaseService<String, MusicGroup> {
+    MusicGroupDao getDao();
 	
 	/**
 	 * 将学生导入至乐团中

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupSubjectGoodsGroupService.java

@@ -2,11 +2,14 @@ package com.ym.mec.biz.service;
 
 import java.util.List;
 
+import com.ym.mec.biz.dal.dao.MusicGroupSubjectGoodsGroupDao;
 import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
 import com.ym.mec.common.service.BaseService;
 
 public interface MusicGroupSubjectGoodsGroupService extends BaseService<Long, MusicGroupSubjectGoodsGroup> {
 
+    MusicGroupSubjectGoodsGroupDao getDao();
+
     /**
      * 获取乐团声部对应的商品
      * @param musicGroupId

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

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service;
 
+import com.ym.mec.biz.dal.dao.PracticeGroupDao;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.PracticeGroup;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
@@ -18,6 +19,8 @@ import java.util.Map;
 
 public interface PracticeGroupService extends BaseService<Long, PracticeGroup> {
 
+	PracticeGroupDao getDao();
+
 	/**
 	 * @describe 获取学生的陪练课
 	 * @author Joburgess

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/SellOrderService.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.service;
 
 
+import com.ym.mec.biz.dal.dao.SellOrderDao;
 import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.SellOrder;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
@@ -14,6 +15,8 @@ import java.util.Map;
 
 public interface SellOrderService extends BaseService<Integer, SellOrder> {
 
+    SellOrderDao getDao();
+
     /**
      * 添加销售订单
      *

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/VipGroupService.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.ym.mec.biz.dal.dao.VipGroupDao;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.StudentApplyRefunds.StudentApplyRefundsStatus;
@@ -18,6 +19,7 @@ import java.util.List;
 import java.util.Map;
 
 public interface VipGroupService extends BaseService<Long, VipGroup> {
+    VipGroupDao getDao();
 
     HttpResponseResult updateLiveGroup(VipGroupApplyDto vipGroup);
 

文件差異過大導致無法顯示
+ 267 - 218
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExportServiceImpl.java


+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -144,6 +144,10 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
         return musicGroupPaymentCalenderDao;
     }
 
+    public MusicGroupPaymentCalenderDao getDao() {
+        return musicGroupPaymentCalenderDao;
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public String create(MusicGroupPaymentCalenderDto musicGroupPaymentCalenderDto) {

+ 50 - 52
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -82,10 +82,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     private MusicGroupDao musicGroupDao;
     @Autowired
     private TeacherDao teacherDao;
-
     @Autowired
     private MusicGroupDeliveryRecordDao musicGroupDeliveryRecordDao;
-
     @Autowired
     private StudentService studentService;
     @Autowired
@@ -93,16 +91,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     @Autowired
     private SchoolDao schoolDao;
     @Autowired
-    private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
-    @Autowired
     private MusicGroupPaymentCalenderMemberDao musicGroupPaymentCalenderMemberDao;
     @Autowired
     private MusicGroupPaymentCalenderService musicGroupPaymentCalenderService;
     @Autowired
     private MusicGroupPaymentEntitiesDao musicGroupPaymentEntitiesDao;
     @Autowired
-    private MusicGroupSubjectGoodsGroupDao musicGroupSubjectGoodsGroupDao;
-    @Autowired
     private MusicGroupSubjectPlanDao musicGroupSubjectPlanDao;
     @Autowired
     private StudentTeacherMapperDao studentTeacherMapperDao;
@@ -241,6 +235,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         return musicGroupDao;
     }
 
+	public MusicGroupDao getDao() {
+		return musicGroupDao;
+	}
+
     @Override
     @Transactional(rollbackFor = Exception.class)
 	public boolean importStudentToMusicGroup(String musicGroupId, Map<String, List<Map<String, Object>>> excelData) {
@@ -317,7 +315,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     	}
 
     	//查询课程费用是否是0
-    	MusicGroupPaymentCalender musicGroupPaymentCalender = musicGroupPaymentCalenderDao.findByMusicGroupRegCalender(musicGroupId);
+    	MusicGroupPaymentCalender musicGroupPaymentCalender = musicGroupPaymentCalenderService.getDao().findByMusicGroupRegCalender(musicGroupId);
     	if(musicGroupPaymentCalender == null){
     		throw new BizException("请先创建乐团报名缴费");
     	}
@@ -429,7 +427,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 				}
 			}
 			musicGroupPaymentCalender.setUpdateTime(nowDate);
-			musicGroupPaymentCalenderDao.update(musicGroupPaymentCalender);
+			musicGroupPaymentCalenderService.getDao().update(musicGroupPaymentCalender);
 
 			MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = null;
 			List<MusicGroupPaymentCalenderDetail> insertMusicGroupPaymentCalenderDetailList = new ArrayList<MusicGroupPaymentCalenderDetail>();
@@ -628,7 +626,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 				calender.setExpectNum(calender.getExpectNum() + allList.size());
 			}
 			calender.setUpdateTime(now);
-			musicGroupPaymentCalenderDao.update(calender);
+			musicGroupPaymentCalenderService.getDao().update(calender);
 		}
 	}
 
@@ -742,7 +740,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                     musicGroupSubjectGoodsGroup.setGroupRemissionCourseFee(0);
                 }
             }
-            musicGroupSubjectGoodsGroupDao.batchInsert(musicGroupSubjectGoodsGroups, musicGroupId);
+			musicGroupSubjectGoodsGroupService.getDao().batchInsert(musicGroupSubjectGoodsGroups, musicGroupId);
         }
         return musicGroupId;
     }
@@ -833,11 +831,11 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "预报名完成(预报名 -> 报名缴费中)", sysUser.getId(), ""));
 
         studentRegistrationDao.musicGroupOpenPay(musicGroupId, PaymentStatusEnum.OPEN);
-        MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderDao.findByMusicGroupRegCalender(musicGroupId);
+        MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderService.getDao().findByMusicGroupRegCalender(musicGroupId);
         if (regCalender != null && regCalender.getPayUserType().equals(MusicGroupPaymentCalender.PayUserType.STUDENT)) {
             regCalender.setStatus(MusicGroupPaymentCalender.PaymentCalenderStatusEnum.OPEN);
             regCalender.setUpdateTime(new Date());
-            musicGroupPaymentCalenderDao.update(regCalender);
+            musicGroupPaymentCalenderService.getDao().update(regCalender);
         }
         //三方乐团不发送缴费通知
         if (musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN) {
@@ -1006,7 +1004,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     public HttpResponseResult renew(RegisterPayDto renewParamDto) throws Exception {
         Long calenderId = renewParamDto.getCalenderId();
         Integer userId = renewParamDto.getUserId();
-        MusicGroupPaymentCalender calender = musicGroupPaymentCalenderDao.get(calenderId);
+        MusicGroupPaymentCalender calender = musicGroupPaymentCalenderService.getDao().get(calenderId);
         StudentRegistration studentRegistration = studentRegistrationService.queryByUserIdAndMusicGroupId(userId, calender.getMusicGroupId());
         if (studentRegistration == null) {
             throw new BizException("请走报名缴费流程");
@@ -1139,7 +1137,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         Map<String, List<MusicGroupPaymentImportDto>> dtoMap = importDtos.stream().collect(Collectors.groupingBy(e -> e.getBatchNo()));
         Date now = new Date();
         for (String batchNo : dtoMap.keySet()) {
-            List<MusicGroupPaymentCalender> byBatchNo = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
+            List<MusicGroupPaymentCalender> byBatchNo = musicGroupPaymentCalenderService.getDao().findByBatchNo(batchNo);
             if(CollectionUtils.isEmpty(byBatchNo)){
                 throw new BizException("缴费项目批次{}不存在",batchNo);
             }
@@ -1344,7 +1342,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if (studentRegistration == null) {
             throw new BizException("报名信息有误,请核查");
         }
-        MusicGroupPaymentCalender musicGroupRegCalender = musicGroupPaymentCalenderDao.findByMusicGroupRegCalender(studentRegistration.getMusicGroupId());
+        MusicGroupPaymentCalender musicGroupRegCalender = musicGroupPaymentCalenderService.getDao().findByMusicGroupRegCalender(studentRegistration.getMusicGroupId());
         if (musicGroupRegCalender == null) {
             throw new BizException("缴费信息不存在");
         }
@@ -1543,7 +1541,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         //删除原有的乐团声部规划
         musicGroupSubjectPlanDao.delByMusicGroupId(musicGroupId);
         //删除原有的声部商品组合
-        musicGroupSubjectGoodsGroupDao.delByMusicGroupId(subFeeSettingDto.getMusicGroupId());
+		musicGroupSubjectGoodsGroupService.getDao().delByMusicGroupId(subFeeSettingDto.getMusicGroupId());
         if (musicGroupSubjectPlans != null && musicGroupSubjectPlans.size() > 0) {
             musicGroupSubjectPlans.forEach(e -> {
                 //修改课程费用
@@ -1576,7 +1574,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 }
             }
 
-            musicGroupSubjectGoodsGroupDao.batchInsert(subFeeSettingDto.getMusicGroupSubjectGoodsGroups(), musicGroupId);
+			musicGroupSubjectGoodsGroupService.getDao().batchInsert(subFeeSettingDto.getMusicGroupSubjectGoodsGroups(), musicGroupId);
         }
         sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{ORGAN_MANAGER},
                 null, null, MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, sysUser.getRealName(), musicGroup.getName());
@@ -1705,7 +1703,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         List<PaymentCalenderStatusEnum> statusList = new ArrayList<MusicGroupPaymentCalender.PaymentCalenderStatusEnum>();
         statusList.add(PaymentCalenderStatusEnum.DRAFT);
         //修改乐团报名缴费项目状态
-        List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderDao.queryByPaymentStatus(musicGroupId, statusList, null);
+        List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderService.getDao().queryByPaymentStatus(musicGroupId, statusList, null);
 
         if(musicGroupPaymentCalenderList == null || musicGroupPaymentCalenderList.size() == 0) {
         	throw new BizException("请先创建缴费项目");
@@ -1716,7 +1714,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         	t.setUpdateTime(date);
         });
 
-        musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenderList);
+        musicGroupPaymentCalenderService.getDao().batchUpdate(musicGroupPaymentCalenderList);
 
         sendSeoMessageSource.sendSeoMessage(musicGroup.getOrganId(), new SysUserRoleEnum[]{ORGAN_MANAGER},
                 null, null, MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, sysUser.getRealName(), musicGroup.getName());
@@ -1750,21 +1748,21 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             List<PaymentCalenderStatusEnum> statusList = new ArrayList<MusicGroupPaymentCalender.PaymentCalenderStatusEnum>();
             statusList.add(PaymentCalenderStatusEnum.AUDITING);
             //修改乐团报名缴费项目状态
-            List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderDao.queryByPaymentStatus(musicGroupId, statusList, null);
+            List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderService.getDao().queryByPaymentStatus(musicGroupId, statusList, null);
 
             musicGroupPaymentCalenderList.forEach(t -> {
             	t.setStatus(PaymentCalenderStatusEnum.DRAFT);
             	t.setUpdateTime(date);
             });
 
-            musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenderList);
+            musicGroupPaymentCalenderService.getDao().batchUpdate(musicGroupPaymentCalenderList);
 
         }else if(musicGroup.getStatus() == MusicGroupStatusEnum.FEE_AUDIT){
         	musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "乐团审核失败(费用审核中 -> 费用审核失败)", sysUser.getId(), memo));
         	List<PaymentCalenderStatusEnum> statusList = new ArrayList<MusicGroupPaymentCalender.PaymentCalenderStatusEnum>();
             statusList.add(PaymentCalenderStatusEnum.AUDITING);
             //修改乐团报名缴费项目状态
-            List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderDao.queryByPaymentStatus(musicGroupId, statusList, null);
+            List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderService.getDao().queryByPaymentStatus(musicGroupId, statusList, null);
 
             musicGroupPaymentCalenderList.forEach(t -> {
             	t.setStatus(PaymentCalenderStatusEnum.REJECT);
@@ -1772,7 +1770,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             	t.setMemo(memo);
             });
 
-            musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenderList);
+            musicGroupPaymentCalenderService.getDao().batchUpdate(musicGroupPaymentCalenderList);
 
             //修改乐团状态
             musicGroup.setStatus(MusicGroupStatusEnum.FEE_AUDIT_FAILED);
@@ -1811,7 +1809,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             List<PaymentCalenderStatusEnum> statusList = new ArrayList<MusicGroupPaymentCalender.PaymentCalenderStatusEnum>();
             statusList.add(PaymentCalenderStatusEnum.AUDITING);
             //修改乐团报名缴费项目状态
-            List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderDao.queryByPaymentStatus(musicGroupId, statusList, null);
+            List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderService.getDao().queryByPaymentStatus(musicGroupId, statusList, null);
 
             if(musicGroupPaymentCalenderList == null || musicGroupPaymentCalenderList.size() == 0){
             	throw new BizException("没有审核中的缴费项目");
@@ -1834,7 +1832,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             	t.setUpdateTime(date);
             });
 
-            musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenderList);
+            musicGroupPaymentCalenderService.getDao().batchUpdate(musicGroupPaymentCalenderList);
         }
         musicGroup.setUpdateTime(date);
         musicGroupDao.update(musicGroup);
@@ -1909,7 +1907,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     public List<MusicCardDto> queryUserMusicGroups(Integer userId) {
         List<MusicCardDto> musicCardDtos = musicGroupDao.queryUserMusicGroups(userId);
         Set<String> musicGroupIds = musicCardDtos.stream().map(MusicCardDto::getMusicGroupId).collect(Collectors.toSet());
-        Map<String, String> paymentStatus = MapUtil.convertMybatisMap(musicGroupPaymentCalenderDao.queryUserPaymentStatus(userId, StringUtils.join(musicGroupIds, ",")));
+        Map<String, String> paymentStatus = MapUtil.convertMybatisMap(musicGroupPaymentCalenderService.getDao().queryUserPaymentStatus(userId, StringUtils.join(musicGroupIds, ",")));
         // 获取学员在该乐团续费状态
         musicCardDtos.forEach(e -> {
             e.setPaymentStatus(paymentStatus.get(e.getMusicGroupId()));
@@ -2551,30 +2549,30 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             studentRegistrationDao.update(studentRegistration);
 
             //删除进行中加学生,且在审批中或拒绝的缴费
-            List<Long> paymentCalenderIdList = musicGroupPaymentCalenderDao.findStudentNoPaymentCalender(userId, musicGroupId);
+            List<Long> paymentCalenderIdList = musicGroupPaymentCalenderService.getDao().findStudentNoPaymentCalender(userId, musicGroupId);
             if (paymentCalenderIdList != null && paymentCalenderIdList.size() > 0) {
-                musicGroupPaymentCalenderDao.delByIds(paymentCalenderIdList);
+                musicGroupPaymentCalenderService.getDao().delByIds(paymentCalenderIdList);
             }
 
             //查询未交费的项目
             List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = musicGroupPaymentCalenderDetailDao.queryNotPaymentStudentByUserIdAndMusicGroupId(userId, musicGroupId);
 
             for (MusicGroupPaymentCalenderDetail mgpcd : musicGroupPaymentCalenderDetailList) {
-                MusicGroupPaymentCalender mgpc = musicGroupPaymentCalenderDao.get(mgpcd.getMusicGroupPaymentCalenderId());
+                MusicGroupPaymentCalender mgpc = musicGroupPaymentCalenderService.getDao().get(mgpcd.getMusicGroupPaymentCalenderId());
                 if (mgpc != null) {
                     if (mgpc.getPaymentType() == PaymentType.ADD_STUDENT) {
-                        musicGroupPaymentCalenderDao.delete(mgpc.getId());
+                        musicGroupPaymentCalenderService.getDao().delete(mgpc.getId());
                     } else {
                         // 缴费项目预计人数减一
                         mgpc.setExpectNum(mgpc.getExpectNum() - 1);
                         mgpc.setUpdateTime(date);
-                        musicGroupPaymentCalenderDao.update(mgpc);
+                        musicGroupPaymentCalenderService.getDao().update(mgpc);
                     }
                 }
                 musicGroupPaymentCalenderDetailDao.delete(mgpcd.getId());
             }
             //删除用户购买的课程记录
-            List<MusicGroupPaymentCalender> paymentCalenders = musicGroupPaymentCalenderDao.findByMusicGroupId(musicGroupId);
+            List<MusicGroupPaymentCalender> paymentCalenders = musicGroupPaymentCalenderService.getDao().findByMusicGroupId(musicGroupId);
             if(CollectionUtils.isNotEmpty(paymentCalenders)){
                 List<Long> calenderIds = paymentCalenders.stream().map(e -> e.getId()).collect(Collectors.toList());
                 musicGroupPaymentStudentCourseDetailService.deleteByMusicGroupPaymentCalenderId(StringUtils.join(calenderIds,","),userId);
@@ -2845,24 +2843,24 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         studentRegistrationDao.update(studentRegistration);
 
         //删除进行中加学生,且在审批中或拒绝的缴费
-        List<Long> paymentCalenderIdList = musicGroupPaymentCalenderDao.findStudentNoPaymentCalender(userId, musicGroupId);
+        List<Long> paymentCalenderIdList = musicGroupPaymentCalenderService.getDao().findStudentNoPaymentCalender(userId, musicGroupId);
         if (paymentCalenderIdList != null && paymentCalenderIdList.size() > 0) {
-            musicGroupPaymentCalenderDao.delByIds(paymentCalenderIdList);
+            musicGroupPaymentCalenderService.getDao().delByIds(paymentCalenderIdList);
         }
 
         //查询未交费的项目
         List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = musicGroupPaymentCalenderDetailDao.queryNotPaymentStudentByUserIdAndMusicGroupId(userId, musicGroupId);
 
         for (MusicGroupPaymentCalenderDetail mgpcd : musicGroupPaymentCalenderDetailList) {
-            MusicGroupPaymentCalender mgpc = musicGroupPaymentCalenderDao.get(mgpcd.getMusicGroupPaymentCalenderId());
+            MusicGroupPaymentCalender mgpc = musicGroupPaymentCalenderService.getDao().get(mgpcd.getMusicGroupPaymentCalenderId());
             if (mgpc != null) {
                 if (mgpc.getPaymentType() == PaymentType.ADD_STUDENT) {
-                    musicGroupPaymentCalenderDao.delete(mgpc.getId());
+                    musicGroupPaymentCalenderService.getDao().delete(mgpc.getId());
                 } else {
                     // 缴费项目预计人数减一
                     mgpc.setExpectNum(mgpc.getExpectNum() - 1);
                     mgpc.setUpdateTime(date);
-                    musicGroupPaymentCalenderDao.update(mgpc);
+                    musicGroupPaymentCalenderService.getDao().update(mgpc);
                 }
             }
             musicGroupPaymentCalenderDetailDao.delete(mgpcd.getId());
@@ -3066,24 +3064,24 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         studentRegistrationDao.update(studentRegistration);
 
         //删除进行中加学生,且在审批中或拒绝的缴费
-        List<Long> paymentCalenderIdList = musicGroupPaymentCalenderDao.findStudentNoPaymentCalender(userId, musicGroupId);
+        List<Long> paymentCalenderIdList = musicGroupPaymentCalenderService.getDao().findStudentNoPaymentCalender(userId, musicGroupId);
         if (paymentCalenderIdList != null && paymentCalenderIdList.size() > 0) {
-            musicGroupPaymentCalenderDao.delByIds(paymentCalenderIdList);
+            musicGroupPaymentCalenderService.getDao().delByIds(paymentCalenderIdList);
         }
 
         //查询未交费的项目
         List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = musicGroupPaymentCalenderDetailDao.queryNotPaymentStudentByUserIdAndMusicGroupId(userId, musicGroupId);
 
         for (MusicGroupPaymentCalenderDetail mgpcd : musicGroupPaymentCalenderDetailList) {
-            MusicGroupPaymentCalender mgpc = musicGroupPaymentCalenderDao.get(mgpcd.getMusicGroupPaymentCalenderId());
+            MusicGroupPaymentCalender mgpc = musicGroupPaymentCalenderService.getDao().get(mgpcd.getMusicGroupPaymentCalenderId());
             if (mgpc != null) {
                 if (mgpc.getPaymentType() == PaymentType.ADD_STUDENT) {
-                    musicGroupPaymentCalenderDao.delete(mgpc.getId());
+                    musicGroupPaymentCalenderService.getDao().delete(mgpc.getId());
                 } else {
                     // 缴费项目预计人数减一
                     mgpc.setExpectNum(mgpc.getExpectNum() - 1);
                     mgpc.setUpdateTime(date);
-                    musicGroupPaymentCalenderDao.update(mgpc);
+                    musicGroupPaymentCalenderService.getDao().update(mgpc);
                 }
             }
             musicGroupPaymentCalenderDetailDao.delete(mgpcd.getId());
@@ -3256,7 +3254,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
         if (studentPaymentOrder.getStatus() == SUCCESS) {
             //如果是进行中加学员
-            MusicGroupPaymentCalender paymentCalender = musicGroupPaymentCalenderDao.get(studentPaymentOrder.getCalenderId());
+            MusicGroupPaymentCalender paymentCalender = musicGroupPaymentCalenderService.getDao().get(studentPaymentOrder.getCalenderId());
             if (paymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.ADD_STUDENT) {
                 studentRegistration.setPaymentStatus(YES);
                 studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
@@ -3434,7 +3432,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 //        Map<String, Integer> payNumMap = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertIntegerMap(studentRegistrationDao.countNormalNum(StringUtils.join(musicGroupIds, ",")))), HashMap.class);
 
 
-        Map<String, BigDecimal> chargeStandardMap = MapUtil.convertIntegerMap(musicGroupPaymentCalenderDao.queryChargeStandard(StringUtils.join(musicGroupIds, ",")));
+        Map<String, BigDecimal> chargeStandardMap = MapUtil.convertIntegerMap(musicGroupPaymentCalenderService.getDao().queryChargeStandard(StringUtils.join(musicGroupIds, ",")));
 
         //获取教学点编号
         Map<Integer, String> cooperationOrganNames = MapUtil.convertMybatisMap(cooperationOrganDao.queryNameByIds(StringUtils.join(musicGroupList.stream().map(MusicGroup::getCooperationOrganId).collect(Collectors.toSet()), ",")));
@@ -3619,11 +3617,11 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if ((group.getStatus().equals(MusicGroupStatusEnum.AUDIT_FAILED) || group.getStatus().equals(MusicGroupStatusEnum.DRAFT))
                 && group.getCourseViewType() != musicGroup.getCourseViewType()) {
             //删除原有的声部商品组合
-            musicGroupSubjectGoodsGroupDao.delByMusicGroupId(musicGroupId);
+			musicGroupSubjectGoodsGroupService.getDao().delByMusicGroupId(musicGroupId);
             //删除原有的缴费项目
-            MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderDao.findByMusicGroupRegCalender(musicGroupId);
+            MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderService.getDao().findByMusicGroupRegCalender(musicGroupId);
             if (regCalender != null) {
-                musicGroupPaymentCalenderDao.delByGroupId(musicGroupId);
+                musicGroupPaymentCalenderService.getDao().delByGroupId(musicGroupId);
 
                 List<Long> calenderIds = new ArrayList<Long>();
                 calenderIds.add(regCalender.getId());
@@ -3642,7 +3640,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 statusList.add(PaymentCalenderStatusEnum.NO);
                 statusList.add(PaymentCalenderStatusEnum.OPEN);
                 statusList.add(PaymentCalenderStatusEnum.AUDITING);
-                List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderDao.queryByPaymentStatus(musicGroupId, statusList, PayUserType.STUDENT.getCode());
+                List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderService.getDao().queryByPaymentStatus(musicGroupId, statusList, PayUserType.STUDENT.getCode());
 
                 if (musicGroupPaymentCalenderList != null && musicGroupPaymentCalenderList.size() > 0) {
                     throw new BizException("存在未完结[审核中/未开启缴费/开启缴费]的缴费项目,请检查");
@@ -3679,7 +3677,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         subFeeSettingDto.setMusicGroupPaymentEntities(musicGroupPaymentEntitiesDao.findByMusicGroupId(musicGroupId));
         subFeeSettingDto.setMaxMusicalInstrumentsProfits(organizationDao.get(musicGroup.getOrganId()).getMaxMusicalInstrumentsProfits());
         //获取缴费周期
-        //List<Integer> paymentMonth = musicGroupPaymentCalenderDao.findByMusicGroupId(musicGroupId).stream().map(e -> e.getPaymentMonth()).collect(Collectors.toList());
+        //List<Integer> paymentMonth = musicGroupPaymentCalenderService.getDao().findByMusicGroupId(musicGroupId).stream().map(e -> e.getPaymentMonth()).collect(Collectors.toList());
         //subFeeSettingDto.setMonths(paymentMonth);
         return subFeeSettingDto;
     }
@@ -3690,7 +3688,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         //获取乐团声部规划列表
         subFeeSettingDto.setMusicGroupSubjectPlans(musicGroupSubjectPlanDao.getMusicSubjectClassPlan(musicGroupId));
         //获取乐团声部商品组
-        subFeeSettingDto.setMusicGroupSubjectGoodsGroups(musicGroupSubjectGoodsGroupDao.findGoodsGroup(musicGroupId, null));
+        subFeeSettingDto.setMusicGroupSubjectGoodsGroups(musicGroupSubjectGoodsGroupService.getDao().findGoodsGroup(musicGroupId, null));
         return subFeeSettingDto;
     }
 
@@ -3717,12 +3715,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         List<Map<Integer, String>> mapList = studentRegistrationDao.findMapByMusicGroupId(musicGroupId, 0);
         //所有人开启缴费
         studentRegistrationDao.musicGroupOpenPay(musicGroupId, PaymentStatusEnum.OPEN);
-        MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderDao.findByMusicGroupRegCalender(musicGroupId);
+        MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderService.getDao().findByMusicGroupRegCalender(musicGroupId);
         if (regCalender != null && regCalender.getPayUserType().equals(MusicGroupPaymentCalender.PayUserType.STUDENT)) {
             regCalender.setStatus(MusicGroupPaymentCalender.PaymentCalenderStatusEnum.OPEN);
             regCalender.setDeadlinePaymentDate(DateUtil.toDate(expireDate));
             regCalender.setUpdateTime(new Date());
-            musicGroupPaymentCalenderDao.update(regCalender);
+            musicGroupPaymentCalenderService.getDao().update(regCalender);
         }
         //三方乐团不发送缴费通知
         if (musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN) {

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupSubjectGoodsGroupServiceImpl.java

@@ -22,6 +22,10 @@ public class MusicGroupSubjectGoodsGroupServiceImpl extends BaseServiceImpl<Long
 		return musicGroupSubjectGoodsGroupDao;
 	}
 
+	public MusicGroupSubjectGoodsGroupDao getDao() {
+		return musicGroupSubjectGoodsGroupDao;
+	}
+
 	@Override
     public List<MusicGroupSubjectGoodsGroup> findGoodsGroup(String musicGroupId, Integer subId) {
         return musicGroupSubjectGoodsGroupDao.findGoodsGroup(musicGroupId, subId);

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

@@ -230,6 +230,10 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         return practiceGroupDao;
     }
 
+    public PracticeGroupDao getDao() {
+        return practiceGroupDao;
+    }
+
     @Override
     public List<CourseScheduleDto> findUserPracticeCourses(Integer userId) {
         List<CourseScheduleDto> studentPracticeCourses = courseScheduleDao.findStudentPracticeCourses(userId);

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SellOrderServiceImpl.java

@@ -78,6 +78,10 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
         return sellOrderDao;
     }
 
+    public SellOrderDao getDao() {
+        return sellOrderDao;
+    }
+
 
     @Override
     @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -222,6 +222,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         return vipGroupDao;
     }
 
+    @Override
+    public VipGroupDao getDao() {
+        return vipGroupDao;
+    }
+
 
     @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
     @Override

+ 0 - 56
mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml

@@ -923,62 +923,6 @@
 		</foreach>
 		GROUP BY cssp.user_id_
 	</select>
-    <select id="hasStudentMusicTheoryCourseInfo" resultType="java.lang.Boolean">
-		SELECT CASE WHEN cssp.user_id_ = NULL THEN 0 ELSE 1 END hasCourse
-		FROM `course_schedule_student_payment` cssp
-				 LEFT JOIN `course_schedule` cs on cssp.`course_schedule_id_` = cs.`id_`
-				 LEFT JOIN `vip_group` vg on vg.`id_` = cssp.`music_group_id_` AND cssp.`group_type_` = 'VIP'
-				 LEFT JOIN `sys_user` u on u.`id_` = cssp.`user_id_`
-		<include refid="hasStudentMusicTheoryCourseInfo"/>
-		LIMIT 1
-	</select>
-	<resultMap id="ExportStudentCourseInfoDto" type="com.ym.mec.biz.dal.dto.ExportStudentCourseInfoDto">
-		<result property="username" column="username_"/>
-		<result property="userId" column="user_id_"/>
-		<result property="organName" column="organ_name_"/>
-		<result property="teacherId" column="teacher_id_"/>
-		<result property="teacherName" column="teacher_name_"/>
-		<result property="beforeClassNum" column="before_class_num_"/>
-		<result property="eduId" column="edu_id_"/>
-		<result property="eduName" column="edu_name_"/>
-		<result property="grade" column="current_grade_num_"/>
-		<result property="startClassNum" column="start_class_num_"/>
-		<result property="subClassNum" column="sub_class_num_"/>
-		<result property="totalClassNum" column="total_class_num_"/>
-	</resultMap>
-	<select id="queryStudentCourseInfo" resultMap="ExportStudentCourseInfoDto">
-		SELECT o.`name_` organ_name_,u.`username_`,u.`id_` user_id_,tu.`real_name_` teacher_name_,
-		       tu.`id_` teacher_id_,edu.`real_name_` edu_name_ ,edu.`id_` edu_id_ ,
-			   count(vg.`online_classes_num_` + vg.`offline_classes_num_` )  total_class_num_,
-			   sum(case when cs.`status_` != 'NOT_START' then 1 else 0 end) start_class_num_,
-			   sum(case when cs.`status_` = 'NOT_START' then 1 else 0 end) sub_class_num_,
-			   max(case when cs.`status_` != 'NOT_START' then cs.`class_date_` end) before_class_num_,s.`current_grade_num_`
-		FROM `course_schedule_student_payment` cssp
-				 LEFT JOIN `course_schedule` cs on cssp.`course_schedule_id_` = cs.`id_`
-				 LEFT JOIN `vip_group` vg on vg.`id_` = cssp.`music_group_id_` AND cssp.`group_type_` = 'VIP'
-				 LEFT JOIN `sys_user` u on u.`id_` = cssp.`user_id_`
-				 LEFT JOIN `student` s on s.`user_id_` = cssp.`user_id_`
-				 LEFT JOIN `sys_user` tu on tu.`id_` = s.`teacher_id_`
-				 LEFT JOIN `sys_user` edu on edu.`id_` = vg.`educational_teacher_id_`
-				 LEFT JOIN `organization` o on o.`id_` = u.`organ_id_`
-		<include refid="hasStudentMusicTheoryCourseInfo"/>
-		GROUP BY cssp.`user_id_` ;
-	</select>
-	<sql id="hasStudentMusicTheoryCourseInfo">
-		<where>
-			cssp.`group_type_` = 'VIP' AND cs.`del_flag_` != 1 AND cs.`is_lock_` != 1
-			AND u.`organ_id_` NOT IN (38,43,56,36) AND vg.`group_status_` IN (2,4)
-			<if test="groupType == 'VIP'">
-				AND vg.`vip_group_category_id_` != 16
-			</if>
-			<if test="groupType != 'VIP'">
-				AND vg.`vip_group_category_id_` = 16
-			</if>
-			<if test="organId != null and organId != ''">
-				AND FIND_IN_SET(u.organ_id_,#{organId})
-			</if>
-		</where>
-	</sql>
 
 	<select id="queryUserMusicGroupCourseNumByClassTime" resultMap="Mapper" parameterType="map">
 		select cssp.music_group_id_ key_,count(cssp.id_) value_ from course_schedule_student_payment cssp left join course_schedule cs on cssp.course_schedule_id_ = cs.id_

+ 218 - 0
mec-biz/src/main/resources/config/mybatis/ExportMapper.xml

@@ -0,0 +1,218 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
+<mapper namespace="com.ym.mec.biz.dal.dao.ExportDao">
+    <select id="exportBalancedRelationshipMusicCourse"
+            resultType="com.ym.mec.biz.dal.dto.ExportWrapper$ExportBalancedRelationshipMusicCourse">
+        select o.name_ organName,mg.name_ musicGroupName,mg.id_ musicGroupId,cg.name_ className,
+        CASE WHEN cg.type_ = 'NORMAL' THEN '声部班'
+        WHEN cg.type_ = 'MIX' THEN '合奏班'
+        WHEN cg.type_ = 'HIGH' THEN '基础技能班'
+        WHEN cg.type_ = 'VIP' THEN 'vip课'
+        WHEN cg.type_ = 'DEMO' THEN '试听课'
+        WHEN cg.type_ = 'PRACTICE' THEN '网管课'
+        WHEN cg.type_ = 'SNAP' THEN '临时班'
+        WHEN cg.type_ = 'COMM' THEN '对外课程'
+        WHEN cg.type_ = 'HIGH_ONLINE' THEN '线上基础技能班'
+        WHEN cg.type_ = 'MUSIC_NETWORK' THEN '乐团网管课'
+        WHEN cg.type_ = 'LIVE' THEN '直播课' END classType
+        ,cs.class_group_id_ classId,
+        CASE WHEN cs.type_ = 'SINGLE' THEN '声部课'
+        WHEN cs.type_ = 'MIX' THEN '合奏课'
+        WHEN cs.type_ = 'HIGH' THEN '基础技能课'
+        WHEN cs.type_ = 'VIP' THEN 'vip课'
+        WHEN cs.type_ = 'DEMO' THEN '试听课'
+        WHEN cs.type_ = 'COMPREHENSIVE' THEN '综合课'
+        WHEN cs.type_ = 'PRACTICE' THEN '网管课'
+        WHEN cs.type_ = 'ENLIGHTENMENT' THEN '启蒙课'
+        WHEN cs.type_ = 'TRAINING_SINGLE' THEN '集训声部课'
+        WHEN cs.type_ = 'TRAINING_MIX' THEN '集训合奏课'
+        WHEN cs.type_ = 'CLASSROOM' THEN '课堂课'
+        WHEN cs.type_ = 'COMM' THEN '对外课程'
+        WHEN cs.type_ = 'HIGH_ONLINE' THEN '线上基础技能课'
+        WHEN cs.type_ = 'MUSIC_NETWORK' THEN '乐团网管课'
+        WHEN cs.type_ = 'LIVE' THEN '直播课' END courseType,
+        COUNT(CASE WHEN cs.create_time_ &lt;= CONCAT(#{month},'-31 23:59:59') AND cs.class_date_ > CONCAT(#{month},'-31') AND cs.merge_flag_ != 2 THEN cs.id_ ELSE NULL END) surplusCourse,
+        SUM(CASE WHEN cs.create_time_ &lt;= CONCAT(#{month},'-31 23:59:59') AND cs.class_date_ > CONCAT(#{month},'-31') AND cs.merge_flag_ != 2
+        THEN IF(csts.settlement_time_ IS NULL,csts.expect_salary_ + IF(csts.subsidy_ IS NULL,0,csts.subsidy_),csts.actual_salary_) ELSE 0 END) surplusCourseReward,
+        COUNT(CASE WHEN cs.merge_time_ &lt;= CONCAT(#{month},'-31 23:59:59') AND cs.class_date_ > CONCAT(#{month},'-31') AND cs.merge_flag_ = 2 THEN cs.id_ ELSE NULL END) surplusMergeCourse,
+        SUM(CASE WHEN cs.merge_time_ &lt;= CONCAT(#{month},'-31 23:59:59') AND cs.class_date_ > CONCAT(#{month},'-31') AND cs.merge_flag_ = 2
+        THEN IF(csts.settlement_time_ IS NULL,csts.expect_salary_ + IF(csts.subsidy_ IS NULL,0,csts.subsidy_),csts.actual_salary_) ELSE 0 END) surplusMergeCourseReward,
+        COUNT(CASE WHEN cs.create_time_ &lt;= CONCAT(#{month},'-31 23:59:59') AND cs.class_date_ &lt;= CONCAT(#{month},'-31') AND cs.merge_flag_ != 2 THEN cs.id_ ELSE NULL END) alreadyCourse,
+        SUM(CASE WHEN cs.create_time_ &lt;= CONCAT(#{month},'-31 23:59:59') AND cs.class_date_ &lt;= CONCAT(#{month},'-31') AND cs.merge_flag_ != 2
+        THEN IF(csts.settlement_time_ IS NULL,csts.expect_salary_ + IF(csts.subsidy_ IS NULL,0,csts.subsidy_),csts.actual_salary_) ELSE 0 END) alreadyCourseReward,
+        COUNT(CASE WHEN cs.merge_time_ &lt;= CONCAT(#{month},'-31 23:59:59') AND cs.class_date_ &lt;= CONCAT(#{month},'-31') AND cs.merge_flag_ = 2 THEN cs.id_ ELSE NULL END) alreadyMergeCourse,
+        SUM(CASE WHEN cs.merge_time_ &lt;= CONCAT(#{month},'-31 23:59:59') AND cs.class_date_ &lt;= CONCAT(#{month},'-31') AND cs.merge_flag_ = 2
+        THEN IF(csts.settlement_time_ IS NULL,csts.expect_salary_ + IF(csts.subsidy_ IS NULL,0,csts.subsidy_),csts.actual_salary_) ELSE 0 END) alreadyMergeCourseReward,
+        COUNT(CASE WHEN cs.create_time_ BETWEEN CONCAT(#{month},'-01 00:00:00') AND CONCAT(#{month},'-31 23:59:59') AND cs.merge_flag_ != 2 THEN cs.id_ ELSE NULL END) currentMonthAdd,
+        SUM(CASE WHEN cs.create_time_ BETWEEN CONCAT(#{month},'-01 00:00:00') AND CONCAT(#{month},'-31 23:59:59') AND cs.merge_flag_ != 2
+        THEN IF(csts.settlement_time_ IS NULL,csts.expect_salary_ + IF(csts.subsidy_ IS NULL,0,csts.subsidy_),csts.actual_salary_) ELSE 0 END) currentMonthAddReward,
+        COUNT(CASE WHEN cs.merge_time_ BETWEEN CONCAT(#{month},'-01 00:00:00') AND CONCAT(#{month},'-31 23:59:59') AND cs.merge_flag_ = 2 THEN cs.id_ ELSE NULL END) currentMonthMergedAdd,
+        SUM(CASE WHEN cs.merge_time_ BETWEEN CONCAT(#{month},'-01 00:00:00') AND CONCAT(#{month},'-31 23:59:59') AND cs.merge_flag_ = 2
+        THEN IF(csts.settlement_time_ IS NULL,csts.expect_salary_ + IF(csts.subsidy_ IS NULL,0,csts.subsidy_),csts.actual_salary_) ELSE 0 END) currentMonthMergedAddReward,
+        COUNT(CASE WHEN cs.class_date_ BETWEEN CONCAT(#{month},'-01') AND CONCAT(#{month},'-31') AND cs.merge_flag_ != 2 THEN cs.id_ ELSE NULL END) currentMonthConsume,
+        SUM(CASE WHEN cs.class_date_ BETWEEN CONCAT(#{month},'-01') AND CONCAT(#{month},'-31') AND cs.merge_flag_ != 2
+        THEN IF(csts.settlement_time_ IS NULL,csts.expect_salary_ + IF(csts.subsidy_ IS NULL,0,csts.subsidy_),csts.actual_salary_) ELSE 0 END) currentMonthConsumeReward,
+        COUNT(CASE WHEN cs.class_date_ BETWEEN CONCAT(#{month},'-01') AND CONCAT(#{month},'-31') AND cs.merge_flag_ = 2 THEN cs.id_ ELSE NULL END) currentMonthMergedConsume,
+        SUM(CASE WHEN cs.class_date_ BETWEEN CONCAT(#{month},'-01') AND CONCAT(#{month},'-31') AND cs.merge_flag_ = 2
+        THEN IF(csts.settlement_time_ IS NULL,csts.expect_salary_ + IF(csts.subsidy_ IS NULL,0,csts.subsidy_),csts.actual_salary_) ELSE 0 END) currentMonthMergedConsumeReward
+        from course_schedule cs
+        left join course_schedule_teacher_salary csts ON csts.course_schedule_id_ = cs.id_
+        left join class_group cg ON cg.id_ = cs.class_group_id_
+        left join music_group mg ON mg.id_ = cs.music_group_id_
+        left join organization o ON o.id_ = mg.organ_id_
+        where cs.group_type_ = 'MUSIC' AND cs.`del_flag_` = 0 AND cs.is_lock_ = 0 and cs.pre_course_flag_ != 1
+        group by cs.class_group_id_,cs.type_ order by cs.organ_id_,cs.class_group_id_;
+    </select>
+    <select id="exportBalancedRelationshipVipCourse"
+            resultType="com.ym.mec.biz.dal.dto.ExportWrapper$ExportBalancedRelationshipVipCourse">
+        select o.name_ 'organName',cssp.user_id_ 'studentId',su.username_ studentName,vgc.name_ 'courseType',
+        COUNT(DISTINCT CASE WHEN cs.create_time_ &lt;= CONCAT(#{month},'-31 23:59:59') AND cs.class_date_ > CONCAT(#{month},'-31') THEN cs.id_ END) 'surplusCourse',
+        COUNT(DISTINCT CASE WHEN cs.create_time_ &lt;= CONCAT(#{month},'-31 23:59:59') AND cs.class_date_ &lt;= CONCAT(#{month},'-31') THEN cs.id_ END) 'alreadyCourse',
+        COUNT(DISTINCT CASE WHEN cs.create_time_ BETWEEN CONCAT(#{month},'-01 00:00:00') AND CONCAT(#{month},'-31 23:59:59') THEN cs.id_ END) 'addCourse',
+        COUNT(DISTINCT CASE WHEN cs.class_date_ BETWEEN CONCAT(#{month},'-01') AND CONCAT(#{month},'-31') THEN cs.id_ END) 'consumeCourse'
+        from course_schedule cs
+        left join course_schedule_student_payment cssp ON cs.id_ = cssp.course_schedule_id_
+        left join vip_group vg ON vg.id_ = cs.music_group_id_
+        left join vip_group_category vgc ON vgc.id_ = vg.vip_group_category_id_
+        left join sys_user su ON su.id_ = cssp.user_id_
+        left join organization o ON o.id_ = cs.organ_id_
+        where cs.group_type_ = 'VIP' AND cs.is_lock_ = 0 AND cs.del_flag_ = 0 AND cs.id_ = cssp.course_schedule_id_
+        group by cssp.user_id_,vg.vip_group_category_id_ ORDER BY cs.organ_id_,cssp.user_id_
+    </select>
+    <select id="exportBalancedRelationshipVipNoCourse"
+            resultType="com.ym.mec.biz.dal.dto.ExportWrapper$ExportBalancedRelationshipVipNoCourse">
+        select o.name_ 'organName',aum.user_id_ 'studentId',su.username_ 'studentName',vgc.name_ 'courseType',aum.sub_course_num_ 'noCourse',aum.addCourseNum 'addCourse' from (
+        select aum.user_id_,aum.category_id_,SUM(aum.sub_course_num_) sub_course_num_,SUM(addCourseNum) addCourseNum,aum.organ_id_
+        from (
+        select aum.sub_course_num_,aum.user_id_,aum.category_id_,aum.organ_id_,
+        CASE WHEN aum.create_time_ BETWEEN CONCAT(#{month},'-01 00:00:00') AND CONCAT(#{month},'-31 23:59:59') THEN total_course_num_ ELSE 0 END addCourseNum
+        from activity_user_mapper aum
+        where aum.return_fee_ = 0 AND aum.create_time_ &lt;= CONCAT(#{month},'-31 23:59:59') AND aum.category_id_ IS NOT NULL
+        union ALL
+        select aum.sub_give_course_num_ sub_course_num_,aum.user_id_,aum.give_category_id_ category_id_,aum.organ_id_,
+        CASE WHEN aum.create_time_ BETWEEN CONCAT(#{month},'-01 00:00:00') AND CONCAT(#{month},'-31 23:59:59') THEN total_give_course_num_ ELSE 0 END addCourseNum
+        from activity_user_mapper aum
+        where aum.return_fee_ = 0 AND aum.create_time_ &lt;= CONCAT(#{month},'-31 23:59:59') AND aum.give_category_id_ IS NOT NULL
+        ) aum
+        group by aum.user_id_,aum.category_id_
+        order by aum.user_id_) aum
+        left join organization o ON o.id_ = aum.organ_id_
+        left join sys_user su ON su.id_ = aum.user_id_
+        left join vip_group_category vgc ON vgc.id_ = aum.category_id_
+        order by aum.organ_id_,aum.user_id_
+    </select>
+    <select id="exportBalancedRelationshipMusicSubCourse"
+            resultType="com.ym.mec.biz.dal.dto.ExportWrapper$ExportBalancedRelationshipMusicSubCourse">
+        select o.name_ 'organName',mgpscd.music_group_id_ 'musicGroupId',mg.name_ 'musicGroupName',mgpc.batch_no_ 'paymentBatchNo',
+        spo.actual_amount_ + spo.coupon_remit_fee_ 'paymentAmount',mgpscd.user_id_ 'studentId',
+        CASE WHEN mgpscd.course_type_ = 'CLASSROOM' THEN mgpscd.total_course_minutes_ ELSE 0 END AS 'classroom'
+        ,CASE WHEN mgpscd.course_type_ = 'COMPREHENSIVE' THEN mgpscd.total_course_minutes_ ELSE 0 END AS 'comprehensive'
+        ,CASE WHEN mgpscd.course_type_ = 'HIGH' THEN mgpscd.total_course_minutes_ ELSE 0 END AS 'high'
+        ,CASE WHEN mgpscd.course_type_ = 'HIGH_ONLINE' THEN mgpscd.total_course_minutes_ ELSE 0 END AS 'highOnline'
+        ,CASE WHEN mgpscd.course_type_ = 'MIX' THEN mgpscd.total_course_minutes_ ELSE 0 END AS 'mix'
+        ,CASE WHEN mgpscd.course_type_ = 'SINGLE' THEN mgpscd.total_course_minutes_ ELSE 0 END AS 'single'
+        ,CASE WHEN mgpscd.course_type_ = 'TRAINING_MIX' THEN mgpscd.total_course_minutes_ ELSE 0 END AS 'trainingMix'
+        ,CASE WHEN mgpscd.course_type_ = 'TRAINING_SINGLE' THEN mgpscd.total_course_minutes_ ELSE 0 END AS 'trainingSingle'
+        from music_group_payment_student_course_detail mgpscd
+        left join music_group mg ON mg.id_ = mgpscd.music_group_id_
+        left join organization o ON o.id_ = mg.organ_id_
+        left join music_group_payment_calender mgpc ON mgpc.id_ = mgpscd.music_group_payment_calender_id_
+        left join student_payment_order spo ON spo.calender_id_ = mgpscd.music_group_payment_calender_id_ AND mgpscd.user_id_ = spo.user_id_ AND spo.status_ = 'SUCCESS'
+        where sub_course_minutes_ + used_course_minutes_ = total_course_minutes_ AND mgpc.create_time_ >= CONCAT(#{month},'-01 00:00:00') AND mgpscd.tenant_id_ = 1
+        group by mgpscd.user_id_,mgpscd.music_group_payment_calender_id_ order by o.id_,mgpscd.music_group_id_,mgpc.batch_no_,mgpscd.user_id_ desc
+    </select>
+    <select id="exportBalancedRelationshipStudentInfo"
+            resultType="com.ym.mec.biz.dal.dto.ExportWrapper$ExportBalancedRelationshipStudentInfo">
+        select o.name_ 'organName',COUNT(distinct CASE WHEN mg.status_ = 'PROGRESS' THEN mg.id_ END) 'musicGroupCount',
+        ibmd.MUSIC_GROUP_STUDENT 'currentMonthStudentCount',ibmd.NEWLY_STUDENT_NUM 'currentMonthAddStudentCount',
+        COUNT(DISTINCT mgq.user_id_) 'currentMonthQuitStudentCount'
+        from organization o
+        left join music_group mg ON o.id_ = mg.organ_id_
+        left join music_group_quit mgq ON mgq.music_group_id_ = mg.id_ AND mgq.status_ = 'APPROVED' AND DATE_FORMAT(mgq.create_time_,'%Y-%m-%d') BETWEEN CONCAT(#{month},'-01') AND CONCAT(#{month},'-31')
+        left join (select ibmd.organ_id_,SUM(CASE WHEN ibmd.data_type_ = 'MUSIC_GROUP_STUDENT' AND ibmd.month_ = last_day(CONCAT(#{month},'-01')) THEN ibmd.total_num_ ELSE 0 END) 'MUSIC_GROUP_STUDENT',
+        SUM(CASE WHEN ibmd.data_type_ = 'NEWLY_STUDENT_NUM' THEN ibmd.total_num_ END) 'NEWLY_STUDENT_NUM'
+        from index_base_month_data ibmd
+        where ibmd.tenant_id_ = 1 AND ibmd.month_ BETWEEN CONCAT(#{month},'-01') AND CONCAT(#{month},'-31')
+        group by ibmd.organ_id_) ibmd ON ibmd.organ_id_ = o.id_
+        where o.tenant_id_ = 1
+        group by o.id_ order by o.id_
+    </select>
+    <select id="exportBalancedRelationshipStudentNormalDetail"
+            resultType="com.ym.mec.biz.dal.dto.ExportWrapper$ExportBalancedRelationshipStudentNormalDetail">
+        SELECT o.name_ 'organName',mg.id_ 'musicGroupId',mg.name_ 'musicGroupName',sr.user_id_ 'studentId',su.username_ 'studentName'
+        FROM student_registration sr
+        left join sys_user su ON su.id_ = sr.user_id_
+        LEFT JOIN music_group mg ON sr.music_group_id_ = mg.id_
+        left join organization o ON o.id_ = mg.organ_id_
+        WHERE mg.status_ = 'PROGRESS' AND sr.music_group_status_ = 'NORMAL'
+        GROUP BY mg.organ_id_,mg.id_,sr.user_id_ order by mg.organ_id_,mg.id_,sr.user_id_
+    </select>
+    <select id="exportBalancedRelationshipStudentQuitDetail"
+            resultType="com.ym.mec.biz.dal.dto.ExportWrapper$ExportBalancedRelationshipStudentQuitDetail">
+        SELECT o.name_ 'organName',mg.id_ 'musicGroupId',mg.name_ 'musicGroupName',mgq.user_id_ 'studentId',su.username_ 'studentName' FROM music_group_quit mgq
+        left join sys_user su ON su.id_ = mgq.user_id_
+        LEFT JOIN music_group mg ON mg.id_ = mgq.music_group_id_
+        left join organization o ON o.id_ = mg.organ_id_
+        WHERE mgq.status_ = 'APPROVED' AND mgq.tenant_id_ = 1
+        AND DATE_FORMAT(mgq.create_time_,'%Y-%m-%d') BETWEEN CONCAT(#{month},'-01') AND CONCAT(#{month},'-31')
+        GROUP BY mg.organ_id_,mg.id_,mgq.user_id_ order by mg.organ_id_,mg.id_,mgq.user_id_
+    </select>
+
+    <resultMap id="ExportStudentCourseInfoDto" type="com.ym.mec.biz.dal.dto.ExportStudentCourseInfoDto">
+        <result property="username" column="username_"/>
+        <result property="userId" column="user_id_"/>
+        <result property="organName" column="organ_name_"/>
+        <result property="teacherId" column="teacher_id_"/>
+        <result property="teacherName" column="teacher_name_"/>
+        <result property="beforeClassNum" column="before_class_num_"/>
+        <result property="eduId" column="edu_id_"/>
+        <result property="eduName" column="edu_name_"/>
+        <result property="grade" column="current_grade_num_"/>
+        <result property="startClassNum" column="start_class_num_"/>
+        <result property="subClassNum" column="sub_class_num_"/>
+        <result property="totalClassNum" column="total_class_num_"/>
+    </resultMap>
+    <select id="queryStudentCourseInfo" resultMap="ExportStudentCourseInfoDto">
+        SELECT o.`name_` organ_name_,u.`username_`,u.`id_` user_id_,tu.`real_name_` teacher_name_,
+        tu.`id_` teacher_id_,edu.`real_name_` edu_name_ ,edu.`id_` edu_id_ ,
+        count(vg.`online_classes_num_` + vg.`offline_classes_num_` )  total_class_num_,
+        sum(case when cs.`status_` != 'NOT_START' then 1 else 0 end) start_class_num_,
+        sum(case when cs.`status_` = 'NOT_START' then 1 else 0 end) sub_class_num_,
+        max(case when cs.`status_` != 'NOT_START' then cs.`class_date_` end) before_class_num_,s.`current_grade_num_`
+        FROM `course_schedule_student_payment` cssp
+        LEFT JOIN `course_schedule` cs on cssp.`course_schedule_id_` = cs.`id_`
+        LEFT JOIN `vip_group` vg on vg.`id_` = cssp.`music_group_id_` AND cssp.`group_type_` = 'VIP'
+        LEFT JOIN `sys_user` u on u.`id_` = cssp.`user_id_`
+        LEFT JOIN `student` s on s.`user_id_` = cssp.`user_id_`
+        LEFT JOIN `sys_user` tu on tu.`id_` = s.`teacher_id_`
+        LEFT JOIN `sys_user` edu on edu.`id_` = vg.`educational_teacher_id_`
+        LEFT JOIN `organization` o on o.`id_` = u.`organ_id_`
+        <include refid="hasStudentMusicTheoryCourseInfo"/>
+        GROUP BY cssp.`user_id_` ;
+    </select>
+    <select id="hasStudentMusicTheoryCourseInfo" resultType="java.lang.Boolean">
+        SELECT CASE WHEN cssp.user_id_ = NULL THEN 0 ELSE 1 END hasCourse
+        FROM `course_schedule_student_payment` cssp
+        LEFT JOIN `course_schedule` cs on cssp.`course_schedule_id_` = cs.`id_`
+        LEFT JOIN `vip_group` vg on vg.`id_` = cssp.`music_group_id_` AND cssp.`group_type_` = 'VIP'
+        LEFT JOIN `sys_user` u on u.`id_` = cssp.`user_id_`
+        <include refid="hasStudentMusicTheoryCourseInfo"/>
+        LIMIT 1
+    </select>
+    <sql id="hasStudentMusicTheoryCourseInfo">
+        <where>
+            cssp.`group_type_` = 'VIP' AND cs.`del_flag_` != 1 AND cs.`is_lock_` != 1
+            AND u.`organ_id_` NOT IN (38,43,56,36) AND vg.`group_status_` IN (2,4)
+            <if test="groupType == 'VIP'">
+                AND vg.`vip_group_category_id_` != 16
+            </if>
+            <if test="groupType != 'VIP'">
+                AND vg.`vip_group_category_id_` = 16
+            </if>
+            <if test="organId != null and organId != ''">
+                AND FIND_IN_SET(u.organ_id_,#{organId})
+            </if>
+        </where>
+    </sql>
+</mapper>

部分文件因文件數量過多而無法顯示