Browse Source

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

yonge 5 years ago
parent
commit
f858b02d7f
42 changed files with 942 additions and 69 deletions
  1. 4 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupCategoryDao.java
  2. 40 4
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupDao.java
  3. 10 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupDefaultClassesCycleDao.java
  4. 18 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupDefaultClassesUnitPriceDao.java
  5. 54 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeachingRecordBaseInfo.java
  6. 70 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/VipGroupCourseSchduleRecordDto.java
  7. 54 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/VipGroupStudentDto.java
  8. 28 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TeacherDefaultVipGroupSalaryController.java
  9. 56 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/VipGroup.java
  10. 11 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/VipGroupActivity.java
  11. 26 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/VipGroupCategory.java
  12. 12 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/VipGroupDefaultClassesCycle.java
  13. 2 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/VipGroupDefaultClassesUnitPrice.java
  14. 30 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/VipGroupQueryInfo.java
  15. 52 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/VipGroupTeachingRecordQueryInfo.java
  16. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/TeacherDefaultVipGroupSalaryService.java
  17. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/service/VipGroupCategoryService.java
  18. 4 0
      mec-biz/src/main/java/com/ym/mec/biz/service/VipGroupDefaultClassesCycleService.java
  19. 38 0
      mec-biz/src/main/java/com/ym/mec/biz/service/VipGroupService.java
  20. 5 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherDefaultVipGroupSalaryServiceImpl.java
  21. 7 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupCategoryServiceImpl.java
  22. 53 12
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupDefaultClassesCycleServiceImpl.java
  23. 10 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupDefaultClassesUnitPriceServiceImpl.java
  24. 69 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  25. BIN
      mec-biz/src/main/resources/config/certificate/yqpay.pfx
  26. 2 0
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  27. 7 1
      mec-biz/src/main/resources/config/mybatis/VipGroupActivityMapper.xml
  28. 11 2
      mec-biz/src/main/resources/config/mybatis/VipGroupCategoryMapper.xml
  29. 27 5
      mec-biz/src/main/resources/config/mybatis/VipGroupDefaultClassesCycleMapper.xml
  30. 43 0
      mec-biz/src/main/resources/config/mybatis/VipGroupDefaultClassesUnitPriceMapper.xml
  31. 133 0
      mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml
  32. 1 1
      mec-student/src/main/java/com/ym/mec/student/config/ResourceServerConfig.java
  33. 9 11
      mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java
  34. 4 2
      mec-thirdparty/src/main/java/com/ym/mec/thirdparty/yqpay/CFCARAUtil.java
  35. BIN
      mec-thirdparty/src/main/resources/config/certificate/sq_formal_sign.cer
  36. BIN
      mec-thirdparty/src/main/resources/config/certificate/yqpay.cer
  37. BIN
      mec-thirdparty/src/main/resources/config/certificate/yqpay.pfx
  38. 11 14
      mec-web/src/main/java/com/ym/mec/web/controller/VipGroupCategoryController.java
  39. 2 2
      mec-web/src/main/java/com/ym/mec/web/controller/VipGroupDefaultClassesCycleController.java
  40. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/VipGroupDefaultClassesUnitPriceController.java
  41. 14 1
      mec-web/src/main/java/com/ym/mec/web/controller/VipGroupManageController.java
  42. 12 0
      pom.xml

+ 4 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupCategoryDao.java

@@ -3,7 +3,10 @@ package com.ym.mec.biz.dal.dao;
 import com.ym.mec.biz.dal.entity.VipGroupCategory;
 import com.ym.mec.common.dal.BaseDAO;
 
+import java.util.List;
+
 public interface VipGroupCategoryDao extends BaseDAO<Integer, VipGroupCategory> {
 
-	
+    List<VipGroupCategory> findAllByOrgan(Long organId);
+
 }

+ 40 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupDao.java

@@ -1,9 +1,6 @@
 package com.ym.mec.biz.dal.dao;
 
-import com.ym.mec.biz.dal.dto.StudentManageVipGroupDto;
-import com.ym.mec.biz.dal.dto.StudentVipGroupDetailDto;
-import com.ym.mec.biz.dal.dto.StudentVipGroupShowListDto;
-import com.ym.mec.biz.dal.dto.VipGroupManageDetailDto;
+import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.VipGroup;
 import com.ym.mec.common.dal.BaseDAO;
@@ -15,6 +12,45 @@ public interface VipGroupDao extends BaseDAO<Long, VipGroup> {
 
 	/**
 	 * @Author: Joburgess
+	 * @Date: 2019/10/9
+	 * @params [organId]
+	 * @return java.util.List<com.ym.mec.biz.dal.entity.VipGroup>
+	 * @describe 根据部门获取
+	 */
+	List<VipGroup> findAllByOrgan(Map<String,Object> params);
+	int countVipGroupByOrgan(Map<String,Object> params);
+
+	/**
+	 * @Author: Joburgess
+	 * @Date: 2019/10/9
+	 * @params [params]
+	 * @return java.util.List<com.ym.mec.biz.dal.dto.VipGroupStudentDto>
+	 * @describe 获取小课学员
+	 */
+	List<VipGroupStudentDto> findVipGroupStudents(Map<String,Object> params);
+	int countVipGroupStudents(Map<String,Object> params);
+
+	/**
+	 * @Author: Joburgess
+	 * @Date: 2019/10/9
+	 * @params [params]
+	 * @return java.util.List<com.ym.mec.biz.dal.dto.VipGroupCourseSchduleRecordDto>
+	 * @describe 获取vip课教学记录
+	 */
+	List<VipGroupCourseSchduleRecordDto> findTeachingRecord(Map<String,Object> params);
+	int countTeachingRecord(Map<String,Object> params);
+
+	/**
+	 * @Author: Joburgess
+	 * @Date: 2019/10/9
+	 * @params [vipGroupId]
+	 * @return com.ym.mec.biz.dal.dto.TeachingRecordBaseInfo
+	 * @describe 获取vip课的总课次及已上课次
+	 */
+	TeachingRecordBaseInfo getClassTimes(Long vipGroupId);
+
+	/**
+	 * @Author: Joburgess
 	 * @Date: 2019/10/3
 	 * @params [userID]
 	 * @return java.util.List<com.ym.mec.biz.dal.dto.StudentManageVipGroupDto>

+ 10 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupDefaultClassesCycleDao.java

@@ -2,12 +2,19 @@ package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.entity.VipGroupDefaultClassesCycle;
 import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface VipGroupDefaultClassesCycleDao extends BaseDAO<Integer, VipGroupDefaultClassesCycle> {
 
 
     VipGroupDefaultClassesCycle checkMaxClassTimes(Integer maxClassTimes);
 
+    int batchInstert(List<VipGroupDefaultClassesCycle> vipGroupDefaultClassesCycles);
+
+    int deleteAllByOrgan(Long organId);
+
     /**
      * @Author: Joburgess
      * @Date: 2019/10/8
@@ -21,5 +28,7 @@ public interface VipGroupDefaultClassesCycleDao extends BaseDAO<Integer, VipGrou
     VipGroupDefaultClassesCycle findByMinClassTimes(Integer minClassTimes);
 
     int countAll();
-	
+
+    List<VipGroupDefaultClassesCycle> findAllByOrgan(@Param("organId") Long organId);
+
 }

+ 18 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupDefaultClassesUnitPriceDao.java

@@ -2,6 +2,9 @@ package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.entity.VipGroupDefaultClassesUnitPrice;
 import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface VipGroupDefaultClassesUnitPriceDao extends BaseDAO<Integer, VipGroupDefaultClassesUnitPrice> {
 
@@ -12,4 +15,19 @@ public interface VipGroupDefaultClassesUnitPriceDao extends BaseDAO<Integer, Vip
      */
     VipGroupDefaultClassesUnitPrice getByVipGroup(Long vipGroupId);
 
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/8
+     * @params [vipGroupCategoryId]
+     * @return com.ym.mec.biz.dal.entity.VipGroupDefaultClassesUnitPrice
+     * @describe 根据vip课类型获取课时收费设置
+     */
+    VipGroupDefaultClassesUnitPrice getByVipGroupCategory(@Param("vipGroupCategoryId") Long vipGroupCategoryId,
+                                                          @Param("organId") Long organId);
+
+
+    int updateByVipGroupCategory(VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice);
+
+    List<VipGroupDefaultClassesUnitPrice> findAllByOrgan(Long organId);
+
 }

+ 54 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeachingRecordBaseInfo.java

@@ -0,0 +1,54 @@
+package com.ym.mec.biz.dal.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/10/9
+ */
+public class TeachingRecordBaseInfo {
+
+    @ApiModelProperty(value = "总统课次",required = false)
+    private Integer totalClassTimes;
+
+    @ApiModelProperty(value = "当前课次",required = false)
+    private Integer currentClassTimes;
+
+    @ApiModelProperty(value = "已结算数量")
+    private Integer isSalaryNum;
+
+    @ApiModelProperty(value = "被投诉数量")
+    private Integer complaintsNum;
+
+    public Integer getTotalClassTimes() {
+        return totalClassTimes;
+    }
+
+    public void setTotalClassTimes(Integer totalClassTimes) {
+        this.totalClassTimes = totalClassTimes;
+    }
+
+    public Integer getCurrentClassTimes() {
+        return currentClassTimes;
+    }
+
+    public void setCurrentClassTimes(Integer currentClassTimes) {
+        this.currentClassTimes = currentClassTimes;
+    }
+
+    public Integer getIsSalaryNum() {
+        return isSalaryNum;
+    }
+
+    public void setIsSalaryNum(Integer isSalaryNum) {
+        this.isSalaryNum = isSalaryNum;
+    }
+
+    public Integer getComplaintsNum() {
+        return complaintsNum;
+    }
+
+    public void setComplaintsNum(Integer complaintsNum) {
+        this.complaintsNum = complaintsNum;
+    }
+}

+ 70 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/VipGroupCourseSchduleRecordDto.java

@@ -0,0 +1,70 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.enums.CourseStatusEnum;
+import com.ym.mec.biz.dal.enums.TeachModeEnum;
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/10/9
+ */
+public class VipGroupCourseSchduleRecordDto {
+
+    @ApiModelProperty(value = "课程编号")
+    private Long id;
+
+    @ApiModelProperty(value = "上课时间")
+    private java.util.Date startClassTime;
+
+    @ApiModelProperty(value = "课程状态  NOT_START未开始,SIGN_IN已签到,SIGN_OUT已签退")
+    private CourseStatusEnum status;
+
+    @ApiModelProperty(value = "课程类型")
+    private TeachModeEnum teachMode;
+
+    @ApiModelProperty(value = "结算状态")
+    private YesOrNoEnum isSalary;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Date getStartClassTime() {
+        return startClassTime;
+    }
+
+    public void setStartClassTime(Date startClassTime) {
+        this.startClassTime = startClassTime;
+    }
+
+    public CourseStatusEnum getStatus() {
+        return status;
+    }
+
+    public void setStatus(CourseStatusEnum status) {
+        this.status = status;
+    }
+
+    public TeachModeEnum getTeachMode() {
+        return teachMode;
+    }
+
+    public void setTeachMode(TeachModeEnum teachMode) {
+        this.teachMode = teachMode;
+    }
+
+    public YesOrNoEnum getIsSalary() {
+        return isSalary;
+    }
+
+    public void setIsSalary(YesOrNoEnum isSalary) {
+        this.isSalary = isSalary;
+    }
+}

+ 54 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/VipGroupStudentDto.java

@@ -0,0 +1,54 @@
+package com.ym.mec.biz.dal.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/10/9
+ */
+public class VipGroupStudentDto {
+
+    @ApiModelProperty(value = "用户编号")
+    private Long id;
+
+    @ApiModelProperty(value = "用户名称")
+    private String userName;
+
+    @ApiModelProperty(value = "课时总数")
+    private Integer totalClassTimes;
+
+    @ApiModelProperty(value = "当前课时")
+    private Integer currentClassTimes;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public Integer getTotalClassTimes() {
+        return totalClassTimes;
+    }
+
+    public void setTotalClassTimes(Integer totalClassTimes) {
+        this.totalClassTimes = totalClassTimes;
+    }
+
+    public Integer getCurrentClassTimes() {
+        return currentClassTimes;
+    }
+
+    public void setCurrentClassTimes(Integer currentClassTimes) {
+        this.currentClassTimes = currentClassTimes;
+    }
+}

+ 28 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TeacherDefaultVipGroupSalaryController.java

@@ -0,0 +1,28 @@
+package com.ym.mec.biz.dal.entity;
+
+import com.ym.mec.biz.service.TeacherDefaultVipGroupSalaryService;
+import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/10/9
+ */
+@Api(tags = "老师默认VIP课薪酬")
+@RequestMapping("teacherDefaultVipGroupSalary")
+@RestController
+public class TeacherDefaultVipGroupSalaryController extends BaseController {
+
+    private TeacherDefaultVipGroupSalaryService teacherDefaultVipGroupSalaryService;
+
+    @ApiOperation(value = "根据老师编号及课程类型编号获取默认课酬")
+    @GetMapping("/findByTeacherAndCategory")
+    public Object findByTeacherAndCategory(Long userId, Long categoryId){
+        return succeed(teacherDefaultVipGroupSalaryService.findByTeacherAndCategory(userId,categoryId));
+    }
+
+}

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

@@ -2,6 +2,7 @@ package com.ym.mec.biz.dal.entity;
 
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
 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;
 
@@ -23,6 +24,9 @@ public class VipGroup {
 	@ApiModelProperty(value = "用户编号", required = false)
 	private Integer userId;
 
+	@ApiModelProperty(value = "用户名")
+	private String userName;
+
 	/** 单节课时 */
 	@ApiModelProperty(value = "单节课时", required = false)
 	private Integer singleClassMinutes;
@@ -80,6 +84,58 @@ public class VipGroup {
 	@ApiModelProperty(value = "课程状态")
 	private VipGroupStatusEnum status;
 
+	@ApiModelProperty(value = "学生数量")
+	private Integer studentNum;
+
+	@ApiModelProperty(value = "课时总数")
+	private Integer totalClassTimes;
+
+	@ApiModelProperty(value = "当前课时")
+	private Integer currentClassTimes;
+
+	@ApiModelProperty(value = "是否已结算")
+	private YesOrNoEnum isSalary;
+
+	public YesOrNoEnum getIsSalary() {
+		return isSalary;
+	}
+
+	public void setIsSalary(YesOrNoEnum isSalary) {
+		this.isSalary = isSalary;
+	}
+
+	public String getUserName() {
+		return userName;
+	}
+
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
+
+	public Integer getStudentNum() {
+		return studentNum;
+	}
+
+	public void setStudentNum(Integer studentNum) {
+		this.studentNum = studentNum;
+	}
+
+	public Integer getTotalClassTimes() {
+		return totalClassTimes;
+	}
+
+	public void setTotalClassTimes(Integer totalClassTimes) {
+		this.totalClassTimes = totalClassTimes;
+	}
+
+	public Integer getCurrentClassTimes() {
+		return currentClassTimes;
+	}
+
+	public void setCurrentClassTimes(Integer currentClassTimes) {
+		this.currentClassTimes = currentClassTimes;
+	}
+
 	public VipGroupStatusEnum getStatus() {
 		return status;
 	}

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

@@ -61,7 +61,17 @@ public class VipGroupActivity {
 	
 	/** 结算标准 */
 	private String salarySettlementJson;
-	
+
+	private String vipGroupCategoryNames;
+
+	public String getVipGroupCategoryNames() {
+		return vipGroupCategoryNames;
+	}
+
+	public void setVipGroupCategoryNames(String vipGroupCategoryNames) {
+		this.vipGroupCategoryNames = vipGroupCategoryNames;
+	}
+
 	public void setId(Integer id){
 		this.id = id;
 	}

+ 26 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/VipGroupCategory.java

@@ -1,9 +1,11 @@
 package com.ym.mec.biz.dal.entity;
 
+import com.fasterxml.jackson.annotation.JsonInclude;
 import io.swagger.annotations.ApiModelProperty;
-
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
+import java.math.BigDecimal;
+
 /**
  * 对应数据库表(vip_group_category):
  */
@@ -29,7 +31,29 @@ public class VipGroupCategory {
 	
 	@ApiModelProperty(value = "学生数",required = false)
 	private Integer studentNum;
-	
+
+	@ApiModelProperty(value = "线上课单价",required = false)
+	private BigDecimal onlineClassesUnitPrice;
+
+	@ApiModelProperty(value = "线下课单价",required = false)
+	private BigDecimal offlineClassesUnitPrice;
+
+	public BigDecimal getOnlineClassesUnitPrice() {
+		return onlineClassesUnitPrice;
+	}
+
+	public void setOnlineClassesUnitPrice(BigDecimal onlineClassesUnitPrice) {
+		this.onlineClassesUnitPrice = onlineClassesUnitPrice;
+	}
+
+	public BigDecimal getOfflineClassesUnitPrice() {
+		return offlineClassesUnitPrice;
+	}
+
+	public void setOfflineClassesUnitPrice(BigDecimal offlineClassesUnitPrice) {
+		this.offlineClassesUnitPrice = offlineClassesUnitPrice;
+	}
+
 	public void setId(Integer id){
 		this.id = id;
 	}

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

@@ -29,7 +29,18 @@ public class VipGroupDefaultClassesCycle {
 	
 	/**  */
 	private java.util.Date updateTime;
-	
+
+	@ApiModelProperty(value = "部门编号")
+	private Long organId;
+
+	public Long getOrganId() {
+		return organId;
+	}
+
+	public void setOrganId(Long organId) {
+		this.organId = organId;
+	}
+
 	public void setId(Integer id){
 		this.id = id;
 	}

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

@@ -1,11 +1,10 @@
 package com.ym.mec.biz.dal.entity;
 
 import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import java.math.BigDecimal;
 
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
 /**
  * 对应数据库表(vip_group_default_classes_unit_price_):
  */
@@ -17,7 +16,7 @@ public class VipGroupDefaultClassesUnitPrice {
 	@ApiModelProperty(value = "所属分部",required = false)
 	private Integer organId;
 	
-	@ApiModelProperty(value = "类别",required = false)
+	@ApiModelProperty(value = "类别编号",required = false)
 	private Integer vipGroupCategoryId;
 	
 	@ApiModelProperty(value = "线上课单价",required = false)

+ 30 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/VipGroupQueryInfo.java

@@ -0,0 +1,30 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/10/9
+ */
+public class VipGroupQueryInfo extends QueryInfo {
+
+    private Long organId;
+
+    private Long vipGroupId;
+
+    public Long getVipGroupId() {
+        return vipGroupId;
+    }
+
+    public void setVipGroupId(Long vipGroupId) {
+        this.vipGroupId = vipGroupId;
+    }
+
+    public Long getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Long organId) {
+        this.organId = organId;
+    }
+}

+ 52 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/VipGroupTeachingRecordQueryInfo.java

@@ -0,0 +1,52 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+
+import java.util.Date;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/10/9
+ */
+public class VipGroupTeachingRecordQueryInfo extends QueryInfo {
+
+    private Date startTime;
+
+    private Date endTime;
+
+    private String teachMode;
+
+    private String status;
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getTeachMode() {
+        return teachMode;
+    }
+
+    public void setTeachMode(String teachMode) {
+        this.teachMode = teachMode;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+}

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/TeacherDefaultVipGroupSalaryService.java

@@ -5,4 +5,13 @@ import com.ym.mec.common.service.BaseService;
 
 public interface TeacherDefaultVipGroupSalaryService extends BaseService<Long, TeacherDefaultVipGroupSalary> {
 
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/9
+     * @params [userId, categoryId]
+     * @return com.ym.mec.biz.dal.entity.TeacherDefaultVipGroupSalary
+     * @describe 根据用户及课程类型获取教师默认vip课酬
+     */
+    TeacherDefaultVipGroupSalary findByTeacherAndCategory(Long userId, Long categoryId);
+
 }

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

@@ -3,6 +3,9 @@ package com.ym.mec.biz.service;
 import com.ym.mec.biz.dal.entity.VipGroupCategory;
 import com.ym.mec.common.service.BaseService;
 
+import java.util.List;
+
 public interface VipGroupCategoryService extends BaseService<Integer, VipGroupCategory> {
 
+    List<VipGroupCategory> findAllByOrgan(Long organId);
 }

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

@@ -3,6 +3,10 @@ package com.ym.mec.biz.service;
 import com.ym.mec.biz.dal.entity.VipGroupDefaultClassesCycle;
 import com.ym.mec.common.service.BaseService;
 
+import java.util.List;
+
 public interface VipGroupDefaultClassesCycleService extends BaseService<Integer, VipGroupDefaultClassesCycle> {
 
+    List<VipGroupDefaultClassesCycle> findAllByOrgan(Long organId);
+
 }

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

@@ -5,6 +5,8 @@ import com.ym.mec.biz.dal.entity.StudentApplyRefunds;
 import com.ym.mec.biz.dal.entity.VipGroup;
 import com.ym.mec.biz.dal.page.StudentVipGroupQueryInfo;
 import com.ym.mec.biz.dal.page.VipGroupAttendanceQueryInfo;
+import com.ym.mec.biz.dal.page.VipGroupQueryInfo;
+import com.ym.mec.biz.dal.page.VipGroupTeachingRecordQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 
@@ -30,6 +32,42 @@ public interface VipGroupService extends BaseService<Long, VipGroup> {
 
     /**
      * @Author: Joburgess
+     * @Date: 2019/10/9
+     * @params [queryInfo]
+     * @return com.ym.mec.common.page.PageInfo
+     * @describe 获取vip课列表
+     */
+    PageInfo findVipGroups(VipGroupQueryInfo queryInfo);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/9
+     * @params [queryInfo]
+     * @return com.ym.mec.common.page.PageInfo
+     * @describe 获取vip课教学记录
+     */
+    PageInfo findVipGroupTeachingRecord(VipGroupTeachingRecordQueryInfo queryInfo);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/9
+     * @params [vipGroupId]
+     * @return com.ym.mec.biz.dal.dto.TeachingRecordBaseInfo
+     * @describe 获取vip课教学记录基本信息
+     */
+    TeachingRecordBaseInfo findTeachingRecordBaseInfo(Long vipGroupId);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/9
+     * @params [queryInfo]
+     * @return com.ym.mec.common.page.PageInfo
+     * @describe 获取vip课学员
+     */
+    PageInfo findVipGroupStudents(VipGroupQueryInfo queryInfo);
+
+    /**
+     * @Author: Joburgess
      * @Date: 2019/10/3
      * @params [vipGroupId]
      * @return com.ym.mec.biz.dal.dto.VipGroupManageDetailDto

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

@@ -19,5 +19,9 @@ public class TeacherDefaultVipGroupSalaryServiceImpl extends BaseServiceImpl<Lon
 	public BaseDAO<Long, TeacherDefaultVipGroupSalary> getDAO() {
 		return teacherDefaultVipGroupSalaryDao;
 	}
-	
+
+	@Override
+	public TeacherDefaultVipGroupSalary findByTeacherAndCategory(Long userId, Long categoryId) {
+		return teacherDefaultVipGroupSalaryDao.findByTeacherAndCategory(userId,categoryId);
+	}
 }

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

@@ -9,6 +9,8 @@ import com.ym.mec.biz.service.VipGroupCategoryService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 
+import java.util.List;
+
 @Service
 public class VipGroupCategoryServiceImpl extends BaseServiceImpl<Integer, VipGroupCategory>  implements VipGroupCategoryService {
 	
@@ -19,5 +21,9 @@ public class VipGroupCategoryServiceImpl extends BaseServiceImpl<Integer, VipGro
 	public BaseDAO<Integer, VipGroupCategory> getDAO() {
 		return vipGroupCategoryDao;
 	}
-	
+
+	@Override
+	public List<VipGroupCategory> findAllByOrgan(Long organId) {
+		return vipGroupCategoryDao.findAllByOrgan(organId);
+	}
 }

+ 53 - 12
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupDefaultClassesCycleServiceImpl.java

@@ -1,14 +1,18 @@
 package com.ym.mec.biz.service.impl;
 
-import com.ym.mec.common.exception.BizException;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
 import com.ym.mec.biz.dal.dao.VipGroupDefaultClassesCycleDao;
 import com.ym.mec.biz.dal.entity.VipGroupDefaultClassesCycle;
 import com.ym.mec.biz.service.VipGroupDefaultClassesCycleService;
 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 org.springframework.transaction.annotation.Transactional;
+
+import java.util.Comparator;
+import java.util.List;
+import java.util.stream.Collectors;
 
 @Service
 public class VipGroupDefaultClassesCycleServiceImpl extends BaseServiceImpl<Integer, VipGroupDefaultClassesCycle>  implements VipGroupDefaultClassesCycleService {
@@ -23,16 +27,53 @@ public class VipGroupDefaultClassesCycleServiceImpl extends BaseServiceImpl<Inte
 
 	@Override
 	public long insert(VipGroupDefaultClassesCycle bean) {
-		if(vipGroupDefaultClassesCycleDao.countAll()>0){
-
+		if(vipGroupDefaultClassesCycleDao.countAll()<=0){
+			bean.setMinClassTimes(0);
+			return super.insert(bean);
 		}else{
-
+			VipGroupDefaultClassesCycle checkMaxClassTimes = vipGroupDefaultClassesCycleDao.checkMaxClassTimes(bean.getMaxClassTimes());
+			if(null!=checkMaxClassTimes){
+				throw new BizException("已存在包含该课次的设置!");
+			}
+			List<VipGroupDefaultClassesCycle> allRecord = vipGroupDefaultClassesCycleDao.findAllByOrgan(bean.getOrganId());
+			allRecord.add(bean);
+			allRecord=createMinClassTimess(allRecord);
+			vipGroupDefaultClassesCycleDao.deleteAllByOrgan(bean.getOrganId());
+			return vipGroupDefaultClassesCycleDao.batchInstert(allRecord);
 		}
-		VipGroupDefaultClassesCycle checkMaxClassTimes = vipGroupDefaultClassesCycleDao.checkMaxClassTimes(bean.getMaxClassTimes());
-		if(null!=checkMaxClassTimes){
-			throw new BizException("已存在包含该课次的设置!");
+	}
+
+	@Override
+	public List<VipGroupDefaultClassesCycle> findAllByOrgan(Long organId) {
+		return vipGroupDefaultClassesCycleDao.findAllByOrgan(organId);
+	}
+
+	@Override
+	public int update(VipGroupDefaultClassesCycle bean) {
+		vipGroupDefaultClassesCycleDao.delete(bean.getId());
+		return (int) insert(bean);
+	}
+
+	@Transactional(rollbackFor = Exception.class)
+	@Override
+	public int delete(Integer id) {
+		VipGroupDefaultClassesCycle bean=vipGroupDefaultClassesCycleDao.get(id);
+		super.delete(id);
+		List<VipGroupDefaultClassesCycle> allRecord = vipGroupDefaultClassesCycleDao.findAllByOrgan(bean.getOrganId());
+		allRecord=createMinClassTimess(allRecord);
+		vipGroupDefaultClassesCycleDao.deleteAllByOrgan(bean.getOrganId());
+		return vipGroupDefaultClassesCycleDao.batchInstert(allRecord);
+	}
+
+	private List<VipGroupDefaultClassesCycle> createMinClassTimess(List<VipGroupDefaultClassesCycle> vipGroupDefaultClassesCycles){
+		vipGroupDefaultClassesCycles = vipGroupDefaultClassesCycles.stream().sorted(Comparator.comparing(VipGroupDefaultClassesCycle::getMaxClassTimes)).collect(Collectors.toList());
+		for(int i=0;i<vipGroupDefaultClassesCycles.size();i++){
+			if(i==0){
+				vipGroupDefaultClassesCycles.get(i).setMinClassTimes(0);
+			}else{
+				vipGroupDefaultClassesCycles.get(i).setMinClassTimes(vipGroupDefaultClassesCycles.get(i-1).getMaxClassTimes()+1);
+			}
 		}
-		vipGroupDefaultClassesCycleDao.findByMaxClassTimes(bean.getMaxClassTimes());
-		return super.insert(bean);
+		return vipGroupDefaultClassesCycles;
 	}
 }

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

@@ -19,5 +19,14 @@ public class VipGroupDefaultClassesUnitPriceServiceImpl extends BaseServiceImpl<
 	public BaseDAO<Integer, VipGroupDefaultClassesUnitPrice> getDAO() {
 		return vipGroupDefaultClassesUnitPriceDao;
 	}
-	
+
+	@Override
+	public long insert(VipGroupDefaultClassesUnitPrice bean) {
+		VipGroupDefaultClassesUnitPrice byVipGroupCategory = vipGroupDefaultClassesUnitPriceDao.getByVipGroupCategory( bean.getVipGroupCategoryId().longValue(),bean.getOrganId().longValue());
+		if(null!=byVipGroupCategory){
+			return vipGroupDefaultClassesUnitPriceDao.updateByVipGroupCategory(bean);
+		}else{
+			return super.insert(bean);
+		}
+	}
 }

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

@@ -9,6 +9,8 @@ import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.dal.page.StudentVipGroupQueryInfo;
 import com.ym.mec.biz.dal.page.VipGroupAttendanceQueryInfo;
+import com.ym.mec.biz.dal.page.VipGroupQueryInfo;
+import com.ym.mec.biz.dal.page.VipGroupTeachingRecordQueryInfo;
 import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.VipGroupService;
 import com.ym.mec.common.dal.BaseDAO;
@@ -134,6 +136,71 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 	}
 
 	@Override
+	public PageInfo findVipGroups(VipGroupQueryInfo queryInfo) {
+		PageInfo pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+		Map<String, Object> params = new HashMap<String, Object>();
+		MapUtil.populateMap(params, queryInfo);
+
+		List dataList = null;
+		int count = vipGroupDao.countVipGroupByOrgan(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			dataList = vipGroupDao.findAllByOrgan(params);
+		}
+		if (count == 0) {
+			dataList = new ArrayList<>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
+
+	@Override
+	public PageInfo findVipGroupTeachingRecord(VipGroupTeachingRecordQueryInfo queryInfo) {
+		PageInfo pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+		Map<String, Object> params = new HashMap<String, Object>();
+		MapUtil.populateMap(params, queryInfo);
+
+		List dataList = null;
+		int count = vipGroupDao.countTeachingRecord(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			dataList = vipGroupDao.findTeachingRecord(params);
+		}
+		if (count == 0) {
+			dataList = new ArrayList<>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
+
+	@Override
+	public TeachingRecordBaseInfo findTeachingRecordBaseInfo(Long vipGroupId) {
+		return null;
+	}
+
+	@Override
+	public PageInfo findVipGroupStudents(VipGroupQueryInfo queryInfo) {
+		PageInfo pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+		Map<String, Object> params = new HashMap<String, Object>();
+		MapUtil.populateMap(params, queryInfo);
+
+		List dataList = null;
+		int count = vipGroupDao.countVipGroupStudents(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			dataList = vipGroupDao.findVipGroupStudents(params);
+		}
+		if (count == 0) {
+			dataList = new ArrayList<>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
+
+	@Override
 	public VipGroupManageDetailDto getVipGroupDetail(Long vipGroupId) {
 		VipGroupManageDetailDto vipGroupBaseInfo = vipGroupDao.getVipGroupBaseInfo(vipGroupId);
 		return vipGroupBaseInfo;
@@ -275,8 +342,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 	@Override
 	public void applyRefund(Long vipGroupId,Long studentId) {
+		SysUser sysUser=sysUserFeignService.queryUserInfo();
     	if(null==studentId){
-    		studentId=sysUserFeignService.queryUserInfo().getId().longValue();
+    		studentId=sysUser.getId().longValue();
 		}
 		StudentApplyRefunds studentApplyRefunds=new StudentApplyRefunds();
 		StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.findByStudentVipGroup(vipGroupId,studentId);

BIN
mec-biz/src/main/resources/config/certificate/yqpay.pfx


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

@@ -30,6 +30,7 @@
         <result column="school_name_" property="schoolName"/>
         <result column="attendance_status_" property="attendanceStatus" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="seal_class_id_" property="sealClassId"/>
+        <result column="paran_value_" property="vipAppealDaysRange"/>
     </resultMap>
 
     <resultMap type="com.ym.mec.biz.dal.entity.StudentCourseScheduleRecordDto" id="studentCourseScheduleRecord">
@@ -256,6 +257,7 @@
             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}

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

@@ -25,6 +25,7 @@
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 		<result column="salary_settlement_json_" property="salarySettlementJson" />
+		<result column="vip_group_category_names_" property="vipGroupCategoryNames"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -120,8 +121,13 @@ type_ = #{type},
 
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="VipGroupActivity" parameterType="map">
-		SELECT * FROM vip_group_activity
+		SELECT
+		vga.*,
+		GROUP_CONCAT(vgc.name_) vip_group_category_names_
+		FROM vip_group_activity vga
+		LEFT JOIN vip_group_category vgc ON FIND_IN_SET(vgc.id_,vga.vip_group_category_id_list_)
 		<include refid="queryCondition"/>
+		GROUP BY vga.id_
 		ORDER BY id_ <include refid="global.limit"/>
 	</select>
 	

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

@@ -12,6 +12,8 @@
 		<result column="update_time_" property="updateTime" />
 		<result column="single_class_minutes_" property="singleClassMinutes" />
 		<result column="student_num_" property="studentNum" />
+		<result column="online_classes_unit_price_" property="onlineClassesUnitPrice" />
+		<result column="offline_classes_unit_price_" property="offlineClassesUnitPrice" />
 	</resultMap>
 
 	<!-- 根据主键查询一条记录 -->
@@ -22,8 +24,15 @@
 
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="VipGroupCategory">
-		SELECT * FROM vip_group_category
-		WHERE del_flag_=0
+		SELECT vgc.* FROM vip_group_category vgc
+		WHERE vgc.del_flag_=0
+		ORDER BY id_
+	</select>
+
+	<select id="findAllByOrgan" resultMap="VipGroupCategory">
+		SELECT vgc.*,vgdcup.online_classes_unit_price_,vgdcup.offline_classes_unit_price_ FROM vip_group_category vgc
+		LEFT JOIN vip_group_default_classes_unit_price_ vgdcup ON vgc.id_=vgdcup.vip_group_category_id_ AND vgdcup.organ_id_=#{organId}
+		WHERE vgc.del_flag_=0
 		ORDER BY id_
 	</select>
 

+ 27 - 5
mec-biz/src/main/resources/config/mybatis/VipGroupDefaultClassesCycleMapper.xml

@@ -13,6 +13,7 @@
 		<result column="month_" property="month" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+		<result column="organ_id_" property="organId"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -26,13 +27,22 @@
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
-	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.VipGroupDefaultClassesCycle" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+	<insert id="batchInstert" parameterType="com.ym.mec.biz.dal.entity.VipGroupDefaultClassesCycle" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		<!--
 		<selectKey resultClass="int" keyProperty="id" > 
 		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
 		</selectKey>
 		-->
-		INSERT INTO vip_group_default_classes_cycle (id_,min_class_times_,max_class_times_,month_,create_time_,update_time_) VALUES(#{id},#{minClassTimes},#{maxClassTimes},#{month},now(),now())
+		INSERT INTO vip_group_default_classes_cycle (id_,min_class_times_,max_class_times_,month_,create_time_,update_time_,organ_id_)
+		VALUE
+		<foreach collection="list" item="vipGroupDefaultClassesCycle" separator=",">
+			(#{vipGroupDefaultClassesCycle.id},#{vipGroupDefaultClassesCycle.minClassTimes},#{vipGroupDefaultClassesCycle.maxClassTimes},#{vipGroupDefaultClassesCycle.month},now(),now(),#{vipGroupDefaultClassesCycle.organId})
+		</foreach>
+	</insert>
+
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.VipGroupDefaultClassesCycle" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO vip_group_default_classes_cycle (id_,min_class_times_,max_class_times_,month_,create_time_,update_time_,organ_id_) VALUES(#{id},#{minClassTimes},#{maxClassTimes},#{month},now(),now(),#{organId})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -63,6 +73,9 @@ create_time_ = #{createTime},
 	<delete id="delete" >
 		DELETE FROM vip_group_default_classes_cycle WHERE id_ = #{id} 
 	</delete>
+	<delete id="deleteAllByOrgan" >
+		DELETE FROM vip_group_default_classes_cycle WHERE organ_id_=#{organId}
+	</delete>
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="VipGroupDefaultClassesCycle" parameterType="map">
@@ -78,9 +91,8 @@ create_time_ = #{createTime},
 			*
 		FROM
 			vip_group_default_classes_cycle
-			WHERE min_class_times_&gt;#{minClassTimes}
-			AND min_class_times_&gt;#{minClassTimes}
-		ORDER BY min_class_times_ LIMIT 1
+			WHERE max_class_times_=#{maxClassTimes}
+		ORDER BY max_class_times_ LIMIT 1
 	</select>
 	<select id="findByMaxClassTimes" resultMap="VipGroupDefaultClassesCycle">
 		SELECT
@@ -105,4 +117,14 @@ create_time_ = #{createTime},
 			vip_group_default_classes_cycle
 		LIMIT 1
     </select>
+	<select id="findAllByOrgan" resultMap="VipGroupDefaultClassesCycle">
+		SELECT
+			*
+		FROM
+			vip_group_default_classes_cycle
+		<if test="organId!=null">
+			WHERE organ_id_=#{organId}
+		</if>
+		ORDER BY max_class_times_
+	</select>
 </mapper>

+ 43 - 0
mec-biz/src/main/resources/config/mybatis/VipGroupDefaultClassesUnitPriceMapper.xml

@@ -25,6 +25,15 @@
 	<select id="findAll" resultMap="VipGroupDefaultClassesUnitPrice">
 		SELECT * FROM vip_group_default_classes_unit_price_ ORDER BY id_
 	</select>
+
+	<!-- 全查询 -->
+	<select id="findAllByOrgan" resultMap="VipGroupDefaultClassesUnitPrice">
+		SELECT * FROM vip_group_default_classes_unit_price_
+		<if test="organId!=null">
+			WHERE organ_id_=#{organId}
+		</if>
+		ORDER BY id_
+	</select>
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.VipGroupDefaultClassesUnitPrice" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
@@ -62,6 +71,33 @@ create_time_ = #{createTime},
 </if>
 </set> WHERE id_ = #{id} 
 	</update>
+
+	<!-- 根据主键查询一条记录 -->
+	<update id="updateByVipGroupCategory" parameterType="com.ym.mec.biz.dal.entity.VipGroupDefaultClassesUnitPrice">
+		UPDATE vip_group_default_classes_unit_price_ <set>
+		<if test="organId != null">
+			organ_id_ = #{organId},
+		</if>
+		<if test="id != null">
+			id_ = #{id},
+		</if>
+		<if test="offlineClassesUnitPrice != null">
+			offline_classes_unit_price_ = #{offlineClassesUnitPrice},
+		</if>
+		<if test="onlineClassesUnitPrice != null">
+			online_classes_unit_price_ = #{onlineClassesUnitPrice},
+		</if>
+		<if test="updateTime != null">
+			update_time_ = #{updateTime},
+		</if>
+		<if test="vipGroupCategoryId != null">
+			vip_group_category_id_ = #{vipGroupCategoryId},
+		</if>
+		<if test="createTime != null">
+			create_time_ = #{createTime},
+		</if>
+	</set> WHERE organ_id_=#{organId} AND vip_group_category_id_=#{vipGroupCategoryId}
+	</update>
 	
 	<!-- 根据主键删除一条记录 -->
 	<delete id="delete" >
@@ -86,4 +122,11 @@ create_time_ = #{createTime},
 			LEFT JOIN vip_group_default_classes_unit_price_ vgdcup ON vg.vip_group_category_id_=vgdcup.vip_group_category_id_ AND t.organ_id_=vgdcup.organ_id_
 			WHERE vg.id_=#{vipGroupId}
 	</select>
+    <select id="getByVipGroupCategory" resultMap="VipGroupDefaultClassesUnitPrice">
+		SELECT
+			vgdcup.*
+		FROM
+			vip_group_default_classes_unit_price_ vgdcup
+		WHERE vgdcup.organ_id_=#{organId} AND vgdcup.vip_group_category_id_=#{vipGroupCategoryId}
+    </select>
 </mapper>

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

@@ -9,6 +9,7 @@
     <resultMap type="com.ym.mec.biz.dal.entity.VipGroup" id="VipGroup">
         <result column="id_" property="id"/>
         <result column="user_id_" property="userId"/>
+        <result column="username_" property="userName"/>
         <result column="single_class_minutes_" property="singleClassMinutes"/>
         <result column="payment_expire_date_" property="paymentExpireDate"/>
         <result column="courses_expire_date_" property="coursesExpireDate"/>
@@ -25,6 +26,10 @@
         <result column="online_classes_unit_price_" property="onlineClassesUnitPrice"/>
         <result column="offline_classes_unit_price_" property="offlineClassesUnitPrice"/>
         <result column="total_price_" property="totalPrice"/>
+        <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"/>
     </resultMap>
 
     <resultMap id="studentManageVipGroup" type="com.ym.mec.biz.dal.dto.StudentManageVipGroupDto" extends="VipGroup">
@@ -81,6 +86,42 @@
 		SELECT * FROM vip_group ORDER BY id_
 	</select>
 
+    <sql id="vipGroupQueryCondition">
+        <where>
+            <if test="search!=null and search!=''">
+                vg.name LIKE CONCAT('%',#{search},'%')
+            </if>
+            <if test="organId!=null">
+                AND FIND_IN_SET(#{organId},vg.organ_id_list_)
+            </if>
+        </where>
+    </sql>
+
+    <select id="findAllByOrgan" resultMap="VipGroup">
+		SELECT
+            vg.*,
+            su.username_,
+            cg.student_num_,
+            cg.total_class_times_,
+            cg.current_class_times_
+        FROM
+            vip_group vg
+            LEFT JOIN sys_user su ON vg.user_id_=su.id_
+            LEFT JOIN vip_group_class_group_mapper vgcgm ON vg.id_=vgcgm.vip_group_id_
+            LEFT JOIN class_group cg ON vgcgm.class_group_id_=cg.id_
+        <include refid="vipGroupQueryCondition"/>
+        ORDER BY vg.id_
+        <include refid="global.limit"/>
+	</select>
+
+    <select id="countVipGroupByOrgan" resultType="int">
+        SELECT
+        count(*)
+        FROM
+        vip_group vg
+        <include refid="vipGroupQueryCondition"/>
+    </select>
+
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.VipGroup" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
@@ -149,6 +190,9 @@
             <if test="totalPrice != null">
                 total_price_ = #{totalPrice},
             </if>
+            <if test="isSalary!=null">
+                is_salary_=#{isSalary}
+            </if>
         </set>
         WHERE id_ = #{id}
     </update>
@@ -304,4 +348,93 @@
             WHERE cs.status_="NOT_START" AND cs.type_="VIP" AND vgcgm.vip_group_id_=#{vipGroupId}
             GROUP BY cs.teach_mode_
     </select>
+
+    <resultMap id="vipGroupStudentDto" type="com.ym.mec.biz.dal.dto.VipGroupStudentDto">
+        <result column="id_" property="id"/>
+        <result column="username_" property="userName"/>
+        <result column="total_class_times_" property="totalClassTimes"/>
+        <result column="current_class_times_" property="currentClassTimes"/>
+    </resultMap>
+
+    <select id="findVipGroupStudents" resultMap="vipGroupStudentDto">
+        SELECT
+            su.id_,
+            su.username_,
+            cg.total_class_times_,
+            cg.current_class_times_
+        FROM
+            vip_group_class_group_mapper vgcgm
+            LEFT JOIN class_group cg ON vgcgm.class_group_id_=cg.id_
+            LEFT JOIN class_group_student_mapper cgsm ON vgcgm.class_group_id_=cgsm.class_group_id_
+            LEFT JOIN sys_user su ON cgsm.user_id_=su.id_
+        WHERE vgcgm.id_=#{vipGroupId}
+        ORDER BY su.id_
+        <include refid="global.limit"/>
+    </select>
+
+    <select id="countVipGroupStudents" resultType="int">
+        SELECT
+        count(*)
+        FROM
+        vip_group_class_group_mapper vgcgm
+        LEFT JOIN class_group cg ON vgcgm.class_group_id_=cg.id_
+        LEFT JOIN class_group_student_mapper cgsm ON vgcgm.class_group_id_=cgsm.class_group_id_
+        WHERE vgcgm.id_=#{vipGroupId}
+    </select>
+
+    <resultMap id="teachingRecord" type="com.ym.mec.biz.dal.dto.VipGroupCourseSchduleRecordDto">
+        <result column="id_" property="id"/>
+        <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"/>
+    </resultMap>
+
+    <sql id="teachingRecordQueryCondition">
+        <where>
+            vgcgm.vip_group_id_=#{vipGroupId}
+            <if test="startTime!=null and endTime!=null">
+                cs.class_date_ BETWEEN #{startTime} AND #{endTime}
+            </if>
+            <if test="teachMode!=null and teachMode!=''">
+                cs.teach_mode_=#{teachMode}
+            </if>
+            <if test="status!=null and status!=''">
+                cs.status_=#{status}
+            </if>
+        </where>
+    </sql>
+
+    <select id="findTeachingRecord">
+        SELECT
+            cs.id_,
+            CONCAT(cs.class_date_,' ',cs.start_class_time_) start_class_time_,
+            cs.status_,
+            cs.teach_mode_,
+            cs.is_salary_
+        FROM
+            vip_group_class_group_mapper vgcgm
+            LEFT JOIN course_schedule cs ON vgcgm.class_group_id_=cs.class_group_id_
+        <include refid="teachingRecordQueryCondition"/>
+        ORDER BY cs.id_
+        <include refid="global.limit"/>
+    </select>
+    <select id="countTeachingRecord">
+        SELECT
+        COUNT(*)
+        FROM
+        vip_group_class_group_mapper vgcgm
+        LEFT JOIN course_schedule cs ON vgcgm.class_group_id_=cs.class_group_id_
+        <include refid="teachingRecordQueryCondition"/>
+    </select>
+
+    <select id="getClassTimes" resultType="com.ym.mec.biz.dal.dto.TeachingRecordBaseInfo">
+        SELECT
+            cg.total_class_times_ totalClassTimes,
+            cg.current_class_times_ currentClassTimes
+        FROM
+            vip_group_class_group_mapper vgcgm
+            LEFT JOIN class_group cg ON vgcgm.class_group_id_=cg.id_
+        WHERE vgcgm.vip_group_id_=#{vipGroupId}
+    </select>
 </mapper>

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

@@ -22,7 +22,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
 
 	@Override
 	public void configure(HttpSecurity http) throws Exception {
-		http.csrf().disable().authorizeRequests().antMatchers("/v2/api-docs", "/register/findSubByMusicGroupId", "/register/add","/musicGroup/test","musicGroup/getSubjectGoodsAndInfo").permitAll().anyRequest().authenticated().and().httpBasic();
+		http.csrf().disable().authorizeRequests().antMatchers("/v2/api-docs", "/register/findSubByMusicGroupId", "/register/add","musicGroup/getSubjectGoodsAndInfo","/musicGroup/test").permitAll().anyRequest().authenticated().and().httpBasic();
 	}
 
 	@Override

+ 9 - 11
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java

@@ -13,6 +13,7 @@ import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.util.string.IdWorker;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -92,7 +93,7 @@ public class MusicGroupController extends BaseController {
     @ApiOperation(value = "乐团报名支付")
     @PostMapping("/pay")
     @ApiImplicitParams({@ApiImplicitParam(name = "registerPayDto", value = "支付信息", required = true, dataType = "Integer")})
-    public HttpResponseResult pay(@RequestBody RegisterPayDto registerPayDto) {
+    public HttpResponseResult pay(@RequestBody RegisterPayDto registerPayDto) throws Exception {
 
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         Integer userId = sysUser.getId();
@@ -137,16 +138,13 @@ public class MusicGroupController extends BaseController {
         if (amount.compareTo(orderAmount) != 0) {
             return failed("商品价格不符");
         }
-        Map<String, Object> rqMap = new LinkedHashMap<String, Object>();
-        rqMap.put("merNo", "07654478");
-        rqMap.put("version", "v1");
-        rqMap.put("notifyUrl", "https://notify.cpm");
-        rqMap.put("timestamp", new Date().getTime());
-        rqMap.put("apiContent", "ap");
-        rqMap.put("signType", "signType");
-        rqMap.put("sign", "sign");
-        rqMap.put("payUrl", "http://pay.url");
-        return succeed(rqMap);
+
+        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","测试订单","测试订单");
+
+        return succeed(payMap);
     }
 
     @GetMapping("/test")

+ 4 - 2
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/yqpay/CFCARAUtil.java

@@ -6,6 +6,7 @@ import cfca.sadk.lib.crypto.JCrypto;
 import cfca.sadk.system.FileHelper;
 import cfca.sadk.util.*;
 import cfca.sadk.x509.certificate.X509Cert;
+import org.hibernate.validator.internal.util.privilegedactions.GetClassLoader;
 import org.springframework.core.io.ClassPathResource;
 
 import javax.crypto.spec.SecretKeySpec;
@@ -49,7 +50,8 @@ public class CFCARAUtil {
     public static String signMessageByP1(String message, String pfxPath, String passWord) throws Exception{
        // File file = new ClassPathResource(pfxPath).getFile();
 
-        PrivateKey userPriKey = KeyUtil.getPrivateKeyFromPFX(new ClassPathResource(pfxPath).getInputStream(), passWord);
+
+        PrivateKey userPriKey = KeyUtil.getPrivateKeyFromPFX(CFCARAUtil.class.getClassLoader().getResourceAsStream(pfxPath), passWord);
         Signature signature = new Signature();
         byte[] base64P7SignedData = signature.p1SignMessage(Mechanism.SHA256_RSA, message.getBytes("UTF-8"), userPriKey, session);
         return new String(base64P7SignedData);
@@ -65,7 +67,7 @@ public class CFCARAUtil {
      */
     public static boolean verifyMessageByP1(String beforeSignedData, String afterSignedData, String certPath) throws Exception{
         //File file = new ClassPathResource(certPath).getFile();
-        X509Cert cert = new X509Cert(new ClassPathResource(certPath).getInputStream());
+        X509Cert cert = new X509Cert(CFCARAUtil.class.getClassLoader().getResourceAsStream(certPath));
         PublicKey publicKey = cert.getPublicKey();
         Signature signature = new Signature();
         return signature.p1VerifyMessage(Mechanism.SHA256_RSA, beforeSignedData.getBytes("UTF-8"), afterSignedData.getBytes("UTF-8"), publicKey, session);

BIN
mec-thirdparty/src/main/resources/config/certificate/sq_formal_sign.cer


BIN
mec-thirdparty/src/main/resources/config/certificate/yqpay.cer


BIN
mec-thirdparty/src/main/resources/config/certificate/yqpay.pfx


+ 11 - 14
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupCategoryController.java

@@ -1,20 +1,17 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.dal.entity.VipGroupCategory;
+import com.ym.mec.biz.service.VipGroupCategoryService;
+import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-
-import java.util.Date;
-
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.MediaType;
 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 com.ym.mec.biz.dal.entity.VipGroupCategory;
-import com.ym.mec.biz.service.VipGroupCategoryService;
-import com.ym.mec.common.controller.BaseController;
+import java.util.Date;
 
 @Api(tags = "vip课类别")
 @RequestMapping("vipGroupCategory")
@@ -25,19 +22,19 @@ public class VipGroupCategoryController extends BaseController {
 	private VipGroupCategoryService vipGroupCategoryService;
 
 	@ApiOperation("单查询")
-	@GetMapping(value = "/query", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@GetMapping(value = "/query")
 	public Object query(int id) {
 		return succeed(vipGroupCategoryService.get(id));
 	}
 
 	@ApiOperation("全查询")
-	@GetMapping(value = "/queryAll", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
-	public Object queryAll() {
-		return succeed(vipGroupCategoryService.findAll(null));
+	@GetMapping(value = "/queryAll")
+	public Object queryAll(Long organId) {
+		return succeed(vipGroupCategoryService.findAllByOrgan(organId));
 	}
 
 	@ApiOperation("新增")
-	@PostMapping(value = "/add", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@PostMapping(value = "/add")
 	public Object add(VipGroupCategory vipGroupCategory) {
 		Date date = new Date();
 		vipGroupCategory.setCreateTime(date);
@@ -48,7 +45,7 @@ public class VipGroupCategoryController extends BaseController {
 	}
 
 	@ApiOperation("修改")
-	@PostMapping(value = "/update", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@PostMapping(value = "/update")
 	public Object update(VipGroupCategory vipGroupCategory) {
 		Date date = new Date();
 		vipGroupCategory.setUpdateTime(date);
@@ -57,7 +54,7 @@ public class VipGroupCategoryController extends BaseController {
 	}
 
 	@ApiOperation("删除")
-	@PostMapping(value = "/delete", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@PostMapping(value = "/delete")
 	public Object delete(int id) {
 		VipGroupCategory vipGroupCategory = vipGroupCategoryService.get(id);
 		Date date = new Date();

+ 2 - 2
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupDefaultClassesCycleController.java

@@ -29,8 +29,8 @@ public class VipGroupDefaultClassesCycleController extends BaseController {
 
 	@ApiOperation("全查询")
 	@GetMapping(value = "/queryAll")
-	public Object queryAll() {
-		return succeed(vipGroupDefaultClassesCycleService.findAll(null));
+	public Object queryAll(Long organId) {
+		return succeed(vipGroupDefaultClassesCycleService.findAllByOrgan(organId));
 	}
 
 	@ApiOperation("新增")

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupDefaultClassesUnitPriceController.java

@@ -29,7 +29,7 @@ public class VipGroupDefaultClassesUnitPriceController extends BaseController {
 
 	@ApiOperation("全查询")
 	@GetMapping(value = "/queryAll")
-	public Object queryAll() {
+	public Object queryAll(Long organId) {
 		return succeed(vipGroupDefaultClassesUnitPriceService.findAll(null));
 	}
 

+ 14 - 1
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupManageController.java

@@ -3,6 +3,7 @@ package com.ym.mec.web.controller;
 import com.ym.mec.biz.dal.dto.VipGroupApplyDto;
 import com.ym.mec.biz.dal.entity.StudentApplyRefunds;
 import com.ym.mec.biz.dal.page.VipGroupAttendanceQueryInfo;
+import com.ym.mec.biz.dal.page.VipGroupQueryInfo;
 import com.ym.mec.biz.service.VipGroupService;
 import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
@@ -22,13 +23,25 @@ public class VipGroupManageController extends BaseController {
     @Autowired
     private VipGroupService vipGroupService;
 
-    @ApiOperation("vip课申请")
+    @ApiOperation(value = "vip课申请")
     @PostMapping("/vipGroupApply")
     public Object vipGroupApply(@RequestBody VipGroupApplyDto vipGroupApplyDto){
         vipGroupService.createVipGroup(vipGroupApplyDto);
         return succeed();
     }
 
+    @ApiOperation(value = "全查询")
+    @GetMapping("/queryAll")
+    public Object queryAll(VipGroupQueryInfo queryInfo) {
+        return succeed(vipGroupService.findVipGroups(queryInfo));
+    }
+
+    @ApiOperation(value = "获取小课学员")
+    @GetMapping("/findVipGroupStudents")
+    public Object findVipGroupStudents(VipGroupQueryInfo queryInfo){
+        return succeed(vipGroupService.findVipGroupStudents(queryInfo));
+    }
+
     @ApiOperation("vip课详情")
     @GetMapping("/getVipGroupDetail/{vipGroupId}")
     public Object getVipGroupDetail(@PathVariable("vipGroupId") Long vipGroupId){

+ 12 - 0
pom.xml

@@ -295,6 +295,18 @@
 				<artifactId>git-commit-id-plugin</artifactId>
 				<version>2.2.5</version>
 			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-resources-plugin</artifactId>
+				<configuration><encoding>UTF-8</encoding>
+					<!-- 过滤后缀为pem、pfx的证书文件 -->
+					<nonFilteredFileExtensions>
+						<nonFilteredFileExtension>cer</nonFilteredFileExtension>
+						<nonFilteredFileExtension>pem</nonFilteredFileExtension>
+						<nonFilteredFileExtension>pfx</nonFilteredFileExtension>
+					</nonFilteredFileExtensions>
+				</configuration>
+			</plugin>
 		</plugins>
 	</build>