Browse Source

缴费项目删掉不用的逻辑。课程时长是0时,不生成可排课时长

zouxuan 3 years ago
parent
commit
ec1b2b75dd

+ 3 - 20
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupPaymentCalenderDetailService.java

@@ -1,10 +1,5 @@
 package com.ym.mec.biz.service;
 
-import java.math.BigDecimal;
-import java.util.Date;
-import java.util.List;
-import java.util.Set;
-
 import com.ym.mec.biz.dal.dto.FeeStudentDto;
 import com.ym.mec.biz.dal.dto.MusicArrearageStudentDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDetailDto;
@@ -13,20 +8,14 @@ import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.page.ArrearageStudentsQueryInfo;
 import com.ym.mec.biz.dal.page.MusicCalenderDetailQueryInfo;
 import com.ym.mec.common.page.PageInfo;
-import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.BaseService;
 
-import org.apache.ibatis.annotations.Param;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
 
 public interface MusicGroupPaymentCalenderDetailService extends BaseService<Long, MusicGroupPaymentCalenderDetail> {
 
-    /**
-     * 修改学员预计缴费金额
-     * @param expectAmount
-     * @param ids
-     * @return
-     */
-//    void updateExpectAmount(BigDecimal expectAmount,BigDecimal expectMemberAmount,String ids);
 
     /**
      * 开启缴费
@@ -49,12 +38,6 @@ public interface MusicGroupPaymentCalenderDetailService extends BaseService<Long
      */
     void refreshUserMusicGroupPaymentStatusTask();
 
-    /**
-     * 乐团缴费记录新增学员
-     * @param musicGroupPaymentCalenderId
-     * @param userIdList
-     */
-    void batchAdd(Long musicGroupPaymentCalenderId, Set<Integer> userIdList,MusicGroup musicGroup,Boolean autoCreate);
 
     /**
      * 跨团合班新增学员

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

@@ -1,12 +1,9 @@
 package com.ym.mec.biz.service;
 
-import java.math.BigDecimal;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
 import com.ym.mec.biz.dal.dto.*;
-import com.ym.mec.biz.dal.entity.*;
+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.BaseOrganQueryInfo;
 import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -14,6 +11,11 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 import org.springframework.ui.ModelMap;
 
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 public interface MusicGroupPaymentCalenderService extends BaseService<Long, MusicGroupPaymentCalender> {
 
 	/**
@@ -55,11 +57,9 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 	/**
 	 * 进行中加学员
 	 * @param musicGroupPaymentCalender
-	 * @param musicGroupPaymentCalenderCourseSettingsList
 	 * @param musicGroup
 	 */
 	void addStudent(MusicGroupPaymentCalender musicGroupPaymentCalender,
-					List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList,
 					MusicGroup musicGroup);
 
 
@@ -133,13 +133,6 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 	void auditPass(String batchNo,String auditMemo);
 
 	/**
-	 * 审核通过后自动排课
-	 * @author zouxuan
-	 * @param batchNo
-	 */
-	public void autoClassGroupAdjust(MusicGroupStudentClassAdjust musicGroupStudentClassAdjust);
-
-	/**
 	 * @describe 审核拒绝
 	 * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
 	 * @author zouxuan

+ 20 - 296
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java

@@ -1,71 +1,15 @@
 package com.ym.mec.biz.service.impl;
 
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.STUDENT;
-import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.AUDITING;
-import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.NON_PAYMENT;
-import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED;
-
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import org.apache.commons.lang3.StringUtils;
-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.CloudTeacherOrderDao;
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentStudentCourseDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
-import com.ym.mec.biz.dal.dao.StudentDao;
-import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
-import com.ym.mec.biz.dal.dao.StudentPaymentOrderDetailDao;
-import com.ym.mec.biz.dal.dao.SysConfigDao;
-import com.ym.mec.biz.dal.dto.FeeStudentDto;
-import com.ym.mec.biz.dal.dto.MusicArrearageStudentDto;
-import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDetailDto;
-import com.ym.mec.biz.dal.dto.SimpleUserDto;
-import com.ym.mec.biz.dal.dto.StudentSubTotalCourseTimesDto;
-import com.ym.mec.biz.dal.entity.ActivityUserMapper;
-import com.ym.mec.biz.dal.entity.CloudTeacherOrder;
-import com.ym.mec.biz.dal.entity.MusicGroup;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
+import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.dto.*;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderActivity;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderMember;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderStudentDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentStudentCourseDetail;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
-import com.ym.mec.biz.dal.entity.Student;
-import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
-import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
-import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
 import com.ym.mec.biz.dal.page.ArrearageStudentsQueryInfo;
 import com.ym.mec.biz.dal.page.MusicCalenderDetailQueryInfo;
-import com.ym.mec.biz.service.ActivityUserMapperService;
-import com.ym.mec.biz.service.MusicGroupPaymentCalenderActivityService;
-import com.ym.mec.biz.service.MusicGroupPaymentCalenderDetailService;
-import com.ym.mec.biz.service.MusicGroupPaymentCalenderMemberService;
-import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
-import com.ym.mec.biz.service.SysConfigService;
-import com.ym.mec.biz.service.SysMessageService;
+import com.ym.mec.biz.service.*;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
@@ -73,6 +17,19 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PayUserType.STUDENT;
+import static com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender.PaymentCalenderStatusEnum.AUDITING;
+import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.NON_PAYMENT;
+import static com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED;
 
 @Service
 public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentCalenderDetail>  implements MusicGroupPaymentCalenderDetailService {
@@ -115,145 +72,6 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 		return musicGroupPaymentCalenderDetailDao;
 	}
 
-	/*@Override
-	@Transactional(rollbackFor = Exception.class)
-	public void updateExpectAmount(BigDecimal expectAmount,BigDecimal expectMemberAmount,String ids) {
-		if((expectAmount == null && expectMemberAmount == null) || StringUtils.isEmpty(ids)){
-			throw new BizException("参数校验失败");
-		}
-		if(expectAmount == null){
-			expectAmount = BigDecimal.ZERO;
-		}
-		if(expectMemberAmount == null){
-			expectMemberAmount = BigDecimal.ZERO;
-		}
-		//获取缴费列表
-		List<MusicGroupPaymentCalenderDetail> calenderDetails = musicGroupPaymentCalenderDetailDao.queryListByIds(ids);
-		if(calenderDetails.size() == 0){
-			throw new BizException("缴费记录不存在");
-		}
-		Date date = new Date();
-		MusicGroupPaymentCalender calender = musicGroupPaymentCalenderService.get(calenderDetails.get(0).getMusicGroupPaymentCalenderId());
-		MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
-
-		if(calender.getPaymentAmount().doubleValue() > 0d){
-			BigDecimal totalAmount = calender.getPaymentAmount();
-			BigDecimal subExpectAmount = expectAmount;
-			if(calender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.SPAN_GROUP_CLASS_ADJUST){
-				List<MusicGroupPaymentCalenderStudentDetail> studentDetails = musicGroupPaymentCalenderStudentDetailDao.findByBatchNoAndUserId(calender.getBatchNo(), calenderDetails.get(0).getUserId());
-				if(studentDetails.size() == 0){
-					throw new BizException("修改失败:缴费项目数据异常");
-				}
-				List<Integer> studentIds = calenderDetails.stream().map(e -> e.getUserId()).collect(Collectors.toList());
-				for (int i = 0; i < studentDetails.size(); i++) {
-					MusicGroupPaymentCalenderStudentDetail studentDetail = studentDetails.get(i);
-					if(i == studentDetails.size() - 1){
-						musicGroupPaymentCalenderStudentDetailDao.updateByCourseType(studentDetail.getCourseType(),calender.getBatchNo(),studentIds,subExpectAmount);
-					}else {
-						BigDecimal divide = studentDetail.getCourseCurrentPrice().divide(totalAmount, CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
-						BigDecimal courseAmount = divide.multiply(expectAmount).setScale(0, BigDecimal.ROUND_DOWN);
-						subExpectAmount = subExpectAmount.subtract(courseAmount);
-						musicGroupPaymentCalenderStudentDetailDao.updateByCourseType(studentDetail.getCourseType(),calender.getBatchNo(),studentIds,courseAmount);
-					}
-				}
-			}else {
-				List<MusicGroupPaymentCalenderCourseSettings> courseSettingsList = musicGroupPaymentCalenderCourseSettingsDao.getWithPaymentCalender(calender.getId());
-				if(courseSettingsList.size() == 0){
-					throw new BizException("修改失败:缴费项目数据异常");
-				}
-				for (int i = 0; i < courseSettingsList.size(); i++) {
-					MusicGroupPaymentCalenderCourseSettings courseSettings = courseSettingsList.get(i);
-					if(i == courseSettingsList.size() - 1){
-						musicGroupPaymentStudentCourseDetailDao.updateByCourseType(courseSettings.getCourseType().getCode(),ids,subExpectAmount);
-					}else {
-						BigDecimal divide = courseSettings.getCourseCurrentPrice().divide(totalAmount, CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
-						BigDecimal courseAmount = divide.multiply(expectAmount).setScale(0, BigDecimal.ROUND_DOWN);
-						subExpectAmount = subExpectAmount.subtract(courseAmount);
-						musicGroupPaymentStudentCourseDetailDao.updateByCourseType(courseSettings.getCourseType().getCode(),ids,courseAmount);
-					}
-				}
-			}
-		}
-		//为了解决学员欠费数量的问题,只要学员没有缴费就可以修改金额
-		Set<Integer> studentIds = new HashSet<>();
-		for (MusicGroupPaymentCalenderDetail e : calenderDetails) {
-			if(e.getPaymentStatus() == null || e.getPaymentStatus() != NON_PAYMENT){
-				throw new BizException("修改失败:缴费状态不匹配");
-			}
-			e.setUpdateTime(date);
-//			e.setExpectAmount(expectAmount);
-//			e.setExpectMemberAmount(expectMemberAmount);
-
-			if(expectAmount.doubleValue() > 0 || expectMemberAmount.doubleValue() > 0){
-				if((e.getOpen() != null && e.getOpen() == 1) || calender.getStatus() == PaymentCalenderStatusEnum.OPEN){
-					studentIds.add(e.getUserId());
-				}
-			}else {
-				// 添加会员有效时长
-				if(calender.getMemberRankSettingId() != null){
-					CloudTeacherOrder cloudTeacherOrder = new CloudTeacherOrder();
-					cloudTeacherOrder.setOrganId(musicGroup.getOrganId());
-					cloudTeacherOrder.setType(calender.getMemberPeriod());
-					cloudTeacherOrder.setTime(calender.getMemberValidDate());
-					//只用会员价格
-					cloudTeacherOrder.setAmount(expectMemberAmount);
-					cloudTeacherOrder.setStudentId(e.getUserId());
-					cloudTeacherOrder.setLevel(calender.getMemberRankSettingId());
-					cloudTeacherOrder.setStatus(1);
-					if(calender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.ADD_STUDENT){
-						cloudTeacherOrder.setRemark("进行中乐团加学生,缴费金额改为0元");
-					}else {
-						cloudTeacherOrder.setRemark("乐团续费,缴费金额改为0元");
-					}
-					cloudTeacherOrder.setMusicGroupId(calender.getMusicGroupId());
-					cloudTeacherOrderDao.insert(cloudTeacherOrder);
-//					studentService.updateMemberRank(cloudTeacherOrder);
-				}
-				calender.setActualNum((calender.getActualNum()==null?0:calender.getActualNum()) + 1);
-				e.setPaymentStatus(PAID_COMPLETED);
-				if(calender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.ADD_STUDENT){
-					MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(e.getUserId(), calender.getMusicGroupId());
-					if (musicGroupStudentFee != null) {
-						musicGroupStudentFee.setUpdateTime(date);
-						musicGroupStudentFee.setLatestPaidTime(date);
-						musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
-						musicGroupStudentFee.setTemporaryCourseFee(new BigDecimal(0));
-						musicGroupStudentFeeDao.update(musicGroupStudentFee);
-					}
-					//如果是进行中加学员
-					StudentRegistration studentRegistration = studentRegistrationDao.queryByUserIdAndMusicGroupId(e.getUserId(), calender.getMusicGroupId());
-					studentRegistration.setPaymentStatus(YES);
-					studentRegistration.setMusicGroupStatus(StudentMusicGroupStatusEnum.NORMAL);
-					studentRegistrationDao.update(studentRegistration);
-
-					//统计变更学员数
-					groupEventSource.musicGroupStudentChangeEvent(calender.getMusicGroupId(), StudentMusicGroupStatusEnum.NORMAL, new ArrayList<>(Arrays.asList(e.getUserId())));
-				}
-			}
-		}
-		musicGroupPaymentCalenderDao.update(calender);
-		musicGroupPaymentCalenderDetailDao.batchUpdate(calenderDetails);
-		//推送消息
-		if (calender.getPayUserType() == STUDENT && studentIds.size() > 0) {
-			Map<Integer, String> push = new HashMap<>();
-			for (Integer userId : studentIds) {
-				push.put(userId, userId + "");
-			}
-			String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
-			String memo = "4?" + baseUrl + "/#/musicGroupRenew?calenderId="+calender.getId()+"&id=" + calender.getMusicGroupId();
-			// 发送续费通知
-			sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_WAIT_RENEW_MESSAGE, push,
-					null, 0, memo,"STUDENT",musicGroup.getName());
-
-			//获取未缴费且不是0元的学员列表
-			Map<Integer,String> studentMaps = MapUtil.convertMybatisMap(musicGroupPaymentCalenderDetailDao.queryNoPaymentAndNotZeroStudent(calender.getId(),studentIds));
-			if(studentMaps.size() > 0){
-				sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.STUDENT_SMS_WAIT_RENEW_MESSAGE, studentMaps,
-						null, 0, memo, null, musicGroup.getName());
-			}
-		}
-	}*/
-
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public String openPayment(String ids, Date startPaymentDate, Date deadlinePaymentDate) {
@@ -314,103 +132,6 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 		musicGroupPaymentCalenderDetailDao.refreshUserMusicGroupPaymentStatusTask();
 	}
 
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public void batchAdd(Long musicGroupPaymentCalenderId, Set<Integer> userIdList,MusicGroup musicGroup,Boolean autoCreate) {
-		
-		MusicGroupPaymentCalender musicGroupPaymentCalender = musicGroupPaymentCalenderService.get(musicGroupPaymentCalenderId);
-		if(musicGroupPaymentCalender == null){
-			throw new BizException("查询缴费信息失败");
-		}
-		if(musicGroupPaymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY){
-			throw new BizException("操作失败:报名缴费项不允许添加学员");
-		}
-		if (musicGroupPaymentCalender.getStatus() == PaymentCalenderStatusEnum.AUDITING
-				|| musicGroupPaymentCalender.getStatus() == PaymentCalenderStatusEnum.REJECT) {
-			throw new BizException("当前缴费状态不能添加学生");
-		}
-		
-		//判断学生是否已存在
-		Set<Integer> userList = musicGroupPaymentCalenderDetailDao.queryStudentIds(musicGroupPaymentCalenderId);
-
-		if(Collections.disjoint(userList, userIdList) == false){
-			throw new BizException("操作失败:包含已存在的学员");
-		}
-		
-		List<MusicGroupPaymentCalenderCourseSettings> courseSettingsList = musicGroupPaymentCalenderCourseSettingsDao.getWithPaymentCalender(musicGroupPaymentCalenderId);
-
-		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);
-			if (musicGroupPaymentCalender.getCurrentTotalAmount().compareTo(BigDecimal.ZERO) == 0) {
-				musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
-			} else {
-				musicGroupPaymentCalenderDetail.setPaymentStatus(PaymentStatus.NON_PAYMENT);
-			}
-			musicGroupPaymentCalenderDetail.setUpdateTime(date);
-			musicGroupPaymentCalenderDetail.setUserId(studentId);
-			musicGroupPaymentCalenderDetail.setStartPaymentDate(musicGroupPaymentCalender.getStartPaymentDate());
-			musicGroupPaymentCalenderDetail.setDeadlinePaymentDate(musicGroupPaymentCalender.getDeadlinePaymentDate());
-			musicGroupPaymentCalenderDetail.setResponsibleUserId(musicGroupPaymentCalender.getOperator());
-
-			musicGroupPaymentCalenderDetailList.add(musicGroupPaymentCalenderDetail);
-		}
-
-		Map<Integer,Long> userMap = new HashMap<>();
-		if (musicGroupPaymentCalenderDetailList.size() > 0) {
-			musicGroupPaymentCalenderDetailDao.batchInsert(musicGroupPaymentCalenderDetailList);
-			for(MusicGroupPaymentCalenderDetail cd : musicGroupPaymentCalenderDetailList){
-				userMap.put(cd.getUserId(), cd.getId());
-			}
-		}
-		//更新预计缴费人数
-		musicGroupPaymentCalender.setExpectNum(musicGroupPaymentCalender.getExpectNum() + userIdList.size());
-		if (musicGroupPaymentCalender.getCurrentTotalAmount().compareTo(BigDecimal.ZERO) == 0) {
-			musicGroupPaymentCalender.setActualNum(musicGroupPaymentCalender.getActualNum() + userIdList.size());
-		}
-		musicGroupPaymentCalender.setUpdateTime(date);
-		musicGroupPaymentCalenderService.update(musicGroupPaymentCalender);
-
-		List<MusicGroupPaymentStudentCourseDetail> musicGroupPaymentStudentCourseDetailList = new ArrayList<MusicGroupPaymentStudentCourseDetail>();
-		MusicGroupPaymentStudentCourseDetail musicGroupPaymentStudentCourseDetail = null;
-		if(courseSettingsList.size() > 0){
-			//创建学生课排课分钟数
-			for(Integer studentId : userIdList){
-				for(MusicGroupPaymentCalenderCourseSettings courseSettings : courseSettingsList){
-					if (courseSettings.getIsStudentOptional() == true || courseSettings.getCourseTotalMinuties() == null || courseSettings.getCourseTotalMinuties() == 0) {
-						continue;
-					}
-					musicGroupPaymentStudentCourseDetail = new MusicGroupPaymentStudentCourseDetail();
-					musicGroupPaymentStudentCourseDetail.setCourseType(courseSettings.getCourseType());
-					musicGroupPaymentStudentCourseDetail.setCreateTime(date);
-					musicGroupPaymentStudentCourseDetail.setMusicGroupPaymentCalenderId(musicGroupPaymentCalenderId);
-					musicGroupPaymentStudentCourseDetail.setMusicGroupPaymentCalenderDetailId(userMap.get(studentId));
-					musicGroupPaymentStudentCourseDetail.setTotalCourseMinutes(courseSettings.getCourseTotalMinuties());
-					musicGroupPaymentStudentCourseDetail.setCourseOriginalPrice(courseSettings.getCourseOriginalPrice());
-					musicGroupPaymentStudentCourseDetail.setCourseCurrentPrice(courseSettings.getCourseCurrentPrice());
-					musicGroupPaymentStudentCourseDetail.setUpdateTime(date);
-					musicGroupPaymentStudentCourseDetail.setUsedCourseMinutes(0);
-					musicGroupPaymentStudentCourseDetail.setUserId(studentId);
-					musicGroupPaymentStudentCourseDetailList.add(musicGroupPaymentStudentCourseDetail);
-				}
-			}
-		}
-
-		if(musicGroupPaymentStudentCourseDetailList.size() > 0){
-			musicGroupPaymentStudentCourseDetailDao.batchInsert(musicGroupPaymentStudentCourseDetailList);
-		}
-		if(!autoCreate){
-			//给学员推送缴费通知
-			if(musicGroupPaymentCalender.getPayUserType() == STUDENT && musicGroupPaymentCalender.getStatus() == PaymentCalenderStatusEnum.OPEN){
-				musicGroupPaymentCalenderService.pushWaitRenewMessage(musicGroupPaymentCalenderId,musicGroupDao.get(musicGroupPaymentCalender.getMusicGroupId()),userIdList);
-			}
-		}
-	}
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
@@ -590,6 +311,9 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 			MusicGroupPaymentStudentCourseDetail musicGroupPaymentStudentCourseDetail = null;
 			for(Integer studentId : userIdList){
 				for(MusicGroupPaymentCalenderCourseSettings courseSettings : courseSettingsList){
+					if (courseSettings.getCourseTotalMinuties() == null || courseSettings.getCourseTotalMinuties() == 0) {
+						continue;
+					}
 					musicGroupPaymentStudentCourseDetail = new MusicGroupPaymentStudentCourseDetail();
 					musicGroupPaymentStudentCourseDetail.setCourseType(courseSettings.getCourseType());
 					musicGroupPaymentStudentCourseDetail.setCreateTime(date);

+ 15 - 93
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -32,7 +32,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Isolation;
-import org.springframework.transaction.annotation.TransactionAnnotationParser;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 import org.springframework.ui.ModelMap;
@@ -76,14 +75,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
     @Autowired
     private MusicGroupDao musicGroupDao;
     @Autowired
-    private ClassGroupDao classGroupDao;
-    @Autowired
     private CourseScheduleDao courseScheduleDao;
     @Autowired
-    private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
-    @Autowired
-    private TeacherAttendanceDao teacherAttendanceDao;
-    @Autowired
     private MusicGroupBuildLogDao musicGroupBuildLogDao;
     @Autowired
     private SysConfigDao sysConfigDao;
@@ -96,12 +89,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
     @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
-    private ImGroupMemberService imGroupMemberService;
-    @Autowired
     private ImUserFriendService imUserFriendService;
     @Autowired
-    private ClassGroupStudentMapperDao classGroupStudentMapperDao;
-    @Autowired
     private MusicGroupStudentClassAdjustDao musicGroupStudentClassAdjustDao;
     @Autowired
     private MusicGroupPaymentCalenderDetailService musicGroupPaymentCalenderDetailService;
@@ -415,7 +404,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
                     null, null, MessageTypeEnum.BACKSTAGE_PAYMENT_CALENDER_AUDIT, organization.getName(), musicGroup.getName());
         } else {
             if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
-                addStudent(musicGroupPaymentCalender, musicGroupPaymentCalender.getMusicGroupPaymentCalenderCourseSettingsList(), musicGroup);
+                addStudent(musicGroupPaymentCalender, musicGroup);
                 //将0元未缴费学员缴费状态更新为已缴费
                 this.updateNoPaymentAndZeroPaymentStatus(musicGroupPaymentCalender, true);
                 // 学生加到班级
@@ -622,13 +611,13 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
         musicGroupPaymentCalender.setBatchNo(batchNo);
         musicGroupPaymentCalenderDto.setBatchNo(batchNo);
         musicGroupPaymentCalenderDao.insert(musicGroupPaymentCalender);
-        List<MusicGroupPaymentCalenderCourseSettings> currentMusicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalender
-                .getMusicGroupPaymentCalenderCourseSettingsList();
+//        List<MusicGroupPaymentCalenderCourseSettings> currentMusicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalender
+//                .getMusicGroupPaymentCalenderCourseSettingsList();
 
         if (musicGroupPaymentCalender.getStatus() != AUDITING) {
             // 如果是进行中加学生
             if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
-                addStudent(musicGroupPaymentCalender, currentMusicGroupPaymentCalenderCourseSettings, musicGroup);
+                addStudent(musicGroupPaymentCalender, musicGroup);
             } else if (musicGroupPaymentCalender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST) {
                 //如果是跨团班级合并,添加学员
                 musicGroupPaymentCalenderDetailService.batchAdd(musicGroupPaymentCalender, musicGroupPaymentCalenderDto.getMusicGroupPaymentCalenderStudentDetails());
@@ -689,7 +678,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
     @Transactional(rollbackFor = Exception.class)
     @Override
     public void addStudent(MusicGroupPaymentCalender musicGroupPaymentCalender,
-                           List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettingsList,
                            MusicGroup musicGroup) {
         //如果是进行中加学生
         Date date = new Date();
@@ -697,8 +685,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
         if (StringUtils.isNoneBlank(studentIdStr)) {
             //当前乐团是否有预排课计划
             MusicGroupSchoolTermCourseDetail termCourseDetail = musicGroupSchoolTermCourseDetailDao.findByCourseDateAndMusicGroupId(musicGroup.getId(), null, 0);
-            List<MusicGroupPaymentStudentCourseDetail> musicGroupPaymentStudentCourseDetailList = new ArrayList<MusicGroupPaymentStudentCourseDetail>();
-            MusicGroupPaymentStudentCourseDetail musicGroupPaymentStudentCourseDetail = null;
+//            List<MusicGroupPaymentStudentCourseDetail> musicGroupPaymentStudentCourseDetailList = new ArrayList<MusicGroupPaymentStudentCourseDetail>();
+//            MusicGroupPaymentStudentCourseDetail musicGroupPaymentStudentCourseDetail = null;
 
             List<MusicGroupPaymentCalenderActivity> calenderActivities = musicGroupPaymentCalenderActivityService.findByCalenderId(musicGroupPaymentCalender.getId());
             MusicGroupPaymentCalenderMember calenderMember = musicGroupPaymentCalenderMemberService.findByCalenderId(musicGroupPaymentCalender.getId());
@@ -772,7 +760,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
                     //统计变更学员数
                     groupEventSource.musicGroupStudentChangeEvent(musicGroupPaymentCalender.getMusicGroupId(), StudentMusicGroupStatusEnum.NORMAL, new ArrayList<>(Arrays.asList(Integer.parseInt(studentId))));
                 }
-                if (musicGroupPaymentCalenderCourseSettingsList != null && musicGroupPaymentCalenderCourseSettingsList.size() > 0) {
+                /*if (musicGroupPaymentCalenderCourseSettingsList != null && musicGroupPaymentCalenderCourseSettingsList.size() > 0) {
                     // 学生加课程明细
                     for (MusicGroupPaymentCalenderCourseSettings courseSettings : musicGroupPaymentCalenderCourseSettingsList) {
                         if (courseSettings.getIsStudentOptional() == true) {
@@ -791,11 +779,10 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
                         musicGroupPaymentStudentCourseDetail.setUserId(Integer.parseInt(studentId));
                         musicGroupPaymentStudentCourseDetailList.add(musicGroupPaymentStudentCourseDetail);
                     }
-
                 }
                 if (musicGroupPaymentStudentCourseDetailList.size() > 0) {
                     musicGroupPaymentStudentCourseDetailDao.batchInsert(musicGroupPaymentStudentCourseDetailList);
-                }
+                }*/
             }
         }
     }
@@ -927,71 +914,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
         return calenderAuditDetailDto;
     }
 
-    //审核通过后自动排课
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void autoClassGroupAdjust(MusicGroupStudentClassAdjust musicGroupStudentClassAdjust) {
-        List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(musicGroupStudentClassAdjust.getBatchNo());
-        for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
-            if (musicGroupPaymentCalender.getStatus() == AUDITING || musicGroupPaymentCalender.getStatus() == REJECT) {
-                return;
-            }
-        }
-        List<ClassGroup4MixDto> classGroup4MixDtos = JSON.parseArray(musicGroupStudentClassAdjust.getNewClassGroupJson(), ClassGroup4MixDto.class);
-        String musicGroupId = musicGroupPaymentCalenders.get(0).getMusicGroupId();
-        MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
-        for (MusicGroupPaymentCalender calender : musicGroupPaymentCalenders) {
-            //缴费项目添加学员
-            int[] ints = Arrays.stream(calender.getStudentIds().split(",")).mapToInt(Integer::parseInt).toArray();
-            Set<Integer> list2 = Arrays.stream(ints).boxed().collect(Collectors.toSet());
-            musicGroupPaymentCalenderDetailService.batchAdd(calender.getId(), list2, musicGroup, false);
-        }
-        //每种课程类型单独排课
-        ClassGroup classGroup = null;
-        for (ClassGroup4MixDto classGroup4MixDto : classGroup4MixDtos) {
-            classGroup4MixDto.setClassGroup(classGroup);
-            classGroup4MixDto.setMusicGroupStudentClassAdjustId(musicGroupStudentClassAdjust.getId());
-            classGroup4MixDto.setClassCourseMinute(musicGroupStudentClassAdjust.getClassCourseMinute());
-            classGroup = classGroupService.classGroupAdjust2(classGroup4MixDto);
-        }
-        //排课完成后删除所选课程
-        List<Long> courseIds = JSON.parseArray(musicGroupStudentClassAdjust.getSubLockCourseIds(), Long.class);
-        List<Integer> studentIds = JSON.parseArray(musicGroupStudentClassAdjust.getStudentIds(), Integer.class);
-        courseScheduleDao.deleteMusicGroupCourseSchedulesWithStudents(courseIds, studentIds);
-        //解冻课程
-        List<Long> allCourseIds = JSON.parseArray(musicGroupStudentClassAdjust.getAllLockCourseIds(), Long.class);
-        courseScheduleDao.batchUpdateLockByCourseIds(allCourseIds, 0, null);
-        //解冻班级
-        List<Integer> classGroupIds = JSON.parseArray(musicGroupStudentClassAdjust.getClassGroupIds(), Integer.class);
-        classGroupDao.batchUpdateLockByClassGroupIds(classGroupIds, 0);
-        //删除班级学员
-        musicGroupStudentClassAdjustDao.update(musicGroupStudentClassAdjust);
-        String classGroupStudents = musicGroupStudentClassAdjust.getClassGroupStudents();
-        if (StringUtils.isNotEmpty(classGroupStudents)) {
-            List<Map> maps = JSON.parseArray(classGroupStudents, Map.class);
-            for (Map<Integer, String> classGroupStudent : maps) {
-                Set<Integer> integers = classGroupStudent.keySet();
-                for (Integer integer : integers) {
-                    List<Integer> collect = Arrays.asList(classGroupStudent.get(integer).split(",")).stream().map(e -> Integer.parseInt(e)).collect(Collectors.toList());
-                    //学员退出群聊
-                    imGroupMemberService.quit(integer.longValue(), collect);
-                    classGroupStudentMapperDao.deleteByClassGroupIdAndStudents(integer, classGroupStudent.get(integer));
-                }
-            }
-        }
-        //获取没有学员的课程列表
-        List<Long> delCourseIds = courseScheduleDao.findNoStudentCourseIds(courseIds);
-        if (delCourseIds != null && delCourseIds.size() > 0) {
-            //删除课程
-            courseScheduleDao.deleteCourseSchedulesByClassGroupIds(delCourseIds);
-            //删除教师考勤
-            teacherAttendanceDao.batchDeleteByCourseSchedules(delCourseIds);
-            //删除教师课酬
-            courseScheduleTeacherSalaryDao.batchDeleteByCourseScheduleIds(delCourseIds);
-        }
-        classGroupService.batchUpdateTeacherSalary(classGroupIds);
-        imUserFriendService.refreshGroupImUserFriend(musicGroupId, GroupType.MUSIC);
-    }
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -1025,8 +947,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 
                 if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
                     musicGroupPaymentCalender.setExpectNum(1);
-                    List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsService.queryCalenderCourseSettings(musicGroupPaymentCalender.getId());
-                    addStudent(musicGroupPaymentCalender, musicGroupPaymentCalenderCourseSettings, musicGroup);
+//                    List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsService.queryCalenderCourseSettings(musicGroupPaymentCalender.getId());
+                    addStudent(musicGroupPaymentCalender, musicGroup);
                 }
             }
             if (calender.getPaymentType() == ADD_STUDENT || calender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST) {
@@ -1075,11 +997,11 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
                     classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(calender.getStudentIds()), classGroupIdStr, batchNo,
                             musicGroupPaymentCalenderCourseSettingsService.queryCalenderCourseSettingsByBatchNo(batchNo), musicGroup);
                 }
-                MusicGroupStudentClassAdjust musicGroupStudentClassAdjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
-                if (musicGroupStudentClassAdjust != null) {
-                    //如果是合班缴费
-                    autoClassGroupAdjust(musicGroupStudentClassAdjust);
-                }
+//                MusicGroupStudentClassAdjust musicGroupStudentClassAdjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
+//                if (musicGroupStudentClassAdjust != null) {
+//                    如果是合班缴费
+//                    autoClassGroupAdjust(musicGroupStudentClassAdjust);
+//                }
             } else if (calender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST) {
                 //删除和解冻班级,课程信息
                 MusicGroupStudentClassAdjust adjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);

+ 0 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/QuestionnaireUserResultServiceImpl.java

@@ -17,7 +17,6 @@ import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
-import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.util.collection.MapUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -28,8 +27,6 @@ import java.time.Instant;
 import java.util.*;
 import java.util.stream.Collectors;
 
-import static com.ym.mec.biz.dal.enums.QuestionnaireActiveTypeEnum.CLOUD_TEACHER_FEEDBACK;
-
 @Service
 public class QuestionnaireUserResultServiceImpl extends BaseServiceImpl<Long, QuestionnaireUserResult>  implements QuestionnaireUserResultService {
 	
@@ -45,8 +42,6 @@ public class QuestionnaireUserResultServiceImpl extends BaseServiceImpl<Long, Qu
 	private TeacherDao teacherDao;
 	@Autowired
 	private StudentDao studentDao;
-	@Autowired
-	private QuestionnaireQuestionDao questionnaireQuestionDao;
 
 	@Override
 	public BaseDAO<Long, QuestionnaireUserResult> getDAO() {

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

@@ -7,15 +7,14 @@ import com.ym.mec.biz.dal.dto.ReplacementInstrumentActivityDto;
 import com.ym.mec.biz.dal.entity.QuestionnaireTopic;
 import com.ym.mec.biz.dal.entity.QuestionnaireUserResult;
 import com.ym.mec.biz.dal.enums.QuestionnaireActiveTypeEnum;
-import com.ym.mec.biz.dal.page.QuestionnaireUserResultQueryInfo;
 import com.ym.mec.biz.service.QuestionnaireUserResultService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.exception.BizException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
+
 import java.util.HashMap;
 import java.util.List;