Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

Joburgess 5 lat temu
rodzic
commit
1325c586d6
30 zmienionych plików z 701 dodań i 463 usunięć
  1. 2 2
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/config/AuthorizationServerConfig.java
  2. 12 5
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java
  3. 4 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SporadicChargeInfoDao.java
  4. 15 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java
  5. 316 304
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupDao.java
  6. 62 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentPaymentOrder.java
  7. 30 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRegistration.java
  8. 29 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/VipGroup.java
  9. 0 31
      mec-biz/src/main/java/com/ym/mec/biz/service/SysConfigService.java
  10. 9 8
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java
  11. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ContractServiceImpl.java
  12. 13 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  13. 8 5
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupStudentFeeServiceImpl.java
  14. 3 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  15. 13 27
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherServiceImpl.java
  16. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  17. 10 6
      mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml
  18. 17 5
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  19. 1 1
      mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml
  20. 6 0
      mec-biz/src/main/resources/config/mybatis/SporadicChargeInfo.xml
  21. 1 1
      mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml
  22. 5 1
      mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml
  23. 14 0
      mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml
  24. 13 0
      mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml
  25. 9 0
      mec-common/common-core/src/main/java/com/ym/mec/common/entity/ImGroupModel.java
  26. 0 1
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherController.java
  27. 8 2
      mec-util/pom.xml
  28. 4 6
      mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleController.java
  29. 88 38
      mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java
  30. 6 8
      pom.xml

+ 2 - 2
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/config/AuthorizationServerConfig.java

@@ -72,8 +72,8 @@ public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdap
 		DefaultTokenServices tokenServices = new DefaultTokenServices();
 		tokenServices.setTokenStore(redisTokenStore());
 		tokenServices.setSupportRefreshToken(true);
-		tokenServices.setAccessTokenValiditySeconds(60 * 60 * 24); // token有效期自定义设置,默认12小时
-		tokenServices.setRefreshTokenValiditySeconds(60 * 60 * 24 * 30);// 默认30天,这里修改
+		//tokenServices.setAccessTokenValiditySeconds(60 * 60 * 24); // token有效期自定义设置,默认12小时
+		//tokenServices.setRefreshTokenValiditySeconds(60 * 60 * 24 * 30);// 默认30天,这里修改
 		return tokenServices;
 	}
 

+ 12 - 5
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java

@@ -858,8 +858,8 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
     List<Map<String, Long>> countTotalCourseScheduleNum(@Param("vipGroupIds")List<String> vipGroupIds,@Param("groupType") String groupType);
 
     /**
-     * 获取当前课时
-     * @param vipGroupIds
+     * 获取当前课时(已上)
+     * @param vipGroupIds vip编号
      * @param groupType
      * @return
      */
@@ -873,12 +873,19 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
     List<Map<Integer, Long>> countTotalNumByClassGroupId(@Param("classGroupIds") List<Integer> classGroupIds, @Param("classDate") Date classDate);
 
     /**
-     * 根据班级编号count剩余课时
+     * 根据班级编号count当前课时(已上总数)
+     * @param classGroupIds
+     * @return
+     */
+    List<Map<Integer, Long>> countExpendNumByClassGroupId(@Param("classGroupIds") List<Integer> classGroupIds);
+
+    /**
+     * 根据班级编号count剩余课时(未上)
      * @param classGroupIds
-     * @param classDate
+     * @param teacherId
      * @return
      */
-    List<Map<Integer, Long>> countCurrentNumByClassGroupId(@Param("classGroupIds") List<Integer> classGroupIds, @Param("classDate") Date classDate);
+    List<Map<Integer, Long>> countCurrentNumByClassGroupId(@Param("classGroupIds") List<Integer> classGroupIds, @Param("teacherId") Integer teacherId);
 
     /**
      * @describe 获取乐团下剩余课程计划

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SporadicChargeInfoDao.java

@@ -2,6 +2,10 @@ package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.entity.SporadicChargeInfo;
 import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface SporadicChargeInfoDao extends BaseDAO<Integer, SporadicChargeInfo> {
+    SporadicChargeInfo findInfoById(@Param("id") Integer id);
 }

+ 15 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java

@@ -264,17 +264,19 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
      *
      * @return
      */
-    int updateUser(@Param("id") Integer id,@Param("realName") String realName, @Param("idCardNo") String idCardNo);
+    int updateUser(@Param("id") Integer id, @Param("realName") String realName, @Param("idCardNo") String idCardNo);
 
     /**
      * 获取乐团在读人数
+     *
      * @param musicGroupIds
      * @return
      */
-    List<Map<String,Integer>> countNormalNum(String musicGroupIds);
+    List<Map<String, Integer>> countNormalNum(String musicGroupIds);
 
     /**
      * 获取学员基本信息
+     *
      * @param mobile
      * @return
      */
@@ -282,12 +284,14 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
 
     /**
      * 批量修改学生年级班级
+     *
      * @param studentRegistration
      */
     void updateCurrentClass(StudentRegistration studentRegistration);
 
     /**
      * 获取乐团学员购买方式
+     *
      * @param musicGroupId
      * @return
      */
@@ -295,7 +299,16 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
 
     /**
      * 获取学员注册比例
+     *
      * @return
      */
     List<StudentRegisterPerDto> queryStudentPer();
+
+    /**
+     * 获取乐团报名信息和学校信息
+     * @param musicGroupId
+     * @param userId
+     * @return
+     */
+    StudentRegistration findStudentByMusicGroupIdAndUserId(@Param("musicGroupId") String musicGroupId, @Param("userId") Integer userId);
 }

+ 316 - 304
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupDao.java

@@ -13,308 +13,320 @@ import java.util.Map;
 
 public interface VipGroupDao extends BaseDAO<Long, VipGroup> {
 
-	/**
-	 * @describe 锁定指定vip课
-	 * @author Joburgess
-	 * @date 2019/10/21
-	 * @param vipGroupId: vip课编号
-	 * @return com.ym.mec.biz.dal.entity.VipGroup
-	 */
-	VipGroup getLockVipGroup(Long vipGroupId);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/9
-	 * @params [organId]
-	 * @return java.util.List<com.ym.mec.biz.dal.entity.VipGroup>
-	 * @describe 根据部门获取
-	 */
-	List<VipGroup> findAllByOrgan(Map<String, Object> params);
-
-	int countVipGroupByOrgan(Map<String, Object> params);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/9
-	 * @params [params]
-	 * @return java.util.List<com.ym.mec.biz.dal.dto.VipGroupStudentDto>
-	 * @describe 获取小课学员
-	 */
-	List<VipGroupStudentDto> findVipGroupStudents(Map<String, Object> params);
-
-	/**
-	 * @describe 获取还有课程余额的学员
-	 * @author Joburgess
-	 * @date 2019/11/16
-	 * @param params:
-	 * @return java.util.List<com.ym.mec.biz.dal.dto.VipGroupStudentDto>
-	 */
-	List<VipGroupStudentDto> findHaveCourseBalanceStudents(Map<String, Object> params);
-	int countHaveCourseBalanceStudentNum(Map<String, Object> params);
-
-	int countVipGroupStudents(Map<String, Object> params);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/9
-	 * @params [params]
-	 * @return java.util.List<com.ym.mec.biz.dal.dto.VipGroupCourseSchduleRecordDto>
-	 * @describe 获取vip课教学记录
-	 */
-	List<VipGroupCourseSchduleRecordDto> findTeachingRecord(Map<String, Object> params);
-
-	int countTeachingRecord(Map<String, Object> params);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/9
-	 * @params [vipGroupId]
-	 * @return int
-	 * @describe 统计已结算课程数量
-	 */
-	int countIsSalaryNum(Long vipGroupId);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/9
-	 * @params [vipGroupId]
-	 * @return int
-	 * @describe 统计被投诉课程数量
-	 */
-	int countComplaintsNum(Long vipGroupId);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/9
-	 * @params [vipGroupId]
-	 * @return com.ym.mec.biz.dal.dto.TeachingRecordBaseInfo
-	 * @describe 获取vip课的总课次及已上课次
-	 */
-	TeachingRecordBaseInfo getClassTimes(Long vipGroupId);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/3
-	 * @params [userID]
-	 * @return java.util.List<com.ym.mec.biz.dal.dto.StudentManageVipGroupDto>
-	 * @describe 获取对应学生vip课
-	 */
-	List<StudentManageVipGroupDto> findStudentVipGroups(Map<String, Object> params);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/3
-	 * @params [params]
-	 * @return java.util.List<com.ym.mec.biz.dal.dto.StudentVipGroupShowListDto>
-	 * @describe 学生端获取vip课列表
-	 */
-	List<StudentVipGroupShowListDto> findVipGroups(Map<String, Object> params);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/3
-	 * @params [params]
-	 * @return int
-	 * @describe 统计vip数
-	 */
-	int countVipGorups(Map<String, Object> params);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/3
-	 * @params [vipGroupId]
-	 * @return com.ym.mec.biz.dal.dto.VipGroupManageDetailDto
-	 * @describe 获取小课详情
-	 */
-	VipGroupManageDetailDto getVipGroupBaseInfo(Long vipGroupId);
-
-	/**
-	 * @describe 获取vip课财务基本信息
-	 * @author Joburgess
-	 * @date 2019/11/5
-	 * @param vipGroupId: vip课编号
-	 * @return com.ym.mec.biz.dal.dto.VipGroupSalaryBaseInfo
-	 */
-	VipGroupSalaryBaseInfo getVipGroupSalaryInfo(@Param("vipGroupId") Long vipGroupId);
-
-	/**
-	 * @describe 统计学生缴费笔数
-	 * @author Joburgess
-	 * @date 2019/11/16
-	 * @param classGroupId: 班级编号
-	 * @return int
-	 */
-	int countStudentPaymentNum(@Param("classGroupId") Integer classGroupId);
-
-	BigDecimal countStudentPaymentFee(@Param("classGroupId") Integer classGroupId);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/11
-	 * @params [vipGroupId]
-	 * @return int
-	 * @describe 统计扣费笔数
-	 */
-	int countVipGroupDeductionNum(Long vipGroupId);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/3
-	 * @params [params]
-	 * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
-	 * @describe 获取小课考勤记录
-	 */
-	List<CourseSchedule> findVipGroupAttendances(Map<String, Object> params);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/3
-	 * @params [params]
-	 * @return int
-	 * @describe 统计小课考勤记录数
-	 */
-	int countVipGroupAttendance(Map<String, Object> params);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/3
-	 * @params [vipGroupId]
-	 * @return com.ym.mec.biz.dal.dto.StudentVipGroupDetailDto
-	 * @describe 获取vip课详情
-	 */
-	StudentVipGroupDetailDto getVipGroupDetail(Long vipGroupId);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/3
-	 * @params [vipGroupId]
-	 * @return java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>
-	 * @describe 统计剩余课时数
-	 */
-	List<Map<String, Integer>> countSurplusClassTimes(Long vipGroupId);
-
-	/**
-	 * @describe 统计vip课已上课程数量
-	 * @author Joburgess
-	 * @date 2019/10/21
-	 * @param vipGroupIds: vip课编号列表
-	 * @return java.util.List<java.util.Map<java.lang.Long,java.lang.Integer>>
-	 */
-	List<Map<Long, Integer>> countVipGroupOverCourse(List<String> vipGroupIds);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/12
-	 * @params [vipGroupId]
-	 * @return java.math.BigDecimal
-	 * @describe 统计学生vip课未上课时费用
-	 */
-	List<Map<Integer, BigDecimal>> countSurplusCourseFee(Long vipGroupId);
-
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/14
-	 * @params [teacherId]
-	 * @return int
-	 * @describe 统计老师开启的vip课数
-	 */
-	int countTeacherVipGroups(Long teacherId);
-
-	/**
-	 * 根据教师编号获取老师vip课数量
-	 * @param teacherId
-	 * @return
-	 */
-	int countTeacherVipClass(Integer teacherId);
-
-	/**
-	 * 根据教师编号获取老师vip课列表
-	 * @param params
-	 * @return
-	 */
-	List<TeacherVipClassInfoDto> getTeacherVipClass(Map<String, Object> params);
-
-	/**
-	 * 根据老师查询vip课教学点
-	 * @param userId
-	 * @return
-	 */
-	List<School> querySchoolByUserId(Integer userId);
-
-	/**
-	 * @describe 根据课程编号获取vip课
-	 * @author Joburgess
-	 * @date 2019/10/23
-	 * @param courseScheduleId: 课程编号
-	 * @return com.ym.mec.biz.dal.entity.VipGroup
-	 */
-	VipGroup findByCourseSchedule(Integer courseScheduleId);
-
-	/**
-	 * 查询vip课数目
-	 * @param organId
-	 * @return
-	 */
-	Map<String, Integer> queryVipGroupNum(@Param("organId") String organId);
-	
-	/**
-	 * 查询当月vip课数量
-	 * @param organId
-	 * @return
-	 */
-	Integer queryCurrentMonthCoursesNum(@Param("organId") String organId);
-
-	/**
-	 * @describe 获取报名已截至但是报名人数还未达到的vip课程
-	 * @author Joburgess
-	 * @date 2019/11/13
-	 * @param :
-	 * @return java.util.List<com.ym.mec.biz.dal.entity.VipGroup>
-	 */
-	List<VipGroup> findNoCreateSuccessVipGroup();
-
-
-	/**
-	 * count学员vip课程列表
-	 * @param params
-	 * @return
-	 */
-	int countStudentVipGroups(Map<String, Object> params);
-	
-	/**
-	 * 根编号列表查询对象
-	 * @param idList
-	 * @return
-	 */
-	List<VipGroup> queryByIds(String idList);
-
-	/**
-	 * 批量更新
-	 * @param vipGroupList
-	 * @return
-	 */
-	int batchUpdate(@Param("vipGroupList") List<VipGroup> vipGroupList);
-
-	/**
-	 * @describe
-	 * @author Joburgess
-	 * @date 2019/11/29
-	 * @param vipGroupId:
-	 * @return com.ym.mec.biz.dal.dto.VipBuyResultDto
-	 */
-	VipBuyResultDto getVipBuyResultInfo(@Param("vipGroupId") Integer vipGroupId);
-	
-	/**
-	 * 查询需要结束的对象列表
-	 * @return
-	 */
-	List<VipGroup> queryRequiredOverList();
-
-	/**
-	 * @describe 获取正常状态的vip课
-	 * @author Joburgess
-	 * @date 2019/12/3
-	 * @return java.util.List<com.ym.mec.biz.dal.entity.VipGroup>
-	 */
-	List<VipGroup> queryNormalStatusList();
+    /**
+     * @param vipGroupId: vip课编号
+     * @return com.ym.mec.biz.dal.entity.VipGroup
+     * @describe 锁定指定vip课
+     * @author Joburgess
+     * @date 2019/10/21
+     */
+    VipGroup getLockVipGroup(Long vipGroupId);
+
+    /**
+     * @return java.util.List<com.ym.mec.biz.dal.entity.VipGroup>
+     * @Author: Joburgess
+     * @Date: 2019/10/9
+     * @params [organId]
+     * @describe 根据部门获取
+     */
+    List<VipGroup> findAllByOrgan(Map<String, Object> params);
+
+    int countVipGroupByOrgan(Map<String, Object> params);
+
+    /**
+     * @return java.util.List<com.ym.mec.biz.dal.dto.VipGroupStudentDto>
+     * @Author: Joburgess
+     * @Date: 2019/10/9
+     * @params [params]
+     * @describe 获取小课学员
+     */
+    List<VipGroupStudentDto> findVipGroupStudents(Map<String, Object> params);
+
+    /**
+     * @param params:
+     * @return java.util.List<com.ym.mec.biz.dal.dto.VipGroupStudentDto>
+     * @describe 获取还有课程余额的学员
+     * @author Joburgess
+     * @date 2019/11/16
+     */
+    List<VipGroupStudentDto> findHaveCourseBalanceStudents(Map<String, Object> params);
+
+    int countHaveCourseBalanceStudentNum(Map<String, Object> params);
+
+    int countVipGroupStudents(Map<String, Object> params);
+
+    /**
+     * @return java.util.List<com.ym.mec.biz.dal.dto.VipGroupCourseSchduleRecordDto>
+     * @Author: Joburgess
+     * @Date: 2019/10/9
+     * @params [params]
+     * @describe 获取vip课教学记录
+     */
+    List<VipGroupCourseSchduleRecordDto> findTeachingRecord(Map<String, Object> params);
+
+    int countTeachingRecord(Map<String, Object> params);
+
+    /**
+     * @return int
+     * @Author: Joburgess
+     * @Date: 2019/10/9
+     * @params [vipGroupId]
+     * @describe 统计已结算课程数量
+     */
+    int countIsSalaryNum(Long vipGroupId);
+
+    /**
+     * @return int
+     * @Author: Joburgess
+     * @Date: 2019/10/9
+     * @params [vipGroupId]
+     * @describe 统计被投诉课程数量
+     */
+    int countComplaintsNum(Long vipGroupId);
+
+    /**
+     * @return com.ym.mec.biz.dal.dto.TeachingRecordBaseInfo
+     * @Author: Joburgess
+     * @Date: 2019/10/9
+     * @params [vipGroupId]
+     * @describe 获取vip课的总课次及已上课次
+     */
+    TeachingRecordBaseInfo getClassTimes(Long vipGroupId);
+
+    /**
+     * @return java.util.List<com.ym.mec.biz.dal.dto.StudentManageVipGroupDto>
+     * @Author: Joburgess
+     * @Date: 2019/10/3
+     * @params [userID]
+     * @describe 获取对应学生vip课
+     */
+    List<StudentManageVipGroupDto> findStudentVipGroups(Map<String, Object> params);
+
+    /**
+     * @return java.util.List<com.ym.mec.biz.dal.dto.StudentVipGroupShowListDto>
+     * @Author: Joburgess
+     * @Date: 2019/10/3
+     * @params [params]
+     * @describe 学生端获取vip课列表
+     */
+    List<StudentVipGroupShowListDto> findVipGroups(Map<String, Object> params);
+
+    /**
+     * @return int
+     * @Author: Joburgess
+     * @Date: 2019/10/3
+     * @params [params]
+     * @describe 统计vip数
+     */
+    int countVipGorups(Map<String, Object> params);
+
+    /**
+     * @return com.ym.mec.biz.dal.dto.VipGroupManageDetailDto
+     * @Author: Joburgess
+     * @Date: 2019/10/3
+     * @params [vipGroupId]
+     * @describe 获取小课详情
+     */
+    VipGroupManageDetailDto getVipGroupBaseInfo(Long vipGroupId);
+
+    /**
+     * @param vipGroupId: vip课编号
+     * @return com.ym.mec.biz.dal.dto.VipGroupSalaryBaseInfo
+     * @describe 获取vip课财务基本信息
+     * @author Joburgess
+     * @date 2019/11/5
+     */
+    VipGroupSalaryBaseInfo getVipGroupSalaryInfo(@Param("vipGroupId") Long vipGroupId);
+
+    /**
+     * @param classGroupId: 班级编号
+     * @return int
+     * @describe 统计学生缴费笔数
+     * @author Joburgess
+     * @date 2019/11/16
+     */
+    int countStudentPaymentNum(@Param("classGroupId") Integer classGroupId);
+
+    BigDecimal countStudentPaymentFee(@Param("classGroupId") Integer classGroupId);
+
+    /**
+     * @return int
+     * @Author: Joburgess
+     * @Date: 2019/10/11
+     * @params [vipGroupId]
+     * @describe 统计扣费笔数
+     */
+    int countVipGroupDeductionNum(Long vipGroupId);
+
+    /**
+     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
+     * @Author: Joburgess
+     * @Date: 2019/10/3
+     * @params [params]
+     * @describe 获取小课考勤记录
+     */
+    List<CourseSchedule> findVipGroupAttendances(Map<String, Object> params);
+
+    /**
+     * @return int
+     * @Author: Joburgess
+     * @Date: 2019/10/3
+     * @params [params]
+     * @describe 统计小课考勤记录数
+     */
+    int countVipGroupAttendance(Map<String, Object> params);
+
+    /**
+     * @return com.ym.mec.biz.dal.dto.StudentVipGroupDetailDto
+     * @Author: Joburgess
+     * @Date: 2019/10/3
+     * @params [vipGroupId]
+     * @describe 获取vip课详情
+     */
+    StudentVipGroupDetailDto getVipGroupDetail(Long vipGroupId);
+
+    /**
+     * @return java.util.List<java.util.Map < java.lang.String, java.lang.Integer>>
+     * @Author: Joburgess
+     * @Date: 2019/10/3
+     * @params [vipGroupId]
+     * @describe 统计剩余课时数
+     */
+    List<Map<String, Integer>> countSurplusClassTimes(Long vipGroupId);
+
+    /**
+     * @param vipGroupIds: vip课编号列表
+     * @return java.util.List<java.util.Map < java.lang.Long, java.lang.Integer>>
+     * @describe 统计vip课已上课程数量
+     * @author Joburgess
+     * @date 2019/10/21
+     */
+    List<Map<Long, Integer>> countVipGroupOverCourse(List<String> vipGroupIds);
+
+    /**
+     * @return java.math.BigDecimal
+     * @Author: Joburgess
+     * @Date: 2019/10/12
+     * @params [vipGroupId]
+     * @describe 统计学生vip课未上课时费用
+     */
+    List<Map<Integer, BigDecimal>> countSurplusCourseFee(Long vipGroupId);
+
+    /**
+     * @return int
+     * @Author: Joburgess
+     * @Date: 2019/10/14
+     * @params [teacherId]
+     * @describe 统计老师开启的vip课数
+     */
+    int countTeacherVipGroups(Long teacherId);
+
+    /**
+     * 根据教师编号获取老师vip课数量
+     *
+     * @param teacherId
+     * @return
+     */
+    int countTeacherVipClass(Integer teacherId);
+
+    /**
+     * 根据教师编号获取老师vip课列表
+     *
+     * @param params
+     * @return
+     */
+    List<TeacherVipClassInfoDto> getTeacherVipClass(Map<String, Object> params);
+
+    /**
+     * 根据老师查询vip课教学点
+     *
+     * @param userId
+     * @return
+     */
+    List<School> querySchoolByUserId(Integer userId);
+
+    /**
+     * @param courseScheduleId: 课程编号
+     * @return com.ym.mec.biz.dal.entity.VipGroup
+     * @describe 根据课程编号获取vip课
+     * @author Joburgess
+     * @date 2019/10/23
+     */
+    VipGroup findByCourseSchedule(Integer courseScheduleId);
+
+    /**
+     * 查询vip课数目
+     *
+     * @param organId
+     * @return
+     */
+    Map<String, Integer> queryVipGroupNum(@Param("organId") String organId);
+
+    /**
+     * 查询当月vip课数量
+     *
+     * @param organId
+     * @return
+     */
+    Integer queryCurrentMonthCoursesNum(@Param("organId") String organId);
+
+    /**
+     * @param :
+     * @return java.util.List<com.ym.mec.biz.dal.entity.VipGroup>
+     * @describe 获取报名已截至但是报名人数还未达到的vip课程
+     * @author Joburgess
+     * @date 2019/11/13
+     */
+    List<VipGroup> findNoCreateSuccessVipGroup();
+
+
+    /**
+     * count学员vip课程列表
+     *
+     * @param params
+     * @return
+     */
+    int countStudentVipGroups(Map<String, Object> params);
+
+    /**
+     * 根编号列表查询对象
+     *
+     * @param idList
+     * @return
+     */
+    List<VipGroup> queryByIds(String idList);
+
+    /**
+     * 批量更新
+     *
+     * @param vipGroupList
+     * @return
+     */
+    int batchUpdate(@Param("vipGroupList") List<VipGroup> vipGroupList);
+
+    /**
+     * @param vipGroupId:
+     * @return com.ym.mec.biz.dal.dto.VipBuyResultDto
+     * @describe
+     * @author Joburgess
+     * @date 2019/11/29
+     */
+    VipBuyResultDto getVipBuyResultInfo(@Param("vipGroupId") Integer vipGroupId);
+
+    /**
+     * 查询需要结束的对象列表
+     *
+     * @return
+     */
+    List<VipGroup> queryRequiredOverList();
+
+    /**
+     * @return java.util.List<com.ym.mec.biz.dal.entity.VipGroup>
+     * @describe 获取正常状态的vip课
+     * @author Joburgess
+     * @date 2019/12/3
+     */
+    List<VipGroup> queryNormalStatusList();
+
+    VipGroup findVipGroupInfo(@Param("id") Integer id, @Param("classGroupId") Integer classGroupId);
 }

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

@@ -30,7 +30,10 @@ public class StudentPaymentOrder {
 	/**  */
 	@ApiModelProperty(value = "用户编号",required = true)
 	private Integer userId;
-	
+
+	@ApiModelProperty(value = "分部编号",required = true)
+	private Integer organId;
+
 	/** 订单类型(报名、续费、小课购买、其他) */
 	@ApiModelProperty(value = "订单类型",required = true)
 	private OrderTypeEnum type;
@@ -108,15 +111,25 @@ public class StudentPaymentOrder {
 	//零星费用
 	private BigDecimal sporadicAmount;
 
+	//零星费用类型
+	private String sporadicType;
+
 	//乐器费用
 	private BigDecimal musicalFee;
 
+	//租赁费用
+	private BigDecimal leaseFee;
+
 	//教辅费用
 	private BigDecimal teachingFee;
 
 	//手续费
 	private BigDecimal transferFee;
 
+	private String organName;
+	private String schoolName;
+	private String subjectName;
+
 	public void setId(Long id){
 		this.id = id;
 	}
@@ -352,4 +365,52 @@ public class StudentPaymentOrder {
 	public void setTransferFee(BigDecimal transferFee) {
 		this.transferFee = transferFee;
 	}
+
+	public String getOrganName() {
+		return organName;
+	}
+
+	public void setOrganName(String organName) {
+		this.organName = organName;
+	}
+
+	public String getSchoolName() {
+		return schoolName;
+	}
+
+	public void setSchoolName(String schoolName) {
+		this.schoolName = schoolName;
+	}
+
+	public String getSubjectName() {
+		return subjectName;
+	}
+
+	public void setSubjectName(String subjectName) {
+		this.subjectName = subjectName;
+	}
+
+	public String getSporadicType() {
+		return sporadicType;
+	}
+
+	public void setSporadicType(String sporadicType) {
+		this.sporadicType = sporadicType;
+	}
+
+	public BigDecimal getLeaseFee() {
+		return leaseFee;
+	}
+
+	public void setLeaseFee(BigDecimal leaseFee) {
+		this.leaseFee = leaseFee;
+	}
+
+	public Integer getOrganId() {
+		return organId;
+	}
+
+	public void setOrganId(Integer organId) {
+		this.organId = organId;
+	}
 }

+ 30 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRegistration.java

@@ -99,6 +99,12 @@ public class StudentRegistration {
     @ApiModelProperty(value = "是否是插班生0不是,1是", required = true)
     private int transferStudent;
 
+    private String organName;
+
+    private String schoolName;
+
+    private KitPurchaseMethodEnum KitType;
+
     public BigDecimal getBalance() {
         return balance;
     }
@@ -329,4 +335,28 @@ public class StudentRegistration {
     public void setTemporaryCourseFee(BigDecimal temporaryCourseFee) {
         this.temporaryCourseFee = temporaryCourseFee;
     }
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
+    public String getSchoolName() {
+        return schoolName;
+    }
+
+    public void setSchoolName(String schoolName) {
+        this.schoolName = schoolName;
+    }
+
+    public KitPurchaseMethodEnum getKitType() {
+        return KitType;
+    }
+
+    public void setKitType(KitPurchaseMethodEnum kitType) {
+        KitType = kitType;
+    }
 }

+ 29 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/VipGroup.java

@@ -48,6 +48,12 @@ public class VipGroup {
 	/**  */
 	private java.util.Date updateTime;
 
+	private String organName;
+
+	private String schoolName;
+
+	private String subjectName;
+
 	/** 教学点 */
 	@ApiModelProperty(value = "教学点", required = false)
 	private Integer teacherSchoolId;
@@ -365,4 +371,27 @@ public class VipGroup {
 		return ToStringBuilder.reflectionToString(this);
 	}
 
+	public String getOrganName() {
+		return organName;
+	}
+
+	public void setOrganName(String organName) {
+		this.organName = organName;
+	}
+
+	public String getSchoolName() {
+		return schoolName;
+	}
+
+	public void setSchoolName(String schoolName) {
+		this.schoolName = schoolName;
+	}
+
+	public String getSubjectName() {
+		return subjectName;
+	}
+
+	public void setSubjectName(String subjectName) {
+		this.subjectName = subjectName;
+	}
 }

+ 0 - 31
mec-biz/src/main/java/com/ym/mec/biz/service/SysConfigService.java

@@ -18,26 +18,11 @@ public interface SysConfigService extends BaseService<Long, SysConfig> {
     public static final String VIP_APPEAL_DAYS_RANGE = "vip_appeal_days_range";
 
     /**
-     * VIP课的结算周期,为课程完成后{}天
-     */
-    public static final String VIP_SETTLEMENT_CYCLE = "vip_settlement_cycle";
-
-    /**
-     * 课酬结算周期,为每个月的{}日
-     */
-    public static final String COURSES_SETTLEMENT_CYCLE = "courses_settlement_cycle";
-
-    /**
      * 老师正常打卡时间,为课程当天,距离开课时间前{}分钟
      */
     public static final String ADVANCE_SIGN_IN_MINUTES = "advance_sign_in_minutes";
 
     /**
-     * 乐团课,签退时间,为课程结束后开始,至结束后的{}小时
-     */
-    public static final String SIGN_OUT_DELAY_HOURS = "sign_out_delay_hours";
-
-    /**
      * 老师可以打卡范围,为教学定位方圆{}米
      */
     public static final String ATTENDANCE_RANGE = "attendance_range";
@@ -48,16 +33,6 @@ public interface SysConfigService extends BaseService<Long, SysConfig> {
     public static final String ADVANCE_LEAVE_HOURS = "advance_leave_hours";
 
     /**
-     * 移动端「课程调整」调整的课程时间,为开课前{}天
-     */
-    public static final String ADVANCE_UPDATE_COURSES_DAYS = "advance_update_courses_days";
-
-    /**
-     * 密码重置后的默认密码为{}
-     */
-    public static final String DEFAULT_PASSWORD = "default_password";
-
-    /**
      * 单技课梯度结算规则设置
      */
     public static final String SIGLE_GRADIENT_SETTLEMENT_RULE = "sigle_gradient_settlement_rule";
@@ -83,14 +58,8 @@ public interface SysConfigService extends BaseService<Long, SysConfig> {
     String DEMO_GROUP_SINGLE_CLASS_MINUTES_ = "demo_group_single_class_minutes_";
     String USER_DEFAULT_HEAD_URL = "user_default_head_url";
     String STUDENT_APPLY_URL = "student_apply_url";
-    String STUDENT_APPLY_PAYMENT_DETAIL_URL = "student_apply_payment_detail_url";
     String SERVER_PHONE = "server_phone";
 
-    /**
-     * 乐团课90分钟课酬计算时的收费类型
-     */
-    String MUSIC_GROUP_CHARGE_TYPE_90_ = "music_group_charge_type_90_";
-
     String MUSIC_GROUP_SETTLEMENT_CLASS_MINUTES = "music_group_settlement_class_minutes";
 
     String MUSIC_GROUP_SETTLEMENT_SINGLE_CLASS_MINUTES = "music_group_settlement_single_class_minutes";

+ 9 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -666,6 +666,9 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             //获取班级老师总数map
             Map<Integer, Integer> numsMap = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertIntegerMap(classGroupDao.countTeacherNums(StringUtils.join(classGroupIds, ",")))), HashMap.class);
             imGroupModels.forEach(e -> {
+                if(StringUtils.isNotEmpty(e.getGroupName())){
+                    e.setName(e.getGroupName() + " " + e.getName());
+                }
                 Integer num = numsMap.get(Integer.parseInt(e.getId()));
                 e.setCount((num == null ? 0 : num) + e.getCount());
             });
@@ -879,15 +882,13 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         List<Map<Long, Integer>> vipGroupOverCourses = vipGroupDao.countVipGroupOverCourse(musicGroupIds);
         Map<Long, Integer> vipGroupOverCourseMaps = MapUtil.convertIntegerMap(vipGroupOverCourses);
 
-        List<ClassGroup> byClassGroupIds = classGroupDao.findByClassGroupIds(classGroupIds);
-        Map<Integer, ClassGroup> classGorupIdMap = byClassGroupIds.stream().collect(Collectors.toMap(ClassGroup::getId, classGroup -> classGroup));
-
-
+//        List<ClassGroup> byClassGroupIds = classGroupDao.findByClassGroupIds(classGroupIds);
+//        Map<Integer, ClassGroup> classGorupIdMap = byClassGroupIds.stream().collect(Collectors.toMap(ClassGroup::getId, classGroup -> classGroup));
 
         //统计班级人数
         List<Map<Integer, Integer>> classGroupStudentNumMaps = classGroupStudentMapperDao.countClassGroupsStudentNum(classGroupIds);
         Map<Integer, Long> classGroupStudentNumMap = MapUtil.convertIntegerMap(classGroupStudentNumMaps);
-        Map<Integer, Long> currentClassTimes = MapUtil.convertIntegerMap(courseScheduleDao.countCurrentNumByClassGroupId(classGroupIds,null));
+        Map<Integer, Long> currentClassTimes = MapUtil.convertIntegerMap(courseScheduleDao.countCurrentNumByClassGroupId(classGroupIds,user.getId()));
         teacherMusicClassGroup.forEach(teacherClassGroupDto -> {
 
             if (teacherClassGroupDto.getType() == ClassGroupTypeEnum.VIP) {
@@ -919,7 +920,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
             }
 
-            ClassGroup classGroup = classGorupIdMap.get(teacherClassGroupDto.getClassGroupId().intValue());
+//            ClassGroup classGroup = classGorupIdMap.get(teacherClassGroupDto.getClassGroupId().intValue());
 //            teacherClassGroupDto.setSurplusClassTimes(classGroup.getTotalClassTimes() - classGroup.getCurrentClassTimes());
             Long aLong = currentClassTimes.get(teacherClassGroupDto.getClassGroupId().intValue());
             teacherClassGroupDto.setSurplusClassTimes(aLong==null?0:aLong.intValue());
@@ -1808,7 +1809,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             dataList = classGroupDao.queryMusicGroupClassGroup(params);
             List<Integer> classGroups = dataList.stream().map(e -> e.getClassGroupId()).collect(Collectors.toList());
             Map<Integer, Long> totalNumMap = MapUtil.convertIntegerMap(courseScheduleDao.countTotalNumByClassGroupId(classGroups, null));
-            Map<Integer, Long> currentNumMap = MapUtil.convertIntegerMap(courseScheduleDao.countCurrentNumByClassGroupId(classGroups, null));
+            Map<Integer, Long> currentNumMap = MapUtil.convertIntegerMap(courseScheduleDao.countExpendNumByClassGroupId(classGroups));
             String join = StringUtils.join(classGroups, ",");
             //获取主教老师
             Map<Integer, String> masterTeachers = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertMybatisMap(classGroupDao.countStudentNum(join, "BISHOP"))), HashMap.class);
@@ -2033,7 +2034,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         Map<Integer, Integer> studyNums = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertIntegerMap(classGroupDao.countStudyNum(classGroupIds))), HashMap.class);
 
         Map<Integer, Long> totalNumMap = MapUtil.convertIntegerMap(courseScheduleDao.countTotalNumByClassGroupId(classGroupSet, null));
-        Map<Integer, Long> currentNumMap = MapUtil.convertIntegerMap(courseScheduleDao.countCurrentNumByClassGroupId(classGroupSet, null));
+        Map<Integer, Long> currentNumMap = MapUtil.convertIntegerMap(courseScheduleDao.countExpendNumByClassGroupId(classGroupSet));
 
         for (ClassGroupTeachersDto classGroup : classGroups) {
             List<ClassGroupTeacherMapper> classGroupTeacherMappers = new ArrayList<>();

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

@@ -344,7 +344,7 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 		// 生成借款协议PDF
 		try {
 			PDFUtil.renderToPDFByData(ContractServiceImpl.class.getResource("/").getFile(), FileUtils.readFileToString(srcFile), srcPdfPath,
-					"config/fonts/simsun.ttf");
+					"config/fonts/simsun.ttc");
 		} catch (IOException e) {
 			throw new BizException("生成pdf协议失败", e);
 		}

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

@@ -327,6 +327,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 studentPaymentOrder.setActualAmount(new BigDecimal(0));
                 studentPaymentOrder.setBalancePaymentAmount(amount);
                 studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
+                studentPaymentOrder.setOrganId(chargeInfo.getOrganId());
                 studentPaymentOrder.setUpdateTime(date);
                 sysUserCashAccountService.updateBalance(userId, amount.negate(),PlatformCashAccountDetailTypeEnum.SPORADIC,chargeInfo.getTitle());
                 studentPaymentOrderService.update(studentPaymentOrder);
@@ -378,6 +379,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         );
 
         Map<String,BigDecimal> routingFee = (Map<String,BigDecimal>)payMap.get("routingFee");
+        studentPaymentOrder.setOrganId(chargeInfo.getOrganId());
         studentPaymentOrder.setComAmount(routingFee.get("COM"));
         studentPaymentOrder.setPerAmount(routingFee.get("PER"));
         studentPaymentOrder.setMerNos((String) payMap.get("routingMerNos"));
@@ -497,6 +499,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
         Date date = new Date();
 
+        MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
         if(registerPayDto.getIsUseBalancePayment() || amount.doubleValue() == 0){
             studentPaymentOrder.setPaymentChannel("BALANCE");
         	SysUserCashAccount userCashAccount = sysUserCashAccountService.getLocked(userId);
@@ -506,9 +509,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         	if(userCashAccount.getBalance().subtract(amount).doubleValue() > 0){
         		// 更新订单信息
         		studentPaymentOrder.setBalancePaymentAmount(amount);
+        		studentPaymentOrder.setOrganId(musicGroup.getOrganId());
                 studentPaymentOrder.setUpdateTime(date);
         		sysUserCashAccountService.updateBalance(userId, amount.negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"乐团续费");
-
+                amount = BigDecimal.ZERO;
         	}else{
 				if (userCashAccount.getBalance().doubleValue() > 0) {
 					sysUserCashAccountService.updateBalance(userId, userCashAccount.getBalance().negate(), PlatformCashAccountDetailTypeEnum.PAY_FEE, "乐团续费");
@@ -533,7 +537,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
         studentPaymentOrder.setVersion(studentPaymentOrder.getVersion()+1);
 
-        MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
         //分类费用 course,instrument,accessories,other
         Map<String, BigDecimal> classFee = new HashMap<>();
         classFee.put("course",courseFee);
@@ -569,6 +572,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         );
 
         Map<String,BigDecimal> routingFee = (Map<String,BigDecimal>)payMap.get("routingFee");
+        studentPaymentOrder.setOrganId(musicGroup.getOrganId());
         studentPaymentOrder.setComAmount(routingFee.get("COM"));
         studentPaymentOrder.setPerAmount(routingFee.get("PER"));
         studentPaymentOrder.setMerNos((String) payMap.get("routingMerNos"));
@@ -693,6 +697,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         studentPaymentOrder.setVersion(0);
         Date date = new Date();
 
+        MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
         if(registerPayDto.getIsUseBalancePayment() || amount.doubleValue() == 0){
         	SysUserCashAccount userCashAccount = sysUserCashAccountService.getLocked(userId);
         	if(userCashAccount == null){
@@ -702,8 +707,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         	if(userCashAccount.getBalance().subtract(amount).doubleValue() > 0){
         		// 更新订单信息
         		studentPaymentOrder.setBalancePaymentAmount(amount);
+        		studentPaymentOrder.setOrganId(musicGroup.getOrganId());
                 studentPaymentOrder.setUpdateTime(date);
         		sysUserCashAccountService.updateBalance(userId, amount.negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"乐团续费");
+        		amount = BigDecimal.ZERO;
         	}else{
 				if (userCashAccount.getBalance().doubleValue() > 0) {
 					sysUserCashAccountService.updateBalance(userId, userCashAccount.getBalance().negate(), PlatformCashAccountDetailTypeEnum.PAY_FEE, "乐团续费");
@@ -727,7 +734,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         }
         studentPaymentOrder.setVersion(studentPaymentOrder.getVersion()+1);
 
-        MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
         //分类费用 course,instrument,accessories,other
         Map<String, BigDecimal> classFee = new HashMap<>();
         classFee.put("course",courseFee);
@@ -763,6 +769,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         );
 
         Map<String,BigDecimal> routingFee = (Map<String,BigDecimal>)payMap.get("routingFee");
+        studentPaymentOrder.setOrganId(musicGroup.getOrganId());
         studentPaymentOrder.setComAmount(routingFee.get("COM"));
         studentPaymentOrder.setPerAmount(routingFee.get("PER"));
         studentPaymentOrder.setMerNos((String) payMap.get("routingMerNos"));
@@ -1471,11 +1478,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         		throw new BizException("用户账户找不到");
         	}
             studentPaymentOrder.setPaymentChannel("BALANCE");
-        	if(userCashAccount.getBalance().subtract(amount).doubleValue() > 0){
+        	if(userCashAccount.getBalance().subtract(amount).doubleValue() >= 0){
         		// 更新订单信息
         		studentPaymentOrder.setBalancePaymentAmount(amount);
                 studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
                 studentPaymentOrder.setUpdateTime(date);
+                studentPaymentOrder.setOrganId(musicGroup.getOrganId());
                 studentPaymentOrderService.update(studentPaymentOrder);
 
         		sysUserCashAccountService.updateBalance(userId, amount.negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"乐团续费");
@@ -1520,6 +1528,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             );
 
             Map<String,BigDecimal> routingFee = (Map<String,BigDecimal>)payMap.get("routingFee");
+            studentPaymentOrder.setOrganId(musicGroup.getOrganId());
             studentPaymentOrder.setComAmount(routingFee.get("COM"));
             studentPaymentOrder.setPerAmount(routingFee.get("PER"));
             studentPaymentOrder.setMerNos((String) payMap.get("routingMerNos"));

+ 8 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupStudentFeeServiceImpl.java

@@ -1,17 +1,20 @@
 package com.ym.mec.biz.service.impl;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
-import com.ym.mec.biz.dal.entity.MusicGroup;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import com.ym.mec.biz.dal.dao.MusicGroupDao;
 import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
 import com.ym.mec.biz.dal.dao.SysConfigDao;
+import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
-import com.ym.mec.biz.dal.entity.SysConfig;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.service.MusicGroupStudentFeeService;
 import com.ym.mec.biz.service.SysConfigService;
@@ -52,7 +55,7 @@ public class MusicGroupStudentFeeServiceImpl extends BaseServiceImpl<Long, Music
 		List<MusicGroupStudentFee> musicGroupStudentFeeList = musicGroupStudentFeeDao.queryWillRenewList(days);
 
 		for (MusicGroupStudentFee musicGroupStudentFee : musicGroupStudentFeeList) {
-			if (musicGroupStudentFee.getPaymentStatus() == PaymentStatus.PAID_COMPLETED && musicGroupStudentFee.getCourseFee().doubleValue() > 0) {
+			if (musicGroupStudentFee.getPaymentStatus() == PaymentStatus.PAID_COMPLETED && (musicGroupStudentFee.getCourseFee() != null && musicGroupStudentFee.getCourseFee().doubleValue() > 0)) {
 				musicGroupStudentFee.setPaymentStatus(PaymentStatus.NON_PAYMENT);
 				musicGroupStudentFee.setUpdateTime(date);
 				updateList.add(musicGroupStudentFee);

+ 3 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -249,17 +249,16 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         //增加报名学生数
         musicGroupSubjectPlanService.addApplyStudentNum(studentRegistration.getMusicGroupId(), studentRegistration.getSubjectId(), 1);
         //报名成功后,发送短信
-        String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL) + studentRegistration.getMusicGroupId();
+//        String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL) + studentRegistration.getMusicGroupId();
         String serverPhone = sysConfigDao.findConfigValue(SysConfigService.SERVER_PHONE);
         Subject subject = subjectDao.get(studentRegistration.getActualSubjectId());
-        MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
+//        MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
 
         Map<Integer, String> map = new HashMap<>(1);
         map.put(studentRegistration.getUserId(), studentRegistration.getParentsPhone());
         sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI,
                 MessageTypeEnum.SMS_APPLY_MESSAGE, map, null, 0, "",
-                studentRegistration.getParentsName(), subject.getName(), HttpUtil.getSortUrl(studentApplyUrl),
-                DateUtil.format(musicGroup.getApplyExpireDate(), DateUtil.DATE_FORMAT_MIN), serverPhone);
+                studentRegistration.getParentsName(), subject.getName(), serverPhone);
 
         redisCache.releaseLocked(key, threadId);
         return studentRegistration;

+ 13 - 27
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherServiceImpl.java

@@ -109,6 +109,16 @@ public class TeacherServiceImpl extends BaseServiceImpl<Integer, Teacher>  imple
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void updateTea(Teacher teacher) {
+		Teacher teacher1 = teacherDao.get(teacher.getId());
+		if(null==teacher1){
+			throw new BizException("教师信息不存在");
+		}
+		if(StringUtils.isNotEmpty(teacher.getPhone())){
+			SysUser sysUser = sysUserFeignService.queryUserByMobile(teacher.getPhone());
+			if(sysUser != null && !sysUser.getId().equals(teacher.getId())){
+				throw new BizException("手机号已存在");
+			}
+		}
 		teacher.setUpdateTime(new Date());
 		teacherDao.update(teacher);
 		teacherDao.updateUser(teacher);
@@ -125,33 +135,6 @@ public class TeacherServiceImpl extends BaseServiceImpl<Integer, Teacher>  imple
 
 	@Override
 	public List<ImGroupModel> queryTeacherGroups(Integer userId,String search) {
-		//获取教师所在乐团列表
-		/*List<ImGroupModel> imGroupModels =  musicGroupDao.queryTeacherGroups(userId,search);
-
-		if(imGroupModels != null && imGroupModels.size() > 0){
-			//获取乐团id列表
-			Set<String> musicGroupIds = imGroupModels.stream().map(e -> e.getId()).collect(Collectors.toSet());
-			List<MusicGroup> musicGroups = musicGroupDao.queryListByIds(musicGroupIds);
-			List<Map<String, BigDecimal>> musicGroupUserNums = musicGroupDao.countMusicGroupUserNum(StringUtils.join(musicGroupIds,","));
-			Map<String, BigDecimal> musicGroupUserNumMap = MapUtil.convertMybatisMap(musicGroupUserNums);
-			imGroupModels.forEach(e -> {
-				Set<Integer> teachers = e.getName() == null?new HashSet<>():new HashSet(Arrays.asList(e.getName().split(",")));
-				MusicGroup musicGroup = musicGroups.stream().filter(mg -> mg.getId().equals(e.getId())).findFirst().get();
-				//获取教学老师id列表
-//				Set<Integer> teachers = musicGroupDao.queryTeacherIds(e.getId());
-				teachers.add(musicGroup.getTeamTeacherId());
-				teachers.add(musicGroup.getEducationalTeacherId());
-				teachers.add(musicGroup.getOperatorUserId());
-				teachers.add(musicGroup.getDirectorUserId());
-				teachers.removeAll(Collections.singleton(null));
-				//获取乐团群用户总数
-				BigDecimal count = musicGroupUserNumMap.get(e.getId());
-				e.setCount(count == null?0:count.intValue() + teachers.size());
-				e.setId("mg" + e.getId());
-			});
-		}else {
-			imGroupModels = new ArrayList<>();
-		}*/
 		//获取教师所在班级列表
 		List<ImGroupModel> imGroupModels =  classGroupDao.queryTeacherGroups(userId,search);
 		if(imGroupModels != null && imGroupModels.size() > 0){
@@ -159,6 +142,9 @@ public class TeacherServiceImpl extends BaseServiceImpl<Integer, Teacher>  imple
 			//获取班级老师总数map
 			Map<Integer, Integer> numsMap = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertIntegerMap(classGroupDao.countTeacherNums(StringUtils.join(classGroupIds, ",")))),HashMap.class);
 			imGroupModels.forEach(e -> {
+				if(StringUtils.isNotEmpty(e.getGroupName())){
+					e.setName(e.getGroupName() + " " + e.getName());
+				}
 				Integer num = numsMap.get(Integer.parseInt(e.getId()));
 				e.setCount((num == null ? 0 : num) + e.getCount());
 			});

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -1069,6 +1069,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				studentPaymentOrder.setBalancePaymentAmount(amount);
 				studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
 				studentPaymentOrder.setUpdateTime(date);
+				studentPaymentOrder.setOrganId(vipGroup.getOrganId());
 
 				this.orderCallback(studentPaymentOrder);
 
@@ -1118,6 +1119,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			);
 
 			Map<String,BigDecimal> routingFee = (Map<String,BigDecimal>)payMap.get("routingFee");
+			studentPaymentOrder.setOrganId(vipGroup.getOrganId());
 			studentPaymentOrder.setComAmount(routingFee.get("COM"));
 			studentPaymentOrder.setPerAmount(routingFee.get("PER"));
 			studentPaymentOrder.setMerNos((String) payMap.get("routingMerNos"));

+ 10 - 6
mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -254,10 +254,12 @@
         <result column="student_num_" property="count"/>
         <result column="img_" property="img"/>
         <result column="teacher_ids_" property="teacherIds"/>
+        <result column="group_name_" property="groupName"/>
     </resultMap>
     <select id="queryUserGroups" resultMap="imGroupModel">
-        SELECT cg.id_,cg.name_,cg.student_num_,cg.img_ FROM class_group_student_mapper cgsm
+        SELECT cg.id_,cg.name_,cg.student_num_,cg.img_,mg.name_ group_name_ FROM class_group_student_mapper cgsm
         LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
+        LEFT JOIN music_group mg ON mg.id_ = cg.music_group_id_ AND cg.group_type_ = 'MUSIC'
         <where>
             cg.del_flag_ = 0 AND cgsm.status_ != 'QUIT'
             <if test="userId != null">
@@ -347,8 +349,9 @@
     </select>
 
     <select id="queryTeacherGroups" resultMap="imGroupModel">
-        SELECT cg.id_,cg.name_,cg.student_num_,cg.img_ FROM class_group_teacher_mapper cgtm
+        SELECT cg.id_,cg.name_,cg.student_num_,cg.img_,mg.name_ group_name_ FROM class_group_teacher_mapper cgtm
         LEFT JOIN class_group cg ON cgtm.class_group_id_ = cg.id_
+        LEFT JOIN music_group mg ON mg.id_ = cg.music_group_id_ AND cg.group_type_ = 'MUSIC'
         WHERE cgtm.user_id_ = #{userId} AND cg.del_flag_ = 0
         <if test="search != null">
             AND cg.name_ LIKE CONCAT('%',#{search},'%')
@@ -438,8 +441,9 @@
         WHERE
             csts.user_id_ = #{teacherId}
             AND cg.group_type_='MUSIC'
-            AND csts.expect_salary_!=0
             AND cg.del_flag_ = 0
+            AND cs.del_flag_ = 0
+            AND mg.status_ = 'PROGRESS'
         GROUP BY cg.id_
     </select>
     <select id="findTeacherVipClassGroup" resultMap="TeacherClassGroupDto">
@@ -466,7 +470,7 @@
             LEFT JOIN course_schedule cs ON cg.id_=cs.class_group_id_
             LEFT JOIN school s ON vg.teacher_school_id_ = s.id_
         WHERE
-            vg.user_id_ = #{teacherId}
+            vg.user_id_ = #{teacherId} AND vg.status_ = 2
         GROUP BY
         vg.id_,cg.id_
     </select>
@@ -537,7 +541,7 @@
 
     <sql id="queryMusicGroupCourseScheduleSql">
         <where>
-            cg.group_type_ = 'MUSIC'
+            cg.group_type_ = 'MUSIC' AND cs.del_flag_ = 0
             <if test="startTime != null">
                 AND cs.class_date_ &gt;= #{startTime}
             </if>
@@ -552,7 +556,7 @@
 
     <sql id="queryMusicGroupCourseScheduleDetailSql">
         <where>
-            (ta.teacher_id_ = cs.actual_teacher_id_ OR ta.id_ IS NULL) AND cg.group_type_ = 'MUSIC'
+            (ta.teacher_id_ = cs.actual_teacher_id_ OR ta.id_ IS NULL) AND cg.group_type_ = 'MUSIC' AND cs.del_flag_ = 0
             <if test="classScheduleType != null">
                 AND cs.type_ = #{classScheduleType}
             </if>

+ 17 - 5
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -1199,7 +1199,9 @@
     <select id="queryMusicGroupIds" resultType="java.lang.String">
         SELECT DISTINCT cgsm.music_group_id_ FROM class_group_student_mapper cgsm
         LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
-        WHERE cgsm.user_id_ = #{userId} AND cgsm.status_ != 'QUIT' AND cg.del_flag_ = 0
+        LEFT JOIN music_group mg ON mg.id_ = cg.music_group_id_ AND cg.group_type_ = 'MUSIC'
+        LEFT JOIN vip_group vg ON vg.id_ = cg.music_group_id_ AND cg.group_type_ = 'VIP'
+        WHERE cgsm.user_id_ = #{userId} AND cgsm.status_ != 'QUIT' AND cg.del_flag_ = 0 AND (mg.status_ = 'PROGRESS' OR vg.status_ = 3)
         ORDER BY cgsm.music_group_id_
         <include refid="global.limit"/>
     </select>
@@ -1675,7 +1677,7 @@
         <foreach collection="vipGroupIds" open="(" close=")" separator="," item="item">
             #{item}
         </foreach>
-        AND cs.group_type_ = 'VIP' AND cs.del_flag_ = 0
+        AND cs.group_type_ = #{groupType} AND cs.del_flag_ = 0
         GROUP BY cs.music_group_id_
     </select>
     <select id="countCourseScheduleNum" resultType="java.util.Map">
@@ -1683,7 +1685,7 @@
         <foreach collection="vipGroupIds" open="(" close=")" separator="," item="item">
             #{item}
         </foreach>
-        AND cs.group_type_ = 'VIP' AND cs.status_ != 'NOT_START' AND cs.del_flag_ = 0
+        AND cs.group_type_ = #{groupType} AND cs.status_ != 'NOT_START' AND cs.del_flag_ = 0
         GROUP BY cs.music_group_id_
     </select>
     <select id="countTotalNumByClassGroupId" resultType="java.util.Map">
@@ -1704,13 +1706,23 @@
         <foreach collection="classGroupIds" item="item" separator="," open="(" close=")">
             #{item}
         </foreach>
-        <if test="classDate != null">
-            AND cs.class_date_ = DATE_FORMAT(#{classDate}, '%Y%m%d')
+        <if test="teacherId != null">
+            AND cs.actual_teacher_id_ = #{teacherId}
         </if>
         AND cs.status_ = 'NOT_START' AND cs.del_flag_ = 0
         GROUP BY cs.class_group_id_
     </select>
 
+    <select id="countExpendNumByClassGroupId" resultType="java.util.Map">
+        SELECT cs.class_group_id_ 'key',COUNT(cs.id_) 'value' FROM course_schedule cs
+        WHERE cs.class_group_id_ IN
+        <foreach collection="classGroupIds" item="item" separator="," open="(" close=")">
+            #{item}
+        </foreach>
+        AND cs.status_ != 'NOT_START' AND cs.del_flag_ = 0
+        GROUP BY cs.class_group_id_
+    </select>
+
     <select id="findUserSurplusCourseInfoByGroup" resultMap="StudentCourseInfoDto">
         SELECT
             cs.id_,

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

@@ -207,7 +207,7 @@
 		LEFT JOIN music_group mg ON sr.music_group_id_ = mg.id_
 		LEFT JOIN `subject` s ON sr.actual_subject_id_ = s.id_
 		LEFT JOIN sys_user su ON  su.id_ = sr.user_id_
-		WHERE sr.user_id_ = #{userId} AND sr.music_group_status_ != 'QUIT'
+		WHERE sr.user_id_ = #{userId} AND mg.status_ IN ('APPLY','PAY','PREPARE','PROGRESS')
 		ORDER BY mg.create_time_ DESC
 	</select>
 

+ 6 - 0
mec-biz/src/main/resources/config/mybatis/SporadicChargeInfo.xml

@@ -14,6 +14,8 @@
 		<result column="update_time_" property="updateTime" />
 		<result column="operator_id_" property="operatorId" />
 		<result column="del_flag_" property="delFlag" />
+		<result column="organ_name_" property="organName" />
+		<result column="organ_name_" property="organName" />
 	</resultMap>
 
 	<!-- 根据主键查询一条记录 -->
@@ -96,4 +98,8 @@
 		SELECT COUNT(id_) FROM sporadic_charge_info sci
 		<include refid="queryPageSql"/>
 	</select>
+	<select id="findInfoById" resultMap="SporadicChargeInfo">
+		SELECT sci.*,o.name_ organ_name_ FROM sporadic_charge_info sci
+		LEFT JOIN organization o on sci.organ_id_ = o.id_ WHERE sci.id_ = #{id}
+	</select>
 </mapper>

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

@@ -418,7 +418,7 @@
         LEFT JOIN music_group mg ON sr.music_group_id_ = mg.id_
         LEFT JOIN music_group_student_fee_ mgsf ON mgsf.music_group_id_ = mg.id_ AND mgsf.user_id_ = su.id_
         <include refid="queryMusicGroupStudentSql"/>
-        ORDER BY sr.create_time_ DESC
+        ORDER BY sr.id_ DESC
         <include refid="global.limit"/>
     </select>
 

+ 5 - 1
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml

@@ -10,6 +10,7 @@
         <result column="id_" property="id"/>
         <result column="group_type_" property="groupType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="user_id_" property="userId"/>
+        <result column="organ_id_" property="organId"/>
         <result column="type_" property="type" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="expect_amount_" property="expectAmount"/>
         <result column="actual_amount_" property="actualAmount"/>
@@ -149,6 +150,9 @@
             <if test="musicGroupId != null">
                 music_group_id_ = #{musicGroupId},
             </if>
+            <if test="organId != null">
+                organ_id_ = #{organId},
+            </if>
             <if test="payTime != null">
                 pay_time_ = #{payTime},
             </if>
@@ -183,7 +187,7 @@
     <sql id="queryPaymentOrder">
         <where>
             <if test="organId != null">
-                AND FIND_IN_SET(u.organ_id_,#{organId})
+                AND FIND_IN_SET(spo.organ_id_,#{organId})
             </if>
             <if test="orderStartDate != null">
                 AND DATE_FORMAT(spo.create_time_,'%Y-%m-%d') &gt;= #{orderStartDate}

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

@@ -34,6 +34,10 @@
         <result column="temporary_course_fee_" property="temporaryCourseFee" />
         <result column="birthdate_" property="birthdate" />
         <result column="gender_" property="gender" />
+        <result column="organ_name_" property="organName" />
+        <result column="school_name_" property="schoolName" />
+        <result column="subject_name_" property="subjectName" />
+        <result column="kit_group_purchase_type_" property="kitType" />
     </resultMap>
 
     <resultMap type="com.ym.mec.biz.dal.dto.StudentInfo" id="StudentInfo">
@@ -582,4 +586,14 @@
         UPDATE student_registration sr SET sr.current_grade_ = #{currentGrade},sr.current_class_ = #{currentClass},sr.update_time_ = NOW()
         WHERE sr.user_id_ = #{userId}
     </update>
+
+    <select id="findStudentByMusicGroupIdAndUserId" resultMap="StudentRegistration">
+        SELECT sr.*,o.name_ organ_name_,s.name_ school_name_,s2.name_ subject_name_,mgsp.kit_group_purchase_type_ kit_group_purchase_type_ FROM student_registration sr
+        LEFT JOIN music_group mg ON mg.id_ =sr.music_group_id_
+        LEFT JOIN school s on mg.school_id_ = s.id_
+        LEFT JOIN organization o on mg.organ_id_ = o.id_
+        LEFT JOIN subject s2 on sr.subject_id_ = s2.id_
+        LEFT JOIN music_group_subject_plan mgsp on mg.id_ = sr.subject_id_
+        WHERE sr.music_group_id_ = #{musicGroupId} AND sr.user_id_ = #{userId} AND sr.music_group_status_ != 'QUIT' LIMIT 1
+    </select>
 </mapper>

+ 13 - 0
mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml

@@ -37,6 +37,10 @@
         <result column="stop_reason_" property="stopReason"/>
         <result column="courses_start_date" property="courseStartDate"/>
         <result column="course_schedules_json_" property="courseSchedulesJson"/>
+
+        <result column="organ_name_" property="organName" />
+        <result column="school_name_" property="schoolName" />
+        <result column="subject_name_" property="subjectName" />
     </resultMap>
     
     <resultMap type="com.ym.mec.biz.dal.entity.School" id="School">
@@ -885,4 +889,13 @@
     <select id="queryNormalStatusList" resultMap="VipGroup">
         SELECT * FROM vip_group WHERE status_!=3 AND status_!=4
     </select>
+
+    <select id="findVipGroupInfo" resultMap="VipGroup">
+        SELECT vg.*,s.name_ subject_name_,o.name_ organ_name_,s2.name_ school_name_ FROM vip_group vg
+        LEFT JOIN class_group cg on vg.id_ = cg.music_group_id_
+        LEFT JOIN organization o on vg.organ_id_ = o.id_
+        LEFT JOIN subject s on cg.subject_id_list_ = s.id_
+        LEFT JOIN school s2 on vg.teacher_school_id_ = s2.id_
+        WHERE vg.id_ = #{id} AND cg.id_=#{classGroupId} AND cg.group_type_='VIP'
+    </select>
 </mapper>

+ 9 - 0
mec-common/common-core/src/main/java/com/ym/mec/common/entity/ImGroupModel.java

@@ -9,6 +9,7 @@ public class ImGroupModel {
     private String name;
     private String teacherIds;
     private String img;
+    private String groupName;
     private Integer minute;
     private Integer count;
     private Integer status;
@@ -31,6 +32,14 @@ public class ImGroupModel {
         this.name = name;
     }
 
+    public String getGroupName() {
+        return groupName;
+    }
+
+    public void setGroupName(String groupName) {
+        this.groupName = groupName;
+    }
+
     public String getTeacherIds() {
         return teacherIds;
     }

+ 0 - 1
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherController.java

@@ -29,7 +29,6 @@ public class TeacherController extends BaseController {
     private TeacherService teacherService;
     @Autowired
     private SubjectService subjectService;
-
     @Autowired
     private ClassGroupService classGroupService;
     @Autowired

+ 8 - 2
mec-util/pom.xml

@@ -65,13 +65,19 @@
 		<dependency>
 			<groupId>org.apache.poi</groupId>
 			<artifactId>poi</artifactId>
-    		<version>3.12</version>
+			<version>3.12</version>
 		</dependency>
 
 		<dependency>
 			<groupId>org.apache.poi</groupId>
 			<artifactId>poi-ooxml</artifactId>
-    		<version>3.12</version>
+			<version>3.12</version>
+		</dependency>
+
+		<dependency>
+			<groupId>iTextAsian</groupId>
+			<artifactId>iTextAsian</artifactId>
+			<version>1.0</version>
 		</dependency>
 	</dependencies>
 </project>

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

@@ -11,11 +11,13 @@ import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
 import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
-import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
 import com.ym.mec.biz.dal.enums.TeachModeEnum;
 import com.ym.mec.biz.dal.page.StudentAttendanceQueryInfo;
 import com.ym.mec.biz.dal.page.VipGroupQueryInfo;
-import com.ym.mec.biz.service.*;
+import com.ym.mec.biz.service.CourseScheduleComplaintsService;
+import com.ym.mec.biz.service.CourseScheduleService;
+import com.ym.mec.biz.service.MusicGroupService;
+import com.ym.mec.biz.service.StudentAttendanceService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.exception.BizException;
 import io.swagger.annotations.Api;
@@ -49,14 +51,10 @@ public class CourseScheduleController extends BaseController {
     private StudentAttendanceService studentAttendanceService;
     @Autowired
     private ClassGroupTeacherMapperDao classGroupTeacherMapperDao;
-    
     @Autowired
     private CourseScheduleComplaintsService courseScheduleComplaintsService;
     @Autowired
-    private ClassGroupTeacherMapperService classGroupTeacherMapperService;
-    @Autowired
     private SysUserFeignService sysUserFeignService;
-    
     @Autowired
     private MusicGroupService musicGroupService;
 

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

@@ -2,17 +2,14 @@ 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.dao.StudentPaymentOrderDetailDao;
+import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.StudentApplyDetailDto;
 import com.ym.mec.biz.dal.dto.StudentHasCourseDto;
 import com.ym.mec.biz.dal.dto.TeacherSalaryDto;
 import com.ym.mec.biz.dal.dto.musicalListDetailDto;
-import com.ym.mec.biz.dal.entity.Employee;
-import com.ym.mec.biz.dal.entity.Goods;
-import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
-import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.biz.dal.enums.KitPurchaseMethodEnum;
 import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
 import com.ym.mec.biz.dal.page.CourseScheduleTeacherSalaryQueryInfo;
 import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
@@ -61,19 +58,25 @@ public class ExportController extends BaseController {
     private StudentPaymentOrderService studentPaymentOrderService;
     @Autowired
     private StudentPaymentOrderDetailDao studentPaymentOrderDetailDao;
+    @Autowired
+    private StudentRegistrationDao studentRegistrationDao;
+    @Autowired
+    private SporadicChargeInfoDao sporadicChargeInfoDao;
+    @Autowired
+    private VipGroupDao vipGroupDao;
 
     @ApiOperation(value = "导出学员是否有课")
     @PostMapping("export/studentHasCourse")
     @PreAuthorize("@pcs.hasPermissions('export/studentHasCourse')")
-    public void studentHasCourse(HttpServletResponse response){
+    public void studentHasCourse(HttpServletResponse response) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if(sysUser == null){
+        if (sysUser == null) {
             throw new BizException("获取用户信息失败");
         }
-        List<StudentHasCourseDto> hasCourseDtos =  studentManageService.queryHasCourseStudent(sysUser.getOrganId());
+        List<StudentHasCourseDto> hasCourseDtos = studentManageService.queryHasCourseStudent(sysUser.getOrganId());
         try {
-            HSSFWorkbook workbook = POIUtil.exportExcel(new String[] {"学员编号", "姓名","分部","所在乐团","乐团所属声部","所在vip课"}, new String[] {
-                    "userId","userName","organName","musicGroupName","subjectName","vipGroupName"}, hasCourseDtos);
+            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"学员编号", "姓名", "分部", "所在乐团", "乐团所属声部", "所在vip课"}, new String[]{
+                    "userId", "userName", "organName", "musicGroupName", "subjectName", "vipGroupName"}, hasCourseDtos);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
             response.flushBuffer();
@@ -88,11 +91,11 @@ public class ExportController extends BaseController {
     @ApiOperation(value = "导出乐器采购清单")
     @PostMapping("order/musicalListExport")
     @PreAuthorize("@pcs.hasPermissions('order/musicalListExport')")
-    public void musicalListExport(HttpServletResponse response, String musicGroupId){
+    public void musicalListExport(HttpServletResponse response, String musicGroupId) {
         List<Goods> musicalList = studentPaymentOrderDetailService.getMusicalList(musicGroupId);
         try {
-            HSSFWorkbook workbook = POIUtil.exportExcel(new String[] {"分部","乐团","商品类型", "商品名称", "型号", "数量"}, new String[] {
-                    "brief","memo","type.desc","name","specification","sellCount"}, musicalList);
+            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "乐团", "商品类型", "商品名称", "型号", "数量"}, new String[]{
+                    "brief", "memo", "type.desc", "name", "specification", "sellCount"}, musicalList);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
             response.flushBuffer();
@@ -106,11 +109,11 @@ public class ExportController extends BaseController {
     @ApiOperation(value = "导出学员采购清单明细")
     @PostMapping("order/musicalListDetailExport")
     @PreAuthorize("@pcs.hasPermissions('order/musicalListDetailExport')")
-    public void musicalListDetailExport(HttpServletResponse response, String musicGroupId){
+    public void musicalListDetailExport(HttpServletResponse response, String musicGroupId) {
         List<musicalListDetailDto> musicalList = studentPaymentOrderDetailService.getMusicalListDetail(musicGroupId);
         try {
-            HSSFWorkbook workbook = POIUtil.exportExcel(new String[] {"分部", "乐团","学员编号","学员姓名","购买商品", "采购方式", "乐器金额", "教辅金额", "课程金额", "订单总价"}, new String[] {
-                    "organName","musicGroupName","userId","username","goodsNames","kitGroupPurchaseTypeEnum.msg","musicalAmount","accessoriesAmount","courseAmount","orderAmount"}, musicalList);
+            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "乐团", "学员编号", "学员姓名", "购买商品", "采购方式", "乐器金额", "教辅金额", "课程金额", "订单总价"}, new String[]{
+                    "organName", "musicGroupName", "userId", "username", "goodsNames", "kitGroupPurchaseTypeEnum.msg", "musicalAmount", "accessoriesAmount", "courseAmount", "orderAmount"}, musicalList);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
             response.flushBuffer();
@@ -127,8 +130,8 @@ public class ExportController extends BaseController {
     public void queryStudentApplyDetailExport(StudentRegistrationQueryInfo queryInfo, HttpServletResponse response) {
         List<StudentApplyDetailDto> studentApplyDetail = studentRegistrationService.queryStudentDetailPage(queryInfo).getRows();
         try {
-            HSSFWorkbook workbook = POIUtil.exportExcel(new String[] { "学生姓名","家长姓名", "年级", "班级", "性别", "服从调剂","报名专业", "实际专业","联系电话", "学员缴费状态", "乐器购买方式"}, new String[] {
-                    "studentName","parentsName", "currentGrade", "currentClass", "gender.description", "isAllowAdjust.msg", "subjectName", "actualSubjectName", "parentsPhone","paymentStatus.desc","kitGroupPurchaseTypeEnum.msg"}, studentApplyDetail);
+            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"学生姓名", "家长姓名", "年级", "班级", "性别", "服从调剂", "报名专业", "实际专业", "联系电话", "学员缴费状态", "乐器购买方式"}, new String[]{
+                    "studentName", "parentsName", "currentGrade", "currentClass", "gender.description", "isAllowAdjust.msg", "subjectName", "actualSubjectName", "parentsPhone", "paymentStatus.desc", "kitGroupPurchaseTypeEnum.msg"}, studentApplyDetail);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
             response.flushBuffer();
@@ -145,8 +148,8 @@ public class ExportController extends BaseController {
     public void export(CourseScheduleTeacherSalaryQueryInfo queryInfo, HttpServletResponse response) {
         List<TeacherSalaryDto> teacherSalaries = courseScheduleTeacherSalaryService.querySalaries(queryInfo).getRows();
         try {
-            HSSFWorkbook workbook = POIUtil.exportExcel(new String[] { "用户编号","用户名", "手机号", "课程类型", "实际薪水", "补助", "结算时间", "教师角色"}, new String[] {
-                    "userId","username", "phone", "type.msg", "name", "actualSalary", "subsidy", "settlementTime", "teacherRole.msg"}, teacherSalaries);
+            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"用户编号", "用户名", "手机号", "课程类型", "实际薪水", "补助", "结算时间", "教师角色"}, new String[]{
+                    "userId", "username", "phone", "type.msg", "name", "actualSalary", "subsidy", "settlementTime", "teacherRole.msg"}, teacherSalaries);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
             response.flushBuffer();
@@ -168,49 +171,96 @@ public class ExportController extends BaseController {
                 queryInfo.setOrganId(employee.getOrganIdList());
             }
         }
+        queryInfo.setRows(999999999);
 
         PageInfo<StudentPaymentOrder> studentPaymentOrderPageInfo = studentPaymentOrderService.queryPage(queryInfo);
 
+        long i = 1;
         for (StudentPaymentOrder row : studentPaymentOrderPageInfo.getRows()) {
-            BigDecimal balancePaymentAmount = row.getBalancePaymentAmount() == null ? BigDecimal.ZERO : row.getBalancePaymentAmount();
-            if (queryInfo.getOrderType().equals(1)) {
+            if (queryInfo.getOrderType().equals("1")) {
                 BigDecimal comAmount = row.getComAmount() == null ? BigDecimal.ZERO : row.getComAmount();
-                row.setExpectAmount(comAmount.add(balancePaymentAmount));
-                row.setActualAmount(comAmount.add(balancePaymentAmount));
-            }else {
+                row.setActualAmount(comAmount);
+            } else if (queryInfo.getOrderType().equals("2")) {
                 BigDecimal perAmount = row.getPerAmount() == null ? BigDecimal.ZERO : row.getPerAmount();
-                row.setExpectAmount(perAmount.add(balancePaymentAmount));
-                row.setActualAmount(perAmount.add(balancePaymentAmount));
+                row.setActualAmount(perAmount);
             }
-            BigDecimal transferFee = (row.getActualAmount().subtract(balancePaymentAmount).multiply(new BigDecimal(0.28)).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_UP);
-            row.setTransferFee(transferFee);
-            if(row.getGroupType().equals(GroupType.SPORADIC)){
-                row.setSporadicAmount(row.getActualAmount());
-                row.setExpectAmount(BigDecimal.ZERO);
+            if (row.getActualAmount() == null) {
                 row.setActualAmount(BigDecimal.ZERO);
             }
+            BigDecimal transferFee = (row.getActualAmount().multiply(new BigDecimal(0.28)).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_UP);
+            row.setTransferFee(transferFee);
             List<StudentPaymentOrderDetail> orderDetails = studentPaymentOrderDetailDao.findApplyOrderGoods(row.getId());
             BigDecimal musicalFee = BigDecimal.ZERO;
             BigDecimal teachingFee = BigDecimal.ZERO;
-            if(orderDetails.size() > 0) {
+            if (orderDetails.size() > 0) {
                 for (StudentPaymentOrderDetail orderDetail : orderDetails) {
                     if (orderDetail.getType().equals(OrderDetailTypeEnum.MUSICAL)) {
-                        musicalFee =  musicalFee.add(orderDetail.getPrice());
+                        musicalFee = musicalFee.add(orderDetail.getPrice());
                     } else if (orderDetail.getType().equals(OrderDetailTypeEnum.ACCESSORIES) || orderDetail.getType().equals(OrderDetailTypeEnum.TEACHING)) {
-                        teachingFee =  teachingFee.add(orderDetail.getPrice());
+                        teachingFee = teachingFee.add(orderDetail.getPrice());
                     }
                 }
             }
             row.setMusicalFee(musicalFee);
             row.setTeachingFee(teachingFee);
+            //专业
+            if (row.getGroupType().equals(GroupType.MUSIC)) {
+                StudentRegistration studentRegistration = studentRegistrationDao.findStudentByMusicGroupIdAndUserId(row.getMusicGroupId(), row.getUserId());
+                if (studentRegistration != null) {
+                    row.setSubjectName(studentRegistration.getSubjectName());
+                    row.setOrganName(studentRegistration.getOrganName());
+                    row.setSchoolName(studentRegistration.getSchoolName());
+                    if (studentRegistration.getKitType() != null && studentRegistration.getKitType().equals(KitPurchaseMethodEnum.LEASE)) {
+                        row.setLeaseFee(musicalFee);
+                        row.setMusicalFee(BigDecimal.ZERO);
+                    }
+                }
+            } else if (row.getGroupType().equals(GroupType.VIP)) {
+                VipGroup vipGroupInfo = vipGroupDao.findVipGroupInfo(Integer.parseInt(row.getMusicGroupId()), row.getClassGroupId());
+                if (vipGroupInfo != null) {
+                    row.setOrganName(vipGroupInfo.getOrganName());
+                    row.setSchoolName(vipGroupInfo.getSchoolName());
+                    row.setSubjectName(vipGroupInfo.getSubjectName());
+                }
 
+            } else if (row.getGroupType().equals(GroupType.SPORADIC)) {
+                SporadicChargeInfo sporadicChargeInfo = sporadicChargeInfoDao.findInfoById(Integer.parseInt(row.getMusicGroupId()));
+                if(sporadicChargeInfo != null) {
+                    row.setSporadicAmount(row.getActualAmount());
+                    row.setMusicalFee(BigDecimal.ZERO);
+                    row.setTeachingFee(BigDecimal.ZERO);
+                    row.setTeachingFee(BigDecimal.ZERO);
+                    if (sporadicChargeInfo.getChargeType().equals("1")) {
+                        row.setSporadicType("考级");
+                    } else if (sporadicChargeInfo.getChargeType().equals("2")) {
+                        row.setSporadicType("缴费");
+                    } else if (sporadicChargeInfo.getChargeType().equals("3")) {
+                        row.setSporadicType("声部更改");
+                    } else if (sporadicChargeInfo.getChargeType().equals("4")) {
+                        row.setSporadicType("乐器更换");
+                    }
+                    row.setOrganName(sporadicChargeInfo.getOrganName());
+                }
+            }
+            String paymentChannel = "";
+            if (row.getPaymentChannel() == null) {
+            } else if (row.getPaymentChannel().equals("YQPAY")) {
+                paymentChannel = "双乾";
+            } else if (row.getPaymentChannel().equals("ADAPAY")) {
+                paymentChannel = "汇付";
+            } else if (row.getPaymentChannel().equals("BALANCE")) {
+                paymentChannel = "余额";
+            }
+            row.setPaymentChannel(paymentChannel);
+            row.setId(i);
+            i++;
         }
 
         try {
             String[] header = {"序号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "支付金额", "到账时间",
-            "关联乐团ID/VIP课ID","课程形态","押金","乐器","教辅费用","零星收款费用","零星收款类别","手续费","专业","分部","单位/学校","备注"};
+                    "关联乐团ID/VIP课ID", "课程形态", "押金", "乐器", "教辅费用", "零星收款费用", "零星收款类别", "手续费", "专业", "分部", "单位/学校", "备注"};
             String[] body = {"id", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "actualAmount", "payTime", "musicGroupId",
-            "groupType","musicalFee","musicalFee","teachingFee","SporadicAmount","SporadicAmount","transferFee","groupType","groupType","groupType","memo"};
+                    "groupType.desc", "leaseFee", "musicalFee", "teachingFee", "sporadicAmount", "sporadicType", "transferFee", "subjectName", "organName", "schoolName", "memo"};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, studentPaymentOrderPageInfo.getRows());
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");

+ 6 - 8
pom.xml

@@ -257,18 +257,13 @@
 		<resources>
 			<resource>
 				<directory>src/main/resources</directory>
-				<filtering>true</filtering>
-				<excludes>
-					<exclude>**/*.ttf</exclude>
-					<exclude>**/*.ttc</exclude>
-				</excludes>
-			</resource>
-			<resource>
-				<directory>src/main/resources</directory>
 				<filtering>false</filtering>
 				<includes>
 					<include>**/*.ttf</include>
 					<include>**/*.ttc</include>
+					<include>**/*.xml</include>
+					<include>**/*.yml</include>
+					<include>**/*.properties</include>
 				</includes>
 			</resource>
 		</resources>
@@ -319,6 +314,9 @@
 						<nonFilteredFileExtension>pfx</nonFilteredFileExtension>
 						<nonFilteredFileExtension>ttc</nonFilteredFileExtension>
 						<nonFilteredFileExtension>ttf</nonFilteredFileExtension>
+						<nonFilteredFileExtension>xml</nonFilteredFileExtension>
+						<nonFilteredFileExtension>yml</nonFilteredFileExtension>
+						<nonFilteredFileExtension>properties</nonFilteredFileExtension>
 					</nonFilteredFileExtensions>
 				</configuration>
 			</plugin>