Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/children_day' into children_day

# Conflicts:
#	mec-biz/src/main/java/com/ym/mec/biz/service/impl/ChildrenDayReserveServiceImpl.java
zouxuan 4 anni fa
parent
commit
aad22c53d9
37 ha cambiato i file con 1245 aggiunte e 63 eliminazioni
  1. 17 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ChildrenDayDegreeDetailDao.java
  2. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ChildrenDayDegreeInfoDao.java
  3. 32 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ChildrenDayDetailDto.java
  4. 22 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/DegreePayDto.java
  5. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupSubjectGoodsAndInfoDto.java
  6. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/RegisterPayDto.java
  7. 220 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ChildrenDayDegreeInfo.java
  8. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/OrganizationCloudTeacherFee.java
  9. 16 4
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/CourseViewTypeEnum.java
  10. 3 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/OrderDetailTypeEnum.java
  11. 47 0
      mec-biz/src/main/java/com/ym/mec/biz/service/ChildrenDayDegreeDetailService.java
  12. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/service/ChildrenDayReserveService.java
  13. 0 5
      mec-biz/src/main/java/com/ym/mec/biz/service/ContractService.java
  14. 3 2
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java
  15. 123 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ChildrenDayDegreeDetailServiceImpl.java
  16. 119 8
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ChildrenDayReserveServiceImpl.java
  17. 3 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CloudTeacherOrderServiceImpl.java
  18. 9 5
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ContractServiceImpl.java
  19. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleStudentPaymentServiceImpl.java
  20. 4 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExportServiceImpl.java
  21. 10 10
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  22. 6 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupSubjectPlanServiceImpl.java
  23. 4 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentAttendanceServiceImpl.java
  24. 4 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java
  25. 12 9
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  26. 209 0
      mec-biz/src/main/resources/config/contracts/product5.ftl
  27. 18 0
      mec-biz/src/main/resources/config/mybatis/ChildrenDayDegreeDetailDao.xml
  28. 106 0
      mec-biz/src/main/resources/config/mybatis/ChildrenDayDegreeInfoDao.xml
  29. 6 2
      mec-biz/src/main/resources/config/mybatis/OrganizationCloudTeacherFeeMapper.xml
  30. 27 3
      mec-biz/src/main/resources/config/mybatis/StudentPreRegistrationMapper.xml
  31. 2 2
      mec-biz/src/main/resources/config/mybatis/SysUserCashAccountDetailMapper.xml
  32. 2 2
      mec-biz/src/main/resources/config/mybatis/SysUserCoursesAccountDetailMapper.xml
  33. 51 0
      mec-student/src/main/java/com/ym/mec/student/controller/ChildrenDayDegreeDetailController.java
  34. 1 1
      mec-web/src/main/java/com/ym/mec/web/config/ResourceServerConfig.java
  35. 5 0
      mec-web/src/main/java/com/ym/mec/web/controller/StudentRegistrationController.java
  36. 82 0
      mec-web/src/main/java/com/ym/mec/web/controller/education/EduStudentRegistrationController.java
  37. 27 0
      mec-web/src/main/java/com/ym/mec/web/controller/education/EduSubjectController.java

+ 17 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ChildrenDayDegreeDetailDao.java

@@ -15,4 +15,21 @@ public interface ChildrenDayDegreeDetailDao extends BaseDAO<Integer, ChildrenDay
      * @return
      */
     List<ChildrenDayDegreeDetail> getByUserIdAndStatus(@Param("userId") Integer userId, @Param("status") Integer status);
+
+    /**
+     * 批量插入购买详情
+     *
+     * @param details
+     * @return
+     */
+    int batchAdd(@Param("details") List<ChildrenDayDegreeDetail> details);
+
+    /**
+     * 跟新状态信息
+     *
+     * @param orderId
+     * @param status
+     * @return
+     */
+    int updateStatus(@Param("orderId") Long orderId, @Param("status") Integer status);
 }

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

@@ -0,0 +1,8 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.ChildrenDayDegreeInfo;
+import com.ym.mec.common.dal.BaseDAO;
+
+public interface ChildrenDayDegreeInfoDao extends BaseDAO<Integer,ChildrenDayDegreeInfo> {
+
+}

+ 32 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ChildrenDayDetailDto.java

@@ -0,0 +1,32 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.entity.ChildrenDayDegreeDetail;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+public class ChildrenDayDetailDto {
+
+    @ApiModelProperty(value = "用户信息", required = false)
+    private SysUser user;
+
+    @ApiModelProperty(value = "购买信息详情", required = false)
+    private List<ChildrenDayDegreeDetail> childrenDayDegreeDetails;
+
+    public SysUser getUser() {
+        return user;
+    }
+
+    public void setUser(SysUser user) {
+        this.user = user;
+    }
+
+    public List<ChildrenDayDegreeDetail> getChildrenDayDegreeDetails() {
+        return childrenDayDegreeDetails;
+    }
+
+    public void setChildrenDayDegreeDetails(List<ChildrenDayDegreeDetail> childrenDayDegreeDetails) {
+        this.childrenDayDegreeDetails = childrenDayDegreeDetails;
+    }
+}

+ 22 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/DegreePayDto.java

@@ -20,10 +20,10 @@ public class DegreePayDto {
     private Integer theoryLevel;
 
     @ApiModelProperty(value = "vip 1v1")
-    private boolean vip1v1=false;
+    private boolean vip1v1 = false;
 
     @ApiModelProperty(value = "vip 1v2")
-    private Boolean vip1v2=false;
+    private Boolean vip1v2 = false;
 
     @ApiModelProperty(value = "乐理课程")
     private Boolean theoryCourse = false;
@@ -39,6 +39,10 @@ public class DegreePayDto {
 
     private SysUser user;
 
+    private Long orderId;
+
+    private Integer reserveId;
+
     public Integer getSubject() {
         return subject;
     }
@@ -134,4 +138,20 @@ public class DegreePayDto {
     public void setUser(SysUser user) {
         this.user = user;
     }
+
+    public Long getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(Long orderId) {
+        this.orderId = orderId;
+    }
+
+    public Integer getReserveId() {
+        return reserveId;
+    }
+
+    public void setReserveId(Integer reserveId) {
+        this.reserveId = reserveId;
+    }
 }

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

@@ -36,6 +36,9 @@ public class MusicGroupSubjectGoodsAndInfoDto {
     @ApiModelProperty(value = "乐团云教练价格",required = false)
     private BigDecimal cloudTeacherFee;
 
+    @ApiModelProperty(value = "乐团云教练+价格",required = false)
+    private BigDecimal cloudTeacherPlusFee;
+
     public Map getCourseScheduleInfo() {
         return CourseScheduleInfo;
     }
@@ -99,4 +102,12 @@ public class MusicGroupSubjectGoodsAndInfoDto {
     public void setCloudTeacherFee(BigDecimal cloudTeacherFee) {
         this.cloudTeacherFee = cloudTeacherFee;
     }
+
+    public BigDecimal getCloudTeacherPlusFee() {
+        return cloudTeacherPlusFee;
+    }
+
+    public void setCloudTeacherPlusFee(BigDecimal cloudTeacherPlusFee) {
+        this.cloudTeacherPlusFee = cloudTeacherPlusFee;
+    }
 }

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

@@ -38,6 +38,9 @@ public class RegisterPayDto {
     @ApiModelProperty(value = "购买云教练",required = false)
     private Boolean buyCloudTeacher= false;
 
+    @ApiModelProperty(value = "购买云教练+",required = false)
+    private Boolean buyCloudTeacherPlus= false;
+
     public Integer getRegisterId() {
         return registerId;
     }
@@ -125,4 +128,12 @@ public class RegisterPayDto {
     public void setBuyCloudTeacher(Boolean buyCloudTeacher) {
         this.buyCloudTeacher = buyCloudTeacher;
     }
+
+    public Boolean getBuyCloudTeacherPlus() {
+        return buyCloudTeacherPlus;
+    }
+
+    public void setBuyCloudTeacherPlus(Boolean buyCloudTeacherPlus) {
+        this.buyCloudTeacherPlus = buyCloudTeacherPlus;
+    }
 }

+ 220 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ChildrenDayDegreeInfo.java

@@ -0,0 +1,220 @@
+package com.ym.mec.biz.dal.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.math.BigDecimal;
+import java.util.Date;
+
+@ApiModel(value="com-domain-ChildrenDayDegreeInfo")
+public class ChildrenDayDegreeInfo {
+    @ApiModelProperty(value="")
+    private Integer id;
+
+    /**
+    * 预约id
+    */
+    @ApiModelProperty(value="预约id")
+    private Integer reserveId;
+
+    /**
+    * 用户id
+    */
+    @ApiModelProperty(value="用户id")
+    private Integer userId;
+
+    /**
+    * 声部id
+    */
+    @ApiModelProperty(value="声部id")
+    private Integer subjectId;
+
+    /**
+    * 器乐等级
+    */
+    @ApiModelProperty(value="器乐等级")
+    private Integer gradeLevel;
+
+    /**
+    * 器乐支付金额
+    */
+    @ApiModelProperty(value="器乐支付金额")
+    private BigDecimal gradePrice;
+
+    /**
+    * 乐理等级
+    */
+    @ApiModelProperty(value="乐理等级")
+    private Integer theoryLevel;
+
+    /**
+    * 乐理支付金额
+    */
+    @ApiModelProperty(value="乐理支付金额")
+    private BigDecimal theoryPrice;
+
+    /**
+    * vip 1v1支付价格
+    */
+    @ApiModelProperty(value="vip 1v1支付价格")
+    private BigDecimal vip1v1Price;
+
+    /**
+    * vip 1v2支付价格
+    */
+    @ApiModelProperty(value="vip 1v2支付价格")
+    private BigDecimal vip1v2Price;
+
+    /**
+    * 乐理课支付价格
+    */
+    @ApiModelProperty(value="乐理课支付价格")
+    private BigDecimal theoryCoursePrice;
+
+    /**
+    * 支付总金额
+    */
+    @ApiModelProperty(value="支付总金额")
+    private BigDecimal totalAmount;
+
+    @ApiModelProperty(value="")
+    private Date createTime;
+
+    @ApiModelProperty(value="")
+    private Date updateTime;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getReserveId() {
+        return reserveId;
+    }
+
+    public void setReserveId(Integer reserveId) {
+        this.reserveId = reserveId;
+    }
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public Integer getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Integer subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public Integer getGradeLevel() {
+        return gradeLevel;
+    }
+
+    public void setGradeLevel(Integer gradeLevel) {
+        this.gradeLevel = gradeLevel;
+    }
+
+    public BigDecimal getGradePrice() {
+        return gradePrice;
+    }
+
+    public void setGradePrice(BigDecimal gradePrice) {
+        this.gradePrice = gradePrice;
+    }
+
+    public Integer getTheoryLevel() {
+        return theoryLevel;
+    }
+
+    public void setTheoryLevel(Integer theoryLevel) {
+        this.theoryLevel = theoryLevel;
+    }
+
+    public BigDecimal getTheoryPrice() {
+        return theoryPrice;
+    }
+
+    public void setTheoryPrice(BigDecimal theoryPrice) {
+        this.theoryPrice = theoryPrice;
+    }
+
+    public BigDecimal getVip1v1Price() {
+        return vip1v1Price;
+    }
+
+    public void setVip1v1Price(BigDecimal vip1v1Price) {
+        this.vip1v1Price = vip1v1Price;
+    }
+
+    public BigDecimal getVip1v2Price() {
+        return vip1v2Price;
+    }
+
+    public void setVip1v2Price(BigDecimal vip1v2Price) {
+        this.vip1v2Price = vip1v2Price;
+    }
+
+    public BigDecimal getTheoryCoursePrice() {
+        return theoryCoursePrice;
+    }
+
+    public void setTheoryCoursePrice(BigDecimal theoryCoursePrice) {
+        this.theoryCoursePrice = theoryCoursePrice;
+    }
+
+    public BigDecimal getTotalAmount() {
+        return totalAmount;
+    }
+
+    public void setTotalAmount(BigDecimal totalAmount) {
+        this.totalAmount = totalAmount;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", reserveId=").append(reserveId);
+        sb.append(", userId=").append(userId);
+        sb.append(", subjectId=").append(subjectId);
+        sb.append(", gradeLevel=").append(gradeLevel);
+        sb.append(", gradePrice=").append(gradePrice);
+        sb.append(", theoryLevel=").append(theoryLevel);
+        sb.append(", theoryPrice=").append(theoryPrice);
+        sb.append(", vip1v1Price=").append(vip1v1Price);
+        sb.append(", vip1v2Price=").append(vip1v2Price);
+        sb.append(", theoryCoursePrice=").append(theoryCoursePrice);
+        sb.append(", totalAmount=").append(totalAmount);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append("]");
+        return sb.toString();
+    }
+}

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

@@ -16,6 +16,9 @@ public class OrganizationCloudTeacherFee {
     @ApiModelProperty(value = "云教练价格")
     private BigDecimal price;
 
+    @ApiModelProperty(value = "云教练+价格")
+    private BigDecimal plusPrice;
+
     private Date createTime;
 
     private Date updateTime;
@@ -39,6 +42,14 @@ public class OrganizationCloudTeacherFee {
         this.price = price;
     }
 
+    public BigDecimal getPlusPrice() {
+        return plusPrice;
+    }
+
+    public void setPlusPrice(BigDecimal plusPrice) {
+        this.plusPrice = plusPrice;
+    }
+
     public Date getCreateTime() {
         return createTime;
     }

+ 16 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/CourseViewTypeEnum.java

@@ -3,17 +3,21 @@ package com.ym.mec.biz.dal.enums;
 import com.ym.mec.common.enums.BaseEnum;
 
 public enum CourseViewTypeEnum implements BaseEnum<Integer, CourseViewTypeEnum> {
-    COURSE_lIST(0, "课程详情"),
-    AMR(1, "器乐练习系统"),
-    CLOUD_TEACHER(2, "云教练收费");
+    COURSE_lIST(0, "课程详情", 2),
+    AMR(1, "器乐练习系统", 4),
+    CLOUD_TEACHER(2, "云教练收费", 4),
+    CLOUD_TEACHER_PLUS(3, "云教练+收费", 5);
 
     private Integer code;
 
     private String msg;
 
-    CourseViewTypeEnum(Integer code, String msg) {
+    private Integer contractVersion;
+
+    CourseViewTypeEnum(Integer code, String msg, Integer contractVersion) {
         this.code = code;
         this.msg = msg;
+        this.contractVersion = contractVersion;
     }
 
     public void setCode(Integer code) {
@@ -32,4 +36,12 @@ public enum CourseViewTypeEnum implements BaseEnum<Integer, CourseViewTypeEnum>
     public Integer getCode() {
         return this.code;
     }
+
+    public Integer getContractVersion() {
+        return contractVersion;
+    }
+
+    public void setContractVersion(Integer contractVersion) {
+        this.contractVersion = contractVersion;
+    }
 }

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

@@ -26,7 +26,9 @@ public enum OrderDetailTypeEnum implements BaseEnum<String, OrderDetailTypeEnum>
     CLASSROOM("CLASSROOM", "课堂课"),
 	DEGREE_REGISTRATION("DEGREE_REGISTRATION", "考级报名"),
     MAINTENANCE("MAINTENANCE","乐保服务"),
-    CLOUD_TEACHER("CLOUD_TEACHER","云教练");
+    CLOUD_TEACHER("CLOUD_TEACHER","云教练"),
+    CLOUD_TEACHER_PLUS("CLOUD_TEACHER_PLUS","云教练+"),
+    THEORY_COURSE("THEORY_COURSE", "乐理课");
 
     private String code;
 

+ 47 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/ChildrenDayDegreeDetailService.java

@@ -1,9 +1,12 @@
 package com.ym.mec.biz.service;
 
 
+import com.ym.mec.biz.dal.dto.DegreePayDto;
 import com.ym.mec.biz.dal.entity.ChildrenDayDegreeDetail;
+import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
 import com.ym.mec.common.service.BaseService;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 public interface ChildrenDayDegreeDetailService extends BaseService<Integer, ChildrenDayDegreeDetail> {
@@ -16,4 +19,48 @@ public interface ChildrenDayDegreeDetailService extends BaseService<Integer, Chi
      */
     List<ChildrenDayDegreeDetail> getByUserIdAndStatus(Integer userId, Integer status);
 
+    /**
+     * 增加考级支付详情
+     *
+     * @param degreePayDto
+     * @param gradeFee
+     * @param theoryLevelFee
+     * @param vip1v1Fee
+     * @param vip1v2Fee
+     * @param theoryCourseFee
+     * @return
+     */
+    List<ChildrenDayDegreeDetail> addDegreeDetails(DegreePayDto degreePayDto, BigDecimal gradeFee, BigDecimal theoryLevelFee, BigDecimal vip1v1Fee, BigDecimal vip1v2Fee, BigDecimal theoryCourseFee);
+
+    /**
+     * 增加考级订单详情
+     *
+     * @param degreePayDto
+     * @param gradeFee
+     * @param theoryLevelFee
+     * @param vip1v1Fee
+     * @param vip1v2Fee
+     * @param theoryCourseFee
+     * @return
+     */
+    List<StudentPaymentOrderDetail> addOrderDetails(DegreePayDto degreePayDto, BigDecimal gradeFee, BigDecimal theoryLevelFee, BigDecimal vip1v1Fee, BigDecimal vip1v2Fee, BigDecimal theoryCourseFee);
+
+    /**
+     * 获取用户6.1考级报名详情
+     *
+     * @param userId
+     * @return
+     */
+    List<ChildrenDayDegreeDetail> getUserDegreeInfo(Integer userId);
+
+
+    /**
+     * 更新状态信息
+     *
+     * @param orderId
+     * @param status
+     * @return
+     */
+    Integer updateStatus(Long orderId, Integer status);
+
 }

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

@@ -4,6 +4,7 @@ package com.ym.mec.biz.service;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.ChildrenDayReserve;
+import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.page.ChildrenReserveQueryInfo;
 import com.ym.mec.common.page.PageInfo;
@@ -35,6 +36,7 @@ public interface ChildrenDayReserveService extends BaseService<Integer, Children
 
     /**
      * 获取活动的费用信息
+     *
      * @param organId
      * @return
      */
@@ -42,6 +44,7 @@ public interface ChildrenDayReserveService extends BaseService<Integer, Children
 
     /**
      * 获取后台考级活动详情列表
+     *
      * @param queryInfo
      * @return
      */
@@ -54,4 +57,12 @@ public interface ChildrenDayReserveService extends BaseService<Integer, Children
      * @throws Exception
      */
     Map pay(DegreePayDto degreePayDto) throws Exception;
+
+    /**
+     * 支付回调处理
+     *
+     * @param studentPaymentOrder
+     * @return
+     */
+    Boolean orderCallback(StudentPaymentOrder studentPaymentOrder);
 }

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

@@ -108,11 +108,6 @@ public interface ContractService {
 	 */
 	boolean transferPracticeCoursesContract(Integer userId, int courseSectionNum, Date startDate, Date endDate, BigDecimal fee);
 
-	//课程协议版本
-	int COURSE_CONTRACT_VERSION = 2;
-	//AMR协议版本
-	int AMR_CONTRACT_VERSION = 4;
-
 	/**
 	 * 传递产品协议
 	 * @param userId

+ 3 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java

@@ -95,12 +95,13 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
      * @param newCourses
      * @param buyMaintenance
      * @param buyCloudTeacher
+     * @param buyCloudTeacherPlus
      * @return
      * @throws Exception
      */
     StudentPaymentOrder addOrder(StudentRegistration studentRegistration, BigDecimal amount, String orderNo, String paymentChannel, BigDecimal courseFee,
                                  List<MusicGroupSubjectGoodsGroup> goodsGroups, BigDecimal remitFee, BigDecimal courseRemitFee,
-                                 List<MusicGroupPaymentCalenderCourseSettings> newCourses, Boolean buyMaintenance, Boolean buyCloudTeacher) throws Exception;
+                                 List<MusicGroupPaymentCalenderCourseSettings> newCourses, Boolean buyMaintenance, Boolean buyCloudTeacher, Boolean buyCloudTeacherPlus) throws Exception;
 
     /**
      * 学生注册缴费重新下订单
@@ -326,7 +327,7 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
      * @return boolean
      */
     BigDecimal updateUserSurplusCourseFee(Integer userId, String musicGroupId, BigDecimal amount, String memo, Integer operatorId);
-    
+
     /**
      * 查询指定学生的乐团信息
      * @param userId

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

@@ -1,19 +1,28 @@
 package com.ym.mec.biz.service.impl;
 
 import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.dto.DegreePayDto;
 import com.ym.mec.biz.dal.entity.ChildrenDayDegreeDetail;
+import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
+import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
 import com.ym.mec.biz.service.ChildrenDayDegreeDetailService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 @Service
 public class ChildrenDayDegreeDetailServiceImpl extends BaseServiceImpl<Integer, ChildrenDayDegreeDetail> implements ChildrenDayDegreeDetailService {
     @Autowired
     private ChildrenDayDegreeDetailDao childrenDayDegreeDetailDao;
+    @Autowired
+    private StudentPaymentOrderDetailDao studentPaymentOrderDetailDao;
 
     @Override
     public BaseDAO<Integer, ChildrenDayDegreeDetail> getDAO() {
@@ -21,7 +30,120 @@ public class ChildrenDayDegreeDetailServiceImpl extends BaseServiceImpl<Integer,
     }
 
     @Override
-    public List<ChildrenDayDegreeDetail> getByUserIdAndStatus(Integer userId,Integer status) {
+    public List<ChildrenDayDegreeDetail> getByUserIdAndStatus(Integer userId, Integer status) {
         return childrenDayDegreeDetailDao.getByUserIdAndStatus(userId, status);
     }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public List<ChildrenDayDegreeDetail> addDegreeDetails(DegreePayDto degreePayDto, BigDecimal gradeFee, BigDecimal theoryLevelFee, BigDecimal vip1v1Fee, BigDecimal vip1v2Fee, BigDecimal theoryCourseFee) {
+        List<ChildrenDayDegreeDetail> childrenDayDegreeDetails = new ArrayList<>();
+        if (degreePayDto.getMusicGradeLevel() != null) {
+            ChildrenDayDegreeDetail childrenDayDegreeDetail = new ChildrenDayDegreeDetail();
+            childrenDayDegreeDetail.setReserveId(degreePayDto.getReserveId());
+            childrenDayDegreeDetail.setUserId(degreePayDto.getUserId());
+            childrenDayDegreeDetail.setType(1);
+            childrenDayDegreeDetail.setSubjectId(degreePayDto.getSubject());
+            childrenDayDegreeDetail.setLevel(degreePayDto.getMusicGradeLevel());
+            childrenDayDegreeDetail.setPrice(gradeFee);
+            childrenDayDegreeDetail.setStatus(1);
+            childrenDayDegreeDetail.setOrderId(degreePayDto.getOrderId());
+            childrenDayDegreeDetails.add(childrenDayDegreeDetail);
+        }
+        if (degreePayDto.getTheoryLevel() != null) {
+            ChildrenDayDegreeDetail childrenDayDegreeDetail = new ChildrenDayDegreeDetail();
+            childrenDayDegreeDetail.setReserveId(degreePayDto.getReserveId());
+            childrenDayDegreeDetail.setUserId(degreePayDto.getUserId());
+            childrenDayDegreeDetail.setType(2);
+            childrenDayDegreeDetail.setLevel(degreePayDto.getTheoryLevel());
+            childrenDayDegreeDetail.setPrice(theoryLevelFee);
+            childrenDayDegreeDetail.setStatus(1);
+            childrenDayDegreeDetail.setOrderId(degreePayDto.getOrderId());
+            childrenDayDegreeDetails.add(childrenDayDegreeDetail);
+        }
+        if (degreePayDto.getVip1v1()) {
+            ChildrenDayDegreeDetail childrenDayDegreeDetail = new ChildrenDayDegreeDetail();
+            childrenDayDegreeDetail.setReserveId(degreePayDto.getReserveId());
+            childrenDayDegreeDetail.setUserId(degreePayDto.getUserId());
+            childrenDayDegreeDetail.setType(3);
+            childrenDayDegreeDetail.setPrice(vip1v1Fee);
+            childrenDayDegreeDetail.setStatus(1);
+            childrenDayDegreeDetail.setOrderId(degreePayDto.getOrderId());
+            childrenDayDegreeDetails.add(childrenDayDegreeDetail);
+        }
+        if (degreePayDto.getVip1v2()) {
+            ChildrenDayDegreeDetail childrenDayDegreeDetail = new ChildrenDayDegreeDetail();
+            childrenDayDegreeDetail.setReserveId(degreePayDto.getReserveId());
+            childrenDayDegreeDetail.setUserId(degreePayDto.getUserId());
+            childrenDayDegreeDetail.setType(4);
+            childrenDayDegreeDetail.setPrice(vip1v2Fee);
+            childrenDayDegreeDetail.setStatus(1);
+            childrenDayDegreeDetail.setOrderId(degreePayDto.getOrderId());
+            childrenDayDegreeDetails.add(childrenDayDegreeDetail);
+        }
+        if (degreePayDto.getTheoryCourse()) {
+            ChildrenDayDegreeDetail childrenDayDegreeDetail = new ChildrenDayDegreeDetail();
+            childrenDayDegreeDetail.setReserveId(degreePayDto.getReserveId());
+            childrenDayDegreeDetail.setUserId(degreePayDto.getUserId());
+            childrenDayDegreeDetail.setType(5);
+            childrenDayDegreeDetail.setPrice(theoryCourseFee);
+            childrenDayDegreeDetail.setStatus(1);
+            childrenDayDegreeDetail.setOrderId(degreePayDto.getOrderId());
+            childrenDayDegreeDetails.add(childrenDayDegreeDetail);
+        }
+        childrenDayDegreeDetailDao.batchAdd(childrenDayDegreeDetails);
+        return childrenDayDegreeDetails;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public List<StudentPaymentOrderDetail> addOrderDetails(DegreePayDto degreePayDto, BigDecimal gradeFee, BigDecimal theoryLevelFee, BigDecimal vip1v1Fee, BigDecimal vip1v2Fee, BigDecimal theoryCourseFee) {
+        Date nowDate = new Date();
+        List<StudentPaymentOrderDetail> orderDetails = new ArrayList<>();
+        if (degreePayDto.getMusicGradeLevel() != null || degreePayDto.getTheoryLevel() != null) {
+            StudentPaymentOrderDetail detail = new StudentPaymentOrderDetail();
+            detail.setType(OrderDetailTypeEnum.DEGREE_REGISTRATION);
+            detail.setPrice(gradeFee.add(theoryLevelFee));
+            detail.setRemitFee(BigDecimal.ZERO);
+            detail.setCreateTime(nowDate);
+            detail.setUpdateTime(nowDate);
+            detail.setPaymentOrderId(degreePayDto.getOrderId());
+            detail.setIsRenew(0);
+            orderDetails.add(detail);
+        }
+        if (degreePayDto.getVip1v1() || degreePayDto.getVip1v2()) {
+            StudentPaymentOrderDetail detail = new StudentPaymentOrderDetail();
+            detail.setType(OrderDetailTypeEnum.VIP);
+            detail.setPrice(vip1v1Fee.add(vip1v2Fee));
+            detail.setRemitFee(BigDecimal.ZERO);
+            detail.setCreateTime(nowDate);
+            detail.setUpdateTime(nowDate);
+            detail.setPaymentOrderId(degreePayDto.getOrderId());
+            detail.setIsRenew(0);
+            orderDetails.add(detail);
+        }
+        if (degreePayDto.getTheoryCourse()) {
+            StudentPaymentOrderDetail detail = new StudentPaymentOrderDetail();
+            detail.setType(OrderDetailTypeEnum.THEORY_COURSE);
+            detail.setPrice(theoryCourseFee);
+            detail.setRemitFee(BigDecimal.ZERO);
+            detail.setCreateTime(nowDate);
+            detail.setUpdateTime(nowDate);
+            detail.setPaymentOrderId(degreePayDto.getOrderId());
+            detail.setIsRenew(0);
+            orderDetails.add(detail);
+        }
+        studentPaymentOrderDetailDao.batchAdd(orderDetails);
+        return orderDetails;
+    }
+
+    @Override
+    public List<ChildrenDayDegreeDetail> getUserDegreeInfo(Integer userId) {
+        return childrenDayDegreeDetailDao.getByUserIdAndStatus(userId, 2);
+    }
+
+    @Override
+    public Integer updateStatus(Long orderId, Integer status) {
+        return childrenDayDegreeDetailDao.updateStatus(orderId, status);
+    }
 }

+ 119 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ChildrenDayReserveServiceImpl.java

@@ -12,8 +12,11 @@ import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.IdGeneratorService;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -50,6 +53,16 @@ public class ChildrenDayReserveServiceImpl extends BaseServiceImpl<Integer, Chil
     @Autowired
     private PayService payService;
     @Autowired
+    private SysUserCashAccountDetailService sysUserCashAccountDetailService;
+    @Autowired
+    private ContractService contractService;
+    @Autowired
+    private SysUserCashAccountService sysUserCashAccountService;
+    @Autowired
+    private SysMessageService sysMessageService;
+
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+    @Autowired
     private StudentRegistrationService studentRegistrationService;
 
     @Override
@@ -211,44 +224,55 @@ public class ChildrenDayReserveServiceImpl extends BaseServiceImpl<Integer, Chil
         ChildrenDayReserve userReserve = this.getUserReserve(degreePayDto.getUserId());
 
         if (userReserve == null) {
-            this.addReserve(degreePayDto.getUser(), YesOrNoEnum.NO);
+            userReserve = this.addReserve(degreePayDto.getUser(), YesOrNoEnum.NO);
         }
+        degreePayDto.setReserveId(userReserve.getId());
 
         //获取课程的价格
         OrganizationDegreeCourseFee courseFee = organizationDegreeCourseFeeDao.getByOrganId(degreePayDto.getOrganId());
+
+        if (courseFee == null) {
+            throw new BizException("刚前分部不参与,谢谢关注");
+        }
+
         List<DegreeLevelFee> degreeLevelFees = degreeLevelFeeDao.getAll();
 
         //订单总金额
         BigDecimal orderAmount = BigDecimal.ZERO;
 
         //器乐考级费用
+        BigDecimal gradeFee = BigDecimal.ZERO;
         if (degreePayDto.getMusicGradeLevel() != null) {
-            BigDecimal gradeFee = degreeLevelFees.stream().filter(e -> e.getLevel().equals(degreePayDto.getMusicGradeLevel())).map(DegreeLevelFee::getGrade).reduce(BigDecimal.ZERO, BigDecimal::add);
+            gradeFee = degreeLevelFees.stream().filter(e -> e.getLevel().equals(degreePayDto.getMusicGradeLevel())).map(DegreeLevelFee::getGrade).reduce(BigDecimal.ZERO, BigDecimal::add);
             orderAmount = orderAmount.add(gradeFee);
         }
 
         //乐理考级费用
+        BigDecimal theoryLevelFee = BigDecimal.ZERO;
         if (degreePayDto.getTheoryLevel() != null) {
-            BigDecimal theoryLevelFee = degreeLevelFees.stream().filter(e -> e.getLevel().equals(degreePayDto.getTheoryLevel())).map(DegreeLevelFee::getTheory).reduce(BigDecimal.ZERO, BigDecimal::add);
+            theoryLevelFee = degreeLevelFees.stream().filter(e -> e.getLevel().equals(degreePayDto.getTheoryLevel())).map(DegreeLevelFee::getTheory).reduce(BigDecimal.ZERO, BigDecimal::add);
             orderAmount = orderAmount.add(theoryLevelFee);
         }
 
         //VIP 1v1 1v2费用
+        BigDecimal vip1v1Fee = BigDecimal.ZERO;
         if (degreePayDto.getVip1v1()) {
-            BigDecimal vip1v1Fee = courseFee.getVip1v1();
+            vip1v1Fee = courseFee.getVip1v1();
             orderAmount = orderAmount.add(vip1v1Fee);
         }
 
         //VIP 1v2费用
+        BigDecimal vip1v2Fee = BigDecimal.ZERO;
         if (degreePayDto.getVip1v2()) {
-            BigDecimal vip1v2Fee = courseFee.getVip1v2();
+            vip1v2Fee = courseFee.getVip1v2();
             orderAmount = orderAmount.add(vip1v2Fee);
         }
 
-        //VIP 乐理课费用
+        //乐理课费用
+        BigDecimal theoryCourseFee = BigDecimal.ZERO;
         if (degreePayDto.getTheoryCourse()) {
-            BigDecimal theoryFee = courseFee.getTheory();
-            orderAmount = orderAmount.add(theoryFee);
+            theoryCourseFee = courseFee.getTheory();
+            orderAmount = orderAmount.add(theoryCourseFee);
         }
 
         if (orderAmount.compareTo(degreePayDto.getAmount()) != 0) {
@@ -281,6 +305,11 @@ public class ChildrenDayReserveServiceImpl extends BaseServiceImpl<Integer, Chil
         studentPaymentOrder.setUpdateTime(nowDate);
         studentPaymentOrderService.insert(studentPaymentOrder);
 
+        //添加购买详情
+        degreePayDto.setOrderId(studentPaymentOrder.getId());
+        childrenDayDegreeDetailService.addOrderDetails(degreePayDto, gradeFee, theoryLevelFee, vip1v1Fee, vip1v2Fee, theoryCourseFee);
+        childrenDayDegreeDetailService.addDegreeDetails(degreePayDto, gradeFee, theoryLevelFee, vip1v1Fee, vip1v2Fee, theoryCourseFee);
+
         studentPaymentOrder.setVersion(0);
         if (orderAmount.compareTo(BigDecimal.ZERO) == 0) {
             studentPaymentRouteOrderService.addRouteOrder(orderNo, degreePayDto.getOrganId(), balance);
@@ -317,4 +346,86 @@ public class ChildrenDayReserveServiceImpl extends BaseServiceImpl<Integer, Chil
         studentPaymentOrderService.update(studentPaymentOrder);
         return payMap;
     }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean orderCallback(StudentPaymentOrder studentPaymentOrder) {
+        Date nowDate = new Date();
+        //更新订单信息
+        studentPaymentOrder.setUpdateTime(nowDate);
+        int updateCount = studentPaymentOrderService.update(studentPaymentOrder);
+        if (updateCount <= 0) {
+            throw new BizException("订单更新失败");
+        }
+
+        Integer userId = studentPaymentOrder.getUserId();
+
+        Map<Integer, String> map = new HashMap<>();
+        map.put(userId, userId.toString());
+
+        //支付成功
+        if (studentPaymentOrder.getStatus() == DealStatusEnum.SUCCESS) {
+            if (childrenDayDegreeDetailService.updateStatus(studentPaymentOrder.getId(), 2) <= 0) {
+                throw new BizException("购买详情,更新失败");
+            }
+
+
+            //插入交易明细
+            BigDecimal amount = studentPaymentOrder.getActualAmount();
+            if (amount.compareTo(BigDecimal.ZERO) > 0) {
+                SysUserCashAccount cashAccount = sysUserCashAccountService.get(userId);
+                //充值
+                SysUserCashAccountDetail rechargeDetail = new SysUserCashAccountDetail();
+                rechargeDetail.setAmount(amount);
+                rechargeDetail.setBalance(cashAccount.getBalance().add(amount));
+                rechargeDetail.setComment("缴费前充值");
+                rechargeDetail.setCreateTime(nowDate);
+                rechargeDetail.setStatus(DealStatusEnum.SUCCESS);
+                rechargeDetail.setTransNo(studentPaymentOrder.getTransNo());
+                rechargeDetail.setType(PlatformCashAccountDetailTypeEnum.RECHARGE);
+                rechargeDetail.setUpdateTime(nowDate);
+                rechargeDetail.setUserId(userId);
+                rechargeDetail.setChannel(studentPaymentOrder.getPaymentChannel());
+                rechargeDetail.setComAmount(studentPaymentOrder.getComAmount());
+                rechargeDetail.setPerAmount(studentPaymentOrder.getPerAmount());
+                sysUserCashAccountDetailService.insert(rechargeDetail);
+
+                //缴费
+                SysUserCashAccountDetail paymentDetail = new SysUserCashAccountDetail();
+                paymentDetail.setAmount(amount.negate());
+                paymentDetail.setBalance(cashAccount.getBalance());
+                paymentDetail.setComment("6.1考级活动");
+                paymentDetail.setCreateTime(nowDate);
+                paymentDetail.setStatus(DealStatusEnum.SUCCESS);
+                paymentDetail.setTransNo(studentPaymentOrder.getTransNo());
+                paymentDetail.setType(PlatformCashAccountDetailTypeEnum.PAY_FEE);
+                paymentDetail.setUpdateTime(nowDate);
+                paymentDetail.setUserId(userId);
+                rechargeDetail.setChannel(studentPaymentOrder.getPaymentChannel());
+                sysUserCashAccountDetailService.insert(paymentDetail);
+            }
+
+            try {
+                contractService.transferProduceContract(userId, null);
+            } catch (Exception e) {
+                logger.error("产品协议生成失败", e);
+            }
+            return true;
+        }
+
+        if (studentPaymentOrder.getStatus() == DealStatusEnum.CLOSE || studentPaymentOrder.getStatus() == DealStatusEnum.FAILED) {
+            if (childrenDayDegreeDetailService.updateStatus(studentPaymentOrder.getId(), 3) <= 0) {
+                throw new BizException("购买详情,更新失败");
+            }
+
+            if (studentPaymentOrder.getBalancePaymentAmount() != null && studentPaymentOrder.getBalancePaymentAmount().compareTo(BigDecimal.ZERO) > 0) {
+                sysUserCashAccountService.updateBalance(studentPaymentOrder.getUserId(), studentPaymentOrder.getBalancePaymentAmount(), PlatformCashAccountDetailTypeEnum.REFUNDS, "6.1考级支付失败");
+            }
+
+            sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_SMS_PUSH_SPORADIC_PAYMENT_FAILED, map, null, 0, null, "STUDENT",
+                    studentPaymentOrder.getActualAmount(), "6.1考级活动");
+            return false;
+        }
+        return true;
+    }
 }

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

@@ -38,6 +38,7 @@ public class CloudTeacherOrderServiceImpl extends BaseServiceImpl<Long, CloudTea
     public Boolean addOrderDetail2CloudTeacher(StudentPaymentOrder order) {
         List<OrderDetailTypeEnum> orderDetailTypes = new ArrayList<>();
         orderDetailTypes.add(OrderDetailTypeEnum.CLOUD_TEACHER);
+        orderDetailTypes.add(OrderDetailTypeEnum.CLOUD_TEACHER_PLUS);
         List<StudentPaymentOrderDetail> orderDetails = studentPaymentOrderDetailDao.getOrderDetailByType(order.getId(), orderDetailTypes);
         if (orderDetails.size() <= 0) {
             return true;
@@ -47,7 +48,8 @@ public class CloudTeacherOrderServiceImpl extends BaseServiceImpl<Long, CloudTea
         cloudTeacherOrder.setOrganId(order.getOrganId());
         cloudTeacherOrder.setStudentId(order.getUserId());
         cloudTeacherOrder.setType(2);
-        cloudTeacherOrder.setLevel(3);
+        int level = orderDetail.getType().equals(OrderDetailTypeEnum.CLOUD_TEACHER) ? 3 : 4;
+        cloudTeacherOrder.setLevel(level);
         cloudTeacherOrder.setTime(6);
         cloudTeacherOrder.setAmount(orderDetail.getPrice());
         cloudTeacherOrder.setStatus(1);

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

@@ -1034,12 +1034,12 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 			ownershipType = musicGroup.getCourseViewType();
 		}
 
-		List<SysUserContracts> userContracts = sysUserContractsService.getUserContractWithType(userId, ContractType.PRODUCT, CourseViewTypeEnum.COURSE_lIST.equals(ownershipType)?COURSE_CONTRACT_VERSION:AMR_CONTRACT_VERSION);
+		List<SysUserContracts> userContracts = sysUserContractsService.getUserContractWithType(userId, ContractType.PRODUCT, ownershipType.getContractVersion());
 		if(!CollectionUtils.isEmpty(userContracts)){
 			return true;
 		}
 
-		templateEngine.render(params, "product"+(CourseViewTypeEnum.COURSE_lIST.equals(ownershipType)?COURSE_CONTRACT_VERSION:AMR_CONTRACT_VERSION)+".ftl", srcFile);
+		templateEngine.render(params, "product"+ownershipType.getContractVersion()+".ftl", srcFile);
 
 		// 生成借款协议PDF
 		try {
@@ -1077,7 +1077,7 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 		sysUserContracts.setType(ContractType.PRODUCT);
 		sysUserContracts.setUrl(pdfFilePath);
 		sysUserContracts.setUserId(userId);
-		sysUserContracts.setVersion(CourseViewTypeEnum.COURSE_lIST.equals(ownershipType)?COURSE_CONTRACT_VERSION:AMR_CONTRACT_VERSION);
+		sysUserContracts.setVersion(ownershipType.getContractVersion());
 
 		sysUserContractsService.insert(sysUserContracts);
 
@@ -1115,12 +1115,14 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 
 		Map<String, Object> result = new HashMap<>();
 		result.put("courseViewType", CourseViewTypeEnum.COURSE_lIST);
+		CourseViewTypeEnum ownershipType = CourseViewTypeEnum.COURSE_lIST;
 
 		if(StringUtils.isBlank(musicGroupId)){
 			params.put("ownershipType", "OWN");
 			MusicGroup userLastNormalMusicGroup = studentRegistrationDao.getUserLastNormalMusicGroup(userId);
 			if(Objects.nonNull(userLastNormalMusicGroup)){
 				result.put("courseViewType", userLastNormalMusicGroup.getCourseViewType());
+				ownershipType = userLastNormalMusicGroup.getCourseViewType();
 			}
 		}else{
 			MusicGroup musicGroup = musicGroupService.get(musicGroupId);
@@ -1129,9 +1131,11 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 			}
 			params.put("ownershipType", musicGroup.getOwnershipType().name());
 			result.put("courseViewType", musicGroup.getCourseViewType());
+			ownershipType = musicGroup.getCourseViewType();
 		}
 
-		templateEngine.render(params, "product"+(CourseViewTypeEnum.COURSE_lIST.equals(result.get("courseViewType"))?COURSE_CONTRACT_VERSION:AMR_CONTRACT_VERSION)+".ftl", srcFile);
+
+		templateEngine.render(params, "product"+ownershipType.getContractVersion()+".ftl", srcFile);
 
 		String html = "";
 		try {
@@ -1142,7 +1146,7 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 			FileUtils.deleteQuietly(srcFile);
 		}
 
-		List<SysUserContracts> userContractWithType = sysUserContractsService.getUserContractWithType(userId, ContractType.PRODUCT, CourseViewTypeEnum.COURSE_lIST.equals(result.get("courseViewType"))?COURSE_CONTRACT_VERSION:AMR_CONTRACT_VERSION);
+		List<SysUserContracts> userContractWithType = sysUserContractsService.getUserContractWithType(userId, ContractType.PRODUCT, ownershipType.getContractVersion());
 
 		result.put("exists", !CollectionUtils.isEmpty(userContractWithType));
 		result.put("productContract", html);

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

@@ -722,6 +722,9 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 		if(statusCoursesMap.containsKey(CourseStatusEnum.NOT_START)){
 			List<CourseScheduleStudentPaymentDto> notStartCourses = statusCoursesMap.get(CourseStatusEnum.NOT_START);
 			for (CourseScheduleStudentPaymentDto notStartCourse : notStartCourses) {
+				if(Objects.isNull(notStartCourse.getActualPrice())){
+					continue;
+				}
 				studentRegistrationService.updateUserSurplusCourseFee(notStartCourse.getUserId(), notStartCourse.getMusicGroupId(), notStartCourse.getActualPrice(), StringUtils.join("课程状态变更到未开始,退还缴费:", notStartCourse.getCourseScheduleId()), null);
 				notStartCourse.setActualPrice(BigDecimal.ZERO);
 				needUpdates.add(notStartCourse);

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

@@ -147,6 +147,7 @@ public class ExportServiceImpl implements ExportService {
                             row.setMaintenanceFee(repairFee);
                             break;
                         case CLOUD_TEACHER:
+                        case CLOUD_TEACHER_PLUS:
                             BigDecimal cloudTeacherFee = BigDecimal.ZERO;
                             if (row.getExpectAmount().compareTo(BigDecimal.ZERO) > 0) {
                                 cloudTeacherFee = orderDetail.getPrice().multiply(row.getActualAmount()).divide(row.getExpectAmount(), 2, BigDecimal.ROUND_DOWN);
@@ -366,7 +367,8 @@ public class ExportServiceImpl implements ExportService {
                     transferFee = row.getActualAmount().multiply(new BigDecimal("0.28")).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP);
                 }
                 if (countFeeFlagNum.getTotalNum().equals(countFeeFlagNum.getYesNum())) {
-                    transferFee = row.getRouteAmount().multiply(new BigDecimal("0.28")).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP);
+                    BigDecimal totalTransferFee = row.getActualAmount().multiply(new BigDecimal("0.28")).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP);
+                    transferFee = totalTransferFee.multiply(row.getRouteAmount()).divide(row.getActualAmount(), 2, BigDecimal.ROUND_HALF_UP);
                 }
             }
             row.setTransferFee(transferFee);
@@ -415,6 +417,7 @@ public class ExportServiceImpl implements ExportService {
                             row.setMaintenanceFee(maintenanceFee);
                             break;
                         case CLOUD_TEACHER:
+                        case CLOUD_TEACHER_PLUS:
                             BigDecimal cloudTeacherFee = BigDecimal.ZERO;
                             if (row.getExpectAmount().compareTo(BigDecimal.ZERO) > 0) {
                                 cloudTeacherFee = orderDetail.getPrice().multiply(row.getActualAmount()).divide(row.getExpectAmount(), 2, BigDecimal.ROUND_DOWN);

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

@@ -671,12 +671,12 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             orderAmount = orderAmount.add(maintenancePrice);
         }
 
-        //云教练
         MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
         studentRegistration.setOrganId(musicGroup.getOrganId());
-        if (registerPayDto.getBuyCloudTeacher()) {
+        //云教练/云教练+
+        if (registerPayDto.getBuyCloudTeacher() || registerPayDto.getBuyCloudTeacherPlus()) {
             OrganizationCloudTeacherFee cloudTeacher = organizationCloudTeacherFeeDao.getByOrganId(studentRegistration.getOrganId());
-            BigDecimal cloudTeacherPrice = cloudTeacher.getPrice();
+            BigDecimal cloudTeacherPrice = registerPayDto.getBuyCloudTeacher() ? cloudTeacher.getPrice() : cloudTeacher.getPlusPrice();
             orderAmount = orderAmount.add(cloudTeacherPrice);
         }
 
@@ -691,7 +691,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
         String channelType = "";
 
-        StudentPaymentOrder studentPaymentOrder = studentRegistrationService.addOrder(studentRegistration, amount, orderNo, channelType, courseFee, goodsGroups, remitFee, courseRemitFee, newCourses, registerPayDto.getBuyMaintenance(), registerPayDto.getBuyCloudTeacher());
+        StudentPaymentOrder studentPaymentOrder = studentRegistrationService.addOrder(studentRegistration, amount, orderNo, channelType, courseFee, goodsGroups, remitFee, courseRemitFee, newCourses, registerPayDto.getBuyMaintenance(), registerPayDto.getBuyCloudTeacher(), registerPayDto.getBuyCloudTeacherPlus());
         studentPaymentOrder = studentPaymentOrderService.get(studentPaymentOrder.getId());
 
         Date date = new Date();
@@ -843,10 +843,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
         MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
         studentRegistration.setOrganId(musicGroup.getOrganId());
-        //云教练
-        if (registerPayDto.getBuyCloudTeacher()) {
+        //云教练/云教练+
+        if (registerPayDto.getBuyCloudTeacher() || registerPayDto.getBuyCloudTeacherPlus()) {
             OrganizationCloudTeacherFee cloudTeacher = organizationCloudTeacherFeeDao.getByOrganId(studentRegistration.getOrganId());
-            BigDecimal cloudTeacherPrice = cloudTeacher.getPrice();
+            BigDecimal cloudTeacherPrice = registerPayDto.getBuyCloudTeacher() ? cloudTeacher.getPrice() : cloudTeacher.getPlusPrice();
             orderAmount = orderAmount.add(cloudTeacherPrice);
         }
 
@@ -862,7 +862,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
         String channelType = "";
 
-        StudentPaymentOrder studentPaymentOrder = studentRegistrationService.addOrder(studentRegistration, amount, orderNo, channelType, courseFee, goodsGroups, remitFee, courseRemitFee, newCourses, registerPayDto.getBuyMaintenance(), registerPayDto.getBuyCloudTeacher());
+        StudentPaymentOrder studentPaymentOrder = studentRegistrationService.addOrder(studentRegistration, amount, orderNo, channelType, courseFee, goodsGroups, remitFee, courseRemitFee, newCourses, registerPayDto.getBuyMaintenance(), registerPayDto.getBuyCloudTeacher(), registerPayDto.getBuyCloudTeacherPlus());
         studentPaymentOrder = studentPaymentOrderService.get(studentPaymentOrder.getId());
         Date date = new Date();
 
@@ -1786,7 +1786,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             if (hasPaid && musicGroupSubjectPlan != null) {
                 musicGroupSubjectPlan.setUpdateTime(date);
                 //减去缴费人数(器乐收费,0元时不减缴费人数)
-                if (musicGroup.getCourseViewType().equals(CourseViewTypeEnum.CLOUD_TEACHER)) {
+                if (musicGroup.getCourseViewType().equals(CourseViewTypeEnum.CLOUD_TEACHER) || musicGroup.getCourseViewType().equals(CourseViewTypeEnum.CLOUD_TEACHER_PLUS)) {
                     if (studentPaymentOrder != null && studentPaymentOrder.getPaymentAccountNo() != null && studentPaymentOrder.getPaymentAccountNo().equals("200")) {
                         musicGroupSubjectPlan.setPaidZeroNum(musicGroupSubjectPlan.getPaidZeroNum() - 1);
                         musicGroupSubjectPlan.setPaidStudentNum(musicGroupSubjectPlan.getPaidStudentNum() - 1);
@@ -2017,7 +2017,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if (hasPaid && musicGroupSubjectPlan != null) {
             musicGroupSubjectPlan.setUpdateTime(date);
             //减去缴费人数(器乐收费,0元时不减缴费人数)
-            if (musicGroup.getCourseViewType().equals(CourseViewTypeEnum.CLOUD_TEACHER)) {
+            if (musicGroup.getCourseViewType().equals(CourseViewTypeEnum.CLOUD_TEACHER) || musicGroup.getCourseViewType().equals(CourseViewTypeEnum.CLOUD_TEACHER_PLUS)) {
                 if (studentPaymentOrder != null && studentPaymentOrder.getPaymentAccountNo() != null && studentPaymentOrder.getPaymentAccountNo().equals("200")) {
                     musicGroupSubjectPlan.setPaidZeroNum(musicGroupSubjectPlan.getPaidZeroNum() - 1);
                     musicGroupSubjectPlan.setPaidStudentNum(musicGroupSubjectPlan.getPaidStudentNum() - 1);

+ 6 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupSubjectPlanServiceImpl.java

@@ -127,9 +127,10 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
         musicGroupSubjectGoodsAndInfo.setMusicGroupPaymentCalender(musicGroupRegCalender);
         musicGroupSubjectGoodsAndInfo.setMusicGroupSubjectGoodsGroupList(goodsGroups);
         musicGroupSubjectGoodsAndInfo.setMusicGroup(musicGroup);
-        if (musicGroup.getCourseViewType().equals(CourseViewTypeEnum.CLOUD_TEACHER)) {
+        if (musicGroup.getCourseViewType().equals(CourseViewTypeEnum.CLOUD_TEACHER) || musicGroup.getCourseViewType().equals(CourseViewTypeEnum.CLOUD_TEACHER_PLUS)) {
             OrganizationCloudTeacherFee cloudTeacherFee = organizationCloudTeacherFeeDao.getByOrganId(musicGroup.getOrganId());
             musicGroupSubjectGoodsAndInfo.setCloudTeacherFee(cloudTeacherFee.getPrice());
+            musicGroupSubjectGoodsAndInfo.setCloudTeacherPlusFee(cloudTeacherFee.getPlusPrice());
         }
         return musicGroupSubjectGoodsAndInfo;
     }
@@ -237,12 +238,13 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
     }
 
     @Override
-    public List<MusicGroupGoodsAndDiscountDto> getSubjectGoods(Integer subjectId, String type, Integer chargeTypeId,Integer courseViewType,String musicGroupId) {
-        if(StringUtils.isNotEmpty(musicGroupId)){
+    public List<MusicGroupGoodsAndDiscountDto> getSubjectGoods(Integer subjectId, String type, Integer chargeTypeId, Integer courseViewType, String musicGroupId) {
+        if (StringUtils.isNotEmpty(musicGroupId)) {
             MusicGroup musicGroup = musicGroupService.get(musicGroupId);
             courseViewType = musicGroup.getCourseViewType().getCode();
+            courseViewType = courseViewType == 3?2:courseViewType;
         }
-        List<MusicGroupGoodsAndDiscountDto> goodsList = goodsDao.getMusicGroupGoodsAndDiscount(subjectId, type,courseViewType);
+        List<MusicGroupGoodsAndDiscountDto> goodsList = goodsDao.getMusicGroupGoodsAndDiscount(subjectId, type, courseViewType);
         if (chargeTypeId == null || (type != null && !"INSTRUMENT".equals(type))) {
             return goodsList;
         }

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentAttendanceServiceImpl.java

@@ -10,6 +10,7 @@ import java.util.Objects;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import com.alibaba.fastjson.JSON;
 import com.ym.mec.biz.dal.dto.*;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
@@ -68,6 +69,8 @@ import com.ym.mec.util.date.DateUtil;
 @Service
 public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentAttendance> implements StudentAttendanceService {
 
+    private final Logger LOGGER = LoggerFactory.getLogger(StudentAttendanceServiceImpl.class);
+
     @Autowired
     private StudentAttendanceDao studentAttendanceDao;
     @Autowired
@@ -113,6 +116,7 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
     @Override
     @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
     public Map<String, Object> addStudentAttendances(StudentAttendanceDto studentAttendanceInfos) {
+        LOGGER.info(JSON.toJSONString(studentAttendanceInfos));
         List<StudentAttendance> studentAttendances = studentAttendanceInfos.getStudentAttendances();
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if (Objects.isNull(sysUser)) {

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -90,6 +90,8 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
     private StudentInstrumentService studentInstrumentService;
     @Autowired
     private ReplacementInstrumentActivityService replacementInstrumentActivityService;
+    @Autowired
+    private ChildrenDayReserveService childrenDayReserveService;
 
     @Override
     public BaseDAO<Long, StudentPaymentOrder> getDAO() {
@@ -374,6 +376,8 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
             studentInstrumentService.orderCallback(order);
         } else if (order.getType().equals(OrderTypeEnum.REPLACEMENT)) {
             replacementInstrumentActivityService.orderCallback(order);
+        }else if (order.getType().equals(OrderTypeEnum.DEGREE)) {
+            childrenDayReserveService.orderCallback(order);
         }
     }
 

+ 12 - 9
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -25,7 +25,6 @@ import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.page.NoClassMusicStudentQueryInfo;
 import com.ym.mec.biz.service.*;
-import com.ym.mec.common.controller.BaseController;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -390,7 +389,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     @Override
     @Transactional(rollbackFor = Exception.class)
     public StudentPaymentOrder addOrder(StudentRegistration studentRegistration, BigDecimal amount, String orderNo, String paymentChannel,
-                                        BigDecimal courseFee, List<MusicGroupSubjectGoodsGroup> goodsGroups, BigDecimal remitFee, BigDecimal courseRemitFee, List<MusicGroupPaymentCalenderCourseSettings> newCourses, Boolean buyMaintenance, Boolean buyCloudTeacher) throws Exception {
+                                        BigDecimal courseFee, List<MusicGroupSubjectGoodsGroup> goodsGroups, BigDecimal remitFee, BigDecimal courseRemitFee, List<MusicGroupPaymentCalenderCourseSettings> newCourses, Boolean buyMaintenance, Boolean buyCloudTeacher, Boolean buyCloudTeacherPlus) throws Exception {
         Date date = new Date();
         StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
         studentPaymentOrder.setUserId(studentRegistration.getUserId());
@@ -476,12 +475,13 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             maintenanceOrderDetail.setIsRenew(0);
             studentPaymentOrderDetailList.add(maintenanceOrderDetail);
         }
-        //云教练
-        if (buyCloudTeacher) {
+        //云教练/云教练+
+        if (buyCloudTeacher || buyCloudTeacherPlus) {
             OrganizationCloudTeacherFee cloudTeacher = organizationCloudTeacherFeeDao.getByOrganId(studentRegistration.getOrganId());
-            BigDecimal cloudTeacherPrice = cloudTeacher.getPrice();
+            BigDecimal cloudTeacherPrice = buyCloudTeacher ? cloudTeacher.getPrice() : cloudTeacher.getPlusPrice();
+            OrderDetailTypeEnum orderDetailTypeEnum = buyCloudTeacher ? OrderDetailTypeEnum.CLOUD_TEACHER : OrderDetailTypeEnum.CLOUD_TEACHER_PLUS;
             StudentPaymentOrderDetail cloudTeacherOrderDetail = new StudentPaymentOrderDetail();
-            cloudTeacherOrderDetail.setType(OrderDetailTypeEnum.CLOUD_TEACHER);
+            cloudTeacherOrderDetail.setType(orderDetailTypeEnum);
             cloudTeacherOrderDetail.setPrice(cloudTeacherPrice);
             cloudTeacherOrderDetail.setRemitFee(BigDecimal.ZERO);
             cloudTeacherOrderDetail.setCreateTime(date);
@@ -494,14 +494,16 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 
         MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
 
-        //增加缴费学生数,0元订单不增加报名人数(没买云教练的)
+        //增加缴费学生数,0元订单不增加报名人数(没买云教练/云教练+的)
         boolean paidZeroFlag = false;
         boolean firstPaidZeroFlag = false;
 
         MusicGroupSubjectPlan musicOneSubjectClassPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(studentRegistration.getMusicGroupId(), studentRegistration.getActualSubjectId());
         int paidNum = musicOneSubjectClassPlan.getPaidStudentNum() == null ? 0 : musicOneSubjectClassPlan.getPaidStudentNum();
         int paidZeroNum = musicOneSubjectClassPlan.getPaidZeroNum() == null ? 0 : musicOneSubjectClassPlan.getPaidZeroNum();
-        if (musicGroup.getCourseViewType().equals(CourseViewTypeEnum.CLOUD_TEACHER) && !buyCloudTeacher) {
+        if ((musicGroup.getCourseViewType().equals(CourseViewTypeEnum.CLOUD_TEACHER) && !buyCloudTeacher) ||
+                (musicGroup.getCourseViewType().equals(CourseViewTypeEnum.CLOUD_TEACHER_PLUS) && !buyCloudTeacherPlus)
+        ) {
             paidZeroFlag = true;
             if (paidZeroNum <= 0) {
                 musicOneSubjectClassPlan.setPaidZeroNum(paidZeroNum + 1);
@@ -1090,6 +1092,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                     .filter(o -> !o.getType().getCode().equals("ACCESSORIES"))
                     .filter(o -> !o.getType().getCode().equals("MAINTENANCE"))
                     .filter(o -> !o.getType().getCode().equals("CLOUD_TEACHER"))
+                    .filter(o -> !o.getType().getCode().equals("CLOUD_TEACHER_PLUS"))
                     .map(o -> o.getPrice().subtract(o.getRemitFee() == null ? BigDecimal.ZERO : o.getRemitFee()))
                     .reduce(BigDecimal.ZERO, BigDecimal::add);
 
@@ -1206,7 +1209,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         if (studentPaymentOrder.getStatus().equals(DealStatusEnum.FAILED)) {
             MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
             //减去缴费人数(器乐收费,0元时不减缴费人数)
-            if (musicGroup.getCourseViewType().equals(CourseViewTypeEnum.CLOUD_TEACHER)) {
+            if (musicGroup.getCourseViewType().equals(CourseViewTypeEnum.CLOUD_TEACHER) || musicGroup.getCourseViewType().equals(CourseViewTypeEnum.CLOUD_TEACHER_PLUS)) {
                 if (studentPaymentOrder.getPaymentAccountNo() != null && studentPaymentOrder.getPaymentAccountNo().equals("200")) {
                     musicOneSubjectClassPlan.setPaidZeroNum(musicOneSubjectClassPlan.getPaidZeroNum() - 1);
                     musicOneSubjectClassPlan.setPaidStudentNum(musicOneSubjectClassPlan.getPaidStudentNum() - 1);

+ 209 - 0
mec-biz/src/main/resources/config/contracts/product5.ftl

@@ -0,0 +1,209 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
+    <meta http-equiv="Pragma" content="no-cache" />
+    <meta http-equiv="Cache-Control" content="no-cache" />
+    <meta http-equiv="Expires" content="0" />
+    <title>产品与服务协议</title>
+    <style>
+        body { margin: 0; }
+        header {
+            height: 40px;
+            line-height: .40px;
+            color: #000;
+            font-size: 17px;
+            background: #fff;
+            box-shadow: 0px 1px 8px 0px rgba(0, 0, 0, 0.07);
+            text-align: center;
+        }
+        header .back {
+            width: 20px;
+            height: 20px;
+            position: absolute;
+            left: 12px;
+            top: 10px;
+        }
+        .container {
+            padding: 22px 20px 3px;
+            font-size: 14px;
+        }
+        h1 {
+            font-size: 18px;
+            text-align: center;
+            margin-bottom: 8px;
+        }
+        h2 {
+            font-size: 16px;
+            font-weight: bold;
+            padding-top: 15px;
+        }
+        h3 {
+            font-size: 14px;
+            font-weight: bold;
+        }
+        .signature {
+            padding-top: 50px;
+        }
+        .signature .sign {
+            position: relative;
+            width: 49%;
+            display: inline-block;
+        }
+        .signature span {
+            display: block;
+        }
+        .signature .cachet {
+            position: absolute;
+            top: -60px;
+            left: 0;
+            width: 150px;
+            height: 150px;
+        }
+        .iInfo {
+            display: flex;
+        }
+        .iInfo span {
+            flex: 1;
+        }
+        .iInfoContent, .iInfoContent span {
+            display: block;
+        }
+
+        .underline {
+            text-decoration: underline;
+        }
+        .bold {
+            font-weight: bold;
+        }
+    </style>
+</head>
+<body style="font-family:'SimSun'">
+    <div class="container">
+        <h1>《产品与服务协议》</h1>
+        <!-- 甲方:深圳大雅乐盟网络教育股份有限公司 <br/> -->
+        <#if ownershipType == 'OWN'>
+		甲方:深圳大雅乐盟网络教育股份有限公司
+		<#else>
+		甲方:武汉长乐长风乐器销售有限公司
+		</#if>
+		<br/>
+        <div style="display: flex;">乙方:
+            <div style="flex: 1 auto;">
+                <div class="iInfo">
+                    <span>家长姓名:${studentInfo.realName!}</span>
+                    <span>电话:${studentInfo.phone!}</span>
+                </div>
+                <#if studentInfo.certificateType == 'IDENTITY'>
+                    <div class="iInfo">
+                        <span>身份证号:${studentInfo.idCardNo!}</span>
+                    </div>
+                </#if>
+                <div class="iInfo">
+                    <span>学生姓名:${studentInfo.username!}</span>
+                </div>
+                <#if studentInfo.grade?default("")?trim?length gt 1>
+                <div class="iInfo">
+                    <span>所在班级:${studentInfo.grade!} ${studentInfo.clazz!}</span>
+                </div>
+                </#if>
+                <#if studentInfo.subject.name?default("")?trim?length gt 1>
+                <div class="iInfo">
+                    <span>所在声部:${studentInfo.subject.name!}</span>
+                </div>
+                </#if>
+            </div>
+        </div>
+        <div>(本协议中“乙方“指学员及家长;”乙方学员“指购买甲方产品或服务的学员;”乙方家长“仅指乙方学员的法定监护人。)</div>
+
+        <p class="underline bold">重要须知:在注册或购买使用甲方提供的产品、服务之前,请您务必审慎阅读、充分理解本使用协议各条款内容, 特别是免除或者限制甲方责任的条款、对您权利进行限制的条款、约定争议解决方式和司法管辖的条款等。 限制、免责条款或者其他涉及您重大权益的条款可能以加粗、加下划线等形式提示您重点注意。您注册或购买使用甲方提供的产品和服务,均视为您同意本使用协议,以及同意接受本使用协议的约束。</p>
+        <p class="bold">如无特别说明 ,下列术语在本协议中的定义为:管乐迷平台(下称“本平台”),即管乐迷APP;乐器练习云教练<sup>+</sup>系统(下称“本系统”)指由甲方提供的器乐教学全流程辅助系统,包括媒体资料,教师点评,课前、课中、课后管理等服务,具体以该系统实际提供为准。该系统将根据实际需要进行调整和增减,乙方使用平台时需遵守本服务协议。</p>
+
+        <h2>一、注册及购买</h2>
+        <div>1、无论是否源自甲方建议,乙方选择报名注册加入乐团,或选择购买使用甲方提供的产品和服务,均为乙方自主意愿的表达及独立自主的选择。</div>
+        2、乙方完成所选产品或服务缴费后,乙方务必妥善保管甲方收款后开具的加盖公司印章的收款凭据或电子凭据。
+
+        <h2>二、乐团及上课规范</h2>
+				1、乙方学员在应服从甲方的管理,遵守甲方的制度。<br />
+				2、乙方学员应按时到达甲方指定上课地点,作好课前准备;如发生迟到、早退或因其他乙方原因未能按时上课的,视为乙方学员放弃该次课程,为避免影响老师后续课程的正常进行,授课老师除完成原定时间安排的授课外,将不再提供额外延长课时,也不会因乙方学员缺席而暂停教学课程。<br />
+				3、乙方学员不得携带任何食品进入教室,所有进食应在课前完成;进入教室后,不得大声喧哗、追逐嬉戏,应当听从授课老师的安排;乙方学员应爱护公共财产和教学设施,严禁在桌椅上刻、划、涂、写等不文明行为;乙方学员未经授课老师同意,不得擅自使用教室内的乐器、音响、电视、空调等器材、设施,如造成此类器材、设施损坏的,乙方应照价赔偿。<br />
+				4、未经授课老师同意,乙方家长不得进入课堂,以免影响老师和学员上课;为保证训练质量及进度,乙方学员应保证按照指导老师或教务老师所提出的要求在家练习,遇到专业问题应及时向指导老师请教,非专业问题可随时向教务老师反映。<br />
+				5、乙方家长应教育及监督乙方学员务必注意个人安全,妥善保管个人财物,对于非甲方原因造成的人身安全事故或财物损失,由乙方自行承担。<br />
+				6、对于乐团学员出现以下情形时,甲方有权对乙方学员作出警告,如甲方作出警告后,乙方学员仍然不遵守甲方的管理制度的,甲方有权对该团员作出退团等处分。<br />
+                &#160;&#160;6.1上课、排练时不服从管理和指导,不遵守纪律,影响其他团员的正常上课、排练;<br />
+                &#160;&#160;6.2一个学期内发生两次及以上旷课行为;<br />
+                &#160;&#160;6.3一个学期内发生两次及以上未按老师要求回传视频作业的情形;<br />
+                &#160;&#160;6.4无特殊原因连续七天不练习,影响团员和乐团的整体水平的。<br />
+
+        <h2>三、请假</h2>
+        1、基于教学进度和质量保证,甲方对于课程延续性有严格要求,因此乙方学员应尽量参加课程,无特殊情况则应避免请假。<br />
+        2、VIP课程学员如有特殊情况需要请假的,应提前4小时以上通过管乐迷APP完成请假,否则当次课程将视同发生,系统将自动记录结算课时并扣除相应课程费用。<br />
+        3、VIP学员如遇特殊情况需要长期请假时,可向甲方/授课老师申请办理临时休会。学员可在6个月内申请复学,超过6个月未申请复学的,甲方有权按自动退会处理。VIP课程为一对二课程的,其中一位学员申请临时休会的,还需征得同组另一位学员的同意后方可申请休会。否则将不予受理。<br />
+        4、鉴于团体课的特殊性,团体课学员个人请假,当次课程仍视同发生。<br />
+
+        <h2>四、退费</h2>
+        1、乐器、教辅、配件等,未经签收,自购买缴款之日起15日内提出申请可全额退还,超过上述期限则不予受理退费申请;非因商品本身存在质量问题,一经签收,无论使用与否,均不予退费;<br />
+        2、乐保服务,在维修老师下校检查前提出申请可全额退还,下校检查日过后则不予退费;<br />
+        3、“乐器练习云教练<sup>+</sup>”系统服务,自购买之日起到生效前一日提出申请可全额退还,超过上述期限或实际已提供相应服务则一律不予受理退费;<br />
+        4、正价购买的个别课程,包括但不限于VIP课程项下一对一、网管课等,课程有效期内可申请退费,可退款金额为:购买金额-课时原价*已消耗课时数量;<br />
+        5、活动期间以优惠价格购买的个别课程,自购买缴款之日起15日内提出申请可全额退还,超过上述期限或实际已发生课时消耗的则一律不予受理退费;<br />
+
+        <h2>五、违约责任</h2>
+        1、当事人一方不履行合同义务或者履行合同义务不符合约定的,均构成违约,守约方有权以书面通知的方式要求违约方纠正其违约行为并采取及时、有效的补救措施消除违约后果,并赔偿守约方因违约方之违约行为而遭致的损失。若违约方在收到守约方的上述通知后5日内未纠正其违约行为的,守约方有权在做出书面通知的情况下,单方解除本协议,违约方应赔偿守约方因此遭致的全部损失,包括但不限于守约方因此支付的律师费,差旅费等。<br />
+        2、乙方应始终维护甲方的知识产权以及品牌形象,本协议期间以及本协议因任何原因失效、被撤销、解除或终止后,均不得直接或间接通过任何公众媒体(包括但不限于传统大众媒体,以及微信、微博、博客、直播平台等社交平台)发表损害甲方(包括但不限于其产品、服务及甲方授课老师)声誉的言论或实施任何类似行为,否则乙方应赔偿甲方因此遭受的全部损失,包括但不限于守约方因此支付的律师费,差旅费等。<br />
+
+        <h2>六、保密条款</h2>
+        1、双方对本协议的条款、本协议的签订及履行情况以及通过签订和履行本协议而获知的对方及对方关联公司的任何信息均负有保密义务。任何一方不得以任何形式透露给第三方(有关法律法规要求和甲乙双方的法律、会计顾问、授权雇员除外),也不得擅自使用。<br />
+        2、本保密义务期限不受本协议期限的限制。本协议失效、被撤销、解除或终止等任何情况下,双方均应遵守本保密义务。<br />
+
+        <h2>七、不可抗力</h2>
+        1、一方遇到不可抗力事件(指甲乙双方无法控制、无法预见或即使预见也无法避免的事件,该事件妨碍、影响或延误任何一方履行本协议的全部或部分义务,该事件包括但不限于自然灾害(如水灾、地震等)、火灾、政府行为、法律或政策变化(含学校合作变化)、战争或其他任何类似事件)时,受影响方应当立即书面通知对方,并告知该不可抗力事件对本协议可能产生的影响,并在该不可抗力事件发生后5日内向对方提供该事件的详细信息及由有关机构出具的解释受影响方因此无法履行本协议项下全部或部分义务的相关证明。<br />
+        2、由于上述不可抗力事件致使受影响方无法履行或无法按时履行本协议项下全部或部分义务的,双方于彼此间均不承担违约责任,但双方应在相互信任的基础上协商解决,尽力减少不可抗力事件对本协议的影响,并采取合理方式进行调整(包括但不限于另行签订补充协议等),尽量避免损失的扩大。<br />
+        3、不可抗力事件消失或结束后,除双方另行协商一致外,受到不可抗力影响的一方应当立即采取措施继续履行本协议,如不可抗力事件持续30日以上的,则任何一方有权以书面通知对方的方式单方解除本协议。<br />
+
+        <h2>八、适用法律及争议解决方式</h2>
+        1、本协议的订立、效力、履行、解释及争议解决均适用中华人民共和国法律。<br />
+        2、因履行本协议发生的一切争议,甲乙双方应友好协商解决;如双方在发生争议后30日内无法通过协商解决时,任何一方有权向甲方所在地有管辖权的人民法院提起诉讼解决。<br />
+
+        <h2>九、其他</h2>
+        1、乙方同意,甲方有权在乙方学习、上课、排练和活动期间对其拍摄照片、视频,甲方对所拍摄的照片、视频享有著作权,乙方同意甲方可使用该等照片、视频。<br />
+        2、未经甲方事先书面同意,乙方不得将本课程转让给乙方以外的任何第三方。<br />
+        3、双方确认并同意,本协议的电子版本与纸质版本具有同等法律效力。双方发生争议时,电子合同打印件可作为证据提交。双方通过网络以在线方式签订本协议的 ,则以乙方点击“确认”或“同意”等相关按钮或以电子签名的方式作为对合同内容的同意、确认以及本协议的签署;如双方签订纸质版本协议的,则本协议壹式贰份,甲方盖公章或合同专用章并且乙方签字作为有效签署方式,并且双方各执壹份,每份具有同等法律效力。<br />
+        4、本协议自双方按照本协议约定方式签署之日起生效,有效期至双方履行完本协议约定的全部义务时止。<br />
+        5、本协议未尽事宜或对本协议的任何修改、补充,有双方另行协商后以签订补充协议的方式解决,补充协议与本协议具有同等法律效力;双方没有约定也没有协商一致的,遵照相关法律法规规定执行。<br />
+        6、双方因履行本协议而相互发出或者提供的所有通知、文件、资料,均以本协议中所列明的电话、APP推送消息送达,乙方如果变更电话号码的,应当自变更后1日内通知甲方且获得甲方确认,甲方通过电话、APP方式无法联系乙方或者甲方认为必要时,甲方也可以通过特快专递至乙方住址的方式向乙方发出上述任何通知、文件、资料等,并在甲方寄出特快专递后第5日视为送达成功。<br />
+
+        <div class="signature">
+        	<#if isShowVisualSeal>
+        	<#if ownershipType == 'OWN'>
+            <div class="sign">甲方签章:深圳大雅乐盟网络教育股份有限公司<img class="cachet" src="https://daya-online.oss-cn-beijing.aliyuncs.com/website/cachet.png" alt="" />
+                <span>日期:${.now?string("yyyy年MM月dd日")}</span>
+            </div>
+            <#else>
+            <div class="sign">甲方签章:武汉长乐长风乐器销售有限公司<img class="cachet" src="https://daya-online.oss-cn-beijing.aliyuncs.com/website/clcf.png" alt="" />
+                <span>日期:${.now?string("yyyy年MM月dd日")}</span>
+            </div>
+            </#if>
+            <div class="sign">乙方签章:${studentInfo.realName!}
+                <span>日期:${.now?string("yyyy年MM月dd日")} </span>
+            </div>
+        	<#else>
+        	<#if ownershipType == 'OWN'>
+            <div class="sign">甲方签章:深圳大雅乐盟网络教育股份有限公司
+                <span>日期:${.now?string("yyyy年MM月dd日")}</span>
+            </div>
+            <#else>
+            <div class="sign">甲方签章:武汉长乐长风乐器销售有限公司
+                <span>日期:${.now?string("yyyy年MM月dd日")}</span>
+            </div>
+            </#if>
+            <div class="sign">乙方签章:
+                <span>日期:${.now?string("yyyy年MM月dd日")} </span>
+            </div>
+        	</#if>
+        </div>
+    </div>
+</body>
+</html>

+ 18 - 0
mec-biz/src/main/resources/config/mybatis/ChildrenDayDegreeDetailDao.xml

@@ -79,4 +79,22 @@
         WHERE user_id_ = #{userId}
           AND status_ = #{status}
     </select>
+
+    <insert id="batchAdd" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id_">
+        INSERT INTO children_day_degree_detail
+        (reserve_id_, user_id_, type_, subject_id_, level_, price_,status_,order_id_,create_time_,update_time)
+        VALUE
+        <foreach collection="details" item="detail" separator=",">
+            (#{detail.reserveId}, #{detail.userId}, #{detail.type}, #{detail.subjectId}, #{detail.level},
+            #{detail.price}, #{detail.status},#{detail.orderId},
+            now(),now())
+        </foreach>
+    </insert>
+
+    <update id="updateStatus">
+        UPDATE children_day_degree_detail
+        SET status_=#{status},
+            update_time = NOW()
+        WHERE order_id_ = #{orderId}
+    </update>
 </mapper>

+ 106 - 0
mec-biz/src/main/resources/config/mybatis/ChildrenDayDegreeInfoDao.xml

@@ -0,0 +1,106 @@
+<?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.ChildrenDayDegreeInfoDao">
+    <resultMap id="ChildrenDayDegreeInfo" type="com.ym.mec.biz.dal.entity.ChildrenDayDegreeInfo">
+        <!--@mbg.generated-->
+        <!--@Table children_day_degree_info-->
+        <id column="id_" property="id"/>
+        <result column="reserve_id_" property="reserveId"/>
+        <result column="user_id_" property="userId"/>
+        <result column="subject_id_" property="subjectId"/>
+        <result column="grade_level_" property="gradeLevel"/>
+        <result column="grade_price_" property="gradePrice"/>
+        <result column="theory_level_" property="theoryLevel"/>
+        <result column="theory_price_" property="theoryPrice"/>
+        <result column="vip_1v1_price_" property="vip1v1Price"/>
+        <result column="vip_1v2_price_" property="vip1v2Price"/>
+        <result column="theory_course_price_" property="theoryCoursePrice"/>
+        <result column="total_amount_" property="totalAmount"/>
+        <result column="create_time_" property="createTime"/>
+        <result column="update_time_" property="updateTime"/>
+    </resultMap>
+
+    <select id="get" parameterType="java.lang.Integer" resultMap="ChildrenDayDegreeInfo">
+        <!--@mbg.generated-->
+        select *
+        from children_day_degree_info
+        where id_ = #{id}
+    </select>
+
+    <delete id="delete" parameterType="java.lang.Integer">
+        <!--@mbg.generated-->
+        delete from children_day_degree_info
+        where id_ = #{id}
+    </delete>
+
+    <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.ChildrenDayDegreeInfo"
+            useGeneratedKeys="true">
+        <!--@mbg.generated-->
+        insert into children_day_degree_info (reserve_id_, user_id_, subject_id_, grade_level_, grade_price_,
+        theory_level_,
+        theory_price_, vip_1v1_price_, vip_1v2_price_, theory_course_price_, total_amount_,
+        create_time_, update_time_)
+        values (#{reserveId}, #{userId}, #{subjectId}, #{gradeLevel}, #{gradePrice}, #{theoryLevel},
+        #{theoryPrice}, #{vip1v1Price}, #{vip1v2Price}, #{theoryCoursePrice}, #{totalAmount},
+        NOW(), NOW())
+    </insert>
+
+    <update id="update" parameterType="com.ym.mec.biz.dal.entity.ChildrenDayDegreeInfo">
+        <!--@mbg.generated-->
+        update children_day_degree_info
+        <set>
+            <if test="reserveId != null">
+                reserve_id_ = #{reserveId},
+            </if>
+            <if test="userId != null">
+                user_id_ = #{userId},
+            </if>
+            <if test="subjectId != null">
+                subject_id_ = #{subjectId},
+            </if>
+            <if test="gradeLevel != null">
+                grade_level_ = #{gradeLevel},
+            </if>
+            <if test="gradePrice != null">
+                grade_price_ = #{gradePrice},
+            </if>
+            <if test="theoryLevel != null">
+                theory_level_ = #{theoryLevel},
+            </if>
+            <if test="theoryPrice != null">
+                theory_price_ = #{theoryPrice},
+            </if>
+            <if test="vip1v1Price != null">
+                vip_1v1_price_ = #{vip1v1Price},
+            </if>
+            <if test="vip1v2Price != null">
+                vip_1v2_price_ = #{vip1v2Price},
+            </if>
+            <if test="theoryCoursePrice != null">
+                theory_course_price_ = #{theoryCoursePrice},
+            </if>
+            <if test="totalAmount != null">
+                total_amount_ = #{totalAmount},
+            </if>
+            <if test="createTime != null">
+                create_time_ = #{createTime},
+            </if>
+            <if test="updateTime != null">
+                update_time_ = NOW(),
+            </if>
+        </set>
+        where id_ = #{id}
+    </update>
+
+    <!-- 分页查询 -->
+    <select id="queryPage" resultMap="ChildrenDayDegreeInfo" parameterType="map">
+        SELECT * FROM children_day_degree_info
+        <include refid="global.limit"/>
+    </select>
+
+    <!-- 查询当前表的总记录数 -->
+    <select id="queryCount" resultType="int">
+        SELECT COUNT(*)
+        FROM children_day_degree_info
+    </select>
+</mapper>

+ 6 - 2
mec-biz/src/main/resources/config/mybatis/OrganizationCloudTeacherFeeMapper.xml

@@ -7,6 +7,7 @@
         <id column="id_" property="id"/>
         <result column="organ_id_" property="organId"/>
         <result column="price_" property="price"/>
+        <result column="plus_price_" property="plusPrice"/>
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
         <result column="organName" property="organName"/>
@@ -30,8 +31,8 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.OrganizationCloudTeacherFee"
             useGeneratedKeys="true" keyColumn="id_" keyProperty="id">
         INSERT INTO organization_cloud_teacher_fee
-            (organ_id_, price_, create_time_, update_time_)
-        VALUES (#{organId}, #{price}, NOW(), NOW())
+            (organ_id_, price_,plus_price_, create_time_, update_time_)
+        VALUES (#{organId}, #{price},#{plusPrice}, NOW(), NOW())
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -41,6 +42,9 @@
             <if test="price != null">
                 price_ = #{price},
             </if>
+            <if test="plusPrice != null">
+                plus_price_ = #{plusPrice},
+            </if>
             update_time_=NOW()
         </set>
         WHERE id_ = #{id}

+ 27 - 3
mec-biz/src/main/resources/config/mybatis/StudentPreRegistrationMapper.xml

@@ -46,9 +46,33 @@
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="StudentPreRegistration">
-        SELECT *
-        FROM student_pre_registration
-        ORDER BY id_
+        SELECT spr.*
+        FROM student_pre_registration spr
+        <where>
+            <if test="musicGroupId != null">
+                and spr.music_group_id_ = #{musicGroupId}
+            </if>
+            <if test="isAllowAdjust != null">
+                and spr.is_allow_adjust_ = #{isAllowAdjust}
+            </if>
+            <if test="subjectId != null">
+                and (spr.subject_first_ = #{subjectId} or spr.subject_second_ = #{subjectId})
+            </if>
+            <if test="name != null">
+                and (spr.phone_ like concat('%',#{name},'%') or spr.user_name_ like concat('%',#{name},'%') or
+                spr.user_id_ like concat('%',#{name},'%'))
+            </if>
+            <if test="isAllowAdjust != null">
+                and spr.is_allow_adjust_ = #{isAllowAdjust}
+            </if>
+            <if test="kitPurchaseMethod != null">
+                and spr.kit_purchase_method_ = #{kitPurchaseMethod}
+            </if>
+            <if test="cloudTeacherMethod != null">
+                and spr.cloud_teacher_method_ = #{cloudTeacherMethod}
+            </if>
+        </where>
+        ORDER BY spr.id_
     </select>
 
     <!-- 向数据库增加一条记录 -->

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

@@ -256,10 +256,10 @@
                 AND FIND_IN_SET(su.organ_id_,#{queryInfo.organId})
             </if>
             <if test="queryInfo.startTime != null and queryInfo.startTime != ''">
-                AND cad.create_time_ >= #{queryInfo.startTime}
+                AAND DATE_FORMAT(cad.create_time_,'%Y-%m-%d') >= #{queryInfo.startTime}
             </if>
             <if test="queryInfo.endTime != null and queryInfo.startTime != ''">
-                AND cad.create_time_ &lt;= #{queryInfo.endTime}
+                AND DATE_FORMAT(cad.create_time_,'%Y-%m-%d') &lt;= #{queryInfo.endTime}
             </if>
         </where>
         GROUP BY cad.id_

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

@@ -129,10 +129,10 @@
 				AND FIND_IN_SET(su.organ_id_,#{queryInfo.organId})
 			</if>
 			<if test="queryInfo.startTime != null and queryInfo.startTime != ''">
-				AND cad.create_time_ >= #{queryInfo.startTime}
+				AND DATE_FORMAT(cad.create_time_,'%Y-%m-%d') >= #{queryInfo.startTime}
 			</if>
 			<if test="queryInfo.endTime != null and queryInfo.startTime != ''">
-				AND cad.create_time_ &lt;= #{queryInfo.endTime}
+				AND DATE_FORMAT(cad.create_time_,'%Y-%m-%d') &lt;= #{queryInfo.endTime}
 			</if>
 		</where>
 		GROUP BY cad.id_

+ 51 - 0
mec-student/src/main/java/com/ym/mec/student/controller/ChildrenDayDegreeDetailController.java

@@ -0,0 +1,51 @@
+package com.ym.mec.student.controller;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.StudentDao;
+import com.ym.mec.biz.dal.dto.ChildrenDayDetailDto;
+import com.ym.mec.biz.dal.dto.DegreeFeeDto;
+import com.ym.mec.biz.dal.dto.DegreePayDto;
+import com.ym.mec.biz.dal.entity.ChildrenDayDegreeDetail;
+import com.ym.mec.biz.dal.entity.ChildrenDayReserve;
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
+import com.ym.mec.biz.service.ChildrenDayDegreeDetailService;
+import com.ym.mec.biz.service.ChildrenDayReserveService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+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.http.HttpStatus;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+@RequestMapping("childrenDayDegreeDetail")
+@Api(tags = "6.1儿童节活动报名详情")
+@RestController
+public class ChildrenDayDegreeDetailController extends BaseController {
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private ChildrenDayDegreeDetailService childrenDayDegreeDetailService;
+
+
+    @ApiOperation(value = "获取用户已报名的详情,类型 1-乐器考级 2-乐理考级 3-vip1v1,4-vip1v2 5-乐理课")
+    @GetMapping("/getUserDegreeInfo")
+    public HttpResponseResult<ChildrenDayDetailDto> getFeeInfo() {
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if (Objects.isNull(user)) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+        List<ChildrenDayDegreeDetail> userDegreeInfo = childrenDayDegreeDetailService.getUserDegreeInfo(user.getId());
+        ChildrenDayDetailDto childrenDayDetailDto = new ChildrenDayDetailDto();
+        childrenDayDetailDto.setUser(user);
+        childrenDayDetailDto.setChildrenDayDegreeDetails(userDegreeInfo);
+        return succeed(childrenDayDetailDto);
+    }
+
+}

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/config/ResourceServerConfig.java

@@ -35,7 +35,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
 				.hasIpAddress("0.0.0.0/0")
 				.antMatchers("/v2/api-docs", "/classGroup/highClassGroups", "/code/*", "/api/*", "/appVersionInfo/queryByPlatform", "/eduDegree/*",
 						"/uploadFile", "/eduContracts/queryProduceContract","/activity/doubleEleven2020Statis","/replacementInstrument/queryPage",
-						"/replacementInstrumentActivity/queryReplacementsStat").permitAll().anyRequest().authenticated().and().httpBasic();
+						"/replacementInstrumentActivity/queryReplacementsStat","/eduStudentRegistration/queryPreApplyList","/eduSubject/findSubSubjects").permitAll().anyRequest().authenticated().and().httpBasic();
 	}
 
 	@Override

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

@@ -6,6 +6,7 @@ import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.CourseViewTypeEnum;
 import com.ym.mec.biz.dal.page.NoClassMusicStudentQueryInfo;
 import com.ym.mec.biz.service.EmployeeService;
+
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -15,7 +16,9 @@ import java.io.IOException;
 import java.io.OutputStream;
 import java.util.Arrays;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import javax.servlet.http.HttpServletResponse;
 
@@ -23,6 +26,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -45,6 +49,7 @@ import com.ym.mec.biz.service.StudentRegistrationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.excel.POIUtil;
 

+ 82 - 0
mec-web/src/main/java/com/ym/mec/web/controller/education/EduStudentRegistrationController.java

@@ -0,0 +1,82 @@
+package com.ym.mec.web.controller.education;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.biz.dal.dao.MusicGroupDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderCourseSettingsDao;
+import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
+import com.ym.mec.biz.dal.dto.StudentPreRegistrationDto;
+import com.ym.mec.biz.dal.entity.StudentPreRegistration;
+import com.ym.mec.biz.dal.page.StudentPreRegistrationQueryInfo;
+import com.ym.mec.biz.service.EmployeeService;
+import com.ym.mec.biz.service.MusicGroupSubjectPlanService;
+import com.ym.mec.biz.service.StudentPreRegistrationService;
+import com.ym.mec.biz.service.StudentRegistrationService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.page.PageInfo;
+
+@RequestMapping("eduStudentRegistration")
+@Api(tags = "学生报名信息服务")
+@RestController
+public class EduStudentRegistrationController extends BaseController {
+
+    @Autowired
+    private StudentRegistrationService studentRegistrationService;
+    @Autowired
+    private MusicGroupSubjectPlanService musicGroupSubjectPlanService;
+    @Autowired
+    private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
+    @Autowired
+    private MusicGroupPaymentCalenderCourseSettingsDao musicGroupPaymentCalenderCourseSettingsDao;
+    @Autowired
+    private StudentPreRegistrationService studentPreRegistrationService;
+    @Autowired
+    private MusicGroupDao musicGroupDao;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private EmployeeService employeeService;
+
+    @ApiOperation(value = "乐团预报名列表分页查询")
+    @GetMapping("/queryPreApplyList")
+    public Object queryPreApplyList(StudentPreRegistrationQueryInfo queryInfo) {
+    	ModelMap model = new ModelMap();
+    	PageInfo<StudentPreRegistrationDto> dataList = studentPreRegistrationService.queryListForPage(queryInfo);
+    	model.put("dataList", dataList);
+    	
+    	Map<String, Object> params = new HashMap<String, Object>();
+		params.put("musicGroupId", queryInfo.getMusicGroupId());
+    	List<StudentPreRegistration> studentPreRegistrationList = studentPreRegistrationService.findAll(params);
+    	
+    	int instrument = 0;
+    	long cloudTeacher = 0;
+		for (StudentPreRegistration spr : studentPreRegistrationList) {
+			if (spr.getCloudTeacherMethod() != null && spr.getCloudTeacherMethod().equals("OWNED")) {
+				++cloudTeacher;
+			}
+			if (spr.getKitPurchaseMethod() != null && spr.getKitPurchaseMethod().equals("OWNED")) {
+				++instrument;
+			}
+		}
+    	
+    	model.put("instrument", instrument);
+    	model.put("cloudTeacher", cloudTeacher);
+    	model.put("total", studentPreRegistrationList.size());
+    	
+    	model.put("musicGroup", musicGroupDao.get(queryInfo.getMusicGroupId()));
+    	
+        return succeed(model);
+    }
+}

+ 27 - 0
mec-web/src/main/java/com/ym/mec/web/controller/education/EduSubjectController.java

@@ -0,0 +1,27 @@
+package com.ym.mec.web.controller.education;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.ym.mec.biz.service.SubjectService;
+import com.ym.mec.common.controller.BaseController;
+
+@RequestMapping("eduSubject")
+@Api(tags = "教务端科目服务")
+@RestController
+public class EduSubjectController extends BaseController {
+
+    @Autowired
+    private SubjectService subjectService;
+
+    @ApiOperation(value = "获取子集科目列表")
+    @GetMapping("/findSubSubjects")
+    public Object findSubSubjects(Integer tenantId){
+        return succeed(subjectService.findSubSubjects(tenantId));
+    }
+}