Browse Source

Merge branch 'online1' into merge_music_group

周箭河 4 years ago
parent
commit
f2e0b82e9d
77 changed files with 2047 additions and 323 deletions
  1. 11 0
      mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/entity/SysUser.java
  2. 41 0
      mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/enums/CertificateTypeEnum.java
  3. 1 1
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/web/controller/UserController.java
  4. 6 2
      mec-auth/mec-auth-server/src/main/resources/config/mybatis/SysUserMapper.xml
  5. 17 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java
  6. 64 47
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java
  7. 24 10
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/EmployeeDao.java
  8. 42 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/IndexDao.java
  9. 27 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderStudentDetailDao.java
  10. 6 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentCourseFeeDetailDao.java
  11. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java
  12. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDao.java
  13. 26 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java
  14. 62 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/IndexBaseDto.java
  15. 55 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/IndexBaseMonthDto.java
  16. 17 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MergeClassSplitClassAffirmDto.java
  17. 12 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentCalenderAuditDetailDto.java
  18. 24 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentCalenderDto.java
  19. 20 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/SimpleUserDto.java
  20. 4 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentRecoverInfoDto.java
  21. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalender.java
  22. 167 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalenderStudentDetail.java
  23. 22 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupStudentClassAdjust.java
  24. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRecoverDto.java
  25. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRegistration.java
  26. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/ClassGroupQueryInfo.java
  27. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/EmployeeQueryInfo.java
  28. 49 6
      mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupService.java
  29. 17 0
      mec-biz/src/main/java/com/ym/mec/biz/service/IndexService.java
  30. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderDetailService.java
  31. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderService.java
  32. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderStudentDetailService.java
  33. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupSubjectPlanService.java
  34. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentOrderService.java
  35. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java
  36. 283 24
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java
  37. 15 6
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ContractServiceImpl.java
  38. 15 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  39. 7 7
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java
  40. 41 16
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/EmployeeServiceImpl.java
  41. 113 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexServiceImpl.java
  42. 52 6
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java
  43. 64 58
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java
  44. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderStudentDetailServiceImpl.java
  45. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupSubjectPlanServiceImpl.java
  46. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java
  47. 26 6
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java
  48. 87 10
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  49. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServeServiceImpl.java
  50. 12 21
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  51. 5 3
      mec-biz/src/main/resources/config/contracts/product.ftl
  52. 50 21
      mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml
  53. 8 0
      mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml
  54. 6 6
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  55. 27 12
      mec-biz/src/main/resources/config/mybatis/EmployeeMapper.xml
  56. 77 0
      mec-biz/src/main/resources/config/mybatis/IndexMapper.xml
  57. 2 2
      mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml
  58. 1 1
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml
  59. 123 0
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderStudentDetailMapper.xml
  60. 7 2
      mec-biz/src/main/resources/config/mybatis/MusicGroupStudentClassAdjustMapper.xml
  61. 8 0
      mec-biz/src/main/resources/config/mybatis/StudentCourseFeeDetailMapper.xml
  62. 6 1
      mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml
  63. 1 0
      mec-biz/src/main/resources/config/mybatis/StudentMapper.xml
  64. 4 0
      mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml
  65. 16 2
      mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml
  66. 11 11
      mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml
  67. 0 2
      mec-common/common-core/src/main/java/com/ym/mec/common/entity/ImGroupMember.java
  68. 17 1
      mec-common/common-core/src/main/java/com/ym/mec/common/entity/ImGroupModel.java
  69. 4 0
      mec-common/common-core/src/main/java/com/ym/mec/common/page/PageInfo.java
  70. 0 6
      mec-im/src/main/java/com/ym/service/Impl/GroupServiceImpl.java
  71. 1 1
      mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java
  72. 12 3
      mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java
  73. 1 1
      mec-thirdparty/src/main/java/com/ym/mec/thirdparty/adapay/Payment.java
  74. 59 2
      mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java
  75. 2 2
      mec-web/src/main/java/com/ym/mec/web/controller/EmployeeController.java
  76. 36 0
      mec-web/src/main/java/com/ym/mec/web/controller/IndexController.java
  77. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/VipGroupManageController.java

+ 11 - 0
mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/entity/SysUser.java

@@ -1,5 +1,6 @@
 package com.ym.mec.auth.api.entity;
 package com.ym.mec.auth.api.entity;
 
 
+import com.ym.mec.auth.api.enums.CertificateTypeEnum;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
@@ -130,6 +131,16 @@ public class SysUser implements Serializable{
 	@ApiModelProperty(value = "邮编",required = false)
 	@ApiModelProperty(value = "邮编",required = false)
 	private String postalCode;
 	private String postalCode;
 
 
+	private String certificateType;
+
+	public String getCertificateType() {
+		return certificateType;
+	}
+
+	public void setCertificateType(String certificateType) {
+		this.certificateType = certificateType;
+	}
+
 	public Integer getServiceTag() {
 	public Integer getServiceTag() {
 		return serviceTag;
 		return serviceTag;
 	}
 	}

+ 41 - 0
mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/enums/CertificateTypeEnum.java

@@ -0,0 +1,41 @@
+package com.ym.mec.auth.api.enums;
+
+import com.ym.mec.common.enums.BaseEnum;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/1/6 0006
+ **/
+public enum CertificateTypeEnum implements BaseEnum<String, CertificateTypeEnum> {
+
+    IDENTITY("IDENTITY", "身份证"),
+    HK_MAC("HK_MAC", "港澳居民往来内地通行证"),
+    TAIWAN("TAIWAN", "台湾居民往来内地通行证"),
+    FOREIGN_PASSPORT("FOREIGN_PASSPORT", "外国护照");
+
+    private String code;
+
+    private String msg;
+
+    CertificateTypeEnum(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    @Override
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+}

+ 1 - 1
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/web/controller/UserController.java

@@ -243,7 +243,7 @@ public class UserController extends BaseController {
 				throw new BizException("出生日期不可超过当前时间");
 				throw new BizException("出生日期不可超过当前时间");
 			}
 			}
 
 
-			if(!debugMode){
+			if(!debugMode&&StringUtils.isNotBlank(sysUser.getCertificateType())&&"IDENTITY".equals(sysUser.getCertificateType())){
 				realnameAuthenticationPluginContext.getRealnameAuthenticationPlugin(LinkfaceRealnameAuthenticationPlugin.getName()).verify(sysUser.getRealName(), sysUser.getIdCardNo());
 				realnameAuthenticationPluginContext.getRealnameAuthenticationPlugin(LinkfaceRealnameAuthenticationPlugin.getName()).verify(sysUser.getRealName(), sysUser.getIdCardNo());
 			}
 			}
 
 

+ 6 - 2
mec-auth/mec-auth-server/src/main/resources/config/mybatis/SysUserMapper.xml

@@ -32,6 +32,7 @@
         <result column="is_super_admin_" property="isSuperAdmin"/>
         <result column="is_super_admin_" property="isSuperAdmin"/>
         <result column="current_grade_" property="currentGrade"/>
         <result column="current_grade_" property="currentGrade"/>
         <result column="current_class_" property="currentClass"/>
         <result column="current_class_" property="currentClass"/>
+        <result column="certificate_type_" property="certificateType"/>
     </resultMap>
     </resultMap>
 
 
     <!-- 查询条件 -->
     <!-- 查询条件 -->
@@ -67,9 +68,9 @@
             keyProperty="id">
             keyProperty="id">
         INSERT INTO sys_user
         INSERT INTO sys_user
         (is_super_admin_,im_token_,id_,username_,salt_,phone_,avatar_,organ_id_,create_time_,update_time_,wx_openid_,qq_openid_,user_type_,
         (is_super_admin_,im_token_,id_,username_,salt_,phone_,avatar_,organ_id_,create_time_,update_time_,wx_openid_,qq_openid_,user_type_,
-        gender_,nation_,birthdate_,email_,id_card_no_,wechat_id_,real_name_)
+        gender_,nation_,birthdate_,email_,id_card_no_,wechat_id_,real_name_,certificate_type_)
         VALUES(#{isSuperAdmin},#{imToken},#{id},#{username},#{salt},#{phone},#{avatar},#{organId},now(),now(),#{wxOpenid},#{qqOpenid},#{userType},
         VALUES(#{isSuperAdmin},#{imToken},#{id},#{username},#{salt},#{phone},#{avatar},#{organId},now(),now(),#{wxOpenid},#{qqOpenid},#{userType},
-        #{gender},#{nation},#{birthdate},#{email},#{idCardNo},#{wechatId},#{realName})
+        #{gender},#{nation},#{birthdate},#{email},#{idCardNo},#{wechatId},#{realName},#{certificateType})
     </insert>
     </insert>
     <insert id="insertTeacher">
     <insert id="insertTeacher">
         INSERT INTO teacher
         INSERT INTO teacher
@@ -151,6 +152,9 @@
             <if test="isSuperAdmin != null">
             <if test="isSuperAdmin != null">
                 is_super_admin_ = #{isSuperAdmin},
                 is_super_admin_ = #{isSuperAdmin},
             </if>
             </if>
+            <if test="certificateType != null">
+                certificate_type_ = #{certificateType},
+            </if>
         </set>
         </set>
         WHERE id_ = #{id}
         WHERE id_ = #{id}
     </update>
     </update>

+ 17 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java

@@ -240,7 +240,7 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
      * @param userId
      * @param userId
      * @return
      * @return
      */
      */
-    List<ImGroupModel> queryEducationGroups(@Param("userId") Integer userId, @Param("organId") Integer organId);
+    List<ImGroupModel> queryEducationGroups(@Param("transferUserId") Integer transferUserId, @Param("userId") Integer userId, @Param("organId") Integer organId);
 
 
     /**
     /**
      * 获取运营主管关联的群列表
      * 获取运营主管关联的群列表
@@ -248,7 +248,7 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
      * @param userId
      * @param userId
      * @return
      * @return
      */
      */
-    List<ImGroupModel> queryTeamTeacherGroups(@Param("userId") Integer userId, @Param("organId") Integer organId);
+    List<ImGroupModel> queryTeamTeacherGroups(@Param("transferUserId") Integer transferUserId, @Param("userId") Integer userId, @Param("organId") Integer organId);
 
 
     /**
     /**
      * 获取乐队指导关联的群列表
      * 获取乐队指导关联的群列表
@@ -256,7 +256,7 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
      * @param userId
      * @param userId
      * @return
      * @return
      */
      */
-    List<ImGroupModel> queryDirectorGroups(@Param("userId") Integer userId, @Param("organId") Integer organId);
+    List<ImGroupModel> queryDirectorGroups(@Param("transferUserId") Integer transferUserId, @Param("userId") Integer userId, @Param("organId") Integer organId);
 
 
     /**
     /**
      * 获取未分配合奏的单技班列表
      * 获取未分配合奏的单技班列表
@@ -792,4 +792,18 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
      * @return
      * @return
      */
      */
     Integer getMusicGroupHighClassNumBySubject(@Param("musicGroupId") String musicGroupId, @Param("subjectIds") String subjectIds, @Param("type") ClassGroupTypeEnum type);
     Integer getMusicGroupHighClassNumBySubject(@Param("musicGroupId") String musicGroupId, @Param("subjectIds") String subjectIds, @Param("type") ClassGroupTypeEnum type);
+
+    /**
+     * count班级数量
+     * @param params
+     * @return
+     */
+    int countClassGroup(Map<String, Object> params);
+
+    /**
+     * 获取班级列表
+     * @param params
+     * @return
+     */
+    List<ClassGroupTeachersDto> queryClassGroupPage(Map<String, Object> params);
 }
 }

+ 64 - 47
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java

@@ -17,6 +17,7 @@ import java.util.Map;
 public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStudentMapper> {
 public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStudentMapper> {
 
 
     int batchUpdate(@Param("classGroupStudentMappers") List<ClassGroupStudentMapper> classGroupStudentMappers);
     int batchUpdate(@Param("classGroupStudentMappers") List<ClassGroupStudentMapper> classGroupStudentMappers);
+
     /**
     /**
      * 批量插入学生
      * 批量插入学生
      *
      *
@@ -35,12 +36,12 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
     ClassGroupStudentMapper query(@Param("classGroupId") int classGroupId, @Param("userId") Integer userId);
     ClassGroupStudentMapper query(@Param("classGroupId") int classGroupId, @Param("userId") Integer userId);
 
 
     /**
     /**
+     * @param classGroupId: 班级编号
+     * @param userId:       学员编号
+     * @return com.ym.mec.biz.dal.entity.ClassGroupStudentMapper
      * @describe 获取班级上的学员
      * @describe 获取班级上的学员
      * @author Joburgess
      * @author Joburgess
      * @date 2019/12/18
      * @date 2019/12/18
-     * @param classGroupId: 班级编号
-     * @param userId: 学员编号
-     * @return com.ym.mec.biz.dal.entity.ClassGroupStudentMapper
      */
      */
     ClassGroupStudentMapper findClassGroupStudent(@Param("classGroupId") int classGroupId, @Param("userId") Integer userId);
     ClassGroupStudentMapper findClassGroupStudent(@Param("classGroupId") int classGroupId, @Param("userId") Integer userId);
 
 
@@ -61,26 +62,26 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
     void deleteByClassId(Integer classGroupId);
     void deleteByClassId(Integer classGroupId);
 
 
     /**
     /**
-     * @describe 根据团体删除班上的学生
-     * @author Joburgess
-     * @date 2020/2/17
      * @param groupId:
      * @param groupId:
      * @param groupType:
      * @param groupType:
      * @return int
      * @return int
+     * @describe 根据团体删除班上的学生
+     * @author Joburgess
+     * @date 2020/2/17
      */
      */
     int deleteByGroup(@Param("groupId") String groupId,
     int deleteByGroup(@Param("groupId") String groupId,
                       @Param("groupType") GroupType groupType);
                       @Param("groupType") GroupType groupType);
 
 
     /**
     /**
-     * @describe 根据团体删除班上的学生-退学
-     * @author Joburgess
-     * @date 2020/2/17
      * @param groupId:
      * @param groupId:
      * @param groupType:
      * @param groupType:
      * @return int
      * @return int
+     * @describe 根据团体删除班上的学生-退学
+     * @author Joburgess
+     * @date 2020/2/17
      */
      */
     int deleteByGroupWithLogic(@Param("groupId") String groupId,
     int deleteByGroupWithLogic(@Param("groupId") String groupId,
-                      @Param("groupType") GroupType groupType);
+                               @Param("groupType") GroupType groupType);
 
 
     /**
     /**
      * @return int
      * @return int
@@ -102,7 +103,7 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
 
 
     int deleteClassGroupStudent(@Param("classGroupId") Long classGroupId, @Param("userId") Integer userId);
     int deleteClassGroupStudent(@Param("classGroupId") Long classGroupId, @Param("userId") Integer userId);
 
 
-  /**
+    /**
      * @param classGroupId: 班级编号
      * @param classGroupId: 班级编号
      * @return java.lang.String[]
      * @return java.lang.String[]
      * @describe 根据班级编号获取班级学生名称列表
      * @describe 根据班级编号获取班级学生名称列表
@@ -112,20 +113,20 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
     String[] findStudentNumByClassGroupId(@Param("classGroupId") Integer classGroupId);
     String[] findStudentNumByClassGroupId(@Param("classGroupId") Integer classGroupId);
 
 
     /**
     /**
+     * @param courseScheduleId:
+     * @return java.lang.String[]
      * @describe 获取课程上的学员名称集合
      * @describe 获取课程上的学员名称集合
      * @author Joburgess
      * @author Joburgess
      * @date 2019/12/4
      * @date 2019/12/4
-     * @param courseScheduleId:
-     * @return java.lang.String[]
      */
      */
     String[] findCourseStudentName(@Param("courseScheduleId") Integer courseScheduleId);
     String[] findCourseStudentName(@Param("courseScheduleId") Integer courseScheduleId);
 
 
     /**
     /**
+     * @param courseScheduleId:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.StudentNameAndPhoneDto>
      * @describe 获取课程上的学员名称和电话
      * @describe 获取课程上的学员名称和电话
      * @author Joburgess
      * @author Joburgess
      * @date 2020/2/16
      * @date 2020/2/16
-     * @param courseScheduleId:
-     * @return java.util.List<com.ym.mec.biz.dal.dto.StudentNameAndPhoneDto>
      */
      */
     List<StudentNameAndPhoneDto> findCourseStudentNameAndPhone(@Param("courseScheduleId") Integer courseScheduleId);
     List<StudentNameAndPhoneDto> findCourseStudentNameAndPhone(@Param("courseScheduleId") Integer courseScheduleId);
 
 
@@ -185,22 +186,22 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
     List<ClassGroupStudentMapper> findByClassGroups(@Param("classGroupIds") List<Integer> classGroupIds);
     List<ClassGroupStudentMapper> findByClassGroups(@Param("classGroupIds") List<Integer> classGroupIds);
 
 
     /**
     /**
-     * @describe 获取团体学员
-     * @author Joburgess
-     * @date 2020/3/8
      * @param groupIds:
      * @param groupIds:
      * @param groupType:
      * @param groupType:
      * @return java.util.List<com.ym.mec.biz.dal.entity.ClassGroupStudentMapper>
      * @return java.util.List<com.ym.mec.biz.dal.entity.ClassGroupStudentMapper>
+     * @describe 获取团体学员
+     * @author Joburgess
+     * @date 2020/3/8
      */
      */
     List<ClassGroupStudentMapper> findByGroups(@Param("groupIds") List<String> groupIds,
     List<ClassGroupStudentMapper> findByGroups(@Param("groupIds") List<String> groupIds,
                                                @Param("groupType") GroupType groupType);
                                                @Param("groupType") GroupType groupType);
 
 
     /**
     /**
+     * @param classGroupId:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.ClassGroupStudentMapper>
      * @describe 获取指定班级的所有学员
      * @describe 获取指定班级的所有学员
      * @author Joburgess
      * @author Joburgess
      * @date 2020.11.04
      * @date 2020.11.04
-     * @param classGroupId:
-     * @return java.util.List<com.ym.mec.biz.dal.entity.ClassGroupStudentMapper>
      */
      */
     List<ClassGroupStudentMapper> findAllByClassGroup(@Param("classGroupId") Long classGroupId);
     List<ClassGroupStudentMapper> findAllByClassGroup(@Param("classGroupId") Long classGroupId);
 
 
@@ -214,17 +215,17 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
     List<ClassGroupStudentMapper> findByClassGroup(@Param("classGroupId") Integer classGroupId);
     List<ClassGroupStudentMapper> findByClassGroup(@Param("classGroupId") Integer classGroupId);
 
 
     /**
     /**
-     * @describe 获取团体或者班级上的学员
-     * @author Joburgess
-     * @date 2020/3/10
      * @param groupId:
      * @param groupId:
      * @param groupType:
      * @param groupType:
      * @param classGroupId:
      * @param classGroupId:
      * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>
      * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>
+     * @describe 获取团体或者班级上的学员
+     * @author Joburgess
+     * @date 2020/3/10
      */
      */
     List<ClassGroupStudentInfoDto> findByGroupOrClassGroup(@Param("groupId") String groupId,
     List<ClassGroupStudentInfoDto> findByGroupOrClassGroup(@Param("groupId") String groupId,
-                                               @Param("groupType") GroupType groupType,
-                                               @Param("classGroupId") Integer classGroupId);
+                                                           @Param("groupType") GroupType groupType,
+                                                           @Param("classGroupId") Integer classGroupId);
 
 
     /**
     /**
      * 查询班级某状态下所有的学生
      * 查询班级某状态下所有的学生
@@ -266,10 +267,10 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
      * @date 2019/11/21
      * @date 2019/11/21
      */
      */
     List<Map<Integer, Integer>> countClassGroupsStudentNum(@Param("classGroupIds") List<Integer> classGroupIds,
     List<Map<Integer, Integer>> countClassGroupsStudentNum(@Param("classGroupIds") List<Integer> classGroupIds,
-                                                           @Param("status")ClassGroupStudentStatusEnum status);
+                                                           @Param("status") ClassGroupStudentStatusEnum status);
 
 
     List<Map<String, Integer>> countGroupAllStudentNum(@Param("groupIds") List<String> groupIds,
     List<Map<String, Integer>> countGroupAllStudentNum(@Param("groupIds") List<String> groupIds,
-                                                        @Param("groupType") GroupType groupType);
+                                                       @Param("groupType") GroupType groupType);
 
 
     /**
     /**
      * @param classGroupId: 班级编号
      * @param classGroupId: 班级编号
@@ -281,32 +282,32 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
     Integer countClassGroupStudentNum(@Param("classGroupId") Integer classGroupId);
     Integer countClassGroupStudentNum(@Param("classGroupId") Integer classGroupId);
 
 
     /**
     /**
+     * @param classGroupId:
+     * @return java.lang.Integer
      * @describe 统计班级上学生人数,
      * @describe 统计班级上学生人数,
      * @author Joburgess
      * @author Joburgess
      * @date 2019/12/26
      * @date 2019/12/26
-     * @param classGroupId:
-     * @return java.lang.Integer
      */
      */
     Integer countClassGroupNormalStudentNum(@Param("classGroupId") Integer classGroupId);
     Integer countClassGroupNormalStudentNum(@Param("classGroupId") Integer classGroupId);
 
 
     /**
     /**
-     * @describe 统计课程组上状态正常的学员数量
-     * @author Joburgess
-     * @date 2020.08.05
      * @param groupType:
      * @param groupType:
      * @param groupId:
      * @param groupId:
      * @return int
      * @return int
+     * @describe 统计课程组上状态正常的学员数量
+     * @author Joburgess
+     * @date 2020.08.05
      */
      */
     int countGroupNormalStudentNum(@Param("groupType") GroupType groupType,
     int countGroupNormalStudentNum(@Param("groupType") GroupType groupType,
                                    @Param("groupId") String groupId);
                                    @Param("groupId") String groupId);
 
 
     /**
     /**
-     * @describe 统计vip课或乐团下的学生人数
-     * @author Joburgess
-     * @date 2019/12/14
      * @param groupId:
      * @param groupId:
      * @param groupType:
      * @param groupType:
      * @return java.lang.Integer
      * @return java.lang.Integer
+     * @describe 统计vip课或乐团下的学生人数
+     * @author Joburgess
+     * @date 2019/12/14
      */
      */
     Integer countGroupStudentNum(@Param("groupId") String groupId,
     Integer countGroupStudentNum(@Param("groupId") String groupId,
                                  @Param("groupType") String groupType);
                                  @Param("groupType") String groupType);
@@ -345,6 +346,7 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
 
 
     /**
     /**
      * 查询乐团某种类型班级的学生
      * 查询乐团某种类型班级的学生
+     *
      * @param musicGroupId
      * @param musicGroupId
      * @param classGroupType
      * @param classGroupType
      * @return
      * @return
@@ -353,6 +355,7 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
 
 
     /**
     /**
      * 获取vip课所有学员列表
      * 获取vip课所有学员列表
+     *
      * @param vipGroupId
      * @param vipGroupId
      * @return
      * @return
      */
      */
@@ -360,50 +363,52 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
 
 
     /**
     /**
      * 获取vip课所有教师列表
      * 获取vip课所有教师列表
+     *
      * @param vipGroupId
      * @param vipGroupId
      * @return
      * @return
      */
      */
     List<Map<Integer, String>> queryTeacherIdMap(Long vipGroupId);
     List<Map<Integer, String>> queryTeacherIdMap(Long vipGroupId);
 
 
     /**
     /**
+     * @param classGroupId: 班级编号
+     * @param userIds:      学生编号列表
+     * @return java.util.List<com.ym.mec.biz.dal.entity.ClassGroupStudentMapper>
      * @describe 根据班级和学生编号获取关联记录
      * @describe 根据班级和学生编号获取关联记录
      * @author Joburgess
      * @author Joburgess
      * @date 2019/12/8
      * @date 2019/12/8
-     * @param classGroupId: 班级编号
-     * @param userIds: 学生编号列表
-     * @return java.util.List<com.ym.mec.biz.dal.entity.ClassGroupStudentMapper>
      */
      */
     List<ClassGroupStudentMapper> findByClassGroupAndStudent(@Param("classGroupId") Integer classGroupId,
     List<ClassGroupStudentMapper> findByClassGroupAndStudent(@Param("classGroupId") Integer classGroupId,
                                                              @Param("userIds") List<Integer> userIds);
                                                              @Param("userIds") List<Integer> userIds);
 
 
     /**
     /**
+     * @param groupId:   编号
+     * @param groupType: 类型
+     * @param status:    状态
+     * @return int
      * @describe 批量更新指定乐团或小课下学员状态
      * @describe 批量更新指定乐团或小课下学员状态
      * @author Joburgess
      * @author Joburgess
      * @date 2019/12/10
      * @date 2019/12/10
-     * @param groupId: 编号
-     * @param groupType: 类型
-     * @param status: 状态
-     * @return int
      */
      */
     int updateVipGroupStudentStatus(@Param("groupId") String groupId,
     int updateVipGroupStudentStatus(@Param("groupId") String groupId,
                                     @Param("groupType") String groupType,
                                     @Param("groupType") String groupType,
                                     @Param("status") String status);
                                     @Param("status") String status);
-    
+
     /**
     /**
      * 查询这节课的新学生
      * 查询这节课的新学生
+     *
      * @param courseScheduleId
      * @param courseScheduleId
      * @return
      * @return
      */
      */
     List<ClassGroupStudentMapper> queryNewStudentListByCourseScheduleId(Long courseScheduleId);
     List<ClassGroupStudentMapper> queryNewStudentListByCourseScheduleId(Long courseScheduleId);
 
 
     /**
     /**
-     * @describe 获取课程组上的学生
-     * @author Joburgess
-     * @date 2020/3/11
      * @param groupId:
      * @param groupId:
      * @param groupType:
      * @param groupType:
      * @param userId:
      * @param userId:
      * @return java.util.List<com.ym.mec.biz.dal.entity.ClassGroupStudentMapper>
      * @return java.util.List<com.ym.mec.biz.dal.entity.ClassGroupStudentMapper>
+     * @describe 获取课程组上的学生
+     * @author Joburgess
+     * @date 2020/3/11
      */
      */
     List<ClassGroupStudentMapper> findGroupStudents(@Param("groupId") String groupId,
     List<ClassGroupStudentMapper> findGroupStudents(@Param("groupId") String groupId,
                                                     @Param("groupType") GroupType groupType,
                                                     @Param("groupType") GroupType groupType,
@@ -412,6 +417,7 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
 
 
     /**
     /**
      * 获取学员教务老师
      * 获取学员教务老师
+     *
      * @param studentIds
      * @param studentIds
      * @return
      * @return
      */
      */
@@ -419,6 +425,7 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
 
 
     /**
     /**
      * 是否在指定的班级
      * 是否在指定的班级
+     *
      * @param classGroupIdListStr
      * @param classGroupIdListStr
      * @return
      * @return
      */
      */
@@ -426,8 +433,18 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
 
 
     /**
     /**
      * 获取班级里学员列表
      * 获取班级里学员列表
-     * @author zouxuan
+     *
      * @param classGroupId
      * @param classGroupId
+     * @author zouxuan
      */
      */
     List<StudentNameAndPhoneDto> findCourseStudentNameAndPhoneByClassGroupId(Integer classGroupId);
     List<StudentNameAndPhoneDto> findCourseStudentNameAndPhoneByClassGroupId(Integer classGroupId);
+
+    /**
+     * //主班是否包含所选学员学员
+     *
+     * @param masterClassGroupId
+     * @param studentIds
+     * @return
+     */
+    Boolean hasStudent(@Param("masterClassGroupId") Integer masterClassGroupId, @Param("studentIds") List<Integer> studentIds);
 }
 }

+ 24 - 10
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/EmployeeDao.java

@@ -19,17 +19,18 @@ public interface EmployeeDao extends BaseDAO<Integer, Employee> {
      * @Date: 2019/9/17
      * @Date: 2019/9/17
      * 根据部门获取下面的员工
      * 根据部门获取下面的员工
      */
      */
-    List<EmployeeDto> queryEmployByOrganId(Map<String,Object> params);
+    List<EmployeeDto> queryEmployByOrganId(Map<String, Object> params);
 
 
     /**
     /**
      * @Author: Joburgess
      * @Author: Joburgess
      * @Date: 2019/9/17
      * @Date: 2019/9/17
      * 部门员工统计
      * 部门员工统计
      */
      */
-    int queryEmployByOrganIdCount(Map<String,Object> params);
+    int queryEmployByOrganIdCount(Map<String, Object> params);
 
 
     /**
     /**
      * 修改密码
      * 修改密码
+     *
      * @param userID
      * @param userID
      * @param password
      * @param password
      */
      */
@@ -51,8 +52,10 @@ public interface EmployeeDao extends BaseDAO<Integer, Employee> {
      * 修改用户离职日期
      * 修改用户离职日期
      */
      */
     int updateUserDemissionDate(@Param("userID") Integer userID);
     int updateUserDemissionDate(@Param("userID") Integer userID);
+
     /**
     /**
      * 根据手机号查询对象
      * 根据手机号查询对象
+     *
      * @param phone
      * @param phone
      * @return
      * @return
      */
      */
@@ -60,46 +63,50 @@ public interface EmployeeDao extends BaseDAO<Integer, Employee> {
 
 
     /**
     /**
      * 删除用户角色
      * 删除用户角色
+     *
      * @param userId
      * @param userId
      */
      */
     void delEmployeeRole(Integer userId);
     void delEmployeeRole(Integer userId);
 
 
     /**
     /**
      * 批量新增用户角色
      * 批量新增用户角色
+     *
      * @param id
      * @param id
      * @param roleIds
      * @param roleIds
      */
      */
-    void batchAddEmployeeRole(@Param("userId") Integer id, @Param("roleIds")List<Integer> roleIds);
+    void batchAddEmployeeRole(@Param("userId") Integer id, @Param("roleIds") List<Integer> roleIds);
 
 
     /**
     /**
      * 获取用户权限列表
      * 获取用户权限列表
+     *
      * @param userId
      * @param userId
      * @return
      * @return
      */
      */
     List<Integer> queryUserRole(Integer userId);
     List<Integer> queryUserRole(Integer userId);
 
 
     /**
     /**
+     * @param roleIds:  角色编号列表
+     * @param organIds: 部门编号列表
+     * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>
      * @describe 根据角色和用户查找用户
      * @describe 根据角色和用户查找用户
      * @author Joburgess
      * @author Joburgess
      * @date 2020/3/12
      * @date 2020/3/12
-     * @param roleIds: 角色编号列表
-     * @param organIds: 部门编号列表
-     * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>
      */
      */
     List<SimpleUserDto> findByRole(@Param("roleIds") String roleIds,
     List<SimpleUserDto> findByRole(@Param("roleIds") String roleIds,
                                    @Param("organIds") String organIds);
                                    @Param("organIds") String organIds);
 
 
     /**
     /**
+     * @param userIds:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>
      * @describe 根据用户编号获取用户
      * @describe 根据用户编号获取用户
      * @author Joburgess
      * @author Joburgess
      * @date 2020/3/12
      * @date 2020/3/12
-     * @param userIds:
-     * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>
      */
      */
     List<SimpleUserDto> findByIds(@Param("userIds") List<Integer> userIds);
     List<SimpleUserDto> findByIds(@Param("userIds") List<Integer> userIds);
 
 
     /**
     /**
      * 是否有课程组关联的教务老师
      * 是否有课程组关联的教务老师
+     *
      * @param employeeId
      * @param employeeId
      * @return
      * @return
      */
      */
@@ -107,13 +114,15 @@ public interface EmployeeDao extends BaseDAO<Integer, Employee> {
 
 
     /**
     /**
      * 修改知道老师的教务老师关联
      * 修改知道老师的教务老师关联
+     *
      * @param currentUserId
      * @param currentUserId
      * @param targetUserId
      * @param targetUserId
      */
      */
     void updateEducationTeacherId(@Param("currentUserId") Integer currentUserId, @Param("targetUserId") Integer targetUserId);
     void updateEducationTeacherId(@Param("currentUserId") Integer currentUserId, @Param("targetUserId") Integer targetUserId);
 
 
     /**
     /**
-     *是否有未上的课
+     * 是否有未上的课
+     *
      * @param employeeId
      * @param employeeId
      * @return
      * @return
      */
      */
@@ -121,6 +130,7 @@ public interface EmployeeDao extends BaseDAO<Integer, Employee> {
 
 
     /**
     /**
      * 获取维修技师所在分部
      * 获取维修技师所在分部
+     *
      * @param userId
      * @param userId
      * @return
      * @return
      */
      */
@@ -128,6 +138,7 @@ public interface EmployeeDao extends BaseDAO<Integer, Employee> {
 
 
     /**
     /**
      * 教务老师所在分部列表
      * 教务老师所在分部列表
+     *
      * @param userId
      * @param userId
      * @return
      * @return
      */
      */
@@ -135,6 +146,7 @@ public interface EmployeeDao extends BaseDAO<Integer, Employee> {
 
 
     /**
     /**
      * 运营主管所在分部列表
      * 运营主管所在分部列表
+     *
      * @param userId
      * @param userId
      * @return
      * @return
      */
      */
@@ -142,6 +154,7 @@ public interface EmployeeDao extends BaseDAO<Integer, Employee> {
 
 
     /**
     /**
      * 乐队指导所在分部列表
      * 乐队指导所在分部列表
+     *
      * @param userId
      * @param userId
      * @return
      * @return
      */
      */
@@ -149,7 +162,8 @@ public interface EmployeeDao extends BaseDAO<Integer, Employee> {
 
 
     /**
     /**
      * 员工离职
      * 员工离职
+     *
      * @param employeeLevelDtos
      * @param employeeLevelDtos
      */
      */
-    void employeeLevel(List<EmployeeLevelDto> employeeLevelDtos);
+    void employeeLevel(@Param("employeeLevelDtos") List<EmployeeLevelDto> employeeLevelDtos);
 }
 }

+ 42 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/IndexDao.java

@@ -0,0 +1,42 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.dto.IndexBaseMonthDto;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/1/7 0007
+ **/
+public interface IndexDao {
+
+    /**
+     * @describe 统计系统中指定时间段的学员注册数据
+     * @author Joburgess
+     * @date 2021/1/7 0007
+     * @param organIds:
+     * @param startMonth:
+     * @param endMonth:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.IndexBaseMonthDto>
+     */
+    List<IndexBaseMonthDto> getStudentSignUpData(@Param("organIds") Set<Integer> organIds,
+                                                 @Param("startMonth") String startMonth,
+                                                 @Param("endMonth") String endMonth);
+
+    /**
+     * @describe 统计作业布置数据
+     * @author Joburgess
+     * @date 2021/1/7 0007
+     * @param organIds:
+     * @param startMonth:
+     * @param endMonth:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.IndexBaseMonthDto>
+     */
+    List<IndexBaseMonthDto> getHomeworkDate(@Param("organIds") Set<Integer> organIds,
+                                                  @Param("startMonth") String startMonth,
+                                                  @Param("endMonth") String endMonth,
+                                                  @Param("type") String type);
+
+}

+ 27 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderStudentDetailDao.java

@@ -0,0 +1,27 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
+import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface MusicGroupPaymentCalenderStudentDetailDao extends BaseDAO<Integer, MusicGroupPaymentCalenderStudentDetail> {
+
+    void batchInsert(@Param("musicGroupPaymentCalenderStudentDetails") List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails, @Param("batchNo") String batchNo);
+
+    void batchUpdate(@Param("musicGroupPaymentCalenderStudentDetails") List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails);
+
+    /**
+     * 根据批次号获取缴费详情
+     * @param batchNo
+     * @return
+     */
+    List<MusicGroupPaymentCalenderStudentDetail> findByBatchNo(String batchNo);
+
+    /**
+     * 根据批次号删除
+     * @param batchNo
+     */
+    void delByBatchNo(String batchNo);
+}

+ 6 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentCourseFeeDetailDao.java

@@ -1,10 +1,13 @@
 package com.ym.mec.biz.dal.dao;
 package com.ym.mec.biz.dal.dao;
 
 
-import com.ym.mec.biz.dal.entity.CourseHomework;
 import com.ym.mec.biz.dal.entity.StudentCourseFeeDetail;
 import com.ym.mec.biz.dal.entity.StudentCourseFeeDetail;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
 
 
-public interface StudentCourseFeeDetailDao extends BaseDAO<Long, StudentCourseFeeDetail>{
+import java.util.List;
 
 
-	
+public interface StudentCourseFeeDetailDao extends BaseDAO<Long, StudentCourseFeeDetail> {
+
+
+    void batchInsert(@Param("studentCourseFeeDetails") List<StudentCourseFeeDetail> studentCourseFeeDetails);
 }
 }

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

@@ -98,6 +98,7 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
     List<StudentServeCourseDto> getServeStudentCourseStartTimes(@Param("monday") String monday);
     List<StudentServeCourseDto> getServeStudentCourseStartTimes(@Param("monday") String monday);
 
 
     List<StudentServeCourseDto> getStudentFutureCourseInfo(@Param("monday") String monday,
     List<StudentServeCourseDto> getStudentFutureCourseInfo(@Param("monday") String monday,
+                                                           @Param("nextMonday") String nextMonday,
                                                            @Param("studentIds") List<Integer> studentIds);
                                                            @Param("studentIds") List<Integer> studentIds);
 
 
     /**
     /**

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDao.java

@@ -383,9 +383,19 @@ public interface StudentPaymentOrderDao extends BaseDAO<Long, StudentPaymentOrde
 
 
     /**
     /**
      * 获取学生的报名订单
      * 获取学生的报名订单
+     *
      * @param userId
      * @param userId
      * @param musicGroupId
      * @param musicGroupId
      * @return
      * @return
      */
      */
     List<StudentPaymentOrderExportDto> getUserApplyOrders(@Param("userId") Integer userId, @Param("musicGroupId") String musicGroupId);
     List<StudentPaymentOrderExportDto> getUserApplyOrders(@Param("userId") Integer userId, @Param("musicGroupId") String musicGroupId);
+
+    /**
+     * 获取成功的汇付支付的订单
+     *
+     * @param startTime
+     * @param endTime
+     * @return
+     */
+    List<StudentPaymentOrder> getAdaPayOrdersByTime(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
 }
 }

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

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.dao;
 package com.ym.mec.biz.dal.dao;
 
 
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 import java.util.Set;
 import java.util.Set;
@@ -264,11 +265,14 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
     int findMusicGroupStudentNum(@Param("musicGroupId") String musicGroupId);
     int findMusicGroupStudentNum(@Param("musicGroupId") String musicGroupId);
 
 
     /**
     /**
-     * 更新用户信息
+     * 更新用户证件信息
      *
      *
      * @return
      * @return
      */
      */
-    int updateUser(@Param("id") Integer id, @Param("realName") String realName, @Param("idCardNo") String idCardNo);
+    int updateUser(@Param("id") Integer id,
+                   @Param("realName") String realName,
+                   @Param("idCardNo") String idCardNo,
+                   @Param("certificateType") String certificateType);
 
 
     /**
     /**
      * 获取乐团在读人数
      * 获取乐团在读人数
@@ -393,11 +397,30 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
      * @return
      * @return
      */
      */
     Integer getMusicGroupSubjectStudentNum(@Param("musicGroupId") String musicGroupId, @Param("subjectIds") String subjectIds);
     Integer getMusicGroupSubjectStudentNum(@Param("musicGroupId") String musicGroupId, @Param("subjectIds") String subjectIds);
-    
+
     /**
     /**
      * 查询用户所在乐团信息
      * 查询用户所在乐团信息
+     *
      * @param userId
      * @param userId
      * @return
      * @return
      */
      */
     List<StudentMusicGroupDto> queryStudentMusicGroupInfo(Integer userId);
     List<StudentMusicGroupDto> queryStudentMusicGroupInfo(Integer userId);
+
+    /**
+     * 获取学员剩余课程费用
+     *
+     * @param classGroupId
+     * @param studentIds
+     * @return
+     */
+    List<Map<Integer, BigDecimal>> querySurplusCourseFeeByClassGroupId(@Param("classGroupId") Integer classGroupId, @Param("studentIds") String studentIds);
+
+    /**
+     * 根据学员编号列表和乐团编号获取学员注册列表
+     *
+     * @param studentIds
+     * @param musicGroupId
+     * @return
+     */
+    List<StudentRegistration> queryByUserIdsAndMusicGroupId(@Param("studentIds") String studentIds, @Param("musicGroupId") String musicGroupId);
 }
 }

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

@@ -0,0 +1,62 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.common.constant.CommonConstants;
+import org.springframework.util.CollectionUtils;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/1/7 0007
+ */
+public class IndexBaseDto {
+
+    private String title;
+
+    private BigDecimal percent;
+
+    private List<IndexBaseMonthDto> indexMonthData;
+
+    public IndexBaseDto() {
+    }
+
+    public IndexBaseDto(String title) {
+        this.title = title;
+    }
+
+    public IndexBaseDto(String title, BigDecimal percent, List<IndexBaseMonthDto> indexMonthData) {
+        this.title = title;
+        this.percent = percent;
+        this.indexMonthData = indexMonthData;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public BigDecimal getPercent() {
+        return percent;
+    }
+
+    public void setPercent(BigDecimal percent) {
+        this.percent = percent;
+    }
+
+    public List<IndexBaseMonthDto> getIndexMonthData() {
+        return indexMonthData;
+    }
+
+    public void setIndexMonthData(List<IndexBaseMonthDto> indexMonthData) {
+        this.indexMonthData = indexMonthData;
+        if(!CollectionUtils.isEmpty(indexMonthData)){
+            BigDecimal total = indexMonthData.stream().map(IndexBaseMonthDto::getTotal).reduce(BigDecimal.ZERO, BigDecimal::add);
+            BigDecimal activateNum = indexMonthData.stream().map(IndexBaseMonthDto::getActivateNum).reduce(BigDecimal.ZERO, BigDecimal::add);
+            this.percent = activateNum.divide(total, CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN);
+        }
+    }
+}

+ 55 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/IndexBaseMonthDto.java

@@ -0,0 +1,55 @@
+package com.ym.mec.biz.dal.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/1/7 0007
+ */
+public class IndexBaseMonthDto {
+
+    private String title;
+
+    //总数
+    private BigDecimal total;
+
+    //有效数量
+    private BigDecimal activateNum;
+
+    //最终结果
+    private BigDecimal percent;
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public BigDecimal getTotal() {
+        return total;
+    }
+
+    public void setTotal(BigDecimal total) {
+        this.total = total;
+    }
+
+    public BigDecimal getActivateNum() {
+        return activateNum;
+    }
+
+    public void setActivateNum(BigDecimal activateNum) {
+        this.activateNum = activateNum;
+    }
+
+    public BigDecimal getPercent() {
+        return percent;
+    }
+
+    public void setPercent(BigDecimal percent) {
+        this.percent = percent;
+    }
+}

+ 17 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MergeClassSplitClassAffirmDto.java

@@ -5,18 +5,35 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
 public class MergeClassSplitClassAffirmDto {
 public class MergeClassSplitClassAffirmDto {
+    //新建班级参数
     private List<ClassGroup4MixDto> classGroup4MixDtos;
     private List<ClassGroup4MixDto> classGroup4MixDtos;
 
 
+    //缴费项目参数
     private List<MusicGroupPaymentCalenderDto> musicGroupPaymentCalenderDtos;
     private List<MusicGroupPaymentCalenderDto> musicGroupPaymentCalenderDtos;
 
 
+    //需要合并的班级列表
     private List<Integer> classGroupIds;
     private List<Integer> classGroupIds;
 
 
+    //主班
+    private Integer masterClassGroupId;
+
+    //所选学员列表
     private List<Integer> studentIds;
     private List<Integer> studentIds;
 
 
+    //班级和学员关联
     private List<Map<Integer,String>> classGroupStudents;
     private List<Map<Integer,String>> classGroupStudents;
 
 
+    //最大的可排课时长
     private Map<String,Long> classCourseMinuteMap;
     private Map<String,Long> classCourseMinuteMap;
 
 
+    public Integer getMasterClassGroupId() {
+        return masterClassGroupId;
+    }
+
+    public void setMasterClassGroupId(Integer masterClassGroupId) {
+        this.masterClassGroupId = masterClassGroupId;
+    }
+
     public Map<String, Long> getClassCourseMinuteMap() {
     public Map<String, Long> getClassCourseMinuteMap() {
         return classCourseMinuteMap;
         return classCourseMinuteMap;
     }
     }

+ 12 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentCalenderAuditDetailDto.java

@@ -1,8 +1,8 @@
 package com.ym.mec.biz.dal.dto;
 package com.ym.mec.biz.dal.dto;
 
 
-import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 
 
 import java.util.List;
 import java.util.List;
@@ -17,6 +17,17 @@ public class MusicGroupPaymentCalenderAuditDetailDto {
     @ApiModelProperty(value = "缴费周期列表",required = false)
     @ApiModelProperty(value = "缴费周期列表",required = false)
     private List<MusicGroupPaymentCalender> musicGroupPaymentCalenders;
     private List<MusicGroupPaymentCalender> musicGroupPaymentCalenders;
 
 
+    @ApiModelProperty(value = "学员缴费详情",required = false)
+    private List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails;
+
+    public List<MusicGroupPaymentCalenderStudentDetail> getMusicGroupPaymentCalenderStudentDetails() {
+        return musicGroupPaymentCalenderStudentDetails;
+    }
+
+    public void setMusicGroupPaymentCalenderStudentDetails(List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails) {
+        this.musicGroupPaymentCalenderStudentDetails = musicGroupPaymentCalenderStudentDetails;
+    }
+
     public List<MusicGroupPaymentCalender> getMusicGroupPaymentCalenders() {
     public List<MusicGroupPaymentCalender> getMusicGroupPaymentCalenders() {
         return musicGroupPaymentCalenders;
         return musicGroupPaymentCalenders;
     }
     }

+ 24 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentCalenderDto.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.dto;
 package com.ym.mec.biz.dal.dto;
 
 
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
@@ -8,6 +9,8 @@ import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
+import io.swagger.annotations.ApiModelProperty;
 
 
 public class MusicGroupPaymentCalenderDto {
 public class MusicGroupPaymentCalenderDto {
 
 
@@ -37,6 +40,27 @@ public class MusicGroupPaymentCalenderDto {
 
 
 	private List<String> IgnoreBatchNoList = null;
 	private List<String> IgnoreBatchNoList = null;
 
 
+	private BigDecimal masterTotalPrice = BigDecimal.ZERO;
+
+	@ApiModelProperty(value = "跨团合并时缴费项目中学员的缴费明细")
+	private List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails;
+
+	public BigDecimal getMasterTotalPrice() {
+		return masterTotalPrice;
+	}
+
+	public void setMasterTotalPrice(BigDecimal masterTotalPrice) {
+		this.masterTotalPrice = masterTotalPrice;
+	}
+
+	public List<MusicGroupPaymentCalenderStudentDetail> getMusicGroupPaymentCalenderStudentDetails() {
+		return musicGroupPaymentCalenderStudentDetails;
+	}
+
+	public void setMusicGroupPaymentCalenderStudentDetails(List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails) {
+		this.musicGroupPaymentCalenderStudentDetails = musicGroupPaymentCalenderStudentDetails;
+	}
+
 	public List<String> getIgnoreBatchNoList() {
 	public List<String> getIgnoreBatchNoList() {
 		return IgnoreBatchNoList;
 		return IgnoreBatchNoList;
 	}
 	}

+ 20 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/SimpleUserDto.java

@@ -1,7 +1,6 @@
 package com.ym.mec.biz.dal.dto;
 package com.ym.mec.biz.dal.dto;
 
 
-import com.ym.mec.auth.api.entity.SysUser;
-import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.StringUtils;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 
 
@@ -29,8 +28,27 @@ public class SimpleUserDto {
 
 
     private String phone;
     private String phone;
 
 
+    private String organIds;
+
+    private String[] organIdList;
+
     private BigDecimal actualAmount;
     private BigDecimal actualAmount;
 
 
+    public String getOrganIds() {
+        return organIds;
+    }
+
+    public void setOrganIds(String organIds) {
+        this.organIds = organIds;
+        if(StringUtils.isNotEmpty(organIds)){
+            this.organIdList = organIds.split(",");
+        }
+    }
+
+    public String[] getOrganIdList() {
+        return organIdList;
+    }
+
     public BigDecimal getActualAmount() {
     public BigDecimal getActualAmount() {
         return actualAmount;
         return actualAmount;
     }
     }

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

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.dto;
 package com.ym.mec.biz.dal.dto;
 
 
 import java.time.LocalDate;
 import java.time.LocalDate;
+import java.util.Date;
 
 
 /**
 /**
  * @Author Joburgess
  * @Author Joburgess
@@ -20,13 +21,13 @@ public class StudentRecoverInfoDto {
 
 
     private int giveCourseTimes;
     private int giveCourseTimes;
 
 
-    private LocalDate expireDate;
+    private Date expireDate;
 
 
-    public LocalDate getExpireDate() {
+    public Date getExpireDate() {
         return expireDate;
         return expireDate;
     }
     }
 
 
-    public void setExpireDate(LocalDate expireDate) {
+    public void setExpireDate(Date expireDate) {
         this.expireDate = expireDate;
         this.expireDate = expireDate;
     }
     }
 
 

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

@@ -57,7 +57,7 @@ public class MusicGroupPaymentCalender {
 	}
 	}
 
 
 	public enum PaymentType implements BaseEnum<String, PaymentType> {
 	public enum PaymentType implements BaseEnum<String, PaymentType> {
-		ADD_STUDENT("新增学员"), ADD_COURSE("临时加课"), MUSIC_APPLY("乐团报名"),MUSIC_RENEW("乐团续费");
+		ADD_STUDENT("新增学员"), ADD_COURSE("临时加课"), MUSIC_APPLY("乐团报名"),MUSIC_RENEW("乐团续费"),SPAN_GROUP_CLASS_ADJUST("跨团班级调整");
 
 
 		private String desc;
 		private String desc;
 
 

+ 167 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalenderStudentDetail.java

@@ -0,0 +1,167 @@
+package com.ym.mec.biz.dal.entity;
+
+import java.util.Objects;
+
+/**
+ * 对应数据库表(music_group_payment_calender_student_detail):
+ */
+public class MusicGroupPaymentCalenderStudentDetail {
+
+	/**  */
+	private Integer id;
+	
+	/**  */
+	private Integer userId;
+	
+	/**  */
+	private String phone;
+	
+	/**  */
+	private String username;
+	
+	/** 原价 */
+	private java.math.BigDecimal courseOriginalPrice;
+	
+	/** 现价 */
+	private java.math.BigDecimal courseCurrentPrice;
+	
+	/** 课程类型 */
+	private String courseType;
+	
+	/** 课程时长 */
+	private Long courseTime;
+	
+	/** 班级编号 */
+	private Integer classGroupId;
+
+	/** 缴费项目编号 */
+	private String batchNo;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setUserId(Integer userId){
+		this.userId = userId;
+	}
+	
+	public Integer getUserId(){
+		return this.userId;
+	}
+			
+	public void setPhone(String phone){
+		this.phone = phone;
+	}
+	
+	public String getPhone(){
+		return this.phone;
+	}
+			
+	public void setUsername(String username){
+		this.username = username;
+	}
+	
+	public String getUsername(){
+		return this.username;
+	}
+			
+	public void setCourseOriginalPrice(java.math.BigDecimal courseOriginalPrice){
+		this.courseOriginalPrice = courseOriginalPrice;
+	}
+	
+	public java.math.BigDecimal getCourseOriginalPrice(){
+		return this.courseOriginalPrice;
+	}
+			
+	public void setCourseCurrentPrice(java.math.BigDecimal courseCurrentPrice){
+		this.courseCurrentPrice = courseCurrentPrice;
+	}
+	
+	public java.math.BigDecimal getCourseCurrentPrice(){
+		return this.courseCurrentPrice;
+	}
+			
+	public void setCourseType(String courseType){
+		this.courseType = courseType;
+	}
+	
+	public String getCourseType(){
+		return this.courseType;
+	}
+
+	public Long getCourseTime() {
+		return courseTime;
+	}
+
+	public void setCourseTime(Long courseTime) {
+		this.courseTime = courseTime;
+	}
+
+	public void setClassGroupId(Integer classGroupId){
+		this.classGroupId = classGroupId;
+	}
+	
+	public Integer getClassGroupId(){
+		return this.classGroupId;
+	}
+
+	public String getBatchNo() {
+		return batchNo;
+	}
+
+	public void setBatchNo(String batchNo) {
+		this.batchNo = batchNo;
+	}
+
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+
+	@Override
+	public String toString() {
+		return "MusicGroupPaymentCalenderStudentDetail{" +
+				"userId=" + userId +
+				", courseCurrentPrice=" + courseCurrentPrice +
+				", courseType='" + courseType + '\'' +
+				", classGroupId=" + classGroupId +
+				'}';
+	}
+
+	@Override
+	public boolean equals(Object o) {
+		if (this == o) return true;
+		if (o == null || getClass() != o.getClass()) return false;
+		MusicGroupPaymentCalenderStudentDetail that = (MusicGroupPaymentCalenderStudentDetail) o;
+		return userId.equals(that.userId) &&
+				courseCurrentPrice.equals(that.courseCurrentPrice) &&
+				courseType.equals(that.courseType) &&
+				classGroupId.equals(that.classGroupId);
+	}
+
+	@Override
+	public int hashCode() {
+		return Objects.hash(userId, courseCurrentPrice, courseType, classGroupId);
+	}
+}

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupStudentClassAdjust.java

@@ -43,12 +43,34 @@ public class MusicGroupStudentClassAdjust {
 	@ApiModelProperty(value = "每个班级对应的学员", required = false)
 	@ApiModelProperty(value = "每个班级对应的学员", required = false)
 	private String classGroupStudents;
 	private String classGroupStudents;
 
 
+	@ApiModelProperty(value = "学员的缴费详情", required = false)
+	private String studentPaymentCalender;
+
 	private Integer operatorId;
 	private Integer operatorId;
 
 
+	@ApiModelProperty(value = "主班编号", required = false)
+	private Integer masterClassGroupId;
+
 	private Date createTime;
 	private Date createTime;
 
 
 	private Date updateTime;
 	private Date updateTime;
 
 
+	public Integer getMasterClassGroupId() {
+		return masterClassGroupId;
+	}
+
+	public void setMasterClassGroupId(Integer masterClassGroupId) {
+		this.masterClassGroupId = masterClassGroupId;
+	}
+
+	public String getStudentPaymentCalender() {
+		return studentPaymentCalender;
+	}
+
+	public void setStudentPaymentCalender(String studentPaymentCalender) {
+		this.studentPaymentCalender = studentPaymentCalender;
+	}
+
 	public String getDefaultCourseTypeMinute() {
 	public String getDefaultCourseTypeMinute() {
 		return defaultCourseTypeMinute;
 		return defaultCourseTypeMinute;
 	}
 	}

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRecoverDto.java

@@ -2,6 +2,8 @@ package com.ym.mec.biz.dal.entity;
 
 
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 
 
+import java.util.Date;
+
 /**
 /**
  * @Author Joburgess
  * @Author Joburgess
  * @Date 2019/12/23
  * @Date 2019/12/23
@@ -16,6 +18,27 @@ public class StudentRecoverDto extends CourseGenerateDto{
     @ApiModelProperty(value = "教师编号")
     @ApiModelProperty(value = "教师编号")
     private Integer teacherId;
     private Integer teacherId;
 
 
+    @ApiModelProperty(value = "课程截至时间")
+    private Date expireDate;
+
+    private int days;
+
+    public int getDays() {
+        return days;
+    }
+
+    public void setDays(int days) {
+        this.days = days;
+    }
+
+    public Date getExpireDate() {
+        return expireDate;
+    }
+
+    public void setExpireDate(Date expireDate) {
+        this.expireDate = expireDate;
+    }
+
     public Integer getTeacherId() {
     public Integer getTeacherId() {
         return teacherId;
         return teacherId;
     }
     }

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

@@ -34,6 +34,9 @@ public class StudentRegistration {
     @ApiModelProperty(value = "身份证号", required = false)
     @ApiModelProperty(value = "身份证号", required = false)
     private String idCardNo;
     private String idCardNo;
 
 
+    @ApiModelProperty(value = "证件类型")
+    private String certificateType;
+
     @ApiModelProperty(value = "所属乐团(对应 music_group 表id)", required = false)
     @ApiModelProperty(value = "所属乐团(对应 music_group 表id)", required = false)
     private String musicGroupId;
     private String musicGroupId;
 
 
@@ -118,6 +121,14 @@ public class StudentRegistration {
     
     
     private Integer chargeTypeId;
     private Integer chargeTypeId;
 
 
+    public String getCertificateType() {
+        return certificateType;
+    }
+
+    public void setCertificateType(String certificateType) {
+        this.certificateType = certificateType;
+    }
+
     public BigDecimal getBalance() {
     public BigDecimal getBalance() {
         return balance;
         return balance;
     }
     }

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

@@ -22,9 +22,20 @@ public class ClassGroupQueryInfo extends QueryInfo {
     
     
     @ApiModelProperty(value = "班级名称", required = false)
     @ApiModelProperty(value = "班级名称", required = false)
     private String name;
     private String name;
+
+    @ApiModelProperty(value = "分部", required = false)
+    private String organIdList;
     
     
     private Integer delFlag;
     private Integer delFlag;
 
 
+	public String getOrganIdList() {
+		return organIdList;
+	}
+
+	public void setOrganIdList(String organIdList) {
+		this.organIdList = organIdList;
+	}
+
 	public Integer getId() {
 	public Integer getId() {
 		return id;
 		return id;
 	}
 	}

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

@@ -21,6 +21,18 @@ public class EmployeeQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "用户名或电话",required = false)
     @ApiModelProperty(value = "用户名或电话",required = false)
     private Long userNameOrPhone;
     private Long userNameOrPhone;
 
 
+    /** 是否离职 */
+    @ApiModelProperty(value = "是否离职",required = false)
+    private Boolean demissionflag;
+
+    public Boolean getDemissionflag() {
+        return demissionflag;
+    }
+
+    public void setDemissionflag(Boolean demissionflag) {
+        this.demissionflag = demissionflag;
+    }
+
     public String getJobNature() {
     public String getJobNature() {
         return jobNature;
         return jobNature;
     }
     }

+ 49 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupService.java

@@ -1,10 +1,7 @@
 package com.ym.mec.biz.service;
 package com.ym.mec.biz.service;
 
 
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.dto.*;
-import com.ym.mec.biz.dal.entity.ClassGroup;
-import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.SalarySettlementTypeEnum;
 import com.ym.mec.biz.dal.enums.SalarySettlementTypeEnum;
@@ -16,6 +13,7 @@ import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.BaseService;
 import com.ym.mec.common.service.BaseService;
 
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.InvocationTargetException;
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 import java.util.Set;
 import java.util.Set;
@@ -373,6 +371,13 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
     List<ClassGroupTeachersDto> getClassGroupAndTeacherByType(String musicGroupId, ClassGroupTypeEnum type);
     List<ClassGroupTeachersDto> getClassGroupAndTeacherByType(String musicGroupId, ClassGroupTypeEnum type);
 
 
     /**
     /**
+     * 根据乐团id,班级类型获取班级和老师
+     * @param queryInfo
+     * @return
+     */
+    PageInfo<ClassGroupTeachersDto> queryClassGroupPage(ClassGroupQueryInfo queryInfo);
+
+    /**
      * 添加IM群组
      * 添加IM群组
      * @param classGroup
      * @param classGroup
      * @param userIds
      * @param userIds
@@ -468,7 +473,7 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
     Map<String,Integer> classGroupSubCourseNum(Integer classGroupId);
     Map<String,Integer> classGroupSubCourseNum(Integer classGroupId);
 
 
     /**
     /**
-     * 进行中乐团-修改-班级详情-学员班级调整-生成默认缴费信息
+     * 进行中乐团-修改-班级详情-学员班级调整-获取所选班级最大可排课时长
      * @author zouxuan
      * @author zouxuan
      * @param classGroupIds
      * @param classGroupIds
      * @return
      * @return
@@ -501,4 +506,42 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
      */
      */
     HighClassGroupNumDto getSubjectMaxHighClassGroupNum(String musicGroupId,ClassGroupTypeEnum type,String subjectIds);
     HighClassGroupNumDto getSubjectMaxHighClassGroupNum(String musicGroupId,ClassGroupTypeEnum type,String subjectIds);
 
 
-    }
+    /**
+     * 进行中乐团-修改-班级详情-班级合并-获取学员需要补交的费用以及需要退还的课程余额
+     * @param masterClassGroupId
+     * @param classGroupStudents
+     * @param studentIds
+     * @return
+     */
+    List<MusicGroupPaymentCalenderStudentDetail> queryStudentPaymentCalenders(Integer masterClassGroupId,List<Map<Integer, String>> classGroupStudents,List<Integer> studentIds);
+
+    /**
+     * 获取主班课程类型剩余价值
+     * @param masterClassGroupId
+     * @return
+     */
+    BigDecimal getMasterTotalPrice(Integer masterClassGroupId);
+
+    /**
+     * 获取班级列表最大可排课时长
+     * @param classGroupId
+     * @return
+     */
+    Map<String,Long> querySubCourseTime(Integer classGroupId);
+
+    /**
+     * 跨团班级合并提交
+     * @param mergeClassSplitClassAffirmDto
+     * @return
+     */
+    void spanGroupMergeClassSplitClassAffirm(MergeClassSplitClassAffirmDto mergeClassSplitClassAffirmDto);
+
+    /**
+     * 跨团合班缴费项目审核通过后
+     * @param masterClassGroupId
+     * @param studentIds
+     * @param courseIds
+     * @param classGroupStudents
+     */
+    void spanGroupClassAdjustPass(Integer masterClassGroupId,List<Integer> studentIds,List<Long> courseIds,List<Map<Integer, String>> classGroupStudents);
+}

+ 17 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/IndexService.java

@@ -0,0 +1,17 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.dto.IndexBaseDto;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/1/7 0007
+ **/
+public interface IndexService {
+
+    Map<String, List<IndexBaseDto>> getIndexBaseData(Set<String> dataType, String organIds, String startMonth, String endMonth);
+
+}

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderDetailService.java

@@ -6,7 +6,9 @@ import java.util.Set;
 
 
 import com.ym.mec.biz.dal.dto.FeeStudentDto;
 import com.ym.mec.biz.dal.dto.FeeStudentDto;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
 import com.ym.mec.common.service.BaseService;
 import com.ym.mec.common.service.BaseService;
 
 
 public interface MusicGroupPaymentCalenderDetailService extends BaseService<Long, MusicGroupPaymentCalenderDetail> {
 public interface MusicGroupPaymentCalenderDetailService extends BaseService<Long, MusicGroupPaymentCalenderDetail> {
@@ -54,6 +56,13 @@ public interface MusicGroupPaymentCalenderDetailService extends BaseService<Long
 
 
     /**
     /**
      * 乐团缴费记录新增学员
      * 乐团缴费记录新增学员
+     * @param musicGroupPaymentCalender
+     * @param musicGroupPaymentCalenderStudentDetails
+     */
+    void batchAdd(MusicGroupPaymentCalender musicGroupPaymentCalender, List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails);
+
+    /**
+     * 乐团缴费记录新增学员
      * @param batchNo
      * @param batchNo
      * @param userIdList
      * @param userIdList
      */
      */

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

@@ -95,7 +95,7 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 	 * @author zouxuan
 	 * @author zouxuan
 	 * @date 2020/10/30
 	 * @date 2020/10/30
 	 * @time 15:10
 	 * @time 15:10
-	 * @param calenderId:
+	 * @param batchNo:
 	 * @return com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDetailDto
 	 * @return com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDetailDto
 	 */
 	 */
 	MusicGroupPaymentCalenderAuditDetailDto auditListDetail(String batchNo);
 	MusicGroupPaymentCalenderAuditDetailDto auditListDetail(String batchNo);

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderStudentDetailService.java

@@ -0,0 +1,9 @@
+package com.ym.mec.biz.service;
+
+
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
+import com.ym.mec.common.service.BaseService;
+
+public interface MusicGroupPaymentCalenderStudentDetailService extends BaseService<Integer, MusicGroupPaymentCalenderStudentDetail> {
+
+}

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

@@ -47,7 +47,7 @@ public interface MusicGroupSubjectPlanService extends BaseService<Integer, Music
      * @param musicGroupId
      * @param musicGroupId
      * @param subjectId
      * @param subjectId
      */
      */
-    void addApplyStudentNum(String musicGroupId, Integer subjectId,int num) throws Exception;
+    void addApplyStudentNum(String musicGroupId, Integer subjectId,int num);
 
 
     /**
     /**
      * 批量修改声部规划费用
      * 批量修改声部规划费用

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

@@ -131,4 +131,12 @@ public interface StudentPaymentOrderService extends BaseService<Long, StudentPay
 	 */
 	 */
 	List<StudentPaymentOrder> getUserOrderByType(Integer userId, OrderTypeEnum type, DealStatusEnum status);
 	List<StudentPaymentOrder> getUserOrderByType(Integer userId, OrderTypeEnum type, DealStatusEnum status);
 
 
+
+	/**
+	 * 从新提交分账信息
+	 * @param startTime
+	 * @param endTime
+	 * @return
+	 */
+	List<StudentPaymentOrder> reConfirmOrder(Date startTime,Date endTime);
 }
 }

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

@@ -137,6 +137,16 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
     Integer insertStudent(StudentAddDto studentAddDto) throws Exception;
     Integer insertStudent(StudentAddDto studentAddDto) throws Exception;
 
 
     /**
     /**
+     * 跨团合班进行中加学员
+     * @param studentIds 学员列表
+     * @param oldMusicGroupId 原乐团
+     * @param newMusicGroupId 主乐团
+     * @param masterTotalPrice 主乐团剩余课程价值
+     * @return
+     */
+    void insertStudent(String studentIds,String oldMusicGroupId,String newMusicGroupId,BigDecimal masterTotalPrice);
+
+    /**
      * 获取班级学生
      * 获取班级学生
      *
      *
      * @param musicGroupId
      * @param musicGroupId

+ 283 - 24
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -1,6 +1,8 @@
 package com.ym.mec.biz.service.impl;
 package com.ym.mec.biz.service.impl;
 
 
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.AUDITING;
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.AUDITING;
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.NO;
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.SPAN_GROUP_CLASS_ADJUST;
 import static com.ym.mec.biz.dal.enums.GroupType.COMM;
 import static com.ym.mec.biz.dal.enums.GroupType.COMM;
 import static com.ym.mec.biz.dal.enums.GroupType.MUSIC;
 import static com.ym.mec.biz.dal.enums.GroupType.MUSIC;
 import static com.ym.mec.biz.dal.enums.GroupType.PRACTICE;
 import static com.ym.mec.biz.dal.enums.GroupType.PRACTICE;
@@ -30,7 +32,6 @@ import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.biz.service.*;
-import com.ym.mec.common.service.IdGeneratorService;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -100,6 +101,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     @Autowired
     @Autowired
     private ClassGroupStudentMapperDao classGroupStudentMapperDao;
     private ClassGroupStudentMapperDao classGroupStudentMapperDao;
     @Autowired
     @Autowired
+    private ClassGroupStudentMapperService classGroupStudentMapperService;
+    @Autowired
     private ClassGroupRelationDao classGroupRelationDao;
     private ClassGroupRelationDao classGroupRelationDao;
     @Autowired
     @Autowired
     private ClassGroupTeacherMapperService classGroupTeacherMapperService;
     private ClassGroupTeacherMapperService classGroupTeacherMapperService;
@@ -163,8 +166,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     @Autowired
     @Autowired
     private MusicGroupPaymentCalenderService musicGroupPaymentCalenderService;
     private MusicGroupPaymentCalenderService musicGroupPaymentCalenderService;
     @Autowired
     @Autowired
-    private IdGeneratorService idGeneratorService;
-    @Autowired
     private MusicGroupStudentClassAdjustDao musicGroupStudentClassAdjustDao;
     private MusicGroupStudentClassAdjustDao musicGroupStudentClassAdjustDao;
 
 
     @Override
     @Override
@@ -905,7 +906,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     public List<ImGroupModel> queryUserGroups(Integer userId, String search) {
     public List<ImGroupModel> queryUserGroups(Integer userId, String search) {
         List<ImGroupModel> imGroupModels = classGroupDao.queryUserMusicGroups(userId, search);
         List<ImGroupModel> imGroupModels = classGroupDao.queryUserMusicGroups(userId, search);
         imGroupModels.addAll(classGroupDao.queryUserVipGroups(userId, search));
         imGroupModels.addAll(classGroupDao.queryUserVipGroups(userId, search));
-//        imGroupModels.addAll(classGroupDao.queryUserPracticeGroups(userId, search));
         imGroupModels.addAll(classGroupDao.queryUserCommGroups(userId, search));
         imGroupModels.addAll(classGroupDao.queryUserCommGroups(userId, search));
         if (imGroupModels != null && imGroupModels.size() > 0) {
         if (imGroupModels != null && imGroupModels.size() > 0) {
             imGroupModels.forEach(e -> {
             imGroupModels.forEach(e -> {
@@ -2919,6 +2919,53 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     }
     }
 
 
     @Override
     @Override
+    public PageInfo<ClassGroupTeachersDto> queryClassGroupPage(ClassGroupQueryInfo queryInfo) {
+        PageInfo<ClassGroupTeachersDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+        Map<String, Object> params = new HashMap<String, Object>();
+        MapUtil.populateMap(params, queryInfo);
+
+        List<ClassGroupTeachersDto> dataList = null;
+        int count = classGroupDao.countClassGroup(params);
+        if (count > 0) {
+            pageInfo.setTotal(count);
+            params.put("offset", pageInfo.getOffset());
+            dataList = classGroupDao.queryClassGroupPage(params);
+            String classGroupIds = dataList.stream().map(classGroup -> classGroup.getId().toString()).collect(Collectors.joining(","));
+            List<Integer> classGroupSet = dataList.stream().map(classGroup -> classGroup.getId()).collect(Collectors.toList());
+
+            List<ClassGroupTeacherMapper> classGroupTeachers = classGroupTeacherMapperDao.findClassGroupTeachers(classGroupIds);
+            Map<Integer, Integer> studyNums = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertIntegerMap(classGroupDao.countStudyNum(classGroupIds))), HashMap.class);
+
+            Map<Integer, Long> totalNumMap = MapUtil.convertIntegerMap(courseScheduleDao.countTotalNumByClassGroupId(classGroupSet, null));
+            Map<Integer, Long> currentNumMap = MapUtil.convertIntegerMap(courseScheduleDao.countExpendNumByClassGroupId(classGroupSet));
+            for (ClassGroupTeachersDto classGroup : dataList) {
+                List<ClassGroupTeacherMapper> classGroupTeacherMappers = new ArrayList<>();
+                for (ClassGroupTeacherMapper classGroupTeacher : classGroupTeachers) {
+                    if (!classGroup.getId().equals(classGroupTeacher.getClassGroupId())) continue;
+                    classGroupTeacherMappers.add(classGroupTeacher);
+                }
+                classGroup.setClassGroupTeacherMapperList(classGroupTeacherMappers);
+                classGroup.setStudentNum(studyNums.get(classGroup.getId()));
+                int totalClassTimes = 0;
+                int currentClassTimes = 0;
+                if (totalNumMap.containsKey(classGroup.getId())) {
+                    totalClassTimes = totalNumMap.get(classGroup.getId()).intValue();
+                }
+                if (currentNumMap.containsKey(classGroup.getId())) {
+                    currentClassTimes = currentNumMap.get(classGroup.getId()).intValue();
+                }
+                classGroup.setTotalClassTimes(totalClassTimes);
+                classGroup.setCurrentClassTimes(currentClassTimes);
+            }
+        }
+        if (count == 0) {
+            dataList = new ArrayList<>();
+        }
+        pageInfo.setRows(dataList);
+        return pageInfo;
+    }
+
+    @Override
     public Boolean addImGroup(ClassGroup classGroup, List<Integer> userIds) {
     public Boolean addImGroup(ClassGroup classGroup, List<Integer> userIds) {
         MusicGroup musicGroup = musicGroupDao.get(classGroup.getMusicGroupId());
         MusicGroup musicGroup = musicGroupDao.get(classGroup.getMusicGroupId());
         List<Integer> userIdList = new ArrayList<>();
         List<Integer> userIdList = new ArrayList<>();
@@ -3255,34 +3302,14 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     @Override
     @Override
     public Map<String, Integer> classGroupSubCourseNum(Integer classGroupId) {
     public Map<String, Integer> classGroupSubCourseNum(Integer classGroupId) {
         return MapUtil.convertIntegerMap(courseScheduleDao.querySubCourseNumMap(classGroupId));
         return MapUtil.convertIntegerMap(courseScheduleDao.querySubCourseNumMap(classGroupId));
-
-//        List<Map<String,Object>> result = new ArrayList<>();
-//        //获取班级列表
-//        List<ClassGroup> classGroups = classGroupDao.queryClassGroups(musicGroupId, null);
-//        for (ClassGroup classGroup : classGroups) {
-//            Map<String,Object> resultMap = new HashMap();
-//            resultMap.put("classGroup",classGroup);
-//            //获取班级剩余的课程类型和课程数量
-//            List<Map<String,Integer>> courseTypeNumMap = courseScheduleDao.querySubCourseNumMap(classGroup.getId());
-//            resultMap.put("courseTypeNumMap",courseTypeNumMap);
-//            //获取班级里学员列表
-//            resultMap.put("students",classGroupStudentMapperDao.findCourseStudentNameAndPhoneByClassGroupId(classGroup.getId()));
-//            result.add(resultMap);
-//        }
-//        return result;
     }
     }
 
 
-    @Override
     public Map<String, Object> getDefaultPaymentCalender(List<Integer> classGroupIds) {
     public Map<String, Object> getDefaultPaymentCalender(List<Integer> classGroupIds) {
         if (classGroupIds == null || classGroupIds.size() == 0) {
         if (classGroupIds == null || classGroupIds.size() == 0) {
             throw new BizException("参数校验失败");
             throw new BizException("参数校验失败");
         }
         }
         Map<String, Object> result = new HashMap<>();
         Map<String, Object> result = new HashMap<>();
         Map<Integer, Map<String, MusicGroupOrganizationCourseSettingsDetail>> resultMap = new HashMap<>();
         Map<Integer, Map<String, MusicGroupOrganizationCourseSettingsDetail>> resultMap = new HashMap<>();
-        //获取默认的排课时长
-//        JSONObject jsonObject = JSON.parseObject(classAdjust.getDefaultCourseTypeMinute());
-//        String courseDefaultMinutes = sysConfigDao.findConfigValue("music_course_default_minutes");
-//        JSONObject jsonObject = JSON.parseObject(courseDefaultMinutes);
         //获取所选班级最大剩余课时
         //获取所选班级最大剩余课时
         Map<String, Long> map = MapUtil.convertIntegerMap(courseScheduleDao.findClassMaxCourseNumMap(classGroupIds));
         Map<String, Long> map = MapUtil.convertIntegerMap(courseScheduleDao.findClassMaxCourseNumMap(classGroupIds));
         //获取分布默认的课程类型单价
         //获取分布默认的课程类型单价
@@ -3545,4 +3572,236 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         highClassGroupNumDto.setMaxHighClassGroupNum(maxClassGroupNum);
         highClassGroupNumDto.setMaxHighClassGroupNum(maxClassGroupNum);
         return highClassGroupNumDto;
         return highClassGroupNumDto;
     }
     }
+
+    @Override
+    public List<MusicGroupPaymentCalenderStudentDetail> queryStudentPaymentCalenders(Integer masterClassGroupId,List<Map<Integer, String>> classGroupStudents,List<Integer> studentIds) {
+        //获取主班剩余时长
+        Map<String, Long> masterMap = MapUtil.convertIntegerMap(courseScheduleDao.querySubCourseNumMap(masterClassGroupId));
+        if(masterMap.size() <= 0){
+            throw new BizException("所选主班没有剩余课程,请重新选择");
+        }
+        //获取学员列表
+        Map<Integer, String> userNames = MapUtil.convertMybatisMap(teacherDao.queryUsernameByIds(studentIds));
+        Map<Integer, String> phoneMaps = MapUtil.convertMybatisMap(teacherDao.queryPhoneByIds(StringUtils.join(studentIds,",")));
+
+        Map<Integer, Integer> studentCLassMap = new HashMap<>();
+        List<Map<Integer, BigDecimal>> surplusCourseFeeMapList = new ArrayList<>();
+        for (Map<Integer, String> classGroupStudent : classGroupStudents) {
+            for (Integer integer : classGroupStudent.keySet()) {
+                //获取学员剩余课程费用
+                surplusCourseFeeMapList.addAll(studentRegistrationDao.querySurplusCourseFeeByClassGroupId(integer,classGroupStudent.get(integer)));
+                String[] s = classGroupStudent.get(integer).split(",");
+                for (String s1 : s) {
+                    studentCLassMap.put(Integer.parseInt(s1),integer);
+                }
+            }
+        }
+        //学员剩余课程费用
+        Map<Integer, BigDecimal> surplusCourseFeeMap = MapUtil.convertIntegerMap(surplusCourseFeeMapList);
+        //获取分布默认的课程类型单价
+        MusicGroup musicGroup = musicGroupDao.findByClassGroupId(masterClassGroupId);
+        Map<String, BigDecimal> unitPriceMap = MapUtil.convertIntegerMap(organizationCourseUnitPriceSettingsDao.queryMapByOrganIdAndChargeTypeId(musicGroup.getChargeTypeId(), musicGroup.getOrganId()));
+        Set<String> masterKeySet = masterMap.keySet();
+        //计算主班课程类型剩余价值
+        Map<String, BigDecimal> masterTotalPriceMap = new HashMap<>(masterKeySet.size());
+        //学员缴费项目列表
+        List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails = new ArrayList<>();
+        for (String s : masterKeySet) {
+            BigDecimal unitPrice = unitPriceMap.get(s);
+            if (unitPrice == null) {
+                throw new BizException("分部默认课程类型单价不存在,请设置");
+            }
+            Long courseTime = masterMap.get(s);
+            //获取主班剩余课程价值,按分部默认单价计算
+            if(courseTime == 0l){
+                masterTotalPriceMap.put(s,BigDecimal.ZERO);
+            }
+            //总价四舍五入取整
+            BigDecimal totalPrice = unitPrice.multiply(new BigDecimal(courseTime)).setScale(0, BigDecimal.ROUND_HALF_UP);
+            masterTotalPriceMap.put(s,totalPrice);
+            //课程余额转移
+            for (Integer studentId : studentCLassMap.keySet()) {
+                //学员剩余课程余额
+                BigDecimal bigDecimal = surplusCourseFeeMap.get(studentId);
+                //创建学员缴费项目
+                MusicGroupPaymentCalenderStudentDetail calenderDto = new MusicGroupPaymentCalenderStudentDetail();
+                calenderDto.setClassGroupId(studentCLassMap.get(studentId));
+                //如果剩余课程余额小于等于0
+                if(bigDecimal.doubleValue() <= 0d){
+                    calenderDto.setCourseCurrentPrice(totalPrice);
+                    calenderDto.setCourseOriginalPrice(totalPrice);
+                }else {
+                    //如果剩余课程余额大于等于总价值,那么补交0元
+                    if(bigDecimal.doubleValue() >= totalPrice.doubleValue()){
+                        calenderDto.setCourseCurrentPrice(BigDecimal.ZERO);
+                        calenderDto.setCourseOriginalPrice(BigDecimal.ZERO);
+                    }else {
+                        calenderDto.setCourseCurrentPrice(totalPrice.subtract(bigDecimal));
+                        calenderDto.setCourseOriginalPrice(totalPrice.subtract(bigDecimal));
+                    }
+                    //剩余课程余额减去主班对应课程类型总的课程价值,负数就是需要补交的金额
+//                    bigDecimal = bigDecimal.subtract(totalPrice);
+                    surplusCourseFeeMap.put(studentId,bigDecimal.subtract(totalPrice));
+                }
+                calenderDto.setCourseTime(courseTime);
+                calenderDto.setCourseType(s);
+
+                calenderDto.setPhone(phoneMaps.get(studentId));
+                calenderDto.setUserId(studentId);
+                calenderDto.setUsername(userNames.get(studentId));
+                musicGroupPaymentCalenderStudentDetails.add(calenderDto);
+            }
+        }
+        return musicGroupPaymentCalenderStudentDetails;
+    }
+
+
+    @Override
+    public BigDecimal getMasterTotalPrice(Integer masterClassGroupId) {
+        //获取主班剩余时长
+        Map<String, Long> masterMap = MapUtil.convertIntegerMap(courseScheduleDao.querySubCourseNumMap(masterClassGroupId));
+        if(masterMap.size() <= 0){
+            throw new BizException("所选主班没有剩余课程,请重新选择");
+        }
+        //获取分布默认的课程类型单价
+        MusicGroup musicGroup = musicGroupDao.findByClassGroupId(masterClassGroupId);
+        Map<String, BigDecimal> unitPriceMap = MapUtil.convertIntegerMap(organizationCourseUnitPriceSettingsDao.queryMapByOrganIdAndChargeTypeId(musicGroup.getChargeTypeId(), musicGroup.getOrganId()));
+        Set<String> masterKeySet = masterMap.keySet();
+        //计算主班课程类型剩余价值
+        BigDecimal masterTotalPrice = BigDecimal.ZERO;
+        for (String s : masterKeySet) {
+            BigDecimal unitPrice = unitPriceMap.get(s);
+            if (unitPrice == null) {
+                throw new BizException("分部默认课程类型单价不存在,请设置");
+            }
+            Long courseTime = masterMap.get(s);
+            //获取主班剩余课程价值,按分部默认单价计算
+            //总价四舍五入取整
+            BigDecimal totalPrice = unitPrice.multiply(new BigDecimal(courseTime)).setScale(0, BigDecimal.ROUND_HALF_UP);
+            masterTotalPrice = masterTotalPrice.add(totalPrice);
+        }
+        return masterTotalPrice;
+    }
+
+    @Override
+    public Map<String, Long> querySubCourseTime(Integer classGroupId) {
+        return MapUtil.convertIntegerMap(courseScheduleDao.querySubCourseNumMap(classGroupId));
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void spanGroupMergeClassSplitClassAffirm(MergeClassSplitClassAffirmDto mergeClassSplitClassAffirmDto) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        //缴费项目
+        List<MusicGroupPaymentCalenderDto> paymentCalenderDtos = mergeClassSplitClassAffirmDto.getMusicGroupPaymentCalenderDtos();
+        //主班
+        Integer masterClassGroupId = mergeClassSplitClassAffirmDto.getMasterClassGroupId();
+        //学员列表
+        List<Integer> studentIds = mergeClassSplitClassAffirmDto.getStudentIds();
+        //主班是否包含所选学员学员
+        Boolean hasStudent = classGroupStudentMapperDao.hasStudent(masterClassGroupId,studentIds);
+        if(hasStudent){
+            throw new BizException("操作失败: 主班包含部分已选学员");
+        }
+        //学员列表
+        List<Integer> classGroupIds = mergeClassSplitClassAffirmDto.getClassGroupIds();
+        //班级和学员关联
+        List<Map<Integer, String>> classGroupStudents = mergeClassSplitClassAffirmDto.getClassGroupStudents();
+        //获取默认的学员缴费详情
+        List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails = queryStudentPaymentCalenders(masterClassGroupId,
+                classGroupStudents,
+                studentIds);
+        //创建缴费项目
+        MusicGroup musicGroup = musicGroupDao.findByClassGroupId(masterClassGroupId);
+        MusicGroupPaymentCalender.PaymentCalenderStatusEnum status = null;
+        StringBuffer batchNos = new StringBuffer();
+        List<String> batchNoList = new ArrayList<>();
+        if (paymentCalenderDtos != null && paymentCalenderDtos.size() > 0) {
+            BigDecimal masterTotalPrice = getMasterTotalPrice(masterClassGroupId);
+            //是否有需要审核的缴费项目
+            for (MusicGroupPaymentCalenderDto calenderDto : paymentCalenderDtos) {
+                //将学员加入新乐团、扣除原乐团剩余课程余额、补充到现有乐团
+                studentRegistrationService.insertStudent(calenderDto.getStudentIds(),calenderDto.getMusicGroupId(),musicGroup.getId(),masterTotalPrice);
+                calenderDto.setMusicGroupId(musicGroup.getId());
+                List<MusicGroupPaymentCalenderStudentDetail> calenderStudentDetails = calenderDto.getMusicGroupPaymentCalenderStudentDetails();
+                boolean containsAll = musicGroupPaymentCalenderStudentDetails.containsAll(calenderStudentDetails);
+                if(!containsAll){
+                    calenderDto.setStatus(AUDITING);
+                }else {
+                    calenderDto.setStatus(NO);
+                }
+                calenderDto.setPaymentType(SPAN_GROUP_CLASS_ADJUST);
+                //生成缴费项目
+                calenderDto.setMasterTotalPrice(masterTotalPrice);
+                musicGroupPaymentCalenderService.create(calenderDto);
+                if (batchNos.length() > 0) {
+                    batchNos.append(",");
+                }
+                batchNoList.add(calenderDto.getBatchNo());
+                batchNos.append(calenderDto.getBatchNo());
+                if (status == null || status != AUDITING) {
+                    if(!containsAll){
+                        status = AUDITING;
+                    }
+                }
+            }
+            //记录申请信息
+            MusicGroupStudentClassAdjust musicGroupStudentClassAdjust = new MusicGroupStudentClassAdjust();
+            musicGroupStudentClassAdjust.setMasterClassGroupId(masterClassGroupId);
+            musicGroupStudentClassAdjust.setBatchNo(batchNos.toString());
+            musicGroupStudentClassAdjust.setMusicGroupId(musicGroup.getId());
+            musicGroupStudentClassAdjust.setOperatorId(sysUser.getId());
+            musicGroupStudentClassAdjust.setClassGroupIds(JSON.toJSONString(classGroupIds));
+            musicGroupStudentClassAdjust.setStudentIds(JSON.toJSONString(studentIds));
+            if (classGroupStudents != null && classGroupStudents.size() > 0) {
+                musicGroupStudentClassAdjust.setClassGroupStudents(JSON.toJSONString(mergeClassSplitClassAffirmDto.getClassGroupStudents()));
+            }
+            //获取需要删除的学员关联的课程
+            List<Long> courseIds = courseScheduleDao.queryStudentNotStartByClassIdsAndStudentIds(classGroupIds, studentIds);
+            musicGroupStudentClassAdjust.setSubLockCourseIds(JSON.toJSONString(courseIds));
+            //获取关联的学员缴费信息
+            List<Long> studentPaymentIds = courseScheduleStudentPaymentDao.queryStudentNotStartByClassIdsAndStudentIds(classGroupIds, studentIds);
+            musicGroupStudentClassAdjust.setStudentPaymentIds(JSON.toJSONString(studentPaymentIds));
+            //获取需要冻结的课程
+            classGroupIds.add(masterClassGroupId);
+            List<Long> allLockCourseIds = courseScheduleDao.queryStudentNotStartByClassIdsAndStudentIds(classGroupIds, null);
+            musicGroupStudentClassAdjust.setAllLockCourseIds(JSON.toJSONString(allLockCourseIds));
+            musicGroupStudentClassAdjustDao.insert(musicGroupStudentClassAdjust);
+            //没有需要审核的缴费项目
+            if (status == null) {
+                spanGroupClassAdjustPass(masterClassGroupId,studentIds,courseIds,classGroupStudents);
+            }else {
+//                冻结班级
+                classGroupDao.batchUpdateLockByClassGroupIds(classGroupIds, 1);
+//                冻结所选班级的课程
+                courseScheduleDao.batchUpdateLockByCourseIds(allLockCourseIds, 1);
+            }
+        }
+    }
+
+    public void spanGroupClassAdjustPass(Integer masterClassGroupId,List<Integer> studentIds,List<Long> courseIds,List<Map<Integer, String>> classGroupStudents){
+        //将学员加进班级未开始的课程,以及班级关联、加群
+        classGroupStudentMapperService.updateClassGroupStudents(masterClassGroupId.longValue(),new HashSet<>(studentIds));
+        //删除学员课程
+        courseScheduleDao.deleteMusicGroupCourseSchedulesWithStudents(courseIds, studentIds);
+        //删除班级关联的学员
+        if (classGroupStudents != null && classGroupStudents.size() > 0) {
+            for (Map<Integer, String> classGroupStudent : classGroupStudents) {
+                Set<Integer> integers = classGroupStudent.keySet();
+                for (Integer integer : integers) {
+                    classGroupStudentMapperDao.deleteByClassGroupIdAndStudents(integer, classGroupStudent.get(integer));
+                }
+            }
+        }
+        //获取没有学员的课程
+        List<Long> delCourseIds = courseScheduleDao.findNoStudentCourseIds(courseIds);
+        if (delCourseIds != null && delCourseIds.size() > 0) {
+            //删除课程
+            courseScheduleDao.deleteCourseSchedulesByClassGroupIds(delCourseIds);
+            //删除教师考勤
+            teacherAttendanceDao.batchDeleteByCourseSchedules(delCourseIds);
+            //删除教师课酬
+            courseScheduleTeacherSalaryDao.batchDeleteByCourseScheduleIds(delCourseIds);
+        }
+    }
 }
 }

+ 15 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ContractServiceImpl.java

@@ -8,6 +8,7 @@ import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.*;
 import java.util.Map.Entry;
 import java.util.Map.Entry;
 
 
+import com.ym.mec.auth.api.enums.CertificateTypeEnum;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
@@ -220,7 +221,8 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 			if (user == null) {
 			if (user == null) {
 				throw new BizException("用户信息查询失败");
 				throw new BizException("用户信息查询失败");
 			}
 			}
-			sysUserTsign = register(userId, user.getRealName(), user.getIdCardNo(), user.getPhone());
+			if(CertificateTypeEnum.IDENTITY.getCode().equals(user.getCertificateType()))
+				sysUserTsign = register(userId, user.getRealName(), user.getIdCardNo(), user.getPhone());
 		}
 		}
 
 
 		// 合成freemarker
 		// 合成freemarker
@@ -315,7 +317,8 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 			if (user == null) {
 			if (user == null) {
 				throw new BizException("用户信息查询失败");
 				throw new BizException("用户信息查询失败");
 			}
 			}
-			sysUserTsign = register(userId, user.getRealName(), user.getIdCardNo(), user.getPhone());
+			if(CertificateTypeEnum.IDENTITY.getCode().equals(user.getCertificateType()))
+				sysUserTsign = register(userId, user.getRealName(), user.getIdCardNo(), user.getPhone());
 		}
 		}
 		Date date = new Date();
 		Date date = new Date();
 
 
@@ -511,7 +514,8 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 			if (user == null) {
 			if (user == null) {
 				throw new BizException("用户信息查询失败");
 				throw new BizException("用户信息查询失败");
 			}
 			}
-			sysUserTsign = register(userId, user.getRealName(), user.getIdCardNo(), user.getPhone());
+			if(CertificateTypeEnum.IDENTITY.getCode().equals(user.getCertificateType()))
+				sysUserTsign = register(userId, user.getRealName(), user.getIdCardNo(), user.getPhone());
 		}
 		}
 		Date date = new Date();
 		Date date = new Date();
 
 
@@ -654,7 +658,8 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 			if (user == null) {
 			if (user == null) {
 				throw new BizException("用户信息查询失败");
 				throw new BizException("用户信息查询失败");
 			}
 			}
-			sysUserTsign = register(userId, user.getRealName(), user.getIdCardNo(), user.getPhone());
+			if(CertificateTypeEnum.IDENTITY.getCode().equals(user.getCertificateType()))
+				sysUserTsign = register(userId, user.getRealName(), user.getIdCardNo(), user.getPhone());
 		}
 		}
 		Date date = new Date();
 		Date date = new Date();
 
 
@@ -889,7 +894,8 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 			if (user == null) {
 			if (user == null) {
 				throw new BizException("用户信息查询失败");
 				throw new BizException("用户信息查询失败");
 			}
 			}
-			sysUserTsign = register(userId, user.getRealName(), user.getIdCardNo(), user.getPhone());
+			if(CertificateTypeEnum.IDENTITY.getCode().equals(user.getCertificateType()))
+				sysUserTsign = register(userId, user.getRealName(), user.getIdCardNo(), user.getPhone());
 		}
 		}
 
 
 		Date date = new Date();
 		Date date = new Date();
@@ -976,7 +982,7 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 		}
 		}
 
 
 		SysUserTsign sysUserTsign = sysUserTsignService.get(userId);
 		SysUserTsign sysUserTsign = sysUserTsignService.get(userId);
-		if (sysUserTsign == null) {
+		if (sysUserTsign == null && CertificateTypeEnum.IDENTITY.getCode().equals(user.getCertificateType())) {
 			try {
 			try {
 				sysUserTsign = register(userId, user.getRealName(), user.getIdCardNo(), user.getPhone());
 				sysUserTsign = register(userId, user.getRealName(), user.getIdCardNo(), user.getPhone());
 			} catch (Exception e) {
 			} catch (Exception e) {
@@ -1085,6 +1091,9 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 		if(Objects.isNull(studentInfo)){
 		if(Objects.isNull(studentInfo)){
 			studentInfo = new StudentInfo();
 			studentInfo = new StudentInfo();
 		}
 		}
+		if(StringUtils.isEmpty(studentInfo.getCertificateType())){
+			studentInfo.setCertificateType(CertificateTypeEnum.IDENTITY.getCode());
+		}
 		params.put("studentInfo", studentInfo);
 		params.put("studentInfo", studentInfo);
 		params.put("isShowVisualSeal", true);
 		params.put("isShowVisualSeal", true);
 
 

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

@@ -2786,6 +2786,11 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 				teacherSalary=vipGroupCourseAdjustInfo.getTeachMode().equals(TeachModeEnum.OFFLINE)?salaryMap.get("offlineTeacherSalary"):salaryMap.get("onlineTeacherSalary");
 				teacherSalary=vipGroupCourseAdjustInfo.getTeachMode().equals(TeachModeEnum.OFFLINE)?salaryMap.get("offlineTeacherSalary"):salaryMap.get("onlineTeacherSalary");
 			}
 			}
 
 
+			if(courseSchedule.getEndClassTime().compareTo(vipGroup.getCoursesExpireDate())>0){
+				vipGroup.setCoursesExpireDate(courseSchedule.getEndClassTime());
+				vipGroupDao.update(vipGroup);
+			}
+
 			courseScheduleTeacherSalaryDao.batchUpdateCourseSalarys(courseScheduleIds, teacherSalary);
 			courseScheduleTeacherSalaryDao.batchUpdateCourseSalarys(courseScheduleIds, teacherSalary);
 
 
 		}
 		}
@@ -3256,6 +3261,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			}
 			}
 
 
 			if(Objects.nonNull(vipGroup) && newCourseSchedule.getStartClassTime().after(date)){
 			if(Objects.nonNull(vipGroup) && newCourseSchedule.getStartClassTime().after(date)){
+				if(newCourseSchedule.getEndClassTime().compareTo(vipGroup.getCoursesExpireDate())>0){
+					vipGroup.setCoursesExpireDate(newCourseSchedule.getEndClassTime());
+				}
 				vipGroup.setStatus(VipGroupStatusEnum.PROGRESS);
 				vipGroup.setStatus(VipGroupStatusEnum.PROGRESS);
 				vipGroup.setUpdateTime(date);
 				vipGroup.setUpdateTime(date);
 				vipGroupDao.update(vipGroup);
 				vipGroupDao.update(vipGroup);
@@ -4384,7 +4392,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         }
         }
         if (count > 0) {
         if (count > 0) {
             pageInfo.setTotal(count);
             pageInfo.setTotal(count);
-            params.put("offset", pageInfo.getOffset());
+			params.put("offset", pageInfo.getOffset());
             results = courseScheduleDao.endFindCourseSchedules(params);
             results = courseScheduleDao.endFindCourseSchedules(params);
             List<Long> courseScheduleIds = results.stream().map(CourseScheduleEndDto::getId).collect(Collectors.toList());
             List<Long> courseScheduleIds = results.stream().map(CourseScheduleEndDto::getId).collect(Collectors.toList());
             //Map<Long, String> studentIdMap = MapUtil.convertIntegerMap(courseScheduleStudentPaymentDao.getStudentIdMap(courseScheduleIds));
             //Map<Long, String> studentIdMap = MapUtil.convertIntegerMap(courseScheduleStudentPaymentDao.getStudentIdMap(courseScheduleIds));
@@ -4636,7 +4644,10 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		Date date = new Date();
 		Date date = new Date();
 		List<Long> courseIds1 = courseSchedules.stream().map(e -> e.getId()).collect(Collectors.toList());
 		List<Long> courseIds1 = courseSchedules.stream().map(e -> e.getId()).collect(Collectors.toList());
 		//获取修改日志
 		//获取修改日志
-		List<CourseScheduleModifyLog> modifyLogs = getModifyLogs(courseIds1, courseSchedules, user.getId(), date);
+		List<CourseScheduleModifyLog> modifyLogs = new ArrayList<>();
+		if(!CollectionUtils.isEmpty(courseIds1)){
+			modifyLogs = getModifyLogs(courseIds1, courseSchedules, user.getId(), date);
+		}
 
 
 		PracticeGroup practiceGroup = practiceGroupDao.get(Long.valueOf(practiceGroupId));
 		PracticeGroup practiceGroup = practiceGroupDao.get(Long.valueOf(practiceGroupId));
 
 
@@ -4712,7 +4723,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		//清除考勤申述
 		//清除考勤申述
 		teacherAttendanceDao.clearAttendanceComplaints(courseScheduleIds);
 		teacherAttendanceDao.clearAttendanceComplaints(courseScheduleIds);
 		//保存修改记录
 		//保存修改记录
-		saveModifyLog(modifyLogs,courseIds1);
+		if(!CollectionUtils.isEmpty(modifyLogs))
+			saveModifyLog(modifyLogs,courseIds1);
 
 
         if (teacherIdMap != null && teacherIdMap.size() > 0) {
         if (teacherIdMap != null && teacherIdMap.size() > 0) {
             sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.TEACHER_PUSH_COURSE_SCHEDULE_CHANGE_RESULT,
             sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.TEACHER_PUSH_COURSE_SCHEDULE_CHANGE_RESULT,

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

@@ -405,14 +405,14 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
             BigDecimal deductCost = new BigDecimal(0);
             BigDecimal deductCost = new BigDecimal(0);
             List<TeacherAttendance> courseTeacherAttendances = teacherCourseAttendanceMap.get(org.apache.commons.lang3.StringUtils.joinWith(":", courseScheduleTeacherSalary.getCourseScheduleId(), courseScheduleTeacherSalary.getUserId()));
             List<TeacherAttendance> courseTeacherAttendances = teacherCourseAttendanceMap.get(org.apache.commons.lang3.StringUtils.joinWith(":", courseScheduleTeacherSalary.getCourseScheduleId(), courseScheduleTeacherSalary.getUserId()));
 
 
-            TeacherAttendance teacherAttendance = courseTeacherAttendances.get(0);
-            if(CollectionUtils.isEmpty(courseTeacherAttendances)||Objects.isNull(teacherAttendance.getSignInStatus())){
+//            TeacherAttendance teacherAttendance = courseTeacherAttendances.get(0);
+            if(CollectionUtils.isEmpty(courseTeacherAttendances)||Objects.isNull(courseTeacherAttendances.get(0).getSignInStatus())){
                 //未签到扣除全部课酬
                 //未签到扣除全部课酬
                 deductCost = deductCost.add(expectSalary);
                 deductCost = deductCost.add(expectSalary);
                 deductReasons.add("未签到扣除全部课酬");
                 deductReasons.add("未签到扣除全部课酬");
-            }else if(YesOrNoEnum.NO.equals(teacherAttendance.getSignInStatus())){
+            }else if(YesOrNoEnum.NO.equals(courseTeacherAttendances.get(0).getSignInStatus())){
                 //异常签到
                 //异常签到
-                int signCourseTimeBetweenSeconds = DateUtil.secondsBetween(teacherAttendance.getSignInTime(), courseScheduleTeacherSalary.getCourseSchedule().getStartClassTime());
+                int signCourseTimeBetweenSeconds = DateUtil.secondsBetween(courseTeacherAttendances.get(0).getSignInTime(), courseScheduleTeacherSalary.getCourseSchedule().getStartClassTime());
                 float signCourseTimeBetween = (float)signCourseTimeBetweenSeconds/(float)60;
                 float signCourseTimeBetween = (float)signCourseTimeBetweenSeconds/(float)60;
                 if(signCourseTimeBetween<=1&&signCourseTimeBetween>-3){
                 if(signCourseTimeBetween<=1&&signCourseTimeBetween>-3){
                     //课程开始前1分钟至开始后3分钟进入教室
                     //课程开始前1分钟至开始后3分钟进入教室
@@ -430,13 +430,13 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                 }
                 }
             }
             }
 
 
-            if(CollectionUtils.isEmpty(courseTeacherAttendances)||Objects.isNull(teacherAttendance.getSignOutStatus())){
+            if(CollectionUtils.isEmpty(courseTeacherAttendances)||Objects.isNull(courseTeacherAttendances.get(0).getSignOutStatus())){
                 //未签退扣除全部课酬
                 //未签退扣除全部课酬
                 deductCost = deductCost.add(expectSalary);
                 deductCost = deductCost.add(expectSalary);
                 deductReasons.add("未签退扣除全部课酬");
                 deductReasons.add("未签退扣除全部课酬");
-            }else if(YesOrNoEnum.NO.equals(teacherAttendance.getSignOutStatus())){
+            }else if(YesOrNoEnum.NO.equals(courseTeacherAttendances.get(0).getSignOutStatus())){
                 //异常签退
                 //异常签退
-                int signOutCourseTimeBetweenSeconds = DateUtil.secondsBetween(teacherAttendance.getSignOutTime(), courseScheduleTeacherSalary.getCourseSchedule().getEndClassTime());
+                int signOutCourseTimeBetweenSeconds = DateUtil.secondsBetween(courseTeacherAttendances.get(0).getSignOutTime(), courseScheduleTeacherSalary.getCourseSchedule().getEndClassTime());
                 float signOutCourseTimeBetween = (float)signOutCourseTimeBetweenSeconds/(float)60;
                 float signOutCourseTimeBetween = (float)signOutCourseTimeBetweenSeconds/(float)60;
 
 
                 if(signOutCourseTimeBetween>3){
                 if(signOutCourseTimeBetween>3){

+ 41 - 16
mec-biz/src/main/java/com/ym/mec/biz/service/impl/EmployeeServiceImpl.java

@@ -18,6 +18,7 @@ import com.ym.mec.biz.dal.enums.ParamEnum;
 import com.ym.mec.biz.dal.page.EmployeeQueryInfo;
 import com.ym.mec.biz.dal.page.EmployeeQueryInfo;
 import com.ym.mec.biz.service.EmployeeService;
 import com.ym.mec.biz.service.EmployeeService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.entity.ImGroupMember;
 import com.ym.mec.common.entity.ImGroupModel;
 import com.ym.mec.common.entity.ImGroupModel;
 import com.ym.mec.common.entity.ImResult;
 import com.ym.mec.common.entity.ImResult;
 import com.ym.mec.common.entity.ImUserModel;
 import com.ym.mec.common.entity.ImUserModel;
@@ -201,17 +202,17 @@ public class EmployeeServiceImpl extends BaseServiceImpl<Integer, Employee>  imp
 	public Map<String, Object> levelDetail(Integer userId) {
 	public Map<String, Object> levelDetail(Integer userId) {
 		Map<String,Object> resultMap = new HashMap<>(4);
 		Map<String,Object> resultMap = new HashMap<>(4);
 		//维修技师所在分部列表
 		//维修技师所在分部列表
-		List<Integer> repairOrgans = employeeDao.queryRepairOrganList(userId);
-		resultMap.put("repairOrgans",repairOrgans);
+		List<Integer> repair = employeeDao.queryRepairOrganList(userId);
+		resultMap.put("repair",repair);
 		//教务老师所在分部列表
 		//教务老师所在分部列表
-		List<Integer> educationOrgans = employeeDao.queryEducationOrganList(userId);
-		resultMap.put("educationOrgans",educationOrgans);
+		List<Integer> education = employeeDao.queryEducationOrganList(userId);
+		resultMap.put("education",education);
 		//运营主管所在分部列表
 		//运营主管所在分部列表
-		List<Integer> teamTeacherOrgans = employeeDao.queryTeamTeacherOrganList(userId);
-		resultMap.put("teamTeacherOrgans",teamTeacherOrgans);
+		List<Integer> teamTeacher = employeeDao.queryTeamTeacherOrganList(userId);
+		resultMap.put("teamTeacher",teamTeacher);
 		//乐队指导所在分部列表
 		//乐队指导所在分部列表
-		List<Integer> directorOrgans = employeeDao.queryDirectorOrganList(userId);
-		resultMap.put("directorOrgans",directorOrgans);
+		List<Integer> director = employeeDao.queryDirectorOrganList(userId);
+		resultMap.put("director",director);
 		return resultMap;
 		return resultMap;
 	}
 	}
 
 
@@ -230,30 +231,54 @@ public class EmployeeServiceImpl extends BaseServiceImpl<Integer, Employee>  imp
 			for (Integer organId : organIds) {
 			for (Integer organId : organIds) {
 				List<EmployeeLevelDto> levelDtoList = organIdMap.get(organId);
 				List<EmployeeLevelDto> levelDtoList = organIdMap.get(organId);
 				for (EmployeeLevelDto employeeLevelDto : levelDtoList) {
 				for (EmployeeLevelDto employeeLevelDto : levelDtoList) {
+					if(employeeLevelDto.getLevelUserId() == employeeLevelDto.getTransferUserId()){
+						throw new BizException("交接人校验失败,请重新填写");
+					}
 					switch (roleName){
 					switch (roleName){
 						case "education":
 						case "education":
 							//教务老师所需加入的群组
 							//教务老师所需加入的群组
-							imGroupModels.addAll(classGroupDao.queryEducationGroups(levelUserId,organId));
+							imGroupModels.addAll(classGroupDao.queryEducationGroups(employeeLevelDto.getTransferUserId(),levelUserId,organId));
 							break;
 							break;
 						case "teamTeacher":
 						case "teamTeacher":
 							//运营主管所需加入的群组
 							//运营主管所需加入的群组
-							imGroupModels.addAll(classGroupDao.queryTeamTeacherGroups(levelUserId,organId));
+							imGroupModels.addAll(classGroupDao.queryTeamTeacherGroups(employeeLevelDto.getTransferUserId(),levelUserId,organId));
 							break;
 							break;
 						case "director":
 						case "director":
 							//乐队指导所需加入的群组
 							//乐队指导所需加入的群组
-							imGroupModels.addAll(classGroupDao.queryDirectorGroups(levelUserId,organId));
+							imGroupModels.addAll(classGroupDao.queryDirectorGroups(employeeLevelDto.getTransferUserId(),levelUserId,organId));
 							break;
 							break;
 					}
 					}
 				}
 				}
 			}
 			}
 		}
 		}
-		//❤️用户加群
-//		imFeignService.groupBatchJoin(imGroupModels);
+		if(imGroupModels.size() > 0){
+			//❤️用户加群
+			for (ImGroupModel imGroupModel : imGroupModels) {
+				List<ImGroupMember> memberList = imGroupModel.getMemberList();
+				if(memberList != null && memberList.size() > 0){
+					ImGroupMember[] imGroupMembers = new ImGroupMember[memberList.size()];
+					imGroupModel.setMembers(memberList.toArray(imGroupMembers));
+				}
+			}
+		imFeignService.groupBatchJoin(imGroupModels);
+		}
 		//原有员工退群
 		//原有员工退群
 		List<ImGroupModel> groupModels = classGroupDao.queryTeacherQuitGroups(levelUserId);
 		List<ImGroupModel> groupModels = classGroupDao.queryTeacherQuitGroups(levelUserId);
-//		imFeignService.groupBatchQuit(groupModels);
-//		employeeDao.employeeLevel(employeeLevelDtos);
-		//用户退群和加群
+		if(groupModels.size() > 0){
+			for (ImGroupModel imGroupModel : groupModels) {
+				List<ImGroupMember> memberList = imGroupModel.getMemberList();
+				if(memberList != null && memberList.size() > 0){
+					ImGroupMember[] imGroupMembers = new ImGroupMember[memberList.size()];
+					imGroupModel.setMembers(memberList.toArray(imGroupMembers));
+				}
+			}
+			imFeignService.groupBatchQuit(groupModels);
+		}
+		//更换教务老师等数据
+		employeeDao.employeeLevel(employeeLevelDtos);
+		//新增离职时间
 		employeeDao.updateUserDemissionDate(levelUserId);
 		employeeDao.updateUserDemissionDate(levelUserId);
+		//冻结用户
+		employeeDao.updateUserLock(levelUserId,1);
 	}
 	}
 }
 }

+ 113 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexServiceImpl.java

@@ -0,0 +1,113 @@
+package com.ym.mec.biz.service.impl;
+
+import com.sun.org.apache.xerces.internal.xs.StringList;
+import com.ym.mec.biz.dal.dao.IndexDao;
+import com.ym.mec.biz.dal.dto.IndexBaseDto;
+import com.ym.mec.biz.dal.dto.IndexBaseMonthDto;
+import com.ym.mec.biz.service.IndexService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/1/7 0007
+ */
+@Service
+public class IndexServiceImpl implements IndexService {
+    
+    @Autowired
+    private IndexDao indexDao;
+
+    @Override
+    public Map<String, List<IndexBaseDto>> getIndexBaseData(Set<String> dataTypes, String organIdsStr, String startMonth, String endMonth) {
+        Map<String, List<IndexBaseDto>> result = new HashMap<>();
+
+        if(StringUtils.isBlank(startMonth)){
+            LocalDateTime nowDateTime = LocalDateTime.now();
+            startMonth = nowDateTime.getYear() + "-01";
+            endMonth = null;
+        }
+        Set<Integer> organIds = null;
+        if(StringUtils.isNotBlank(organIdsStr)){
+            organIds = Arrays.stream(organIdsStr.split(",")).map(Integer::new).collect(Collectors.toSet());
+        }
+
+        if(dataTypes.contains("ALL") || dataTypes.contains("OPERATION_DATA")){
+            //运营数据
+            List<IndexBaseDto> operationData = new LinkedList<>();
+            operationData.add(new IndexBaseDto("合作单位"));
+            operationData.add(new IndexBaseDto("乐团数量"));
+            operationData.add(new IndexBaseDto("乐团学员"));
+            operationData.add(new IndexBaseDto("其他学员"));
+            result.put("OPERATION_DATA", operationData);
+        }
+
+        if(dataTypes.contains("ALL") || dataTypes.contains("BUSINESS_DATA")){
+            //业务数据
+            List<IndexBaseDto> businessData = new LinkedList<>();
+            businessData.add(getUserSignUpDate(new IndexBaseDto("激活率"), organIds, startMonth, endMonth));
+            businessData.add(getHomeworkDate(new IndexBaseDto("作业布置率"), organIds, startMonth, endMonth, "assign"));
+            businessData.add(getHomeworkDate(new IndexBaseDto("作业提交率"), organIds, startMonth, endMonth, "submit"));
+            businessData.add(getHomeworkDate(new IndexBaseDto("作业点评率"), organIds, startMonth, endMonth, "comment"));
+            result.put("BUSINESS_DATA", businessData);
+        }
+
+        if(dataTypes.contains("ALL") || dataTypes.contains("FINANCE_DATA")){
+            //财务数据
+            List<IndexBaseDto> financeData = new LinkedList<>();
+            financeData.add(new IndexBaseDto("应收金额"));
+            financeData.add(new IndexBaseDto("预收金额"));
+            financeData.add(new IndexBaseDto("预付金额"));
+            financeData.add(new IndexBaseDto("应付金额"));
+            financeData.add(new IndexBaseDto("营收金额"));
+            result.put("FINANCE_DATA", financeData);
+        }
+
+        if(dataTypes.contains("ALL") || dataTypes.contains("PERSONNEL_DATA")){
+            //人事数据
+            List<IndexBaseDto> personnelData = new LinkedList<>();
+            personnelData.add(new IndexBaseDto("老师总数"));
+            personnelData.add(new IndexBaseDto("全职人数"));
+            personnelData.add(new IndexBaseDto("兼职人数"));
+            personnelData.add(new IndexBaseDto("离职人数"));
+            result.put("PERSONNEL_DATA", personnelData);
+        }
+
+        if(dataTypes.contains("ALL") || dataTypes.contains("STUDENT_VARIATION")){
+            //学员变动
+            List<IndexBaseDto> studentVariation = new LinkedList<>();
+            studentVariation.add(new IndexBaseDto("新增学员"));
+            studentVariation.add(new IndexBaseDto("退团学员"));
+            studentVariation.add(new IndexBaseDto("学员转化"));
+            result.put("STUDENT_VARIATION", studentVariation);
+        }
+
+        if(dataTypes.contains("ALL") || dataTypes.contains("COURSE_DATA")){
+            //本月课程
+            List<IndexBaseDto> courseData = new LinkedList<>();
+            courseData.add(new IndexBaseDto("乐团课"));
+            courseData.add(new IndexBaseDto("VIP课"));
+            courseData.add(new IndexBaseDto("网管课"));
+            result.put("COURSE_DATA", courseData);
+        }
+
+        return result;
+    }
+
+    private IndexBaseDto getUserSignUpDate(IndexBaseDto indexBaseData, Set<Integer> organIds, String startMonth, String endMonth){
+        indexBaseData.setIndexMonthData(indexDao.getStudentSignUpData(organIds, startMonth, endMonth));
+        return indexBaseData;
+    }
+
+    private IndexBaseDto getHomeworkDate(IndexBaseDto indexBaseData, Set<Integer> organIds, String startMonth, String endMonth, String type){
+        indexBaseData.setIndexMonthData(indexDao.getHomeworkDate(organIds, startMonth, endMonth, type));
+        return indexBaseData;
+    }
+}

+ 52 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.service.impl;
 package com.ym.mec.biz.service.impl;
 
 
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.STUDENT;
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.STUDENT;
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.AUDITING;
 import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.NON_PAYMENT;
 import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.NON_PAYMENT;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
@@ -15,6 +16,7 @@ import java.util.Objects;
 import java.util.Set;
 import java.util.Set;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
+import com.ym.mec.biz.dal.entity.*;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -29,13 +31,7 @@ import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
 import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dto.FeeStudentDto;
 import com.ym.mec.biz.dal.dto.FeeStudentDto;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
-import com.ym.mec.biz.dal.entity.MusicGroup;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.service.MusicGroupPaymentCalenderDetailService;
 import com.ym.mec.biz.service.MusicGroupPaymentCalenderDetailService;
@@ -379,6 +375,56 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 
 
 	@Override
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	@Transactional(rollbackFor = Exception.class)
+	public void batchAdd(MusicGroupPaymentCalender musicGroupPaymentCalender,List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails) {
+		Map<Integer, List<MusicGroupPaymentCalenderStudentDetail>> collect = musicGroupPaymentCalenderStudentDetails.stream().collect(Collectors.groupingBy(e -> e.getUserId()));
+		//生成music_group_payment_calender_detail
+//		List<MusicGroupPaymentStudentCourseDetail> musicGroupPaymentStudentCourseDetailList = new ArrayList<MusicGroupPaymentStudentCourseDetail>();
+//		MusicGroupPaymentStudentCourseDetail musicGroupPaymentStudentCourseDetail = null;
+		MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = null;
+		Long musicGroupPaymentCalenderId = musicGroupPaymentCalender.getId();
+		for (Integer studentId : collect.keySet()) {
+			musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();
+			musicGroupPaymentCalenderDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalenderId);
+			musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.NON_PAYMENT);
+			List<MusicGroupPaymentCalenderStudentDetail> calenderStudentDetails = collect.get(studentId);
+			BigDecimal totalPrice = calenderStudentDetails.stream().map(e->e.getCourseCurrentPrice()).reduce(BigDecimal.ZERO, BigDecimal::add);
+			musicGroupPaymentCalenderDetail.setExpectAmount(totalPrice);
+			if(musicGroupPaymentCalender.getStatus() != AUDITING){
+				if (totalPrice.doubleValue() == 0d) {
+					musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
+					musicGroupPaymentCalenderDetail.setActualAmount(totalPrice);
+				}
+			}
+			musicGroupPaymentCalenderDetail.setMusicGroupId(musicGroupPaymentCalender.getMusicGroupId());
+			musicGroupPaymentCalenderDetail.setUserId(studentId);
+			musicGroupPaymentCalenderDetail.setStartPaymentDate(musicGroupPaymentCalender.getStartPaymentDate());
+			musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
+			musicGroupPaymentCalenderDetail.setResponsibleUserId(musicGroupPaymentCalender.getOperator());
+			musicGroupPaymentCalenderDetailDao.insert(musicGroupPaymentCalenderDetail);
+//			Long musicGroupPaymentCalenderDetailId = musicGroupPaymentCalenderDetail.getId();
+//			for (MusicGroupPaymentCalenderStudentDetail calenderStudentDetail : calenderStudentDetails) {
+//				//创建学生课排课分钟数
+//				musicGroupPaymentStudentCourseDetail = new MusicGroupPaymentStudentCourseDetail();
+//				musicGroupPaymentStudentCourseDetail.setCourseType(CourseSchedule.CourseScheduleType.valueOf(calenderStudentDetail.getCourseType()));
+//				musicGroupPaymentStudentCourseDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalenderId);
+//				musicGroupPaymentStudentCourseDetail.setMusicGroupPaymentCalenderDetailId(musicGroupPaymentCalenderDetailId);
+//				musicGroupPaymentStudentCourseDetail.setTotalCourseMinutes(0);
+//				musicGroupPaymentStudentCourseDetail.setUsedCourseMinutes(calenderStudentDetail.getCourseTime().intValue());
+//				musicGroupPaymentStudentCourseDetail.setUserId(studentId);
+//				musicGroupPaymentStudentCourseDetailList.add(musicGroupPaymentStudentCourseDetail);
+//			}
+		}
+		musicGroupPaymentCalender.setExpectNum(collect.keySet().size());
+		musicGroupPaymentCalenderService.update(musicGroupPaymentCalender);
+//		musicGroupPaymentStudentCourseDetailDao.batchInsert(musicGroupPaymentStudentCourseDetailList);
+		//给学员推送缴费通知
+		if(musicGroupPaymentCalender.getStatus() == PaymentCalenderStatusEnum.OPEN){
+			musicGroupPaymentCalenderService.pushWaitRenewMessage(musicGroupPaymentCalenderId,musicGroupDao.get(musicGroupPaymentCalender.getMusicGroupId()),collect.keySet());
+		}
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
 	public void batchAdd(String batchNo, Set<Integer> userIdList) {
 	public void batchAdd(String batchNo, Set<Integer> userIdList) {
 		
 		
 		List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
 		List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);

+ 64 - 58
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -4,10 +4,7 @@ import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.SC
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.STUDENT;
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.STUDENT;
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.AUDITING;
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.AUDITING;
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.REJECT;
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.REJECT;
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.ADD_COURSE;
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.ADD_STUDENT;
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY;
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.MUSIC_RENEW;
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType.*;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.ArrayList;
@@ -23,6 +20,9 @@ import java.util.Map.Entry;
 import java.util.Set;
 import java.util.Set;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
+import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.dto.*;
+import com.ym.mec.biz.dal.entity.*;
 import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -34,50 +34,12 @@ import com.alibaba.fastjson.JSON;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUserRole;
 import com.ym.mec.auth.api.entity.SysUserRole;
-import com.ym.mec.biz.dal.dao.ClassGroupDao;
-import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
-import com.ym.mec.biz.dal.dao.CourseScheduleDao;
-import com.ym.mec.biz.dal.dao.CourseScheduleStudentPaymentDao;
-import com.ym.mec.biz.dal.dao.CourseScheduleTeacherSalaryDao;
-import com.ym.mec.biz.dal.dao.MusicGroupBuildLogDao;
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
-import com.ym.mec.biz.dal.dao.MusicGroupOrganizationCourseSettingsDao;
-import com.ym.mec.biz.dal.dao.MusicGroupOrganizationCourseSettingsDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentStudentCourseDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupStudentClassAdjustDao;
-import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
-import com.ym.mec.biz.dal.dao.OrganizationCourseUnitPriceSettingsDao;
-import com.ym.mec.biz.dal.dao.OrganizationDao;
-import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
-import com.ym.mec.biz.dal.dao.SysConfigDao;
-import com.ym.mec.biz.dal.dao.TeacherAttendanceDao;
-import com.ym.mec.biz.dal.dto.CalenderPushDto;
-import com.ym.mec.biz.dal.dto.ClassGroup4MixDto;
-import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDetailDto;
-import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto;
-import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDto.MusicGroupPaymentDateRange;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDto.MusicGroupPaymentDateRange;
-import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
-import com.ym.mec.biz.dal.entity.MusicGroup;
-import com.ym.mec.biz.dal.entity.MusicGroupBuildLog;
-import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings;
-import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentType;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupStudentClassAdjust;
-import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
-import com.ym.mec.biz.dal.entity.Organization;
-import com.ym.mec.biz.dal.entity.OrganizationCourseUnitPriceSettings;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
 import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
 import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
 import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
@@ -140,9 +102,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 
 
 	@Autowired
 	@Autowired
 	private TeacherAttendanceDao teacherAttendanceDao;
 	private TeacherAttendanceDao teacherAttendanceDao;
-
-	@Autowired
-	private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
 	@Autowired
 	@Autowired
 	private MusicGroupBuildLogDao musicGroupBuildLogDao;
 	private MusicGroupBuildLogDao musicGroupBuildLogDao;
 	@Autowired
 	@Autowired
@@ -150,19 +109,17 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	@Autowired
 	@Autowired
 	private OrganizationDao organizationDao;
 	private OrganizationDao organizationDao;
 	@Autowired
 	@Autowired
-	private StudentRegistrationDao studentRegistrationDao;
-	@Autowired
 	private SysMessageService sysMessageService;
 	private SysMessageService sysMessageService;
 	@Autowired
 	@Autowired
 	private SysUserFeignService sysUserFeignService;
 	private SysUserFeignService sysUserFeignService;
 	@Autowired
 	@Autowired
-	private CourseScheduleStudentPaymentServiceImpl courseScheduleStudentPaymentService;
-	@Autowired
 	private ClassGroupStudentMapperDao classGroupStudentMapperDao;
 	private ClassGroupStudentMapperDao classGroupStudentMapperDao;
 	@Autowired
 	@Autowired
 	private MusicGroupStudentClassAdjustDao musicGroupStudentClassAdjustDao;
 	private MusicGroupStudentClassAdjustDao musicGroupStudentClassAdjustDao;
 	@Autowired
 	@Autowired
 	private MusicGroupPaymentCalenderDetailService musicGroupPaymentCalenderDetailService;
 	private MusicGroupPaymentCalenderDetailService musicGroupPaymentCalenderDetailService;
+	@Autowired
+	private MusicGroupPaymentCalenderStudentDetailDao musicGroupPaymentCalenderStudentDetailDao;
 
 
 	@Override
 	@Override
 	public BaseDAO<Long, MusicGroupPaymentCalender> getDAO() {
 	public BaseDAO<Long, MusicGroupPaymentCalender> getDAO() {
@@ -303,7 +260,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			List<MusicGroupPaymentCalenderCourseSettings> newCSList = new ArrayList<MusicGroupPaymentCalenderCourseSettings>(
 			List<MusicGroupPaymentCalenderCourseSettings> newCSList = new ArrayList<MusicGroupPaymentCalenderCourseSettings>(
 					musicGroupPaymentCalenderCourseSettingsList.size());
 					musicGroupPaymentCalenderCourseSettingsList.size());
 
 
-			BigDecimal totalPaymentAmount = new BigDecimal(0);
+			BigDecimal totalPaymentAmount = musicGroupPaymentCalenderDto.getMasterTotalPrice();
 			for (MusicGroupPaymentCalenderCourseSettings pccs : musicGroupPaymentCalenderCourseSettingsList) {
 			for (MusicGroupPaymentCalenderCourseSettings pccs : musicGroupPaymentCalenderCourseSettingsList) {
 				
 				
 				MusicGroupPaymentCalenderCourseSettings tempPccs = new MusicGroupPaymentCalenderCourseSettings();
 				MusicGroupPaymentCalenderCourseSettings tempPccs = new MusicGroupPaymentCalenderCourseSettings();
@@ -366,7 +323,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && payUserType == PayUserType.STUDENT) {
 			if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && payUserType == PayUserType.STUDENT) {
 				musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
 				musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
 			}
 			}
-			if (paymentType != ADD_STUDENT && paymentType != ADD_COURSE) {
+			if (paymentType != ADD_STUDENT && paymentType != ADD_COURSE && paymentType != SPAN_GROUP_CLASS_ADJUST) {
 				int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPayUserType(),
 				int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPayUserType(),
 						musicGroupPaymentCalender.getPaymentValidStartDate(), musicGroupPaymentCalender.getPaymentValidEndDate(), null);
 						musicGroupPaymentCalender.getPaymentValidStartDate(), musicGroupPaymentCalender.getPaymentValidEndDate(), null);
 				if (count > 0) {
 				if (count > 0) {
@@ -412,10 +369,21 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				musicGroupPaymentCalenderCourseSettingsDao.batchInsert(currentMusicGroupPaymentCalenderCourseSettings);
 				musicGroupPaymentCalenderCourseSettingsDao.batchInsert(currentMusicGroupPaymentCalenderCourseSettings);
 			}
 			}
 
 
+			//如果是跨团班级合并,保存用户缴费详情
+			List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails = null;
+			if (musicGroupPaymentCalender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST){
+				musicGroupPaymentCalenderStudentDetails = musicGroupPaymentCalenderDto.getMusicGroupPaymentCalenderStudentDetails();
+				//记录学员缴费详情
+				musicGroupPaymentCalenderStudentDetailDao.batchInsert(musicGroupPaymentCalenderStudentDetails,musicGroupPaymentCalender.getBatchNo());
+			}
+
 			if (musicGroupPaymentCalender.getStatus() != AUDITING) {
 			if (musicGroupPaymentCalender.getStatus() != AUDITING) {
 				// 如果是进行中加学生
 				// 如果是进行中加学生
 				if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
 				if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
 					addStudent(musicGroupPaymentCalender, currentMusicGroupPaymentCalenderCourseSettings);
 					addStudent(musicGroupPaymentCalender, currentMusicGroupPaymentCalenderCourseSettings);
+				}else if(musicGroupPaymentCalender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST){
+					//如果是跨团班级合并,添加学员
+					musicGroupPaymentCalenderDetailService.batchAdd(musicGroupPaymentCalender,musicGroupPaymentCalenderStudentDetails);
 				}else if(musicGroupPaymentCalenderDto.getMergeClassFlag()){
 				}else if(musicGroupPaymentCalenderDto.getMergeClassFlag()){
 					//缴费项目添加学员
 					//缴费项目添加学员
 					int[] ints = Arrays.stream(musicGroupPaymentCalenderDto.getStudentIds().split(",")).mapToInt(Integer::parseInt).toArray();
 					int[] ints = Arrays.stream(musicGroupPaymentCalenderDto.getStudentIds().split(",")).mapToInt(Integer::parseInt).toArray();
@@ -581,6 +549,23 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 						break;
 						break;
 					}
 					}
 				}
 				}
+			}else if(paymentType == SPAN_GROUP_CLASS_ADJUST){
+				MusicGroupStudentClassAdjust adjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
+				//获取默认的学员缴费详情
+				List<Map<Integer,String>> classGroupStudents = (List<Map<Integer,String>>)JSON.parse(adjust.getClassGroupStudents());
+				List<Integer> studentIds = JSON.parseArray(adjust.getStudentIds(), Integer.class);
+				List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails = classGroupService.queryStudentPaymentCalenders(adjust.getMasterClassGroupId(),
+						classGroupStudents,studentIds);
+				List<MusicGroupPaymentCalenderStudentDetail> calenderStudentDetails = musicGroupPaymentCalenderDto.getMusicGroupPaymentCalenderStudentDetails();
+				boolean containsAll = musicGroupPaymentCalenderStudentDetails.containsAll(calenderStudentDetails);
+				if(!containsAll){
+					status = AUDITING;
+					//保存新的学员详情
+				}
+				//删除之前的记录
+				musicGroupPaymentCalenderStudentDetailDao.delByBatchNo(batchNo);
+				//保存现有记录
+				musicGroupPaymentCalenderStudentDetailDao.batchInsert(calenderStudentDetails,batchNo);
 			}
 			}
 		}
 		}
 
 
@@ -673,7 +658,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && payUserType == PayUserType.STUDENT) {
 			if (musicGroupPaymentCalender.getDeadlinePaymentDate() == null && payUserType == PayUserType.STUDENT) {
 				musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
 				musicGroupPaymentCalender.setDeadlinePaymentDate(DateUtil.addDays(musicGroupPaymentCalender.getStartPaymentDate(), 3));
 			}
 			}
-			if (paymentType != ADD_STUDENT && paymentType != ADD_COURSE) {
+			if (paymentType != ADD_STUDENT && paymentType != ADD_COURSE && paymentType != SPAN_GROUP_CLASS_ADJUST) {
 				int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPayUserType(),
 				int count = musicGroupPaymentCalenderDao.queryIntersectionByValidDate(musicGroupId, musicGroupPaymentCalender.getPayUserType(),
 						musicGroupPaymentCalender.getPaymentValidStartDate(), musicGroupPaymentCalender.getPaymentValidEndDate(), null);
 						musicGroupPaymentCalender.getPaymentValidStartDate(), musicGroupPaymentCalender.getPaymentValidEndDate(), null);
 				if (count > 0) {
 				if (count > 0) {
@@ -709,6 +694,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				// 如果是进行中加学生
 				// 如果是进行中加学生
 				if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
 				if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
 					addStudent(musicGroupPaymentCalender, currentMusicGroupPaymentCalenderCourseSettings);
 					addStudent(musicGroupPaymentCalender, currentMusicGroupPaymentCalenderCourseSettings);
+				}else if(musicGroupPaymentCalender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST){
+					//如果是跨团班级合并,添加学员
+					musicGroupPaymentCalenderDetailService.batchAdd(musicGroupPaymentCalender,musicGroupPaymentCalenderDto.getMusicGroupPaymentCalenderStudentDetails());
 				}
 				}
 			}
 			}
 
 
@@ -742,7 +730,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			musicGroup.setUpdateTime(date);
 			musicGroup.setUpdateTime(date);
 			musicGroupDao.update(musicGroup);
 			musicGroupDao.update(musicGroup);
 		} else if (paymentType == ADD_STUDENT) {
 		} else if (paymentType == ADD_STUDENT) {
-
 			if (status != AUDITING) {
 			if (status != AUDITING) {
 				// 学生加到班级
 				// 学生加到班级
 				String classGroupIdStr = musicGroupPaymentCalenderDto.getAttribute1();
 				String classGroupIdStr = musicGroupPaymentCalenderDto.getAttribute1();
@@ -761,8 +748,18 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()),
 			sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()),
 					MessageTypeEnum.BACKSTAGE_PAYMENT_CALENDER_AUDIT, "", organization.getName(), musicGroup.getName());
 					MessageTypeEnum.BACKSTAGE_PAYMENT_CALENDER_AUDIT, "", organization.getName(), musicGroup.getName());
 		}else {
 		}else {
-			//如果是合班缴费
-			autoClassGroupAdjust(batchNo);
+			if(paymentType == ADD_STUDENT){
+				//如果是合班缴费
+				autoClassGroupAdjust(batchNo);
+			}else if(paymentType == SPAN_GROUP_CLASS_ADJUST){
+				//删除和解冻班级,课程信息
+				MusicGroupStudentClassAdjust adjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
+				List<Map<Integer,String>> classGroupStudents = (List<Map<Integer,String>>)JSON.parse(adjust.getClassGroupStudents());
+				List<Integer> studentIds = JSON.parseArray(adjust.getStudentIds(), Integer.class);
+				List<Long> courseIds = JSON.parseArray(adjust.getSubLockCourseIds(), Long.class);
+				classGroupService.spanGroupClassAdjustPass(adjust.getMasterClassGroupId()
+						,studentIds,courseIds,classGroupStudents);
+			}
 		}
 		}
 		return batchNo;
 		return batchNo;
 	}
 	}
@@ -942,6 +939,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		//获取缴费周期
 		//获取缴费周期
 		List<MusicGroupPaymentCalender> groupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
 		List<MusicGroupPaymentCalender> groupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
 		calenderAuditDetailDto.setMusicGroupPaymentCalenders(groupPaymentCalenders);
 		calenderAuditDetailDto.setMusicGroupPaymentCalenders(groupPaymentCalenders);
+		//获取跨团合班学员缴费详情
+		calenderAuditDetailDto.setMusicGroupPaymentCalenderStudentDetails(musicGroupPaymentCalenderStudentDetailDao.findByBatchNo(batchNo));
 		return calenderAuditDetailDto;
 		return calenderAuditDetailDto;
 	}
 	}
 
 
@@ -1058,17 +1057,24 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, "", sysUser.getUsername());
 				sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_CREATE_MUSIC_GROUP_APPLY, "", sysUser.getUsername());
 			}
 			}
 		} else if (calender.getPaymentType() == ADD_STUDENT) {
 		} else if (calender.getPaymentType() == ADD_STUDENT) {
-
 			// 学生加到班级
 			// 学生加到班级
 			String classGroupIdStr = calender.getAttribute1();
 			String classGroupIdStr = calender.getAttribute1();
 			if (StringUtils.isNotBlank(classGroupIdStr)) {
 			if (StringUtils.isNotBlank(classGroupIdStr)) {
 				classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(calender.getStudentIds()), classGroupIdStr, batchNo,
 				classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(calender.getStudentIds()), classGroupIdStr, batchNo,
 						musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo));
 						musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo));
 			}
 			}
+			//如果是合班缴费
+			autoClassGroupAdjust(batchNo);
+		}else if(calender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST){
+			//删除和解冻班级,课程信息
+			MusicGroupStudentClassAdjust adjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
+			List<Map<Integer,String>> classGroupStudents = (List<Map<Integer,String>>)JSON.parse(adjust.getClassGroupStudents());
+			List<Integer> studentIds = JSON.parseArray(adjust.getStudentIds(), Integer.class);
+			List<Long> courseIds = JSON.parseArray(adjust.getSubLockCourseIds(), Long.class);
+			classGroupService.spanGroupClassAdjustPass(adjust.getMasterClassGroupId()
+					,studentIds,courseIds,classGroupStudents);
 		}
 		}
 		musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
 		musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
-		//如果是合班缴费
-		autoClassGroupAdjust(batchNo);
 	}
 	}
 
 
 	@Override
 	@Override

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

@@ -0,0 +1,23 @@
+package com.ym.mec.biz.service.impl;
+
+
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderStudentDetailDao;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
+import com.ym.mec.biz.service.MusicGroupPaymentCalenderStudentDetailService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class MusicGroupPaymentCalenderStudentDetailServiceImpl extends BaseServiceImpl<Integer, MusicGroupPaymentCalenderStudentDetail> implements MusicGroupPaymentCalenderStudentDetailService {
+	
+	@Autowired
+	private MusicGroupPaymentCalenderStudentDetailDao musicGroupPaymentCalenderStudentDetailDao;
+
+	@Override
+	public BaseDAO<Integer, MusicGroupPaymentCalenderStudentDetail> getDAO() {
+		return musicGroupPaymentCalenderStudentDetailDao;
+	}
+	
+}

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

@@ -144,7 +144,7 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
     }
     }
 
 
     @Override
     @Override
-    public void addApplyStudentNum(String musicGroupId, Integer subjectId, int num) throws Exception {
+    public void addApplyStudentNum(String musicGroupId, Integer subjectId, int num){
         boolean flag = false;
         boolean flag = false;
         for (int i = 10; i >= 1; i--) {
         for (int i = 10; i >= 1; i--) {
             MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanDao.getMusicOneSubjectClassPlan(musicGroupId, subjectId);
             MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanDao.getMusicOneSubjectClassPlan(musicGroupId, subjectId);

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

@@ -3145,6 +3145,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
 
 
             return BaseController.succeed(payMap);
             return BaseController.succeed(payMap);
         } catch (Exception e) {
         } catch (Exception e) {
+            LOGGER.error("网管课购买失败:", e.getCause());
             throw new BizException("订单提交超时,请尝试重新提交购买");
             throw new BizException("订单提交超时,请尝试重新提交购买");
         }
         }
     }
     }

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

@@ -119,6 +119,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
     public void queryOrderStatus() throws Exception {
     public void queryOrderStatus() throws Exception {
         yqPayQuery(null);
         yqPayQuery(null);
         adaPayQuery(null);
         adaPayQuery(null);
+        reConfirmOrder(null, null);
     }
     }
 
 
     private void yqPayQuery(List<StudentPaymentOrder> payingOrders) throws Exception {
     private void yqPayQuery(List<StudentPaymentOrder> payingOrders) throws Exception {
@@ -254,19 +255,15 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
         }
         }
         order.setPaymentBusinessChannel(rpMap.get("channelType"));
         order.setPaymentBusinessChannel(rpMap.get("channelType"));
 
 
+        callOrderCallBack(order);
+
         if (status.equals(DealStatusEnum.SUCCESS) && order.getPaymentChannel().equals("ADAPAY")
         if (status.equals(DealStatusEnum.SUCCESS) && order.getPaymentChannel().equals("ADAPAY")
                 && !rpMap.containsKey("simulation")) {
                 && !rpMap.containsKey("simulation")) {
             confirmOrder(order);
             confirmOrder(order);
         }
         }
-
-        callOrderCallBack(order);
     }
     }
 
 
     private Boolean confirmOrder(StudentPaymentOrder order) {
     private Boolean confirmOrder(StudentPaymentOrder order) {
-        String delayRouteStartDate = sysConfigDao.findConfigValue("delay_route_start_date");
-        if (order.getCreateTime().before(Objects.requireNonNull(DateUtil.stringToDate(delayRouteStartDate, "yyyy-MM-dd HH:mm:ss")))) {
-            return true;
-        }
         List<StudentPaymentRouteOrder> routeOrders = studentPaymentRouteOrderDao.getRouteOrders(order.getOrderNo());
         List<StudentPaymentRouteOrder> routeOrders = studentPaymentRouteOrderDao.getRouteOrders(order.getOrderNo());
         for (StudentPaymentRouteOrder routeOrder : routeOrders) {
         for (StudentPaymentRouteOrder routeOrder : routeOrders) {
             Map<String, Object> divMember = new HashMap<>();
             Map<String, Object> divMember = new HashMap<>();
@@ -472,4 +469,27 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
     public List<StudentPaymentOrder> getUserOrderByType(Integer userId, OrderTypeEnum type, DealStatusEnum status) {
     public List<StudentPaymentOrder> getUserOrderByType(Integer userId, OrderTypeEnum type, DealStatusEnum status) {
         return studentPaymentOrderDao.getUserOrderByType(userId, type, status);
         return studentPaymentOrderDao.getUserOrderByType(userId, type, status);
     }
     }
+
+    @Override
+    public List<StudentPaymentOrder> reConfirmOrder(Date startTime, Date endTime) {
+        if (startTime == null) {
+            endTime = new Date();
+            startTime = DateUtil.addMinutes(endTime, -20);
+        }
+
+        List<StudentPaymentOrder> orders = studentPaymentOrderDao.getAdaPayOrdersByTime(startTime, endTime);
+        String tips = "";
+        for (StudentPaymentOrder order : orders) {
+            try {
+                this.confirmOrder(order);
+            } catch (Exception e) {
+                tips += order.getOrderNo() + ":" + e.getMessage() + ",";
+                continue;
+            }
+        }
+        if (StringUtils.isNotBlank(tips)) {
+            throw new BizException(tips);
+        }
+        return orders;
+    }
 }
 }

+ 87 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -16,6 +16,7 @@ import java.util.stream.Collectors;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 
 
+import com.ym.mec.auth.api.enums.CertificateTypeEnum;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
@@ -121,6 +122,10 @@ import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.http.HttpUtil;
 import com.ym.mec.util.http.HttpUtil;
 
 
+import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.NON_PAYMENT;
+import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED;
+import static com.ym.mec.biz.dal.enums.PaymentStatusEnum.YES;
+
 @Service
 @Service
 public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, StudentRegistration> implements StudentRegistrationService {
 public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, StudentRegistration> implements StudentRegistrationService {
 
 
@@ -782,9 +787,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             BigDecimal reduce = studentPaymentOrderDetails.stream().map(StudentPaymentOrderDetail::getPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
             BigDecimal reduce = studentPaymentOrderDetails.stream().map(StudentPaymentOrderDetail::getPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
             MusicGroupStudentFee.PaymentStatus paymentStatus = MusicGroupStudentFee.PaymentStatus.NON_PAYMENT;
             MusicGroupStudentFee.PaymentStatus paymentStatus = MusicGroupStudentFee.PaymentStatus.NON_PAYMENT;
             if (reduce.compareTo(BigDecimal.ZERO) == 0) {
             if (reduce.compareTo(BigDecimal.ZERO) == 0) {
-                paymentStatus = MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED;
+                paymentStatus = PAID_COMPLETED;
                 studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
                 studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
-                studentRegistration.setPaymentStatus(PaymentStatusEnum.YES);
+                studentRegistration.setPaymentStatus(YES);
                 studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
                 studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
                 studentPaymentOrder.setActualAmount(reduce);
                 studentPaymentOrder.setActualAmount(reduce);
                 studentPaymentOrder.setPayTime(date);
                 studentPaymentOrder.setPayTime(date);
@@ -830,6 +835,73 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         }
         }
     }
     }
 
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void insertStudent(String studentIds,String oldMusicGroupId,String newMusicGroupId,BigDecimal masterTotalPrice){
+        SysUser sysUser1 = sysUserFeignService.queryUserInfo();
+        //获取旧乐团学员注册信息
+        List<StudentRegistration> studentRegistrations = studentRegistrationDao.queryByUserIdsAndMusicGroupId(studentIds,oldMusicGroupId);
+        List<StudentCourseFeeDetail> studentCourseFeeDetails = new ArrayList<>();
+        BigDecimal amount = BigDecimal.ZERO;
+        for (StudentRegistration studentRegistration : studentRegistrations) {
+            //记录课程余额消费日志
+            if(studentRegistration.getSurplusCourseFee().doubleValue() > 0d && masterTotalPrice.doubleValue() > 0d){
+                StudentCourseFeeDetail studentCourseFeeDetail = new StudentCourseFeeDetail();
+                if(studentRegistration.getSurplusCourseFee().doubleValue() > masterTotalPrice.doubleValue()){
+                    studentCourseFeeDetail.setAmount(masterTotalPrice.negate());
+                    studentCourseFeeDetail.setSurplusCourseFee(studentRegistration.getSurplusCourseFee().subtract(masterTotalPrice));
+                }else {
+                    studentCourseFeeDetail.setAmount(studentRegistration.getSurplusCourseFee().negate());
+                    studentCourseFeeDetail.setSurplusCourseFee(BigDecimal.ZERO);
+                }
+                amount = studentCourseFeeDetail.getAmount();
+                studentCourseFeeDetail.setStudentRegistrationId(studentRegistration.getId());
+                studentRegistration.setSurplusCourseFee(studentCourseFeeDetail.getSurplusCourseFee());
+                studentCourseFeeDetail.setMemo("跨团合班消费");
+                studentCourseFeeDetail.setOperator(sysUser1.getId());
+                studentCourseFeeDetails.add(studentCourseFeeDetail);
+                //修改原有乐团注册信息
+                studentRegistrationDao.update(studentRegistration);
+            }
+            //用户是否在主乐团
+            StudentRegistration registration = studentRegistrationDao.getByPhoneAndMusicGroupId(newMusicGroupId, studentRegistration.getParentsPhone());
+            if (registration != null) {
+                //修改剩余课程余额
+                registration.setSurplusCourseFee(registration.getSurplusCourseFee().add(amount));
+                studentRegistrationDao.update(registration);
+            }else {
+                //生成学员乐团注册表
+                studentRegistration.setSurplusCourseFee(amount);
+                studentRegistration.setMusicGroupId(newMusicGroupId);
+                studentRegistrationDao.insertBasic(studentRegistration);
+                registration = studentRegistration;
+            }
+            //主班新增余额日志
+            if(studentRegistration.getSurplusCourseFee().doubleValue() > 0d && masterTotalPrice.doubleValue() > 0d){
+                StudentCourseFeeDetail studentCourseFeeDetail = new StudentCourseFeeDetail();
+                studentCourseFeeDetail.setAmount(amount);
+                studentCourseFeeDetail.setSurplusCourseFee(registration.getSurplusCourseFee().add(amount));
+                studentCourseFeeDetail.setStudentRegistrationId(studentRegistration.getId());
+                studentCourseFeeDetail.setMemo("跨团合班费用转移");
+                studentCourseFeeDetail.setOperator(sysUser1.getId());
+                studentCourseFeeDetails.add(studentCourseFeeDetail);
+            }
+            //增加报名学生数
+            musicGroupSubjectPlanService.addApplyStudentNum(newMusicGroupId, studentRegistration.getSubjectId(), 1);
+            //新增Fee表
+            MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(studentRegistration.getUserId(),oldMusicGroupId);
+            if(musicGroupStudentFee == null){
+                musicGroupStudentFee = new MusicGroupStudentFee(newMusicGroupId,
+                        studentRegistration.getUserId(), studentRegistration.getSubjectId(),BigDecimal.ZERO,
+                        null, studentRegistration.getTemporaryCourseFee(), studentRegistration.getPaymentStatus()==YES?PAID_COMPLETED:NON_PAYMENT);
+                musicGroupStudentFeeDao.insert(musicGroupStudentFee);
+            }
+        }
+        if(studentCourseFeeDetails.size() > 0){
+            studentCourseFeeDetailDao.batchInsert(studentCourseFeeDetails);
+        }
+    }
+
     private List<CourseSchedule> addStudent(Integer classGroupId, Integer userId, Date date, List<CourseSchedule> courseScheduleList) {
     private List<CourseSchedule> addStudent(Integer classGroupId, Integer userId, Date date, List<CourseSchedule> courseScheduleList) {
         ClassGroup classGroup = classGroupDao.get(classGroupId);
         ClassGroup classGroup = classGroupDao.get(classGroupId);
         ClassGroupStudentMapper classGroupStudentMapper = classGroupStudentMapperDao.findClassStudentMapperByUserIdAndClassGroupId(userId, classGroupId, null);
         ClassGroupStudentMapper classGroupStudentMapper = classGroupStudentMapperDao.findClassStudentMapperByUserIdAndClassGroupId(userId, classGroupId, null);
@@ -930,7 +1002,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             musicGroupStudentFee.setRemainNetworkClassTimes(musicGroupStudentFee.getRemainNetworkClassTimes() + 1);
             musicGroupStudentFee.setRemainNetworkClassTimes(musicGroupStudentFee.getRemainNetworkClassTimes() + 1);
         }
         }
         //更新学生的缴费记录状态
         //更新学生的缴费记录状态
-        calenderDetail.setPaymentStatus(MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED);
+        calenderDetail.setPaymentStatus(PAID_COMPLETED);
         calenderDetail.setActualAmount(calenderDetail.getExpectAmount());
         calenderDetail.setActualAmount(calenderDetail.getExpectAmount());
         calenderDetail.setPayTime(date);
         calenderDetail.setPayTime(date);
         calenderDetail.setUpdateTime(date);
         calenderDetail.setUpdateTime(date);
@@ -956,7 +1028,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         //成功报名状态变更
         //成功报名状态变更
         StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(studentPaymentOrder.getUserId(), studentPaymentOrder.getMusicGroupId());
         StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(studentPaymentOrder.getUserId(), studentPaymentOrder.getMusicGroupId());
 
 
-        if (studentRegistration.getPaymentStatus().equals(PaymentStatusEnum.YES)) {
+        if (studentRegistration.getPaymentStatus().equals(YES)) {
             return studentPaymentOrder;
             return studentPaymentOrder;
         }
         }
         MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getActualSubjectId());
         MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getActualSubjectId());
@@ -967,7 +1039,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             if (studentRegistration.getTemporaryCourseFee() != null) {
             if (studentRegistration.getTemporaryCourseFee() != null) {
                 studentRegistration.setTemporaryCourseFee(new BigDecimal(0));
                 studentRegistration.setTemporaryCourseFee(new BigDecimal(0));
             }
             }
-            studentRegistration.setPaymentStatus(PaymentStatusEnum.YES);
+            studentRegistration.setPaymentStatus(YES);
             studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
             studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
 
 
             List<StudentPaymentOrderDetail> orderDetails = studentPaymentOrderDetailService.getOrderDetail(studentPaymentOrder.getId());
             List<StudentPaymentOrderDetail> orderDetails = studentPaymentOrderDetailService.getOrderDetail(studentPaymentOrder.getId());
@@ -997,7 +1069,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 waitPayOrder.setStatus(DealStatusEnum.CLOSE);
                 waitPayOrder.setStatus(DealStatusEnum.CLOSE);
                 studentPaymentOrderService.update(waitPayOrder);
                 studentPaymentOrderService.update(waitPayOrder);
                 musicGroupStudentFee.setLatestPaidTime(nowDate);
                 musicGroupStudentFee.setLatestPaidTime(nowDate);
-                musicGroupStudentFee.setPaymentStatus(MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED);
+                musicGroupStudentFee.setPaymentStatus(PAID_COMPLETED);
                 musicGroupStudentFee.setTemporaryCourseFee(BigDecimal.ZERO);
                 musicGroupStudentFee.setTemporaryCourseFee(BigDecimal.ZERO);
                 musicGroupStudentFee.setUpdateTime(nowDate);
                 musicGroupStudentFee.setUpdateTime(nowDate);
             }
             }
@@ -1108,7 +1180,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         Date nowDate = new Date();
         Date nowDate = new Date();
         MusicGroupStudentFee musicGroupStudentFee = new MusicGroupStudentFee();
         MusicGroupStudentFee musicGroupStudentFee = new MusicGroupStudentFee();
         musicGroupStudentFee.setLatestPaidTime(nowDate);
         musicGroupStudentFee.setLatestPaidTime(nowDate);
-        musicGroupStudentFee.setPaymentStatus(MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED);
+        musicGroupStudentFee.setPaymentStatus(PAID_COMPLETED);
         musicGroupStudentFee.setUpdateTime(nowDate);
         musicGroupStudentFee.setUpdateTime(nowDate);
         musicGroupStudentFee.setContinuousAbsenteeismTimes(0);
         musicGroupStudentFee.setContinuousAbsenteeismTimes(0);
         musicGroupStudentFee.setSubjectId(studentRegistration.getActualSubjectId());
         musicGroupStudentFee.setSubjectId(studentRegistration.getActualSubjectId());
@@ -1176,7 +1248,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 } else {
                 } else {
                     musicGroupPaymentCalenderDetail.setActualAmount(courseTotalPrice);
                     musicGroupPaymentCalenderDetail.setActualAmount(courseTotalPrice);
                 }
                 }
-                musicGroupPaymentCalenderDetail.setPaymentStatus(MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED);
+                musicGroupPaymentCalenderDetail.setPaymentStatus(PAID_COMPLETED);
                 musicGroupPaymentCalenderDetail.setPayTime(nowDate);
                 musicGroupPaymentCalenderDetail.setPayTime(nowDate);
                 musicGroupPaymentCalenderDetail.setPaymentOrderId(studentPaymentOrder.getId());
                 musicGroupPaymentCalenderDetail.setPaymentOrderId(studentPaymentOrder.getId());
                 musicGroupPaymentCalenderDetail.setUseInCourse(0);
                 musicGroupPaymentCalenderDetail.setUseInCourse(0);
@@ -1314,6 +1386,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     @Override
     @Override
     @Transactional
     @Transactional
     public StudentRegistration updateStudent(StudentRegistration studentRegistration) {
     public StudentRegistration updateStudent(StudentRegistration studentRegistration) {
+        if(StringUtils.isBlank(studentRegistration.getCertificateType())){
+            studentRegistration.setCertificateType(CertificateTypeEnum.IDENTITY.getCode());
+        }
         StudentRegistration student = get(studentRegistration.getId());
         StudentRegistration student = get(studentRegistration.getId());
         if (student == null) {
         if (student == null) {
             throw new BizException("用户注册信息不存在,无法更新");
             throw new BizException("用户注册信息不存在,无法更新");
@@ -1321,9 +1396,11 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         student.setParentsName(studentRegistration.getParentsName());
         student.setParentsName(studentRegistration.getParentsName());
         student.setIdCardNo(studentRegistration.getIdCardNo());
         student.setIdCardNo(studentRegistration.getIdCardNo());
         update(student);
         update(student);
-        studentRegistrationDao.updateUser(student.getUserId(), student.getParentsName(), student.getIdCardNo());
+        studentRegistrationDao.updateUser(student.getUserId(), student.getParentsName(), student.getIdCardNo(), studentRegistration.getCertificateType());
         // 添加用户电子签章账户
         // 添加用户电子签章账户
-        contractService.register(student.getUserId(), student.getParentsName(), student.getIdCardNo(), student.getParentsPhone());
+        if(CertificateTypeEnum.IDENTITY.getCode().equals(studentRegistration.getCertificateType())){
+            contractService.register(student.getUserId(), student.getParentsName(), student.getIdCardNo(), student.getParentsPhone());
+        }
         return student;
         return student;
     }
     }
 
 

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

@@ -312,7 +312,7 @@ public class StudentServeServiceImpl implements StudentServeService {
 //            return;
 //            return;
 //        }
 //        }
 
 
-        List<StudentServeCourseDto> studentFutureCourseInfo = studentDao.getStudentFutureCourseInfo(monDayDate.toString(), studentIds);
+        List<StudentServeCourseDto> studentFutureCourseInfo = studentDao.getStudentFutureCourseInfo(monDayDate.toString(), DateUtil.dateToString(nextMonday, "yyyy-MM-dd"), studentIds);
         if(CollectionUtils.isEmpty(studentFutureCourseInfo)){
         if(CollectionUtils.isEmpty(studentFutureCourseInfo)){
             return;
             return;
         }
         }

+ 12 - 21
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUserRole;
 import com.ym.mec.auth.api.entity.SysUserRole;
+import com.ym.mec.auth.api.enums.CertificateTypeEnum;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.*;
@@ -1569,7 +1570,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				}
 				}
 			}
 			}
 		}
 		}
-		if(!"36".equals(user.getOrganId())){
+		if(!"36".equals(user.getOrganId())&& CertificateTypeEnum.IDENTITY.getCode().equals(user.getCertificateType())){
 			try {
 			try {
 				contractService.register(user.getId(),user.getRealName(),user.getIdCardNo(),user.getPhone());
 				contractService.register(user.getId(),user.getRealName(),user.getIdCardNo(),user.getPhone());
 			} catch (Exception e) {
 			} catch (Exception e) {
@@ -1919,13 +1920,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		//学生剩余课时
 		//学生剩余课时
         List<StudentCourseInfoDto> userSurplusCourseInfoByGroup = courseScheduleDao.findUserSurplusCourseInfoByGroup(GroupType.VIP, vipGroupId.toString(), studentId);
         List<StudentCourseInfoDto> userSurplusCourseInfoByGroup = courseScheduleDao.findUserSurplusCourseInfoByGroup(GroupType.VIP, vipGroupId.toString(), studentId);
 
 
-		int days = 0;
-        if(!CollectionUtils.isEmpty(userSurplusCourseInfoByGroup)){
-        	LocalDate nowDate = LocalDate.now(DateUtil.zoneId);
-			StudentCourseInfoDto studentCourseInfoDto = userSurplusCourseInfoByGroup.stream().max(Comparator.comparing(StudentCourseInfoDto::getClassDate)).get();
-			days = (int) nowDate
-					.until((LocalDateTime.ofInstant(studentCourseInfoDto.getClassDate().toInstant(), DateUtil.zoneId).toLocalDate()), ChronoUnit.DAYS);
-		}
         int[] teachModeSequence=new int[userSurplusCourseInfoByGroup.size()];
         int[] teachModeSequence=new int[userSurplusCourseInfoByGroup.size()];
         List<BigDecimal> coursePrices = new ArrayList<>();
         List<BigDecimal> coursePrices = new ArrayList<>();
         List<Long> courseScheduleIds=new ArrayList<>();
         List<Long> courseScheduleIds=new ArrayList<>();
@@ -1936,7 +1930,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         }
         }
         pauseInfos.put("teaChModeSequence", teachModeSequence);
         pauseInfos.put("teaChModeSequence", teachModeSequence);
         pauseInfos.put("coursePriceInfo",coursePrices);
         pauseInfos.put("coursePriceInfo",coursePrices);
-//        pauseInfos.put("days", days);
 
 
         StudentPauseInfo  studentPauseInfo=new StudentPauseInfo();
         StudentPauseInfo  studentPauseInfo=new StudentPauseInfo();
 		studentPauseInfo.setUserId(studentId);
 		studentPauseInfo.setUserId(studentId);
@@ -2073,14 +2066,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				newCourseSchedules.get(i).setOrganId(vipGroup.getOrganId());
 				newCourseSchedules.get(i).setOrganId(vipGroup.getOrganId());
 			}
 			}
 
 
-			if(courseInfo1.containsKey("days")){
-				int surplusDays = Integer.valueOf(courseInfo1.get("days").toString());
-				LocalDate nowDate = LocalDate.now();
-				CourseSchedule courseSchedule = newCourseSchedules.stream().max(Comparator.comparing(CourseSchedule::getClassDate)).get();
-				int days = (int) nowDate.until(LocalDateTime.ofInstant(courseSchedule.getClassDate().toInstant(), DateUtil.zoneId), ChronoUnit.DAYS);
-				if(days>surplusDays){
-					throw new BizException("您必须在{}天内完成剩余课程", surplusDays);
-				}
+			CourseSchedule courseSchedule = newCourseSchedules.stream().max(Comparator.comparing(CourseSchedule::getClassDate)).get();
+			if(vipGroup.getCoursesExpireDate().compareTo(courseSchedule.getEndClassTime())<=0&&!DateUtil.isSameDay(vipGroup.getCoursesExpireDate(), courseSchedule.getEndClassTime())){
+				throw new BizException("排课时间不可超过{}", DateUtil.dateToString(vipGroup.getCoursesExpireDate(), "yyyy年MM月dd日"));
 			}
 			}
 
 
 			courseScheduleService.batchAddCourseSchedule(newCourseSchedules);
 			courseScheduleService.batchAddCourseSchedule(newCourseSchedules);
@@ -2114,6 +2102,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			throw new BizException("剩余课时不足,无法与现有课时对齐");
 			throw new BizException("剩余课时不足,无法与现有课时对齐");
 		}
 		}
 
 
+
+		CourseSchedule lastCourseSchedule = surplusCourseWithGroup.stream().max(Comparator.comparing(CourseSchedule::getClassDate)).get();
+		if(vipGroup.getCoursesExpireDate().compareTo(lastCourseSchedule.getEndClassTime())<=0&&!DateUtil.isSameDay(vipGroup.getCoursesExpireDate(), lastCourseSchedule.getEndClassTime())){
+			throw new BizException("排课时间不可超过{}", DateUtil.dateToString(vipGroup.getCoursesExpireDate(), "yyyy年MM月dd日"));
+		}
+
 		List<CourseScheduleStudentPayment> courseScheduleStudentPaymentList = new ArrayList<>();
 		List<CourseScheduleStudentPayment> courseScheduleStudentPaymentList = new ArrayList<>();
 		for (int i=0;i<surplusCourseWithGroup.size();i++) {
 		for (int i=0;i<surplusCourseWithGroup.size();i++) {
 			CourseScheduleStudentPayment courseScheduleStudentPayment = new CourseScheduleStudentPayment();
 			CourseScheduleStudentPayment courseScheduleStudentPayment = new CourseScheduleStudentPayment();
@@ -2184,11 +2178,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		Map<BigDecimal, Long> collect = coursePrices.stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
 		Map<BigDecimal, Long> collect = coursePrices.stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
 		studentRecoverInfoDto.setGiveCourseTimes(Objects.isNull(collect.get(new BigDecimal("0.00")))?0:collect.get(new BigDecimal("0.00")).intValue());
 		studentRecoverInfoDto.setGiveCourseTimes(Objects.isNull(collect.get(new BigDecimal("0.00")))?0:collect.get(new BigDecimal("0.00")).intValue());
 		studentRecoverInfoDto.setTotalCourseTimes(coursePrices.size()-studentRecoverInfoDto.getGiveCourseTimes());
 		studentRecoverInfoDto.setTotalCourseTimes(coursePrices.size()-studentRecoverInfoDto.getGiveCourseTimes());
+		studentRecoverInfoDto.setExpireDate(vipGroup.getCoursesExpireDate());
 
 
-		if(courseInfo.containsKey("days")){
-			int surplusDays = Integer.valueOf(courseInfo.get("days").toString());
-			studentRecoverInfoDto.setExpireDate(LocalDate.now().plusDays(surplusDays));
-		}
 		return studentRecoverInfoDto;
 		return studentRecoverInfoDto;
     }
     }
 
 

+ 5 - 3
mec-biz/src/main/resources/config/contracts/product.ftl

@@ -99,9 +99,11 @@
                     <span>家长姓名:${studentInfo.realName!}</span>
                     <span>家长姓名:${studentInfo.realName!}</span>
                     <span>电话:${studentInfo.phone!}</span>
                     <span>电话:${studentInfo.phone!}</span>
                 </div>
                 </div>
-                <div class="iInfo">
-                    <span>身份证号:${studentInfo.idCardNo!}</span>
-                </div>
+                <#if studentInfo.certificateType == 'IDENTITY'>
+                    <div class="iInfo">
+                        <span>身份证号:${studentInfo.idCardNo!}</span>
+                    </div>
+                </#if>
                 <div class="iInfo">
                 <div class="iInfo">
                     <span>学生姓名:${studentInfo.username!}</span>
                     <span>学生姓名:${studentInfo.username!}</span>
                 </div>
                 </div>

+ 50 - 21
mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -282,6 +282,7 @@
     <resultMap type="com.ym.mec.biz.dal.dto.ClassGroupTeachersDto" id="ClassGroupTeachers">
     <resultMap type="com.ym.mec.biz.dal.dto.ClassGroupTeachersDto" id="ClassGroupTeachers">
         <result column="id_" property="id"/>
         <result column="id_" property="id"/>
         <result column="music_group_id_" property="musicGroupId"/>
         <result column="music_group_id_" property="musicGroupId"/>
+        <result column="music_group_name_" property="musicGroupName"/>
         <result column="subject_id_list_" property="subjectIdList"/>
         <result column="subject_id_list_" property="subjectIdList"/>
         <result column="memo_" property="memo"/>
         <result column="memo_" property="memo"/>
         <result column="name_" property="name"/>
         <result column="name_" property="name"/>
@@ -312,7 +313,7 @@
         <result column="img_" property="img"/>
         <result column="img_" property="img"/>
         <result column="teacher_ids_" property="teacherIds"/>
         <result column="teacher_ids_" property="teacherIds"/>
         <result column="group_name_" property="groupName"/>
         <result column="group_name_" property="groupName"/>
-        <collection property="members" ofType="com.ym.mec.common.entity.ImGroupMember">
+        <collection property="memberList" ofType="com.ym.mec.common.entity.ImGroupMember">
             <result property="id" column="user_id_"/>
             <result property="id" column="user_id_"/>
         </collection>
         </collection>
     </resultMap>
     </resultMap>
@@ -323,7 +324,7 @@
         LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
         LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
         LEFT JOIN music_group mg ON mg.id_ = cg.music_group_id_
         LEFT JOIN music_group mg ON mg.id_ = cg.music_group_id_
         <where>
         <where>
-            cg.del_flag_ = 0 AND cgsm.status_ != 'QUIT' AND mg.status_ = 'PROGRESS' AND cgsm.group_type_ = 'MUSIC'
+            cg.del_flag_ = 0 AND cgsm.status_ != 'QUIT' AND mg.status_ IN ('PROGRESS','PAUSE') AND cgsm.group_type_ = 'MUSIC'
             <if test="userId != null">
             <if test="userId != null">
                 AND cgsm.user_id_ = #{userId}
                 AND cgsm.user_id_ = #{userId}
             </if>
             </if>
@@ -341,7 +342,7 @@
         LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
         LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
         LEFT JOIN vip_group vg ON vg.id_ = cg.music_group_id_
         LEFT JOIN vip_group vg ON vg.id_ = cg.music_group_id_
         <where>
         <where>
-            cg.del_flag_ = 0 AND cgsm.status_ != 'QUIT' AND vg.group_status_ = 2 AND cgsm.group_type_ = 'VIP'
+            cg.del_flag_ = 0 AND cgsm.status_ != 'QUIT' AND vg.group_status_ IN (2,6) AND cgsm.group_type_ = 'VIP'
             <if test="userId != null">
             <if test="userId != null">
                 AND cgsm.user_id_ = #{userId}
                 AND cgsm.user_id_ = #{userId}
             </if>
             </if>
@@ -473,12 +474,13 @@
         cg.student_num_,cg.img_,mg.name_ group_name_
         cg.student_num_,cg.img_,mg.name_ group_name_
         FROM class_group_teacher_mapper cgtm
         FROM class_group_teacher_mapper cgtm
         LEFT JOIN class_group cg ON cgtm.class_group_id_ = cg.id_
         LEFT JOIN class_group cg ON cgtm.class_group_id_ = cg.id_
-        LEFT JOIN music_group mg ON mg.id_ = cg.music_group_id_ AND cg.group_type_ = 'MUSIC'
-        LEFT JOIN vip_group vg ON vg.id_ = cg.music_group_id_ AND cg.group_type_ = 'VIP'
-        LEFT JOIN courses_group csg ON csg.id_ = cg.music_group_id_ AND cg.group_type_ = 'COMM'
-        WHERE (cgtm.user_id_ = #{userId} OR mg.team_teacher_id_ = #{userId} OR mg.educational_teacher_id_ = #{userId} OR mg.director_user_id_ = #{userId})
-        AND cg.del_flag_ = 0 AND ((mg.status_ = 'PROGRESS' OR vg.group_status_ = 2 OR csg.status_ = 'NORMAL')
-        OR (vg.group_status_ = 2 AND vg.educational_teacher_id_ =  #{userId}) OR (csg.status_ = 'NORMAL' AND csg.educational_teacher_id_ =  #{userId}))
+        LEFT JOIN music_group mg ON mg.id_ = cg.music_group_id_
+        LEFT JOIN vip_group vg ON vg.id_ = cg.music_group_id_
+        LEFT JOIN courses_group csg ON csg.id_ = cg.music_group_id_
+        WHERE cg.del_flag_ = 0 AND
+        ((mg.status_ IN ('PROGRESS','PAUSE') AND cg.group_type_ = 'MUSIC' AND (cgtm.user_id_ = #{userId} OR mg.team_teacher_id_ = #{userId} OR mg.educational_teacher_id_ = #{userId} OR mg.director_user_id_ = #{userId}))
+        OR (vg.group_status_ IN (2,6) AND cg.group_type_ = 'VIP' AND vg.educational_teacher_id_ =  #{userId})
+        OR (csg.status_ = 'NORMAL' AND cg.group_type_ = 'COMM' AND csg.educational_teacher_id_ =  #{userId}))
         <if test="search != null">
         <if test="search != null">
             AND (cg.name_ LIKE CONCAT('%',#{search},'%') OR cg.group_name_ LIKE CONCAT('%',#{search},'%')
             AND (cg.name_ LIKE CONCAT('%',#{search},'%') OR cg.group_name_ LIKE CONCAT('%',#{search},'%')
              OR mg.name_ LIKE CONCAT('%',#{search},'%'))
              OR mg.name_ LIKE CONCAT('%',#{search},'%'))
@@ -494,42 +496,42 @@
         LEFT JOIN vip_group vg ON vg.id_ = cg.music_group_id_
         LEFT JOIN vip_group vg ON vg.id_ = cg.music_group_id_
         LEFT JOIN courses_group csg ON csg.id_ = cg.music_group_id_
         LEFT JOIN courses_group csg ON csg.id_ = cg.music_group_id_
         WHERE cgtm.user_id_ != #{userId} AND cg.del_flag_ = 0
         WHERE cgtm.user_id_ != #{userId} AND cg.del_flag_ = 0
-        AND ((vg.group_status_ = 2 AND vg.educational_teacher_id_ =  #{userId} AND vg.organ_id_ = #{organId} AND cg.group_type_ = 'VIP')
-        OR (mg.status_ = 'PROGRESS' AND (mg.team_teacher_id_ = #{userId} OR mg.educational_teacher_id_ = #{userId} OR mg.director_user_id_ = #{userId})
-        AND mg.organ_id_ = #{organId} AND cg.group_type_ = 'MUSIC')
-        OR (csg.status_ = 'NORMAL' AND csg.educational_teacher_id_ =  #{userId} AND csg.organ_id_ = #{organId} AND cg.group_type_ = 'COMM'))
+        AND ((vg.educational_teacher_id_ =  #{userId} AND cg.group_type_ = 'VIP')
+        OR (cg.group_type_ = 'MUSIC' AND (mg.team_teacher_id_ = #{userId} OR mg.educational_teacher_id_ = #{userId} OR mg.director_user_id_ = #{userId}))
+        OR (csg.educational_teacher_id_ =  #{userId} AND cg.group_type_ = 'COMM'))
         GROUP BY cg.id_
         GROUP BY cg.id_
     </select>
     </select>
 
 
     <select id="queryEducationGroups" resultMap="imGroupModel">
     <select id="queryEducationGroups" resultMap="imGroupModel">
-        SELECT cg.id_,CASE WHEN cg.group_name_ IS NULL OR cg.group_name_ = '' THEN cg.name_ ELSE cg.group_name_ END name_,#{userId} user_id_
+        SELECT cg.id_,CASE WHEN cg.group_name_ IS NULL OR cg.group_name_ = '' THEN cg.name_ ELSE cg.group_name_ END name_,#{transferUserId} user_id_
         FROM class_group_teacher_mapper cgtm
         FROM class_group_teacher_mapper cgtm
         LEFT JOIN class_group cg ON cgtm.class_group_id_ = cg.id_
         LEFT JOIN class_group cg ON cgtm.class_group_id_ = cg.id_
         LEFT JOIN music_group mg ON mg.id_ = cg.music_group_id_
         LEFT JOIN music_group mg ON mg.id_ = cg.music_group_id_
         LEFT JOIN vip_group vg ON vg.id_ = cg.music_group_id_
         LEFT JOIN vip_group vg ON vg.id_ = cg.music_group_id_
         LEFT JOIN courses_group csg ON csg.id_ = cg.music_group_id_
         LEFT JOIN courses_group csg ON csg.id_ = cg.music_group_id_
-        WHERE cg.del_flag_ = 0 AND ((vg.group_status_ = 2 AND vg.educational_teacher_id_ =  #{userId} AND vg.organ_id_ = #{organId} AND cg.group_type_ = 'VIP')
-        OR (mg.status_ = 'PROGRESS' AND mg.educational_teacher_id_ =  #{userId} AND mg.organ_id_ = #{organId} AND cg.group_type_ = 'MUSIC')
-        OR (csg.status_ = 'NORMAL' AND csg.educational_teacher_id_ =  #{userId} AND csg.organ_id_ = #{organId} AND cg.group_type_ = 'COMM'))
+        WHERE cg.del_flag_ = 0 AND
+        ((vg.group_status_ IN (2,6) AND cg.group_type_ = 'VIP' AND vg.educational_teacher_id_ =  #{userId} AND vg.organ_id_ = #{organId})
+        OR (mg.status_ IN ('PROGRESS','PAUSE') AND cg.group_type_ = 'MUSIC' AND mg.educational_teacher_id_ =  #{userId} AND mg.organ_id_ = #{organId})
+        OR (csg.status_ = 'NORMAL' AND cg.group_type_ = 'COMM' AND csg.educational_teacher_id_ =  #{userId} AND csg.organ_id_ = #{organId}))
         GROUP BY cg.id_
         GROUP BY cg.id_
     </select>
     </select>
 
 
     <select id="queryTeamTeacherGroups" resultMap="imGroupModel">
     <select id="queryTeamTeacherGroups" resultMap="imGroupModel">
         SELECT cg.id_,CASE WHEN cg.group_name_ IS NULL OR cg.group_name_ = '' THEN cg.name_ ELSE cg.group_name_ END name_,
         SELECT cg.id_,CASE WHEN cg.group_name_ IS NULL OR cg.group_name_ = '' THEN cg.name_ ELSE cg.group_name_ END name_,
-               mg.team_teacher_id_ user_id_
+               #{transferUserId} user_id_
         FROM class_group_teacher_mapper cgtm
         FROM class_group_teacher_mapper cgtm
         LEFT JOIN class_group cg ON cgtm.class_group_id_ = cg.id_
         LEFT JOIN class_group cg ON cgtm.class_group_id_ = cg.id_
         LEFT JOIN music_group mg ON mg.id_ = cg.music_group_id_
         LEFT JOIN music_group mg ON mg.id_ = cg.music_group_id_
-        WHERE mg.team_teacher_id_ = #{userId} AND cg.del_flag_ = 0 AND mg.status_ = 'PROGRESS' AND cg.group_type_ = 'MUSIC'
+        WHERE mg.team_teacher_id_ = #{userId} AND cg.del_flag_ = 0 AND mg.status_ IN ('PROGRESS','PAUSE')  AND cg.group_type_ = 'MUSIC'
         GROUP BY cg.id_
         GROUP BY cg.id_
     </select>
     </select>
 
 
     <select id="queryDirectorGroups" resultMap="imGroupModel">
     <select id="queryDirectorGroups" resultMap="imGroupModel">
-        SELECT cg.id_,CASE WHEN cg.group_name_ IS NULL OR cg.group_name_ = '' THEN cg.name_ ELSE cg.group_name_ END name_,mg.director_user_id_ user_id_
+        SELECT cg.id_,CASE WHEN cg.group_name_ IS NULL OR cg.group_name_ = '' THEN cg.name_ ELSE cg.group_name_ END name_,#{transferUserId} user_id_
         FROM class_group_teacher_mapper cgtm
         FROM class_group_teacher_mapper cgtm
         LEFT JOIN class_group cg ON cgtm.class_group_id_ = cg.id_
         LEFT JOIN class_group cg ON cgtm.class_group_id_ = cg.id_
         LEFT JOIN music_group mg ON mg.id_ = cg.music_group_id_ AND cg.group_type_ = 'MUSIC'
         LEFT JOIN music_group mg ON mg.id_ = cg.music_group_id_ AND cg.group_type_ = 'MUSIC'
-        WHERE mg.director_user_id_ = #{userId} AND cg.del_flag_ = 0 AND mg.status_ = 'PROGRESS'
+        WHERE mg.director_user_id_ = #{userId} AND cg.del_flag_ = 0 AND mg.status_ IN ('PROGRESS','PAUSE')
         GROUP BY cg.id_
         GROUP BY cg.id_
     </select>
     </select>
 
 
@@ -1401,4 +1403,31 @@
         AND type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} AND del_flag_ = '0'
         AND type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} AND del_flag_ = '0'
         AND INTE_ARRAY(subject_id_list_,#{subjectIds})
         AND INTE_ARRAY(subject_id_list_,#{subjectIds})
     </select>
     </select>
+
+    <sql id="queryClassGroupPageSql">
+        <where>
+            cg.group_type_ = 'MUSIC' AND cg.del_flag_ = 0
+            <if test="type != null">
+                AND type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
+            <if test="organIdList != null and organIdList != ''">
+                AND FIND_IN_SET(mg.organ_id_,#{organIdList})
+            </if>
+            <if test="search != null and search != ''">
+                AND (mg.name_ LIKE CONCAT('%',#{search},'%') OR cg.music_group_id_ LIKE CONCAT('%',#{search},'%'))
+            </if>
+        </where>
+    </sql>
+    <select id="countClassGroup" resultType="int">
+        SELECT COUNT(cg.id_) FROM class_group cg
+        LEFT JOIN music_group mg ON mg.id_ = cg.music_group_id_
+        <include refid="queryClassGroupPageSql"/>
+    </select>
+    <select id="queryClassGroupPage" resultMap="ClassGroupTeachers">
+        SELECT cg.*,mg.name_ music_group_name_ FROM class_group cg
+        LEFT JOIN music_group mg ON mg.id_ = cg.music_group_id_
+        <include refid="queryClassGroupPageSql"/>
+        ORDER BY cg.id_ DESC
+        <include refid="global.limit"/>
+    </select>
 </mapper>
 </mapper>

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

@@ -580,4 +580,12 @@
         WHERE cssp.class_group_id_ = #{classGroupId} AND sr.music_group_status_ != 'QUIT'
         WHERE cssp.class_group_id_ = #{classGroupId} AND sr.music_group_status_ != 'QUIT'
         GROUP BY cssp.user_id_
         GROUP BY cssp.user_id_
     </select>
     </select>
+
+    <select id="hasStudent" resultType="java.lang.Boolean">
+        SELECT COUNT(DISTINCT class_group_id_) FROM class_group_student_mapper
+        WHERE class_group_id_ = #{masterClassGroupId} AND user_id_ IN
+        <foreach collection="studentIds" separator="," open="(" close=")" item="item">
+            #{item}
+        </foreach>
+    </select>
 </mapper>
 </mapper>

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

@@ -1080,7 +1080,7 @@
                cs.status_,
                cs.status_,
                sc.paran_value_
                sc.paran_value_
         FROM course_schedule cs
         FROM course_schedule cs
-                 LEFT JOIN sys_config sc ON sc.param_name_ = "vip_appeal_days_range"
+                 LEFT JOIN sys_config sc ON sc.param_name_ = 'vip_appeal_days_range'
         WHERE cs.id_ = #{courseScheduleId}
         WHERE cs.id_ = #{courseScheduleId}
     </select>
     </select>
 
 
@@ -1268,7 +1268,7 @@
             update_time_   = NOW()
             update_time_   = NOW()
         WHERE cs.music_group_id_ = #{musicGroupId}
         WHERE cs.music_group_id_ = #{musicGroupId}
           AND cs.group_type_ = 'MUSIC'
           AND cs.group_type_ = 'MUSIC'
-          AND NOW() &lt; CONCAT(cs.class_date_, " ", cs.start_class_time_);
+          AND NOW() &lt; CONCAT(cs.class_date_,' ', cs.start_class_time_);
     </update>
     </update>
     <update id="updateCourseSchoolByGroup">
     <update id="updateCourseSchoolByGroup">
         UPDATE course_schedule cs
         UPDATE course_schedule cs
@@ -1276,8 +1276,8 @@
             update_time_   = NOW()
             update_time_   = NOW()
         WHERE cs.music_group_id_ = #{groupId}
         WHERE cs.music_group_id_ = #{groupId}
           AND cs.group_type_ = #{groupType}
           AND cs.group_type_ = #{groupType}
-          AND cs.teach_mode_ = "OFFLINE"
-          AND NOW() &lt; CONCAT(cs.class_date_, " ", cs.start_class_time_);
+          AND cs.teach_mode_ = 'OFFLINE'
+          AND NOW() &lt; CONCAT(cs.class_date_,' ', cs.start_class_time_);
     </update>
     </update>
 
 
     <update id="updateGroupCourseLock">
     <update id="updateGroupCourseLock">
@@ -1286,7 +1286,7 @@
             update_time_ = NOW()
             update_time_ = NOW()
         WHERE music_group_id_ = #{groupId}
         WHERE music_group_id_ = #{groupId}
           AND group_type_ = #{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
           AND group_type_ = #{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-          AND NOW() &lt; CONCAT(class_date_, " ", start_class_time_);
+          AND NOW() &lt; CONCAT(class_date_,' ', start_class_time_);
     </update>
     </update>
     <update id="batchUpdateLockByCourseIds">
     <update id="batchUpdateLockByCourseIds">
         UPDATE course_schedule
         UPDATE course_schedule
@@ -3380,7 +3380,7 @@
         SELECT COUNT(id_) FROM course_schedule WHERE new_course_id_=#{courseId}
         SELECT COUNT(id_) FROM course_schedule WHERE new_course_id_=#{courseId}
     </select>
     </select>
     <select id="querySubCourseNumMap" resultType="java.util.Map">
     <select id="querySubCourseNumMap" resultType="java.util.Map">
-        SELECT cs.type_ 'key',COUNT(CASE WHEN (CONCAT(cs.class_date_," ",cs.start_class_time_) > NOW()) THEN 1 ELSE NULL END) 'value' FROM course_schedule cs
+        SELECT cs.type_ 'key',COUNT(CASE WHEN (CONCAT(cs.class_date_,' ',cs.start_class_time_) > NOW()) THEN 1 ELSE NULL END) 'value' FROM course_schedule cs
         WHERE cs.class_group_id_ = #{classGroupId}
         WHERE cs.class_group_id_ = #{classGroupId}
         GROUP BY cs.type_
         GROUP BY cs.type_
     </select>
     </select>

+ 27 - 12
mec-biz/src/main/resources/config/mybatis/EmployeeMapper.xml

@@ -208,6 +208,12 @@
             LEFT JOIN sys_user_role sur ON sur.user_id_ = e.user_id_
             LEFT JOIN sys_user_role sur ON sur.user_id_ = e.user_id_
         </if>
         </if>
         <where>
         <where>
+            <if test="demissionflag != null and demissionflag == 1">
+                AND e.demission_date_ IS NOT NULL
+            </if>
+            <if test="demissionflag != null and demissionflag == 0">
+                AND e.demission_date_ IS NULL
+            </if>
             <if test="organId != null">
             <if test="organId != null">
                 AND INTE_ARRAY(e.organ_id_list_,#{organId})
                 AND INTE_ARRAY(e.organ_id_list_,#{organId})
             </if>
             </if>
@@ -238,6 +244,15 @@
             <if test="organId != null">
             <if test="organId != null">
                 AND INTE_ARRAY(e.organ_id_list_,#{organId})
                 AND INTE_ARRAY(e.organ_id_list_,#{organId})
             </if>
             </if>
+            <if test="demissionflag != null and demissionflag == 1">
+                AND e.demission_date_ IS NOT NULL
+            </if>
+            <if test="demissionflag != null and demissionflag == 0">
+                AND e.demission_date_ IS NULL
+            </if>
+            <if test="jobNature != null">
+                AND e.job_nature_ = #{jobNature}
+            </if>
             <if test="search != null">
             <if test="search != null">
                 AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
                 AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
             </if>
             </if>
@@ -251,10 +266,10 @@
     </select>
     </select>
 
 
     <select id="findByRole" resultType="com.ym.mec.biz.dal.dto.SimpleUserDto">
     <select id="findByRole" resultType="com.ym.mec.biz.dal.dto.SimpleUserDto">
-        SELECT
-          DISTINCT su.id_ userId,
+        SELECT DISTINCT su.id_ userId,
           su.real_name_ userName,
           su.real_name_ userName,
-          su.avatar_ avatar
+          su.avatar_ avatar,
+            e.organ_id_list_ organIds
         FROM
         FROM
             sys_user su
             sys_user su
             LEFT JOIN sys_user_role sur ON su.id_ = sur.user_id_
             LEFT JOIN sys_user_role sur ON su.id_ = sur.user_id_
@@ -314,20 +329,20 @@
     </select>
     </select>
 
 
     <update id="employeeLevel">
     <update id="employeeLevel">
-        <foreach collection="employeeLevelDtos" item="item" open="(" close=")" separator=";">
-            <if test="employeeLevelDto.roleName == 'repair'">
-                UPDATE music_group SET repair_user_id_ = #{item.transferUserId} WHERE repair_user_id_ = #{item.levelUserId} AND organ_id_ = #{item.organId}
+        <foreach collection="employeeLevelDtos" item="item">
+            <if test="item.roleName == 'repair'">
+                UPDATE music_group SET repair_user_id_ = #{item.transferUserId} WHERE repair_user_id_ = #{item.levelUserId} AND organ_id_ = #{item.organId};
             </if>
             </if>
-            <if test="employeeLevelDto.roleName == 'education'">
+            <if test="item.roleName == 'education'">
                 UPDATE music_group SET educational_teacher_id_ = #{item.transferUserId} WHERE educational_teacher_id_ = #{item.levelUserId} AND organ_id_ = #{item.organId};
                 UPDATE music_group SET educational_teacher_id_ = #{item.transferUserId} WHERE educational_teacher_id_ = #{item.levelUserId} AND organ_id_ = #{item.organId};
                 UPDATE practice_group SET educational_teacher_id_ = #{item.transferUserId} WHERE educational_teacher_id_ = #{item.levelUserId} AND organ_id_ = #{item.organId};
                 UPDATE practice_group SET educational_teacher_id_ = #{item.transferUserId} WHERE educational_teacher_id_ = #{item.levelUserId} AND organ_id_ = #{item.organId};
-                UPDATE vip_group SET educational_teacher_id_ = #{item.transferUserId} WHERE educational_teacher_id_ = #{item.levelUserId} AND organ_id_ = #{item.organId}
+                UPDATE vip_group SET educational_teacher_id_ = #{item.transferUserId} WHERE educational_teacher_id_ = #{item.levelUserId} AND organ_id_ = #{item.organId};
             </if>
             </if>
-            <if test="employeeLevelDto.roleName == 'teamTeacher'">
-                UPDATE music_group SET team_teacher_id_ = #{item.transferUserId} WHERE team_teacher_id_ = #{item.levelUserId} AND organ_id_ = #{item.organId}
+            <if test="item.roleName == 'teamTeacher'">
+                UPDATE music_group SET team_teacher_id_ = #{item.transferUserId} WHERE team_teacher_id_ = #{item.levelUserId} AND organ_id_ = #{item.organId};
             </if>
             </if>
-            <if test="employeeLevelDto.roleName == 'director'">
-                UPDATE music_group SET director_user_id_ = #{item.transferUserId} WHERE director_user_id_ = #{item.levelUserId} AND organ_id_ = #{item.organId}
+            <if test="item.roleName == 'director'">
+                UPDATE music_group SET director_user_id_ = #{item.transferUserId} WHERE director_user_id_ = #{item.levelUserId} AND organ_id_ = #{item.organId};
             </if>
             </if>
         </foreach>
         </foreach>
     </update>
     </update>

+ 77 - 0
mec-biz/src/main/resources/config/mybatis/IndexMapper.xml

@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--
+这个文件是自动生成的。
+不要修改此文件。所有改动将在下次重新自动生成时丢失。
+-->
+<mapper namespace="com.ym.mec.biz.dal.dao.IndexDao">
+
+    <select id="getStudentSignUpData" resultType="com.ym.mec.biz.dal.dto.IndexBaseMonthDto">
+        SELECT
+            DATE_FORMAT( create_time_, '%Y-%m' ) title,
+            COUNT( id_ ) total,
+            COUNT(CASE WHEN password_ IS NOT NULL THEN id_ ELSE NULL END) activateNum,
+            TRUNCATE(COUNT(CASE WHEN password_ IS NOT NULL THEN id_ ELSE NULL END)/COUNT( id_ )*100, 2) percent
+        FROM
+            sys_user
+        WHERE
+            del_flag_=0
+            AND user_type_ LIKE '%STUDENT%'
+            <if test="organIds!=null and organIds.size()>0">
+                AND organ_id_ IN
+                <foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+                    #{organIds}
+                </foreach>
+            </if>
+            <if test="startMonth!=null and startMonth!=''">
+                AND DATE_FORMAT(create_time_, '%Y-%m')&gt;=#{startMonth}
+            </if>
+            <if test="endMonth!=null and endMonth!=''">
+                AND DATE_FORMAT(create_time_, '%Y-%m')&lt;=#{endMonth}
+            </if>
+        GROUP BY
+            title
+        ORDER BY
+            title;
+    </select>
+
+    <select id="getHomeworkDate" resultType="com.ym.mec.biz.dal.dto.IndexBaseMonthDto">
+        SELECT
+            DATE_FORMAT(sees.monday_, '%Y-%m') title,
+            <choose>
+                <when test="type == 'submit'">
+                    SUM(sees.expect_exercises_num_) total,
+                    SUM(sees.exercises_reply_num_) activateNum,
+                    TRUNCATE(SUM(sees.exercises_reply_num_)/SUM(sees.expect_exercises_num_)*100, 2) percent
+                </when>
+                <when test="type == 'comment'">
+                    SUM(sees.expect_exercises_num_) total,
+                    SUM(sees.exercises_reply_num_) activateNum,
+                    TRUNCATE(SUM(sees.exercises_reply_num_)/SUM(sees.expect_exercises_num_)*100, 2) percent
+                </when>
+                <otherwise>
+                    SUM(sees.expect_exercises_num_) total,
+                    SUM(sees.actual_exercises_num_) activateNum,
+                    TRUNCATE(SUM(sees.actual_exercises_num_)/SUM(sees.expect_exercises_num_)*100, 2) percent
+                </otherwise>
+            </choose>
+        FROM student_extracurricular_exercises_situation_ sees
+                 LEFT JOIN sys_user su ON sees.student_id_=su.id_
+        WHERE su.del_flag_=0
+            <if test="organIds!=null and organIds.size()>0">
+                AND su.organ_id_ IN
+                <foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+                    #{organIds}
+                </foreach>
+            </if>
+            <if test="startMonth!=null and startMonth!=''">
+                AND DATE_FORMAT(sees.monday_, '%Y-%m')&gt;=#{startMonth}
+            </if>
+            <if test="endMonth!=null and endMonth!=''">
+                AND DATE_FORMAT(sees.monday_, '%Y-%m')&lt;=#{endMonth}
+            </if>
+        GROUP BY title
+        ORDER BY title
+    </select>
+
+</mapper>

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

@@ -327,7 +327,7 @@
         LEFT JOIN class_group cg ON mg.id_ = cg.music_group_id_
         LEFT JOIN class_group cg ON mg.id_ = cg.music_group_id_
         LEFT JOIN class_group_teacher_mapper cgtm ON cg.id_ = cgtm.class_group_id_
         LEFT JOIN class_group_teacher_mapper cgtm ON cg.id_ = cgtm.class_group_id_
         WHERE (cgtm.user_id_ = #{userId} OR mg.team_teacher_id_ = #{userId} OR mg.educational_teacher_id_ = #{userId}
         WHERE (cgtm.user_id_ = #{userId} OR mg.team_teacher_id_ = #{userId} OR mg.educational_teacher_id_ = #{userId}
-        OR director_user_id_ = #{userId}) AND mg.status_ = 'PROGRESS'
+        OR director_user_id_ = #{userId}) AND mg.status_ IN ('PROGRESS','PAUSE')
         <if test="search != null and search != ''">
         <if test="search != null and search != ''">
             AND mg.name_ LIKE CONCAT('%',#{search},'%')
             AND mg.name_ LIKE CONCAT('%',#{search},'%')
         </if>
         </if>
@@ -462,7 +462,7 @@
                  LEFT JOIN music_group mg ON cg.music_group_id_ = mg.id_
                  LEFT JOIN music_group mg ON cg.music_group_id_ = mg.id_
         WHERE cg.id_ = #{groupId}
         WHERE cg.id_ = #{groupId}
           AND cg.group_type_ = 'MUSIC'
           AND cg.group_type_ = 'MUSIC'
-          AND mg.status_ = 'PROGRESS'
+          AND mg.status_ IN ('PROGRESS','PAUSE')
           AND cg.del_flag_ = 0
           AND cg.del_flag_ = 0
     </select>
     </select>
     <select id="queryUserMusicNames" resultType="java.util.Map">
     <select id="queryUserMusicNames" resultType="java.util.Map">

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

@@ -323,7 +323,7 @@
         WHERE music_group_id_ = #{musicGroupId}
         WHERE music_group_id_ = #{musicGroupId}
         AND (payment_valid_end_date_ IS NULL OR payment_valid_start_date_ BETWEEN #{paymentValidStartDate} AND #{paymentValidEndDate}
         AND (payment_valid_end_date_ IS NULL OR payment_valid_start_date_ BETWEEN #{paymentValidStartDate} AND #{paymentValidEndDate}
         OR payment_valid_end_date_ BETWEEN #{paymentValidStartDate} AND #{paymentValidEndDate}) AND payment_valid_start_date_ IS NOT NULL
         OR payment_valid_end_date_ BETWEEN #{paymentValidStartDate} AND #{paymentValidEndDate}) AND payment_valid_start_date_ IS NOT NULL
-        AND mgpc.payment_type_ != 'ADD_STUDENT' AND mgpc.payment_type_ != 'ADD_COURSE' AND mgpc.batch_no_ IS NOT NULL
+        AND mgpc.payment_type_ NOT IN ('SPAN_GROUP_CLASS_ADJUST','ADD_STUDENT','ADD_COURSE') AND mgpc.batch_no_ IS NOT NULL
         <if test="payUserType != null">
         <if test="payUserType != null">
         	and pay_user_type_ = #{payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
         	and pay_user_type_ = #{payUserType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
         </if>
         </if>

+ 123 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderStudentDetailMapper.xml

@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--
+这个文件是自动生成的。
+不要修改此文件。所有改动将在下次重新自动生成时丢失。
+-->
+<mapper namespace="com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderStudentDetailDao">
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail" id="MusicGroupPaymentCalenderStudentDetail">
+		<result column="id_" property="id" />
+		<result column="user_id_" property="userId" />
+		<result column="phone_" property="phone" />
+		<result column="username_" property="username" />
+		<result column="course_original_price_" property="courseOriginalPrice" />
+		<result column="course_current_price_" property="courseCurrentPrice" />
+		<result column="course_type_" property="courseType" />
+		<result column="course_time_" property="courseTime" />
+		<result column="class_group_id_" property="classGroupId" />
+		<result column="batch_no_" property="batchNo" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="MusicGroupPaymentCalenderStudentDetail" >
+		SELECT * FROM music_group_payment_calender_student_detail WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="MusicGroupPaymentCalenderStudentDetail">
+		SELECT * FROM music_group_payment_calender_student_detail ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO music_group_payment_calender_student_detail (id_,user_id_,phone_,username_,course_original_price_,
+																 course_current_price_,course_type_,course_time_,class_group_id_,batch_no_,create_time_,update_time_)
+		VALUES(#{id},#{userId},#{phone},#{username},#{courseOriginalPrice},#{courseCurrentPrice},
+			   #{courseType},#{courseTime},#{classGroupId},#{batchNo},NOW(),NOW())
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail">
+		UPDATE music_group_payment_calender_student_detail <set>
+		<if test="userId != null">
+		user_id_ = #{userId},
+		</if>
+		<if test="classGroupId != null">
+		class_group_id_ = #{classGroupId},
+		</if>
+		<if test="courseCurrentPrice != null">
+		course_current_price_ = #{courseCurrentPrice},
+		</if>
+		<if test="courseType != null">
+		course_type_ = #{courseType},
+		</if>
+		<if test="courseOriginalPrice != null">
+		course_original_price_ = #{courseOriginalPrice},
+		</if>
+		<if test="batchNo != null">
+			batch_no_ = #{batchNo},
+		</if>
+		<if test="phone != null">
+		phone_ = #{phone},
+		</if>
+		<if test="courseTime != null">
+		course_time_ = #{courseTime},
+		</if>
+		<if test="username != null">
+		username_ = #{username},
+		</if>
+		update_time_ = NOW()
+		</set> WHERE id_ = #{id}
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM music_group_payment_calender_student_detail WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="MusicGroupPaymentCalenderStudentDetail" parameterType="map">
+		SELECT * FROM music_group_payment_calender_student_detail ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM music_group_payment_calender_student_detail
+	</select>
+	<insert id="batchInsert">
+		INSERT INTO music_group_payment_calender_student_detail (user_id_,phone_,username_,course_original_price_,
+		course_current_price_,course_type_,course_time_,class_group_id_,batch_no_,create_time_,update_time_)
+		VALUES
+		<foreach collection="musicGroupPaymentCalenderStudentDetails" item="item" index="index" separator=",">
+			(#{item.userId},#{item.phone},#{item.username},#{item.courseOriginalPrice},#{item.courseCurrentPrice},
+			#{item.courseType},#{item.courseTime},#{item.classGroupId},#{batchNo},NOW(),NOW())
+		</foreach>
+	</insert>
+
+	<update id="batchUpdate">
+		<foreach collection="musicGroupPaymentCalenderStudentDetails" item="item" index="index" open="" close="" separator=";">
+			UPDATE music_group_payment_calender_student_detail
+		<set>
+			<if test="item.courseCurrentPrice != null">
+				course_current_price_ = #{item.courseCurrentPrice},
+			</if>
+			<if test="item.courseOriginalPrice != null">
+				course_original_price_ = #{item.courseOriginalPrice},
+			</if>
+			update_time_ = NOW()
+		</set>
+			WHERE id_ = #{item.id}
+		</foreach>
+	</update>
+
+	<select id="findByBatchNo" resultMap="MusicGroupPaymentCalenderStudentDetail">
+		SELECT * FROM music_group_payment_calender_student_detail where batch_no_ = #{batchNo}
+	</select>
+
+	<delete id="delByBatchNo">
+		DELETE FROM music_group_payment_calender_student_detail WHERE batch_no_ = #{batchNo}
+	</delete>
+</mapper>

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

@@ -20,6 +20,7 @@
 		<result column="student_payment_ids_" property="studentPaymentIds" />
 		<result column="student_payment_ids_" property="studentPaymentIds" />
 		<result column="class_group_students_" property="classGroupStudents" />
 		<result column="class_group_students_" property="classGroupStudents" />
 		<result column="operator_id_" property="operatorId" />
 		<result column="operator_id_" property="operatorId" />
+		<result column="master_class_group_id_" property="masterClassGroupId" />
 		<result column="create_time_" property="createTime" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 		<result column="update_time_" property="updateTime" />
 	</resultMap>
 	</resultMap>
@@ -38,14 +39,18 @@
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupStudentClassAdjust" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MusicGroupStudentClassAdjust" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO music_group_student_class_adjust (music_group_id_,batch_no_,new_class_group_json_,
 		INSERT INTO music_group_student_class_adjust (music_group_id_,batch_no_,new_class_group_json_,
 		class_group_ids_,student_ids_,class_course_minute_,all_lock_course_ids_,sub_lock_course_ids_,
 		class_group_ids_,student_ids_,class_course_minute_,all_lock_course_ids_,sub_lock_course_ids_,
-		operator_id_,student_payment_ids_,class_group_students_,default_course_type_minute_,create_time_,update_time_)
+		operator_id_,student_payment_ids_,class_group_students_,default_course_type_minute_,master_class_group_id_,create_time_,update_time_)
 		VALUES(#{musicGroupId},#{batchNo},#{newClassGroupJson},#{classGroupIds},#{studentIds},
 		VALUES(#{musicGroupId},#{batchNo},#{newClassGroupJson},#{classGroupIds},#{studentIds},
-		#{classCourseMinute},#{allLockCourseIds},#{subLockCourseIds},#{operatorId},#{studentPaymentIds},#{classGroupStudents},#{defaultCourseTypeMinute},NOW(),NOW())
+		#{classCourseMinute},#{allLockCourseIds},#{subLockCourseIds},#{operatorId},#{studentPaymentIds},#{classGroupStudents},
+			   #{defaultCourseTypeMinute},#{masterClassGroupId},NOW(),NOW())
 	</insert>
 	</insert>
 	
 	
 	<!-- 根据主键查询一条记录 -->
 	<!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupStudentClassAdjust">
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupStudentClassAdjust">
 		UPDATE music_group_student_class_adjust <set>
 		UPDATE music_group_student_class_adjust <set>
+		<if test="masterClassGroupId != null">
+			master_class_group_id_ = #{masterClassGroupId},
+		</if>
 		<if test="defaultCourseTypeMinute != null">
 		<if test="defaultCourseTypeMinute != null">
 			default_course_type_minute_ = #{defaultCourseTypeMinute},
 			default_course_type_minute_ = #{defaultCourseTypeMinute},
 		</if>
 		</if>

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

@@ -56,4 +56,12 @@
 	<select id="queryCount" resultType="int">
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM student_course_fee_detail
 		SELECT COUNT(*) FROM student_course_fee_detail
 	</select>
 	</select>
+
+	<insert id="batchInsert">
+		INSERT INTO student_course_fee_detail (student_registration_id_,amount_,surplus_course_fee_,memo_,operator_,create_time_,update_time_)
+		VALUES
+		<foreach collection="studentCourseFeeDetails" item="item" separator=",">
+			(#{item.studentRegistrationId},#{item.amount},#{item.surplusCourseFee},#{item.memo},#{item.operator},NOW(),NOW())
+		</foreach>
+    </insert>
 </mapper>
 </mapper>

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

@@ -181,7 +181,12 @@
                 AND s.operating_tag_ = #{operatingTag}
                 AND s.operating_tag_ = #{operatingTag}
             </if>
             </if>
             <if test="serviceTag != null">
             <if test="serviceTag != null">
-                AND s.service_tag_ = #{serviceTag}
+                <if test="serviceTag == 0">
+                    AND s.service_tag_ IN (0, 2)
+                </if>
+                <if test="serviceTag == 1">
+                    AND s.service_tag_ = 1
+                </if>
             </if>
             </if>
             <if test="teacherId != null">
             <if test="teacherId != null">
                 AND s.teacher_id_ = #{teacherId}
                 AND s.teacher_id_ = #{teacherId}

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

@@ -500,6 +500,7 @@
         WHERE stu.service_tag_=1
         WHERE stu.service_tag_=1
             AND cs.class_date_&gt;=#{monday}
             AND cs.class_date_&gt;=#{monday}
             AND cs.type_ IN ('SINGLE','VIP','MIX','PRACTICE')
             AND cs.type_ IN ('SINGLE','VIP','MIX','PRACTICE')
+            AND cssp.create_time_&lt;#{nextMonday}
             <if test="studentIds!=null and studentIds.size()>0">
             <if test="studentIds!=null and studentIds.size()>0">
                 AND cssp.user_id_ IN
                 AND cssp.user_id_ IN
                 <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">
                 <foreach collection="studentIds" item="studentId" open="(" close=")" separator=",">

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

@@ -863,4 +863,8 @@
         WHERE spo.user_id_ = #{userId} AND spo.type_='APPLY' AND spo.music_group_id_=#{musicGroupId}
         WHERE spo.user_id_ = #{userId} AND spo.type_='APPLY' AND spo.music_group_id_=#{musicGroupId}
         ORDER BY spo.id_ desc
         ORDER BY spo.id_ desc
     </select>
     </select>
+
+    <select id="getAdaPayOrdersByTime" resultMap="StudentPaymentOrder"><![CDATA[
+        SELECT * FROM student_payment_order WHERE create_time_ >= #{startTime} AND create_time_ <= #{endTime} AND payment_channel_='ADAPAY' AND status_ ='SUCCESS']]>
+    </select>
 </mapper>
 </mapper>

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

@@ -72,6 +72,7 @@
         <result column="id_card_no_" property="idCardNo"/>
         <result column="id_card_no_" property="idCardNo"/>
         <result column="real_name_" property="realName"/>
         <result column="real_name_" property="realName"/>
         <result column="wechat_id_" property="wechatId"/>
         <result column="wechat_id_" property="wechatId"/>
+        <result column="certificate_type_" property="certificateType"/>
         <result column="name_" property="name"/>
         <result column="name_" property="name"/>
         <result column="parents_name_" property="parentsName"/>
         <result column="parents_name_" property="parentsName"/>
         <result column="current_grade_" property="grade"/>
         <result column="current_grade_" property="grade"/>
@@ -395,7 +396,7 @@
 
 
     <!-- 根据乐团编号和手机号查询注册乐团注册信息-->
     <!-- 根据乐团编号和手机号查询注册乐团注册信息-->
     <select id="getByPhoneAndMusicGroupId" resultMap="StudentRegistration">
     <select id="getByPhoneAndMusicGroupId" resultMap="StudentRegistration">
-        SELECT * FROM student_registration WHERE music_group_id_=#{musicGroupId} AND parents_phone_ = #{parentsPhone} LIMIT 1
+        SELECT * FROM student_registration WHERE music_group_id_ = #{musicGroupId} AND parents_phone_ = #{parentsPhone} AND music_group_status_ != 'QUIT' LIMIT 1
     </select>
     </select>
 
 
     <resultMap type="com.ym.mec.auth.api.entity.SysUser" id="FindSysUser">
     <resultMap type="com.ym.mec.auth.api.entity.SysUser" id="FindSysUser">
@@ -618,7 +619,7 @@
     </select>
     </select>
 
 
     <update id="updateUser">
     <update id="updateUser">
-        UPDATE sys_user SET real_name_ = #{realName},id_card_no_=#{idCardNo} WHERE id_=#{id}
+        UPDATE sys_user SET real_name_ = #{realName},id_card_no_=#{idCardNo},certificate_type_=#{certificateType},update_time_=NOW() WHERE id_=#{id}
     </update>
     </update>
     <update id="updateCurrentClass" parameterType="com.ym.mec.biz.dal.entity.StudentRegistration">
     <update id="updateCurrentClass" parameterType="com.ym.mec.biz.dal.entity.StudentRegistration">
         UPDATE student_registration sr SET sr.current_grade_ = #{currentGrade},sr.current_class_ = #{currentClass},sr.current_grade_date_= NOW(),sr.update_time_ = NOW()
         UPDATE student_registration sr SET sr.current_grade_ = #{currentGrade},sr.current_class_ = #{currentClass},sr.current_grade_date_= NOW(),sr.update_time_ = NOW()
@@ -728,4 +729,17 @@
     	where sr.user_id_ = #{userId} 
     	where sr.user_id_ = #{userId} 
     	order by sr.id_ 
     	order by sr.id_ 
     </select>
     </select>
+
+    <select id="querySurplusCourseFeeByClassGroupId" resultType="java.util.Map">
+        SELECT sr.user_id_ 'key',sr.surplus_course_fee_ 'value' FROM student_registration sr
+        LEFT JOIN class_group cg ON cg.music_group_id_ = sr.music_group_id_
+        WHERE cg.id_ = #{classGroupId} AND FIND_IN_SET(sr.user_id_,#{studentIds})
+        AND sr.music_group_status_ != 'QUIT'
+    </select>
+
+    <select id="queryByUserIdsAndMusicGroupId" resultMap="StudentRegistration">
+        SELECT sr.*,su.id_card_no_,su.organ_id_ FROM student_registration sr
+        LEFT JOIN sys_user su ON su.id_ = sr.user_id_
+        WHERE sr.music_group_id_ = #{musicGroupId} AND FIND_IN_SET(sr.user_id_,#{studentIds}) AND sr.music_group_status_ != 'QUIT'
+    </select>
 </mapper>
 </mapper>

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

@@ -936,13 +936,13 @@
         SELECT DISTINCT cgtm.user_id_ FROM class_group_student_mapper cgsm
         SELECT DISTINCT cgtm.user_id_ FROM class_group_student_mapper cgsm
         LEFT JOIN class_group_teacher_mapper cgtm ON cgsm.class_group_id_ = cgtm.class_group_id_
         LEFT JOIN class_group_teacher_mapper cgtm ON cgsm.class_group_id_ = cgtm.class_group_id_
         LEFT JOIN music_group mg ON cgsm.music_group_id_ = mg.id_
         LEFT JOIN music_group mg ON cgsm.music_group_id_ = mg.id_
-        WHERE mg.status_ = 'PROGRESS' AND cgsm.user_id_ = #{studentId}
+        WHERE mg.status_ IN ('PROGRESS','PAUSE') AND cgsm.user_id_ = #{studentId}
     </select>
     </select>
     <select id="findVipTeacherIds" resultType="java.lang.Integer">
     <select id="findVipTeacherIds" resultType="java.lang.Integer">
         SELECT DISTINCT cgtm.user_id_ FROM class_group_student_mapper cgsm
         SELECT DISTINCT cgtm.user_id_ FROM class_group_student_mapper cgsm
         LEFT JOIN class_group_teacher_mapper cgtm ON cgsm.class_group_id_ = cgtm.class_group_id_
         LEFT JOIN class_group_teacher_mapper cgtm ON cgsm.class_group_id_ = cgtm.class_group_id_
         LEFT JOIN vip_group vg ON vg.id_ = cgsm.music_group_id_
         LEFT JOIN vip_group vg ON vg.id_ = cgsm.music_group_id_
-        WHERE vg.group_status_ IN (2,3,4) AND cgsm.user_id_ = #{studentId}
+        WHERE vg.group_status_ IN (2,3,4,6) AND cgsm.user_id_ = #{studentId}
     </select>
     </select>
     <select id="findPracticeTeacherIds" resultType="java.lang.Integer">
     <select id="findPracticeTeacherIds" resultType="java.lang.Integer">
         SELECT DISTINCT cgtm.user_id_ FROM class_group_student_mapper cgsm
         SELECT DISTINCT cgtm.user_id_ FROM class_group_student_mapper cgsm
@@ -1061,11 +1061,11 @@
         SELECT cssp.user_id_ FROM music_group mg
         SELECT cssp.user_id_ FROM music_group mg
         LEFT JOIN course_schedule_student_payment cssp ON mg.id_ = cssp.music_group_id_
         LEFT JOIN course_schedule_student_payment cssp ON mg.id_ = cssp.music_group_id_
         WHERE (mg.educational_teacher_id_ = #{teacherId} OR mg.director_user_id_ = #{teacherId} OR mg.team_teacher_id_ = #{teacherId})
         WHERE (mg.educational_teacher_id_ = #{teacherId} OR mg.director_user_id_ = #{teacherId} OR mg.team_teacher_id_ = #{teacherId})
-        AND cssp.group_type_ = 'MUSIC' AND mg.status_ = 'PROGRESS'
+        AND cssp.group_type_ = 'MUSIC' AND mg.status_ IN ('PROGRESS','PAUSE')
         UNION ALL
         UNION ALL
         SELECT cgsm.user_id_ FROM vip_group vg
         SELECT cgsm.user_id_ FROM vip_group vg
         LEFT JOIN class_group_student_mapper cgsm ON vg.id_ = cgsm.music_group_id_
         LEFT JOIN class_group_student_mapper cgsm ON vg.id_ = cgsm.music_group_id_
-        WHERE vg.educational_teacher_id_ = #{teacherId} AND cgsm.group_type_ = 'VIP' AND vg.group_status_ IN (2,3,4)
+        WHERE vg.educational_teacher_id_ = #{teacherId} AND cgsm.group_type_ = 'VIP' AND vg.group_status_ IN (2,3,4,6)
         UNION ALL
         UNION ALL
         SELECT cssp.user_id_ FROM courses_group cg
         SELECT cssp.user_id_ FROM courses_group cg
         LEFT JOIN course_schedule_student_payment cssp ON cg.id_ = cssp.music_group_id_
         LEFT JOIN course_schedule_student_payment cssp ON cg.id_ = cssp.music_group_id_
@@ -1085,7 +1085,7 @@
         UNION ALL
         UNION ALL
         SELECT csts.user_id_ FROM vip_group vg 
         SELECT csts.user_id_ FROM vip_group vg 
         LEFT JOIN course_schedule_teacher_salary csts ON vg.id_ = csts.music_group_id_
         LEFT JOIN course_schedule_teacher_salary csts ON vg.id_ = csts.music_group_id_
-        WHERE vg.educational_teacher_id_ = #{teacherId} AND csts.group_type_ = 'VIP' AND vg.group_status_ IN (2,3,4)
+        WHERE vg.educational_teacher_id_ = #{teacherId} AND csts.group_type_ = 'VIP' AND vg.group_status_ IN (2,3,4,6)
         GROUP BY csts.user_id_
         GROUP BY csts.user_id_
         UNION ALL
         UNION ALL
         SELECT csts.user_id_ FROM courses_group cg 
         SELECT csts.user_id_ FROM courses_group cg 
@@ -1100,13 +1100,13 @@
         UNION ALL
         UNION ALL
         SELECT cgtm.user_id_ FROM music_group mg
         SELECT cgtm.user_id_ FROM music_group mg
         LEFT JOIN class_group_teacher_mapper cgtm ON mg.id_ = cgtm.music_group_id_
         LEFT JOIN class_group_teacher_mapper cgtm ON mg.id_ = cgtm.music_group_id_
-        WHERE cgtm.group_type_ = 'MUSIC' AND mg.status_ = 'PROGRESS'
+        WHERE cgtm.group_type_ = 'MUSIC' AND mg.status_ IN ('PROGRESS','PAUSE')
         AND (mg.educational_teacher_id_ = #{teacherId} OR mg.director_user_id_ = #{teacherId} OR mg.team_teacher_id_ = #{teacherId})
         AND (mg.educational_teacher_id_ = #{teacherId} OR mg.director_user_id_ = #{teacherId} OR mg.team_teacher_id_ = #{teacherId})
         GROUP BY cgtm.user_id_
         GROUP BY cgtm.user_id_
         UNION ALL
         UNION ALL
         SELECT cgtm.user_id_ FROM vip_group vg 
         SELECT cgtm.user_id_ FROM vip_group vg 
         LEFT JOIN class_group_teacher_mapper cgtm ON vg.id_ = cgtm.music_group_id_
         LEFT JOIN class_group_teacher_mapper cgtm ON vg.id_ = cgtm.music_group_id_
-        WHERE vg.educational_teacher_id_ = #{teacherId} AND cgtm.group_type_ = 'VIP' AND vg.group_status_ IN (2,3,4)
+        WHERE vg.educational_teacher_id_ = #{teacherId} AND cgtm.group_type_ = 'VIP' AND vg.group_status_ IN (2,3,4,6)
         GROUP BY cgtm.user_id_
         GROUP BY cgtm.user_id_
         UNION ALL
         UNION ALL
         SELECT cgtm.user_id_ FROM courses_group cg 
         SELECT cgtm.user_id_ FROM courses_group cg 
@@ -1121,7 +1121,7 @@
         UNION ALL
         UNION ALL
         SELECT vg.educational_teacher_id_ FROM class_group_teacher_mapper cgtm
         SELECT vg.educational_teacher_id_ FROM class_group_teacher_mapper cgtm
         LEFT JOIN vip_group vg ON vg.id_ = cgtm.music_group_id_
         LEFT JOIN vip_group vg ON vg.id_ = cgtm.music_group_id_
-        WHERE cgtm.user_id_ = #{teacherId} AND cgtm.group_type_ = 'VIP' AND vg.group_status_ IN (2,3,4)
+        WHERE cgtm.user_id_ = #{teacherId} AND cgtm.group_type_ = 'VIP' AND vg.group_status_ IN (2,3,4,6)
         GROUP BY vg.educational_teacher_id_
         GROUP BY vg.educational_teacher_id_
         UNION ALL
         UNION ALL
         SELECT cg.educational_teacher_id_ FROM class_group_teacher_mapper cgtm
         SELECT cg.educational_teacher_id_ FROM class_group_teacher_mapper cgtm
@@ -1136,7 +1136,7 @@
         UNION ALL
         UNION ALL
         SELECT vg.educational_teacher_id_ FROM course_schedule_teacher_salary csts
         SELECT vg.educational_teacher_id_ FROM course_schedule_teacher_salary csts
         LEFT JOIN vip_group vg ON vg.id_ = csts.music_group_id_
         LEFT JOIN vip_group vg ON vg.id_ = csts.music_group_id_
-        WHERE csts.user_id_ = #{teacherId} AND csts.group_type_ = 'VIP' AND vg.group_status_ IN (2,3,4)
+        WHERE csts.user_id_ = #{teacherId} AND csts.group_type_ = 'VIP' AND vg.group_status_ IN (2,3,4,6)
         GROUP BY vg.educational_teacher_id_
         GROUP BY vg.educational_teacher_id_
         UNION ALL
         UNION ALL
         SELECT cg.educational_teacher_id_ FROM course_schedule_teacher_salary csts
         SELECT cg.educational_teacher_id_ FROM course_schedule_teacher_salary csts
@@ -1152,12 +1152,12 @@
     <select id="queryMusicLeaderIds" resultType="java.lang.String">
     <select id="queryMusicLeaderIds" resultType="java.lang.String">
         SELECT DISTINCT CONCAT(mg.educational_teacher_id_,',',mg.director_user_id_,',',mg.team_teacher_id_) FROM course_schedule_teacher_salary csts
         SELECT DISTINCT CONCAT(mg.educational_teacher_id_,',',mg.director_user_id_,',',mg.team_teacher_id_) FROM course_schedule_teacher_salary csts
         LEFT JOIN music_group mg ON mg.id_ = csts.music_group_id_
         LEFT JOIN music_group mg ON mg.id_ = csts.music_group_id_
-        WHERE csts.user_id_ = #{teacherId} AND csts.group_type_ = 'MUSIC' AND mg.status_ = 'PROGRESS'
+        WHERE csts.user_id_ = #{teacherId} AND csts.group_type_ = 'MUSIC' AND mg.status_ IN ('PROGRESS','PAUSE')
         GROUP BY mg.id_
         GROUP BY mg.id_
         UNION ALL
         UNION ALL
         SELECT DISTINCT CONCAT(mg.educational_teacher_id_,',',mg.director_user_id_,',',mg.team_teacher_id_) FROM class_group_teacher_mapper cgtm
         SELECT DISTINCT CONCAT(mg.educational_teacher_id_,',',mg.director_user_id_,',',mg.team_teacher_id_) FROM class_group_teacher_mapper cgtm
         LEFT JOIN music_group mg ON mg.id_ = cgtm.music_group_id_
         LEFT JOIN music_group mg ON mg.id_ = cgtm.music_group_id_
-        WHERE cgtm.user_id_ = #{teacherId} AND cgtm.group_type_ = 'MUSIC' AND mg.status_ = 'PROGRESS'
+        WHERE cgtm.user_id_ = #{teacherId} AND cgtm.group_type_ = 'MUSIC' AND mg.status_ IN ('PROGRESS','PAUSE')
         GROUP BY mg.id_
         GROUP BY mg.id_
     </select>
     </select>
     <select id="queryStudent" resultMap="com.ym.mec.biz.dal.dao.MusicGroupDao.BasicUserDto">
     <select id="queryStudent" resultMap="com.ym.mec.biz.dal.dao.MusicGroupDao.BasicUserDto">

+ 0 - 2
mec-common/common-core/src/main/java/com/ym/mec/common/entity/ImGroupMember.java

@@ -12,8 +12,6 @@ public class ImGroupMember {
         this.id = id;
         this.id = id;
     }
     }
 
 
-
-
     public ImGroupMember(String id, String groupId, Integer munite) {
     public ImGroupMember(String id, String groupId, Integer munite) {
         this.id = id;
         this.id = id;
         this.groupId = groupId;
         this.groupId = groupId;

+ 17 - 1
mec-common/common-core/src/main/java/com/ym/mec/common/entity/ImGroupModel.java

@@ -1,10 +1,16 @@
 package com.ym.mec.common.entity;
 package com.ym.mec.common.entity;
 
 
+import java.lang.reflect.Array;
+import java.util.Arrays;
+import java.util.List;
+
 public class ImGroupModel {
 public class ImGroupModel {
     //群组编号
     //群组编号
     private String id;
     private String id;
     //用户列表
     //用户列表
     private ImGroupMember[] members;
     private ImGroupMember[] members;
+    //用户列表
+    private List<ImGroupMember> memberList;
     //群名称
     //群名称
     private String name;
     private String name;
     private String teacherIds;
     private String teacherIds;
@@ -32,6 +38,14 @@ public class ImGroupModel {
         this.name = name;
         this.name = name;
     }
     }
 
 
+    public List<ImGroupMember> getMemberList() {
+        return memberList;
+    }
+
+    public void setMemberList(List<ImGroupMember> memberList) {
+        this.memberList = memberList;
+    }
+
     public String getGroupName() {
     public String getGroupName() {
         return groupName;
         return groupName;
     }
     }
@@ -90,7 +104,9 @@ public class ImGroupModel {
     }
     }
 
 
     public ImGroupModel setMembers(ImGroupMember[] members) {
     public ImGroupModel setMembers(ImGroupMember[] members) {
-        this.members = members;
+        if(members != null && members.length > 0){
+            this.members = members;
+        }
         return this;
         return this;
     }
     }
 
 

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

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

+ 0 - 6
mec-im/src/main/java/com/ym/service/Impl/GroupServiceImpl.java

@@ -163,10 +163,8 @@ public class GroupServiceImpl implements GroupService {
     public void groupBatchDismiss(List<GroupModel> groupModels) {
     public void groupBatchDismiss(List<GroupModel> groupModels) {
         if(groupModels != null && groupModels.size() > 0){
         if(groupModels != null && groupModels.size() > 0){
             Group group = getGroup();
             Group group = getGroup();
-            GroupMember[] groupMember = {new GroupMember("1",null,null)};
             groupModels.forEach(e->{
             groupModels.forEach(e->{
                 try {
                 try {
-                    e.setMembers(groupMember);
                     group.dismiss(e);
                     group.dismiss(e);
                 } catch (Exception e1) {
                 } catch (Exception e1) {
                     e1.printStackTrace();
                     e1.printStackTrace();
@@ -179,10 +177,8 @@ public class GroupServiceImpl implements GroupService {
     public void groupBatchQuit(List<GroupModel> groupModels) {
     public void groupBatchQuit(List<GroupModel> groupModels) {
         if(groupModels != null && groupModels.size() > 0){
         if(groupModels != null && groupModels.size() > 0){
             Group group = getGroup();
             Group group = getGroup();
-            GroupMember[] groupMember = {new GroupMember("1",null,null)};
             groupModels.forEach(e->{
             groupModels.forEach(e->{
                 try {
                 try {
-                    e.setMembers(groupMember);
                     group.quit(e);
                     group.quit(e);
                 } catch (Exception e1) {
                 } catch (Exception e1) {
                     e1.printStackTrace();
                     e1.printStackTrace();
@@ -195,10 +191,8 @@ public class GroupServiceImpl implements GroupService {
     public void groupBatchJoin(List<GroupModel> groupModels){
     public void groupBatchJoin(List<GroupModel> groupModels){
         if(groupModels != null && groupModels.size() > 0){
         if(groupModels != null && groupModels.size() > 0){
             Group group = getGroup();
             Group group = getGroup();
-            GroupMember[] groupMember = {new GroupMember("1",null,null)};
             groupModels.forEach(e->{
             groupModels.forEach(e->{
                 try {
                 try {
-                    e.setMembers(groupMember);
                     group.join(e);
                     group.join(e);
                 } catch (Exception e1) {
                 } catch (Exception e1) {
                     e1.printStackTrace();
                     e1.printStackTrace();

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

@@ -102,7 +102,7 @@ public class MusicGroupController extends BaseController {
         return succeed(musicGroupService.queryPersonalMusicGroups(sysUser.getId()));
         return succeed(musicGroupService.queryPersonalMusicGroups(sysUser.getId()));
     }
     }
 
 
-    @ApiOperation(value = "根据学员编号,获取有关联的老师列表")
+    @ApiOperation(value = "根据学员编号,获取有关联的老师列表,获取学员通讯录列表")
     @GetMapping("/findTeachersByStuId")
     @GetMapping("/findTeachersByStuId")
     public Object findTeachersByStuId(String search) {
     public Object findTeachersByStuId(String search) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         SysUser sysUser = sysUserFeignService.queryUserInfo();

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

@@ -139,7 +139,7 @@ public class StudentOrderController extends BaseController {
             List<StudentPaymentOrderDetail> orderDetail1 = studentPaymentOrderDetailService.getOrderDetail(orderByOrderNo.getId());
             List<StudentPaymentOrderDetail> orderDetail1 = studentPaymentOrderDetailService.getOrderDetail(orderByOrderNo.getId());
             String kitGroupPurchaseType = orderDetail1.stream().filter(e -> e.getGoodsList() != null).filter(e -> e.getKitGroupPurchaseType() != null).map(e -> e.getKitGroupPurchaseType().getCode()).collect(Collectors.joining(","));
             String kitGroupPurchaseType = orderDetail1.stream().filter(e -> e.getGoodsList() != null).filter(e -> e.getKitGroupPurchaseType() != null).map(e -> e.getKitGroupPurchaseType().getCode()).collect(Collectors.joining(","));
             orderDetail.put("goods", goodsList);
             orderDetail.put("goods", goodsList);
-            orderDetail.put("kitGroupPurchaseType",kitGroupPurchaseType);
+            orderDetail.put("kitGroupPurchaseType", kitGroupPurchaseType);
             orderDetail.put("course", musicGroup.getCourseForm());
             orderDetail.put("course", musicGroup.getCourseForm());
             orderDetail.put("ownershipType", musicGroup.getOwnershipType());
             orderDetail.put("ownershipType", musicGroup.getOwnershipType());
             orderDetail.put("detailType", orderDetailType);
             orderDetail.put("detailType", orderDetailType);
@@ -754,12 +754,21 @@ public class StudentOrderController extends BaseController {
     }
     }
 
 
     @GetMapping("/getUserApplyOrders")
     @GetMapping("/getUserApplyOrders")
-    public HttpResponseResult<List<StudentPaymentOrderExportDto>> getUserApplyOrders(String musicGroupId){
+    public HttpResponseResult<List<StudentPaymentOrderExportDto>> getUserApplyOrders(String musicGroupId) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if (sysUser == null) {
         if (sysUser == null) {
             return failed(HttpStatus.FORBIDDEN, "请登录");
             return failed(HttpStatus.FORBIDDEN, "请登录");
         }
         }
-        return succeed(studentPaymentOrderDao.getUserApplyOrders(sysUser.getId(),musicGroupId));
+        return succeed(studentPaymentOrderDao.getUserApplyOrders(sysUser.getId(), musicGroupId));
     }
     }
 
 
+    @GetMapping("/reConfirmOrder")
+    public HttpResponseResult<List<StudentPaymentOrder>> reConfirmOrder(Date startTime, Date endTime) {
+        if (!profiles.equals("prod")) {
+            return failed("测试环境不支持");
+        }
+        return succeed(studentPaymentOrderService.reConfirmOrder(startTime, endTime));
+    }
+
+
 }
 }

+ 1 - 1
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/adapay/Payment.java

@@ -96,7 +96,7 @@ public class Payment {
         System.out.println("支付查询返回参数:" + JSON.toJSONString(payment));
         System.out.println("支付查询返回参数:" + JSON.toJSONString(payment));
 
 
         String error_code = (String) payment.get("error_code");
         String error_code = (String) payment.get("error_code");
-        if (null == error_code) {
+        if (null != error_code) {
             String error_msg = (String) payment.get("error_msg");
             String error_msg = (String) payment.get("error_msg");
             System.out.println("error_code:" + error_code + "............." + error_msg);
             System.out.println("error_code:" + error_code + "............." + error_msg);
         }
         }

+ 59 - 2
mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java

@@ -1,6 +1,9 @@
 package com.ym.mec.web.controller;
 package com.ym.mec.web.controller;
 
 
+import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.dto.*;
+import com.ym.mec.biz.dal.entity.Employee;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.exception.BizException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParam;
@@ -8,8 +11,11 @@ import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import io.swagger.annotations.ApiParam;
 
 
+import java.util.Arrays;
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -50,6 +56,8 @@ public class ClassGroupController extends BaseController {
     private ClassGroupTeacherMapperService classGroupTeacherMapperService;
     private ClassGroupTeacherMapperService classGroupTeacherMapperService;
     @Autowired
     @Autowired
     private SysUserFeignService sysUserFeignService;
     private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private EmployeeDao employeeDao;
 
 
     @ApiOperation(value = "分页查询班级列表")
     @ApiOperation(value = "分页查询班级列表")
     @GetMapping("/queryPage")
     @GetMapping("/queryPage")
@@ -280,6 +288,30 @@ public class ClassGroupController extends BaseController {
         return succeed(classGroupService.getClassGroupAndTeacherByType(musicGroupId, type));
         return succeed(classGroupService.getClassGroupAndTeacherByType(musicGroupId, type));
     }
     }
 
 
+    @ApiOperation(value = "获取所有班级列表")
+    @GetMapping("/queryClassGroupPage")
+    @PreAuthorize("@pcs.hasPermissions('classGroup/queryClassGroupPage')")
+    public HttpResponseResult queryClassGroupPage(ClassGroupQueryInfo queryInfo) throws Exception {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        if(!sysUser.getIsSuperAdmin()){
+            Employee employee = employeeDao.get(sysUser.getId());
+            if (org.apache.commons.lang3.StringUtils.isEmpty(queryInfo.getOrganIdList())) {
+                queryInfo.setOrganIdList(employee.getOrganIdList());
+            }else if(org.apache.commons.lang3.StringUtils.isEmpty(employee.getOrganIdList())){
+                return failed("用户所在分部异常");
+            }else {
+                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+                if(!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))){
+                    return failed("非法请求");
+                }
+            }
+        }
+        return succeed(classGroupService.queryClassGroupPage(queryInfo));
+    }
+
     @ApiOperation(value = "查询是否设置课酬")
     @ApiOperation(value = "查询是否设置课酬")
     @GetMapping("/checkSetSalary")
     @GetMapping("/checkSetSalary")
     @PreAuthorize("@pcs.hasPermissions('classGroup/checkSetSalary')")
     @PreAuthorize("@pcs.hasPermissions('classGroup/checkSetSalary')")
@@ -330,7 +362,6 @@ public class ClassGroupController extends BaseController {
     @GetMapping("/queryRemainCourseTypeDuration")
     @GetMapping("/queryRemainCourseTypeDuration")
     @PreAuthorize("@pcs.hasPermissions('classGroup/queryRemainCourseTypeDuration')")
     @PreAuthorize("@pcs.hasPermissions('classGroup/queryRemainCourseTypeDuration')")
     public HttpResponseResult queryRemainCourseTypeDuration(String classGroupIdList) {
     public HttpResponseResult queryRemainCourseTypeDuration(String classGroupIdList) {
-
         return succeed(classGroupService.queryRemainCourseTypeDuration(classGroupIdList));
         return succeed(classGroupService.queryRemainCourseTypeDuration(classGroupIdList));
     }
     }
 
 
@@ -341,7 +372,33 @@ public class ClassGroupController extends BaseController {
         return succeed(classGroupService.classGroupSubCourseNum(classGroupId));
         return succeed(classGroupService.classGroupSubCourseNum(classGroupId));
     }
     }
 
 
-    @ApiOperation(value = "进行中乐团-修改-班级详情-学员班级调整-生成默认缴费信息")
+    @ApiOperation(value = "进行中乐团-修改-班级详情-学员班级调整-获取班级最大剩余可排课时长")
+    @PostMapping("/querySubCourseTime")
+    @PreAuthorize("@pcs.hasPermissions('classGroup/querySubCourseTime')")
+    public HttpResponseResult querySubCourseTime(Integer classGroupId) {
+        return succeed(classGroupService.querySubCourseTime(classGroupId));
+    }
+
+    @ApiOperation(value = "进行中乐团-修改-班级详情-班级合并-获取学员需要补交的费用以及需要退还的课程余额")
+    @PostMapping("/queryStudentPaymentCalenders")
+    @PreAuthorize("@pcs.hasPermissions('classGroup/queryStudentPaymentCalenders')")
+    public HttpResponseResult queryStudentPaymentCalenders(@RequestBody MergeClassSplitClassAffirmDto mergeClassSplitClassAffirmDto) {
+        Map<Integer, List<MusicGroupPaymentCalenderStudentDetail>> collect = classGroupService.queryStudentPaymentCalenders(mergeClassSplitClassAffirmDto.getMasterClassGroupId(),
+                mergeClassSplitClassAffirmDto.getClassGroupStudents(),
+                mergeClassSplitClassAffirmDto.getStudentIds())
+                .stream().collect(Collectors.groupingBy(e -> e.getClassGroupId()));
+        return succeed(collect);
+    }
+
+    @ApiOperation(value = "跨团班级合并提交")
+    @PostMapping("/spanGroupMergeClassSplitClassAffirm")
+    @PreAuthorize("@pcs.hasPermissions('classGroup/spanGroupMergeClassSplitClassAffirm')")
+    public HttpResponseResult spanGroupMergeClassSplitClassAffirm(@RequestBody MergeClassSplitClassAffirmDto mergeClassSplitClassAffirmDto) throws Exception {
+        classGroupService.spanGroupMergeClassSplitClassAffirm(mergeClassSplitClassAffirmDto);
+        return succeed();
+    }
+
+    @ApiOperation(value = "进行中乐团-修改-班级详情-学员班级调整-获取所选班级最大可排课时长")
     @PostMapping("/getDefaultPaymentCalender")
     @PostMapping("/getDefaultPaymentCalender")
     @PreAuthorize("@pcs.hasPermissions('classGroup/getDefaultPaymentCalender')")
     @PreAuthorize("@pcs.hasPermissions('classGroup/getDefaultPaymentCalender')")
     public HttpResponseResult studentClassAuditDetail(@RequestBody List<Integer> classGroupIds) {
     public HttpResponseResult studentClassAuditDetail(@RequestBody List<Integer> classGroupIds) {

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

@@ -192,7 +192,7 @@ public class EmployeeController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('employee/findTechnician')")
     @PreAuthorize("@pcs.hasPermissions('employee/findTechnician')")
     public HttpResponseResult findTechnician(){
     public HttpResponseResult findTechnician(){
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-        String organIds=new String();
+        String organIds = new String();
         if (sysUser == null) {
         if (sysUser == null) {
             return failed("用户信息获取失败");
             return failed("用户信息获取失败");
         }
         }
@@ -217,7 +217,7 @@ public class EmployeeController extends BaseController {
     }
     }
 
 
     @ApiOperation(value = "员工离职交接")
     @ApiOperation(value = "员工离职交接")
-    @GetMapping("/level")
+    @PostMapping("/level")
     @PreAuthorize("@pcs.hasPermissions('employee/level')")
     @PreAuthorize("@pcs.hasPermissions('employee/level')")
     public HttpResponseResult level(@RequestBody List<EmployeeLevelDto> employeeLevelDtos){
     public HttpResponseResult level(@RequestBody List<EmployeeLevelDto> employeeLevelDtos){
         employeeService.level(employeeLevelDtos);
         employeeService.level(employeeLevelDtos);

+ 36 - 0
mec-web/src/main/java/com/ym/mec/web/controller/IndexController.java

@@ -2,10 +2,16 @@ package com.ym.mec.web.controller;
 
 
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.Employee;
+import com.ym.mec.biz.service.EmployeeService;
+import com.ym.mec.biz.service.IndexService;
+import com.ym.mec.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 
 
+import java.util.Arrays;
+import java.util.List;
 import java.util.Map;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -44,6 +50,9 @@ public class IndexController extends BaseController {
 
 
 	@Autowired
 	@Autowired
 	private EmployeeDao employeeDao;
 	private EmployeeDao employeeDao;
+
+	@Autowired
+	private EmployeeService employeeService;
 	
 	
 	@Autowired
 	@Autowired
 	private SysUserCashAccountDetailDao sysUserCashAccountDetailDao;
 	private SysUserCashAccountDetailDao sysUserCashAccountDetailDao;
@@ -51,6 +60,9 @@ public class IndexController extends BaseController {
 	@Autowired
 	@Autowired
 	private StudentPaymentOrderDao studentPaymentOrderDao;
 	private StudentPaymentOrderDao studentPaymentOrderDao;
 
 
+	@Autowired
+	private IndexService indexService;
+
 	@ApiOperation(value = "获取首页数据")
 	@ApiOperation(value = "获取首页数据")
 	@GetMapping("/index")
 	@GetMapping("/index")
 	public Object index() {
 	public Object index() {
@@ -103,4 +115,28 @@ public class IndexController extends BaseController {
 		return succeed(model);
 		return succeed(model);
 	}
 	}
 
 
+	@GetMapping("/newIndex")
+	public HttpResponseResult newIndex(String dataTypes, String organIds, String startMonth, String endMonth){
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser == null) {
+			return failed("用户信息获取失败");
+		}
+		if (!sysUser.getIsSuperAdmin()) {
+			Employee employee = employeeService.get(sysUser.getId());
+			if (StringUtils.isBlank(organIds)) {
+				organIds = employee.getOrganIdList();
+			}else if(StringUtils.isEmpty(employee.getOrganIdList())){
+				return failed("用户所在分部异常");
+			}else {
+				List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+				if(!list.containsAll(Arrays.asList(organIds.split(",")))){
+					return failed("非法请求");
+				}
+			}
+		}
+		if(StringUtils.isBlank(dataTypes)){
+			dataTypes = "ALL";
+		}
+		return succeed(indexService.getIndexBaseData(Arrays.stream(dataTypes.split(",")).collect(Collectors.toSet()), organIds, startMonth, endMonth));
+	}
 }
 }

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

@@ -73,7 +73,7 @@ public class VipGroupManageController extends BaseController {
             if(Objects.isNull(oldVipGroup)){
             if(Objects.isNull(oldVipGroup)){
                 throw new BizException("此课程组不存在");
                 throw new BizException("此课程组不存在");
             }
             }
-            if(!VipGroupStatusEnum.PROGRESS.equals(oldVipGroup.getStatus())){
+            if(!VipGroupStatusEnum.PROGRESS.equals(oldVipGroup.getStatus())&&!VipGroupStatusEnum.PAUSE.equals(oldVipGroup.getStatus())){
                 throw new BizException("此课程组状态暂不支持修改");
                 throw new BizException("此课程组状态暂不支持修改");
             }
             }
         }
         }