Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

Joburgess 5 лет назад
Родитель
Сommit
44f8633d0e

+ 59 - 39
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleStudentPaymentDao.java

@@ -24,11 +24,11 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
     int batchInsert(List<CourseScheduleStudentPayment> courseScheduleStudentPayments);
 
     /**
+     * @param courseScheduleStudentPayments:
+     * @return int
      * @describe 批量更新
      * @author Joburgess
      * @date 2020/1/10
-     * @param courseScheduleStudentPayments:
-     * @return int
      */
     int batchUpdate(@Param("courseScheduleStudentPayments") List<CourseScheduleStudentPayment> courseScheduleStudentPayments);
 
@@ -115,15 +115,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: 小课编号
@@ -137,103 +137,110 @@ 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获取学员剩余课程数
+     *
      * @param musicGroupIds
      * @param userId
      * @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);
 
     /**
      * 根据乐团,vip状态获取编号
+     *
      * @return
      */
     Set<Integer> queryMusicStudentPer();
+
     /**
      * 根据乐团,vip状态获取编号
+     *
      * @return
      */
     Set<Integer> queryVipStudentPer();
 
     /**
+     * @param courseIds: 统计课程上的学生人数
+     * @return java.util.List<java.util.Map < java.lang.Integer, java.lang.Integer>>
      * @describe
      * @author Joburgess
      * @date 2020/1/8
-     * @param courseIds: 统计课程上的学生人数
-     * @return java.util.List<java.util.Map<java.lang.Integer,java.lang.Integer>>
      */
     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);
 
     /**
      * 获取课程学员数量
+     *
      * @param courseScheduleId
      * @return
      */
     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);
 
     /**
      * 获取当前课程的学员列表
+     *
      * @param courseScheduleId
      * @return
      */
@@ -241,25 +248,27 @@ 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);
 
     /**
+     * @param monday:
+     * @return java.util.List<java.lang.Integer>
      * @describe 获取在指定时间之后不存在网管课的学员编号列表
      * @author Joburgess
      * @date 2020/4/10
-     * @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
      */
     List<StudentCourseTimesDto> queryStudentNotStartCourseTimesOfOnline();
@@ -267,25 +276,27 @@ 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);
 
     /**
      * 获取学员指定课程类型的剩余课时数
+     *
      * @param studentId
      * @param courseScheduleType
      * @return
      */
     int countStudentNotStartCourseNumWithCourseType(@Param("studentId") Integer studentId,
-                                                    @Param("courseScheduleType")CourseSchedule.CourseScheduleType courseScheduleType);
+                                                    @Param("courseScheduleType") CourseSchedule.CourseScheduleType courseScheduleType);
 
     /**
      * 批量操作节拍器状态
+     *
      * @param courseScheduleId
      * @param userId
      */
@@ -293,6 +304,7 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
 
     /**
      * 获取用户的节拍器信息
+     *
      * @param userIds
      * @param courseScheduleId
      * @return
@@ -301,6 +313,7 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
 
     /**
      * 获取单个用户的midi
+     *
      * @param courseScheduleId
      * @param userId
      * @return
@@ -308,18 +321,19 @@ 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);
 
     /**
      * 获取未进入教室的学员列表
+     *
      * @param roomId
      * @param courseScheduleId
      * @return
@@ -327,11 +341,17 @@ 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
-     * @param batchNo:
-     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment>
      */
     List<CourseScheduleStudentPayment> findByBatchNo(@Param("batchNo") String batchNo);
+
+
+    /**
+     * 获取学生班级未开始的课程
+     */
+    List<CourseScheduleStudentPayment> getClassGroupNoStartCourse(@Param("classGroupIds") List<Integer> classGroupIds);
 }

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

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

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

@@ -14,6 +14,9 @@ public class MusicGroupPaymentCalenderCourseSettings {
 	
 	/**  */
 	private Long musicGroupPaymentCalenderId;
+
+	/**  */
+	private String name;
 	
 	/** 课程类型 */
 	private CourseSchedule.CourseScheduleType courseType;
@@ -38,7 +41,15 @@ public class MusicGroupPaymentCalenderCourseSettings {
 	
 	/**  */
 	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;
 	}

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

@@ -74,4 +74,11 @@ public interface CourseScheduleStudentPaymentService extends BaseService<Long, C
 	 */
 	void updateForMusicGroupWithPaymentCalender(String batchNo);
 
+	/**
+	 * 获取班级未开始的的课程
+	 * @param classGroupIds
+	 * @return
+	 */
+	List<CourseScheduleStudentPayment> getClassGroupNoStartCourse(List<Integer> classGroupIds);
+
 }

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

@@ -290,4 +290,12 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
      * @return
      */
     StudentRegistration changeStudentSubject(Integer studentId, String musicGroupId, Integer originalSubjectId, Integer changeSubjectId);
+
+
+    /**
+     * 获取班级未上课程的价值
+     * @param classGroupIds
+     * @return
+     */
+    BigDecimal getClassGroupCourseExpectPrice(List<Integer> classGroupIds);
 }

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

@@ -25,7 +25,7 @@ import java.util.stream.Collectors;
 
 @Service
 public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Long, CourseScheduleStudentPayment>  implements CourseScheduleStudentPaymentService {
-	
+
 	@Autowired
 	private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
 	@Autowired
@@ -418,4 +418,18 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 
 		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;
+	}
+
 }

+ 41 - 40
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -1,53 +1,40 @@
 package com.ym.mec.biz.service.impl;
 
-import java.math.BigDecimal;
-import java.util.*;
-import java.util.Map.Entry;
-import java.util.stream.Collectors;
-
 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.CalenderPushDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDetailDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto;
-import com.ym.mec.biz.dal.dto.SimpleUserDto;
-import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
-import com.ym.mec.common.page.PageInfo;
-import com.ym.mec.common.page.QueryInfo;
-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.MusicGroupDao;
-import com.ym.mec.biz.dal.dao.MusicGroupOrganizationCourseSettingsDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDetailDao;
-import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
-import com.ym.mec.biz.dal.dao.SysConfigDao;
-import com.ym.mec.biz.dal.dto.CalenderPushDto;
 import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
-import com.ym.mec.biz.dal.entity.MusicGroup;
-import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail;
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
+import com.ym.mec.biz.dal.entity.*;
 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.dal.enums.MusicGroupStatusEnum;
 import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
+import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
 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.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.IdGeneratorService;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
+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 java.math.BigDecimal;
+import java.util.*;
+import java.util.Map.Entry;
+import java.util.stream.Collectors;
 
 @Service
 public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long, MusicGroupPaymentCalender> implements MusicGroupPaymentCalenderService {
@@ -71,6 +58,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	@Autowired
 	private MusicGroupDao musicGroupDao;
 	@Autowired
+	private MusicGroupBuildLogDao musicGroupBuildLogDao;
+	@Autowired
 	private SysConfigDao sysConfigDao;
 	@Autowired
 	private SysMessageService sysMessageService;
@@ -146,9 +135,14 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			}
 			
 			//如果是报名,需要修改乐团状态
-			if (musicGroupPaymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.MUSIC_COURSE) {
+			if (musicGroupPaymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY) {
+				if(musicGroup.getStatus() != MusicGroupStatusEnum.DRAFT){
+					throw new BizException("创建失败:缴费项目类型不匹配");
+				}
 				musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
 				musicGroup.setUpdateTime(date);
+				//记录操作日志
+				musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "报名缴费项目创建成功(草稿 -> 审核中)", sysUser.getId(), ""));
 				musicGroupDao.update(musicGroup);
 			}
 		}
@@ -275,7 +269,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			}
 			
 			//如果是报名,需要修改乐团状态
-			if (musicGroupPaymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.MUSIC_COURSE) {
+			if (musicGroupPaymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY) {
 				musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
 				musicGroup.setUpdateTime(date);
 				musicGroupDao.update(musicGroup);
@@ -404,7 +398,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			operatorIds.removeAll(Collections.singleton(null));
 			Map<Integer, String> realNameMap = getMap("sys_user", "id_", "real_name_", operatorIds, Integer.class, String.class);
 			dataList.forEach(e->{
-				e.setOperatorName(organNameMap.get(e.getOrganId()));
+				e.setOrganName(organNameMap.get(e.getOrganId()));
 				e.setOperatorName(realNameMap.get(e.getOperator()));
 			});
 		}
@@ -440,11 +434,18 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
 		}
 		//如果是报名,需要修改乐团状态
-		if (musicGroupPaymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.MUSIC_COURSE) {
+		if (musicGroupPaymentCalender.getPaymentType() == MusicGroupPaymentCalender.PaymentType.MUSIC_APPLY) {
 			MusicGroup musicGroup = musicGroupDao.get(musicGroupPaymentCalender.getMusicGroupId());
 			musicGroup.setStatus(MusicGroupStatusEnum.AUDIT);
 			musicGroup.setUpdateTime(date);
 			musicGroupDao.update(musicGroup);
+			SysUser sysUser = sysUserFeignService.queryUserInfo();
+			if(sysUser == null || sysUser.getId() == null){
+				throw new BizException("请重新登录");
+			}
+			//记录操作日志
+			musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目通过(草稿 -> 审核中)", sysUser.getId(), ""));
+
 		}
 		musicGroupPaymentCalender.setAuditMemo(auditMemo);
 		musicGroupPaymentCalender.setUpdateTime(date);
@@ -463,7 +464,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	}
 
 	@Override
-	@Transactional(rollbackFor = Exception.class)
+	@Transactional(rollbackFor = Exception.class,isolation = Isolation.READ_COMMITTED)
 	public boolean autoUpdateMusicGroupPaymentCalenderStatus() {
 		// 获取当天创建且未缴费的数据,并推送
 		List<MusicGroupPaymentCalenderDetail> details = musicGroupPaymentCalenderDetailDao.queryNoPaymentCanPushList();
@@ -521,15 +522,15 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 						mgpcd.setUpdateTime(date);
 						updateMusicGroupPaymentCalenderDetailList.add(mgpcd);
 
-						if (mgpc.getIsGiveMusicNetwork()) {
-							// 更新fee表,且加1
-							musicGroupStudentFee = feeMap.get(mgpcd.getUserId());
-							if (musicGroupStudentFee != null) {
-								musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
-								musicGroupStudentFee.setUpdateTime(date);
+						// 更新fee表,且加1
+						musicGroupStudentFee = feeMap.get(mgpcd.getUserId());
+						if (musicGroupStudentFee != null) {
+							musicGroupStudentFee.setPaymentStatus(PaymentStatus.PAID_COMPLETED);
+							musicGroupStudentFee.setUpdateTime(date);
+							if(mgpc.getIsGiveMusicNetwork()){
 								musicGroupStudentFee.setRemainNetworkClassTimes(musicGroupStudentFee.getContinuousAbsenteeismTimes() + 1);
-								updateMusicGroupStudentFeeList.add(musicGroupStudentFee);
 							}
+							updateMusicGroupStudentFeeList.add(musicGroupStudentFee);
 						}
 					}
 				}

+ 1 - 1
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) throws Exception {
+    public String createGroup(SubFeeSettingDto subFeeSettingDto){
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if (sysUser == null || sysUser.getId() == null) {
             throw new BizException("获取用户信息失败");

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

@@ -105,6 +105,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     private SubjectChangeDao subjectChangeDao;
     @Autowired
     private GoodsDao goodsDao;
+    @Autowired
+    private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
 
     @Override
     public BaseDAO<Long, StudentRegistration> getDAO() {
@@ -1191,4 +1193,10 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         }
         return studentRegistration;
     }
+
+    @Override
+    public BigDecimal getClassGroupCourseExpectPrice(List<Integer> classGroupIds) {
+        List<CourseScheduleStudentPayment> classGroupNoStartCourse = courseScheduleStudentPaymentService.getClassGroupNoStartCourse(classGroupIds);
+        return BigDecimal.ZERO;
+    }
 }

+ 27 - 17
mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml

@@ -5,7 +5,7 @@
 不要修改此文件。所有改动将在下次重新自动生成时丢失。
 -->
 <mapper namespace="com.ym.mec.biz.dal.dao.CourseScheduleStudentPaymentDao">
-	
+
 	<resultMap type="com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment" id="CourseScheduleStudentPayment">
 		<result column="id_" property="id" />
         <result column="group_type_" property="groupType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
@@ -21,7 +21,7 @@
 		<result column="class_group_id_" property="classGroupId" />
 		<result column="batch_no_" property="batchNo"/>
 	</resultMap>
-	
+
 	<resultMap type="com.ym.mec.biz.dal.dto.StudentCourseTimesDto" id="studentCourseTimesDto">
 		<result column="user_id_" property="userId" />
         <result column="totalTimes" property="totalCourseTimes"/>
@@ -29,22 +29,22 @@
 		<result column="practiceTmes" property="practiceCourseTimes" />
 		<result column="freePracticeTimes" property="freePracticeCourseTimes" />
 	</resultMap>
-	
+
 	<!-- 根据主键查询一条记录 -->
 	<select id="get" resultMap="CourseScheduleStudentPayment" >
-		SELECT * FROM course_schedule_student_payment WHERE id_ = #{id} 
+		SELECT * FROM course_schedule_student_payment WHERE id_ = #{id}
 	</select>
-	
+
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="CourseScheduleStudentPayment">
 		SELECT * FROM course_schedule_student_payment ORDER BY id_
 	</select>
-	
+
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		<!--
-		<selectKey resultClass="int" keyProperty="id" > 
-		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		<selectKey resultClass="int" keyProperty="id" >
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
 		</selectKey>
 		-->
 		INSERT INTO course_schedule_student_payment (id_,group_type_,music_group_id_,course_schedule_id_,user_id_,
@@ -64,7 +64,7 @@
 
     <!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment">
-		UPDATE course_schedule_student_payment 
+		UPDATE course_schedule_student_payment
 		<set>
 			<if test="userId != null">
 				user_id_ = #{userId},
@@ -100,7 +100,7 @@
 				original_price_ = #{originalPrice},
 			</if>
 				update_time_ = NOW()
-		</set> WHERE id_ = #{id} 
+		</set> WHERE id_ = #{id}
 	</update>
 
 	<update id="batchUpdate" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment">
@@ -164,19 +164,19 @@
 
     <!-- 根据主键删除一条记录 -->
 	<delete id="delete" >
-		DELETE FROM course_schedule_student_payment WHERE id_ = #{id} 
+		DELETE FROM course_schedule_student_payment WHERE id_ = #{id}
 	</delete>
-	
+
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="CourseScheduleStudentPayment" parameterType="map">
 		SELECT * FROM course_schedule_student_payment ORDER BY id_ <include refid="global.limit"/>
 	</select>
-	
+
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM course_schedule_student_payment
 	</select>
-	
+
     <select id="findByCourseScheduleIds" resultMap="CourseScheduleStudentPayment">
 		SELECT * FROM course_schedule_student_payment WHERE course_schedule_id_ IN
 		<foreach collection="ids" item="id" open="(" close=")" separator=",">
@@ -407,16 +407,16 @@
 			#{userId}
 		</foreach>
 	</delete>
-	
+
 	<delete id="deleteByMusicGroupId" parameterType="map">
 		DELETE cssp FROM course_schedule_student_payment cssp left join course_schedule cs on cssp.course_schedule_id_ = cs.id_ WHERE cssp.music_group_id_=#{musicGroupId} AND cssp.group_type_=#{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} and cs.status_ = 'NOT_START'
 	</delete>
 	<delete id="deleteByGroup">
 		DELETE FROM course_schedule_student_payment WHERE music_group_id_=#{groupId} AND group_type_=#{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
 	</delete>
-	
+
 	<select id="queryStudentNotStartCourseTimesOfOnline" resultMap="studentCourseTimesDto">
-		SELECT cssp.`user_id_`,count(*) totalTimes, 
+		SELECT cssp.`user_id_`,count(*) totalTimes,
 		sum(CASE pg.type_ WHEN 'FREE' THEN 0 WHEN 'CHARGE' THEN 1 END) practiceTmes,
 		sum(case when (pg.type_='FREE' AND cssp.`group_type_` = 'PRACTICE' ) then 1 ELSE 0 END) freePracticeTimes
 		FROM course_schedule_student_payment cssp LEFT JOIN course_schedule cs on cssp.course_schedule_id_ = cs.id_
@@ -525,4 +525,14 @@
     <select id="findByBatchNo" resultMap="CourseScheduleStudentPayment">
 		SELECT * FROM course_schedule_student_payment WHERE batch_no_=#{batchNo}
 	</select>
+
+    <select id="getClassGroupNoStartCourse" resultMap="CourseScheduleStudentPayment">
+		SELECT cssp.* FROM course_schedule_student_payment cssp
+        LEFT JOIN course_schedule cs ON cssp.course_schedule_id_ = cs.id_
+        WHERE cssp.class_group_id_ IN
+		<foreach collection="classGroupIds" item="classGroupId" open="(" close=")" separator=",">
+			#{classGroupId}
+		</foreach>
+        AND cs.status_ = 'NOT_START' ORDER BY cssp.id_ ASC
+	</select>
 </mapper>

+ 13 - 9
mec-biz/src/main/resources/config/mybatis/MusicGroupPaymentCalenderCourseSettingsMapper.xml

@@ -15,6 +15,7 @@
 		<result column="course_original_price_" property="courseOriginalPrice" />
 		<result column="course_current_price_" property="courseCurrentPrice" />
 		<result column="is_student_optional_" property="isStudentOptional" />
+		<result column="name_" property="name" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 	</resultMap>
@@ -33,20 +34,23 @@
 	<insert id="insert"
 		parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings"
 		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval
-			AS ID FROM DUAL </selectKey> -->
 		INSERT INTO music_group_payment_calender_course_settings
-		(music_group_payment_calender_id_,course_type_,course_total_minuties_,unit_price_,course_original_price_,course_current_price_,is_student_optional_,create_time_,update_time_)
-		VALUES(#{musicGroupPaymentCalenderId},#{courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{courseTotalMinuties},#{unitPrice},#{courseOriginalPrice},#{courseCurrentPrice},#{isStudentOptional},#{createTime},#{updateTime})
+		(music_group_payment_calender_id_,course_type_,course_total_minuties_,unit_price_,course_original_price_,
+		course_current_price_,is_student_optional_,create_time_,update_time_,name_)
+		VALUES(#{musicGroupPaymentCalenderId},#{courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{courseTotalMinuties},
+		#{unitPrice},#{courseOriginalPrice},#{courseCurrentPrice},#{isStudentOptional},#{createTime},#{updateTime},#{name})
 	</insert>
 	
 	<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
 		INSERT INTO music_group_payment_calender_course_settings
-		(music_group_payment_calender_id_,course_type_,course_total_minuties_,unit_price_,course_original_price_,course_current_price_,is_student_optional_,create_time_,update_time_)
+		(music_group_payment_calender_id_,course_type_,course_total_minuties_,unit_price_,course_original_price_,
+		course_current_price_,is_student_optional_,create_time_,update_time_,name_)
 		VALUES
 		<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.musicGroupPaymentCalenderId},#{item.courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+		#{item.courseTotalMinuties},#{item.unitPrice},#{item.courseOriginalPrice},#{item.courseCurrentPrice},
+		#{item.isStudentOptional},#{item.createTime},#{item.updateTime},#{name})
 		</foreach>
 	</insert>
 
@@ -55,12 +59,12 @@
 		parameterType="com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings">
 		UPDATE music_group_payment_calender_course_settings
 		<set>
+			<if test="name != null and name != ''">
+				name_ = #{name},
+			</if>
 			<if test="isStudentOptional != null">
 				is_student_optional_ = #{isStudentOptional},
 			</if>
-			<if test="id != null">
-				id_ = #{id},
-			</if>
 			<if test="unitPrice != null">
 				unit_price_ = #{unitPrice},
 			</if>

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

@@ -367,7 +367,7 @@
         <result property="payUserType" column="pay_user_type_"/>
         <result property="calenderSettingsName" column="calender_settings_name_"/>
         <result property="paymentPattern" column="payment_pattern_"/>
-        <result property="paymentValidEndDate" column="payment_valid_start_date_"/>
+        <result property="paymentValidStartDate" column="payment_valid_start_date_"/>
         <result property="paymentValidEndDate" column="payment_valid_end_date_"/>
         <result property="startPaymentDate" column="start_payment_date_"/>
         <result property="deadlinePaymentDate" column="deadline_payment_date_"/>
@@ -405,6 +405,7 @@
         LEFT JOIN music_group_payment_calender_course_settings mgpccs ON mgpc.id_ = mgpccs.music_group_payment_calender_id_
         <include refid="MusicGroupPaymentCalenderAuditDtoSql"/>
         GROUP BY mgpc.id_
+        ORDER BY create_time_ DESC
         <include refid="global.limit"/>
     </select>
 </mapper>

+ 25 - 0
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupPaymentCalenderController.java

@@ -1,5 +1,9 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.EmployeeDao;
+import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalenderCourseSettings;
 import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
@@ -28,6 +32,10 @@ public class MusicGroupPaymentCalenderController extends BaseController {
     private MusicGroupPaymentCalenderService musicGroupPaymentCalenderService;
     @Autowired
     private MusicGroupPaymentCalenderCourseSettingsService musicGroupPaymentCalenderCourseSettingsService;
+	@Autowired
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private EmployeeDao employeeDao;
 
     @ApiOperation(value = "分页查询乐团缴费日历列表")
     @GetMapping(value = "/queryPage", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@@ -72,6 +80,23 @@ public class MusicGroupPaymentCalenderController extends BaseController {
     @GetMapping("/auditList")
     @PreAuthorize("@pcs.hasPermissions('musicGroupPaymentCalender/auditList')")
     public Object auditList(MusicGroupPaymentCalenderQueryInfo queryInfo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        if(!sysUser.getIsSuperAdmin()){
+            Employee employee = employeeDao.get(sysUser.getId());
+            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
+                queryInfo.setOrganId(employee.getOrganIdList());
+            }else if(StringUtils.isEmpty(employee.getOrganIdList())){
+                return failed("用户所在分部异常");
+            }else {
+                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+                if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
+                    return failed("非法请求");
+                }
+            }
+        }
         return succeed(musicGroupPaymentCalenderService.auditList(queryInfo));
     }
 

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

@@ -159,4 +159,12 @@ public class StudentRegistrationController extends BaseController {
         }
         return succeed(musicGroupSubjectPlanService.getSubjectGoodsAndInfo(musicGroupId, subjectId));
     }
+
+    @ApiOperation(value = "获取班级课程的价值")
+    @GetMapping("/getClassGroupCourseExpectPrice")
+    @PreAuthorize("@pcs.hasPermissions('studentRegistration/getClassGroupCourseExpectPrice')")
+    public Object getClassGroupCourseExpect(List<Integer> classGroupIds) {
+        return succeed(studentRegistrationService.getClassGroupCourseExpectPrice(classGroupIds));
+    }
+
 }