Преглед изворни кода

Merge remote-tracking branch 'origin/master'

Joburgess пре 4 година
родитељ
комит
b7cfd3ff40
16 измењених фајлова са 338 додато и 140 уклоњено
  1. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderCourseSettingsDao.java
  2. 29 20
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDao.java
  3. 13 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDetailDao.java
  4. 10 4
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderDetailService.java
  5. 9 3
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderService.java
  6. 47 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java
  7. 21 46
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java
  8. 19 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  9. 21 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  10. 3 2
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderCourseSettingsMapper.xml
  11. 9 6
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderDetailMapper.xml
  12. 3 0
      mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderMapper.xml
  13. 42 38
      mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java
  14. 87 0
      mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupPaymentCalenderController.java
  15. 8 11
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderController.java
  16. 16 5
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderDetailController.java

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

@@ -51,5 +51,5 @@ public interface MusicGroupPaymentCalenderCourseSettingsDao extends BaseDAO<Inte
 	 * @param calenderId:
 	 * @return java.util.List<com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings>
 	 */
-	List<MusicGroupPaymentCalenderCourseSettings> queryCalenderCourseSettings(Integer calenderId);
+	List<MusicGroupPaymentCalenderCourseSettings> queryCalenderCourseSettings(Long calenderId);
 }

+ 29 - 20
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentCalenderDao.java

@@ -69,10 +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("deadlinePaymentDate") Date deadlinePaymentDate, @Param("calenderId") Long calenderId);
 
     /**
      * 乐团最后一次交费信息
+     *
      * @param musicGroupId
      * @return
      */
@@ -81,15 +82,15 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
     int queryIntersectionByDate(@Param("musicGroupId") String musicGroupId, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
     /**
+     * @param musicGroupId:
+     * @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") Date paymentValidStartDate,
@@ -97,13 +98,13 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
                                      @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);
 
@@ -116,53 +117,53 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
     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
-     * @param musicGroupId:
-     * @return com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender
      */
     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
-     * @param calenderIds:
-     * @return com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender
      */
     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
-     * @param batchNo: 批次号
-     * @return java.util.List<com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender>
      */
     List<MusicGroupPaymentCalender> findByBatchNo(@Param("batchNo") String batchNo);
 
 
     /**
+     * @param params:
+     * @return int
      * @describe 乐团缴费日历审核列表
      * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
      * @author zouxuan
      * @date 2020/10/30
      * @time 13:47
-     * @param params:
-     * @return int
      */
     int countAuditList(Map<String, Object> params);
 
     /**
+     * @param params:
+     * @return int
      * @describe 乐团缴费日历审核列表
      * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
      * @author zouxuan
      * @date 2020/10/30
      * @time 13:47
-     * @param params:
-     * @return int
      */
     List<MusicGroupPaymentCalenderAuditDto> queryAuditList(Map<String, Object> params);
 
@@ -183,13 +184,21 @@ public interface MusicGroupPaymentCalenderDao extends BaseDAO<Long, MusicGroupPa
     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
-     * @param calenderId:
-     * @return com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto
      */
-    MusicGroupPaymentCalenderAuditDto getAuditDetail(@Param("calenderId") Integer calenderId);
+    MusicGroupPaymentCalenderAuditDto getAuditDetail(@Param("calenderId") Long calenderId);
+
+    /**
+     * 获取乐团的报名缴费日历
+     *
+     * @param musicGroupId
+     * @return
+     */
+    MusicGroupPaymentCalender findByMusicGroupRegCalender(@Param("musicGroupId") String musicGroupId);
 }

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

@@ -167,7 +167,7 @@ public interface MusicGroupPaymentCalenderDetailDao extends BaseDAO<Long, MusicG
      * @param musicGroupId:
      * @return java.util.List<com.ym.mec.biz.dal.dto.SimpleUserDto>
      */
-	List<SimpleUserDto> querySimpleUserDto(@Param("calenderId") Integer calenderId, @Param("musicGroupId") String musicGroupId);
+	List<SimpleUserDto> querySimpleUserDto(@Param("calenderId") Long calenderId, @Param("musicGroupId") String musicGroupId);
 
 	/**
 	 * 统计实际收款金额
@@ -175,4 +175,16 @@ public interface MusicGroupPaymentCalenderDetailDao extends BaseDAO<Long, MusicG
 	 * @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);
 }

+ 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

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

@@ -7,7 +7,6 @@ import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
 import com.ym.mec.common.page.PageInfo;
-import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.BaseService;
 
 public interface MusicGroupPaymentCalenderService extends BaseService<Long, MusicGroupPaymentCalender> {
@@ -17,7 +16,7 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 	 * @param musicGroupPaymentCalender
 	 * @return
 	 */
-	boolean create(MusicGroupPaymentCalender musicGroupPaymentCalender);
+	Long create(MusicGroupPaymentCalender musicGroupPaymentCalender);
 
 	/**
 	 * 获取明细
@@ -94,7 +93,7 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 	 * @param calenderId:
 	 * @return com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDetailDto
 	 */
-	MusicGroupPaymentCalenderAuditDetailDto auditListDetail(Integer calenderId);
+	MusicGroupPaymentCalenderAuditDetailDto auditListDetail(Long calenderId);
 
 	/**
 	 * @describe 审核通过
@@ -117,4 +116,11 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 	 * @return void
 	 */
 	void auditRefuse(Long calenderId,String auditMemo);
+
+	/**
+	 * 获取乐团报名的缴费日历
+	 * @param musicGroupId
+	 * @return
+	 */
+	MusicGroupPaymentCalender findByMusicGroupRegCalender(String musicGroupId);
 }

+ 47 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java

@@ -4,6 +4,7 @@ import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.NON_P
 import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -20,6 +21,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import com.ym.mec.biz.dal.dao.MusicGroupDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
 import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
 import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
 import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
@@ -29,8 +31,10 @@ import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
+import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.service.MusicGroupPaymentCalenderDetailService;
 import com.ym.mec.biz.service.SysConfigService;
@@ -47,6 +51,10 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 	private MusicGroupPaymentCalenderDetailDao musicGroupPaymentCalenderDetailDao;
 	@Autowired
 	private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
+	
+	@Autowired
+	private MusicGroupPaymentCalenderCourseSettingsDao musicGroupPaymentCalenderCourseSettingsDao;
+	
 	@Autowired
 	private MusicGroupDao musicGroupDao;
 	@Autowired
@@ -245,6 +253,45 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 	}
 
 	@Override
+	public void batchAdd(Long musicGroupPaymentCalenderId, List<Integer> userIdList) {
+		
+		MusicGroupPaymentCalender musicGroupPaymentCalender = musicGroupPaymentCalenderDao.get(musicGroupPaymentCalenderId);
+		if(musicGroupPaymentCalender == null){
+			throw new BizException("查询缴费信息失败");
+		}
+		
+		List<MusicGroupPaymentCalenderCourseSettings> courseSettingsList = musicGroupPaymentCalenderCourseSettingsDao.getWithPaymentCalender(musicGroupPaymentCalenderId);
+		
+		BigDecimal totalPrice = new BigDecimal(0);
+		for(MusicGroupPaymentCalenderCourseSettings courseSettings : courseSettingsList){
+			totalPrice.add(courseSettings.getCourseCurrentPrice());
+		}
+		
+		Date date = new Date();
+		MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = null;
+
+		List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = new ArrayList<MusicGroupPaymentCalenderDetail>();
+		//创建缴费明细
+		for(Integer studentId : userIdList){
+			musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();
+			musicGroupPaymentCalenderDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalenderId);
+			musicGroupPaymentCalenderDetail.setCreateTime(date);
+			musicGroupPaymentCalenderDetail.setExpectAmount(totalPrice);
+			musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.NON_PAYMENT);
+			musicGroupPaymentCalenderDetail.setUpdateTime(date);
+			musicGroupPaymentCalenderDetail.setUserId(studentId);
+			musicGroupPaymentCalenderDetail.setStartPaymentDate(musicGroupPaymentCalender.getStartPaymentDate());
+			musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
+			
+			musicGroupPaymentCalenderDetailList.add(musicGroupPaymentCalenderDetail);
+		}
+
+		if (musicGroupPaymentCalenderDetailList.size() > 0) {
+			musicGroupPaymentCalenderDetailDao.batchInsert(musicGroupPaymentCalenderDetailList);
+		}
+	}
+
+	@Override
 	public List<FeeStudentDto> queryFeeStudents(String musicGroupId,String search,Integer subjectId) {
 		return musicGroupStudentFeeDao.queryFeeStudents(musicGroupId,search,subjectId);
 	}

+ 21 - 46
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -55,6 +55,9 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	
 	@Autowired
 	private MusicGroupOrganizationCourseSettingsDetailDao musicGroupOrganizationCourseSettingsDetailDao;
+
+	@Autowired
+	private MusicGroupOrganizationCourseSettingsDao musicGroupOrganizationCourseSettingsDao;
 	
 	@Autowired
 	private IdGeneratorService idGeneratorService;
@@ -79,7 +82,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public boolean create(MusicGroupPaymentCalender musicGroupPaymentCalender) {
+	public Long create(MusicGroupPaymentCalender musicGroupPaymentCalender) {
 		
 		String musicGroupId = musicGroupPaymentCalender.getMusicGroupId();
 
@@ -94,7 +97,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		}
 		Date date = new Date();
 		Map<Integer, String> pushUserMap = new HashMap<>();
-		MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = null;
 		List<MusicGroupPaymentCalenderDetail> musicGroupPaymentCalenderDetailList = new ArrayList<>();
 		musicGroupPaymentCalender.setOperator(sysUser.getId());
 		musicGroupPaymentCalender.setCreateTime(date);
@@ -130,15 +132,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 					musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.AUDITING);
 				}
 			}
-			for(MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : musicGroupPaymentCalenderCourseSettingsList){
-				musicGroupPaymentCalenderCourseSettings.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
-				musicGroupPaymentCalenderCourseSettings.setCreateTime(date);
-				musicGroupPaymentCalenderCourseSettings.setUpdateTime(date);
-			}
-
-			if(musicGroupPaymentCalenderCourseSettingsList.size() > 0){
-				musicGroupPaymentCalenderCourseSettingsDao.batchInsert(musicGroupPaymentCalenderCourseSettingsList);
-			}
 		}else {
 			musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.AUDITING);
 		}
@@ -166,45 +159,22 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		}
 
 		musicGroupPaymentCalender.setExpectNum(0);
-		if(StringUtils.isNoneBlank(musicGroupPaymentCalender.getStudentIds())){
-			String[] sutdentIdList = musicGroupPaymentCalender.getStudentIds().split(",");
-			musicGroupPaymentCalender.setExpectNum(sutdentIdList.length);
-			
-			if (musicGroupPaymentCalender.getStatus() == PaymentCalenderStatusEnum.OPEN) {
-				for(String studentId : sutdentIdList){
-					pushUserMap.put(Integer.parseInt(studentId), studentId);
-				}
-			}
-
-			BigDecimal totalPrice = new BigDecimal(0);
-			//相同类型的课程如果修改了课程费用,需要走审批
-			for(Entry<CourseScheduleType, BigDecimal> entry : currentCoursePrice.entrySet()){
-				totalPrice.add(entry.getValue());
-			}
-			//创建缴费明细
-			for(String studentId : sutdentIdList){
-				musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();
-				musicGroupPaymentCalenderDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
-				musicGroupPaymentCalenderDetail.setCreateTime(date);
-				musicGroupPaymentCalenderDetail.setExpectAmount(totalPrice);
-				musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.NON_PAYMENT);
-				musicGroupPaymentCalenderDetail.setUpdateTime(date);
-				musicGroupPaymentCalenderDetail.setUserId(Integer.parseInt(studentId));
-				musicGroupPaymentCalenderDetail.setStartPaymentDate(musicGroupPaymentCalender.getStartPaymentDate());
-				musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
-				
-				musicGroupPaymentCalenderDetailList.add(musicGroupPaymentCalenderDetail);
-			}
-		}
 		//设置批次号
 		musicGroupPaymentCalender.setBatchNo(idGeneratorService.generatorId()+"");
 		musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
 
+		if(musicGroupPaymentCalenderCourseSettingsList.size() > 0){
+			MusicGroupOrganizationCourseSettings courseSettings = musicGroupOrganizationCourseSettingsDao.get(musicGroupPaymentCalender.getMusicGroupOrganizationCourseSettingId());
+			for(MusicGroupPaymentCalenderCourseSettings musicGroupPaymentCalenderCourseSettings : musicGroupPaymentCalenderCourseSettingsList){
+				musicGroupPaymentCalenderCourseSettings.setMusicGroupPaymentCalenderId(musicGroupPaymentCalender.getId());
+				musicGroupPaymentCalenderCourseSettings.setName(courseSettings.getName());
+			}
+			musicGroupPaymentCalenderCourseSettingsDao.batchInsert(musicGroupPaymentCalenderCourseSettingsList);
+		}
+
 		if (musicGroupPaymentCalenderDetailList.size() > 0) {
 			musicGroupPaymentCalenderDetailDao.batchInsert(musicGroupPaymentCalenderDetailList);
 		}
-		
-		
 		// 发送续费通知
 		if (pushUserMap.size() > 0) {
 			String configValue = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
@@ -213,8 +183,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_WAIT_RENEW_MESSAGE,
 					pushUserMap, null, 0, memo, "STUDENT", musicGroup.getName());
 		}
-
-		return true;
+		return musicGroupPaymentCalender.getId();
 	}
 
 	@Override
@@ -437,7 +406,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	}
 
 	@Override
-	public MusicGroupPaymentCalenderAuditDetailDto auditListDetail(Integer calenderId) {
+	public MusicGroupPaymentCalenderAuditDetailDto auditListDetail(Long calenderId) {
 		MusicGroupPaymentCalenderAuditDetailDto calenderAuditDetailDto = new MusicGroupPaymentCalenderAuditDetailDto();
 		MusicGroupPaymentCalenderAuditDto auditDto = musicGroupPaymentCalenderDao.getAuditDetail(calenderId);
 		if(auditDto.getOrganId() != null){
@@ -772,4 +741,10 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			}
 		}
 	}
+
+	@Override
+	public MusicGroupPaymentCalender findByMusicGroupRegCalender(String musicGroupId) {
+		return musicGroupPaymentCalenderDao.findByMusicGroupRegCalender(musicGroupId);
+	}
+
 }

+ 19 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -213,7 +213,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public String createGroup(SubFeeSettingDto subFeeSettingDto){
+    public String createGroup(SubFeeSettingDto subFeeSettingDto) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if (sysUser == null || sysUser.getId() == null) {
             throw new BizException("获取用户信息失败");
@@ -465,7 +465,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
         //获取课程价格
         MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getActualSubjectId());
-        BigDecimal courseFee = musicOneSubjectClassPlan.getFee();
+        BigDecimal courseFee = musicOneSubjectClassPlan.getFee() == null ? BigDecimal.ZERO : musicOneSubjectClassPlan.getFee();
         if (studentRegistration.getTemporaryCourseFee() != null) {
             courseFee = studentRegistration.getTemporaryCourseFee();
         }
@@ -680,7 +680,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
         //获取课程价格
         MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getActualSubjectId());
-        BigDecimal courseFee = musicOneSubjectClassPlan.getFee();
+        BigDecimal courseFee = musicOneSubjectClassPlan.getFee() == null ? BigDecimal.ZERO : musicOneSubjectClassPlan.getFee();
         if (studentRegistration.getTemporaryCourseFee() != null) {
             courseFee = studentRegistration.getTemporaryCourseFee();
         }
@@ -1047,6 +1047,14 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         musicGroup.setMemo(memo);
         musicGroup.setStatus(MusicGroupStatusEnum.AUDIT_FAILED);
         musicGroupDao.update(musicGroup);
+        //修改缴费项目状态
+        List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByMusicGroupId(musicGroupId);
+        if (musicGroupPaymentCalenders != null && musicGroupPaymentCalenders.size() > 0) {
+            musicGroupPaymentCalenders.forEach(e -> {
+                e.setStatus(MusicGroupPaymentCalender.PaymentCalenderStatusEnum.REJECT);
+            });
+            musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
+        }
     }
 
     @Override
@@ -1375,6 +1383,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public boolean extensionPaymentExpireDate(String musicGroupId, Date expireDate) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if (sysUser == null) {
@@ -1398,6 +1407,13 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         musicGroup.setPaymentExpireDate(expireDate);
         musicGroup.setUpdateTime(date);
         musicGroupDao.update(musicGroup);
+
+        MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderService.findByMusicGroupRegCalender(musicGroup.getId());
+        if (regCalender != null) {
+            regCalender.setDeadlinePaymentDate(expireDate);
+            musicGroupPaymentCalenderService.update(regCalender);
+        }
+
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "延长缴费", sysUser.getId(), ""));
         Set<Integer> roleIds = new HashSet<>(4);
         roleIds.add(SysUserRole.SECTION_MANAGER);

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

@@ -107,6 +107,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     private GoodsDao goodsDao;
     @Autowired
     private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
+    @Autowired
+    private MusicGroupPaymentCalenderDetailDao musicGroupPaymentCalenderDetailDao;
 
     @Override
     public BaseDAO<Long, StudentRegistration> getDAO() {
@@ -929,6 +931,25 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 sellOrderService.addOrderDetail2SellOrder(orderDetails, studentPaymentOrder, musicGroup);
             }
 
+            //缴费详情 calender detail
+            MusicGroupPaymentCalender musicGroupRegCalender = musicGroupPaymentCalenderService.findByMusicGroupRegCalender(musicGroup.getId());
+            MusicGroupPaymentCalenderDetail musicGroupPaymentCalenderDetail = new MusicGroupPaymentCalenderDetail();
+            musicGroupPaymentCalenderDetail.setMusicGroupPaymentCalenderId(musicGroupRegCalender.getId());
+            musicGroupPaymentCalenderDetail.setUserId(studentPaymentOrder.getUserId());
+            musicGroupPaymentCalenderDetail.setExpectAmount(studentPaymentOrder.getExpectAmount());
+            musicGroupPaymentCalenderDetail.setActualAmount(studentPaymentOrder.getActualAmount());
+            musicGroupPaymentCalenderDetail.setPaymentStatus(MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED);
+            musicGroupPaymentCalenderDetail.setUserStatus(null);
+            musicGroupPaymentCalenderDetail.setPayTime(nowDate);
+            musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupRegCalender.getDeadlinePaymentDate());
+            musicGroupPaymentCalenderDetail.setStartPaymentDate(musicGroupRegCalender.getStartPaymentDate());
+            musicGroupPaymentCalenderDetail.setOpen(1);
+            musicGroupPaymentCalenderDetail.setCreateTime(nowDate);
+            musicGroupPaymentCalenderDetail.setUpdateTime(nowDate);
+            musicGroupPaymentCalenderDetail.setPaymentOrderId(studentPaymentOrder.getId());
+            musicGroupPaymentCalenderDetail.setUseInCourse(0);
+            musicGroupPaymentCalenderDetailDao.insert(musicGroupPaymentCalenderDetail);
+
             //三方乐团不发送缴费通知
             if (musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN) {
                 //发送缴费成功通知(短信 + push)

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

@@ -50,7 +50,7 @@
 		<foreach collection="list" item="item" separator=",">
 		(#{item.musicGroupPaymentCalenderId},#{item.courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
 		#{item.courseTotalMinuties},#{item.unitPrice},#{item.courseOriginalPrice},#{item.courseCurrentPrice},
-		#{item.isStudentOptional},#{item.createTime},#{item.updateTime},#{item.name})
+		#{item.isStudentOptional},NOW(),NOW(),#{item.name})
 		</foreach>
 	</insert>
 
@@ -119,7 +119,8 @@
 		LEFT JOIN music_group_payment_calender_course_settings mgpccs
 		ON mgpccs.music_group_payment_calender_id_ = mgpc.id_
 		WHERE mgpc.music_group_id_ = #{musicGroupId}
-		AND mgpc.payment_type_ = 1
+		AND mgpc.payment_type_ = 'MUSIC_APPLY'
+		AND mgpc.pay_user_type_='STUDENT'
 	</select>
 
     <select id="getCalenderCourseSettings" resultMap="MusicGroupPaymentCalenderCourseSettings">

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

@@ -178,7 +178,7 @@
 	<delete id="deleteByUserIdAndMusicGroupId">
 		DELETE FROM music_group_payment_calender_detail
 		WHERE music_group_payment_calender_id_ IN (SELECT mgpc.id_ FROM music_group_payment_calender mgpc
-		WHERE mgpc.music_group_id_ = #{musicGroupId} AND mgpc.payment_status_ != 2)
+		WHERE mgpc.music_group_id_ = #{musicGroupId} AND mgpc.payment_status_ IN ('NO','OPEN'))
 		AND user_id_ = #{userId} AND payment_status_ = 'NON_PAYMENT'
 	</delete>
     <delete id="deleteByCalenderId">
@@ -267,14 +267,14 @@
 		SELECT * FROM music_group_payment_calender_detail mgpcd
 		LEFT JOIN music_group_payment_calender mgpc ON mgpcd.music_group_payment_calender_id_ = mgpc.id_
 		WHERE mgpc.music_group_id_=#{musicGroupId} AND mgpcd.user_id_=#{userId} AND mgpcd.payment_status_ = 'NON_PAYMENT'
-		AND (mgpc.payment_status_ = '1' OR mgpcd.open_=1)
+		AND (mgpc.status_ = 'OPEN' OR mgpcd.open_ = 1)
 		ORDER BY mgpc.start_payment_date_ DESC LIMIT 1
 	</select>
 	<select id="queryCanOpenList" resultMap="MusicGroupPaymentCalenderDetail">
 		SELECT mgpcd.*,mgpc.music_group_id_ FROM music_group_payment_calender_detail mgpcd
 		LEFT JOIN music_group_payment_calender mgpc ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
 		LEFT JOIN student_registration sr ON sr.music_group_id_ = mgpc.music_group_id_
-		WHERE mgpcd.payment_status_ = 'NON_PAYMENT' AND (mgpcd.open_ = 0 OR mgpcd.open_ IS NULL) AND sr.music_group_status_ != 'QUIT' AND mgpc.payment_status_ = 2
+		WHERE mgpcd.payment_status_ = 'NON_PAYMENT' AND (mgpcd.open_ = 0 OR mgpcd.open_ IS NULL) AND sr.music_group_status_ != 'QUIT' AND mgpc.status_ = 'OVER'
 		AND FIND_IN_SET(mgpcd.id_,#{ids})
 		GROUP BY mgpcd.id_
 	</select>
@@ -294,12 +294,12 @@
 	<select id="queryNoPaymentCanPushList" resultMap="MusicGroupPaymentCalenderDetail">
 		SELECT mgpcd.*,mgpc.music_group_id_ FROM music_group_payment_calender mgpc
 		LEFT JOIN music_group_payment_calender_detail mgpcd ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
-		WHERE DATE_FORMAT(mgpc.create_time_,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d') AND mgpc.payment_status_ = 1 AND mgpcd.payment_status_ = 'NON_PAYMENT'
+		WHERE DATE_FORMAT(mgpc.create_time_,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d') AND mgpc.status_ = 'OPEN' AND mgpcd.payment_status_ = 'NON_PAYMENT'
 	</select>
 	<select id="queryPaymentPushMap" resultType="java.util.Map">
 		SELECT mgpcd.user_id_ 'key',mgpc.music_group_id_ 'value' FROM music_group_payment_calender mgpc
 		LEFT JOIN music_group_payment_calender_detail mgpcd ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
-		WHERE DATE_FORMAT(mgpc.create_time_,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d') AND mgpc.payment_status_ = 1 AND mgpcd.payment_status_ = 'NON_PAYMENT'
+		WHERE DATE_FORMAT(mgpc.create_time_,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d') AND mgpc.status_ = 'OPEN' AND mgpcd.payment_status_ = 'NON_PAYMENT'
 	</select>
 	<select id="queryStudentIds" resultType="java.lang.Integer">
 		SELECT user_id_ FROM music_group_payment_calender_detail WHERE music_group_payment_calender_id_ = #{calenderId}
@@ -307,7 +307,7 @@
     <select id="countOpenPayment" resultType="java.lang.Integer">
 		SELECT COUNT(DISTINCT mgpcd.id_) FROM music_group_payment_calender mgpc
 		LEFT JOIN music_group_payment_calender_detail mgpcd ON mgpc.id_ = mgpcd.music_group_payment_calender_id_
-		WHERE mgpcd.user_id_ = #{userId} AND mgpc.music_group_id_ = #{musicGroupId} AND (mgpc.payment_status_ = 1 OR mgpcd.open_ = 1)
+		WHERE mgpcd.user_id_ = #{userId} AND mgpc.music_group_id_ = #{musicGroupId} AND (mgpc.status_ = 'OPEN' OR mgpcd.open_ = 1)
 		AND mgpcd.payment_status_ != 'PAID_COMPLETED'
 	</select>
 
@@ -360,4 +360,7 @@
 		SELECT SUM(mgpcd.actual_amount_) FROM music_group_payment_calender_detail mgpcd
 		WHERE mgpcd.music_group_payment_calender_id_ = #{id}
 	</select>
+	<select id="findByCalenderIdAndUserId" resultMap="MusicGroupPaymentCalenderDetail">
+		SELECT * FROM music_group_payment_calender_detail WHERE music_group_payment_calender_id_ = #{calenderId} AND user_id_ = #{userId} LIMIT 1
+	</select>
 </mapper>

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

@@ -437,4 +437,7 @@
         LEFT JOIN music_group_payment_calender_course_settings mgpccs ON mgpc.id_ = mgpccs.music_group_payment_calender_id_
         WHERE mgpc.id_ = #{calenderId} LIMIT 1
     </select>
+    <select id="findByMusicGroupRegCalender" resultMap="MusicGroupPaymentCalender">
+        SELECT * FROM music_group_payment_calender WHERE music_group_id_=#{musicGroupId} AND payment_type_='MUSIC_APPLY'
+    </select>
 </mapper>

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

@@ -106,7 +106,7 @@ public class MusicGroupController extends BaseController {
         if (sysUser == null) {
             return failed(HttpStatus.FORBIDDEN, "请登录");
         }
-        return succeed(musicGroupService.findTeachersByStuId(sysUser.getId(),search));
+        return succeed(musicGroupService.findTeachersByStuId(sysUser.getId(), search));
     }
 
 
@@ -154,18 +154,22 @@ public class MusicGroupController extends BaseController {
         if (studentRegistration.getPaymentStatus() != PaymentStatusEnum.OPEN) {
             return failed("乐团还未开启缴费,请等待通知");
         }
-		if (studentRegistration.getTemporaryCourseFee() == null) {
-			if (musicGroup.getStatus() != MusicGroupStatusEnum.APPLY && musicGroup.getStatus() != MusicGroupStatusEnum.PAY) {
-				return failed("乐团在" + musicGroup.getStatus().getMsg() + ",不能缴费");
-			}
-
-			if(musicGroup.getStatus() == MusicGroupStatusEnum.PAY){
-				Date now = new Date();
-				if (DateUtil.daysBetween(musicGroup.getPaymentExpireDate(), now) > 1) {
-					return failed("乐团缴费时间已截止");
-				}
-			}
-		}
+        if (studentRegistration.getTemporaryCourseFee() == null) {
+            if (musicGroup.getStatus() != MusicGroupStatusEnum.APPLY && musicGroup.getStatus() != MusicGroupStatusEnum.PAY) {
+                return failed("乐团在" + musicGroup.getStatus().getMsg() + ",不能缴费");
+            }
+
+            if (musicGroup.getStatus() == MusicGroupStatusEnum.PAY) {
+                Date now = new Date();
+                MusicGroupPaymentCalender regCalender = musicGroupPaymentCalenderDao.findByMusicGroupRegCalender(musicGroupId);
+                if (regCalender != null) {
+                    musicGroup.setPaymentExpireDate(regCalender.getDeadlinePaymentDate());
+                }
+                if (DateUtil.daysBetween(musicGroup.getPaymentExpireDate(), now) > 1) {
+                    return failed("乐团缴费时间已截止");
+                }
+            }
+        }
         studentRegistration.setOwnershipType(musicGroup.getOwnershipType());
         studentRegistration.setChargeTypeId(musicGroup.getChargeTypeId());
 
@@ -174,7 +178,7 @@ public class MusicGroupController extends BaseController {
 
     @ApiOperation(value = "查询续费信息")
     @GetMapping("/queryRenewInfo")
-    @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团id", required = true, dataType = "String")})
+    @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String")})
     public HttpResponseResult queryRenewInfo(String musicGroupId) throws Exception {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         Integer userId = sysUser.getId();
@@ -191,9 +195,9 @@ public class MusicGroupController extends BaseController {
             throw new BizException("已缴费");
         }
         MusicGroupPaymentCalenderDetail userLastCalenderDetail = musicGroupPaymentCalenderDetailDao.getUserLastCalenderDetail(musicGroupId, userId);
-        if(userLastCalenderDetail == null){
+        if (userLastCalenderDetail == null) {
             MusicGroupPaymentCalender lastCalender = musicGroupPaymentCalenderDao.getLastStartOne(musicGroupId);
-           String tips =  (lastCalender != null && lastCalender.getStatus() == PaymentCalenderStatusEnum.OVER)?"当前续费时间已截止,如有问题请联系指导老师":"当前续费未开始,如有问题请联系指导老师";
+            String tips = (lastCalender != null && lastCalender.getStatus() == PaymentCalenderStatusEnum.OVER) ? "当前续费时间已截止,如有问题请联系指导老师" : "当前续费未开始,如有问题请联系指导老师";
             throw new BizException(tips);
         }
 
@@ -210,38 +214,38 @@ public class MusicGroupController extends BaseController {
         model.put("amount", amount);
         model.put("nextPaymentDate", musicGroupStudentFee.getNextPaymentDate());
         model.put("musicGroupSubjectPlan", musicGroupSubjectPlan);
-        model.put("balance",studentRegistration.getBalance());
+        model.put("balance", studentRegistration.getBalance());
 
         return succeed(model);
     }
 
-	@ApiOperation(value = "续费")
-	@GetMapping("/renew")
-	@ApiImplicitParams({ @ApiImplicitParam(name = "musicGroupId", value = "乐团id", required = true, dataType = "String"),
-			@ApiImplicitParam(name = "isUseBalancePayment", value = "是否使用余额付款", required = true, dataType = "Boolean") })
-	public HttpResponseResult renew(String musicGroupId, Boolean isUseBalancePayment, boolean isRepeatPay) throws Exception {
-		SysUser sysUser = sysUserFeignService.queryUserInfo();
-		Integer userId = sysUser.getId();
-
-		if (isUseBalancePayment == null) {
-			isUseBalancePayment = false;
-		}
-		if (isRepeatPay == false) {
+    @ApiOperation(value = "续费")
+    @GetMapping("/renew")
+    @ApiImplicitParams({@ApiImplicitParam(name = "musicGroupId", value = "乐团id", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "isUseBalancePayment", value = "是否使用余额付款", required = true, dataType = "Boolean")})
+    public HttpResponseResult renew(String musicGroupId, Boolean isUseBalancePayment, boolean isRepeatPay) throws Exception {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        Integer userId = sysUser.getId();
+
+        if (isUseBalancePayment == null) {
+            isUseBalancePayment = false;
+        }
+        if (isRepeatPay == false) {
             // 判断是否存在支付中的记录
             List<StudentPaymentOrder> list = studentPaymentOrderService.queryByCondition(GroupType.MUSIC, musicGroupId, userId, DealStatusEnum.ING,
                     OrderTypeEnum.RENEW);
-			if (list.size() > 0) {
-				return failed(HttpStatus.CONTINUE, "您有待支付的订单");
-			}
-		}
+            if (list.size() > 0) {
+                return failed(HttpStatus.CONTINUE, "您有待支付的订单");
+            }
+        }
         MusicGroupPaymentCalenderDetail userLastCalenderDetail = musicGroupPaymentCalenderDetailDao.getUserLastCalenderDetail(musicGroupId, userId);
-        if(userLastCalenderDetail == null){
+        if (userLastCalenderDetail == null) {
             MusicGroupPaymentCalender lastCalender = musicGroupPaymentCalenderDao.getLastStartOne(musicGroupId);
-            String tips =  (lastCalender != null && lastCalender.getStatus() == PaymentCalenderStatusEnum.OVER)?"当前续费时间已截止,如有问题请联系指导老师":"当前续费未开始,如有问题请联系指导老师";
+            String tips = (lastCalender != null && lastCalender.getStatus() == PaymentCalenderStatusEnum.OVER) ? "当前续费时间已截止,如有问题请联系指导老师" : "当前续费未开始,如有问题请联系指导老师";
             throw new BizException(tips);
         }
         return succeed(musicGroupService.renew(musicGroupId, userId, isUseBalancePayment));
-	}
+    }
 
     @ApiOperation(value = "退团")
     @PostMapping("/quitMusicGroup")
@@ -274,7 +278,7 @@ public class MusicGroupController extends BaseController {
             return failed(HttpStatus.CONTINUE, "您有待支付的订单");
         }
         Map payMap = musicGroupService.pay(registerPayDto);
-        if(payMap.containsKey("tradeState")){
+        if (payMap.containsKey("tradeState")) {
             return failed(HttpStatus.CREATED, "恭喜您,报名成功!");
         }
 
@@ -296,7 +300,7 @@ public class MusicGroupController extends BaseController {
             return failed("您已支付成功,请勿重复支付");
         }
         Map payMap = musicGroupService.rePay(registerPayDto);
-        if(payMap.containsKey("tradeState")){
+        if (payMap.containsKey("tradeState")) {
             return failed(HttpStatus.CREATED, "恭喜您,报名成功!");
         }
         return succeed(payMap);

+ 87 - 0
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupPaymentCalenderController.java

@@ -0,0 +1,87 @@
+package com.ym.mec.student.controller;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.dto.RegisterPayDto;
+import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
+import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
+import com.ym.mec.biz.dal.enums.*;
+import com.ym.mec.biz.service.*;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.exception.BizException;
+import com.ym.mec.util.date.DateUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.util.*;
+
+@RequestMapping("musicGroupPaymentCalender")
+@Api(tags = "乐团缴费项目服务")
+@RestController
+public class MusicGroupPaymentCalenderController extends BaseController {
+
+    @Resource
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private MusicGroupPaymentCalenderService musicGroupPaymentCalenderService;
+    @Autowired
+    private StudentRegistrationService studentRegistrationService;
+    @Autowired
+    private MusicGroupDao musicGroupDao;
+    @Autowired
+    private MusicGroupPaymentCalenderDetailDao musicGroupPaymentCalenderDetailDao;
+    @Autowired
+    private MusicGroupPaymentCalenderCourseSettingsDao musicGroupPaymentCalenderCourseSettingsDao;
+
+
+    @ApiOperation(value = "查询学员缴费详情")
+    @GetMapping("/getCalenderInfo")
+    @ApiImplicitParams({@ApiImplicitParam(name = "calenderId", value = "缴费项目编号", required = true, dataType = "Long")})
+    public HttpResponseResult getCalenderInfo(Long calenderId){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        Integer userId = sysUser.getId();
+        MusicGroupPaymentCalender calender = musicGroupPaymentCalenderService.get(calenderId);
+        if (calender == null) {
+            return failed("缴费项目不存在");
+        }
+        String musicGroupId = calender.getMusicGroupId();
+        MusicGroupPaymentCalenderDetail calenderDetail = musicGroupPaymentCalenderDetailDao.findByCalenderIdAndUserId(calenderId, userId);
+        if (calenderDetail == null) {
+            throw new BizException("缴费项不存在该学员,请联系教务老师");
+        }
+        if(calenderDetail.getPaymentStatus() == PaymentStatus.PAID_COMPLETED){
+            throw new BizException("当前缴费项已缴费");
+        }else if(calenderDetail.getPaymentStatus() == PaymentStatus.PROCESSING){
+            throw new BizException("当前缴费项存在待处理的订单,请稍候尝试");
+        }
+        if(calender.getStatus() == PaymentCalenderStatusEnum.OPEN){
+            StudentRegistration studentRegistration = studentRegistrationService.queryByUserIdAndMusicGroupId(userId,musicGroupId);
+            if (studentRegistration == null) {
+                return failed("乐团报名信息找不到");
+            }
+            List<MusicGroupPaymentCalenderCourseSettings> calenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(calenderId);
+            ModelMap model = new ModelMap();
+            model.put("musicGroup",musicGroupDao.get(musicGroupId));
+            model.put("amount", calenderDetail.getExpectAmount());
+            model.put("calenderCourseSettings", calenderCourseSettings);
+            model.put("balance",studentRegistration.getBalance());
+            return succeed(model);
+        }else if(calender.getStatus() == PaymentCalenderStatusEnum.OVER){
+            throw new BizException("当前缴费项时间已截止,如有问题请联系指导老师");
+        }else {
+            throw new BizException("当前缴费项未开始,如有问题请联系指导老师");
+        }
+    }
+}

+ 8 - 11
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderController.java

@@ -11,12 +11,15 @@ import com.ym.mec.biz.service.MusicGroupPaymentCalenderCourseSettingsService;
 import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
+
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.MediaType;
 import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.Arrays;
@@ -55,8 +58,10 @@ public class MusicGroupPaymentCalenderController extends BaseController {
     @PostMapping(value = "/add", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/add')")
     public Object add(@RequestBody MusicGroupPaymentCalender musicGroupPaymentCalender) {
-        musicGroupPaymentCalenderService.create(musicGroupPaymentCalender);
-        return succeed();
+        Long musicGroupPaymentCalenderId = musicGroupPaymentCalenderService.create(musicGroupPaymentCalender);
+        ModelMap map = new ModelMap();
+        map.put("musicGroupPaymentCalenderId", musicGroupPaymentCalenderId);
+        return succeed(map);
     }
 
     @ApiOperation(value = "删除乐团缴费日历")
@@ -75,14 +80,6 @@ public class MusicGroupPaymentCalenderController extends BaseController {
         return succeed();
     }
 
-    @ApiOperation(value = "开启缴费的推送(暂时不用,没写完)")
-    @GetMapping("/paymentPush")
-    @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/paymentPush')")
-    public Object paymentPush(Long id,String userIds) {
-        musicGroupPaymentCalenderService.paymentPush(id,userIds);
-        return succeed();
-    }
-
     @ApiOperation(value = "乐团缴费日历审核列表")
     @GetMapping("/auditList")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/auditList')")
@@ -110,7 +107,7 @@ public class MusicGroupPaymentCalenderController extends BaseController {
     @ApiOperation(value = "乐团缴费日历审核列表详情")
     @GetMapping("/auditListDetail")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/auditListDetail')")
-    public Object auditListDetail(Integer calenderId) {
+    public Object auditListDetail(Long calenderId) {
         return succeed(musicGroupPaymentCalenderService.auditListDetail(calenderId));
     }
 

+ 16 - 5
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderDetailController.java

@@ -1,11 +1,11 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.biz.dal.page.MusicCalenderDetailQueryInfo;
-import com.ym.mec.biz.service.MusicGroupPaymentCalenderDetailService;
-import com.ym.mec.common.controller.BaseController;
-import com.ym.mec.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+
+import java.math.BigDecimal;
+import java.util.List;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -13,7 +13,10 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.math.BigDecimal;
+import com.ym.mec.biz.dal.page.MusicCalenderDetailQueryInfo;
+import com.ym.mec.biz.service.MusicGroupPaymentCalenderDetailService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
 
 @RequestMapping("musicGroupPaymentCalenderDetail")
 @Api(tags = "乐团缴费明细")
@@ -53,6 +56,14 @@ public class MusicGroupPaymentCalenderDetailController extends BaseController {
         return succeed();
     }
 
+    @ApiOperation(value = "乐团缴费记录新增学员")
+    @PostMapping("/batchAdd")
+    @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalenderDetail/batchAdd')")
+    public Object batchAdd(Long musicGroupPaymentCalenderId,List<Integer> userIdList) {
+        musicGroupPaymentCalenderDetailService.batchAdd(musicGroupPaymentCalenderId,userIdList);
+        return succeed();
+    }
+
     @ApiOperation(value = "批量删除缴费信息")
     @PostMapping("/batchDel")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalenderDetail/batchDel')")