Explorar o código

Merge branch 'master' of git.dayaedu.com:yonge/mec

# Conflicts:
#	mec-education/src/main/java/com/ym/mec/education/service/impl/StudentAttendanceServiceImpl.java
chengpeng %!s(int64=5) %!d(string=hai) anos
pai
achega
b3b95390eb
Modificáronse 65 ficheiros con 1572 adicións e 411 borrados
  1. 1 0
      cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml
  2. 18 14
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/web/controller/SmsCodeController.java
  3. 13 6
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java
  4. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleStudentPaymentDao.java
  5. 34 14
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDao.java
  6. 11 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDetailDao.java
  7. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysConfigDao.java
  8. 0 11
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseScheduleDto.java
  9. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicCardDto.java
  10. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/RegisterPayDto.java
  11. 22 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/VipGroupApplyBaseInfoDto.java
  12. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ClassGroup.java
  13. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ClassGroupTeacherSalary.java
  14. 20 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleComplaints.java
  15. 103 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleStudentPayment.java
  16. 31 9
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleTeacherSalary.java
  17. 11 11
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/VipGroup.java
  18. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/OrderDetailTypeEnum.java
  19. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleService.java
  20. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleStudentPaymentService.java
  21. 31 26
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupService.java
  22. 31 21
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentAttendanceService.java
  23. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentOrderDetailService.java
  24. 21 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentOrderService.java
  25. 16 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java
  26. 40 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  27. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleStudentPaymentServiceImpl.java
  28. 5 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  29. 63 9
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentAttendanceServiceImpl.java
  30. 15 9
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderDetailServiceImpl.java
  31. 27 15
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java
  32. 96 6
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  33. 14 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupActivityServiceImpl.java
  34. 60 10
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  35. 6 0
      mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml
  36. 4 0
      mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml
  37. 10 0
      mec-biz/src/main/resources/config/mybatis/ClassGroupTeacherSalaryMapper.xml
  38. 9 1
      mec-biz/src/main/resources/config/mybatis/CourseScheduleComplaintsMapper.xml
  39. 3 7
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  40. 84 0
      mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml
  41. 12 4
      mec-biz/src/main/resources/config/mybatis/CourseScheduleTeacherSalaryMapper.xml
  42. 2 1
      mec-biz/src/main/resources/config/mybatis/MusicGroupMapper.xml
  43. 9 0
      mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderDetailMapper.xml
  44. 9 0
      mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml
  45. 3 0
      mec-biz/src/main/resources/config/mybatis/SysConfigMapper.xml
  46. 55 55
      mec-biz/src/main/resources/config/mybatis/VipGroupActivityMapper.xml
  47. 7 6
      mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml
  48. 4 0
      mec-common/common-core/src/main/java/com/ym/mec/common/redis/service/RedisCache.java
  49. 17 0
      mec-common/common-core/src/main/java/com/ym/mec/common/service/IdGeneratorService.java
  50. 89 0
      mec-common/common-core/src/main/java/com/ym/mec/common/service/impl/RedisIdGeneratorService.java
  51. 12 3
      mec-education/src/main/java/com/ym/mec/education/controller/TeacherController.java
  52. 38 0
      mec-education/src/main/java/com/ym/mec/education/controller/UserController.java
  53. 1 1
      mec-education/src/main/java/com/ym/mec/education/enums/SignStatusEnum.java
  54. 4 0
      mec-education/src/main/java/com/ym/mec/education/req/TeacherReq.java
  55. 36 0
      mec-education/src/main/java/com/ym/mec/education/resp/TeacherDailyScheduleResp.java
  56. 2 0
      mec-education/src/main/java/com/ym/mec/education/service/ITeacherService.java
  57. 6 10
      mec-education/src/main/java/com/ym/mec/education/service/impl/ClassGroupStudentMapperServiceImpl.java
  58. 4 3
      mec-education/src/main/java/com/ym/mec/education/service/impl/StudentAttendanceServiceImpl.java
  59. 139 70
      mec-education/src/main/java/com/ym/mec/education/service/impl/TeacherServiceImpl.java
  60. 134 30
      mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java
  61. 55 47
      mec-student/src/main/java/com/ym/mec/student/controller/StudentCourseScheduleController.java
  62. 2 3
      mec-student/src/main/java/com/ym/mec/student/controller/StudentVipGroupController.java
  63. 17 0
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherCourseScheduleController.java
  64. 6 0
      mec-web/src/main/java/com/ym/mec/web/controller/VipGroupActivityController.java
  65. 3 3
      mec-workflow/src/main/resources/flows/viprefund.snaker

+ 1 - 0
cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml

@@ -11,6 +11,7 @@
 		<result column="title_" property="title" />
 		<result column="content_" property="content" />
 		<result column="cover_image_" property="coverImage" />
+		<result column="link_url_" property="linkUrl"/>
 		<result column="type_" property="type"/>
 		<result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler" />
 		<result column="create_time_" property="createTime" />

+ 18 - 14
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/web/controller/SmsCodeController.java

@@ -1,28 +1,32 @@
 package com.ym.mec.auth.web.controller;
 
-import com.google.code.kaptcha.Constants;
-import com.google.code.kaptcha.Producer;
-import com.google.code.kaptcha.servlet.KaptchaServlet;
-import com.ym.mec.auth.config.constant.SecurityConstants;
-import com.ym.mec.common.controller.BaseController;
-import com.ym.mec.common.validcode.SmsCodeService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
+
+import java.awt.image.BufferedImage;
+import java.util.concurrent.TimeUnit;
+
+import javax.imageio.ImageIO;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.http.MediaType;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
-import javax.imageio.ImageIO;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletResponse;
-import java.awt.image.BufferedImage;
-import java.util.HashMap;
-import java.util.concurrent.TimeUnit;
+import com.google.code.kaptcha.Constants;
+import com.google.code.kaptcha.Producer;
+import com.google.code.kaptcha.servlet.KaptchaServlet;
+import com.ym.mec.auth.config.constant.SecurityConstants;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.validcode.SmsCodeService;
 
 @RestController
 @RequestMapping("code")

+ 13 - 6
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java

@@ -9,11 +9,18 @@ import java.util.List;
 
 public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStudentMapper> {
 
+	/**
+	 * 批量插入学生
+	 * @param classGroupStudentMapperList
+	 * @return
+	 */
+	int classGroupStudentsInsert(@Param("classGroupStudentMapperList") List<ClassGroupStudentMapper> classGroupStudentMapperList);
 
-    /**
-     * 批量插入学生
-     * @param classGroupStudentMapperList
-     * @return
-     */
-    int classGroupStudentsInsert(@Param("classGroupStudentMapperList") List<ClassGroupStudentMapper> classGroupStudentMapperList);
+	/**
+	 * 根据班级和学生编号查询
+	 * @param classGroupId
+	 * @param userId
+	 * @return
+	 */
+	ClassGroupStudentMapper query(@Param("classGroupId") int classGroupId, @Param("userId") Integer userId);
 }

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

@@ -0,0 +1,9 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
+import com.ym.mec.common.dal.BaseDAO;
+
+public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseScheduleStudentPayment> {
+
+	
+}

+ 34 - 14
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDao.java

@@ -1,8 +1,11 @@
 package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.entity.Goods;
+import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
+import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
+import com.ym.mec.biz.dal.enums.OrderTypeEnum;
 import com.ym.mec.common.dal.BaseDAO;
 import org.apache.ibatis.annotations.Param;
 
@@ -10,19 +13,36 @@ import java.util.List;
 
 public interface StudentPaymentOrderDao extends BaseDAO<Long, StudentPaymentOrder> {
 
-	/**
-	 * 查询商品列表
-	 * @param musicGroupId
-	 * @param type
-	 * @return
-	 */
-	List<Goods> queryApplyGoodsList(@Param("musicGroupId") Integer musicGroupId, @Param("type") OrderDetailTypeEnum type);
+    /**
+     * 查询商品列表
+     *
+     * @param musicGroupId
+     * @param type
+     * @return
+     */
+    List<Goods> queryApplyGoodsList(@Param("musicGroupId") Integer musicGroupId, @Param("type") OrderDetailTypeEnum type);
 
-	/**
-	 * @Author: Joburgess
-	 * @Date: 2019/10/3
-	 * 根据学生vip课获取缴费订单
-	 */
-	StudentPaymentOrder findByStudentVipGroup(@Param("vipGroupId") Long vipGroupId,
-											  @Param("userId") Long userId);
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/3
+     * 根据学生vip课获取缴费订单
+     */
+    StudentPaymentOrder findByStudentVipGroup(@Param("vipGroupId") Long vipGroupId, @Param("userId") Long userId);
+
+    /**
+     * 查询乐团报名的订单
+     *
+     * @param userId
+     * @param musicGroupId
+     * @param status
+     * @return
+     */
+    StudentPaymentOrder findMusicGroupApplyOrderByStatus(@Param("userId") Integer userId, @Param("musicGroupId") String musicGroupId, @Param("status") DealStatusEnum status);
+
+    /**
+     * 根据订单号查询订单
+     * @param orderNo
+     * @return
+     */
+    StudentPaymentOrder findOrderByOrderNo(@Param("orderNo") String orderNo);
 }

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

@@ -2,8 +2,18 @@ package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
 import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface StudentPaymentOrderDetailDao extends BaseDAO<Long, StudentPaymentOrderDetail> {
 
-	
+
+    /**
+     * 批量添加订单详情
+     *
+     * @param studentPaymentOrderDetailList
+     * @return
+     */
+    int batchAdd(@Param("studentPaymentOrderDetailList") List<StudentPaymentOrderDetail> studentPaymentOrderDetailList);
 }

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysConfigDao.java

@@ -5,5 +5,13 @@ import com.ym.mec.common.dal.BaseDAO;
 
 public interface SysConfigDao extends BaseDAO<Long, SysConfig> {
 
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/9
+     * @params [paramName]
+     * @return com.ym.mec.biz.dal.entity.SysConfig
+     * @describe 根据配置名称获取配置信息
+     */
+    SysConfig findByParamName(String paramName);
 	
 }

+ 0 - 11
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseScheduleDto.java

@@ -23,17 +23,6 @@ public class CourseScheduleDto extends CourseSchedule {
     @ApiModelProperty(value = "班级编号,房间号",required = false)
     private String sealClassId;
 
-    @ApiModelProperty(value = "课程结束后课申诉时间限制")
-    private Integer vipAppealDaysRange;
-
-    public Integer getVipAppealDaysRange() {
-        return vipAppealDaysRange;
-    }
-
-    public void setVipAppealDaysRange(Integer vipAppealDaysRange) {
-        this.vipAppealDaysRange = vipAppealDaysRange;
-    }
-
     public String getSealClassId() {
         return sealClassId;
     }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicCardDto.java

@@ -13,6 +13,9 @@ public class MusicCardDto {
     @ApiModelProperty(value = "乐团编号",required = true)
     private String musicGroupId;
 
+    @ApiModelProperty(value = "科目编号",required = true)
+    private String subjectId;
+
     @ApiModelProperty(value = "乐团名称",required = true)
     private String musicGroupName;
 
@@ -113,4 +116,12 @@ public class MusicCardDto {
     public void setRegisterId(String registerId) {
         this.registerId = registerId;
     }
+
+    public String getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(String subjectId) {
+        this.subjectId = subjectId;
+    }
 }

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/RegisterPayDto.java

@@ -10,6 +10,7 @@ public class RegisterPayDto {
     private Integer registerId;
     private String goodsGroupIds;
     private String goodsIds;
+    private String otherGoodsIds;
 
     public Integer getRegisterId() {
         return registerId;
@@ -42,4 +43,12 @@ public class RegisterPayDto {
     public void setAmount(BigDecimal amount) {
         this.amount = amount;
     }
+
+    public String getOtherGoodsIds() {
+        return otherGoodsIds;
+    }
+
+    public void setOtherGoodsIds(String otherGoodsIds) {
+        this.otherGoodsIds = otherGoodsIds;
+    }
 }

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/VipGroupApplyBaseInfoDto.java

@@ -23,6 +23,28 @@ public class VipGroupApplyBaseInfoDto extends VipGroup {
     @ApiModelProperty(value = "预计招生人数",hidden = true)
     private Integer expectStudentNum;
 
+    @ApiModelProperty(value = "教师线上课课酬")
+    private BigDecimal onlineTeacherSalary;
+
+    @ApiModelProperty(value = "教师线下课课酬")
+    private BigDecimal offlineTeacherSalary;
+
+    public BigDecimal getOnlineTeacherSalary() {
+        return onlineTeacherSalary;
+    }
+
+    public void setOnlineTeacherSalary(BigDecimal onlineTeacherSalary) {
+        this.onlineTeacherSalary = onlineTeacherSalary;
+    }
+
+    public BigDecimal getOfflineTeacherSalary() {
+        return offlineTeacherSalary;
+    }
+
+    public void setOfflineTeacherSalary(BigDecimal offlineTeacherSalary) {
+        this.offlineTeacherSalary = offlineTeacherSalary;
+    }
+
     public Integer getAllCourseNum() {
         return allCourseNum;
     }

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

@@ -69,6 +69,9 @@ public class ClassGroup {
 
 	@ApiModelProperty(value = "当前课次",required = false)
 	private Integer currentClassTimes;
+	
+	@ApiModelProperty(value = "班级图标",required = false)
+	private String img;
 
 	public String getTeachMode() {
 		return teachMode;
@@ -198,6 +201,14 @@ public class ClassGroup {
 		this.expectStudentNum = expectStudentNum;
 	}
 
+	public String getImg() {
+		return img;
+	}
+
+	public void setImg(String img) {
+		this.img = img;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ClassGroupTeacherSalary.java

@@ -1,10 +1,14 @@
 package com.ym.mec.biz.dal.entity;
 
+import java.math.BigDecimal;
+
 public class ClassGroupTeacherSalary extends ClassGroupTeacherMapper {
     /**
      * 课时长
      */
     private Integer duration;
+    
+    private BigDecimal onlineClassesSalary;
 
     public Integer getDuration() {
         return duration;
@@ -13,4 +17,12 @@ public class ClassGroupTeacherSalary extends ClassGroupTeacherMapper {
     public void setDuration(Integer duration) {
         this.duration = duration;
     }
+
+	public BigDecimal getOnlineClassesSalary() {
+		return onlineClassesSalary;
+	}
+
+	public void setOnlineClassesSalary(BigDecimal onlineClassesSalary) {
+		this.onlineClassesSalary = onlineClassesSalary;
+	}
 }

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleComplaints.java

@@ -36,6 +36,10 @@ public class CourseScheduleComplaints {
 	/**  */
 	private java.util.Date updateTime;
 	
+	private Double teacherLiabilityRatio;
+	
+	private Double studentLiabilityRatio;
+	
 	public void setId(Long id){
 		this.id = id;
 	}
@@ -108,6 +112,22 @@ public class CourseScheduleComplaints {
 		return this.updateTime;
 	}
 			
+	public Double getStudentLiabilityRatio() {
+		return studentLiabilityRatio;
+	}
+
+	public void setStudentLiabilityRatio(Double studentLiabilityRatio) {
+		this.studentLiabilityRatio = studentLiabilityRatio;
+	}
+
+	public Double getTeacherLiabilityRatio() {
+		return teacherLiabilityRatio;
+	}
+
+	public void setTeacherLiabilityRatio(Double teacherLiabilityRatio) {
+		this.teacherLiabilityRatio = teacherLiabilityRatio;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 103 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleStudentPayment.java

@@ -0,0 +1,103 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(course_schedule_student_payment):
+ */
+public class CourseScheduleStudentPayment {
+
+	/**  */
+	private Long id;
+	
+	/**  */
+	private Long courseScheduleId;
+	
+	/**  */
+	private Integer userId;
+	
+	/** 预计价格 */
+	private java.math.BigDecimal expectPrice;
+	
+	/**  */
+	private java.math.BigDecimal actualPrice;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	/** 结算时间 */
+	private java.util.Date settlementTime;
+	
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setCourseScheduleId(Long courseScheduleId){
+		this.courseScheduleId = courseScheduleId;
+	}
+	
+	public Long getCourseScheduleId(){
+		return this.courseScheduleId;
+	}
+			
+	public void setUserId(Integer userId){
+		this.userId = userId;
+	}
+	
+	public Integer getUserId(){
+		return this.userId;
+	}
+			
+	public void setExpectPrice(java.math.BigDecimal expectPrice){
+		this.expectPrice = expectPrice;
+	}
+	
+	public java.math.BigDecimal getExpectPrice(){
+		return this.expectPrice;
+	}
+			
+	public void setActualPrice(java.math.BigDecimal actualPrice){
+		this.actualPrice = actualPrice;
+	}
+	
+	public java.math.BigDecimal getActualPrice(){
+		return this.actualPrice;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	public void setSettlementTime(java.util.Date settlementTime){
+		this.settlementTime = settlementTime;
+	}
+	
+	public java.util.Date getSettlementTime(){
+		return this.settlementTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

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

@@ -19,8 +19,8 @@ public class CourseScheduleTeacherSalary {
 	/**  */
 	private Integer userId;
 	
-	/** 薪水 */
-	private long salary;
+	/** 预计薪水 */
+	private java.math.BigDecimal expectSalary;
 	
 	/**  */
 	private java.util.Date createTime;
@@ -29,7 +29,13 @@ public class CourseScheduleTeacherSalary {
 	private java.util.Date createUpdate;
 	
 	/** 补贴 */
-	private long subsidy;
+	private java.math.BigDecimal subsidy;
+	
+	/** 实际薪水 */
+	private java.math.BigDecimal actualSalary;
+	
+	/** 结算时间 */
+	private java.util.Date settlementTime;
 	
 	public void setId(Long id){
 		this.id = id;
@@ -63,12 +69,12 @@ public class CourseScheduleTeacherSalary {
 		return this.userId;
 	}
 			
-	public void setSalary(long salary){
-		this.salary = salary;
+	public void setExpectSalary(java.math.BigDecimal expectSalary){
+		this.expectSalary = expectSalary;
 	}
 	
-	public long getSalary(){
-		return this.salary;
+	public java.math.BigDecimal getExpectSalary(){
+		return this.expectSalary;
 	}
 			
 	public void setCreateTime(java.util.Date createTime){
@@ -87,14 +93,30 @@ public class CourseScheduleTeacherSalary {
 		return this.createUpdate;
 	}
 			
-	public void setSubsidy(long subsidy){
+	public void setSubsidy(java.math.BigDecimal subsidy){
 		this.subsidy = subsidy;
 	}
 	
-	public long getSubsidy(){
+	public java.math.BigDecimal getSubsidy(){
 		return this.subsidy;
 	}
 			
+	public void setActualSalary(java.math.BigDecimal actualSalary){
+		this.actualSalary = actualSalary;
+	}
+	
+	public java.math.BigDecimal getActualSalary(){
+		return this.actualSalary;
+	}
+			
+	public void setSettlementTime(java.util.Date settlementTime){
+		this.settlementTime = settlementTime;
+	}
+	
+	public java.util.Date getSettlementTime(){
+		return this.settlementTime;
+	}
+			
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

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

@@ -1,8 +1,8 @@
 package com.ym.mec.biz.dal.entity;
 
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
+import com.ym.mec.biz.dal.enums.TeachModeEnum;
 import com.ym.mec.biz.dal.enums.VipGroupStatusEnum;
-import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
@@ -93,16 +93,8 @@ public class VipGroup {
 	@ApiModelProperty(value = "当前课时")
 	private Integer currentClassTimes;
 
-	@ApiModelProperty(value = "是否已结算")
-	private YesOrNoEnum isSalary;
-
-	public YesOrNoEnum getIsSalary() {
-		return isSalary;
-	}
-
-	public void setIsSalary(YesOrNoEnum isSalary) {
-		this.isSalary = isSalary;
-	}
+	@ApiModelProperty(value = "赠送课时类型")
+	private TeachModeEnum giveTeachMode;
 
 	public String getUserName() {
 		return userName;
@@ -296,6 +288,14 @@ public class VipGroup {
 		this.organIdList = organIdList;
 	}
 
+	public TeachModeEnum getGiveTeachMode() {
+		return giveTeachMode;
+	}
+
+	public void setGiveTeachMode(TeachModeEnum giveTeachMode) {
+		this.giveTeachMode = giveTeachMode;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/OrderDetailTypeEnum.java

@@ -7,7 +7,8 @@ import com.ym.mec.common.enums.BaseEnum;
  */
 public enum OrderDetailTypeEnum implements BaseEnum<String, OrderDetailTypeEnum> {
 	MUSICAL("MUSICAL", "乐器"),
-	TEACHING("TEACHING", "教辅"),
+	ACCESSORIES("ACCESSORIES", "辅件"),
+	TEACHING("TEACHING", "教谱"),
 	OTHER("OTHER", "其他"),
 	COURSE("COURSE", "课程");
 

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleService.java

@@ -10,6 +10,7 @@ import com.ym.mec.common.service.BaseService;
 
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 public interface CourseScheduleService extends BaseService<Long, CourseSchedule> {
 
@@ -46,7 +47,7 @@ public interface CourseScheduleService extends BaseService<Long, CourseSchedule>
      * @Date: 2019/9/17
      * 根据日期获取当日排课信息
      */
-    List<CourseScheduleDto> getStudentCourseSchedulesWithDate(Date classDate);
+    Map getStudentCourseSchedulesWithDate(Date classDate);
 
     /**
      * @Author: Joburgess

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

@@ -0,0 +1,8 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
+import com.ym.mec.common.service.BaseService;
+
+public interface CourseScheduleStudentPaymentService extends BaseService<Long, CourseScheduleStudentPayment> {
+
+}

+ 31 - 26
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupService.java

@@ -1,39 +1,44 @@
 package com.ym.mec.biz.service;
 
-import com.ym.mec.auth.api.entity.SysUser;
+import java.util.List;
+
 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.MusicGroup;
 import com.ym.mec.common.service.BaseService;
 
-import java.util.List;
-
 public interface MusicGroupService extends BaseService<String, MusicGroup> {
-    /**
-     * 建团申请数据提交
-     * @param subFeeSettingDto
-     * @Author superzou
-     */
-    void createGroup(SubFeeSettingDto subFeeSettingDto,Integer userId);
+	/**
+	 * 建团申请数据提交
+	 * @param subFeeSettingDto
+	 * @Author superzou
+	 */
+	void createGroup(SubFeeSettingDto subFeeSettingDto, Integer userId);
+
+	/**
+	 * 获取学生所在乐团详情
+	 * @return
+	 */
+	List<MusicCardDto> queryUserMusicGroups(Integer userId);
 
-    /**
-     * 获取学生所在乐团详情
-     * @return
-     */
-    List<MusicCardDto> queryUserMusicGroups(Integer userId);
+	/**
+	 * 获取个人中心乐团数据
+	 * @param id
+	 * @return
+	 */
+	MusicCardDto queryPersonalMusicGroups(Integer id);
 
-    /**
-     * 获取个人中心乐团数据
-     * @param id
-     * @return
-     */
-    MusicCardDto queryPersonalMusicGroups(Integer id);
+	/**
+	 * 根据学员编号获取相关老师列表
+	 * @param studentId
+	 * @return
+	 */
+	List<BasicUserDto> findTeachersByStuId(Integer studentId);
 
-    /**
-     * 根据学员编号获取相关老师列表
-     * @param studentId
-     * @return
-     */
-    List<BasicUserDto> findTeachersByStuId(Integer studentId);
+	/**
+	 * 取消乐团
+	 * @param musicGroupId 乐团编号
+	 */
+	void cancelMusicGroup(String musicGroupId);
 }

+ 31 - 21
mec-biz/src/main/java/com/ym/mec/biz/service/StudentAttendanceService.java

@@ -1,33 +1,43 @@
 package com.ym.mec.biz.service;
 
+import java.util.List;
+import java.util.Map;
+
+import com.ym.mec.biz.dal.dto.StudentPersonalAttendanceDto;
 import com.ym.mec.biz.dal.entity.StudentAttendance;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.BaseService;
 
-import java.util.List;
-import java.util.Map;
-
 public interface StudentAttendanceService extends BaseService<Long, StudentAttendance> {
 
-    /**
-     * @Author: Joburgess
-     * @Date: 2019/9/11
-     * 批量插入学生上课签到信息
-     */
-    void addStudentAttendances(List<StudentAttendance> studentAttendances);
+	/**
+	 * @Author: Joburgess
+	 * @Date: 2019/9/11
+	 * 批量插入学生上课签到信息
+	 */
+	void addStudentAttendances(List<StudentAttendance> studentAttendances);
+
+	/**
+	 * @Author: Joburgess
+	 * @Date: 2019/9/16
+	 * 获取当前课程的学生
+	 */
+	Map<String, Object> getCurrentCourseStudents(QueryInfo queryInfo);
 
-    /**
-     * @Author: Joburgess
-     * @Date: 2019/9/16
-     * 获取当前课程的学生
-     */
-    Map<String, Object> getCurrentCourseStudents(QueryInfo queryInfo);
+	/**
+	 * @Author: Joburgess
+	 * @Date: 2019/9/16
+	 * 获取学生个人签到信息
+	 */
+	PageInfo<StudentPersonalAttendanceDto> getStudentPersonalAttendances(QueryInfo queryInfo);
 
-    /**
-     * @Author: Joburgess
-     * @Date: 2019/9/16
-     * 获取学生个人签到信息
-     */
-    PageInfo getStudentPersonalAttendances(QueryInfo queryInfo);
+	/**
+	 * 请假
+	 * @param userId 用户编号
+	 * @param courseScheduleId 课程编号
+	 * @param remark 请假理由
+	 * @return
+	 */
+	boolean leave(Integer userId, Long courseScheduleId, String remark);
 }

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentOrderDetailService.java

@@ -2,7 +2,19 @@ package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
 import com.ym.mec.common.service.BaseService;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface StudentPaymentOrderDetailService extends BaseService<Long, StudentPaymentOrderDetail> {
 
+
+    /**
+     * 批量添加订单
+     *
+     * @param studentPaymentOrderDetailList
+     * @return
+     */
+    int batchAdd(List<StudentPaymentOrderDetail> studentPaymentOrderDetailList);
+
 }

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

@@ -4,8 +4,11 @@ import java.util.List;
 
 import com.ym.mec.biz.dal.entity.Goods;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
+import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
+import com.ym.mec.biz.dal.enums.OrderTypeEnum;
 import com.ym.mec.common.service.BaseService;
+import org.apache.ibatis.annotations.Param;
 
 public interface StudentPaymentOrderService extends BaseService<Long, StudentPaymentOrder> {
 
@@ -16,4 +19,22 @@ public interface StudentPaymentOrderService extends BaseService<Long, StudentPay
 	 * @return
 	 */
 	List<Goods> queryApplyGoodsList(Integer musicGroupId, OrderDetailTypeEnum type);
+
+	/**
+	 * 查询报名缴费订单
+	 * @param musicGroupId
+	 * @param status
+	 * @return
+	 */
+	StudentPaymentOrder findMusicGroupApplyOrderByStatus(Integer userId,String musicGroupId, DealStatusEnum status);
+
+
+	/**
+	 * 根据orderNo查询订单
+	 * @param orderNo
+	 * @return
+	 */
+	StudentPaymentOrder findOrderByOrderNo(String orderNo);
+
+
 }

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

@@ -1,10 +1,14 @@
 package com.ym.mec.biz.service;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 import com.ym.mec.biz.dal.dto.StudentApplyDetailDto;
 import com.ym.mec.biz.dal.dto.StudentFeeDto;
 import com.ym.mec.biz.dal.dto.StudentInfo;
+import com.ym.mec.biz.dal.entity.Goods;
+import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
+import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
 import com.ym.mec.common.page.PageInfo;
@@ -79,4 +83,16 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
      */
     StudentInfo queryStudentInfo(Integer userId);
 
+
+    /**
+     * 学生注册缴费订单
+     * @param userId
+     * @param amount
+     * @param courseFee
+     * @param goodsGroups
+     * @param goodsList
+     * @return
+     */
+    StudentPaymentOrder addOrder(Integer userId,BigDecimal amount,String orderNo,String paymentChannel,BigDecimal courseFee, List<MusicGroupSubjectGoodsGroup> goodsGroups, List<Goods> goodsList, List<Goods> otherGoodsList,String musicGroupId);
+
 }

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

@@ -4,11 +4,13 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.CourseScheduleComplaintsDao;
 import com.ym.mec.biz.dal.dao.CourseScheduleDao;
+import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
 import com.ym.mec.biz.dal.dto.CourseScheduleDto;
 import com.ym.mec.biz.dal.dto.TeacherAttendanceDto;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
+import com.ym.mec.biz.dal.entity.SysConfig;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
 import com.ym.mec.biz.dal.enums.ParamEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
@@ -40,6 +42,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 	private SysUserFeignService sysUserFeignService;
 	@Autowired
 	private CourseScheduleComplaintsDao courseScheduleComplaintsDao;
+	@Autowired
+	private SysConfigDao sysConfigDao;
 
 	@Override
 	public BaseDAO<Long, CourseSchedule> getDAO() {
@@ -48,6 +52,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
 	@Override
 	public TeacherAttendanceDto getCurrentCourseDetail(Long courseID) {
+		if(Objects.isNull(courseID)){
+			throw new BizException("参数错误!");
+		}
 		TeacherAttendanceDto currentCourseDetail = courseScheduleDao.getCurrentCourseDetail(courseID);
 		currentCourseDetail.setCurrentTime(new Date());
 		currentCourseDetail.setTeacherAttendanceTimeGap(ParamEnum.TEACHER_ATTENDANCE_TIME_GAP);
@@ -56,6 +63,9 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
 	@Override
 	public void batchAddCourseSchedule(List<CourseSchedule> courseSchedules) {
+		if(Objects.isNull(courseSchedules)&&courseSchedules.size()<=0){
+			throw new BizException("参数错误!");
+		}
 		checkCourseSchedule(courseSchedules);
         createCourseScheduleName(courseSchedules);
 		courseScheduleDao.batchAddCourseSchedules(courseSchedules);
@@ -63,6 +73,12 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
 	@Override
 	public void batchUpdateCourseSchedule(List<CourseSchedule> courseSchedules, Long musicGroupID) {
+		if(Objects.isNull(courseSchedules)&&courseSchedules.size()<=0){
+			throw new BizException("请选择需要调整的课程!");
+		}
+		if(Objects.isNull(musicGroupID)){
+			throw new BizException("请指定乐团!");
+		}
 		checkCourseSchedule(courseSchedules);
         courseScheduleDao.deleteCourseSchedulesByMusicGroupID(musicGroupID);
         courseScheduleDao.batchAddCourseSchedules(courseSchedules);
@@ -70,30 +86,50 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
 	@Override
 	public List<CourseScheduleDto> getCourseSchedulesWithDate(Date classDate) {
+		if(Objects.isNull(classDate)){
+			throw new BizException("请选择日期!");
+		}
 		return courseScheduleDao.getCourseSchedulesWithDate(classDate);
 	}
 
 	@Override
 	public List<Date> getCourseScheduleDateByMonth(Long musicGroupID, Date month) {
+		if(Objects.isNull(month)||Objects.isNull(musicGroupID)){
+			throw new BizException("请选择日期并指定乐团!");
+		}
 		return courseScheduleDao.getCourseScheduleDateByMonth(musicGroupID,month);
 	}
 
 	@Override
 	public List<Date> getCourseScheduleDateByStudent(Date month, Integer isAttend) {
 		SysUser user = sysUserFeignService.queryUserInfo();
+		if(null==user){
+			throw new BizException("请登录");
+		}
 		return courseScheduleDao.getStudentCourseScheduleDate(user.getId().longValue(),month,isAttend);
 	}
 
 	@Override
 	public List<Date> getCourseScheduleDateByTeacher(Date month) {
 		SysUser user = sysUserFeignService.queryUserInfo();
+		if(null==user){
+			throw new BizException("请登录");
+		}
 		return courseScheduleDao.getTeacherCourseScheduleDate(user.getId().longValue(),month);
 	}
 
 	@Override
-	public List<CourseScheduleDto> getStudentCourseSchedulesWithDate(Date classDate) {
+	public Map getStudentCourseSchedulesWithDate(Date classDate) {
+		if(Objects.isNull(classDate)){
+			throw new BizException("请选择上课日期!");
+		}
+
 		SysUser user = sysUserFeignService.queryUserInfo();
-		return courseScheduleDao.getStudentCourseSchedulesWithDate(classDate,user.getId().longValue());
+		SysConfig vip_appeal_days_range = sysConfigDao.findByParamName("vip_appeal_days_range");
+		Map<String,Object> result=new HashMap<>();
+		result.put("vipAppealDaysRange",vip_appeal_days_range.getParanValue());
+		result.put("list",courseScheduleDao.getStudentCourseSchedulesWithDate(classDate,user.getId().longValue()));
+		return result;
 	}
 
 	@Override
@@ -350,7 +386,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		CourseScheduleDto courseSchedules = courseScheduleDao.getCourseSchedules(courseScheduleComplaints.getCourseScheduleId());
 		Date now=new Date();
 		int i = DateUtil.daysBetween(courseSchedules.getEndClassTime(), now);
-		if(i>courseSchedules.getVipAppealDaysRange()){
+		SysConfig vip_appeal_days_range = sysConfigDao.findByParamName("vip_appeal_days_range");
+		if(i>Integer.parseInt(vip_appeal_days_range.getParanValue())){
 			throw new BizException("该课程已超过可申诉时间范围!");
 		}
 		courseScheduleComplaints.setUserId(user.getId());

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleStudentPaymentServiceImpl.java

@@ -0,0 +1,23 @@
+package com.ym.mec.biz.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.biz.dal.dao.CourseScheduleStudentPaymentDao;
+import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
+import com.ym.mec.biz.service.CourseScheduleStudentPaymentService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+
+@Service
+public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Long, CourseScheduleStudentPayment>  implements CourseScheduleStudentPaymentService {
+	
+	@Autowired
+	private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
+
+	@Override
+	public BaseDAO<Long, CourseScheduleStudentPayment> getDAO() {
+		return courseScheduleStudentPaymentDao;
+	}
+	
+}

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

@@ -117,4 +117,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup>
 	public List<BasicUserDto> findTeachersByStuId(Integer studentId) {
 		return musicGroupDao.findTeachersByStuId(studentId);
 	}
+
+	@Override
+	public void cancelMusicGroup(String musicGroupId) {
+		
+	}
 }

+ 63 - 9
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentAttendanceServiceImpl.java

@@ -1,27 +1,37 @@
 package com.ym.mec.biz.service.impl;
 
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.ym.mec.biz.dal.dao.ClassGroupStudentMapperDao;
 import com.ym.mec.biz.dal.dao.CourseScheduleDao;
 import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
 import com.ym.mec.biz.dal.dao.StudentAttendanceDao;
 import com.ym.mec.biz.dal.dto.StudentPersonalAttendanceDto;
 import com.ym.mec.biz.dal.dto.StudentStatusCountUtilEntity;
+import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
+import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.StudentAttendance;
+import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
+import com.ym.mec.biz.dal.enums.CourseStatusEnum;
 import com.ym.mec.biz.dal.enums.StudentAttendanceStatusEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.page.StudentAttendanceQueryInfo;
 import com.ym.mec.biz.service.StudentAttendanceService;
 import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import com.ym.mec.util.date.DateUtil;
 
 @Service
 public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentAttendance>  implements StudentAttendanceService {
@@ -32,6 +42,9 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 	private MusicGroupStudentFeeDao studentFeeDao;
 	@Autowired
 	private CourseScheduleDao courseScheduleDao;
+	
+	@Autowired
+	private ClassGroupStudentMapperDao classGroupStudentMapperDao;
 
 	@Override
 	public BaseDAO<Long, StudentAttendance> getDAO() {
@@ -73,7 +86,7 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 	public Map<String, Object> getCurrentCourseStudents(QueryInfo queryInfo) {
 		Map<String,Object> result=new HashMap<>();
 
-		PageInfo pageInfo = super.queryPage(queryInfo);
+		PageInfo<StudentAttendance> pageInfo = super.queryPage(queryInfo);
 
 		result.put("pageInfo",pageInfo);
 
@@ -84,6 +97,8 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 				case LEAVE:
 					result.put("numberOfLeavePeoples",studentStatusCount.getNumberOfStudent());
 					break;
+			default:
+				break;
 
 			}
 		});
@@ -92,7 +107,7 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 	}
 
 	@Override
-	public PageInfo getStudentPersonalAttendances(QueryInfo queryInfo) {
+	public PageInfo<StudentPersonalAttendanceDto> getStudentPersonalAttendances(QueryInfo queryInfo) {
 		PageInfo<StudentPersonalAttendanceDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
 		Map<String, Object> params = new HashMap<String, Object>();
 		MapUtil.populateMap(params, queryInfo);
@@ -110,4 +125,43 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 		pageInfo.setRows(dataList);
 		return pageInfo;
 	}
+
+	@Override
+	@Transactional
+	public boolean leave(Integer userId, Long courseScheduleId, String remark) {
+		
+		CourseSchedule courseSchedule = courseScheduleDao.get(courseScheduleId);
+		if(courseSchedule == null){
+			throw new BizException("课程编号异常");
+		}
+		
+		if(courseSchedule.getStatus() == CourseStatusEnum.OVER){
+			throw new BizException("课程已结束");
+		}
+		
+		Date date = new Date();
+		
+		if(DateUtil.addHours(date, 2).after(courseSchedule.getStartClassTime())){
+			throw new BizException("开课2个小时之前才可以请假");
+		}
+		
+		StudentAttendance studentAttendance  = new StudentAttendance();
+		studentAttendance.setClassGroupId(courseSchedule.getClassGroupId());
+		studentAttendance.setCourseScheduleId(courseScheduleId);
+		studentAttendance.setCreateTime(date);
+		studentAttendance.setCurrentClassTimes(0);
+		studentAttendance.setRemark(remark);
+		studentAttendance.setStatus(StudentAttendanceStatusEnum.LEAVE);
+		studentAttendance.setUserId(userId);
+		
+		studentAttendanceDao.insert(studentAttendance);
+		
+		ClassGroupStudentMapper classGroupStudentMapper = classGroupStudentMapperDao.query(courseSchedule.getClassGroupId(), userId);
+		classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.LEAVE);
+		classGroupStudentMapperDao.update(classGroupStudentMapper);
+		
+		//发送消息至老师
+		
+		return true;
+	}
 }

+ 15 - 9
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderDetailServiceImpl.java

@@ -9,15 +9,21 @@ import com.ym.mec.biz.service.StudentPaymentOrderDetailService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 
+import java.util.List;
+
 @Service
-public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long, StudentPaymentOrderDetail>  implements StudentPaymentOrderDetailService {
-	
-	@Autowired
-	private StudentPaymentOrderDetailDao studentPaymentOrderDetailDao;
+public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long, StudentPaymentOrderDetail> implements StudentPaymentOrderDetailService {
+
+    @Autowired
+    private StudentPaymentOrderDetailDao studentPaymentOrderDetailDao;
+
+    @Override
+    public BaseDAO<Long, StudentPaymentOrderDetail> getDAO() {
+        return studentPaymentOrderDetailDao;
+    }
 
-	@Override
-	public BaseDAO<Long, StudentPaymentOrderDetail> getDAO() {
-		return studentPaymentOrderDetailDao;
-	}
-	
+    @Override
+    public int batchAdd(List<StudentPaymentOrderDetail> studentPaymentOrderDetailList) {
+        return studentPaymentOrderDetailDao.batchAdd(studentPaymentOrderDetailList);
+    }
 }

+ 27 - 15
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -2,6 +2,8 @@ package com.ym.mec.biz.service.impl;
 
 import java.util.List;
 
+import com.ym.mec.biz.dal.enums.DealStatusEnum;
+import com.ym.mec.biz.dal.enums.OrderTypeEnum;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -14,19 +16,29 @@ import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 
 @Service
-public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, StudentPaymentOrder>  implements StudentPaymentOrderService {
-	
-	@Autowired
-	private StudentPaymentOrderDao studentPaymentOrderDao;
-
-	@Override
-	public BaseDAO<Long, StudentPaymentOrder> getDAO() {
-		return studentPaymentOrderDao;
-	}
-
-	@Override
-	public List<Goods> queryApplyGoodsList(Integer musicGroupId, OrderDetailTypeEnum type) {
-		return studentPaymentOrderDao.queryApplyGoodsList(musicGroupId, type);
-	}
-	
+public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, StudentPaymentOrder> implements StudentPaymentOrderService {
+
+    @Autowired
+    private StudentPaymentOrderDao studentPaymentOrderDao;
+
+    @Override
+    public BaseDAO<Long, StudentPaymentOrder> getDAO() {
+        return studentPaymentOrderDao;
+    }
+
+    @Override
+    public List<Goods> queryApplyGoodsList(Integer musicGroupId, OrderDetailTypeEnum type) {
+        return studentPaymentOrderDao.queryApplyGoodsList(musicGroupId, type);
+    }
+
+    @Override
+    public StudentPaymentOrder findMusicGroupApplyOrderByStatus(Integer userId,String musicGroupId, DealStatusEnum status) {
+        return studentPaymentOrderDao.findMusicGroupApplyOrderByStatus(userId,musicGroupId, status);
+    }
+
+    @Override
+    public StudentPaymentOrder findOrderByOrderNo(String orderNo) {
+        return studentPaymentOrderDao.findOrderByOrderNo(orderNo);
+    }
+
 }

+ 96 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service.impl;
 
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
@@ -8,6 +9,13 @@ import java.util.Map;
 
 import javax.annotation.Resource;
 
+import com.ym.mec.biz.dal.dto.VipGroupBuyParamsDto;
+import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.enums.*;
+import com.ym.mec.biz.service.StudentPaymentOrderDetailService;
+import com.ym.mec.biz.service.StudentPaymentOrderService;
+import com.ym.mec.common.exception.BizException;
+import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -20,8 +28,6 @@ import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
 import com.ym.mec.biz.dal.dto.StudentApplyDetailDto;
 import com.ym.mec.biz.dal.dto.StudentFeeDto;
 import com.ym.mec.biz.dal.dto.StudentInfo;
-import com.ym.mec.biz.dal.entity.StudentRegistration;
-import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
 import com.ym.mec.biz.service.StudentRegistrationService;
 import com.ym.mec.common.dal.BaseDAO;
@@ -36,6 +42,10 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     private StudentRegistrationDao studentRegistrationDao;
     @Autowired
     private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private StudentPaymentOrderService studentPaymentOrderService;
+    @Autowired
+    private StudentPaymentOrderDetailService studentPaymentOrderDetailService;
 
     @Override
     public BaseDAO<Long, StudentRegistration> getDAO() {
@@ -123,8 +133,88 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         return studentRegistration;
     }
 
-	@Override
-	public StudentInfo queryStudentInfo(Integer userId) {
-		return studentRegistrationDao.queryStudentInfo(userId);
-	}
+    @Override
+    public StudentInfo queryStudentInfo(Integer userId) {
+        return studentRegistrationDao.queryStudentInfo(userId);
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public StudentPaymentOrder addOrder(Integer userId, BigDecimal amount, String orderNo, String paymentChannel, BigDecimal courseFee, List<MusicGroupSubjectGoodsGroup> goodsGroups, List<Goods> goodsList, List<Goods> otherGoodsList, String musicGroupId) {
+
+        Date date = new Date();
+        StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
+        studentPaymentOrder.setUserId(userId);
+        studentPaymentOrder.setOrderNo(orderNo);
+        studentPaymentOrder.setType(OrderTypeEnum.APPLY);
+        studentPaymentOrder.setExpectAmount(amount);
+        studentPaymentOrder.setActualAmount(amount);
+        studentPaymentOrder.setStatus(DealStatusEnum.ING);
+        studentPaymentOrder.setPaymentChannel(paymentChannel);
+        studentPaymentOrder.setMusicGroupId(musicGroupId);
+        studentPaymentOrderService.insert(studentPaymentOrder);
+
+        ArrayList<StudentPaymentOrderDetail> studentPaymentOrderDetailList = new ArrayList<>();
+        StudentPaymentOrderDetail studentPaymentOrderDetail = new StudentPaymentOrderDetail();
+        studentPaymentOrderDetail.setType(OrderDetailTypeEnum.COURSE);
+        studentPaymentOrderDetail.setPrice(courseFee);
+        studentPaymentOrderDetail.setCreateTime(date);
+        studentPaymentOrderDetail.setUpdateTime(date);
+        studentPaymentOrderDetail.setPaymentOrderId(studentPaymentOrder.getId());
+        studentPaymentOrderDetailList.add(studentPaymentOrderDetail);
+        //乐器及打包辅件
+        if (goodsGroups != null) {
+            for (MusicGroupSubjectGoodsGroup goodsGroup : goodsGroups) {
+                StudentPaymentOrderDetail studentPaymentOrderDetail4goodsGroup = new StudentPaymentOrderDetail();
+                OrderDetailTypeEnum type = null;
+                if (goodsGroup.getType().equals(GoodsType.INSTRUMENT)) {
+                    type = OrderDetailTypeEnum.MUSICAL;
+                } else if (goodsGroup.getType().equals(GoodsType.ACCESSORIES)) {
+                    type = OrderDetailTypeEnum.ACCESSORIES;
+                } else if (goodsGroup.getType().equals(GoodsType.OTHER)) {
+                    type = OrderDetailTypeEnum.TEACHING;
+                }
+                studentPaymentOrderDetail4goodsGroup.setType(type);
+                studentPaymentOrderDetail4goodsGroup.setPrice(goodsGroup.getPrice());
+                studentPaymentOrderDetail4goodsGroup.setGoodsIdList(goodsGroup.getGoodsIdList());
+                studentPaymentOrderDetail4goodsGroup.setCreateTime(date);
+                studentPaymentOrderDetail4goodsGroup.setUpdateTime(date);
+                studentPaymentOrderDetail4goodsGroup.setPaymentOrderId(studentPaymentOrder.getId());
+                studentPaymentOrderDetailList.add(studentPaymentOrderDetail4goodsGroup);
+            }
+        }
+
+        //单独辅件
+        if (goodsList != null) {
+            for (Goods goods : goodsList) {
+                StudentPaymentOrderDetail studentPaymentOrderDetail4goods = new StudentPaymentOrderDetail();
+                studentPaymentOrderDetail4goods.setType(OrderDetailTypeEnum.ACCESSORIES);
+                studentPaymentOrderDetail4goods.setPrice(goods.getGroupPurchasePrice());
+                studentPaymentOrderDetail4goods.setGoodsIdList(goods.getId().toString());
+                studentPaymentOrderDetail4goods.setCreateTime(date);
+                studentPaymentOrderDetail4goods.setUpdateTime(date);
+                studentPaymentOrderDetail4goods.setPaymentOrderId(studentPaymentOrder.getId());
+                studentPaymentOrderDetailList.add(studentPaymentOrderDetail4goods);
+
+            }
+        }
+        //单独教谱
+        if (otherGoodsList != null) {
+            for (Goods goods : otherGoodsList) {
+                StudentPaymentOrderDetail studentPaymentOrderDetail4otherGoods = new StudentPaymentOrderDetail();
+                studentPaymentOrderDetail4otherGoods.setType(OrderDetailTypeEnum.TEACHING);
+                studentPaymentOrderDetail4otherGoods.setPrice(goods.getGroupPurchasePrice());
+                studentPaymentOrderDetail4otherGoods.setGoodsIdList(goods.getId().toString());
+                studentPaymentOrderDetail4otherGoods.setCreateTime(date);
+                studentPaymentOrderDetail4otherGoods.setUpdateTime(date);
+                studentPaymentOrderDetail4otherGoods.setPaymentOrderId(studentPaymentOrder.getId());
+                studentPaymentOrderDetailList.add(studentPaymentOrderDetail4otherGoods);
+            }
+        }
+
+        studentPaymentOrderDetailService.batchAdd(studentPaymentOrderDetailList);
+
+        return studentPaymentOrder;
+    }
+
 }

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

@@ -6,11 +6,13 @@ import com.ym.mec.biz.dal.dto.VipGroupActivityAddDto;
 import com.ym.mec.biz.dal.entity.VipGroupActivity;
 import com.ym.mec.biz.service.VipGroupActivityService;
 import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
+import java.util.Objects;
 
 @Service
 public class VipGroupActivityServiceImpl extends BaseServiceImpl<Integer, VipGroupActivity>  implements VipGroupActivityService {
@@ -25,18 +27,30 @@ public class VipGroupActivityServiceImpl extends BaseServiceImpl<Integer, VipGro
 
 	@Override
 	public void addVipGroupActivity(VipGroupActivityAddDto vipGroupActivityAddDto) {
+		if(Objects.isNull(vipGroupActivityAddDto.getOrganId())){
+			throw new BizException("请指定部门!");
+		}
 		vipGroupActivityAddDto.setSalarySettlementJson(JSON.toJSONString(vipGroupActivityAddDto.getVipGroupSalarySettlement()));
 		super.insert(vipGroupActivityAddDto);
 	}
 
 	@Override
 	public void updateVipGroupActivity(VipGroupActivityAddDto vipGroupActivityAddDto) {
+		if(Objects.isNull(vipGroupActivityAddDto.getId())){
+			throw new BizException("请指定活动编号!");
+		}
+		if(Objects.isNull(vipGroupActivityAddDto.getOrganId())){
+			throw new BizException("请指定部门!");
+		}
 		vipGroupActivityAddDto.setSalarySettlementJson(JSON.toJSONString(vipGroupActivityAddDto.getVipGroupSalarySettlement()));
 		super.update(vipGroupActivityAddDto);
 	}
 
 	@Override
 	public List<VipGroupActivity> findByVipGroupCategory(Long categoryId) {
+		if(Objects.isNull(categoryId)){
+			throw new BizException("请选择课程形态!");
+		}
 		return vipGroupActivityDao.findByCategory(categoryId);
 	}
 }

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

@@ -24,10 +24,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 @Service
@@ -73,6 +70,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 	@Override
 	public void createVipGroup(VipGroupApplyDto vipGroup) {
 
+		if (Objects.isNull(vipGroup.getVipGroupApplyBaseInfo().getUserId())){
+			throw new BizException("请选择指导老师");
+		}
+
 	    if(vipGroup.getCourseSchedules().size()!=vipGroup.getVipGroupApplyBaseInfo().getAllCourseNum()){
 	        throw new BizException("课时总数不匹配!");
         }
@@ -85,10 +86,20 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
             throw new BizException("线上课课时数量安排有误!");
         }
 
+        //获取活动信息
         VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupApplyBaseInfo().getVipGroupActivityId().intValue());
+
+        //生成vip课信息
 		VipGroupApplyBaseInfoDto vipGroupApplyBaseInfoDto=vipGroup.getVipGroupApplyBaseInfo();
+		vipGroupApplyBaseInfoDto.setTotalPrice(countVipGroupPredictFee(vipGroupApplyBaseInfoDto,
+				vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice(),
+				vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice()));
 		vipGroupDao.insert(vipGroupApplyBaseInfoDto);
+
+		//获取vip课类型信息
 		VipGroupCategory vipGroupCategory = vipGroupCategoryDao.get(vipGroup.getVipGroupApplyBaseInfo().getVipGroupCategoryId().intValue());
+
+		//创建班级信息
 		ClassGroup classGroup=new ClassGroup();
 		classGroup.setExpectStudentNum(vipGroupCategory.getStudentNum());
 		classGroup.setName(vipGroupApplyBaseInfoDto.getName());
@@ -96,15 +107,27 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		classGroup.setType(ClassGroupTypeEnum.VIP);
 		classGroup.setDelFlag(YesOrNoEnum.NO);
 		classGroupDao.insert(classGroup);
+
+		//创建vip课班级关联记录
 		VipGroupClassGroupMapper vipGroupClassGroupMapper=new VipGroupClassGroupMapper();
 		vipGroupClassGroupMapper.setVipGroupId(vipGroupApplyBaseInfoDto.getId());
 		vipGroupClassGroupMapper.setClassGroupId(classGroup.getId());
 		vipGroupClassGroupMapperDao.insert(vipGroupClassGroupMapper);
+
+		//创建班级老师关联记录
 		ClassGroupTeacherMapper classGroupTeacherMapper=new ClassGroupTeacherMapper();
 		classGroupTeacherMapper.setTeacherRole(TeachTypeEnum.TEACHING);
 		classGroupTeacherMapper.setUserId(Integer.parseInt(vipGroupApplyBaseInfoDto.getTeacherId().toString()));
-		classGroupTeacherMapper.setSalary(vipGroupApplyBaseInfoDto.getSalary());
 		classGroupTeacherMapperDao.insert(classGroupTeacherMapper);
+
+		//创建班级与老师课酬记录
+		ClassGroupTeacherSalary classGroupTeacherSalary=new ClassGroupTeacherSalary();
+		classGroupTeacherSalary.setTeacherRole(TeachTypeEnum.TEACHING);
+		classGroupTeacherSalary.setUserId(Integer.parseInt(vipGroupApplyBaseInfoDto.getTeacherId().toString()));
+		classGroupTeacherSalary.setSalary(vipGroupApplyBaseInfoDto.getOfflineTeacherSalary());
+
+
+		//课程信息调整
 		vipGroup.getCourseSchedules().forEach(courseSchedule -> {
 		    if(courseSchedule.getEndClassTime().after(vipGroupActivity.getCoursesEndTime())
                 &&courseSchedule.getStartClassTime().before(vipGroupActivity.getCoursesStartTime())){
@@ -113,6 +136,13 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			courseSchedule.setClassGroupId(classGroup.getId());
 		});
 		courseScheduleService.batchAddCourseSchedule(vipGroup.getCourseSchedules());
+
+		//创建老师与学生费用相关记录
+		List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries=new ArrayList<>();
+		Map<TeachModeEnum, List<CourseSchedule>> courseScheduleGroupByTeachMode = vipGroup.getCourseSchedules().stream().collect(Collectors.groupingBy(CourseSchedule::getTeachMode));
+		vipGroup.getCourseSchedules().forEach(courseSchedule -> {
+			CourseScheduleTeacherSalary courseScheduleTeacherSalary=new CourseScheduleTeacherSalary();
+		});
 	}
 
 	@Override
@@ -329,11 +359,31 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
      * 计算VIP课程预计收费
      */
     private BigDecimal countVipGroupPredictFee(VipGroup vipGroup,BigDecimal onlineClassesUnitPrice,BigDecimal offlineClassesUnitPrice){
-        BigDecimal offlineClassNum=new BigDecimal(vipGroup.getOfflineClassesNum());
-        BigDecimal onlineClassNum=new BigDecimal(vipGroup.getOnlineClassesNum());
-        BigDecimal onlineVipGroupCharge = onlineClassesUnitPrice.multiply(onlineClassNum);
-        BigDecimal offlineVipGroupCharge = offlineClassesUnitPrice.multiply(offlineClassNum);
-        return onlineVipGroupCharge.add(offlineVipGroupCharge);
+		VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupActivityId().intValue());
+		if(Objects.isNull(vipGroup)){
+			throw new BizException("该课未指定活动方案");
+		}
+		BigDecimal offlineClassNum=new BigDecimal(vipGroup.getOfflineClassesNum());
+		BigDecimal onlineClassNum=new BigDecimal(vipGroup.getOnlineClassesNum());
+		BigDecimal onlineVipGroupCharge = onlineClassesUnitPrice.multiply(onlineClassNum);
+		BigDecimal offlineVipGroupCharge = offlineClassesUnitPrice.multiply(offlineClassNum);
+		BigDecimal totalPrice=null;
+		switch (vipGroupActivity.getType()){
+			case BASE_ACTIVITY:
+				totalPrice=onlineVipGroupCharge.add(offlineVipGroupCharge);
+				break;
+			case DISCOUNT:
+				BigDecimal discount=new BigDecimal(vipGroupActivity.getAttribute1());
+				totalPrice=onlineVipGroupCharge.add(offlineVipGroupCharge);
+				totalPrice=totalPrice.multiply(discount);
+				break;
+			case GIVE_CLASS:
+
+				break;
+			default:
+				throw new BizException("活动类型错误!");
+		}
+        return totalPrice;
     }
 
 	@Override

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

@@ -17,6 +17,7 @@
         <result column="del_flag_" property="delFlag" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="expect_student_num_" property="expectStudentNum"/>
         <result column="total_class_times_" property="totalClassTimes"/>
+        <result column="img_" property="img"/>
         <!--<association property="musicGroupId" javaType="com.ym.mec.biz.dal.entity.MusicGroup" >-->
         <!--<result column="name_" property="name"/>-->
         <!--<result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>-->
@@ -52,6 +53,7 @@
             <if test="expectStudentNum!=null">expect_student_num_,</if>
             <if test="totalClassTimes!=null">total_class_times_,</if>
             <if test="currentClassTimes!=null">current_class_times_,</if>
+            <if test="img!=null">img_,</if>
         </trim>
         VALUES
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -66,6 +68,7 @@
             <if test="expectStudentNum!=null">#{expectStudentNum},</if>
             <if test="totalClassTimes!=null">#{totalClassTimes},</if>
             <if test="currentClassTimes!=null">#{currentClassTimes},</if>
+            <if test="img!=null">#{img},</if>
         </trim>
     </insert>
 
@@ -112,6 +115,9 @@
             <if test="currentClassTimes!=null">
                 current_class_times_=#{currentClassTimes},
             </if>
+            <if test="img!=null">
+                img_=#{img},
+            </if>
         </set>
         WHERE id_ = #{id}
     </update>

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

@@ -71,4 +71,8 @@
             (#{item.id},#{item.classGroupId},#{item.userId},#{item.status},#{item.createTime})
         </foreach>
     </insert>
+    
+    <select id="query" resultMap="ClassGroupStudentMapper" parameterType="map">
+		SELECT * FROM class_group_student_mapper where class_group_id_ = #{classGroupId} and user_id_ = #{userId}
+	</select>
 </mapper>

+ 10 - 0
mec-biz/src/main/resources/config/mybatis/ClassGroupTeacherSalaryMapper.xml

@@ -9,6 +9,7 @@
     <result column="user_id_" jdbcType="INTEGER" property="userId" />
     <result column="duration_" jdbcType="INTEGER" property="duration" />
     <result column="salary_" jdbcType="DECIMAL" property="salary" />
+    <result column="online_classes_salary_" jdbcType="DECIMAL" property="onlineClassesSalary" />
     <result column="create_time_" jdbcType="TIMESTAMP" property="createTime" />
     <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime" />
   </resultMap>
@@ -41,6 +42,9 @@
       <if test="salary != null">
         salary_,
       </if>
+      <if test="onlineClassesSalary != null">
+        online_classes_salary_,
+      </if>
       <if test="createTime != null">
         create_time_,
       </if>
@@ -67,6 +71,9 @@
       <if test="salary != null">
         #{salary,jdbcType=DECIMAL},
       </if>
+      <if test="onlineClassesSalary != null">
+        #{onlineClassesSalary,jdbcType=DECIMAL},
+      </if>
       <if test="createTime != null">
         #{createTime,jdbcType=TIMESTAMP},
       </if>
@@ -97,6 +104,9 @@
       <if test="salary != null">
         salary_ = #{salary,jdbcType=DECIMAL},
       </if>
+      <if test="onlineClassesSalary != null">
+        online_classes_salary_ = #{onlineClassesSalary,jdbcType=DECIMAL},
+      </if>
       <if test="createTime != null">
         create_time_ = #{createTime,jdbcType=TIMESTAMP},
       </if>

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

@@ -14,6 +14,8 @@
 		<result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
 		<result column="wf_process_id_" property="wfProcessId" />
 		<result column="wf_order_id_" property="wfOrderId" />
+		<result column="teacher_liability_ratio_" property="teacherLiabilityRatio" />
+		<result column="student_liability_ratio_" property="studentLiabilityRatio" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 	</resultMap>
@@ -35,7 +37,7 @@
 		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
 		</selectKey>
 		-->
-		INSERT INTO course_schedule_complaints (id_,user_id_,course_schedule_id_,reason_,status_,wf_process_id_,wf_order_id_,create_time_,update_time_) VALUES(#{id},#{userId},#{courseScheduleId},#{reason},#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{wfProcessId},#{wfOrderId},now(),now())
+		INSERT INTO course_schedule_complaints (id_,user_id_,course_schedule_id_,reason_,status_,wf_process_id_,wf_order_id_,create_time_,update_time_,teacher_liability_ratio_,student_liability_ratio_) VALUES(#{id},#{userId},#{courseScheduleId},#{reason},#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{wfProcessId},#{wfOrderId},now(),now(),#{teacherLiabilityRatio},#{studentLiabilityRatio})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -66,6 +68,12 @@
 			<if test="updateTime != null">
 			update_time_ = now(),
 			</if>
+			<if test="teacherLiabilityRatio != null">
+			teacher_liability_ratio_ = #{teacherLiabilityRatio},
+			</if>
+			<if test="studentLiabilityRatio != null">
+			student_liability_ratio_ = #{studentLiabilityRatio},
+			</if>
 		</set> WHERE id_ = #{id}
 	</update>
 	

+ 3 - 7
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -240,8 +240,8 @@
 
     <select id="getStudentCourseSchedulesWithDate" resultMap="courseScheduleDto">
         SELECT
-            cg.id_ seal_class_id_,
-            cg.name_,
+            cgsm.class_group_id_ seal_class_id_,
+            cs.name_,
             cs.type_,
             cs.id_,
             cs.class_date_,
@@ -249,15 +249,11 @@
             CONCAT(cs.class_date_,' ',cs.end_class_time_) end_class_time_,
             cs.status_,
 	        su.username_ teacher_name_,
-	        sa.status_ attendance_status_,
-			sc.paran_value_
+	        cgsm.status_ attendance_status_
         FROM
             course_schedule cs
             LEFT JOIN sys_user su ON cs.teacher_id_=su.id_
-            LEFT JOIN class_group cg ON cs.class_group_id_ = cg.id_
             LEFT JOIN class_group_student_mapper cgsm ON cgsm.class_group_id_ = cs.class_group_id_
-	        LEFT JOIN student_attendance sa ON cs.id_=sa.course_schedule_id_ AND sa.user_id_=#{studentId}
-			LEFT JOIN sys_config sc ON sc.param_name_="vip_appeal_days_range"
         WHERE
             cs.class_date_ = DATE_FORMAT(#{classDate},'%Y%m%d')
             AND cgsm.user_id_ = #{studentId}

+ 84 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml

@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--
+这个文件是自动生成的。
+不要修改此文件。所有改动将在下次重新自动生成时丢失。
+-->
+<mapper namespace="com.ym.mec.biz.dal.dao.CourseScheduleStudentPaymentDao">
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment" id="CourseScheduleStudentPayment">
+		<result column="id_" property="id" />
+		<result column="course_schedule_id_" property="courseScheduleId" />
+		<result column="user_id_" property="userId" />
+		<result column="expect_price_" property="expectPrice" />
+		<result column="actual_price_" property="actualPrice" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+		<result column="settlement_time_" property="settlementTime" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="CourseScheduleStudentPayment" >
+		SELECT * FROM course_schedule_student_payment WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="CourseScheduleStudentPayment">
+		SELECT * FROM course_schedule_student_payment ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!--
+		<selectKey resultClass="int" keyProperty="id" > 
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		</selectKey>
+		-->
+		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>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment">
+		UPDATE course_schedule_student_payment <set>
+<if test="userId != null">
+user_id_ = #{userId},
+</if>
+<if test="id != null">
+id_ = #{id},
+</if>
+<if test="courseScheduleId != null">
+course_schedule_id_ = #{courseScheduleId},
+</if>
+<if test="updateTime != null">
+update_time_ = #{updateTime},
+</if>
+<if test="settlementTime != null">
+settlement_time_ = #{settlementTime},
+</if>
+<if test="expectPrice != null">
+expect_price_ = #{expectPrice},
+</if>
+<if test="actualPrice != null">
+actual_price_ = #{actualPrice},
+</if>
+<if test="createTime != null">
+create_time_ = #{createTime},
+</if>
+</set> WHERE id_ = #{id} 
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM course_schedule_student_payment WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="CourseScheduleStudentPayment" parameterType="map">
+		SELECT * FROM course_schedule_student_payment ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM course_schedule_student_payment
+	</select>
+</mapper>

+ 12 - 4
mec-biz/src/main/resources/config/mybatis/CourseScheduleTeacherSalaryMapper.xml

@@ -11,10 +11,12 @@
 		<result column="course_schedule_id_" property="courseScheduleId" />
 		<result column="teacher_role_" property="teacherRole" />
 		<result column="user_id_" property="userId" />
-		<result column="salary_" property="salary" />
+		<result column="expect_salary_" property="expectSalary" />
 		<result column="create_time_" property="createTime" />
 		<result column="create_update_" property="createUpdate" />
 		<result column="subsidy_" property="subsidy" />
+		<result column="actual_salary_" property="actualSalary" />
+		<result column="settlement_time_" property="settlementTime" />
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -34,7 +36,7 @@
 		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
 		</selectKey>
 		-->
-		INSERT INTO course_schedule_teacher_salary (id_,course_schedule_id_,teacher_role_,user_id_,salary_,create_time_,create_update_,subsidy_) VALUES(#{id},#{courseScheduleId},#{teacherRole},#{userId},#{salary},#{createTime},#{createUpdate},#{subsidy})
+		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>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -49,11 +51,14 @@ subsidy_ = #{subsidy},
 <if test="id != null">
 id_ = #{id},
 </if>
+<if test="expectSalary != null">
+expect_salary_ = #{expectSalary},
+</if>
 <if test="courseScheduleId != null">
 course_schedule_id_ = #{courseScheduleId},
 </if>
-<if test="salary != null">
-salary_ = #{salary},
+<if test="settlementTime != null">
+settlement_time_ = #{settlementTime},
 </if>
 <if test="teacherRole != null">
 teacher_role_ = #{teacherRole},
@@ -61,6 +66,9 @@ teacher_role_ = #{teacherRole},
 <if test="createUpdate != null">
 create_update_ = #{createUpdate},
 </if>
+<if test="actualSalary != null">
+actual_salary_ = #{actualSalary},
+</if>
 <if test="createTime != null">
 create_time_ = #{createTime},
 </if>

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

@@ -140,6 +140,7 @@
 		<result column="register_id_" property="registerId" />
 		<result column="user_name_" property="userName" />
 		<result column="subject_name_" property="subjectName" />
+		<result column="subject_id_" property="subjectId" />
 		<result column="current_class_" property="currentClass" />
 		<result column="current_grade_" property="currentGrade" />
 		<result column="music_group_name_" property="musicGroupName" />
@@ -151,7 +152,7 @@
 
     <select id="queryUserMusicGroups" resultMap="queryUserMusicGroupsMap">
 		SELECT sr.id_ register_id_,sr.name_ user_name_,sr.current_class_,sr.current_grade_,
-		sr.payment_status_,mg.name_ music_group_name_,s.name_ subject_name_,mg.id_ music_group_id_
+		sr.payment_status_,mg.name_ music_group_name_,s.name_ subject_name_,s.id_ subject_id_,mg.id_ music_group_id_
 		FROM student_registration sr
 		LEFT JOIN music_group mg ON sr.music_group_id_ = mg.id_
 		LEFT JOIN `subject` s ON sr.actual_subject_id_ = s.id_

+ 9 - 0
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderDetailMapper.xml

@@ -77,4 +77,13 @@
     <select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM student_payment_order_detail
 	</select>
+
+    <insert id="batchAdd" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id_">
+        INSERT INTO student_payment_order_detail
+        (id_,type_,goods_id_list_,price_,create_time_,update_time_,payment_order_id_)
+        VALUES
+        <foreach collection="studentPaymentOrderDetailList" item="orderDetail" separator=",">
+            (#{orderDetail.id},#{orderDetail.type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{orderDetail.goodsIdList},#{orderDetail.price},#{orderDetail.createTime},#{orderDetail.updateTime},#{orderDetail.paymentOrderId})
+        </foreach>
+    </insert>
 </mapper>

+ 9 - 0
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml

@@ -150,4 +150,13 @@
             LEFT JOIN student_payment_order spo ON svgp.student_payment_order_id_=spo.id_
             WHERE svgp.user_id_=#{userId} AND svgp.vip_group_id_=#{vipGroupId}
     </select>
+    <!-- 查询报名订单 -->
+    <select id="findMusicGroupApplyOrderByStatus" resultMap="StudentPaymentOrder">
+        SELECT * FROM student_payment_order WHERE music_group_id_= #{musicGroupId} AND user_id_=#{userId} AND type_ = 'APPLY' AND status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+    </select>
+
+    <!-- 根据订单号查询订单 -->
+    <select id="findOrderByOrderNo" resultMap="StudentPaymentOrder">
+        SELECT * FROM student_payment_order WHERE order_no_ = #{orderNo}
+    </select>
 </mapper>

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

@@ -75,4 +75,7 @@
 		SELECT COUNT(*) FROM
 		sys_config
 	</select>
+	<select id="findByParamName" resultMap="SysConfig">
+		SELECT * FROM sys_config WHERE param_name_=#{paramName}
+	</select>
 </mapper>

+ 55 - 55
mec-biz/src/main/resources/config/mybatis/VipGroupActivityMapper.xml

@@ -52,61 +52,61 @@
 	<!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.VipGroupActivity">
 		UPDATE vip_group_activity <set>
-<if test="salaryReadonlyFlag != null">
-salary_readonly_flag_ = #{salaryReadonlyFlag},
-</if>
-<if test="organId != null">
-organ_id_ = #{organId},
-</if>
-<if test="id != null">
-id_ = #{id},
-</if>
-<if test="giveClassPaySalaryFlag != null">
-give_class_pay_salary_flag_ = #{giveClassPaySalaryFlag},
-</if>
-<if test="coursesEndTime != null">
-courses_end_time_ = #{coursesEndTime},
-</if>
-<if test="attribute1 != null">
-attribute1_ = #{attribute1},
-</if>
-<if test="endTime != null">
-end_time_ = #{endTime},
-</if>
-<if test="attribute2 != null">
-attribute2_ = #{attribute2},
-</if>
-<if test="name != null">
-name_ = #{name},
-</if>
-<if test="startTime != null">
-start_time_ = #{startTime},
-</if>
-<if test="attribute3 != null">
-attribute3_ = #{attribute3},
-</if>
-<if test="createTime != null">
-create_time_ = #{createTime},
-</if>
-<if test="vipGroupCategoryIdList != null">
-vip_group_category_id_list_ = #{vipGroupCategoryIdList},
-</if>
-<if test="updateTime != null">
-update_time_ = #{updateTime},
-</if>
-<if test="description != null">
-description_ = #{description},
-</if>
-<if test="salarySettlementJson != null">
-salary_settlement_json_ = #{salarySettlementJson},
-</if>
-<if test="coursesStartTime != null">
-courses_start_time_ = #{coursesStartTime},
-</if>
-<if test="type != null">
-type_ = #{type},
-</if>
-</set> WHERE id_ = #{id} 
+			<if test="salaryReadonlyFlag != null">
+			salary_readonly_flag_ = #{salaryReadonlyFlag},
+			</if>
+			<if test="organId != null">
+			organ_id_ = #{organId},
+			</if>
+			<if test="id != null">
+			id_ = #{id},
+			</if>
+			<if test="giveClassPaySalaryFlag != null">
+			give_class_pay_salary_flag_ = #{giveClassPaySalaryFlag},
+			</if>
+			<if test="coursesEndTime != null">
+			courses_end_time_ = #{coursesEndTime},
+			</if>
+			<if test="attribute1 != null">
+			attribute1_ = #{attribute1},
+			</if>
+			<if test="endTime != null">
+			end_time_ = #{endTime},
+			</if>
+			<if test="attribute2 != null">
+			attribute2_ = #{attribute2},
+			</if>
+			<if test="name != null">
+			name_ = #{name},
+			</if>
+			<if test="startTime != null">
+			start_time_ = #{startTime},
+			</if>
+			<if test="attribute3 != null">
+			attribute3_ = #{attribute3},
+			</if>
+			<if test="createTime != null">
+			create_time_ = #{createTime},
+			</if>
+			<if test="vipGroupCategoryIdList != null">
+			vip_group_category_id_list_ = #{vipGroupCategoryIdList},
+			</if>
+			<if test="updateTime != null">
+			update_time_ = #{updateTime},
+			</if>
+			<if test="description != null">
+			description_ = #{description},
+			</if>
+			<if test="salarySettlementJson != null">
+			salary_settlement_json_ = #{salarySettlementJson},
+			</if>
+			<if test="coursesStartTime != null">
+			courses_start_time_ = #{coursesStartTime},
+			</if>
+			<if test="type != null">
+			type_ = #{type},
+			</if>
+			</set> WHERE id_ = #{id}
 	</update>
 	
 	<!-- 根据主键删除一条记录 -->

+ 7 - 6
mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml

@@ -29,7 +29,7 @@
         <result column="student_num_" property="studentNum"/>
         <result column="total_class_times_" property="totalClassTimes"/>
         <result column="current_class_times_" property="currentClassTimes"/>
-        <result column="is_salary_" property="isSalary"/>
+        <result column="give_teach_mode_" property="giveTeachMode" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
     </resultMap>
 
     <resultMap id="studentManageVipGroup" type="com.ym.mec.biz.dal.dto.StudentManageVipGroupDto" extends="VipGroup">
@@ -193,8 +193,8 @@
             <if test="totalPrice != null">
                 total_price_ = #{totalPrice},
             </if>
-            <if test="isSalary!=null">
-                is_salary_=#{isSalary}
+            <if test="giveTeachMode!=null">
+                give_teach_mode_=#{giveTeachMode}
             </if>
         </set>
         WHERE id_ = #{id}
@@ -395,7 +395,7 @@
         <result column="start_class_time_" property="startClassTime"/>
         <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="teach_mode_" property="teachMode" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
-        <result column="is_salary_" property="isSalary" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="give_teach_mode_" property="giveTeachMode" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
     </resultMap>
 
     <sql id="teachingRecordQueryCondition">
@@ -419,10 +419,11 @@
             CONCAT(cs.class_date_,' ',cs.start_class_time_) start_class_time_,
             cs.status_,
             cs.teach_mode_,
-            cs.is_salary_
+            csts.actual_salary_ IS NOT NULL is_salary_
         FROM
             vip_group_class_group_mapper vgcgm
             LEFT JOIN course_schedule cs ON vgcgm.class_group_id_=cs.class_group_id_
+            LEFT JOIN course_schedule_teacher_salary csts ON cs.id_=csts.course_schedule_id_
         <include refid="teachingRecordQueryCondition"/>
         ORDER BY cs.id_
         <include refid="global.limit"/>
@@ -451,7 +452,7 @@
         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.is_salary_=1
+        WHERE vgcgm.vip_group_id_=#{vipGroupId} AND cs.give_teach_mode_=1
     </select>
     <select id="countComplaintsNum" resultType="java.lang.Integer">
         SELECT

+ 4 - 0
mec-common/common-core/src/main/java/com/ym/mec/common/redis/service/RedisCache.java

@@ -68,4 +68,8 @@ public class RedisCache<K, V> implements Cache<K, V> {
 	public void setRedisTemplate(RedisTemplate<K, V> redisTemplate) {
 		this.redisTemplate = redisTemplate;
 	}
+
+	public RedisTemplate<K, V> getRedisTemplate() {
+		return redisTemplate;
+	}
 }

+ 17 - 0
mec-common/common-core/src/main/java/com/ym/mec/common/service/IdGeneratorService.java

@@ -0,0 +1,17 @@
+package com.ym.mec.common.service;
+
+public interface IdGeneratorService {
+
+	/**
+	 * 根据业务名称生产id
+	 * @param biz
+	 * @return
+	 */
+	long generatorId(String biz);
+
+	/**
+	 * 自动生成id
+	 * @return
+	 */
+	long generatorId();
+}

+ 89 - 0
mec-common/common-core/src/main/java/com/ym/mec/common/service/impl/RedisIdGeneratorService.java

@@ -0,0 +1,89 @@
+package com.ym.mec.common.service.impl;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.concurrent.TimeUnit;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.core.ValueOperations;
+import org.springframework.stereotype.Service;
+
+import com.google.common.base.Strings;
+import com.ym.mec.common.redis.service.RedisCache;
+import com.ym.mec.common.service.IdGeneratorService;
+
+@Service
+public class RedisIdGeneratorService implements IdGeneratorService {
+
+	private final static Logger log = LoggerFactory.getLogger(RedisIdGeneratorService.class);
+
+	private static final String keyPrefix = "smart";
+
+	@Autowired
+	private RedisCache<String,Object> redisCache;
+
+	/**
+	 * @Description
+	 * @author butterfly
+	 */
+	private String getIDPrefix() {
+		Date date = new Date();
+		Calendar c = Calendar.getInstance();
+		c.setTime(date);
+		int year = c.get(Calendar.YEAR);
+		int month = c.get(Calendar.MONTH) + 1;
+		int day = c.get(Calendar.DAY_OF_MONTH); // 今天是第多少天
+		int hour = c.get(Calendar.HOUR_OF_DAY);
+		int minute = c.get(Calendar.MINUTE);
+		int second = c.get(Calendar.SECOND);
+		String monthFmt = String.format("%1$02d", month);
+		String dayFmt = String.format("%1$02d", day); // 0补位操作 必须满足三位
+		String hourFmt = String.format("%1$02d", hour); // 0补位操作 必须满足2位
+		String minuteFmt = String.format("%1$02d", minute); // 0补位操作 必须满足2位
+		String secondFmt = String.format("%1$02d", second); // 0补位操作 必须满足2位
+		StringBuffer prefix = new StringBuffer();
+		prefix.append((year - 2000)).append(monthFmt).append(dayFmt).append(hourFmt).append(minuteFmt).append(secondFmt);
+		return prefix.toString();
+	}
+
+	/**
+	 * @author butterfly
+	 */
+	private long incrDistrId(String biz) {
+		String prefix = getIDPrefix();
+		String orderId = null;
+		String key = "#{biz}:id:".replace("#{biz}", biz).concat(prefix); // 001
+		RedisTemplate<String, Object> redisTemplate = redisCache.getRedisTemplate();
+		try {
+			ValueOperations<String, Object> valueOper = redisTemplate.opsForValue();
+			Long index = valueOper.increment(key, 1);
+			orderId = prefix.concat(String.format("%1$03d", index)); // 补位操作 保证满足3位
+		} catch (Exception ex) {
+			log.error("分布式订单号生成失败异常。。。。。", ex);
+		} finally {
+			redisTemplate.expire(key, 600, TimeUnit.SECONDS);// 保留10分钟内的key
+		}
+		if (Strings.isNullOrEmpty(orderId))
+			return 0;
+		return Long.parseLong(orderId);
+	}
+
+	/**
+	 * @Description 生成分布式ID
+	 * @author butterfly
+	 */
+	@Override
+	public long generatorId(String biz) {
+		// 转成数字类型,可排序
+		return incrDistrId(biz);
+	}
+
+	@Override
+	public long generatorId() {
+		return incrDistrId(keyPrefix);
+	}
+	
+}

+ 12 - 3
mec-education/src/main/java/com/ym/mec/education/controller/TeacherController.java

@@ -1,5 +1,6 @@
 package com.ym.mec.education.controller;
 
+import com.alibaba.fastjson.JSONObject;
 import com.ym.mec.education.base.BaseResponse;
 import com.ym.mec.education.base.PageResponse;
 import com.ym.mec.education.req.HomeWorkReq;
@@ -44,7 +45,6 @@ public class TeacherController {
 
 
     /**
-     *
      * @param req
      * @return
      */
@@ -60,12 +60,21 @@ public class TeacherController {
     }
 
     /**
-     *
      * @return
      */
     @PostMapping(value = "/teacherVipClass")
-    public PageResponse teacherVipClass(@RequestBody TeacherReq req){
+    public PageResponse teacherVipClass(@RequestBody TeacherReq req) {
 
         return teacherService.teacherVipClass(req);
     }
+
+    /**
+     * 老师的日程安排
+     * @param teacherReq
+     * @return
+     */
+    @PostMapping("/dailySchedule")
+    public PageResponse dailySchedule(@RequestBody TeacherReq teacherReq) {
+        return teacherService.dailySchedule(teacherReq);
+    }
 }

+ 38 - 0
mec-education/src/main/java/com/ym/mec/education/controller/UserController.java

@@ -0,0 +1,38 @@
+package com.ym.mec.education.controller;
+
+import javax.annotation.Resource;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.education.base.BaseResponse;
+import com.ym.mec.education.service.ISubjectService;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @program: mec
+ * @description: 声部
+ * @author: xw
+ * @create: 2019-10-01 11:25
+ */
+@RestController
+@RequestMapping("api/user")
+@Api(tags = "用户")
+public class UserController {
+
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @PostMapping("/detail")
+    @ApiOperation("个人明细")
+    public BaseResponse list() {
+        return BaseResponse.success(sysUserFeignService.queryUserInfo());
+    }
+}

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

@@ -3,7 +3,7 @@ package com.ym.mec.education.enums;
 import com.ym.mec.common.enums.BaseEnum;
 import java.util.Arrays;
 
-//状态(1正常签到,0异常签到,2正常签退)
+//老师签到状态(1正常签到,0异常签到,2正常签退)
 public enum SignStatusEnum implements BaseEnum<Integer, SignStatusEnum> {
     SIGN(1,"正常签到"),
     EXCEPTION(0,"异常签到"),

+ 4 - 0
mec-education/src/main/java/com/ym/mec/education/req/TeacherReq.java

@@ -4,6 +4,7 @@ import com.ym.mec.education.base.BaseQuery;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.ToString;
+import java.time.LocalDate;
 
 /**
  * @version V1.0
@@ -18,4 +19,7 @@ public class TeacherReq extends BaseQuery {
 
     @ApiModelProperty(value = "老师编号")
     private Integer userId;
+
+    @ApiModelProperty(value = "日程安排时间")
+    private LocalDate date;
 }

+ 36 - 0
mec-education/src/main/java/com/ym/mec/education/resp/TeacherDailyScheduleResp.java

@@ -0,0 +1,36 @@
+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-08 17:24
+ */
+@Data
+@ApiModel(description = "老师日程安排")
+@Accessors(chain = true)
+public class TeacherDailyScheduleResp implements Serializable {
+
+    @ApiModelProperty(value = "课程类型")
+    private String courseType;
+    @ApiModelProperty(value = "课程名称")
+    private String courseName;
+    @ApiModelProperty(value = "老师签到情况")
+    private String signInStatus;
+    @ApiModelProperty(value = "到课比")
+    private String attendanceRate;
+    @ApiModelProperty(value = "请假人数")
+    private Integer leaveNum;
+    @ApiModelProperty(value = "上课时间")
+    private String classTime;
+    @ApiModelProperty(value = "学校名称")
+    private String schoolName;
+    @ApiModelProperty(value = "课程计划id")
+    private Long courseScheduleId;
+}

+ 2 - 0
mec-education/src/main/java/com/ym/mec/education/service/ITeacherService.java

@@ -21,4 +21,6 @@ public interface ITeacherService extends IService<Teacher> {
     BaseResponse teacherDetail(TeacherReq req);
 
     PageResponse teacherVipClass(TeacherReq req);
+
+    PageResponse dailySchedule(TeacherReq req);
 }

+ 6 - 10
mec-education/src/main/java/com/ym/mec/education/service/impl/ClassGroupStudentMapperServiceImpl.java

@@ -7,8 +7,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.google.common.collect.Lists;
 import com.ym.mec.biz.dal.enums.JobTypeEnum;
 import com.ym.mec.common.enums.UserGenderEnum;
-import com.ym.mec.common.security.AuthUser;
-import com.ym.mec.common.security.SecurityUtils;
 import com.ym.mec.education.base.BaseResponse;
 import com.ym.mec.education.base.PageResponse;
 import com.ym.mec.education.entity.*;
@@ -24,7 +22,9 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
 import java.util.stream.Collectors;
 
 /**
@@ -113,14 +113,10 @@ public class ClassGroupStudentMapperServiceImpl extends ServiceImpl<ClassGroupSt
 
     @Override
     public PageResponse getPageByTeacher(StudentReq studentReq) {
-        Teacher teacher;
-        //判断当前登录人角色
-        AuthUser user = SecurityUtils.getUser();
-        if(Objects.nonNull(user)) {
-            teacher = teacherService.getById(user.getUserId());
-        }else {
-            teacher = teacherService.getById(studentReq.getTeacherId());
+        if (Objects.isNull(studentReq.getTeacherId())) {
+            return PageResponse.errorParam();
         }
+        Teacher teacher = teacherService.getById(studentReq.getTeacherId());
         if (Objects.nonNull(teacher)) {
             //教学主管
             QueryWrapper<MusicGroup> musicGroupQueryWrapper = new QueryWrapper<>();

+ 4 - 3
mec-education/src/main/java/com/ym/mec/education/service/impl/StudentAttendanceServiceImpl.java

@@ -76,7 +76,8 @@ public class StudentAttendanceServiceImpl extends ServiceImpl<StudentAttendanceM
         QueryWrapper<StudentAttendance> leaveWrapper = new QueryWrapper<>();
         QueryWrapper<StudentAttendance> normalWrapper = new QueryWrapper<>();
         //总人数
-        Integer totalCount = count();
+        queryWrapper.lambda().eq(StudentAttendance::getClassGroupId, classGroupReq.getGroupId());
+        Integer totalCount = count(queryWrapper);
         //请假
         leaveWrapper.lambda().eq(true, StudentAttendance::getClassGroupId, classGroupReq.getGroupId())
                 .eq(true, StudentAttendance::getStatus, StudentAttendanceStatusEnum.LEAVE.getCode());
@@ -151,7 +152,7 @@ public class StudentAttendanceServiceImpl extends ServiceImpl<StudentAttendanceM
         Page<StudentAttendanceStatisticsResp> pageResult = new Page();
         ClassGroup classGroup = groupService.getById(classGroupReq.getGroupId());
         if (Objects.nonNull(classGroup)) {
-            List<String> subjectNameList = Lists.newArrayList();
+            List<String> subjectNameList;
             if (Objects.nonNull(classGroupReq.getSubjectId())) {
                 subjectNameList = Lists.newArrayList(subjectService.getById(classGroupReq.getSubjectId()).getName());
             } else {
@@ -259,7 +260,7 @@ public class StudentAttendanceServiceImpl extends ServiceImpl<StudentAttendanceM
         }
         PageResponse response = new PageResponse();
 
-        IPage<StudentAttendance> page = new Page<>(req.getPageNo(),req.getPageSize());
+        IPage<StudentAttendance> page = new Page<StudentAttendance>(req.getPageNo(),req.getPageSize());
         QueryWrapper<StudentAttendance> queryWrapper = new QueryWrapper<StudentAttendance>();
         queryWrapper.eq("course_schedule_id_",req.getCourseScheduleId());
         if(req.getStatus() != null){

+ 139 - 70
mec-education/src/main/java/com/ym/mec/education/service/impl/TeacherServiceImpl.java

@@ -4,24 +4,24 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.google.common.collect.Lists;
 import com.ym.mec.education.base.BaseResponse;
 import com.ym.mec.education.base.PageResponse;
 import com.ym.mec.education.entity.*;
-import com.ym.mec.education.enums.ClassGroupTypeEnum;
-import com.ym.mec.education.enums.CourseStatusEnum;
-import com.ym.mec.education.enums.ReturnCodeEnum;
+import com.ym.mec.education.enums.*;
 import com.ym.mec.education.mapper.TeacherMapper;
 import com.ym.mec.education.req.TeacherReq;
+import com.ym.mec.education.resp.TeacherDailyScheduleResp;
 import com.ym.mec.education.resp.TeacherDetailResp;
 import com.ym.mec.education.resp.TeacherResp;
 import com.ym.mec.education.resp.VipGroupClassResp;
 import com.ym.mec.education.service.*;
 import com.ym.mec.education.utils.DateUtil;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
-
 import java.util.*;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.stream.Collectors;
@@ -65,34 +65,43 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherMapper, Teacher> impl
 
     @Autowired
     private ICourseScheduleService courseScheduleService;
+    @Autowired
+    private ITeacherAttendanceService teacherAttendanceService;
+    @Autowired
+    private IStudentAttendanceService studentAttendanceService;
 
 
     @Autowired
     private IVipGroupDefaultClassesCycleService vipGroupDefaultClassesCycleService;
+    @Autowired
+    private IMusicGroupService musicGroupService;
+    @Autowired
+    private ISchoolService schoolService;
+
     @Override
     public PageResponse teacherList(TeacherReq req) {
         PageResponse response = new PageResponse();
         QueryWrapper<SysUser> userQueryWrapper = new QueryWrapper<>();
         List<SysUser> userList = null;
-        if(req != null && StringUtils.isEmpty(req.getName())){
-            userQueryWrapper.like("real_name_",req.getName());
+        if (req != null && StringUtils.isEmpty(req.getName())) {
+            userQueryWrapper.like("real_name_", req.getName());
             userList = sysUserService.list(userQueryWrapper);
         }
         QueryWrapper<Teacher> queryWrapper = new QueryWrapper<>();
         List<Integer> userIds = null;
-        if(!CollectionUtils.isEmpty(userList)){
+        if (!CollectionUtils.isEmpty(userList)) {
             userIds = userList.stream().map(SysUser::getId).collect(Collectors.toList());
-            queryWrapper.in("id_",userIds);
+            queryWrapper.in("id_", userIds);
         }
 
 
-        IPage<Teacher> page = new Page(req.getPageNo() == null ? 1 : req.getPageNo(),req.getPageSize() == null ? 10 : req.getPageSize());
-        IPage<Teacher> teacherIPage = this.page(page,queryWrapper);
+        IPage<Teacher> page = new Page(req.getPageNo() == null ? 1 : req.getPageNo(), req.getPageSize() == null ? 10 : req.getPageSize());
+        IPage<Teacher> teacherIPage = this.page(page, queryWrapper);
 
         List<Teacher> teacherList = teacherIPage.getRecords();
         List<TeacherResp> teacherRespList = new ArrayList<>();
-        if(!CollectionUtils.isEmpty(teacherList)){
-            teacherList.forEach(e ->{
+        if (!CollectionUtils.isEmpty(teacherList)) {
+            teacherList.forEach(e -> {
                 TeacherResp teacherResp = new TeacherResp();
                 String ids[] = e.getSubjectId().split(",");
                 List<String> stringB = Arrays.asList(ids);
@@ -105,19 +114,19 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherMapper, Teacher> impl
                 }
                 teacherResp.setUserId(e.getId());
                 SysUser sysUser = sysUserService.getById(e.getId());
-                if(sysUser != null){
+                if (sysUser != null) {
                     teacherResp.setAvatar(sysUser.getAvatar());
                     teacherResp.setName(sysUser.getRealName());
                 }
                 QueryWrapper<ClassGroupTeacherMapper> queryWrapper1 = new QueryWrapper<>();
-                queryWrapper1.eq("user_id_",e.getId());
+                queryWrapper1.eq("user_id_", e.getId());
                 List<ClassGroupTeacherMapper> classGroupTeacherMappers = classGroupTeacherMapperService.list(queryWrapper1);
-                if(!CollectionUtils.isEmpty(classGroupTeacherMappers)){
+                if (!CollectionUtils.isEmpty(classGroupTeacherMappers)) {
                     List<Integer> classId = classGroupTeacherMappers.stream().map(ClassGroupTeacherMapper::getClassGroupId).collect(Collectors.toList());
                     QueryWrapper<ClassGroup> groupQueryWrapper = new QueryWrapper<>();
-                    groupQueryWrapper.eq("id_",classId);
+                    groupQueryWrapper.eq("id_", classId);
                     List<ClassGroup> classGroups = classGroupService.list(groupQueryWrapper);
-                    if(!CollectionUtils.isEmpty(classGroups)){
+                    if (!CollectionUtils.isEmpty(classGroups)) {
                         List<String> className = classGroups.stream().map(ClassGroup::getName).collect(Collectors.toList());
 
                         teacherResp.setClassName(className);
@@ -139,61 +148,60 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherMapper, Teacher> impl
     public BaseResponse teacherDetail(TeacherReq req) {
 
         TeacherDetailResp teacherDetailResp = new TeacherDetailResp();
-        if(req == null || req.getUserId() == null){
-            return  BaseResponse.errorParam();
+        if (req == null || req.getUserId() == null) {
+            return BaseResponse.errorParam();
         }
         QueryWrapper<ClassGroupTeacherMapper> mapperQueryWrapper = new QueryWrapper<>();
-        mapperQueryWrapper.eq("user_id_",req.getUserId());
-        List<ClassGroupTeacherMapper> groupTeacherMapperList =  classGroupTeacherMapperService.list(mapperQueryWrapper);
+        mapperQueryWrapper.eq("user_id_", req.getUserId());
+        List<ClassGroupTeacherMapper> groupTeacherMapperList = classGroupTeacherMapperService.list(mapperQueryWrapper);
 
-        if(!CollectionUtils.isEmpty(groupTeacherMapperList)){
-            List<Integer> classIds = groupTeacherMapperList.stream().map(ClassGroupTeacherMapper :: getClassGroupId).collect(Collectors.toList());
+        if (!CollectionUtils.isEmpty(groupTeacherMapperList)) {
+            List<Integer> classIds = groupTeacherMapperList.stream().map(ClassGroupTeacherMapper::getClassGroupId).collect(Collectors.toList());
             QueryWrapper<ClassGroup> queryWrapper = new QueryWrapper<>();
-            queryWrapper.in("id_",classIds);
+            queryWrapper.in("id_", classIds);
             List<ClassGroup> classGroups = classGroupService.list(queryWrapper);
-            if(!CollectionUtils.isEmpty(classGroups)){
+            if (!CollectionUtils.isEmpty(classGroups)) {
                 List<ClassGroup> norClass = classGroups.stream().filter(e -> ClassGroupTypeEnum.NORMAL.getCode().equalsIgnoreCase(e.getType()) ||
-                                ClassGroupTypeEnum.MIX.getCode().equalsIgnoreCase(e.getType()) ||  ClassGroupTypeEnum.HIGH.getCode().equalsIgnoreCase(e.getType())).collect(Collectors.toList());
+                    ClassGroupTypeEnum.MIX.getCode().equalsIgnoreCase(e.getType()) || ClassGroupTypeEnum.HIGH.getCode().equalsIgnoreCase(e.getType())).collect(Collectors.toList());
 
                 List<ClassGroup> vipClass = classGroups.stream().filter(e -> ClassGroupTypeEnum.VIP.getCode().equalsIgnoreCase(e.getType())).collect(Collectors.toList());
-                if(!CollectionUtils.isEmpty(norClass)){
+                if (!CollectionUtils.isEmpty(norClass)) {
                     Integer norCount = norClass.stream().mapToInt(ClassGroup::getTotalClassTimes).sum();
                     teacherDetailResp.setGroupClassNum(norCount * norClass.size());
                 }
 
-                if(!CollectionUtils.isEmpty(vipClass)){
+                if (!CollectionUtils.isEmpty(vipClass)) {
                     Integer vipCount = vipClass.stream().mapToInt(ClassGroup::getTotalClassTimes).sum();
                     teacherDetailResp.setVipClassNum(vipCount * vipClass.size());
                 }
                 QueryWrapper<DemoGroup> demoGroupQueryWrapper = new QueryWrapper<>();
-                demoGroupQueryWrapper.eq("user_id_",req.getUserId());
+                demoGroupQueryWrapper.eq("user_id_", req.getUserId());
                 List<DemoGroup> demoGroupList = demoGroupService.list(demoGroupQueryWrapper);
-                if(!CollectionUtils.isEmpty(demoGroupList)){
-                    List<Long> demoId = demoGroupList.stream().map(e ->e.getId()).collect(Collectors.toList());
+                if (!CollectionUtils.isEmpty(demoGroupList)) {
+                    List<Long> demoId = demoGroupList.stream().map(e -> e.getId()).collect(Collectors.toList());
                     QueryWrapper<DemoGroupCoursesPlan> planQueryWrapper = new QueryWrapper<>();
-                    planQueryWrapper.in("demo_group_id_",demoId);
-                    List<DemoGroupCoursesPlan> demoGroupCoursesPlans =  iDemoGroupCoursesPlanService.list(planQueryWrapper);
-                    if(!CollectionUtils.isEmpty(demoGroupCoursesPlans)){
+                    planQueryWrapper.in("demo_group_id_", demoId);
+                    List<DemoGroupCoursesPlan> demoGroupCoursesPlans = iDemoGroupCoursesPlanService.list(planQueryWrapper);
+                    if (!CollectionUtils.isEmpty(demoGroupCoursesPlans)) {
                         Map<Date, List<DemoGroupCoursesPlan>> collect = demoGroupCoursesPlans.stream()
-                                .collect(
-                                        Collectors.groupingBy(DemoGroupCoursesPlan::getCourseDate));
-
+                            .collect(
+                                Collectors.groupingBy(DemoGroupCoursesPlan::getCourseDate));
 
 
-                        if(!CollectionUtils.isEmpty(collect)) {
+                        if (!CollectionUtils.isEmpty(collect)) {
                             List<TeacherDetailResp.InnerDemoGroup> innerDemoGroups = new ArrayList<>();
                             for (Date key : collect.keySet()) {
                                 TeacherDetailResp.InnerDemoGroup demoGroup = new TeacherDetailResp.InnerDemoGroup();
-                                demoGroup.setDateStr(DateUtil.date2String(key,DateUtil.DATE_FORMAT));
+                                demoGroup.setDateStr(DateUtil.date2String(key, DateUtil.DATE_FORMAT));
                                 demoGroup.setWeek(DateUtil.date2Week(key));
 
                                 List<DemoGroupCoursesPlan> demoGroupCoursesPlans1 = collect.get(key);
-                                if(!CollectionUtils.isEmpty(demoGroupCoursesPlans1)){
+                                if (!CollectionUtils.isEmpty(demoGroupCoursesPlans1)) {
                                     List<TeacherDetailResp.DemoGroupPlan> planList = new ArrayList<>();
-                                    demoGroupCoursesPlans1.forEach(e ->{
+                                    demoGroupCoursesPlans1.forEach(e -> {
                                         TeacherDetailResp.DemoGroupPlan demoGroupPlan = new TeacherDetailResp.DemoGroupPlan();
-                                        demoGroupPlan.setStartTime(DateUtil.date2String(e.getStartTime(),DateUtil.TIME_FORMAT));
-                                        demoGroupPlan.setEndTime(DateUtil.date2String(e.getEndTime(),DateUtil.TIME_FORMAT));
+                                        demoGroupPlan.setStartTime(DateUtil.date2String(e.getStartTime(), DateUtil.TIME_FORMAT));
+                                        demoGroupPlan.setEndTime(DateUtil.date2String(e.getEndTime(), DateUtil.TIME_FORMAT));
                                         planList.add(demoGroupPlan);
                                     });
                                     demoGroup.setDemoGroupPlans(planList);
@@ -202,12 +210,12 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherMapper, Teacher> impl
                             }
 
                             QueryWrapper<CourseSchedule> scheduleQueryWrapper = new QueryWrapper<>();
-                            scheduleQueryWrapper.eq("teacher_id_",req.getUserId());
+                            scheduleQueryWrapper.eq("teacher_id_", req.getUserId());
                             scheduleQueryWrapper.eq("status_", CourseStatusEnum.OVER.getCode());
                             List<CourseSchedule> courseSchedules = courseScheduleService.list(scheduleQueryWrapper);
-                            if(!CollectionUtils.isEmpty(courseSchedules)){
+                            if (!CollectionUtils.isEmpty(courseSchedules)) {
                                 teacherDetailResp.setUsed(courseSchedules.size());
-                            }else{
+                            } else {
                                 teacherDetailResp.setUsed(0);
                             }
 
@@ -221,14 +229,14 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherMapper, Teacher> impl
             }
 
             QueryWrapper<TeacherLeaveRecord> teacherLeaveRecordQueryWrapper = new QueryWrapper<>();
-            teacherLeaveRecordQueryWrapper.eq("user_id_",req.getUserId());
+            teacherLeaveRecordQueryWrapper.eq("user_id_", req.getUserId());
             List<TeacherLeaveRecord> teacherLeaveRecordList = teacherLeaveRecordService.list(teacherLeaveRecordQueryWrapper);
-            if(!CollectionUtils.isEmpty(teacherLeaveRecordList)){
+            if (!CollectionUtils.isEmpty(teacherLeaveRecordList)) {
                 AtomicReference<Integer> count = new AtomicReference<>(0);
-                teacherLeaveRecordList.forEach(e ->{
+                teacherLeaveRecordList.forEach(e -> {
 
-                    Integer hour = DateUtil.subMin(e.getStartTime(),e.getEndTime());
-                    if (hour != null){
+                    Integer hour = DateUtil.subMin(e.getStartTime(), e.getEndTime());
+                    if (hour != null) {
                         count.set(count.get() + hour);
                     }
                 });
@@ -243,56 +251,56 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherMapper, Teacher> impl
     public PageResponse teacherVipClass(TeacherReq req) {
 
         PageResponse response = new PageResponse();
-        if(req == null && req.getUserId() == null){
+        if (req == null && req.getUserId() == null) {
             return PageResponse.errorParam();
         }
 
-        IPage page = new Page(req.getPageNo() == null ? 1 : req.getPageNo(),req.getPageSize() == null ? 10 : req.getPageSize());
+        IPage page = new Page(req.getPageNo() == null ? 1 : req.getPageNo(), req.getPageSize() == null ? 10 : req.getPageSize());
         QueryWrapper<VipGroup> vipGroupQueryWrapper = new QueryWrapper<>();
-        vipGroupQueryWrapper.eq("user_id_",req.getUserId());
-        IPage<VipGroup> vipGroupPage = vipGroupService.page(page,vipGroupQueryWrapper);
+        vipGroupQueryWrapper.eq("user_id_", req.getUserId());
+        IPage<VipGroup> vipGroupPage = vipGroupService.page(page, vipGroupQueryWrapper);
 
         List<VipGroup> vipGroupList = vipGroupPage.getRecords();
         List<VipGroupClassResp> vipGroupClassRespList = new ArrayList<>();
-        if(!CollectionUtils.isEmpty(vipGroupList)){
+        if (!CollectionUtils.isEmpty(vipGroupList)) {
 
-            vipGroupList.forEach(e ->{
+            vipGroupList.forEach(e -> {
                 VipGroupClassResp vipGroupClassResp = new VipGroupClassResp();
                 vipGroupClassResp.setVipGroupName(e.getName());
 
-                VipGroupCategory vipGroupCategory =  vipGroupCategoryService.getById(e.getVipGroupCategoryId());
-                if(vipGroupCategory != null){
+                VipGroupCategory vipGroupCategory = vipGroupCategoryService.getById(e.getVipGroupCategoryId());
+                if (vipGroupCategory != null) {
                     vipGroupClassResp.setVipClassType(vipGroupCategory.getName());
                 }
 
                 QueryWrapper<CourseSchedule> scheduleQueryWrapper = new QueryWrapper<>();
-                scheduleQueryWrapper.eq("teacher_id_",req.getUserId());
+                scheduleQueryWrapper.eq("teacher_id_", req.getUserId());
                 List<CourseSchedule> courseSchedules = courseScheduleService.list(scheduleQueryWrapper);
-                if(!CollectionUtils.isEmpty(courseSchedules)){
-                    courseSchedules.forEach(c ->{
-                        c.setClassDateStr(DateUtil.date2String(c.getClassDate(),DateUtil.DATE_FORMAT_EXTRA));
+                if (!CollectionUtils.isEmpty(courseSchedules)) {
+                    courseSchedules.forEach(c -> {
+                        c.setClassDateStr(DateUtil.date2String(c.getClassDate(), DateUtil.DATE_FORMAT_EXTRA));
 
                     });
-                    Map<String,List<CourseSchedule>> map = courseSchedules.stream().collect(Collectors.groupingBy(CourseSchedule::getClassDateStr));
+                    Map<String, List<CourseSchedule>> map = courseSchedules.stream().collect(Collectors.groupingBy(CourseSchedule::getClassDateStr));
 
-                    if(!CollectionUtils.isEmpty(map)){
+                    if (!CollectionUtils.isEmpty(map)) {
 
                         int count1 = map.size();
-                        int count2 =0;
+                        int count2 = 0;
                         for (Map.Entry<String, List<CourseSchedule>> entry : map.entrySet()) {
 
-                            if(!CollectionUtils.isEmpty(entry.getValue())){
+                            if (!CollectionUtils.isEmpty(entry.getValue())) {
                                 count2 = count2 + entry.getValue().size();
                             }
 
                         }
                         //月平均排課
 
-                        if(count1 <= count2){
+                        if (count1 <= count2) {
                             vipGroupClassResp.setClassNum(1);
-                        }else{
+                        } else {
 
-                            vipGroupClassResp.setClassNum(count2%count1);
+                            vipGroupClassResp.setClassNum(count2 % count1);
                         }
 
                     }
@@ -306,4 +314,65 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherMapper, Teacher> impl
         response.setMessage(ReturnCodeEnum.CODE_200.getValue());
         return response;
     }
+
+    @Override
+    public PageResponse dailySchedule(TeacherReq req) {
+        Page<TeacherDailyScheduleResp> pageResult = new Page<>();
+        if (Objects.isNull(req.getUserId())) {
+            return PageResponse.errorParam();
+        }
+        List<TeacherDailyScheduleResp> list = Lists.newArrayList();
+        Page<CourseSchedule> courseSchedulePage = new Page<CourseSchedule>(req.getPageNo(), req.getPageSize());
+        QueryWrapper<CourseSchedule> courseScheduleQueryWrapper = new QueryWrapper<>();
+        courseScheduleQueryWrapper.lambda().eq(CourseSchedule::getTeacherId, req.getUserId())
+        .eq(Objects.nonNull(req.getDate()), CourseSchedule::getClassDate, req.getDate());
+        IPage<CourseSchedule> page = courseScheduleService.page(courseSchedulePage, courseScheduleQueryWrapper);
+        BeanUtils.copyProperties(page, pageResult);
+        if (!CollectionUtils.isEmpty(page.getRecords())) {
+            page.getRecords().forEach(courseSchedule -> {
+                TeacherDailyScheduleResp teacherDailyScheduleResp = new TeacherDailyScheduleResp();
+                teacherDailyScheduleResp.setCourseScheduleId(courseSchedule.getId())
+                    .setCourseName(courseSchedule.getName())
+                    .setCourseType(CourseSchedule.CourseScheduleType.getMsgByCode(courseSchedule.getType()));
+                if (Objects.nonNull(courseSchedule.getStartClassTime()) && Objects.nonNull(courseSchedule.getEndClassTime())) {
+                    teacherDailyScheduleResp.setClassTime(DateUtil.time2String(courseSchedule.getStartClassTime()) + "-" +
+                        DateUtil.time2String(courseSchedule.getEndClassTime()));
+                }
+                QueryWrapper<TeacherAttendance> teacherAttendanceQueryWrapper = new QueryWrapper<>();
+                teacherAttendanceQueryWrapper.lambda().eq(TeacherAttendance::getCourseScheduleId, courseSchedule.getId())
+                    .eq(TeacherAttendance::getTeacherId, courseSchedule.getTeacherId())
+                    .eq(TeacherAttendance::getClassGroupId, courseSchedule.getClassGroupId());
+                TeacherAttendance teacherAttendance = teacherAttendanceService.getOne(teacherAttendanceQueryWrapper);
+                Optional.ofNullable(teacherAttendance).ifPresent(attendance -> teacherDailyScheduleResp.setSignInStatus
+                    (SignStatusEnum.getMsgByCode(attendance.getSignInStatus())));
+                //考勤总人数
+                QueryWrapper<StudentAttendance> totalQueryWrapper = new QueryWrapper<>();
+                totalQueryWrapper.lambda().eq(StudentAttendance::getCourseScheduleId, courseSchedule.getId());
+                int totalCount = studentAttendanceService.count(totalQueryWrapper);
+                QueryWrapper<StudentAttendance> leaveWrapper = new QueryWrapper<>();
+                //请假人数
+                leaveWrapper.lambda().eq(StudentAttendance::getCourseScheduleId, courseSchedule.getId())
+                    .eq(StudentAttendance::getStatus, StudentAttendanceStatusEnum.LEAVE.getCode());
+                Integer leaveCount = studentAttendanceService.count(leaveWrapper);
+                //已到人数
+                QueryWrapper<StudentAttendance> normalWrapper = new QueryWrapper<>();
+                normalWrapper.lambda().eq(StudentAttendance::getCourseScheduleId, courseSchedule.getId())
+                    .eq(StudentAttendance::getStatus, StudentAttendanceStatusEnum.NORMAL.getCode());
+                Integer normalCount = studentAttendanceService.count(normalWrapper);
+                teacherDailyScheduleResp.setAttendanceRate(normalCount + "/" + totalCount)
+                    .setLeaveNum(leaveCount);
+                ClassGroup classGroup = classGroupService.getById(courseSchedule.getClassGroupId());
+                if (Objects.nonNull(classGroup)) {
+                    MusicGroup musicGroup = musicGroupService.getById(classGroup.getMusicGroupId());
+                    if (Objects.nonNull(musicGroup)) {
+                        School school = schoolService.getById(musicGroup.getSchoolId());
+                        Optional.ofNullable(school).ifPresent(value -> teacherDailyScheduleResp.setSchoolName(value.getName()));
+                    }
+                }
+                list.add(teacherDailyScheduleResp);
+                pageResult.setRecords(list);
+            });
+        }
+        return PageResponse.success(pageResult);
+    }
 }

+ 134 - 30
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java

@@ -4,12 +4,11 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.MusicGroupSubjectGoodsAndInfoDto;
 import com.ym.mec.biz.dal.dto.RegisterPayDto;
-import com.ym.mec.biz.dal.entity.Goods;
-import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
-import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
-import com.ym.mec.biz.dal.entity.StudentRegistration;
+import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.GoodsType;
 import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
+import com.ym.mec.biz.dal.enums.OrderTypeEnum;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -19,14 +18,12 @@ import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
-import java.util.Date;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 @RequestMapping("musicGroup")
 @Api(tags = "乐团服务")
@@ -47,7 +44,8 @@ public class MusicGroupController extends BaseController {
     private GoodsService goodsService;
     @Autowired
     private StudentPaymentOrderService studentPaymentOrderService;
-    @Autowired PayService payService;
+    @Autowired
+    PayService payService;
 
     @ApiOperation("获取学生所在乐团列表")
     @GetMapping(value = "/queryUserMusicGroups")
@@ -102,47 +100,143 @@ public class MusicGroupController extends BaseController {
             return failed("报名信息有误,请核查");
         }
 
-        BigDecimal amount = registerPayDto.getAmount();
+        StudentPaymentOrder ApplyOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, studentRegistration.getMusicGroupId().toString(), DealStatusEnum.SUCCESS);
+        if (ApplyOrder != null) {
+            return failed("您已支付成功,请勿重复支付");
+        }
+
+        //判断用户是否已存在订单
+        ApplyOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, studentRegistration.getMusicGroupId().toString(), DealStatusEnum.ING);
+        if (ApplyOrder != null) {
+            return failed(HttpStatus.CONTINUE, "您有待支付的订单");
+        }
 
+        BigDecimal amount = registerPayDto.getAmount(); //前端获取的价格
         BigDecimal orderAmount = new BigDecimal("0");
 
         //获取课程价格
         MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getSubjectId());
-        orderAmount.add(musicOneSubjectClassPlan.getFee());
+        BigDecimal courseFee = musicOneSubjectClassPlan.getFee();
+        orderAmount = orderAmount.add(courseFee);
 
 
         //乐器及打包辅件
-        if (registerPayDto.getGoodsGroupIds() != null) {
-            List<MusicGroupSubjectGoodsGroup> goodsGroups = musicGroupSubjectGoodsGroupService.findGoodsGroupByIds(registerPayDto.getGoodsGroupIds());
-            goodsGroups.forEach(goodsGroup -> {
-                //辅件价格
-                if (goodsGroup.getType().equals(GoodsType.ACCESSORIES)) {
-                    orderAmount.add(goodsGroup.getPrice());
-                    return;
+        List<MusicGroupSubjectGoodsGroup> goodsGroups = null;
+        if (registerPayDto.getGoodsGroupIds() != null && !registerPayDto.getGoodsGroupIds().equals("")) {
+            goodsGroups = musicGroupSubjectGoodsGroupService.findGoodsGroupByIds(registerPayDto.getGoodsGroupIds());
+            for (MusicGroupSubjectGoodsGroup goodsGroup : goodsGroups) {
+                orderAmount = orderAmount.add(goodsGroup.getPrice());
+                //团购乐器减免课程费用
+                if (goodsGroup.getType().equals(GoodsType.INSTRUMENT) && goodsGroup.getRemissionCourseFee() != null && musicOneSubjectClassPlan.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.GROUP)) {//团购
+                    orderAmount = orderAmount.subtract(goodsGroup.getRemissionCourseFee());
                 }
-                if (musicOneSubjectClassPlan.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.LEASE)) {//租赁
-                    orderAmount.add(musicOneSubjectClassPlan.getDepositFee());
-                } else if (musicOneSubjectClassPlan.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.GROUP)) {//团购
-                    orderAmount.add(goodsGroup.getPrice()).subtract(goodsGroup.getRemissionCourseFee());//团购减免课程费用
+            }
+        }
+
+        //单独辅件
+        List<Goods> goodsList = null;
+        if (registerPayDto.getGoodsIds() != null && !registerPayDto.getGoodsIds().equals("")) {
+            goodsList = goodsService.findGoodsByIds(registerPayDto.getGoodsIds());
+            for (Goods goods : goodsList) {
+                orderAmount = orderAmount.add(goods.getGroupPurchasePrice());
+            }
+        }
+
+        //单独教谱
+        List<Goods> otherGoodsList = null;
+        if (registerPayDto.getOtherGoodsIds() != null && !registerPayDto.getOtherGoodsIds().equals("")) {
+            otherGoodsList = goodsService.findGoodsByIds(registerPayDto.getOtherGoodsIds());
+            for (Goods goods : otherGoodsList) {
+                orderAmount = orderAmount.add(goods.getGroupPurchasePrice());
+            }
+        }
+        if (amount.compareTo(orderAmount) != 0) {
+            return failed("商品价格不符");
+        }
+
+
+        IdWorker idWorker = new IdWorker(0, 0);
+        String orderNo = idWorker.nextId();
+
+        Map payMap = payService.getPayMap(orderAmount, orderNo, "https://pay.dayaedu.com/api/yqpay/notify", "http://dev.dayaedu.com", "测试订单", "测试订单");
+
+        studentRegistrationService.addOrder(userId, amount, orderNo, "双乾", courseFee, goodsGroups, goodsList, otherGoodsList, studentRegistration.getMusicGroupId().toString());
+
+        return succeed(payMap);
+    }
+
+    @ApiOperation(value = "乐团报名重新支付")
+    @PostMapping("/rePay")
+    @ApiImplicitParams({@ApiImplicitParam(name = "registerPayDto", value = "支付信息", required = true, dataType = "Integer")})
+    public HttpResponseResult rePay(@RequestBody RegisterPayDto registerPayDto) throws Exception {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        Integer userId = sysUser.getId();
+        StudentRegistration studentRegistration = studentRegistrationService.get(registerPayDto.getRegisterId().longValue());
+        if (!studentRegistration.getUserId().equals(userId)) {
+            return failed("报名信息有误,请核查");
+        }
+
+        StudentPaymentOrder ApplyOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, studentRegistration.getMusicGroupId().toString(), DealStatusEnum.SUCCESS);
+        if (ApplyOrder != null) {
+            return failed("您已支付成功,请勿重复支付");
+        }
+
+        //判断用户是否已存在订单
+        ApplyOrder = studentPaymentOrderService.findMusicGroupApplyOrderByStatus(userId, studentRegistration.getMusicGroupId().toString(), DealStatusEnum.ING);
+        if (ApplyOrder == null) {
+            return failed(HttpStatus.CONTINUE, "没有支付中的订单,请勿非法请求");
+        }
+
+        BigDecimal amount = registerPayDto.getAmount(); //前端获取的价格
+        BigDecimal orderAmount = new BigDecimal("0");
+
+        //获取课程价格
+        MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getSubjectId());
+        BigDecimal courseFee = musicOneSubjectClassPlan.getFee();
+        orderAmount = orderAmount.add(courseFee);
+
+
+        //乐器及打包辅件
+        List<MusicGroupSubjectGoodsGroup> goodsGroups = null;
+        if (registerPayDto.getGoodsGroupIds() != null && !registerPayDto.getGoodsGroupIds().equals("")) {
+            goodsGroups = musicGroupSubjectGoodsGroupService.findGoodsGroupByIds(registerPayDto.getGoodsGroupIds());
+            for (MusicGroupSubjectGoodsGroup goodsGroup : goodsGroups) {
+                orderAmount = orderAmount.add(goodsGroup.getPrice());
+                //团购乐器减免课程费用
+                if (goodsGroup.getType().equals(GoodsType.INSTRUMENT) && goodsGroup.getRemissionCourseFee() != null && musicOneSubjectClassPlan.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.GROUP)) {//团购
+                    orderAmount = orderAmount.subtract(goodsGroup.getRemissionCourseFee());
                 }
-            });
+            }
         }
 
         //单独辅件
-        if (registerPayDto.getGoodsIds() != null) {
-            List<Goods> goodsList = goodsService.findGoodsByIds(registerPayDto.getGoodsIds());
-            goodsList.forEach(goods -> {
-                orderAmount.add(goods.getGroupPurchasePrice());
-            });
+        List<Goods> goodsList = null;
+        if (registerPayDto.getGoodsIds() != null && !registerPayDto.getGoodsIds().equals("")) {
+            goodsList = goodsService.findGoodsByIds(registerPayDto.getGoodsIds());
+            for (Goods goods : goodsList) {
+                orderAmount = orderAmount.add(goods.getGroupPurchasePrice());
+            }
+        }
+
+        //单独教谱
+        List<Goods> otherGoodsList = null;
+        if (registerPayDto.getOtherGoodsIds() != null && !registerPayDto.getOtherGoodsIds().equals("")) {
+            otherGoodsList = goodsService.findGoodsByIds(registerPayDto.getOtherGoodsIds());
+            for (Goods goods : otherGoodsList) {
+                orderAmount = orderAmount.add(goods.getGroupPurchasePrice());
+            }
         }
         if (amount.compareTo(orderAmount) != 0) {
             return failed("商品价格不符");
         }
 
+
         IdWorker idWorker = new IdWorker(0, 0);
         String orderNo = idWorker.nextId();
 
-        Map payMap = payService.getPayMap(orderAmount,orderNo,"https://pay.dayaedu.com/yqpay/notify","http://dev.dayaedu.com","测试订单","测试订单");
+        Map payMap = payService.getPayMap(orderAmount, orderNo, "https://pay.dayaedu.com/api/yqpay/notify", "http://dev.dayaedu.com", "测试订单", "测试订单");
+
+        studentRegistrationService.addOrder(userId, amount, orderNo, "双乾", courseFee, goodsGroups, goodsList, otherGoodsList, studentRegistration.getMusicGroupId().toString());
 
         return succeed(payMap);
     }
@@ -150,8 +244,18 @@ public class MusicGroupController extends BaseController {
     @GetMapping("/test")
     public Object test() throws Exception {
 
+        IdWorker idWorker = new IdWorker(0, 0);
+        String orderNo = idWorker.nextId();
         BigDecimal amount = new BigDecimal("200");
-        Map map = payService.getPayMap(amount,"201910113456789386903","https://pay.dayaedu.com/notify","https://baodiu.com","测试订单","测试订单");
+        Map map = payService.getPayMap(amount, orderNo, "https://pay.dayaedu.com/notify", "https://baodiu.com", "测试订单", "测试订单");
         return succeed(map);
     }
+
+    @ApiOperation(value = "订单状态查询")
+    @GetMapping("/getOrderStatus")
+    @ApiImplicitParams({@ApiImplicitParam(name = "orderNo", value = "订单号", required = true, dataType = "String")})
+    public HttpResponseResult getOrderStatus(String orderNo) {
+        StudentPaymentOrder order = studentPaymentOrderService.findOrderByOrderNo(orderNo);
+        return succeed(order);
+    }
 }

+ 55 - 47
mec-student/src/main/java/com/ym/mec/student/controller/StudentCourseScheduleController.java

@@ -1,21 +1,28 @@
 package com.ym.mec.student.controller;
 
-import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
-import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
-import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
-import com.ym.mec.biz.service.CourseScheduleService;
-import com.ym.mec.biz.service.StudentAttendanceService;
-import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.MediaType;
-import org.springframework.web.bind.annotation.*;
 
 import java.util.Date;
 
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
+import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
+import com.ym.mec.biz.service.CourseScheduleService;
+import com.ym.mec.biz.service.StudentAttendanceService;
+import com.ym.mec.common.controller.BaseController;
+
 /**
  * @Author Joburgess
  * @Date 2019/9/24
@@ -25,49 +32,50 @@ import java.util.Date;
 @RestController
 public class StudentCourseScheduleController extends BaseController {
 
-    @Autowired
-    private CourseScheduleService scheduleService;
-    @Autowired
-    private StudentAttendanceService studentAttendanceService;
+	@Autowired
+	private CourseScheduleService scheduleService;
+
+	@Autowired
+	private StudentAttendanceService studentAttendanceService;
 
-    @ApiOperation(value = "根据月份获取乐团在该月有课的日期")
-    @GetMapping("/getCourseScheduleDateByMonth")
-    public Object getCourseScheduleDateByMonth(@ApiParam(value = "月份", required = true) @RequestParam Date month,
-                                               @ApiParam(value = "未上课", required = true) Integer isAttend) {
-        return succeed(scheduleService.getCourseScheduleDateByStudent(month,isAttend));
-    }
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
 
-    @ApiOperation(value = "根据日期获取当日排课")
-    @GetMapping("/getCourseSchedulesWithDate")
-    public Object getCourseSchedulesWithDate(@ApiParam(value = "日期", required = true) Date date){
-        return succeed(scheduleService.getStudentCourseSchedulesWithDate(date));
-    }
+	@ApiOperation(value = "根据月份获取乐团在该月有课的日期")
+	@GetMapping("/getCourseScheduleDateByMonth")
+	public Object getCourseScheduleDateByMonth(@ApiParam(value = "月份", required = true) @RequestParam Date month,
+			@ApiParam(value = "未上课", required = true) Integer isAttend) {
+		return succeed(scheduleService.getCourseScheduleDateByStudent(month, isAttend));
+	}
 
-    @ApiOperation(value = "课时调整")
-    @PostMapping(value = "/classStartDateAdjust",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
-    public Object classStartDateAdjust(ClassDateAdjustDto classDateAdjustDto){
-        scheduleService.classStartDateAdjust(classDateAdjustDto);
-        return succeed();
-    }
+	@ApiOperation(value = "根据日期获取当日排课")
+	@GetMapping("/getCourseSchedulesWithDate")
+	public Object getCourseSchedulesWithDate(@ApiParam(value = "日期", required = true) Date date) {
+		return succeed(scheduleService.getStudentCourseSchedulesWithDate(date));
+	}
 
-    @ApiOperation(value = "课时交换")
-    @GetMapping(value = "/courseSwap",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
-    public Object courseSwap(Long courseScheduleId1,Long courseScheduleId2){
-        scheduleService.courseSwap(courseScheduleId1,courseScheduleId2);
-        return succeed();
-    }
+	@ApiOperation(value = "上课记录")
+	@GetMapping(value = "/findStudentCourseScheduleRecords")
+	public Object findStudentCourseScheduleRecords(StudentCourseScheduleRecordQueryInfo queryInfo) {
+		return succeed(scheduleService.findStudentCourseScheduleRecords(queryInfo));
+	}
 
-    @ApiOperation(value = "上课记录")
-    @GetMapping(value = "/findStudentCourseScheduleRecords")
-    public Object findStudentCourseScheduleRecords(StudentCourseScheduleRecordQueryInfo queryInfo){
-        return succeed(scheduleService.findStudentCourseScheduleRecords(queryInfo));
-    }
+	@ApiModelProperty(value = "课程投诉")
+	@PostMapping("/courseScheduleCommplaint")
+	public Object courseScheduleCommplaint(CourseScheduleComplaints courseScheduleComplaints) {
+		scheduleService.courseScheduleCommplaint(courseScheduleComplaints);
+		return succeed();
+	}
 
-    @ApiModelProperty(value = "课程投诉")
-    @PostMapping("/courseScheduleCommplaint")
-    public Object courseScheduleCommplaint(CourseScheduleComplaints courseScheduleComplaints){
-        scheduleService.courseScheduleCommplaint(courseScheduleComplaints);
-        return succeed();
-    }
+	@ApiModelProperty(value = "请假")
+	@PostMapping("/leave")
+	public Object leave(long courseScheduleId, String reason) {
+		SysUser user = sysUserFeignService.queryUserInfo();
+		if (user == null) {
+			return failed(HttpStatus.FORBIDDEN, "请登录");
+		}
+		studentAttendanceService.leave(user.getId(), courseScheduleId, reason);
+		return succeed();
+	}
 
 }

+ 2 - 3
mec-student/src/main/java/com/ym/mec/student/controller/StudentVipGroupController.java

@@ -8,7 +8,6 @@ import com.ym.mec.biz.service.SubjectService;
 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.*;
@@ -60,14 +59,14 @@ public class StudentVipGroupController extends BaseController {
         return succeed(vipGroupService.getVipGroupShowDetail(vipGroupId));
     }
 
-    @ApiModelProperty(value = "vip课购买")
+    @ApiOperation(value = "vip课购买")
     @PostMapping("/buyVipGroup")
     public Object buyVipGroup(VipGroupBuyParamsDto vipGroupBuyParams){
         vipGroupService.buyVipGroup(vipGroupBuyParams);
         return succeed();
     }
 
-    @ApiModelProperty(value = "vip课退课")
+    @ApiOperation(value = "vip课退课")
     @PostMapping("/applyRefund")
     public Object applyRefund(Long vipGroupId){
         vipGroupService.applyRefund(vipGroupId,null);

+ 17 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherCourseScheduleController.java

@@ -1,5 +1,6 @@
 package com.ym.mec.teacher.controller;
 
+import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
 import com.ym.mec.biz.dal.page.StudentAttendanceQueryInfo;
 import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.StudentAttendanceService;
@@ -8,6 +9,7 @@ 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.MediaType;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.Date;
@@ -50,4 +52,19 @@ public class TeacherCourseScheduleController extends BaseController {
         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){
+        scheduleService.classStartDateAdjust(classDateAdjustDto);
+        return succeed();
+    }
+
+    @ApiOperation(value = "课时交换")
+    @GetMapping(value = "/courseSwap",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+    public Object courseSwap(Long courseScheduleId1,Long courseScheduleId2){
+        scheduleService.courseSwap(courseScheduleId1,courseScheduleId2);
+        return succeed();
+    }
+
 }

+ 6 - 0
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupActivityController.java

@@ -4,11 +4,14 @@ import com.ym.mec.biz.dal.dto.VipGroupActivityAddDto;
 import com.ym.mec.biz.dal.page.VipGroupActivityQueryInfo;
 import com.ym.mec.biz.service.VipGroupActivityService;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.exception.BizException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Objects;
+
 /**
  * @Author Joburgess
  * @Date 2019/10/1
@@ -45,6 +48,9 @@ public class VipGroupActivityController extends BaseController {
     @ApiOperation(value = "删除活动方案")
     @PostMapping("/delete")
     public Object delete(Long id){
+        if(Objects.isNull(id)){
+            throw new BizException("请指定活动编号!");
+        }
         vipGroupActivityService.delete(id.intValue());
         return succeed();
     }

+ 3 - 3
mec-workflow/src/main/resources/flows/viprefund.snaker

@@ -4,13 +4,13 @@
 <transition g="" name="transition1" offset="0,0" to="apply"/>
 </start>
 <end displayName="end1" layout="785,160,-1,-1" name="end1"/>
-<task assignee="${student}" autoExecute="Y" displayName="学生申请" layout="280,158,-1,-1" name="apply" performType="ANY" taskType="Major">
+<task assignee="student" autoExecute="Y" displayName="学生申请" layout="280,158,-1,-1" name="apply" performType="ANY" taskType="Major">
 <transition g="" name="transition2" offset="0,0" to="task1"/>
 </task>
-<task assignee="${eduTeacher}" autoExecute="Y" displayName="教务老师审批" layout="425,157,-1,-1" name="task1" performType="ANY" taskType="Major">
+<task assignee="eduTeacher" autoExecute="Y" displayName="教务老师审批" layout="425,157,-1,-1" name="task1" performType="ANY" taskType="Major">
 <transition g="" name="transition3" offset="0,0" to="task2"/>
 </task>
-<task assignee="${deptManager}" autoExecute="Y" displayName="分部经理审批" layout="598,158,-1,-1" name="task2" performType="ANY" taskType="Major">
+<task assignee="deptManager" autoExecute="Y" displayName="分部经理审批" layout="598,158,-1,-1" name="task2" performType="ANY" taskType="Major">
 <transition g="" name="transition4" offset="0,0" to="end1"/>
 </task>
 </process>