Parcourir la source

Merge branch 'online1' into merge_student_feature

周箭河 il y a 4 ans
Parent
commit
f0e78b2f25
65 fichiers modifiés avec 2273 ajouts et 212 suppressions
  1. 1 1
      cms/src/main/java/com/ym/mec/cms/interceptor/OperationLogInterceptor.java
  2. 16 0
      mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/dto/MusicScoreQueryInfo.java
  3. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDetailDao.java
  4. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/PracticeGroupDao.java
  5. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java
  6. 28 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysMusicScoreAccompanimentDao.java
  7. 13 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysMusicScoreCategoriesDao.java
  8. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysMusicScoreDao.java
  9. 20 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentCalenderAuditDetailDto.java
  10. 41 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicScoreDto.java
  11. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalenderStudentDetail.java
  12. 170 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysMusicScore.java
  13. 180 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysMusicScoreAccompaniment.java
  14. 104 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysMusicScoreCategories.java
  15. 36 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/EmployeeRoleEnum.java
  16. 21 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/SysExamSongQueryInfo.java
  17. 48 0
      mec-biz/src/main/java/com/ym/mec/biz/event/MusicGroupStatusChangeEvent.java
  18. 50 0
      mec-biz/src/main/java/com/ym/mec/biz/event/MusicGroupStudentChangeEvent.java
  19. 44 0
      mec-biz/src/main/java/com/ym/mec/biz/event/listener/GroupEventListener.java
  20. 30 0
      mec-biz/src/main/java/com/ym/mec/biz/event/source/GroupEventSource.java
  21. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleService.java
  22. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderDetailService.java
  23. 9 9
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderService.java
  24. 17 0
      mec-biz/src/main/java/com/ym/mec/biz/service/SysMusicScoreAccompanimentService.java
  25. 13 0
      mec-biz/src/main/java/com/ym/mec/biz/service/SysMusicScoreCategoriesService.java
  26. 15 0
      mec-biz/src/main/java/com/ym/mec/biz/service/SysMusicScoreService.java
  27. 33 21
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  28. 5 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/EduPracticeGroupServiceImpl.java
  29. 58 17
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java
  30. 140 100
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java
  31. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  32. 6 5
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java
  33. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  34. 59 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicScoreAccompanimentServiceImpl.java
  35. 54 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicScoreCategoriesServiceImpl.java
  36. 97 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicScoreServiceImpl.java
  37. 12 2
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml
  38. 3 0
      mec-biz/src/main/resources/config/mybatis/PracticeGroupMapper.xml
  39. 15 0
      mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml
  40. 204 0
      mec-biz/src/main/resources/config/mybatis/SysMusicScoreAccompanimentMapper.xml
  41. 89 0
      mec-biz/src/main/resources/config/mybatis/SysMusicScoreCategoriesMapper.xml
  42. 129 0
      mec-biz/src/main/resources/config/mybatis/SysMusicScoreMapper.xml
  43. 6 0
      mec-common/audit-log/pom.xml
  44. 10 0
      mec-common/audit-log/src/main/java/com/yonge/log/dal/model/AuditLog.java
  45. 69 35
      mec-common/audit-log/src/main/java/com/yonge/log/interceptor/AuditLogInterceptor.java
  46. 8 0
      mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupRegisterController.java
  47. 2 1
      mec-student/src/main/java/com/ym/mec/student/controller/PracticeGroupController.java
  48. 25 0
      mec-student/src/main/java/com/ym/mec/student/controller/SysMusicScoreAccompanimentController.java
  49. 25 0
      mec-student/src/main/java/com/ym/mec/student/controller/SysMusicScoreController.java
  50. 1 1
      mec-student/src/main/java/com/ym/mec/student/interceptor/OperationLogInterceptor.java
  51. 54 0
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/SysMusicScoreAccompanimentController.java
  52. 55 0
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/SysMusicScoreController.java
  53. 1 1
      mec-teacher/src/main/java/com/ym/mec/teacher/interceptor/OperationLogInterceptor.java
  54. 2 2
      mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleController.java
  55. 29 0
      mec-web/src/main/java/com/ym/mec/web/controller/EmployeeController.java
  56. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java
  57. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/InspectionItemPlanConclusionController.java
  58. 7 0
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderDetailController.java
  59. 7 0
      mec-web/src/main/java/com/ym/mec/web/controller/StudentRegistrationController.java
  60. 44 0
      mec-web/src/main/java/com/ym/mec/web/controller/SysMusicScoreAccompanimentController.java
  61. 36 0
      mec-web/src/main/java/com/ym/mec/web/controller/SysMusicScoreCategoriesController.java
  62. 51 0
      mec-web/src/main/java/com/ym/mec/web/controller/SysMusicScoreController.java
  63. 3 1
      mec-web/src/main/java/com/ym/mec/web/controller/education/EduPracticeGroupController.java
  64. 6 6
      mec-web/src/main/java/com/ym/mec/web/controller/education/EduRepairController.java
  65. 1 1
      mec-web/src/main/java/com/ym/mec/web/interceptor/OperationLogInterceptor.java

+ 1 - 1
cms/src/main/java/com/ym/mec/cms/interceptor/OperationLogInterceptor.java

@@ -25,7 +25,7 @@ public class OperationLogInterceptor extends AuditLogInterceptor {
 	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServletException, IOException {
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if (sysUser != null) {
-			setUsername(sysUser.getRealName());
+			setUsername(sysUser.getRealName(),sysUser.getId());
 		}
 		return true;
 	}

+ 16 - 0
mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/dto/MusicScoreQueryInfo.java

@@ -0,0 +1,16 @@
+package com.ym.mec.auth.api.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+public class MusicScoreQueryInfo {
+    @ApiModelProperty(value = "父节点编号,默认0",required = false)
+    private Integer parentId = 0;
+
+    public Integer getParentId() {
+        return parentId;
+    }
+
+    public void setParentId(Integer parentId) {
+        this.parentId = parentId;
+    }
+}

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDetailDao.java

@@ -264,4 +264,12 @@ public interface MusicGroupPaymentCalenderDetailDao extends BaseDAO<Long, MusicG
 	 * @return java.util.List<com.ym.mec.biz.dal.entity.MusicGroup>
 	 */
 	List<MusicGroup> getNoPaymentStudentMusicGroups(@Param("organIds") Set<Integer> organIds);
+
+	/**
+	 *
+	 * @param calenderId
+	 * @param studentIds
+	 * @return
+	 */
+    List<MusicGroupPaymentCalenderDetail> queryNoPaymentCanPushByCalenderId(@Param("calenderId") Long calenderId, @Param("studentIds") String studentIds);
 }

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

@@ -106,7 +106,8 @@ public interface PracticeGroupDao extends com.ym.mec.common.dal.BaseDAO<Long, Pr
      * @author Joburgess
      * @date 2020/4/24
      */
-    int checkStudentExitChargePractice(@Param("studentId") Integer studentId);
+    int checkStudentExitChargePractice(@Param("studentId") Integer studentId,
+                                       @Param("startTime") String startTime);
 
     /**
      * @param userId:

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

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

+ 28 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysMusicScoreAccompanimentDao.java

@@ -0,0 +1,28 @@
+package com.ym.mec.biz.dal.dao;
+
+
+import com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment;
+import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+public interface SysMusicScoreAccompanimentDao extends BaseDAO<Integer, SysMusicScoreAccompaniment> {
+
+
+    void batchInsert(@Param("sysMusicScoreAccompaniments") List<SysMusicScoreAccompaniment> sysMusicScoreAccompaniments,
+                     @Param("sysMusicScoreId") Integer sysMusicScoreId);
+
+    void batchDel(@Param("delExamSongAccompanimentIds") List<Integer> delExamSongAccompanimentIds);
+
+    List<Integer> findSubjectByMusicScoreId(@Param("sysMusicScoreId") Integer sysMusicScoreId, @Param("idList") List<Integer> idList);
+
+    void batchUpdate(@Param("sysMusicScoreAccompaniments") List<SysMusicScoreAccompaniment> sysMusicScoreAccompaniments);
+
+    void deleteBySongId(Integer id);
+
+    List<SysMusicScoreAccompaniment> queryAccPage(Map<String, Object> params);
+
+    int findAccCount(Map<String, Object> params);
+}

+ 13 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysMusicScoreCategoriesDao.java

@@ -0,0 +1,13 @@
+package com.ym.mec.biz.dal.dao;
+
+
+import com.ym.mec.biz.dal.entity.SysMusicScoreCategories;
+import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface SysMusicScoreCategoriesDao extends BaseDAO<Integer, SysMusicScoreCategories> {
+
+    List<SysMusicScoreCategories> findByParentId(@Param("parentId") Integer parentId);
+}

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

@@ -0,0 +1,10 @@
+package com.ym.mec.biz.dal.dao;
+
+
+import com.ym.mec.biz.dal.entity.SysMusicScore;
+import com.ym.mec.common.dal.BaseDAO;
+
+public interface SysMusicScoreDao extends BaseDAO<Integer, SysMusicScore> {
+
+	
+}

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

@@ -20,6 +20,26 @@ public class MusicGroupPaymentCalenderAuditDetailDto {
     @ApiModelProperty(value = "学员缴费详情",required = false)
     private List<MusicGroupPaymentCalenderStudentDetail> musicGroupPaymentCalenderStudentDetails;
 
+    private String username;
+
+    private String phone;
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
     public List<MusicGroupPaymentCalenderStudentDetail> getMusicGroupPaymentCalenderStudentDetails() {
         return musicGroupPaymentCalenderStudentDetails;
     }

+ 41 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicScoreDto.java

@@ -0,0 +1,41 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.entity.SysMusicScore;
+import com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+public class MusicScoreDto {
+    @ApiModelProperty(value = "曲库", required = false)
+    private SysMusicScore sysMusicScore;
+
+    @ApiModelProperty(value = "曲库伴奏", required = false)
+    private List<SysMusicScoreAccompaniment> sysMusicScoreAccompaniments;
+
+    private List<Integer> delExamSongAccompanimentIds;
+
+    public List<Integer> getDelExamSongAccompanimentIds() {
+        return delExamSongAccompanimentIds;
+    }
+
+    public void setDelExamSongAccompanimentIds(List<Integer> delExamSongAccompanimentIds) {
+        this.delExamSongAccompanimentIds = delExamSongAccompanimentIds;
+    }
+
+    public SysMusicScore getSysMusicScore() {
+        return sysMusicScore;
+    }
+
+    public void setSysMusicScore(SysMusicScore sysMusicScore) {
+        this.sysMusicScore = sysMusicScore;
+    }
+
+    public List<SysMusicScoreAccompaniment> getSysMusicScoreAccompaniments() {
+        return sysMusicScoreAccompaniments;
+    }
+
+    public void setSysMusicScoreAccompaniments(List<SysMusicScoreAccompaniment> sysMusicScoreAccompaniments) {
+        this.sysMusicScoreAccompaniments = sysMusicScoreAccompaniments;
+    }
+}

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

@@ -24,7 +24,7 @@ public class MusicGroupPaymentCalenderStudentDetail {
 	private java.math.BigDecimal courseOriginalPrice;
 	
 	/** 现价 */
-	private java.math.BigDecimal courseCurrentPrice;
+	private java.math.BigDecimal courseCurrentPrice = BigDecimal.ZERO;
 
 	/** 可扣减的课程余额 */
 	private java.math.BigDecimal subCourseAmount;

+ 170 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysMusicScore.java

@@ -0,0 +1,170 @@
+package com.ym.mec.biz.dal.entity;
+
+import com.ym.mec.biz.dal.enums.ExamSongTypeEnum;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(sys_music_score):
+ */
+public class SysMusicScore {
+
+	/**  */
+	private Integer id;
+	
+	/**  */
+	private Integer musicScoreCategoriesId;
+	
+	/** 名称 */
+	private String name;
+
+	/** 名称 */
+	private String categoriesName;
+
+	/** 名称 */
+	private Integer categoriesId;
+	
+	/** 类型PERSON 个人,COMMON公用 */
+	private ExamSongTypeEnum type;
+	
+	/** 声部列表 */
+	private String subjectIds;
+	
+	/** 速度 */
+	private Integer speed;
+	
+	/** 原音MP3 */
+	private String url;
+
+	/** 原音MP3 */
+	private String createUserName;
+	
+	/** 上传人 */
+	private Integer createUserId;
+	
+	/** 是否删除1是0否 */
+	private Integer delFlag;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	/**  */
+	private java.util.Date createTime;
+
+	public Integer getCategoriesId() {
+		return categoriesId;
+	}
+
+	public void setCategoriesId(Integer categoriesId) {
+		this.categoriesId = categoriesId;
+	}
+
+	public String getCategoriesName() {
+		return categoriesName;
+	}
+
+	public void setCategoriesName(String categoriesName) {
+		this.categoriesName = categoriesName;
+	}
+
+	public String getCreateUserName() {
+		return createUserName;
+	}
+
+	public void setCreateUserName(String createUserName) {
+		this.createUserName = createUserName;
+	}
+
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setMusicScoreCategoriesId(Integer musicScoreCategoriesId){
+		this.musicScoreCategoriesId = musicScoreCategoriesId;
+	}
+	
+	public Integer getMusicScoreCategoriesId(){
+		return this.musicScoreCategoriesId;
+	}
+			
+	public void setName(String name){
+		this.name = name;
+	}
+	
+	public String getName(){
+		return this.name;
+	}
+
+	public ExamSongTypeEnum getType() {
+		return type;
+	}
+
+	public void setType(ExamSongTypeEnum type) {
+		this.type = type;
+	}
+
+	public void setSubjectIds(String subjectIds){
+		this.subjectIds = subjectIds;
+	}
+	
+	public String getSubjectIds(){
+		return this.subjectIds;
+	}
+			
+	public void setSpeed(Integer speed){
+		this.speed = speed;
+	}
+	
+	public Integer getSpeed(){
+		return this.speed;
+	}
+			
+	public void setUrl(String url){
+		this.url = url;
+	}
+	
+	public String getUrl(){
+		return this.url;
+	}
+			
+	public void setCreateUserId(Integer createUserId){
+		this.createUserId = createUserId;
+	}
+	
+	public Integer getCreateUserId(){
+		return this.createUserId;
+	}
+			
+	public void setDelFlag(Integer delFlag){
+		this.delFlag = delFlag;
+	}
+	
+	public Integer getDelFlag(){
+		return this.delFlag;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 180 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysMusicScoreAccompaniment.java

@@ -0,0 +1,180 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(sys_music_score_accompaniment):
+ */
+public class SysMusicScoreAccompaniment {
+
+	/**  */
+	private Integer id;
+	
+	/**  */
+	private Integer examSongId;
+	
+	/**  */
+	private Integer subjectId;
+
+	/**  */
+	private String subjectName;
+	
+	/**  */
+	private String mp3Url;
+	
+	/** 是否删除 */
+	private Integer delFlag;
+	
+	/** 速度 */
+	private Integer speed;
+	
+	/**  */
+	private String xmlUrl;
+
+	/**  */
+	private String examSongName;
+
+	/**  */
+	private String categoriesName;
+
+	/**  */
+	private Integer categoriesId;
+
+	/**  */
+	private String type;
+
+	/**  */
+	private String url;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+
+	public Integer getCategoriesId() {
+		return categoriesId;
+	}
+
+	public void setCategoriesId(Integer categoriesId) {
+		this.categoriesId = categoriesId;
+	}
+
+	public String getCategoriesName() {
+		return categoriesName;
+	}
+
+	public void setCategoriesName(String categoriesName) {
+		this.categoriesName = categoriesName;
+	}
+
+	public String getSubjectName() {
+		return subjectName;
+	}
+
+	public void setSubjectName(String subjectName) {
+		this.subjectName = subjectName;
+	}
+
+	public String getExamSongName() {
+		return examSongName;
+	}
+
+	public void setExamSongName(String examSongName) {
+		this.examSongName = examSongName;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public String getUrl() {
+		return url;
+	}
+
+	public void setUrl(String url) {
+		this.url = url;
+	}
+
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setExamSongId(Integer examSongId){
+		this.examSongId = examSongId;
+	}
+	
+	public Integer getExamSongId(){
+		return this.examSongId;
+	}
+			
+	public void setSubjectId(Integer subjectId){
+		this.subjectId = subjectId;
+	}
+	
+	public Integer getSubjectId(){
+		return this.subjectId;
+	}
+			
+	public void setMp3Url(String mp3Url){
+		this.mp3Url = mp3Url;
+	}
+	
+	public String getMp3Url(){
+		return this.mp3Url;
+	}
+			
+	public void setDelFlag(Integer delFlag){
+		this.delFlag = delFlag;
+	}
+	
+	public Integer getDelFlag(){
+		return this.delFlag;
+	}
+			
+	public void setSpeed(Integer speed){
+		this.speed = speed;
+	}
+	
+	public Integer getSpeed(){
+		return this.speed;
+	}
+			
+	public void setXmlUrl(String xmlUrl){
+		this.xmlUrl = xmlUrl;
+	}
+	
+	public String getXmlUrl(){
+		return this.xmlUrl;
+	}
+			
+	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 ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 104 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysMusicScoreCategories.java

@@ -0,0 +1,104 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import java.util.List;
+
+/**
+ * 对应数据库表(sys_music_score_categories):
+ */
+public class SysMusicScoreCategories {
+
+	/**  */
+	private Integer id;
+	
+	/**  */
+	private Integer parentId;
+	
+	/** 名称 */
+	private String name;
+	
+	/** 封面图片 */
+	private String coverImg;
+	
+	/** 操作人 */
+	private Integer operatorId;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+
+	private List<SysMusicScoreCategories> sysMusicScoreCategoriesList;
+
+	public List<SysMusicScoreCategories> getSysMusicScoreCategoriesList() {
+		return sysMusicScoreCategoriesList;
+	}
+
+	public void setSysMusicScoreCategoriesList(List<SysMusicScoreCategories> sysMusicScoreCategoriesList) {
+		this.sysMusicScoreCategoriesList = sysMusicScoreCategoriesList;
+	}
+
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setParentId(Integer parentId){
+		this.parentId = parentId;
+	}
+	
+	public Integer getParentId(){
+		return this.parentId;
+	}
+			
+	public void setName(String name){
+		this.name = name;
+	}
+	
+	public String getName(){
+		return this.name;
+	}
+			
+	public void setCoverImg(String coverImg){
+		this.coverImg = coverImg;
+	}
+	
+	public String getCoverImg(){
+		return this.coverImg;
+	}
+			
+	public void setOperatorId(Integer operatorId){
+		this.operatorId = operatorId;
+	}
+	
+	public Integer getOperatorId(){
+		return this.operatorId;
+	}
+			
+	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 ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 36 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/EmployeeRoleEnum.java

@@ -0,0 +1,36 @@
+package com.ym.mec.biz.dal.enums;
+
+import com.ym.mec.common.enums.BaseEnum;
+
+/**
+ * 员工角色枚举
+ */
+public enum EmployeeRoleEnum implements BaseEnum<String, EmployeeRoleEnum> {
+	TEAM_TEACHER("TEAM_TEACHER", "运营主管"), EDUCATION("EDUCATION", "乐团主管");
+
+	private String code;
+
+	private String msg;
+
+	EmployeeRoleEnum(String code, String msg) {
+		this.code = code;
+		this.msg = msg;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+	public String getMsg() {
+		return msg;
+	}
+
+	public void setMsg(String msg) {
+		this.msg = msg;
+	}
+
+	@Override
+	public String getCode() {
+		return this.code;
+	}
+}

+ 21 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/SysExamSongQueryInfo.java

@@ -14,6 +14,27 @@ public class SysExamSongQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "类型",required = true)
     private String type;
 
+    @ApiModelProperty(value = "曲库分类",required = true)
+    private Integer categoriesId;
+
+    private Integer sysMusicScoreId;
+
+    public Integer getCategoriesId() {
+        return categoriesId;
+    }
+
+    public void setCategoriesId(Integer categoriesId) {
+        this.categoriesId = categoriesId;
+    }
+
+    public Integer getSysMusicScoreId() {
+        return sysMusicScoreId;
+    }
+
+    public void setSysMusicScoreId(Integer sysMusicScoreId) {
+        this.sysMusicScoreId = sysMusicScoreId;
+    }
+
     public Integer getCreateUserId() {
         return createUserId;
     }

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

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

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

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

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

@@ -0,0 +1,44 @@
+package com.ym.mec.biz.event.listener;
+
+import com.ym.mec.biz.dal.dao.IndexBaseMonthDataDao;
+import com.ym.mec.biz.dal.dao.MusicGroupDao;
+import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
+import com.ym.mec.biz.dal.entity.IndexBaseMonthData;
+import com.ym.mec.biz.dal.entity.MusicGroup;
+import com.ym.mec.biz.dal.entity.StudentRegistration;
+import com.ym.mec.biz.dal.enums.IndexDataType;
+import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
+import com.ym.mec.biz.event.MusicGroupStudentChangeEvent;
+import com.ym.mec.util.date.DateUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.event.EventListener;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * @Author Joburgess
+ * @Date 2021/2/24 0024
+ */
+@Component
+public class GroupEventListener {
+
+    @Autowired
+    private MusicGroupDao musicGroupDao;
+    @Autowired
+    private StudentRegistrationDao studentRegistrationDao;
+    @Autowired
+    private IndexBaseMonthDataDao indexBaseMonthDataDao;
+
+    @Async
+    @EventListener
+    public void musicGroupStudentChangeMonitor(MusicGroupStudentChangeEvent musicGroupStatusChangeEvent){
+
+    }
+
+}

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

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

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

@@ -573,7 +573,7 @@ public interface CourseScheduleService extends BaseService<Long, CourseSchedule>
 	 * @param practiceGroupId
 	 * @param coursesExpireDate
 	 */
-	void updateCoursesExpireDate(String practiceGroupId, Date coursesExpireDate);
+	void updatePracticeGroupInDate(String practiceGroupId, Date courseStartDate, Date coursesExpireDate);
 
 	/**
 	 * 获取当前班级列表的所有未开始的课程

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

@@ -104,4 +104,11 @@ public interface MusicGroupPaymentCalenderDetailService extends BaseService<Long
      * @return java.util.List<com.ym.mec.biz.dal.entity.MusicGroup>
      */
     List<MusicGroup> getNoPaymentStudentMusicGroups(String organIds);
+
+    /**
+     * 发送学员待续费通知
+     * @param calenderId
+     * @param studentIds
+     */
+    void pushWaitRenewMessage(Long calenderId, String studentIds);
 }

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

@@ -6,10 +6,7 @@ import java.util.Set;
 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.entity.MusicGroup;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
-import com.ym.mec.biz.dal.entity.MusicGroupStudentClassAdjust;
-import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
@@ -42,11 +39,14 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 	 * @return
 	 */
 	boolean makesureSchoolePaid(Long id, String memo);
-	
-	/**
-	 * 自动更新付款日历记录状态
-	 * @return
-	 */
+
+	void addStudent(MusicGroupPaymentCalender musicGroupPaymentCalender,List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList);
+
+
+		/**
+         * 自动更新付款日历记录状态
+         * @return
+         */
 	boolean autoUpdateMusicGroupPaymentCalenderStatus();
 
 	/**

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

@@ -0,0 +1,17 @@
+package com.ym.mec.biz.service;
+
+
+import com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment;
+import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
+import com.ym.mec.common.service.BaseService;
+
+import java.util.List;
+
+public interface SysMusicScoreAccompanimentService extends BaseService<Integer, SysMusicScoreAccompaniment> {
+
+    void updateAcc(SysMusicScoreAccompaniment sysMusicScoreAccompaniment);
+
+    List<SysMusicScoreAccompaniment> queryAll(SysExamSongQueryInfo queryInfo);
+
+    List<SysMusicScoreAccompaniment> queryAccPage(SysExamSongQueryInfo queryInfo);
+}

+ 13 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/SysMusicScoreCategoriesService.java

@@ -0,0 +1,13 @@
+package com.ym.mec.biz.service;
+
+
+import com.ym.mec.auth.api.dto.MusicScoreQueryInfo;
+import com.ym.mec.biz.dal.entity.SysMusicScoreCategories;
+import com.ym.mec.common.service.BaseService;
+
+import java.util.List;
+
+public interface SysMusicScoreCategoriesService extends BaseService<Integer, SysMusicScoreCategories> {
+
+    List<SysMusicScoreCategories> queryTree(MusicScoreQueryInfo menuQueryInfo);
+}

+ 15 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/SysMusicScoreService.java

@@ -0,0 +1,15 @@
+package com.ym.mec.biz.service;
+
+
+import com.ym.mec.biz.dal.dto.MusicScoreDto;
+import com.ym.mec.biz.dal.entity.SysMusicScore;
+import com.ym.mec.common.service.BaseService;
+
+public interface SysMusicScoreService extends BaseService<Integer, SysMusicScore> {
+
+    void updateMusicScore(MusicScoreDto examSongDto);
+
+    void add(MusicScoreDto examSongDto);
+
+    void del(Integer id);
+}

+ 33 - 21
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -2770,23 +2770,23 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			VipGroup vipGroup = vipGroupDao.get(vipGroupCourseAdjustInfo.getVipGroupId().longValue());
 
 			CourseSchedule courseSchedule = courseSchedules.stream().max(Comparator.comparing(CourseSchedule::getEndClassTime)).get();
+//
+//			BigDecimal teacherSalary=BigDecimal.ZERO;
 
-			BigDecimal teacherSalary=BigDecimal.ZERO;
-
-			Map<String, BigDecimal> salaryMap = vipGroupService.countVipGroupPredictFee(vipGroup, vipGroup.getUserId());
-
-			ClassGroupTeacherSalary classGroupTeacherSalary = classGroupTeacherSalaryDao.findByVipGoupAndTeacher(vipGroupCourseAdjustInfo.getVipGroupId().intValue(), courseSchedules.get(0).getActualTeacherId());
-
-			if(Objects.nonNull(classGroupTeacherSalary)){
-				teacherSalary=vipGroupCourseAdjustInfo.getTeachMode().equals(TeachModeEnum.OFFLINE)?salaryMap.get("offlineTeacherSalary"):salaryMap.get("onlineTeacherSalary");
-			}
+//			Map<String, BigDecimal> salaryMap = vipGroupService.countVipGroupPredictFee(vipGroup, vipGroup.getUserId());
+//
+//			ClassGroupTeacherSalary classGroupTeacherSalary = classGroupTeacherSalaryDao.findByVipGoupAndTeacher(vipGroupCourseAdjustInfo.getVipGroupId().intValue(), courseSchedules.get(0).getActualTeacherId());
+//
+//			if(Objects.nonNull(classGroupTeacherSalary)){
+//				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);
 
 		}
 
@@ -4927,34 +4927,46 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public void updateCoursesExpireDate(String practiceGroupId, Date coursesExpireDate) {
+	public void updatePracticeGroupInDate(String practiceGroupId, Date courseStartDate, Date coursesExpireDate) {
 		SysUser user = sysUserFeignService.queryUserInfo();
 		if (null == user) {
 			throw new BizException("获取用户信息失败");
 		}
-    	if(practiceGroupId == null || coursesExpireDate == null ){
+    	if(practiceGroupId == null || courseStartDate == null || coursesExpireDate == null){
     		throw new BizException("参数校验失败");
 		}
 		PracticeGroup practiceGroup = practiceGroupDao.get(Long.parseLong(practiceGroupId));
     	if(practiceGroup == null){
 			throw new BizException("课程组不存在");
 		}
-		if(practiceGroup.getCoursesStartDate().after(coursesExpireDate)){
-			throw new BizException("课程有效时间不能早于开始时间");
+    	if(!GroupStatusEnum.NORMAL.equals(practiceGroup.getGroupStatus())){
+    		throw new BizException("非进行中课程组不可编辑");
 		}
-		if(Objects.nonNull(practiceGroup.getBuyMonths())){
-			LocalDate courseStartDay = LocalDateTime.ofInstant(practiceGroup.getCoursesStartDate().toInstant(), DateUtil.zoneId).toLocalDate();
-			LocalDate currentExpiredDay = courseStartDay.plusMonths(practiceGroup.getBuyMonths()).plusDays(-1);
-			Date courseExpiredDateTemp=Date.from(currentExpiredDay.atStartOfDay(DateUtil.zoneId).toInstant());
-			if(coursesExpireDate.before(courseExpiredDateTemp)){
-				throw new BizException("课程结束时间不得早于,{}", DateUtil.dateToString(courseExpiredDateTemp, "yyyy年MM月dd日"));
-			}
+		if(courseStartDate.after(coursesExpireDate)){
+			throw new BizException("课程组有效结束时间不能早于课程组有效开始时间");
+		}
+		Date minCourseTime = courseScheduleDao.getMinCourseTime(PRACTICE, practiceGroupId);
+		if(Objects.nonNull(minCourseTime)&&courseStartDate.compareTo(minCourseTime)>0){
+			throw new BizException("课程组有效开始时间不得晚于第一节课开始时间");
 		}
+		Date maxCourseTime = courseScheduleDao.getMaxCourseTime(PRACTICE, practiceGroupId);
+		if(Objects.nonNull(maxCourseTime)&&!DateUtil.isSameDay(maxCourseTime, coursesExpireDate)&&coursesExpireDate.compareTo(maxCourseTime)<0){
+			throw new BizException("课程组有效结束时间不得早于最后一节课结束时间");
+		}
+//		if(Objects.nonNull(practiceGroup.getBuyMonths())){
+//			LocalDate courseStartDay = LocalDateTime.ofInstant(practiceGroup.getCoursesStartDate().toInstant(), DateUtil.zoneId).toLocalDate();
+//			LocalDate currentExpiredDay = courseStartDay.plusMonths(practiceGroup.getBuyMonths()).plusDays(-1);
+//			Date courseExpiredDateTemp=Date.from(currentExpiredDay.atStartOfDay(DateUtil.zoneId).toInstant());
+//			if(coursesExpireDate.before(courseExpiredDateTemp)){
+//				throw new BizException("课程结束时间不得早于,{}", DateUtil.dateToString(courseExpiredDateTemp, "yyyy年MM月dd日"));
+//			}
+//		}
 		CoursesGroupModifyLog coursesGroupModifyLog = new CoursesGroupModifyLog();
 		coursesGroupModifyLog.setGroupId(practiceGroupId);
 		coursesGroupModifyLog.setGroupType(PRACTICE.getCode());
 		coursesGroupModifyLog.setOperatorId(user.getId());
 		coursesGroupModifyLog.setPreviousGroup(JSONObject.toJSONString(practiceGroup));
+		practiceGroup.setCoursesStartDate(courseStartDate);
 		practiceGroup.setCoursesExpireDate(DateUtil.addSeconds(DateUtil.addDays(coursesExpireDate, 1),-1));
 		practiceGroup.setUpdateTime(new Date());
 		practiceGroupDao.update(practiceGroup);

+ 5 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/EduPracticeGroupServiceImpl.java

@@ -192,7 +192,7 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
 
         Date now=new Date();
 
-        int studentExitChargePractices = practiceGroupDao.checkStudentExitChargePractice(practiceGroupBuyParams.getStudentId());
+        int studentExitChargePractices = practiceGroupDao.checkStudentExitChargePractice(practiceGroupBuyParams.getStudentId(), "2021-03-09 00:00:00");
 
         LocalDate courseStartDay=LocalDate.now();
         LocalDate tempCourseLocalDate=LocalDate.parse("2020-03-01", DateUtil.dateFormatter);
@@ -286,8 +286,9 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
         }
         BigDecimal oneMonthPrice;
         BigDecimal oneMonthOriginalPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceOriginalPrice():practiceGroupSellPrice.getTwiceOriginalPrice();
-        if(practiceBuyActivityExpireDate.after(now)){
-            oneMonthPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceActivityPrice():practiceGroupSellPrice.getTwiceActivityPrice();
+        if(practiceBuyActivityExpireDate.after(now)&&Objects.nonNull(sysUser.getOrganId())&&sysUser.getOrganId()==14&&studentExitChargePractices<=0){
+//            oneMonthPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceActivityPrice():practiceGroupSellPrice.getTwiceActivityPrice();
+            oneMonthPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceOriginalPrice():practiceGroupSellPrice.getTwiceOriginalPrice();
             if(!now.before(practicePromotionActivityStartDate)&&practiceGroupBuyParams.getBuyMonths()>=3&&studentExitChargePractices>0){
                 oneMonthPrice=practiceGroupBuyParams.getDrillTimesOnWeek()==1?practiceGroupSellPrice.getOnceQuartActivityPrice():practiceGroupSellPrice.getTwiceQuartActivityPrice();
             }else if(!now.before(practicePromotionActivityStartDate)&&studentExitChargePractices<=0){
@@ -298,7 +299,7 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
         }
         BigDecimal originalAmount = oneMonthOriginalPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
         BigDecimal amount= oneMonthPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
-        if(!now.before(practicePromotionActivityStartDate)&&now.before(practiceBuyActivityExpireDate)&&studentExitChargePractices<=0){
+        if(!now.before(practicePromotionActivityStartDate)&&now.before(practiceBuyActivityExpireDate)&&Objects.nonNull(sysUser.getOrganId())&&sysUser.getOrganId()==14&&studentExitChargePractices<=0){
             amount= oneMonthPrice.multiply(new BigDecimal(1));
         }
 

+ 58 - 17
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java

@@ -3,13 +3,17 @@ 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.PaymentCalenderStatusEnum.*;
 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;
 
 import java.math.BigDecimal;
 import java.util.*;
 import java.util.stream.Collectors;
 
+import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.MusicArrearageStudentDto;
 import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
 import com.ym.mec.biz.dal.page.ArrearageStudentsQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
@@ -20,13 +24,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
-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.MusicGroupStudentFeeDao;
-import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dto.FeeStudentDto;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
@@ -65,6 +62,8 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 	@Autowired
 	private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
 	@Autowired
+	private StudentRegistrationDao studentRegistrationDao;
+	@Autowired
 	private SysMessageService sysMessageService;
 
 	@Override
@@ -86,28 +85,44 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 		Date date = new Date();
 		MusicGroupPaymentCalender calender = musicGroupPaymentCalenderService.get(calenderDetails.get(0).getMusicGroupPaymentCalenderId());
 		//缴费项目已结束,并且没有单独开启缴费的学员,不能修改缴费金额
-		if(calender.getStatus() == OVER){
-			List<MusicGroupPaymentCalenderDetail> paymentCalenderDetails = calenderDetails.stream().filter(e -> e.getOpenFlag() == YesOrNoEnum.NO).collect(Collectors.toList());
-			if(paymentCalenderDetails != null && paymentCalenderDetails.size() > 0){
-				throw new BizException("修改失败:存在未开启缴费的学员");
-			}
-		}
+//		if(calender.getStatus() == OVER){
+//			List<MusicGroupPaymentCalenderDetail> paymentCalenderDetails = calenderDetails.stream().filter(e -> e.getOpenFlag() == YesOrNoEnum.NO).collect(Collectors.toList());
+//			if(paymentCalenderDetails != null && paymentCalenderDetails.size() > 0){
+//				throw new BizException("修改失败:存在未开启缴费的学员");
+//			}
+//		}
 		Set<Integer> studentIds = new HashSet<>();
 				calenderDetails.forEach(e->{
 			if(e.getPaymentStatus() == null || e.getPaymentStatus() != NON_PAYMENT){
 				throw new BizException("修改失败:缴费状态不匹配");
 			}
-			if(expectAmount.doubleValue() != 0){
-
-			}
 			e.setUpdateTime(date);
 			e.setExpectAmount(expectAmount);
 			if(expectAmount.doubleValue() > 0){
 				if((e.getOpen() != null && e.getOpen() == 1) || calender.getStatus() == PaymentCalenderStatusEnum.OPEN){
 					studentIds.add(e.getUserId());
 				}
+			}else {
+				calender.setActualNum((calender.getActualNum()==null?0:calender.getActualNum()) + 1);
+				e.setPaymentStatus(PAID_COMPLETED);
+				if(calender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.ADD_STUDENT){
+					MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(e.getUserId(), calender.getMusicGroupId());
+					if (musicGroupStudentFee != null) {
+						musicGroupStudentFee.setUpdateTime(date);
+						musicGroupStudentFee.setLatestPaidTime(date);
+						musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
+						musicGroupStudentFee.setTemporaryCourseFee(new BigDecimal(0));
+						musicGroupStudentFeeDao.update(musicGroupStudentFee);
+					}
+					//如果是进行中加学员
+					StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(e.getUserId(), calender.getMusicGroupId());
+					studentRegistration.setPaymentStatus(YES);
+					studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
+					studentRegistrationDao.update(studentRegistration);
+				}
 			}
 		});
+		musicGroupPaymentCalenderDao.update(calender);
 		musicGroupPaymentCalenderDetailDao.batchUpdate(calenderDetails);
 		//推送消息
 		if (calender.getPayUserType() == STUDENT && studentIds.size() > 0) {
@@ -407,8 +422,8 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 		List<MusicGroupPaymentStudentCourseDetail> musicGroupPaymentStudentCourseDetailList = new ArrayList<MusicGroupPaymentStudentCourseDetail>();
 		
 		Long musicGroupPaymentCalenderId = null;
-		
 		for(MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenderList){
+			int paymentNum = 0;
 			
 			musicGroupPaymentCalenderId = musicGroupPaymentCalender.getId();
 			
@@ -452,6 +467,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 				musicGroupPaymentCalenderDetail.setExpectAmount(totalPrice);
 				if (musicGroupPaymentCalenderDetail.getExpectAmount().compareTo(new BigDecimal(0)) == 0) {
 					musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
+					paymentNum++;
 				} else {
 					musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.NON_PAYMENT);
 				}
@@ -473,6 +489,7 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 			//更新预计缴费人数
 			musicGroupPaymentCalender.setExpectNum(musicGroupPaymentCalender.getExpectNum() + userIdList.size());
 			musicGroupPaymentCalender.setUpdateTime(date);
+			musicGroupPaymentCalender.setActualNum((musicGroupPaymentCalender.getActualNum()==null?0:musicGroupPaymentCalender.getActualNum()) + paymentNum);
 			musicGroupPaymentCalenderService.update(musicGroupPaymentCalender);
 			
 			MusicGroupPaymentStudentCourseDetail musicGroupPaymentStudentCourseDetail = null;
@@ -590,4 +607,28 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 		}
 		return musicGroupPaymentCalenderDetailDao.getNoPaymentStudentMusicGroups(organIds);
 	}
+
+	@Override
+	public void pushWaitRenewMessage(Long calenderId, String studentIds) {
+		List<MusicGroupPaymentCalenderDetail> calenderDetails = musicGroupPaymentCalenderDetailDao.queryNoPaymentCanPushByCalenderId(calenderId,studentIds);
+		if(calenderDetails == null || calenderDetails.size() == 0){
+			throw new BizException("发送失败:没有可以发送缴费提醒的学员");
+		}
+		Set<Integer> studentIdList = calenderDetails.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
+		MusicGroupPaymentCalender paymentCalender = musicGroupPaymentCalenderDao.get(calenderId);
+		//未缴费
+		Map<Integer,String> studentMaps = MapUtil.convertMybatisMap(musicGroupPaymentCalenderDetailDao.queryNoPaymentAndNotZeroStudent(calenderId,studentIdList));
+		MusicGroup musicGroup = musicGroupDao.get(paymentCalender.getMusicGroupId());
+		String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
+		String memo = "4?" + baseUrl + "/#/musicGroupRenew?calenderId="+calenderId+"&id=" + musicGroup.getId();
+		Map<Integer, String> push = new HashMap<>();
+		for (Integer userId : studentIdList) {
+			push.put(userId, userId.toString());
+		}
+		// 发送续费通知
+		sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_WAIT_RENEW_MESSAGE, push,
+				null, 0, memo, "STUDENT", musicGroup.getName());
+		sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.STUDENT_SMS_WAIT_RENEW_MESSAGE, studentMaps,
+				null, 0, memo, null, musicGroup.getName());
+	}
 }

+ 140 - 100
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -2,8 +2,7 @@ package com.ym.mec.biz.service.impl;
 
 import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.SCHOOL;
 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.REJECT;
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.*;
 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;
@@ -26,6 +25,7 @@ import java.util.Set;
 import java.util.stream.Collectors;
 
 import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
 import com.ym.mec.biz.service.*;
@@ -46,25 +46,11 @@ 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.entity.ClassGroup;
 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.PaymentCalenderStatusEnum;
 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.MusicGroupPaymentCalenderStudentDetail;
-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.Organization;
-import com.ym.mec.biz.dal.entity.OrganizationCourseUnitPriceSettings;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
 import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
@@ -433,6 +419,10 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 					Set<Integer> list2 = Arrays.stream(ints).boxed().collect(Collectors.toSet());
 					musicGroupPaymentCalenderDetailService.batchAdd(musicGroupPaymentCalender.getId(),list2);
 				}
+				//将0元未缴费学员缴费状态更新为已缴费
+				int j = musicGroupPaymentCalenderDetailDao.updateNoPaymentAndZeroPaymentStatus(musicGroupPaymentCalender.getId());
+				musicGroupPaymentCalender.setActualNum((musicGroupPaymentCalender.getActualNum()==null?0:musicGroupPaymentCalender.getActualNum()) + j);
+				musicGroupPaymentCalenderDao.update(musicGroupPaymentCalender);
 			}
 		}
 
@@ -744,6 +734,10 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 					//如果是跨团班级合并,添加学员
 					musicGroupPaymentCalenderDetailService.batchAdd(musicGroupPaymentCalender,musicGroupPaymentCalenderDto.getMusicGroupPaymentCalenderStudentDetails());
 				}
+				//将0元未缴费学员缴费状态更新为已缴费
+				int j = musicGroupPaymentCalenderDetailDao.updateNoPaymentAndZeroPaymentStatus(musicGroupPaymentCalender.getId());
+				musicGroupPaymentCalender.setActualNum((musicGroupPaymentCalender.getActualNum()==null?0:musicGroupPaymentCalender.getActualNum()) + j);
+				musicGroupPaymentCalenderDao.update(musicGroupPaymentCalender);
 			}
 
 			if (currentMusicGroupPaymentCalenderCourseSettings.size() > 0) {
@@ -832,6 +826,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		return true;
 	}
 
+	@Transactional(rollbackFor = Exception.class)
+	@Override
 	public void addStudent(MusicGroupPaymentCalender musicGroupPaymentCalender,List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList){
 		//如果是进行中加学生
 		Date date = new Date();
@@ -859,6 +855,22 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
 
 				musicGroupPaymentCalenderDetailDao.insert(musicGroupPaymentCalenderDetail);
+				//如果是0元那么更新fee表和studentRegistration表
+				if(totalPrice.doubleValue() == 0d){
+					MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(Integer.parseInt(studentId), musicGroupPaymentCalender.getMusicGroupId());
+					if (musicGroupStudentFee != null) {
+						musicGroupStudentFee.setUpdateTime(date);
+						musicGroupStudentFee.setLatestPaidTime(date);
+						musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
+						musicGroupStudentFee.setTemporaryCourseFee(new BigDecimal(0));
+						musicGroupStudentFeeDao.update(musicGroupStudentFee);
+					}
+					//如果是进行中加学员
+					StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(Integer.parseInt(studentId), musicGroupPaymentCalender.getMusicGroupId());
+					studentRegistration.setPaymentStatus(YES);
+					studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
+					studentRegistrationDao.update(studentRegistration);
+				}
 
 				// 学生加课程明细
 				for(MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList){
@@ -980,11 +992,24 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		MusicGroupPaymentCalenderAuditDetailDto calenderAuditDetailDto = new MusicGroupPaymentCalenderAuditDetailDto();
 		MusicGroupPaymentCalenderAuditDto auditDto = musicGroupPaymentCalenderDao.getAuditDetail(batchNo);
 		calenderAuditDetailDto.setAuditDto(auditDto);
-		//获取收费标准
-		calenderAuditDetailDto.setMusicGroupPaymentCalenderCourseSettings(musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo));
 		//获取缴费周期
 		List<MusicGroupPaymentCalender> groupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
 		calenderAuditDetailDto.setMusicGroupPaymentCalenders(groupPaymentCalenders);
+		MusicGroupPaymentCalender paymentCalender = groupPaymentCalenders.get(0);
+		if(paymentCalender.getPaymentType() == ADD_STUDENT){
+			try {
+				String studentIds = groupPaymentCalenders.get(0).getStudentIds();
+				if(StringUtils.isNotEmpty(studentIds)){
+					SysUser sysUser = sysUserFeignService.queryUserById(Integer.parseInt(studentIds));
+					calenderAuditDetailDto.setPhone(sysUser.getPhone());
+					calenderAuditDetailDto.setUsername(sysUser.getUsername());
+				}
+			}catch (Exception e){
+				e.printStackTrace();
+			}
+		}
+		//获取收费标准
+		calenderAuditDetailDto.setMusicGroupPaymentCalenderCourseSettings(musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo));
 		//获取跨团合班学员缴费详情
 		calenderAuditDetailDto.setMusicGroupPaymentCalenderStudentDetails(musicGroupPaymentCalenderStudentDetailDao.findByBatchNo(batchNo));
 		return calenderAuditDetailDto;
@@ -1056,106 +1081,118 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public void auditPass(String batchNo,String auditMemo) {
-		List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
-		if(musicGroupPaymentCalenders == null || musicGroupPaymentCalenders.size() == 0){
-			throw new BizException("缴费项目不存在");
-		}
+	public void auditPass(String batchNs,String auditMemo) {
+		String[] split = batchNs.split(",");
 		Date date = new Date();
-		for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
-			//如果是报名项目,将乐团改为审核中,缴费项目修改状态,审核状态改为审核通过
-			if(musicGroupPaymentCalender.getPayUserType() == SCHOOL){
-				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
-			}else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
-				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
-			}else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
-				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
-			}else {
-				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
+		for (String batchNo : split) {
+			List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
+			if(musicGroupPaymentCalenders == null || musicGroupPaymentCalenders.size() == 0){
+				throw new BizException("缴费项目不存在");
 			}
-			musicGroupPaymentCalender.setAuditMemo(auditMemo);
-			musicGroupPaymentCalender.setUpdateTime(date);
+			for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
+				//如果是报名项目,将乐团改为审核中,缴费项目修改状态,审核状态改为审核通过
+				if(musicGroupPaymentCalender.getPayUserType() == SCHOOL){
+					musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
+				}else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
+					musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
+				}else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
+					musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
+				}else {
+					musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
+				}
+				musicGroupPaymentCalender.setAuditMemo(auditMemo);
+				musicGroupPaymentCalender.setUpdateTime(date);
 
-			if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
-				musicGroupPaymentCalender.setExpectNum(1);
-				List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(musicGroupPaymentCalender.getId());
-				addStudent(musicGroupPaymentCalender,musicGroupPaymentCalenderCourseSettings);
-			}
-		}
-		MusicGroupPaymentCalender calender = musicGroupPaymentCalenders.get(0);
-		//如果是报名,并且所有的报名都审核通过,需要修改乐团状态
-		if (calender.getPaymentType() == MUSIC_APPLY) {
-			//统计乐团还在审核中或者审核被拒的缴费
-			int count = musicGroupPaymentCalenderDao.countAuditReject(calender.getMusicGroupId(),calender.getId());
-			if(count == 0){
-				MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
-				musicGroup.setStatus(MusicGroupStatusEnum.APPLY);
-				musicGroup.setUpdateTime(date);
-				musicGroupDao.update(musicGroup);
-				SysUser sysUser = sysUserFeignService.queryUserInfo();
-				if(sysUser == null || sysUser.getId() == null){
-					throw new BizException("请重新登录");
+				if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
+					musicGroupPaymentCalender.setExpectNum(1);
+					List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(musicGroupPaymentCalender.getId());
+					addStudent(musicGroupPaymentCalender,musicGroupPaymentCalenderCourseSettings);
 				}
-				//记录操作日志
-				musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目通过(费用审核中 -> 报名中)", sysUser.getId(), ""));
 			}
-		} else if (calender.getPaymentType() == ADD_STUDENT) {
-			// 学生加到班级
-			String classGroupIdStr = calender.getAttribute1();
-			if (StringUtils.isNotBlank(classGroupIdStr)) {
-				classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(calender.getStudentIds()), classGroupIdStr, batchNo,
-						musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo));
+			MusicGroupPaymentCalender calender = musicGroupPaymentCalenders.get(0);
+			//如果是报名,并且所有的报名都审核通过,需要修改乐团状态
+			if (calender.getPaymentType() == MUSIC_APPLY) {
+				//统计乐团还在审核中或者审核被拒的缴费
+				int count = musicGroupPaymentCalenderDao.countAuditReject(calender.getMusicGroupId(),calender.getId());
+				if(count == 0){
+					MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
+					musicGroup.setStatus(MusicGroupStatusEnum.APPLY);
+					musicGroup.setUpdateTime(date);
+					musicGroupDao.update(musicGroup);
+					SysUser sysUser = sysUserFeignService.queryUserInfo();
+					if(sysUser == null || sysUser.getId() == null){
+						throw new BizException("请重新登录");
+					}
+					//记录操作日志
+					musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目通过(费用审核中 -> 报名中)", sysUser.getId(), ""));
+				}
+			} else if (calender.getPaymentType() == ADD_STUDENT) {
+				// 学生加到班级
+				String classGroupIdStr = calender.getAttribute1();
+				if (StringUtils.isNotBlank(classGroupIdStr)) {
+					classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(calender.getStudentIds()), classGroupIdStr, batchNo,
+							musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo));
+				}
+				MusicGroupStudentClassAdjust musicGroupStudentClassAdjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
+				if(musicGroupStudentClassAdjust != null){
+					//如果是合班缴费
+					autoClassGroupAdjust(musicGroupStudentClassAdjust);
+				}else {
+					imUserFriendService.refreshGroupImUserFriend(calender.getMusicGroupId(),GroupType.MUSIC);
+				}
+			}else if(calender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST){
+				//删除和解冻班级,课程信息
+				MusicGroupStudentClassAdjust adjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
+				List<Map> classGroupStudents = JSON.parseArray(adjust.getClassGroupStudents(),Map.class);
+				List<Integer> studentIds = JSON.parseArray(adjust.getStudentIds(), Integer.class);
+				List<Long> courseIds = JSON.parseArray(adjust.getSubLockCourseIds(), Long.class);
+				List<Long> allLockCourseIds = JSON.parseArray(adjust.getAllLockCourseIds(), Long.class);
+				//如果是跨团班级合并,添加学员
+				musicGroupPaymentCalenderDetailService.batchAdd(calender,musicGroupPaymentCalenderStudentDetailDao.findByBatchNo(batchNo));
+				classGroupService.spanGroupClassAdjustPass(adjust.getMasterClassGroupId()
+						,studentIds,courseIds,classGroupStudents,allLockCourseIds,batchNo,adjust.getMasterTotalPrice());
 			}
-			MusicGroupStudentClassAdjust musicGroupStudentClassAdjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
-			if(musicGroupStudentClassAdjust != null){
-				//如果是合班缴费
-				autoClassGroupAdjust(musicGroupStudentClassAdjust);
-			}else {
-				imUserFriendService.refreshGroupImUserFriend(calender.getMusicGroupId(),GroupType.MUSIC);
+			for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
+				//将0元未缴费学员缴费状态更新为已缴费
+				int j = musicGroupPaymentCalenderDetailDao.updateNoPaymentAndZeroPaymentStatus(musicGroupPaymentCalender.getId());
+				musicGroupPaymentCalender.setActualNum((musicGroupPaymentCalender.getActualNum()==null?0:musicGroupPaymentCalender.getActualNum()) + j);
 			}
-		}else if(calender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST){
-			//删除和解冻班级,课程信息
-			MusicGroupStudentClassAdjust adjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
-			List<Map> classGroupStudents = JSON.parseArray(adjust.getClassGroupStudents(),Map.class);
-			List<Integer> studentIds = JSON.parseArray(adjust.getStudentIds(), Integer.class);
-			List<Long> courseIds = JSON.parseArray(adjust.getSubLockCourseIds(), Long.class);
-			List<Long> allLockCourseIds = JSON.parseArray(adjust.getAllLockCourseIds(), Long.class);
-			//如果是跨团班级合并,添加学员
-			musicGroupPaymentCalenderDetailService.batchAdd(calender,musicGroupPaymentCalenderStudentDetailDao.findByBatchNo(batchNo));
-			classGroupService.spanGroupClassAdjustPass(adjust.getMasterClassGroupId()
-					,studentIds,courseIds,classGroupStudents,allLockCourseIds,batchNo,adjust.getMasterTotalPrice());
+			musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
 		}
-		musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
+
 	}
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public void auditRefuse(String batchNo,String auditMemo) {
+	public void auditRefuse(String batchNs,String auditMemo) {
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if(sysUser == null || sysUser.getId() == null){
 			throw new BizException("请重新登录");
 		}
-		List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
-		if(musicGroupPaymentCalenders == null || musicGroupPaymentCalenders.size() == 0){
-			throw new BizException("缴费项目不存在");
-		}
+		String[] split = batchNs.split(",");
 		Date date = new Date();
-		for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
-			musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.REJECT);
-			musicGroupPaymentCalender.setUpdateTime(date);
-			musicGroupPaymentCalender.setAuditMemo(auditMemo);
-		}
-		MusicGroupPaymentCalender calender = musicGroupPaymentCalenders.get(0);
-		//如果是报名,并且所有的报名都审核通过,需要修改乐团状态
-		if (calender.getPaymentType() == MUSIC_APPLY) {
-			MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
-			musicGroup.setStatus(MusicGroupStatusEnum.PRE_BUILD_FEE);
-			musicGroup.setUpdateTime(date);
-			musicGroupDao.update(musicGroup);
-			//记录操作日志
-			musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目失败(费用审核中 -> 审核拒绝)", sysUser.getId(), ""));
+		for (String batchNo : split) {
+			List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
+			if(musicGroupPaymentCalenders == null || musicGroupPaymentCalenders.size() == 0){
+				throw new BizException("缴费项目不存在");
+			}
+			for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
+				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.REJECT);
+				musicGroupPaymentCalender.setUpdateTime(date);
+				musicGroupPaymentCalender.setAuditMemo(auditMemo);
+			}
+			MusicGroupPaymentCalender calender = musicGroupPaymentCalenders.get(0);
+			//如果是报名,并且所有的报名都审核通过,需要修改乐团状态
+			if (calender.getPaymentType() == MUSIC_APPLY) {
+				MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
+				musicGroup.setStatus(MusicGroupStatusEnum.PRE_BUILD_FEE);
+				musicGroup.setUpdateTime(date);
+				musicGroupDao.update(musicGroup);
+				//记录操作日志
+				musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目失败(费用审核中 -> 审核拒绝)", sysUser.getId(), ""));
+			}
+			musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
 		}
-		musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
 	}
 
 	//推送待续费通知
@@ -1218,6 +1255,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				// “未开始”更新至“进行中”
 				mgpc.setUpdateTime(date);
 				mgpc.setStatus(PaymentCalenderStatusEnum.OPEN);
+				//将0元未缴费学员缴费状态更新为已缴费
+				int i = musicGroupPaymentCalenderDetailDao.updateNoPaymentAndZeroPaymentStatus(mgpc.getId());
+				mgpc.setActualNum((mgpc.getActualNum()==null?0:mgpc.getActualNum()) + i);
 				updateMusicGroupPaymentCalenderList.add(mgpc);
 				if(mgpc.getPayUserType() == STUDENT){
 					//推送待续费通知

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

@@ -18,6 +18,7 @@ import java.util.Set;
 import java.util.stream.Collectors;
 
 import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.event.source.GroupEventSource;
 import com.ym.mec.biz.service.*;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
@@ -251,6 +252,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     @Autowired
     private StudentPreRegistrationDao studentPreRegistrationDao;
 
+    @Autowired
+    private GroupEventSource groupEventSource;
+
     private SimpleDateFormat sdf_ymd = new SimpleDateFormat("yyyy-MM-dd");
 
     private SimpleDateFormat sdf_hms = new SimpleDateFormat("HH:mm:ss");
@@ -1209,6 +1213,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         roleIds.add(SysUserRole.DEAN_OF_STUDIES);
 
         sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()), MessageTypeEnum.BACKSTAGE_ACTION_GROUP, "1", musicGroup.getName());
+
+        //统计变更学员数
+        groupEventSource.musicGroupStudentChangeEvent(musicGroupId, StudentMusicGroupStatusEnum.NORMAL, null);
     }
 
     private MusicGroup saveLog(String musicGroupId, MusicGroupStatusEnum statusEnum) throws Exception {
@@ -1559,6 +1566,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         //删除课表
         courseScheduleDao.logicDeleteCourseSchedulesByMusicGroupID(musicGroup.getId());
 
+        //统计变更学员数
+        groupEventSource.musicGroupStudentChangeEvent(musicGroupId, StudentMusicGroupStatusEnum.QUIT, null);
+
         return true;
     }
 
@@ -1596,6 +1606,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         //恢复课表
         courseScheduleDao.resumeCourseScheduleByMusicGroupId(musicGroup.getId());
 
+        //统计变更学员数
+        groupEventSource.musicGroupStudentChangeEvent(musicGroupId, StudentMusicGroupStatusEnum.NORMAL, null);
+
         return true;
     }
 
@@ -1898,6 +1911,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 musicGroupSubjectPlanDao.update(musicGroupSubjectPlan);
             }
 
+            //统计变更学员数
+            groupEventSource.musicGroupStudentChangeEvent(musicGroupId, StudentMusicGroupStatusEnum.QUIT, new ArrayList<>(Arrays.asList(userId)));
+
             if (currentStudentMusicGroupStatus != StudentMusicGroupStatusEnum.NORMAL) {
                 return true;
             }
@@ -2073,6 +2089,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             musicGroupSubjectPlanDao.update(musicGroupSubjectPlan);
         }
 
+        //统计变更学员数
+        groupEventSource.musicGroupStudentChangeEvent(musicGroupId, StudentMusicGroupStatusEnum.QUIT, new ArrayList<>(Arrays.asList(userId)));
+
         if (currentStudentMusicGroupStatus != StudentMusicGroupStatusEnum.NORMAL) {
             return true;
         }
@@ -2953,6 +2972,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
         //删除未上课表
         courseScheduleDao.logicDeleteCourseSchedulesByMusicGroupID(musicGroup.getId());
+
+        //统计变更学员数
+        groupEventSource.musicGroupStudentChangeEvent(closeMusicGroupDto.getMusicGroupId(), StudentMusicGroupStatusEnum.QUIT, null);
+
         return true;
     }
 

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

@@ -2786,7 +2786,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
 
         Date now = new Date();
 
-        int studentExitChargePractices = practiceGroupDao.checkStudentExitChargePractice(practiceGroupBuyParams.getStudentId());
+        int studentExitChargePractices = practiceGroupDao.checkStudentExitChargePractice(practiceGroupBuyParams.getStudentId(),"2021-03-09 00:00:00");
 
         LocalDate courseStartDay = LocalDate.now();
         LocalDate tempCourseLocalDate = LocalDate.parse("2020-03-01", DateUtil.dateFormatter);
@@ -2894,8 +2894,9 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             throw new BizException("所在城市暂不参与此活动");
         }
         BigDecimal oneMonthPrice;
-        if (practiceBuyActivityExpireDate.after(now)) {
-            oneMonthPrice = practiceGroupBuyParams.getDrillTimesOnWeek() == 1 ? practiceGroupSellPrice.getOnceActivityPrice() : practiceGroupSellPrice.getTwiceActivityPrice();
+        if (practiceBuyActivityExpireDate.after(now)&&Objects.nonNull(sysUser.getOrganId())&&sysUser.getOrganId()==14&& studentExitChargePractices <= 0) {
+//            oneMonthPrice = practiceGroupBuyParams.getDrillTimesOnWeek() == 1 ? practiceGroupSellPrice.getOnceActivityPrice() : practiceGroupSellPrice.getTwiceActivityPrice();
+            oneMonthPrice = practiceGroupBuyParams.getDrillTimesOnWeek() == 1 ? practiceGroupSellPrice.getOnceOriginalPrice() : practiceGroupSellPrice.getTwiceOriginalPrice();
             if (!now.before(practicePromotionActivityStartDate) && practiceGroupBuyParams.getBuyMonths() >= 3 && studentExitChargePractices > 0) {
                 oneMonthPrice = practiceGroupBuyParams.getDrillTimesOnWeek() == 1 ? practiceGroupSellPrice.getOnceQuartActivityPrice() : practiceGroupSellPrice.getTwiceQuartActivityPrice();
             } else if (!now.before(practicePromotionActivityStartDate) && studentExitChargePractices <= 0) {
@@ -2905,7 +2906,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             oneMonthPrice = practiceGroupBuyParams.getDrillTimesOnWeek() == 1 ? practiceGroupSellPrice.getOnceOriginalPrice() : practiceGroupSellPrice.getTwiceOriginalPrice();
         }
         BigDecimal amount = oneMonthPrice.multiply(new BigDecimal(practiceGroupBuyParams.getBuyMonths()));
-        if (!now.before(practicePromotionActivityStartDate) && now.before(practiceBuyActivityExpireDate) && studentExitChargePractices <= 0) {
+        if (!now.before(practicePromotionActivityStartDate) && now.before(practiceBuyActivityExpireDate) && Objects.nonNull(sysUser.getOrganId())&&sysUser.getOrganId()==14 && studentExitChargePractices <= 0) {
             amount = oneMonthPrice.multiply(new BigDecimal(1));
         }
 
@@ -3730,7 +3731,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
 
     @Override
     public boolean isPurchasedPracticeCourse(Integer userId) {
-        int count = practiceGroupDao.checkStudentExitChargePractice(userId);
+        int count = practiceGroupDao.checkStudentExitChargePractice(userId, null);
         if (count > 0) {
             return true;
         }

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

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

+ 59 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicScoreAccompanimentServiceImpl.java

@@ -0,0 +1,59 @@
+package com.ym.mec.biz.service.impl;
+
+
+import com.ym.mec.biz.dal.dao.SysMusicScoreAccompanimentDao;
+import com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment;
+import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
+import com.ym.mec.biz.service.SysMusicScoreAccompanimentService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.util.collection.MapUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class SysMusicScoreAccompanimentServiceImpl extends BaseServiceImpl<Integer, SysMusicScoreAccompaniment> implements SysMusicScoreAccompanimentService {
+	
+	@Autowired
+	private SysMusicScoreAccompanimentDao sysMusicScoreAccompanimentDao;
+
+	@Override
+	public BaseDAO<Integer, SysMusicScoreAccompaniment> getDAO() {
+		return sysMusicScoreAccompanimentDao;
+	}
+
+	@Override
+	public void updateAcc(SysMusicScoreAccompaniment sysMusicScoreAccompaniment) {
+		SysMusicScoreAccompaniment accompaniment = sysMusicScoreAccompanimentDao.get(sysMusicScoreAccompaniment.getId());
+		if(accompaniment == null){
+			throw new BizException("操作失败:伴奏信息不存在");
+		}
+		List<Integer> idList = new ArrayList<>();
+		idList.add(accompaniment.getId());
+		List<Integer> subjectIds = sysMusicScoreAccompanimentDao.findSubjectByMusicScoreId(accompaniment.getExamSongId(),idList);
+		if(subjectIds.size() > 0 && subjectIds.contains(accompaniment.getId())){
+			throw new BizException("操作失败:请勿提交重复的伴奏声部");
+		}
+		sysMusicScoreAccompanimentDao.update(sysMusicScoreAccompaniment);
+	}
+
+	@Override
+	public List<SysMusicScoreAccompaniment> queryAll(SysExamSongQueryInfo queryInfo) {
+		Map<String, Object> params = new HashMap<>();
+		MapUtil.populateMap(params, queryInfo);
+		return sysMusicScoreAccompanimentDao.queryPage(params);
+	}
+
+	@Override
+	public List<SysMusicScoreAccompaniment> queryAccPage(SysExamSongQueryInfo queryInfo) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		MapUtil.populateMap(params, queryInfo);
+		return sysMusicScoreAccompanimentDao.queryAccPage(params);
+	}
+}

+ 54 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicScoreCategoriesServiceImpl.java

@@ -0,0 +1,54 @@
+package com.ym.mec.biz.service.impl;
+
+
+import com.ym.mec.auth.api.dto.MusicScoreQueryInfo;
+import com.ym.mec.auth.api.entity.SysMenu;
+import com.ym.mec.biz.dal.dao.SysMusicScoreCategoriesDao;
+import com.ym.mec.biz.dal.entity.SysMusicScoreCategories;
+import com.ym.mec.biz.service.SysMusicScoreCategoriesService;
+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;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class SysMusicScoreCategoriesServiceImpl extends BaseServiceImpl<Integer, SysMusicScoreCategories> implements SysMusicScoreCategoriesService {
+	
+	@Autowired
+	private SysMusicScoreCategoriesDao sysMusicScoreCategoriesDao;
+
+	@Override
+	public BaseDAO<Integer, SysMusicScoreCategories> getDAO() {
+		return sysMusicScoreCategoriesDao;
+	}
+
+
+	@Override
+	public List<SysMusicScoreCategories> queryTree(MusicScoreQueryInfo menuQueryInfo) {
+		List<SysMusicScoreCategories> scoreCategories = sysMusicScoreCategoriesDao.findByParentId(menuQueryInfo.getParentId());
+		List<SysMusicScoreCategories> scoreCategoriesAllList = sysMusicScoreCategoriesDao.findByParentId(null);
+		for (SysMusicScoreCategories categories : scoreCategories) {
+			categories = getTree(categories,scoreCategoriesAllList);
+		}
+		return scoreCategories;
+	}
+
+	private SysMusicScoreCategories getTree(SysMusicScoreCategories categories,List<SysMusicScoreCategories> scoreCategoriesAllList){
+		//得到根节点对象
+		//获取子节点list
+		List<SysMusicScoreCategories> scoreCategories = scoreCategoriesAllList.stream().filter(e->e.getParentId().equals(categories.getId())).collect(Collectors.toList());
+		//如果存在子节点
+		if(scoreCategories != null && scoreCategories.size() > 0) {
+			//将子节点list放入父节点对象
+			categories.setSysMusicScoreCategoriesList(scoreCategories);
+			//遍历子节点....
+			for (SysMusicScoreCategories sysMenu : scoreCategories) {
+				getTree(sysMenu,scoreCategoriesAllList);
+			}
+		}
+		return categories;
+	}
+}

+ 97 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicScoreServiceImpl.java

@@ -0,0 +1,97 @@
+package com.ym.mec.biz.service.impl;
+
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.SysMusicScoreAccompanimentDao;
+import com.ym.mec.biz.dal.dao.SysMusicScoreDao;
+import com.ym.mec.biz.dal.dto.MusicScoreDto;
+import com.ym.mec.biz.dal.entity.SysMusicScore;
+import com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment;
+import com.ym.mec.biz.service.SysMusicScoreService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class SysMusicScoreServiceImpl extends BaseServiceImpl<Integer, SysMusicScore> implements SysMusicScoreService {
+	
+	@Autowired
+	private SysMusicScoreDao sysMusicScoreDao;
+	@Autowired
+	private SysMusicScoreAccompanimentDao sysMusicScoreAccompanimentDao;
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
+
+	@Override
+	public BaseDAO<Integer, SysMusicScore> getDAO() {
+		return sysMusicScoreDao;
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void updateMusicScore(MusicScoreDto examSongDto) {
+		SysMusicScore sysMusicScore = examSongDto.getSysMusicScore();
+		sysMusicScoreDao.update(sysMusicScore);
+		List<Integer> delExamSongAccompanimentIds = examSongDto.getDelExamSongAccompanimentIds();
+		if(delExamSongAccompanimentIds != null && delExamSongAccompanimentIds.size() > 0){
+			sysMusicScoreAccompanimentDao.batchDel(delExamSongAccompanimentIds);
+		}
+		List<SysMusicScoreAccompaniment> sysMusicScoreAccompaniments = examSongDto.getSysMusicScoreAccompaniments();
+		if(sysMusicScoreAccompaniments != null && sysMusicScoreAccompaniments.size() > 0){
+			List<Integer> subjectIdList = sysMusicScoreAccompaniments.stream().map(e -> e.getSubjectId()).collect(Collectors.toList());
+			subjectIdList.removeAll(Collections.singleton(null));
+			if(subjectIdList.size() > 0){
+				List<Integer> idList = sysMusicScoreAccompaniments.stream().map(e -> e.getId()).collect(Collectors.toList());
+				List<Integer> subjectIds = sysMusicScoreAccompanimentDao.findSubjectByMusicScoreId(sysMusicScore.getId(),idList);
+				int subjectSize = subjectIds.size() + subjectIdList.size();
+				subjectIdList.addAll(subjectIds);
+				int size = new HashSet<>(subjectIdList).size();
+				if(size < subjectSize){
+					throw new BizException("操作失败:请勿提交重复的伴奏声部");
+				}
+			}
+			//获取需要修改的伴奏
+			List<SysMusicScoreAccompaniment> updateCollect = sysMusicScoreAccompaniments.stream().filter(e -> e.getId() != null).collect(Collectors.toList());
+			if(updateCollect.size() > 0){
+				sysMusicScoreAccompanimentDao.batchUpdate(updateCollect);
+			}
+			//获取需要新增的伴奏
+			List<SysMusicScoreAccompaniment> addCollect = sysMusicScoreAccompaniments.stream().filter(e -> e.getId() == null).collect(Collectors.toList());
+			if(addCollect.size() > 0){
+				sysMusicScoreAccompanimentDao.batchInsert(addCollect,sysMusicScore.getId());
+			}
+		}
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void add(MusicScoreDto examSongDto) {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if(sysUser == null){
+			throw new BizException("请登录");
+		}
+		SysMusicScore sysMusicScore = examSongDto.getSysMusicScore();
+		sysMusicScore.setCreateUserId(sysUser.getId());
+		sysMusicScoreDao.insert(sysMusicScore);
+		List<SysMusicScoreAccompaniment> sysMusicScoreAccompaniments = examSongDto.getSysMusicScoreAccompaniments();
+		if(sysMusicScoreAccompaniments != null && sysMusicScoreAccompaniments.size() > 0){
+			sysMusicScoreAccompanimentDao.batchInsert(sysMusicScoreAccompaniments,sysMusicScore.getId());
+		}
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void del(Integer id) {
+		sysMusicScoreDao.delete(id);
+		sysMusicScoreAccompanimentDao.deleteBySongId(id);
+	}
+}

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

@@ -511,8 +511,18 @@
 			</if>
 	</select>
 
+	<select id="queryNoPaymentCanPushByCalenderId"
+			resultMap="MusicGroupPaymentCalenderDetail">
+		SELECT mgpcd.* FROM music_group_payment_calender_detail mgpcd
+								LEFT JOIN music_group_payment_calender mgpc ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
+		WHERE (mgpc.status_ = 'OPEN' OR mgpcd.open_ = 1) AND mgpcd.payment_status_ = 'NON_PAYMENT' AND mgpcd.expect_amount_ != 0
+		AND mgpcd.music_group_payment_calender_id_ = #{calenderId} AND FIND_IN_SET(mgpcd.user_id_,#{studentIds})
+	</select>
+
     <update id="updateNoPaymentAndZeroPaymentStatus">
-		UPDATE music_group_payment_calender_detail SET payment_status_ = 'PAID_COMPLETED',actual_amount_ = 0,update_time_ = NOW()
-		WHERE music_group_payment_calender_id_ = #{calenderId} AND expect_amount_ = 0 AND payment_status_ = 'NON_PAYMENT'
+		UPDATE music_group_payment_calender_detail mgpcd
+		SET mgpcd.payment_status_ = 'PAID_COMPLETED',mgpcd.actual_amount_ = 0,mgpcd.update_time_ = NOW()
+		WHERE mgpcd.music_group_payment_calender_id_ = #{calenderId} AND mgpcd.expect_amount_ = 0
+		AND mgpcd.payment_status_ = 'NON_PAYMENT'
 	</update>
 </mapper>

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

@@ -672,6 +672,9 @@
 
     <select id="checkStudentExitChargePractice" resultType="int">
         SELECT COUNT(id_) FROM practice_group WHERE type_='CHARGE' AND student_id_=#{studentId} AND group_status_ IN ('NORMAL', 'FINISH')
+        <if test="startTime!=null and startTime!=''">
+            AND create_time_>#{startTime}
+        </if>
     </select>
 
     <select id="countStudentIngTrialPractices" resultType="int">

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

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

+ 204 - 0
mec-biz/src/main/resources/config/mybatis/SysMusicScoreAccompanimentMapper.xml

@@ -0,0 +1,204 @@
+<?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.SysMusicScoreAccompanimentDao">
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment" id="SysMusicScoreAccompaniment">
+		<result column="id_" property="id" />
+		<result column="exam_song_id_" property="examSongId" />
+		<result column="subject_id_" property="subjectId" />
+		<result column="subject_name_" property="subjectName" />
+		<result column="mp3_url_" property="mp3Url" />
+		<result column="xml_url_" property="xmlUrl" />
+		<result column="name_" property="examSongName" />
+		<result column="categories_name_" property="categoriesName" />
+		<result column="categories_id_" property="categoriesId" />
+		<result column="type_" property="type" />
+		<result column="url_" property="url" />
+		<result column="del_flag_" property="delFlag" />
+		<result column="speed_" property="speed" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+
+	<delete id="deleteBySongId">
+		UPDATE sys_music_score_accompaniment SET del_flag_ = 1,update_time_ = NOW() WHERE exam_song_id_ = #{id}
+	</delete>
+
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="SysMusicScoreAccompaniment" >
+		SELECT sesa.*,ses.name_,ses.type_,ses.url_,sesc.name_ categories_name_,sesc.id_ categories_id_
+		FROM sys_music_score_accompaniment sesa
+		LEFT JOIN sys_music_score ses ON ses.id_ = sesa.exam_song_id_
+		LEFT JOIN sys_music_score_categories sesc ON sesc.id_ = ses.music_score_categories_id_
+		WHERE sesa.id_ = #{id}
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="SysMusicScoreAccompaniment">
+		SELECT * FROM sys_music_score_accompaniment ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO sys_music_score_accompaniment (exam_song_id_,subject_id_,mp3_url_,speed_,xml_url_,create_time_,update_time_)
+		VALUES(#{examSongId},#{subjectId},#{mp3Url},#{speed},#{xmlUrl},NOW(),NOW())
+	</insert>
+    <insert id="batchInsert">
+		INSERT INTO sys_music_score_accompaniment (exam_song_id_,subject_id_,mp3_url_,speed_,xml_url_,create_time_,update_time_)
+		VALUES
+		<foreach collection="sysMusicScoreAccompaniments" item="item"  separator=",">
+			(#{sysMusicScoreId},#{item.subjectId},#{item.mp3Url},#{item.speed},#{item.xmlUrl},NOW(),NOW())
+		</foreach>
+	</insert>
+
+    <!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment">
+		UPDATE sys_music_score_accompaniment
+		<set>
+		<if test="subjectId != null">
+			subject_id_ = #{subjectId},
+		</if>
+		<if test="speed != null">
+			speed_ = #{speed},
+		</if>
+		<if test="xmlUrl != null">
+			xml_url_ = #{xmlUrl},
+		</if>
+		<if test="examSongId != null">
+			exam_song_id_ = #{examSongId},
+		</if>
+		<if test="mp3Url != null">
+			mp3_url_ = #{mp3Url},
+		</if>
+		update_time_ = NOW()
+	</set>WHERE id_ = #{id}
+	</update>
+	<update id="batchDel">
+		UPDATE sys_music_score_accompaniment SET del_flag_ = 1,update_time_ = NOW() WHERE id_ IN
+		<foreach collection="delExamSongAccompanimentIds" item="item" open="(" close=")" separator=",">
+			#{item}
+		</foreach>
+	</update>
+	<update id="batchUpdate">
+		<foreach collection="sysMusicScoreAccompaniments" item="item" separator=";">
+			UPDATE sys_music_score_accompaniment
+			<set>
+				<if test="item.speed != null">
+					speed_ = #{item.speed},
+				</if>
+				<if test="item.subjectId != null">
+					subject_id_ = #{item.subjectId},
+				</if>
+				<if test="item.xmlUrl != null">
+					xml_url_ = #{item.xmlUrl},
+				</if>
+				<if test="item.examSongId != null">
+					exam_song_id_ = #{item.examSongId},
+				</if>
+				<if test="item.mp3Url != null">
+					mp3_url_ = #{item.mp3Url},
+				</if>
+				update_time_ = NOW()
+			</set> WHERE id_ = #{item.id}
+		</foreach>
+	</update>
+
+	<!-- 根据主键删除一条记录 -->
+	<update id="delete" >
+		UPDATE sys_music_score_accompaniment SET del_flag_ = 1,update_time_ = NOW() WHERE id_ = #{id}
+	</update>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="SysMusicScoreAccompaniment" parameterType="map">
+		SELECT sesa.*,s.name_ subject_name_,sesc.name_ categories_name_,sesc.id_ categories_id_
+		FROM sys_music_score_accompaniment sesa
+		LEFT JOIN sys_music_score ses ON ses.id_ = sesa.exam_song_id_
+		LEFT JOIN sys_music_score_categories sesc ON sesc.id_ = ses.music_score_categories_id_
+		LEFT JOIN `subject` s ON s.id_ = sesa.subject_id_
+		<where>
+			sesa.del_flag_ = 0
+			<if test="subjectId != null">
+				AND sesa.subject_id_ = #{subjectId}
+			</if>
+			<if test="sysMusicScoreId != null">
+				AND sesa.exam_song_id_ = #{sysMusicScoreId}
+			</if>
+		</where>
+		ORDER BY sesa.id_ DESC
+		<include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM sys_music_score_accompaniment
+	</select>
+	<select id="findSubjectByMusicScoreId" resultType="java.lang.Integer">
+		SELECT subject_id_ FROM sys_music_score_accompaniment
+		<where>
+			del_flag_ = 0
+			<if test="sysMusicScoreId != null">
+				AND exam_song_id_ = #{sysMusicScoreId}
+			</if>
+			<if test="idList != null and idList.size > 0">
+				AND id_ NOT IN
+				<foreach collection="idList" open="(" close=")" item="item" separator=",">
+					#{item}
+				</foreach>
+			</if>
+		</where>
+	</select>
+	<select id="queryAccPage" resultMap="SysMusicScoreAccompaniment">
+		SELECT sesa.*,ses.name_,ses.type_,ses.url_,s.name_ subject_name_,sesc.name_ categories_name_,sesc.id_ categories_id_
+		FROM sys_music_score_accompaniment sesa
+		LEFT JOIN sys_music_score ses ON ses.id_ = sesa.exam_song_id_
+		LEFT JOIN sys_music_score_categories sesc ON sesc.id_ = ses.music_score_categories_id_
+		LEFT JOIN subject s ON s.id_ = sesa.subject_id_
+		<include refid="queryPageSql"/>
+	</select>
+
+	<select id="findAccCount" resultType="java.lang.Integer">
+		SELECT COUNT(DISTINCT sesa.id_) FROM sys_music_score_accompaniment sesa
+		LEFT JOIN sys_music_score ses ON ses.id_ = sesa.exam_song_id_
+		<include refid="queryPageSql"/>
+	</select>
+
+	<sql id="queryPageSql">
+		<where>
+			sesa.del_flag_ = 0
+			<if test="search != null and search != ''">
+				AND (sesa.id_ = #{search} OR ses.name_ LIKE CONCAT('%',#{search},'%'))
+			</if>
+			<if test="sysMusicScoreId != null">
+				AND sesa.exam_song_id_ = #{sysMusicScoreId}
+			</if>
+			<if test="subjectId != null">
+				AND sesa.subject_id_ = #{subjectId}
+			</if>
+			<if test="type != null and type == 'COMMON'">
+				AND ses.type_ = #{type}
+			</if>
+			<if test="type != null and type == 'ALL'">
+				<if test="createUserId != null">
+					AND (ses.type_ = 'COMMON' OR (ses.create_user_id_ = #{createUserId} AND ses.type_ = 'PERSON'))
+				</if>
+			</if>
+			<if test="type != null and type == 'PERSON'">
+				<if test="createUserId != null">
+					AND ses.type_ = #{type} AND ses.create_user_id_ = #{createUserId}
+				</if>
+				<if test="createUserId == null">
+					AND ses.type_ = #{type}
+				</if>
+			</if>
+			<if test="type == null or type == ''">
+				<if test="createUserId != null">
+					AND ses.create_user_id_ = #{createUserId}
+				</if>
+			</if>
+		</where>
+	</sql>
+</mapper>

+ 89 - 0
mec-biz/src/main/resources/config/mybatis/SysMusicScoreCategoriesMapper.xml

@@ -0,0 +1,89 @@
+<?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.SysMusicScoreCategoriesDao">
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.SysMusicScoreCategories" id="SysMusicScoreCategories">
+		<result column="id_" property="id" />
+		<result column="parent_id_" property="parentId" />
+		<result column="name_" property="name" />
+		<result column="cover_img_" property="coverImg" />
+		<result column="operator_id_" property="operatorId" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="SysMusicScoreCategories" >
+		SELECT * FROM sys_music_score_categories WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="SysMusicScoreCategories">
+		SELECT * FROM sys_music_score_categories ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysMusicScoreCategories" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO sys_music_score_categories (id_,parent_id_,name_,cover_img_,operator_id_,create_time_,update_time_)
+		VALUES(#{id},#{parentId},#{name},#{coverImg},#{operatorId},#{createTime},#{updateTime})
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.SysMusicScoreCategories">
+		UPDATE sys_music_score_categories <set>
+		<if test="parentId != null">
+		parent_id_ = #{parentId},
+		</if>
+		<if test="operatorId != null">
+		operator_id_ = #{operatorId},
+		</if>
+		<if test="coverImg != null">
+		cover_img_ = #{coverImg},
+		</if>
+		<if test="id != null">
+		id_ = #{id},
+		</if>
+		<if test="updateTime != null">
+		update_time_ = #{updateTime},
+		</if>
+		<if test="name != null">
+		name_ = #{name},
+		</if>
+		<if test="createTime != null">
+		create_time_ = #{createTime},
+		</if>
+		</set> WHERE id_ = #{id}
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM sys_music_score_categories WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="SysMusicScoreCategories" parameterType="map">
+		SELECT * FROM sys_music_score_categories ORDER BY id_
+		<include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM sys_music_score_categories
+	</select>
+	<select id="findByParentId" resultMap="SysMusicScoreCategories">
+		SELECT sm.* FROM sys_music_score_categories sm
+		<include refid="queryTree"/>
+		ORDER BY sm.id_ DESC
+	</select>
+	<sql id="queryTree">
+		<where>
+			<if test="parentId != null">
+				AND sm.parent_id_ = #{parentId}
+			</if>
+		</where>
+	</sql>
+</mapper>

+ 129 - 0
mec-biz/src/main/resources/config/mybatis/SysMusicScoreMapper.xml

@@ -0,0 +1,129 @@
+<?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.SysMusicScoreDao">
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.SysMusicScore" id="SysMusicScore">
+		<result column="id_" property="id" />
+		<result column="name_" property="name" />
+		<result column="categories_name_" property="categoriesName" />
+		<result column="categories_id_" property="categoriesId" />
+		<result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+		<result column="subject_ids_" property="subjectIds" />
+		<result column="speed_" property="speed" />
+		<result column="url_" property="url" />
+		<result column="create_user_id_" property="createUserId" />
+		<result column="create_user_name_" property="createUserName" />
+		<result column="del_flag_" property="delFlag" />
+		<result column="update_time_" property="updateTime" />
+		<result column="create_time_" property="createTime" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="SysMusicScore" >
+		SELECT * FROM sys_music_score WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="SysMusicScore">
+		SELECT * FROM sys_music_score ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysMusicScore" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO sys_music_score (music_score_categories_id_,name_,type_,speed_,url_,create_user_id_,update_time_,create_time_)
+		VALUES(#{musicScoreCategoriesId},#{name},#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{speed},#{url},#{createUserId},NOW(),NOW())
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.SysMusicScore">
+		UPDATE sys_music_score <set>
+		<if test="delFlag != null">
+			del_flag_ = #{delFlag},
+		</if>
+		<if test="musicScoreCategoriesId != null">
+			music_score_categories_id_ = #{musicScoreCategoriesId},
+		</if>
+		<if test="createUserId != null">
+			create_user_id_ = #{createUserId},
+		</if>
+		<if test="url != null and url != ''">
+			url_ = #{url},
+		</if>
+		<if test="subjectIds != null and subjectIds != ''">
+			subject_ids_ = #{subjectIds},
+		</if>
+		<if test="type != null">
+			type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+		</if>
+		<if test="name != null and name != ''">
+			name_ = #{name},
+		</if>
+		<if test="speed != null">
+			speed_ = #{speed},
+		</if>
+		<if test="updateTime != null">
+			update_time_ = NOW()
+		</if>
+	</set>
+		WHERE id_ = #{id}
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<update id="delete" >
+		UPDATE sys_music_score SET del_flag_ = 1 WHERE id_ = #{id}
+	</update>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="SysMusicScore" parameterType="map">
+		SELECT ses.*,su.real_name_ create_user_name_,smsc.name_ categories_name_,smsc.id_ categories_id_
+		FROM sys_music_score ses
+		LEFT JOIN sys_user su ON ses.create_user_id_ = su.id_
+		LEFT JOIN sys_music_score_categories smsc ON smsc.id_ = ses.music_score_categories_id_
+		<include refid="queryPageSql"/>
+		GROUP BY ses.id_
+		ORDER BY ses.id_ DESC
+		<include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(0) FROM sys_music_score ses
+		<include refid="queryPageSql"/>
+	</select>
+	<sql id="queryPageSql">
+		<where>
+			ses.del_flag_ = 0
+			<if test="categoriesId != null">
+				AND ses.music_score_categories_id_ = #{categoriesId}
+			</if>
+			<if test="search != null and search != ''">
+				AND (ses.id_ = #{search} OR ses.name_ LIKE CONCAT('%',#{search},'%'))
+			</if>
+			<if test="type != null and type == 'COMMON'">
+				AND ses.type_ = #{type}
+			</if>
+			<if test="type != null and type == 'ALL'">
+				<if test="createUserId != null">
+					AND (ses.type_ = 'COMMON' OR (ses.create_user_id_ = #{createUserId} AND ses.type_ = 'PERSON'))
+				</if>
+			</if>
+			<if test="type != null and type == 'PERSON'">
+				<if test="createUserId != null">
+					AND ses.type_ = #{type} AND ses.create_user_id_ = #{createUserId}
+				</if>
+				<if test="createUserId == null">
+					AND ses.type_ = #{type}
+				</if>
+			</if>
+			<if test="type == null or type == ''">
+				<if test="createUserId != null">
+					AND ses.create_user_id_ = #{createUserId}
+				</if>
+			</if>
+		</where>
+	</sql>
+</mapper>

+ 6 - 0
mec-common/audit-log/pom.xml

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

+ 10 - 0
mec-common/audit-log/src/main/java/com/yonge/log/dal/model/AuditLog.java

@@ -18,6 +18,8 @@ public class AuditLog implements Serializable {
 
 	private String username;
 
+	private Integer userId;
+
 	private String operateName;
 
 	private String interfaceUrl;
@@ -32,6 +34,14 @@ public class AuditLog implements Serializable {
 
 	private String service;
 
+	public Integer getUserId() {
+		return userId;
+	}
+
+	public void setUserId(Integer userId) {
+		this.userId = userId;
+	}
+
 	public String getService() {
 		return service;
 	}

+ 69 - 35
mec-common/audit-log/src/main/java/com/yonge/log/interceptor/AuditLogInterceptor.java

@@ -3,23 +3,17 @@ package com.yonge.log.interceptor;
 import java.io.IOException;
 import java.nio.charset.Charset;
 import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Map;
-import java.util.Objects;
-
+import java.util.*;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-
+import io.swagger.annotations.ApiOperation;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.context.support.WebApplicationContextUtils;
 import org.springframework.web.method.HandlerMethod;
 import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
-
 import com.ym.mec.util.json.JsonUtil;
 import com.ym.mec.util.web.WebUtil;
 import com.yonge.log.dal.model.AuditLog;
@@ -39,8 +33,14 @@ public class AuditLogInterceptor extends HandlerInterceptorAdapter {
 
 	private String username;
 
+	private Integer userId;
+
 	private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
+	private static List<String> ignoreLogUrl;
+
+
+
 	@Override
 	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServletException, IOException {
 
@@ -48,39 +48,73 @@ public class AuditLogInterceptor extends HandlerInterceptorAdapter {
 	}
 
 	@Override
-	public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
-
-		HandlerMethod handlerMethod = (HandlerMethod) handler;
-		AuditLogAnnotation anno = handlerMethod.getMethodAnnotation(AuditLogAnnotation.class);
-
-		if (anno != null) {
-			AuditLog auditLog = new AuditLog();
-			auditLog.setOperateName(anno.operateName());
-			if(StringUtils.isNotBlank(anno.interfaceURL())){
-				auditLog.setInterfaceUrl(anno.interfaceURL());
-			}else{
-				auditLog.setInterfaceUrl(request.getRequestURI());
+	public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
+		try {
+			String servletPath = request.getServletPath();
+			HandlerMethod handlerMethod = (HandlerMethod) handler;
+			AuditLogAnnotation anno = handlerMethod.getMethodAnnotation(AuditLogAnnotation.class);
+			ApiOperation apiOperation = handlerMethod.getMethodAnnotation(ApiOperation.class);
+			String operateName = null;
+			if(StringUtils.isEmpty(operateName) && apiOperation != null){
+				operateName = apiOperation.value();
 			}
-			auditLog.setToken(request.getHeader("Authorization"));
-			auditLog.setService(clientName);
-			auditLog.setUserIp(WebUtil.getRemoteIp(request));
-
-			Map<String, Object> params = WebUtil.getParameterMap(request);
-			if (params == null || params.size() == 0) {
-				auditLog.setInputParams(IOUtils.toString(request.getInputStream(), Charset.defaultCharset()));
-			} else {
-				auditLog.setInputParams(JsonUtil.toJSONString(WebUtil.getParameterMap(request)));
+			if(StringUtils.isEmpty(operateName) && anno != null){
+				operateName = anno.operateName();
 			}
-			// 操作人
-			auditLog.setUsername(username);
-			auditLog.setOperateTime(sdf.format(new Date()));
-			auditLogService.insert(auditLog);
+			if(anno != null){
+				saveLog(operateName,servletPath,request);
+				return;
+			}
+			if(servletPath.contains("/task/") || servletPath.contains("/import/") ){
+				return;
+			}
+			String substring = servletPath.substring(servletPath.lastIndexOf("/") + 1).toLowerCase();
+			if(ignoreLogUrl == null){
+				ignoreLogUrl = new ArrayList<>();
+				ignoreLogUrl.add("add");
+				ignoreLogUrl.add("insert");
+				ignoreLogUrl.add("query");
+				ignoreLogUrl.add("get");
+				ignoreLogUrl.add("find");
+				ignoreLogUrl.add("list");
+				ignoreLogUrl.add("detail");
+				ignoreLogUrl.add("hasindexerrdata");
+				ignoreLogUrl.add("newindex");
+			}
+			for (String e : ignoreLogUrl) {
+				if(substring.contains(e)){
+					return;
+				}
+			}
+			saveLog(operateName,servletPath,request);
+		}catch (Exception e){
+			e.printStackTrace();
 		}
+	}
 
+	private void saveLog(String operateName,String servletPath,HttpServletRequest request) throws IOException {
+		AuditLog auditLog = new AuditLog();
+		auditLog.setOperateName(operateName);
+		auditLog.setInterfaceUrl(servletPath);
+		auditLog.setToken(request.getHeader("Authorization"));
+		auditLog.setService(clientName);
+		auditLog.setUserIp(WebUtil.getRemoteIp(request));
+
+		Map<String, Object> params = WebUtil.getParameterMap(request);
+		if (params == null || params.size() == 0) {
+			auditLog.setInputParams(IOUtils.toString(request.getInputStream(), Charset.defaultCharset()));
+		} else {
+			auditLog.setInputParams(JsonUtil.toJSONString(WebUtil.getParameterMap(request)));
+		}
+		// 操作人
+		auditLog.setUsername(username);
+		auditLog.setUserId(userId);
+		auditLog.setOperateTime(sdf.format(new Date()));
+		auditLogService.insert(auditLog);
 	}
 
-	public void setUsername(String username) {
+	public void setUsername(String username,Integer userId) {
 		this.username = username;
+		this.userId = userId;
 	}
-
 }

+ 8 - 0
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupRegisterController.java

@@ -6,11 +6,13 @@ import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
 import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
+import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
 import com.ym.mec.biz.service.MusicGroupService;
 import com.ym.mec.biz.service.MusicGroupSubjectPlanService;
 import com.ym.mec.biz.service.StudentRegistrationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.exception.BizException;
 import com.ym.mec.util.date.DateUtil;
 
 import io.swagger.annotations.Api;
@@ -19,6 +21,7 @@ import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
 import org.springframework.web.bind.annotation.*;
 
 import java.io.IOException;
@@ -62,6 +65,11 @@ public class MusicGroupRegisterController extends BaseController {
             return succeed(studentRegistrationService.updateStudent(studentRegistration));
         }
 
+        StudentRegistration hasReg = studentRegistrationService.getByPhoneAndMusicGroupId(studentRegistration.getMusicGroupId(), studentRegistration.getParentsPhone());
+        if (hasReg != null && hasReg.getMusicGroupStatus() != StudentMusicGroupStatusEnum.QUIT) {
+            return succeed(hasReg);
+        }
+
         if (musicGroup.getStatus().equals(MusicGroupStatusEnum.PAY)) {
             studentRegistration.setPaymentStatus(PaymentStatusEnum.OPEN);
         } else {

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

@@ -198,8 +198,9 @@ public class PracticeGroupController extends BaseController {
         if (sysUser == null) {
             return failed(HttpStatus.FORBIDDEN, "请登录");
         }
-        int studentExitChargePractices = practiceGroupDao.checkStudentExitChargePractice(sysUser.getId());
+        int studentExitChargePractices = practiceGroupDao.checkStudentExitChargePractice(sysUser.getId(),"2021-03-09 00:00:00");
         Map<String, Integer> result=new HashMap<>();
+        result.put("organId", sysUser.getOrganId());
         result.put("isNewStudent", studentExitChargePractices<=0?0:1);
         return succeed(result);
     }

+ 25 - 0
mec-student/src/main/java/com/ym/mec/student/controller/SysMusicScoreAccompanimentController.java

@@ -0,0 +1,25 @@
+package com.ym.mec.student.controller;
+
+import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
+import com.ym.mec.biz.service.SysMusicScoreAccompanimentService;
+import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RequestMapping("sysMusicScoreAccompaniment")
+@Api(tags = "曲库服务")
+@RestController
+public class SysMusicScoreAccompanimentController extends BaseController {
+
+    @Autowired
+    private SysMusicScoreAccompanimentService sysMusicScoreAccompanimentService;
+
+    @ApiOperation(value = "分页查询")
+    @GetMapping("/queryPage")
+    public Object queryPage(SysExamSongQueryInfo queryInfo) {
+        queryInfo.setType("COMMON");
+        return succeed(sysMusicScoreAccompanimentService.queryAccPage(queryInfo));
+    }
+}

+ 25 - 0
mec-student/src/main/java/com/ym/mec/student/controller/SysMusicScoreController.java

@@ -0,0 +1,25 @@
+package com.ym.mec.student.controller;
+
+import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
+import com.ym.mec.biz.service.SysMusicScoreService;
+import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RequestMapping("sysMusicScore")
+@Api(tags = "曲库")
+@RestController
+public class SysMusicScoreController extends BaseController {
+
+    @Autowired
+    private SysMusicScoreService sysMusicScoreService;
+
+    @ApiOperation(value = "分页查询")
+    @GetMapping("/queryPage")
+    public Object queryPage(SysExamSongQueryInfo queryInfo) {
+        queryInfo.setType("COMMON");
+        return succeed(sysMusicScoreService.queryPage(queryInfo));
+    }
+}

+ 1 - 1
mec-student/src/main/java/com/ym/mec/student/interceptor/OperationLogInterceptor.java

@@ -23,7 +23,7 @@ public class OperationLogInterceptor extends AuditLogInterceptor {
 	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServletException, IOException {
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if (sysUser != null) {
-			setUsername(sysUser.getRealName());
+			setUsername(sysUser.getRealName(),sysUser.getId());
 		}
 		return true;
 	}

+ 54 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/SysMusicScoreAccompanimentController.java

@@ -0,0 +1,54 @@
+package com.ym.mec.teacher.controller;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment;
+import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
+import com.ym.mec.biz.service.SysMusicScoreAccompanimentService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.exception.BizException;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RequestMapping("sysMusicScoreAccompaniment")
+@Api(tags = "曲库服务")
+@RestController
+public class SysMusicScoreAccompanimentController extends BaseController {
+
+    @Autowired
+    private SysMusicScoreAccompanimentService sysMusicScoreAccompanimentService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @ApiOperation(value = "修改")
+    @PostMapping("/update")
+    public Object update(@RequestBody SysMusicScoreAccompaniment sysMusicScoreAccompaniment) {
+        sysMusicScoreAccompanimentService.updateAcc(sysMusicScoreAccompaniment);
+        return succeed();
+    }
+
+    @ApiOperation(value = "删除")
+    @PostMapping("/del")
+    public Object del(Integer id) {
+        sysMusicScoreAccompanimentService.delete(id);
+        return succeed();
+    }
+
+    @ApiOperation(value = "分页查询")
+    @GetMapping("/queryPage")
+    public Object queryPage(SysExamSongQueryInfo queryInfo) {
+        String type = queryInfo.getType();
+        if(StringUtils.isEmpty(type)){
+            queryInfo.setType("ALL");
+        }
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(sysUser == null){
+            throw new BizException("请登录");
+        }
+        queryInfo.setCreateUserId(sysUser.getId());
+        return succeed(sysMusicScoreAccompanimentService.queryAccPage(queryInfo));
+    }
+}

+ 55 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/SysMusicScoreController.java

@@ -0,0 +1,55 @@
+package com.ym.mec.teacher.controller;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dto.MusicScoreDto;
+import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
+import com.ym.mec.biz.service.SysMusicScoreService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.exception.BizException;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+@RequestMapping("sysMusicScore")
+@Api(tags = "曲库")
+@RestController
+public class SysMusicScoreController extends BaseController {
+
+    @Autowired
+    private SysMusicScoreService sysMusicScoreService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @ApiOperation(value = "新增")
+    @PostMapping("/add")
+    public Object add(@RequestBody MusicScoreDto examSongDto) {
+        sysMusicScoreService.add(examSongDto);
+        return succeed();
+    }
+
+    @ApiOperation(value = "删除")
+    @PostMapping("/del")
+    public Object del(Integer id) {
+        sysMusicScoreService.del(id);
+        return succeed();
+    }
+
+    @ApiOperation(value = "分页查询")
+    @GetMapping("/queryPage")
+    public Object queryPage(SysExamSongQueryInfo queryInfo) {
+        String type = queryInfo.getType();
+        if(StringUtils.isEmpty(type)){
+            queryInfo.setType("ALL");
+        }
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(sysUser == null){
+            throw new BizException("请登录");
+        }
+        queryInfo.setCreateUserId(sysUser.getId());
+        return succeed(sysMusicScoreService.queryPage(queryInfo));
+    }
+}

+ 1 - 1
mec-teacher/src/main/java/com/ym/mec/teacher/interceptor/OperationLogInterceptor.java

@@ -23,7 +23,7 @@ public class OperationLogInterceptor extends AuditLogInterceptor {
 	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServletException, IOException {
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if (sysUser != null) {
-			setUsername(sysUser.getRealName());
+			setUsername(sysUser.getRealName(),sysUser.getId());
 		}
 		return true;
 	}

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

@@ -424,8 +424,8 @@ public class CourseScheduleController extends BaseController {
     @ApiOperation(value = "陪练课课程组有效期调整")
     @PostMapping("/updateCoursesExpireDate")
     @PreAuthorize("@pcs.hasPermissions('courseSchedule/updateCoursesExpireDate')")
-    public Object updateCoursesExpireDate(String practiceGroupId,Date coursesExpireDate){
-        courseScheduleService.updateCoursesExpireDate(practiceGroupId,coursesExpireDate);
+    public Object updateCoursesExpireDate(String practiceGroupId, Date coursesStartDate,Date coursesExpireDate){
+        courseScheduleService.updatePracticeGroupInDate(practiceGroupId, coursesStartDate,coursesExpireDate);
         return succeed();
     }
 

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

@@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.dto.EmployeeLevelDto;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.enums.EmployeeOperateEnum;
+import com.ym.mec.biz.dal.enums.EmployeeRoleEnum;
 import com.ym.mec.biz.dal.page.EmployeeQueryInfo;
 import com.ym.mec.biz.service.EmployeeService;
 import com.ym.mec.biz.service.OrganizationService;
@@ -167,6 +168,34 @@ public class EmployeeController extends BaseController {
         return succeed(employeeService.findByRole("4,5",organIds));
     }
 
+    @ApiOperation(value = "获取对应角色的员工")
+    @GetMapping("/findUserByRole")
+    public HttpResponseResult findEducationUsers(Integer userId, Integer organId, EmployeeRoleEnum employeeRole){
+        SysUser sysUser;
+        if(userId == null){
+            sysUser = sysUserFeignService.queryUserInfo();
+            if (sysUser == null) {
+                return failed("用户信息获取失败");
+            }
+        }else {
+            sysUser = sysUserFeignService.queryUserById(userId);
+        }
+        String organIds = new String();
+        if(Objects.isNull(organId)){
+            Employee employee = employeeService.get(sysUser.getId());
+            if (StringUtils.isEmpty(organIds)) {
+                organIds = employee.getOrganIdList();
+            }
+        }else{
+            organIds = organId.toString();
+        }
+        if(employeeRole == EmployeeRoleEnum.TEAM_TEACHER){
+            return succeed(employeeService.findByRole("5",organIds));
+        }else {
+            return succeed(employeeService.findByRole("4",organIds));
+        }
+    }
+
     @ApiOperation(value = "获取教务老师")
     @GetMapping("/findEducationTeacher")
     public HttpResponseResult findEducationTeacher(Integer userId){

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

@@ -860,7 +860,7 @@ public class ExportController extends BaseController {
         try {
             HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部名称", "课程编号", "开始时间", "结束时间",
                     "班级名称", "班级声部", "课程名称", "课程类型", "教学模式",
-                    "教学点", "课程状态", "指导老师", "学员编号", "是否点名", "是否有考勤申诉","预计学生数"}, new String[]{
+                    "教学点", "课程状态", "指导老师", "学员编号", "是否点名", "是否有考勤申诉","预计上课人数"}, new String[]{
                     "organName", "id", "startClassTime", "endClassTime", "classGroupName", "subjectName", "name",
                     "groupType.desc", "teachMode.msg", "schoolName", "status.msg", "teacherName", "studentId", "isCallNames.msg", "isComplaints","studentNum"}, rows);
             response.setContentType("application/octet-stream");

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

@@ -76,7 +76,7 @@ public class InspectionItemPlanConclusionController extends BaseController {
             String[] header2 = {"处理方式", planInfo.getMemo(), "", "", "", "", "", "", "", "", "", "", "", "", "", ""};
             String[] header3 = {"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""};
             String[] header4 = {"巡查项目", "课前管理", "", "", "", "", "课中管理", "", "", "", "", "", "", "课后管理", "", ""};
-            String[] header5 = {"", "老师是否提前准备板书(本课内容、作业)", "老师是否佩戴工牌", "老师是否仪容仪表整洁", "老师是否携带乐器", "老师是否携带教学资料、设备", "老师是否合理安排学员座位", "乐器箱包、书包是否摆放整齐", "课堂纪律是否保持良好", "老师是否全程站立教学", "老师是否全程使用节拍器或教学音频", "是否发现学员需要更换新乐器", "老师是否将上课照片/视频发送到声部群", "老师是否保持教室环境卫生", "老师是否关好所有电源、门窗", "老师是否有序组织学员放学"};
+            String[] header5 = {"", "老师是否提前准备板书(本课内容、作业)", "老师是否佩戴工牌", "老师是否仪容仪表整洁", "老师是否携带乐器", "老师是否携带教学资料、设备", "老师是否合理安排学员座位", "乐器箱包、书包是否摆放整齐", "课堂纪律是否保持良好", "老师是否全程站立教学", "老师是否全程使用节拍器或教学音频", "未发现私换乐器", "老师是否将上课照片/视频发送到声部群", "老师是否保持教室环境卫生", "老师是否关好所有电源、门窗", "老师是否有序组织学员放学"};
 
             List<String[]> headers = new LinkedList<>();
             headers.add(header);

+ 7 - 0
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderDetailController.java

@@ -105,6 +105,13 @@ public class MusicGroupPaymentCalenderDetailController extends BaseController {
         return succeed;
     }
 
+    @ApiOperation(value = "发送学员待续费通知")
+    @PostMapping("/sendWaitRenewMessage")
+    @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalenderDetail/sendWaitRenewMessage')")
+    public HttpResponseResult sendWaitRenewMessage(Long calenderId, String studentIds) {
+        musicGroupPaymentCalenderDetailService.pushWaitRenewMessage(calenderId,studentIds);
+        return succeed();
+    }
 
     @ApiOperation(value = "未缴费学员列表")
     @GetMapping("/queryArrearageStudents")

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

@@ -11,6 +11,7 @@ import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 
+import java.io.EOFException;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.util.Date;
@@ -260,6 +261,12 @@ public class StudentRegistrationController extends BaseController {
             } else if (row.getKitPurchaseMethod().equals("GROUP")) {
                 row.setKitPurchaseMethod("团购");
             }
+            if(row.getSubjectFirst().equals(999)){
+                row.setSubjectFirstName("听从老师安排");
+            }
+            if(row.getSubjectSecond().equals(999)){
+                row.setSubjectSecondName("听从老师安排");
+            }
             row.setCurrentGrade(row.getCurrentGrade() + row.getCurrentClass());
         }
         OutputStream outputStream = response.getOutputStream();

+ 44 - 0
mec-web/src/main/java/com/ym/mec/web/controller/SysMusicScoreAccompanimentController.java

@@ -0,0 +1,44 @@
+package com.ym.mec.web.controller;
+
+import com.ym.mec.biz.dal.entity.SysMusicScoreAccompaniment;
+import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
+import com.ym.mec.biz.service.SysMusicScoreAccompanimentService;
+import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+@RequestMapping("sysMusicScoreAccompaniment")
+@Api(tags = "曲库服务")
+@RestController
+public class SysMusicScoreAccompanimentController extends BaseController {
+
+    @Autowired
+    private SysMusicScoreAccompanimentService sysMusicScoreAccompanimentService;
+
+    @ApiOperation(value = "修改")
+    @PostMapping("/update")
+    @PreAuthorize("@pcs.hasPermissions('sysMusicScoreAccompaniment/update')")
+    public Object update(@RequestBody SysMusicScoreAccompaniment sysMusicScoreAccompaniment) {
+        sysMusicScoreAccompanimentService.updateAcc(sysMusicScoreAccompaniment);
+        return succeed();
+    }
+
+    @ApiOperation(value = "删除")
+    @PostMapping("/del/{id}")
+    @PreAuthorize("@pcs.hasPermissions('sysMusicScoreAccompaniment/del')")
+    public Object del(@ApiParam(value = "收费类型编号", required = true) @PathVariable("id") Integer id) {
+        sysMusicScoreAccompanimentService.delete(id);
+        return succeed();
+    }
+
+    @ApiOperation(value = "分页查询")
+    @GetMapping("/queryPage")
+    @PreAuthorize("@pcs.hasPermissions('sysMusicScoreAccompaniment/queryPage')")
+    public Object queryPage(SysExamSongQueryInfo queryInfo) {
+        return succeed(sysMusicScoreAccompanimentService.queryAll(queryInfo));
+    }
+}

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

@@ -0,0 +1,36 @@
+package com.ym.mec.web.controller;
+
+import com.ym.mec.auth.api.dto.MusicScoreQueryInfo;
+import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
+import com.ym.mec.biz.service.SysMusicScoreCategoriesService;
+import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+@RequestMapping("sysMusicScoreCategories")
+@Api(tags = "曲库分类服务")
+@RestController
+public class SysMusicScoreCategoriesController extends BaseController {
+
+    @Autowired
+    private SysMusicScoreCategoriesService sysMusicScoreCategoriesService;
+
+
+    @ApiOperation(value = "分页查询")
+    @GetMapping("/queryPage")
+    @PreAuthorize("@pcs.hasPermissions('sysMusicScoreCategories/queryPage')")
+    public Object queryPage(SysExamSongQueryInfo queryInfo) {
+        return succeed(sysMusicScoreCategoriesService.queryPage(queryInfo));
+    }
+
+    @ApiOperation(value = "树状列表")
+    @GetMapping("/queryTree")
+    @PreAuthorize("@pcs.hasPermissions('sysMusicScoreCategories/queryTree')")
+    public Object queryTree(MusicScoreQueryInfo queryInfo) {
+        return succeed(sysMusicScoreCategoriesService.queryTree(queryInfo));
+    }
+
+}

+ 51 - 0
mec-web/src/main/java/com/ym/mec/web/controller/SysMusicScoreController.java

@@ -0,0 +1,51 @@
+package com.ym.mec.web.controller;
+
+import com.ym.mec.biz.dal.dto.MusicScoreDto;
+import com.ym.mec.biz.dal.page.SysExamSongQueryInfo;
+import com.ym.mec.biz.service.SysMusicScoreService;
+import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+@RequestMapping("sysMusicScore")
+@Api(tags = "曲库")
+@RestController
+public class SysMusicScoreController extends BaseController {
+
+    @Autowired
+    private SysMusicScoreService sysMusicScoreService;
+
+    @ApiOperation(value = "修改")
+    @PostMapping("/update")
+    @PreAuthorize("@pcs.hasPermissions('sysMusicScore/update')")
+    public Object update(@RequestBody MusicScoreDto examSongDto) {
+        sysMusicScoreService.updateMusicScore(examSongDto);
+        return succeed();
+    }
+
+    @ApiOperation(value = "新增")
+    @PostMapping("/add")
+    @PreAuthorize("@pcs.hasPermissions('sysMusicScore/add')")
+    public Object add(@RequestBody MusicScoreDto examSongDto) {
+        sysMusicScoreService.add(examSongDto);
+        return succeed();
+    }
+
+    @ApiOperation(value = "删除")
+    @PostMapping("/del")
+    @PreAuthorize("@pcs.hasPermissions('sysMusicScore/del')")
+    public Object del(Integer id) {
+        sysMusicScoreService.del(id);
+        return succeed();
+    }
+
+    @ApiOperation(value = "分页查询")
+    @GetMapping("/queryPage")
+    @PreAuthorize("@pcs.hasPermissions('sysMusicScore/queryPage')")
+    public Object queryPage(SysExamSongQueryInfo queryInfo) {
+        return succeed(sysMusicScoreService.queryPage(queryInfo));
+    }
+}

+ 3 - 1
mec-web/src/main/java/com/ym/mec/web/controller/education/EduPracticeGroupController.java

@@ -165,8 +165,10 @@ public class EduPracticeGroupController extends BaseController {
         if(Objects.isNull(studentId)){
             throw new BizException("请指定学生");
         }
-        int studentExitChargePractices = practiceGroupDao.checkStudentExitChargePractice(studentId);
+        SysUser student = sysUserFeignService.queryUserById(studentId);
+        int studentExitChargePractices = practiceGroupDao.checkStudentExitChargePractice(studentId, "2021-03-09 00:00:00");
         Map<String, Integer> result=new HashMap<>();
+        result.put("organId", student.getOrganId());
         result.put("isNewStudent", studentExitChargePractices<=0?0:1);
         return succeed(result);
     }

+ 6 - 6
mec-web/src/main/java/com/ym/mec/web/controller/education/EduRepairController.java

@@ -107,12 +107,12 @@ public class EduRepairController extends BaseController {
         }
         repairInfo.setEmployeeId(sysUser.getId());
         repairInfo.setEmployeeName(sysUser.getRealName());
-        if(repairInfo.getSendType().equals(1)){
-            Employee employee = employeeDao.get(sysUser.getId());
-            if(StringUtils.isBlank(employee.getContactAddress())){
-                return failed("联系地址为空,请联系相关人员在\"员工管理\"完善");
-            }
-        }
+//        if(repairInfo.getSendType().equals(1)){
+//            Employee employee = employeeDao.get(sysUser.getId());
+//            if(StringUtils.isBlank(employee.getContactAddress())){
+//                return failed("联系地址为空,请联系相关人员在\"员工管理\"完善");
+//            }
+//        }
         return succeed(studentRepairService.addRepair(repairInfo));
     }
 

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/interceptor/OperationLogInterceptor.java

@@ -25,7 +25,7 @@ public class OperationLogInterceptor extends AuditLogInterceptor {
 	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServletException, IOException {
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if (sysUser != null) {
-			setUsername(sysUser.getRealName());
+			setUsername(sysUser.getRealName(),sysUser.getId());
 		}
 		return true;
 	}