Explorar o código

Merge branch 'master' into vip_double_11

Joburgess %!s(int64=4) %!d(string=hai) anos
pai
achega
807898c19e
Modificáronse 100 ficheiros con 4968 adicións e 1046 borrados
  1. 0 0
      cms/src/main/resources/application-template.yml
  2. 8 18
      mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/entity/LoginEntity.java
  3. 4 0
      mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/entity/SysUser.java
  4. 0 1
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/config/WebSecurityConfig.java
  5. 2 20
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/core/filter/PhoneLoginAuthenticationFilter.java
  6. 41 5
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/core/provider/PhoneAuthenticationProvider.java
  7. 9 9
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/service/SysUserService.java
  8. 45 67
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/service/impl/SysUserServiceImpl.java
  9. 0 0
      mec-auth/mec-auth-server/src/main/resources/application-template.yml
  10. 1 1
      mec-auth/mec-auth-server/src/main/resources/config/mybatis/SysUserMapper.xml
  11. 14 6
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ChargeTypeSubjectMapperDao.java
  12. 18 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java
  13. 21 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java
  14. 73 31
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleStudentPaymentDao.java
  15. 34 14
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/GoodsDao.java
  16. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupOrganizationCourseSettingsDao.java
  17. 16 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupOrganizationCourseSettingsDetailDao.java
  18. 68 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderCourseSettingsDao.java
  19. 187 38
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDao.java
  20. 86 15
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDetailDao.java
  21. 45 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentStudentCourseDetailDao.java
  22. 29 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/OrganizationCourseUnitPriceSettingsDao.java
  23. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java
  24. 4 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentManageDao.java
  25. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDao.java
  26. 9 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDetailDao.java
  27. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentRouteOrderDao.java
  28. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysExamSongDao.java
  29. 7 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherDao.java
  30. 13 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseTimeDto.java
  31. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupCourseScheduleDto.java
  32. 31 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupGoodsAndDiscountDto.java
  33. 26 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentCalenderAddStudentDto.java
  34. 52 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentCalenderAuditDetailDto.java
  35. 280 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentCalenderAuditDto.java
  36. 14 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupSubjectGoodsAndInfoDto.java
  37. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/RegisterPayDto.java
  38. 26 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/RemainCourseTypeDurationDto.java
  39. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/SimpleUserDto.java
  40. 16 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentAttendanceViewDto.java
  41. 20 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherClassCourseSchudeleDto.java
  42. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ChargeTypeSubjectMapper.java
  43. 14 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseSchedule.java
  44. 350 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleAuditDetailDto.java
  45. 44 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleStudentPayment.java
  46. 0 11
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroup.java
  47. 122 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupOrganizationCourseSettings.java
  48. 136 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupOrganizationCourseSettingsDetail.java
  49. 187 70
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalender.java
  50. 138 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalenderCourseSettings.java
  51. 27 5
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalenderDetail.java
  52. 116 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentStudentCourseDetail.java
  53. 114 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/OrganizationCourseUnitPriceSettings.java
  54. 31 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SellOrder.java
  55. 15 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentAttendance.java
  56. 221 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentPaymentRouteOrder.java
  57. 15 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SubjectChange.java
  58. 149 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysExamSong.java
  59. 33 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/ExamSongTypeEnum.java
  60. 15 15
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/FeeTypeEnum.java
  61. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/KitGroupPurchaseTypeEnum.java
  62. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/MessageTypeEnum.java
  63. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/MusicGroupStatusEnum.java
  64. 45 36
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/OrderDetailTypeEnum.java
  65. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/TemplateTypeEnum.java
  66. 27 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/ChargeTypeSubjectMapperQueryInfo.java
  67. 29 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/CourseSettingQueryInfo.java
  68. 0 15
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/MusicCalenderQueryInfo.java
  69. 59 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/MusicGroupPaymentCalenderQueryInfo.java
  70. 42 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/OrganizationCourseUnitPriceSettingsQueryInfo.java
  71. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/SellOrderQueryInfo.java
  72. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentCompetitionQueryInfo.java
  73. 47 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentPaymentRouteOrderQueryInfo.java
  74. 40 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/SysExamSongQueryInfo.java
  75. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/service/ChargeTypeSubjectMapperService.java
  76. 21 5
      mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupService.java
  77. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupStudentMapperService.java
  78. 10 3
      mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleService.java
  79. 29 0
      mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleStudentPaymentService.java
  80. 4 1
      mec-biz/src/main/java/com/ym/mec/biz/service/GoodsCategoryService.java
  81. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupOrganizationCourseSettingsDetailService.java
  82. 32 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupOrganizationCourseSettingsService.java
  83. 21 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderCourseSettingsService.java
  84. 10 4
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderDetailService.java
  85. 106 27
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderService.java
  86. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentStudentCourseDetailService.java
  87. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupService.java
  88. 13 4
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupSubjectPlanService.java
  89. 26 0
      mec-biz/src/main/java/com/ym/mec/biz/service/OrganizationCourseUnitPriceSettingsService.java
  90. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentManageService.java
  91. 41 4
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentRouteOrderService.java
  92. 282 251
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java
  93. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/SysExamSongService.java
  94. 4 16
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ChargeTypeServiceImpl.java
  95. 36 10
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ChargeTypeSubjectMapperServiceImpl.java
  96. 515 228
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java
  97. 170 23
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupStudentMapperServiceImpl.java
  98. 1 14
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupTeacherMapperServiceImpl.java
  99. 111 55
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  100. 180 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleStudentPaymentServiceImpl.java

+ 0 - 0
cms/src/main/resources/application.yml → cms/src/main/resources/application-template.yml


+ 8 - 18
mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/entity/LoginEntity.java

@@ -3,25 +3,23 @@ package com.ym.mec.auth.api.entity;
 public class LoginEntity {
     private String smsCode;
 
-    private String isLessee;
-
     private String clientId;
 
     private String clientSecret;
 
-    private String isRegister;
+    private Boolean isRegister;
 
     private String phone;
 
-    public String getIsRegister() {
-        return isRegister;
-    }
+    public Boolean getIsRegister() {
+		return isRegister;
+	}
 
-    public void setIsRegister(String isRegister) {
-        this.isRegister = isRegister;
-    }
+	public void setIsRegister(Boolean isRegister) {
+		this.isRegister = isRegister;
+	}
 
-    public String getSmsCode() {
+	public String getSmsCode() {
         return smsCode;
     }
 
@@ -29,14 +27,6 @@ public class LoginEntity {
         this.smsCode = smsCode;
     }
 
-    public String getIsLessee() {
-        return isLessee;
-    }
-
-    public void setIsLessee(String isLessee) {
-        this.isLessee = isLessee;
-    }
-
     public String getClientId() {
         return clientId;
     }

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

@@ -6,6 +6,7 @@ import java.io.Serializable;
 import java.util.Date;
 import java.util.List;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import com.ym.mec.auth.api.enums.YesOrNoEnum;
@@ -302,6 +303,9 @@ public class SysUser implements Serializable{
 	}
 
 	public void setUserType(String userType) {
+		if(StringUtils.isNotEmpty(userType) && userType.startsWith(",")){
+			userType = userType.substring(1);
+		}
 		this.userType = userType;
 	}
 

+ 0 - 1
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/config/WebSecurityConfig.java

@@ -124,7 +124,6 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
 		filter.setAuthenticationManager(authenticationManagerBean());
 		filter.setAuthenticationSuccessHandler(successEventHandler);
 		filter.setAuthenticationFailureHandler(failureEvenHandler);
-		filter.setSysUserService(sysUserService);
 		return filter;
 	}
 

+ 2 - 20
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/core/filter/PhoneLoginAuthenticationFilter.java

@@ -10,16 +10,13 @@ import javax.servlet.http.HttpServletResponse;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.security.authentication.AbstractAuthenticationToken;
 import org.springframework.security.authentication.AuthenticationServiceException;
-import org.springframework.security.authentication.LockedException;
 import org.springframework.security.core.Authentication;
 import org.springframework.security.core.AuthenticationException;
 import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter;
 import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
 
-import com.ym.mec.auth.api.dto.SysUserInfo;
 import com.ym.mec.auth.api.entity.LoginEntity;
 import com.ym.mec.auth.config.token.PhoneAuthenticationToken;
-import com.ym.mec.auth.service.SysUserService;
 import com.ym.mec.common.security.SecurityConstants;
 
 public class PhoneLoginAuthenticationFilter extends AbstractAuthenticationProcessingFilter {
@@ -27,14 +24,11 @@ public class PhoneLoginAuthenticationFilter extends AbstractAuthenticationProces
 	private static final String SPRING_SECURITY_RESTFUL_PHONE_KEY = "phone";
 	private static final String SPRING_SECURITY_RESTFUL_VERIFY_CODE_KEY = "smsCode";
 	private static final String clientIdParameter = "clientId";
-	private static final String IS_REGISTER_PARAMETER = "register";
 	private static final String IS_LESSEE = "isLessee";
 
 	private static final String SPRING_SECURITY_RESTFUL_LOGIN_URL = "/smsLogin";
 	private boolean postOnly = true;
 
-	private SysUserService sysUserService;
-
 	public PhoneLoginAuthenticationFilter() {
 		super(new AntPathRequestMatcher(SPRING_SECURITY_RESTFUL_LOGIN_URL, "POST"));
 	}
@@ -49,29 +43,21 @@ public class PhoneLoginAuthenticationFilter extends AbstractAuthenticationProces
 		// 手机验证码登陆
 		String principal = obtainParameter(request, SPRING_SECURITY_RESTFUL_PHONE_KEY);
 		String credentials = obtainParameter(request, SPRING_SECURITY_RESTFUL_VERIFY_CODE_KEY);
-		String isRegister = obtainParameter(request, IS_REGISTER_PARAMETER);
 		// 是否是租户
 		String isLessee = obtainParameter(request, IS_LESSEE);
 
+		boolean isRegister = StringUtils.equals("1", isLessee) || StringUtils.equals("true", isLessee);
+
 		String clientId = request.getParameter(clientIdParameter).toUpperCase();
 
-//		SysUserInfo userInfo = sysUserService.queryUserInfoByPhone(principal);
-		SysUserInfo userInfo = sysUserService.queryUserInfoByPhoneAndClient(principal,clientId);
-		if (userInfo != null && StringUtils.isNotEmpty(isLessee)) {
-			throw new LockedException("用户已存在");
-		}
 		if ("EDUCATION".equals(clientId)) {
 			clientId = "SYSTEM";
 		}
-		if (userInfo != null && !userInfo.getSysUser().getUserType().contains(clientId)) {
-			throw new LockedException("用户不存在,请联系教务老师");
-		}
 
 		principal = principal.trim();
 
 		LoginEntity loginEntity = new LoginEntity();
 		loginEntity.setClientId(clientId);
-		loginEntity.setIsLessee(isLessee);
 		loginEntity.setPhone(principal);
 		loginEntity.setSmsCode(credentials);
 		loginEntity.setIsRegister(isRegister);
@@ -99,8 +85,4 @@ public class PhoneLoginAuthenticationFilter extends AbstractAuthenticationProces
 		return result == null ? "" : result;
 	}
 
-	public void setSysUserService(SysUserService sysUserService) {
-		this.sysUserService = sysUserService;
-	}
-
 }

+ 41 - 5
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/core/provider/PhoneAuthenticationProvider.java

@@ -1,8 +1,11 @@
 package com.ym.mec.auth.core.provider;
 
+import java.util.Date;
+
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.security.authentication.BadCredentialsException;
 import org.springframework.security.authentication.InternalAuthenticationServiceException;
+import org.springframework.security.authentication.LockedException;
 import org.springframework.security.core.Authentication;
 import org.springframework.security.core.AuthenticationException;
 import org.springframework.security.core.userdetails.UserDetails;
@@ -12,6 +15,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import com.ym.mec.auth.api.dto.SysUserInfo;
 import com.ym.mec.auth.api.entity.LoginEntity;
+import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.config.token.PhoneAuthenticationToken;
 import com.ym.mec.auth.service.SysUserService;
 import com.ym.mec.common.security.SecurityConstants;
@@ -35,7 +39,7 @@ public class PhoneAuthenticationProvider extends AbstractAuthenticationProvider
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	protected UserDetails retrieveUser(String phone, Authentication authentication) throws AuthenticationException {
+	protected UserDetails retrieveUser(String username, Authentication authentication) throws AuthenticationException {
 
 		LoginEntity loginEntity = (LoginEntity) authentication.getCredentials();
 		if (loginEntity == null) {
@@ -43,21 +47,53 @@ public class PhoneAuthenticationProvider extends AbstractAuthenticationProvider
 		}
 
 		String smsCode = loginEntity.getSmsCode();
+		
+		String phone = StringUtils.substringAfter(username, SecurityConstants.PHONE_PRINCIPAL_PREFIX);
 
 		// 验证码验证
-		boolean b = smsCodeService.verifyValidCode(StringUtils.substringAfter(phone, SecurityConstants.PHONE_PRINCIPAL_PREFIX), smsCode);
+		boolean b = smsCodeService.verifyValidCode(phone, smsCode);
 		if (!b) {
 			throw new BadCredentialsException("验证码校验失败");
 		}
 
+		String clientId = loginEntity.getClientId();
+
+		Boolean isRegister = loginEntity.getIsRegister();
+
 		SysUserInfo userInfo = sysUserService.queryUserInfoByPhone(loginEntity.getPhone());
-		if (userInfo == null && StringUtils.isNotEmpty(loginEntity.getIsLessee())) {
-			sysUserService.initUser(loginEntity.getPhone(), loginEntity.getClientId(), loginEntity.getIsRegister(), loginEntity.getIsLessee());
+
+		if (userInfo == null) {
+			if (isRegister == false || StringUtils.equals("SYSTEM", clientId)) {
+				throw new LockedException("用户不存在");
+			}
+			sysUserService.initUser(loginEntity.getPhone(), clientId);
+		} else {
+			if (!userInfo.getSysUser().getUserType().contains(clientId)) {
+				if (isRegister == false || StringUtils.equals("SYSTEM", clientId)) {
+					throw new LockedException("用户不存在");
+				} else {
+					SysUser user = sysUserService.queryByPhone(phone);
+					if(user == null){
+						throw new LockedException("用户不存在");
+					}
+					user.setUserType(user.getUserType()+","+clientId);
+					user.setUpdateTime(new Date());
+					
+					// 添加userType以及附加信息
+					if (StringUtils.equals("STUDENT", clientId)) {
+						user.setOrganId(sysUserService.getLesseeOrganId());
+						sysUserService.saveStudent(user.getId());
+					} else if (StringUtils.equals("TEACHER", clientId)) {
+						sysUserService.saveTeacher(user.getId());
+					}
+					sysUserService.update(user);
+				}
+			}
 		}
 
 		UserDetails loadedUser;
 		try {
-			loadedUser = userDetailsService.loadUserByUsername(phone);
+			loadedUser = userDetailsService.loadUserByUsername(username);
 		} catch (UsernameNotFoundException e) {
 			throw e;
 		} catch (Exception e) {

+ 9 - 9
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/service/SysUserService.java

@@ -4,7 +4,6 @@ import com.ym.mec.auth.api.dto.SysUserInfo;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.common.entity.ImUserModel;
 import com.ym.mec.common.service.BaseService;
-import org.springframework.security.core.Authentication;
 
 public interface SysUserService extends BaseService<Integer, SysUser> {
 
@@ -97,14 +96,7 @@ public interface SysUserService extends BaseService<Integer, SysUser> {
 	 * @param clientId
 	 * @return
 	 */
-	SysUserInfo initUser(String phone,String clientId,String isRegister,String isLessee);
-
-	/**
-	 * 获取老师的分部编号
-	 * @param phone
-	 * @return
-	 */
-	void retrieveUser(String phone, Authentication authentication);
+	SysUserInfo initUser(String phone,String clientId);
 
 	/**
 	 * 刷新token
@@ -117,4 +109,12 @@ public interface SysUserService extends BaseService<Integer, SysUser> {
 	 * @param userId
 	 */
 	void saveStudent(Integer userId);
+	
+	/**
+	 * 保存teacher数据
+	 * @param userId
+	 */
+	void saveTeacher(Integer userId);
+	
+	Integer getLesseeOrganId();
 }

+ 45 - 67
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/service/impl/SysUserServiceImpl.java

@@ -1,7 +1,15 @@
 package com.ym.mec.auth.service.impl;
 
+import java.util.Date;
+import java.util.List;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
 import com.ym.mec.auth.api.dto.SysUserInfo;
-import com.ym.mec.auth.api.entity.LoginEntity;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.enums.YesOrNoEnum;
 import com.ym.mec.auth.dal.dao.SysUserDao;
@@ -16,18 +24,6 @@ import com.ym.mec.common.service.IdGeneratorService;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.im.ImFeignService;
 import com.ym.mec.im.WebFeignService;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.security.authentication.BadCredentialsException;
-import org.springframework.security.authentication.LockedException;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.userdetails.UsernameNotFoundException;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.Date;
-import java.util.List;
 
 @Service
 public class SysUserServiceImpl extends BaseServiceImpl<Integer, SysUser> implements SysUserService {
@@ -49,8 +45,6 @@ public class SysUserServiceImpl extends BaseServiceImpl<Integer, SysUser> implem
 	@Autowired
 	private IdGeneratorService smsCodeService;
 
-	@Value("${message.autoRegister}")
-	private boolean autoRegister;
 	@Value("${auth.sysconfig.tenantId}")
 	private Integer lesseeOrganId;
 
@@ -155,59 +149,33 @@ public class SysUserServiceImpl extends BaseServiceImpl<Integer, SysUser> implem
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public SysUserInfo initUser(String phone, String clientId,String isRegister,String isLessee) {
-		if("register".equals(isRegister)){
-			throw new UsernameNotFoundException("404.9");
-		}
-		if(StringUtils.isNotEmpty(isLessee) || autoRegister){
-			if(StringUtils.isNotEmpty(isLessee) && StringUtils.equalsIgnoreCase(clientId,"TEACHER")){
-				SysUser sysUser = new SysUser();
-				sysUser.setPhone(phone);
-				sysUser.setUserType("TEACHER");
-				sysUserDao.insert(sysUser);
-				//添加用户现金账户
-				imFeignService.register(new ImUserModel(sysUser.getId().toString(),phone,null));
-				userFeignService.createCashAccount(sysUser.getId());
-				//sysTenantAccount
-				sysUserDao.insertSysTenantAccount(sysUser.getId());
-				//创建teacher表
-				sysUserDao.insertTeacher(sysUser.getId(),lesseeOrganId);
-				return queryUserInfoByPhone(phone);
-			}else if(StringUtils.isNotEmpty(isLessee) && StringUtils.equalsIgnoreCase(clientId,"STUDENT")){
-				SysUser sysUser = new SysUser();
-				sysUser.setPhone(phone);
-				sysUser.setUserType("STUDENT");
-				sysUser.setOrganId(lesseeOrganId);
-				sysUserDao.insert(sysUser);
-				sysUserService.saveStudent(sysUser.getId());
-				//添加用户现金账户
-				imFeignService.register(new ImUserModel(sysUser.getId().toString(),phone,null));
-				userFeignService.createCashAccount(sysUser.getId());
-				return queryUserInfoByPhone(phone);
-			}
+	public SysUserInfo initUser(String phone, String clientId) {
+		if(StringUtils.equalsIgnoreCase(clientId,"TEACHER")){
+			SysUser sysUser = new SysUser();
+			sysUser.setPhone(phone);
+			sysUser.setUserType("TEACHER");
+			sysUserDao.insert(sysUser);
+			//添加用户现金账户
+			imFeignService.register(new ImUserModel(sysUser.getId().toString(),phone,null));
+			userFeignService.createCashAccount(sysUser.getId());
+			//sysTenantAccount
+			sysUserDao.insertSysTenantAccount(sysUser.getId());
+			//创建teacher表
+			sysUserDao.insertTeacher(sysUser.getId(),lesseeOrganId);
+			return queryUserInfoByPhone(phone);
+		}else if(StringUtils.equalsIgnoreCase(clientId,"STUDENT")){
+			SysUser sysUser = new SysUser();
+			sysUser.setPhone(phone);
+			sysUser.setUserType("STUDENT");
+			sysUser.setOrganId(lesseeOrganId);
+			sysUserDao.insert(sysUser);
+			sysUserService.saveStudent(sysUser.getId());
+			//添加用户现金账户
+			imFeignService.register(new ImUserModel(sysUser.getId().toString(),phone,null));
+			userFeignService.createCashAccount(sysUser.getId());
+			return queryUserInfoByPhone(phone);
 		}
-		throw new UsernameNotFoundException("404.9");
-	}
-
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public void retrieveUser(String phone, Authentication authentication) {
-		LoginEntity loginEntity = (LoginEntity) authentication.getCredentials();
-		SysUserInfo userInfo = sysUserService.queryUserInfoByPhone(loginEntity.getPhone());
-		if (userInfo == null) {
-			userInfo = sysUserService.initUser(loginEntity.getPhone(),loginEntity.getClientId(),loginEntity.getIsRegister(),loginEntity.getIsLessee());
-		}else if(StringUtils.isNotEmpty(loginEntity.getIsLessee())){
-			throw new LockedException("用户已存在");
-		}
-		if("EDUCATION".equals(loginEntity.getClientId())){
-			loginEntity.setClientId("SYSTEM");
-		}
-		if (!userInfo.getSysUser().getUserType().contains(loginEntity.getClientId())) {
-			throw new LockedException("用户不存在,请联系教务老师");
-		}
-//			 验证码验证
-		boolean b = smsCodeService.verifyValidCode(loginEntity.getPhone(), loginEntity.getSmsCode());
-		if(!b) throw new BadCredentialsException("验证码校验失败");
+		return null;
 	}
 
 	@Override
@@ -221,4 +189,14 @@ public class SysUserServiceImpl extends BaseServiceImpl<Integer, SysUser> implem
 		sysUserDao.saveStudent(userId);
 	}
 
+	@Override
+	public void saveTeacher(Integer userId) {
+		sysUserDao.insertTeacher(userId, lesseeOrganId);
+	}
+
+	@Override
+	public Integer getLesseeOrganId() {
+		return lesseeOrganId;
+	}
+
 }

+ 0 - 0
mec-auth/mec-auth-server/src/main/resources/application.yml → mec-auth/mec-auth-server/src/main/resources/application-template.yml


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

@@ -81,7 +81,7 @@
 		VALUES(#{userId},0,0,1,NOW(),NOW())
     </insert>
     <insert id="saveStudent">
-        INSERT INTO student (user_id_,create_time_,update_time_,service_tag_,operating_tag_) VALUES(#{userId},NOW(),NOW(),1,1)
+        INSERT INTO student (user_id_,create_time_,update_time_,service_tag_,operating_tag_) VALUES(#{userId},NOW(),NOW(),0,0)
     </insert>
 
     <!-- 根据主键查询一条记录 -->

+ 14 - 6
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ChargeTypeSubjectMapperDao.java

@@ -1,11 +1,11 @@
 package com.ym.mec.biz.dal.dao;
 
+import java.util.List;
+
 import com.ym.mec.biz.dal.entity.ChargeTypeSubjectMapper;
 import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
 
-import java.util.List;
-
 public interface ChargeTypeSubjectMapperDao extends BaseDAO<Long, ChargeTypeSubjectMapper> {
 
     /**
@@ -13,10 +13,18 @@ public interface ChargeTypeSubjectMapperDao extends BaseDAO<Long, ChargeTypeSubj
      */
     void deleteByChargeTypeId(Integer chargeTypeId);
 
+    int batchInsert(List<ChargeTypeSubjectMapper> chargeTypeSubjectMapperList);
+
+    int batchUpdate(List<ChargeTypeSubjectMapper> chargeTypeSubjectMapperList);
+
     /**
-     * 批量新增
-     * @param subjectIds
+     * 根据收费类型获取声部的折扣
+     *
      * @param chargeTypeId
+     * @param subjectId
+     * @return
      */
-    void batchAdd(@Param("subjectIds") List<Integer> subjectIds, @Param("chargeTypeId")Integer chargeTypeId);
-}
+    ChargeTypeSubjectMapper getSubjectDiscount(@Param("chargeTypeId") Integer chargeTypeId, @Param("subjectId") Integer subjectId);
+
+    ChargeTypeSubjectMapper getSubjectsDiscount(@Param("chargeTypeId") Integer chargeTypeId, @Param("subjectIds") String subjectIds);
+}

+ 18 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java

@@ -15,6 +15,8 @@ import java.util.List;
 import java.util.Map;
 
 public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStudentMapper> {
+
+    int batchUpdate(@Param("classGroupStudentMappers") List<ClassGroupStudentMapper> classGroupStudentMappers);
     /**
      * 批量插入学生
      *
@@ -184,6 +186,15 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
                                                @Param("groupType") GroupType groupType);
 
     /**
+     * @describe 获取指定班级的所有学员
+     * @author Joburgess
+     * @date 2020.11.04
+     * @param classGroupId:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.ClassGroupStudentMapper>
+     */
+    List<ClassGroupStudentMapper> findAllByClassGroup(@Param("classGroupId") Long classGroupId);
+
+    /**
      * @param classGroupId: 班级编号列表
      * @return java.util.List<com.ym.mec.biz.dal.entity.ClassGroupStudentMapper>
      * @describe 根据班级获取学员
@@ -395,4 +406,11 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
      * @return
      */
     List<StudentEduTeacherDto> getStudentEducationalTeachers(@Param("studentIds") List<Integer> studentIds);
+
+    /**
+     * 是否在指定的班级
+     * @param classGroupIdListStr
+     * @return
+     */
+    Boolean existByClassGroupIds(@Param("classGroupIdListStr") String classGroupIdListStr, @Param("studentId") Integer studentId);
 }

+ 21 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java

@@ -6,6 +6,7 @@ import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
 import com.ym.mec.biz.dal.enums.CourseStatusEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.common.dal.BaseDAO;
+
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
@@ -140,6 +141,18 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
     int deleteMusicGroupCourseSchedulesWithStudent(@Param("courseScheduleIds") List<Long> courseScheduleIds,
                                                    @Param("userId") Integer userId);
 
+    int deleteMusicGroupCourseSchedulesWithStudents(@Param("courseScheduleIds") List<Long> courseScheduleIds,
+                                                   @Param("userIds") List<Integer> userIds);
+
+    /**
+     * @describe 获取班级上未开始的课程
+     * @author Joburgess
+     * @date 2020.11.05
+     * @param classGroupId:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
+     */
+    List<CourseSchedule> getClassGroupNotStartCourse(@Param("classGroupId") Long classGroupId);
+
     /**
      * @param teacherId: 教师编号
      * @param classDate: 上课日期
@@ -1576,6 +1589,14 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
      */
     List<Map<Integer, Integer>> queryHasReatClass(@Param("classGroupIds") Set<String> classGroupIds, @Param("teacherId") String teacherId);
 
+    
+    /**
+     * 查询班级未上的课程类型对应的时长
+     * @param classGroupIdList
+     * @return
+     */
+    List<RemainCourseTypeDurationDto> queryRemainCourseTypeDuration(String classGroupIdList);
+
     /**
      * @describe 获取检测课程冲突需要的数据
      * @author qnc99

+ 73 - 31
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleStudentPaymentDao.java

@@ -116,15 +116,15 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
                                                                               @Param("userId") Integer userId);
 
     /**
-     * @describe 统计团体下为开始课程学生数量
-     * @author Joburgess
-     * @date 2020.09.27
      * @param groupId:
      * @param groupType:
      * @return int
+     * @describe 统计团体下为开始课程学生数量
+     * @author Joburgess
+     * @date 2020.09.27
      */
     int countNotStartCourseStudentNumWithGroup(@Param("groupId") String groupId,
-                                      @Param("groupType") GroupType groupType);
+                                               @Param("groupType") GroupType groupType);
 
     /**
      * @param vipGroupId: 小课编号
@@ -138,13 +138,13 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
                                        @Param("teachMode") String teachMode);
 
     int deleteStudentCourseScheduleByUserId(@Param("courseScheduleId") Long courseScheduleId, @Param("userIdList") List<Integer> userIdList);
-    
+
     /**
      * 根据乐团编号删除记录
      * @param musicGroupId
      * @return
      */
-    int deleteByMusicGroupId(@Param("musicGroupId")String musicGroupId, @Param("groupType")GroupType groupType);
+    int deleteByMusicGroupId(@Param("musicGroupId") String musicGroupId, @Param("groupType") GroupType groupType);
 
     /**
      * 根据乐团编号,和groupTYpe获取学员剩余课程数
@@ -153,15 +153,15 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
      * @param groupType
      * @return
      */
-    List<Map<String, Integer>> findStudentCourseNum(@Param("musicGroupIds") Set<String> musicGroupIds, @Param("userId")Integer userId, @Param("groupType")String groupType);
+    List<Map<String, Integer>> findStudentCourseNum(@Param("musicGroupIds") Set<String> musicGroupIds, @Param("userId") Integer userId, @Param("groupType") String groupType);
 
     /**
-     * @describe 统计指定乐团下学员课程数量
-     * @author Joburgess
-     * @date 2019/12/23
      * @param groupType:
      * @param groupId:
      * @return int
+     * @describe 统计指定乐团下学员课程数量
+     * @author Joburgess
+     * @date 2019/12/23
      */
     int countStudentCourseNumWithGroup(@Param("groupType") GroupType groupType,
                                        @Param("groupId") String groupId);
@@ -187,31 +187,31 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
     List<Map<Integer, Integer>> countCourseStudentNum(@Param("courseIds") List<Long> courseIds);
 
     /**
-     * @describe 检测学生是否存在指定课程的缴费记录
-     * @author Joburgess
-     * @date 2020/1/10
      * @param courseScheduleId:
      * @param userId:
      * @return int
+     * @describe 检测学生是否存在指定课程的缴费记录
+     * @author Joburgess
+     * @date 2020/1/10
      */
     int checkStudentHaveCourse(@Param("courseScheduleId") Long courseScheduleId,
                                @Param("userId") Integer userId);
 
     /**
+     * @param courseScheduleId: 课程编号
+     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment>
      * @describe 查询指定课程的学生缴费记录
      * @author Joburgess
      * @date 2020/1/10
-     * @param courseScheduleId: 课程编号
-     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment>
      */
     List<CourseScheduleStudentPayment> findByCourseSchedule(@Param("courseScheduleId") Long courseScheduleId);
 
     /**
+     * @param groupId:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.VipGroupGiveCourseSortDto>
      * @describe 获取小课需要调整的缴费记录
      * @author Joburgess
      * @date 2020/1/10
-     * @param groupId:
-     * @return java.util.List<com.ym.mec.biz.dal.dto.VipGroupGiveCourseSortDto>
      */
     List<VipGroupGiveCourseSortDto> findVipGroupSortCourseByGroup(@Param("groupId") String groupId);
 
@@ -223,15 +223,15 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
     Integer countStudentNum(Integer courseScheduleId);
 
     /**
-     * @describe 根据团体删除班级
-     * @author Joburgess
-     * @date 2020/2/17
      * @param groupId:
      * @param groupType:
      * @return int
+     * @describe 根据团体删除班级
+     * @author Joburgess
+     * @date 2020/2/17
      */
     int deleteByGroup(@Param("groupId") String groupId,
-                      @Param("groupType")GroupType groupType);
+                      @Param("groupType") GroupType groupType);
 
     /**
      * 获取当前课程的学员列表
@@ -245,7 +245,7 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
      * @param courseScheduleIds
      * @return
      */
-    List<Map<Integer,String>> getStudentIdMap(@Param("courseScheduleIds") List<Long> courseScheduleIds);
+    List<Map<Integer, String>> getStudentIdMap(@Param("courseScheduleIds") List<Long> courseScheduleIds);
 
     /**
      * @describe 获取在指定时间之后不存在网管课的学员编号列表
@@ -254,11 +254,11 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
      * @param monday:
      * @return java.util.List<java.lang.Integer>
      */
-    List<Practice4ExercisesSituationDto> findNoPracticeStudentIdsOnWeek(@Param("monday")String monday,
-                                                                        @Param("sunday")String sunday);
+    List<Practice4ExercisesSituationDto> findNoPracticeStudentIdsOnWeek(@Param("monday") String monday,
+                                                                        @Param("sunday") String sunday);
 
     Integer findNoPracticeStudentTeacherId(@Param("studentId") Integer studentId);
-    
+
     /**
      * 从指定时间开始查询学的线上可数
      * @return
@@ -268,11 +268,11 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
     List<StudentTeacherCourseDto> findAllStudentCourseInfo();
 
     /**
+     * @param courseScheduleIds:
+     * @return java.util.List<java.util.Map < java.lang.Long, java.math.BigDecimal>>
      * @describe 统计每节课的收款
      * @author Joburgess
      * @date 2020.05.09
-     * @param courseScheduleIds:
-     * @return java.util.List<java.util.Map<java.lang.Long,java.math.BigDecimal>>
      */
     List<Map<Long, BigDecimal>> findCoursePayment(@Param("courseScheduleIds") List<Long> courseScheduleIds);
 
@@ -283,7 +283,7 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
      * @return
      */
     int countStudentNotStartCourseNumWithCourseType(@Param("studentId") Integer studentId,
-                                                    @Param("courseScheduleType")CourseSchedule.CourseScheduleType courseScheduleType);
+                                                    @Param("courseScheduleType") CourseSchedule.CourseScheduleType courseScheduleType);
 
     /**
      * 批量操作节拍器状态
@@ -301,6 +301,14 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
     List<Map<Integer, String>> queryMidiByUserIdsAndCourseId(@Param("userIds") Set<String> userIds, @Param("courseScheduleId") String courseScheduleId);
 
     /**
+     * 获取用户的曲目下载信息
+     * @param userIds
+     * @param courseScheduleId
+     * @return
+     */
+    List<Map<Integer, String>> queryExamSongByUserIdsAndCourseId(@Param("userIds") Set<String> userIds, @Param("courseScheduleId") String courseScheduleId);
+
+    /**
      * 获取单个用户的midi
      * @param courseScheduleId
      * @param userId
@@ -309,12 +317,12 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
     String getMidiByCourseIdAndUserId(@Param("courseScheduleId") String courseScheduleId, @Param("userId") String userId);
 
     /**
+     * @param groupType:
+     * @param groupIds:
+     * @return java.util.List<java.util.Map < java.lang.String, java.math.BigDecimal>>
      * @describe 统计课程组下的课程单价
      * @author Joburgess
      * @date 2020.06.11
-     * @param groupType:
-     * @param groupIds:
-     * @return java.util.List<java.util.Map<java.lang.String,java.math.BigDecimal>>
      */
     List<Map<String, BigDecimal>> findGroupCoursesUnitPrice(@Param("groupType") GroupType groupType,
                                                             @Param("groupIds") List<String> groupIds);
@@ -328,6 +336,21 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
     List<RongyunBasicUserDto> queryNoJoinStu(@Param("roomId") String roomId, @Param("courseScheduleId") String courseScheduleId);
 
     /**
+     * @param batchNo:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment>
+     * @describe 根据批次号获取学员课程缴费记录
+     * @author Joburgess
+     * @date 2020.10.30
+     */
+    List<CourseScheduleStudentPayment> findByBatchNo(@Param("batchNo") String batchNo);
+
+
+    /**
+     * 获取学生班级未开始的课程
+     */
+    List<CourseScheduleStudentPayment> getClassGroupNoStartCourse(@Param("classGroupIds") List<Integer> classGroupIds);
+
+    /**
      * @describe 获取指定学员的最后一节课时间
      * @author Joburgess
      * @date 2020/11/17 0017
@@ -337,9 +360,28 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
     List<Map<Integer, Date>> findStudentLastCourseSchedule(@Param("studentIds") List<Integer> StudentIds);
 
     List<CourseScheduleStudentPayment> queryAll(Map<String, Object> params);
+
     int countAll(Map<String, Object> params);
 
     /**
+     * 修改学员曲目下载信息
+     * @author zouxuan
+     * @param roomId
+     */
+    void adjustExamSong(@Param("roomId") Long roomId, @Param("userId") Integer userId, @Param("examSongJson") String examSongJson);
+
+    /**
+     * 获取学员的曲目下载状态
+     * @author zouxuan
+     * @param roomId
+     * @param userId
+     * @return
+     */
+    String getExamSongDownloadStatus(@Param("roomId") Long roomId,
+                                      @Param("userId") String userId);
+
+
+    /**
      * @describe 统计学员通过双十一活动排课的数量
      * @author qnc99
      * @date 2020/11/25 0025

+ 34 - 14
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/GoodsDao.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.dto.GoodsSellDto;
+import com.ym.mec.biz.dal.dto.MusicGroupGoodsAndDiscountDto;
 import com.ym.mec.biz.dal.entity.Goods;
 import com.ym.mec.common.dal.BaseDAO;
 
@@ -10,6 +11,8 @@ import java.util.List;
 
 public interface GoodsDao extends BaseDAO<Integer, Goods> {
 
+    Goods lock(@Param("goodsId") Integer goodsId);
+
     /**
      * 通过科目编号查询商品(教材、辅件)列表
      *
@@ -48,64 +51,65 @@ public interface GoodsDao extends BaseDAO<Integer, Goods> {
     void batchInsert(List<Goods> goodsList);
 
     /**
+     * @param goodsList:
+     * @return void
      * @describe 批量更新商品
      * @author Joburgess
      * @date 2020.09.28
-     * @param goodsList:
-     * @return void
      */
     void batchUpdate(@Param("goodsList") List<Goods> goodsList);
 
     /**
      * 获取商品列表
+     *
      * @param goodsIds
      * @return
      */
     List<Goods> getGoodies(@Param("goodsIds") List<Integer> goodsIds);
 
     /**
+     * @param goodsId:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.Goods>
      * @describe 查询附件商品列表中存在指定商品的商品
      * @author Joburgess
      * @date 2020.10.12
-     * @param goodsId:
-     * @return java.util.List<com.ym.mec.biz.dal.entity.Goods>
      */
     List<Goods> getWithComplementGoodsAndStatus(@Param("goodsId") Integer goodsId,
                                                 @Param("status") Integer status);
 
     /**
+     * @param goodsIds:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.Goods>
      * @describe 锁定指定商品
      * @author Joburgess
      * @date 2020.10.12
-     * @param goodsIds:
-     * @return java.util.List<com.ym.mec.biz.dal.entity.Goods>
      */
     List<Goods> lockGoods(@Param("goodsIds") List<Integer> goodsIds);
 
     /**
+     * @param sn:
+     * @return com.ym.mec.biz.dal.entity.Goods
      * @describe 根据货号查找商品
      * @author Joburgess
      * @date 2020.10.10
-     * @param sn:
-     * @return com.ym.mec.biz.dal.entity.Goods
      */
     Goods findBySn(@Param("sn") String sn);
 
     /**
+     * @param sn:
+     * @return com.ym.mec.biz.dal.entity.Goods
      * @describe 根据货号锁定商品
      * @author Joburgess
      * @date 2020.10.15
-     * @param sn:
-     * @return com.ym.mec.biz.dal.entity.Goods
      */
     Goods lockBySn(@Param("sn") String sn);
 
     /**
+     * @param sns:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.Goods>
      * @describe 根据货号查找商品
      * @author Joburgess
      * @date 2020.09.28
-     * @param sns:
-     * @return java.util.List<com.ym.mec.biz.dal.entity.Goods>
      */
     List<Goods> findBySns(@Param("sns") List<String> sns);
 
@@ -114,13 +118,29 @@ public interface GoodsDao extends BaseDAO<Integer, Goods> {
     String getOuterRepertoryWarnName(@Param("outerRepertoryWarnNum") String outerRepertoryWarnNum);
 
     /**
+     * @param goodsId:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.GoodsSellDto>
      * @describe 获取商品辅件列表
      * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
      * @author zouxuan
      * @date 2020/10/13
      * @time 15:09
-     * @param goodsId:
-     * @return java.util.List<com.ym.mec.biz.dal.dto.GoodsSellDto>
      */
     List<GoodsSellDto> queryGoodsSellDtos(@Param("goodsId") String goodsId);
+
+    /**
+     * 获取乐团的商品
+     * @return
+     */
+    List<MusicGroupGoodsAndDiscountDto> getMusicGroupGoodsAndDiscount(@Param("subjectId") Integer subjectId, @Param("type") String type);
+
+    List<MusicGroupGoodsAndDiscountDto> getMusicGroupGoodsAndDiscountWithSubjects(@Param("subjectIds") String subjectIds, @Param("type") String type);
+
+    /**
+     * 是否存在已上架的商品编号
+     * @param goodsId
+     * @param status
+     * @return
+     */
+    Boolean findByIdAndStatus(@Param("goodsId") String goodsId, @Param("status") int status);
 }

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

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

+ 16 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupOrganizationCourseSettingsDetailDao.java

@@ -0,0 +1,16 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail;
+import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface MusicGroupOrganizationCourseSettingsDetailDao extends BaseDAO<Integer, MusicGroupOrganizationCourseSettingsDetail> {
+
+    int batchInsert(@Param("settingDetails") List<MusicGroupOrganizationCourseSettingsDetail> settingDetails);
+
+    int deleteBySettingId(@Param("settingId") Integer settingId);
+    
+    List<MusicGroupOrganizationCourseSettingsDetail> queryByMusicGroupOrganizationCourseSettingsId(Integer musicGroupOrganizationCourseSettingsId);
+}

+ 68 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderCourseSettingsDao.java

@@ -0,0 +1,68 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
+import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface MusicGroupPaymentCalenderCourseSettingsDao extends BaseDAO<Integer, MusicGroupPaymentCalenderCourseSettings> {
+
+	/**
+	 * @param calenderId:
+	 * @return java.util.List<com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings>
+	 * @describe 获取指定缴费日历的课程价格设置
+	 * @author Joburgess
+	 * @date 2020.10.27
+	 */
+	List<MusicGroupPaymentCalenderCourseSettings> getWithPaymentCalender(@Param("calenderId") Long calenderId);
+
+	/**
+	 * @param calenderId:
+	 * @param courseType:
+	 * @return com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings
+	 * @describe 根据缴费日历和课程类型获取课程价格设置
+	 * @author Joburgess
+	 * @date 2020.11.04
+	 */
+	MusicGroupPaymentCalenderCourseSettings getWithPaymentCalenderAndCourseType(@Param("calenderId") Long calenderId,
+																				@Param("courseType") CourseSchedule.CourseScheduleType courseType);
+
+	int deleteByMusicGroupPaymentCalenderId(Long musicGroupPaymentCalenderId);
+
+	/**
+	 * 获取乐团的缴费课程
+	 *
+	 * @param musicGroupId
+	 * @return
+	 */
+	List<MusicGroupPaymentCalenderCourseSettings> getMusicGroupRegCalenderCourseSettings(@Param("musicGroupId") String musicGroupId);
+
+	/**
+	 * 获取乐团的缴费课程
+	 *
+	 * @param ids
+	 * @return
+	 */
+	List<MusicGroupPaymentCalenderCourseSettings> getCalenderCourseSettings(@Param("ids") List<Integer> ids);
+
+	/**
+	 * 批量新增
+	 *
+	 * @param musicGroupPaymentCalenderCourseSettingsList
+	 * @return
+	 */
+	int batchInsert(List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList);
+
+	/**
+	 * @param calenderId:
+	 * @return java.util.List<com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings>
+	 * @describe 获取收费标准
+	 * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+	 * @author zouxuan
+	 * @date 2020/10/30
+	 * @time 16:04
+	 */
+	List<MusicGroupPaymentCalenderCourseSettings> queryCalenderCourseSettings(Long calenderId);
+}

+ 187 - 38
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDao.java

@@ -1,13 +1,14 @@
 package com.ym.mec.biz.dal.dao;
 
-import java.util.*;
-
 import com.ym.mec.biz.dal.dto.CalenderPushDto;
-import org.apache.ibatis.annotations.Param;
-
+import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType;
 import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
 import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.*;
 
 public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPaymentCalender> {
 
@@ -27,20 +28,21 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
     List<MusicGroupPaymentCalender> findByMusicGroupId(String musicGroupId);
 
     /**
-     * 批量新增乐团缴费周期
+     * 批量修改
      *
-     * @param calender
-     * @param musicGroupId
+     * @param musicGroupPaymentCalenderList
+     * @return
      */
-    void batchAdd(@Param("calender") List<Integer> calender, @Param("musicGroupId") String musicGroupId);
+    int batchUpdate(List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList);
+
 
     /**
-     * 批量修改
+     * 批量插入
      *
      * @param musicGroupPaymentCalenderList
      * @return
      */
-    int batchUpdate(List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList);
+    int batchInsert(List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList);
 
     /**
      * 查询指定状态的记录
@@ -48,7 +50,7 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
      * @param status
      * @return
      */
-    List<MusicGroupPaymentCalender> queryByPaymentStatus(@Param("status") List<PaymentStatusEnum> status);
+    List<MusicGroupPaymentCalender> queryByPaymentStatus(@Param("status") List<PaymentStatusEnum> status, @Param("payUserType") String payUserType);
 
     /**
      * 获取缴费信息锁
@@ -67,26 +69,11 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
      * @return
      */
     int queryIntersectionByPaymentDate(@Param("musicGroupId") String musicGroupId, @Param("startPaymentDate") Date startPaymentDate,
-                                       @Param("deadlinePaymentDate") Date deadlinePaymentDate,@Param("calenderId") Long calenderId);
-
-    /**
-     * 统计预计缴费人数
-     *
-     * @param collect
-     * @return
-     */
-    List<Map<Long, Long>> countExpectNum(@Param("collect") Set<Long> collect);
-
-    /**
-     * 统计预计缴费人数
-     *
-     * @param collect
-     * @return
-     */
-    List<Map<Long, Long>> countActualNum(@Param("collect") Set<Long> collect);
+                                       @Param("deadlinePaymentDate") Date deadlinePaymentDate, @Param("calenderId") Long calenderId);
 
     /**
      * 乐团最后一次交费信息
+     *
      * @param musicGroupId
      * @return
      */
@@ -95,29 +82,30 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
     int queryIntersectionByDate(@Param("musicGroupId") String musicGroupId, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
     /**
+     * @param musicGroupId:
+     * @param payUserType:
+     * @param paymentValidStartDate:
+     * @param paymentValidEndDate:
+     * @return int
      * @describe 根据指定乐团的有效日期查询交集
      * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
      * @author zouxuan
      * @date 2020/9/21
      * @time 10:46
-     * @param musicGroupId:
-     * @param paymentValidStartDate:
-     * @param paymentValidEndDate:
-     * @return int
      */
-    int queryIntersectionByValidDate(@Param("musicGroupId") String musicGroupId,
-                                     @Param("paymentValidStartDate") String paymentValidStartDate,
-                                     @Param("paymentValidEndDate") String paymentValidEndDate,
+    int queryIntersectionByValidDate(@Param("musicGroupId") String musicGroupId, @Param("payUserType") PayUserType payUserType,
+                                     @Param("paymentValidStartDate") Date paymentValidStartDate,
+                                     @Param("paymentValidEndDate") Date paymentValidEndDate,
                                      @Param("calenderId") Long calenderId);
 
     /**
+     * @param configValue:
+     * @return void
      * @describe 获取指定时间后的缴费信息
      * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
      * @author zouxuan
      * @date 2020/9/21
      * @time 17:35
-     * @param configValue:
-     * @return void
      */
     List<Map<Long, Long>> queryCalenderByDay(@Param("configValue") String configValue, @Param("format") String format);
 
@@ -128,4 +116,165 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
     List<CalenderPushDto> getCalenderPushDto(@Param("calenderIds") Collection<Long> calenderIds);
 
     List<CalenderPushDto> getMusicCalenderPushDto(@Param("configValue") String configValue, @Param("format") String format);
-}
+
+    /**
+     * @param musicGroupId:
+     * @return com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender
+     * @describe 获取乐团下未使用的最早的缴费记录
+     * @author Joburgess
+     * @date 2020.10.27
+     */
+    MusicGroupPaymentCalender getMusicGroupUnusedFirstPaymentCalender(@Param("musicGroupId") String musicGroupId,
+                                                                      @Param("studentIds") List<Integer> studentIds);
+
+    /**
+     * @param calenderIds:
+     * @return com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender
+     * @describe 获取指定缴费日历中下未使用的最早的缴费记录
+     * @author Joburgess
+     * @date 2020.10.27
+     */
+    MusicGroupPaymentCalender getUnusedFirstPaymentCalenderWithCalenders(@Param("calenderIds") List<Long> calenderIds);
+
+    /**
+     * @param batchNo: 批次号
+     * @return java.util.List<com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender>
+     * @describe 根据批次号获取缴费日历
+     * @author Joburgess
+     * @date 2020.10.30
+     */
+    List<MusicGroupPaymentCalender> findByBatchNo(@Param("batchNo") String batchNo);
+
+
+    /**
+     * @param params:
+     * @return int
+     * @describe 乐团缴费日历审核列表
+     * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+     * @author zouxuan
+     * @date 2020/10/30
+     * @time 13:47
+     */
+    int countAuditList(Map<String, Object> params);
+
+    /**
+     * @param params:
+     * @return int
+     * @describe 乐团缴费日历审核列表
+     * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+     * @author zouxuan
+     * @date 2020/10/30
+     * @time 13:47
+     */
+    List<MusicGroupPaymentCalenderAuditDto> queryAuditList(Map<String, Object> params);
+
+    /**
+     * 统计预计缴费人数
+     *
+     * @param id
+     * @return
+     */
+    List<Map<Long, Long>> countExpectNum(@Param("id") Long id);
+
+    /**
+     * 统计预计缴费人数
+     *
+     * @param id
+     * @return
+     */
+    List<Map<Long, Long>> countActualNum(@Param("id") Long id);
+
+    /**
+     * @param calenderId:
+     * @return com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto
+     * @describe 获取审核详情
+     * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+     * @author zouxuan
+     * @date 2020/11/2
+     * @time 17:46
+     */
+    MusicGroupPaymentCalenderAuditDto getAuditDetail(@Param("calenderId") Long calenderId);
+
+    /**
+     * 获取乐团的报名缴费日历
+     *
+     * @param musicGroupId
+     * @return
+     */
+    MusicGroupPaymentCalender findByMusicGroupRegCalender(@Param("musicGroupId") String musicGroupId);
+
+    /**
+     * @param calenderId:
+     * @return java.lang.String
+     * @describe 获取收费标准名称
+     * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+     * @author zouxuan
+     * @date 2020/11/4
+     * @time 10:11
+     */
+    String getCalenderSettingsName(Long calenderId);
+
+    /**
+     * @param musicGroupId:
+     * @param calenderId:
+     * @return int
+     * @describe 统计乐团还在审核中或者审核被拒的缴费
+     * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+     * @author zouxuan
+     * @date 2020/11/4
+     * @time 10:37
+     */
+    int countAuditReject(@Param("musicGroupId") String musicGroupId, @Param("calenderId") Long calenderId);
+
+    /**
+     * 获取乐团报名的缴费日历
+     * @param musicGroupId
+     * @return
+     */
+    MusicGroupPaymentCalender getMusicGroupRegCalender(@Param("musicGroupId") String musicGroupId);
+
+    /**
+     * @describe 获取学员在乐团的缴费状态
+     * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+     * @author zouxuan
+     * @date 2020/11/4
+     * @time 15:43
+     * @param userId:
+     * @param musicGroupId:
+     * @return java.util.Map<java.lang.String,java.lang.String>
+     */
+    List<Map<String, String>> queryUserPaymentStatus(@Param("userId") Integer userId, @Param("musicGroupId") String musicGroupId);
+
+    /**
+     * @describe 获取学员再乐团的缴费状态
+     * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+     * @author zouxuan
+     * @date 2020/11/11
+     * @time 14:03
+     * @param studentId:
+     * @param musicGroupId:
+     * @return java.util.List<java.util.Map<java.lang.Integer,java.lang.String>>
+     */
+    List<Map<Integer,String>> queryUserCoursePaymentStatus(@Param("studentId") Set studentId, @Param("musicGroupId") String musicGroupId);
+
+    /**
+     * 缴费预计人数减一
+     * @author
+     * @param userId
+     */
+    void cutCalenderExpectNum(@Param("userId") Integer userId, @Param("musicGroupId") String musicGroupId);
+
+    /**
+     * 获取需要删除的缴费项
+     * @author zouxuan
+     * @param userId
+     * @param musicGroupId
+     * @return
+     */
+    List<Long> findStudentNoPaymentCalender(@Param("userId") Integer userId, @Param("musicGroupId") String musicGroupId);
+
+    /**
+     * @param calenderIds
+     */
+    void delByIds(@Param("calenderIds") List<Long> calenderIds);
+}

+ 86 - 15
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDetailDao.java

@@ -1,15 +1,16 @@
 package com.ym.mec.biz.dal.dao;
 
-import com.ym.mec.biz.dal.dto.SimpleUserDto;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
-import com.ym.mec.common.dal.BaseDAO;
-import org.apache.ibatis.annotations.Param;
-
 import java.math.BigDecimal;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.ibatis.annotations.Param;
+
+import com.ym.mec.biz.dal.dto.SimpleUserDto;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
+import com.ym.mec.common.dal.BaseDAO;
+
 public interface MusicGroupPaymentCalenderDetailDao extends BaseDAO<Long, MusicGroupPaymentCalenderDetail> {
 
 	/**
@@ -34,10 +35,10 @@ public interface MusicGroupPaymentCalenderDetailDao extends BaseDAO<Long, MusicG
 
 	/**
 	 * 根据指定的日历编号查询
-	 * @param musicGroupPaymentCalenderId
+	 * @param calenderId
 	 * @return
 	 */
-	List<MusicGroupPaymentCalenderDetail> queryByCalenderId(Long musicGroupPaymentCalenderId);
+	List<MusicGroupPaymentCalenderDetail> queryByCalenderId(@Param("calenderId") Long calenderId, @Param("paymentStatus") String paymentStatus);
 
 	/**
 	 * 根据声部获取乐团下完成缴费的学员
@@ -49,13 +50,6 @@ public interface MusicGroupPaymentCalenderDetailDao extends BaseDAO<Long, MusicG
 														 @Param("subjectId") Integer subjectId);
 
 	/**
-	 * 统计实际收款金额
-	 * @param id
-	 * @return
-	 */
-	BigDecimal sumActualAmount(@Param("id") Long id);
-
-	/**
 	 * 获取学生最后一期续费记录
 	 * @param musicGroupId
 	 * @param userId
@@ -129,10 +123,87 @@ public interface MusicGroupPaymentCalenderDetailDao extends BaseDAO<Long, MusicG
 	Set<Integer> queryStudentIds(Long calenderId);
 
 	/**
+	 * 获取未缴费的员列表
+	 * @param calenderId
+	 * @return
+	 */
+	Set<Integer> queryNoPaymentStudentIds(Long calenderId);
+
+	/**
 	 * 查询进行中的缴费
 	 * @param musicGroupId
 	 * @param userId
 	 * @return
 	 */
     Integer countOpenPayment(@Param("musicGroupId") String musicGroupId, @Param("userId") Integer userId);
-}
+
+	/**
+	 * @describe 获取指定缴费日历的详情
+	 * @author Joburgess
+	 * @date 2020.10.27
+	 * @param calenderId:
+	 * @return java.util.List<com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail>
+	 */
+	List<MusicGroupPaymentCalenderDetail> getCalenderDetailWithCalender(@Param("calenderId") Long calenderId);
+
+	/**
+	 * @describe 获取指定缴费日历的详情
+	 * @author Joburgess
+	 * @date 2020.10.30
+	 * @param calenderIds:
+	 * @return java.util.List<com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail>
+	 */
+	List<MusicGroupPaymentCalenderDetail> getWithCalenderIds(@Param("calenderIds") List<Long> calenderIds);
+
+    /**
+     * @describe 获取乐团下未使用的缴费日历记录
+     * @author Joburgess
+     * @date 2020.10.27
+     * @param musicGroupId:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail>
+     */
+    List<MusicGroupPaymentCalenderDetail> getUnusedPaymentCalenderWithMusicGroup(@Param("musicGroupId") String musicGroupId);
+
+    /**
+     * @describe 获取缴费日历学员列表
+     * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+     * @author zouxuan
+     * @date 2020/10/30
+     * @time 16:39
+     * @param calenderId:
+     * @param musicGroupId:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>
+     */
+	List<SimpleUserDto> querySimpleUserDto(@Param("calenderId") Long calenderId, @Param("musicGroupId") String musicGroupId);
+
+	/**
+	 * 统计实际收款金额
+	 * @param id
+	 * @return
+	 */
+	BigDecimal sumActualAmount(@Param("id") Long id);
+
+	/**
+	 * @describe 获取学员缴费日历详情
+	 * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+	 * @author zouxuan
+	 * @date 2020/11/3
+	 * @time 14:47
+	 * @param calenderId:
+	 * @param userId:
+	 * @return com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail
+	 */
+	MusicGroupPaymentCalenderDetail findByCalenderIdAndUserId(@Param("calenderId") Long calenderId, @Param("userId") Integer userId);
+
+	/**
+	 * @describe 根据订单编号获取缴费详情
+	 * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+	 * @author zouxuan
+	 * @date 2020/11/3
+	 * @time 15:41
+	 * @param orderId:
+	 * @return com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail
+	 */
+	MusicGroupPaymentCalenderDetail findByOrderId(@Param("orderId") Long orderId);
+
+}

+ 45 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentStudentCourseDetailDao.java

@@ -0,0 +1,45 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.CourseSchedule;
+
+import java.util.List;
+
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
+import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+public interface MusicGroupPaymentStudentCourseDetailDao extends BaseDAO<Long, MusicGroupPaymentStudentCourseDetail> {
+
+    /**
+     * @param studentId:
+     * @param courseType:
+     * @param courseMinutes:
+     * @return com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail
+     * @describe 获取指定学员,指定课程,指定课程时长下的可用缴费记录
+     * @author Joburgess
+     * @date 2020.11.04
+     */
+    MusicGroupPaymentStudentCourseDetail getUnUseWithStudentAndCourseTypeAndCourseMinutes(@Param("musicGroupId") String musicGroupId,
+                                                                                          @Param("studentId") Integer studentId,
+                                                                                          @Param("courseType") CourseSchedule.CourseScheduleType courseType,
+                                                                                          @Param("courseMinutes") Integer courseMinutes);
+
+    /**
+     * @param studentIds:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail>
+     * @describe
+     * @author Joburgess
+     * @date 2020.11.04
+     */
+    List<MusicGroupPaymentStudentCourseDetail> getUnUseWithStudents(@Param("musicGroupId") String musicGroupId, @Param("studentIds") List<Integer> studentIds);
+
+    int batchInsert(List<MusicGroupPaymentStudentCourseDetail> musicGroupPaymentStudentCourseDetailList);
+
+    /**
+     * 删除用户购买乐团课程记录
+     * @param userId
+     * @param musicGroupId
+     * @return
+     */
+    int deleteByUserIdAndMusicGroupId(@Param("userId") Integer userId, @Param("musicGroupId") String musicGroupId);
+}

+ 29 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/OrganizationCourseUnitPriceSettingsDao.java

@@ -0,0 +1,29 @@
+package com.ym.mec.biz.dal.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+
+import com.ym.mec.biz.dal.entity.OrganizationCourseUnitPriceSettings;
+import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
+import com.ym.mec.common.dal.BaseDAO;
+
+public interface OrganizationCourseUnitPriceSettingsDao extends BaseDAO<Integer, OrganizationCourseUnitPriceSettings> {
+
+	/**
+	 * 根据分部编号以及课程类型查询对象
+	 * @param organId 分部编号
+	 * @param courseType 课程类型
+	 * @param chargeTypeId 收费类型编号
+	 * @return
+	 */
+	OrganizationCourseUnitPriceSettings queryByOrganIdAndCourseTypeAndChargeType(@Param("organId") Integer organId,
+			@Param("courseScheduleType") CourseScheduleType courseType, @Param("chargeTypeId") Integer chargeTypeId);
+
+	/**
+	 * 批量新增
+	 * @param organizationCourseUnitPriceSettingsList
+	 * @return
+	 */
+	int batchInsert(List<OrganizationCourseUnitPriceSettings> organizationCourseUnitPriceSettingsList);
+}

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

@@ -14,6 +14,8 @@ import java.util.List;
 import java.util.Map;
 
 public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Student> {
+	
+	Student getLocked(Integer userId);
 
     int lockUser(@Param("userId") Integer userId);
 

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

@@ -240,7 +240,10 @@ public interface StudentManageDao {
      * @param musicGroupPaymentCalenderId
      * @return
      */
-    List<BasicUserDto> queryCanAddStudent(@Param("musicGroupId") String musicGroupId, @Param("musicGroupPaymentCalenderId") Long musicGroupPaymentCalenderId);
+    List<BasicUserDto> queryCanAddStudent(@Param("musicGroupId") String musicGroupId,
+                                          @Param("musicGroupPaymentCalenderId") Long musicGroupPaymentCalenderId,
+                                          @Param("search") String search,
+                                          @Param("subjectId") Integer subjectId);
 
     /**
      * 学员是否有课

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

@@ -4,6 +4,7 @@ import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.Goods;
 import com.ym.mec.biz.dal.entity.Organization;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
+import com.ym.mec.biz.dal.entity.StudentPaymentRouteOrder;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;

+ 9 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDetailDao.java

@@ -3,6 +3,7 @@ package com.ym.mec.biz.dal.dao;
 import com.ym.mec.biz.dal.dto.MusicalListDetailDto;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
+import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
 import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
 
@@ -67,10 +68,10 @@ public interface StudentPaymentOrderDetailDao extends BaseDAO<Long, StudentPayme
      * 获取对应商品类型总价
      *
      * @param paymentOrderNo
-     * @param type
+     * @param types
      * @return
      */
-    List<Map<Long, BigDecimal>> queryGoodsPrice(@Param("paymentOrderNo") List<Long> paymentOrderNo, @Param("type") String type);
+    List<Map<Long, BigDecimal>> queryGoodsPrice(@Param("paymentOrderNo") List<Long> paymentOrderNo, @Param("types") String types);
 
     /**
      * 获取订单商品
@@ -118,4 +119,9 @@ public interface StudentPaymentOrderDetailDao extends BaseDAO<Long, StudentPayme
      * @return
      */
     List<StudentPaymentOrderDetail> getOrderGoodies(@Param("orderIds") List<Long> orderIds);
-}
+
+    List<StudentPaymentOrderDetail> getWithIds(@Param("paymentOrderIds") List<Long> paymentOrderIds);
+
+
+    List<StudentPaymentOrderDetail> getOrderDetailByType(@Param("orderId") Long orderId, @Param("orderDetailTypes") List<OrderDetailTypeEnum> orderDetailTypes);
+}

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentRouteOrderDao.java

@@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
 import com.ym.mec.biz.dal.entity.StudentPaymentRouteOrder;
 import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
 import com.ym.mec.common.dal.BaseDAO;
+
 import org.apache.ibatis.annotations.Param;
 
 import java.math.BigDecimal;
@@ -59,4 +60,15 @@ public interface StudentPaymentRouteOrderDao extends BaseDAO<Long, StudentPaymen
      * @return
      */
     int insertOrder(StudentPaymentOrder order);
+    
+    int queryAuditCount(Map<String, Object> params);
+    
+    List<StudentPaymentRouteOrder> queryAuditPage(Map<String, Object> params);
+
+    /**
+     * 是否有重复到订单号
+     * @param transNos
+     * @return
+     */
+    List<String> countByTransNo(@Param("transNos") List<Object> transNos);
 }

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

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

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

@@ -75,7 +75,6 @@ public interface TeacherDao extends BaseDAO<Integer, Teacher> {
      */
     String queryNameById(@Param("userId") Integer userId);
 
-
     /**
      * @param userIds:
      * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>
@@ -469,6 +468,13 @@ public interface TeacherDao extends BaseDAO<Integer, Teacher> {
     List<TeacherDefaultSalaryDto> queryTeacherDefaultSalary(@Param("organIdList") String organIdList);
 
     BasicUserDto findUserByPhone(String phone);
+    /**
+     * 是否存在该userId
+     * @Author zouxuan
+     * @param userId
+     * @return
+     */
+    Boolean existUser(@Param("userId") Object userId);
 
     /**
      * 获取流动分部老师

+ 13 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseTimeDto.java

@@ -1,9 +1,14 @@
 package com.ym.mec.biz.dal.dto;
 
+import com.ym.mec.biz.dal.entity.CourseSchedule;
 import io.swagger.annotations.ApiModelProperty;
 
 public class CourseTimeDto {
 
+
+    @ApiModelProperty(value = "课程类型", required = true)
+    private CourseSchedule.CourseScheduleType courseType;
+
     @ApiModelProperty(value = "排课星期几")
     private Integer dayOfWeek;
 
@@ -13,6 +18,14 @@ public class CourseTimeDto {
     @ApiModelProperty(value = "上课结束时间")
     private String endClassTime;
 
+    public CourseSchedule.CourseScheduleType getCourseType() {
+        return courseType;
+    }
+
+    public void setCourseType(CourseSchedule.CourseScheduleType courseType) {
+        this.courseType = courseType;
+    }
+
     public Integer getDayOfWeek() {
         return dayOfWeek;
     }

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

@@ -80,6 +80,8 @@ public class MusicGroupCourseScheduleDto {
     private String remark;
 
     private YesOrNoEnum isCallNames;
+    
+    private Integer schoolId;
 
     public YesOrNoEnum getIsCallNames() {
         return isCallNames;
@@ -273,4 +275,12 @@ public class MusicGroupCourseScheduleDto {
 		this.courseScheduleName = courseScheduleName;
 	}
 
+	public Integer getSchoolId() {
+		return schoolId;
+	}
+
+	public void setSchoolId(Integer schoolId) {
+		this.schoolId = schoolId;
+	}
+
 }

+ 31 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupGoodsAndDiscountDto.java

@@ -0,0 +1,31 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.entity.Goods;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+
+public class MusicGroupGoodsAndDiscountDto extends Goods {
+
+    @ApiModelProperty(value = "折扣", required = true)
+    private BigDecimal discountRate = BigDecimal.ONE;
+
+    @ApiModelProperty(value = "折扣金额", required = true)
+    private BigDecimal musicGroupDiscountPrice = BigDecimal.ZERO;
+
+    public BigDecimal getDiscountRate() {
+        return discountRate;
+    }
+
+    public void setDiscountRate(BigDecimal discountRate) {
+        this.discountRate = discountRate;
+    }
+
+    public BigDecimal getMusicGroupDiscountPrice() {
+        return musicGroupDiscountPrice;
+    }
+
+    public void setMusicGroupDiscountPrice(BigDecimal musicGroupDiscountPrice) {
+        this.musicGroupDiscountPrice = musicGroupDiscountPrice;
+    }
+}

+ 26 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentCalenderAddStudentDto.java

@@ -0,0 +1,26 @@
+package com.ym.mec.biz.dal.dto;
+
+import java.util.List;
+
+public class MusicGroupPaymentCalenderAddStudentDto {
+
+	private Long musicGroupPaymentCalenderId;
+
+	private List<Integer> userIdList;
+
+	public Long getMusicGroupPaymentCalenderId() {
+		return musicGroupPaymentCalenderId;
+	}
+
+	public void setMusicGroupPaymentCalenderId(Long musicGroupPaymentCalenderId) {
+		this.musicGroupPaymentCalenderId = musicGroupPaymentCalenderId;
+	}
+
+	public List<Integer> getUserIdList() {
+		return userIdList;
+	}
+
+	public void setUserIdList(List<Integer> userIdList) {
+		this.userIdList = userIdList;
+	}
+}

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

@@ -0,0 +1,52 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+public class MusicGroupPaymentCalenderAuditDetailDto {
+    @ApiModelProperty(value = "缴费项基本信息",required = false)
+    private MusicGroupPaymentCalenderAuditDto auditDto;
+
+    @ApiModelProperty(value = "学员数量",required = false)
+    private Integer studentNum;
+
+    @ApiModelProperty(value = "学员名单",required = false)
+    private List<SimpleUserDto> simpleUserDtos;
+
+    @ApiModelProperty(value = "收费标准列表",required = false)
+    private List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings;
+
+    public MusicGroupPaymentCalenderAuditDto getAuditDto() {
+        return auditDto;
+    }
+
+    public void setAuditDto(MusicGroupPaymentCalenderAuditDto auditDto) {
+        this.auditDto = auditDto;
+    }
+
+    public Integer getStudentNum() {
+        return studentNum;
+    }
+
+    public void setStudentNum(Integer studentNum) {
+        this.studentNum = studentNum;
+    }
+
+    public List<SimpleUserDto> getSimpleUserDto() {
+        return simpleUserDtos;
+    }
+
+    public void setBasicUserDtos(List<SimpleUserDto> simpleUserDtos) {
+        this.simpleUserDtos = simpleUserDtos;
+    }
+
+    public List<MusicGroupPaymentCalenderCourseSettings> getMusicGroupPaymentCalenderCourseSettings() {
+        return musicGroupPaymentCalenderCourseSettings;
+    }
+
+    public void setMusicGroupPaymentCalenderCourseSettings(List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings) {
+        this.musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettings;
+    }
+}

+ 280 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupPaymentCalenderAuditDto.java

@@ -0,0 +1,280 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class MusicGroupPaymentCalenderAuditDto {
+    @ApiModelProperty(value = "缴费项目编号",required = false)
+    private Long musicGroupPaymentCalenderId;
+
+    @ApiModelProperty(value = "分部编号",required = false)
+    private Integer organId;
+
+    @ApiModelProperty(value = "分部名称",required = false)
+    private String organName;
+
+    @ApiModelProperty(value = "乐团名称",required = false)
+    private String musicGroupName;
+
+    @ApiModelProperty(value = "乐团编号",required = false)
+    private String musicGroupId;
+
+    @ApiModelProperty(value = "创建时间",required = false)
+    private Date createTime;
+
+    @ApiModelProperty(value = "缴费类型", required = false)
+    private MusicGroupPaymentCalender.PaymentType paymentType;
+
+    @ApiModelProperty(value = "订单类型,学校/个人", required = false)
+    private MusicGroupPaymentCalender.PayUserType payUserType;
+
+    @ApiModelProperty(value = "加课总时长",required = false)
+    private Integer addCourseTotalTime;
+
+    @ApiModelProperty(value = "原价",required = false)
+    private BigDecimal courseOriginalPrice;
+
+    private BigDecimal paymentAmount;
+
+    @ApiModelProperty(value = "申请价格",required = false)
+    private BigDecimal courseCurrentPrice;
+
+    @ApiModelProperty(value = "备注",required = false)
+    private String memo;
+
+    @ApiModelProperty(value = "审核意见",required = false)
+    private String auditMemo;
+
+    @ApiModelProperty(value = "创建人编号",required = false)
+    private Integer operator;
+
+    @ApiModelProperty(value = "创建人名称",required = false)
+    private String operatorName;
+
+    @ApiModelProperty(value = "审核状态",required = false)
+    private MusicGroupPaymentCalender.PaymentCalenderStatusEnum auditStatus;
+
+    @ApiModelProperty(value = "收费标准名称",required = false)
+    private String calenderSettingsName;
+
+    @ApiModelProperty(value = "缴费方式",required = false)
+    private Integer paymentPattern;
+
+    @ApiModelProperty(value = "缴费有效期开始时间",required = false)
+    private String paymentValidStartDate;
+
+    @ApiModelProperty(value = "缴费有效期结束时间",required = false)
+    private String paymentValidEndDate;
+
+    @ApiModelProperty(value = "开始缴费日期",required = false)
+    private String startPaymentDate;
+
+    @ApiModelProperty(value = "缴费截止日期",required = false)
+    private String deadlinePaymentDate;
+
+    @ApiModelProperty(value = "是否赠送网管课",required = false)
+    private Boolean isGiveMusicNetwork;
+
+    public Boolean getIsGiveMusicNetwork() {
+        return isGiveMusicNetwork;
+    }
+
+    public void setIsGiveMusicNetwork(Boolean giveMusicNetwork) {
+        isGiveMusicNetwork = giveMusicNetwork;
+    }
+
+    public Boolean getGiveMusicNetwork() {
+        return isGiveMusicNetwork;
+    }
+
+    public void setGiveMusicNetwork(Boolean giveMusicNetwork) {
+        isGiveMusicNetwork = giveMusicNetwork;
+    }
+
+    public BigDecimal getPaymentAmount() {
+        return paymentAmount;
+    }
+
+    public void setPaymentAmount(BigDecimal paymentAmount) {
+        this.paymentAmount = paymentAmount;
+    }
+
+    public String getAuditMemo() {
+        return auditMemo;
+    }
+
+    public void setAuditMemo(String auditMemo) {
+        this.auditMemo = auditMemo;
+    }
+
+    public String getCalenderSettingsName() {
+        return calenderSettingsName;
+    }
+
+    public void setCalenderSettingsName(String calenderSettingsName) {
+        this.calenderSettingsName = calenderSettingsName;
+    }
+
+    public Integer getPaymentPattern() {
+        return paymentPattern;
+    }
+
+    public void setPaymentPattern(Integer paymentPattern) {
+        this.paymentPattern = paymentPattern;
+    }
+
+    public String getPaymentValidStartDate() {
+        return paymentValidStartDate;
+    }
+
+    public void setPaymentValidStartDate(String paymentValidStartDate) {
+        this.paymentValidStartDate = paymentValidStartDate;
+    }
+
+    public String getPaymentValidEndDate() {
+        return paymentValidEndDate;
+    }
+
+    public void setPaymentValidEndDate(String paymentValidEndDate) {
+        this.paymentValidEndDate = paymentValidEndDate;
+    }
+
+    public String getStartPaymentDate() {
+        return startPaymentDate;
+    }
+
+    public void setStartPaymentDate(String startPaymentDate) {
+        this.startPaymentDate = startPaymentDate;
+    }
+
+    public String getDeadlinePaymentDate() {
+        return deadlinePaymentDate;
+    }
+
+    public void setDeadlinePaymentDate(String deadlinePaymentDate) {
+        this.deadlinePaymentDate = deadlinePaymentDate;
+    }
+
+    public Long getMusicGroupPaymentCalenderId() {
+        return musicGroupPaymentCalenderId;
+    }
+
+    public void setMusicGroupPaymentCalenderId(Long musicGroupPaymentCalenderId) {
+        this.musicGroupPaymentCalenderId = musicGroupPaymentCalenderId;
+    }
+
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
+    public String getMusicGroupName() {
+        return musicGroupName;
+    }
+
+    public void setMusicGroupName(String musicGroupName) {
+        this.musicGroupName = musicGroupName;
+    }
+
+    public String getMusicGroupId() {
+        return musicGroupId;
+    }
+
+    public void setMusicGroupId(String musicGroupId) {
+        this.musicGroupId = musicGroupId;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public MusicGroupPaymentCalender.PaymentType getPaymentType() {
+        return paymentType;
+    }
+
+    public void setPaymentType(MusicGroupPaymentCalender.PaymentType paymentType) {
+        this.paymentType = paymentType;
+    }
+
+    public MusicGroupPaymentCalender.PayUserType getPayUserType() {
+        return payUserType;
+    }
+
+    public void setPayUserType(MusicGroupPaymentCalender.PayUserType payUserType) {
+        this.payUserType = payUserType;
+    }
+
+    public Integer getAddCourseTotalTime() {
+        return addCourseTotalTime;
+    }
+
+    public void setAddCourseTotalTime(Integer addCourseTotalTime) {
+        this.addCourseTotalTime = addCourseTotalTime;
+    }
+
+    public BigDecimal getCourseOriginalPrice() {
+        return courseOriginalPrice;
+    }
+
+    public void setCourseOriginalPrice(BigDecimal courseOriginalPrice) {
+        this.courseOriginalPrice = courseOriginalPrice;
+    }
+
+    public BigDecimal getCourseCurrentPrice() {
+        return courseCurrentPrice;
+    }
+
+    public void setCourseCurrentPrice(BigDecimal courseCurrentPrice) {
+        this.courseCurrentPrice = courseCurrentPrice;
+    }
+
+    public String getMemo() {
+        return memo;
+    }
+
+    public void setMemo(String memo) {
+        this.memo = memo;
+    }
+
+    public Integer getOperator() {
+        return operator;
+    }
+
+    public void setOperator(Integer operator) {
+        this.operator = operator;
+    }
+
+    public String getOperatorName() {
+        return operatorName;
+    }
+
+    public void setOperatorName(String operatorName) {
+        this.operatorName = operatorName;
+    }
+
+    public MusicGroupPaymentCalender.PaymentCalenderStatusEnum getAuditStatus() {
+        return auditStatus;
+    }
+
+    public void setAuditStatus(MusicGroupPaymentCalender.PaymentCalenderStatusEnum auditStatus) {
+        this.auditStatus = auditStatus;
+    }
+}

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

@@ -1,8 +1,7 @@
 package com.ym.mec.biz.dal.dto;
 
-import com.ym.mec.biz.dal.entity.Goods;
-import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
-import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
+import com.ym.mec.biz.dal.entity.*;
+import io.swagger.annotations.ApiModelProperty;
 
 import java.util.List;
 import java.util.Map;
@@ -27,6 +26,10 @@ public class MusicGroupSubjectGoodsAndInfoDto {
     //其他商品(教材、琴谱)
     private List<Goods> otherGoods;
 
+    @ApiModelProperty(value = "乐团报名缴费日历",required = false)
+    private MusicGroupPaymentCalender musicGroupPaymentCalender;
+
+
     public Map getCourseScheduleInfo() {
         return CourseScheduleInfo;
     }
@@ -66,4 +69,12 @@ public class MusicGroupSubjectGoodsAndInfoDto {
     public void setStudentGoods(List<Goods> studentGoods) {
         this.studentGoods = studentGoods;
     }
+
+    public MusicGroupPaymentCalender getMusicGroupPaymentCalender() {
+        return musicGroupPaymentCalender;
+    }
+
+    public void setMusicGroupPaymentCalender(MusicGroupPaymentCalender musicGroupPaymentCalender) {
+        this.musicGroupPaymentCalender = musicGroupPaymentCalender;
+    }
 }

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

@@ -29,6 +29,8 @@ public class RegisterPayDto {
     @ApiModelProperty(value = "可选课程的key",required = false)
     private List<String> courseKeys;
 
+    @ApiModelProperty(value = "新的乐团课程形态",required = false)
+    private List<Integer> newCourse;
 
     public Integer getRegisterId() {
         return registerId;
@@ -93,4 +95,12 @@ public class RegisterPayDto {
     public void setCourseKeys(List<String> courseKeys) {
         this.courseKeys = courseKeys;
     }
+
+    public List<Integer> getNewCourse() {
+        return newCourse;
+    }
+
+    public void setNewCourse(List<Integer> newCourse) {
+        this.newCourse = newCourse;
+    }
 }

+ 26 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/RemainCourseTypeDurationDto.java

@@ -0,0 +1,26 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
+
+public class RemainCourseTypeDurationDto {
+
+	private CourseScheduleType courseType;
+	
+	private Integer remainMinutes;
+
+	public CourseScheduleType getCourseType() {
+		return courseType;
+	}
+
+	public void setCourseType(CourseScheduleType courseType) {
+		this.courseType = courseType;
+	}
+
+	public Integer getRemainMinutes() {
+		return remainMinutes;
+	}
+
+	public void setRemainMinutes(Integer remainMinutes) {
+		this.remainMinutes = remainMinutes;
+	}
+}

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/SimpleUserDto.java

@@ -1,5 +1,7 @@
 package com.ym.mec.biz.dal.dto;
 
+import java.math.BigDecimal;
+
 /**
  * @Author Joburgess
  * @Date 2020/2/9
@@ -20,6 +22,16 @@ public class SimpleUserDto {
 
     private String phone;
 
+    private BigDecimal actualAmount;
+
+    public BigDecimal getActualAmount() {
+        return actualAmount;
+    }
+
+    public void setActualAmount(BigDecimal actualAmount) {
+        this.actualAmount = actualAmount;
+    }
+
     public String getPhone() {
         return phone;
     }

+ 16 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentAttendanceViewDto.java

@@ -2,6 +2,8 @@ package com.ym.mec.biz.dal.dto;
 
 import com.ym.mec.biz.dal.enums.StudentAttendanceStatusEnum;
 import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.StringUtils;
+import sun.swing.StringUIClientPropertyKey;
 
 /**
  * @Author Joburgess
@@ -37,9 +39,23 @@ public class StudentAttendanceViewDto {
     @ApiModelProperty(value = "学生头像")
     private String avatar;
 
+    @ApiModelProperty(value = "缴费状态")
+    private String paymentStatus = "PAID_COMPLETED";
+
     @ApiModelProperty(value = "学生在学状态",required = false)
     private StudentAttendanceStatusEnum status;
 
+    public String getPaymentStatus() {
+        return paymentStatus;
+    }
+
+    public void setPaymentStatus(String paymentStatus) {
+        if(StringUtils.isEmpty(paymentStatus)){
+            paymentStatus = "NON_PAYMENT";
+        }
+        this.paymentStatus = paymentStatus;
+    }
+
     public String getPhone() {
         return phone;
     }

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

@@ -63,6 +63,26 @@ public class TeacherClassCourseSchudeleDto {
     @ApiModelProperty(value = "能否进行调整")
     private int enableAdjustInToday;
 
+    private Integer schoolId;
+
+    private String schoolName;
+
+    public Integer getSchoolId() {
+        return schoolId;
+    }
+
+    public void setSchoolId(Integer schoolId) {
+        this.schoolId = schoolId;
+    }
+
+    public String getSchoolName() {
+        return schoolName;
+    }
+
+    public void setSchoolName(String schoolName) {
+        this.schoolName = schoolName;
+    }
+
     public int getEnableAdjustInToday() {
         return enableAdjustInToday;
     }

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

@@ -42,6 +42,9 @@ public class ChargeTypeSubjectMapper {
 	@ApiModelProperty(value = "课程费用",required = false)
 	private BigDecimal fee;
 	
+	@ApiModelProperty(value = "商品折扣率",required = false)
+	private BigDecimal goodsDiscountRate;
+	
 	public void setId(Long id){
 		this.id = id;
 	}
@@ -106,6 +109,14 @@ public class ChargeTypeSubjectMapper {
 		this.fee = fee;
 	}
 
+	public BigDecimal getGoodsDiscountRate() {
+		return goodsDiscountRate;
+	}
+
+	public void setGoodsDiscountRate(BigDecimal goodsDiscountRate) {
+		this.goodsDiscountRate = goodsDiscountRate;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

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

@@ -53,6 +53,8 @@ public class CourseSchedule {
 	/**  */
 	private Long id;
 
+	private Long newCourseId;
+
 	private GroupType groupType;
 
 	/**  */
@@ -100,6 +102,10 @@ public class CourseSchedule {
 	@ApiModelProperty(value = "实际上课教师", required = false)
 	private Integer actualTeacherId;
 
+	/** 实际上课教师 */
+	@ApiModelProperty(value = "实际上课教师名称", required = false)
+	private String actualTeacherName;
+
 	@ApiModelProperty(value = "助教编号列表")
 	private List<Integer> teachingTeacherIdList = new ArrayList<Integer>();
 
@@ -158,6 +164,14 @@ public class CourseSchedule {
 
 	private int isSignOut = 3;
 
+	public String getActualTeacherName() {
+		return actualTeacherName;
+	}
+
+	public void setActualTeacherName(String actualTeacherName) {
+		this.actualTeacherName = actualTeacherName;
+	}
+
 	public Integer getOrganId() {
 		return organId;
 	}

+ 350 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleAuditDetailDto.java

@@ -0,0 +1,350 @@
+package com.ym.mec.biz.dal.entity;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.enums.*;
+import com.ym.mec.common.enums.BaseEnum;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 对应数据库表(course_schedule):
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class CourseScheduleAuditDetailDto {
+	/**  */
+	private Long id;
+
+	private GroupType groupType;
+
+	/**  */
+	@ApiModelProperty(value = "乐团编号",required = false)
+	private String musicGroupId;
+
+	/** 班级编号 */
+	@ApiModelProperty(value = "班级编号", required = false)
+	private Integer classGroupId;
+
+	/** 课程状态 */
+	@ApiModelProperty(value = "课程状态", required = false)
+	private CourseStatusEnum status;
+
+	/** 补贴 */
+	@ApiModelProperty(value = "补贴", required = false)
+	private BigDecimal subsidy;
+
+	/** 上课日期 */
+	@ApiModelProperty(value = "上课日期", required = false)
+	private String classDate;
+
+	/** 上课时间 */
+	@ApiModelProperty(value = "上课时间", required = false)
+	private String startClassTime;
+
+	/** 结束时间 */
+	@ApiModelProperty(value = "结束时间", required = false)
+	private String endClassTime;
+
+	/** 上课教师 */
+	@ApiModelProperty(value = "上课教师", required = false)
+	private Integer teacherId;
+
+	@ApiModelProperty(value = "上课老师名称", required = false)
+	private String teacherName;
+
+	/** 实际上课教师 */
+	@ApiModelProperty(value = "实际上课教师", required = false)
+	private Integer actualTeacherId;
+
+	/** 实际上课教师 */
+	@ApiModelProperty(value = "实际上课教师名称", required = false)
+	private String actualTeacherName;
+
+	/** 实际上课教师 */
+	@ApiModelProperty(value = "修改人", required = false)
+	private Integer operatorId;
+
+	/** 实际上课教师 */
+	@ApiModelProperty(value = "修改人名称", required = false)
+	private String operatorName;
+
+	/**  */
+	private Date createTime;
+
+	/**  */
+	private Date updateTime;
+
+	@ApiModelProperty(value = "修改时间", required = false)
+	private Date auditTime;
+
+	private TeachModeEnum teachMode;
+
+	private CourseSchedule.CourseScheduleType type;
+
+	private String name;
+
+	@ApiModelProperty(value = "实际上课人数")
+	private Integer studentNum;
+
+	@ApiModelProperty(value = "请假人数")
+	private Integer leaveStudentNum;
+
+	private Integer schoolId;
+
+	private String schoolName;
+
+	private Integer isLock;
+
+	private Integer organId;
+
+	private String teachingContent;
+
+	private String note;
+
+	public Date getAuditTime() {
+		return auditTime;
+	}
+
+	public void setAuditTime(Date auditTime) {
+		this.auditTime = auditTime;
+	}
+
+	public Integer getOperatorId() {
+		return operatorId;
+	}
+
+	public void setOperatorId(Integer operatorId) {
+		this.operatorId = operatorId;
+	}
+
+	public String getOperatorName() {
+		return operatorName;
+	}
+
+	public void setOperatorName(String operatorName) {
+		this.operatorName = operatorName;
+	}
+
+	public String getActualTeacherName() {
+		return actualTeacherName;
+	}
+
+	public void setActualTeacherName(String actualTeacherName) {
+		this.actualTeacherName = actualTeacherName;
+	}
+
+	public Integer getOrganId() {
+		return organId;
+	}
+
+	public void setOrganId(Integer organId) {
+		this.organId = organId;
+	}
+
+	public String getTeachingContent() {
+		return teachingContent;
+	}
+
+	public void setTeachingContent(String teachingContent) {
+		this.teachingContent = teachingContent;
+	}
+
+	public String getNote() {
+		return note;
+	}
+
+	public void setNote(String note) {
+		this.note = note;
+	}
+
+	public Integer getIsLock() {
+		return isLock;
+	}
+
+	public void setIsLock(Integer isLock) {
+		this.isLock = isLock;
+	}
+
+	public String getTeacherName() {
+		return teacherName;
+	}
+
+	public void setTeacherName(String teacherName) {
+		this.teacherName = teacherName;
+	}
+
+	public String getSchoolName() {
+		return schoolName;
+	}
+
+	public void setSchoolName(String schoolName) {
+		this.schoolName = schoolName;
+	}
+
+	public Integer getStudentNum() {
+		return studentNum;
+	}
+
+	public void setStudentNum(Integer studentNum) {
+		this.studentNum = studentNum;
+	}
+
+	public Integer getLeaveStudentNum() {
+		return leaveStudentNum;
+	}
+
+	public void setLeaveStudentNum(Integer leaveStudentNum) {
+		this.leaveStudentNum = leaveStudentNum;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getId() {
+		return this.id;
+	}
+
+	public GroupType getGroupType() {
+		return groupType;
+	}
+
+	public void setGroupType(GroupType groupType) {
+		this.groupType = groupType;
+	}
+
+	public String getMusicGroupId() {
+		return musicGroupId;
+	}
+
+	public void setMusicGroupId(String musicGroupId) {
+		this.musicGroupId = musicGroupId;
+	}
+
+	public void setClassGroupId(Integer classGroupId) {
+		this.classGroupId = classGroupId;
+	}
+
+	public Integer getClassGroupId() {
+		return this.classGroupId;
+	}
+
+	public CourseStatusEnum getStatus() {
+		return status;
+	}
+
+	public void setStatus(CourseStatusEnum status) {
+		this.status = status;
+	}
+
+	public void setSubsidy(BigDecimal subsidy) {
+		this.subsidy = subsidy;
+	}
+
+	public BigDecimal getSubsidy() {
+		return this.subsidy;
+	}
+
+	public String getClassDate() {
+		return classDate;
+	}
+
+	public void setClassDate(String classDate) {
+		this.classDate = classDate;
+	}
+
+	public String getStartClassTime() {
+		return startClassTime;
+	}
+
+	public void setStartClassTime(String startClassTime) {
+		this.startClassTime = startClassTime;
+	}
+
+	public String getEndClassTime() {
+		return endClassTime;
+	}
+
+	public void setEndClassTime(String endClassTime) {
+		this.endClassTime = endClassTime;
+	}
+
+	public Integer getTeacherId() {
+		return teacherId;
+	}
+
+	public void setTeacherId(Integer teacherId) {
+		this.teacherId = teacherId;
+	}
+
+	public Integer getActualTeacherId() {
+		return actualTeacherId;
+	}
+
+	public void setActualTeacherId(Integer actualTeacherId) {
+		this.actualTeacherId = actualTeacherId;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public Date getCreateTime() {
+		return this.createTime;
+	}
+
+	public void setUpdateTime(Date updateTime) {
+		this.updateTime = updateTime;
+	}
+
+	public Date getUpdateTime() {
+		return this.updateTime;
+	}
+
+	public TeachModeEnum getTeachMode() {
+		return teachMode;
+	}
+
+	public void setTeachMode(TeachModeEnum teachMode) {
+		this.teachMode = teachMode;
+	}
+
+	public CourseSchedule.CourseScheduleType getType() {
+		return type;
+	}
+
+	public void setType(CourseSchedule.CourseScheduleType type) {
+		this.type = type;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public Integer getSchoolId() {
+		return schoolId;
+	}
+
+	public void setSchoolId(Integer schoolId) {
+		this.schoolId = schoolId;
+	}
+
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 44 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleStudentPayment.java

@@ -11,7 +11,7 @@ import java.math.BigDecimal;
 /**
  * 对应数据库表(course_schedule_student_payment):
  */
-public class CourseScheduleStudentPayment {
+public class CourseScheduleStudentPayment implements Comparable<CourseScheduleStudentPayment> {
 
 	/**  */
 	private Long id;
@@ -25,8 +25,12 @@ public class CourseScheduleStudentPayment {
 	/**  */
 	private Long courseScheduleId;
 	
+	private CourseSchedule courseSchedule;
+	
 	/**  */
 	private Integer userId;
+
+	private BigDecimal originalPrice;
 	
 	/** 预计价格 */
 	private java.math.BigDecimal expectPrice;
@@ -45,6 +49,8 @@ public class CourseScheduleStudentPayment {
 	
 	private Integer classGroupId;
 
+	private String batchNo;
+
 	public CourseScheduleStudentPayment() {
 	}
 
@@ -99,7 +105,15 @@ public class CourseScheduleStudentPayment {
 	public Integer getUserId(){
 		return this.userId;
 	}
-			
+
+	public BigDecimal getOriginalPrice() {
+		return originalPrice;
+	}
+
+	public void setOriginalPrice(BigDecimal originalPrice) {
+		this.originalPrice = originalPrice;
+	}
+
 	public void setExpectPrice(java.math.BigDecimal expectPrice){
 		this.expectPrice = expectPrice;
 	}
@@ -148,9 +162,37 @@ public class CourseScheduleStudentPayment {
 		this.classGroupId = classGroupId;
 	}
 
+	public String getBatchNo() {
+		return batchNo;
+	}
+
+	public void setBatchNo(String batchNo) {
+		this.batchNo = batchNo;
+	}
+
+	public CourseSchedule getCourseSchedule() {
+		return courseSchedule;
+	}
+
+	public void setCourseSchedule(CourseSchedule courseSchedule) {
+		this.courseSchedule = courseSchedule;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);
 	}
 
+	@Override
+	public int compareTo(CourseScheduleStudentPayment cssp) {
+		if(courseSchedule != null){
+			int r = courseSchedule.getClassDate().compareTo(cssp.getCourseSchedule().getClassDate());
+			if(r == 0){
+				return courseSchedule.getStartClassTime().compareTo(cssp.getCourseSchedule().getStartClassTime());
+			}
+			return r;
+		}
+		return 0;
+	}
+
 }

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

@@ -7,7 +7,6 @@ import java.util.Date;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import com.ym.mec.biz.dal.entity.CooperationOrgan.OwnershipType;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.FeeType;
 import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
 import com.ym.mec.biz.dal.enums.SalarySettlementTypeEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
@@ -159,8 +158,6 @@ public class MusicGroup {
 	
 	private OwnershipType ownershipType;
 	
-	private FeeType feeType;
-	
 	private Boolean delFlag;
 
 	private String subjectName;
@@ -519,14 +516,6 @@ public class MusicGroup {
 		this.ownershipType = ownershipType;
 	}
 
-	public FeeType getFeeType() {
-		return feeType;
-	}
-
-	public void setFeeType(FeeType feeType) {
-		this.feeType = feeType;
-	}
-
 	public Boolean getDelFlag() {
 		return delFlag;
 	}

+ 122 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupOrganizationCourseSettings.java

@@ -0,0 +1,122 @@
+package com.ym.mec.biz.dal.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+public class MusicGroupOrganizationCourseSettings {
+    @ApiModelProperty(value="")
+    private Integer id;
+
+    /**
+    * 课程名称
+    */
+    @ApiModelProperty(value="收费名称")
+    private String name;
+
+    /**
+    * 分部
+    */
+    @ApiModelProperty(value="分部")
+    private Integer organId;
+
+    /**
+    * 收费模式
+    */
+    @ApiModelProperty(value="收费模式")
+    private Integer chargeTypeId;
+
+    /**
+    * 总价
+    */
+    @ApiModelProperty(value="总价")
+    private BigDecimal totalCurrentPrice = BigDecimal.ZERO;
+
+    /**
+    * 原价
+    */
+    @ApiModelProperty(value="原价")
+    private BigDecimal totalOriginalPrice = BigDecimal.ZERO;
+
+    @ApiModelProperty(value="")
+    private Date createTime;
+
+    @ApiModelProperty(value="")
+    private Date updateTime;
+
+
+    private List<MusicGroupOrganizationCourseSettingsDetail> details;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
+    public Integer getChargeTypeId() {
+        return chargeTypeId;
+    }
+
+    public void setChargeTypeId(Integer chargeTypeId) {
+        this.chargeTypeId = chargeTypeId;
+    }
+
+    public BigDecimal getTotalCurrentPrice() {
+        return totalCurrentPrice;
+    }
+
+    public void setTotalCurrentPrice(BigDecimal totalCurrentPrice) {
+        this.totalCurrentPrice = totalCurrentPrice;
+    }
+
+    public BigDecimal getTotalOriginalPrice() {
+        return totalOriginalPrice;
+    }
+
+    public void setTotalOriginalPrice(BigDecimal totalOriginalPrice) {
+        this.totalOriginalPrice = totalOriginalPrice;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public List<MusicGroupOrganizationCourseSettingsDetail> getDetails() {
+        return details;
+    }
+
+    public void setDetails(List<MusicGroupOrganizationCourseSettingsDetail> details) {
+        this.details = details;
+    }
+}

+ 136 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupOrganizationCourseSettingsDetail.java

@@ -0,0 +1,136 @@
+package com.ym.mec.biz.dal.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class MusicGroupOrganizationCourseSettingsDetail {
+    @ApiModelProperty(value="")
+    private Integer id;
+
+    @ApiModelProperty(value="")
+    private Integer musicGroupOrganizationCourseSettingsId;
+
+    /**
+    * 课程类型
+    */
+    @ApiModelProperty(value="课程类型")
+    private CourseSchedule.CourseScheduleType courseType;
+
+    /**
+    * 课程总时间
+    */
+    @ApiModelProperty(value="课程总时间")
+    private Integer courseTotalMinuties;
+
+    /**
+    * 单价
+    */
+    @ApiModelProperty(value="单价")
+    private BigDecimal unitPrice = BigDecimal.ZERO;
+
+    /**
+    * 课程原价
+    */
+    @ApiModelProperty(value="课程原价")
+    private BigDecimal courseOriginalPrice=BigDecimal.ZERO;
+
+    /**
+    * 课程现价
+    */
+    @ApiModelProperty(value="课程现价")
+    private BigDecimal courseCurrentPrice=BigDecimal.ZERO;
+
+    /**
+    * 是否学生可选
+    */
+    @ApiModelProperty(value="是否学生可选")
+    private Boolean isStudentOptional;
+
+    @ApiModelProperty(value="")
+    private Date createTime;
+
+    @ApiModelProperty(value="")
+    private Date updateTime;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getMusicGroupOrganizationCourseSettingsId() {
+        return musicGroupOrganizationCourseSettingsId;
+    }
+
+    public void setMusicGroupOrganizationCourseSettingsId(Integer musicGroupOrganizationCourseSettingsId) {
+        this.musicGroupOrganizationCourseSettingsId = musicGroupOrganizationCourseSettingsId;
+    }
+
+    public CourseSchedule.CourseScheduleType getCourseType() {
+        return courseType;
+    }
+
+    public void setCourseType(CourseSchedule.CourseScheduleType courseType) {
+        this.courseType = courseType;
+    }
+
+    public Integer getCourseTotalMinuties() {
+        return courseTotalMinuties;
+    }
+
+    public void setCourseTotalMinuties(Integer courseTotalMinuties) {
+        this.courseTotalMinuties = courseTotalMinuties;
+    }
+
+    public BigDecimal getUnitPrice() {
+        return unitPrice;
+    }
+
+    public void setUnitPrice(BigDecimal unitPrice) {
+        this.unitPrice = unitPrice;
+    }
+
+    public BigDecimal getCourseOriginalPrice() {
+        return courseOriginalPrice;
+    }
+
+    public void setCourseOriginalPrice(BigDecimal courseOriginalPrice) {
+        this.courseOriginalPrice = courseOriginalPrice;
+    }
+
+    public BigDecimal getCourseCurrentPrice() {
+        return courseCurrentPrice;
+    }
+
+    public void setCourseCurrentPrice(BigDecimal courseCurrentPrice) {
+        this.courseCurrentPrice = courseCurrentPrice;
+    }
+
+    public Boolean getIsStudentOptional() {
+        return isStudentOptional;
+    }
+
+    public void setIsStudentOptional(Boolean isStudentOptional) {
+        this.isStudentOptional = isStudentOptional;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+}

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

@@ -1,56 +1,89 @@
 package com.ym.mec.biz.dal.entity;
 
-import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
-import com.ym.mec.common.enums.BaseEnum;
 import io.swagger.annotations.ApiModelProperty;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.builder.ToStringBuilder;
 
+import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.ym.mec.common.enums.BaseEnum;
 
 /**
  * 对应数据库表(music_group_payment_calender):
  */
-public class MusicGroupPaymentCalender implements Comparable<MusicGroupPaymentCalender> {
+public class MusicGroupPaymentCalender {
+
+	public enum PaymentCalenderStatusEnum implements BaseEnum<String, PaymentCalenderStatusEnum> {
+		AUDITING("审核中"), REJECT("拒绝"), NO("未开启缴费"), OPEN("开启缴费"), OVER("缴费已结束"), PAID("已缴费");
+
+		private String desc;
+
+		PaymentCalenderStatusEnum(String desc) {
+			this.desc = desc;
+		}
+
+		@Override
+		public String getCode() {
+			return this.name();
+		}
 
-	public enum FeeType implements BaseEnum<String, FeeType> {
+		public String getDesc() {
+			return desc;
+		}
 
-		OFFLINE("OFFLINE", "线下"), ONLINE("ONLINE", "线上"), ALL("ALL", "线上/线下");
+	}
 
-		private String code;
+	public enum PayUserType implements BaseEnum<String, PayUserType> {
+		STUDENT("个人"), SCHOOL("学校");
 
-		private String msg;
+		private String desc;
 
-		FeeType(String code, String msg) {
-			this.code = code;
-			this.msg = msg;
+		PayUserType(String desc) {
+			this.desc = desc;
 		}
 
-		public void setCode(String code) {
-			this.code = code;
+		@Override
+		public String getCode() {
+			return this.name();
 		}
 
-		public String getMsg() {
-			return msg;
+		public String getDesc() {
+			return desc;
 		}
 
-		public void setMsg(String msg) {
-			this.msg = msg;
+	}
+
+	public enum PaymentType implements BaseEnum<String, PaymentType> {
+		ADD_STUDENT("新增学员"), ADD_COURSE("临时加课"), MUSIC_APPLY("乐团报名"),MUSIC_RENEW("乐团续费");
+
+		private String desc;
+
+		PaymentType(String desc) {
+			this.desc = desc;
 		}
 
 		@Override
 		public String getCode() {
-			return code;
+			return this.name();
+		}
+
+		public String getDesc() {
+			return desc;
 		}
+
 	}
 
 	private Long id;
 
 	@ApiModelProperty(value = "乐团编号", required = false)
 	private String musicGroupId;
-
-	@ApiModelProperty(value = "缴费月份", required = false)
-	private Integer paymentMonth;
+	
+	private Integer musicGroupOrganizationCourseSettingId;
+	
+	private PayUserType payUserType;
 
 	@ApiModelProperty(value = "开始缴费日期", required = false)
 	private java.util.Date startPaymentDate;
@@ -59,38 +92,75 @@ public class MusicGroupPaymentCalender implements Comparable<MusicGroupPaymentCa
 	private Date deadlinePaymentDate;
 
 	@ApiModelProperty(value = "缴费有效期开始时间", required = false)
-	private String paymentValidStartDate;
+	private Date paymentValidStartDate;
 
 	@ApiModelProperty(value = "缴费有效期截止时间", required = false)
-	private String paymentValidEndDate;
+	private Date paymentValidEndDate;
 
-	@ApiModelProperty(value = "缴费方式0按月,1按,2一次性", required = false)
+	@ApiModelProperty(value = "缴费方式0按月,1按学期,2一次性", required = false)
 	private Integer paymentPattern;
 
-	@ApiModelProperty(value = "缴费类型0续费,1报名", required = false)
-	private Integer paymentType;
+	@ApiModelProperty(value = "缴费类型", required = false)
+	private PaymentType paymentType;
+	
+	private BigDecimal paymentAmount = new BigDecimal(0);
 
-	private PaymentStatusEnum paymentStatus;
+	@ApiModelProperty(value = "状态", required = false)
+	private PaymentCalenderStatusEnum status;
 
-	private Integer expectNum;
+	private Integer expectNum = 0;
 
 	private Integer actualNum;
 
+	@ApiModelProperty(value = "创建人", required = false)
+	private Integer operator;
+
+	@ApiModelProperty(value = "备注", required = false)
 	private String memo;
 
-	private FeeType type;
+	@ApiModelProperty(value = "审核意见", required = false)
+	private String auditMemo;
+
+	private Boolean isGiveMusicNetwork;
+	
+	private String rejectReason;
 
 	private java.util.Date createTime;
 
 	private java.util.Date updateTime;
+	
+	private String attribute1;
+	
+	private String attribute2;
 
 	private String studentIds;
 
-	public Integer getPaymentType() {
+	private List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList = new ArrayList<MusicGroupPaymentCalenderCourseSettings>();
+
+	@ApiModelProperty(value = "批次号", required = false)
+	private String batchNo;
+
+	public String getAuditMemo() {
+		return auditMemo;
+	}
+
+	public void setAuditMemo(String auditMemo) {
+		this.auditMemo = auditMemo;
+	}
+
+	public Integer getOperator() {
+		return operator;
+	}
+
+	public void setOperator(Integer operator) {
+		this.operator = operator;
+	}
+
+	public PaymentType getPaymentType() {
 		return paymentType;
 	}
 
-	public void setPaymentType(Integer paymentType) {
+	public void setPaymentType(PaymentType paymentType) {
 		this.paymentType = paymentType;
 	}
 
@@ -102,32 +172,20 @@ public class MusicGroupPaymentCalender implements Comparable<MusicGroupPaymentCa
 		this.paymentPattern = paymentPattern;
 	}
 
-	public String getPaymentValidStartDate() {
+	public Date getPaymentValidStartDate() {
 		return paymentValidStartDate;
 	}
 
-	public void setPaymentValidStartDate(String paymentValidStartDate) {
+	public void setPaymentValidStartDate(Date paymentValidStartDate) {
 		this.paymentValidStartDate = paymentValidStartDate;
 	}
 
-	public String getPaymentValidEndDate() {
+	public Date getPaymentValidEndDate() {
 		return paymentValidEndDate;
 	}
 
-	public void setPaymentValidEndDate(String paymentValidEndDate) {
-		if(StringUtils.isEmpty(paymentValidEndDate)){
-			this.paymentValidEndDate = null;
-		}else {
-			this.paymentValidEndDate = paymentValidEndDate;
-		}
-	}
-
-	public String getStudentIds() {
-		return studentIds;
-	}
-
-	public void setStudentIds(String studentIds) {
-		this.studentIds = studentIds;
+	public void setPaymentValidEndDate(Date paymentValidEndDate) {
+		this.paymentValidEndDate = paymentValidEndDate;
 	}
 
 	public void setId(Long id) {
@@ -146,14 +204,6 @@ public class MusicGroupPaymentCalender implements Comparable<MusicGroupPaymentCa
 		return this.musicGroupId;
 	}
 
-	public void setPaymentMonth(Integer paymentMonth) {
-		this.paymentMonth = paymentMonth;
-	}
-
-	public Integer getPaymentMonth() {
-		return this.paymentMonth;
-	}
-
 	public void setStartPaymentDate(java.util.Date startPaymentDate) {
 		this.startPaymentDate = startPaymentDate;
 	}
@@ -186,12 +236,12 @@ public class MusicGroupPaymentCalender implements Comparable<MusicGroupPaymentCa
 		this.deadlinePaymentDate = deadlinePaymentDate;
 	}
 
-	public PaymentStatusEnum getPaymentStatus() {
-		return paymentStatus;
+	public PaymentCalenderStatusEnum getStatus() {
+		return status;
 	}
 
-	public void setPaymentStatus(PaymentStatusEnum paymentStatus) {
-		this.paymentStatus = paymentStatus;
+	public void setStatus(PaymentCalenderStatusEnum status) {
+		this.status = status;
 	}
 
 	public Integer getExpectNum() {
@@ -218,22 +268,89 @@ public class MusicGroupPaymentCalender implements Comparable<MusicGroupPaymentCa
 		this.memo = memo;
 	}
 
-	public FeeType getType() {
-		return type;
+	public Boolean getIsGiveMusicNetwork() {
+		return isGiveMusicNetwork;
 	}
 
-	public void setType(FeeType type) {
-		this.type = type;
+	public void setIsGiveMusicNetwork(Boolean isGiveMusicNetwork) {
+		this.isGiveMusicNetwork = isGiveMusicNetwork;
 	}
 
-	@Override
-	public String toString() {
-		return ToStringBuilder.reflectionToString(this);
+	public String getRejectReason() {
+		return rejectReason;
+	}
+
+	public void setRejectReason(String rejectReason) {
+		this.rejectReason = rejectReason;
+	}
+
+	public Integer getMusicGroupOrganizationCourseSettingId() {
+		return musicGroupOrganizationCourseSettingId;
+	}
+
+	public void setMusicGroupOrganizationCourseSettingId(Integer musicGroupOrganizationCourseSettingId) {
+		this.musicGroupOrganizationCourseSettingId = musicGroupOrganizationCourseSettingId;
+	}
+
+	public PayUserType getPayUserType() {
+		return payUserType;
+	}
+
+	public void setPayUserType(PayUserType payUserType) {
+		this.payUserType = payUserType;
+	}
+
+	public String getStudentIds() {
+		return studentIds;
+	}
+
+	public void setStudentIds(String studentIds) {
+		this.studentIds = studentIds;
+	}
+
+	public List<MusicGroupPaymentCalenderCourseSettings> getMusicGroupPaymentCalenderCourseSettingsList() {
+		return musicGroupPaymentCalenderCourseSettingsList;
+	}
+
+	public void setMusicGroupPaymentCalenderCourseSettingsList(List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList) {
+		this.musicGroupPaymentCalenderCourseSettingsList = musicGroupPaymentCalenderCourseSettingsList;
+	}
+
+	public String getBatchNo() {
+		return batchNo;
+	}
+
+	public void setBatchNo(String batchNo) {
+		this.batchNo = batchNo;
+	}
+
+	public BigDecimal getPaymentAmount() {
+		return paymentAmount;
+	}
+
+	public void setPaymentAmount(BigDecimal paymentAmount) {
+		this.paymentAmount = paymentAmount;
+	}
+
+	public String getAttribute1() {
+		return attribute1;
+	}
+
+	public void setAttribute1(String attribute1) {
+		this.attribute1 = attribute1;
+	}
+
+	public String getAttribute2() {
+		return attribute2;
+	}
+
+	public void setAttribute2(String attribute2) {
+		this.attribute2 = attribute2;
 	}
 
 	@Override
-	public int compareTo(MusicGroupPaymentCalender cal) {
-		return this.paymentMonth.compareTo(cal.getPaymentMonth());
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
 	}
 
 }

+ 138 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalenderCourseSettings.java

@@ -0,0 +1,138 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
+
+/**
+ * 对应数据库表(music_group_payment_calender_course_settings):
+ */
+public class MusicGroupPaymentCalenderCourseSettings {
+
+	/**  */
+	private Integer id;
+	
+	/**  */
+	private Long musicGroupPaymentCalenderId;
+
+	/**  */
+	private String name;
+	
+	/** 课程类型 */
+	private CourseSchedule.CourseScheduleType courseType;
+
+	/** 课程总时间 */
+	private Integer courseTotalMinuties;
+	
+	/** 单价 */
+	private java.math.BigDecimal unitPrice;
+	
+	/** 课程原价 */
+	private java.math.BigDecimal courseOriginalPrice;
+	
+	/** 课程现价 */
+	private java.math.BigDecimal courseCurrentPrice;
+	
+	/** 是否学生可选 */
+	private boolean isStudentOptional;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setMusicGroupPaymentCalenderId(Long musicGroupPaymentCalenderId){
+		this.musicGroupPaymentCalenderId = musicGroupPaymentCalenderId;
+	}
+	
+	public Long getMusicGroupPaymentCalenderId(){
+		return this.musicGroupPaymentCalenderId;
+	}
+			
+	public void setCourseType(CourseScheduleType courseType){
+		this.courseType = courseType;
+	}
+	
+	public CourseScheduleType getCourseType() {
+		return this.courseType;
+	}
+
+	public Integer getCourseTotalMinuties() {
+		return courseTotalMinuties;
+	}
+
+	public void setCourseTotalMinuties(Integer courseTotalMinuties) {
+		this.courseTotalMinuties = courseTotalMinuties;
+	}
+			
+	public void setUnitPrice(java.math.BigDecimal unitPrice){
+		this.unitPrice = unitPrice;
+	}
+	
+	public java.math.BigDecimal getUnitPrice(){
+		return this.unitPrice;
+	}
+			
+	public void setCourseOriginalPrice(java.math.BigDecimal courseOriginalPrice){
+		this.courseOriginalPrice = courseOriginalPrice;
+	}
+	
+	public java.math.BigDecimal getCourseOriginalPrice(){
+		return this.courseOriginalPrice;
+	}
+			
+	public void setCourseCurrentPrice(java.math.BigDecimal courseCurrentPrice){
+		this.courseCurrentPrice = courseCurrentPrice;
+	}
+	
+	public java.math.BigDecimal getCourseCurrentPrice(){
+		return this.courseCurrentPrice;
+	}
+			
+	public void setIsStudentOptional(boolean isStudentOptional){
+		this.isStudentOptional = isStudentOptional;
+	}
+	
+	public boolean getIsStudentOptional(){
+		return this.isStudentOptional;
+	}
+			
+	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);
+	}
+
+}

+ 27 - 5
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalenderDetail.java

@@ -2,6 +2,7 @@ package com.ym.mec.biz.dal.entity;
 
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
+import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
@@ -57,13 +58,20 @@ public class MusicGroupPaymentCalenderDetail {
 
 	/**  */
 	private java.util.Date deadlinePaymentDateMgpc;
-	
+
+	@ApiModelProperty(value = "订单编号",required = true)
+	private Long paymentOrderId;
+
 	/**  */
 	private java.util.Date updateTime;
 	
 	/**  */
 	private java.util.Date createTime;
 
+	private Integer useInCourse;
+
+	private SysUser sysUser = new SysUser();
+
 	public Date getStartPaymentDateMgpc() {
 		return startPaymentDateMgpc;
 	}
@@ -80,8 +88,6 @@ public class MusicGroupPaymentCalenderDetail {
 		this.deadlinePaymentDateMgpc = deadlinePaymentDateMgpc;
 	}
 
-	private SysUser sysUser = new SysUser();
-
 	public YesOrNoEnum getOpenFlag() {
 		return openFlag;
 	}
@@ -155,7 +161,15 @@ public class MusicGroupPaymentCalenderDetail {
 	public Long getMusicGroupPaymentCalenderId(){
 		return this.musicGroupPaymentCalenderId;
 	}
-			
+
+	public Long getPaymentOrderId() {
+		return paymentOrderId;
+	}
+
+	public void setPaymentOrderId(Long paymentOrderId) {
+		this.paymentOrderId = paymentOrderId;
+	}
+
 	public void setUserId(Integer userId){
 		this.userId = userId;
 	}
@@ -219,7 +233,15 @@ public class MusicGroupPaymentCalenderDetail {
 	public java.util.Date getCreateTime(){
 		return this.createTime;
 	}
-			
+
+	public Integer getUseInCourse() {
+		return useInCourse;
+	}
+
+	public void setUseInCourse(Integer useInCourse) {
+		this.useInCourse = useInCourse;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 116 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentStudentCourseDetail.java

@@ -0,0 +1,116 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
+
+/**
+ * 对应数据库表(music_group_payment_student_course_detail):
+ */
+public class MusicGroupPaymentStudentCourseDetail {
+
+	/**  */
+	private Long id;
+	
+	/**  */
+	private Long musicGroupPaymentCalenderId;
+	
+	/**  */
+	private Long musicGroupPaymentCalenderDetailId;
+	
+	/**  */
+	private Integer userId;
+	
+	/**  */
+	private CourseScheduleType courseType;
+	
+	/**  */
+	private Integer totalCourseMinutes;
+	
+	/**  */
+	private Integer usedCourseMinutes;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setMusicGroupPaymentCalenderId(Long musicGroupPaymentCalenderId){
+		this.musicGroupPaymentCalenderId = musicGroupPaymentCalenderId;
+	}
+	
+	public Long getMusicGroupPaymentCalenderId(){
+		return this.musicGroupPaymentCalenderId;
+	}
+			
+	public void setMusicGroupPaymentCalenderDetailId(Long musicGroupPaymentCalenderDetailId){
+		this.musicGroupPaymentCalenderDetailId = musicGroupPaymentCalenderDetailId;
+	}
+	
+	public Long getMusicGroupPaymentCalenderDetailId(){
+		return this.musicGroupPaymentCalenderDetailId;
+	}
+			
+	public void setUserId(Integer userId){
+		this.userId = userId;
+	}
+	
+	public Integer getUserId(){
+		return this.userId;
+	}
+			
+	public void setCourseType(CourseScheduleType courseType){
+		this.courseType = courseType;
+	}
+	
+	public CourseScheduleType getCourseType(){
+		return this.courseType;
+	}
+			
+	public void setTotalCourseMinutes(Integer totalCourseMinutes){
+		this.totalCourseMinutes = totalCourseMinutes;
+	}
+	
+	public Integer getTotalCourseMinutes(){
+		return this.totalCourseMinutes;
+	}
+			
+	public void setUsedCourseMinutes(Integer usedCourseMinutes){
+		this.usedCourseMinutes = usedCourseMinutes;
+	}
+	
+	public Integer getUsedCourseMinutes(){
+		return this.usedCourseMinutes;
+	}
+			
+	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);
+	}
+
+}

+ 114 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/OrganizationCourseUnitPriceSettings.java

@@ -0,0 +1,114 @@
+package com.ym.mec.biz.dal.entity;
+
+import java.math.BigDecimal;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
+
+/**
+ * 对应数据库表(organization_course_unit_price_settings):
+ */
+public class OrganizationCourseUnitPriceSettings {
+
+	/**  */
+	private Integer id;
+	
+	/**  */
+	private Integer organId;
+	
+	/** 课程类型 */
+	private CourseScheduleType courseType;
+
+	private Integer chargeTypeId;
+	
+	private BigDecimal unitPrice = new BigDecimal(0);
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	private Organization organ = new Organization();
+	
+	private ChargeType chargeType = new ChargeType();
+	
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setOrganId(Integer organId){
+		this.organId = organId;
+	}
+	
+	public Integer getOrganId(){
+		return this.organId;
+	}
+			
+	public CourseScheduleType getCourseType() {
+		return courseType;
+	}
+
+	public void setCourseType(CourseScheduleType courseType) {
+		this.courseType = courseType;
+	}
+			
+	public BigDecimal getUnitPrice() {
+		return unitPrice;
+	}
+
+	public void setUnitPrice(BigDecimal unitPrice) {
+		this.unitPrice = unitPrice;
+	}
+
+	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;
+	}
+			
+	public Integer getChargeTypeId() {
+		return chargeTypeId;
+	}
+
+	public void setChargeTypeId(Integer chargeTypeId) {
+		this.chargeTypeId = chargeTypeId;
+	}
+
+	public Organization getOrgan() {
+		return organ;
+	}
+
+	public void setOrgan(Organization organ) {
+		this.organ = organ;
+	}
+
+	public ChargeType getChargeType() {
+		return chargeType;
+	}
+
+	public void setChargeType(ChargeType chargeType) {
+		this.chargeType = chargeType;
+	}
+
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

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

@@ -137,6 +137,8 @@ public class SellOrder {
     @ApiModelProperty(value="交易方式")
     private String paymentChannel;
 
+    private String paymentChannelStr;
+
     /**
     * 收款账户
     */
@@ -161,6 +163,8 @@ public class SellOrder {
     @ApiModelProperty(value = "账户类型")
     private AccountType accountType;
 
+    private String accountTypeStr;
+
     /**
      * 状态
      */
@@ -195,6 +199,8 @@ public class SellOrder {
     @ApiModelProperty(value = "收货状态,NO_RECEIVE 未确认,MANUAL_RECEIVE 手动确认,AUTO_RECEIVE 自动确认",required = true)
     private String receiveStatus;
 
+    private String receiveStatusStr;
+
     private Boolean hasRoute = false;
 
     public String getReceiveStatus() {
@@ -476,4 +482,28 @@ public class SellOrder {
     public void setHasRoute(Boolean hasRoute) {
         this.hasRoute = hasRoute;
     }
-}
+
+    public String getPaymentChannelStr() {
+        return paymentChannelStr;
+    }
+
+    public void setPaymentChannelStr(String paymentChannelStr) {
+        this.paymentChannelStr = paymentChannelStr;
+    }
+
+    public String getAccountTypeStr() {
+        return accountTypeStr;
+    }
+
+    public void setAccountTypeStr(String accountTypeStr) {
+        this.accountTypeStr = accountTypeStr;
+    }
+
+    public String getReceiveStatusStr() {
+        return receiveStatusStr;
+    }
+
+    public void setReceiveStatusStr(String receiveStatusStr) {
+        this.receiveStatusStr = receiveStatusStr;
+    }
+}

+ 15 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentAttendance.java

@@ -5,6 +5,7 @@ import com.ym.mec.biz.dal.enums.StudentAttendanceStatusEnum;
 
 import io.swagger.annotations.ApiModelProperty;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import java.util.Date;
@@ -76,6 +77,20 @@ public class StudentAttendance {
 	@ApiModelProperty(value = "当前课时")
 	private Integer currentClassTimes;
 
+	@ApiModelProperty(value = "缴费状态")
+	private String paymentStatus = "PAID_COMPLETED";
+
+	public String getPaymentStatus() {
+		return paymentStatus;
+	}
+
+	public void setPaymentStatus(String paymentStatus) {
+		if(StringUtils.isEmpty(paymentStatus)){
+			paymentStatus = "NON_PAYMENT";
+		}
+		this.paymentStatus = paymentStatus;
+	}
+
 	public Long getCurrentScheduleId() {
 		return currentScheduleId;
 	}

+ 221 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentPaymentRouteOrder.java

@@ -3,6 +3,12 @@ package com.ym.mec.biz.dal.entity;
 import java.math.BigDecimal;
 import java.util.Date;
 
+import com.alibaba.fastjson.JSONObject;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.enums.AuditStatusEnum;
+
+import static com.ym.mec.biz.dal.enums.AuditStatusEnum.ING;
+
 public class StudentPaymentRouteOrder {
     private Long id;
 
@@ -36,7 +42,76 @@ public class StudentPaymentRouteOrder {
     */
     private String feeFlag;
 
-    public Long getId() {
+    /**
+    * 销售类型   销售收入/服务收入
+    */
+    private String incomeType;
+    
+    private Integer userId;
+    
+    private Integer schoolId;
+    
+    private String transNo;
+    
+    private Date payTime;
+    
+    private BigDecimal saleAmount;
+    
+    private BigDecimal serviceAmount;
+    
+    private String memo;
+    
+    private String goodsIds;
+
+    private String goodsNums;
+
+    private String goodsJson;
+    
+    private AuditStatusEnum auditStatus = ING;
+    
+    private String auditComment;
+    
+    private Date createTime;
+    
+    private Date updateTime;
+    
+    private Integer createBy;
+    
+    private Integer updateBy;
+    
+    private CooperationOrgan cooperationOrgan = new CooperationOrgan();
+    
+    private SysUser student = new SysUser();
+    
+    private SysUser operator = new SysUser();
+    
+    private Organization organ = new Organization();
+
+	public String getIncomeType() {
+		return incomeType;
+	}
+
+	public void setIncomeType(String incomeType) {
+		this.incomeType = incomeType;
+	}
+
+	public String getGoodsIds() {
+		return goodsIds;
+	}
+
+	public void setGoodsIds(String goodsIds) {
+		this.goodsIds = goodsIds;
+	}
+
+	public String getGoodsNums() {
+		return goodsNums;
+	}
+
+	public void setGoodsNums(String goodsNums) {
+		this.goodsNums = goodsNums;
+	}
+
+	public Long getId() {
         return id;
     }
 
@@ -76,7 +151,71 @@ public class StudentPaymentRouteOrder {
         this.feeFlag = feeFlag;
     }
 
-    public String getOrderNo() {
+    public Integer getUserId() {
+		return userId;
+	}
+
+	public void setUserId(Integer userId) {
+		this.userId = userId;
+	}
+
+	public Integer getSchoolId() {
+		return schoolId;
+	}
+
+	public void setSchoolId(Integer schoolId) {
+		this.schoolId = schoolId;
+	}
+
+	public String getTransNo() {
+		return transNo;
+	}
+
+	public void setTransNo(String transNo) {
+		this.transNo = transNo;
+	}
+
+	public Date getPayTime() {
+		return payTime;
+	}
+
+	public void setPayTime(Date payTime) {
+		this.payTime = payTime;
+	}
+
+	public BigDecimal getSaleAmount() {
+		return saleAmount;
+	}
+
+	public void setSaleAmount(BigDecimal saleAmount) {
+		this.saleAmount = saleAmount;
+	}
+
+	public BigDecimal getServiceAmount() {
+		return serviceAmount;
+	}
+
+	public void setServiceAmount(BigDecimal serviceAmount) {
+		this.serviceAmount = serviceAmount;
+	}
+
+	public String getMemo() {
+		return memo;
+	}
+
+	public void setMemo(String memo) {
+		this.memo = memo;
+	}
+
+	public String getGoodsJson() {
+		return goodsJson;
+	}
+
+	public void setGoodsJson(String goodsJson) {
+		this.goodsJson = goodsJson;
+	}
+
+	public String getOrderNo() {
         return orderNo;
     }
 
@@ -91,4 +230,84 @@ public class StudentPaymentRouteOrder {
     public void setRouteBalanceAmount(BigDecimal routeBalanceAmount) {
         this.routeBalanceAmount = routeBalanceAmount;
     }
+
+	public AuditStatusEnum getAuditStatus() {
+		return auditStatus;
+	}
+
+	public void setAuditStatus(AuditStatusEnum auditStatus) {
+		this.auditStatus = auditStatus;
+	}
+
+	public String getAuditComment() {
+		return auditComment;
+	}
+
+	public void setAuditComment(String auditComment) {
+		this.auditComment = auditComment;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public Date getUpdateTime() {
+		return updateTime;
+	}
+
+	public void setUpdateTime(Date updateTime) {
+		this.updateTime = updateTime;
+	}
+
+	public Integer getCreateBy() {
+		return createBy;
+	}
+
+	public void setCreateBy(Integer createBy) {
+		this.createBy = createBy;
+	}
+
+	public Integer getUpdateBy() {
+		return updateBy;
+	}
+
+	public void setUpdateBy(Integer updateBy) {
+		this.updateBy = updateBy;
+	}
+
+	public CooperationOrgan getCooperationOrgan() {
+		return cooperationOrgan;
+	}
+
+	public void setCooperationOrgan(CooperationOrgan cooperationOrgan) {
+		this.cooperationOrgan = cooperationOrgan;
+	}
+
+	public SysUser getStudent() {
+		return student;
+	}
+
+	public void setStudent(SysUser student) {
+		this.student = student;
+	}
+
+	public SysUser getOperator() {
+		return operator;
+	}
+
+	public void setOperator(SysUser operator) {
+		this.operator = operator;
+	}
+
+	public Organization getOrgan() {
+		return organ;
+	}
+
+	public void setOrgan(Organization organ) {
+		this.organ = organ;
+	}
 }

+ 15 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SubjectChange.java

@@ -55,8 +55,10 @@ public class SubjectChange {
     @ApiModelProperty(value = "原始课程费用")
     private BigDecimal originalCourseFee = BigDecimal.ZERO;
 
-    @ApiModelProperty(value = "乐器购买方式")
-    private KitGroupPurchaseTypeEnum kitGroupPurchaseType;
+
+
+    @ApiModelProperty(value = "原始乐器购买方式")
+    private KitGroupPurchaseTypeEnum originalKitGroupPurchaseType;
 
     /**
      * 原始乐器编号
@@ -104,6 +106,9 @@ public class SubjectChange {
     private Goods changeMusicalGoods;
 
 
+    @ApiModelProperty(value = "替换后乐器购买方式")
+    private KitGroupPurchaseTypeEnum kitGroupPurchaseType;
+
     /**
      * 替换乐器价格
      */
@@ -566,4 +571,12 @@ public class SubjectChange {
     public void setOriginalOrderId(Integer originalOrderId) {
         this.originalOrderId = originalOrderId;
     }
+
+    public KitGroupPurchaseTypeEnum getOriginalKitGroupPurchaseType() {
+        return originalKitGroupPurchaseType;
+    }
+
+    public void setOriginalKitGroupPurchaseType(KitGroupPurchaseTypeEnum originalKitGroupPurchaseType) {
+        this.originalKitGroupPurchaseType = originalKitGroupPurchaseType;
+    }
 }

+ 149 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysExamSong.java

@@ -0,0 +1,149 @@
+package com.ym.mec.biz.dal.entity;
+
+import com.ym.mec.biz.dal.enums.ExamSongTypeEnum;
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(sys_exam_song):
+ */
+public class SysExamSong {
+
+	/**  */
+	private Integer id;
+
+	@ApiModelProperty(value = "名称", required = true)
+	private String name;
+	
+	@ApiModelProperty(value = "类型PERSON 个人,COMMON公用", required = true)
+	private ExamSongTypeEnum type;
+	
+	@ApiModelProperty(value = "声部列表", required = true)
+	private String subjectIds;
+
+	@ApiModelProperty(value = "声部列表", required = true)
+	private String subjectNames;
+	
+	@ApiModelProperty(value = "速度", required = true)
+	private Integer speed;
+	
+	@ApiModelProperty(value = "地址", required = true)
+	private String url;
+	
+	@ApiModelProperty(value = "上传人", required = true)
+	private Integer createUserId;
+
+	@ApiModelProperty(value = "上传人", required = true)
+	private String createUserName;
+	
+	@ApiModelProperty(value = "是否删除1是0否", required = true)
+	private Integer delFlag;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	/**  */
+	private java.util.Date createTime;
+
+	public String getSubjectNames() {
+		return subjectNames;
+	}
+
+	public void setSubjectNames(String subjectNames) {
+		this.subjectNames = subjectNames;
+	}
+
+	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 setName(String name){
+		this.name = name;
+	}
+	
+	public String getName(){
+		return this.name;
+	}
+			
+	public void setType(ExamSongTypeEnum type){
+		this.type = type;
+	}
+	
+	public ExamSongTypeEnum getType(){
+		return this.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);
+	}
+
+}

+ 33 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/ExamSongTypeEnum.java

@@ -0,0 +1,33 @@
+package com.ym.mec.biz.dal.enums;
+
+import com.ym.mec.common.enums.BaseEnum;
+
+public enum ExamSongTypeEnum implements BaseEnum<String, ExamSongTypeEnum> {
+	PERSON("PERSON", "个人"), COMMON("COMMON", "公共");
+
+	private String code;
+
+	private String msg;
+
+	ExamSongTypeEnum(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;
+	}
+}

+ 15 - 15
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/FeeTypeEnum.java

@@ -3,25 +3,25 @@ package com.ym.mec.biz.dal.enums;
 import com.ym.mec.common.enums.BaseEnum;
 
 public enum FeeTypeEnum implements BaseEnum<String, FeeTypeEnum> {
-    SERVICE("SERVICE", "服务"),
-    SELL("SELL", "销售");
+	SERVICE("SERVICE", "服务"),
+	SELL("SELL", "销售");
 
-    private String code;
+	private String code;
 
-    private String desc;
+	private String desc;
 
-    private FeeTypeEnum(String code, String desc) {
-        this.code = code;
-        this.desc = desc;
-    }
+	private FeeTypeEnum(String code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
 
-    @Override
-    public String getCode() {
-        return code;
-    }
+	@Override
+	public String getCode() {
+		return code;
+	}
 
-    public String getDesc() {
-        return desc;
-    }
+	public String getDesc() {
+		return desc;
+	}
 
 }

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/KitGroupPurchaseTypeEnum.java

@@ -6,7 +6,8 @@ import com.ym.mec.common.enums.BaseEnum;
 public enum  KitGroupPurchaseTypeEnum implements BaseEnum<String,KitGroupPurchaseTypeEnum> {
     FREE("FREE","免费"),
     GROUP("GROUP","团购"),
-    LEASE("LEASE","租赁");
+    LEASE("LEASE","租赁"),
+    OWNED("OWNED", "自备");
     private String code;
 
     private String msg;

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/MessageTypeEnum.java

@@ -121,6 +121,7 @@ public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
 
     BACKSTAGE_CREATE_MUSIC_GROUP_APPLY("BACKSTAGE_CREATE_MUSIC_GROUP_APPLY", "建团申请"),
     BACKSTAGE_ACTION_APPLY("BACKSTAGE_ACTION_APPLY", "开启报名"),
+    BACKSTAGE_PAYMENT_CALENDER_AUDIT("BACKSTAGE_PAYMENT_CALENDER_AUDIT", "缴费项目审核"),
     BACKSTAGE_ACTION_PAYMENT("BACKSTAGE_ACTION_PAYMENT", "开启缴费"),
     SMS_STUDENT_OPEN_PAYMENT("SMS_STUDENT_OPEN_PAYMENT", "开启缴费"),
     BACKSTAGE_LENGTHEN_PAYMENT("BACKSTAGE_LENGTHEN_PAYMENT", "延长缴费"),

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/MusicGroupStatusEnum.java

@@ -3,7 +3,7 @@ package com.ym.mec.biz.dal.enums;
 import com.ym.mec.common.enums.BaseEnum;
 
 public enum MusicGroupStatusEnum implements BaseEnum<String, MusicGroupStatusEnum> {
-	DRAFT("DRAFT", "草稿"), AUDIT("AUDIT", "审核中"),
+	DRAFT("DRAFT", "草稿"), FEE_AUDIT("FEE_AUDIT","费用审核中"), AUDIT("AUDIT", "审核中"),
 	AUDIT_FAILED("AUDIT_FAILED", "审核失败"), APPLY("APPLY", "报名中"),
 	PAY("PAY", "缴费中"), PREPARE("PREPARE", "筹备中"),
 	PROGRESS("PROGRESS", "进行中"), CANCELED("CANCELED", "取消"), PAUSE("PAUSE", "暂停");

+ 45 - 36
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/OrderDetailTypeEnum.java

@@ -6,40 +6,49 @@ import com.ym.mec.common.enums.BaseEnum;
  * 类型(乐器、教辅、课程)'
  */
 public enum OrderDetailTypeEnum implements BaseEnum<String, OrderDetailTypeEnum> {
-	MUSICAL("MUSICAL", "乐器"),
-	ACCESSORIES("ACCESSORIES", "辅件"),
-	TEACHING("TEACHING", "教谱"),
-	OTHER("OTHER", "其他"),
-	COURSE("COURSE", "课程"),
-	MUSIC_COURSE("MUSIC_COURSE", "乐团声部训练"),
-	MIX_COURSE("MIX_COURSE", "乐团合奏训练"),
-	HIGH_ONLINE_COURSE("HIGH_ONLINE_COURSE", "网络基础训练"),
-	HOLIDAY_COURSE("HOLIDAY_COURSE", "假期集中训练"),
-	NETWORK_COURSE("NETWORK_COURSE", "乐团云课堂");
-
-	private String code;
-
-	private String msg;
-
-	OrderDetailTypeEnum(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;
-	}
+    MUSICAL("MUSICAL", "乐器"),
+    ACCESSORIES("ACCESSORIES", "辅件"),
+    TEACHING("TEACHING", "教谱"),
+    OTHER("OTHER", "其他"),
+    COURSE("COURSE", "课程"),
+    HIGH_ONLINE_COURSE("HIGH_ONLINE_COURSE", "网络基础训练"),
+    SINGLE("SINGLE", "单技课"),
+    MIX("MIX", "合奏课"),
+    HIGH("HIGH", "小班课"),
+    VIP("VIP", "vip课"),
+    DEMO("DEMO", "试听课"),
+    COMPREHENSIVE("COMPREHENSIVE", "综合课"),
+    ENLIGHTENMENT("ENLIGHTENMENT", "启蒙课"),
+    TRAINING_SINGLE("TRAINING_SINGLE", "集训单技课"),
+    TRAINING_MIX("TRAINING_MIX", "集训合奏课"),
+    HIGH_ONLINE("HIGH_ONLINE", "网络基础训练课"),
+    MUSIC_NETWORK("MUSIC_NETWORK", "乐团网管课"),
+    CLASSROOM("CLASSROOM", "课堂课");
+
+
+    private String code;
+
+    private String msg;
+
+    OrderDetailTypeEnum(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;
+    }
 }

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/TemplateTypeEnum.java

@@ -4,6 +4,7 @@ import com.ym.mec.common.enums.BaseEnum;
 
 public enum TemplateTypeEnum implements BaseEnum<String, TemplateTypeEnum> {
     GOODS("GOODS","商品导入模板"),
+    ROUTE_ORDER("ROUTE_ORDER","财务管理导入模板"),
     FINANCIAL_EXPENDITURE("FINANCIAL_EXPENDITURE","财务支出导入模板");
 
     private String code;

+ 27 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/ChargeTypeSubjectMapperQueryInfo.java

@@ -0,0 +1,27 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+
+public class ChargeTypeSubjectMapperQueryInfo extends QueryInfo {
+
+	private Integer chargeTypeId;
+
+	/**  */
+	private Integer subjectId;
+
+	public Integer getChargeTypeId() {
+		return chargeTypeId;
+	}
+
+	public void setChargeTypeId(Integer chargeTypeId) {
+		this.chargeTypeId = chargeTypeId;
+	}
+
+	public Integer getSubjectId() {
+		return subjectId;
+	}
+
+	public void setSubjectId(Integer subjectId) {
+		this.subjectId = subjectId;
+	}
+}

+ 29 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/CourseSettingQueryInfo.java

@@ -0,0 +1,29 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+public class CourseSettingQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value="分部id")
+    private Integer organId;
+
+    @ApiModelProperty(value="收费模式id")
+    private Integer chargeTypeId;
+
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
+    public Integer getChargeTypeId() {
+        return chargeTypeId;
+    }
+
+    public void setChargeTypeId(Integer chargeTypeId) {
+        this.chargeTypeId = chargeTypeId;
+    }
+}

+ 0 - 15
mec-biz/src/main/java/com/ym/mec/biz/dal/page/MusicCalenderQueryInfo.java

@@ -1,15 +0,0 @@
-package com.ym.mec.biz.dal.page;
-
-import com.ym.mec.common.page.QueryInfo;
-
-public class MusicCalenderQueryInfo extends QueryInfo {
-	private String musicGroupId;
-
-	public String getMusicGroupId() {
-		return musicGroupId;
-	}
-
-	public void setMusicGroupId(String musicGroupId) {
-		this.musicGroupId = musicGroupId;
-	}
-}

+ 59 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/MusicGroupPaymentCalenderQueryInfo.java

@@ -0,0 +1,59 @@
+package com.ym.mec.biz.dal.page;
+
+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.common.page.QueryInfo;
+
+public class MusicGroupPaymentCalenderQueryInfo extends QueryInfo {
+	
+	private String musicGroupId;
+	
+	private PayUserType payUserType;
+
+	private MusicGroupPaymentCalender.PaymentType paymentType;
+	
+	private PaymentCalenderStatusEnum status;
+
+	private String organId;
+
+	public MusicGroupPaymentCalender.PaymentType getPaymentType() {
+		return paymentType;
+	}
+
+	public void setPaymentType(MusicGroupPaymentCalender.PaymentType paymentType) {
+		this.paymentType = paymentType;
+	}
+
+	public String getOrganId() {
+		return organId;
+	}
+
+	public void setOrganId(String organId) {
+		this.organId = organId;
+	}
+
+	public String getMusicGroupId() {
+		return musicGroupId;
+	}
+
+	public void setMusicGroupId(String musicGroupId) {
+		this.musicGroupId = musicGroupId;
+	}
+
+	public PayUserType getPayUserType() {
+		return payUserType;
+	}
+
+	public void setPayUserType(PayUserType payUserType) {
+		this.payUserType = payUserType;
+	}
+
+	public PaymentCalenderStatusEnum getStatus() {
+		return status;
+	}
+
+	public void setStatus(PaymentCalenderStatusEnum status) {
+		this.status = status;
+	}
+}

+ 42 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/OrganizationCourseUnitPriceSettingsQueryInfo.java

@@ -0,0 +1,42 @@
+package com.ym.mec.biz.dal.page;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
+import com.ym.mec.common.page.QueryInfo;
+
+public class OrganizationCourseUnitPriceSettingsQueryInfo extends QueryInfo {
+
+	@ApiModelProperty(value = "分部编号", required = false)
+	private Integer organId;
+
+	@ApiModelProperty(value = "课程类型", required = false)
+	private CourseScheduleType courseScheduleType;
+
+	@ApiModelProperty(value = "乐团收费类型编号", required = false)
+	private Integer chargeTypeId;
+
+	public Integer getOrganId() {
+		return organId;
+	}
+
+	public void setOrganId(Integer organId) {
+		this.organId = organId;
+	}
+
+	public CourseScheduleType getCourseScheduleType() {
+		return courseScheduleType;
+	}
+
+	public void setCourseScheduleType(CourseScheduleType courseScheduleType) {
+		this.courseScheduleType = courseScheduleType;
+	}
+
+	public Integer getChargeTypeId() {
+		return chargeTypeId;
+	}
+
+	public void setChargeTypeId(Integer chargeTypeId) {
+		this.chargeTypeId = chargeTypeId;
+	}
+}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/SellOrderQueryInfo.java

@@ -25,6 +25,8 @@ public class SellOrderQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "结束时间",required = false)
     private Date endTime;
 
+    @ApiModelProperty(value = "用户名称或编号",required = false)
+    private String userName;
 
     public String getOrganIdList() {
         return organIdList;
@@ -73,4 +75,12 @@ public class SellOrderQueryInfo extends QueryInfo {
     public void setCooperationOrganId(Integer cooperationOrganId) {
         this.cooperationOrganId = cooperationOrganId;
     }
+
+	public String getUserName() {
+		return userName;
+	}
+
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
 }

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentCompetitionQueryInfo.java

@@ -23,7 +23,7 @@ public class StudentCompetitionQueryInfo extends QueryInfo {
     private String subject;
 
     @ApiModelProperty(value = "分数")
-    private BigDecimal score;
+    private java.math.BigDecimal score;
 
     @ApiModelProperty(value = "获奖等级")
     private Integer prizeLevel;
@@ -34,7 +34,7 @@ public class StudentCompetitionQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "评价")
     private String comment;
 
-    private Date createTime;
+    private java.util.Date createTime;
 
     private Integer isReview;
 

+ 47 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentPaymentRouteOrderQueryInfo.java

@@ -0,0 +1,47 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.biz.dal.enums.AuditStatusEnum;
+import com.ym.mec.common.page.QueryInfo;
+
+public class StudentPaymentRouteOrderQueryInfo extends QueryInfo {
+
+	private String transNo;
+	
+	private String organId;
+	
+	private AuditStatusEnum auditStatus;
+	
+	private String type;//SERVICE、SELL
+
+	public String getTransNo() {
+		return transNo;
+	}
+
+	public void setTransNo(String transNo) {
+		this.transNo = transNo;
+	}
+
+	public String getOrganId() {
+		return organId;
+	}
+
+	public void setOrganId(String organId) {
+		this.organId = organId;
+	}
+
+	public AuditStatusEnum getAuditStatus() {
+		return auditStatus;
+	}
+
+	public void setAuditStatus(AuditStatusEnum auditStatus) {
+		this.auditStatus = auditStatus;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+}

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

@@ -0,0 +1,40 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+public class SysExamSongQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value = "上传人",required = true)
+    private Integer createUserId;
+
+    @ApiModelProperty(value = "声部",required = true)
+    private Integer subjectId;
+
+    @ApiModelProperty(value = "类型",required = true)
+    private String type;
+
+    public Integer getCreateUserId() {
+        return createUserId;
+    }
+
+    public void setCreateUserId(Integer createUserId) {
+        this.createUserId = createUserId;
+    }
+
+    public Integer getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Integer subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+}

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

@@ -1,8 +1,15 @@
 package com.ym.mec.biz.service;
 
+import java.util.List;
+
 import com.ym.mec.biz.dal.entity.ChargeTypeSubjectMapper;
 import com.ym.mec.common.service.BaseService;
 
 public interface ChargeTypeSubjectMapperService extends BaseService<Long, ChargeTypeSubjectMapper> {
 
+	boolean deleteById(Long id);
+	
+	boolean batchInsert(List<ChargeTypeSubjectMapper> chargeTypeSubjectMapperList);
+	
+	boolean batchUpdate(List<ChargeTypeSubjectMapper> chargeTypeSubjectMapperList);
 }

+ 21 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupService.java

@@ -2,6 +2,7 @@ package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.ClassGroup;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.SalarySettlementTypeEnum;
@@ -177,6 +178,14 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
      * @return
      */
     ClassGroup addStudent(ClassGroup classGroup, Integer userId, GroupType groupType);
+    
+    /**
+     * 添加学生到指定班级并排课
+     * @param studentId
+     * @param classGroupIdListStr
+     * @return
+     */
+    boolean addStudentToClassGroupAndCourseArranging(Integer studentId, String classGroupIdListStr, String batchNo, List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList);
 
     /**
      * 获取未分配合奏的单技班列表
@@ -265,21 +274,21 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
      * @param classGroup4MixDto
      * @return
      */
-    ClassGroup classGroupAdjust(ClassGroup4MixDto classGroup4MixDto) throws Exception;
+    ClassGroup classGroupAdjust(List<ClassGroup4MixDto> classGroup4MixDto);
 
     /**
      * 班级调整(修改班级)
-     * @param classGroup4MixDto
+     * @param classGroup4MixDtos
      * @return
      */
-    ClassGroup classGroupUpdate(ClassGroup4MixDto classGroup4MixDto) throws Exception;
+    ClassGroup classGroupUpdate(List<ClassGroup4MixDto> classGroup4MixDtos) throws Exception;
 
     /**
      * 班级调整(增加临时班级)
-     * @param classGroup4MixDto
+     * @param classGroup4MixDtos
      * @return
      */
-    ClassGroup classGroupSnap(ClassGroup4MixDto classGroup4MixDto) throws Exception;
+    ClassGroup classGroupSnap(List<ClassGroup4MixDto> classGroup4MixDtos) throws Exception;
 
 
     /**
@@ -438,4 +447,11 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
      * @describe 获取班级信息
      */
     TeacherClassHeadInfo findTeacherClassGroupInfoByCourseId(Integer courseId);
+    
+    /**
+     * 查询指定班级剩余未上课程类型的时长
+     * @param classGroupIdList
+     * @return
+     */
+    List<RemainCourseTypeDurationDto> queryRemainCourseTypeDuration(String classGroupIdList);
 }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupStudentMapperService.java

@@ -10,6 +10,7 @@ import com.ym.mec.common.service.BaseService;
 
 import java.io.IOException;
 import java.util.List;
+import java.util.Set;
 
 public interface ClassGroupStudentMapperService extends BaseService<Long, ClassGroupStudentMapper> {
 
@@ -78,4 +79,14 @@ public interface ClassGroupStudentMapperService extends BaseService<Long, ClassG
      */
     List<ClassGroupStudentInfoDto> findStudentByGroupOrClassGroup(String groupId, Integer classGroupId, GroupType groupType);
 
+    /**
+     * @describe 更新班级学员
+     * @author Joburgess
+     * @date 2020.11.04
+     * @param classGroupId:
+     * @param studentIds:
+     * @return void
+     */
+    void updateClassGroupStudents(Long classGroupId, Set<Integer> studentIds);
+
 }

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

@@ -1,10 +1,8 @@
 package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.dto.*;
-import com.ym.mec.biz.dal.entity.CourseGenerateDto;
-import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
-import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.TeachModeEnum;
@@ -603,6 +601,15 @@ public interface CourseScheduleService extends BaseService<Long, CourseSchedule>
 	void batchPracticeGroupTeacherAdjust(String practiceGroupId, Integer teacherId, Integer subjectId, Integer educationalTeacherId,Integer oldTeacherId);
 
 	/**
+	 * 获取课程调整时间轴
+	 * @author zouxuan
+	 * @param courseScheduleId
+	 * @return
+	 */
+	List<CourseScheduleModifyLog> queryCourseAdjustDetail(Long courseScheduleId);
+
+
+	/**
 	 * @describe 重叠课程查找
 	 * @author qnc99
 	 * @date 2020/11/25 0025

+ 29 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleStudentPaymentService.java

@@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.page.CourseScheduleQueryInfo;
 import com.ym.mec.biz.dal.page.CourseScheduleStudentPaymentQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
+import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.common.service.BaseService;
 import org.snaker.engine.access.Page;
 
@@ -62,6 +63,34 @@ public interface CourseScheduleStudentPaymentService extends BaseService<Long, C
 	void updateVipGiveCourse(Long vipGroupId);
 
 	/**
+	 * @describe 创建课程缴费记录-乐团
+	 * @author Joburgess
+	 * @date 2020.10.27
+	 * @param musicGroupId: 乐团编号
+	 * @param courseSchedules: 课程计划列表
+	 * @param studentIds: 课程学员列表
+	 * @return void
+	 */
+	void createForMusicGroup(String musicGroupId, List<CourseSchedule> courseSchedules, List<Integer> studentIds);
+
+	/**
+	 * @describe 根据缴费日历更新乐团课程学院课程价格
+	 * @author Joburgess
+	 * @date 2020.10.29
+	 * @param batchNo: 缴费日历批次号
+	 * @return void
+	 */
+	void updateForMusicGroupWithPaymentCalender(String batchNo);
+
+	/**
+	 * 获取班级未开始的的课程
+	 * @param classGroupIds
+	 * @return
+	 */
+	List<CourseScheduleStudentPayment> getClassGroupNoStartCourse(List<Integer> classGroupIds);
+
+	int deleteByMusicGroupId(String musicGroupId, GroupType music);
+	/**
 	 * @describe 查询课程上学员列表
 	 * @author Joburgess
 	 * @date 2020/11/17 0017

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

@@ -2,10 +2,13 @@ package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.dto.SubjectGoodsDto;
 import com.ym.mec.biz.dal.entity.GoodsCategory;
+import com.ym.mec.biz.dal.enums.AccountType;
 import com.ym.mec.biz.dal.page.GoodsCategoryQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 
+import java.util.List;
+
 public interface GoodsCategoryService extends BaseService<Integer, GoodsCategory> {
     /**
      * 新增、修改商品类型
@@ -26,4 +29,4 @@ public interface GoodsCategoryService extends BaseService<Integer, GoodsCategory
      * @param goodsIds
      */
     void updateSubjectGoods(Long subjectGoodsMapperId, String goodsIds);
-}
+}

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupOrganizationCourseSettingsDetailService.java

@@ -0,0 +1,11 @@
+package com.ym.mec.biz.service;
+
+import java.util.List;
+
+import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail;
+import com.ym.mec.common.service.BaseService;
+
+public interface MusicGroupOrganizationCourseSettingsDetailService extends BaseService<Integer, MusicGroupOrganizationCourseSettingsDetail> {
+
+	List<MusicGroupOrganizationCourseSettingsDetail> queryByMusicGroupOrganizationCourseSettingsId(Integer musicGroupOrganizationCourseSettingsId);
+}

+ 32 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupOrganizationCourseSettingsService.java

@@ -0,0 +1,32 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.common.service.BaseService;
+import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings;
+
+public interface MusicGroupOrganizationCourseSettingsService extends BaseService<Integer, MusicGroupOrganizationCourseSettings> {
+
+    /**
+     * 添加收费方式设置
+     *
+     * @param setting
+     * @return
+     */
+    MusicGroupOrganizationCourseSettings addSetting(MusicGroupOrganizationCourseSettings setting);
+
+    /**
+     * 删除收费方式设置
+     *
+     * @param id
+     * @return
+     */
+    MusicGroupOrganizationCourseSettings delSetting(Integer id);
+
+    /**
+     * 修改收费方式设置
+     *
+     * @param setting
+     * @return
+     */
+    MusicGroupOrganizationCourseSettings updateSetting(MusicGroupOrganizationCourseSettings setting);
+
+}

+ 21 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderCourseSettingsService.java

@@ -0,0 +1,21 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
+import com.ym.mec.common.service.BaseService;
+
+import java.util.List;
+import java.util.Map;
+
+public interface MusicGroupPaymentCalenderCourseSettingsService extends BaseService<Integer, MusicGroupPaymentCalenderCourseSettings> {
+
+    /**
+     * @describe 获取指定学员在指定乐团下本次课排课时长
+     * @author Joburgess
+     * @date 2020.11.02
+     * @param musicGroupId:
+     * @param studentIds:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings>
+     */
+    Map<String, Integer> getMusicCourseSettingsWithStudents(String musicGroupId, List<Integer> studentIds);
+
+}

+ 10 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderDetailService.java

@@ -1,14 +1,13 @@
 package com.ym.mec.biz.service;
 
+import java.math.BigDecimal;
+import java.util.List;
+
 import com.ym.mec.biz.dal.dto.FeeStudentDto;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
-import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.service.BaseService;
 
-import java.math.BigDecimal;
-import java.util.List;
-
 public interface MusicGroupPaymentCalenderDetailService extends BaseService<Long, MusicGroupPaymentCalenderDetail> {
 
     /**
@@ -46,6 +45,13 @@ public interface MusicGroupPaymentCalenderDetailService extends BaseService<Long
     void add(Long musicGroupPaymentCalenderId, Integer userId);
 
     /**
+     * 乐团缴费记录新增学员
+     * @param musicGroupPaymentCalenderId
+     * @param userIdList
+     */
+    void batchAdd(Long musicGroupPaymentCalenderId, List<Integer> userIdList);
+
+    /**
      * 获取fee表学员列表
      * @param musicGroupId
      * @return

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

@@ -1,22 +1,48 @@
 package com.ym.mec.biz.service;
 
+import java.util.List;
+import java.util.Map;
+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.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
-import com.ym.mec.biz.dal.page.MusicCalenderQueryInfo;
+import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 
-import java.util.Date;
-import java.util.List;
+import org.apache.ibatis.annotations.Param;
 
 public interface MusicGroupPaymentCalenderService extends BaseService<Long, MusicGroupPaymentCalender> {
-	
+
 	/**
 	 * 创建缴费信息
 	 * @param musicGroupPaymentCalender
 	 * @return
 	 */
-	boolean create(MusicGroupPaymentCalender musicGroupPaymentCalender);
+	Long create(MusicGroupPaymentCalender musicGroupPaymentCalender);
+	
+	/**
+	 * 获取明细
+	 * @param id
+	 * @return
+	 */
+	Object getDetail(Long id);
+	
+	/**
+	 * 更新缴费信息
+	 */
+	Long merge(MusicGroupPaymentCalender musicGroupPaymentCalender);
+	
+	/**
+	 * 
+	 * @param id
+	 * @param memo
+	 * @return
+	 */
+	boolean makesureSchoolePaid(Long id, String memo);
 	
 	/**
 	 * 自动更新付款日历记录状态
@@ -31,14 +57,6 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 	void batchInsert(List<MusicGroupPaymentCalender> musicGroupPaymentCalenders);
 
 	/**
-	 * 获取下次缴费时间
-	 * @param musicGroupId
-	 * @param latestPaidDate
-	 * @return
-	 */
-	Date getNextPaymentDate(String musicGroupId, Date latestPaidDate, MusicGroupStudentFee fee);
-
-	/**
 	 * 修改缴费日期
 	 * @param paymentCalender
 	 */
@@ -51,20 +69,6 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 	void del(Long id);
 
 	/**
-	 * 获取明细
-	 * @param id
-	 * @return
-	 */
-    Object getDetail(Long id);
-
-	/**
-	 * 获取列表
-	 * @param queryInfo
-	 * @return
-	 */
-	PageInfo<MusicGroupPaymentCalender> queryDetailPage(MusicCalenderQueryInfo queryInfo);
-
-	/**
 	 * 推送乐团缴费提醒
 	 * @param id
 	 * @param userIds
@@ -82,4 +86,79 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 	 * @return void
 	 */
 	void autoUpdateMusicGroupStudentFeeStatus();
+
+	/**
+	 * @describe 乐团缴费日历审核列表
+	 * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+	 * @author zouxuan
+	 * @date 2020/10/30
+	 * @time 10:45
+	 * @param pageInfo:
+	 * @return void
+	 */
+	PageInfo<MusicGroupPaymentCalenderAuditDto> auditList(MusicGroupPaymentCalenderQueryInfo pageInfo);
+
+	/**
+	 * @describe 乐团缴费日历审核列表详情
+	 * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+	 * @author zouxuan
+	 * @date 2020/10/30
+	 * @time 15:10
+	 * @param calenderId:
+	 * @return com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDetailDto
+	 */
+	MusicGroupPaymentCalenderAuditDetailDto auditListDetail(Long calenderId);
+
+	/**
+	 * @describe 审核通过
+	 * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+	 * @author zouxuan
+	 * @date 2020/10/30
+	 * @time 17:39
+	 * @param calenderId:
+	 * @return void
+	 */
+	void auditPass(Long calenderId,String auditMemo);
+
+	/**
+	 * @describe 审核拒绝
+	 * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+	 * @author zouxuan
+	 * @date 2020/10/30
+	 * @time 17:39
+	 * @param calenderId:
+	 * @return void
+	 */
+	void auditRefuse(Long calenderId,String auditMemo);
+
+	/**
+	 * 获取乐团报名的缴费日历
+	 * @param musicGroupId
+	 * @return
+	 */
+	MusicGroupPaymentCalender findByMusicGroupRegCalender(String musicGroupId);
+
+	/**
+	 * @describe 缴费成功后更新calender
+	 * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+	 * @author zouxuan
+	 * @date 2020/11/3
+	 * @time 17:04
+	 * @param detailId:
+	 * @param userId:
+	 * @return com.ym.mec.biz.dal.entity.MusicGroupStudentFee
+	 */
+    MusicGroupStudentFee updateCalender(Long detailId, Integer userId);
+
+	/**
+	 * @describe 推送学生待续费通知
+	 * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+	 * @author zouxuan
+	 * @date 2020/11/3
+	 * @time 17:04
+	 * @param calenderId:
+	 * @param musicGroup:
+	 * @return com.ym.mec.biz.dal.entity.MusicGroupStudentFee
+	 */
+	void pushWaitRenewMessage(Long calenderId, MusicGroup musicGroup);
 }

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

@@ -0,0 +1,8 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
+import com.ym.mec.common.service.BaseService;
+
+public interface MusicGroupPaymentStudentCourseDetailService extends BaseService<Long, MusicGroupPaymentStudentCourseDetail> {
+
+}

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

@@ -147,12 +147,12 @@ public interface MusicGroupService extends BaseService<String, MusicGroup> {
 
 	/**
 	 *  续费
-	 * @param musicGroupId 乐团编号
+	 * @param calenderId 缴费项目编号
 	 * @param userId 用户编号
 	 * @param isUseBalancePayment 是否使用余额付款
 	 * @return
 	 */
-	Map renew(String musicGroupId, Integer userId, boolean isUseBalancePayment) throws Exception;
+	Map renew(Long calenderId, Integer userId, boolean isUseBalancePayment) throws Exception;
 
 	/**
 	 * 学生支付订单

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

@@ -1,10 +1,9 @@
 package com.ym.mec.biz.service;
 
+import com.ym.mec.biz.dal.dto.MusicGroupGoodsAndDiscountDto;
 import com.ym.mec.biz.dal.dto.MusicGroupRegRespDto;
 import com.ym.mec.biz.dal.dto.MusicGroupSubjectGoodsAndInfoDto;
-import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
-import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
-import com.ym.mec.biz.dal.entity.StudentRegistration;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.common.service.BaseService;
 
 import java.util.List;
@@ -74,4 +73,14 @@ public interface MusicGroupSubjectPlanService extends BaseService<Integer, Music
      * @return
      */
     MusicGroupSubjectGoodsAndInfoDto getStudentGoodsAndInfo(String musicGroupId, Integer subjectId, StudentRegistration studentRegistration);
-}
+
+
+    /**
+     * 获取声部的乐器、辅件(包含折扣)
+     * @param subjectId
+     * @param type
+     * @param chargeTypeId
+     * @return
+     */
+    List<MusicGroupGoodsAndDiscountDto> getSubjectGoods(Integer subjectId, String type, Integer chargeTypeId);
+}

+ 26 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/OrganizationCourseUnitPriceSettingsService.java

@@ -0,0 +1,26 @@
+package com.ym.mec.biz.service;
+
+import java.util.List;
+
+import com.ym.mec.biz.dal.entity.OrganizationCourseUnitPriceSettings;
+import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
+import com.ym.mec.common.service.BaseService;
+
+public interface OrganizationCourseUnitPriceSettingsService extends BaseService<Integer, OrganizationCourseUnitPriceSettings> {
+
+	/**
+	 * 批量新增
+	 * @param organizationCourseUnitPriceSettingsList
+	 * @return
+	 */
+	boolean batchInsert(List<OrganizationCourseUnitPriceSettings> organizationCourseUnitPriceSettingsList);
+
+	/**
+	 * 根据分部编号以及课程类型查询对象
+	 * @param organId 分部编号
+	 * @param courseType 课程类型
+	 * @param chargeTypeId 收费类型编号
+	 * @return
+	 */
+	OrganizationCourseUnitPriceSettings queryByOrganIdAndCourseTypeAndChargeType(Integer organId, CourseScheduleType courseType, Integer chargeTypeId);
+}

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

@@ -193,5 +193,5 @@ public interface StudentManageService {
      * @param musicGroupPaymentCalenderId
      * @return
      */
-    List<BasicUserDto> queryCanAddStudent(String musicGroupId, Long musicGroupPaymentCalenderId);
+    List<BasicUserDto> queryCanAddStudent(String musicGroupId, Long musicGroupPaymentCalenderId,String search,Integer subjectId);
 }

+ 41 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentRouteOrderService.java

@@ -1,25 +1,55 @@
 package com.ym.mec.biz.service;
 
 
+import java.math.BigDecimal;
+import java.util.List;
+
 import com.ym.mec.biz.dal.dto.PageInfoOrder;
 import com.ym.mec.biz.dal.dto.StudentPaymentRouteOrderDto;
 import com.ym.mec.biz.dal.entity.StudentPaymentRouteOrder;
+import com.ym.mec.biz.dal.enums.AuditStatusEnum;
 import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
+import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.BaseService;
-
-import java.math.BigDecimal;
+import org.springframework.web.multipart.MultipartFile;
 
 
 public interface StudentPaymentRouteOrderService extends BaseService<Long, StudentPaymentRouteOrder> {
+	
+	/**
+	 * 查询审核列表
+	 * @param queryInfo
+	 * @return
+	 */
+	PageInfo<StudentPaymentRouteOrder> queryAuditList(QueryInfo queryInfo);
 
 	PageInfoOrder<StudentPaymentRouteOrderDto> OrderQueryPage(StudentPaymentOrderQueryInfo queryInfo);
 
 	/**
 	 * 添加外部订单
-	 * @param studentPaymentRouteOrderDto
+	 * @param studentPaymentRouteOrder
+	 * @return
+	 */
+	StudentPaymentRouteOrder addOutOrder(StudentPaymentRouteOrder studentPaymentRouteOrder);
+	
+	/**
+	 * 更新外部订单
+	 * @param studentPaymentRouteOrder
+	 * @return
+	 */
+	StudentPaymentRouteOrder updateOutOrder(StudentPaymentRouteOrder studentPaymentRouteOrder);
+	
+	/**
+	 * 审核外部订单
+	 * @param studentPaymentRouteOrderId
+	 * @param auditStatus
+	 * @param memo
+	 * @param operatorId
 	 * @return
 	 */
-	StudentPaymentRouteOrderDto addOutOrder(StudentPaymentRouteOrderDto studentPaymentRouteOrderDto);
+	boolean auditOutOrder(Long studentPaymentRouteOrderId,AuditStatusEnum auditStatus,String memo,Integer operatorId);
 
 	/**
 	 * 添加分润订单
@@ -37,4 +67,11 @@ public interface StudentPaymentRouteOrderService extends BaseService<Long, Stude
 	 */
 	Boolean deleteRouteOrder(Long orderId);
 
+	/**
+	 * 财务管理订单导入
+	 * @author zouxuan
+	 * @param file
+	 * @return
+	 */
+	HttpResponseResult<List<StudentPaymentRouteOrder>> importRouteOrder(MultipartFile file) throws Exception;
 }

+ 282 - 251
mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java

@@ -14,257 +14,288 @@ import java.util.Map;
 
 public interface StudentRegistrationService extends BaseService<Long, StudentRegistration> {
 
-	/**
-	 * 获取乐团学员报名详情
-	 *
-	 * @param queryInfo
-	 * @return
-	 */
-	PageInfo<StudentApplyDetailDto> queryStudentDetailPage(StudentRegistrationQueryInfo queryInfo);
-
-	/**
-	 * 批量调剂
-	 *
-	 * @param userId
-	 * @param subId
-	 * @return
-	 */
-	Integer batchUpdateSubject(Integer userId, Integer subId,String musicGroupId) throws Exception;
-
-	/**
-	 * 学生报名缴费金额详情
-	 *
-	 * @param studentId
-	 * @param musicGroupId
-	 * @return
-	 */
-	StudentFeeDetailDto queryFeeDetail(Integer studentId, String musicGroupId);
-
-	/**
-	 * 获取未分配的班级的学生
-	 *
-	 * @param musicGroupId    乐团id
-	 * @param actualSubjectId 科目id
-	 * @return
-	 */
-	List<Map<String,Object>> getNoClassStuBySubjectId(String musicGroupId, String actualSubjectId);
-
-	/**
-	 * 获取乐团声部未分配学生统计
-	 *
-	 * @param musicGroupId
-	 * @return
-	 */
-	List<MusicGroupSubjectPlan> getNoClassStuCountByMusicGroupId(String musicGroupId);
-
-	/**
-	 * 根据user_id 和 乐团id更新
-	 *
-	 * @param studentRegistration
-	 * @return
-	 */
-	Integer updateByUserIdAndMusicGroupId(StudentRegistration studentRegistration);
-
-	/**
-	 * 添加学生报名信息
-	 * @param studentRegistration
-	 * @return
-	 */
-	StudentRegistration addStudent(StudentRegistration studentRegistration) throws Exception;
-
-	/**
-	 * 查询学生信息
-	 * @param userId
-	 * @return
-	 */
-	StudentInfo queryStudentInfo(Integer userId);
-
-	/**
-	 * 学生注册缴费订单
-	 * @param studentRegistration
-	 * @param amount
-	 * @param courseFee
-	 * @param goodsGroups
-	 * @param goodsList
-	 * @return
-	 */
-	StudentPaymentOrder addOrder(StudentRegistration studentRegistration, BigDecimal amount, String orderNo, String paymentChannel, BigDecimal courseFee,
-			List<MusicGroupSubjectGoodsGroup> goodsGroups, List<Goods> goodsList, List<Goods> otherGoodsList,List<CourseFormDto> courseForms,
-								 BigDecimal remitFee,BigDecimal courseRemitFee) throws Exception;
-
-	/**
-	 * 学生注册缴费重新下订单
-	 * @param userId
-	 * @param amount
-	 * @param courseFee
-	 * @param goodsGroups
-	 * @param goodsList
-	 * @return
-	 */
-	StudentPaymentOrder reAddOrder(
-			Integer userId, BigDecimal amount, String orderNo, String paymentChannel, BigDecimal courseFee,
-			List<MusicGroupSubjectGoodsGroup> goodsGroups, List<Goods> goodsList, List<Goods> otherGoodsList,
-			String musicGroupId,StudentPaymentOrder oldOrder,List<CourseFormDto> courseForms,BigDecimal remitFee,BigDecimal courseRemitFee);
-
-	/**
-	 * 查询用户指定乐团的报名信息
-	 * @param userId 用户编号
-	 * @param musicGroupId 乐团编号
-	 * @return
-	 */
-	StudentRegistration queryByUserIdAndMusicGroupId(Integer userId, String musicGroupId);
-
-	/**
-	 * 根据乐团id,手机查询乐团注册信息
-	 * @param musicGroupId
-	 * @param parentsPhone
-	 * @return
-	 */
-	StudentRegistration getByPhoneAndMusicGroupId(String musicGroupId, String parentsPhone);
-
-	/**
-	 * 乐团插入新学员
-	 * @param studentAddDto
-	 * @return
-	 */
+    /**
+     * 获取乐团学员报名详情
+     *
+     * @param queryInfo
+     * @return
+     */
+    PageInfo<StudentApplyDetailDto> queryStudentDetailPage(StudentRegistrationQueryInfo queryInfo);
+
+    /**
+     * 批量调剂
+     *
+     * @param userId
+     * @param subId
+     * @return
+     */
+    Integer batchUpdateSubject(Integer userId, Integer subId, String musicGroupId) throws Exception;
+
+    /**
+     * 学生报名缴费金额详情
+     *
+     * @param studentId
+     * @param musicGroupId
+     * @return
+     */
+    StudentFeeDetailDto queryFeeDetail(Integer studentId, String musicGroupId);
+
+    /**
+     * 获取未分配的班级的学生
+     *
+     * @param musicGroupId    乐团id
+     * @param actualSubjectId 科目id
+     * @return
+     */
+    List<Map<String, Object>> getNoClassStuBySubjectId(String musicGroupId, String actualSubjectId);
+
+    /**
+     * 获取乐团声部未分配学生统计
+     *
+     * @param musicGroupId
+     * @return
+     */
+    List<MusicGroupSubjectPlan> getNoClassStuCountByMusicGroupId(String musicGroupId);
+
+    /**
+     * 根据user_id 和 乐团id更新
+     *
+     * @param studentRegistration
+     * @return
+     */
+    Integer updateByUserIdAndMusicGroupId(StudentRegistration studentRegistration);
+
+    /**
+     * 添加学生报名信息
+     *
+     * @param studentRegistration
+     * @return
+     */
+    StudentRegistration addStudent(StudentRegistration studentRegistration) throws Exception;
+
+    /**
+     * 查询学生信息
+     *
+     * @param userId
+     * @return
+     */
+    StudentInfo queryStudentInfo(Integer userId);
+
+    /**
+     * 学生注册缴费订单
+     *
+     * @param studentRegistration
+     * @param amount
+     * @param courseFee
+     * @param goodsGroups
+     * @param goodsList
+     * @return
+     */
+    StudentPaymentOrder addOrder(StudentRegistration studentRegistration, BigDecimal amount, String orderNo, String paymentChannel, BigDecimal courseFee,
+                                 List<MusicGroupSubjectGoodsGroup> goodsGroups, List<Goods> goodsList, List<Goods> otherGoodsList, List<CourseFormDto> courseForms,
+                                 BigDecimal remitFee, BigDecimal courseRemitFee, List<MusicGroupPaymentCalenderCourseSettings> newCourses) throws Exception;
+
+    /**
+     * 学生注册缴费重新下订单
+     *
+     * @param userId
+     * @param amount
+     * @param courseFee
+     * @param goodsGroups
+     * @param goodsList
+     * @return
+     */
+    StudentPaymentOrder reAddOrder(
+            Integer userId, BigDecimal amount, String orderNo, String paymentChannel, BigDecimal courseFee,
+            List<MusicGroupSubjectGoodsGroup> goodsGroups, List<Goods> goodsList, List<Goods> otherGoodsList,
+            String musicGroupId, StudentPaymentOrder oldOrder, List<CourseFormDto> courseForms, BigDecimal remitFee, BigDecimal courseRemitFee, List<MusicGroupPaymentCalenderCourseSettings> newCourses) throws Exception;
+
+    /**
+     * 查询用户指定乐团的报名信息
+     *
+     * @param userId       用户编号
+     * @param musicGroupId 乐团编号
+     * @return
+     */
+    StudentRegistration queryByUserIdAndMusicGroupId(Integer userId, String musicGroupId);
+
+    /**
+     * 根据乐团id,手机查询乐团注册信息
+     *
+     * @param musicGroupId
+     * @param parentsPhone
+     * @return
+     */
+    StudentRegistration getByPhoneAndMusicGroupId(String musicGroupId, String parentsPhone);
+
+    /**
+     * 乐团插入新学员
+     *
+     * @param studentAddDto
+     * @return
+     */
     Integer insertStudent(StudentAddDto studentAddDto) throws Exception;
 
-	/**
-	 * 获取班级学生
-	 * @param musicGroupId
-	 * @param classGroupId
-	 * @return
-	 */
-	List<StudentRegistration> findClassGroupStu(String musicGroupId, Integer classGroupId);
-
-
-	/**
-	 * 更新报名订单
-	 * @param studentPaymentOrder
-	 * @return
-	 */
-	StudentPaymentOrder updateApplyOrder(StudentPaymentOrder studentPaymentOrder) throws Exception;
-
-	/**
-	 * 获取乐团科目的学生
-	 *
-	 * @param musicGroupId    乐团id
-	 * @param actualSubjectId 科目id
-	 * @return
-	 */
-	List<StudentRegistration> findMusicGroupNoClassGroupStudent(String musicGroupId, Integer actualSubjectId);
-
-	/**
-	 * 根据id list 查询报名学生
-	 * @param idList
-	 * @return
-	 */
-	List<StudentRegistration> findStudentListByIdList(List<Long> idList);
-
-	/**
-	 * 批量插入
-	 * @param studentRegistrationList
-	 * @return
-	 */
-	int batchInsert(List<StudentRegistration> studentRegistrationList);
-
-
-	/**
-	 * 根据userId 和班级id查询学生
-	 * @param userId
-	 * @param classGroupId
-	 * @return
-	 */
-	StudentRegistration findStudentByClassGroupIdAndUserId(Integer userId, Integer classGroupId);
-
-
-
-	/**
-	 * 查询乐团声部下的学生
-	 * @return
-	 */
-	List<StudentRegistration> findMusicGroupStudent(String musicGroupId,Integer actualSubjectId);
-
-	/**
-	 * 查询乐团userIdList的学生
-	 * @param musicGroupId
-	 * @param userIdList
-	 * @return
-	 */
-	List<StudentRegistration> findStudentListByUserIdList(String musicGroupId, List<Integer> userIdList);
-
-	/**
-	 * 开启缴费
-	 * @param ids
-	 * @return
-	 */
-	int openPayment(String ids) throws IOException;
-
-	/**
-	 * 根据乐团编号获取已缴费学员列表
-	 * @param musicGroupId
-	 * @return
-	 */
-	List<StudentRegistration> queryStudentByMusicGroupId(String musicGroupId);
-
-	/**
-	 * 根据家长的手机号列表,获取用户编号
-	 * @param parentPhones
-	 * @return
-	 */
-	List<Map<Integer,String>> findParentId(String parentPhones);
-
-	/**
-	 * 更新用户注册信息
-	 * @param studentRegistration
-	 * @return
-	 */
-	StudentRegistration updateStudent(StudentRegistration studentRegistration);
-
-	/**
-	 * 获取学员基本信息
-	 * @param mobile
-	 * @return
-	 */
-	StudentRegistration queryUserByPhone(String mobile);
-
-	/**
-	 * 获取没有某种班级类型的学生
-	 * @param musicGroupId
-	 * @param type
-	 * @param subjectId
-	 * @return
-	 */
-	List<StudentRegistration> findMusicGroupStuNoClassType(String musicGroupId, ClassGroupTypeEnum type, Integer subjectId);
-
-	/**
-	 * 获取乐团下所有学员身上的声部列表
-	 * @param musicGroupId
-	 * @return
-	 */
-	List<Subject> findMusicGroupAllStudentSubjects(String musicGroupId);
-
-	/**
-	 * 获取学员详情页,包含所在乐团信息
-	 * @param studentId
-	 * @return
-	 */
-	StudentMusicDetailDto getStudentDetail(Integer studentId);
-
-	/**
-	 * 获取学生
-	 * @param studentId
-	 * @param musicGroupId
-	 * @return
-	 */
-	List<StudentPaymentOrderDetail> getStudentApplyDetail(Integer studentId,String musicGroupId);
-
-	/**
-	 * 更换学生声部
-	 * @param musicGroup
-	 * @param originalSubjectId
-	 * @param changeSubjectId
-	 * @return
-	 */
-	StudentRegistration changeStudentSubject(Integer studentId,String musicGroupId,Integer originalSubjectId,Integer changeSubjectId);
+    /**
+     * 获取班级学生
+     *
+     * @param musicGroupId
+     * @param classGroupId
+     * @return
+     */
+    List<StudentRegistration> findClassGroupStu(String musicGroupId, Integer classGroupId);
+
+
+    /**
+     * 更新报名订单
+     *
+     * @param studentPaymentOrder
+     * @return
+     */
+    StudentPaymentOrder updateApplyOrder(StudentPaymentOrder studentPaymentOrder) throws Exception;
+
+    /**
+     * 获取乐团科目的学生
+     *
+     * @param musicGroupId    乐团id
+     * @param actualSubjectId 科目id
+     * @return
+     */
+    List<StudentRegistration> findMusicGroupNoClassGroupStudent(String musicGroupId, Integer actualSubjectId);
+
+    /**
+     * 根据id list 查询报名学生
+     *
+     * @param idList
+     * @return
+     */
+    List<StudentRegistration> findStudentListByIdList(List<Long> idList);
+
+    /**
+     * 批量插入
+     *
+     * @param studentRegistrationList
+     * @return
+     */
+    int batchInsert(List<StudentRegistration> studentRegistrationList);
+
+
+    /**
+     * 根据userId 和班级id查询学生
+     *
+     * @param userId
+     * @param classGroupId
+     * @return
+     */
+    StudentRegistration findStudentByClassGroupIdAndUserId(Integer userId, Integer classGroupId);
+
+
+    /**
+     * 查询乐团声部下的学生
+     *
+     * @return
+     */
+    List<StudentRegistration> findMusicGroupStudent(String musicGroupId, Integer actualSubjectId);
+
+    /**
+     * 查询乐团userIdList的学生
+     *
+     * @param musicGroupId
+     * @param userIdList
+     * @return
+     */
+    List<StudentRegistration> findStudentListByUserIdList(String musicGroupId, List<Integer> userIdList);
+
+    /**
+     * 开启缴费
+     *
+     * @param ids
+     * @return
+     */
+    int openPayment(String ids) throws IOException;
+
+    /**
+     * 根据乐团编号获取已缴费学员列表
+     *
+     * @param musicGroupId
+     * @return
+     */
+    List<StudentRegistration> queryStudentByMusicGroupId(String musicGroupId);
+
+    /**
+     * 根据家长的手机号列表,获取用户编号
+     *
+     * @param parentPhones
+     * @return
+     */
+    List<Map<Integer, String>> findParentId(String parentPhones);
+
+    /**
+     * 更新用户注册信息
+     *
+     * @param studentRegistration
+     * @return
+     */
+    StudentRegistration updateStudent(StudentRegistration studentRegistration);
+
+    /**
+     * 获取学员基本信息
+     *
+     * @param mobile
+     * @return
+     */
+    StudentRegistration queryUserByPhone(String mobile);
+
+    /**
+     * 获取没有某种班级类型的学生
+     *
+     * @param musicGroupId
+     * @param type
+     * @param subjectId
+     * @return
+     */
+    List<StudentRegistration> findMusicGroupStuNoClassType(String musicGroupId, ClassGroupTypeEnum type, Integer subjectId);
+
+    /**
+     * 获取乐团下所有学员身上的声部列表
+     *
+     * @param musicGroupId
+     * @return
+     */
+    List<Subject> findMusicGroupAllStudentSubjects(String musicGroupId);
+
+    /**
+     * 获取学员详情页,包含所在乐团信息
+     *
+     * @param studentId
+     * @return
+     */
+    StudentMusicDetailDto getStudentDetail(Integer studentId);
+
+    /**
+     * 获取学生
+     *
+     * @param studentId
+     * @param musicGroupId
+     * @return
+     */
+    List<StudentPaymentOrderDetail> getStudentApplyDetail(Integer studentId, String musicGroupId);
+
+    /**
+     * 更换学生声部
+     *
+     * @param musicGroup
+     * @param originalSubjectId
+     * @param changeSubjectId
+     * @return
+     */
+    StudentRegistration changeStudentSubject(Integer studentId, String musicGroupId, Integer originalSubjectId, Integer changeSubjectId);
+
+
+    /**
+     * 获取班级未上课程的价值
+     * @param classGroupIds
+     * @return
+     */
+    BigDecimal getClassGroupCourseExpectPrice(List<Integer> classGroupIds);
 }

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

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

+ 4 - 16
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ChargeTypeServiceImpl.java

@@ -1,21 +1,17 @@
 package com.ym.mec.biz.service.impl;
 
-import com.ym.mec.biz.dal.dao.ChargeTypeSubjectMapperDao;
-import com.ym.mec.biz.dal.entity.ChargeTypeSubjectMapper;
-import com.ym.mec.common.page.PageInfo;
-import com.ym.mec.common.page.QueryInfo;
+import java.util.Date;
+
 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.ChargeTypeDao;
+import com.ym.mec.biz.dal.dao.ChargeTypeSubjectMapperDao;
 import com.ym.mec.biz.dal.entity.ChargeType;
 import com.ym.mec.biz.service.ChargeTypeService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.Date;
-import java.util.List;
 
 @Service
 public class ChargeTypeServiceImpl extends BaseServiceImpl<Integer, ChargeType>  implements ChargeTypeService {
@@ -38,23 +34,15 @@ public class ChargeTypeServiceImpl extends BaseServiceImpl<Integer, ChargeType>
 			//修改
 			chargeType.setUpdateTime(new Date());
 			chargeTypeDao.update(chargeType);
-			//删除关联的声部
-			chargeTypeSubjectMapperDao.deleteByChargeTypeId(chargeType.getId());
-			//批量插入关联的声部
-			chargeTypeSubjectMapperDao.batchAdd(chargeType.getSubjectIds(),chargeType.getId());
 		}else {
 			//新增
 			chargeTypeDao.insert(chargeType);
-			//批量插入关联的声部
-			chargeTypeSubjectMapperDao.batchAdd(chargeType.getSubjectIds(),chargeType.getId());
 		}
 	}
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void del(Integer chargeTypeId) {
-		//删除关联的声部
-		chargeTypeSubjectMapperDao.deleteByChargeTypeId(chargeTypeId);
 		chargeTypeDao.delete(chargeTypeId);
 	}
 }

+ 36 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ChargeTypeSubjectMapperServiceImpl.java

@@ -1,5 +1,8 @@
 package com.ym.mec.biz.service.impl;
 
+import java.util.List;
+
+import com.ym.mec.common.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -10,14 +13,37 @@ import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 
 @Service
-public class ChargeTypeSubjectMapperServiceImpl extends BaseServiceImpl<Long, ChargeTypeSubjectMapper>  implements ChargeTypeSubjectMapperService {
-	
-	@Autowired
-	private ChargeTypeSubjectMapperDao chargeTypeSubjectMapperDao;
-
-	@Override
-	public BaseDAO<Long, ChargeTypeSubjectMapper> getDAO() {
-		return chargeTypeSubjectMapperDao;
-	}
-	
+public class ChargeTypeSubjectMapperServiceImpl extends BaseServiceImpl<Long, ChargeTypeSubjectMapper> implements ChargeTypeSubjectMapperService {
+
+    @Autowired
+    private ChargeTypeSubjectMapperDao chargeTypeSubjectMapperDao;
+
+    @Override
+    public BaseDAO<Long, ChargeTypeSubjectMapper> getDAO() {
+        return chargeTypeSubjectMapperDao;
+    }
+
+    @Override
+    public boolean deleteById(Long id) {
+        chargeTypeSubjectMapperDao.delete(id);
+        return true;
+    }
+
+    @Override
+    public boolean batchInsert(List<ChargeTypeSubjectMapper> chargeTypeSubjectMapperList) {
+        ChargeTypeSubjectMapper subjectDiscount = chargeTypeSubjectMapperDao.getSubjectDiscount(chargeTypeSubjectMapperList.get(0).getChargeTypeId(), chargeTypeSubjectMapperList.get(0).getSubjectId());
+        if (subjectDiscount != null) {
+            throw new BizException("此声部商品折扣已添加");
+        }
+
+        chargeTypeSubjectMapperDao.batchInsert(chargeTypeSubjectMapperList);
+        return true;
+    }
+
+    @Override
+    public boolean batchUpdate(List<ChargeTypeSubjectMapper> chargeTypeSubjectMapperList) {
+        chargeTypeSubjectMapperDao.batchUpdate(chargeTypeSubjectMapperList);
+        return true;
+    }
+
 }

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 515 - 228
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java


+ 170 - 23
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupStudentMapperServiceImpl.java

@@ -2,33 +2,19 @@ package com.ym.mec.biz.service.impl;
 
 import java.io.IOException;
 import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
+import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.entity.*;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 
 import com.alibaba.fastjson.JSON;
-import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
-import com.ym.mec.biz.dal.dao.CourseScheduleTeacherSalaryDao;
-import com.ym.mec.biz.dal.dao.StudentDao;
 import com.ym.mec.biz.dal.dto.ClassGroupStudentInfoDto;
-import com.ym.mec.biz.dal.entity.ClassGroup;
-import com.ym.mec.biz.dal.entity.ClassGroupRelation;
-import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
-import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
-import com.ym.mec.biz.dal.entity.CourseSchedule;
-import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
-import com.ym.mec.biz.dal.entity.CourseScheduleTeacherSalary;
-import com.ym.mec.biz.dal.entity.StudentRegistration;
-import com.ym.mec.biz.dal.entity.TeacherDefaultMusicGroupSalary;
 import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
@@ -49,6 +35,7 @@ import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.im.ImFeignService;
 import com.ym.mec.util.http.HttpUtil;
+import org.springframework.util.CollectionUtils;
 
 @Service
 public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, ClassGroupStudentMapper> implements ClassGroupStudentMapperService {
@@ -78,6 +65,10 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
     private TeacherDefaultMusicGroupSalaryService teacherDefaultMusicGroupSalaryService;
     @Autowired
     private StudentDao studentDao;
+    @Autowired
+    private CourseScheduleDao courseScheduleDao;
+    @Autowired
+    private ClassGroupDao classGroupDao;
 
     private static String holidayUrl = "http://tool.bitefu.net/jiari/?d=";
 
@@ -96,9 +87,9 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
     public boolean delClassGroupStudent(Integer userId, Integer classGroupId,Boolean quitMusicGroup) {
         ClassGroup classGroup = classGroupService.get(classGroupId);
         Integer studentNum = classGroupStudentMapperDao.countClassGroupNormalStudentNum(classGroupId);
-        if (!quitMusicGroup && classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) && studentNum <= 3) {
+        /*if (!quitMusicGroup && classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) && studentNum <= 3) {
             throw new BizException(classGroup.getName()+"(网络基础训练课班级)人数不能少于3,请调整");
-        }
+        }*/
 
         ClassGroupStudentMapper classStudentMapper = findClassStudentMapperByUserIdAndClassGroupId(userId, classGroupId, "NORMAL");
         if (classStudentMapper == null) {
@@ -124,7 +115,7 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
 
         //4、调整未上课课酬
         List<ClassGroupTeacherMapper> classGroupTeachers = classGroupTeacherMapperService.getClassGroupTeachers(classGroupId);
-        if (classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) && courseScheduleList.size() > 0) {
+        if ((classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE) || classGroup.getType().equals(ClassGroupTypeEnum.HIGH)) && courseScheduleList.size() > 0) {
             studentNum -= 1;
             Date nowDate = new Date();
             List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaryList = new ArrayList<>();
@@ -137,7 +128,10 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
                         throw new BizException("请设置老师线上网管课课酬");
                     }
                     Map<CourseSchedule.CourseScheduleType, TeacherDefaultMusicGroupSalary> collect = teacherSalaryList.stream().collect(Collectors.toMap(TeacherDefaultMusicGroupSalary::getCourseScheduleType, teacherDefaultMusicGroupSalary -> teacherDefaultMusicGroupSalary));
-                    TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary = collect.get(courseSchedule.getType());
+                    TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary = collect.get(CourseSchedule.CourseScheduleType.HIGH_ONLINE);
+                    if(studentNum>5){
+                        studentNum=5;
+                    }
                     BigDecimal salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum.toString());
 
                     CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
@@ -303,6 +297,9 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
                     }
                     Map<CourseSchedule.CourseScheduleType, TeacherDefaultMusicGroupSalary> collect = teacherSalaryList.stream().collect(Collectors.toMap(TeacherDefaultMusicGroupSalary::getCourseScheduleType, teacherDefaultMusicGroupSalary -> teacherDefaultMusicGroupSalary));
                     TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary = collect.get(courseSchedule.getType());
+                    if(studentNum>5){
+                        studentNum=5;
+                    }
                     BigDecimal salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum.toString());
 
                     CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
@@ -355,4 +352,154 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
     public List<ClassGroupStudentInfoDto> findStudentByGroupOrClassGroup(String groupId, Integer classGroupId, GroupType groupType) {
         return classGroupStudentMapperDao.findByGroupOrClassGroup(groupId, groupType, classGroupId);
     }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
+    public void updateClassGroupStudents(Long classGroupId, Set<Integer> studentIds) {
+        ClassGroup classGroup = classGroupDao.lockClassGroup(classGroupId.intValue());
+        if(Objects.isNull(classGroup)){
+            throw new BizException("班级信息错误");
+        }
+
+        if(ClassGroupTypeEnum.MUSIC_NETWORK.equals(classGroup.getType())){
+            String subjectName = classGroup.getName().split("•")[0];
+            List<String> studentNames = studentDao.getStudentNames(new ArrayList<>(studentIds));
+            classGroup.setName(subjectName + "•" + studentNames);
+        }
+
+        List<ClassGroupStudentMapper> classGroupStudents = classGroupStudentMapperDao.findAllByClassGroup(classGroupId);
+
+        Set<Integer> allStudentIds = new HashSet<>();
+        Set<Integer> oldStudentIds = new HashSet<>();
+        Set<Integer> oldNormalStudentIds = new HashSet<>();
+        Set<Integer> addStudentIds;
+        Set<Integer> removeStudentIds;
+
+        if(!CollectionUtils.isEmpty(studentIds)){
+            allStudentIds = studentIds;
+        }
+
+        if(!CollectionUtils.isEmpty(classGroupStudents)){
+            oldStudentIds = classGroupStudents.stream().map(ClassGroupStudentMapper::getUserId).collect(Collectors.toSet());
+            oldNormalStudentIds = classGroupStudents.stream().filter(s -> ClassGroupStudentStatusEnum.NORMAL.equals(s.getStatus())).map(ClassGroupStudentMapper::getUserId).collect(Collectors.toSet());
+        }
+
+        Set<Integer> repeatStudentIds = allStudentIds.stream().filter(oldNormalStudentIds::contains).collect(Collectors.toSet());
+        addStudentIds = allStudentIds.stream().filter(id -> !repeatStudentIds.contains(id)).collect(Collectors.toSet());
+        removeStudentIds = oldNormalStudentIds.stream().filter(id -> !repeatStudentIds.contains(id)).collect(Collectors.toSet());
+
+        List<ClassGroupStudentMapper> needUpdateClassGroupStudents = new ArrayList<>();
+
+        for (ClassGroupStudentMapper classGroupStudent : classGroupStudents) {
+            if(addStudentIds.contains(classGroupStudent.getUserId())&&!classGroupStudent.getStatus().equals(ClassGroupStudentStatusEnum.NORMAL)){
+                classGroupStudent.setStatus(ClassGroupStudentStatusEnum.NORMAL);
+            }else if(removeStudentIds.contains(classGroupStudent.getUserId())&&!classGroupStudent.getStatus().equals(ClassGroupStudentStatusEnum.QUIT)){
+                classGroupStudent.setStatus(ClassGroupStudentStatusEnum.QUIT);
+            }else{
+                continue;
+            }
+            needUpdateClassGroupStudents.add(classGroupStudent);
+        }
+
+        if(!CollectionUtils.isEmpty(needUpdateClassGroupStudents)){
+            classGroupStudentMapperDao.batchUpdate(needUpdateClassGroupStudents);
+        }
+
+        Date now = new Date();
+        List<ClassGroupStudentMapper> classGroupStudentMappers = new ArrayList<>();
+        for (Integer addStudentId : addStudentIds) {
+            if(oldStudentIds.contains(addStudentId)){
+                continue;
+            }
+            ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
+            classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
+            classGroupStudentMapper.setClassGroupId(classGroupId.intValue());
+            classGroupStudentMapper.setUserId(addStudentId);
+            classGroupStudentMapper.setCreateTime(now);
+            classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
+            classGroupStudentMapper.setGroupType(GroupType.MUSIC);
+            classGroupStudentMappers.add(classGroupStudentMapper);
+        }
+
+        if (classGroupStudentMappers.size() > 0) {
+            classGroupStudentMapperDao.classGroupStudentsInsert(classGroupStudentMappers);
+        }
+
+        classGroupService.updateClassStudentNum(classGroupId.intValue(), allStudentIds.size());
+
+        List<CourseSchedule> classGroupNotStartCourse = courseScheduleDao.getClassGroupNotStartCourse(classGroupId);
+        if(CollectionUtils.isEmpty(classGroupNotStartCourse)){
+            return;
+        }
+
+        if(ClassGroupTypeEnum.MUSIC_NETWORK.equals(classGroup.getType())){
+            for (CourseSchedule courseSchedule : classGroupNotStartCourse) {
+                courseSchedule.setName(classGroup.getName());
+            }
+            courseScheduleDao.batchUpdate(classGroupNotStartCourse);
+        }
+
+        List<Long> courseIds = classGroupNotStartCourse.stream().map(CourseSchedule::getId).collect(Collectors.toList());
+
+        //4、调整未上课课酬
+        List<ClassGroupTeacherMapper> classGroupTeachers = classGroupTeacherMapperService.getClassGroupTeachers(classGroupId.intValue());
+        if ((classGroup.getType().equals(ClassGroupTypeEnum.HIGH_ONLINE)||classGroup.getType().equals(ClassGroupTypeEnum.HIGH)) && classGroupNotStartCourse.size() > 0) {
+            Date nowDate = new Date();
+            List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaryList = new ArrayList<>();
+            List<Long> courseScheduleIds = classGroupNotStartCourse.stream().map(CourseSchedule::getId).collect(Collectors.toList());
+            courseScheduleTeacherSalaryDao.batchDeleteByCourseScheduleIds(courseScheduleIds);
+            for (CourseSchedule courseSchedule : classGroupNotStartCourse) {
+                for (ClassGroupTeacherMapper classGroupTeacher : classGroupTeachers) {
+                    List<TeacherDefaultMusicGroupSalary> teacherSalaryList = teacherDefaultMusicGroupSalaryService.getTeacherSalaryByUserIdAndType(classGroupTeacher.getUserId(), ClassGroupTypeEnum.HIGH_ONLINE.getCode(), null);
+                    if (teacherSalaryList == null || teacherSalaryList.size() == 0) {
+                        throw new BizException("请设置老师线上网管课课酬");
+                    }
+                    Map<CourseSchedule.CourseScheduleType, TeacherDefaultMusicGroupSalary> collect = teacherSalaryList.stream().collect(Collectors.toMap(TeacherDefaultMusicGroupSalary::getCourseScheduleType, teacherDefaultMusicGroupSalary -> teacherDefaultMusicGroupSalary));
+                    TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary = collect.get(CourseSchedule.CourseScheduleType.HIGH_ONLINE);
+
+                    int studentNum = studentIds.size();
+                    if(studentNum>5){
+                        studentNum=5;
+                    }
+
+                    BigDecimal salary = JSON.parseObject(teacherDefaultMusicGroupSalary.getSalaryRuleJson()).getBigDecimal(studentNum+"");
+
+                    CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
+                    courseScheduleTeacherSalary.setCourseScheduleId(courseSchedule.getId());
+                    courseScheduleTeacherSalary.setGroupType(courseSchedule.getGroupType());
+                    courseScheduleTeacherSalary.setMusicGroupId(courseSchedule.getMusicGroupId());
+                    courseScheduleTeacherSalary.setTeacherRole(classGroupTeacher.getTeacherRole());
+                    courseScheduleTeacherSalary.setUserId(classGroupTeacher.getUserId());
+                    courseScheduleTeacherSalary.setExpectSalary(salary);
+                    courseScheduleTeacherSalary.setClassGroupId(classGroup.getId());
+                    courseScheduleTeacherSalary.setCreateTime(nowDate);
+                    courseScheduleTeacherSalary.setUpdateTime(nowDate);
+                    courseScheduleTeacherSalaryList.add(courseScheduleTeacherSalary);
+                }
+            }
+            courseScheduleTeacherSalaryService.batchInsert(courseScheduleTeacherSalaryList);
+        }
+
+        if(!CollectionUtils.isEmpty(removeStudentIds)){
+            courseScheduleDao.deleteMusicGroupCourseSchedulesWithStudents(courseIds, new ArrayList<>(removeStudentIds));
+            List<ImGroupMember> imGroupMemberList = new ArrayList<>();
+            for (Integer addStudentId : addStudentIds) {
+                imGroupMemberList.add(new ImGroupMember(addStudentId.toString()));
+            }
+            //5、学生退出班级群组
+            ImGroupMember[] imGroupMembers = imGroupMemberList.toArray(new ImGroupMember[imGroupMemberList.size()]);
+            imFeignService.groupQuit(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName()));
+        }
+
+        if(!CollectionUtils.isEmpty(addStudentIds)){
+            courseScheduleStudentPaymentService.createForMusicGroup(classGroup.getMusicGroupId(), classGroupNotStartCourse, new ArrayList<>(addStudentIds));
+            List<ImGroupMember> imGroupMemberList = new ArrayList<>();
+            for (Integer addStudentId : addStudentIds) {
+                imGroupMemberList.add(new ImGroupMember(addStudentId.toString()));
+            }
+            //5、添加进IM群组
+            ImGroupMember[] imGroupMembers = imGroupMemberList.toArray(new ImGroupMember[imGroupMemberList.size()]);
+            imFeignService.groupJoin(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName()));
+        }
+    }
 }

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

@@ -309,8 +309,6 @@ public class ClassGroupTeacherMapperServiceImpl extends BaseServiceImpl<Long, Cl
             List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaryList = new ArrayList<>();
             List<TeacherAttendance> teacherAttendances = new ArrayList<>();
 
-            List<CourseScheduleTeacherSalary> allTeacherSalarys = courseScheduleTeacherSalaryDao.findByTeacher(musicGroupId, GroupType.MUSIC, classGroupNoStartCourseSchedule.getType(), teacherUserIds);
-
             //课时长度
             int duration = DateUtil.minutesBetween(classGroupNoStartCourseSchedule.getStartClassTime(), classGroupNoStartCourseSchedule.getEndClassTime());
             List<ClassGroupTeacherMapper> byClassGroup = classGroupTeacherMapperDao.findByClassGroup(classGroupNoStartCourseSchedule.getClassGroupId());
@@ -318,7 +316,7 @@ public class ClassGroupTeacherMapperServiceImpl extends BaseServiceImpl<Long, Cl
                 if (!classGroupTeacherMapper.getClassGroupId().equals(classGroupNoStartCourseSchedule.getClassGroupId())) {
                     continue;
                 }
-                BigDecimal salary;
+                BigDecimal salary = new BigDecimal("0");
 
                 TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary = teacherDefaultMusicGroupSalaryDao.findByTeacherAndCourseType(classGroupTeacherMapper.getUserId(),
                         classGroupNoStartCourseSchedule.getType().getCode());
@@ -357,17 +355,6 @@ public class ClassGroupTeacherMapperServiceImpl extends BaseServiceImpl<Long, Cl
                     classTimeDuty = new BigDecimal(duration).divide(new BigDecimal(40), BigDecimal.ZERO.intValue(), BigDecimal.ROUND_DOWN);
                 }
 
-                salary = baseSalary.multiply(classTimeDuty).setScale(2, BigDecimal.ROUND_HALF_UP);
-
-                for (CourseScheduleTeacherSalary teacherSalary : allTeacherSalarys) {
-                    if (teacherSalary.getUserId().equals(classGroupTeacherMapper.getUserId())
-                            && teacherSalary.getTeacherRole().equals(classGroupTeacherMapper.getTeacherRole())) {
-                        int oldDuration = DateUtil.minutesBetween(teacherSalary.getCourseSchedule().getStartClassTime(), teacherSalary.getCourseSchedule().getEndClassTime());
-                        salary = teacherSalary.getExpectSalary().divide(new BigDecimal(oldDuration), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(duration)).setScale(2, BigDecimal.ROUND_HALF_UP);
-                        break;
-                    }
-                }
-
                 //课堂课课酬
 //                if (musicGroup.isClassroomLessons()) {
 //                    salary = classGroupTeacherMapper.getTeacherRole().equals(TeachTypeEnum.BISHOP) ? teacherDefaultMusicGroupSalary.getMainTeacher30MinSalary() : teacherDefaultMusicGroupSalary.getAssistantTeacher30MinSalary();

+ 111 - 55
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -29,6 +29,7 @@ import java.util.TreeSet;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.enums.*;
 import org.apache.commons.collections.ListUtils;
@@ -74,6 +75,25 @@ import com.ym.mec.biz.dal.dao.TeacherDefaultMusicGroupSalaryDao;
 import com.ym.mec.biz.dal.dao.TeacherDefaultPracticeGroupSalaryDao;
 import com.ym.mec.biz.dal.dao.TeacherDefaultVipGroupSalaryDao;
 import com.ym.mec.biz.dal.dao.VipGroupDao;
+import com.ym.mec.biz.dal.dto.BatchInsertCoursesDto;
+import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
+import com.ym.mec.biz.dal.dto.CourseAttendanceDetailHeadInfoDto;
+import com.ym.mec.biz.dal.dto.CoursePostponeDto;
+import com.ym.mec.biz.dal.dto.CourseScheduleDto;
+import com.ym.mec.biz.dal.dto.CourseScheduleEndDto;
+import com.ym.mec.biz.dal.dto.CourseScheduleRateDto;
+import com.ym.mec.biz.dal.dto.CourseScheduleStudentDto;
+import com.ym.mec.biz.dal.dto.CourseTimeDto;
+import com.ym.mec.biz.dal.dto.CreateCourseScheduleDto;
+import com.ym.mec.biz.dal.dto.IntegerAndIntegerListDto;
+import com.ym.mec.biz.dal.dto.Mapper;
+import com.ym.mec.biz.dal.dto.StudentNameAndPhoneDto;
+import com.ym.mec.biz.dal.dto.TeacherAttendanceDto;
+import com.ym.mec.biz.dal.dto.TeacherClassCourseSchudeleDto;
+import com.ym.mec.biz.dal.dto.TeacherRemarkCommitDto;
+import com.ym.mec.biz.dal.dto.VipGroupApplyBaseInfoDto;
+import com.ym.mec.biz.dal.dto.VipGroupApplyDto;
+import com.ym.mec.biz.dal.dto.VipGroupCourseAdjustInfoDto;
 import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
 import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
@@ -81,28 +101,6 @@ import com.ym.mec.biz.dal.entity.ClassGroupTeacherSalary;
 import com.ym.mec.biz.dal.entity.CourseGenerateDto;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
-import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
-import com.ym.mec.biz.dal.entity.CourseScheduleEvaluate;
-import com.ym.mec.biz.dal.entity.CourseScheduleModifyLog;
-import com.ym.mec.biz.dal.entity.CourseScheduleReview;
-import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
-import com.ym.mec.biz.dal.entity.CourseScheduleTeacherSalary;
-import com.ym.mec.biz.dal.entity.CoursesGroup;
-import com.ym.mec.biz.dal.entity.CoursesGroupModifyLog;
-import com.ym.mec.biz.dal.entity.Group;
-import com.ym.mec.biz.dal.entity.MusicGroup;
-import com.ym.mec.biz.dal.entity.PracticeGroup;
-import com.ym.mec.biz.dal.entity.School;
-import com.ym.mec.biz.dal.entity.StudentAttendance;
-import com.ym.mec.biz.dal.entity.StudentCourseScheduleRecordDto;
-import com.ym.mec.biz.dal.entity.Subject;
-import com.ym.mec.biz.dal.entity.SysConfig;
-import com.ym.mec.biz.dal.entity.Teacher;
-import com.ym.mec.biz.dal.entity.TeacherAttendance;
-import com.ym.mec.biz.dal.entity.TeacherDefaultMusicGroupSalary;
-import com.ym.mec.biz.dal.entity.TeacherDefaultPracticeGroupSalary;
-import com.ym.mec.biz.dal.entity.TeacherDefaultVipGroupSalary;
-import com.ym.mec.biz.dal.entity.VipGroup;
 import com.ym.mec.biz.dal.page.CourseScheduleQueryInfo;
 import com.ym.mec.biz.dal.page.EndCourseScheduleQueryInfo;
 import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
@@ -1432,6 +1430,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			int singleClassMinutes = DateUtil.minutesBetween(existCours.getStartClassTime(), existCours.getEndClassTime());
 
 			existCours.setClassDate(ac.getClassDate());
+			existCours.setUpdateTime(now);
 			existCours.setStartClassTime(ac.getStartClassTime());
 			existCours.setEndClassTime(DateUtil.addMinutes(existCours.getStartClassTime(), singleClassMinutes));
 
@@ -1901,6 +1900,16 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                                 backCourseSchedule.setTeachingTeacherIdList(integerAndIntegerListDto.getIds());
                             }
                         }
+                        if(CollectionUtils.isEmpty(preCourseSchedule.getTeachingTeacherIdList())){
+							preCourseSchedule.setTeachingTeacherIdList(new ArrayList<>(Arrays.asList(preCourseSchedule.getActualTeacherId())));
+						}else{
+							preCourseSchedule.getTeachingTeacherIdList().add(preCourseSchedule.getActualTeacherId());
+						}
+                        if(CollectionUtils.isEmpty(backCourseSchedule.getTeachingTeacherIdList())){
+							backCourseSchedule.setTeachingTeacherIdList(new ArrayList<>(Arrays.asList(backCourseSchedule.getActualTeacherId())));
+						}else{
+							backCourseSchedule.getTeachingTeacherIdList().add(backCourseSchedule.getActualTeacherId());
+						}
                         if (!CollectionUtils.isEmpty(preCourseSchedule.getTeachingTeacherIdList())
                                 && !CollectionUtils.isEmpty(backCourseSchedule.getTeachingTeacherIdList())) {
                             List<Integer> repeatIds = preCourseSchedule.getTeachingTeacherIdList()
@@ -3104,8 +3113,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
 		Date entryDate = DateUtil.stringToDate(sysConfigDao.findByParamName(SysConfigService.TEACHER_ENTRY_DATE).getParanValue(), "yyyy-MM-dd");
 
-		List<CourseScheduleModifyLog> insertCourseScheduleModifyLogList = new ArrayList<CourseScheduleModifyLog>();
-
 		List<CourseScheduleStudentPayment> insertCourseScheduleStudentPaymentList = new ArrayList<CourseScheduleStudentPayment>();
 
 		for (CourseSchedule newCourseSchedule : newCourseSchedules) {
@@ -3362,23 +3369,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 					insertCourseScheduleTeacherSalaryList.add(ts);
 				}
 			}
-
-			// 调整日志
-			CourseScheduleModifyLog courseScheduleModifyLog = new CourseScheduleModifyLog();
-			courseScheduleModifyLog.setCourseScheduleId(courseScheduleId);
-			courseScheduleModifyLog.setCreateTime(date);
-			courseScheduleModifyLog.setCurrentCourseSchedule(JsonUtil.toJSONString(newCourseSchedule));
-			courseScheduleModifyLog.setPreviousCourseSchedule(JsonUtil.toJSONString(oldCourseSchedule));
-
-			SysUser sysUser = sysUserFeignService.queryUserInfo();
-			if (null == sysUser) {
-				throw new BizException("获取用户信息失败");
-			}
-
-			courseScheduleModifyLog.setOperatorId(sysUser.getId());
-
-			insertCourseScheduleModifyLogList.add(courseScheduleModifyLog);
-
 		}
 
 		if (insertTeacherAttendanceList.size() > 0) {
@@ -3389,10 +3379,6 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 			courseScheduleTeacherSalaryDao.batchInsert(insertCourseScheduleTeacherSalaryList);
 		}
 
-		if (insertCourseScheduleModifyLogList.size() > 0) {
-			courseScheduleModifyLogDao.batchInsert(insertCourseScheduleModifyLogList);
-		}
-
 		if(newCourseSchedules.size() > 0){
 			courseScheduleDao.batchUpdate(newCourseSchedules);
             List<Integer> classGroupIds = newCourseSchedules.stream().filter(courseSchedule -> Objects.nonNull(courseSchedule.getClassGroupId())).map(CourseSchedule::getClassGroupId).collect(Collectors.toList());
@@ -3400,6 +3386,25 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                 classGroupService.updateClassGroupsCourseInfo(classGroupIds);
             }
         }
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (null == sysUser) {
+			throw new BizException("获取用户信息失败");
+		}
+		List<CourseScheduleModifyLog> insertCourseScheduleModifyLogList = new ArrayList<>();
+		oldCourseScheduleList.forEach(e->{
+			// 调整日志
+			CourseScheduleModifyLog courseScheduleModifyLog = new CourseScheduleModifyLog();
+			courseScheduleModifyLog.setCourseScheduleId(e.getId());
+			courseScheduleModifyLog.setCreateTime(date);
+			courseScheduleModifyLog.setPreviousCourseSchedule(JsonUtil.toJSONString(e));
+			courseScheduleModifyLog.setCurrentCourseSchedule(JsonUtil.toJSONString(courseScheduleDao.get(e.getId())));
+			courseScheduleModifyLog.setOperatorId(sysUser.getId());
+			insertCourseScheduleModifyLogList.add(courseScheduleModifyLog);
+		});
+
+		if (insertCourseScheduleModifyLogList.size() > 0) {
+			courseScheduleModifyLogDao.batchInsert(insertCourseScheduleModifyLogList);
+		}
 
 		if(insertCourseScheduleStudentPaymentList.size() > 0){
 			courseScheduleStudentPaymentDao.batchInsert(insertCourseScheduleStudentPaymentList);
@@ -5123,6 +5128,52 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 	}
 
 	@Override
+	public List<CourseScheduleModifyLog> queryCourseAdjustDetail(Long courseScheduleId) {
+		//获取所有的更改记录
+		Map<String,Object> param = new HashMap(1);
+		param.put("courseScheduleId",courseScheduleId);
+		List<CourseScheduleModifyLog> scheduleModifyLogs = courseScheduleModifyLogDao.findAll(param);
+		List<CourseScheduleAuditDetailDto> courseSchedules = new ArrayList<>();
+		for (int i = scheduleModifyLogs.size() - 1; i >= 0; i--) {
+			CourseScheduleModifyLog modifyLog = scheduleModifyLogs.get(i);
+			CourseScheduleAuditDetailDto auditDetailDto = JSON.parseObject(modifyLog.getPreviousCourseSchedule(), CourseScheduleAuditDetailDto.class);
+			auditDetailDto.setOperatorId(modifyLog.getOperatorId());
+			courseSchedules.add(auditDetailDto);
+			CourseScheduleAuditDetailDto auditDetailDto1 = JSON.parseObject(modifyLog.getCurrentCourseSchedule(), CourseScheduleAuditDetailDto.class);
+			auditDetailDto1.setOperatorId(modifyLog.getOperatorId());
+			courseSchedules.add(auditDetailDto1);
+		}
+		if(courseSchedules.size() > 0){
+			Set<Integer> actualTeacherIds = courseSchedules.stream().map(e -> e.getActualTeacherId()).collect(Collectors.toSet());
+			actualTeacherIds.addAll(courseSchedules.stream().map(e -> e.getTeacherId()).collect(Collectors.toSet()));
+			actualTeacherIds.addAll(courseSchedules.stream().map(e -> e.getOperatorId()).collect(Collectors.toSet()));
+			Set<Integer> schoolIds = courseSchedules.stream().map(e -> e.getSchoolId()).collect(Collectors.toSet());
+			Map<Integer, String> actualTeacherMap = getMap("sys_user", "id_", "real_name_", actualTeacherIds, Integer.class, String.class);
+			Map<Integer, String> schoolMap = new HashMap<>();
+			if(schoolIds != null && schoolIds.size() > 0){
+				schoolMap = getMap("school", "id_", "name_", schoolIds, Integer.class, String.class);
+			}
+			for (CourseScheduleModifyLog modifyLog : scheduleModifyLogs) {
+				CourseScheduleAuditDetailDto preAuditDetailDto = JSON.parseObject(modifyLog.getPreviousCourseSchedule(), CourseScheduleAuditDetailDto.class);
+				preAuditDetailDto.setTeacherName(actualTeacherMap.get(preAuditDetailDto.getTeacherId()));
+				preAuditDetailDto.setActualTeacherName(actualTeacherMap.get(preAuditDetailDto.getActualTeacherId()));
+				preAuditDetailDto.setSchoolName(schoolMap.get(preAuditDetailDto.getSchoolId()));
+				preAuditDetailDto.setOperatorName(actualTeacherMap.get(modifyLog.getOperatorId()));
+				modifyLog.setPreviousCourseSchedule(JSONObject.toJSONString(preAuditDetailDto));
+
+				CourseScheduleAuditDetailDto auditDetailDto = JSON.parseObject(modifyLog.getCurrentCourseSchedule(), CourseScheduleAuditDetailDto.class);
+				auditDetailDto.setTeacherName(actualTeacherMap.get(auditDetailDto.getTeacherId()));
+				auditDetailDto.setActualTeacherName(actualTeacherMap.get(auditDetailDto.getActualTeacherId()));
+				auditDetailDto.setSchoolName(schoolMap.get(auditDetailDto.getSchoolId()));
+				auditDetailDto.setOperatorName(actualTeacherMap.get(modifyLog.getOperatorId()));
+				modifyLog.setCurrentCourseSchedule(JSONObject.toJSONString(auditDetailDto));
+			}
+			return scheduleModifyLogs;
+		}
+		return null;
+	}
+
+	@Override
 	public void courseRepeatCheck() {
 		List<CourseRepeatCheckDto> courseRepeatCheckInfos = courseScheduleDao.getCourseRepeatCheckInfos();
 		courseRepeatCheckInfos.sort(Comparator.comparing(CourseRepeatCheckDto::getStartClassTime));
@@ -5131,6 +5182,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		for (CourseRepeatCheckDto cs1 : courseRepeatCheckInfos) {
 			if(!courseRepeatIdMap.containsKey(cs1.getCourseId())){
 				courseRepeatIdMap.put(cs1.getCourseId(), new ArrayList<>());
+				courseRepeatIdMap.get(cs1.getCourseId()).add(cs1.getCourseId());
 			}else{
 				continue;
 			}
@@ -5142,8 +5194,11 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 				if(cs2.getEndClassTime().compareTo(cs1.getStartClassTime())<=0){
 					continue;
 				}
+				if(courseRepeatIdMap.containsKey(cs2.getCourseId())&&courseRepeatIdMap.get(cs2.getCourseId()).contains(cs1.getCourseId())){
+					continue;
+				}
 				if(cs2.getStartClassTime().compareTo(cs1.getEndClassTime())>=0){
-					if(CollectionUtils.isEmpty(courseRepeatIdMap.get(cs1.getCourseId()))){
+					if(CollectionUtils.isEmpty(courseRepeatIdMap.get(cs1.getCourseId()))||courseRepeatIdMap.get(cs1.getCourseId()).size()==1){
 						courseRepeatIdMap.remove(cs1.getCourseId());
 					}
 					break;
@@ -5151,20 +5206,21 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 				if(cs1.getStartClassTime().compareTo(cs2.getEndClassTime())>=0||cs1.getEndClassTime().compareTo(cs2.getStartClassTime())<=0){
 					continue;
 				}
-				long repeatTeacherNums = cs1.getTeacherIds().stream().filter(teacherId -> cs2.getTeacherIds().contains(teacherId)).count();
-				if(repeatTeacherNums>0){
-					System.out.println(cs1.getCourseId() + "," + cs2.getCourseId());
-					courseRepeatIdMap.get(cs1.getCourseId()).add(cs2.getCourseId());
-					continue;
-				}
-//				long repeatStudentNums = cs1.getStudentIds().stream().filter(studentId -> cs2.getStudentIds().contains(studentId)).count();
-//				if(repeatStudentNums>0){
+//				long repeatTeacherNums = cs1.getTeacherIds().stream().filter(teacherId -> cs2.getTeacherIds().contains(teacherId)).count();
+//				if(repeatTeacherNums>0){
 //					System.out.println(cs1.getCourseId() + "," + cs2.getCourseId());
 //					courseRepeatIdMap.get(cs1.getCourseId()).add(cs2.getCourseId());
 //					continue;
 //				}
+
+				long repeatStudentNums = cs1.getStudentIds().stream().filter(studentId -> cs2.getStudentIds().contains(studentId)).count();
+				if(repeatStudentNums>0){
+					System.out.println(cs1.getCourseId() + "," + cs2.getCourseId());
+					courseRepeatIdMap.get(cs1.getCourseId()).add(cs2.getCourseId());
+					continue;
+				}
 			}
-			if(CollectionUtils.isEmpty(courseRepeatIdMap.get(cs1.getCourseId()))){
+			if(CollectionUtils.isEmpty(courseRepeatIdMap.get(cs1.getCourseId()))||courseRepeatIdMap.get(cs1.getCourseId()).size()==1){
 				courseRepeatIdMap.remove(cs1.getCourseId());
 			}
 		}

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

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service.impl;
 
+import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.CourseScheduleStudentListDto;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
@@ -15,12 +16,16 @@ import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.thirdparty.yqpay.DateUtils;
+import com.ym.mec.util.date.DateUtil;
+import org.springframework.beans.BeanUtils;
 import com.ym.mec.util.collection.MapUtil;
 import io.swagger.models.auth.In;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.formula.functions.T;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
@@ -30,7 +35,7 @@ import java.util.stream.Collectors;
 
 @Service
 public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Long, CourseScheduleStudentPayment>  implements CourseScheduleStudentPaymentService {
-	
+
 	@Autowired
 	private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
 	@Autowired
@@ -44,10 +49,20 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 	@Autowired
 	private SysUserCashAccountService sysUserCashAccountService;
 	@Autowired
-	private StudentAttendanceDao studentAttendanceDao;
+	private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
+	@Autowired
+	private MusicGroupPaymentCalenderDetailDao musicGroupPaymentCalenderDetailDao;
+	@Autowired
+	private MusicGroupPaymentCalenderCourseSettingsDao musicGroupPaymentCalenderCourseSettingsDao;
+	@Autowired
+	private VipGroupDefaultClassesUnitPriceDao vipGroupDefaultClassesUnitPriceDao;
+	@Autowired
+	private MusicGroupPaymentStudentCourseDetailDao musicGroupPaymentStudentCourseDetailDao;
 	@Autowired
 	private TeacherDao teacherDao;
 	@Autowired
+	private StudentAttendanceDao studentAttendanceDao;
+	@Autowired
 	private StudentDao studentDao;
 	@Autowired
 	private SubjectDao subjectDao;
@@ -65,6 +80,11 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 			throw new BizException("未找到相关vip课程");
 		}
 
+		VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice = vipGroupDefaultClassesUnitPriceDao.getByVipGroup(vipGroupId);
+		if(Objects.isNull(vipGroupDefaultClassesUnitPrice)){
+			throw new BizException("课程单价设置错误");
+		}
+
 		//获取活动信息
 		VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroupApplyBaseInfoDto.getVipGroupActivityId().intValue());
 
@@ -146,6 +166,8 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 							throw new BizException("活动类型错误!");
 					}
 				}
+                courseScheduleStudentPayment.setOriginalPrice(TeachModeEnum.ONLINE.equals(teachModeEnum)?vipGroupDefaultClassesUnitPrice.getOnlineClassesUnitPrice():vipGroupDefaultClassesUnitPrice.getOfflineClassesUnitPrice());
+				courseScheduleStudentPayment.setActualPrice(courseScheduleStudentPayment.getExpectPrice());
 				courseScheduleStudentPayments.add(courseScheduleStudentPayment);
 			}
 		}
@@ -283,6 +305,162 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
+	public void createForMusicGroup(String musicGroupId, List<CourseSchedule> courseSchedules, List<Integer> studentIds) {
+		Map<CourseSchedule.CourseScheduleType, Integer> courseTypeCourseDurationMap = new HashMap<>();
+		Map<CourseSchedule.CourseScheduleType, List<CourseSchedule>> typeCourseMap = courseSchedules.stream().collect(Collectors.groupingBy(CourseSchedule::getType));
+		for (Map.Entry<CourseSchedule.CourseScheduleType, List<CourseSchedule>> typeCoursesEntry : typeCourseMap.entrySet()) {
+			int totalCourseDuration = 0;
+			for (CourseSchedule courseSchedule : typeCoursesEntry.getValue()) {
+				//课程时长
+				int courseDuration = DateUtil.minutesBetween(courseSchedule.getStartClassTime(), courseSchedule.getEndClassTime());
+				totalCourseDuration += courseDuration;
+			}
+			courseTypeCourseDurationMap.put(typeCoursesEntry.getKey(), totalCourseDuration);
+		}
+
+		List<CourseScheduleStudentPayment> courseScheduleStudentPayments = new ArrayList<>();
+
+		List<String> allBatchNos = new ArrayList<>();
+
+		for (Integer studentId : studentIds) {
+			for (Map.Entry<CourseSchedule.CourseScheduleType, List<CourseSchedule>> courseScheduleTypeListEntry : typeCourseMap.entrySet()) {
+				//当前课程类型总课程时长
+				Integer typeCourseDuration = courseTypeCourseDurationMap.get(courseScheduleTypeListEntry.getKey());
+				MusicGroupPaymentStudentCourseDetail musicGroupPaymentStudentCourseDetail = musicGroupPaymentStudentCourseDetailDao.getUnUseWithStudentAndCourseTypeAndCourseMinutes(musicGroupId, studentId, courseScheduleTypeListEntry.getKey(), typeCourseDuration);
+				if(Objects.isNull(musicGroupPaymentStudentCourseDetail)||musicGroupPaymentStudentCourseDetail.getTotalCourseMinutes().compareTo(typeCourseDuration)<0){
+					SysUser user = teacherDao.getUser(studentId);
+					throw new BizException("{}在{}课程类型上的课程时长不足", user.getUsername(), courseScheduleTypeListEntry.getKey().getMsg());
+				}
+
+				MusicGroupPaymentCalender musicGroupPaymentCalender = musicGroupPaymentCalenderDao.get(musicGroupPaymentStudentCourseDetail.getMusicGroupPaymentCalenderId());
+				if(Objects.isNull(musicGroupPaymentCalender)||!musicGroupId.equals(musicGroupPaymentCalender.getMusicGroupId())){
+					throw new BizException("缴费设置异常");
+				}
+
+				MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.getWithPaymentCalenderAndCourseType(musicGroupPaymentStudentCourseDetail.getMusicGroupPaymentCalenderId(), courseScheduleTypeListEntry.getKey());
+				if(Objects.isNull(musicGroupPaymentCalenderCourseSettings)||musicGroupPaymentCalenderCourseSettings.getCourseTotalMinuties().compareTo(musicGroupPaymentStudentCourseDetail.getTotalCourseMinutes())!=0){
+					throw new BizException("缴费设置异常");
+				}
+
+				allBatchNos.add(musicGroupPaymentCalender.getBatchNo());
+
+				//课程每分钟原价
+				BigDecimal unitMinuteOriginalPrice = musicGroupPaymentCalenderCourseSettings.getCourseOriginalPrice().divide(new BigDecimal(musicGroupPaymentCalenderCourseSettings.getCourseTotalMinuties()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
+				//课程每分钟现价
+				BigDecimal unitMinuteCurrentPrice = musicGroupPaymentCalenderCourseSettings.getCourseCurrentPrice().divide(new BigDecimal(musicGroupPaymentCalenderCourseSettings.getCourseTotalMinuties()), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
+
+				if(MusicGroupPaymentCalender.PayUserType.SCHOOL.equals(musicGroupPaymentCalender.getPayUserType())){
+					unitMinuteCurrentPrice = new BigDecimal("0");
+				}
+
+				List<CourseScheduleStudentPayment> typeCourseStudentPayments = new ArrayList<>();
+				courseScheduleTypeListEntry.getValue().sort(Comparator.comparing(CourseSchedule::getStartClassTime));
+				BigDecimal typeCourseTotalOriginalPrice = new BigDecimal("0"), typeCourseTotalCurrentPrice = new BigDecimal("0");
+				for (CourseSchedule courseSchedule : courseScheduleTypeListEntry.getValue()) {
+					//课程时长
+					int courseDuration = DateUtil.minutesBetween(courseSchedule.getStartClassTime(), courseSchedule.getEndClassTime());
+
+					//课程原价
+					BigDecimal courseOriginalPrice = unitMinuteOriginalPrice.multiply(new BigDecimal(courseDuration)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN);
+					typeCourseTotalOriginalPrice = typeCourseTotalOriginalPrice.add(courseOriginalPrice);
+
+					//课程现价
+					BigDecimal courseCurrentPrice = unitMinuteCurrentPrice.multiply(new BigDecimal(courseDuration)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_DOWN);
+					typeCourseTotalCurrentPrice = typeCourseTotalCurrentPrice.add(courseCurrentPrice);
+
+					CourseScheduleStudentPayment cssp = new CourseScheduleStudentPayment();
+					cssp.setGroupType(courseSchedule.getGroupType());
+					cssp.setMusicGroupId(courseSchedule.getMusicGroupId());
+					cssp.setCourseScheduleId(courseSchedule.getId());
+					cssp.setClassGroupId(courseSchedule.getClassGroupId());
+					cssp.setBatchNo(musicGroupPaymentCalender.getBatchNo());
+					cssp.setUserId(studentId);
+					cssp.setOriginalPrice(courseOriginalPrice);
+					cssp.setExpectPrice(courseCurrentPrice);
+					cssp.setActualPrice(BigDecimal.ZERO);
+					typeCourseStudentPayments.add(cssp);
+				}
+
+				typeCourseStudentPayments.get(0).setOriginalPrice(typeCourseStudentPayments.get(0).getOriginalPrice().add(musicGroupPaymentCalenderCourseSettings.getCourseOriginalPrice().subtract(typeCourseTotalOriginalPrice)));
+				if(MusicGroupPaymentCalender.PayUserType.STUDENT.equals(musicGroupPaymentCalender.getPayUserType())) {
+					typeCourseStudentPayments.get(0).setExpectPrice(typeCourseStudentPayments.get(0).getExpectPrice().add(musicGroupPaymentCalenderCourseSettings.getCourseCurrentPrice().subtract(typeCourseTotalCurrentPrice)));
+				}
+				courseScheduleStudentPayments.addAll(typeCourseStudentPayments);
+				musicGroupPaymentStudentCourseDetail.setUsedCourseMinutes(typeCourseDuration);
+				musicGroupPaymentStudentCourseDetailDao.update(musicGroupPaymentStudentCourseDetail);
+			}
+		}
+		courseScheduleStudentPaymentDao.batchInsert(courseScheduleStudentPayments);
+		for (String batchNo : allBatchNos) {
+			updateForMusicGroupWithPaymentCalender(batchNo);
+		}
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
+	public void updateForMusicGroupWithPaymentCalender(String batchNo) {
+		List<CourseScheduleStudentPayment> courseScheduleStudentPayments = courseScheduleStudentPaymentDao.findByBatchNo(batchNo);
+		if(CollectionUtils.isEmpty(courseScheduleStudentPayments)){
+			return;
+		}
+		List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
+		if(CollectionUtils.isEmpty(musicGroupPaymentCalenders)){
+			return;
+		}
+		List<Long> calenderIds = musicGroupPaymentCalenders.stream().map(MusicGroupPaymentCalender::getId).collect(Collectors.toList());
+		List<MusicGroupPaymentCalenderDetail> calenderDetails = musicGroupPaymentCalenderDetailDao.getWithCalenderIds(calenderIds);
+
+		Map<Integer, List<CourseScheduleStudentPayment>> studentStudentPaymentMap = courseScheduleStudentPayments.stream().collect(Collectors.groupingBy(CourseScheduleStudentPayment::getUserId));
+		Map<Integer, List<MusicGroupPaymentCalenderDetail>> studentCalenderDetailMap = calenderDetails.stream().collect(Collectors.groupingBy(MusicGroupPaymentCalenderDetail::getUserId));
+
+		List<CourseScheduleStudentPayment> updateStudentPayments = new ArrayList<>();
+
+		for (Map.Entry<Integer, List<CourseScheduleStudentPayment>> studentStudentPaymentMapEntry : studentStudentPaymentMap.entrySet()) {
+			List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetails = studentCalenderDetailMap.get(studentStudentPaymentMapEntry.getKey());
+
+			if(CollectionUtils.isEmpty(musicGroupPaymentCalenderDetails)){
+				continue;
+			}
+
+			//学员总缴费金额
+			BigDecimal totalActualAmount = musicGroupPaymentCalenderDetails.stream().map(e -> Objects.isNull(e.getActualAmount())?BigDecimal.ZERO:e.getActualAmount()).reduce(BigDecimal.ZERO, BigDecimal::add);
+
+			for (CourseScheduleStudentPayment courseScheduleStudentPayment : studentStudentPaymentMapEntry.getValue()) {
+				if(totalActualAmount.compareTo(courseScheduleStudentPayment.getExpectPrice())>=0){
+					courseScheduleStudentPayment.setActualPrice(courseScheduleStudentPayment.getExpectPrice());
+					totalActualAmount=totalActualAmount.subtract(courseScheduleStudentPayment.getExpectPrice());
+				}else{
+					courseScheduleStudentPayment.setActualPrice(totalActualAmount);
+					totalActualAmount=BigDecimal.ZERO;
+				}
+				updateStudentPayments.add(courseScheduleStudentPayment);
+			}
+		}
+
+		courseScheduleStudentPaymentDao.batchUpdate(updateStudentPayments);
+	}
+
+	@Override
+	public List<CourseScheduleStudentPayment> getClassGroupNoStartCourse(List<Integer> classGroupIds) {
+		List<CourseScheduleStudentPayment> noStartCourses = courseScheduleStudentPaymentDao.getClassGroupNoStartCourse(classGroupIds);
+		Set<Long> needCoursesIds = new HashSet<>();
+		List<CourseScheduleStudentPayment> needCourses = new ArrayList<>();
+		for (CourseScheduleStudentPayment noStartCourse : noStartCourses) {
+			if (needCoursesIds.contains(noStartCourse.getCourseScheduleId())) continue;
+			needCoursesIds.add(noStartCourse.getId());
+			needCourses.add(noStartCourse);
+		}
+		return needCourses;
+	}
+
+	@Override
+	public int deleteByMusicGroupId(String musicGroupId, GroupType music) {
+		return courseScheduleStudentPaymentDao.deleteByMusicGroupId(musicGroupId,music);
+	}
+
+
+	@Override
 	public Map<String, Object> queryCourseStudentList(CourseScheduleStudentPaymentQueryInfo queryInfo) {
 		PageInfo<CourseScheduleStudentListDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
 		Map<String, Object> params = new HashMap<String, Object>();

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio