Explorar o código

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java
#	mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
Joburgess %!s(int64=5) %!d(string=hai) anos
pai
achega
d80caa91f0
Modificáronse 80 ficheiros con 1802 adicións e 737 borrados
  1. 26 0
      data_migration/pom.xml
  2. 13 0
      data_migration/src/main/java/com/ym/App.java
  3. 38 0
      data_migration/src/test/java/com/ym/AppTest.java
  4. 7 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java
  5. 241 226
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java
  6. 8 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/DemoGroupDao.java
  7. 15 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java
  8. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SubjectDao.java
  9. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysAccountDao.java
  10. 6 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherAttendanceDao.java
  11. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherSchoolDao.java
  12. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupActivityDao.java
  13. 14 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupDao.java
  14. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentManageCourseListDto.java
  15. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherMusicClassInfoDto.java
  16. 82 16
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherVipClassInfoDto.java
  17. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseSchedule.java
  18. 18 6
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleRewardsRules.java
  19. 11 6
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/DemoGroup.java
  20. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentPaymentOrder.java
  21. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysConfig.java
  22. 33 4
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Teacher.java
  23. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TeacherAttendance.java
  24. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentManageAttendanceQueryInfo.java
  25. 9 9
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/TeacherAttendanceQueryInfo.java
  26. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/TeacherManageDemoGroupQueryInfo.java
  27. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupService.java
  28. 16 3
      mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleService.java
  29. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/DemoGroupService.java
  30. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java
  31. 17 2
      mec-biz/src/main/java/com/ym/mec/biz/service/SysConfigService.java
  32. 16 11
      mec-biz/src/main/java/com/ym/mec/biz/service/TeacherAttendanceService.java
  33. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/TeacherSchoolService.java
  34. 35 17
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java
  35. 73 7
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupTeacherMapperServiceImpl.java
  36. 54 8
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleRewardsRulesServiceImpl.java
  37. 69 14
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  38. 6 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/DemoGroupServiceImpl.java
  39. 4 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  40. 9 7
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PayServiceImpl.java
  41. 4 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  42. 28 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java
  43. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherSchoolServiceImpl.java
  44. 32 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherServiceImpl.java
  45. 20 18
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  46. 15 42
      mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml
  47. 1 1
      mec-biz/src/main/resources/config/mybatis/ClassGroupTeacherMapperMapper.xml
  48. 1 1
      mec-biz/src/main/resources/config/mybatis/CooperationOrganMapper.xml
  49. 269 208
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  50. 2 2
      mec-biz/src/main/resources/config/mybatis/CourseScheduleRewardsMapper.xml
  51. 1 1
      mec-biz/src/main/resources/config/mybatis/CourseScheduleTeacherSalaryMapper.xml
  52. 8 18
      mec-biz/src/main/resources/config/mybatis/DemoGroupMapper.xml
  53. 1 1
      mec-biz/src/main/resources/config/mybatis/MusicGroupStudentFeeMapper.xml
  54. 1 1
      mec-biz/src/main/resources/config/mybatis/OrganizationMapper.xml
  55. 6 4
      mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml
  56. 5 1
      mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml
  57. 5 0
      mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml
  58. 8 0
      mec-biz/src/main/resources/config/mybatis/SysAccountMapper.xml
  59. 18 17
      mec-biz/src/main/resources/config/mybatis/SysConfigMapper.xml
  60. 4 4
      mec-biz/src/main/resources/config/mybatis/TeacherAttendanceMapper.xml
  61. 23 32
      mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml
  62. 3 0
      mec-biz/src/main/resources/config/mybatis/VipGroupActivityMapper.xml
  63. 41 5
      mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml
  64. 13 0
      mec-client-api/src/main/java/com/ym/mec/task/TaskRemoteService.java
  65. 21 0
      mec-client-api/src/main/java/com/ym/mec/task/fallback/TaskRemoteServiceFallback.java
  66. 1 1
      mec-student/src/main/java/com/ym/mec/student/config/ResourceServerConfig.java
  67. 2 2
      mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java
  68. 51 0
      mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java
  69. 24 0
      mec-task/src/main/java/com/ym/mec/task/jobs/UpdateCourseScheduleToOverStatusTask.java
  70. 24 0
      mec-task/src/main/java/com/ym/mec/task/jobs/VipGroupAwardedMonthlyRewardsTask.java
  71. 9 2
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/DemoGroupController.java
  72. 1 1
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherVipSchoolController.java
  73. 126 0
      mec-thirdparty/src/main/java/com/ym/mec/thirdparty/union/NotifyMsg.java
  74. 10 0
      mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java
  75. 54 0
      mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleRewardsRulesController.java
  76. 8 0
      mec-web/src/main/java/com/ym/mec/web/controller/StudentRegistrationController.java
  77. 6 2
      mec-web/src/main/java/com/ym/mec/web/controller/SysConfigController.java
  78. 41 6
      mec-web/src/main/java/com/ym/mec/web/controller/TaskController.java
  79. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/TeacherVipSchoolController.java
  80. 5 4
      pom.xml

+ 26 - 0
data_migration/pom.xml

@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>com.ym</groupId>
+    <artifactId>mec</artifactId>
+    <version>1.0</version>
+  </parent>
+  <groupId>com.ym</groupId>
+  <artifactId>data_migration</artifactId>
+  <version>1.0</version>
+  <name>data_migration</name>
+  <url>http://maven.apache.org</url>
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>

+ 13 - 0
data_migration/src/main/java/com/ym/App.java

@@ -0,0 +1,13 @@
+package com.ym;
+
+/**
+ * Hello world!
+ *
+ */
+public class App 
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+    }
+}

+ 38 - 0
data_migration/src/test/java/com/ym/AppTest.java

@@ -0,0 +1,38 @@
+package com.ym;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest 
+    extends TestCase
+{
+    /**
+     * Create the test case
+     *
+     * @param testName name of the test case
+     */
+    public AppTest( String testName )
+    {
+        super( testName );
+    }
+
+    /**
+     * @return the suite of tests being tested
+     */
+    public static Test suite()
+    {
+        return new TestSuite( AppTest.class );
+    }
+
+    /**
+     * Rigourous Test :-)
+     */
+    public void testApp()
+    {
+        assertTrue( true );
+    }
+}

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

@@ -3,7 +3,6 @@ package com.ym.mec.biz.dal.dao;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.common.dal.BaseDAO;
-
 import com.ym.mec.common.entity.ImGroupModel;
 import com.ym.mec.common.entity.ImUserModel;
 import org.apache.ibatis.annotations.Param;
@@ -245,6 +244,13 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
     List<TeacherClassGroupDto> findTeacherMusicClassGroup(@Param("teacherId") Long teacherId);
 
     /**
+     * 根据老师编号列表获取小课数量
+     * @param teacherIds
+     * @return
+     */
+    List<Map<Integer, Long>> countTeacherVipNum(String teacherIds);
+
+    /**
      * @Author: Joburgess
      * @Date: 2019/10/17
      * @params [teacherId]

+ 241 - 226
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java

@@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Param;
 
 import com.ym.mec.biz.dal.dto.CourseScheduleDto;
 import com.ym.mec.biz.dal.dto.TeacherAttendanceDto;
+import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.StudentCourseScheduleRecordDto;
 import com.ym.mec.biz.dal.enums.CourseStatusEnum;
@@ -15,230 +16,244 @@ import com.ym.mec.common.dal.BaseDAO;
 
 public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
 
-	/**
-	 * 根据教师ID获取当前课程信息
-	 *
-	 * @param teacherID
-	 * @return
-	 */
-	TeacherAttendanceDto getCurrentCourseDetail(@Param("courseID") Long courseID);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/16
-	 * @params [startTime, endTime, teacherId]
-	 * @return com.ym.mec.biz.dal.dto.TeacherAttendanceDto
-	 * @describe 根据时间区间获取教师上课的课程
-	 */
-	TeacherAttendanceDto getTeacherCourseByDateSpeed(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("teacherId") Long teacherId);
-
-	int batchAddCourseSchedules(List<CourseSchedule> courseSchedules);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/17
-	 * 统计学生所属班级数量
-	 */
-	Integer[] countStudentInClass(List<Integer> classGroupIDs);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/17
-	 * 根据日期获取当日排课信息
-	 */
-	List<CourseScheduleDto> getCourseSchedulesWithDate(@Param("classDate") Date classDate);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/14
-	 * @params [classDates, classGroupId]
-	 * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
-	 * @describe 根据班级和上课日期获取课程计划
-	 */
-	List<CourseSchedule> findByClassGroupAndDate(@Param("classDates") List<Date> classDates, @Param("classGroupId") Long classGroupId);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/17
-	 * 根据日期获取学生当日排课信息
-	 */
-	List<CourseScheduleDto> getStudentCourseSchedulesWithDate(@Param("classDate") Date classDate, @Param("studentId") Long studentId);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/11
-	 * @params [courseScheduleId]
-	 * @return java.util.List<java.lang.String>
-	 * @describe 获取课程签到学生姓名
-	 */
-	List<String> findStudentNamesByCourseSchedule(Long courseScheduleId);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/17
-	 * 根据日期获取老师当日排课信息
-	 */
-	List<CourseScheduleDto> getTeacherCourseSchedulesWithDate(@Param("classDate") Date classDate, @Param("teacherId") Long teacherId);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/11
-	 * @params [params]
-	 * @return java.util.List<com.ym.mec.biz.dal.dto.CourseScheduleDto>
-	 * @describe 根据
-	 */
-	List<CourseScheduleDto> getCourseSchedulesWithDate(Map<String, Object> params);
-
-	int countCourseSchedulesWithDate(Map<String, Object> params);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/17
-	 * 根据乐团ID删除排课
-	 */
-	int deleteCourseSchedulesByMusicGroupID(@Param("musicGroupID") Long musicGroupID);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/17
-	 * 根据月份获取乐团在该月有课的日期
-	 */
-	List<Date> getCourseScheduleDateByMonth(@Param("musicGroupID") Long musicGroupID, @Param("month") Date month);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/27
-	 * 获取学生有课日期
-	 */
-	List<Date> getStudentCourseScheduleDate(@Param("studentId") Long studentId, @Param("month") Date month, @Param("isAttend") Integer isAttend);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/27
-	 * 获取教师有课日期
-	 */
-	List<Date> getTeacherCourseScheduleDate(@Param("teacherId") Long teacherId, @Param("month") Date month);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/11
-	 * @params [month, organId]
-	 * @return java.util.List<java.util.Date>
-	 * @describe 获取当月有课的日期
-	 */
-	List<Date> getCourseScheduleDate(@Param("month") Date month, @Param("organId") Long organId);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/23
-	 * 统计教师在一天内有时间重复的课数
-	 */
-	int countTeacherCourseInOnDayRepeats(CourseSchedule courseSchedule);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/24
-	 * 根据日期获取对应老师的课程
-	 */
-	List<CourseSchedule> findTeacherCoursesInDates(@Param("dates") List<Date> dates, @Param("teacherId") Long teacherId);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/24
-	 * 根据日期获取课程
-	 */
-	List<CourseSchedule> findCoursesByDates(@Param("dates") List<Date> dates);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/24
-	 * 获取在指定时间段内存在重复的课程
-	 */
-	List<CourseSchedule> findOverLapCoursesInDay(@Param("dates") List<Date> dates, @Param("startClassTime") Date startClassTime,
-			@Param("endClassTime") Date endClassTime);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/29
-	 * 获取班级的声部
-	 */
-	String[] findClassSubjects(List<Integer> ids);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/24
-	 * 根据id批量获取课程
-	 */
-	List<CourseSchedule> findCourseSchedulesByIds(@Param("ids") Long[] ids);
-
-	/**
-	 * 获取班级的课程计划
-	 * @param classGroupList
-	 * @return
-	 */
-	List<CourseSchedule> findClassGroupCourseSchedules(@Param("classGroupList") List classGroupList);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/30
-	 * 获取学生上课记录
-	 */
-	List<StudentCourseScheduleRecordDto> findStudentCourseScheduleRecords(Map<String, Object> params);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/30
-	 * 统计学生上课记录
-	 */
-	int countStudentCourseScheduleRecords(Map<String, Object> params);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/30
-	 * 获取学生未上课记录
-	 */
-	List<StudentCourseScheduleRecordDto> findStudentCourseScheduleNotStartRecords(@Param("userId") Long userId, @Param("date") Date date);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/8
-	 * @params [classGroupId]
-	 * @return int
-	 * @describe 统计已上课次
-	 */
-	int countClassTimes(Long classGroupId);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/9/17
-	 * 获取课程信息
-	 */
-	CourseScheduleDto getCourseSchedules(@Param("courseScheduleId") Long courseScheduleId);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/14
-	 * @params [vipGroupId]
-	 * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
-	 * @describe 获取vip课排课计划
-	 */
-	List<CourseSchedule> findVipGroupCourseSchedules(@Param("vipGroupId") Long vipGroupId);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/16
-	 * @params [courseScheduleId]
-	 * @return java.lang.String
-	 * @describe 获取课程关联班级类型
-	 */
-	String findClassTypeByCourse(@Param("courseScheduleId") Long courseScheduleId);
-
-	/**
-	 * 根据课程状态查询老师指定月份的VIP课程记录数
-	 * @param monthDate 指定月份
-	 * @param status 课程状态
-	 * @return
-	 */
-	List<Map<Integer, Integer>> queryVipGroupTeachereClassTimesByMonth(@Param("monthDate") Date monthDate,@Param("status") CourseStatusEnum status);
-
+    /**
+     * 根据教师ID获取当前课程信息
+     *
+     * @param teacherID
+     * @return
+     */
+    TeacherAttendanceDto getCurrentCourseDetail(@Param("courseID") Long courseID);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/16
+     * @params [startTime, endTime, teacherId]
+     * @return com.ym.mec.biz.dal.dto.TeacherAttendanceDto
+     * @describe 根据时间区间获取教师上课的课程
+     */
+    TeacherAttendanceDto getTeacherCourseByDateSpeed(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("teacherId") Long teacherId);
+
+    int batchAddCourseSchedules(List<CourseSchedule> courseSchedules);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/17
+     * 统计学生所属班级数量
+     */
+    Integer[] countStudentInClass(List<Integer> classGroupIDs);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/17
+     * 根据日期获取当日排课信息
+     */
+    List<CourseScheduleDto> getCourseSchedulesWithDate(@Param("classDate") Date classDate);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/14
+     * @params [classDates, classGroupId]
+     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
+     * @describe 根据班级和上课日期获取课程计划
+     */
+    List<CourseSchedule> findByClassGroupAndDate(@Param("classDates") List<Date> classDates, @Param("classGroupId") Long classGroupId);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/17
+     * 根据日期获取学生当日排课信息
+     */
+    List<CourseScheduleDto> getStudentCourseSchedulesWithDate(@Param("classDate") Date classDate, @Param("studentId") Long studentId);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/11
+     * @params [courseScheduleId]
+     * @return java.util.List<java.lang.String>
+     * @describe 获取课程签到学生姓名
+     */
+    List<String> findStudentNamesByCourseSchedule(Long courseScheduleId);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/17
+     * 根据日期获取老师当日排课信息
+     */
+    List<CourseScheduleDto> getTeacherCourseSchedulesWithDate(@Param("classDate") Date classDate, @Param("teacherId") Long teacherId);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/11
+     * @params [params]
+     * @return java.util.List<com.ym.mec.biz.dal.dto.CourseScheduleDto>
+     * @describe 根据
+     */
+    List<CourseScheduleDto> getCourseSchedulesWithDate(Map<String, Object> params);
+
+    int countCourseSchedulesWithDate(Map<String, Object> params);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/17
+     * 根据乐团ID删除排课
+     */
+    int deleteCourseSchedulesByMusicGroupID(@Param("musicGroupID") Long musicGroupID);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/17
+     * 根据月份获取乐团在该月有课的日期
+     */
+    List<Date> getCourseScheduleDateByMonth(@Param("musicGroupID") Long musicGroupID, @Param("month") Date month);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/27
+     * 获取学生有课日期
+     */
+    List<Date> getStudentCourseScheduleDate(@Param("studentId") Long studentId, @Param("month") Date month, @Param("isAttend") Integer isAttend);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/27
+     * 获取教师有课日期
+     */
+    List<Date> getTeacherCourseScheduleDate(@Param("teacherId") Long teacherId, @Param("month") Date month);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/11
+     * @params [month, organId]
+     * @return java.util.List<java.util.Date>
+     * @describe 获取当月有课的日期
+     */
+    List<Date> getCourseScheduleDate(@Param("month") Date month, @Param("organId") Long organId);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/23
+     * 统计教师在一天内有时间重复的课数
+     */
+    int countTeacherCourseInOnDayRepeats(CourseSchedule courseSchedule);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/24
+     * 根据日期获取对应老师的课程
+     */
+    List<CourseSchedule> findTeacherCoursesInDates(@Param("dates") List<Date> dates, @Param("teacherId") Long teacherId);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/24
+     * 根据日期获取课程
+     */
+    List<CourseSchedule> findCoursesByDates(@Param("dates") List<Date> dates);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/24
+     * 获取在指定时间段内存在重复的课程
+     */
+    List<CourseSchedule> findOverLapCoursesInDay(@Param("dates") List<Date> dates, @Param("startClassTime") Date startClassTime,
+                                                 @Param("endClassTime") Date endClassTime);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/29
+     * 获取班级的声部
+     */
+    String[] findClassSubjects(List<Integer> ids);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/24
+     * 根据id批量获取课程
+     */
+    List<CourseSchedule> findCourseSchedulesByIds(@Param("ids") Long[] ids);
+
+    /**
+     * 获取班级未开始的课程计划
+     * @param classGroupTeacherMapperList
+     * @return
+     */
+    List<CourseSchedule> findClassGroupNoStartCourseSchedules(@Param("classGroupTeacherMapperList") List<ClassGroupTeacherMapper> classGroupTeacherMapperList);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/30
+     * 获取学生上课记录
+     */
+    List<StudentCourseScheduleRecordDto> findStudentCourseScheduleRecords(Map<String, Object> params);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/30
+     * 统计学生上课记录
+     */
+    int countStudentCourseScheduleRecords(Map<String, Object> params);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/30
+     * 获取学生未上课记录
+     */
+    List<StudentCourseScheduleRecordDto> findStudentCourseScheduleNotStartRecords(@Param("userId") Long userId, @Param("date") Date date);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/8
+     * @params [classGroupId]
+     * @return int
+     * @describe 统计已上课次
+     */
+    int countClassTimes(Long classGroupId);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/17
+     * 获取课程信息
+     */
+    CourseScheduleDto getCourseSchedules(@Param("courseScheduleId") Long courseScheduleId);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/14
+     * @params [vipGroupId]
+     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
+     * @describe 获取vip课排课计划
+     */
+    List<CourseSchedule> findVipGroupCourseSchedules(@Param("vipGroupId") Long vipGroupId);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/16
+     * @params [courseScheduleId]
+     * @return java.lang.String
+     * @describe 获取课程关联班级类型
+     */
+    String findClassTypeByCourse(@Param("courseScheduleId") Long courseScheduleId);
+
+    /**
+     * 根据课程状态查询老师指定月份的VIP课程记录数
+     * @param monthDate 指定月份
+     * @param status 课程状态
+     * @return
+     */
+    List<Map<Integer, Integer>> queryVipGroupTeachereClassTimesByMonth(@Param("monthDate") Date monthDate,@Param("status") CourseStatusEnum status);
+
+    /**
+     * 查询已完成未更新状态的课程列表
+     * @return
+     */
+    List<CourseSchedule> queryFinishedWithNoUpdateStatus();
+    
+    int batchUpdate(List<CourseSchedule> courseScheduleList);
+    
+    /**
+     * 查询提前指定分钟数还未签到的用户
+     * @param minutes 分钟数
+     * @return
+     */
+    List<CourseSchedule> queryNoSignInListByBeforeMinutes(Integer minutes);
 }

+ 8 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/DemoGroupDao.java

@@ -79,7 +79,7 @@ public interface DemoGroupDao extends BaseDAO<Long, DemoGroup> {
      * @Date: 2019/9/26
      * 根据老师编号获取试听课
      */
-    DemoGroup findDemoGroupByTeacherId(Long teacherId);
+    DemoGroup findDemoGroupByTeacherId(Integer teacherId);
 
     /**
      * @Author: Joburgess
@@ -101,5 +101,11 @@ public interface DemoGroupDao extends BaseDAO<Long, DemoGroup> {
      * 根据老师获取本周内的试听课安排
      */
     List<EducationDemoGroupListDto> findDemoGroupStartClassTimesWithWeekByTeacherId(Long teacherId);
-	
+
+    /**
+     * 根据教师编号列表获取试听课数量map
+     * @param teacherIds
+     * @return
+     */
+    List<Map<Integer, Long>> countTeacherDemoGroupNum(String teacherIds);
 }

+ 15 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java

@@ -36,7 +36,7 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
 	 * @param musicGroupId
 	 * @return
 	 */
-	List<Map<Integer,Integer>> countPayNum(@Param("musicGroupId") String musicGroupId);
+	List<Map<Integer, Integer>> countPayNum(@Param("musicGroupId") String musicGroupId);
 
 	/**
 	 * 学生报名缴费金额详情
@@ -62,10 +62,11 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
 	 * @param musicGroupId
 	 * @return
 	 */
-	List<Map<Integer,Long>> getNoClassStuCountBySubjectId(@Param("musicGroupId") String musicGroupId);
+	List<Map<Integer, Long>> getNoClassStuCountBySubjectId(@Param("musicGroupId") String musicGroupId);
 
 	/**
 	 * 根据乐团id和user_id 更新
+	 *
 	 * @param studentRegistration
 	 * @return
 	 */
@@ -73,6 +74,7 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
 
 	/**
 	 * 查询学生信息
+	 *
 	 * @param userId
 	 * @return
 	 */
@@ -80,7 +82,8 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
 
 	/**
 	 * 查询用户指定乐团的报名信息
-	 * @param userId 用户编号
+	 *
+	 * @param userId       用户编号
 	 * @param musicGroupId 乐团编号
 	 * @return
 	 */
@@ -98,8 +101,17 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
 
 	/**
 	 * 查询用户是否存在
+	 *
 	 * @param phone
 	 * @return
 	 */
 	SysUser getSysUserByPhone(String phone);
+
+	/**
+	 * 获取班级学生
+	 * @param musicGroupId
+	 * @param classGroupId
+	 * @return
+	 */
+	List<StudentRegistration> findClassGroupStu(@Param("musicGroupId") String musicGroupId, @Param("classGroupId") Integer classGroupId);
 }

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

@@ -2,6 +2,7 @@ package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.dto.ConditionDto;
 import com.ym.mec.biz.dal.dto.SubjectApplyDetailDto;
+import com.ym.mec.biz.dal.dto.UserGoodsDto;
 import com.ym.mec.biz.dal.entity.Subject;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.common.dal.BaseDAO;

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysAccountDao.java

@@ -5,6 +5,7 @@ import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
 
 import java.math.BigDecimal;
+import java.util.List;
 
 public interface SysAccountDao extends BaseDAO<Integer, SysAccount> {
 
@@ -17,4 +18,6 @@ public interface SysAccountDao extends BaseDAO<Integer, SysAccount> {
      * @return
      */
     SysAccount getPerAccount(@Param("amount") BigDecimal amount);
+
+    int batchInsert(@Param("sysAccountList") List<SysAccount> sysAccountList);
 }

+ 6 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherAttendanceDao.java

@@ -41,4 +41,10 @@ public interface TeacherAttendanceDao extends BaseDAO<Long, TeacherAttendance> {
     TeacherAttendance findByTeacherAttendanceInfo(@Param("teacherId") Long teacherId,
                                                   @Param("courseScheduleId") Long courseScheduleId);
 	
+    /**
+     * 查询超过指定分钟数还未签退的用户
+     * @param minutes 分钟数
+     * @return
+     */
+    List<TeacherAttendance> queryNoSignOutListByOverMinutes(Integer minutes);
 }

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

@@ -14,6 +14,6 @@ public interface TeacherSchoolDao extends BaseDAO<Long, TeacherSchool> {
      * @return java.util.List<com.ym.mec.biz.dal.entity.TeacherSchool>
      * @describe 根据教师编号获取教学点信息
      */
-    List<TeacherSchool> findByTeacherId(Long teacherId);
+    List<TeacherSchool> findByTeacherId(Integer teacherId);
 
 }

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupActivityDao.java

@@ -4,6 +4,7 @@ import com.ym.mec.biz.dal.entity.VipGroupActivity;
 import com.ym.mec.common.dal.BaseDAO;
 
 import java.util.List;
+import java.util.Map;
 
 public interface VipGroupActivityDao extends BaseDAO<Integer, VipGroupActivity> {
 
@@ -14,4 +15,10 @@ public interface VipGroupActivityDao extends BaseDAO<Integer, VipGroupActivity>
      */
     List<VipGroupActivity> findByCategory(Long categoryId);
 
+    /**
+     * 根据活动方案编号列表获取名称
+     * @param activityIds
+     * @return
+     */
+    List<Map<Integer, String>> queryNamesById(String activityIds);
 }

+ 14 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupDao.java

@@ -175,4 +175,18 @@ public interface VipGroupDao extends BaseDAO<Long, VipGroup> {
      * @describe 统计老师开启的vip课数
      */
     int countTeacherVipGroups(Long teacherId);
+
+	/**
+	 * 根据教师编号获取老师vip课数量
+	 * @param teacherId
+	 * @return
+	 */
+	int countTeacherVipClass(Integer teacherId);
+
+	/**
+	 * 根据教师编号获取老师vip课列表
+	 * @param params
+	 * @return
+	 */
+	List<TeacherVipClassInfoDto> getTeacherVipClass(Map<String, Object> params);
 }

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

@@ -35,6 +35,17 @@ public class StudentManageCourseListDto {
     @ApiModelProperty(value = "状态(正常、旷课、请假、休学)",required = false)
     private StudentAttendanceStatusEnum attendanceStatus;
 
+    @ApiModelProperty(value = "当前课时",required = false)
+    private Integer currentCLassTimes;
+
+    public Integer getCurrentCLassTimes() {
+        return currentCLassTimes;
+    }
+
+    public void setCurrentCLassTimes(Integer currentCLassTimes) {
+        this.currentCLassTimes = currentCLassTimes;
+    }
+
     public StudentAttendanceStatusEnum getAttendanceStatus() {
         return attendanceStatus;
     }

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherMusicClassInfoDto.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.dto;
 
+import com.ym.mec.biz.dal.enums.JobTypeEnum;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.util.List;
@@ -29,9 +30,31 @@ public class TeacherMusicClassInfoDto {
     @ApiModelProperty(value = "执教班级名称", required = false)
     private List<String> classGroupNames;
 
+    @ApiModelProperty(value = "教师乐团职务类型", required = false)
+    private JobTypeEnum jobType;
+
     @ApiModelProperty(value = "乐团状态",required = false)
     private MusicGroupStatusEnum status;
 
+    @ApiModelProperty(value = "出勤次数",required = false)
+    private Integer attendanceNum;
+
+    public Integer getAttendanceNum() {
+        return attendanceNum;
+    }
+
+    public void setAttendanceNum(Integer attendanceNum) {
+        this.attendanceNum = attendanceNum;
+    }
+
+    public JobTypeEnum getJobType() {
+        return jobType;
+    }
+
+    public void setJobType(JobTypeEnum jobType) {
+        this.jobType = jobType;
+    }
+
     public String getMusicGroupId() {
         return musicGroupId;
     }

+ 82 - 16
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherVipClassInfoDto.java

@@ -1,19 +1,25 @@
 package com.ym.mec.biz.dal.dto;
 
+import com.ym.mec.biz.dal.enums.AuditStatusEnum;
+import com.ym.mec.biz.dal.enums.CourseStatusEnum;
+import com.ym.mec.biz.dal.enums.TeachModeEnum;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.math.BigDecimal;
 import java.util.Date;
 
-import com.ym.mec.biz.dal.enums.AuditStatusEnum;
-import com.ym.mec.biz.dal.enums.CourseStatusEnum;
-
 /**
  * 老师Vip课程信息
  */
 public class TeacherVipClassInfoDto {
     @ApiModelProperty(value = "Vip课编号", required = false)
-    private Integer vipClassId;
+    private Long vipClassId;
+
+    @ApiModelProperty(value = "班级编号", required = false)
+    private Integer classGroupId;
+
+    @ApiModelProperty(value = "教学模式(线上线下)", required = false)
+    private TeachModeEnum teachMode;
 
     @ApiModelProperty(value = "Vip课名称",required = false)
     private String vipClassName;
@@ -27,12 +33,21 @@ public class TeacherVipClassInfoDto {
     @ApiModelProperty(value = "班级人数",required = false)
     private Integer studentNum;
 
-    @ApiModelProperty(value = "课程单价",required = false)
-    private BigDecimal vipClassFee;
+    @ApiModelProperty(value = "线上课单价",required = false)
+    private BigDecimal onlineClassesUnitPrice;
+
+    @ApiModelProperty(value = "线下课单价",required = false)
+    private BigDecimal offlineClassesUnitPrice;
 
     @ApiModelProperty(value = "开课时间",required = false)
     private Date paymentExpireDate;
 
+    @ApiModelProperty(value = "活动方案",required = false)
+    private String activityName;
+
+    @ApiModelProperty(value = "活动编号",required = false)
+    private Integer activityId;
+
     @ApiModelProperty(value = "截止时间",required = false)
     private Date coursesExpireDate;
 
@@ -45,6 +60,65 @@ public class TeacherVipClassInfoDto {
     @ApiModelProperty(value = "当前课次",required = false)
     private Integer currentClassTimes;
 
+    @ApiModelProperty(value = "月度平均消耗",required = false)
+    private float monthAvg;
+
+    public Integer getActivityId() {
+        return activityId;
+    }
+
+    public void setActivityId(Integer activityId) {
+        this.activityId = activityId;
+    }
+
+    public BigDecimal getOnlineClassesUnitPrice() {
+        return onlineClassesUnitPrice;
+    }
+
+    public void setOnlineClassesUnitPrice(BigDecimal onlineClassesUnitPrice) {
+        this.onlineClassesUnitPrice = onlineClassesUnitPrice;
+    }
+
+    public BigDecimal getOfflineClassesUnitPrice() {
+        return offlineClassesUnitPrice;
+    }
+
+    public void setOfflineClassesUnitPrice(BigDecimal offlineClassesUnitPrice) {
+        this.offlineClassesUnitPrice = offlineClassesUnitPrice;
+    }
+
+    public TeachModeEnum getTeachMode() {
+        return teachMode;
+    }
+
+    public void setTeachMode(TeachModeEnum teachMode) {
+        this.teachMode = teachMode;
+    }
+
+    public Integer getClassGroupId() {
+        return classGroupId;
+    }
+
+    public void setClassGroupId(Integer classGroupId) {
+        this.classGroupId = classGroupId;
+    }
+
+    public String getActivityName() {
+        return activityName;
+    }
+
+    public void setActivityName(String activityName) {
+        this.activityName = activityName;
+    }
+
+    public float getMonthAvg() {
+        return monthAvg;
+    }
+
+    public void setMonthAvg(float monthAvg) {
+        this.monthAvg = monthAvg;
+    }
+
     public Integer getCurrentClassTimes() {
         return currentClassTimes;
     }
@@ -61,11 +135,11 @@ public class TeacherVipClassInfoDto {
         this.totalClassTimes = totalClassTimes;
     }
 
-    public Integer getVipClassId() {
+    public Long getVipClassId() {
         return vipClassId;
     }
 
-    public void setVipClassId(Integer vipClassId) {
+    public void setVipClassId(Long vipClassId) {
         this.vipClassId = vipClassId;
     }
 
@@ -101,14 +175,6 @@ public class TeacherVipClassInfoDto {
         this.studentNum = studentNum;
     }
 
-    public BigDecimal getVipClassFee() {
-        return vipClassFee;
-    }
-
-    public void setVipClassFee(BigDecimal vipClassFee) {
-        this.vipClassFee = vipClassFee;
-    }
-
     public Date getPaymentExpireDate() {
         return paymentExpireDate;
     }

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

@@ -19,7 +19,7 @@ public class CourseSchedule {
 
 	public enum CourseScheduleType implements BaseEnum<String, CourseScheduleType> {
 
-		SINGLE("SINGLE", "单技课"), MIX("MIX", "合奏课"), HIGH("HIGH", "小班课"), VIP("VIP", "vip课"), DEMO("demo", "试听课"), COMPREHENSIVE("comprehensive", "综合课"), PRACTICE(
+		SINGLE("SINGLE", "单技课"), MIX("MIX", "合奏课"), HIGH("HIGH", "小班课"), VIP("VIP", "vip课"), DEMO("DEMO", "试听课"), COMPREHENSIVE("COMPREHENSIVE", "综合课"), PRACTICE(
 				"PRACTICE", "练习课"), ENLIGHTENMENT("ENLIGHTENMENT", "启蒙课"), TRAINING("TRAINING", "集训课");
 
 		private String code;

+ 18 - 6
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleRewardsRules.java

@@ -1,5 +1,7 @@
 package com.ym.mec.biz.dal.entity;
 
+import io.swagger.annotations.ApiModelProperty;
+
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
@@ -11,7 +13,7 @@ import com.ym.mec.common.enums.BaseEnum;
 public class CourseScheduleRewardsRules {
 
 	public enum RewardMode implements BaseEnum<String, RewardMode> {
-		PER, TOTAL;
+		STAIR, PER, TOTAL;
 
 		@Override
 		public String getCode() {
@@ -23,19 +25,19 @@ public class CourseScheduleRewardsRules {
 	/**  */
 	private Integer id;
 
-	/** 名称 */
+	@ApiModelProperty(value = "名称", required = true)
 	private String name;
 
-	/** 课程类型 */
+	@ApiModelProperty(value = "课程类型", required = true)
 	private CourseScheduleType courseScheduleType;
 
-	/** 奖励方式(每节课奖励、一次性奖励) */
+	@ApiModelProperty(value = "奖励方式(PER, TOTAL)", required = true)
 	private RewardMode rewardMode;
 
-	/** 分部列表(用逗号分开) */
+	@ApiModelProperty(value = "分部列表(用逗号分开)", required = true)
 	private String organIdList;
 
-	/** 梯度奖励规则 */
+	@ApiModelProperty(value = "梯度奖励规则", required = true)
 	private String rewardsRulesJson;
 
 	/**  */
@@ -43,6 +45,8 @@ public class CourseScheduleRewardsRules {
 
 	/**  */
 	private java.util.Date updateTime;
+	
+	private String organNameList;
 
 	public void setId(Integer id) {
 		this.id = id;
@@ -108,6 +112,14 @@ public class CourseScheduleRewardsRules {
 		return this.updateTime;
 	}
 
+	public String getOrganNameList() {
+		return organNameList;
+	}
+
+	public void setOrganNameList(String organNameList) {
+		this.organNameList = organNameList;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 11 - 6
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/DemoGroup.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.entity;
 
+import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import java.math.BigDecimal;
@@ -10,15 +11,17 @@ import java.math.BigDecimal;
 public class DemoGroup {
 
 	/**  */
+	@ApiModelProperty(value = "试听课编号",required = false)
 	private Long id;
 	
 	/**  */
+	@ApiModelProperty(value = "试听课名称",required = false)
 	private String name;
 	
-	/** 单节课时 */
+	@ApiModelProperty(value = "单节课时",required = false)
 	private Integer singleClassMinutes;
 	
-	/** 所属分部列表 */
+	@ApiModelProperty(value = "老师和学生共有的分部列表集合",required = false)
 	private String organIdList;
 	
 	/**  */
@@ -27,18 +30,20 @@ public class DemoGroup {
 	/**  */
 	private java.util.Date updateTime;
 	
-	/** 老师编号 */
+	@ApiModelProperty(value = "老师编号",required = false)
 	private Integer userId;
 
+	@ApiModelProperty(value = "试听课单价",required = false)
 	private BigDecimal price;
 
-	private Long subjectId;
+	@ApiModelProperty(value = "科目编号",required = false)
+	private Integer subjectId;
 
-	public Long getSubjectId() {
+	public Integer getSubjectId() {
 		return subjectId;
 	}
 
-	public void setSubjectId(Long subjectId) {
+	public void setSubjectId(Integer subjectId) {
 		this.subjectId = subjectId;
 	}
 

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentPaymentOrder.java

@@ -74,6 +74,8 @@ public class StudentPaymentOrder {
 	/**  */
 	@ApiModelProperty(value = "课程组编号",required = true)
 	private Integer classGroupId;
+
+	private Integer version;
 	
 	public void setId(Long id){
 		this.id = id;
@@ -203,6 +205,14 @@ public class StudentPaymentOrder {
 		this.status = status;
 	}
 
+	public Integer getVersion() {
+		return version;
+	}
+
+	public void setVersion(Integer version) {
+		this.version = version;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

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

@@ -30,6 +30,9 @@ public class SysConfig {
 	/** 修改时间 */
 	private java.util.Date modifyOn;
 	
+	@ApiModelProperty(value = "消息组", required = true)
+	private String group;
+	
 	public void setId(Long id){
 		this.id = id;
 	}
@@ -78,6 +81,14 @@ public class SysConfig {
 		return this.modifyOn;
 	}
 			
+	public String getGroup() {
+		return group;
+	}
+
+	public void setGroup(String group) {
+		this.group = group;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 33 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Teacher.java

@@ -73,16 +73,45 @@ public class Teacher extends SysUser {
 	@ApiModelProperty(value = "流动范围(多个用逗号分开)", required = false)
 	private String flowOrganRange;
 
-	/** 流动范围(多个用|分开) */
-	@ApiModelProperty(value = "流动范围(多个用逗号分开)", required = false)
-	private List<String> flowOrganRangeName;
-
 	@ApiModelProperty(value = "老师介绍", required = false)
 	private String introduction;
+
+	@ApiModelProperty(value = "VIP课数量", required = false)
+	private Integer vipNum;
+
+	@ApiModelProperty(value = "试听课数量", required = false)
+	private Integer demoNum;
 	
 	@ApiModelProperty(value = "离职时间", required = false)
 	private Date demissionDate;
 
+	@ApiModelProperty(value = "老师教学点列表", required = false)
+	private List<TeacherSchool> teacherSchools;
+
+	public List<TeacherSchool> getTeacherSchools() {
+		return teacherSchools;
+	}
+
+	public void setTeacherSchools(List<TeacherSchool> teacherSchools) {
+		this.teacherSchools = teacherSchools;
+	}
+
+	public Integer getDemoNum() {
+		return demoNum;
+	}
+
+	public void setDemoNum(Integer demoNum) {
+		this.demoNum = demoNum;
+	}
+
+	public Integer getVipNum() {
+		return vipNum;
+	}
+
+	public void setVipNum(Integer vipNum) {
+		this.vipNum = vipNum;
+	}
+
 	public List<String> getSubjectName() {
 		return subjectName;
 	}

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

@@ -44,7 +44,7 @@ public class TeacherAttendance {
 	@ApiModelProperty(value = "签退状态:0异常,1正常")
 	private YesOrNoEnum signOutStatus;
 
-	@ApiModelProperty(value = "签退使劲按")
+	@ApiModelProperty(value = "签退时间")
 	private Date signOutTime;
 	
 	/** 备注 */

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentManageAttendanceQueryInfo.java

@@ -13,7 +13,7 @@ import com.ym.mec.common.page.QueryInfo;
 public class StudentManageAttendanceQueryInfo extends QueryInfo {
 
     @ApiModelProperty(value = "学生ID",required = false)
-    private Long studentId;
+    private Integer studentId;
 
     @ApiModelProperty(value = "班级类型(普通班级、合奏班级、提高课班级、VIP班级)",required = true)
     private ClassGroupTypeEnum classGroupType;
@@ -27,11 +27,11 @@ public class StudentManageAttendanceQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "状态(正常、旷课、请假、休学)",required = false)
     private StudentAttendanceStatusEnum attendanceStatus;
 
-    public Long getStudentId() {
+    public Integer getStudentId() {
         return studentId;
     }
 
-    public void setStudentId(Long studentId) {
+    public void setStudentId(Integer studentId) {
         this.studentId = studentId;
     }
 

+ 9 - 9
mec-biz/src/main/java/com/ym/mec/biz/dal/page/TeacherAttendanceQueryInfo.java

@@ -9,13 +9,13 @@ import com.ym.mec.common.page.QueryInfo;
 public class TeacherAttendanceQueryInfo extends QueryInfo {
 
     @ApiModelProperty(value = "教师ID")
-    private Long teacherId;
+    private Integer teacherId;
 
     @ApiModelProperty(value = "乐团ID")
-    private Long musicGroupId;
+    private String musicGroupId;
 
     @ApiModelProperty(value = "班级ID")
-    private Long classGroupId;
+    private Integer classGroupId;
 
     @ApiModelProperty(value = "签到状态")
     private YesOrNoEnum attendanceStatus;
@@ -42,27 +42,27 @@ public class TeacherAttendanceQueryInfo extends QueryInfo {
         this.classGroupName = classGroupName;
     }
 
-    public Long getTeacherId() {
+    public Integer getTeacherId() {
         return teacherId;
     }
 
-    public void setTeacherId(Long teacherId) {
+    public void setTeacherId(Integer teacherId) {
         this.teacherId = teacherId;
     }
 
-    public Long getMusicGroupId() {
+    public String getMusicGroupId() {
         return musicGroupId;
     }
 
-    public void setMusicGroupId(Long musicGroupId) {
+    public void setMusicGroupId(String musicGroupId) {
         this.musicGroupId = musicGroupId;
     }
 
-    public Long getClassGroupId() {
+    public Integer getClassGroupId() {
         return classGroupId;
     }
 
-    public void setClassGroupId(Long classGroupId) {
+    public void setClassGroupId(Integer classGroupId) {
         this.classGroupId = classGroupId;
     }
 

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/page/TeacherManageDemoGroupQueryInfo.java

@@ -10,13 +10,13 @@ import io.swagger.annotations.ApiModelProperty;
 public class TeacherManageDemoGroupQueryInfo extends QueryInfo {
 
     @ApiModelProperty(value = "教师编号")
-    private Long teacherId;
+    private Integer teacherId;
 
-    public Long getTeacherId() {
+    public Integer getTeacherId() {
         return teacherId;
     }
 
-    public void setTeacherId(Long teacherId) {
+    public void setTeacherId(Integer teacherId) {
         this.teacherId = teacherId;
     }
 }

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

@@ -2,6 +2,7 @@ package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.ClassGroup;
+import com.ym.mec.biz.dal.entity.VipGroup;
 import com.ym.mec.biz.dal.enums.SalarySettlementTypeEnum;
 import com.ym.mec.biz.dal.page.StudentPayLogQueryInfo;
 import com.ym.mec.biz.dal.page.VipClassQueryInfo;

+ 16 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleService.java

@@ -3,6 +3,7 @@ package com.ym.mec.biz.service;
 import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
 import com.ym.mec.biz.dal.dto.CourseScheduleDto;
 import com.ym.mec.biz.dal.dto.TeacherAttendanceDto;
+import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
@@ -129,12 +130,12 @@ public interface CourseScheduleService extends BaseService<Long, CourseSchedule>
     void courseSwapWithDay(Date day1,Date day2);
 
     /**
-     * 获取班级的课程计划
+     * 获取班级未开始的课程计划
      *
-     * @param classGroupList
+     * @param classGroupTeacherMapperList
      * @return
      */
-    List<CourseSchedule> findClassGroupCourseSchedules(List classGroupList);
+    List<CourseSchedule> findClassGroupNoStartCourseSchedules(List<ClassGroupTeacherMapper> classGroupTeacherMapperList);
 
 
     /**
@@ -161,4 +162,16 @@ public interface CourseScheduleService extends BaseService<Long, CourseSchedule>
      * @describe 课程投诉审核
      */
     void courseScheduleCommplaintAudit(CourseScheduleComplaints courseScheduleComplaints);
+    
+    /**
+     * 更新课程至结束状态
+     * @return
+     */
+    boolean updateCourseScheduleToOverStatus();
+
+	/**
+	 * 推送未签到消息提醒
+	 * @return
+	 */
+	boolean pushNoSignInMessage();
 }

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

@@ -41,7 +41,7 @@ public interface DemoGroupService extends BaseService<Long, DemoGroup> {
      * @Date: 2019/9/26
      * 根据教师编号获取试听课信息
      */
-    DemoGroup getDemoGroupByTeacherId();
+    DemoGroup getDemoGroupByTeacherId() throws Exception;
 
     /**
      * @Author: Joburgess

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java

@@ -14,6 +14,7 @@ import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
+import org.apache.ibatis.annotations.Param;
 
 public interface StudentRegistrationService extends BaseService<Long, StudentRegistration> {
 
@@ -130,4 +131,13 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
 	 * @return
 	 */
     Integer insertStudent(StudentRegistration studentRegistration) throws Exception;
+
+	/**
+	 * 获取班级学生
+	 * @param musicGroupId
+	 * @param classGroupId
+	 * @return
+	 */
+	List<StudentRegistration> findClassGroupStu(String musicGroupId, Integer classGroupId);
+
 }

+ 17 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/SysConfigService.java

@@ -56,9 +56,24 @@ public interface SysConfigService extends BaseService<Long, SysConfig> {
 	public static final String DEFAULT_PASSWORD = "default_password";
 
 	/**
-	 * 梯度结算规则设置
+	 * 单技课梯度结算规则设置
 	 */
-	public static final String MUSIC_GRADIENT_SETTLEMENT_RULE = "music_gradient_settlement_rule";
+	public static final String SIGLE_GRADIENT_SETTLEMENT_RULE = "sigle_gradient_settlement_rule";
+
+	/**
+	 * 合奏课梯度结算规则设置
+	 */
+	public static final String MAX_GRADIENT_SETTLEMENT_RULE = "max_gradient_settlement_rule";
+
+	/**
+	 * 小班课梯度结算规则设置
+	 */
+	public static final String HIGH_GRADIENT_SETTLEMENT_RULE = "high_gradient_settlement_rule";
+
+	/**
+	 * 如果没有签退,{}分钟后自动发送推送信息
+	 */
+	public static final String SIGN_OUT_MESSAGE_PUSH_MINUTE = "sign_out_message_push_minute";
 
 	/**
 	 * @params paramName

+ 16 - 11
mec-biz/src/main/java/com/ym/mec/biz/service/TeacherAttendanceService.java

@@ -10,17 +10,22 @@ import java.util.Map;
 
 public interface TeacherAttendanceService extends BaseService<Long, TeacherAttendance> {
 
-    /**
-     * @Author: Joburgess
-     * @Date: 2019/9/10
-     * 添加教师签到记录
-     */
-    Map<String, Object> addTeacherAttendanceRecord(TeacherSignOutDto teacherSignOutDto);
+	/**
+	 * @Author: Joburgess
+	 * @Date: 2019/9/10
+	 * 添加教师签到记录
+	 */
+	Map<String, Object> addTeacherAttendanceRecord(TeacherSignOutDto teacherSignOutDto);
 
-    /**
-     * 获取教师个人的签到记录
-     * @return
-     */
-    PageInfo getTeacherPersonalAttendances(TeacherAttendanceQueryInfo queryInfo);
+	/**
+	 * 获取教师个人的签到记录
+	 * @return
+	 */
+	PageInfo getTeacherPersonalAttendances(TeacherAttendanceQueryInfo queryInfo);
 
+	/**
+	 * 推送未签退消息提醒
+	 * @return
+	 */
+	boolean pushNoSignOutMessage();
 }

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

@@ -14,7 +14,7 @@ public interface TeacherSchoolService extends BaseService<Long, TeacherSchool> {
      * @return java.util.List<com.ym.mec.biz.dal.entity.TeacherSchool>
      * @describe 根据教师编号获取教学点
      */
-    List<TeacherSchool> findByTeacherId(Long teacherId);
+    List<TeacherSchool> findByTeacherId(Integer teacherId);
 
 
 

+ 35 - 17
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -17,6 +17,7 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
+import com.ym.mec.util.date.DateUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -37,17 +38,20 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     @Autowired
     private ClassGroupDao classGroupDao;
     @Autowired
-    private TeacherDao teacherDao;
+    private VipGroupDao vipGroupDao;
+    @Autowired
+    private VipGroupActivityDao vipGroupActivityDao;
+    @Autowired
+    private TeacherAttendanceDao teacherAttendanceDao;
     @Autowired
     private MusicGroupDao musicGroupDao;
     @Autowired
     private ClassGroupRelationService classGroupRelationService;
+    @Autowired
     private ClassGroupStudentMapperDao classGroupStudentMapperDao;
     @Autowired
     private ClassGroupRelationDao classGroupRelationDao;
     @Autowired
-    private ClassGroupStudentMapperService classGroupStudentMapperService;
-    @Autowired
     private ClassGroupTeacherMapperService classGroupTeacherMapperService;
     @Autowired
     private TeacherDefaultMusicGroupSalaryService teacherDefaultMusicGroupSalaryService;
@@ -56,10 +60,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     @Autowired
     private StudentRegistrationDao studentRegistrationDao;
     @Autowired
-    private StudentRegistrationService studentRegistrationService;
-    @Autowired
-    private ClassGroupTeacherSalaryService classGroupTeacherSalaryService;
-    @Autowired
     private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
     @Autowired
     private SysUserFeignService sysUserFeignService;
@@ -240,15 +240,18 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
     @Override
     public List<TeacherMusicClassInfoDto> getTeacherMusicClass(Integer teacherId) {
-        List<TeacherMusicClassInfoDto> teacherMusicClassInfoDtos = classGroupDao.queryGroupCourses(teacherId);
-        Teacher teacher = teacherDao.get(teacherId);
-        if (teacher == null) {
-            return null;
+        List<TeacherMusicClassInfoDto> teacherMusics = classGroupDao.queryGroupCourses(teacherId);
+        //获取老师在当前乐团出勤次数
+        if(teacherMusics != null && teacherMusics.size() > 0){
+            HashMap<String,Object> param = new HashMap<>();
+            param.put("teacherId",teacherId);
+            param.put("attendanceStatus",YesOrNoEnum.YES);
+            teacherMusics.forEach(e->{
+                param.put("musicGroupId",e.getMusicGroupId());
+                e.setAttendanceNum(teacherAttendanceDao.getTeacherPersonalAttendancesCount(param));
+            });
         }
-        teacherMusicClassInfoDtos.forEach(e -> {
-            e.setJobNature(teacher.getJobNature());
-        });
-        return teacherMusicClassInfoDtos;
+        return teacherMusics;
     }
 
     @Override
@@ -257,11 +260,26 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         Map<String, Object> params = new HashMap<>();
         MapUtil.populateMap(params, queryInfo);
         List<TeacherVipClassInfoDto> dataList = null;
-        int count = classGroupDao.countTeacherVipClass(params);
+        int count = vipGroupDao.countTeacherVipClass(queryInfo.getTeacherId());
         if (count > 0) {
             pageInfo.setTotal(count);
             params.put("offset", pageInfo.getOffset());
-            dataList = classGroupDao.getTeacherVipClass(params);
+            dataList = vipGroupDao.getTeacherVipClass(params);
+            Set<Integer> activityIds = dataList.stream().map(e -> e.getActivityId()).collect(Collectors.toSet());
+            List<Map<Integer,String>> names = vipGroupActivityDao.queryNamesById(StringUtils.join(activityIds,","));
+            Map<Integer,String> nameMap = MapUtil.convertMybatisMap(names);
+            //计算月度平均消耗值(已上课时 / 消耗月份)
+            Date date = new Date();
+            dataList.forEach(e->{
+                e.setActivityName(nameMap.get(e.getActivityId()));
+                int days = DateUtil.daysBetween(e.getPaymentExpireDate(), date);
+                if(days <= 0){
+                    e.setMonthAvg(0f);
+                }else {
+                    e.setMonthAvg(e.getCurrentClassTimes()/(days/30));
+                }
+            });
+
         }
         if (count == 0) {
             dataList = new ArrayList<>();

+ 73 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupTeacherMapperServiceImpl.java

@@ -1,16 +1,25 @@
 package com.ym.mec.biz.service.impl;
 
-import com.ym.mec.biz.dal.entity.TeacherDefaultMusicGroupSalary;
+import com.ym.mec.biz.dal.dao.CourseScheduleTeacherSalaryDao;
+import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.enums.SalarySettlementTypeEnum;
+import com.ym.mec.biz.dal.enums.TeachTypeEnum;
+import com.ym.mec.biz.service.CourseScheduleService;
+import com.ym.mec.biz.service.CourseScheduleTeacherSalaryService;
+import com.ym.mec.util.date.DateUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.ym.mec.biz.dal.dao.ClassGroupTeacherMapperDao;
-import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
 import com.ym.mec.biz.service.ClassGroupTeacherMapperService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
 import java.util.List;
 
 @Service
@@ -18,6 +27,10 @@ public class ClassGroupTeacherMapperServiceImpl extends BaseServiceImpl<Long, Cl
 
     @Autowired
     private ClassGroupTeacherMapperDao classGroupTeacherMapperDao;
+    @Autowired
+    private CourseScheduleService courseScheduleService;
+    @Autowired
+    private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
 
     @Override
     public BaseDAO<Long, ClassGroupTeacherMapper> getDAO() {
@@ -39,14 +52,67 @@ public class ClassGroupTeacherMapperServiceImpl extends BaseServiceImpl<Long, Cl
     }
 
     public boolean classGroupTeacherMapperUpdate(List<ClassGroupTeacherMapper> classGroupTeacherMapperList) throws Exception {
-        for (ClassGroupTeacherMapper classGroupTeacherMapper : classGroupTeacherMapperList) {
-            List<TeacherDefaultMusicGroupSalary> teacherDefaultMusicGroupSalaryList = classGroupTeacherMapper.getTeacherDefaultMusicGroupSalaryList();
-            for (TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary : teacherDefaultMusicGroupSalaryList) {
-                
+        Date date = new Date();
+
+        List<ClassGroupTeacherSalary> classGroupTeacherSalaryList = new ArrayList<>();
+        List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaryList = new ArrayList<>();
+
+        List<CourseSchedule> classGroupNoStartCourseSchedules = courseScheduleService.findClassGroupNoStartCourseSchedules(classGroupTeacherMapperList);
+        for (CourseSchedule classGroupNoStartCourseSchedule : classGroupNoStartCourseSchedules) {
+
+            if (!classGroupNoStartCourseSchedule.getType().equals(CourseSchedule.CourseScheduleType.SINGLE) &&
+                    !classGroupNoStartCourseSchedule.getType().equals(CourseSchedule.CourseScheduleType.MIX) &&
+                    !classGroupNoStartCourseSchedule.getType().equals(CourseSchedule.CourseScheduleType.HIGH)
+            ) {
+                continue;
             }
+            //课时长度
+            int duration = DateUtil.minutesBetween(classGroupNoStartCourseSchedule.getEndClassTime(), classGroupNoStartCourseSchedule.getStartClassTime());
+            for (ClassGroupTeacherMapper classGroupTeacherMapper : classGroupTeacherMapperList) {
+                if (!classGroupTeacherMapper.getClassGroupId().equals(classGroupNoStartCourseSchedule.getClassGroupId())) {
+                    continue;
+                }
+                BigDecimal salary = new BigDecimal("0");
+                List<TeacherDefaultMusicGroupSalary> teacherDefaultMusicGroupSalaryList = classGroupTeacherMapper.getTeacherDefaultMusicGroupSalaryList();
+                for (TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary : teacherDefaultMusicGroupSalaryList) {
+                    //对应基准课酬
+                    BigDecimal baseSalary = classGroupTeacherMapper.getTeacherRole().equals(TeachTypeEnum.BISHOP) ? teacherDefaultMusicGroupSalary.getMainTeacherSalary() : teacherDefaultMusicGroupSalary.getAssistantTeacherSalary();
+                    //基准课酬
+                    if (teacherDefaultMusicGroupSalary.getSettlementType().equals(SalarySettlementTypeEnum.TEACHER_DEFAULT)) {
+                        salary = new BigDecimal(duration).divide(new BigDecimal(30)).multiply(baseSalary).setScale(2, BigDecimal.ROUND_HALF_UP);
+                        break;
+                    }
+                    //阶梯课酬
+                    if (duration >= teacherDefaultMusicGroupSalary.getDurationMin() && duration <= teacherDefaultMusicGroupSalary.getDurationMin()) {
+                        salary = baseSalary;
+                        break;
+                    }
+                }
+
+                //班级与老师课酬表
+//                ClassGroupTeacherSalary classGroupTeacherSalary = new ClassGroupTeacherSalary();
+//                classGroupTeacherSalary.setMusicGroupId(classGroupTeacherMapper.getMusicGroupId());
+//                classGroupTeacherSalary.setClassGroupId(classGroupTeacherMapper.getClassGroupId());
+//                classGroupTeacherSalary.setTeacherRole(classGroupTeacherMapper.getTeacherRole());
+//                classGroupTeacherSalary.setUserId(classGroupTeacherMapper.getUserId());
+//                classGroupTeacherSalary.setDuration(duration);
+//                classGroupTeacherSalary.setSalary(salary);
+//                classGroupTeacherSalary.setCreateTime(date);
+//                classGroupTeacherSalary.setUpdateTime(date);
+//                classGroupTeacherSalaryList.add(classGroupTeacherSalary);
 
-            classGroupTeacherMapperDao.update(classGroupTeacherMapper);
+                //课程与老师薪水表
+                CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
+                courseScheduleTeacherSalary.setCourseScheduleId(classGroupNoStartCourseSchedule.getId());
+                courseScheduleTeacherSalary.setTeacherRole(classGroupTeacherMapper.getTeacherRole());
+                courseScheduleTeacherSalary.setUserId(classGroupTeacherMapper.getUserId());
+                courseScheduleTeacherSalary.setExpectSalary(salary);
+                courseScheduleTeacherSalary.setCreateTime(date);
+                courseScheduleTeacherSalary.setCreateUpdate(date);
+                courseScheduleTeacherSalaryList.add(courseScheduleTeacherSalary);
+            }
         }
+        courseScheduleTeacherSalaryDao.batchInsert(courseScheduleTeacherSalaryList);
         return true;
     }
 

+ 54 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleRewardsRulesServiceImpl.java

@@ -1,19 +1,27 @@
 package com.ym.mec.biz.service.impl;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.ym.mec.biz.dal.dao.CourseScheduleRewardsRulesDao;
+import com.ym.mec.biz.dal.dao.OrganizationDao;
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
-import com.ym.mec.biz.dal.entity.CourseScheduleRewardsRules.RewardMode;
 import com.ym.mec.biz.dal.entity.CourseScheduleRewardsRules;
+import com.ym.mec.biz.dal.entity.CourseScheduleRewardsRules.RewardMode;
 import com.ym.mec.biz.service.CourseScheduleRewardsRulesService;
 import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.json.JsonUtil;
 
 @Service
@@ -21,6 +29,9 @@ public class CourseScheduleRewardsRulesServiceImpl extends BaseServiceImpl<Integ
 
 	@Autowired
 	private CourseScheduleRewardsRulesDao courseScheduleRewardsDao;
+	
+	@Autowired
+	private OrganizationDao organizationDao;
 
 	@Override
 	public BaseDAO<Integer, CourseScheduleRewardsRules> getDAO() {
@@ -28,6 +39,29 @@ public class CourseScheduleRewardsRulesServiceImpl extends BaseServiceImpl<Integ
 	}
 
 	@Override
+	public PageInfo<CourseScheduleRewardsRules> queryPage(QueryInfo queryInfo) {
+		PageInfo<CourseScheduleRewardsRules> pageInfo = new PageInfo<CourseScheduleRewardsRules>(queryInfo.getPage(), queryInfo.getRows());
+		Map<String, Object> params = new HashMap<String, Object>();
+		MapUtil.populateMap(params, queryInfo);
+		
+		List<CourseScheduleRewardsRules> dataList = null;
+		int count = this.findCount(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			dataList = this.getDAO().queryPage(params);
+			for(CourseScheduleRewardsRules rules : dataList){
+				rules.setOrganNameList(organizationDao.findByOrganIds(rules.getOrganIdList()).stream().collect(Collectors.joining("、")));
+			}
+		}
+		if (count == 0) {
+			dataList = new ArrayList<CourseScheduleRewardsRules>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
+
+	@Override
 	public BigDecimal queryRewardsAmount(Integer organId, CourseScheduleType courseScheduleType, int coursesNum) {
 
 		List<CourseScheduleRewardsRules> CourseScheduleRewardsRulesList = courseScheduleRewardsDao.query(organId, courseScheduleType);
@@ -41,20 +75,32 @@ public class CourseScheduleRewardsRulesServiceImpl extends BaseServiceImpl<Integ
 		String json = courseScheduleRewardsRules.getRewardsRulesJson();
 
 		List<RewardsRules> rewardsRulesList = JsonUtil.parseArray(json, RewardsRules.class);
-		
+
 		Collections.sort(rewardsRulesList);
-		
+
 		RewardsRules rewardsRules = new RewardsRules();
-		
-		for(RewardsRules rule : rewardsRulesList){
-			if(rule.min >= coursesNum && rule.max < coursesNum){
+
+		for (RewardsRules rule : rewardsRulesList) {
+			if (rule.min >= coursesNum && rule.max <= coursesNum) {
 				rewardsRules = rule;
 				break;
 			}
 		}
-		
-		if(courseScheduleRewardsRules.getRewardMode() == RewardMode.TOTAL){
+
+		if (courseScheduleRewardsRules.getRewardMode() == RewardMode.TOTAL) {
 			return rewardsRules.getAmount();
+		} else if (courseScheduleRewardsRules.getRewardMode() == RewardMode.STAIR) {
+			BigDecimal amount = new BigDecimal(0);
+			for (RewardsRules rule : rewardsRulesList) {
+				if (coursesNum <= rule.max) {
+					amount = amount.add(new BigDecimal(coursesNum * rule.amount.doubleValue()));
+				} else {
+					amount = amount.add(new BigDecimal(rule.max * rule.amount.doubleValue()));
+					coursesNum = coursesNum - rule.max;
+				}
+			}
+
+			return amount;
 		}
 
 		return rewardsRules.getAmount().multiply(new BigDecimal(coursesNum));

+ 69 - 14
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -1,5 +1,27 @@
 package com.ym.mec.biz.service.impl;
 
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.TreeSet;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.time.DateUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.CourseScheduleComplaintsDao;
@@ -9,33 +31,27 @@ import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
 import com.ym.mec.biz.dal.dto.CourseScheduleDto;
 import com.ym.mec.biz.dal.dto.TeacherAttendanceDto;
+import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
 import com.ym.mec.biz.dal.entity.SysConfig;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
+import com.ym.mec.biz.dal.enums.CourseStatusEnum;
+import com.ym.mec.biz.dal.enums.MessageSendMode;
 import com.ym.mec.biz.dal.enums.ParamEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.page.CourseScheduleQueryInfo;
 import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
 import com.ym.mec.biz.service.CourseScheduleService;
+import com.ym.mec.biz.service.SysConfigService;
+import com.ym.mec.biz.service.SysMessageService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.thirdparty.message.MessageSenderPluginContext.MessageSender;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.time.DateUtils;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
 
 @Service
 public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSchedule>  implements CourseScheduleService {
@@ -50,6 +66,11 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 	private SysConfigDao sysConfigDao;
 	@Autowired
 	private StudentAttendanceDao studentAttendanceDao;
+	@Autowired
+	private SysConfigService sysConfigService;
+	
+	@Autowired
+	private SysMessageService sysMessageService;
 
 	@Override
 	public BaseDAO<Long, CourseSchedule> getDAO() {
@@ -390,8 +411,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 	}
 
 	@Override
-    public List<CourseSchedule> findClassGroupCourseSchedules(List classGroupList) {
-		return courseScheduleDao.findClassGroupCourseSchedules(classGroupList);
+    public List<CourseSchedule> findClassGroupNoStartCourseSchedules(List<ClassGroupTeacherMapper> classGroupTeacherMapperList) {
+		return courseScheduleDao.findClassGroupNoStartCourseSchedules(classGroupTeacherMapperList);
     }
 
     /**
@@ -507,4 +528,38 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		newCourseScheduleComplaints.setStatus(courseScheduleComplaints.getStatus());
 		courseScheduleComplaintsDao.update(newCourseScheduleComplaints);
 	}
+
+	@Override
+	public boolean updateCourseScheduleToOverStatus() {
+		List<CourseSchedule> list = courseScheduleDao.queryFinishedWithNoUpdateStatus();
+
+		List<CourseSchedule> updateList = new ArrayList<CourseSchedule>();
+		Date date = new Date();
+		for (CourseSchedule courseSchedule : list) {
+			courseSchedule.setStatus(CourseStatusEnum.OVER);
+			courseSchedule.setUpdateTime(date);
+			updateList.add(courseSchedule);
+		}
+
+		if (updateList.size() > 0) {
+			courseScheduleDao.batchUpdate(updateList);
+		}
+		return true;
+	}
+
+	@Override
+	public boolean pushNoSignInMessage() {
+		Integer minutes = 30;
+		SysConfig sysConfig = sysConfigService.findByParamName(SysConfigService.SIGN_OUT_MESSAGE_PUSH_MINUTE);
+		if (sysConfig != null && StringUtils.isNotBlank(sysConfig.getParanValue())) {
+			minutes = Integer.parseInt(sysConfig.getParanValue());
+		}
+
+		List<CourseSchedule> list = courseScheduleDao.queryNoSignInListByBeforeMinutes(minutes);
+
+		String teacherList = list.stream().map(cs -> cs.getActualTeacherId().toString()).collect(Collectors.joining(","));
+
+		sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageSendMode.PUSH, "", "", teacherList, null, 0, "");
+		return true;
+	}
 }

+ 6 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/DemoGroupServiceImpl.java

@@ -58,7 +58,7 @@ public class DemoGroupServiceImpl extends BaseServiceImpl<Long, DemoGroup>  impl
 	public void demoGroupApply(DemoGroupApplyDto demoGroupApplyDto) {
 		SysUser user = sysUserFeignService.queryUserInfo();
 
-		if(null!=demoGroupDao.findDemoGroupByTeacherId(user.getId().longValue())){
+		if(null!=demoGroupDao.findDemoGroupByTeacherId(user.getId())){
 			throw new BizException("请勿多次创建试听课!");
 		}
 
@@ -71,9 +71,12 @@ public class DemoGroupServiceImpl extends BaseServiceImpl<Long, DemoGroup>  impl
 	}
 
 	@Override
-	public DemoGroup getDemoGroupByTeacherId() {
+	public DemoGroup getDemoGroupByTeacherId() throws Exception {
 		SysUser user = sysUserFeignService.queryUserInfo();
-		return demoGroupDao.findDemoGroupByTeacherId(user.getId().longValue());
+		if(user == null){
+			throw new Exception("获取用户信息失败");
+		}
+		return demoGroupDao.findDemoGroupByTeacherId(user.getId());
 	}
 
 	@Override

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

@@ -181,7 +181,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 		List<MusicCardDto> musicCardDtos = musicGroupDao.queryUserMusicGroups(userId);
 		// 获取学员在该乐团续费状态
 		musicCardDtos.forEach(e -> {
-			e.setPaymentStatus(musicGroupStudentFeeDao.findByUser(userId, e.getMusicGroupId()).getPaymentStatus());
+			MusicGroupStudentFee groupStudentFee = musicGroupStudentFeeDao.findByUser(userId, e.getMusicGroupId());
+			if(groupStudentFee != null){
+				e.setPaymentStatus(musicGroupStudentFeeDao.findByUser(userId, e.getMusicGroupId()).getPaymentStatus());
+			}
 		});
 		return musicCardDtos;
 	}

+ 9 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PayServiceImpl.java

@@ -48,13 +48,15 @@ public class PayServiceImpl implements PayService {
         HashMap<String, Object> unionPay = new HashMap<>();
         String type = "YQPAY";
         Map payMap;
-        if (routingAccount != null) {
-            //易乾支付
-            payMap = YqPayUtil.getPayMap(amount, orderNo, notifyUrl, returnUrl, orderSubject, orderBody, routingAccount.getMerNo());
-        } else {
-            type = "UNIONPAY";
-            payMap = UnionPay.getPayMap(amount, orderNo, notifyUrl, returnUrl, orderSubject);
-        }
+//        if (routingAccount != null) {
+//            //易乾支付
+//            payMap = YqPayUtil.getPayMap(amount, orderNo, notifyUrl, returnUrl, orderSubject, orderBody, routingAccount.getMerNo());
+//        } else {
+//            type = "UNIONPAY";
+//            payMap = UnionPay.getPayMap(amount, orderNo, notifyUrl, returnUrl, orderSubject);
+//        }
+        type = "UNIONPAY";
+        payMap = UnionPay.getPayMap(amount, orderNo, notifyUrl, returnUrl, orderSubject);
         unionPay.put("orderNo", orderNo);
         unionPay.put("type", type);
         unionPay.put("payMap", payMap);

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

@@ -422,4 +422,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         }
     }
 
+    @Override
+    public List<StudentRegistration> findClassGroupStu(String musicGroupId, Integer classGroupId) {
+        return studentRegistrationDao.findClassGroupStu(musicGroupId, classGroupId);
+    }
 }

+ 28 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java

@@ -7,25 +7,31 @@ import com.ym.mec.biz.dal.dto.TeacherAttendanceDto;
 import com.ym.mec.biz.dal.dto.TeacherPersonalAttendanceDto;
 import com.ym.mec.biz.dal.dto.TeacherSignOutDto;
 import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.enums.MessageSendMode;
 import com.ym.mec.biz.dal.enums.ParamEnum;
 import com.ym.mec.biz.dal.enums.SignStatusEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.page.TeacherAttendanceQueryInfo;
 import com.ym.mec.biz.service.CourseHomeworkService;
 import com.ym.mec.biz.service.CourseScheduleService;
+import com.ym.mec.biz.service.SysConfigService;
+import com.ym.mec.biz.service.SysMessageService;
 import com.ym.mec.biz.service.TeacherAttendanceService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.thirdparty.message.MessageSenderPluginContext.MessageSender;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
+
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.*;
+import java.util.stream.Collectors;
 
 @Service
 public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherAttendance>  implements TeacherAttendanceService {
@@ -46,6 +52,12 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 	private ClassGroupDao classGroupDao;
 	@Autowired
 	private CourseScheduleService courseScheduleService;
+	
+	@Autowired
+	private SysConfigService sysConfigService;
+	
+	@Autowired
+	private SysMessageService sysMessageService;
 
 	@Override
 	public BaseDAO<Long, TeacherAttendance> getDAO() {
@@ -180,5 +192,21 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 		return pageInfo;
 	}
 
+	@Override
+	public boolean pushNoSignOutMessage() {
+		
+		Integer minutes = 30;
+		SysConfig sysConfig = sysConfigService.findByParamName(SysConfigService.SIGN_OUT_MESSAGE_PUSH_MINUTE);
+		if(sysConfig != null && StringUtils.isNotBlank(sysConfig.getParanValue())){
+			minutes = Integer.parseInt(sysConfig.getParanValue());
+		}
+		
+		List<TeacherAttendance> list = teacherAttendanceDao.queryNoSignOutListByOverMinutes(minutes);
+		
+		String teacherList = list.stream().map(ta -> ta.getTeacherId().toString()).collect(Collectors.joining(","));
+		
+		sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageSendMode.PUSH, "", "", teacherList, null, 0, "");
+		return true;
+	}
 
 }

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

@@ -25,7 +25,7 @@ public class TeacherSchoolServiceImpl extends BaseServiceImpl<Long, TeacherSchoo
 	}
 
 	@Override
-	public List<TeacherSchool> findByTeacherId(Long teacherId) {
+	public List<TeacherSchool> findByTeacherId(Integer teacherId) {
 		if(Objects.isNull(teacherId)){
 			throw new BizException("请指定教师");
 		}

+ 32 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherServiceImpl.java

@@ -8,8 +8,10 @@ import com.ym.mec.auth.api.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.BasicUserDto;
 import com.ym.mec.biz.dal.dto.NamesDto;
+import com.ym.mec.biz.dal.dto.UserGoodsDto;
 import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.Teacher;
+import com.ym.mec.biz.dal.entity.TeacherSchool;
 import com.ym.mec.biz.dal.page.TeacherQueryInfo;
 import com.ym.mec.biz.service.TeacherService;
 import com.ym.mec.common.dal.BaseDAO;
@@ -43,8 +45,12 @@ public class TeacherServiceImpl extends BaseServiceImpl<Integer, Teacher>  imple
 	@Autowired
 	private ClassGroupDao classGroupDao;
 	@Autowired
+	private DemoGroupDao demoGroupDao;
+	@Autowired
 	private OrganizationDao organizationDao;
 	@Autowired
+	private TeacherSchoolDao teacherSchoolDao;
+	@Autowired
 	private SysUserFeignService sysUserFeignService;
 	@Autowired
 	private ImFeignService imFeignService;
@@ -136,8 +142,6 @@ public class TeacherServiceImpl extends BaseServiceImpl<Integer, Teacher>  imple
 			Map<Integer, Integer> numsMap = MapUtil.convertMybatisMap(nums);
 			imGroupModels1.forEach(e -> {
 				//获取当前班级老师总数
-//				Set<Integer> teachers = classGroupDao.queryTeacherIds(e.getId());
-//				teachers.removeAll(Collections.singleton(null));
 				Integer num = numsMap.get(e.getId());
 				e.setCount(num == null?0:num + e.getCount());
 				e.setId("cg" + e.getId());
@@ -160,19 +164,43 @@ public class TeacherServiceImpl extends BaseServiceImpl<Integer, Teacher>  imple
 
     @Override
 	public PageInfo<Teacher> queryPageDetail(TeacherQueryInfo queryInfo) {
-		return queryPage(queryInfo);
+		PageInfo<Teacher> pageInfo = queryPage(queryInfo);
+		List<Teacher> rows = pageInfo.getRows();
+		if(rows != null && rows.size() > 0){
+			Set<Integer> teachers = rows.stream().map(e -> e.getId()).collect(Collectors.toSet());
+			String teacherIds = StringUtils.join(teachers, ",");
+			//获取小课数量
+			List<Map<Integer,Long>> numList =  classGroupDao.countTeacherVipNum(teacherIds);
+			Map<Integer,Long> vipNumMap = MapUtil.convertMybatisMap(numList);
+			//获取试听课数量
+			List<Map<Integer,Long>> demoNumList =  demoGroupDao.countTeacherDemoGroupNum(teacherIds);
+			Map<Integer,Long> demoNumMap = MapUtil.convertMybatisMap(demoNumList);
+			rows.forEach(e->{
+				e.setSubjectName(subjectDao.findBySubIds(e.getSubjectId()));
+				Long num = vipNumMap.get(e.getId());
+				e.setVipNum(num == null?0:num.intValue());
+				Long demoNum = demoNumMap.get(e.getId());
+				e.setDemoNum(demoNum == null?0:demoNum.intValue());
+			});
+		}
+		return pageInfo;
 	}
 
 	@Override
 	public Teacher getDetail(Integer id) {
 		Teacher teacher = teacherDao.get(id);
 		if(teacher != null){
+			//获取老师教学点列表
+			List<TeacherSchool> teacherSchools = teacherSchoolDao.findByTeacherId(id);
+			teacher.setTeacherSchools(teacherSchools);
+			//获取流动范围
 			if(StringUtils.isNotEmpty(teacher.getFlowOrganRange())){
 				List<String> organNames = organizationDao.findByOrganIds(teacher.getFlowOrganRange());
 				teacher.setFlowOrganRange(StringUtils.join(organNames,","));
 			}
+			//专业技能
 			if(StringUtils.isNotEmpty(teacher.getSubjectId())){
-				teacher.setSubjectId(StringUtils.join(subjectDao.findBySubIds(teacher.getSubjectId()),","));
+				teacher.setSubjectName(subjectDao.findBySubIds(teacher.getSubjectId()));
 			}
 		}
 		return teacher;

+ 20 - 18
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -21,6 +21,7 @@ import com.ym.mec.util.collection.MapUtil;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
@@ -30,7 +31,7 @@ import java.util.stream.Collectors;
 
 @Service
 public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> implements VipGroupService {
-
+	
 	@Autowired
 	private VipGroupDao vipGroupDao;
 	@Autowired
@@ -51,34 +52,34 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 	private VipGroupActivityDao vipGroupActivityDao;
 	@Autowired
 	private VipGroupCategoryDao vipGroupCategoryDao;
-	@Autowired
-	private SysUserFeignService sysUserFeignService;
-	@Autowired
-	private TeacherDefaultVipGroupSalaryDao teacherDefaultVipGroupSalaryDao;
-	@Autowired
-	private StudentPaymentOrderDao studentPaymentOrderDao;
-	@Autowired
-	private StudentVipGroupPaymentDao studentVipGroupPaymentDao;
-	@Autowired
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private TeacherDefaultVipGroupSalaryDao teacherDefaultVipGroupSalaryDao;
+    @Autowired
+    private StudentPaymentOrderDao studentPaymentOrderDao;
+    @Autowired
+    private StudentVipGroupPaymentDao studentVipGroupPaymentDao;
+    @Autowired
 	private StudentApplyRefundsDao studentApplyRefundsDao;
-
+	
 	@Autowired
 	private SysUserCashAccountService sysUserCashAccountService;
 
-	@Autowired
+    @Autowired
 	private SysUserCashAccountDetailDao sysUserCashAccountDetailDao;
-	@Autowired
+    @Autowired
 	private ClassGroupTeacherSalaryDao classGroupTeacherSalaryDao;
 
-	@Autowired
+    @Autowired
 	private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
-	@Autowired
+    @Autowired
 	private ImFeignService imFeignService;
-	@Autowired
+    @Autowired
 	private SubjectDao subjectDao;
-	@Autowired
+    @Autowired
 	private CourseScheduleTeacherSalaryService courseScheduleTeacherSalaryService;
-	@Autowired
+    @Autowired
 	private CourseScheduleStudentPaymentService courseScheduleStudentPaymentService;
 	@Autowired
 	private PayService payService;
@@ -759,6 +760,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 	}
 
 	@Override
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public boolean awardedMonthlyRewards() {
 		List<Map<Integer, Integer>> list = courseScheduleDao.queryVipGroupTeachereClassTimesByMonth(new Date(), CourseStatusEnum.OVER);
 

+ 15 - 42
mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -153,12 +153,9 @@
         WHERE cg.type_="MIX" AND cg.music_group_id_=#{musicGroupId} AND del_flag_='0'
     </select>
     <select id="findMixClassChildClassGroup" resultMap="ClassGroup">
-        SELECT
-        cg.*
-        FROM
-        class_group_relation cgr
-        LEFT JOIN class_group cg ON cgr.class_group_id_=cg.id_
-        WHERE cgr.sub_class_group_id_=#{mixClassGroupId} AND del_flag_='0'
+        SELECT * FROM class_group WHERE id_ IN
+        (SELECT sub_class_group_id_ FROM class_group_relation
+        WHERE class_group_id_ = #{mixClassGroupId}) AND del_flag_ = 0
     </select>
 
     <!-- 根据乐团id获取单技班信息 -->
@@ -189,51 +186,23 @@
     <resultMap type="com.ym.mec.biz.dal.dto.TeacherMusicClassInfoDto" id="getTeaCourseInfosMap">
         <result column="music_group_id_" property="musicGroupId"/>
         <result column="music_group_name_" property="musicGroupName"/>
-        <!--<result column="job_nature_" property="jobNature" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>-->
         <result column="educational_teacher_id_" property="educationalTeacherId"/>
         <result column="team_teacher_id_" property="teamTeacherId"/>
         <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
-        <collection property="classGroupNames" javaType="java.lang.String" column="class_group_name_"/>
+        <result column="job_type_" property="jobType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="job_nature_" property="jobNature" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <collection property="classGroupNames" ofType="string">
+            <result column="class_group_name_"/>
+        </collection>
     </resultMap>
     <select id="queryGroupCourses" resultMap="getTeaCourseInfosMap">
         SELECT mg.id_ music_group_id_,mg.name_ music_group_name_,
-        mg.team_teacher_id_,mg.educational_teacher_id_,cg.name_ class_group_name_,mg.status_
+        mg.team_teacher_id_,mg.educational_teacher_id_,cg.name_ class_group_name_,mg.status_,t.job_type_,t.job_nature_
         FROM class_group_teacher_mapper cgtm
         LEFT JOIN music_group mg ON cgtm.music_group_id_ = mg.id_
         LEFT JOIN class_group cg ON cg.id_ = cgtm.class_group_id_
-        WHERE cgtm.user_id_ = #{userId} AND cg.del_flag_ = 0
-    </select>
-
-
-    <resultMap type="com.ym.mec.biz.dal.dto.TeacherVipClassInfoDto" id="getTeacherVipClassMap">
-        <result column="price_" property="vipClassFee"/>
-        <result column="vip_group_id_" property="vipClassId"/>
-        <result column="student_num_" property="studentNum"/>
-        <result column="courses_expire_date_" property="coursesExpireDate"/>
-        <result column="payment_expire_date_" property="paymentExpireDate"/>
-        <result column="create_time_" property="createDate"/>
-        <result column="current_class_times_" property="currentClassTimes"/>
-        <result column="total_class_times_" property="totalClassTimes"/>
-        <result column="vip_group_name_" property="vipClassName"/>
-        <result column="audit_status_" property="auditStatus"
-                typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
-        <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
-    </resultMap>
-    <select id="getTeacherVipClass" resultMap="getTeacherVipClassMap">
-        SELECT vg.id_ vip_group_id_,vg.name_ vip_group_name_,vg.audit_status_,cs.status_,
-        cg.student_num_,vg.price_,vg.payment_expire_date_,vg.courses_expire_date_,vg.create_time_,
-        cs.current_class_times_,cg.total_class_times_
-        FROM vip_group vg
-        LEFT JOIN sys_user su ON vg.user_id_ = su.id_
-        LEFT JOIN vip_group_class_group_mapper vgcgm ON vg.id_ = vgcgm.vip_group_id_
-        LEFT JOIN class_group cg ON vgcgm.class_group_id_ = cg.id_
-        LEFT JOIN course_schedule cs ON cg.id_ = cs.class_group_id_
-        WHERE vg.user_id_ = #{teacherId}
-        <include refid="global.limit"/>
-    </select>
-    <select id="countTeacherVipClass" resultType="java.lang.Integer">
-        SELECT COUNT(vg.id_) FROM vip_group vg
-        WHERE vg.user_id_ = #{teacherId}
+		LEFT JOIN teacher t ON t.id_ = cgtm.user_id_
+        WHERE cgtm.user_id_ = #{userId} AND cg.del_flag_ = 0 AND (cg.type_ = 'NORMAL' OR cg.type_ = 'MIX')
     </select>
 
 
@@ -454,6 +423,10 @@
             class_group cg
             WHERE cg.id_=#{classGroupId} FOR UPDATE
     </select>
+    <select id="countTeacherVipNum" resultType="java.util.Map">
+        SELECT vg.user_id_ `key`,COUNT(vg.id_) `value` FROM vip_group vg
+        WHERE FIND_IN_SET(vg.user_id_,#{teacherIds}) GROUP BY user_id_
+    </select>
 
     <resultMap id="TeacherClassGroupDto" type="com.ym.mec.biz.dal.dto.TeacherClassGroupDto">
         <result property="classGroupId" column="class_group_id_"/>

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

@@ -96,7 +96,7 @@
         (id_,music_group_id_,class_group_id_,teacher_role_,user_id_,salary_,create_time_,update_time_)
         VALUES
         <foreach collection="classGroupTeacherMapperList" item="item" index="index" separator=",">
-            (#{item.id},#{item.musicGroupId},#{item.classGroupId},#{item.teacherRole},#{item.userId},#{item.salary},#{item.createTime},#{item.updateTime})
+            (#{item.id},#{item.musicGroupId},#{item.classGroupId},#{item.teacherRole},#{item.userId},#{item.salary},NOW(),NOW())
         </foreach>
     </insert>
 

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

@@ -73,7 +73,7 @@
 
     <!-- 根据主键删除一条记录 -->
     <update id="delete">
-		UPDATE cooperation_organ SET det_flag_ = 1 WHERE id_ =#{id}
+		UPDATE cooperation_organ SET del_flag_ = 1 WHERE id_ =#{id}
 	</update>
 
     <!-- 分页查询 -->

+ 269 - 208
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -53,13 +53,15 @@
 
     <!-- 根据主键查询一条记录 -->
     <select id="get" resultMap="CourseSchedule">
-		SELECT * FROM course_schedule WHERE id_ = #{id} 
-	</select>
+        SELECT * FROM course_schedule WHERE id_ = #{id}
+    </select>
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="CourseSchedule">
-		SELECT * FROM course_schedule ORDER BY id_
-	</select>
+        SELECT *
+        FROM course_schedule
+        ORDER BY id_
+    </select>
 
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CourseSchedule" useGeneratedKeys="true" keyColumn="id"
@@ -74,7 +76,8 @@
         VALUES(#{id},#{classGroupId},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{subsidy},#{classDate},#{startClassTime},#{endClassTime},#{teacherId},#{teacherId},now(),now(),#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{name},#{teachMode,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{studentNum},#{leaveStudentNum})
     </insert>
 
-    <insert id="batchAddCourseSchedules" parameterType="java.util.List" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+    <insert id="batchAddCourseSchedules" parameterType="java.util.List" useGeneratedKeys="true" keyColumn="id"
+            keyProperty="id">
         INSERT INTO course_schedule
         (id_,class_group_id_,status_,subsidy_,class_date_,start_class_time_,end_class_time_,teacher_id_,actual_teacher_id_,create_time_,update_time_,type_,name_,teach_mode_,student_num_,leave_student_num_)
         VALUE
@@ -129,14 +132,14 @@
 
     <!-- 根据主键删除一条记录 -->
     <delete id="delete">
-		DELETE FROM course_schedule WHERE id_ = #{id}
-	</delete>
+        DELETE FROM course_schedule WHERE id_ = #{id}
+    </delete>
 
     <delete id="deleteCourseSchedulesByMusicGroupID">
         DELETE
-          cs
+        cs
         FROM
-            course_schedule cs
+        course_schedule cs
         INNER JOIN class_group cg ON cs.class_group_id_=cg.id_
         WHERE cg.music_group_id_=#{musicGroupID}
     </delete>
@@ -149,8 +152,9 @@
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM course_schedule
-	</select>
+        SELECT COUNT(*)
+        FROM course_schedule
+    </select>
 
     <resultMap type="com.ym.mec.biz.dal.dto.TeacherAttendanceDto" id="TeacherAttendanceViewUtilEntity">
         <result property="courseScheduleId" column="id_"/>
@@ -158,7 +162,8 @@
         <result property="classDate" column="class_date_"/>
         <result property="startClassTime" column="start_class_time_"/>
         <result property="endClassTime" column="end_class_time_"/>
-        <result property="courseStatus" column="course_status_" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result property="courseStatus" column="course_status_"
+                typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result property="classId" column="class_id"/>
         <result property="className" column="class_name"/>
         <result property="classType" column="class_type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
@@ -174,24 +179,24 @@
     <select id="getCurrentCourseDetail"
             resultMap="TeacherAttendanceViewUtilEntity">
         SELECT
-            cs.id_ ,
-            cs.name_ course_schedule_name_,
-            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.status_ course_status_,
-            cg.id_ class_id,
-            cg.name_ class_name,
-            cs.type_ class_type,
-            mg.id_ music_group_id,
-            mg.name_ music_group_name,
-            s.id_ school_id_,
-            s.address_,
-            s.longitude_latitude_,
-            su.username_ teacher_name_,
-            ta.sign_in_time_
+        cs.id_ ,
+        cs.name_ course_schedule_name_,
+        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.status_ course_status_,
+        cg.id_ class_id,
+        cg.name_ class_name,
+        cs.type_ class_type,
+        mg.id_ music_group_id,
+        mg.name_ music_group_name,
+        s.id_ school_id_,
+        s.address_,
+        s.longitude_latitude_,
+        su.username_ teacher_name_,
+        ta.sign_in_time_
         FROM
-            course_schedule cs
+        course_schedule cs
         LEFT JOIN class_group cg ON cs.class_group_id_=cg.id_
         LEFT JOIN music_group mg ON cg.music_group_id_=mg.id_
         LEFT JOIN school s ON mg.school_id_=s.id_
@@ -203,24 +208,24 @@
     <select id="getTeacherCourseByDateSpeed"
             resultMap="TeacherAttendanceViewUtilEntity">
         SELECT
-            cs.id_ ,
-            cs.name_ course_schedule_name_,
-            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.status_ course_status_,
-            cg.id_ class_id,
-            cg.name_ class_name,
-            cs.type_ class_type,
-            mg.id_ music_group_id,
-            mg.name_ music_group_name,
-            s.id_ school_id_,
-            s.address_,
-            s.longitude_latitude_,
-            su.username_ teacher_name_,
-            ta.sign_in_time_
+        cs.id_ ,
+        cs.name_ course_schedule_name_,
+        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.status_ course_status_,
+        cg.id_ class_id,
+        cg.name_ class_name,
+        cs.type_ class_type,
+        mg.id_ music_group_id,
+        mg.name_ music_group_name,
+        s.id_ school_id_,
+        s.address_,
+        s.longitude_latitude_,
+        su.username_ teacher_name_,
+        ta.sign_in_time_
         FROM
-            course_schedule cs
+        course_schedule cs
         LEFT JOIN class_group cg ON cs.class_group_id_=cg.id_
         LEFT JOIN music_group mg ON cg.music_group_id_=mg.id_
         LEFT JOIN school s ON mg.school_id_=s.id_
@@ -243,15 +248,15 @@
 
     <select id="getCurrentCourseStudents" resultMap="studentAttendanceViewUtilEntity">
         SELECT
-            cgsm.class_group_id_,
-            su.id_ student_id_,
-            su.username_,
-            mg.id_ music_group_id_,
-            s.id_ subject_id_,
-            s.name_ subject_name_,
-            cgsm.status_
+        cgsm.class_group_id_,
+        su.id_ student_id_,
+        su.username_,
+        mg.id_ music_group_id_,
+        s.id_ subject_id_,
+        s.name_ subject_name_,
+        cgsm.status_
         FROM
-            class_group cg
+        class_group cg
         LEFT JOIN class_group_student_mapper cgsm ON cg.id_=cgsm.class_group_id_
         LEFT JOIN sys_user su ON cgsm.user_id_=su.id_
         LEFT JOIN music_group mg ON cg.music_group_id_=mg.id_
@@ -273,29 +278,29 @@
 
     <select id="getCourseSchedulesWithDate" resultMap="courseScheduleDto">
         SELECT
-            cg.id_ seal_class_id_,
-            cs.name_,
-            cs.type_,
-            cs.id_,
-            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.status_,
-            cs.student_num_,
-            cs.leave_student_num_,
-            cg.student_num_ total_student_num_,
-	        su.username_ teacher_name_,
-	        ta.sign_in_status_ attendance_status_
+        cg.id_ seal_class_id_,
+        cs.name_,
+        cs.type_,
+        cs.id_,
+        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.status_,
+        cs.student_num_,
+        cs.leave_student_num_,
+        cg.student_num_ total_student_num_,
+        su.username_ teacher_name_,
+        ta.sign_in_status_ attendance_status_
         FROM
-            music_group mg
-            LEFT JOIN class_group cg ON mg.id_ = cg.music_group_id_
-            LEFT JOIN course_schedule cs ON cg.id_ = cs.class_group_id_
-            LEFT JOIN sys_user su ON cs.teacher_id_=su.id_
-	        LEFT JOIN teacher_attendance ta ON cs.id_=ta.class_group_id_ AND ta.teacher_id_=cs.teacher_id_
+        music_group mg
+        LEFT JOIN class_group cg ON mg.id_ = cg.music_group_id_
+        LEFT JOIN course_schedule cs ON cg.id_ = cs.class_group_id_
+        LEFT JOIN sys_user su ON cs.teacher_id_=su.id_
+        LEFT JOIN teacher_attendance ta ON cs.id_=ta.class_group_id_ AND ta.teacher_id_=cs.teacher_id_
         WHERE
-            mg.organ_id_ = #{organId}
-            AND cs.id_ IS NOT NULL
-            AND cs.class_date_ = DATE_FORMAT(#{date},'%Y-%m-%d')
+        mg.organ_id_ = #{organId}
+        AND cs.id_ IS NOT NULL
+        AND cs.class_date_ = DATE_FORMAT(#{date},'%Y-%m-%d')
         <include refid="global.limit"/>
     </select>
 
@@ -314,65 +319,66 @@
 
     <select id="getStudentCourseSchedulesWithDate" resultMap="courseScheduleDto">
         SELECT
-            cgsm.class_group_id_ seal_class_id_,
-            cs.name_,
-            cs.type_,
-            cs.id_,
-            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.status_,
-	        su.username_ teacher_name_,
-	        cgsm.status_ attendance_status_,
-	        cs.teach_mode_
+        cgsm.class_group_id_ seal_class_id_,
+        cs.name_,
+        cs.type_,
+        cs.id_,
+        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.status_,
+        su.username_ teacher_name_,
+        cgsm.status_ attendance_status_,
+        cs.teach_mode_
         FROM
-            course_schedule cs
-            LEFT JOIN sys_user su ON cs.teacher_id_=su.id_
-            LEFT JOIN class_group_student_mapper cgsm ON cgsm.class_group_id_ = cs.class_group_id_
+        course_schedule cs
+        LEFT JOIN sys_user su ON cs.teacher_id_=su.id_
+        LEFT JOIN class_group_student_mapper cgsm ON cgsm.class_group_id_ = cs.class_group_id_
         WHERE
-            cs.class_date_ = DATE_FORMAT(#{classDate},'%Y%m%d')
-            AND cgsm.user_id_ = #{studentId}
+        cs.class_date_ = DATE_FORMAT(#{classDate},'%Y%m%d')
+        AND cgsm.user_id_ = #{studentId}
     </select>
 
     <select id="getTeacherCourseSchedulesWithDate" resultMap="courseScheduleDto">
         SELECT
-            cg.id_ seal_class_id_,
-            cg.name_,
-            su.username_ teacher_name_,
-            cs.type_,
-            cs.id_,
-            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.status_,
-	        s.name_ school_name_,
-	        if(ta.sign_in_status_ IS NULL,0,1) sign_in_status_,
-	        if(ta.sign_out_status_ IS NULL,0,1) sign_out_status_,
-	        cs.teach_mode_
+        cg.id_ seal_class_id_,
+        cg.name_,
+        su.username_ teacher_name_,
+        cs.type_,
+        cs.id_,
+        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.status_,
+        s.name_ school_name_,
+        if(ta.sign_in_status_ IS NULL,0,1) sign_in_status_,
+        if(ta.sign_out_status_ IS NULL,0,1) sign_out_status_,
+        cs.teach_mode_
         FROM
-            course_schedule cs
-            LEFT JOIN sys_user su ON cs.actual_teacher_id_=su.id_
-            LEFT JOIN class_group cg ON cs.class_group_id_ = cg.id_
-            LEFT JOIN music_group mg ON cg.music_group_id_=mg.id_
-            LEFT JOIN school s ON mg.school_id_=s.id_
-	        LEFT JOIN teacher_attendance ta ON cs.id_=ta.course_schedule_id_ AND ta.teacher_id_=#{teacherId}
+        course_schedule cs
+        LEFT JOIN sys_user su ON cs.actual_teacher_id_=su.id_
+        LEFT JOIN class_group cg ON cs.class_group_id_ = cg.id_
+        LEFT JOIN music_group mg ON cg.music_group_id_=mg.id_
+        LEFT JOIN school s ON mg.school_id_=s.id_
+        LEFT JOIN teacher_attendance ta ON cs.id_=ta.course_schedule_id_ AND ta.teacher_id_=#{teacherId}
         WHERE
-            cs.class_date_ = DATE_FORMAT(#{classDate},'%Y%m%d')
-            AND cs.actual_teacher_id_ = #{teacherId}
+        cs.class_date_ = DATE_FORMAT(#{classDate},'%Y%m%d')
+        AND cs.actual_teacher_id_ = #{teacherId}
     </select>
 
     <select id="getCourseScheduleDateByMonth" resultType="java.util.Date">
         SELECT
-            cs.class_date_
+        cs.class_date_
         FROM
-            course_schedule cs
+        course_schedule cs
         LEFT JOIN class_group cg ON cs.class_group_id_=cg.id_
         WHERE DATE_FORMAT(cs.class_date_,'%Y%m')=DATE_FORMAT(#{month},'%Y%m')
         AND cg.music_group_id_=#{musicGroupID}
         GROUP BY cs.class_date_
     </select>
 
-    <select id="countTeacherCourseInOnDayRepeats" parameterType="com.ym.mec.biz.dal.entity.CourseSchedule" resultType="int">
+    <select id="countTeacherCourseInOnDayRepeats" parameterType="com.ym.mec.biz.dal.entity.CourseSchedule"
+            resultType="int">
         SELECT
         COUNT( * )
         FROM
@@ -430,8 +436,8 @@
             DATE_FORMAT(#{date},'%Y-%m-%d')
         </foreach>
         AND (
-          DATE_FORMAT(cs.start_class_time_,"%H:%i:%s") &gt; DATE_FORMAT(#{endClassTime}, '%H:%i:%s' )
-          OR DATE_FORMAT(cs.end_class_time_,"%H:%i:%s") &lt; DATE_FORMAT( #{endClassTime}, '%H:%i:%s' )
+        DATE_FORMAT(cs.start_class_time_,"%H:%i:%s") &gt; DATE_FORMAT(#{endClassTime}, '%H:%i:%s' )
+        OR DATE_FORMAT(cs.end_class_time_,"%H:%i:%s") &lt; DATE_FORMAT( #{endClassTime}, '%H:%i:%s' )
         )=0
     </select>
 
@@ -447,34 +453,36 @@
         </foreach>
     </select>
 
-    <!-- 获取班级的课程 -->
-    <select id="findClassGroupCourseSchedules" resultMap="CourseSchedule">
+    <!-- 获取班级未开始的课程 -->
+    <select id="findClassGroupNoStartCourseSchedules" resultMap="CourseSchedule">
         SELECT * FROM course_schedule
-        WHERE class_group_id_ IN
-        <foreach collection="classGroupList" item="classGroup" index="index" open="(" close=")" separator=",">
-            #{classGroup.id}
+        WHERE status_ = 'NOT_START'
+        AND class_group_id_ IN
+        <foreach collection="classGroupTeacherMapperList" item="classGroupTeacherMapper" index="index" open="("
+                 close=")" separator=",">
+            #{classGroupTeacherMapper.classGroupId}
         </foreach>
     </select>
 
     <select id="getStudentCourseScheduleDate" resultType="java.util.Date">
         SELECT
-            cs.class_date_
+        cs.class_date_
         FROM
-            class_group_student_mapper cgsm
-            LEFT JOIN course_schedule cs ON cgsm.class_group_id_ = cs.class_group_id_
+        class_group_student_mapper cgsm
+        LEFT JOIN course_schedule cs ON cgsm.class_group_id_ = cs.class_group_id_
         WHERE
-            cgsm.user_id_ = #{studentId}
-            <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="isAttend!=null">
-                AND cs.status_='NOT_START'
-            </if>
+        cgsm.user_id_ = #{studentId}
+        <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="isAttend!=null">
+            AND cs.status_='NOT_START'
+        </if>
         GROUP BY
-            cs.class_date_
+        cs.class_date_
     </select>
 
     <select id="getTeacherCourseScheduleDate" resultType="java.util.Date">
@@ -496,29 +504,29 @@
 
     <select id="getCourseScheduleDate" resultType="java.util.Date">
         SELECT
-            cs.class_date_
+        cs.class_date_
         FROM
-            music_group mg
-            LEFT JOIN class_group cg ON mg.id_ = cg.music_group_id_
-            LEFT JOIN course_schedule cs ON cg.id_ = cs.class_group_id_
+        music_group mg
+        LEFT JOIN class_group cg ON mg.id_ = cg.music_group_id_
+        LEFT JOIN course_schedule cs ON cg.id_ = cs.class_group_id_
         WHERE
-            mg.organ_id_ = #{organId} AND cs.id_ IS NOT NULL
-            <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>
+        mg.organ_id_ = #{organId} AND cs.id_ IS NOT NULL
+        <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>
         GROUP BY
-            cs.class_date_
+        cs.class_date_
     </select>
 
     <select id="findClassSubjects" resultType="string">
         SELECT
-            CONCAT(cg.id_,'-',IF(GROUP_CONCAT(s.name_) IS NULL,'',GROUP_CONCAT(s.name_)))
+        CONCAT(cg.id_,'-',IF(GROUP_CONCAT(s.name_) IS NULL,'',GROUP_CONCAT(s.name_)))
         FROM
-            class_group cg
-            LEFT JOIN `subject` s ON FIND_IN_SET(s.id_,cg.subject_id_list_)
+        class_group cg
+        LEFT JOIN `subject` s ON FIND_IN_SET(s.id_,cg.subject_id_list_)
         WHERE cg.id_ IN
         <foreach collection="list" item="id" open="(" close=")" separator=",">
             #{id}
@@ -543,21 +551,21 @@
 
     <select id="findStudentCourseScheduleRecords" resultMap="studentCourseScheduleRecord">
         SELECT
-            sa.id_,
-            sa.status_,
-            sa.teacher_id_,
-            su.username_,
-            cs.id_ course_schedule_id_,
-            cs.name_,
-            cs.class_date_,
-            cs.start_class_time_,
-            cs.end_class_time_,
-            cs.teacher_id_,
-            cs.teach_mode_
+        sa.id_,
+        sa.status_,
+        sa.teacher_id_,
+        su.username_,
+        cs.id_ course_schedule_id_,
+        cs.name_,
+        cs.class_date_,
+        cs.start_class_time_,
+        cs.end_class_time_,
+        cs.teacher_id_,
+        cs.teach_mode_
         FROM
-            student_attendance sa
-            LEFT JOIN course_schedule cs ON sa.course_schedule_id_=cs.id_
-            LEFT JOIN sys_user su ON sa.teacher_id_=su.id_
+        student_attendance sa
+        LEFT JOIN course_schedule cs ON sa.course_schedule_id_=cs.id_
+        LEFT JOIN sys_user su ON sa.teacher_id_=su.id_
         <include refid="queryStudentCourseScheduleRecordCondition"/>
         ORDER BY sa.id_
         <include refid="global.limit"/>
@@ -573,68 +581,68 @@
     </select>
     <select id="findStudentCourseScheduleNotStartRecords" resultMap="studentCourseScheduleRecord">
         SELECT
-            cs.teacher_id_,
-            su.username_ teacher_name_,
-            cs.id_ course_schedule_id_,
-            cs.name_,
-            cs.class_date_,
-            cs.start_class_time_,
-            cs.end_class_time_,
-            cs.teach_mode_,
-	        (cg.total_class_times_-cg.current_class_times_) rest_of_class_
+        cs.teacher_id_,
+        su.username_ teacher_name_,
+        cs.id_ course_schedule_id_,
+        cs.name_,
+        cs.class_date_,
+        cs.start_class_time_,
+        cs.end_class_time_,
+        cs.teach_mode_,
+        (cg.total_class_times_-cg.current_class_times_) rest_of_class_
         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 class_group cg ON cgsm.class_group_id_=cg.id_
+        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 class_group cg ON cgsm.class_group_id_=cg.id_
         WHERE cs.status_='NOT_START' AND cgsm.user_id_=#{userId} AND cs.class_date_=DATE_FORMAT(#{date},'%Y%m%d')
     </select>
     <select id="findCourseScheduleByMusicGroup" resultMap="CourseSchedule">
         SELECT
-            cs.*
+        cs.*
         FROM
-            class_group cg
-            LEFT JOIN course_schedule cs ON cg.id_=cs.class_group_id_
-            WHERE  cg.music_group_id_=#{musicGroupId}
+        class_group cg
+        LEFT JOIN course_schedule cs ON cg.id_=cs.class_group_id_
+        WHERE cg.music_group_id_=#{musicGroupId}
     </select>
     <select id="countClassTimes" resultType="int">
         SELECT
-            COUNT(*)
+        COUNT(*)
         FROM
-            course_schedule cs
-            WHERE cs.class_group_id_=#{classGroupId} AND cs.status_!="NOT_START"
+        course_schedule cs
+        WHERE cs.class_group_id_=#{classGroupId} AND cs.status_!="NOT_START"
     </select>
     <select id="getCourseSchedules" resultMap="courseScheduleDto">
         SELECT
-            cs.type_,
-            cs.id_,
-            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_,
-			sc.paran_value_
+        cs.type_,
+        cs.id_,
+        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_,
+        sc.paran_value_
         FROM
-            course_schedule cs
-			LEFT JOIN sys_config sc ON sc.param_name_="vip_appeal_days_range"
+        course_schedule cs
+        LEFT JOIN sys_config sc ON sc.param_name_="vip_appeal_days_range"
         WHERE
-            cs.id_=#{courseScheduleId}
+        cs.id_=#{courseScheduleId}
     </select>
 
     <select id="findStudentNamesByCourseSchedule" resultType="string">
         SELECT
-            su.username_
+        su.username_
         FROM
-            student_attendance sa
-            LEFT JOIN sys_user su ON sa.user_id_=su.id_
-            WHERE sa.course_schedule_id_=#{courseScheduleId}
+        student_attendance sa
+        LEFT JOIN sys_user su ON sa.user_id_=su.id_
+        WHERE sa.course_schedule_id_=#{courseScheduleId}
     </select>
     <select id="findVipGroupCourseSchedules" resultMap="CourseSchedule">
-      SELECT
-            cs.*
+        SELECT
+        cs.*
         FROM
-            vip_group_class_group_mapper vgcgm
-            LEFT JOIN course_schedule cs ON vgcgm.class_group_id_=cs.class_group_id_
+        vip_group_class_group_mapper vgcgm
+        LEFT JOIN course_schedule cs ON vgcgm.class_group_id_=cs.class_group_id_
         WHERE
-            vgcgm.vip_group_id_ =#{vipGroupId}
+        vgcgm.vip_group_id_ =#{vipGroupId}
     </select>
     <select id="findByClassGroupAndDate" resultMap="CourseSchedule">
         SELECT
@@ -652,7 +660,7 @@
         type_,name_,
         teach_mode_
         FROM
-            course_schedule
+        course_schedule
         <where>
             <if test="classGroupId!=null">
                 AND class_group_id_ = #{classGroupId}
@@ -668,14 +676,67 @@
     
     <select id="findClassTypeByCourse" resultType="string">
         SELECT
-            cg.type_
+        cg.type_
         FROM
-            course_schedule cs
-            LEFT JOIN class_group cg ON cs.class_group_id_=cg.id_
-            WHERE cs.id_=#{courseScheduleId}
+        course_schedule cs
+        LEFT JOIN class_group cg ON cs.class_group_id_=cg.id_
+        WHERE cs.id_=#{courseScheduleId}
     </select>
     
     <select id="queryVipGroupTeachereClassTimesByMonth" resultType="map" parameterType="map">
         SELECT vp.organ_id_ organ_id_,cs.actual_teacher_id_ teacher_id_,count(cs.id_) times FROM course_schedule cs left join vip_group_class_group_mapper vgm on cs.class_group_id_ = vgm.class_group_id_ left join vip_group vp on vgm.vip_group_id_ = vp.id_ where cs.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} and date_format(#{monthDate} , '%Y%m' ) = date_format(cs.class_date_, '%Y%m' ) group by vp.organ_id_,cs.actual_teacher_id_
     </select>
+    
+    <select id="queryFinishedWithNoUpdateStatus" resultMap="CourseSchedule">
+    	select * from course_schedule where CONCAT(class_date_,' ',end_class_time_) &lt;= now() and status_ != 'OVER'
+    </select>
+    
+    <update id="batchUpdate" parameterType="java.util.List">
+    	<foreach collection="list" item="item" index="index" open="" close="" separator=";">
+        UPDATE course_schedule
+        <set>
+            <if test="item.classDate != null">
+                class_date_ = #{item.classDate},
+            </if>
+            <if test="item.endClassTime != null">
+                end_class_time_ = #{item.endClassTime},
+            </if>
+            <if test="item.status != null">
+                status_ = #{item.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
+            <if test="item.type != null">
+                type_ = #{item.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
+            <if test="item.actualTeacherId != null">
+                actual_teacher_id_ = #{item.actualTeacherId},
+            </if>
+            <if test="item.subsidy != null">
+                subsidy_ = #{item.subsidy},
+            </if>
+            <if test="item.classGroupId != null">
+                class_group_id_ = #{item.classGroupId},
+            </if>
+            <if test="item.startClassTime != null">
+                start_class_time_ = #{item.startClassTime},
+            </if>
+            <if test="item.teacherId != null">
+                teacher_id_ = #{item.teacherId},
+            </if>
+            <if test="item.updateTime != null">
+                update_time_ = #{item.updateTime},
+            </if>
+            <if test="item.studentNum != null">
+                student_num_ = #{item.studentNum},
+            </if>
+            <if test="item.leaveStudentNum != null">
+                leave_student_num_ = #{item.leaveStudentNum},
+            </if>
+        </set>
+        WHERE id_ = #{item.id}
+        </foreach>
+    </update>
+
+    <select id="queryNoSignInListByBeforeMinutes" resultMap="CourseSchedule">
+        SELECT cs.* FROM course_schedule cs left join teacher_attendance ta on ta.course_schedule_id_ = cs.id_ WHERE ta.sign_in_time_ is null and SUBTIME(start_class_time_, CONCAT(#{minutes},'00')) &lt; CURRENT_TIME()
+    </select>
 </mapper>

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

@@ -34,7 +34,7 @@
 			AS ID FROM DUAL </selectKey> -->
 		INSERT INTO course_schedule_rewards_rules
 		(id_,name_,course_schedule_type_,reward_mode_,organ_id_list_,rewards_rules_json_,create_time_,update_time_)
-		VALUES(#{id},#{name},#{courseScheduleType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{rewardMode,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{organIdList},#{rewardsRulesJson},#{createTime},#{updateTime})
+		VALUES(#{id},#{name},#{courseScheduleType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{rewardMode,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{organIdList},#{rewardsRulesJson},now(),now())
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->
@@ -53,7 +53,7 @@
 				id_ = #{id},
 			</if>
 			<if test="updateTime != null">
-				update_time_ = #{updateTime},
+				update_time_ = now(),
 			</if>
 			<if test="organIdList != null">
 				organ_id_list_ = #{organIdList},

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

@@ -40,7 +40,7 @@
 	</insert>
     <insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id_">
 		INSERT INTO course_schedule_teacher_salary (id_,course_schedule_id_,teacher_role_,user_id_,expect_salary_,create_time_,create_update_,subsidy_,actual_salary_,settlement_time_)
-		VALUE
+		VALUES
 		<foreach collection="list" item="data" separator=",">
 			(#{data.id},#{data.courseScheduleId},#{data.teacherRole},#{data.userId},#{data.expectSalary},now(),now(),#{data.subsidy},#{data.actualSalary},#{data.settlementTime})
 		</foreach>

+ 8 - 18
mec-biz/src/main/resources/config/mybatis/DemoGroupMapper.xml

@@ -212,12 +212,6 @@ create_time_ = #{createTime},
 		SELECT * FROM demo_group WHERE user_id_=#{teacherId}
 	</select>
 
-	<sql id="teacherDemoGroupsQueryCondition">
-		<where>
-			dg.user_id_=#{teacherId}
-		</where>
-	</sql>
-
 	<select id="findTeacherDemoGroups" resultType="com.ym.mec.biz.dal.dto.TeacherManageDemoGroupListDto">
 		SELECT
 			cs.class_date_ classDate,
@@ -228,21 +222,13 @@ create_time_ = #{createTime},
 		LEFT JOIN demo_group_class_group_mapper dgcgm ON dg.id_=dgcgm.demo_group_id_
 		LEFT JOIN class_group cg ON dgcgm.class_group_id_=cg.id_
 		LEFT JOIN course_schedule cs ON cg.id_=cs.class_group_id_
-		LEFT JOIN `subject` s ON FIND_IN_SET(s.id_,cg.subject_id_list_)
-		<include refid="teacherDemoGroupsQueryCondition"/>
+		LEFT JOIN `subject` s ON s.id_ = dg.subject_id_
+		WHERE cs.type_ = 'DEMO' AND dg.user_id_ = #{teacherId}
 		GROUP BY cs.class_date_
 		<include refid="global.limit"/>
 	</select>
-	<select id="countTeacherDemoGroups" resultType="int">
-		SELECT
-			count(*)
-		FROM
-			demo_group dg
-		LEFT JOIN demo_group_class_group_mapper dgcgm ON dg.id_=dgcgm.demo_group_id_
-		LEFT JOIN class_group cg ON dgcgm.class_group_id_=cg.id_
-		LEFT JOIN course_schedule cs ON cg.id_=cs.class_group_id_
-		<include refid="teacherDemoGroupsQueryCondition"/>
-		GROUP BY cs.class_date_
+	<select id="countTeacherDemoGroups" resultType="Integer">
+		SELECT COUNT(DISTINCT cs.class_date_) FROM course_schedule cs WHERE cs.type_ = 'DEMO' AND cs.actual_teacher_id_ = #{teacherId}
 	</select>
 
 	<select id="findDemoGroupStartClassTimesWithWeekByTeacherId" resultType="com.ym.mec.biz.dal.dto.EducationDemoGroupListDto">
@@ -255,5 +241,9 @@ create_time_ = #{createTime},
 			YEARWEEK(class_date_) = YEARWEEK( now( ) )
 		GROUP BY class_date_
 	</select>
+	<select id="countTeacherDemoGroupNum" resultType="java.util.Map">
+		SELECT dg.user_id_ `key`,COUNT(dg.id_) `value` FROM demo_group dg
+        WHERE FIND_IN_SET(dg.user_id_,#{teacherIds}) GROUP BY user_id_
+	</select>
 
 </mapper>

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

@@ -165,7 +165,7 @@
                 temporary_course_fee_ = #{item.temporaryCourseFee},
             </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{item.id}
         </foreach>
     </update>
 </mapper>

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

@@ -102,6 +102,6 @@
     </select>
 
     <select id="findByOrganIds" resultType="java.lang.String">
-        SELECT name_ FROM organization WHERE del_flag_ = 0 AND id_ IN (#{organIds})
+        SELECT name_ FROM organization WHERE del_flag_ = 0 AND FIND_IN_SET(id_,#{organIds})
     </select>
 </mapper>

+ 6 - 4
mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml

@@ -21,6 +21,7 @@
         <result property="courseDate" column="course_date_" />
         <result property="courseStatus" column="course_status_" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result property="teacherName" column="teacher_name_" />
+        <result property="currentCLassTimes" column="current_class_times_" />
         <result property="attendanceStatus" column="status_" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
     </resultMap>
 
@@ -187,13 +188,13 @@
                 and cg.type_=#{classGroupType}
             </if>
             <if test="attendanceStatus!=null">
-                and cs.status_=#{attendanceStatus}
+                and sa.status_=#{attendanceStatus, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>
             <if test="classGroupName!=null">
                 and cg.name_ like CONCAT("%",#{classGroupName},"%")
             </if>
             <if test="teacherName!=null">
-                and sa.status_ like CONCAT("%",#{teacherName},"%")
+                and su.real_name_ like CONCAT("%",#{teacherName},"%")
             </if>
         </where>
     </sql>
@@ -204,8 +205,9 @@
             cg.name_ class_group_name_,
             cg.type_ class_group_type_,
             CONCAT(cs.class_date_," ",cs.start_class_time_) course_date_,
-            su.username_ teacher_name_,
-            sa.status_
+            su.real_name_ teacher_name_,
+            sa.status_,
+            sa.current_class_times_
         FROM
             student_attendance sa
             LEFT JOIN class_group cg ON sa.class_group_id_=cg.id_

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

@@ -23,6 +23,7 @@
         <result column="order_no_" property="orderNo"/>
         <result column="music_group_id_" property="musicGroupId"/>
         <result column="class_group_id_" property="classGroupId"/>
+        <result column="version_" property="version"/>
     </resultMap>
 
     <resultMap type="com.ym.mec.biz.dal.entity.Goods" id="Goods">
@@ -121,8 +122,11 @@
             <if test="musicGroupId != null">
                 music_group_id_ = #{musicGroupId},
             </if>
+            <if test="version != null">
+                version_ = version_+1,
+            </if>
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} AND version_ = #{version}
     </update>
 
     <!-- 根据主键删除一条记录 -->

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

@@ -294,4 +294,9 @@
     <select id="getSysUserByPhone" resultMap="FindSysUser">
         SELECT * FROM sys_user WHERE phone_ = #{phone}
     </select>
+
+    <!-- 获取班级下的学生 -->
+    <select id="findClassGroupStu" resultMap="StudentRegistration">
+        SELECT * FROM student_registration WHERE music_group_id_= #{musicGroupId} AND class_group_id_=#{classGroupId}
+    </select>
 </mapper>

+ 8 - 0
mec-biz/src/main/resources/config/mybatis/SysAccountMapper.xml

@@ -111,4 +111,12 @@
   <select id="getPerAccount" resultMap="SysAccount">
     SELECT * FROM sys_account WHERE channel_ = 'YQPAY' AND channel_type_ = 'PER'
   </select>
+
+  <insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id_">
+    INSERT INTO sys_account (id_,mer_no_,channel_)
+    VALUES
+    <foreach collection="sysAccountList" item="data" separator=",">
+      (#{data.id},#{data.merNo},#{data.channel})
+    </foreach>
+  </insert>
 </mapper>

+ 18 - 17
mec-biz/src/main/resources/config/mybatis/SysConfigMapper.xml

@@ -4,23 +4,27 @@
 <mapper namespace="com.ym.mec.biz.dal.dao.SysConfigDao">
 
 	<resultMap type="com.ym.mec.biz.dal.entity.SysConfig" id="SysConfig">
-		<result column="id" property="id" />
+		<result column="id_" property="id" />
 		<result column="param_name_" property="paramName" />
 		<result column="paran_value_" property="paranValue" />
 		<result column="description_" property="description" />
 		<result column="create_on_" property="createOn" />
 		<result column="modify_on_" property="modifyOn" />
+		<result column="group_" property="group" />
 	</resultMap>
 
 	<!-- 根据主键查询一条记录 -->
 	<select id="get" resultMap="SysConfig">
-		SELECT * FROM sys_config WHERE id = #{id}
+		SELECT * FROM sys_config WHERE id_ = #{id}
 	</select>
 
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="SysConfig">
-		SELECT * FROM sys_config ORDER BY
-		id
+		SELECT * FROM sys_config where 1=1
+		<if test="group != null">
+			and group_ = #{group}
+		</if>
+		ORDER BY id_
 	</select>
 
 	<!-- 向数据库增加一条记录 -->
@@ -29,8 +33,8 @@
 		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
 			AS ID FROM DUAL </selectKey> -->
 		INSERT INTO sys_config
-		(id,param_name_,paran_value_,description_,create_on_,modify_on_)
-		VALUES(#{id},#{paramName},#{paranValue},#{description},#{createOn},#{modifyOn})
+		(id_,param_name_,paran_value_,description_,create_on_,modify_on_,group_)
+		VALUES(#{id},#{paramName},#{paranValue},#{description},#{createOn},#{modifyOn},#{group})
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->
@@ -46,35 +50,32 @@
 			<if test="description != null">
 				description_ = #{description},
 			</if>
-			<if test="id != null">
-				id = #{id},
-			</if>
-			<if test="createOn != null">
-				create_on_ = #{createOn},
-			</if>
 			<if test="paramName != null">
 				param_name_ = #{paramName},
 			</if>
+			<if test="group != null">
+				group_ = #{group},
+			</if>
 		</set>
-		WHERE id = #{id}
+		WHERE id_ = #{id}
 	</update>
 
 	<!-- 根据主键删除一条记录 -->
 	<delete id="delete">
-		DELETE FROM sys_config WHERE id = #{id}
+		DELETE FROM sys_config WHERE id_ = #{id}
 	</delete>
 
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="SysConfig" parameterType="map">
-		SELECT * FROM sys_config ORDER BY id
+		SELECT * FROM sys_config ORDER BY id_
 		<include refid="global.limit" />
 	</select>
 
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM
-		sys_config
+		SELECT COUNT(*) FROM sys_config
 	</select>
+	
 	<select id="findByParamName" resultMap="SysConfig">
 		SELECT * FROM sys_config WHERE param_name_=#{paramName}
 	</select>

+ 4 - 4
mec-biz/src/main/resources/config/mybatis/TeacherAttendanceMapper.xml

@@ -115,7 +115,7 @@
                 and ta.class_group_id_ = #{classGroupId}
             </if>
             <if test="attendanceStatus != null">
-                and ta.status_ = #{attendanceStatus, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+                and ta.sign_in_status_ = #{attendanceStatus, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>
             <if test="classGroupType != null">
                 and cg.type_ = #{classGroupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
@@ -132,7 +132,7 @@
             cs.start_class_time_,
             cg.name_,
             cg.type_,
-            ta.status_,
+            ta.sign_in_status_ status_,
             ta.remark_
         FROM
             teacher_attendance ta
@@ -145,7 +145,7 @@
 
     <select id="getTeacherPersonalAttendancesCount" resultType="int">
         SELECT
-            count(*)
+            count(ta.id_)
         FROM
           teacher_attendance ta
         LEFT JOIN course_schedule cs ON ta.course_schedule_id_=cs.id_
@@ -156,9 +156,9 @@
     <select id="countClassTime" resultType="java.lang.Integer">
         select count(*) from teacher_attendance where class_group_id_=#{classGroupId} for update
     </select>
+    
     <select id="findByTeacherAttendanceInfo" resultMap="TeacherAttendance">
         SELECT * FROM teacher_attendance WHERE teacher_id_=#{teacherId} AND course_schedule_id_=#{courseScheduleId}
     </select>
 
-
 </mapper>

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

@@ -51,11 +51,10 @@
     <select id="get" resultMap="Teacher">
         SELECT t.*,su.username_,su.password_,su.salt_,su.phone_,su.avatar_,
         su.lock_flag_,su.del_flag_,su.wx_openid_,su.qq_openid_,su.user_type_,
-        su.gender_,su.nation_,su.birthdate_,su.email_,su.im_token_,t.subject_id_,t.organ_id_,o.name_ organ_name_
+        su.gender_,su.nation_,su.birthdate_,su.email_,su.im_token_
         FROM teacher t
         LEFT JOIN sys_user su ON t.id_ = su.id_
-        LEFT JOIN organization o ON t.organ_id_ = o.id_
-        WHERE t.id_ = #{userId} AND o.del_flag_ = 0
+        WHERE t.id_ = #{userId} AND su.del_flag_ = 0
     </select>
 
     <!-- 全查询 -->
@@ -199,44 +198,36 @@
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="Teacher" parameterType="map">
-        SELECT t.*,su.username_,su.password_,su.salt_,su.phone_,su.avatar_,
-        su.lock_flag_,su.del_flag_,su.wx_openid_,su.qq_openid_,su.user_type_,
-        su.gender_,su.nation_,su.birthdate_,su.email_,su.im_token_,t.subject_id_,t.organ_id_,o.name_ organ_name_,s.name_
-        subject_name_
-        FROM teacher t
-        LEFT JOIN sys_user su ON t.id_ = su.id_
-        LEFT JOIN organization o ON t.organ_id_ = o.id_
-        LEFT JOIN `subject` s ON FIND_IN_SET(s.id_,t.subject_id_)
+        SELECT t.id_,su.real_name_,su.lock_flag_,t.subject_id_,su.phone_,su.organ_id_,t.job_nature_,t.is_probation_period_
+        FROM teacher t LEFT JOIN sys_user su ON t.id_ = su.id_
+        WHERE su.user_type_ LIKE '%TEACHER%' AND su.del_flag_ = 0
         <include refid="queryPageMap"/>
         <include refid="global.limit"/>
     </select>
 
     <sql id="queryPageMap">
-        <where>
-            <if test="lockFlag != null">
-                AND su.lock_flag_ = #{lockFlag}
-            </if>
-            <if test="subjectId != null">
-                AND t.subject_id_ LIKE CONCAT('%',#{subjectId},'%')
-            </if>
-            <if test="organId != null">
-                AND o.organ_id_ = #{organId}
-            </if>
-            <if test="jobNature != null">
-                AND t.job_nature_ = #{jobNature}
-            </if>
-            <if test="isProbationPeriod != null">
-                AND t.is_probation_period_ = #{isProbationPeriod}
-            </if>
-        </where>
+        <if test="lockFlag != null">
+            AND su.lock_flag_ = #{lockFlag}
+        </if>
+        <if test="subjectId != null">
+            AND t.subject_id_ LIKE CONCAT('%',#{subjectId},'%')
+        </if>
+        <if test="organId != null">
+            AND su.organ_id_ = #{organId}
+        </if>
+        <if test="jobNature != null">
+            AND t.job_nature_ = #{jobNature}
+        </if>
+        <if test="isProbationPeriod != null">
+            AND t.is_probation_period_ = #{isProbationPeriod}
+        </if>
     </sql>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
-        SELECT COUNT(t.id_) FROM teacher t
-        LEFT JOIN sys_user su ON t.id_ = su.id_
-        LEFT JOIN `subject` s ON t.subject_id_ = s.id_
-        LEFT JOIN organization o ON t.organ_id_ = o.id_
+        SELECT COUNT(t.id_)
+        FROM teacher t LEFT JOIN sys_user su ON t.id_ = su.id_
+        WHERE su.user_type_ LIKE '%TEACHER%' AND su.del_flag_ = 0
         <include refid="queryPageMap"/>
     </select>
 

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/VipGroupActivityMapper.xml

@@ -146,4 +146,7 @@
 		WHERE
 			FIND_IN_SET( #{categoryId}, vip_group_category_id_list_ )
 	</select>
+    <select id="queryNamesById" resultType="java.util.Map">
+		SELECT vga.id_ `key`,vga.name_ `value` FROM vip_group_activity vga WHERE FIND_IN_SET(vga.id_,#{activityIds})
+	</select>
 </mapper>

+ 41 - 5
mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml

@@ -547,10 +547,46 @@
         GROUP BY cssp.user_id_
     </select>
     <select id="countTeacherVipGroups" resultType="int">
-        SELECT
-            COUNT( * )
-        FROM
-            vip_group
-        WHERE user_id_=#{teacherId} AND status_!=3
+        SELECT COUNT(vg.id_) FROM vip_group vg
+        LEFT JOIN vip_group_class_group_mapper vgcgm ON vg.id_ = vgcgm.vip_group_id_
+        LEFT JOIN course_schedule cs ON cs.class_group_id_ = vgcgm.class_group_id_
+        WHERE cs.actual_teacher_id_ = #{teacherId} AND cs.type_ = 'VIP' AND status_!=3 GROUP BY vg.id_
+    </select>
+
+    <select id="countTeacherVipClass" resultType="java.lang.Integer">
+        SELECT COUNT(DISTINCT vg.id_) FROM vip_group vg
+        LEFT JOIN vip_group_class_group_mapper vgcgm ON vg.id_ = vgcgm.vip_group_id_
+        LEFT JOIN class_group cg ON cg.id_ = vgcgm.class_group_id_
+        LEFT JOIN course_schedule cs ON cs.class_group_id_ = cg.id_
+        WHERE cs.actual_teacher_id_ = 6 AND cs.type_ = 'VIP' AND cg.del_flag_ = 0
+    </select>
+
+    <resultMap type="com.ym.mec.biz.dal.dto.TeacherVipClassInfoDto" id="getTeacherVipClassMap">
+        <result column="vip_group_id_" property="vipClassId"/>
+        <result column="student_num_" property="studentNum"/>
+        <result column="online_classes_unit_price_" property="onlineClassesUnitPrice"/>
+        <result column="offline_classes_unit_price_" property="offlineClassesUnitPrice"/>
+        <result column="class_group_id_" property="classGroupId"/>
+        <result column="courses_expire_date_" property="coursesExpireDate"/>
+        <result column="payment_expire_date_" property="paymentExpireDate"/>
+        <result column="create_time_" property="createDate"/>
+        <result column="current_class_times_" property="currentClassTimes"/>
+        <result column="total_class_times_" property="totalClassTimes"/>
+        <result column="vip_group_name_" property="vipClassName"/>
+        <result column="audit_status_" property="auditStatus" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="teach_mode_" property="teachMode" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="vip_group_activity_id_" property="activityId"/>
+    </resultMap>
+    <select id="getTeacherVipClass" resultMap="getTeacherVipClassMap">
+        SELECT vg.id_ vip_group_id_,vg.name_ vip_group_name_,vg.status_,vg.audit_status_,vg.create_time_,
+        vg.payment_expire_date_,vg.courses_expire_date_,vg.online_classes_unit_price_,vg.offline_classes_unit_price_,
+        cg.total_class_times_,cg.current_class_times_,cg.id_ class_group_id_,cg.student_num_,vg.vip_group_activity_id_
+        FROM vip_group vg
+        LEFT JOIN vip_group_class_group_mapper vgcgm ON vg.id_ = vgcgm.vip_group_id_
+        LEFT JOIN class_group cg ON cg.id_ = vgcgm.class_group_id_
+        LEFT JOIN course_schedule cs ON cs.class_group_id_ = cg.id_
+        WHERE cs.actual_teacher_id_ = #{teacherId} AND cs.type_ = 'VIP' AND cg.del_flag_ = 0 GROUP BY vg.id_,cg.id_
+        <include refid="global.limit"/>
     </select>
 </mapper>

+ 13 - 0
mec-client-api/src/main/java/com/ym/mec/task/TaskRemoteService.java

@@ -12,4 +12,17 @@ public interface TaskRemoteService {
 	@GetMapping(value = "task/refreshPaymentFeeStatus")
 	public void refreshPaymentFeeStatus();
 
+	@GetMapping(value = "task/vipGroupAwardedMonthlyRewards")
+	public void vipGroupAwardedMonthlyRewards();
+	
+	@GetMapping(value = "task/updateCourseScheduleToOverStatus")
+    boolean updateCourseScheduleToOverStatus();
+	
+	@GetMapping("task/pushNoSignInMessage")
+	// 推送未签到消息提醒
+	public void pushNoSignInMessage();
+	
+	@GetMapping("task/pushNoSignOutMessage")
+	// 推送未签退消息提醒
+	public void pushNoSignOutMessage();
 }

+ 21 - 0
mec-client-api/src/main/java/com/ym/mec/task/fallback/TaskRemoteServiceFallback.java

@@ -16,4 +16,25 @@ public class TaskRemoteServiceFallback implements TaskRemoteService {
 		logger.info("更新学生缴费状态的服务调用失败");
 	}
 
+	@Override
+	public void vipGroupAwardedMonthlyRewards() {
+		logger.info("vip课月度奖励的服务调用失败");
+	}
+
+	@Override
+	public boolean updateCourseScheduleToOverStatus() {
+		logger.info("更新课程状态至已结束服务调用失败");
+		return false;
+	}
+
+	@Override
+	public void pushNoSignInMessage() {
+		logger.info("推送未签到消息提醒的服务调用失败");
+	}
+
+	@Override
+	public void pushNoSignOutMessage() {
+		logger.info("推送未签退消息提醒的服务调用失败");
+	}
+
 }

+ 1 - 1
mec-student/src/main/java/com/ym/mec/student/config/ResourceServerConfig.java

@@ -22,7 +22,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
 
 	@Override
 	public void configure(HttpSecurity http) throws Exception {
-		http.csrf().disable().authorizeRequests().antMatchers("/v2/api-docs", "/register/getMusicGroupRegInfo", "/register/add","musicGroup/getSubjectGoodsAndInfo","/musicGroup/test").permitAll().anyRequest().authenticated().and().httpBasic();
+		http.csrf().disable().authorizeRequests().antMatchers("/v2/api-docs", "/register/getMusicGroupRegInfo", "/register/add","musicGroup/getSubjectGoodsAndInfo","/musicGroup/test","/studentOrder/notify").permitAll().anyRequest().authenticated().and().httpBasic();
 	}
 
 	@Override

+ 2 - 2
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java

@@ -325,8 +325,8 @@ public class MusicGroupController extends BaseController {
 //
         IdWorker idWorker = new IdWorker(0, 0);
         String orderNo = "1017" + idWorker.nextId();
-        BigDecimal amount = new BigDecimal("200");
-        Map map = payService.getPayMap(amount, orderNo, "https://pay.dayaedu.com/notify", "https://baodiu.com", "测试订单", "测试订单");
+        BigDecimal amount = new BigDecimal("0.01");
+        Map map = payService.getPayMap(amount, orderNo, "http://47.99.212.176:8000/studentOrder/notify", "https://baodiu.com", "测试订单", "测试订单");
        return succeed(map);
     }
 

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

@@ -0,0 +1,51 @@
+package com.ym.mec.student.controller;
+
+import com.ym.mec.biz.dal.dao.SysAccountDao;
+import com.ym.mec.biz.dal.entity.SysAccount;
+import com.ym.mec.biz.service.SysAccountService;
+import io.swagger.annotations.Api;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Map;
+
+@RequestMapping("studentOrder")
+@Api(tags = "订单回调")
+@RestController
+public class StudentOrderController {
+    private static final Logger log = LoggerFactory.getLogger(StudentOrderController.class);
+    @Autowired
+    private SysAccountDao sysAccountDao;
+
+
+    @PostMapping("/notify")
+    public String notify(HttpServletRequest request) {
+       Map<String,String[]> msg = request.getParameterMap();
+        ArrayList<SysAccount> sysAccounts = new ArrayList<>();
+        for (Map.Entry<String, String[]> stringObjectEntry : msg.entrySet()) {
+            SysAccount sysAccount = new SysAccount();
+            String KeyVal = "Key:" + stringObjectEntry.getKey() + " val:" + stringObjectEntry.getValue().toString();
+            log.warn(KeyVal);
+            sysAccount.setMerNo(stringObjectEntry.getKey());
+            sysAccount.setChannel(request.getParameter(stringObjectEntry.getKey()));
+            sysAccounts.add(sysAccount);
+        }
+        sysAccountDao.batchInsert(sysAccounts);
+
+        // "SUCCESS";
+        // "FAILED";
+
+        return "SUCCESS";
+    }
+
+
+    //
+}

+ 24 - 0
mec-task/src/main/java/com/ym/mec/task/jobs/UpdateCourseScheduleToOverStatusTask.java

@@ -0,0 +1,24 @@
+package com.ym.mec.task.jobs;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.task.TaskRemoteService;
+import com.ym.mec.task.core.BaseTask;
+import com.ym.mec.task.core.TaskException;
+
+/**
+ * 更新课程状态至已结束
+ */
+@Service
+public class UpdateCourseScheduleToOverStatusTask extends BaseTask {
+
+	@Autowired
+	private TaskRemoteService taskRemoteService;
+
+	@Override
+	public void execute() throws TaskException {
+		taskRemoteService.updateCourseScheduleToOverStatus();
+	}
+
+}

+ 24 - 0
mec-task/src/main/java/com/ym/mec/task/jobs/VipGroupAwardedMonthlyRewardsTask.java

@@ -0,0 +1,24 @@
+package com.ym.mec.task.jobs;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.task.TaskRemoteService;
+import com.ym.mec.task.core.BaseTask;
+import com.ym.mec.task.core.TaskException;
+
+/**
+ * vip课月度奖励
+ */
+@Service
+public class VipGroupAwardedMonthlyRewardsTask extends BaseTask {
+
+	@Autowired
+	private TaskRemoteService taskRemoteService;
+
+	@Override
+	public void execute() throws TaskException {
+		taskRemoteService.vipGroupAwardedMonthlyRewards();
+	}
+
+}

+ 9 - 2
mec-teacher/src/main/java/com/ym/mec/teacher/controller/DemoGroupController.java

@@ -1,6 +1,7 @@
 package com.ym.mec.teacher.controller;
 
 import com.ym.mec.biz.dal.dto.DemoGroupApplyDto;
+import com.ym.mec.biz.dal.page.TeacherManageDemoGroupQueryInfo;
 import com.ym.mec.biz.service.DemoGroupService;
 import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
@@ -27,10 +28,16 @@ public class DemoGroupController extends BaseController {
         return succeed();
     }
 
-    @ApiOperation(value = "获取试听课")
+    @ApiOperation(value = "获取老师试听课")
     @GetMapping("/getDemoGroupByTeacherId")
-    public Object getDemoGroupByTeacherId(){
+    public Object getDemoGroupByTeacherId() throws Exception {
         return succeed(demoGroupService.getDemoGroupByTeacherId());
     }
 
+    @ApiOperation(value = "获取教师试听课安排列表")
+    @GetMapping("/findTeacherDemoGroups")
+    public Object findTeacherDemoGroups(TeacherManageDemoGroupQueryInfo queryInfo) throws Exception {
+        return succeed(demoGroupService.findTeacherDemoGroups(queryInfo));
+    }
+
 }

+ 1 - 1
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherVipSchoolController.java

@@ -33,7 +33,7 @@ public class TeacherVipSchoolController extends BaseController {
 
     @ApiOperation("根据教师编号获取教学点")
     @GetMapping(value = "/queryAll")
-    public Object queryAll(Long teacherId) {
+    public Object queryAll(Integer teacherId) {
         return succeed(teacherSchoolService.findByTeacherId(teacherId));
     }
 

+ 126 - 0
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/union/NotifyMsg.java

@@ -0,0 +1,126 @@
+package com.ym.mec.thirdparty.union;
+
+import java.math.BigDecimal;
+
+/**
+ * 异步通知具体信息
+ */
+public class NotifyMsg {
+    private String mid;//商户号
+    private String tid;//终端号
+    private String instMid;//业务类型
+    private String billFunds;//资金渠道
+    private String billFundsDesc;//资金渠道说明
+    private Integer totalAmount;//订单总金额(分)
+    private String merOrderId;//商户订单号
+    private String payTime;//支付时间
+    private String seqId; //支付系统交易流水号
+    private String status; //交易状态,NEW_ORDER-新订单 UNKNOWN-不明交易状态 TRADE_CLOSED-关闭的交易 WAIT_BUYER_PAY-交易创建等待付款 TRADE_SUCCESS-交易成功
+    private String targetOrderId; //渠道订单号
+    private String targetSys;//支付渠道,WXPay,等
+    private String sign;//签名
+
+    public String getMid() {
+        return mid;
+    }
+
+    public void setMid(String mid) {
+        this.mid = mid;
+    }
+
+    public String getTid() {
+        return tid;
+    }
+
+    public void setTid(String tid) {
+        this.tid = tid;
+    }
+
+    public String getInstMid() {
+        return instMid;
+    }
+
+    public void setInstMid(String instMid) {
+        this.instMid = instMid;
+    }
+
+    public String getBillFunds() {
+        return billFunds;
+    }
+
+    public void setBillFunds(String billFunds) {
+        this.billFunds = billFunds;
+    }
+
+    public String getBillFundsDesc() {
+        return billFundsDesc;
+    }
+
+    public void setBillFundsDesc(String billFundsDesc) {
+        this.billFundsDesc = billFundsDesc;
+    }
+
+    public Integer getTotalAmount() {
+        return totalAmount;
+    }
+
+    public void setTotalAmount(Integer totalAmount) {
+        this.totalAmount = totalAmount;
+    }
+
+    public String getMerOrderId() {
+        return merOrderId;
+    }
+
+    public void setMerOrderId(String merOrderId) {
+        this.merOrderId = merOrderId;
+    }
+
+    public String getPayTime() {
+        return payTime;
+    }
+
+    public void setPayTime(String payTime) {
+        this.payTime = payTime;
+    }
+
+    public String getSeqId() {
+        return seqId;
+    }
+
+    public void setSeqId(String seqId) {
+        this.seqId = seqId;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getTargetOrderId() {
+        return targetOrderId;
+    }
+
+    public void setTargetOrderId(String targetOrderId) {
+        this.targetOrderId = targetOrderId;
+    }
+
+    public String getTargetSys() {
+        return targetSys;
+    }
+
+    public void setTargetSys(String targetSys) {
+        this.targetSys = targetSys;
+    }
+
+    public String getSign() {
+        return sign;
+    }
+
+    public void setSign(String sign) {
+        this.sign = sign;
+    }
+}

+ 10 - 0
mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java

@@ -168,4 +168,14 @@ public class ClassGroupController extends BaseController {
         return succeed();
     }
 
+
+    @ApiOperation(value = "合并班级")
+    @PostMapping("/mergeClassGroup")
+    @ApiImplicitParams({@ApiImplicitParam(name = "classGroupIds", value = "班级编号,号分割", required = true, dataType = "String")})
+    public HttpResponseResult mergeClassGroup(String classGroupIds) throws Exception {
+        //软删除班级
+
+        return succeed();
+    }
+
 }

+ 54 - 0
mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleRewardsRulesController.java

@@ -0,0 +1,54 @@
+package com.ym.mec.web.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.ym.mec.biz.dal.entity.CourseScheduleRewardsRules;
+import com.ym.mec.biz.service.CourseScheduleRewardsRulesService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.page.QueryInfo;
+
+@RequestMapping("courseSchedule")
+@Api(tags = "课程奖励规则")
+@RestController
+public class CourseScheduleRewardsRulesController extends BaseController {
+
+	@Autowired
+	private CourseScheduleRewardsRulesService courseScheduleRewardsRulesService;
+
+	@ApiOperation(value = "查询规则列表")
+	@GetMapping("/queryPage")
+	public Object queryPage(QueryInfo queryInfo) {
+		return succeed(courseScheduleRewardsRulesService.queryPage(queryInfo));
+	}
+
+	@ApiOperation(value = "单查询")
+	@GetMapping("/query")
+	public Object query(Integer id) {
+		return succeed(courseScheduleRewardsRulesService.get(id));
+	}
+
+	@ApiOperation(value = "新增")
+	@PostMapping("/add")
+	public Object add(CourseScheduleRewardsRules courseScheduleRewardsRules) {
+		return succeed(courseScheduleRewardsRulesService.insert(courseScheduleRewardsRules));
+	}
+
+	@ApiOperation(value = "修改")
+	@PostMapping("/update")
+	public Object update(CourseScheduleRewardsRules courseScheduleRewardsRules) {
+		return succeed(courseScheduleRewardsRulesService.update(courseScheduleRewardsRules));
+	}
+
+	@ApiOperation(value = "删除")
+	@PostMapping("/delete")
+	public Object delete(Integer id) {
+		return succeed(courseScheduleRewardsRulesService.delete(id));
+	}
+}

+ 8 - 0
mec-web/src/main/java/com/ym/mec/web/controller/StudentRegistrationController.java

@@ -84,4 +84,12 @@ public class StudentRegistrationController extends BaseController {
         return succeed(studentRegistrationService.getNoClassStuBySubjectId(musicGroupId, actualSubjectId));
     }
 
+    @ApiOperation(value = "获取班级学生")
+    @GetMapping("/getClassStu")
+    @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "classGroupId", value = "班级id", required = true, dataType = "int")})
+    public Object getClassStu(String musicGroupId, int classGroupId) {
+        return succeed(studentRegistrationService.findClassGroupStu(musicGroupId, classGroupId));
+    }
+
 }

+ 6 - 2
mec-web/src/main/java/com/ym/mec/web/controller/SysConfigController.java

@@ -4,7 +4,9 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -30,8 +32,10 @@ public class SysConfigController extends BaseController {
 
 	@ApiOperation(value = "参数列表")
 	@GetMapping(value = "list")
-	public Object configList() {
-		List<SysConfig> configs = sysConfigService.findAll(null);
+	public Object configList(String group) {
+		Map<String,Object> params = new HashMap<String, Object>();
+		params.put("group", group);
+		List<SysConfig> configs = sysConfigService.findAll(params);
 		return succeed(configs);
 	}
 

+ 41 - 6
mec-web/src/main/java/com/ym/mec/web/controller/TaskController.java

@@ -5,20 +5,55 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.MusicGroupStudentFeeService;
+import com.ym.mec.biz.service.TeacherAttendanceService;
+import com.ym.mec.biz.service.VipGroupService;
 import com.ym.mec.common.controller.BaseController;
 
 @RequestMapping("task")
 @RestController
 public class TaskController extends BaseController {
-	
+
 	@Autowired
 	private MusicGroupStudentFeeService musicGroupStudentFeeService;
 
-    @GetMapping("/refreshPaymentFeeStatus")
-    //刷新付费状态
-    public void refreshPaymentFeeStatus() {
-    	musicGroupStudentFeeService.refreshPaymentFeeStatus();
-    }
+	@Autowired
+	private VipGroupService vipGroupService;
+
+	@Autowired
+	private CourseScheduleService courseScheduleService;
+	
+	@Autowired
+	private TeacherAttendanceService teacherAttendanceService;
+	
+	@GetMapping("/refreshPaymentFeeStatus")
+	// 刷新付费状态
+	public void refreshPaymentFeeStatus() {
+		musicGroupStudentFeeService.refreshPaymentFeeStatus();
+	}
+
+	@GetMapping("/vipGroupAwardedMonthlyRewards")
+	// vip课月度奖励
+	public void vipGroupAwardedMonthlyRewards() {
+		vipGroupService.awardedMonthlyRewards();
+	}
+
+	@GetMapping("/updateCourseScheduleToOverStatus")
+	// 更新课程状态至已结束
+	public void updateCourseScheduleToOverStatus() {
+		courseScheduleService.updateCourseScheduleToOverStatus();
+	}
+
+	@GetMapping("/pushNoSignInMessage")
+	// 推送未签到消息提醒
+	public void pushNoSignInMessage() {
+		courseScheduleService.pushNoSignInMessage();
+	}
 
+	@GetMapping("/pushNoSignOutMessage")
+	// 推送未签退消息提醒
+	public void pushNoSignOutMessage() {
+		teacherAttendanceService.pushNoSignOutMessage();
+	}
 }

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

@@ -33,7 +33,7 @@ public class TeacherVipSchoolController extends BaseController {
 
     @ApiOperation("根据教师编号获取教学点")
     @GetMapping(value = "/queryAll")
-    public Object queryAll(Long teacherId) {
+    public Object queryAll(Integer teacherId) {
         return succeed(teacherSchoolService.findByTeacherId(teacherId));
     }
 

+ 5 - 4
pom.xml

@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 
 	<groupId>com.ym</groupId>
@@ -298,7 +297,8 @@
 			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-resources-plugin</artifactId>
-				<configuration><encoding>UTF-8</encoding>
+				<configuration>
+          <encoding>UTF-8</encoding>
 					<!-- 过滤后缀为pem、pfx的证书文件 -->
 					<nonFilteredFileExtensions>
 						<nonFilteredFileExtension>cer</nonFilteredFileExtension>
@@ -331,5 +331,6 @@
 		<module>mec-teacher</module>
 		<module>mec-education</module>
 		<module>mec-biz</module>
-	</modules>
+	  <module>data_migration</module>
+  </modules>
 </project>