Browse Source

Merge remote-tracking branch 'origin/master'

周箭河 5 years ago
parent
commit
217e606d0f
41 changed files with 873 additions and 168 deletions
  1. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java
  2. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleStudentPaymentDao.java
  3. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleTeacherSalaryDao.java
  4. 24 16
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupStudentFeeDao.java
  5. 9 8
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleTeacherSalary.java
  6. 39 34
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupPaymentCalender.java
  7. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentAttendance.java
  8. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysMessage.java
  9. 12 16
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/MusicGroupStatusEnum.java
  10. 0 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/StudentAttendanceStatusEnum.java
  11. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentAttendanceQueryInfo.java
  12. 39 1
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupService.java
  13. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/service/VipGroupService.java
  14. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  15. 179 34
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  16. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupActivityServiceImpl.java
  17. 145 10
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  18. 4 0
      mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml
  19. 9 2
      mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml
  20. 9 2
      mec-biz/src/main/resources/config/mybatis/CourseScheduleTeacherSalaryMapper.xml
  21. 5 0
      mec-biz/src/main/resources/config/mybatis/MusicGroupStudentFeeMapper.xml
  22. 15 6
      mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml
  23. 11 4
      mec-biz/src/main/resources/config/mybatis/SysMessageMapper.xml
  24. 4 3
      mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml
  25. 5 0
      mec-education/pom.xml
  26. 1 1
      mec-education/src/main/java/com/ym/mec/education/EducationApplication.java
  27. 33 0
      mec-education/src/main/java/com/ym/mec/education/controller/MessageController.java
  28. 28 15
      mec-education/src/main/java/com/ym/mec/education/entity/SysMessage.java
  29. 48 0
      mec-education/src/main/java/com/ym/mec/education/enums/JobTypeEnum.java
  30. 25 0
      mec-education/src/main/java/com/ym/mec/education/feign/UserFeign.java
  31. 1 1
      mec-education/src/main/java/com/ym/mec/education/mapper/SysMessageMapper.java
  32. 2 0
      mec-education/src/main/java/com/ym/mec/education/resp/CourseHomeworkResp.java
  33. 34 0
      mec-education/src/main/java/com/ym/mec/education/resp/MessageResp.java
  34. 8 1
      mec-education/src/main/java/com/ym/mec/education/service/ISysMessageService.java
  35. 8 0
      mec-education/src/main/java/com/ym/mec/education/service/impl/StudentCourseHomeworkServiceImpl.java
  36. 61 1
      mec-education/src/main/java/com/ym/mec/education/service/impl/SysMessageServiceImpl.java
  37. 24 3
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherCourseScheduleController.java
  38. 2 3
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherVipGroupController.java
  39. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/TeacherDefaultVipGroupSalaryController.java
  40. 15 0
      mec-web/src/main/java/com/ym/mec/web/controller/VipGroupManageController.java
  41. 2 2
      mec-web/src/test/java/com/ym/webApplicationTest.java

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

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
+import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
 import com.ym.mec.common.dal.BaseDAO;
 
 import org.apache.ibatis.annotations.Param;
@@ -23,4 +24,14 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
 	 * @return
 	 */
 	ClassGroupStudentMapper query(@Param("classGroupId") int classGroupId, @Param("userId") Integer userId);
+
+	/**
+	 * 根据乐团编号修改学生状态
+	 * @param musicGroupId 乐团编号
+	 * @param userId 学生编号
+	 * @param status 状态
+	 * @return
+	 */
+	int updateUserStatusByMusicGroupId(@Param("musicGroupId") String musicGroupId, @Param("userId") Integer userId,
+			@Param("status") ClassGroupStudentStatusEnum status);
 }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleStudentPaymentDao.java

@@ -3,7 +3,17 @@ package com.ym.mec.biz.dal.dao;
 import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
 import com.ym.mec.common.dal.BaseDAO;
 
+import java.util.List;
+
 public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseScheduleStudentPayment> {
 
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/10
+     * @params [courseScheduleStudentPayments]
+     * @return int
+     * @describe 批量插入
+     */
+    int batchInsert(List<CourseScheduleStudentPayment> courseScheduleStudentPayments);
 	
 }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleTeacherSalaryDao.java

@@ -3,7 +3,17 @@ package com.ym.mec.biz.dal.dao;
 import com.ym.mec.biz.dal.entity.CourseScheduleTeacherSalary;
 import com.ym.mec.common.dal.BaseDAO;
 
+import java.util.List;
+
 public interface CourseScheduleTeacherSalaryDao extends BaseDAO<Long, CourseScheduleTeacherSalary> {
 
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/10
+     * @params [courseScheduleTeacherSalaries]
+     * @return int
+     * @describe 批量插入
+     */
+    int batchInsert(List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries);
 	
 }

+ 24 - 16
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupStudentFeeDao.java

@@ -1,26 +1,34 @@
 package com.ym.mec.biz.dal.dao;
 
+import java.util.Date;
+
+import org.apache.ibatis.annotations.Param;
+
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
 import com.ym.mec.common.dal.BaseDAO;
-import org.apache.ibatis.annotations.Param;
 
 public interface MusicGroupStudentFeeDao extends BaseDAO<Long, MusicGroupStudentFee> {
 
+	/**
+	 * 根据乐团编号和学员编号获取乐团费用信息
+	 * @param userId
+	 * @return
+	 */
+	MusicGroupStudentFee findByUser(@Param("userId") Integer userId, @Param("musicGroupId") String musicGroupId);
 
-    /**
-     * 根据乐团编号和学员编号获取乐团费用信息
-     * @param userId
-     * @return
-     */
-    MusicGroupStudentFee findByUser(@Param("userId") Integer userId,@Param("musicGroupId") String musicGroupId);
+	/**
+	 * @Author: Joburgess
+	 * @Date: 2019/9/29
+	 * 根据学生编号和乐团编号更新旷课次数
+	 * @param operate 0重置,1加1
+	 */
+	int updateStudentAbsenteeismTimes(@Param("userId") Integer userId, @Param("musicGroupId") String musicGroupId, @Param("operate") Integer operate);
 
-    /**
-     * @Author: Joburgess
-     * @Date: 2019/9/29
-     * 根据学生编号和乐团编号更新旷课次数
-     * @param operate 0重置,1加1
-     */
-    int updateStudentAbsenteeismTimes(@Param("userId") Integer userId,
-                                      @Param("musicGroupId") Integer musicGroupId,
-                                      @Param("operate")Integer operate);
+	/**
+	 * 更新乐团下所有学生的下次缴费时间
+	 * @param musicGroupId 乐团编号
+	 * @param nextPaymentDate 下次缴费时间
+	 * @return
+	 */
+	int updateNextPaymentDate(@Param("musicGroupId") String musicGroupId, @Param("nextPaymentDate") Date nextPaymentDate);
 }

+ 9 - 8
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleTeacherSalary.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.entity;
 
+import com.ym.mec.biz.dal.enums.TeachTypeEnum;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 /**
@@ -14,7 +15,7 @@ public class CourseScheduleTeacherSalary {
 	private Long courseScheduleId;
 	
 	/** 老师角色(主教、助教) */
-	private String teacherRole;
+	private TeachTypeEnum teacherRole;
 	
 	/**  */
 	private Integer userId;
@@ -52,15 +53,15 @@ public class CourseScheduleTeacherSalary {
 	public Long getCourseScheduleId(){
 		return this.courseScheduleId;
 	}
-			
-	public void setTeacherRole(String teacherRole){
-		this.teacherRole = teacherRole;
+
+	public TeachTypeEnum getTeacherRole() {
+		return teacherRole;
 	}
-	
-	public String getTeacherRole(){
-		return this.teacherRole;
+
+	public void setTeacherRole(TeachTypeEnum teacherRole) {
+		this.teacherRole = teacherRole;
 	}
-			
+
 	public void setUserId(Integer userId){
 		this.userId = userId;
 	}

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

@@ -6,80 +6,85 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
 /**
  * 对应数据库表(music_group_payment_calender):
  */
-public class MusicGroupPaymentCalender {
+public class MusicGroupPaymentCalender implements Comparable<MusicGroupPaymentCalender> {
 
 	/**  */
 	private Long id;
-	
+
 	/**  */
-	@ApiModelProperty(value = "乐团编号",required = false)
+	@ApiModelProperty(value = "乐团编号", required = false)
 	private String musicGroupId;
-	
+
 	/** 缴费月份 */
-	@ApiModelProperty(value = "缴费月份",required = false)
+	@ApiModelProperty(value = "缴费月份", required = false)
 	private Integer paymentMonth;
-	
+
 	/** 开始缴费日期 */
-	@ApiModelProperty(value = "开始缴费日期",required = false)
+	@ApiModelProperty(value = "开始缴费日期", required = false)
 	private java.util.Date startPaymentDate;
-	
+
 	/**  */
 	private java.util.Date createTime;
-	
+
 	/**  */
 	private java.util.Date updateTime;
-	
-	public void setId(Long id){
+
+	public void setId(Long id) {
 		this.id = id;
 	}
-	
-	public Long getId(){
+
+	public Long getId() {
 		return this.id;
 	}
-			
-	public void setMusicGroupId(String musicGroupId){
+
+	public void setMusicGroupId(String musicGroupId) {
 		this.musicGroupId = musicGroupId;
 	}
-	
-	public String getMusicGroupId(){
+
+	public String getMusicGroupId() {
 		return this.musicGroupId;
 	}
-			
-	public void setPaymentMonth(Integer paymentMonth){
+
+	public void setPaymentMonth(Integer paymentMonth) {
 		this.paymentMonth = paymentMonth;
 	}
-	
-	public Integer getPaymentMonth(){
+
+	public Integer getPaymentMonth() {
 		return this.paymentMonth;
 	}
-			
-	public void setStartPaymentDate(java.util.Date startPaymentDate){
+
+	public void setStartPaymentDate(java.util.Date startPaymentDate) {
 		this.startPaymentDate = startPaymentDate;
 	}
-	
-	public java.util.Date getStartPaymentDate(){
+
+	public java.util.Date getStartPaymentDate() {
 		return this.startPaymentDate;
 	}
-			
-	public void setCreateTime(java.util.Date createTime){
+
+	public void setCreateTime(java.util.Date createTime) {
 		this.createTime = createTime;
 	}
-	
-	public java.util.Date getCreateTime(){
+
+	public java.util.Date getCreateTime() {
 		return this.createTime;
 	}
-			
-	public void setUpdateTime(java.util.Date updateTime){
+
+	public void setUpdateTime(java.util.Date updateTime) {
 		this.updateTime = updateTime;
 	}
-	
-	public java.util.Date getUpdateTime(){
+
+	public java.util.Date getUpdateTime() {
 		return this.updateTime;
 	}
-			
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);
 	}
 
+	@Override
+	public int compareTo(MusicGroupPaymentCalender cal) {
+		return this.paymentMonth.compareTo(cal.getPaymentMonth());
+	}
+
 }

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

@@ -16,7 +16,7 @@ public class StudentAttendance {
 	
 	/** 乐团 */
 	@ApiModelProperty(value = "乐团",required = false)
-	private Integer musicGroupId;
+	private String musicGroupId;
 	
 	/** 班级 */
 	@ApiModelProperty(value = "班级",required = false)
@@ -64,11 +64,11 @@ public class StudentAttendance {
 		return this.id;
 	}
 			
-	public void setMusicGroupId(Integer musicGroupId){
+	public void setMusicGroupId(String musicGroupId){
 		this.musicGroupId = musicGroupId;
 	}
 	
-	public Integer getMusicGroupId(){
+	public String getMusicGroupId(){
 		return this.musicGroupId;
 	}
 			

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

@@ -61,6 +61,9 @@ public class SysMessage {
 	@ApiModelProperty(value = "是否已读",required = false)
 	private Integer readStatus;
 	
+	@ApiModelProperty(value = "消息组",required = false)
+	private String group;
+	
 	public void setId(Long id){
 		this.id = id;
 	}
@@ -165,6 +168,14 @@ public class SysMessage {
 		this.readStatus = readStatus;
 	}
 
+	public String getGroup() {
+		return group;
+	}
+
+	public void setGroup(String group) {
+		this.group = group;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

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

@@ -2,26 +2,22 @@ package com.ym.mec.biz.dal.enums;
 
 import com.ym.mec.common.enums.BaseEnum;
 
-public enum  MusicGroupStatusEnum implements BaseEnum<String,MusicGroupStatusEnum> {
+public enum MusicGroupStatusEnum implements BaseEnum<String, MusicGroupStatusEnum> {
 
-    APPLY("APPLY","报名中"),
-    PAY("PAY","缴费中"),
-    PREPARE("PREPARE","筹备中"),
-    UNDERWAY("UNDERWAY","进行中"),
-    CANCELED("CANCELED","取消");
+	APPLY("APPLY", "报名中"), PAY("PAY", "缴费中"), PREPARE("PREPARE", "筹备中"), PROGRESS("PROGRESS", "进行中"), CANCELED("CANCELED", "取消"), PAUSE("PAUSE", "暂停");
 
-    private String code;
-    private String msg;
+	private String code;
+	private String msg;
 
-    MusicGroupStatusEnum(String code, String msg) {
-        this.code = code;
-        this.msg = msg;
-    }
+	MusicGroupStatusEnum(String code, String msg) {
+		this.code = code;
+		this.msg = msg;
+	}
 
-    @Override
-    public String getCode() {
-        return this.code;
-    }
+	@Override
+	public String getCode() {
+		return this.code;
+	}
 
 	public String getMsg() {
 		return msg;

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

@@ -9,7 +9,6 @@ public enum StudentAttendanceStatusEnum implements BaseEnum<String,StudentAttend
     NORMAL("NORMAL","正常"),
     TRUANT("TRUANT","旷课"),
     LEAVE("LEAVE","请假"),
-    QUIT_SCHOOL("QUIT_SCHOOL","休学"),
     DROP_OUT("DROP_OUT","退学");
 
     private String code;

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentAttendanceQueryInfo.java

@@ -23,6 +23,17 @@ public class StudentAttendanceQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "状态(正常、旷课、请假、休学)",required = false)
     private StudentAttendanceStatusEnum status;
 
+    @ApiModelProperty(value = "过滤状态")
+    private StudentAttendanceStatusEnum filterStatus;
+
+    public StudentAttendanceStatusEnum getFilterStatus() {
+        return filterStatus;
+    }
+
+    public void setFilterStatus(StudentAttendanceStatusEnum filterStatus) {
+        this.filterStatus = filterStatus;
+    }
+
     public Long getStudentID() {
         return studentID;
     }

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

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service;
 
+import java.util.Date;
 import java.util.List;
 
 import com.ym.mec.biz.dal.dto.BasicUserDto;
@@ -40,5 +41,42 @@ public interface MusicGroupService extends BaseService<String, MusicGroup> {
 	 * 取消乐团
 	 * @param musicGroupId 乐团编号
 	 */
-	void cancelMusicGroup(String musicGroupId);
+	boolean cancelMusicGroup(String musicGroupId);
+
+	/**
+	 * 暂停乐团
+	 * @param musicGroupId 乐团编号
+	 */
+	boolean pauseMusicGroup(String musicGroupId);
+
+	/**
+	 * 恢复乐团
+	 * @param musicGroupId 乐团编号
+	 */
+	boolean resumeMusicGroup(String musicGroupId);
+
+	/**
+	 * 延长缴费
+	 * @param musicGroupId 乐团编号
+	 * @param expireDate 延长缴费的截止日期
+	 * @return
+	 */
+	boolean extensionPayment(String musicGroupId, Date expireDate);
+
+	/**
+	 * 退团
+	 * @param musicGroupId 乐团编号
+	 * @param userId 用户编号
+	 * @return
+	 */
+	boolean quitMusicGroup(String musicGroupId, Integer userId);
+
+	/**
+	 *  续费
+	 * @param musicGroupId 乐团编号
+	 * @param userId 用户编号
+	 * @param amount 缴费金额
+	 * @return
+	 */
+	boolean renew(String musicGroupId, Integer userId, double amount);
 }

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

@@ -10,6 +10,8 @@ import com.ym.mec.biz.dal.page.VipGroupTeachingRecordQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 
+import java.math.BigDecimal;
+
 public interface VipGroupService extends BaseService<Long, VipGroup> {
 
     /**
@@ -77,6 +79,15 @@ public interface VipGroupService extends BaseService<Long, VipGroup> {
 
     /**
      * @Author: Joburgess
+     * @Date: 2019/10/10
+     * @params [vipGroup, onlineClassesUnitPrice, offlineClassesUnitPrice]
+     * @return java.math.BigDecimal
+     * @describe 计算课程购买总价
+     */
+    BigDecimal countVipGroupPredictFee(VipGroup vipGroup,BigDecimal onlineClassesUnitPrice,BigDecimal offlineClassesUnitPrice);
+
+    /**
+     * @Author: Joburgess
      * @Date: 2019/10/3
      * @params [queryInfo]
      * @return com.ym.mec.common.page.PageInfo

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -397,6 +397,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
 	@Override
 	public void courseScheduleCommplaintAudit(CourseScheduleComplaints courseScheduleComplaints) {
+		if(Objects.isNull(courseScheduleComplaints.getId())){
+			throw new BizException("请指定投诉记录!");
+		}
 		CourseScheduleComplaints newCourseScheduleComplaints=new CourseScheduleComplaints();
 		newCourseScheduleComplaints.setId(courseScheduleComplaints.getId());
 		newCourseScheduleComplaints.setStatus(courseScheduleComplaints.getStatus());

+ 179 - 34
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -1,29 +1,48 @@
 package com.ym.mec.biz.service.impl;
 
-import com.ym.mec.biz.dal.dao.*;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
+import com.ym.mec.biz.dal.dao.MusicGroupBuildLogDao;
+import com.ym.mec.biz.dal.dao.MusicGroupDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentEntitiesDao;
+import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
+import com.ym.mec.biz.dal.dao.MusicGroupSubjectGoodsGroupDao;
+import com.ym.mec.biz.dal.dao.MusicGroupSubjectPlanDao;
 import com.ym.mec.biz.dal.dto.BasicUserDto;
 import com.ym.mec.biz.dal.dto.MusicCardDto;
 import com.ym.mec.biz.dal.dto.SubFeeSettingDto;
-import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.entity.MusicGroup;
+import com.ym.mec.biz.dal.entity.MusicGroupBuildLog;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
+import com.ym.mec.biz.dal.entity.MusicGroupPaymentEntities;
+import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
+import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
+import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
+import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
 import com.ym.mec.biz.service.MusicGroupService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.entity.ImGroupMember;
 import com.ym.mec.common.entity.ImGroupModel;
+import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.im.ImFeignService;
 
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.UUID;
-
 @Service
-public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup>  implements MusicGroupService {
-	
+public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> implements MusicGroupService {
+
 	@Autowired
 	private MusicGroupDao musicGroupDao;
 	@Autowired
@@ -39,6 +58,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup>
 	@Autowired
 	private MusicGroupBuildLogDao musicGroupBuildLogDao;
 
+	@Autowired
+	private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
+	
+	@Autowired
+	private ClassGroupStudentMapperDao classGroupStudentMapperDao;
+
 	@Override
 	public BaseDAO<String, MusicGroup> getDAO() {
 		return musicGroupDao;
@@ -46,57 +71,57 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup>
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public void createGroup(SubFeeSettingDto subFeeSettingDto,Integer userId) {
+	public void createGroup(SubFeeSettingDto subFeeSettingDto, Integer userId) {
 		MusicGroup musicGroup = subFeeSettingDto.getMusicGroup();
 		List<MusicGroupPaymentEntities> musicGroupPaymentEntities = subFeeSettingDto.getMusicGroupPaymentEntities();
 		List<MusicGroupSubjectGoodsGroup> musicGroupSubjectGoodsGroups = subFeeSettingDto.getMusicGroupSubjectGoodsGroups();
 		List<MusicGroupSubjectPlan> musicGroupSubjectPlans = subFeeSettingDto.getMusicGroupSubjectPlans();
-		if(musicGroup == null || musicGroupPaymentEntities == null || musicGroupSubjectGoodsGroups == null || musicGroupSubjectPlans == null){
+		if (musicGroup == null || musicGroupPaymentEntities == null || musicGroupSubjectGoodsGroups == null || musicGroupSubjectPlans == null) {
 			String musicGroupId = UUID.randomUUID().toString();
 			musicGroup.setId(musicGroupId);
-			//保存乐团基本信息
+			// 保存乐团基本信息
 			musicGroupDao.insert(musicGroup);
-			//保存乐团付费主体列表
-			musicGroupPaymentEntities.forEach(e ->{
+			// 保存乐团付费主体列表
+			musicGroupPaymentEntities.forEach(e -> {
 				e.setMusicGroupId(musicGroupId);
 				musicGroupPaymentEntitiesDao.insert(e);
 			});
-			//保存学员付费周期
+			// 保存学员付费周期
 			List<Integer> months = subFeeSettingDto.getMonths();
-			if(months != null && months.size() > 0){
+			if (months != null && months.size() > 0) {
 				MusicGroupPaymentCalender mg;
-				for (Integer month:months) {
+				for (Integer month : months) {
 					mg = new MusicGroupPaymentCalender();
 					mg.setMusicGroupId(musicGroupId);
 					mg.setPaymentMonth(month);
 					musicGroupPaymentCalenderDao.insert(mg);
 				}
 			}
-			//保存乐团声部规划
+			// 保存乐团声部规划
 			if (musicGroupSubjectPlans == null) {
 				musicGroupSubjectPlans = new ArrayList<MusicGroupSubjectPlan>();
 			}
-			musicGroupSubjectPlans.forEach(e ->{
+			musicGroupSubjectPlans.forEach(e -> {
 				e.setMusicGroupId(musicGroupId);
 				musicGroupSubjectPlanDao.insert(e);
 			});
-			//保存乐团声部商品规划
+			// 保存乐团声部商品规划
 			if (musicGroupSubjectGoodsGroups == null) {
 				musicGroupSubjectGoodsGroups = new ArrayList<MusicGroupSubjectGoodsGroup>();
 			}
-			musicGroupSubjectGoodsGroups.forEach(e->{
+			musicGroupSubjectGoodsGroups.forEach(e -> {
 				e.setMusicGroupId(musicGroupId);
 				musicGroupSubjectGoodsGroupDao.insert(e);
 			});
-			//新增聊天群
+			// 新增聊天群
 			ImGroupModel imGroupModel = new ImGroupModel(musicGroupId, musicGroup.getName());
-			//教务老师和运营主管加入群组
-			ImGroupMember[] imGroupMembers = {new ImGroupMember(musicGroup.getTeamTeacherId().toString()),
-					new ImGroupMember(musicGroup.getEducationalTeacherId().toString())};
-			//创建群组
-			imFeignService.groupCreate(new ImGroupModel(musicGroupId,imGroupMembers,musicGroup.getName()));
-			//记录创建日志
-			musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId,"提交建团申请",userId,""));
+			// 教务老师和运营主管加入群组
+			ImGroupMember[] imGroupMembers = { new ImGroupMember(musicGroup.getTeamTeacherId().toString()),
+					new ImGroupMember(musicGroup.getEducationalTeacherId().toString()) };
+			// 创建群组
+			imFeignService.groupCreate(new ImGroupModel(musicGroupId, imGroupMembers, musicGroup.getName()));
+			// 记录创建日志
+			musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "提交建团申请", userId, ""));
 		}
 	}
 
@@ -109,7 +134,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup>
 	public MusicCardDto queryPersonalMusicGroups(Integer id) {
 		MusicCardDto musicCardDto = musicGroupDao.queryPersonalMusicGroups(id);
 		musicCardDto.setMusicGroupNum(musicGroupDao.countUserMusicGroups(id));
-		musicCardDto.setVipClassNum(musicGroupDao.countCourseByType(id,ClassGroupTypeEnum.VIP));
+		musicCardDto.setVipClassNum(musicGroupDao.countCourseByType(id, ClassGroupTypeEnum.VIP));
 		return musicGroupDao.queryPersonalMusicGroups(id);
 	}
 
@@ -119,7 +144,127 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup>
 	}
 
 	@Override
-	public void cancelMusicGroup(String musicGroupId) {
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+	public boolean cancelMusicGroup(String musicGroupId) {
+		MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
+		if (musicGroup == null) {
+			throw new BizException("乐团找不到");
+		}
+
+		if (musicGroup.getStatus() == MusicGroupStatusEnum.APPLY || musicGroup.getStatus() == MusicGroupStatusEnum.PAY) {
+			musicGroup.setStatus(MusicGroupStatusEnum.CANCELED);
+			musicGroup.setUpdateTime(new Date());
+			musicGroupDao.update(musicGroup);
+		} else {
+			throw new BizException("乐团当前状态是{},不能取消", musicGroup.getStatus().getMsg());
+		}
+
+		// 退费
+
+		return true;
+	}
+
+	@Override
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+	public boolean pauseMusicGroup(String musicGroupId) {
+		MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
+		if (musicGroup == null) {
+			throw new BizException("乐团找不到");
+		}
+
+		if (musicGroup.getStatus() != MusicGroupStatusEnum.PROGRESS) {
+			throw new BizException("乐团当前状态是{},不能暂停", musicGroup.getStatus().getMsg());
+		}
+
+		musicGroup.setStatus(MusicGroupStatusEnum.PAUSE);
+		musicGroup.setUpdateTime(new Date());
+		musicGroupDao.update(musicGroup);
+
+		// 清除下次缴费时间
+		musicGroupStudentFeeDao.updateNextPaymentDate(musicGroupId, null);
+
+		return true;
+	}
+
+	@Override
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+	public boolean resumeMusicGroup(String musicGroupId) {
+		MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
+		if (musicGroup == null) {
+			throw new BizException("乐团找不到");
+		}
+
+		if (musicGroup.getStatus() != MusicGroupStatusEnum.PAUSE) {
+			throw new BizException("乐团当前状态是{},不能恢复", musicGroup.getStatus().getMsg());
+		}
+
+		musicGroup.setStatus(MusicGroupStatusEnum.PROGRESS);
+		musicGroup.setUpdateTime(new Date());
+		musicGroupDao.update(musicGroup);
+
+		// 查询下次缴费时间
+		List<MusicGroupPaymentCalender> musicGroupPaymentCalenderList = musicGroupPaymentCalenderDao.findByMusicGroupId(musicGroupId);
+		if (musicGroupPaymentCalenderList != null && musicGroupPaymentCalenderList.size() > 0) {
+
+			Collections.sort(musicGroupPaymentCalenderList);
+
+			Calendar cale = Calendar.getInstance();
+			int month = cale.get(Calendar.MONTH) + 1;
+
+			MusicGroupPaymentCalender calender = null;
+
+			for (MusicGroupPaymentCalender cal : musicGroupPaymentCalenderList) {
+				if (cal.getPaymentMonth() >= month) {
+					calender = cal;
+					break;
+				}
+			}
+
+			// 重新设置下次缴费时间
+			musicGroupStudentFeeDao.updateNextPaymentDate(musicGroupId, calender.getStartPaymentDate());
+		}
+
+		return true;
+	}
+
+	@Override
+	public boolean extensionPayment(String musicGroupId, Date expireDate) {
+		MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
+		if (musicGroup == null) {
+			throw new BizException("乐团找不到");
+		}
+
+		if (musicGroup.getStatus() != MusicGroupStatusEnum.PAY) {
+			throw new BizException("乐团当前状态是{},延长缴费", musicGroup.getStatus().getMsg());
+		}
+
+		Date date = new Date();
+
+		if (date.after(expireDate)) {
+			throw new BizException("日期设置错误");
+		}
+
+		musicGroup.setPaymentExpireDate(expireDate);
+		musicGroup.setUpdateTime(date);
+		musicGroupDao.update(musicGroup);
+
+		return true;
+	}
+
+	@Override
+	public boolean quitMusicGroup(String musicGroupId, Integer userId) {
+		MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
+		if (musicGroup == null) {
+			throw new BizException("乐团找不到");
+		}
 		
+		classGroupStudentMapperDao.updateUserStatusByMusicGroupId(musicGroupId, userId, ClassGroupStudentStatusEnum.QUIT);
+		
+		return true;
+	}
+
+	@Override
+	public boolean renew(String musicGroupId, Integer userId, double amount) {
+		return true;
 	}
 }

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

@@ -30,6 +30,7 @@ public class VipGroupActivityServiceImpl extends BaseServiceImpl<Integer, VipGro
 		if(Objects.isNull(vipGroupActivityAddDto.getOrganId())){
 			throw new BizException("请指定部门!");
 		}
+
 		vipGroupActivityAddDto.setSalarySettlementJson(JSON.toJSONString(vipGroupActivityAddDto.getVipGroupSalarySettlement()));
 		super.insert(vipGroupActivityAddDto);
 	}

+ 145 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -60,6 +60,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 	private SysUserCashAccountDao sysUserCashAccountDao;
     @Autowired
 	private SysUserCashAccountDetailDao sysUserCashAccountDetailDao;
+    @Autowired
+	private ClassGroupTeacherSalaryDao classGroupTeacherSalaryDao;
+    @Autowired
+	private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
+    @Autowired
+	private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
 
 	@Override
 	public BaseDAO<Long, VipGroup> getDAO() {
@@ -88,8 +94,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
         //获取活动信息
         VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupApplyBaseInfo().getVipGroupActivityId().intValue());
+		VipGroupSalarySettlementDto vipGroupSalarySettlementDto = JSON.parseObject(vipGroupActivity.getSalarySettlementJson(), VipGroupSalarySettlementDto.class);
 
-        //生成vip课信息
+
+		//生成vip课信息
 		VipGroupApplyBaseInfoDto vipGroupApplyBaseInfoDto=vipGroup.getVipGroupApplyBaseInfo();
 		vipGroupApplyBaseInfoDto.setTotalPrice(countVipGroupPredictFee(vipGroupApplyBaseInfoDto,
 				vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice(),
@@ -116,16 +124,17 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 		//创建班级老师关联记录
 		ClassGroupTeacherMapper classGroupTeacherMapper=new ClassGroupTeacherMapper();
-		classGroupTeacherMapper.setTeacherRole(TeachTypeEnum.TEACHING);
+		classGroupTeacherMapper.setTeacherRole(TeachTypeEnum.BISHOP);
 		classGroupTeacherMapper.setUserId(Integer.parseInt(vipGroupApplyBaseInfoDto.getTeacherId().toString()));
 		classGroupTeacherMapperDao.insert(classGroupTeacherMapper);
 
 		//创建班级与老师课酬记录
 		ClassGroupTeacherSalary classGroupTeacherSalary=new ClassGroupTeacherSalary();
-		classGroupTeacherSalary.setTeacherRole(TeachTypeEnum.TEACHING);
+		classGroupTeacherSalary.setTeacherRole(TeachTypeEnum.BISHOP);
 		classGroupTeacherSalary.setUserId(Integer.parseInt(vipGroupApplyBaseInfoDto.getTeacherId().toString()));
 		classGroupTeacherSalary.setSalary(vipGroupApplyBaseInfoDto.getOfflineTeacherSalary());
-
+		classGroupTeacherSalary.setOnlineClassesSalary(vipGroupApplyBaseInfoDto.getOnlineTeacherSalary());
+		classGroupTeacherSalaryDao.insert(classGroupTeacherSalary);
 
 		//课程信息调整
 		vipGroup.getCourseSchedules().forEach(courseSchedule -> {
@@ -138,11 +147,125 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		courseScheduleService.batchAddCourseSchedule(vipGroup.getCourseSchedules());
 
 		//创建老师与学生费用相关记录
+		TeacherDefaultVipGroupSalary teacherDefaultVipGroupSalary = teacherDefaultVipGroupSalaryDao.findByTeacherAndCategory(vipGroupApplyBaseInfoDto.getUserId().longValue(),
+				vipGroupApplyBaseInfoDto.getVipGroupCategoryId());
+
 		List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries=new ArrayList<>();
+		List<CourseScheduleStudentPayment> courseScheduleStudentPayments=new ArrayList<>();
 		Map<TeachModeEnum, List<CourseSchedule>> courseScheduleGroupByTeachMode = vipGroup.getCourseSchedules().stream().collect(Collectors.groupingBy(CourseSchedule::getTeachMode));
-		vipGroup.getCourseSchedules().forEach(courseSchedule -> {
-			CourseScheduleTeacherSalary courseScheduleTeacherSalary=new CourseScheduleTeacherSalary();
-		});
+		for(TeachModeEnum teachModeEnum:courseScheduleGroupByTeachMode.keySet()){
+			List<CourseSchedule> courseSchedules = courseScheduleGroupByTeachMode.get(teachModeEnum)
+					.stream()
+					.sorted(Comparator.comparing(CourseSchedule::getStartClassTime)).collect(Collectors.toList());
+			for(int i=0;i<courseSchedules.size();i++){
+				//创建教师课程薪水记录
+				CourseScheduleTeacherSalary courseScheduleTeacherSalary=new CourseScheduleTeacherSalary();
+				courseScheduleTeacherSalary.setCourseScheduleId(courseSchedules.get(i).getId());
+				courseScheduleTeacherSalary.setTeacherRole(TeachTypeEnum.BISHOP);
+				courseScheduleTeacherSalary.setUserId(vipGroupApplyBaseInfoDto.getUserId());
+
+				//创建学生课程应缴费记录
+				CourseScheduleStudentPayment courseScheduleStudentPayment=new CourseScheduleStudentPayment();
+				courseScheduleStudentPayment.setCourseScheduleId(courseSchedules.get(i).getId());
+
+				if(teachModeEnum==TeachModeEnum.ONLINE){
+					if(vipGroupActivity.getType()==VipGroupActivityTypeEnum.GIVE_CLASS
+							&&vipGroupApplyBaseInfoDto.getGiveTeachMode()==teachModeEnum
+							&&i>=Integer.parseInt(vipGroupActivity.getAttribute1())
+							&&"0".equals(vipGroupActivity.getGiveClassPaySalaryFlag())){
+						courseScheduleTeacherSalary.setExpectSalary(new BigDecimal(0));
+					}else {
+						//教师课酬线上单课酬计算
+						switch (vipGroupSalarySettlementDto.getOnlineSalarySettlement().getSalarySettlementType()){
+							case TEACHER_DEFAULT:
+								courseScheduleTeacherSalary.setExpectSalary(teacherDefaultVipGroupSalary.getOnlineClassesSalary());
+								break;
+							case RATIO_DISCOUNT:
+								courseScheduleTeacherSalary.setExpectSalary(vipGroupApplyBaseInfoDto
+										.getOnlineTeacherSalary()
+										.multiply(vipGroupSalarySettlementDto.getOnlineSalarySettlement().getSettlementValue()));
+								break;
+							case FIXED_SALARY:
+								courseScheduleTeacherSalary.setExpectSalary(vipGroupSalarySettlementDto.getOnlineSalarySettlement().getSettlementValue());
+								break;
+							default:
+								throw new BizException("未指定课酬结算标准!");
+						}
+					}
+
+					//学生线上单节课应缴费计算
+					switch (vipGroupActivity.getType()){
+						case BASE_ACTIVITY:
+							courseScheduleStudentPayment.setExpectPrice(vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice());
+							break;
+						case DISCOUNT:
+							courseScheduleStudentPayment.setExpectPrice(
+									vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice().multiply(
+											new BigDecimal(vipGroupActivity.getAttribute1())
+									)
+							);
+							break;
+						case GIVE_CLASS:
+							if(vipGroupActivity.getType()==VipGroupActivityTypeEnum.GIVE_CLASS
+									&&vipGroupApplyBaseInfoDto.getGiveTeachMode()==teachModeEnum
+									&&i>=Integer.parseInt(vipGroupActivity.getAttribute1())){
+								courseScheduleStudentPayment.setExpectPrice(new BigDecimal(0));
+							}else {
+								courseScheduleStudentPayment.setExpectPrice(vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice());
+							}
+							break;
+						default:
+							throw new BizException("活动类型错误!");
+					}
+				}else{
+					//教师线下单课酬计算
+					switch (vipGroupSalarySettlementDto.getOfflineSalarySettlement().getSalarySettlementType()){
+						case TEACHER_DEFAULT:
+							courseScheduleTeacherSalary.setExpectSalary(teacherDefaultVipGroupSalary.getOfflineClassesSalary());
+							break;
+						case RATIO_DISCOUNT:
+							courseScheduleTeacherSalary.setExpectSalary(vipGroupApplyBaseInfoDto
+									.getOfflineTeacherSalary()
+									.multiply(vipGroupSalarySettlementDto.getOfflineSalarySettlement().getSettlementValue()));
+							break;
+						case FIXED_SALARY:
+							courseScheduleTeacherSalary.setExpectSalary(vipGroupSalarySettlementDto.getOfflineSalarySettlement().getSettlementValue());
+							break;
+						default:
+							throw new BizException("未指定课酬结算标准!");
+					}
+				}
+
+				//学生线下单节课应缴费计算
+				switch (vipGroupActivity.getType()){
+					case BASE_ACTIVITY:
+						courseScheduleStudentPayment.setExpectPrice(vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice());
+						break;
+					case DISCOUNT:
+						courseScheduleStudentPayment.setExpectPrice(
+								vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice().multiply(
+										new BigDecimal(vipGroupActivity.getAttribute1())
+								)
+						);
+						break;
+					case GIVE_CLASS:
+						if(vipGroupActivity.getType()==VipGroupActivityTypeEnum.GIVE_CLASS
+								&&vipGroupApplyBaseInfoDto.getGiveTeachMode()==teachModeEnum
+								&&i>=Integer.parseInt(vipGroupActivity.getAttribute1())){
+							courseScheduleStudentPayment.setExpectPrice(new BigDecimal(0));
+						}else {
+							courseScheduleStudentPayment.setExpectPrice(vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice());
+						}
+						break;
+					default:
+						throw new BizException("活动类型错误!");
+				}
+				courseScheduleTeacherSalaries.add(courseScheduleTeacherSalary);
+				courseScheduleStudentPayments.add(courseScheduleStudentPayment);
+			}
+		}
+		courseScheduleStudentPaymentDao.batchInsert(courseScheduleStudentPayments);
+		courseScheduleTeacherSalaryDao.batchInsert(courseScheduleTeacherSalaries);
 	}
 
 	@Override
@@ -358,7 +481,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
      * @Date: 2019/10/2
      * 计算VIP课程预计收费
      */
-    private BigDecimal countVipGroupPredictFee(VipGroup vipGroup,BigDecimal onlineClassesUnitPrice,BigDecimal offlineClassesUnitPrice){
+    @Override
+    public BigDecimal countVipGroupPredictFee(VipGroup vipGroup,BigDecimal onlineClassesUnitPrice,BigDecimal offlineClassesUnitPrice){
 		VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupActivityId().intValue());
 		if(Objects.isNull(vipGroup)){
 			throw new BizException("该课未指定活动方案");
@@ -367,7 +491,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		BigDecimal onlineClassNum=new BigDecimal(vipGroup.getOnlineClassesNum());
 		BigDecimal onlineVipGroupCharge = onlineClassesUnitPrice.multiply(onlineClassNum);
 		BigDecimal offlineVipGroupCharge = offlineClassesUnitPrice.multiply(offlineClassNum);
-		BigDecimal totalPrice=null;
+		BigDecimal totalPrice;
 		switch (vipGroupActivity.getType()){
 			case BASE_ACTIVITY:
 				totalPrice=onlineVipGroupCharge.add(offlineVipGroupCharge);
@@ -378,7 +502,18 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				totalPrice=totalPrice.multiply(discount);
 				break;
 			case GIVE_CLASS:
-
+				if(vipGroup.getGiveTeachMode()==TeachModeEnum.OFFLINE){
+					if(offlineClassNum.compareTo(new BigDecimal(vipGroupActivity.getAttribute1()))>-1){
+						offlineClassNum=offlineClassNum.subtract(new BigDecimal(vipGroupActivity.getAttribute2()));
+					}
+					offlineVipGroupCharge = offlineClassesUnitPrice.multiply(offlineClassNum);
+				}else{
+					if(onlineClassNum.compareTo(new BigDecimal(vipGroupActivity.getAttribute1()))>-1){
+						onlineClassNum=onlineClassNum.subtract(new BigDecimal(vipGroupActivity.getAttribute2()));
+					}
+					onlineVipGroupCharge = onlineClassesUnitPrice.multiply(onlineClassNum);
+				}
+				totalPrice=onlineVipGroupCharge.add(offlineVipGroupCharge);
 				break;
 			default:
 				throw new BizException("活动类型错误!");

+ 4 - 0
mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml

@@ -75,4 +75,8 @@
     <select id="query" resultMap="ClassGroupStudentMapper" parameterType="map">
 		SELECT * FROM class_group_student_mapper where class_group_id_ = #{classGroupId} and user_id_ = #{userId}
 	</select>
+	
+	<update id="updateUserStatusByMusicGroupId" parameterType="map">
+		UPDATE class_group_student_mapper set status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} where class_group_id_ in (select id_ from class_group where music_group_id_ = #{musicGroupId}) and user_id_ = #{userId}
+	</update>
 </mapper>

+ 9 - 2
mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml

@@ -36,8 +36,15 @@
 		-->
 		INSERT INTO course_schedule_student_payment (id_,course_schedule_id_,user_id_,expect_price_,actual_price_,create_time_,update_time_,settlement_time_) VALUES(#{id},#{courseScheduleId},#{userId},#{expectPrice},#{actualPrice},#{createTime},#{updateTime},#{settlementTime})
 	</insert>
-	
-	<!-- 根据主键查询一条记录 -->
+    <insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id_">
+		INSERT INTO course_schedule_student_payment (id_,course_schedule_id_,user_id_,expect_price_,actual_price_,create_time_,update_time_,settlement_time_)
+		VALUE
+		<foreach collection="list" item="data" separator=",">
+			(#{data.id},#{data.courseScheduleId},#{data.userId},#{data.expectPrice},#{data.actualPrice},now(),now(),#{data.settlementTime})
+		</foreach>
+    </insert>
+
+    <!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment">
 		UPDATE course_schedule_student_payment <set>
 <if test="userId != null">

+ 9 - 2
mec-biz/src/main/resources/config/mybatis/CourseScheduleTeacherSalaryMapper.xml

@@ -38,8 +38,15 @@
 		-->
 		INSERT INTO course_schedule_teacher_salary (id_,course_schedule_id_,teacher_role_,user_id_,expect_salary_,create_time_,create_update_,subsidy_,actual_salary_,settlement_time_) VALUES(#{id},#{courseScheduleId},#{teacherRole},#{userId},#{expectSalary},#{createTime},#{createUpdate},#{subsidy},#{actualSalary},#{settlementTime})
 	</insert>
-	
-	<!-- 根据主键查询一条记录 -->
+    <insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id_">
+		INSERT INTO course_schedule_teacher_salary (id_,course_schedule_id_,teacher_role_,user_id_,expect_salary_,create_time_,create_update_,subsidy_,actual_salary_,settlement_time_)
+		VALUE
+		<foreach collection="list" item="data" separator=",">
+			(#{data.id},#{data.courseScheduleId},#{data.teacherRole},#{data.userId},#{data.expectSalary},now(),now(),#{data.subsidy},#{data.actualSalary},#{data.settlementTime})
+		</foreach>
+    </insert>
+
+    <!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleTeacherSalary">
 		UPDATE course_schedule_teacher_salary <set>
 <if test="userId != null">

+ 5 - 0
mec-biz/src/main/resources/config/mybatis/MusicGroupStudentFeeMapper.xml

@@ -63,6 +63,7 @@
         </set>
         WHERE id_ = #{id}
     </update>
+    
     <update id="updateStudentAbsenteeismTimes">
         update music_group_student_fee_
         <if test="operate==0">
@@ -93,4 +94,8 @@
     <select id="findByUser" resultMap="MusicGroupStudentFee">
         SELECT * FROM music_group_student_fee_ WHERE music_group_id_ = #{musicGroupId} AND user_id_ = #{userId}
     </select>
+    
+    <update id="updateNextPaymentDate" parameterType="map">
+        update music_group_student_fee_ set next_payment_date_ = #{nextPaymentDate},update_time_ = now() WHERE music_group_id_ = #{musicGroupId}
+    </update>
 </mapper>

+ 15 - 6
mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml

@@ -97,6 +97,15 @@
         <result property="status" column="status_" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
     </resultMap>
 
+    <sql id="queryPageCondition">
+        <where>
+            cgsm.class_group_id_=#{classGroupId}
+            <if test="filterStatus!=null">
+                AND cgsm.status_!=#{filterStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
+        </where>
+    </sql>
+
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="studentAttendanceViewUtilEntity" parameterType="map">
         SELECT
@@ -108,12 +117,12 @@
         s.name_ subject_name_,
         cgsm.status_
         FROM
-        class_group cg
-        LEFT JOIN class_group_student_mapper cgsm ON cg.id_=cgsm.class_group_id_
+        class_group_student_mapper cgsm
+        LEFT JOIN class_group cg ON cg.id_ = cgsm.class_group_id_
         LEFT JOIN sys_user su ON cgsm.user_id_=su.id_
         LEFT JOIN music_group mg ON cg.music_group_id_=mg.id_
-        LEFT JOIN `subject` s ON cg.subject_id_=s.id_
-        WHERE cgsm.class_group_id_=#{classId}
+        LEFT JOIN `subject` s ON cg.subject_id_list_=s.id_
+        <include refid="queryPageCondition"/>
         <include refid="global.limit"/>
     </select>
 
@@ -125,8 +134,8 @@
         LEFT JOIN class_group_student_mapper cgsm ON cg.id_=cgsm.class_group_id_
         LEFT JOIN sys_user su ON cgsm.user_id_=su.id_
         LEFT JOIN music_group mg ON cg.music_group_id_=mg.id_
-        LEFT JOIN `subject` s ON cg.subject_id_=s.id_
-        WHERE cgsm.class_group_id_=#{classId}
+        LEFT JOIN `subject` s ON cg.subject_id_list_=s.id_
+        <include refid="queryPageCondition"/>
 	</select>
 
     <select id="countStudentStatus" resultType="com.ym.mec.biz.dal.dto.StudentStatusCountUtilEntity">

+ 11 - 4
mec-biz/src/main/resources/config/mybatis/SysMessageMapper.xml

@@ -20,6 +20,7 @@
         <result column="user_id_" property="userId"/>
         <result column="memo_" property="memo"/>
         <result column="read_status_" property="readStatus"/>
+        <result column="group_" property="group"/>
     </resultMap>
 
 	<sql id="queryCondition">
@@ -42,6 +43,9 @@
 			<if test="type != null">
 				and type_ = #{type}
 			</if>
+			<if test="group != null">
+				and group_ = #{group}
+			</if>
 		</where>
 	</sql>
 
@@ -63,14 +67,14 @@
 		title_, content_,
 		type_, status_, receiver_,
 		send_time_, error_msg_,read_status_,memo_, create_on_,
-		modify_on_)
+		modify_on_,group_)
 		values (#{id,jdbcType=BIGINT},#{userId,jdbcType=BIGINT}, #{title,jdbcType=VARCHAR},
 		#{content,jdbcType=VARCHAR},
 		#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
 		#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{receiver,jdbcType=VARCHAR},
 		#{sendTime},#{errorMsg,jdbcType=VARCHAR},#{readStatus},#{memo},
 		#{createOn},
-		#{modifyOn})
+		#{modifyOn},#{group})
 	</insert>
 
 	<insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.SysMessage">
@@ -78,7 +82,7 @@
 		title_, content_,
 		type_, status_, receiver_,
 		send_time_, error_msg_,read_status_,memo_, create_on_,
-		modify_on_)
+		modify_on_,group_)
 		values
 		<foreach collection="list" item="item" index="index"
 			separator=",">
@@ -89,7 +93,7 @@
 			#{item.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{item.receiver,jdbcType=VARCHAR},
 			#{item.sendTime},#{item.errorMsg,jdbcType=VARCHAR},#{item.readStatus},#{item.memo},
 			#{item.createOn},
-			#{item.modifyOn}
+			#{item.modifyOn},#{item.group}
 			)
 		</foreach>
 	</insert>
@@ -133,6 +137,9 @@
 			<if test="modifyOn != null">
 				modify_on_ = #{modifyOn},
 			</if>
+			<if test="group != null">
+				group_ = #{group},
+			</if>
 		</set>
 		where id_ = #{id,jdbcType=BIGINT}
 	</update>

+ 4 - 3
mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml

@@ -134,8 +134,8 @@
         </selectKey>
         -->
         INSERT INTO vip_group
-        (id_,user_id_,single_class_minutes_,payment_expire_date_,courses_expire_date_,create_time_,update_time_,teacher_school_id_,online_classes_num_,offline_classes_num_,registration_start_time_,organ_id_list_,vip_group_activity_id_,status_,online_classes_unit_price_,offline_classes_unit_price_,total_price_)
-        VALUES(#{id},#{userId},#{singleClassMinutes},#{paymentExpireDate},#{coursesExpireDate},now(),now(),#{teacherSchoolId},#{onlineClassesNum},#{offlineClassesNum},#{registrationStartTime},#{organIdList},#{vipGroupActivityId},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{onlineClassesUnitPrice},#{offline_classes_unit_price_},#{total_price_})
+        (id_,user_id_,single_class_minutes_,payment_expire_date_,courses_expire_date_,create_time_,update_time_,teacher_school_id_,online_classes_num_,offline_classes_num_,registration_start_time_,organ_id_list_,vip_group_activity_id_,status_,online_classes_unit_price_,offline_classes_unit_price_,total_price_,give_teach_mode_)
+        VALUES(#{id},#{userId},#{singleClassMinutes},#{paymentExpireDate},#{coursesExpireDate},now(),now(),#{teacherSchoolId},#{onlineClassesNum},#{offlineClassesNum},#{registrationStartTime},#{organIdList},#{vipGroupActivityId},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{onlineClassesUnitPrice},#{offline_classes_unit_price_},#{total_price_},#{giveTeachMode})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -452,7 +452,8 @@
         FROM
             vip_group_class_group_mapper vgcgm
             LEFT JOIN course_schedule cs ON vgcgm.class_group_id_=cs.class_group_id_
-        WHERE vgcgm.vip_group_id_=#{vipGroupId} AND cs.give_teach_mode_=1
+            LEFT JOIN course_schedule_teacher_salary csts ON cs.id_=csts.course_schedule_id_
+        WHERE vgcgm.vip_group_id_=#{vipGroupId} AND csts.settlement_time_ IS NOT NULL
     </select>
     <select id="countComplaintsNum" resultType="java.lang.Integer">
         SELECT

+ 5 - 0
mec-education/pom.xml

@@ -103,6 +103,11 @@
 			<artifactId>mec-biz</artifactId>
 		</dependency>
 
+        <dependency>
+            <groupId>com.ym</groupId>
+            <artifactId>snakerflowy</artifactId>
+        </dependency>
+
 	</dependencies>
 	<build>
 		<plugins>

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/EducationApplication.java

@@ -15,7 +15,7 @@ import com.spring4all.swagger.EnableSwagger2Doc;
 @MapperScan({"com.ym.mec.education.mapper", "com.ym.mec.biz.dal.dao"})
 @SpringBootApplication
 @EnableDiscoveryClient
-@ComponentScan(basePackages = "com.ym.mec")
+@ComponentScan(basePackages = {"com.ym.mec", "org.snaker"})
 @Configuration
 @EnableSwagger2Doc
 public class EducationApplication {

+ 33 - 0
mec-education/src/main/java/com/ym/mec/education/controller/MessageController.java

@@ -0,0 +1,33 @@
+package com.ym.mec.education.controller;
+
+import com.ym.mec.education.base.BaseResponse;
+import com.ym.mec.education.service.ISysMessageService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @program: mec
+ * @description: 消息
+ * @author: xw
+ * @create: 2019-10-10 19:12
+ */
+@RestController
+@RequestMapping("/api/message")
+@Slf4j
+public class MessageController {
+
+    @Autowired
+    private ISysMessageService messageService;
+
+    /**
+     * 获取当前登陆人的消息
+     * @return
+     */
+    @GetMapping("/info")
+    public BaseResponse getMessage(){
+        return messageService.getInfo();
+    }
+}

+ 28 - 15
mec-education/src/main/java/com/ym/mec/education/entity/SysMessage.java

@@ -86,7 +86,11 @@ public class SysMessage extends Model<SysMessage> {
      */
     @TableField("read_status_")
     private Integer readStatus;
-
+    /**
+     * 消息组
+     */
+    @TableField("group_")
+    private String group;
 
     public Long getId() {
         return id;
@@ -205,6 +209,14 @@ public class SysMessage extends Model<SysMessage> {
         return this;
     }
 
+    public String getGroup() {
+        return group;
+    }
+
+    public void setGroup(String group) {
+        this.group = group;
+    }
+
     @Override
     protected Serializable pkVal() {
         return this.id;
@@ -213,19 +225,20 @@ public class SysMessage extends Model<SysMessage> {
     @Override
     public String toString() {
         return "SysMessage{" +
-        ", id=" + id +
-        ", title=" + title +
-        ", content=" + content +
-        ", type=" + type +
-        ", status=" + status +
-        ", receiver=" + receiver +
-        ", sendTime=" + sendTime +
-        ", errorMsg=" + errorMsg +
-        ", createOn=" + createOn +
-        ", modifyOn=" + modifyOn +
-        ", userId=" + userId +
-        ", memo=" + memo +
-        ", readStatus=" + readStatus +
-        "}";
+            "id=" + id +
+            ", title='" + title + '\'' +
+            ", content='" + content + '\'' +
+            ", type=" + type +
+            ", status=" + status +
+            ", receiver='" + receiver + '\'' +
+            ", sendTime=" + sendTime +
+            ", errorMsg='" + errorMsg + '\'' +
+            ", createOn=" + createOn +
+            ", modifyOn=" + modifyOn +
+            ", userId=" + userId +
+            ", memo='" + memo + '\'' +
+            ", readStatus=" + readStatus +
+            ", group='" + group + '\'' +
+            '}';
     }
 }

+ 48 - 0
mec-education/src/main/java/com/ym/mec/education/enums/JobTypeEnum.java

@@ -0,0 +1,48 @@
+package com.ym.mec.education.enums;
+
+import com.ym.mec.common.enums.BaseEnum;
+import java.util.Arrays;
+
+//职务类型(指导老师、教务老师、教学主管)
+public enum JobTypeEnum implements BaseEnum<String, JobTypeEnum> {
+    ADVISER("ADVISER", "指导老师"), ACADEMIC("ACADEMIC", "教务老师"), TEACHING("TEACHING", "教学主管"), ASSISTANT("ASSISTANT", "助教");
+
+    private String code;
+
+    private String msg;
+
+    JobTypeEnum(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    @Override
+    public String getCode() {
+        return this.code;
+    }
+
+    /**
+     * 根据枚举值获取枚举信息
+     *
+     * @param code 枚举值
+     * @return 枚举信息
+     */
+    public static String getMsgByCode(String code) {
+        return Arrays.stream(JobTypeEnum.values())
+            .filter(JobTypeEnum -> JobTypeEnum.getCode().equals(code))
+            .findFirst()
+            .map(JobTypeEnum::getMsg).orElse(null);
+    }
+}

+ 25 - 0
mec-education/src/main/java/com/ym/mec/education/feign/UserFeign.java

@@ -0,0 +1,25 @@
+package com.ym.mec.education.feign;
+
+import com.ym.mec.auth.api.entity.SysUser;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.GetMapping;
+
+/**
+ * @program: mec
+ * @description: 用户信息rpc
+ * @author: xw
+ * @create: 2019-10-10 18:53
+ */
+@FeignClient(value = "auth-server", fallback = Exception.class)
+@Component
+public interface UserFeign {
+
+    /**
+     * 获取当前登录人信息
+     *
+     * @return
+     */
+    @GetMapping(value = "user/queryUserInfo")
+    SysUser getCurrentUser();
+}

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/mapper/SysMessageMapper.java

@@ -1,7 +1,7 @@
 package com.ym.mec.education.mapper;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ym.mec.education.entity.SysMessage;
-import com.baomidou.mybatisplus.mapper.BaseMapper;
 
 /**
  * <p>

+ 2 - 0
mec-education/src/main/java/com/ym/mec/education/resp/CourseHomeworkResp.java

@@ -63,6 +63,8 @@ public class CourseHomeworkResp implements Serializable {
      */
     private Integer currentClassTimes;
 
+    private String groupName;
+
 
 
 

+ 34 - 0
mec-education/src/main/java/com/ym/mec/education/resp/MessageResp.java

@@ -0,0 +1,34 @@
+package com.ym.mec.education.resp;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.experimental.Accessors;
+import java.io.Serializable;
+
+/**
+ * @program: mec
+ * @description: 接收消息出参
+ * @author: xw
+ * @create: 2019-10-10 19:17
+ */
+@Data
+@ApiModel(description = "接收消息")
+@Accessors(chain = true)
+public class MessageResp implements Serializable {
+
+    @ApiModelProperty(value = "待审批处理消息数量")
+    private Integer approvalCount;
+    @ApiModelProperty(value = "考勤异常消息数量")
+    private Integer attendanceCount;
+    @ApiModelProperty(value = "其他类型消息数量")
+    private Integer otherStatusCount;
+    @ApiModelProperty(value = "当前登录人姓名")
+    private String userName;
+    @ApiModelProperty(value = "当前登录人id")
+    private Integer userId;
+    @ApiModelProperty(value = "职务")
+    private String jobType;
+    @ApiModelProperty(value = "当前登录人手机号")
+    private String mobileNo;
+}

+ 8 - 1
mec-education/src/main/java/com/ym/mec/education/service/ISysMessageService.java

@@ -1,7 +1,8 @@
 package com.ym.mec.education.service;
 
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ym.mec.education.base.BaseResponse;
 import com.ym.mec.education.entity.SysMessage;
-import com.baomidou.mybatisplus.service.IService;
 
 /**
  * <p>
@@ -13,4 +14,10 @@ import com.baomidou.mybatisplus.service.IService;
  */
 public interface ISysMessageService extends IService<SysMessage> {
 
+    /**
+     * 获取当前登录人的审批提示 签到异常消息 未知状态消息
+     * @return
+     */
+    BaseResponse getInfo();
+
 }

+ 8 - 0
mec-education/src/main/java/com/ym/mec/education/service/impl/StudentCourseHomeworkServiceImpl.java

@@ -178,6 +178,14 @@ public class StudentCourseHomeworkServiceImpl extends ServiceImpl<StudentCourseH
                 BeanUtils.copyProperties(e,resp);
                 CourseSchedule courseSchedule =  courseScheduleService.getById(e.getCourseScheduleId());
                 if(courseSchedule != null){
+
+                    ClassGroup classGroup = classGroupService.getById(courseSchedule.getClassGroupId());
+                    if(classGroup != null){
+                       MusicGroup musicGroup = musicGroupService.getById(classGroup.getMusicGroupId());
+                       if(musicGroup != null){
+                           resp.setGroupName(musicGroup.getName());
+                       }
+                    }
                     resp.setCourseName(courseSchedule.getName());
 
                 }

+ 61 - 1
mec-education/src/main/java/com/ym/mec/education/service/impl/SysMessageServiceImpl.java

@@ -1,10 +1,29 @@
 package com.ym.mec.education.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.enums.MessageSendMode;
+import com.ym.mec.education.base.BaseResponse;
 import com.ym.mec.education.entity.SysMessage;
+import com.ym.mec.education.entity.Teacher;
+import com.ym.mec.education.entity.TeacherAttendance;
+import com.ym.mec.education.enums.JobTypeEnum;
+import com.ym.mec.education.enums.SignStatusEnum;
+import com.ym.mec.education.feign.UserFeign;
 import com.ym.mec.education.mapper.SysMessageMapper;
+import com.ym.mec.education.resp.MessageResp;
 import com.ym.mec.education.service.ISysMessageService;
-import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import com.ym.mec.education.service.ITeacherAttendanceService;
+import com.ym.mec.education.service.ITeacherService;
+import org.snaker.engine.IQueryService;
+import org.snaker.engine.access.QueryFilter;
+import org.snaker.engine.entity.Task;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
 
 /**
  * <p>
@@ -17,4 +36,45 @@ import org.springframework.stereotype.Service;
 @Service("ISysMessageService")
 public class SysMessageServiceImpl extends ServiceImpl<SysMessageMapper, SysMessage> implements ISysMessageService {
 
+    @Autowired
+    private UserFeign userFeign;
+    @Autowired
+    private IQueryService taskQueryService;
+    @Autowired
+    private ITeacherAttendanceService teacherAttendanceService;
+    @Autowired
+    private ITeacherService teacherService;
+
+    @Override
+    public BaseResponse getInfo() {
+        SysUser currentUser = userFeign.getCurrentUser();
+        if (Objects.isNull(currentUser)) {
+            return BaseResponse.noDataExists();
+        }
+        MessageResp messageResp = new MessageResp();
+        messageResp.setUserId(currentUser.getId()).setUserName(currentUser.getRealName()).setMobileNo(currentUser.getPhone());
+        //职务
+        Teacher teacher = teacherService.getById(currentUser.getId());
+        Optional.ofNullable(teacher.getJobType()).ifPresent(jobType ->
+            messageResp.setJobType(JobTypeEnum.getMsgByCode(jobType)));
+        //活动中的任务
+        QueryFilter queryFilter = new QueryFilter();
+        queryFilter.setOperator(currentUser.getId().toString());
+        List<Task> activeTasks = taskQueryService.getActiveTasks(queryFilter);
+        messageResp.setApprovalCount(activeTasks.size());
+        //老师考勤异常
+        QueryWrapper<TeacherAttendance> teacherAttendanceQueryWrapper = new QueryWrapper<>();
+        teacherAttendanceQueryWrapper.lambda().eq(TeacherAttendance::getTeacherId, currentUser.getId())
+            .eq(TeacherAttendance::getSignInStatus, SignStatusEnum.EXCEPTION.getCode());
+        int exceptionCount = teacherAttendanceService.count(teacherAttendanceQueryWrapper);
+        messageResp.setAttendanceCount(exceptionCount);
+        //未知状态消息
+        QueryWrapper<SysMessage> messageQueryWrapper = new QueryWrapper<>();
+        messageQueryWrapper.lambda().eq(SysMessage::getReceiver, currentUser.getId())
+            .eq(SysMessage::getReadStatus, 0).eq(SysMessage::getType, MessageSendMode.PUSH.getCode());
+        int messageCount = count(messageQueryWrapper);
+        messageResp.setOtherStatusCount(messageCount);
+        messageResp.setTotalCount(activeTasks.size() + exceptionCount + messageCount);
+        return BaseResponse.success(messageResp);
+    }
 }

+ 24 - 3
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherCourseScheduleController.java

@@ -1,6 +1,7 @@
 package com.ym.mec.teacher.controller;
 
 import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
+import com.ym.mec.biz.dal.enums.StudentAttendanceStatusEnum;
 import com.ym.mec.biz.dal.page.StudentAttendanceQueryInfo;
 import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.StudentAttendanceService;
@@ -9,17 +10,19 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.Date;
+import java.util.Objects;
 
 /**
  * @Author Joburgess
  * @Date 2019/9/27
  */
-@RequestMapping("teacherCourseSchedule")
 @Api(tags = "课程计划服务")
+@RequestMapping("teacherCourseSchedule")
 @RestController
 public class TeacherCourseScheduleController extends BaseController {
 
@@ -31,31 +34,46 @@ public class TeacherCourseScheduleController extends BaseController {
     @ApiOperation(value = "根据月份获取乐团在该月有课的日期")
     @GetMapping("/getCourseScheduleDateByMonth")
     public Object getCourseScheduleDateByMonth(@ApiParam(value = "月份", required = true) @RequestParam Date month) {
+        if(Objects.isNull(month)){
+            return failed(HttpStatus.FORBIDDEN, "请指定日期!");
+        }
         return succeed(scheduleService.getCourseScheduleDateByTeacher(month));
     }
 
     @ApiOperation(value = "根据日期获取当日排课")
     @GetMapping("/getCourseSchedulesWithDate")
     public Object getCourseSchedulesWithDate(@ApiParam(value = "日期", required = true) Date date){
+        if(Objects.isNull(date)){
+            return failed(HttpStatus.FORBIDDEN, "请指定日期!");
+        }
         return succeed(scheduleService.getTeacherCourseSchedulesWithDate(date));
     }
 
     @ApiOperation(value = "根据课程ID查询正在或即将开始的课程")
     @GetMapping("/getCurrentCourseDetail/{courseID}")
     public Object getCurrentCourseDetail(@ApiParam(value = "课程ID", required = true) @PathVariable("courseID") Long courseID){
+        if(Objects.isNull(courseID)){
+            return failed(HttpStatus.FORBIDDEN, "请指定课程!");
+        }
         return succeed(scheduleService.getCurrentCourseDetail(courseID));
     }
 
     @ApiOperation(value = "根据班级ID获取当前课程的学生")
     @GetMapping("/getCurrentCourseStudents")
-    public Object getCurrentCourseStudents(@RequestBody StudentAttendanceQueryInfo queryInfo){
+    public Object getCurrentCourseStudents(StudentAttendanceQueryInfo queryInfo){
+        if(Objects.isNull(queryInfo.getClassGroupId())){
+            return failed(HttpStatus.FORBIDDEN, "请指定班级!");
+        }
+        queryInfo.setFilterStatus(StudentAttendanceStatusEnum.DROP_OUT);
         return succeed(studentAttendanceService.getCurrentCourseStudents(queryInfo));
     }
 
-
     @ApiOperation(value = "课时调整")
     @PostMapping(value = "/classStartDateAdjust",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
     public Object classStartDateAdjust(ClassDateAdjustDto classDateAdjustDto){
+        if(Objects.isNull(classDateAdjustDto.getId())){
+            return failed(HttpStatus.FORBIDDEN, "请指定课程!");
+        }
         scheduleService.classStartDateAdjust(classDateAdjustDto);
         return succeed();
     }
@@ -63,6 +81,9 @@ public class TeacherCourseScheduleController extends BaseController {
     @ApiOperation(value = "课时交换")
     @GetMapping(value = "/courseSwap",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
     public Object courseSwap(Long courseScheduleId1,Long courseScheduleId2){
+        if(Objects.isNull(courseScheduleId1)||Objects.isNull(courseScheduleId2)){
+            return failed(HttpStatus.FORBIDDEN, "请指定课程!");
+        }
         scheduleService.courseSwap(courseScheduleId1,courseScheduleId2);
         return succeed();
     }

+ 2 - 3
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherVipGroupController.java

@@ -3,12 +3,10 @@ package com.ym.mec.teacher.controller;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.VipGroupApplyDto;
-import com.ym.mec.biz.dal.dto.VipGroupBuyParamsDto;
 import com.ym.mec.biz.dal.dto.VipGroupCostCountParamsDto;
 import com.ym.mec.biz.service.VipGroupService;
 import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -43,7 +41,8 @@ public class TeacherVipGroupController extends BaseController {
     @ApiOperation("获取vip课课程和课酬总费用")
     @PostMapping("/getVipGroupCostCount")
     public Object getVipGroupCostCount(VipGroupCostCountParamsDto vipGroupCostCountParamsDto){
-        return succeed(vipGroupService.vipGroupCostCount(vipGroupCostCountParamsDto));
+//        return succeed(vipGroupService.vipGroupCostCount(vipGroupCostCountParamsDto));
+        return succeed();
     }
 
 }

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TeacherDefaultVipGroupSalaryController.java → mec-web/src/main/java/com/ym/mec/web/controller/TeacherDefaultVipGroupSalaryController.java

@@ -1,4 +1,4 @@
-package com.ym.mec.biz.dal.entity;
+package com.ym.mec.web.controller;
 
 import com.ym.mec.biz.service.TeacherDefaultVipGroupSalaryService;
 import com.ym.mec.common.controller.BaseController;

+ 15 - 0
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupManageController.java

@@ -2,6 +2,7 @@ package com.ym.mec.web.controller;
 
 import com.ym.mec.biz.dal.dto.VipGroupApplyDto;
 import com.ym.mec.biz.dal.entity.StudentApplyRefunds;
+import com.ym.mec.biz.dal.entity.VipGroup;
 import com.ym.mec.biz.dal.page.VipGroupAttendanceQueryInfo;
 import com.ym.mec.biz.dal.page.VipGroupQueryInfo;
 import com.ym.mec.biz.dal.page.VipGroupTeachingRecordQueryInfo;
@@ -12,6 +13,10 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * @Author Joburgess
  * @Date 2019/9/21
@@ -80,4 +85,14 @@ public class VipGroupManageController extends BaseController {
     public Object findTeachingRecordBaseInfo(Long vipGroupId){
         return succeed(vipGroupService.findTeachingRecordBaseInfo(vipGroupId));
     }
+
+    @ApiOperation("课酬总费用")
+    @PostMapping("/getVipGroupCostCount")
+    public Object getVipGroupCostCount(VipGroup vipGroup){
+        BigDecimal bigDecimal = vipGroupService.countVipGroupPredictFee(vipGroup, vipGroup.getOnlineClassesUnitPrice(), vipGroup.getOfflineClassesUnitPrice());
+        Map<String,BigDecimal> results=new HashMap<>(1);
+        results.put("totalPrice",bigDecimal);
+        return succeed(results);
+    }
+
 }

+ 2 - 2
mec-web/src/test/java/com/ym/webApplicationTest.java

@@ -74,7 +74,7 @@ public class webApplicationTest
         StudentAttendance sa=new StudentAttendance();
         sa.setClassGroupId(1);
         sa.setCourseScheduleId(1L);
-        sa.setMusicGroupId(1);
+        sa.setMusicGroupId("1");
         sa.setRemark("test");
         sa.setStatus(StudentAttendanceStatusEnum.LEAVE);
         sa.setTeacherId(1);
@@ -140,7 +140,7 @@ public class webApplicationTest
 
     @Test
     public void test7(){
-        int i = studentFeeDao.updateStudentAbsenteeismTimes(1, 1, 0);
+        int i = studentFeeDao.updateStudentAbsenteeismTimes(1, "1", 0);
         System.out.println(i);
     }