Forráskód Böngészése

Merge branch 'master' into maintenance_feature

周箭河 4 éve
szülő
commit
ed3e81635f
66 módosított fájl, 1320 hozzáadás és 515 törlés
  1. 2 2
      cms/src/main/resources/bootstrap-test.properties
  2. 8 3
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/service/impl/SysMenuServiceImpl.java
  3. 1 2
      mec-auth/mec-auth-server/src/main/resources/config/mybatis/SysMenuMapper.xml
  4. 5 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java
  5. 48 7
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/IndexBaseMonthDataDao.java
  6. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java
  7. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentManageDao.java
  8. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java
  9. 22 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseHomeworkListDto.java
  10. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseScheduleDto.java
  11. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ExtraExerciseStudentsDto.java
  12. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/IndexBaseDto.java
  13. 20 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentHomeworkRecordDto.java
  14. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Goods.java
  15. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupSubjectGoodsGroup.java
  16. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentCourseScheduleRecordDto.java
  17. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentPaymentOrderDetail.java
  18. 75 37
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/IndexDataType.java
  19. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/EndCourseScheduleQueryInfo.java
  20. 48 0
      mec-biz/src/main/java/com/ym/mec/biz/event/MusicGroupStatusChangeEvent.java
  21. 50 0
      mec-biz/src/main/java/com/ym/mec/biz/event/MusicGroupStudentChangeEvent.java
  22. 102 0
      mec-biz/src/main/java/com/ym/mec/biz/event/listener/GroupEventListener.java
  23. 30 0
      mec-biz/src/main/java/com/ym/mec/biz/event/source/GroupEventSource.java
  24. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/ImUserFriendService.java
  25. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/IndexBaseMonthDataService.java
  26. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentOrderService.java
  27. 15 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupStudentMapperServiceImpl.java
  28. 53 43
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  29. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleStudentPaymentServiceImpl.java
  30. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/GroupClassServiceImpl.java
  31. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImGroupMemberServiceImpl.java
  32. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImUserFriendServiceImpl.java
  33. 75 155
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java
  34. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  35. 16 14
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupSubjectPlanServiceImpl.java
  36. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java
  37. 5 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java
  38. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderDetailServiceImpl.java
  39. 26 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java
  40. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  41. 95 96
      mec-biz/src/main/resources/config/contracts/product2.ftl
  42. 82 34
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  43. 3 1
      mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesReplyMapper.xml
  44. 196 38
      mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml
  45. 2 1
      mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml
  46. 15 2
      mec-biz/src/main/resources/config/mybatis/StudentCourseHomeworkMapper.xml
  47. 11 3
      mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml
  48. 1 1
      mec-biz/src/main/resources/config/mybatis/StudentMapper.xml
  49. 2 1
      mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml
  50. 15 0
      mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml
  51. 1 1
      mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml
  52. 7 1
      mec-common/audit-log/pom.xml
  53. 53 26
      mec-common/audit-log/src/main/java/com/yonge/log/interceptor/AuditLogInterceptor.java
  54. 0 4
      mec-common/common-core/src/main/java/com/ym/mec/common/page/PageInfo.java
  55. 2 2
      mec-eureka/src/main/resources/bootstrap-test.properties
  56. 1 1
      mec-gateway/mec-gateway-web/src/main/resources/bootstrap-test.properties
  57. 0 3
      mec-im/src/main/java/com/ym/controller/UserController.java
  58. 2 2
      mec-im/src/main/resources/bootstrap-test.properties
  59. 0 6
      mec-student/src/main/java/com/ym/mec/student/controller/StudentAttendanceController.java
  60. 0 3
      mec-student/src/main/java/com/ym/mec/student/controller/StudentCourseHomeworkController.java
  61. 1 1
      mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java
  62. 2 2
      mec-task/src/main/resources/bootstrap-test.properties
  63. 2 2
      mec-teacher/src/main/resources/bootstrap-test.properties
  64. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java
  65. 35 1
      mec-web/src/main/java/com/ym/mec/web/controller/ImGroupController.java
  66. 52 0
      mec-web/src/main/java/com/ym/mec/web/controller/ImUserFriendController.java

+ 2 - 2
cms/src/main/resources/bootstrap-test.properties

@@ -1,9 +1,9 @@
 #\u6307\u5b9a\u5f00\u53d1\u73af\u5883
 #spring.profiles.active=dev
 #\u670d\u52a1\u5668\u5730\u5740
-spring.cloud.nacos.config.server-addr=47.96.85.100:8848
+spring.cloud.nacos.config.server-addr=47.114.1.200:8848
 #\u9ed8\u8ba4\u4e3aPublic\u547d\u540d\u7a7a\u95f4,\u53ef\u4ee5\u7701\u7565\u4e0d\u5199
-spring.cloud.nacos.config.namespace=02105743-16b8-46ab-87df-2aca0f3dbca3
+spring.cloud.nacos.config.namespace=f753d9d9-4bb2-4df6-a483-da9e169617c4
 #\u6307\u5b9a\u914d\u7f6e\u7fa4\u7ec4 --\u5982\u679c\u662fPublic\u547d\u540d\u7a7a\u95f4 \u5219\u53ef\u4ee5\u7701\u7565\u7fa4\u7ec4\u914d\u7f6e
 spring.cloud.nacos.config.group=DEFAULT_GROUP
 #\u6587\u4ef6\u540d -- \u5982\u679c\u6ca1\u6709\u914d\u7f6e\u5219\u9ed8\u8ba4\u4e3a ${spring.appliction.name}

+ 8 - 3
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/service/impl/SysMenuServiceImpl.java

@@ -50,11 +50,16 @@ public class SysMenuServiceImpl extends BaseServiceImpl<Integer, SysMenu>  imple
 
 	public List<SysMenu> findByUser(MenuQueryInfo menuQueryInfo) {
 		SysUser sysUser = sysUserDao.get(menuQueryInfo.getUserId());
+		List<SysMenu> sysMenus;
+		List<SysMenu> sysMenusAllList;
+
 		if(sysUser.getIsSuperAdmin()){
-			menuQueryInfo.setUserId(null);
+			sysMenus = sysMenuDao.findList(menuQueryInfo.getParentId(),menuQueryInfo.getDelFlag(),menuQueryInfo.getHid());
+			sysMenusAllList = sysMenuDao.findList(null,menuQueryInfo.getDelFlag(),menuQueryInfo.getHid());
+		}else {
+			sysMenus = sysMenuDao.findByParentId(menuQueryInfo.getParentId(),menuQueryInfo.getDelFlag(),menuQueryInfo.getUserId(),menuQueryInfo.getHid());
+			sysMenusAllList = sysMenuDao.findByParentId(null,menuQueryInfo.getDelFlag(),menuQueryInfo.getUserId(),menuQueryInfo.getHid());
 		}
-		List<SysMenu> sysMenus = sysMenuDao.findByParentId(menuQueryInfo.getParentId(),menuQueryInfo.getDelFlag(),menuQueryInfo.getUserId(),menuQueryInfo.getHid());
-		List<SysMenu> sysMenusAllList = sysMenuDao.findByParentId(null,menuQueryInfo.getDelFlag(),menuQueryInfo.getUserId(),menuQueryInfo.getHid());
 
 		for (SysMenu menu:sysMenus) {
 			menu = getTree1(menu,sysMenusAllList);

+ 1 - 2
mec-auth/mec-auth-server/src/main/resources/config/mybatis/SysMenuMapper.xml

@@ -145,7 +145,6 @@
     </select>
     <sql id="queryTree">
         <where>
-                sm.parent_id_ IS NOT NULL
             <if test="userId != null">
                 AND sur.user_id_ = #{userId}
             </if>
@@ -183,6 +182,6 @@
                 AND hidden_ = #{hid}
             </if>
         </where>
-        ORDER BY sort_ DESC
+        ORDER BY sort_ DESC,id_ DESC
     </select>
 </mapper>

+ 5 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java

@@ -426,6 +426,10 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
                                      @Param("classGroupIds") List<Integer> classGroupIds,
                                      @Param("type") String type);
 
+    List<Date> getCourseScheduleDateWithOrgan(@Param("organIds") List<Integer> organIds,
+                                              @Param("month") Date month,
+                                              @Param("type") String type);
+
     /**
      * @Author: Joburgess
      * @Date: 2019/9/23
@@ -531,7 +535,7 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
      * @params [vipGroupId]
      * @describe 获取vip课排课计划
      */
-    List<CourseSchedule> findGroupCourseSchedules(@Param("groupId") Long groupId, @Param("groupType") String groupType);
+    List<CourseSchedule> findGroupCourseSchedules(@Param("groupId") String groupId, @Param("groupType") String groupType);
 
     /**
      * @param groupId:   乐团编号

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

@@ -1,10 +1,7 @@
 package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.entity.IndexBaseMonthData;
-import com.ym.mec.biz.dal.enums.GroupType;
-import com.ym.mec.biz.dal.enums.IndexDataType;
-import com.ym.mec.biz.dal.enums.JobNatureEnum;
-import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
+import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
 import org.apache.poi.ss.formula.functions.Index;
@@ -24,6 +21,10 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
     int deleteWithMonthAndType(@Param("months") Collection months,
                                @Param("dataType")IndexDataType dataType);
 
+    IndexBaseMonthData getOrganDataWithDayAndDataType(@Param("organId") Integer organId,
+                                                      @Param("day") String day,
+                                                      @Param("dataType")IndexDataType dataType);
+
     /**
      * @describe 获取首页统计数据
      * @author Joburgess
@@ -39,6 +40,36 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
                                               @Param("startMonth") String startMonth,
                                               @Param("endMonth") String endMonth);
 
+	List<IndexBaseMonthData> getWithDayAndDataType(@Param("day") String day,
+                                                   @Param("dataType")IndexDataType dataType);
+
+	/**
+	 * @describe 统计学员注册数据
+	 * @author Joburgess
+	 * @date 2021/2/24 0024
+	 * @param dayStr:
+	 * @return java.util.List<com.ym.mec.biz.dal.entity.IndexBaseMonthData>
+	 */
+	List<IndexBaseMonthData> getStudentRegistrationData(@Param("dayStr") String dayStr);
+
+	/**
+	 * @describe 统计新增学员注册数据
+	 * @author Joburgess
+	 * @date 2021/2/24 0024
+	 * @param dayStr:
+	 * @return java.util.List<com.ym.mec.biz.dal.entity.IndexBaseMonthData>
+	 */
+	List<IndexBaseMonthData> getAddStudentRegistrationData(@Param("dayStr") String dayStr);
+
+	/**
+	 * @describe 付费转化率
+	 * @author Joburgess
+	 * @date 2021/2/24 0024
+	 * @param dayStr:
+	 * @return java.util.List<com.ym.mec.biz.dal.entity.IndexBaseMonthData>
+	 */
+	List<IndexBaseMonthData> getChargeStudentChangeData(@Param("dayStr") String dayStr);
+
     /**
      * @describe 统计系统中指定时间段的学员注册数据
      * @author Joburgess
@@ -94,13 +125,23 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
 
     List<IndexBaseMonthData> getOtherStudentData(@Param("dayStr") String dayStr);
 
+    List<IndexBaseMonthData> getVipPracticeAddStudentData(@Param("dayStr") String dayStr);
+
     List<IndexBaseMonthData> getTeacherData(@Param("dayStr") String dayStr,
                                             @Param("jobNature") JobNatureEnum jobNature,
                                             @Param("isDemission") Boolean isDemission);
 
     List<IndexBaseMonthData> getGroupCourseData(@Param("dayStr") String dayStr,
-                                                @Param("groupType")GroupType groupType);
+                                                @Param("groupType")GroupType groupType,
+                                                @Param("courseStatus") CourseStatusEnum courseStatus);
+
+    List<IndexBaseMonthData> getGroupSurplusCourseData(@Param("dayStr") String dayStr,
+                                                @Param("groupType")GroupType groupType,
+                                                @Param("courseStatus") CourseStatusEnum courseStatus);
 
+    List<IndexBaseMonthData> getGroupCourseDataWithGroup(@Param("dayStr") String dayStr,
+                                                @Param("groupType")GroupType groupType,
+                                                @Param("courseStatus") CourseStatusEnum courseStatus);
 
     int countLessThenThreeClassGroupNum(@Param("organIds") Set<Integer> organIds);
     List<String> getLessThenThreeMusicGroup(@Param("organIds") Set<Integer> organIds);
@@ -121,14 +162,14 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
      * @param organIds
      * @return
      */
-    int getAttendanceError(@Param("organIds") String organIds,@Param("startTime") String startTime);
+    int getAttendanceError(@Param("organIds") Set<Integer> organIds,@Param("startTime") String startTime);
 
     /**
      * 获取旷课考勤
      * @param organIds
      * @return
      */
-    int getNoAttendance(@Param("organIds") String organIds, @Param("startTime") String startTime);
+    int getNoAttendance(@Param("organIds") Set<Integer> organIds, @Param("startTime") String startTime);
 
     /**
      * 获取老师离职申请数

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

@@ -70,7 +70,7 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
      * @param groupType
      * @return
      */
-    List<Map<Integer, Integer>> getBuyNums(@Param("teacherIds") String teacherIds, @Param("groupType") GroupType groupType);
+    List<Map<Integer, Integer>> getBuyNums(@Param("teacherId") String teacherId, @Param("groupType") GroupType groupType);
 
     /**
      * 根据同事存在vip和网管的转化

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

@@ -4,6 +4,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import com.ym.mec.biz.dal.entity.Subject;
 import org.apache.ibatis.annotations.Param;
 
 import com.ym.mec.auth.api.entity.SysUser;
@@ -307,4 +308,12 @@ public interface StudentManageDao {
      * @return
      */
     int countPracticeGroupStudents(Map<String, Object> params);
+
+    /**
+     * 获取学生的声部
+     * @param userIds
+     * @return
+     */
+    List<Subject> getStudentSubject(@Param("userIds") Set<Integer> userIds);
+
 }

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

@@ -471,4 +471,13 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
      * @return com.ym.mec.biz.dal.entity.MusicGroup
      */
     MusicGroup getUserLastNormalMusicGroup(@Param("userId") Integer userId);
+
+    /**
+     * @describe 查询学员在读进行中乐团报名信息
+     * @author Joburgess
+     * @date 2021/2/25 0025
+     * @param studentIds:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.StudentRegistration>
+     */
+    List<StudentRegistration> getStudentNormalRegistration(@Param("studentIds") Set<Integer> studentIds);
 }

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseHomeworkListDto.java

@@ -61,6 +61,28 @@ public class CourseHomeworkListDto {
     @ApiModelProperty(value = "是否已经回复",required = false)
     private YesOrNoEnum isReplied;
 
+    @ApiModelProperty(value = "实际上课老师",required = false)
+    private String teacherName;
+
+    @ApiModelProperty(value = "实际上课老师头像",required = false)
+    private String headUrl;
+
+    public String getTeacherName() {
+        return teacherName;
+    }
+
+    public void setTeacherName(String teacherName) {
+        this.teacherName = teacherName;
+    }
+
+    public String getHeadUrl() {
+        return headUrl;
+    }
+
+    public void setHeadUrl(String headUrl) {
+        this.headUrl = headUrl;
+    }
+
     public Long getId() {
         return id;
     }

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

@@ -17,6 +17,9 @@ public class CourseScheduleDto extends CourseSchedule {
     @ApiModelProperty(value = "教师名称",required = false)
     private String teacherName;
 
+    @ApiModelProperty(value = "教师头像",required = false)
+    private String headUrl;
+
     /** 班级名称 */
     @ApiModelProperty(value = "班级名称",required = false)
     private String classGroupName;
@@ -90,6 +93,14 @@ public class CourseScheduleDto extends CourseSchedule {
 
     private PracticeGroupType practiceType;
 
+    public String getHeadUrl() {
+        return headUrl;
+    }
+
+    public void setHeadUrl(String headUrl) {
+        this.headUrl = headUrl;
+    }
+
     public PracticeGroupType getPracticeType() {
         return practiceType;
     }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ExtraExerciseStudentsDto.java

@@ -17,6 +17,8 @@ public class ExtraExerciseStudentsDto extends ExtracurricularExercisesReply {
 
     private String teacherName;
 
+    private String headUrl;
+
     private String title;
 
     private String content;
@@ -33,6 +35,14 @@ public class ExtraExerciseStudentsDto extends ExtracurricularExercisesReply {
 
     private String existVipCourseStr;
 
+    public String getHeadUrl() {
+        return headUrl;
+    }
+
+    public void setHeadUrl(String headUrl) {
+        this.headUrl = headUrl;
+    }
+
     public String getIsRepliedTimelyStr() {
         return isRepliedTimelyStr;
     }

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/IndexBaseDto.java

@@ -74,8 +74,8 @@ public class IndexBaseDto {
     public void setIndexMonthData(List<IndexBaseMonthData> indexMonthData, Date currentMonth) {
         this.indexMonthData = indexMonthData;
         if(!CollectionUtils.isEmpty(indexMonthData)){
-            BigDecimal total = indexMonthData.stream().map(IndexBaseMonthData::getTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add);
-            if(IndexDataType.ACTIVATION_RATE.equals(dataType)){
+            if(dataType.getCollect()){
+                BigDecimal total = indexMonthData.stream().map(IndexBaseMonthData::getTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add);
                 if(total.compareTo(BigDecimal.ZERO)==0){
                     this.percent = BigDecimal.ZERO;
                 }else{
@@ -83,7 +83,7 @@ public class IndexBaseDto {
                     this.percent = activateNum.divide(total, CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN);
                 }
             }else{
-                this.percent = indexMonthData.stream().filter(i->currentMonth.compareTo(i.getMonth())==0).max(Comparator.comparing(IndexBaseMonthData::getMonth)).get().getPercent();
+                this.percent = indexMonthData.stream().filter(i->currentMonth.compareTo(i.getMonth())>=0).max(Comparator.comparing(IndexBaseMonthData::getMonth)).get().getPercent();
             }
         }
     }

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentHomeworkRecordDto.java

@@ -20,8 +20,28 @@ public class StudentHomeworkRecordDto {
 
     private String teacherName;
 
+    private String headUrl;
+
     private int status;
 
+    private String expiryDate;
+
+    public String getHeadUrl() {
+        return headUrl;
+    }
+
+    public void setHeadUrl(String headUrl) {
+        this.headUrl = headUrl;
+    }
+
+    public String getExpiryDate() {
+        return expiryDate;
+    }
+
+    public void setExpiryDate(String expiryDate) {
+        this.expiryDate = expiryDate;
+    }
+
     public Integer getStudentCourseHomeworkId() {
         return studentCourseHomeworkId;
     }

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Goods.java

@@ -111,6 +111,7 @@ public class Goods {
 	private String complementGoodsIdList;
 
 	/** 辅件列表 */
+	@ApiModelProperty(value = "辅件列表(子商品)",required = false)
 	private List<Goods> goodsList;
 
 	/** 声部列表编号 */

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupSubjectGoodsGroup.java

@@ -64,6 +64,10 @@ public class MusicGroupSubjectGoodsGroup {
 	private String coursePurchaseTypeJson;
 
 
+	@ApiModelProperty(value = "子商品列表",required = false)
+	private List<Goods> childGoodsList;
+
+
 	/**  */
 	private java.util.Date createTime;
 	
@@ -215,4 +219,12 @@ public class MusicGroupSubjectGoodsGroup {
 	public void setGroupRemissionCourseFee(Integer groupRemissionCourseFee) {
 		this.groupRemissionCourseFee = groupRemissionCourseFee;
 	}
+
+	public List<Goods> getChildGoodsList() {
+		return childGoodsList;
+	}
+
+	public void setChildGoodsList(List<Goods> childGoodsList) {
+		this.childGoodsList = childGoodsList;
+	}
 }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentCourseScheduleRecordDto.java

@@ -49,12 +49,23 @@ public class StudentCourseScheduleRecordDto {
     @ApiModelProperty(value = "教师名称",required = false)
     private String teacherName;
 
+    @ApiModelProperty(value = "教师头像",required = false)
+    private String headUrl;
+
     @ApiModelProperty(value = "剩余课次",required = false)
     private Integer restOfClass;
 
     @ApiModelProperty(value = "教学形式")
     private TeachModeEnum teachMode;
 
+    public String getHeadUrl() {
+        return headUrl;
+    }
+
+    public void setHeadUrl(String headUrl) {
+        this.headUrl = headUrl;
+    }
+
     public Integer getClassGroupId() {
         return classGroupId;
     }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentPaymentOrderDetail.java

@@ -51,6 +51,9 @@ public class StudentPaymentOrderDetail {
 	//减免费用
 	private BigDecimal remitFee;
 
+	@ApiModelProperty(value = "子商品列表",required = false)
+	private List<Goods> childGoodsList;
+
 	public void setId(Long id){
 		this.id = id;
 	}
@@ -143,4 +146,12 @@ public class StudentPaymentOrderDetail {
 	public void setRemitFee(BigDecimal remitFee) {
 		this.remitFee = remitFee;
 	}
+
+	public List<Goods> getChildGoodsList() {
+		return childGoodsList;
+	}
+
+	public void setChildGoodsList(List<Goods> childGoodsList) {
+		this.childGoodsList = childGoodsList;
+	}
 }

+ 75 - 37
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/IndexDataType.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.enums;
 
+import com.sun.org.apache.xpath.internal.operations.Bool;
 import com.ym.mec.common.enums.BaseEnum;
 
 /**
@@ -7,50 +8,71 @@ import com.ym.mec.common.enums.BaseEnum;
  * @Date 2021/1/8 0008
  **/
 public enum IndexDataType implements BaseEnum<String, IndexDataType> {
-    SCHOOL("SCHOOL","合作单位"),
-    MUSIC_GROUP_NUM("MUSIC_GROUP_NUM","乐团数量"),
-    MUSIC_GROUP_STUDENT("MUSIC_GROUP_STUDENT","乐团学员"),
-    OTHER_STUDENT("OTHER_STUDENT","其他学员"),
-
-    ACTIVATION_RATE("ACTIVATION_RATE","激活率"),
-    HOMEWORK_CREATE_RATE("HOMEWORK_CREATE_RATE","作业布置率"),
-    HOMEWORK_SUBMIT_RATE("HOMEWORK_SUBMIT_RATE","作业提交率"),
-    HOMEWORK_COMMENT_RATE("HOMEWORK_COMMENT_RATE","作业点评率"),
-
-    SHOULD_INCOME_MONEY("SHOULD_INCOME_MONEY","应收金额"),
-    ANTICIPATED_INCOME_MONEY("ANTICIPATED_INCOME_MONEY","预收金额"),
-    SHOULD_EXPEND_MONEY("SHOULD_EXPEND_MONEY","预付金额"),
-    ANTICIPATED_EXPEND_MONEY("ANTICIPATED_EXPEND_MONEY","应付金额"),
-    REVENUE_MONEY("REVENUE_MONEY","营收金额"),
-
-    TEACHER_NUM("TEACHER_NUM","老师总数"),
-    FULL_TIME_NUM("FULL_TIME_NUM","全职人数"),
-    PART_TIME_NUM("PART_TIME_NUM","兼职人数"),
-    DIMISSION_NUM("DIMISSION_NUM","离职人数"),
-
-    NEWLY_STUDENT_NUM("NEWLY_STUDENT_NUM","乐团新增学员"),
-    QUIT_MUSIC_GROUP_STUDENT_NUM("QUIT_MUSIC_GROUP_STUDENT_NUM","退团学员"),
-    STUDENT_CONVERSION("STUDENT_CONVERSION","学员转化"),
-    STUDENT_CONVERSION_PRE_STUDENT_NUM("STUDENT_CONVERSION_PRE_STUDENT_NUM","预报名人数"),
-    STUDENT_CONVERSION_STUDENT_NUM("STUDENT_CONVERSION_STUDENT_NUM","报名人数"),
-    STUDENT_CONVERSION_PAYMENT_STUDENT_NUM("STUDENT_CONVERSION_PAYMENT_STUDENT_NUM","报名缴费"),
-    STUDENT_CONVERSION_VIP_PRACTICE_STUDENT_NUM("STUDENT_CONVERSION_VIP_PRACTICE_STUDENT_NUM","VIP/网管课购买"),
-
-    MUSIC_GROUP_COURSE("MUSIC_GROUP_COURSE","乐团课"),
-    VIP_GROUP_COURSE("VIP_GROUP_COURSE","VIP课"),
-    PRACTICE_GROUP_COURSE("PRACTICE_GROUP_COURSE","网管课"),
-
-    FINANCE_PAY("FINANCE_PAY","财务支出"),
-    FINANCE_BALANCE_AMOUNT("FINANCE_BALANCE_AMOUNT","余额收入"),
-    FINANCE_AMOUNT("FINANCE_AMOUNT","现金收入");
+    //学员数据类型
+    STUDENT_REGISTRATION_NUM("STUDENT_REGISTRATION_NUM", "注册学员", false, false),
+    CHARGE_STUDENT_CHANGE_RATE("CHARGE_STUDENT_CHANGE_RATE", "付费转化率", true, false),
+    ACTIVATION_RATE("ACTIVATION_RATE","激活率", true, false),
+
+    //运营数据类型
+    SCHOOL("SCHOOL","合作单位", false, false),
+    PROGRESS_MUSIC_GROUP_NUM("PROGRESS_MUSIC_GROUP_NUM","进行中乐团", false, false),
+
+    //人事数据
+    TEACHER_NUM("TEACHER_NUM","老师总数", false, false),
+    FULL_TIME_NUM("FULL_TIME_NUM","全职人数", false, false),
+    PART_TIME_NUM("PART_TIME_NUM","兼职人数", false, false),
+
+    DIMISSION_NUM("DIMISSION_NUM","离职人数", false, false),
+
+    //剩余课时
+    SURPLUS_COURSE_NUM("SURPLUS_COURSE_NUM", "剩余课时总数", false, false),
+    SURPLUS_MUSIC_COURSE_NUM("SURPLUS_MUSIC_COURSE_NUM", "剩余乐团课时", false, false),
+    SURPLUS_VIP_COURSE_NUM("SURPLUS_VIP_COURSE_NUM", "剩余VIP课时", false, false),
+    SURPLUS_PRACTICE_COURSE_NUM("SURPLUS_PRACTICE_COURSE_NUM", "剩余网管课时", false, false),
+
+    //已消耗课时
+    OVER_COURSE_NUM("OVER_COURSE_NUM", "已消耗课时总数", false, false),
+    OVER_MUSIC_COURSE_NUM("OVER_MUSIC_COURSE_NUM", "已消耗乐团课时", false, false),
+    OVER_VIP_COURSE_NUM("OVER_VIP_COURSE_NUM", "已消耗VIP课时", false, false),
+    OVER_PRACTICE_COURSE_NUM("OVER_PRACTICE_COURSE_NUM", "已消耗网管课时", false, false),
+
+    //经营数据
+    FINANCE_PAY("FINANCE_PAY","财务支出", false, false),
+    FINANCE_BALANCE_AMOUNT("FINANCE_BALANCE_AMOUNT","余额收入", false, false),
+    FINANCE_AMOUNT("FINANCE_AMOUNT","现金收入", false, false),
+
+    //业务数据
+    HOMEWORK_CREATE_RATE("HOMEWORK_CREATE_RATE","作业布置率", true, false),
+    HOMEWORK_SUBMIT_RATE("HOMEWORK_SUBMIT_RATE","作业提交率", true, false),
+    HOMEWORK_COMMENT_RATE("HOMEWORK_COMMENT_RATE","作业点评率", true, false),
+
+    //课程数据
+    MUSIC_GROUP_COURSE("MUSIC_GROUP_COURSE","乐团课", false, false),
+    VIP_GROUP_COURSE("VIP_GROUP_COURSE","VIP课", false, false),
+    PRACTICE_GROUP_COURSE("PRACTICE_GROUP_COURSE","网管课", false, false),
+
+    //学员变动
+    ADD_STUDENT_REGISTRATION_NUM("ADD_STUDENT_REGISTRATION_NUM", "新增注册学员", false, false),
+    MUSIC_GROUP_STUDENT("MUSIC_GROUP_STUDENT","乐团在读学员", false, false),
+    NEWLY_STUDENT_NUM("NEWLY_STUDENT_NUM","乐团新增学员", false, false),
+    QUIT_MUSIC_GROUP_STUDENT_NUM("QUIT_MUSIC_GROUP_STUDENT_NUM","退团学员", false, false),
+    VIP_PRACTICE_STUDENT_NUM("VIP_PRACTICE_STUDENT_NUM", "VIP/网管在读", false, false),
+    VIP_PRACTICE_ADD_STUDENT_NUM("VIP_PRACTICE_ADD_STUDENT_NUM", "VIP/网管新增", false, false),
+    ;
 
     private String code;
 
     private String msg;
 
-    IndexDataType(String code, String msg) {
+    private Boolean percent;
+
+    private Boolean collect;
+
+    IndexDataType(String code, String msg, Boolean percent, Boolean collect) {
         this.code = code;
         this.msg = msg;
+        this.percent = percent;
+        this.collect = collect;
     }
 
     @Override
@@ -69,4 +91,20 @@ public enum IndexDataType implements BaseEnum<String, IndexDataType> {
     public void setMsg(String msg) {
         this.msg = msg;
     }
+
+    public Boolean getCollect() {
+        return collect;
+    }
+
+    public void setCollect(Boolean collect) {
+        this.collect = collect;
+    }
+
+    public Boolean getPercent() {
+        return percent;
+    }
+
+    public void setPercent(Boolean percent) {
+        this.percent = percent;
+    }
 }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/EndCourseScheduleQueryInfo.java

@@ -78,6 +78,17 @@ public class EndCourseScheduleQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "ERR_ATTENDANCE 考勤异常,NO_ATTENDANCE 课程异常")
     private String searchType;
 
+    @ApiModelProperty(value = "课程编号搜索")
+    private Long courseIdSearch;
+
+    public Long getCourseIdSearch() {
+        return courseIdSearch;
+    }
+
+    public void setCourseIdSearch(Long courseIdSearch) {
+        this.courseIdSearch = courseIdSearch;
+    }
+
     public String getSearchType() {
         return searchType;
     }

+ 48 - 0
mec-biz/src/main/java/com/ym/mec/biz/event/MusicGroupStatusChangeEvent.java

@@ -0,0 +1,48 @@
+package com.ym.mec.biz.event;
+
+import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
+import org.springframework.context.ApplicationEvent;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/2/24 0024
+ */
+public class MusicGroupStatusChangeEvent extends ApplicationEvent {
+
+    private String musicGroupId;
+
+    private MusicGroupStatusEnum oldStatus;
+
+    private MusicGroupStatusEnum currentStatus;
+
+    public MusicGroupStatusChangeEvent(Object source, String musicGroupId, MusicGroupStatusEnum oldStatus, MusicGroupStatusEnum currentStatus) {
+        super(source);
+        this.musicGroupId = musicGroupId;
+        this.oldStatus = oldStatus;
+        this.currentStatus = currentStatus;
+    }
+
+    public String getMusicGroupId() {
+        return musicGroupId;
+    }
+
+    public void setMusicGroupId(String musicGroupId) {
+        this.musicGroupId = musicGroupId;
+    }
+
+    public MusicGroupStatusEnum getOldStatus() {
+        return oldStatus;
+    }
+
+    public void setOldStatus(MusicGroupStatusEnum oldStatus) {
+        this.oldStatus = oldStatus;
+    }
+
+    public MusicGroupStatusEnum getCurrentStatus() {
+        return currentStatus;
+    }
+
+    public void setCurrentStatus(MusicGroupStatusEnum currentStatus) {
+        this.currentStatus = currentStatus;
+    }
+}

+ 50 - 0
mec-biz/src/main/java/com/ym/mec/biz/event/MusicGroupStudentChangeEvent.java

@@ -0,0 +1,50 @@
+package com.ym.mec.biz.event;
+
+import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
+import org.springframework.context.ApplicationEvent;
+
+import java.util.List;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/2/24 0024
+ */
+public class MusicGroupStudentChangeEvent extends ApplicationEvent {
+
+    private String musicGroupId;
+
+    private StudentMusicGroupStatusEnum studentMusicGroupStatus;
+
+    private List<Integer> studentIds;
+
+    public MusicGroupStudentChangeEvent(Object source, String musicGroupId, StudentMusicGroupStatusEnum studentMusicGroupStatus, List<Integer> studentIds) {
+        super(source);
+        this.musicGroupId = musicGroupId;
+        this.studentMusicGroupStatus = studentMusicGroupStatus;
+        this.studentIds = studentIds;
+    }
+
+    public String getMusicGroupId() {
+        return musicGroupId;
+    }
+
+    public void setMusicGroupId(String musicGroupId) {
+        this.musicGroupId = musicGroupId;
+    }
+
+    public StudentMusicGroupStatusEnum getStudentMusicGroupStatus() {
+        return studentMusicGroupStatus;
+    }
+
+    public void setStudentMusicGroupStatus(StudentMusicGroupStatusEnum studentMusicGroupStatus) {
+        this.studentMusicGroupStatus = studentMusicGroupStatus;
+    }
+
+    public List<Integer> getStudentIds() {
+        return studentIds;
+    }
+
+    public void setStudentIds(List<Integer> studentIds) {
+        this.studentIds = studentIds;
+    }
+}

+ 102 - 0
mec-biz/src/main/java/com/ym/mec/biz/event/listener/GroupEventListener.java

@@ -0,0 +1,102 @@
+package com.ym.mec.biz.event.listener;
+
+import com.ym.mec.biz.dal.dao.IndexBaseMonthDataDao;
+import com.ym.mec.biz.dal.dao.MusicGroupDao;
+import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
+import com.ym.mec.biz.dal.entity.IndexBaseMonthData;
+import com.ym.mec.biz.dal.entity.MusicGroup;
+import com.ym.mec.biz.dal.entity.StudentRegistration;
+import com.ym.mec.biz.dal.enums.IndexDataType;
+import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
+import com.ym.mec.biz.event.MusicGroupStudentChangeEvent;
+import com.ym.mec.util.date.DateUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.event.EventListener;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/2/24 0024
+ */
+@Component
+public class GroupEventListener {
+
+    @Autowired
+    private MusicGroupDao musicGroupDao;
+    @Autowired
+    private StudentRegistrationDao studentRegistrationDao;
+    @Autowired
+    private IndexBaseMonthDataDao indexBaseMonthDataDao;
+
+    @Async
+    @EventListener
+    public void musicGroupStudentChangeMonitor(MusicGroupStudentChangeEvent musicGroupStatusChangeEvent){
+        if(Objects.isNull(musicGroupStatusChangeEvent.getMusicGroupId())||Objects.isNull(musicGroupStatusChangeEvent.getStudentMusicGroupStatus())){
+            return;
+        }
+        MusicGroup musicGroup = musicGroupDao.get(musicGroupStatusChangeEvent.getMusicGroupId());
+        if(Objects.isNull(musicGroup)){
+            return;
+        }
+        List<Integer> studentIds = musicGroupStatusChangeEvent.getStudentIds();
+        if(CollectionUtils.isEmpty(studentIds)) {
+            List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryStudentByMusicGroupId(musicGroupStatusChangeEvent.getMusicGroupId());
+            studentIds = studentRegistrations.stream().map(StudentRegistration::getUserId).collect(Collectors.toList());
+        }
+        if(CollectionUtils.isEmpty(studentIds)){
+            return;
+        }
+        List<StudentRegistration> studentNormalRegistration = studentRegistrationDao.getStudentNormalRegistration(new HashSet<>(studentIds));
+        Map<Integer, Set<String>> userGroupIdMap = studentNormalRegistration.stream().collect(Collectors.groupingBy(StudentRegistration::getUserId, Collectors.mapping(StudentRegistration::getMusicGroupId, Collectors.toSet())));
+        int updateNum = 0;
+        for (Integer studentId : studentIds) {
+            if(userGroupIdMap.containsKey(studentId)&&userGroupIdMap.get(studentId).size()>1){
+                continue;
+            }
+            if(userGroupIdMap.containsKey(studentId)&&!userGroupIdMap.get(studentId).contains(musicGroupStatusChangeEvent.getMusicGroupId())){
+                continue;
+            }
+            updateNum+=1;
+        }
+        LocalDate nowDate = LocalDate.now();
+        String dayStr = nowDate.plusDays(-1).toString();
+        IndexBaseMonthData indexBaseMonthData = null;
+        switch (musicGroupStatusChangeEvent.getStudentMusicGroupStatus()){
+            case NORMAL:
+                indexBaseMonthData = indexBaseMonthDataDao.getOrganDataWithDayAndDataType(musicGroup.getOrganId(), dayStr, IndexDataType.NEWLY_STUDENT_NUM);
+                break;
+            case QUIT:
+                indexBaseMonthData = indexBaseMonthDataDao.getOrganDataWithDayAndDataType(musicGroup.getOrganId(), dayStr, IndexDataType.QUIT_MUSIC_GROUP_STUDENT_NUM);
+                break;
+            default:
+                return;
+        }
+        if(Objects.isNull(indexBaseMonthData)){
+            indexBaseMonthData = new IndexBaseMonthData();
+            Date date = DateUtil.stringToDate(dayStr, "yyyy-MM-dd");
+            BigDecimal zero = new BigDecimal(0);
+            indexBaseMonthData.setMonth(date);
+            indexBaseMonthData.setOrganId(musicGroup.getOrganId());
+            indexBaseMonthData.setDataType(StudentMusicGroupStatusEnum.NORMAL.equals(musicGroupStatusChangeEvent.getStudentMusicGroupStatus())?IndexDataType.NEWLY_STUDENT_NUM:IndexDataType.QUIT_MUSIC_GROUP_STUDENT_NUM);
+            indexBaseMonthData.setTotalNum(zero);
+            indexBaseMonthData.setActivateNum(zero);
+            indexBaseMonthData.setPercent(zero);
+        }
+        indexBaseMonthData.setTotalNum(indexBaseMonthData.getTotalNum().add(new BigDecimal(updateNum)));
+        indexBaseMonthData.setActivateNum(indexBaseMonthData.getActivateNum().add(new BigDecimal(updateNum)));
+        indexBaseMonthData.setPercent(indexBaseMonthData.getPercent().add(new BigDecimal(updateNum)));
+        if(Objects.isNull(indexBaseMonthData.getId())){
+            indexBaseMonthDataDao.insert(indexBaseMonthData);
+        }else{
+            indexBaseMonthDataDao.update(indexBaseMonthData);
+        }
+    }
+
+}

+ 30 - 0
mec-biz/src/main/java/com/ym/mec/biz/event/source/GroupEventSource.java

@@ -0,0 +1,30 @@
+package com.ym.mec.biz.event.source;
+
+import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
+import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
+import com.ym.mec.biz.event.MusicGroupStatusChangeEvent;
+import com.ym.mec.biz.event.MusicGroupStudentChangeEvent;
+import org.springframework.context.ApplicationContext;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/2/24 0024
+ */
+@Service
+public class GroupEventSource {
+
+    @Resource
+    private ApplicationContext applicationContext;
+
+    public void musicGroupStatusChange(String musicGroupId, MusicGroupStatusEnum oldStatus, MusicGroupStatusEnum currentStatus) {
+        applicationContext.publishEvent(new MusicGroupStatusChangeEvent(this, musicGroupId, oldStatus, currentStatus));
+    }
+
+    public void musicGroupStudentChangeEvent(String musicGroupId, StudentMusicGroupStatusEnum studentMusicGroupStatus, List<Integer> studentIds) {
+        applicationContext.publishEvent(new MusicGroupStudentChangeEvent(this, musicGroupId, studentMusicGroupStatus, studentIds));
+    }
+}

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

@@ -35,7 +35,7 @@ public interface ImUserFriendService extends BaseService<Long, ImUserFriend> {
 	 * @param nickname 昵称
 	 * @return
 	 */
-	boolean updateFriendNickname(Integer userId, Integer friendUserId, String nickname);
+	boolean updateFriendNickname(Integer userId, Integer friendUserId, String nickname, String memo);
 
 	/**
 	 * 根据条件查询指定用户的好友列表

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

@@ -14,7 +14,7 @@ public interface IndexBaseMonthDataService extends BaseService<Long, IndexBaseMo
 
     List<IndexBaseDto> getIndexBaseData(IndexDataQueryInfo indexDataQueryInfo);
 
-    Map<String, List<IndexBaseDto>> indexBaseDataTask(String month);
+    void indexBaseDataTask(String month);
 
     Map<String, Object> getIndexErrData(String organIds, IndexErrorType errorType);
 

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentOrderService.java

@@ -139,4 +139,12 @@ public interface StudentPaymentOrderService extends BaseService<Long, StudentPay
 	 * @return
 	 */
 	List<StudentPaymentOrder> reConfirmOrder(Date startTime,Date endTime);
+
+	/**
+	 * 获取学生报名的订单
+	 * @param studentId
+	 * @param musicGroupId
+	 * @return
+	 */
+	List<StudentPaymentOrderExportDto> getUserApplyOrders(Integer studentId,String musicGroupId);
 }

+ 15 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupStudentMapperServiceImpl.java

@@ -164,7 +164,11 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
 
                     BigDecimal salary = null;
                     if(classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE)){
-                        salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum + "");
+                        if(studentNum>0){
+                            salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum + "");
+                        }else{
+                            salary = new BigDecimal("0");
+                        }
                     }else if(classGroup.getType().equals(ClassGroupTypeEnum.HIGH)){
                         MusicGroup musicGroup = musicGroupDao.get(classGroup.getMusicGroupId());
                         TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalaryHigh = collect.get(CourseSchedule.CourseScheduleType.HIGH);
@@ -350,7 +354,11 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
                     }
                     BigDecimal salary = null;
                     if(classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE)){
-                        salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum + "");
+                        if(studentNum>0){
+                            salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum + "");
+                        }else{
+                            salary = new BigDecimal("0");
+                        }
                     }else if(classGroup.getType().equals(ClassGroupTypeEnum.HIGH)){
                         MusicGroup musicGroup = musicGroupDao.get(classGroup.getMusicGroupId());
                         TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalaryHigh = collect.get(CourseSchedule.CourseScheduleType.HIGH);
@@ -558,7 +566,11 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
 
                     BigDecimal salary = null;
                     if(classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE)){
-                        salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum + "");
+                        if(studentNum>0){
+                            salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum + "");
+                        }else{
+                            salary = new BigDecimal("0");
+                        }
                     }else if(classGroup.getType().equals(ClassGroupTypeEnum.HIGH)){
                         TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalaryHigh = collect.get(CourseSchedule.CourseScheduleType.HIGH);
                         if(Objects.isNull(teacherDefaultMusicGroupSalaryHigh)){

+ 53 - 43
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -972,28 +972,33 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
     @Override
     public List<Date> getCourseScheduleDates(Date month, String organIdList, String type) {
-		Map<String, Object> params = new HashMap<>();
-		params.put("organIdList", organIdList);
-
-		List<Group> groups = groupDao.searchGroups(params);
-		List<Integer> classGroupIds=new ArrayList<>();
-		if(!CollectionUtils.isEmpty(groups)){
-			Map<GroupType, List<Group>> groupTypeGroupsMap = groups.stream().collect(Collectors.groupingBy(Group::getGroupType));
-			for (Map.Entry<GroupType, List<Group>> groupTypeListEntry : groupTypeGroupsMap.entrySet()) {
-				List<String> groupIds = groupTypeListEntry.getValue().stream().map(Group::getId).collect(Collectors.toList());
-				List<ClassGroup> classGroups = classGroupDao.findByMusicGroupsAndType(groupIds, groupTypeListEntry.getKey().getCode());
-				if(!CollectionUtils.isEmpty(classGroups)){
-					List<Integer> tempClassGroupIds=classGroups.stream().map(ClassGroup::getId).collect(Collectors.toList());
-					classGroupIds.addAll(tempClassGroupIds);
-				}
-			}
-			if(CollectionUtils.isEmpty(classGroupIds)){
-				return Collections.EMPTY_LIST;
-			}
-		}else{
-			return Collections.EMPTY_LIST;
+//		Map<String, Object> params = new HashMap<>();
+//		params.put("organIdList", organIdList);
+//
+//		List<Group> groups = groupDao.searchGroups(params);
+//		List<Integer> classGroupIds=new ArrayList<>();
+//		if(!CollectionUtils.isEmpty(groups)){
+//			Map<GroupType, List<Group>> groupTypeGroupsMap = groups.stream().collect(Collectors.groupingBy(Group::getGroupType));
+//			for (Map.Entry<GroupType, List<Group>> groupTypeListEntry : groupTypeGroupsMap.entrySet()) {
+//				List<String> groupIds = groupTypeListEntry.getValue().stream().map(Group::getId).collect(Collectors.toList());
+//				List<ClassGroup> classGroups = classGroupDao.findByMusicGroupsAndType(groupIds, groupTypeListEntry.getKey().getCode());
+//				if(!CollectionUtils.isEmpty(classGroups)){
+//					List<Integer> tempClassGroupIds=classGroups.stream().map(ClassGroup::getId).collect(Collectors.toList());
+//					classGroupIds.addAll(tempClassGroupIds);
+//				}
+//			}
+//			if(CollectionUtils.isEmpty(classGroupIds)){
+//				return Collections.EMPTY_LIST;
+//			}
+//		}else{
+//			return Collections.EMPTY_LIST;
+//		}
+//        return courseScheduleDao.getCourseScheduleDate(month, classGroupIds,type);
+		List<Integer> organIds = new ArrayList<>();
+		if(StringUtils.isNotBlank(organIdList)){
+			organIds = Arrays.stream(organIdList.split(",")).map(s->Integer.valueOf(s)).collect(Collectors.toList());
 		}
-        return courseScheduleDao.getCourseScheduleDate(month, classGroupIds,type);
+		return courseScheduleDao.getCourseScheduleDateWithOrgan(organIds, month, type);
     }
 
     @Override
@@ -1075,30 +1080,35 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             queryInfo.setDate(new Date());
         }
 
+		List<Integer> organIds = new ArrayList<>();
+		if(StringUtils.isNotBlank(queryInfo.getOrganIdList())){
+			organIds = Arrays.stream(queryInfo.getOrganIdList().split(",")).map(s->Integer.valueOf(s)).collect(Collectors.toList());
+		}
+
         Map<String, Object> params = new HashMap<>();
         MapUtil.populateMap(params, queryInfo);
 
-        params.put("musicGroupStatus", null);
-        params.put("vipGroupStatus", null);
-        List<Group> groups = groupDao.searchGroups(params);
-        if(!CollectionUtils.isEmpty(groups)){
-            Map<GroupType, List<Group>> groupTypeGroupsMap = groups.stream().collect(Collectors.groupingBy(Group::getGroupType));
-            List<Integer> classGroupIds=new ArrayList<>();
-            for (Map.Entry<GroupType, List<Group>> groupTypeListEntry : groupTypeGroupsMap.entrySet()) {
-                List<String> groupIds = groupTypeListEntry.getValue().stream().map(Group::getId).collect(Collectors.toList());
-                List<ClassGroup> classGroups = classGroupDao.findByMusicGroupsAndType(groupIds, groupTypeListEntry.getKey().getCode());
-                if(!CollectionUtils.isEmpty(classGroups)){
-                    List<Integer> tempClassGroupIds=classGroups.stream().map(ClassGroup::getId).collect(Collectors.toList());
-                    classGroupIds.addAll(tempClassGroupIds);
-                }
-            }
-            if(CollectionUtils.isEmpty(classGroupIds)){
-                return pageInfo;
-            }
-            params.put("classGroupIds", classGroupIds);
-        }else{
-            return pageInfo;
-        }
+//        params.put("musicGroupStatus", null);
+//        params.put("vipGroupStatus", null);
+//        List<Group> groups = groupDao.searchGroups(params);
+//        if(!CollectionUtils.isEmpty(groups)){
+//            Map<GroupType, List<Group>> groupTypeGroupsMap = groups.stream().collect(Collectors.groupingBy(Group::getGroupType));
+//            List<Integer> classGroupIds=new ArrayList<>();
+//            for (Map.Entry<GroupType, List<Group>> groupTypeListEntry : groupTypeGroupsMap.entrySet()) {
+//                List<String> groupIds = groupTypeListEntry.getValue().stream().map(Group::getId).collect(Collectors.toList());
+//                List<ClassGroup> classGroups = classGroupDao.findByMusicGroupsAndType(groupIds, groupTypeListEntry.getKey().getCode());
+//                if(!CollectionUtils.isEmpty(classGroups)){
+//                    List<Integer> tempClassGroupIds=classGroups.stream().map(ClassGroup::getId).collect(Collectors.toList());
+//                    classGroupIds.addAll(tempClassGroupIds);
+//                }
+//            }
+//            if(CollectionUtils.isEmpty(classGroupIds)){
+//                return pageInfo;
+//            }
+//            params.put("classGroupIds", classGroupIds);
+//        }else{
+//            return pageInfo;
+//        }
 
         List<CourseScheduleDto> dataList = null;
         int count = courseScheduleDao.countCourseSchedulesWithDate(params);
@@ -4273,7 +4283,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         if (vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING)) {
             dataList = JSON.parseArray(vipGroup.getCourseSchedulesJson(), CourseSchedule.class);
         } else {
-            dataList = courseScheduleDao.findGroupCourseSchedules(vipGroup.getId(),GroupType.VIP.getCode());
+            dataList = courseScheduleDao.findGroupCourseSchedules(vipGroup.getId().toString(),GroupType.VIP.getCode());
         }
 
         int count = dataList.size();

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

@@ -96,7 +96,7 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 		//获取活动信息
 		VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroupApplyBaseInfoDto.getVipGroupActivityId().intValue());
 
-		List<CourseSchedule> vipGroupCourseSchedules=courseScheduleDao.findGroupCourseSchedules(vipGroupId,GroupType.VIP.getCode());
+		List<CourseSchedule> vipGroupCourseSchedules=courseScheduleDao.findGroupCourseSchedules(vipGroupId.toString(),GroupType.VIP.getCode());
 
 		if(CollectionUtils.isEmpty(vipGroupCourseSchedules)){
 			throw new BizException("未获取到排课信息");

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

@@ -153,7 +153,7 @@ public class GroupClassServiceImpl implements GroupClassService {
                 if(refundAmount.compareTo(orders.get(0).getExpectAmount())>0){
                     throw new BizException("退款不可大于购买金额");
                 }
-                sysUserCashAccountService.updateBalance(practiceGroup.getStudentId(), refundAmount, PlatformCashAccountDetailTypeEnum.REFUNDS, "后关闭网管课");
+                sysUserCashAccountService.updateBalance(practiceGroup.getStudentId(), refundAmount, PlatformCashAccountDetailTypeEnum.REFUNDS, "后关闭网管课");
             }
             cleanGroupInfo(groupId.toString(), GroupType.PRACTICE);
             practiceGroup.setMemo("后台关闭网管课");

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

@@ -73,7 +73,7 @@ public class ImGroupMemberServiceImpl extends BaseServiceImpl<Long, ImGroupMembe
 		imGroupMember.setUpdateTime(date);
 		imGroupMember.setUserId(userId);
 		if (StringUtils.isBlank(roleType)) {
-			imGroupMember.setNickname(user.getRealName());
+			imGroupMember.setNickname(user.getUsername());
 		} else {
 			imGroupMember.setNickname(user.getRealName());
 		}

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

@@ -88,13 +88,14 @@ public class ImUserFriendServiceImpl extends BaseServiceImpl<Long, ImUserFriend>
 	}
 
 	@Override
-	public boolean updateFriendNickname(Integer userId, Integer friendUserId, String nickname) {
+	public boolean updateFriendNickname(Integer userId, Integer friendUserId, String nickname, String memo) {
 		ImUserFriend userFriend = imUserFriendDao.query(userId, friendUserId);
 		if (userFriend == null) {
 			throw new BizException("好友不存在");
 		}
 		Date date = new Date();
 		userFriend.setFriendNickname(nickname);
+		userFriend.setMemo(memo);
 		userFriend.setUpdateTime(date);
 		imUserFriendDao.update(userFriend);
 

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

@@ -23,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
 import java.math.BigDecimal;
+import java.time.DayOfWeek;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
@@ -95,7 +96,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			indexBaseDatas = new ArrayList<>();
 		}
 
-		Map<IndexDataType, List<IndexBaseMonthData>> typeDateMap = indexBaseDatas.stream().collect(Collectors.groupingBy(IndexBaseMonthData::getDataType));
+		Map<IndexDataType, List<IndexBaseMonthData>> typeDateMap = indexBaseDatas.stream().filter(d->Objects.nonNull(d.getDataType())).collect(Collectors.groupingBy(IndexBaseMonthData::getDataType));
 
 		for (IndexDataType dataType : IndexDataType.values()) {
 			if(typeDateMap.containsKey(dataType)){
@@ -104,6 +105,11 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 
 			IndexBaseMonthData indexBaseMonthData = new IndexBaseMonthData();
 			indexBaseMonthData.setMonth(Date.from(endDate.atStartOfDay(DateUtil.zoneId).toInstant()));
+			if(IndexDataType.HOMEWORK_CREATE_RATE.equals(dataType)
+					||IndexDataType.HOMEWORK_SUBMIT_RATE.equals(dataType)
+					||IndexDataType.HOMEWORK_COMMENT_RATE.equals(dataType)){
+				indexBaseMonthData.setMonth(Date.from(endDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue()).atStartOfDay(DateUtil.zoneId).toInstant()));
+			}
 			indexBaseMonthData.setTotalNum(BigDecimal.ZERO);
 			indexBaseMonthData.setActivateNum(BigDecimal.ZERO);
 			indexBaseMonthData.setPercent(BigDecimal.ZERO);
@@ -115,6 +121,13 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			Set<String> hasMonths = typeDateMapEntry.getValue().stream().map(d -> DateUtil.dateToString(d.getMonth(), "yyyy-MM-dd")).collect(Collectors.toSet());
 			LocalDate currentMonthDate = startDate;
 			while (currentMonthDate.compareTo(endDate)<=0){
+				if((IndexDataType.HOMEWORK_CREATE_RATE.equals(typeDateMapEntry.getKey())
+					||IndexDataType.HOMEWORK_SUBMIT_RATE.equals(typeDateMapEntry.getKey())
+					||IndexDataType.HOMEWORK_COMMENT_RATE.equals(typeDateMapEntry.getKey()))
+					&&currentMonthDate.getDayOfWeek()!=DayOfWeek.MONDAY){
+					currentMonthDate = currentMonthDate.plusDays(1);
+					continue;
+				}
 				if(hasMonths.contains(currentMonthDate.toString())){
 					currentMonthDate = currentMonthDate.plusDays(1);
 					continue;
@@ -129,9 +142,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 				currentMonthDate = currentMonthDate.plusDays(1);
 			}
 			typeDateMapEntry.getValue().sort(Comparator.comparing(IndexBaseMonthData::getMonth));
-			if(IndexDataType.ACTIVATION_RATE.equals(typeDateMapEntry.getKey())||IndexDataType.HOMEWORK_CREATE_RATE.equals(typeDateMapEntry.getKey())
-					||IndexDataType.HOMEWORK_SUBMIT_RATE.equals(typeDateMapEntry.getKey())||IndexDataType.HOMEWORK_COMMENT_RATE.equals(typeDateMapEntry.getKey())
-					||IndexDataType.STUDENT_CONVERSION.equals(typeDateMapEntry.getKey())){
+			if(typeDateMapEntry.getKey().getPercent()){
 				for (IndexBaseMonthData indexBaseMonthData : typeDateMapEntry.getValue()) {
 					if(indexBaseMonthData.getTotalNum().compareTo(BigDecimal.ZERO)==0){
 						indexBaseMonthData.setPercent(BigDecimal.ZERO);
@@ -143,22 +154,17 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			IndexBaseDto indexBaseData = new IndexBaseDto(typeDateMapEntry.getKey(),typeDateMapEntry.getKey().getMsg());
 			indexBaseData.setIndexMonthData(typeDateMapEntry.getValue(), currentMonth);
 			if(IndexDataType.FINANCE_PAY.equals(typeDateMapEntry.getKey()) || IndexDataType.FINANCE_AMOUNT.equals(typeDateMapEntry.getKey()) ||
-				IndexDataType.FINANCE_BALANCE_AMOUNT.equals(typeDateMapEntry.getKey())
-				||IndexDataType.MUSIC_GROUP_COURSE.equals(typeDateMapEntry.getKey())||IndexDataType.VIP_GROUP_COURSE.equals(typeDateMapEntry.getKey())
-					||IndexDataType.PRACTICE_GROUP_COURSE.equals(typeDateMapEntry.getKey())){
+				IndexDataType.FINANCE_BALANCE_AMOUNT.equals(typeDateMapEntry.getKey())){
 				indexBaseData.setPercent(typeDateMapEntry.getValue().stream().map(IndexBaseMonthData::getPercent).reduce(BigDecimal.ZERO, BigDecimal::add));
 			}
 			result.add(indexBaseData);
 		}
-		countStudentConvertData(result, currentMonth);
 		return result;
 	}
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public Map<String, List<IndexBaseDto>> indexBaseDataTask(String dayStr) {
-		Map<String, List<IndexBaseDto>> result = new HashMap<>();
-
+	public void indexBaseDataTask(String dayStr) {
 		LocalDate nowDate = LocalDate.now();
 
 		List<Organization> allOrgans = organizationDao.findAllOrgans();
@@ -171,149 +177,58 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			dayStr = nowDate.plusDays(-1).toString();
 		}
 
-		//运营数据
-		saveData(indexBaseMonthDataDao.getSchoolData(dayStr), dayStr, IndexDataType.SCHOOL);
-		saveData(indexBaseMonthDataDao.getMusicData(dayStr), dayStr, IndexDataType.MUSIC_GROUP_NUM);
-		saveData(indexBaseMonthDataDao.getMusicStudentData(dayStr, null), dayStr, IndexDataType.MUSIC_GROUP_STUDENT);
-		saveData(indexBaseMonthDataDao.getOtherStudentData(dayStr), dayStr, IndexDataType.OTHER_STUDENT);
+		LocalDate day = LocalDate.parse(dayStr, DateUtil.dateFormatter);
+		LocalDate monday = day.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
 
-		//业务数据
+		//学员数据
+		saveData(indexBaseMonthDataDao.getStudentRegistrationData(dayStr), dayStr, IndexDataType.STUDENT_REGISTRATION_NUM);
+		saveData(indexBaseMonthDataDao.getChargeStudentChangeData(dayStr), dayStr, IndexDataType.CHARGE_STUDENT_CHANGE_RATE);
 		saveData(indexBaseMonthDataDao.getStudentSignUpData(dayStr), dayStr, IndexDataType.ACTIVATION_RATE);
-		saveData(indexBaseMonthDataDao.getHomeworkData(dayStr, null), dayStr, IndexDataType.HOMEWORK_CREATE_RATE);
-		saveData(indexBaseMonthDataDao.getHomeworkData(dayStr, "submit"), dayStr, IndexDataType.HOMEWORK_SUBMIT_RATE);
-		saveData(indexBaseMonthDataDao.getHomeworkData(dayStr, "comment"), dayStr, IndexDataType.HOMEWORK_COMMENT_RATE);
 
-		//经营数据
-		saveData(null, dayStr, IndexDataType.SHOULD_INCOME_MONEY);
-		saveData(null, dayStr, IndexDataType.ANTICIPATED_INCOME_MONEY);
-		saveData(null, dayStr, IndexDataType.SHOULD_EXPEND_MONEY);
-		saveData(null, dayStr, IndexDataType.ANTICIPATED_EXPEND_MONEY);
-		saveData(null, dayStr, IndexDataType.REVENUE_MONEY);
+		//运营数据
+		saveData(indexBaseMonthDataDao.getSchoolData(dayStr), dayStr, IndexDataType.SCHOOL);
+		saveData(indexBaseMonthDataDao.getMusicData(dayStr), dayStr, IndexDataType.PROGRESS_MUSIC_GROUP_NUM);
 
 		//人事数据
 		saveData(indexBaseMonthDataDao.getTeacherData(dayStr, null, null), dayStr, IndexDataType.TEACHER_NUM);
 		saveData(indexBaseMonthDataDao.getTeacherData(dayStr, JobNatureEnum.FULL_TIME, null), dayStr, IndexDataType.FULL_TIME_NUM);
 		saveData(indexBaseMonthDataDao.getTeacherData(dayStr, JobNatureEnum.PART_TIME, null), dayStr, IndexDataType.PART_TIME_NUM);
-		saveData(indexBaseMonthDataDao.getTeacherData(dayStr, null, true), dayStr, IndexDataType.DIMISSION_NUM);
+//		saveData(indexBaseMonthDataDao.getTeacherData(dayStr, null, true), dayStr, IndexDataType.DIMISSION_NUM);
 
-		//学员变动
-		saveData(indexBaseMonthDataDao.getMusicStudentData(dayStr, "ADD"), dayStr, IndexDataType.NEWLY_STUDENT_NUM);
-		saveData(indexBaseMonthDataDao.getMusicStudentData(dayStr, "QUIT"), dayStr, IndexDataType.QUIT_MUSIC_GROUP_STUDENT_NUM);
-		saveData(indexBaseMonthDataDao.getMusicGroupPreRegistrationStudentData(dayStr), dayStr, IndexDataType.STUDENT_CONVERSION_PRE_STUDENT_NUM);
-		saveData(indexBaseMonthDataDao.getMusicGroupStudentFromPreData(dayStr, null), dayStr, IndexDataType.STUDENT_CONVERSION_STUDENT_NUM);
-		saveData(indexBaseMonthDataDao.getMusicGroupStudentFromPreData(dayStr, PaymentStatusEnum.YES), dayStr, IndexDataType.STUDENT_CONVERSION_PAYMENT_STUDENT_NUM);
-		List<Integer> studentIds = indexBaseMonthDataDao.getMusicGroupStudentIdFromPre(dayStr, PaymentStatusEnum.YES);
-		List<IndexBaseMonthData> convertStudentNum = new ArrayList<>();
-		if(!CollectionUtils.isEmpty(studentIds)){
-			convertStudentNum = indexBaseMonthDataDao.getStudentConversionData(dayStr, studentIds);
-		}
-		saveData(convertStudentNum, dayStr, IndexDataType.STUDENT_CONVERSION_VIP_PRACTICE_STUDENT_NUM);
+		//剩余课时
+		saveData(indexBaseMonthDataDao.getGroupCourseData(dayStr, null, CourseStatusEnum.NOT_START), dayStr, IndexDataType.SURPLUS_COURSE_NUM);
+		saveData(indexBaseMonthDataDao.getGroupCourseData(dayStr, GroupType.MUSIC, CourseStatusEnum.NOT_START), dayStr, IndexDataType.SURPLUS_MUSIC_COURSE_NUM);
+		saveData(indexBaseMonthDataDao.getGroupCourseData(dayStr, GroupType.VIP, CourseStatusEnum.NOT_START), dayStr, IndexDataType.SURPLUS_VIP_COURSE_NUM);
+		saveData(indexBaseMonthDataDao.getGroupCourseData(dayStr, GroupType.PRACTICE, CourseStatusEnum.NOT_START), dayStr, IndexDataType.SURPLUS_PRACTICE_COURSE_NUM);
 
-		//课程数据
-		saveData(indexBaseMonthDataDao.getGroupCourseData(dayStr, GroupType.MUSIC), dayStr, IndexDataType.MUSIC_GROUP_COURSE);
-		saveData(indexBaseMonthDataDao.getGroupCourseData(dayStr, GroupType.VIP), dayStr, IndexDataType.VIP_GROUP_COURSE);
-		saveData(indexBaseMonthDataDao.getGroupCourseData(dayStr, GroupType.PRACTICE), dayStr, IndexDataType.PRACTICE_GROUP_COURSE);
+		//已消耗课时
+		saveData(indexBaseMonthDataDao.getGroupSurplusCourseData(dayStr, null, CourseStatusEnum.OVER), dayStr, IndexDataType.OVER_COURSE_NUM);
+		saveData(indexBaseMonthDataDao.getGroupSurplusCourseData(dayStr, GroupType.MUSIC, CourseStatusEnum.OVER), dayStr, IndexDataType.OVER_MUSIC_COURSE_NUM);
+		saveData(indexBaseMonthDataDao.getGroupSurplusCourseData(dayStr, GroupType.VIP, CourseStatusEnum.OVER), dayStr, IndexDataType.OVER_VIP_COURSE_NUM);
+		saveData(indexBaseMonthDataDao.getGroupSurplusCourseData(dayStr, GroupType.PRACTICE, CourseStatusEnum.OVER), dayStr, IndexDataType.OVER_PRACTICE_COURSE_NUM);
 
-		//财务数据
+		//经营数据
 		saveData(indexBaseMonthDataDao.getFinancePayData(dayStr),dayStr,IndexDataType.FINANCE_PAY);
 		saveData(indexBaseMonthDataDao.getFinanceBalanceData(dayStr),dayStr,IndexDataType.FINANCE_BALANCE_AMOUNT);
 		saveData(indexBaseMonthDataDao.getFinanceActualData(dayStr),dayStr,IndexDataType.FINANCE_AMOUNT);
 
-		return result;
-	}
+		//业务数据
+		saveData(indexBaseMonthDataDao.getHomeworkData(dayStr, null), monday.toString(), IndexDataType.HOMEWORK_CREATE_RATE);
+		saveData(indexBaseMonthDataDao.getHomeworkData(dayStr, "submit"), monday.toString(), IndexDataType.HOMEWORK_SUBMIT_RATE);
+		saveData(indexBaseMonthDataDao.getHomeworkData(dayStr, "comment"), monday.toString(), IndexDataType.HOMEWORK_COMMENT_RATE);
 
-	private void countStudentConvertData(List<IndexBaseDto> result, Date currentMonth){
-		List<IndexBaseMonthData> convertData = new ArrayList<>();
-
-		Map<IndexDataType, IndexBaseDto> typeDataMap = result.stream().collect(Collectors.toMap(IndexBaseDto::getDataType, i -> i, (i1, i2) -> i1));
-		List<IndexBaseMonthData> preStudentNum = new ArrayList<>();
-		if(typeDataMap.containsKey(IndexDataType.STUDENT_CONVERSION_PRE_STUDENT_NUM)){
-			preStudentNum = typeDataMap.get(IndexDataType.STUDENT_CONVERSION_PRE_STUDENT_NUM).getIndexMonthData();
-		}
-
-		IndexBaseMonthData preStudentNumData = new IndexBaseMonthData();
-		preStudentNumData = preStudentNum.stream().max(Comparator.comparing(IndexBaseMonthData::getMonth)).get();
-//		preStudentNumData.setMonth(currentMonth);
-		preStudentNumData.setDataType(IndexDataType.STUDENT_CONVERSION_PRE_STUDENT_NUM);
-		preStudentNumData.setTitle(IndexDataType.STUDENT_CONVERSION_PRE_STUDENT_NUM.getMsg());
-//		preStudentNumData.setTotalNum(preStudentNum.stream().map(IndexBaseMonthData::getTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add));
-//		preStudentNumData.setActivateNum(preStudentNum.stream().map(IndexBaseMonthData::getActivateNum).reduce(BigDecimal.ZERO, BigDecimal::add));
-//		preStudentNumData.setPercent(preStudentNumData.getActivateNum());
-
-		List<IndexBaseMonthData> studentNum = new ArrayList<>();
-		if(typeDataMap.containsKey(IndexDataType.STUDENT_CONVERSION_STUDENT_NUM)){
-			studentNum = typeDataMap.get(IndexDataType.STUDENT_CONVERSION_STUDENT_NUM).getIndexMonthData();
-		}
-
-		IndexBaseMonthData studentNumData = new IndexBaseMonthData();
-		studentNumData = studentNum.stream().max(Comparator.comparing(IndexBaseMonthData::getMonth)).get();
-//		studentNumData.setMonth(currentMonth);
-		studentNumData.setDataType(IndexDataType.STUDENT_CONVERSION_STUDENT_NUM);
-		studentNumData.setTitle(IndexDataType.STUDENT_CONVERSION_STUDENT_NUM.getMsg());
-//		studentNumData.setTotalNum(studentNum.stream().map(IndexBaseMonthData::getTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add));
-//		studentNumData.setActivateNum(studentNum.stream().map(IndexBaseMonthData::getActivateNum).reduce(BigDecimal.ZERO, BigDecimal::add));
-
-		List<IndexBaseMonthData> paymentStudentNum = new ArrayList<>();
-		if(typeDataMap.containsKey(IndexDataType.STUDENT_CONVERSION_PAYMENT_STUDENT_NUM)){
-			paymentStudentNum = typeDataMap.get(IndexDataType.STUDENT_CONVERSION_PAYMENT_STUDENT_NUM).getIndexMonthData();
-		}
-
-		IndexBaseMonthData paymentStudentNumData = new IndexBaseMonthData();
-		paymentStudentNumData = paymentStudentNum.stream().max(Comparator.comparing(IndexBaseMonthData::getMonth)).get();
-//		paymentStudentNumData.setMonth(currentMonth);
-		paymentStudentNumData.setDataType(IndexDataType.STUDENT_CONVERSION_PAYMENT_STUDENT_NUM);
-		paymentStudentNumData.setTitle(IndexDataType.STUDENT_CONVERSION_PAYMENT_STUDENT_NUM.getMsg());
-//		paymentStudentNumData.setTotalNum(paymentStudentNum.stream().map(IndexBaseMonthData::getTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add));
-//		paymentStudentNumData.setActivateNum(paymentStudentNum.stream().map(IndexBaseMonthData::getActivateNum).reduce(BigDecimal.ZERO, BigDecimal::add));
-
-		List<IndexBaseMonthData> convertStudentNum = new ArrayList<>();
-		if(typeDataMap.containsKey(IndexDataType.STUDENT_CONVERSION_VIP_PRACTICE_STUDENT_NUM)){
-			convertStudentNum = typeDataMap.get(IndexDataType.STUDENT_CONVERSION_VIP_PRACTICE_STUDENT_NUM).getIndexMonthData();
-		}
-
-		IndexBaseMonthData convertStudentNumData = new IndexBaseMonthData();
-		convertStudentNumData = convertStudentNum.stream().max(Comparator.comparing(IndexBaseMonthData::getMonth)).get();
-//		convertStudentNumData.setMonth(currentMonth);
-		convertStudentNumData.setDataType(IndexDataType.STUDENT_CONVERSION_VIP_PRACTICE_STUDENT_NUM);
-		convertStudentNumData.setTitle(IndexDataType.STUDENT_CONVERSION_VIP_PRACTICE_STUDENT_NUM.getMsg());
-//		convertStudentNumData.setTotalNum(convertStudentNum.stream().map(IndexBaseMonthData::getTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add));
-//		convertStudentNumData.setActivateNum(convertStudentNum.stream().map(IndexBaseMonthData::getActivateNum).reduce(BigDecimal.ZERO, BigDecimal::add));
-
-		if(true){
-			studentNumData.setPercent(studentNumData.getActivateNum());
-			paymentStudentNumData.setPercent(paymentStudentNumData.getActivateNum());
-			convertStudentNumData.setPercent(convertStudentNumData.getActivateNum());
-		}else if(preStudentNumData.getActivateNum().compareTo(BigDecimal.ZERO)==0){
-			studentNumData.setPercent(BigDecimal.ZERO);
-			paymentStudentNumData.setPercent(BigDecimal.ZERO);
-			convertStudentNumData.setPercent(BigDecimal.ZERO);
-		}else{
-			studentNumData.setPercent(studentNumData.getActivateNum().divide(preStudentNumData.getActivateNum(), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN));
-			if(studentNumData.getActivateNum().compareTo(BigDecimal.ZERO)==0){
-				paymentStudentNumData.setPercent(BigDecimal.ZERO);
-				convertStudentNumData.setPercent(BigDecimal.ZERO);
-			}else{
-				paymentStudentNumData.setPercent(paymentStudentNumData.getActivateNum().divide(studentNumData.getActivateNum(), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN));
-				if(paymentStudentNumData.getActivateNum().compareTo(BigDecimal.ZERO)==0){
-					convertStudentNumData.setPercent(BigDecimal.ZERO);
-				}else{
-					convertStudentNumData.setPercent(convertStudentNumData.getActivateNum().divide(paymentStudentNumData.getActivateNum(), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN));
-				}
-			}
-		}
+		//课程数据
+		saveData(indexBaseMonthDataDao.getGroupCourseDataWithGroup(dayStr, GroupType.MUSIC, null), dayStr, IndexDataType.MUSIC_GROUP_COURSE);
+		saveData(indexBaseMonthDataDao.getGroupCourseDataWithGroup(dayStr, GroupType.VIP, null), dayStr, IndexDataType.VIP_GROUP_COURSE);
+		saveData(indexBaseMonthDataDao.getGroupCourseDataWithGroup(dayStr, GroupType.PRACTICE, null), dayStr, IndexDataType.PRACTICE_GROUP_COURSE);
 
-		convertData.add(preStudentNumData);
-		convertData.add(studentNumData);
-		convertData.add(paymentStudentNumData);
-		convertData.add(convertStudentNumData);
-		IndexBaseDto indexBaseData = new IndexBaseDto(IndexDataType.STUDENT_CONVERSION, IndexDataType.STUDENT_CONVERSION.getMsg());
-		indexBaseData.setIndexMonthData(convertData, currentMonth);
-		if(paymentStudentNumData.getActivateNum().compareTo(BigDecimal.ZERO)==0){
-			indexBaseData.setPercent(convertStudentNumData.getPercent());
-		}else{
-			indexBaseData.setPercent(convertStudentNumData.getActivateNum().divide(paymentStudentNumData.getActivateNum(), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN));
-		}
-		result.add(indexBaseData);
+		//学员变动
+		saveData(indexBaseMonthDataDao.getAddStudentRegistrationData(dayStr), dayStr, IndexDataType.ADD_STUDENT_REGISTRATION_NUM);
+		saveData(indexBaseMonthDataDao.getMusicStudentData(dayStr, null), dayStr, IndexDataType.MUSIC_GROUP_STUDENT);
+		saveData(null, dayStr, IndexDataType.NEWLY_STUDENT_NUM);
+		saveData(null, dayStr, IndexDataType.QUIT_MUSIC_GROUP_STUDENT_NUM);
+		saveData(indexBaseMonthDataDao.getOtherStudentData(dayStr), dayStr, IndexDataType.VIP_PRACTICE_STUDENT_NUM);
+		saveData(indexBaseMonthDataDao.getVipPracticeAddStudentData(dayStr), dayStr, IndexDataType.VIP_PRACTICE_ADD_STUDENT_NUM);
 	}
 
 	/**
@@ -328,14 +243,31 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			dataList = new ArrayList<>();
 		}
 		Set<Integer> hasOrganIds = dataList.stream().map(IndexBaseMonthData::getOrganId).collect(Collectors.toSet());
+
+		boolean specialType = IndexDataType.NEWLY_STUDENT_NUM.equals(indexDataType)||IndexDataType.QUIT_MUSIC_GROUP_STUDENT_NUM.equals(indexDataType);
+		Set<Integer> ignoreOrganIds = new HashSet<>();
+		if(specialType){
+			List<IndexBaseMonthData> indexBaseDatas = indexBaseMonthDataDao.getWithDayAndDataType(dayStr, indexDataType);
+			if(!CollectionUtils.isEmpty(indexBaseDatas)) {
+				ignoreOrganIds = indexBaseDatas.stream().map(IndexBaseMonthData::getOrganId).collect(Collectors.toSet());
+			}
+		}
+
 		for (Integer organId : this.organIds.get()) {
 			if(hasOrganIds.contains(organId)){
 				continue;
 			}
+			if(specialType&&ignoreOrganIds.contains(organId)){
+				continue;
+			}
 			dataList.add(new IndexBaseMonthData(date, organId));
 		}
-		indexBaseMonthDataDao.deleteWithMonthAndType(Arrays.asList(dayStr), indexDataType);
-		indexBaseMonthDataDao.batchInsertWithDataType(dataList, indexDataType);
+		if(!IndexDataType.NEWLY_STUDENT_NUM.equals(indexDataType)&&!IndexDataType.QUIT_MUSIC_GROUP_STUDENT_NUM.equals(indexDataType)){
+			indexBaseMonthDataDao.deleteWithMonthAndType(Arrays.asList(dayStr), indexDataType);
+		}
+		if(!CollectionUtils.isEmpty(dataList)){
+			indexBaseMonthDataDao.batchInsertWithDataType(dataList, indexDataType);
+		}
 	}
 
 	@Override
@@ -391,10 +323,10 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 			three.setDesc(IndexErrorType.TEACHER_INFO.getMsg());
 			List<IndexErrInfoDto> threeChild = new ArrayList<>();
 
-			int attendanceError = indexBaseMonthDataDao.getAttendanceError(organIdsStr,startTime);
+			int attendanceError = indexBaseMonthDataDao.getAttendanceError(organIds,startTime);
 			threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXCEPTION_ATTENDANCE, IndexErrorType.TEACHER_EXCEPTION_ATTENDANCE.getMsg(), attendanceError, null));
 
-			int noAttendance = indexBaseMonthDataDao.getNoAttendance(organIdsStr,startTime);
+			int noAttendance = indexBaseMonthDataDao.getNoAttendance(organIds,startTime);
 			threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_NOT_A_CLASS, IndexErrorType.TEACHER_NOT_A_CLASS.getMsg(), noAttendance, null));
 
 //			int teacherLeave = indexBaseMonthDataDao.queryTeacherLeave(organIdsStr,startTime);
@@ -489,28 +421,16 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 				flag2 = true;
 			}
 		}
-		/*if(!flag2){
-			int attendanceInfo = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.TRUANT.getCode(),startTime);
-			if(attendanceInfo > 0){
-				flag2 = true;
-			}
-		}
-		if(!flag2){
-			int attendanceInfo1 = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.LEAVE.getCode(),startTime);
-			if(attendanceInfo1 > 0){
-				flag2 = true;
-			}
-		}*/
 		resultMap.put("studentInfo",flag2);
 		boolean flag3 = false;
 		if(!flag3){
-			int attendanceError = indexBaseMonthDataDao.getAttendanceError(organIdsStr,startTime);
+			int attendanceError = indexBaseMonthDataDao.getAttendanceError(organIds,startTime);
 			if(attendanceError > 0){
 				flag3 = true;
 			}
 		}
 		if(!flag3){
-			int noAttendance = indexBaseMonthDataDao.getNoAttendance(organIdsStr,startTime);
+			int noAttendance = indexBaseMonthDataDao.getNoAttendance(organIds,startTime);
 			if(noAttendance > 0){
 				flag3 = true;
 			}

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -18,6 +18,7 @@ import java.util.Set;
 import java.util.stream.Collectors;
 
 import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.event.source.GroupEventSource;
 import com.ym.mec.biz.service.*;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -247,6 +248,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     @Autowired
     private StudentPreRegistrationDao studentPreRegistrationDao;
 
+    @Autowired
+    private GroupEventSource groupEventSource;
+
     private SimpleDateFormat sdf_ymd = new SimpleDateFormat("yyyy-MM-dd");
 
     private SimpleDateFormat sdf_hms = new SimpleDateFormat("HH:mm:ss");
@@ -1063,6 +1067,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         roleIds.add(SysUserRole.DEAN_OF_STUDIES);
 
         sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_ACTION_GROUP, "1", musicGroup.getName());
+
+        //统计变更学员数
+        groupEventSource.musicGroupStudentChangeEvent(musicGroupId, StudentMusicGroupStatusEnum.NORMAL, null);
     }
 
     private MusicGroup saveLog(String musicGroupId, MusicGroupStatusEnum statusEnum) throws Exception {
@@ -1413,6 +1420,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         //删除课表
         courseScheduleDao.logicDeleteCourseSchedulesByMusicGroupID(musicGroup.getId());
 
+        //统计变更学员数
+        groupEventSource.musicGroupStudentChangeEvent(musicGroupId, StudentMusicGroupStatusEnum.QUIT, null);
+
         return true;
     }
 
@@ -1450,6 +1460,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         //恢复课表
         courseScheduleDao.resumeCourseScheduleByMusicGroupId(musicGroup.getId());
 
+        //统计变更学员数
+        groupEventSource.musicGroupStudentChangeEvent(musicGroupId, StudentMusicGroupStatusEnum.NORMAL, null);
+
         return true;
     }
 
@@ -1752,6 +1765,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 musicGroupSubjectPlanDao.update(musicGroupSubjectPlan);
             }
 
+            //统计变更学员数
+            groupEventSource.musicGroupStudentChangeEvent(musicGroupId, StudentMusicGroupStatusEnum.QUIT, new ArrayList<>(Arrays.asList(userId)));
+
             if (currentStudentMusicGroupStatus != StudentMusicGroupStatusEnum.NORMAL) {
                 return true;
             }
@@ -1927,6 +1943,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             musicGroupSubjectPlanDao.update(musicGroupSubjectPlan);
         }
 
+        //统计变更学员数
+        groupEventSource.musicGroupStudentChangeEvent(musicGroupId, StudentMusicGroupStatusEnum.QUIT, new ArrayList<>(Arrays.asList(userId)));
+
         if (currentStudentMusicGroupStatus != StudentMusicGroupStatusEnum.NORMAL) {
             return true;
         }
@@ -2784,6 +2803,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
         //删除未上课表
         courseScheduleDao.logicDeleteCourseSchedulesByMusicGroupID(musicGroup.getId());
+
+        //统计变更学员数
+        groupEventSource.musicGroupStudentChangeEvent(closeMusicGroupDto.getMusicGroupId(), StudentMusicGroupStatusEnum.QUIT, null);
+
         return true;
     }
 

+ 16 - 14
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupSubjectPlanServiceImpl.java

@@ -10,6 +10,7 @@ import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.MusicGroupGoodsAndDiscountDto;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -107,24 +108,25 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
         //乐团乐器及辅件信息
         List<MusicGroupSubjectGoodsGroup> goodsGroups = musicGroupSubjectGoodsGroupService.findGoodsGroup(musicGroupId, subjectId);
 
-        List<Goods> accessoriesList = goodsService.findGoodsBySubId(subjectId, GoodsType.ACCESSORIES.getCode());
-
-        goodsGroups.forEach(goodsGroup -> {
-            if (goodsGroup.getType().equals(GoodsType.INSTRUMENT)) {
-                goodsGroup.getGoodsList().forEach(goods -> {
-                    goods.setGoodsList(accessoriesList);
-                });
+        for (MusicGroupSubjectGoodsGroup goodsGroup : goodsGroups) {
+            String childGoodIds = "";
+            for (Goods goods : goodsGroup.getGoodsList()) {
+                if (StringUtils.isNotBlank(goods.getComplementGoodsIdList())) {
+                    childGoodIds += StringUtils.isNotBlank(childGoodIds) ? "," : "" + goods.getComplementGoodsIdList();
+                }
             }
-        });
-        //获取声部(科目)下其他商品
-        List<Goods> otherGoods = goodsService.findTypeGoods("OTHER");
+            if(StringUtils.isNotBlank(childGoodIds)) {
+                goodsGroup.setChildGoodsList(goodsDao.findGoodsByIds(childGoodIds));
+            }
+        }
+
 
+        //获取声部(科目)下其他商品
         MusicGroupSubjectGoodsAndInfoDto musicGroupSubjectGoodsAndInfo = new MusicGroupSubjectGoodsAndInfoDto();
         musicGroupSubjectGoodsAndInfo.setMusicGroupSubjectPlan(musicOneSubjectClassPlan);
         musicGroupSubjectGoodsAndInfo.setCourseScheduleInfo(courseForm);
         musicGroupSubjectGoodsAndInfo.setMusicGroupPaymentCalender(musicGroupRegCalender);
         musicGroupSubjectGoodsAndInfo.setMusicGroupSubjectGoodsGroupList(goodsGroups);
-        musicGroupSubjectGoodsAndInfo.setOtherGoods(otherGoods);
         musicGroupSubjectGoodsAndInfo.setMusicGroup(musicGroup);
         return musicGroupSubjectGoodsAndInfo;
     }
@@ -145,14 +147,14 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
     }
 
     @Override
-    public void addApplyStudentNum(String musicGroupId, Integer subjectId, int num){
+    public void addApplyStudentNum(String musicGroupId, Integer subjectId, int num) {
         boolean flag = false;
         for (int i = 10; i >= 1; i--) {
             MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanDao.getMusicOneSubjectClassPlan(musicGroupId, subjectId);
-            if(musicOneSubjectClassPlan == null){
+            if (musicOneSubjectClassPlan == null) {
                 MusicGroup musicGroup = musicGroupService.get(musicGroupId);
                 Subject subject = subjectService.get(subjectId);
-                throw new BizException("操作失败:{}乐团缺少{}声部",musicGroup.getName(),subject.getName());
+                throw new BizException("操作失败:{}乐团缺少{}声部", musicGroup.getName(), subject.getName());
             }
             int applyNum = musicOneSubjectClassPlan.getApplyStudentNum() == null ? 0 : musicOneSubjectClassPlan.getApplyStudentNum();
             musicOneSubjectClassPlan.setApplyStudentNum(applyNum + num);

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

@@ -2221,7 +2221,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         if (Objects.isNull(practiceGroup)) {
             throw new BizException("指定的网管课不存在");
         }
-        List<CourseSchedule> dataList = courseScheduleDao.findGroupCourseSchedules(practiceGroup.getId(), GroupType.PRACTICE.getCode());
+        List<CourseSchedule> dataList = courseScheduleDao.findGroupCourseSchedules(practiceGroup.getId().toString(), GroupType.PRACTICE.getCode());
         int count = dataList.size();
         if (count > 0) {
             pageInfo.setTotal(count);

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

@@ -144,6 +144,7 @@ public class StudentManageServiceImpl implements StudentManageService {
 //            userContractVersionMap = userAllContract.stream().collect(Collectors.groupingBy(SysUserContracts::getUserId, Collectors.mapping(SysUserContracts::getVersion, Collectors.toSet())));
 //        }
 
+        //List<Subject> studentSubject = studentManageDao.getStudentSubject(userIds);
         StudentListCourseDto studentListCourseDto = null;
         for (StudentManageListDto dto : dataList) {
             studentListCourseDto = StudentListCourseDtoMap.get(dto.getUserId());
@@ -166,6 +167,10 @@ public class StudentManageServiceImpl implements StudentManageService {
 //            if(userContractVersionMap.containsKey(dto.getUserId())){
 //                dto.setContractVersions(StringUtils.join(userContractVersionMap.get(dto.getUserId()), ","));
 //            }
+//            for (Subject subject : studentSubject) {
+//                if(!subject.getId().equals(dto.getUserId())) continue;
+//                dto.setSubjectName(subject.getName());
+//            }
         }
 
         if (queryInfo.getIsExport()) {

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

@@ -231,6 +231,8 @@ public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long,
                     goods.setSellCount(goods.getSellCount() + 1);
                 }
             }
+            if(StringUtils.isBlank(goods.getComplementGoodsIdList())) continue;
+            goods.setGoodsList(goodsService.findGoodsByIds(goods.getComplementGoodsIdList()));
         }
         return goodies;
     }

+ 26 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -11,6 +11,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
 
+import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
@@ -18,10 +20,6 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import com.alibaba.fastjson.JSON;
-import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
-import com.ym.mec.biz.dal.dao.StudentPaymentRouteOrderDao;
-import com.ym.mec.biz.dal.dao.SysConfigDao;
-import com.ym.mec.biz.dal.dao.SysUserCashAccountDao;
 import com.ym.mec.biz.dal.dto.PageInfoOrder;
 import com.ym.mec.biz.dal.dto.SporadicChargeInfoDto;
 import com.ym.mec.biz.dal.dto.StudentPaymentOrderDto;
@@ -95,6 +93,8 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
     private IdGeneratorService idGeneratorService;
     @Autowired
     private SysConfigDao sysConfigDao;
+    @Autowired
+    private GoodsDao goodsDao;
 
     @Override
     public BaseDAO<Long, StudentPaymentOrder> getDAO() {
@@ -516,4 +516,26 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
         }
         return orders;
     }
+
+    @Override
+    public List<StudentPaymentOrderExportDto> getUserApplyOrders(Integer studentId, String musicGroupId) {
+        List<StudentPaymentOrderExportDto> orders = studentPaymentOrderDao.getUserApplyOrders(studentId, musicGroupId);
+        for (StudentPaymentOrderExportDto order : orders) {
+            if(order.getOrderDetailList()==null) continue;
+            for (StudentPaymentOrderDetail studentPaymentOrderDetail : order.getOrderDetailList()) {
+                if(studentPaymentOrderDetail.getGoodsList()==null) continue;
+
+                String childGoodIds = "";
+                for (Goods goods : studentPaymentOrderDetail.getGoodsList()) {
+                    if (StringUtils.isNotBlank(goods.getComplementGoodsIdList())) {
+                        childGoodIds += StringUtils.isNotBlank(childGoodIds) ? "," : "" + goods.getComplementGoodsIdList();
+                    }
+                }
+                if(StringUtils.isNotBlank(childGoodIds)) {
+                    studentPaymentOrderDetail.setChildGoodsList(goodsDao.findGoodsByIds(childGoodIds));
+                }
+            }
+        }
+        return orders;
+    }
 }

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -20,6 +20,8 @@ import java.util.stream.Collectors;
 
 import javax.annotation.Resource;
 
+import com.ym.mec.biz.event.source.GroupEventSource;
+import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -203,6 +205,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     @Autowired
     private CourseScheduleDao courseScheduleDao;
 
+    @Autowired
+    private GroupEventSource groupEventSource;
+
     @Override
     public BaseDAO<Long, StudentRegistration> getDAO() {
         return studentRegistrationDao;
@@ -749,6 +754,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             }
             studentRegistrationDao.updateCurrentClass(studentRegistration);
 
+            //统计变更学员数
+            groupEventSource.musicGroupStudentChangeEvent(musicGroupId, StudentMusicGroupStatusEnum.NORMAL, new ArrayList<>(Arrays.asList(userId)));
+
             return userId;
         }
     }

+ 95 - 96
mec-biz/src/main/resources/config/contracts/product2.ftl

@@ -31,9 +31,8 @@
             font-size: 14px;
         }
         h1 {
-            font-size: 18px;
+            font-size: 16px;
             text-align: center;
-            margin-bottom: 8px;
         }
         h2 {
             font-size: 16px;
@@ -85,129 +84,129 @@
     </style>
 </head>
 <body style="font-family:'SimSun'">
-    <div class="container">
-        <h1>《产品与服务协议》</h1>
-        <!-- 甲方:深圳大雅乐盟网络教育股份有限公司 <br/> -->
-        <#if ownershipType == 'OWN'>
-		甲方:深圳大雅乐盟网络教育股份有限公司
-		<#else>
-		甲方:武汉长乐长风乐器销售有限公司
-		</#if>
-		<br/>
-        <div style="display: flex;">乙方:
-            <div style="flex: 1 auto;">
-                <div class="iInfo">
-                    <span>家长姓名:${studentInfo.realName!}</span>
-                    <span>电话:${studentInfo.phone!}</span>
-                </div>
-                <#if studentInfo.certificateType == 'IDENTITY'>
-                    <div class="iInfo">
-                        <span>身份证号:${studentInfo.idCardNo!}</span>
-                    </div>
-                </#if>
+<div class="container">
+    <h1>《产品与服务协议》</h1>
+    <!-- 甲方:深圳大雅乐盟网络教育股份有限公司 <br/> -->
+    <#if ownershipType == 'OWN'>
+        甲方:深圳大雅乐盟网络教育股份有限公司
+    <#else>
+        甲方:武汉长乐长风乐器销售有限公司
+    </#if>
+    <br/>
+    <div style="display: flex;">乙方:
+        <div style="flex: 1 auto;">
+            <div class="iInfo">
+                <span>家长姓名:${studentInfo.realName!}</span>
+                <span>电话:${studentInfo.phone!}</span>
+            </div>
+            <#if studentInfo.certificateType == 'IDENTITY'>
                 <div class="iInfo">
-                    <span>学生姓名:${studentInfo.username!}</span>
+                    <span>身份证号:${studentInfo.idCardNo!}</span>
                 </div>
-                <#if studentInfo.grade?default("")?trim?length gt 1>
+            </#if>
+            <div class="iInfo">
+                <span>学生姓名:${studentInfo.username!}</span>
+            </div>
+            <#if studentInfo.grade?default("")?trim?length gt 1>
                 <div class="iInfo">
                     <span>所在班级:${studentInfo.grade!} ${studentInfo.clazz!}</span>
                 </div>
-                </#if>
-                <#if studentInfo.subject.name?default("")?trim?length gt 1>
+            </#if>
+            <#if studentInfo.subject.name?default("")?trim?length gt 1>
                 <div class="iInfo">
                     <span>所在声部:${studentInfo.subject.name!}</span>
                 </div>
-                </#if>
-            </div>
+            </#if>
         </div>
-        <div>(本协议中“乙方“指学员及家长;”乙方学员“指购买甲方产品或服务的学员;”乙方家长“仅指乙方学员的法定监护人。)</div>
-
-        <p class="underline bold">重要须知:在注册或购买使用甲方提供的产品、服务之前,请您务必审慎阅读、充分理解本使用协议各条款内容, 特别是免除或者限制甲方责任的条款、对您权利进行限制的条款、约定争议解决方式和司法管辖的条款等。 限制、免责条款或者其他涉及您重大权益的条款可能以加粗、加下划线等形式提示您重点注意。您注册或购买使用甲方提供的产品和服务,均视为您同意本使用协议,以及同意接受本使用协议的约束。</p>
-        <p class="underline bold">如无特别说明 ,下列术语在本协议中的定义为:管乐迷平台(下称“本平台”),即管乐迷APP;AMR器乐练习系统(下称“本系统”)指由甲方提供和维护的器乐教学全流程辅助系统。乙方通过该系统完成器乐学习。本系统提供包括媒体资料,老师互动点评,课前中后管理等服务。具体功能以该系统实际提供为准,且该系统将根据实际需要进行调整和增减,乙方使用平台时还需遵守本服务协议。</p>
+    </div>
+    <div class="underline">(本协议中“乙方“指学员及家长;”乙方学员“指购买甲方产品或服务的学员;”乙方家长“仅指乙方学员的法定监护人。)</div>
 
-        <h2>一、注册及购买</h2>
-        <div>1、无论是否源自甲方建议,乙方选择报名注册加入乐团,或选择购买使用甲方提供的产品和服务,均为乙方自主意愿的表达及独立自主的选择。</div>
-        2、乙方完成所选产品或服务缴费后,甲方向乙方开具加盖公司印章的收款凭据,乙方务必妥善保管。
+    <p class="underline bold">重要须知:在注册或购买使用甲方提供的产品、服务之前,请您务必审慎阅读、充分理解本使用协议各条款内容, 特别是免除或者限制甲方责任的条款、对您权利进行限制的条款、约定争议解决方式和司法管辖的条款等。 限制、免责条款或者其他涉及您重大权益的条款可能以加粗、加下划线等形式提示您重点注意。您注册或购买使用甲方提供的产品和服务,均视为您同意本使用协议,以及同意接受本使用协议的约束。</p>
+    <h2>一、注册及购买</h2>
+    <div >1、无论是否源自甲方建议,乙方选择报名注册加入乐团,或选择购买使用甲方提供的产品和服务,均为乙方自主意愿的表达及独立自主的选择。</div>
+    2、乙方完成所选产品或服务缴费后,甲方向乙方开具加盖公司印章的收款凭据,乙方务必妥善保管。
 
-        <h2>二、乐团及上课规范</h2>
-        1、乙方学员在应服从甲方的管理,遵守甲方的制度。<br />
-        2、乙方学员应按时到达甲方指定上课地点,好课前准备;如发生迟到、早退或因其他乙方原因未能按时上课的,视为乙方学员放弃该次课程,为避免影响老师后续课程的正常进行,授课老师除完成原定时间安排的授课外,将不再提供额外延长课时,也不会因乙方学员缺席而暂停教学课程。<br />
-        3、乙方学员不得携带任何食品进入教室,所有进食应在课前完成;进入教室后,不得大声喧哗、追逐嬉戏,应当听从授课老师的安排;乙方学员应爱护公共财产和教学设施,严禁在桌椅上刻、划、涂、写等不文明行为;乙方学员未经授课老师同意,不得擅自使用教室内的乐器、音响、电视、空调等器材、设施,如造成此类器材、设施损坏的,乙方应照价赔偿。<br />
-        4、未经授课老师同意,乙方家长不得进入课堂,以免影响老师和学员上课;为保证训练质量及进度,乙方学员应保证按照指导老师或教务老师所提出的要求在家练习,遇到专业问题应及时向指导老师请教,非专业问题可随时向教务老师反映。<br />
-        5、乙方家长应教育及监督乙方学员务必注意个人安全,妥善保管个人财物,对于非甲方原因造成的人身安全事故或财物损失,由乙方自行承担。<br />
-        6、对于乐团学员出现以下情形时,甲方有权对乙方学员作出警告,如甲方作出警告后,乙方学员仍然不遵守甲方的管理制度的,甲方有权对其作出退团等处分。<br />
-        &#160;&#160;6.1上课、排练时不服从管理和指导,不遵守纪律,影响其他团员的正常上课、排练;<br />
-        &#160;&#160;6.2一个学期内发生两次及以上旷课行为;<br />
-        &#160;&#160;6.3一个学期内发生两次及以上未按老师要求回传视频作业的情形;<br />
-        &#160;&#160;6.4无特殊原因连续七天不练习,影响团员和乐团的整体水平的。<br />
+    <h2>二、乐团及上课规范</h2>
+    1、乙方学员在应服从甲方的管理,遵守甲方的制度。<br />
+    2、乙方学员应按时到达甲方指定上课地点,好课前准备;如发生迟到、早退或因其他乙方原因未能按时上课的,视为乙方学员放弃该次课程,为避免影响老师后续课程的正常进行,授课老师除完成原定时间安排的授课外,将不再提供额外延长课时,也不会因乙方学员缺席而暂停教学课程。<br />
+    3、乙方学员不得携带任何食品进入教室,所有进食应在课前完成;进入教室后,不得大声喧哗、追逐嬉戏,应当听从授课老师的安排;乙方学员应爱护公共财产和教学设施,严禁在桌椅上刻、划、涂、写等不文明行为;乙方学员未经授课老师同意,不得擅自使用教室内的乐器、音响、电视、空调等器材、设施,如造成此类器材、设施损坏的,乙方应照价赔偿。<br />
+    4、未经授课老师同意,乙方家长不得进入课堂,以免影响老师和学员上课;为保证训练质量及进度,乙方学员应保证按照指导老师或教务老师所提出的要求在家练习,遇到专业问题应及时向指导老师请教,非专业问题可随时向教务老师反映。<br />
+    <span>5、乙方家长应教育及监督乙方学员务必注意个人安全,妥善保管个人财物,对于非甲方原因造成的人身安全事故或财物损失,由乙方自行承担。</span><br />
+    6、对于乐团学员出现以下情形时,甲方有权对乙方学员作出警告,如甲方作出警告后,乙方学员仍然不遵守甲方的管理制度的,甲方有权对其作出退团等处分。<br />
+    &#160;&#160;6.1上课、排练时不服从管理和指导,不遵守纪律,影响其他团员的正常上课、排练;<br />
+    &#160;&#160;6.2一个学期内发生两次及以上旷课行为;<br />
+    &#160;&#160;6.3一个学期内发生两次及以上未按老师要求回传视频作业的情形;<br />
+    &#160;&#160;6.4无特殊原因连续七天不练习,影响团员和乐团的整体水平的。<br />
 
-        <h2>三、请假</h2>
-        1、基于教学进度和质量保证,甲方对于课程延续性有严格要求,因此乙方学员应尽量参加课程,无特殊情况则应避免请假。
-        <div>2、VIP课程学员如有特殊情况需要请假的,应提前4小时以上通过管乐迷APP完成请假,否则当次课程将视同发生,系统将自动记录结算课时并扣除相应课程费用。</div>
-        VIP课程为一对二课程的,其中一位学员申请临时休会的,还需征得同组另一位学员的同意后方可申请休会。否则将不予受理。
-        <div>3、鉴于团体课的特殊性,团体课学员个人请假,当次课程仍视同发生。</div>
+    <h2>三、请假</h2>
+    1、基于教学进度和质量保证,甲方对于课程延续性有严格要求,因此乙方学员应尽量参加课程,无特殊情况则应避免请假。<br />
+    <div>2、VIP课程学员如有特殊情况需要请假的,应提前4小时以上通过管乐迷App完成请假,否则当次课程将视同发生,系统将自动记录结算课时并扣除相应课程费用。</div>
+    3、VIP学员如遇特殊情况需要长期请假时,可向甲方/授课老师申请办理临时休会。学员可在6个月内申请复学,超过6个月未申请复学的,甲方有权按自动退会处理。<span >VIP课程为一对二课程的,其中一位学员申请临时休会的,还需征得同组另一位学员的同意后方可申请休会。否则将不予受理。</span><br />
+    <span>4、鉴于团课的特殊性,团课学员个人请假,当次课程仍视同发生,系统将自动记录结算课时并扣除相应课程费用。</span><br />
+    5、每期课程均有相对应的有效期,乙方应在有效期内完成课程,10次课一期的,自交费之日起4个月内有效;20次课一期的,自交费之日起8个月内有效;40次课一期的,自交费之日起16个月内有效。<span>如果由于指导老师请假等原因造成课程不能如期完成的,课程有效期将顺延;如课程超出有效期限,乙方所缴纳的课程费用将自动扣除逾期未完成的课时后自动清零。</span><br />
 
-        <h2>四、退费</h2>
-        1、乐器、教辅、配件等,未经签收,自购买缴款之日起15日内提出申请可全额退还,超过上述期限则不予受理退费申请;非因商品本身存在质量问题,一经签收,无论使用与否,均不予退费;<br />
-        2、乐保服务,在维修老师下校检查前提出申请可全额退还,下校检查日过后则不予退费;<br />
-        3、AMR器乐练习系统服务,自购买缴款之日起15日内提出申请可全额退还,超过上述期限或实际已提供相应服务则一律不予受理退费;<br />
-        4、正价购买的个别课程,包括但不限于VIP课程项下一对一、网管课等,课程有效期内可申请退费,可退款金额为:购买金额-课时原价*已消耗课时数量;<br />
-        5、活动期间以优惠价格购买的个别课程,自购买缴款之日起15日内提出申请可全额退还,超过上述期限或实际已发生课时消耗的则一律不予受理退费;<br />
+    <h2>四、退费</h2>
+    <span>1、乐器、教辅、配件等,未经签收,自购买缴款之日起15日内提出申请可全额退还,超过上述期限则不予受理退费申请;非因商品本身存在质量问题,一经签收,无论使用与否,均不予退费;</span><br />
+    <span>2、乐保服务,在维修老师下校检查前提出申请可全额退还,下校检查日过后则不予退费;</span><br />
+    <span>3、非个别课程,包括但不限于声部基础课、合奏课、基础技能课、网基课、集训课、VIP课程项下一对二等,自购买缴款之日起15日内提出申请可全额退还,超过上述期限或实际已发生课时消耗的则一律不予受理退费;</span><br />
+    <span>4、正价购买的个别课程,包括但不限于VIP课程项下一对一、网管课等,课程有效期内可申请退费,可退款金额为:购买金额-课时原价*已消耗课时数量;</span><br />
+    <span>5、活动期间以优惠价格购买的个别课程,自购买缴款之日起15日内提出申请可全额退还,超过上述期限或实际已发生课时消耗的则一律不予受理退费;</span><br />
+    <span>从您提出退费申请到您收到退款的时间,会因为您订购时所选择的付款方式而有所不同,通常符合规定的退费会在15个工作日内完成退款操作。</span><br />
 
-        <h2>五、违约责任</h2>
-        1、当事人一方不履行合同义务或者履行合同义务不符合约定的,均构成违约,守约方有权以书面通知的方式要求违约方纠正其违约行为并采取及时、有效的补救措施消除违约后果,并赔偿守约方因违约方之违约行为而遭致的损失。若违约方在收到守约方的上述通知后5日内未纠正其违约行为的,守约方有权在做出书面通知的情况下,单方解除本协议,违约方应赔偿守约方因此遭致的全部损失,包括但不限于守约方因此支付的律师费,差旅费等。<br />
-        2、乙方应始终维护甲方的知识产权以及品牌形象,本协议期间以及本协议因任何原因失效、被撤销、解除或终止后,均不得直接或间接通过任何公众媒体(包括但不限于传统大众媒体,以及微信、微博、博客、直播平台等社交平台)发表损害甲方(包括但不限于其产品、服务及甲方授课老师)声誉的言论或实施任何类似行为,否则乙方应赔偿甲方因此遭受的全部损失,包括但不限于守约方因此支付的律师费,差旅费等。<br />
+    <h2>五、违约责任</h2>
+    1、当事人一方不履行合同义务或者履行合同义务不符合约定的,均构成违约,守约方有权以书面通知的方式要求违约方纠正其违约行为并采取及时、有效的补救措施消除违约后果,并赔偿守约方因违约方之违约行为而遭致的损失。若违约方在收到守约方的上述通知后5日内未纠正其违约行为的,守约方有权在做出书面通知的情况下,单方解除本协议,违约方应赔偿守约方因此遭致的全部损失。<br />
+    2、乙方应始终维护甲方的知识产权以及品牌形象,本协议期间以及本协议因任何原因失效、被撤销、解除或终止后,均不得直接或间接通过任何公众媒体(包括但不限于传统大众媒体,以及微信、微博、博客、直播平台等社交平台)发表损害甲方(包括但不限于其产品、服务及甲方授课老师)声誉的言论或实施任何类似行为,否则乙方应赔偿甲方因此遭受的全部损失。<br />
 
-        <h2>六、保密条款</h2>
-        1、双方对本协议的条款、本协议的签订及履行情况以及通过签订和履行本协议而获知的对方及对方关联公司的任何信息均负有保密义务。任何一方不得以任何形式透露给第三方(有关法律法规要求和甲乙双方的法律、会计顾问、授权雇员除外),也不得擅自使用。<br />
-        2、本保密义务期限不受本协议期限的限制。本协议失效、被撤销、解除或终止等任何情况下,双方均应遵守本保密义务。<br />
+    <h2>六、保密条款</h2>
+    1、双方对本协议的条款、本协议的签订及履行情况以及通过签订和履行本协议而获知的对方及对方关联公司的任何信息均负有保密义务。任何一方不得以任何形式透露给第三方(有关法律法规要求和甲乙双方的法律、会计顾问、授权雇员除外),也不得擅自使用。<br />
+    2、本保密义务期限不受本协议期限的限制。本协议失效、被撤销、解除或终止等任何情况下,双方均应遵守本保密义务。<br />
 
-        <h2>七、不可抗力</h2>
-        1、一方遇到不可抗力事件(指甲乙双方无法控制、无法预见或即使预见也无法避免的事件,该事件妨碍、影响或延误任何一方履行本协议的全部或部分义务,该事件包括但不限于自然灾害(如水灾、地震等)、火灾、政府行为、法律或政策变化(含学校合作变化)、战争或其他任何类似事件)时,受影响方应当立即书面通知对方,并告知该不可抗力事件对本协议可能产生的影响,并在该不可抗力事件发生后5日内向对方提供该事件的详细信息及由有关机构出具的解释受影响方因此无法履行本协议项下全部或部分义务的相关证明。<br />
-        2、由于上述不可抗力事件致使受影响方无法履行或无法按时履行本协议项下全部或部分义务的,双方于彼此间均不承担违约责任,但双方应在相互信任的基础上协商解决,尽力减少不可抗力事件对本协议的影响,并采取合理方式进行调整(包括但不限于另行签订补充协议等),尽量避免损失的扩大。<br />
-        3、不可抗力事件消失或结束后,除双方另行协商一致外,受到不可抗力影响的一方应当立即采取措施继续履行本协议,如不可抗力事件持续30日以上的,则任何一方有权以书面通知对方的方式单方解除本协议。<br />
+    <h2>七、不可抗力</h2>
+    1、一方遇到不可抗力事件(指甲乙双方无法控制、无法预见或即使预见也无法避免的事件,该事件妨碍、影响或延误任何一方履行本协议的全部或部分义务,该事件包括但不限于自然灾害(如水灾、地震等)、火灾、政府行为、法律或政策变化(含学校合作变化)、战争或其他任何类似事件)时,受影响方应当立即书面通知对方,并告知该不可抗力事件对本协议可能产生的影响,并在该不可抗力事件发生后5日内向对方提供该事件的详细信息及由有关机构出具的解释受影响方因此无法履行本协议项下全部或部分义务的相关证明。<br />
+    2、由于上述不可抗力事件致使受影响方无法履行或无法按时履行本协议项下全部或部分义务的,双方于彼此间均不承担违约责任,但双方应在相互信任的基础上协商解决,尽力减少不可抗力事件对本协议的影响,并采取合理方式进行调整(包括但不限于另行签订补充协议等),尽量避免损失的扩大。<br />
+    3、不可抗力事件消失或结束后,除双方另行协商一致外,受到不可抗力影响的一方应当立即采取措施继续履行本协议,如不可抗力事件持续30日以上的,则任何一方有权以书面通知对方的方式单方解除本协议。<br />
 
-        <h2>八、适用法律及争议解决方式</h2>
-        1、本协议的订立、效力、履行、解释及争议解决均适用中华人民共和国法律。<br />
-        2、因履行本协议发生的一切争议,甲乙双方应友好协商解决;如双方在发生争议后30日内无法通过协商解决时,任何一方有权向甲方所在地有管辖权的人民法院提起诉讼解决。<br />
+    <h2>八、适用法律及争议解决方式</h2>
+    1、本协议的订立、效力、履行、解释及争议解决均适用中华人民共和国法律。<br />
+    2、因履行本协议发生的一切争议,甲乙双方应友好协商解决;如双方在发生争议后30日内无法通过协商解决时,任何一方有权向甲方所在地有管辖权的人民法院提起诉讼解决。<br />
 
-        <h2>九、其他</h2>
-        1、乙方同意,甲方有权在乙方学习、上课、排练和活动期间对其拍摄照片、视频,甲方对所拍摄的照片、视频享有著作权,乙方同意甲方可合理使用该等照片、视频。<br />
-        2、未经甲方事先书面同意,乙方不得将本课程转让给乙方以外的任何第三方。<br />
-        3、双方确认并同意,本协议的电子版本与纸质版本具有同等法律效力。双方发生争议时,电子合同打印件可作为证据提交。双方通过网络以在线方式签订本协议的 ,则以乙方点击“确认”或“同意”等相关按钮或以电子签名的方式作为对合同内容的同意、确认以及本协议的签署;如双方签订纸质版本协议的,则本协议壹式贰份,甲方盖公章或合同专用章并且乙方签字作为有效签署方式,并且双方各执壹份,每份具有同等法律效力。<br />
-        4、本协议自双方按照本协议约定方式签署之日起生效,有效期至双方履行完本协议约定的全部义务时止。<br />
-        5、本协议未尽事宜或对本协议的任何修改、补充,有双方另行协商后以签订补充协议的方式解决,补充协议与本协议具有同等法律效力;双方没有约定也没有协商一致的,遵照相关法律法规规定执行。<br />
-        6、双方因履行本协议而相互发出或者提供的所有通知、文件、资料,均以本协议中所列明的电话、APP推送消息送达,乙方如果变更电话号码的,应当自变更后1日内通知甲方且获得甲方确认,甲方通过电话、APP方式无法联系乙方或者甲方认为必要时,甲方也可以通过特快专递至乙方住址的方式向乙方发出上述任何通知、文件、资料等,并在甲方寄出特快专递后第5日视为送达成功。<br />
+    <h2>九、其他</h2>
+    1、乙方同意,甲方有权在乙方学习、上课、排练和活动期间对其拍摄照片、视频,甲方对所拍摄的照片、视频享有著作权,乙方同意甲方可合理使用该等照片、视频。<br />
+    2、未经甲方事先书面同意,乙方不得将本课程转让给乙方以外的任何第三方。<br />
+    3、双方确认并同意,本协议的电子版本与纸质版本具有同等法律效力。双方发生争议时,电子合同打印件可作为证据提交。双方通过网络以在线方式签订本协议的 ,则以乙方点击“确认”或“同意”等相关按钮或以电子签名的方式作为对合同内容的同意、确认以及本协议的签署;如双方签订纸质版本协议的,则本协议壹式贰份,甲方盖公章或合同专用章并且乙方签字作为有效签署方式,并且双方各执壹份,每份具有同等法律效力。<br />
+    4、本协议自双方按照本协议约定方式签署之日起生效,有效期至双方履行完本协议约定的全部义务时止。<br />
+    5、本协议未尽事宜或对本协议的任何修改、补充,有双方另行协商后以签订补充协议的方式解决,补充协议与本协议具有同等法律效力;双方没有约定也没有协商一致的,遵照相关法律法规规定执行。<br />
+    6、双方因履行本协议而相互发出或者提供的所有通知、文件、资料,均以本协议中所列明的电话、App推送消息送达,乙方如果变更电话号码的,应当自变更后1日内通知甲方且获得甲方确认,甲方通过电话、App方式无法联系乙方或者甲方认为必要时,甲方也可以通过特快专递至乙方住址的方式向乙方发出上述任何通知、文件、资料等,并在甲方寄出特快专递后第5日视为送达成功。<br />
 
-        <div class="signature">
-        	<#if isShowVisualSeal>
-        	<#if ownershipType == 'OWN'>
-            <div class="sign">甲方签章:深圳大雅乐盟网络教育股份有限公司<img class="cachet" src="https://daya-online.oss-cn-beijing.aliyuncs.com/website/cachet.png" alt="" />
-                <span>日期:${.now?string("yyyy年MM月dd日")}</span>
-            </div>
+    <div class="signature">
+        <#if isShowVisualSeal>
+            <#if ownershipType == 'OWN'>
+                <div class="sign">甲方签章:深圳大雅乐盟网络教育股份有限公司<img class="cachet" src="https://daya-online.oss-cn-beijing.aliyuncs.com/website/cachet.png" alt="" />
+                    <span>日期:${.now?string("yyyy年MM月dd日")}</span>
+                </div>
             <#else>
-            <div class="sign">甲方签章:武汉长乐长风乐器销售有限公司<img class="cachet" src="https://daya-online.oss-cn-beijing.aliyuncs.com/website/clcf.png" alt="" />
-                <span>日期:${.now?string("yyyy年MM月dd日")}</span>
-            </div>
+                <div class="sign">甲方签章:武汉长乐长风乐器销售有限公司<img class="cachet" src="https://daya-online.oss-cn-beijing.aliyuncs.com/website/clcf.png" alt="" />
+                    <span>日期:${.now?string("yyyy年MM月dd日")}</span>
+                </div>
             </#if>
             <div class="sign">乙方签章:${studentInfo.realName!}
                 <span>日期:${.now?string("yyyy年MM月dd日")} </span>
             </div>
-        	<#else>
-        	<#if ownershipType == 'OWN'>
-            <div class="sign">甲方签章:深圳大雅乐盟网络教育股份有限公司
-                <span>日期:${.now?string("yyyy年MM月dd日")}</span>
-            </div>
+        <#else>
+            <#if ownershipType == 'OWN'>
+                <div class="sign">甲方签章:深圳大雅乐盟网络教育股份有限公司
+                    <span>日期:${.now?string("yyyy年MM月dd日")}</span>
+                </div>
             <#else>
-            <div class="sign">甲方签章:武汉长乐长风乐器销售有限公司
-                <span>日期:${.now?string("yyyy年MM月dd日")}</span>
-            </div>
+                <div class="sign">甲方签章:武汉长乐长风乐器销售有限公司
+                    <span>日期:${.now?string("yyyy年MM月dd日")}</span>
+                </div>
             </#if>
             <div class="sign">乙方签章:
                 <span>日期:${.now?string("yyyy年MM月dd日")} </span>
             </div>
-        	</#if>
-        </div>
+        </#if>
     </div>
+</div>
 </body>
 </html>

+ 82 - 34
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -60,6 +60,7 @@
 
     <resultMap type="com.ym.mec.biz.dal.dto.CourseScheduleDto" id="courseScheduleDto" extends="CourseSchedule">
         <result column="teacher_name_" property="teacherName"/>
+        <result column="avatar_" property="headUrl"/>
         <result column="name_" property="classGroupName"/>
         <result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="school_name_" property="schoolName"/>
@@ -95,6 +96,7 @@
         <result column="end_class_time_" property="endClassTime"/>
         <result column="teacher_id_" property="teacherId"/>
         <result column="teacher_name_" property="teacherName"/>
+        <result column="avatar_" property="headUrl"/>
         <result column="teach_mode_" property="teachMode" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="rest_of_class_" property="restOfClass"/>
@@ -519,6 +521,7 @@
             cs.new_course_id_,
             cg.student_num_ total_student_num_,
             su.real_name_ teacher_name_,
+            su.avatar_,
             IF(ta.sign_in_status_ IS NULL,3,ta.sign_in_status_) sign_in_status_,
             s.name_ school_name_
         FROM
@@ -528,36 +531,50 @@
             LEFT JOIN teacher_attendance ta ON cs.id_=ta.course_schedule_id_ AND ta.teacher_id_=cs.actual_teacher_id_
             LEFT JOIN school s ON cs.schoole_id_=s.id_
         WHERE
-        (cs.del_flag_ != 1 OR cs.del_flag_ IS NULL)
-        <if test="classGroupIds != null and organIdList!=null">
-            AND cs.class_group_id_ IN
-            <foreach collection="classGroupIds" item="classGroupId" open="(" close=")" separator=",">
-                #{classGroupId}
-            </foreach>
-        </if>
-        AND cs.id_ IS NOT NULL
-        <if test="type!=null">
-            AND cg.group_type_ = #{type}
-        </if>
-        <if test="musicGroupId!=null">
-            AND cs.music_group_id_=#{musicGroupId} AND cs.group_type_='MUSIC'
-        </if>
-        AND cs.class_date_ = DATE_FORMAT(#{date},'%Y-%m-%d')
-        ORDER BY CONCAT(cs.class_date_,' ',cs.start_class_time_)
-        <include refid="global.limit"/>
+            (cs.del_flag_ != 1 OR cs.del_flag_ IS NULL)
+            <if test="organIds!=null and organIds.size()>0">
+                AND cs.organ_id_ IN
+                <foreach collection="organIds" item="organId" separator="," open="(" close=")">
+                    #{organId}
+                </foreach>
+            </if>
+            <if test="classGroupIds != null and organIdList!=null">
+                AND cs.class_group_id_ IN
+                <foreach collection="classGroupIds" item="classGroupId" open="(" close=")" separator=",">
+                    #{classGroupId}
+                </foreach>
+            </if>
+            AND cs.id_ IS NOT NULL
+            <if test="type!=null">
+                AND cs.group_type_ = #{type}
+            </if>
+            <if test="musicGroupId!=null">
+                AND cs.music_group_id_=#{musicGroupId} AND cs.group_type_='MUSIC'
+            </if>
+            AND cs.class_date_ = DATE_FORMAT(#{date},'%Y-%m-%d')
+            ORDER BY CONCAT(cs.class_date_,' ',cs.start_class_time_)
+            <include refid="global.limit"/>
     </select>
 
     <select id="countCourseSchedulesWithDate" resultType="int">
         SELECT
         count(*)
         FROM
-        course_schedule cs
-        LEFT JOIN class_group cg ON cs.class_group_id_ = cg.id_
+            course_schedule cs
+            <if test="classGroupIds != null and organIdList!=null">
+                LEFT JOIN class_group cg ON cs.class_group_id_ = cg.id_
+            </if>
         WHERE
         (cs.del_flag_ != 1 OR cs.del_flag_ IS NULL)
         AND cs.id_ IS NOT NULL
+        <if test="organIds!=null and organIds.size()>0">
+            AND cs.organ_id_ IN
+            <foreach collection="organIds" item="organId" separator="," open="(" close=")">
+                #{organId}
+            </foreach>
+        </if>
         <if test="type!=null">
-            AND cg.group_type_ = #{type}
+            AND cs.group_type_ = #{type}
         </if>
         <if test="classGroupIds != null and organIdList!=null">
             AND cs.class_group_id_ IN
@@ -971,6 +988,31 @@
         cs.class_date_
     </select>
 
+    <select id="getCourseScheduleDateWithOrgan" resultType="java.util.Date">
+        SELECT
+            cs.class_date_
+        FROM
+            course_schedule cs
+        WHERE
+            (cs.del_flag_ != 1 OR cs.del_flag_ IS NULL)
+            <if test="organIds!=null and organIds.size()>0">
+                AND cs.organ_id_ IN
+                <foreach collection="organIds" item="organId" separator="," open="(" close=")">
+                    #{organId}
+                </foreach>
+            </if>
+            <if test="month==null">
+                AND DATE_FORMAT( NOW(), '%Y%m' ) = DATE_FORMAT( cs.class_date_, '%Y%m' )
+            </if>
+            <if test="month!=null">
+                AND DATE_FORMAT( #{month}, '%Y%m' ) = DATE_FORMAT( cs.class_date_, '%Y%m' )
+            </if>
+            <if test="type!=null and type!=''">
+                AND cs.group_type_=#{type}
+            </if>
+        GROUP BY cs.class_date_
+    </select>
+
     <select id="findClassSubjects" resultType="string">
         SELECT
         CONCAT(cg.id_,'-',IF(GROUP_CONCAT(s.name_) IS NULL,'',GROUP_CONCAT(s.name_)))
@@ -1009,20 +1051,21 @@
         SELECT
         sa.id_,
         IF(sa.status_ IS NULL,'TRUANT',sa.status_) status_,
-        sa.teacher_id_,
-        su.username_,
-        cs.id_ course_schedule_id_,
+        su.real_name_ username_,
+        su.avatar_,
+        cssp.course_schedule_id_,
         cs.name_,
+        cs.type_,
         cs.class_date_,
         CONCAT(cs.class_date_,' ',cs.start_class_time_) start_class_time_,
         CONCAT(cs.class_date_,' ',cs.end_class_time_) end_class_time_,
-        cs.teacher_id_,
+        cs.actual_teacher_id_ teacher_id_,
         cs.teach_mode_
         FROM course_schedule_student_payment cssp
         LEFT JOIN student_attendance sa ON cssp.course_schedule_id_ = sa.course_schedule_id_ AND cssp.user_id_ =
         sa.user_id_
-        LEFT JOIN course_schedule cs ON sa.course_schedule_id_=cs.id_
-        LEFT JOIN sys_user su ON sa.teacher_id_=su.id_
+        LEFT JOIN course_schedule cs ON cssp.course_schedule_id_ = cs.id_
+        LEFT JOIN sys_user su ON cs.actual_teacher_id_ = su.id_
         <include refid="queryStudentCourseScheduleRecordCondition"/>
         ORDER BY cs.class_date_ DESC,cs.start_class_time_ DESC
         <include refid="global.limit"/>
@@ -1033,23 +1076,25 @@
         FROM course_schedule_student_payment cssp
         LEFT JOIN student_attendance sa ON cssp.course_schedule_id_ = sa.course_schedule_id_ AND cssp.user_id_ =
         sa.user_id_
-        LEFT JOIN course_schedule cs ON sa.course_schedule_id_=cs.id_
-        LEFT JOIN sys_user su ON sa.teacher_id_=su.id_
+        LEFT JOIN course_schedule cs ON cssp.course_schedule_id_ = cs.id_
+        LEFT JOIN sys_user su ON cs.actual_teacher_id_ = su.id_
         <include refid="queryStudentCourseScheduleRecordCondition"/>
     </select>
     <select id="findStudentCourseScheduleNotStartRecords" resultMap="studentCourseScheduleRecord">
-        SELECT cs.teacher_id_,
+        SELECT cs.actual_teacher_id_ teacher_id_,
                su.real_name_                                     teacher_name_,
+               su.avatar_,
                cs.id_                                            course_schedule_id_,
                cs.name_,
                cs.class_date_,
+               cs.type_,
                CONCAT(cs.class_date_, ' ', cs.start_class_time_) start_class_time_,
                CONCAT(cs.class_date_, ' ', cs.end_class_time_)   end_class_time_,
                cs.teach_mode_,
                cs.class_group_id_
         FROM class_group_student_mapper cgsm
                  LEFT JOIN course_schedule cs ON cs.class_group_id_ = cgsm.class_group_id_
-                 LEFT JOIN sys_user su ON cs.teacher_id_ = su.id_
+                 LEFT JOIN sys_user su ON cs.actual_teacher_id_ = su.id_
         WHERE (cs.del_flag_ != 1 OR cs.del_flag_ IS NULL)
             AND (cs.is_lock_=0 OR cs.is_lock_ IS NULL)
             AND cs.status_ = 'NOT_START'
@@ -2499,14 +2544,17 @@
         <if test="organIdList!=null">
             AND FIND_IN_SET(cs.organ_id_,#{organIdList})
         </if>
-        <if test="search!=null">
-            AND (cs.music_group_id_=#{search} OR cs.id_=#{search} OR cs.name_ LIKE CONCAT( '%', #{search}, '%' ))
+        <if test="search != null and search != ''">
+            AND (cs.music_group_id_ = #{search} OR cs.name_ LIKE CONCAT('%' ,#{search}, '%' ))
+        </if>
+        <if test="courseIdSearch != null">
+            AND cs.id_ = #{courseIdSearch}
         </if>
         <if test="searchType == 'ERR_ATTENDANCE'">
             AND ta.teacher_id_ = cs.actual_teacher_id_
             AND cs.status_ = 'OVER'
-            AND ta.sign_in_status_ IS NOT NULL AND ta.sign_out_status_ IS NOT NULL
-            AND (ta.sign_in_status_ = 0 OR ta.sign_out_status_ = 0 OR (sa.id_ IS NULL OR (sa.status_ != 'NORMAL' AND sa.visit_flag_ = 0))) AND ta.dispose_content_ IS NULL
+            AND (((ta.sign_in_status_ = 0 OR ta.sign_out_status_ = 0) AND ta.dispose_content_ IS NULL) OR (sa.id_ IS NULL OR (sa.status_ != 'NORMAL' AND sa.visit_flag_ = 0)))
+            AND (ta.dispose_content_ IS NOT NULL OR (ta.sign_in_status_ IS NOT NULL AND ta.sign_out_status_ IS NOT NULL))
             AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
         </if>
         <if test="searchType == 'NO_ATTENDANCE'">

+ 3 - 1
mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesReplyMapper.xml

@@ -29,6 +29,7 @@
 		<result column="student_name_" property="studentName"/>
 		<result column="teacher_id_" property="teacherId"/>
 		<result column="teacher_name_" property="teacherName"/>
+		<result column="avatar_" property="headUrl"/>
 		<result column="title_" property="title"/>
 		<result column="content_" property="content"/>
 		<result column="expire_date_" property="expireDate"/>
@@ -223,12 +224,13 @@
 			ee.expire_date_,
 			ee.teacher_id_,
 			tea.real_name_ teacher_name_,
+			tea.avatar_,
 			su.username_ student_name_
 		FROM
 			extracurricular_exercises_reply eer
 			LEFT JOIN extracurricular_exercises ee ON ee.id_=eer.extracurricular_exercises_id_
 			LEFT JOIN sys_user su ON su.id_ = eer.user_id_
-			LEFT JOIN sys_user tea ON tea.id_=ee.teacher_id_
+			LEFT JOIN sys_user tea ON tea.id_ = ee.teacher_id_
 			<include refid="queryStudentExtraExercisesCondition"/>
 			ORDER BY eer.create_time_ DESC
 		<include refid="global.limit"/>

+ 196 - 38
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -28,6 +28,10 @@
 		SELECT * FROM index_base_month_data ORDER BY id_
 	</select>
 
+	<select id="getOrganDataWithDayAndDataType" resultMap="IndexBaseMonthData">
+		SELECT * FROM index_base_month_data WHERE organ_id_=#{organId} AND month_ = #{day} AND data_type_=#{dataType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} ORDER BY month_ DESC LIMIT 1;
+	</select>
+
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.IndexBaseMonthData" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		<!--
@@ -59,30 +63,32 @@
 
 	<!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.IndexBaseMonthData">
-		UPDATE index_base_month_data <set>
-		<if test="organId != null">
-			organ_id_ = #{organId},
-		</if>
-		<if test="id != null">
-			id_ = #{id},
-		</if>
-		<if test="activateNum != null">
-			activate_num_ = #{activateNum},
-		</if>
-		<if test="totalNum != null">
-			total_num_ = #{totalNum},
-		</if>
-		<if test="percent != null">
-			percent_ = #{percent},
-		</if>
-		<if test="month != null">
-			month_ = #{month},
-		</if>
-		<if test="dataType != null">
-			data_type_ = #{dataType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-		</if>
-		update_time_ = NOW()
-	</set> WHERE id_ = #{id}
+		UPDATE index_base_month_data
+		<set>
+			<if test="organId != null">
+				organ_id_ = #{organId},
+			</if>
+			<if test="id != null">
+				id_ = #{id},
+			</if>
+			<if test="activateNum != null">
+				activate_num_ = #{activateNum},
+			</if>
+			<if test="totalNum != null">
+				total_num_ = #{totalNum},
+			</if>
+			<if test="percent != null">
+				percent_ = #{percent},
+			</if>
+			<if test="month != null">
+				month_ = #{month},
+			</if>
+			<if test="dataType != null">
+				data_type_ = #{dataType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+			</if>
+			update_time_ = NOW()
+		</set>
+		WHERE id_ = #{id}
 	</update>
 
 	<!-- 根据主键删除一条记录 -->
@@ -138,6 +144,15 @@
 		GROUP BY month_,data_type_
 	</select>
 
+	<select id="getWithDayAndDataType" resultMap="IndexBaseMonthData">
+		SELECT
+			*
+		FROM index_base_month_data
+		WHERE 1=1
+			AND data_type_ = #{dataType}
+			AND month_&gt;=#{day}
+	</select>
+
 	<select id="getStudentSignUpData" resultMap="IndexBaseMonthData">
 		SELECT
 			organ_id_,
@@ -161,8 +176,8 @@
 			 SELECT DISTINCT
 				 cssp.user_id_
 			 FROM
-				 course_schedule_student_payment cssp
-					 LEFT JOIN course_schedule cs ON cssp.course_schedule_id_ = cs.id_
+				course_schedule_student_payment cssp
+				LEFT JOIN course_schedule cs ON cssp.course_schedule_id_ = cs.id_
 			 WHERE
 				 cs.del_flag_ = 0
 			   AND ( cs.is_lock_ = 0 OR cs.is_lock_ IS NULL )
@@ -179,10 +194,67 @@
 		ORDER BY organ_id_;
 	</select>
 
-	<select id="getHomeworkData" resultMap="IndexBaseMonthData">
+	<select id="getStudentRegistrationData" resultMap="IndexBaseMonthData">
+		SELECT
+			su.organ_id_,
+			#{dayStr} month_,
+			COUNT( DISTINCT stu.user_id_ ) total_num_,
+			COUNT( DISTINCT stu.user_id_ ) activate_num_,
+			COUNT( DISTINCT stu.user_id_ ) percent_
+		FROM
+			student stu
+			LEFT JOIN sys_user su ON stu.user_id_=su.id_
+		WHERE
+			su.del_flag_=0
+		  AND su.organ_id_ IS NOT NULL
+		  AND su.user_type_ LIKE '%STUDENT%'
+		  AND DATE_FORMAT(stu.create_time_, '%Y-%m-%d')&lt;=#{dayStr}
+		GROUP BY organ_id_
+		ORDER BY organ_id_;
+	</select>
+
+	<select id="getAddStudentRegistrationData" resultMap="IndexBaseMonthData">
+		SELECT
+			su.organ_id_,
+			#{dayStr} month_,
+			COUNT( DISTINCT stu.user_id_ ) total_num_,
+			COUNT( DISTINCT stu.user_id_ ) activate_num_,
+			COUNT( DISTINCT stu.user_id_ ) percent_
+		FROM
+			student stu
+				LEFT JOIN sys_user su ON stu.user_id_=su.id_
+		WHERE
+			su.del_flag_=0
+		  AND su.organ_id_ IS NOT NULL
+		  AND su.user_type_ LIKE '%STUDENT%'
+		  AND DATE_FORMAT(stu.create_time_, '%Y-%m-%d')=#{dayStr}
+		GROUP BY organ_id_
+		ORDER BY organ_id_;
+	</select>
+
+	<select id="getChargeStudentChangeData" resultMap="IndexBaseMonthData">
 		SELECT
 			su.organ_id_,
 			#{dayStr} month_,
+			COUNT( DISTINCT stu.user_id_ ) total_num_,
+			COUNT( DISTINCT spo.user_id_ ) activate_num_,
+			TRUNCATE(COUNT(DISTINCT spo.user_id_)/COUNT(DISTINCT stu.user_id_)*100, 2) percent_
+		FROM
+			student stu
+			LEFT JOIN sys_user su ON stu.user_id_=su.id_
+			LEFT JOIN student_payment_order spo ON stu.user_id_=spo.user_id_ AND status_='SUCCESS' AND actual_amount_>0
+		WHERE
+			su.del_flag_=0
+		  AND su.organ_id_ IS NOT NULL
+		  AND su.user_type_ LIKE '%STUDENT%'
+		GROUP BY organ_id_
+		ORDER BY organ_id_;
+	</select>
+
+	<select id="getHomeworkData" resultMap="IndexBaseMonthData">
+		SELECT
+			su.organ_id_,
+			sees.monday_ month_,
 			<choose>
 				<when test="type == 'submit'">
 					SUM(sees.actual_exercises_num_) total_num_,
@@ -204,8 +276,8 @@
 		LEFT JOIN sys_user su ON sees.student_id_=su.id_
 		WHERE su.del_flag_=0
 			AND su.organ_id_ IS NOT NULL
-			AND (DATE_FORMAT(sees.monday_, '%Y-%m')=DATE_FORMAT(#{dayStr}, '%Y-%m')
-			        OR DATE_FORMAT(sees.sunday_, '%Y-%m')=DATE_FORMAT(#{dayStr}, '%Y-%m'))
+			AND DATE_FORMAT(sees.monday_, '%Y-%m-%d')&lt;=#{dayStr}
+			AND DATE_FORMAT(sees.sunday_, '%Y-%m-%d')&gt;=#{dayStr}
 		GROUP BY su.organ_id_
 		ORDER BY su.organ_id_
 	</select>
@@ -326,14 +398,15 @@
 		WHERE
 			m.del_flag_ = 0
 			AND (m.is_lock_ = 0 OR m.is_lock_ IS NULL)
-		  	AND m.status_ = 'OVER'
+		  	AND m.status_ = #{courseStatus, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 			AND (m.new_course_id_ IS NULL OR m.new_course_id_=m.id_)
+		  	AND m.group_type_!='DEMO'
 			AND m.organ_id_ IS NOT NULL
 			<if test="groupType!=null">
-				AND m.group_type_ = #{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+				AND m.group_type_ = #{groupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 			</if>
 			<if test="dayStr!=null and dayStr!=''">
-				AND DATE_FORMAT(m.class_date_, '%Y-%m-%d') = #{dayStr}
+				AND m.class_date_ &gt;= #{dayStr}
 			</if>
 		GROUP BY
 			m.organ_id_
@@ -341,6 +414,59 @@
 			m.organ_id_;
 	</select>
 
+	<select id="getGroupSurplusCourseData" resultMap="IndexBaseMonthData">
+		SELECT
+			m.organ_id_,
+			#{dayStr} month_,
+			COUNT( m.id_ ) total_num_,
+			COUNT( m.id_ ) activate_num_,
+			COUNT( m.id_ ) percent_
+		FROM
+			course_schedule m
+		WHERE
+			m.del_flag_ = 0
+			AND (m.is_lock_ = 0 OR m.is_lock_ IS NULL)
+			AND m.status_ = #{courseStatus, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+			AND (m.new_course_id_ IS NULL OR m.new_course_id_=m.id_)
+			AND m.group_type_!='DEMO'
+			AND m.organ_id_ IS NOT NULL
+			<if test="groupType!=null">
+				AND m.group_type_ = #{groupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+			</if>
+			<if test="dayStr!=null and dayStr!=''">
+				AND m.class_date_ &lt;= #{dayStr}
+			</if>
+		GROUP BY m.organ_id_
+		ORDER BY m.organ_id_;
+	</select>
+
+	<select id="getGroupCourseDataWithGroup" resultMap="IndexBaseMonthData">
+		SELECT
+		m.organ_id_,
+		#{dayStr} month_,
+		COUNT( m.id_ ) total_num_,
+		COUNT( m.id_ ) activate_num_,
+		COUNT( m.id_ ) percent_
+		FROM
+		course_schedule m
+		WHERE
+		m.del_flag_ = 0
+		AND (m.is_lock_ = 0 OR m.is_lock_ IS NULL)
+		AND (m.new_course_id_ IS NULL OR m.new_course_id_=m.id_)
+		AND m.group_type_!='DEMO'
+		AND m.organ_id_ IS NOT NULL
+		<if test="groupType!=null">
+			AND m.group_type_ = #{groupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+		</if>
+		<if test="dayStr!=null and dayStr!=''">
+			AND m.class_date_ = #{dayStr}
+		</if>
+		GROUP BY
+		m.organ_id_
+		ORDER BY
+		m.organ_id_;
+	</select>
+
 	<select id="getOtherStudentData" resultMap="IndexBaseMonthData">
 		SELECT
 			su.organ_id_,
@@ -367,6 +493,32 @@
 			su.organ_id_;
 	</select>
 
+	<select id="getVipPracticeAddStudentData" resultMap="IndexBaseMonthData">
+		SELECT
+			su.organ_id_,
+			#{dayStr} month_,
+			COUNT( DISTINCT s.user_id_ ) total_num_,
+			COUNT( DISTINCT s.user_id_ ) activate_num_,
+			COUNT( DISTINCT s.user_id_ ) percent_
+		FROM
+			sys_user su
+			LEFT JOIN course_schedule_student_payment s ON su.id_=s.user_id_
+			LEFT JOIN course_schedule_student_payment cssp1 ON s.user_id_=cssp1.user_id_ AND cssp1.create_time_&lt;#{dayStr}
+			LEFT JOIN course_schedule m ON s.course_schedule_id_=m.id_
+		WHERE
+			m.del_flag_ = 0
+			AND (m.is_lock_ = 0 OR m.is_lock_ IS NULL)
+			AND cssp1.id_ IS NULL
+			AND su.organ_id_ IS NOT NULL
+			AND m.group_type_ IN ('VIP', 'PRACTICE')
+			AND m.status_ = 'NOT_START'
+			<if test="dayStr!=null and dayStr!=''">
+				AND DATE_FORMAT(s.create_time_, '%Y-%m-%d') = #{dayStr}
+			</if>
+		GROUP BY su.organ_id_
+		ORDER BY su.organ_id_;
+	</select>
+
 	<select id="getStudentConversionData" resultMap="IndexBaseMonthData">
 		SELECT
 			cs.organ_id_,
@@ -592,11 +744,14 @@
 		LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cssp.course_schedule_id_ AND cssp.user_id_ = sa.user_id_
 		WHERE ta.teacher_id_ = cs.actual_teacher_id_
 		AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND cs.class_date_ >= '2021-02-01'
-		AND ta.sign_in_status_ IS NOT NULL AND ta.sign_out_status_ IS NOT NULL
-		AND (ta.sign_in_status_ = 0 OR ta.sign_out_status_ = 0 OR (sa.id_ IS NULL OR (sa.status_ != 'NORMAL' AND sa.visit_flag_ = 0))) AND ta.dispose_content_ IS NULL
+		AND (((ta.sign_in_status_ = 0 OR ta.sign_out_status_ = 0) AND ta.dispose_content_ IS NULL) OR (sa.id_ IS NULL OR (sa.status_ != 'NORMAL' AND sa.visit_flag_ = 0)))
+		AND (ta.dispose_content_ IS NOT NULL OR (ta.sign_in_status_ IS NOT NULL AND ta.sign_out_status_ IS NOT NULL))
 		AND (cs.new_course_id_ IS NULL OR cs.new_course_id_=cs.id_)
-		<if test="organIds != null and organIds != ''">
-			AND FIND_IN_SET(cs.organ_id_,#{organIds})
+		<if test="organIds!=null and organIds.size() > 0">
+			AND cs.organ_id_ IN
+			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+				#{organId}
+			</foreach>
 		</if>
 		GROUP BY cs.id_) c
 	</select>
@@ -607,8 +762,11 @@
 		AND cs.status_ = 'OVER' AND cs.del_flag_ = 0 AND cs.class_date_>='2021-02-01'
 		AND ta.sign_in_time_ IS NULL AND ta.sign_out_time_ IS NULL AND ta.dispose_content_ IS NULL
 		AND (cs.new_course_id_ IS NULL OR cs.new_course_id_ = cs.id_)
-		<if test="organIds != null and organIds != ''">
-			AND FIND_IN_SET(cs.organ_id_,#{organIds})
+		<if test="organIds!=null and organIds.size() > 0">
+			AND cs.organ_id_ IN
+			<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+				#{organId}
+			</foreach>
 		</if>
 	</select>
 	<select id="queryTeacherLeave" resultType="int">

+ 2 - 1
mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml

@@ -494,7 +494,8 @@
     <select id="findStudentAttendance" resultMap="StudentAttendance">
         SELECT cssp.id_,cssp.course_schedule_id_,cssp.user_id_,cssp.group_type_,cssp.music_group_id_,sa.sign_in_time_,sa.sign_out_time_,
                CASE WHEN sa.status_ IS NULL THEN 'TRUANT' ELSE sa.status_ END status_,
-        su.username_,su.phone_,su.avatar_,cs.teach_mode_,cs.type_ course_type_,o.name_ organ_name_,tu.real_name_ teacher_name_,cs.name_ course_schedule_name_,cs.status_ course_status_,
+        su.username_,su.phone_,su.avatar_,cs.teach_mode_,cs.type_ course_type_,o.name_ organ_name_,tu.real_name_ teacher_name_,tu.avatar_,
+        cs.name_ course_schedule_name_,cs.status_ course_status_,
         cs.actual_teacher_id_ teacher_id_,cs.class_date_ ,cs.start_class_time_,cs.end_class_time_ ,cs.new_course_id_,
         CASE WHEN sa.visit_flag_ IS NULL THEN 0 ELSE sa.visit_flag_ END visitFlag
         FROM course_schedule_student_payment cssp left join course_schedule cs on cs.id_ = cssp.course_schedule_id_

+ 15 - 2
mec-biz/src/main/resources/config/mybatis/StudentCourseHomeworkMapper.xml

@@ -152,6 +152,8 @@
         <result column="expect_num_" property="expectNum"/>
         <result column="expiry_date_" property="expiryDate"/>
         <result column="remark_" property="remark"/>
+        <result column="real_name_" property="teacherName"/>
+        <result column="avatar_" property="headUrl"/>
         <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="is_replied_" property="isReplied" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
     </resultMap>
@@ -188,10 +190,13 @@
         ch.expiry_date_,
         sch.remark_,
         sch.status_,
-        sch.is_replied_
+        sch.is_replied_,
+        su.real_name_,
+        su.avatar_
         FROM student_course_homework sch
         LEFT JOIN course_homework ch ON sch.course_homework_id_=ch.id_
         LEFT JOIN course_schedule cs ON ch.course_schedule_id_=cs.id_
+        LEFT JOIN sys_user su ON su.id_ = cs.actual_teacher_id_
         LEFT JOIN music_group mg ON ch.music_group_id_=mg.id_
         LEFT JOIN class_group cg ON ch.class_group_id_=cg.id_
         <include refid="queryCondition"/>
@@ -319,6 +324,9 @@
         <result property="startClassTime" column="start_class_time_"/>
         <result property="teacherId" column="actual_teacher_id_"/>
         <result property="status" column="status_"/>
+        <result property="expiryDate" column="expiry_date_"/>
+        <result property="teacherName" column="real_name_"/>
+        <result property="headUrl" column="avatar_"/>
     </resultMap>
     <select id="findStudentHomeworkRecord" resultMap="StudentHomeworkRecordDto">
         SELECT
@@ -327,10 +335,15 @@
         cs.name_ course_name_,
         CONCAT(cs.class_date_,' ',cs.start_class_time_) start_class_time_,
         cs.actual_teacher_id_,
-        sch.status_
+        sch.status_,
+        ch.expiry_date_,
+        su.real_name_,
+        su.avatar_
         FROM
         student_course_homework sch
+        LEFT JOIN course_homework ch ON ch.id_ = sch.course_homework_id_
         LEFT JOIN course_schedule cs ON cs.id_ = sch.course_schedule_id_
+        LEFT JOIN sys_user su ON su.id_ = cs.actual_teacher_id_
         WHERE sch.user_id_=#{userId}
         AND DATE_FORMAT(class_date_, '%Y-%m')=DATE_FORMAT(#{classDate}, '%Y-%m')
         ORDER BY CONCAT(cs.class_date_,' ',cs.start_class_time_) DESC

+ 11 - 3
mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml

@@ -154,8 +154,7 @@
     <select id="findStudentsByOrganId" resultMap="studentManageListDto">
         SELECT o.`name_` organ_name_,s.`user_id_` ,su.`username_` ,su.`phone_` parents_phone_,su.`real_name_` ,su.`gender_` , su.organ_id_,
 		tu.`real_name_` teacher_name_,IF(s.service_tag_=2,0,s.service_tag_) service_tag_ ,s.`operating_tag_` , s.care_package_, s.come_on_package_, suca.`course_balance_` ,
-		sub.`name_` music_group_subject_ ,su.birthdate_,s.subject_id_list_,s.teacher_id_,
-		case when su.password_ is null then false else true end isActive_,s.is_new_user_,case when count(sut.user_id_) > 0 then 1 else 0 end is_signed_contract_
+		sub.`name_` music_group_subject_ ,su.birthdate_,s.subject_id_list_,s.teacher_id_,case when su.password_ is null then false else true end isActive_,s.is_new_user_,case when sut.user_id_ is null then 0 else 1 end is_signed_contract_
 		FROM `student` s LEFT JOIN `sys_user` su on s.`user_id_` = su.`id_`
 		LEFT JOIN `organization` o on o.`id_` = su.`organ_id_`
 		LEFT JOIN `sys_user` tu on tu.`id_` = s.`teacher_id_` 
@@ -163,7 +162,6 @@
 		LEFT JOIN `subject` sub on sub.id_ = s.`subject_id_list_`
 		left join sys_user_tsign sut on sut.user_id_ = s.user_id_
         <include refid="findStudentsByOrganIdSql"/>
-        group by s.user_id_
         ORDER BY su.create_time_ DESC
         <include refid="global.limit"/>
     </select>
@@ -903,4 +901,14 @@
             AND (su.id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
         </if>
     </select>
+
+    <select id="getStudentSubject" resultMap="com.ym.mec.biz.dal.dao.SubjectDao.Subject">
+        SELECT s.user_id_ id_ ,GROUP_CONCAT(sj.name_) name_ FROM student s
+        LEFT JOIN subject sj ON FIND_IN_SET(sj.id_,s.subject_id_list_)
+        WHERE s.user_id_ IN
+        <foreach collection="userIds" item="userId" open="(" close=")" separator=",">
+            #{userId}
+        </foreach>
+        GROUP BY s.user_id_
+    </select>
 </mapper>

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

@@ -373,7 +373,7 @@
         <if test="groupType != null and groupType==@com.ym.mec.biz.dal.enums.GroupType@PRACTICE">
             LEFT JOIN practice_group pg ON cssp.music_group_id_ = pg.id_ AND cssp.group_type_ = 'PRACTICE'
         </if>
-        WHERE FIND_IN_SET(s.teacher_id_, #{teacherIds})
+        WHERE s.teacher_id_ = #{teacherId}
         AND cs.status_ IN ('NOT_START', 'UNDERWAY')
         AND (cs.is_lock_ IS NULL OR cs.is_lock_ = 0)
         <if test="groupType != null">

+ 2 - 1
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml

@@ -854,13 +854,14 @@
             <collection property="goodsList" ofType="com.ym.mec.biz.dal.entity.Goods">
                 <result column="goods_id" property="id"/>
                 <result column="goods_name" property="name"/>
+                <result column="complementGoodsIdList" property="complementGoodsIdList"/>
             </collection>
         </collection>
     </resultMap>
     <select id="getUserApplyOrders" resultMap="applyOrderAndDetail" parameterType="map">
         SELECT spo.*,spod.id_ detail_id_,spod.type_ detail_type_,spod.price_
         detail_price_,spod.kit_group_purchase_type_ detail_kit_group_purchase_type_,
-        g.id_ goods_id, g.name_ goods_name
+        g.id_ goods_id, g.name_ goods_name,g.complement_goods_id_list_ complementGoodsIdList
         FROM student_payment_order spo
         LEFT JOIN student_payment_order_detail spod on spo.id_ = spod.payment_order_id_
         LEFT JOIN goods g on FIND_IN_SET(g.id_,spod.goods_id_list_)

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

@@ -810,6 +810,21 @@
             AND sr.user_id_ = #{userId}
         ORDER BY sr.create_time_ DESC LIMIT 1
     </select>
+    <select id="getStudentNormalRegistration" resultMap="StudentRegistration">
+        SELECT
+               sr.*
+        FROM
+            student_registration sr
+            LEFT JOIN music_group mg ON sr.music_group_id_ = mg.id_
+        WHERE
+            mg.status_ = 'PROGRESS'
+            AND mg.del_flag_ = 0
+            AND sr.music_group_status_ = 'NORMAL'
+            AND sr.user_id_ IN
+            <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
+                #{studentId}
+            </foreach>
+    </select>
     <!-- 批量删除信息 -->
     <delete id="batchDelete">
         DELETE FROM student_registration WHERE id_ IN

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml

@@ -313,7 +313,7 @@
         <where>
             su.del_flag_ = 0
             <if test="organId != null and organId != ''">
-                AND (INTE_ARRAY(#{organId},t.flow_organ_range_) OR FIND_IN_SET(t.organ_id_,#{organId}))
+               AND (CONCAT(',',t.organ_id_,',',t.flow_organ_range_,',') REGEXP CONCAT(',(',replace(#{organId},',','|'),'),'))
             </if>
             <if test="subjectId != null">
                 AND FIND_IN_SET(#{subjectId},t.subject_id_)

+ 7 - 1
mec-common/audit-log/pom.xml

@@ -21,5 +21,11 @@
 			<groupId>com.yonge.mongodb</groupId>
 			<artifactId>mongo-db</artifactId>
 		</dependency>
-	</dependencies>
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-annotations</artifactId>
+            <version>1.5.20</version>
+            <scope>compile</scope>
+        </dependency>
+    </dependencies>
 </project>

+ 53 - 26
mec-common/audit-log/src/main/java/com/yonge/log/interceptor/AuditLogInterceptor.java

@@ -1,16 +1,16 @@
 package com.yonge.log.interceptor;
 
 import java.io.IOException;
+import java.lang.reflect.Array;
 import java.nio.charset.Charset;
 import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import io.swagger.annotations.ApiOperation;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -41,6 +41,10 @@ public class AuditLogInterceptor extends HandlerInterceptorAdapter {
 
 	private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
+	private static List<String> logUrl;
+
+
+
 	@Override
 	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServletException, IOException {
 
@@ -49,34 +53,57 @@ public class AuditLogInterceptor extends HandlerInterceptorAdapter {
 
 	@Override
 	public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
-
+		String servletPath = request.getServletPath();
 		HandlerMethod handlerMethod = (HandlerMethod) handler;
 		AuditLogAnnotation anno = handlerMethod.getMethodAnnotation(AuditLogAnnotation.class);
-
-		if (anno != null) {
-			AuditLog auditLog = new AuditLog();
-			auditLog.setOperateName(anno.operateName());
-			if(StringUtils.isNotBlank(anno.interfaceURL())){
-				auditLog.setInterfaceUrl(anno.interfaceURL());
-			}else{
-				auditLog.setInterfaceUrl(request.getRequestURI());
-			}
-			auditLog.setToken(request.getHeader("Authorization"));
-			auditLog.setService(clientName);
-			auditLog.setUserIp(WebUtil.getRemoteIp(request));
-
-			Map<String, Object> params = WebUtil.getParameterMap(request);
-			if (params == null || params.size() == 0) {
-				auditLog.setInputParams(IOUtils.toString(request.getInputStream(), Charset.defaultCharset()));
-			} else {
-				auditLog.setInputParams(JsonUtil.toJSONString(WebUtil.getParameterMap(request)));
+		ApiOperation apiOperation = handlerMethod.getMethodAnnotation(ApiOperation.class);
+		String operateName = null;
+		if(StringUtils.isEmpty(operateName) && apiOperation != null){
+			operateName = apiOperation.value();
+		}
+		if(StringUtils.isEmpty(operateName) && anno != null){
+			operateName = anno.operateName();
+		}
+		if(anno != null){
+			saveLog(operateName,servletPath,request);
+			return;
+		}
+		if(servletPath.contains("/task/")){
+			return;
+		}
+ 		String substring = servletPath.substring(servletPath.lastIndexOf("/") + 1).toLowerCase();
+		if(logUrl == null){
+			logUrl = new ArrayList<>();
+			logUrl.add("update");
+			logUrl.add("modify");
+			logUrl.add("del");
+		}
+		for (String e : logUrl) {
+			if(substring.contains(e)){
+				saveLog(operateName,servletPath,request);
+				break;
 			}
-			// 操作人
-			auditLog.setUsername(username);
-			auditLog.setOperateTime(sdf.format(new Date()));
-			auditLogService.insert(auditLog);
 		}
+	}
 
+	private void saveLog(String operateName,String servletPath,HttpServletRequest request) throws IOException {
+		AuditLog auditLog = new AuditLog();
+		auditLog.setOperateName(operateName);
+		auditLog.setInterfaceUrl(servletPath);
+		auditLog.setToken(request.getHeader("Authorization"));
+		auditLog.setService(clientName);
+		auditLog.setUserIp(WebUtil.getRemoteIp(request));
+
+		Map<String, Object> params = WebUtil.getParameterMap(request);
+		if (params == null || params.size() == 0) {
+			auditLog.setInputParams(IOUtils.toString(request.getInputStream(), Charset.defaultCharset()));
+		} else {
+			auditLog.setInputParams(JsonUtil.toJSONString(WebUtil.getParameterMap(request)));
+		}
+		// 操作人
+		auditLog.setUsername(username);
+		auditLog.setOperateTime(sdf.format(new Date()));
+		auditLogService.insert(auditLog);
 	}
 
 	public void setUsername(String username) {

+ 0 - 4
mec-common/common-core/src/main/java/com/ym/mec/common/page/PageInfo.java

@@ -132,10 +132,6 @@ public class PageInfo<T> implements Serializable {
 	public void setTotal(int total) {
 		this.total = total;
 		this.totalPage=new BigDecimal(total).divide(new BigDecimal(limit),0,BigDecimal.ROUND_CEILING).intValue();
-		if(this.pageNo>total){
-			this.pageNo = total;
-			this.offset = (this.pageNo - 1) * this.limit;
-		}
 	}
 
 	public List<T> getRows() {

+ 2 - 2
mec-eureka/src/main/resources/bootstrap-test.properties

@@ -1,9 +1,9 @@
 #\u6307\u5b9a\u5f00\u53d1\u73af\u5883
 #spring.profiles.active=dev
 #\u670d\u52a1\u5668\u5730\u5740
-spring.cloud.nacos.config.server-addr=47.96.85.100:8848
+spring.cloud.nacos.config.server-addr=47.114.1.200:8848
 #\u9ed8\u8ba4\u4e3aPublic\u547d\u540d\u7a7a\u95f4,\u53ef\u4ee5\u7701\u7565\u4e0d\u5199
-spring.cloud.nacos.config.namespace=02105743-16b8-46ab-87df-2aca0f3dbca3
+spring.cloud.nacos.config.namespace=f9d46b0a-9847-48ae-8e4b-216c7a3eb466
 #\u6307\u5b9a\u914d\u7f6e\u7fa4\u7ec4 --\u5982\u679c\u662fPublic\u547d\u540d\u7a7a\u95f4 \u5219\u53ef\u4ee5\u7701\u7565\u7fa4\u7ec4\u914d\u7f6e
 spring.cloud.nacos.config.group=DEFAULT_GROUP
 #\u6587\u4ef6\u540d -- \u5982\u679c\u6ca1\u6709\u914d\u7f6e\u5219\u9ed8\u8ba4\u4e3a ${spring.appliction.name}

+ 1 - 1
mec-gateway/mec-gateway-web/src/main/resources/bootstrap-test.properties

@@ -3,7 +3,7 @@
 #\u670d\u52a1\u5668\u5730\u5740
 spring.cloud.nacos.config.server-addr=47.96.85.100:8848
 #\u9ed8\u8ba4\u4e3aPublic\u547d\u540d\u7a7a\u95f4,\u53ef\u4ee5\u7701\u7565\u4e0d\u5199
-spring.cloud.nacos.config.namespace=02105743-16b8-46ab-87df-2aca0f3dbca3
+spring.cloud.nacos.config.namespace=f9d46b0a-9847-48ae-8e4b-216c7a3eb466
 #\u6307\u5b9a\u914d\u7f6e\u7fa4\u7ec4 --\u5982\u679c\u662fPublic\u547d\u540d\u7a7a\u95f4 \u5219\u53ef\u4ee5\u7701\u7565\u7fa4\u7ec4\u914d\u7f6e
 spring.cloud.nacos.config.group=DEFAULT_GROUP
 #\u6587\u4ef6\u540d -- \u5982\u679c\u6ca1\u6709\u914d\u7f6e\u5219\u9ed8\u8ba4\u4e3a ${spring.appliction.name}

+ 0 - 3
mec-im/src/main/java/com/ym/controller/UserController.java

@@ -8,9 +8,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
-/**
- * Created by weiqinxiao on 2019/2/25.
- */
 @RestController
 @RequestMapping("/user")
 public class UserController {

+ 2 - 2
mec-im/src/main/resources/bootstrap-test.properties

@@ -1,9 +1,9 @@
 #\u6307\u5b9a\u5f00\u53d1\u73af\u5883
 #spring.profiles.active=dev
 #\u670d\u52a1\u5668\u5730\u5740
-spring.cloud.nacos.config.server-addr=47.96.85.100:8848
+spring.cloud.nacos.config.server-addr=47.114.1.200:8848
 #\u9ed8\u8ba4\u4e3aPublic\u547d\u540d\u7a7a\u95f4,\u53ef\u4ee5\u7701\u7565\u4e0d\u5199
-spring.cloud.nacos.config.namespace=02105743-16b8-46ab-87df-2aca0f3dbca3
+spring.cloud.nacos.config.namespace=f9d46b0a-9847-48ae-8e4b-216c7a3eb466
 #\u6307\u5b9a\u914d\u7f6e\u7fa4\u7ec4 --\u5982\u679c\u662fPublic\u547d\u540d\u7a7a\u95f4 \u5219\u53ef\u4ee5\u7701\u7565\u7fa4\u7ec4\u914d\u7f6e
 spring.cloud.nacos.config.group=DEFAULT_GROUP
 #\u6587\u4ef6\u540d -- \u5982\u679c\u6ca1\u6709\u914d\u7f6e\u5219\u9ed8\u8ba4\u4e3a ${spring.appliction.name}

+ 0 - 6
mec-student/src/main/java/com/ym/mec/student/controller/StudentAttendanceController.java

@@ -10,9 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.page.StudentAttendanceQueryInfo;
-import com.ym.mec.biz.service.ClassGroupService;
 import com.ym.mec.biz.service.StudentAttendanceService;
 import com.ym.mec.common.controller.BaseController;
 
@@ -24,11 +22,7 @@ public class StudentAttendanceController extends BaseController {
     @Autowired
     private StudentAttendanceService studentAttendanceService;
     @Autowired
-    private ClassGroupService classGroupService;
-    @Autowired
     private SysUserFeignService sysUserFeignService;
-    @Autowired
-    private EmployeeDao employeeDao;
 
 
     @ApiOperation(value = "获取某节课学生签到列表")

+ 0 - 3
mec-student/src/main/java/com/ym/mec/student/controller/StudentCourseHomeworkController.java

@@ -8,7 +8,6 @@ import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.page.CourseHomeworkQueryInfo;
 import com.ym.mec.biz.service.ExtracurricularExercisesReplyService;
 import com.ym.mec.biz.service.StudentCourseHomeworkService;
-import com.ym.mec.biz.service.StudentServeService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
@@ -37,8 +36,6 @@ public class StudentCourseHomeworkController extends BaseController {
     private ExtracurricularExercisesReplyService extracurricularExercisesReplyService;
     @Autowired
     private SysUserFeignService sysUserFeignService;
-    @Autowired
-    private StudentServeService studentServeService;
 
     @ApiOperation(value = "提交作业")
     @PostMapping(value = "/add",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)

+ 1 - 1
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -776,7 +776,7 @@ public class StudentOrderController extends BaseController {
         if (sysUser == null) {
             return failed(HttpStatus.FORBIDDEN, "请登录");
         }
-        return succeed(studentPaymentOrderDao.getUserApplyOrders(sysUser.getId(), musicGroupId));
+        return succeed(studentPaymentOrderService.getUserApplyOrders(sysUser.getId(), musicGroupId));
     }
 
     @GetMapping("/reConfirmOrder")

+ 2 - 2
mec-task/src/main/resources/bootstrap-test.properties

@@ -1,9 +1,9 @@
 #\u6307\u5b9a\u5f00\u53d1\u73af\u5883
 #spring.profiles.active=dev
 #\u670d\u52a1\u5668\u5730\u5740
-spring.cloud.nacos.config.server-addr=47.96.85.100:8848
+spring.cloud.nacos.config.server-addr=47.114.1.200:8848
 #\u9ed8\u8ba4\u4e3aPublic\u547d\u540d\u7a7a\u95f4,\u53ef\u4ee5\u7701\u7565\u4e0d\u5199
-spring.cloud.nacos.config.namespace=02105743-16b8-46ab-87df-2aca0f3dbca3
+spring.cloud.nacos.config.namespace=f9d46b0a-9847-48ae-8e4b-216c7a3eb466
 #\u6307\u5b9a\u914d\u7f6e\u7fa4\u7ec4 --\u5982\u679c\u662fPublic\u547d\u540d\u7a7a\u95f4 \u5219\u53ef\u4ee5\u7701\u7565\u7fa4\u7ec4\u914d\u7f6e
 spring.cloud.nacos.config.group=DEFAULT_GROUP
 #\u6587\u4ef6\u540d -- \u5982\u679c\u6ca1\u6709\u914d\u7f6e\u5219\u9ed8\u8ba4\u4e3a ${spring.appliction.name}

+ 2 - 2
mec-teacher/src/main/resources/bootstrap-test.properties

@@ -1,9 +1,9 @@
 #\u6307\u5b9a\u5f00\u53d1\u73af\u5883
 #spring.profiles.active=dev
 #\u670d\u52a1\u5668\u5730\u5740
-spring.cloud.nacos.config.server-addr=47.96.85.100:8848
+spring.cloud.nacos.config.server-addr=47.114.1.200:8848
 #\u9ed8\u8ba4\u4e3aPublic\u547d\u540d\u7a7a\u95f4,\u53ef\u4ee5\u7701\u7565\u4e0d\u5199
-spring.cloud.nacos.config.namespace=02105743-16b8-46ab-87df-2aca0f3dbca3
+spring.cloud.nacos.config.namespace=f9d46b0a-9847-48ae-8e4b-216c7a3eb466
 #\u6307\u5b9a\u914d\u7f6e\u7fa4\u7ec4 --\u5982\u679c\u662fPublic\u547d\u540d\u7a7a\u95f4 \u5219\u53ef\u4ee5\u7701\u7565\u7fa4\u7ec4\u914d\u7f6e
 spring.cloud.nacos.config.group=DEFAULT_GROUP
 #\u6587\u4ef6\u540d -- \u5982\u679c\u6ca1\u6709\u914d\u7f6e\u5219\u9ed8\u8ba4\u4e3a ${spring.appliction.name}

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

@@ -1835,7 +1835,7 @@ public class ExportController extends BaseController {
 
             HSSFWorkbook workbook = POIUtil.exportExcel(
                     new String[]{"分部", "乐团名称", "学生", "学生编号", "指导老师", "指导老师id", "参与运营指标", "有线上VIP课", "参与免费网管课", "有付费网管课", "有乐团网管课"},
-                    new String[]{"organName", "groupNames", "studentName", "studentId", "teacherName", "teacherId", "operatingTagStr", "vipTimesStr", "freePracticeTimesStr", "buyPracticeTimesStr", "musicNetWorkTimes"}, rows);
+                    new String[]{"organName", "groupNames", "studentName", "studentId", "teacherName", "teacherId", "operatingTagStr", "vipTimesStr", "freePracticeTimesStr", "buyPracticeTimesStr", "musicNetWorkTimesStr"}, rows);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
             ouputStream = response.getOutputStream();

+ 35 - 1
mec-web/src/main/java/com/ym/mec/web/controller/ImGroupController.java

@@ -1,6 +1,10 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.service.ImGroupMemberService;
+import com.yonge.log.model.AuditLogAnnotation;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 
 import java.util.Date;
@@ -38,6 +42,9 @@ public class ImGroupController extends BaseController {
 	private ImUserFriendService imUserFriendService;
 
 	@Autowired
+	private ImGroupMemberService imGroupMemberService;
+
+	@Autowired
 	private ImGroupNoticeService imGroupNoticeService;
 
 	@Autowired
@@ -85,7 +92,6 @@ public class ImGroupController extends BaseController {
 	@ApiOperation("查询群成员详情")
 	@GetMapping(value = "/queryGroupMemberDetail")
 	public Object queryGroupMemberDetail(Long imGroupId, Integer userId) {
-
 		return succeed(imGroupService.queryMember(imGroupId, userId));
 	}
 
@@ -140,4 +146,32 @@ public class ImGroupController extends BaseController {
 	public Object queryNoticeList(ImGroupNoticeQueryInfo queryInfo) {
 		return succeed(imGroupNoticeService.queryPage(queryInfo));
 	}
+
+	@ApiOperation("添加群成员")
+	@PostMapping(value = "/addGroupMember")
+	@ApiImplicitParams({ @ApiImplicitParam(name = "imGroupId", value = "群编号", required = true, dataType = "Integer"),
+			@ApiImplicitParam(name = "roleType", value = "指导老师,乐队指导,乐团主管,运营主管,学员不传", required = true, dataType = "String"),
+			@ApiImplicitParam(name = "isAdmin", value = "是否管理员", required = true, dataType = "Boolean"),
+			@ApiImplicitParam(name = "userId", value = "用户编号", required = true, dataType = "Integer")})
+	public Object addGroupMember(Long imGroupId, Integer userId, String roleType, boolean isAdmin) {
+		return succeed(imGroupMemberService.join(imGroupId,userId,roleType,isAdmin));
+	}
+
+	@ApiOperation("退群")
+	@PostMapping(value = "/quitGroup")
+	@AuditLogAnnotation(operateName = "退群",interfaceURL = "imGroup/quitGroup")
+	@ApiImplicitParams({ @ApiImplicitParam(name = "imGroupId", value = "群编号", required = true, dataType = "Integer"),
+			@ApiImplicitParam(name = "userId", value = "用户编号", required = true, dataType = "Integer")})
+	public Object quitGroup(Long imGroupId, Integer userId) {
+		return succeed(imGroupMemberService.quit(imGroupId,userId));
+	}
+
+	@ApiOperation("修改角色")
+	@PostMapping(value = "/updateRoleType")
+	@ApiImplicitParams({ @ApiImplicitParam(name = "imGroupId", value = "群编号", required = true, dataType = "Integer"),
+			@ApiImplicitParam(name = "roleType", value = "指导老师,乐队指导,乐团主管,运营主管,学员不传", required = true, dataType = "String"),
+			@ApiImplicitParam(name = "userId", value = "用户编号", required = true, dataType = "Integer")})
+	public Object updateRoleType(Long imGroupId, Integer userId, String roleType) {
+		return succeed(imGroupMemberService.updateRoleType(imGroupId,userId,roleType));
+	}
 }

+ 52 - 0
mec-web/src/main/java/com/ym/mec/web/controller/ImUserFriendController.java

@@ -0,0 +1,52 @@
+package com.ym.mec.web.controller;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.service.ImUserFriendService;
+import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RequestMapping("imUserFriend")
+@Api(tags = "IM通讯录")
+@RestController
+public class ImUserFriendController extends BaseController {
+
+	@Autowired
+	private ImUserFriendService imUserFriendService;
+
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
+
+	@ApiOperation("添加好友")
+	@PostMapping(value = "/add")
+	@ApiImplicitParams({ @ApiImplicitParam(name = "memo", value = "备注", required = true, dataType = "String"),
+			@ApiImplicitParam(name = "nickname", value = "昵称", required = true, dataType = "String"),
+			@ApiImplicitParam(name = "friendUserId", value = "好友编号", required = true, dataType = "Integer")})
+	public Object addFriend(Integer friendUserId, String nickname, String memo) {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		return succeed(imUserFriendService.addFriend(sysUser.getId(),friendUserId,nickname,memo));
+	}
+
+	@ApiOperation("删除好友")
+	@PostMapping(value = "/del")
+	@ApiImplicitParams({ @ApiImplicitParam(name = "friendUserId", value = "好友编号", required = true, dataType = "Integer")})
+	public Object quitGroup(Integer friendUserId) {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		return succeed(imUserFriendService.deleteFriend(sysUser.getId(),friendUserId));
+	}
+
+	@ApiOperation("修改昵称,备注")
+	@PostMapping(value = "/updateFriend")
+	@ApiImplicitParams({ @ApiImplicitParam(name = "memo", value = "备注", required = true, dataType = "String"),
+			@ApiImplicitParam(name = "nickname", value = "昵称", required = true, dataType = "String"),
+			@ApiImplicitParam(name = "friendUserId", value = "好友编号", required = true, dataType = "Integer")})
+	public Object updateFriend(Integer friendUserId, String nickname, String memo) {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		return succeed(imUserFriendService.updateFriendNickname(sysUser.getId(),friendUserId,nickname,memo));
+	}
+}