فهرست منبع

Merge remote-tracking branch 'origin/master'

Joburgess 5 سال پیش
والد
کامیت
8cd02aa032
30فایلهای تغییر یافته به همراه569 افزوده شده و 220 حذف شده
  1. 15 15
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java
  2. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java
  3. 46 16
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ClassGroupAdjustDto.java
  4. 17 6
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ClassGroupStudentMapperDto.java
  5. 4 4
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicCardDto.java
  6. 43 34
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupCourseScheduleDto.java
  7. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentApplyRefunds.java
  8. 17 6
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentPaymentOrder.java
  9. 21 23
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRegistration.java
  10. 28 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentApplyrefundsQueryInfo.java
  11. 28 30
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/queryMusicGroupCourseScheduleQueryInfo.java
  12. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentManageService.java
  13. 0 3
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentPaymentOrderService.java
  14. 110 11
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java
  15. 9 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java
  16. 62 2
      mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml
  17. 2 2
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  18. 24 4
      mec-biz/src/main/resources/config/mybatis/StudentApplyRefundsMapper.xml
  19. 8 3
      mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml
  20. 3 3
      mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml
  21. 1 1
      mec-student/src/main/java/com/ym/mec/student/config/ResourceServerConfig.java
  22. 1 1
      mec-student/src/main/java/com/ym/mec/student/controller/ClassGroupController.java
  23. 17 14
      mec-student/src/main/java/com/ym/mec/student/controller/WithdrawController.java
  24. 3 1
      mec-student/src/main/resources/application.yml
  25. 1 1
      mec-web/src/main/java/com/ym/mec/web/config/ResourceServerConfig.java
  26. 31 0
      mec-web/src/main/java/com/ym/mec/web/controller/StudentApplyRefundsController.java
  27. 14 3
      mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java
  28. 12 9
      mec-web/src/main/java/com/ym/mec/web/controller/StudentPaymentOrderController.java
  29. 17 20
      mec-web/src/main/java/com/ym/mec/web/controller/StudentWithdrawController.java
  30. 0 1
      mec-web/src/main/java/com/ym/mec/web/controller/UploadFileController.java

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

@@ -85,21 +85,6 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
      */
     int countGroupCourses(Map<String, Object> params);
 
-    /**
-     * 获取老师VIP课程信息列表
-     *
-     * @param params
-     * @return
-     */
-    List<TeacherVipClassInfoDto> getTeacherVipClass(Map<String, Object> params);
-
-    /**
-     * count老师VIP课程信息列表
-     *
-     * @param params
-     * @return
-     */
-    int countTeacherVipClass(Map<String, Object> params);
 
     /**
      * 获取乐团所有班级列表
@@ -329,4 +314,19 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
      * @return
      */
     int countMusicGroupCourseSchedule(Map<String, Object> params);
+
+    /**
+     * 根据班级编号列表获取班级名称
+     * @param classGroupIds
+     * @return
+     */
+    List<Map<Integer,String>> findNameById(String classGroupIds);
+
+    /**
+     * 获取学员班级列表
+     * @param musicGroupId
+     * @param teacherId
+     * @return
+     */
+    List<ConditionDto> queryStudentClassGroup(@Param("musicGroupId") String musicGroupId, @Param("teacherId") Integer teacherId);
 }

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

@@ -362,14 +362,14 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
     void updateByMusicGroupId(@Param("musicGroupId") String musicGroupId, @Param("schoolId") Integer schoolId);
 
     /**
-     * 获取班级时间段内的课程
+     * 获取班级某时间后相应节数的课程
      *
      * @param classGroupId
      * @param startDate
-     * @param endDate
+     * @param times
      * @return
      */
-    List<CourseSchedule> findCourseScheduleByClassGroupIdAndDate(@Param("classGroupId") Integer classGroupId, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
+    List<CourseSchedule> findCourseScheduleByClassGroupIdAndDate(@Param("classGroupId") Integer classGroupId, @Param("startDate") String startDate, @Param("times") int times);
     
     /**
      * 根据时间范围查询老师指定类型的课程列表

+ 46 - 16
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ClassGroupAdjustDto.java

@@ -1,12 +1,9 @@
 package com.ym.mec.biz.dal.dto;
 
-import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
 import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import io.swagger.annotations.ApiModelProperty;
 
-import java.time.LocalDateTime;
-import java.util.Date;
 import java.util.List;
 
 /**
@@ -30,10 +27,19 @@ public class ClassGroupAdjustDto {
     private YesOrNoEnum type;
 
     @ApiModelProperty(value = "开始时间", required = true)
-    private Date startDate;
+    private String startDate;
 
-    @ApiModelProperty(value = "结束时间", required = true)
-    private Date endDate;
+    @ApiModelProperty(value = "排课星期几",required = true)
+    private Integer dayOfWeek;
+
+    @ApiModelProperty(value = "上课开始时间",required = true)
+    private String startClassTime;
+
+    @ApiModelProperty(value = "上课结束时间",required = true)
+    private String endClassTime;
+
+    @ApiModelProperty(value = "排课次数", required = true)
+    private Integer courseTimes;
 
     public String getClassGroupName() {
         return classGroupName;
@@ -51,22 +57,14 @@ public class ClassGroupAdjustDto {
         this.type = type;
     }
 
-    public Date getStartDate() {
+    public String getStartDate() {
         return startDate;
     }
 
-    public void setStartDate(Date startDate) {
+    public void setStartDate(String startDate) {
         this.startDate = startDate;
     }
 
-    public Date getEndDate() {
-        return endDate;
-    }
-
-    public void setEndDate(Date endDate) {
-        this.endDate = endDate;
-    }
-
     public List<ClassGroupTeacherMapper> getClassGroupTeacherMapperList() {
         return classGroupTeacherMapperList;
     }
@@ -90,4 +88,36 @@ public class ClassGroupAdjustDto {
     public void setMusicGroupId(String musicGroupId) {
         this.musicGroupId = musicGroupId;
     }
+
+    public Integer getDayOfWeek() {
+        return dayOfWeek;
+    }
+
+    public void setDayOfWeek(Integer dayOfWeek) {
+        this.dayOfWeek = dayOfWeek;
+    }
+
+    public String getStartClassTime() {
+        return startClassTime;
+    }
+
+    public void setStartClassTime(String startClassTime) {
+        this.startClassTime = startClassTime;
+    }
+
+    public String getEndClassTime() {
+        return endClassTime;
+    }
+
+    public void setEndClassTime(String endClassTime) {
+        this.endClassTime = endClassTime;
+    }
+
+    public Integer getCourseTimes() {
+        return courseTimes;
+    }
+
+    public void setCourseTimes(Integer courseTimes) {
+        this.courseTimes = courseTimes;
+    }
 }

+ 17 - 6
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ClassGroupStudentMapperDto.java

@@ -4,14 +4,25 @@ import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
 import io.swagger.annotations.ApiModelProperty;
 
 public class ClassGroupStudentMapperDto extends ClassGroupStudentMapper {
-    @ApiModelProperty(value = "科目编号",required = true)
-    private Integer actual_subject_id_;
+    @ApiModelProperty(value = "科目编号(声部编号)",required = true)
+    private Integer actualSubjectId;
 
-    public Integer getActual_subject_id_() {
-        return actual_subject_id_;
+    @ApiModelProperty(value = "科目名称(声部名称)",required = true)
+    private String subjectName;
+
+    public Integer actualSubjectId() {
+        return actualSubjectId;
+    }
+
+    public void actualSubjectId(Integer actualSubjectId) {
+        this.actualSubjectId = actualSubjectId;
+    }
+
+    public String getSubjectName() {
+        return subjectName;
     }
 
-    public void setActual_subject_id_(Integer actual_subject_id_) {
-        this.actual_subject_id_ = actual_subject_id_;
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
     }
 }

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

@@ -1,7 +1,6 @@
 package com.ym.mec.biz.dal.dto;
 
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
-import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import io.swagger.annotations.ApiModelProperty;
 
 public class MusicCardDto {
@@ -29,9 +28,6 @@ public class MusicCardDto {
     @ApiModelProperty(value = "所在班级",required = true)
     private String currentClass;
 
-//    @ApiModelProperty(value = "是否缴费",required = true)
-//    private YesOrNoEnum paymentStatus;
-
     @ApiModelProperty(value = "缴费状态",required = true)
     private MusicGroupStudentFee.PaymentStatus paymentStatus;
 
@@ -41,6 +37,10 @@ public class MusicCardDto {
     @ApiModelProperty(value = "vip课数量",required = true)
     private Integer vipClassNum;
 
+    public MusicGroupStudentFee.PaymentStatus getPaymentStatus() {
+        return paymentStatus;
+    }
+
     public void setPaymentStatus(MusicGroupStudentFee.PaymentStatus paymentStatus) {
         this.paymentStatus = paymentStatus;
     }

+ 43 - 34
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupCourseScheduleDto.java

@@ -2,8 +2,6 @@ package com.ym.mec.biz.dal.dto;
 
 import io.swagger.annotations.ApiModelProperty;
 
-import java.util.Date;
-
 public class MusicGroupCourseScheduleDto {
 
     @ApiModelProperty(value = "上课日期",required = false)
@@ -12,63 +10,74 @@ public class MusicGroupCourseScheduleDto {
     @ApiModelProperty(value = "上课时间",required = false)
     private String startClassTime;
 
-    @ApiModelProperty(value = "上课时间",required = false)
-    private String courseScheduleId;
+    @ApiModelProperty(value = "合奏班编号",required = false)
+    private Integer mixClassGroupId;
 
-    @ApiModelProperty(value = "上课时间",required = false)
-    private String courseScheduleName;
+    @ApiModelProperty(value = "合奏班名称",required = false)
+    private String mixClassGroupName;
 
-    @ApiModelProperty(value = "上课时间",required = false)
+    @ApiModelProperty(value = "班级编号",required = false)
+    private Integer classGroupId;
+
+    @ApiModelProperty(value = "班级名称",required = false)
     private String classGroupName;
 
-    @ApiModelProperty(value = "上课时间",required = false)
+    @ApiModelProperty(value = "课程类型",required = false)
     private String courseScheduleType;
 
-    @ApiModelProperty(value = "上课时间",required = false)
-    private String getCourseScheduleStatus;
+    @ApiModelProperty(value = "课程状态",required = false)
+    private String courseScheduleStatus;
 
-    @ApiModelProperty(value = "上课时间",required = false)
+    @ApiModelProperty(value = "签到状态",required = false)
     private String signInStatus;
 
-    @ApiModelProperty(value = "上课时间",required = false)
+    @ApiModelProperty(value = "签退状态",required = false)
     private String signOutStatus;
 
-    @ApiModelProperty(value = "上课时间",required = false)
+    @ApiModelProperty(value = "主教老师",required = false)
     private String masterTeacherName;
 
-    @ApiModelProperty(value = "上课时间",required = false)
+    @ApiModelProperty(value = "助教老师",required = false)
     private String subTeacherName;
 
-    public String getClassDate() {
-        return classDate;
+    public String getMixClassGroupName() {
+        return mixClassGroupName;
     }
 
-    public void setClassDate(String classDate) {
-        this.classDate = classDate;
+    public void setMixClassGroupName(String mixClassGroupName) {
+        this.mixClassGroupName = mixClassGroupName;
     }
 
-    public String getStartClassTime() {
-        return startClassTime;
+    public Integer getMixClassGroupId() {
+        return mixClassGroupId;
     }
 
-    public void setStartClassTime(String startClassTime) {
-        this.startClassTime = startClassTime;
+    public void setMixClassGroupId(Integer mixClassGroupId) {
+        this.mixClassGroupId = mixClassGroupId;
     }
 
-    public String getCourseScheduleId() {
-        return courseScheduleId;
+    public Integer getClassGroupId() {
+        return classGroupId;
     }
 
-    public void setCourseScheduleId(String courseScheduleId) {
-        this.courseScheduleId = courseScheduleId;
+    public void setClassGroupId(Integer classGroupId) {
+        this.classGroupId = classGroupId;
     }
 
-    public String getCourseScheduleName() {
-        return courseScheduleName;
+    public String getClassDate() {
+        return classDate;
     }
 
-    public void setCourseScheduleName(String courseScheduleName) {
-        this.courseScheduleName = courseScheduleName;
+    public void setClassDate(String classDate) {
+        this.classDate = classDate;
+    }
+
+    public String getStartClassTime() {
+        return startClassTime;
+    }
+
+    public void setStartClassTime(String startClassTime) {
+        this.startClassTime = startClassTime;
     }
 
     public String getClassGroupName() {
@@ -87,12 +96,12 @@ public class MusicGroupCourseScheduleDto {
         this.courseScheduleType = courseScheduleType;
     }
 
-    public String getGetCourseScheduleStatus() {
-        return getCourseScheduleStatus;
+    public String getCourseScheduleStatus() {
+        return courseScheduleStatus;
     }
 
-    public void setGetCourseScheduleStatus(String getCourseScheduleStatus) {
-        this.getCourseScheduleStatus = getCourseScheduleStatus;
+    public void setCourseScheduleStatus(String courseScheduleStatus) {
+        this.courseScheduleStatus = courseScheduleStatus;
     }
 
     public String getSignInStatus() {

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentApplyRefunds.java

@@ -1,7 +1,10 @@
 package com.ym.mec.biz.dal.entity;
 
+import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
+
 import io.swagger.annotations.ApiModelProperty;
+
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import java.math.BigDecimal;
@@ -45,6 +48,10 @@ public class StudentApplyRefunds {
 	@ApiModelProperty(value = "原订单编号",required = true)
 	private Long origPaymentOrderId;
 	
+	private StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
+	
+	private SysUser user = new SysUser();
+	
 	public void setId(Long id){
 		this.id = id;
 	}
@@ -125,6 +132,22 @@ public class StudentApplyRefunds {
 		this.remark = remark;
 	}
 
+	public StudentPaymentOrder getStudentPaymentOrder() {
+		return studentPaymentOrder;
+	}
+
+	public void setStudentPaymentOrder(StudentPaymentOrder studentPaymentOrder) {
+		this.studentPaymentOrder = studentPaymentOrder;
+	}
+
+	public SysUser getUser() {
+		return user;
+	}
+
+	public void setUser(SysUser user) {
+		this.user = user;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 17 - 6
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentPaymentOrder.java

@@ -1,16 +1,17 @@
 package com.ym.mec.biz.dal.entity;
 
-import com.ym.mec.biz.dal.enums.DealStatusEnum;
-import com.ym.mec.biz.dal.enums.OrderTypeEnum;
-
-import com.ym.mec.biz.dal.enums.PaymentChannelTypeEnum;
 import io.swagger.annotations.ApiModelProperty;
 
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
 import java.math.BigDecimal;
 import java.util.Date;
 
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.enums.DealStatusEnum;
+import com.ym.mec.biz.dal.enums.OrderTypeEnum;
+import com.ym.mec.biz.dal.enums.PaymentChannelTypeEnum;
+
 /**
  * 对应数据库表(student_payment_order):
  */
@@ -85,6 +86,8 @@ public class StudentPaymentOrder {
 
 	private PaymentChannelTypeEnum paymentChannelType;
 	
+	private SysUser user = new SysUser();
+	
 	public void setId(Long id){
 		this.id = id;
 	}
@@ -244,6 +247,14 @@ public class StudentPaymentOrder {
         this.paymentChannelType = paymentChannelType;
     }
 
+	public SysUser getUser() {
+		return user;
+	}
+
+	public void setUser(SysUser user) {
+		this.user = user;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 21 - 23
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRegistration.java

@@ -3,9 +3,7 @@ package com.ym.mec.biz.dal.entity;
 import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
 import com.ym.mec.biz.dal.enums.KitPurchaseMethodEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
-
 import io.swagger.annotations.ApiModelProperty;
-
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import java.math.BigDecimal;
@@ -15,73 +13,73 @@ import java.math.BigDecimal;
  */
 public class StudentRegistration {
 
-    @ApiModelProperty(value = "报名id", hidden = true)
+    @ApiModelProperty(value = "报名id", required = false)
     private Long id;
 
-    @ApiModelProperty(value = "机构id", hidden = true)
+    @ApiModelProperty(value = "机构id", required = false)
     private Integer organId;
 
-    @ApiModelProperty(value = "学生编号", hidden = true)
+    @ApiModelProperty(value = "学生编号", required = false)
     private Integer userId;
 
-    @ApiModelProperty(value = "学生姓名", required = true)
+    @ApiModelProperty(value = "学生姓名", required = false)
     private String name;
 
-    @ApiModelProperty(value = "性别(0,女  1,男", required = true)
+    @ApiModelProperty(value = "性别(0,女  1,男", required = false)
     private Integer gender;
 
-    @ApiModelProperty(value = "身份证号", required = true)
+    @ApiModelProperty(value = "身份证号", required = false)
     private String idCardNo;
 
-    @ApiModelProperty(value = "所属乐团(对应 music_group 表id)", required = true)
+    @ApiModelProperty(value = "所属乐团(对应 music_group 表id)", required = false)
     private String musicGroupId;
 
-    @ApiModelProperty(value = "当前所在年级", required = true)
+    @ApiModelProperty(value = "当前所在年级", required = false)
     private String currentGrade;
 
-    @ApiModelProperty(value = "当前所在班级", required = true)
+    @ApiModelProperty(value = "当前所在班级", required = false)
     private String currentClass;
 
-    @ApiModelProperty(value = "报名科目", required = true)
+    @ApiModelProperty(value = "报名科目", required = false)
     private Integer subjectId;
 
-    @ApiModelProperty(value = "实际科目", hidden = true)
+    @ApiModelProperty(value = "实际科目", required = false)
     private Integer actualSubjectId;
 
-    @ApiModelProperty(value = "是否允许调剂", required = true)
+    @ApiModelProperty(value = "是否允许调剂", required = false)
     private YesOrNoEnum isAllowAdjust;
 
-    @ApiModelProperty(value = "器材购买方式(GROUP:团购,OWNED:自备)", required = true)
+    @ApiModelProperty(value = "器材购买方式(GROUP:团购,OWNED:自备)", required = false)
     private KitPurchaseMethodEnum kitPurchaseMethod;
 
-    @ApiModelProperty(value = "备注", hidden = false)
+    @ApiModelProperty(value = "备注", required = false)
     private String remark;
 
-    @ApiModelProperty(value = "添加时间", hidden = true)
+    @ApiModelProperty(value = "添加时间", required = false)
     private java.util.Date createTime;
 
-    @ApiModelProperty(value = "更新时间", hidden = true)
+    @ApiModelProperty(value = "更新时间", required = false)
     private java.util.Date updateTime;
 
-    @ApiModelProperty(value = "家长姓名", required = true)
+    @ApiModelProperty(value = "家长姓名", required = false)
     private String parentsName;
 
-    @ApiModelProperty(value = "家长电话", required = true)
+    @ApiModelProperty(value = "家长电话", required = false)
     private String parentsPhone;
 
     @ApiModelProperty(value = "家长单位", required = false)
     private String parentsCompany;
 
-    @ApiModelProperty(value = "缴费状态(1-已缴费 0-未交费)", hidden = true)
+    @ApiModelProperty(value = "缴费状态(1-已缴费 0-未交费)", required = false)
     private YesOrNoEnum paymentStatus;
 
     @ApiModelProperty(value = "用户所在乐团状态)",required = false)
     private ClassGroupStudentStatusEnum musicGroupStatus;
 
-    @ApiModelProperty(value = "班级ids", hidden = true)
+    @ApiModelProperty(value = "班级ids", required = true)
     private String classGroupId;
 
-    @ApiModelProperty(value = "零时课程费用", hidden = true)
+    @ApiModelProperty(value = "零时课程费用", required = true)
     private BigDecimal temporaryCourseFee;
 
     public ClassGroupStudentStatusEnum getMusicGroupStatus() {

+ 28 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentApplyrefundsQueryInfo.java

@@ -0,0 +1,28 @@
+package com.ym.mec.biz.dal.page;
+
+import java.util.Date;
+
+import com.ym.mec.common.page.QueryInfo;
+
+public class StudentApplyrefundsQueryInfo extends QueryInfo {
+
+	private Date startTime;
+
+	private Date endTime;
+
+	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;
+	}
+}

+ 28 - 30
mec-biz/src/main/java/com/ym/mec/biz/dal/page/queryMusicGroupCourseScheduleQueryInfo.java

@@ -3,62 +3,60 @@ package com.ym.mec.biz.dal.page;
 import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.ApiModelProperty;
 
-import java.util.Date;
-
 public class queryMusicGroupCourseScheduleQueryInfo extends QueryInfo {
 
-    @ApiModelProperty(value = "合奏班编号",required = false)
-    private String mixClassId;
+    @ApiModelProperty(value = "开始日期(不包含时分秒)",required = false)
+    private String startTime;
 
-    @ApiModelProperty(value = "班级编号",required = false)
-    private String classGroupId;
+    @ApiModelProperty(value = "结束日期",required = false)
+    private String endTime;
 
     @ApiModelProperty(value = "课程类型",required = false)
-    private String classGroupType;
+    private String classScheduleType;
 
     @ApiModelProperty(value = "课程状态",required = false)
-    private String classGroupStatus;
+    private String classScheduleStatus;
 
-    @ApiModelProperty(value = "老师编号",required = false)
-    private String teacherId;
+    @ApiModelProperty(value = "乐团编号",required = false)
+    private String musicGroupId;
 
-    public String getMixClassId() {
-        return mixClassId;
+    public String getStartTime() {
+        return startTime;
     }
 
-    public void setMixClassId(String mixClassId) {
-        this.mixClassId = mixClassId;
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
     }
 
-    public String getClassGroupId() {
-        return classGroupId;
+    public String getEndTime() {
+        return endTime;
     }
 
-    public void setClassGroupId(String classGroupId) {
-        this.classGroupId = classGroupId;
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
     }
 
-    public String getClassGroupType() {
-        return classGroupType;
+    public String getClassScheduleType() {
+        return classScheduleType;
     }
 
-    public void setClassGroupType(String classGroupType) {
-        this.classGroupType = classGroupType;
+    public void setClassScheduleType(String classScheduleType) {
+        this.classScheduleType = classScheduleType;
     }
 
-    public String getClassGroupStatus() {
-        return classGroupStatus;
+    public String getClassScheduleStatus() {
+        return classScheduleStatus;
     }
 
-    public void setClassGroupStatus(String classGroupStatus) {
-        this.classGroupStatus = classGroupStatus;
+    public void setClassScheduleStatus(String classScheduleStatus) {
+        this.classScheduleStatus = classScheduleStatus;
     }
 
-    public String getTeacherId() {
-        return teacherId;
+    public String getMusicGroupId() {
+        return musicGroupId;
     }
 
-    public void setTeacherId(String teacherId) {
-        this.teacherId = teacherId;
+    public void setMusicGroupId(String musicGroupId) {
+        this.musicGroupId = musicGroupId;
     }
 }

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

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.dto.*;
+import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
@@ -90,4 +91,12 @@ public interface StudentManageService {
      * @return
      */
     PageInfo<MusicGroupStudentSignDto> queryMusicGroupStudentsSign(QueryInfo queryInfo);
+
+    /**
+     * 获取学员的班级信息列表
+     * @param musicGroupId
+     * @param teacherId
+     * @return
+     */
+    List<ConditionDto> queryStudentClassGroup(String musicGroupId, Integer teacherId);
 }

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

@@ -6,9 +6,6 @@ import com.ym.mec.biz.dal.entity.Goods;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
-import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
-import com.ym.mec.common.page.PageInfo;
-import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.BaseService;
 
 public interface StudentPaymentOrderService extends BaseService<Long, StudentPaymentOrder> {

+ 110 - 11
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -28,10 +28,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
 import java.math.BigDecimal;
-import java.time.Instant;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.ZoneId;
+import java.time.*;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -73,6 +70,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     private CourseScheduleDao courseScheduleDao;
     @Autowired
     private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
+    @Autowired
+    private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
 
     @Override
     public BaseDAO<Integer, ClassGroup> getDAO() {
@@ -712,29 +711,36 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     @Transactional(rollbackFor = Exception.class)
     public ClassGroup classGroupAdjust(ClassGroupAdjustDto classGroupAdjustDto) throws Exception {
         Date date = new Date();
+        MusicGroup musicGroup = musicGroupDao.get(classGroupAdjustDto.getMusicGroupId());
+        if (musicGroup != null) {
+            throw new Exception("乐团不存在");
+        }
+        Integer schoolId = musicGroup.getSchoolId();
 
         List<ClassGroupStudentMapperDto> classGroupStudentMapperDtoList = classGroupAdjustDto.getClassGroupStudentMapperDtoList();
-        String subject_id_list_ = "";
-        for (ClassGroupStudentMapper classGroupStudentMapperDto : classGroupStudentMapperDtoList) {
+        String subjectIdList = "";
+        String subjectNameList = "";
+        for (ClassGroupStudentMapperDto classGroupStudentMapperDto : classGroupStudentMapperDtoList) {
             //1、永久调整,删除学生班级关联关系
             if (classGroupAdjustDto.getType().equals(YesOrNoEnum.YES)) {
                 ClassGroupStudentMapper classStudentMapper = classGroupStudentMapperDao.query(classGroupStudentMapperDto.getClassGroupId(), classGroupStudentMapperDto.getUserId());
                 classStudentMapper.setStatus(ClassGroupStudentStatusEnum.QUIT);
                 classGroupStudentMapperDao.update(classStudentMapper);
             } else { //临时删除学生对应时间段的课程
-                List<CourseSchedule> courseScheduleList = courseScheduleDao.findCourseScheduleByClassGroupIdAndDate(classGroupStudentMapperDto.getClassGroupId(), classGroupAdjustDto.getStartDate(), classGroupAdjustDto.getEndDate());
+                List<CourseSchedule> courseScheduleList = courseScheduleDao.findCourseScheduleByClassGroupIdAndDate(classGroupStudentMapperDto.getClassGroupId(), classGroupAdjustDto.getStartDate(), classGroupAdjustDto.getCourseTimes());
                 courseScheduleStudentPaymentDao.deleteStudentCourseSchedule(classGroupStudentMapperDto.getUserId(), courseScheduleList);
             }
-            subject_id_list_ += classGroupStudentMapperDto.getUserId() + ",";
+            subjectIdList += classGroupStudentMapperDto.actualSubjectId() + ",";
+            subjectNameList += classGroupStudentMapperDto.getSubjectName() + "/";
         }
 
 
-        subject_id_list_ = subject_id_list_.substring(0, subject_id_list_.length() - 1);
+        subjectIdList = subjectIdList.substring(0, subjectIdList.length() - 1);
 
         //2、新建班级
         ClassGroup classGroup = new ClassGroup();
         classGroup.setMusicGroupId(classGroupAdjustDto.getMusicGroupId());
-        classGroup.setSubjectIdList(subject_id_list_);
+        classGroup.setSubjectIdList(subjectIdList);
         classGroup.setName(classGroupAdjustDto.getClassGroupName());
         classGroup.setExpectStudentNum(classGroupStudentMapperDtoList.size());
         classGroup.setStudentNum(classGroupStudentMapperDtoList.size());
@@ -744,7 +750,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         classGroup.setUpdateTime(date);
         classGroupDao.insert(classGroup);
 
-        //3、将学生加入新班级(学生注册表,关联表
+        //3、将学生加入新班级(学生注册表,关联表
         List<ClassGroupStudentMapper> classGroupStudentMapperList = new ArrayList<>();
         for (ClassGroupStudentMapperDto classGroupStudentMapperDto : classGroupStudentMapperDtoList) {
             classGroupStudentMapperDto.setClassGroupId(classGroup.getId());
@@ -755,11 +761,87 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
         //4、将老师加入关联关系
         List<ClassGroupTeacherMapper> classGroupTeacherMapperList = classGroupAdjustDto.getClassGroupTeacherMapperList();
+
+        //课时长度
+        long classCourseDuration = Duration.between(LocalDateTime.parse(classGroupAdjustDto.getStartDate() + " " + classGroupAdjustDto.getStartClassTime() + ":00"),
+                LocalDateTime.parse(classGroupAdjustDto.getStartDate() + " " + classGroupAdjustDto.getEndClassTime() + ":00"))
+                .toMinutes();
+
         for (ClassGroupTeacherMapper classGroupTeacherMapper : classGroupTeacherMapperList) {
             classGroupTeacherMapper.setClassGroupId(classGroup.getId());
             classGroupTeacherMapper.setMusicGroupId(classGroupAdjustDto.getMusicGroupId());
+
+            List<TeacherDefaultMusicGroupSalary> teacherSalaryList = teacherDefaultMusicGroupSalaryService.getTeacherSalaryByUserIdAndType(classGroupTeacherMapper.getUserId(), "SINGLE", musicGroup.getSettlementType());
+            BigDecimal salary = new BigDecimal("0");
+            for (TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary : teacherSalaryList) {
+                //对应基准课酬
+                BigDecimal baseSalary = classGroupTeacherMapper.getTeacherRole().equals(TeachTypeEnum.BISHOP) ? teacherDefaultMusicGroupSalary.getMainTeacherSalary() : teacherDefaultMusicGroupSalary.getAssistantTeacherSalary();
+                //基准课酬
+                if (teacherDefaultMusicGroupSalary.getSettlementType().equals(SalarySettlementTypeEnum.TEACHER_DEFAULT)) {
+                    salary = new BigDecimal(classCourseDuration).divide(new BigDecimal(30)).multiply(baseSalary).setScale(2, BigDecimal.ROUND_HALF_UP);
+                    break;
+                }
+                //阶梯课酬
+                if (classCourseDuration >= teacherDefaultMusicGroupSalary.getDurationMin() && classCourseDuration <= teacherDefaultMusicGroupSalary.getDurationMin()) {
+                    salary = baseSalary;
+                    break;
+                }
+            }
+            classGroupTeacherMapper.setSalary(salary);
         }
         classGroupTeacherMapperDao.classGroupTeachersInsert(classGroupTeacherMapperList);
+
+        //5、插入班级排课信息
+        LocalDateTime now = LocalDate.parse(classGroupAdjustDto.getStartDate(), DateTimeFormatter.ofPattern("yyyy-MM-dd")).atStartOfDay();
+
+        //计算每节课的课酬
+        List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaryList = new ArrayList<>();
+
+        int times = 0;
+        while (true) {
+            int dayOfWeek = now.getDayOfWeek().getValue();
+            if (classGroupAdjustDto.getDayOfWeek().equals(dayOfWeek)) {
+                Instant instant = now.atZone(ZoneId.systemDefault()).toInstant();
+                Date classDate = Date.from(instant);
+                String startClassTime = DateUtil.getDate(classDate) + " " + classGroupAdjustDto.getStartClassTime() + ":00";
+                String endClassTime = DateUtil.getDate(classDate) + " " + classGroupAdjustDto.getEndClassTime() + ":00";
+
+                CourseSchedule courseSchedule = new CourseSchedule();
+                courseSchedule.setSchoolId(schoolId);
+                courseSchedule.setClassGroupId(classGroup.getId());
+                courseSchedule.setStatus(CourseStatusEnum.NOT_START);
+                courseSchedule.setClassDate(classDate);
+                courseSchedule.setStartClassTime(DateUtil.stringToDate(startClassTime));
+                courseSchedule.setEndClassTime(DateUtil.stringToDate(endClassTime));
+                courseSchedule.setCreateTime(date);
+                courseSchedule.setUpdateTime(date);
+                courseSchedule.setTeachMode(TeachModeEnum.OFFLINE);
+                courseSchedule.setType(CourseSchedule.CourseScheduleType.SINGLE);
+                courseSchedule.setName(subjectNameList + "-" + CourseSchedule.CourseScheduleType.SINGLE.getMsg());
+
+                courseScheduleDao.insert(courseSchedule);
+
+                times++;
+
+                for (ClassGroupTeacherMapper classGroupTeacherMapper : classGroupTeacherMapperList) {
+                    CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
+                    courseScheduleTeacherSalary.setCourseScheduleId(courseSchedule.getId());
+                    courseScheduleTeacherSalary.setTeacherRole(classGroupTeacherMapper.getTeacherRole());
+                    courseScheduleTeacherSalary.setUserId(classGroupTeacherMapper.getUserId());
+                    courseScheduleTeacherSalary.setExpectSalary(classGroupTeacherMapper.getSalary());
+                    courseScheduleTeacherSalary.setClassGroupId(classGroup.getId());
+                    courseScheduleTeacherSalary.setCreateTime(date);
+                    courseScheduleTeacherSalary.setUpdateTime(date);
+                    courseScheduleTeacherSalaryList.add(courseScheduleTeacherSalary);
+                }
+
+            }
+            now = now.plusDays(1);
+            if (classGroupAdjustDto.getCourseTimes().equals(times)) {
+                break;
+            }
+        }
+        courseScheduleTeacherSalaryDao.batchInsert(courseScheduleTeacherSalaryList);
         return classGroup;
     }
 
@@ -809,6 +891,23 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             pageInfo.setTotal(count);
             params.put("offset", pageInfo.getOffset());
             dataList = classGroupDao.queryMusicGroupCourseSchedule(params);
+            //获取当前合奏班班级编号列表
+            Set<Integer> mixClassGroupIds = dataList.stream().map(e -> e.getMixClassGroupId()).collect(Collectors.toSet());
+            String mixClassGroupIdsStr = StringUtils.join(mixClassGroupIds, ",");
+            //获取当前班级编号列表
+            Set<Integer> classGroupIds = dataList.stream().map(e -> e.getClassGroupId()).collect(Collectors.toSet());
+            String classGroupIdsStr = StringUtils.join(classGroupIds, ",");
+            //获取合奏班名称
+            Map<Integer,String> classGroupNames = MapUtil.convertMybatisMap(classGroupDao.findNameById(mixClassGroupIdsStr));
+            //获取主教老师
+            Map<Integer,String> masterTeachers = MapUtil.convertMybatisMap(classGroupDao.countStudentNum(classGroupIdsStr, "BISHOP"));
+            //获取助教老师
+            Map<Integer,String> subTeachers = MapUtil.convertMybatisMap(classGroupDao.countStudentNum(classGroupIdsStr, "TEACHING"));
+            dataList.forEach(e->{
+                e.setMixClassGroupName(classGroupNames.get(e.getMixClassGroupId()));
+                e.setMasterTeacherName(masterTeachers.get(e.getClassGroupId()));
+                e.setSubTeacherName(subTeachers.get(e.getClassGroupId()));
+            });
         }
         if (count == 0) {
             dataList = new ArrayList<>();

+ 9 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java

@@ -2,11 +2,9 @@ package com.ym.mec.biz.service.impl;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.CourseScheduleStudentPaymentDao;
-import com.ym.mec.biz.dal.dao.StudentManageDao;
-import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
-import com.ym.mec.biz.dal.dao.VipGroupDao;
+import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.*;
+import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.biz.service.CourseScheduleStudentPaymentService;
@@ -32,6 +30,8 @@ public class StudentManageServiceImpl implements StudentManageService {
     @Autowired
     private StudentManageDao studentManageDao;
     @Autowired
+    private ClassGroupDao classGroupDao;
+    @Autowired
     private StudentPaymentOrderDao studentPaymentOrderDao;
     @Autowired
     private SysUserFeignService sysUserFeignService;
@@ -198,4 +198,9 @@ public class StudentManageServiceImpl implements StudentManageService {
         pageInfo.setRows(dataList);
         return pageInfo;
     }
+
+    @Override
+    public List<ConditionDto> queryStudentClassGroup(String musicGroupId, Integer teacherId) {
+        return classGroupDao.queryStudentClassGroup(musicGroupId,teacherId);
+    }
 }

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

@@ -572,12 +572,72 @@
         GROUP BY sr.class_group_id_
     </select>
 
-    <select id="queryMusicGroupCourseSchedule" resultType="com.ym.mec.biz.dal.dto.MusicGroupCourseScheduleDto">
-
+    <sql id="queryMusicGroupCourseScheduleSql">
+        <where>
+            <if test="classScheduleType != null and classScheduleType != ''">
+                AND cs.type_ = #{classScheduleType}
+            </if>
+            <if test="classScheduleType = null or classScheduleType = ''">
+                AND (cs.type_ = 'NORMAL' OR cs.type_ = 'MIX' OR cs.type_ = 'HIGH')
+            </if>
+            <if test="classScheduleStatus != null and classScheduleStatus != ''">
+                AND cs.status_ = #{classScheduleStatus}
+            </if>
+            <if test="startTime != null and startTime != ''">
+                AND cs.class_date_ &gt;= #{startTime}
+            </if>
+            <if test="endTime != null and endTime != ''">
+                AND cs.class_date_ &lt;= #{endTime}
+            </if>
+            <if test="musicGroupId != null and musicGroupId != ''">
+                AND cg.music_group_id_ = #{musicGroupId}
+            </if>
+        </where>
+    </sql>
+    <resultMap id="MusicGroupCourseScheduleDto" type="com.ym.mec.biz.dal.dto.MusicGroupCourseScheduleDto">
+        <result property="classDate" column="class_date_"/>
+        <result property="startClassTime" column="start_class_time_"/>
+        <result property="classGroupId" column="class_group_id_"/>
+        <result property="mixClassGroupId" column="mix_class_group_id_"/>
+        <result property="courseScheduleType" column="course_schedule_type_"/>
+        <result property="courseScheduleStatus" column="course_schedule_status_"/>
+        <result property="signInStatus" column="sign_in_status_"/>
+        <result property="signOutStatus" column="sign_out_status_"/>
+    </resultMap>
+    <select id="queryMusicGroupCourseSchedule" resultMap="MusicGroupCourseScheduleDto">
+        SELECT cs.class_date_,cs.start_class_time_,cs.class_group_id_,
+        cs.type_ course_schedule_type_,cs.status_ course_schedule_status_,
+        IF(cgr.class_group_id_ IS NULL,cs.class_group_id_,cgr.class_group_id_) mix_class_group_id_,
+        IF(ISNULL(ta.sign_in_status_),3,ta.sign_in_status_) sign_in_status_,
+        IF(ISNULL(ta.sign_out_status_),3,ta.sign_out_status_) sign_out_status_
+        FROM course_schedule cs
+        LEFT JOIN class_group cg ON cg.id_ = cs.class_group_id_
+        LEFT JOIN teacher_attendance ta ON ta.course_schedule_id_ = cs.id_
+        LEFT JOIN class_group_relation cgr ON cgr.sub_class_group_id_ = cs.class_group_id_
+        <include refid="queryMusicGroupCourseScheduleSql"/>
+        <include refid="global.limit"/>
     </select>
     <select id="countMusicGroupCourseSchedule" resultType="java.lang.Integer">
+        SELECT COUNT(cs.id_) FROM course_schedule cs
+        LEFT JOIN class_group cg ON cg.id_ = cs.class_group_id_
+        <include refid="queryMusicGroupCourseScheduleSql"/>
+    </select>
 
+    <select id="findNameById" resultType="java.util.Map">
+        SELECT cg.id_ 'key',cg.name_ 'value'
+        FROM class_group cg WHERE FIND_IN_SET(cg.id_,#{classGroupIds})
     </select>
+
+    <resultMap id="ConditionDto" type="com.ym.mec.biz.dal.dto.ConditionDto">
+        <result property="id" column="id_"/>
+        <result property="name" column="name_"/>
+    </resultMap>
+    <select id="queryStudentClassGroup" resultMap="ConditionDto">
+        SELECT cg.id_,cg.name_,cg.student_num_ FROM class_group_student_mapper cgsm
+        LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
+        where cg.music_group_id_ = #{musicGroupId} AND cgsm.user_id_ = #{userId} AND cg.del_flag_ = 0
+    </select>
+
     <!-- 增加实际学生人数 -->
     <update id="addStudentNum" parameterType="com.ym.mec.biz.dal.entity.ClassGroup">
         UPDATE class_group SET student_num_ = student_num_+1,update_time_=#{updateTime} WHERE id_ = #{id} AND

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

@@ -920,9 +920,9 @@
         GROUP BY course_schedule_id_
     </select>
 
-    <!-- 获取班级某时间的课程 -->
+    <!-- 获取班级某时间后对应节数的课程 -->
     <select id="findCourseScheduleByClassGroupIdAndDate" resultMap="CourseSchedule">
-        <![CDATA[ SELECT * FROM course_schedule WHERE class_group_id_=#{classGroupId} AND class_date_ >= #{startDate} AND  class_date_ <=#{endDate} ]]>
+        SELECT * FROM course_schedule WHERE class_group_id_=#{classGroupId} AND class_date_ >= #{startDate} ORDER BY class_date_ ASC LIMIT #{times}
     </select>
     
     <select id="queryTeacherCourseScheduleListByTimeRangeAndType" resultMap="CourseSchedule" parameterType="map">

+ 24 - 4
mec-biz/src/main/resources/config/mybatis/StudentApplyRefundsMapper.xml

@@ -18,6 +18,12 @@
         <result column="orig_payment_order_id_" property="origPaymentOrderId"/>
         <result column="remark_" property="remark"/>
     </resultMap>
+    
+    <resultMap type="com.ym.mec.biz.dal.entity.StudentApplyRefunds" extends="StudentApplyRefunds" id="StudentApplyRefundsListDTO">
+    	<result column="spo.expect_amount_" property="studentPaymentOrder.expectAmount"/>
+    	<result column="spo.actual_amount_" property="studentPaymentOrder.actualAmount"/>
+    	<result column="u.username_" property="user.username"/>
+    </resultMap>
 
     <!-- 根据主键查询一条记录 -->
     <select id="get" resultMap="StudentApplyRefunds">
@@ -80,13 +86,27 @@
 	</delete>
 
     <!-- 分页查询 -->
-    <select id="queryPage" resultMap="StudentApplyRefunds" parameterType="map">
-        SELECT * FROM student_apply_refunds ORDER BY id_
-        <include refid="global.limit"/>
+    <select id="queryPage" resultMap="StudentApplyRefundsListDTO" parameterType="map">
+        SELECT sar.*,spo.expect_amount_,spo.actual_amount_,u.username_ FROM student_apply_refunds sar left join student_payment_order spo on sar.orig_payment_order_id_ = spo.id_ left join sys_user u on sar.user_id_ = u.id_
+        where 1=1 
+        <if test="startTime != null">
+            and sar.create_time_ &gt;= #{startTime}
+        </if>
+        <if test="endTime != null">
+            and sar.create_time_ &lt;= #{endTime}
+        </if>
+        ORDER BY sar.id_ <include refid="global.limit"/>
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM student_apply_refunds
+		SELECT count(1) FROM student_apply_refunds sar left join student_payment_order spo on sar.orig_payment_order_id_ = spo.id_ 
+		where 1=1 
+        <if test="startTime != null">
+            and sar.create_time_ = #{startTime}
+        </if>
+        <if test="endTime != null">
+            and sar.create_time_ = #{endTime}
+        </if>
 	</select>
 </mapper>

+ 8 - 3
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml

@@ -26,6 +26,10 @@
         <result column="pay_time_" property="payTime"/>
         <result column="version_" property="version"/>
     </resultMap>
+    
+    <resultMap type="com.ym.mec.biz.dal.entity.StudentPaymentOrder" extends="StudentPaymentOrder" id="PaymentOrderAndStudentInfo">
+    	<result column="username_" property="user.username"/>
+    </resultMap>
 
     <resultMap type="com.ym.mec.biz.dal.entity.Goods" id="Goods">
         <result column="id_" property="id"/>
@@ -139,8 +143,8 @@
     </delete>
 
     <!-- 分页查询 -->
-    <select id="queryPage" resultMap="StudentPaymentOrder" parameterType="map">
-        SELECT * FROM student_payment_order spo
+    <select id="queryPage" resultMap="PaymentOrderAndStudentInfo" parameterType="map">
+        SELECT spo.*,u.username_ FROM student_payment_order spo left join sys_user u on spo.user_id_ = u.id_
         <include refid="queryPaymentOrder"/>
         ORDER BY spo.id_
         <include refid="global.limit"/>
@@ -187,7 +191,7 @@
         FROM
         student_vip_group_payment svgp
         LEFT JOIN student_payment_order spo ON svgp.student_payment_order_id_=spo.id_
-        WHERE svgp.user_id_=#{userId} AND svgp.vip_group_id_=#{vipGroupId} AND spo.status_='ING'
+        WHERE svgp.user_id_=#{userId} AND svgp.vip_group_id_=#{vipGroupId} AND spo.status_='ING' and spo.type_ = 'SMALL_CLASS_TO_BUY'
     </select>
     <!-- 查询报名订单 -->
     <select id="findMusicGroupApplyOrderByStatus" resultMap="StudentPaymentOrder">
@@ -220,6 +224,7 @@
             <result column="goods_name_"/>
         </collection>
     </resultMap>
+    
     <select id="findGoodsIds" resultMap="userGoodsDto">
         SELECT g.id_ goods_id_,g.name_ goods_name_ FROM student_payment_order spo
         LEFT JOIN student_payment_order_detail spod ON spo.id_ = spod.payment_order_id_

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

@@ -61,7 +61,7 @@
     <select id="findAll" resultMap="Teacher">
         SELECT *
         FROM teacher
-        ORDER BY user_id_
+        ORDER BY id_
     </select>
 
     <!-- 向数据库增加一条记录 -->
@@ -133,12 +133,12 @@
                 introduction_ = #{introduction},
             </if>
         </set>
-        WHERE user_id_ = #{userId}
+        WHERE id_ = #{userId}
     </update>
 
     <!-- 根据主键删除一条记录 -->
     <update id="delete">
-        DELETE FROM teacher WHERE user_id_ = #{userId}
+        DELETE FROM teacher WHERE id_ = #{userId}
     </update>
 
     <update id="updateUser" parameterType="com.ym.mec.auth.api.entity.SysUser">

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

@@ -25,7 +25,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
 	@Override
 	public void configure(HttpSecurity http) throws Exception {
 		http.csrf().disable().exceptionHandling().accessDeniedHandler(baseAccessDeniedHandler).authenticationEntryPoint(baseAuthenticationEntryPoint).and()
-				.authorizeRequests().antMatchers("/v2/api-docs","/studentOrder/notify").permitAll().anyRequest().authenticated().and().httpBasic();
+				.authorizeRequests().antMatchers("/v2/api-docs","/studentOrder/notify","/musicGroup/test").permitAll().anyRequest().authenticated().and().httpBasic();
 	}
 
 	@Override

+ 1 - 1
mec-student/src/main/java/com/ym/mec/student/controller/ClassGroupController.java

@@ -37,7 +37,7 @@ public class ClassGroupController extends BaseController {
     @ApiOperation(value = "小班课报名")
     @PostMapping("/highReg")
     @ApiImplicitParams({@ApiImplicitParam(name = "classGroupId", value = "班级id", required = true, dataType = "int")})
-    public HttpResponseResult highReg(int classGroupId) throws Exception {
+    public HttpResponseResult highReg(int classGroupId){
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         ClassGroup classGroup = classGroupService.get(classGroupId);
         if (classGroup == null || !classGroup.getType().equals(ClassGroupTypeEnum.HIGH) || classGroup.getDelFlag().equals(1)) {

+ 17 - 14
mec-student/src/main/java/com/ym/mec/student/controller/WithdrawController.java

@@ -1,14 +1,15 @@
 package com.ym.mec.student.controller;
 
-import com.ym.mec.biz.dal.dto.CashAccountDetail;
-import com.ym.mec.biz.dal.dto.WithdrawDto;
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.entity.StudentWithdraw;
 import com.ym.mec.biz.service.StudentWithdrawService;
 import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -24,18 +25,20 @@ import org.springframework.web.bind.annotation.RestController;
 public class WithdrawController extends BaseController {
 
     @Autowired
-    private StudentWithdrawService withdrawService;
+    private StudentWithdrawService studentWithdrawService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
 
-    @PostMapping("confirm")
-    @ApiOperation(value = "确认提现")
-    public Object confirmWithdraw(@RequestBody WithdrawDto withdrawDto) {
-        withdrawService.confirmWithdraw(withdrawDto);
+    @ApiOperation(value = "新增提现申请")
+    @PostMapping("/add")
+    @PreAuthorize("@pcs.hasPermissions('studentWithdraw/add')")
+    public Object add(StudentWithdraw studentWithdraw) throws Exception {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(sysUser == null && sysUser.getId() == null){
+            return failed("获取用户信息失败");
+        }
+        studentWithdraw.setUserId(sysUser.getId());
+        studentWithdrawService.add(studentWithdraw);
         return succeed();
     }
-
-    @PostMapping("page")
-    @ApiOperation(value = "学员提现详情")
-    public Object getInfo(@RequestBody CashAccountDetail cashAccountDetail) {
-        return succeed(withdrawService.queryWithdrawPage(cashAccountDetail));
-    }
 }

+ 3 - 1
mec-student/src/main/resources/application.yml

@@ -53,7 +53,9 @@ spring:
 
 mybatis:
     mapperLocations: classpath:config/mybatis/*.xml
-    
+  #   configuration:
+  #      log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+
 swagger:
   base-package: com.ym.mec.student.controller
  

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

@@ -24,7 +24,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
 
 	@Override
 	public void configure(HttpSecurity http) throws Exception {
-		http.csrf().disable().exceptionHandling().accessDeniedHandler(baseAccessDeniedHandler).authenticationEntryPoint(baseAuthenticationEntryPoint).and().authorizeRequests().antMatchers("/v2/api-docs","/classGroup/revisionClassGroup").permitAll().anyRequest().authenticated().and().httpBasic();
+		http.csrf().disable().exceptionHandling().accessDeniedHandler(baseAccessDeniedHandler).authenticationEntryPoint(baseAuthenticationEntryPoint).and().authorizeRequests().antMatchers("/v2/api-docs").permitAll().anyRequest().authenticated().and().httpBasic();
 	}
 
 	@Override

+ 31 - 0
mec-web/src/main/java/com/ym/mec/web/controller/StudentApplyRefundsController.java

@@ -0,0 +1,31 @@
+package com.ym.mec.web.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+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.dal.page.StudentApplyrefundsQueryInfo;
+import com.ym.mec.biz.service.StudentApplyRefundsService;
+import com.ym.mec.common.controller.BaseController;
+
+@RequestMapping("studentRefunds")
+@Api(tags = "退费服务")
+@RestController
+public class StudentApplyRefundsController extends BaseController {
+	
+	@Autowired
+	private StudentApplyRefundsService studentApplyRefundsService;
+
+	@ApiOperation(value = "查询退费列表")
+    @GetMapping("/queryPage")
+    @PreAuthorize("@pcs.hasPermissions('studentRefunds/queryPage')")
+    public Object queryPage(StudentApplyrefundsQueryInfo queryInfo){
+		
+        return succeed(studentApplyRefundsService.queryPage(queryInfo));
+    }
+}

+ 14 - 3
mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java

@@ -4,9 +4,8 @@ import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.biz.service.StudentManageService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.page.QueryInfo;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.*;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -35,6 +34,18 @@ public class StudentManageController extends BaseController {
         return succeed(studentManageService.queryMusicGroupStudent(queryInfo));
     }
 
+    @ApiOperation(value = "乐团管理--乐团详情--学员列表--查看班级")
+    @GetMapping("/queryStudentClassGroup")
+    @PreAuthorize("@pcs.hasPermissions('studentManage/queryStudentClassGroup')")
+    @ApiImplicitParams({@ApiImplicitParam(name = "teacherId", value = "学生编号", required = true, dataType = "Integer"),
+            @ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String")})
+    public Object queryStudentClassGroup(String musicGroupId,Integer teacherId){
+        if(StringUtils.isEmpty(musicGroupId) || teacherId == null){
+            return failed("参数校验失败");
+        }
+        return succeed(studentManageService.queryStudentClassGroup(musicGroupId,teacherId));
+    }
+
     @ApiOperation(value = "乐团管理--乐团详情--学员列表,汇总数据接口")
     @GetMapping("/musicGroupStudentsSum")
     @PreAuthorize("@pcs.hasPermissions('studentManage/musicGroupStudentsSum')")

+ 12 - 9
mec-web/src/main/java/com/ym/mec/web/controller/student/StudentPaymentOrderController.java → mec-web/src/main/java/com/ym/mec/web/controller/StudentPaymentOrderController.java

@@ -1,26 +1,29 @@
-package com.ym.mec.web.controller.student;
+package com.ym.mec.web.controller;
 
-import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
-import com.ym.mec.biz.service.StudentPaymentOrderService;
-import com.ym.mec.common.controller.BaseController;
-import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-@RequestMapping("studentPaymentOrder")
-@Api(tags = "学生缴费订单服务")
+import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
+import com.ym.mec.biz.service.StudentPaymentOrderService;
+import com.ym.mec.common.controller.BaseController;
+
+@RequestMapping("order")
+@Api(tags = "订单服务")
 @RestController
 public class StudentPaymentOrderController extends BaseController {
 
     @Autowired
     private StudentPaymentOrderService studentPaymentOrderService;
 
-    @ApiOperation(value = "获取学员订单列表")
-    @GetMapping("/queryOrderPage")
+    @ApiOperation(value = "获取订单列表")
+    @GetMapping("/queryPage")
+    @PreAuthorize("@pcs.hasPermissions('order/queryPage')")
     public Object queryOrderPage(StudentPaymentOrderQueryInfo queryInfo){
         return succeed(studentPaymentOrderService.queryPage(queryInfo));
     }

+ 17 - 20
mec-web/src/main/java/com/ym/mec/web/controller/StudentWithdrawController.java

@@ -1,19 +1,14 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dto.CashAccountDetail;
 import com.ym.mec.biz.dal.dto.WithdrawDto;
-import com.ym.mec.biz.dal.entity.StudentWithdraw;
 import com.ym.mec.biz.service.StudentWithdrawService;
 import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
-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 org.springframework.web.bind.annotation.*;
 
 @RequestMapping("studentWithdraw")
 @Api(tags = "提现服务")
@@ -22,22 +17,24 @@ public class StudentWithdrawController extends BaseController {
 
     @Autowired
     private StudentWithdrawService studentWithdrawService;
-    @Autowired
-    private SysUserFeignService sysUserFeignService;
-
-    @ApiOperation(value = "新增提现申请")
-    @PostMapping("/add")
-    @PreAuthorize("@pcs.hasPermissions('studentWithdraw//add')")
-    public Object add(StudentWithdraw studentWithdraw) throws Exception {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if(sysUser == null && sysUser.getId() == null){
-            return failed("获取用户信息失败");
-        }
-        studentWithdraw.setUserId(sysUser.getId());
-        studentWithdrawService.add(studentWithdraw);
+
+
+    @PostMapping("confirm")
+    @ApiOperation(value = "确认提现")
+    @PreAuthorize("@pcs.hasPermissions('studentWithdraw/confirm')")
+    public Object confirmWithdraw(@RequestBody WithdrawDto withdrawDto) {
+        studentWithdrawService.confirmWithdraw(withdrawDto);
         return succeed();
     }
 
+    @PostMapping("page")
+    @ApiOperation(value = "学员提现详情")
+    @PreAuthorize("@pcs.hasPermissions('studentWithdraw/page')")
+    public Object getInfo(@RequestBody CashAccountDetail cashAccountDetail) {
+        return succeed(studentWithdrawService.queryWithdrawPage(cashAccountDetail));
+    }
+
+
     @ApiOperation(value = "分页查询")
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('studentWithdraw/queryPage')")

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

@@ -32,7 +32,6 @@ public class UploadFileController extends BaseController {
 	private UploadFileService uploadFileService;
 
 	@PostMapping(value = "uploadFile")
-    @PreAuthorize("@pcs.hasPermissions('uploadFile')")
 	public Object uploadFile(@ApiParam(value = "上传的文件", required = true) @RequestParam("file") MultipartFile file) {
 		try {
 			if (file != null && StringUtils.isNotBlank(file.getOriginalFilename())) {