瀏覽代碼

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

yonge 5 年之前
父節點
當前提交
1a067aaaa1
共有 47 個文件被更改,包括 691 次插入97 次删除
  1. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java
  2. 13 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupStudentMapperDao.java
  3. 46 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java
  4. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupStudentFeeDao.java
  5. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysPaymentConfigDao.java
  6. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseTimeDto.java
  7. 25 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupStudentsDto.java
  8. 68 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/VipGroupCourseAdjustInfoDto.java
  9. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/VipGroupCourseSchduleRecordDto.java
  10. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupStudentFee.java
  11. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/School.java
  12. 14 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysPaymentConfig.java
  13. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/MusicGroupStudentQueryInfo.java
  14. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/VipGroupQueryInfo.java
  15. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupService.java
  16. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleService.java
  17. 4 0
      mec-biz/src/main/java/com/ym/mec/biz/service/SchoolService.java
  18. 1 0
      mec-biz/src/main/java/com/ym/mec/biz/service/SysPaymentConfigService.java
  19. 36 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java
  20. 22 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupTeacherMapperServiceImpl.java
  21. 0 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ContractServiceImpl.java
  22. 120 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  23. 4 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java
  24. 11 5
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  25. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PayServiceImpl.java
  26. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SchoolServiceImpl.java
  27. 4 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentAttendanceServiceImpl.java
  28. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java
  29. 19 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  30. 5 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysPaymentConfigServiceImpl.java
  31. 39 18
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  32. 18 12
      mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml
  33. 10 3
      mec-biz/src/main/resources/config/mybatis/ClassGroupStudentMapperMapper.xml
  34. 40 17
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  35. 1 1
      mec-biz/src/main/resources/config/mybatis/CourseScheduleTeacherSalaryMapper.xml
  36. 3 0
      mec-biz/src/main/resources/config/mybatis/MusicGroupStudentFeeMapper.xml
  37. 6 0
      mec-biz/src/main/resources/config/mybatis/SchoolMapper.xml
  38. 7 1
      mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml
  39. 16 1
      mec-biz/src/main/resources/config/mybatis/SysPaymentConfigMapper.xml
  40. 5 0
      mec-biz/src/main/resources/config/mybatis/VipGroupMapper.xml
  41. 1 0
      mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java
  42. 1 1
      mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupRegisterController.java
  43. 0 3
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/SmsCodeController.java
  44. 9 0
      mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleController.java
  45. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/SchoolController.java
  46. 20 9
      mec-web/src/main/java/com/ym/mec/web/controller/SysPaymentConfigController.java
  47. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/VipGroupManageController.java

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

@@ -522,4 +522,15 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
     int batchUpdateStudentNumMinusOne(@Param("classGroupIds") List<Integer> classGroupIdList);
 
     int updateTest(@Param("delFlag") YesOrNoEnum delFlag);
+
+    /**
+     * @describe 根据乐团编号和类型获取班级
+     * @author Joburgess
+     * @date 2019/12/11
+     * @param groupId: 乐团编号
+     * @param groupType: 乐团类型
+     * @return com.ym.mec.biz.dal.entity.ClassGroup
+     */
+    ClassGroup findByGroupAndType(@Param("groupId") String groupId,
+                                  @Param("groupType") String groupType);
 }

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

@@ -243,4 +243,17 @@ public interface ClassGroupStudentMapperDao extends BaseDAO<Long, ClassGroupStud
      */
     List<ClassGroupStudentMapper> findByClassGroupAndStudent(@Param("classGroupId") Integer classGroupId,
                                                              @Param("userIds") List<Integer> userIds);
+
+    /**
+     * @describe 批量更新指定乐团或小课下学员状态
+     * @author Joburgess
+     * @date 2019/12/10
+     * @param groupId: 编号
+     * @param groupType: 类型
+     * @param status: 状态
+     * @return int
+     */
+    int updateVipGroupStudentStatus(@Param("groupId") String groupId,
+                                    @Param("groupType") String groupType,
+                                    @Param("status") String status);
 }

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

@@ -10,6 +10,7 @@ import com.ym.mec.biz.dal.enums.CourseStatusEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.common.dal.BaseDAO;
 
+import com.ym.mec.common.page.PageInfo;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
@@ -533,6 +534,14 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
     List<String> queryMusicGroupIds(Map<String, Object> params);
 
     /**
+     * count学员购买的所有乐团和vip编号分页列表
+     *
+     * @param params
+     * @return
+     */
+    Integer countMusicGroupIds(Map<String, Object> params);
+
+    /**
      * @describe 获取学员购买的所有乐团和vip编号分页列表,排除已结束的乐团
      * @author Joburgess
      * @date 2019/12/2
@@ -542,6 +551,15 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
     List<String> queryMusicGroupIdsWithoutOverGroup(Map<String, Object> params);
 
     /**
+     * @describe count学员购买的所有乐团和vip编号分页列表,排除已结束的乐团
+     * @author Joburgess
+     * @date 2019/12/2
+     * @param params: 参数
+     * @return java.util.List<java.lang.String>
+     */
+    Integer countMusicGroupIdsWithoutOverGroup(Map<String, Object> params);
+
+    /**
      * @param startTime: 开始时间
      * @param endTime:   结束时间
      * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
@@ -713,4 +731,32 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
     void updateCourseScheduleSchool(@Param("groupType") String groupType,@Param("musicGroupId") String musicGroupId,@Param("schoolId") Integer schoolId);
 
     int countCourseScheduleByMusicGroupId(@Param("musicGroupId") String musicGroupId);
+
+    /**
+     * @describe 获取班级上未删除的课程
+     * @author Joburgess
+     * @date 2019/12/11
+     * @param classGroupId: 班级编号
+     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
+     */
+    List<CourseSchedule> findClassGroupCourseSchedules(@Param("classGroupId") Integer classGroupId);
+
+    /**
+     * @describe 批量修改乐团下所有课程上的教学点
+     * @author Joburgess
+     * @date 2019/12/11
+     * @param groupId: 乐团编号
+     * @param groupType: 乐团类型
+     * @return int
+     */
+    int updateCourseSchoolByGroup(@Param("groupId") String groupId,
+                                  @Param("groupType") String groupType,
+                                  @Param("schoolId") Integer schoolId);
+
+    /**
+     * 获取学员的课程列表
+     * @param params
+     * @return
+     */
+    PageInfo<CourseListDto> queryStudentCourse(Map<String, Object> params);
 }

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

@@ -8,6 +8,7 @@ import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 public interface MusicGroupStudentFeeDao extends BaseDAO<Long, MusicGroupStudentFee> {
 
@@ -120,4 +121,11 @@ public interface MusicGroupStudentFeeDao extends BaseDAO<Long, MusicGroupStudent
 	 */
 	void batchInsert(@Param("musicGroupStudentFees") List<MusicGroupStudentFee> musicGroupStudentFees
 			, @Param("nextPaymentDate") Date nextPaymentDate, @Param("paymentStatus") String paymentStatus);
+
+	/**
+	 * 获取当前乐团下所有学员缴费状态
+	 * @param musicGroupId
+	 * @return
+	 */
+	List<Map<Integer, String>> findPaymentStatusMap(String musicGroupId);
 }

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysPaymentConfigDao.java

@@ -2,6 +2,8 @@ package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.entity.SysPaymentConfig;
 import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
 
 public interface SysPaymentConfigDao extends BaseDAO<Integer, SysPaymentConfig> {
+    SysPaymentConfig findPaymentConfigByOrganId(@Param("organId") Integer organId);
 }

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseTimeDto.java

@@ -4,13 +4,13 @@ import io.swagger.annotations.ApiModelProperty;
 
 public class CourseTimeDto {
 
-    @ApiModelProperty(value = "排课星期几",required = true)
+    @ApiModelProperty(value = "排课星期几")
     private Integer dayOfWeek;
 
-    @ApiModelProperty(value = "上课开始时间",required = true)
+    @ApiModelProperty(value = "上课开始时间")
     private String startClassTime;
 
-    @ApiModelProperty(value = "上课结束时间",required = true)
+    @ApiModelProperty(value = "上课结束时间")
     private String endClassTime;
 
     public Integer getDayOfWeek() {

+ 25 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupStudentsDto.java

@@ -2,6 +2,9 @@ package com.ym.mec.biz.dal.dto;
 
 import io.swagger.annotations.ApiModelProperty;
 
+import java.math.BigDecimal;
+import java.util.Date;
+
 public class MusicGroupStudentsDto{
 
     @ApiModelProperty(value = "学生编号",required = false)
@@ -25,6 +28,12 @@ public class MusicGroupStudentsDto{
     @ApiModelProperty(value = "专业",required = false)
     private String subjectName;
 
+    @ApiModelProperty(value = "下次缴费日期",required = false)
+    private Date nextPaymentDate;
+
+    @ApiModelProperty(value = "课程费用",required = false)
+    private BigDecimal courseFee;
+
     @ApiModelProperty(value = "乐团编号",required = false)
     private String musicGroupId;
 
@@ -37,6 +46,22 @@ public class MusicGroupStudentsDto{
     @ApiModelProperty(value = "是否新增学员(1是0否)",required = false)
     private Integer isNewStudent;
 
+    public Date getNextPaymentDate() {
+        return nextPaymentDate;
+    }
+
+    public void setNextPaymentDate(Date nextPaymentDate) {
+        this.nextPaymentDate = nextPaymentDate;
+    }
+
+    public BigDecimal getCourseFee() {
+        return courseFee;
+    }
+
+    public void setCourseFee(BigDecimal courseFee) {
+        this.courseFee = courseFee;
+    }
+
     public Integer getUserId() {
         return userId;
     }

+ 68 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/VipGroupCourseAdjustInfoDto.java

@@ -0,0 +1,68 @@
+package com.ym.mec.biz.dal.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/12/11
+ */
+public class VipGroupCourseAdjustInfoDto {
+
+    @ApiModelProperty(value = "vip课编号")
+    private Integer vipGroupId;
+
+    @ApiModelProperty(value = "需要调整的vip课排课计划的编号")
+    private String courseScheduleIds;
+
+    @ApiModelProperty(value = "开始排课时间")
+    private Date courseCreateStartTime;
+
+    @ApiModelProperty(value = "可排课时间")
+    private List<CourseTimeDto> courseTimes;
+
+    @ApiModelProperty(value = "是否跳过节假日 true-跳过 false-不跳过")
+    private boolean isHoliday;
+
+    public Integer getVipGroupId() {
+        return vipGroupId;
+    }
+
+    public void setVipGroupId(Integer vipGroupId) {
+        this.vipGroupId = vipGroupId;
+    }
+
+    public String getCourseScheduleIds() {
+        return courseScheduleIds;
+    }
+
+    public void setCourseScheduleIds(String courseScheduleIds) {
+        this.courseScheduleIds = courseScheduleIds;
+    }
+
+    public Date getCourseCreateStartTime() {
+        return courseCreateStartTime;
+    }
+
+    public void setCourseCreateStartTime(Date courseCreateStartTime) {
+        this.courseCreateStartTime = courseCreateStartTime;
+    }
+
+    public List<CourseTimeDto> getCourseTimes() {
+        return courseTimes;
+    }
+
+    public void setCourseTimes(List<CourseTimeDto> courseTimes) {
+        this.courseTimes = courseTimes;
+    }
+
+    public boolean isHoliday() {
+        return isHoliday;
+    }
+
+    public void setHoliday(boolean holiday) {
+        isHoliday = holiday;
+    }
+}

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

@@ -19,6 +19,9 @@ public class VipGroupCourseSchduleRecordDto {
     @ApiModelProperty(value = "上课时间")
     private java.util.Date startClassTime;
 
+    @ApiModelProperty(value = "课程结束时间")
+    private Date endClassTime;
+
     @ApiModelProperty(value = "课程状态  NOT_START未开始,SIGN_IN已签到,SIGN_OUT已签退")
     private CourseStatusEnum status;
 
@@ -35,6 +38,14 @@ public class VipGroupCourseSchduleRecordDto {
 
     private Integer schooleId;
 
+    public Date getEndClassTime() {
+        return endClassTime;
+    }
+
+    public void setEndClassTime(Date endClassTime) {
+        this.endClassTime = endClassTime;
+    }
+
     public Integer getSchooleId() {
         return schooleId;
     }

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

@@ -74,7 +74,7 @@ public class MusicGroupStudentFee {
 	private java.util.Date updateTime;
 
 	public MusicGroupStudentFee(String musicGroupId, Integer userId, Integer subjectId,
-								BigDecimal courseFee, Date nextPaymentDate, BigDecimal temporaryCourseFee) {
+								BigDecimal courseFee, Date nextPaymentDate, BigDecimal temporaryCourseFee,PaymentStatus paymentStatus) {
 		this.musicGroupId = musicGroupId;
 		this.userId = userId;
 		this.subjectId = subjectId;
@@ -82,7 +82,7 @@ public class MusicGroupStudentFee {
 		this.nextPaymentDate = nextPaymentDate;
 		this.continuousAbsenteeismTimes = 0;
 		this.temporaryCourseFee = temporaryCourseFee;
-		this.paymentStatus = PaymentStatus.PAID_COMPLETED;
+		this.paymentStatus = paymentStatus;
 	}
 
 	public MusicGroupStudentFee() {

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

@@ -25,6 +25,10 @@ public class School {
 	private Integer organId;
 
 	/**  */
+	@ApiModelProperty(value = "所属机构名称", required = false)
+	private String organName;
+
+	/**  */
 	@ApiModelProperty(value = "地址", required = false)
 	private String address;
 
@@ -58,6 +62,14 @@ public class School {
 	@ApiModelProperty(value = "备注", required = false)
 	private String remark;
 
+	public String getOrganName() {
+		return organName;
+	}
+
+	public void setOrganName(String organName) {
+		this.organName = organName;
+	}
+
 	public void setId(Integer id) {
 		this.id = id;
 	}

+ 14 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysPaymentConfig.java

@@ -11,6 +11,12 @@ public class SysPaymentConfig {
     private Integer id;
 
     /**
+     * type
+     */
+    @ApiModelProperty(value = "type(1-比例 2-类型)")
+    private Integer type;
+
+    /**
      * 分部id
      */
     @ApiModelProperty(value = "分部id")
@@ -159,5 +165,13 @@ public class SysPaymentConfig {
     public void setUpdateTime(Date updateTime) {
         this.updateTime = updateTime;
     }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
 }
 

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

@@ -8,6 +8,9 @@ public class MusicGroupStudentQueryInfo extends QueryInfo {
   @ApiModelProperty(value = "科目编号")
   private Integer subjectId;
 
+  @ApiModelProperty(value = "学员姓名")
+  private String studentName;
+
   @ApiModelProperty(value = "乐团编号")
   private String musicGroupId;
 
@@ -17,6 +20,14 @@ public class MusicGroupStudentQueryInfo extends QueryInfo {
   @ApiModelProperty(value = "缴费状态  PAID_COMPLETED(完成缴费), NON_PAYMENT(未缴费), PROCESSING(缴费中)",required = false)
   private String paymentStatus;
 
+  public String getStudentName() {
+    return studentName;
+  }
+
+  public void setStudentName(String studentName) {
+    this.studentName = studentName;
+  }
+
   public String getMusicGroupId() {
     return musicGroupId;
   }

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

@@ -16,6 +16,16 @@ public class VipGroupQueryInfo extends QueryInfo {
 
     private Integer activityId;
 
+    private String status;
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
     public Integer getTeacherId() {
         return teacherId;
     }

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

@@ -350,4 +350,13 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
 
     boolean updateTotalClassTimes(Long classGroupId, Integer num);
 
+    /**
+     * @describe 跟新班级相关信息
+     * @author Joburgess
+     * @date 2019/12/11
+     * @param classGroupId: 班级编号
+     * @return void
+     */
+    void updateClassGroupInfo(Integer classGroupId);
+
 }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleService.java

@@ -3,6 +3,7 @@ package com.ym.mec.biz.service;
 import com.ym.mec.biz.dal.dto.CourseAttendanceDetailHeadInfoDto;
 import com.ym.mec.biz.dal.dto.CourseScheduleDto;
 import com.ym.mec.biz.dal.dto.TeacherAttendanceDto;
+import com.ym.mec.biz.dal.dto.VipGroupCourseAdjustInfoDto;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
@@ -167,6 +168,15 @@ public interface CourseScheduleService extends BaseService<Long, CourseSchedule>
 	void classStartDateAdjust(List<CourseSchedule> newCourseSchedules);
 
 	/**
+	 * @describe 小课课程批量调整
+	 * @author Joburgess
+	 * @date 2019/12/11
+	 * @param vipGroupCourseAdjustInfo: 调整信息
+	 * @return void
+	 */
+	void vipCourseAdjust(VipGroupCourseAdjustInfoDto vipGroupCourseAdjustInfo);
+
+	/**
 	 * @Author: Joburgess
 	 * @Date: 2019/9/24
 	 * 课程交换

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

@@ -1,6 +1,8 @@
 package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.entity.School;
+import com.ym.mec.biz.dal.page.SchoolQueryInfo;
+import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 
 import java.util.List;
@@ -22,4 +24,6 @@ public interface SchoolService extends BaseService<Integer, School> {
      * @return java.util.List<com.ym.mec.biz.dal.entity.School>
      */
     List<School> findVipSchoolByTeacher(Integer teacherId,String organId,Integer isDefault);
+
+    PageInfo<School> queryPageDetail(SchoolQueryInfo queryInfo);
 }

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

@@ -5,5 +5,6 @@ import com.ym.mec.common.service.BaseService;
 
 public interface SysPaymentConfigService extends BaseService<Integer, SysPaymentConfig> {
 
+    SysPaymentConfig findPaymentConfigByOrganId(Integer organId);
 
 }

+ 36 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -556,16 +556,20 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         List<CourseListDto> courseListDtos = null;
         //获取分页前的所有的乐团编号和vip编号
         params.put("offset", pageInfo.getOffset());
-        List<String> musicGroupIds = courseScheduleDao.queryMusicGroupIds(params);
+        List<String> musicGroupIds = null;
         if (queryInfo.isHideOverGroup()) {
             musicGroupIds = courseScheduleDao.queryMusicGroupIdsWithoutOverGroup(params);
+            pageInfo.setTotal(courseScheduleDao.countMusicGroupIdsWithoutOverGroup(params));
+        }else {
+            musicGroupIds = courseScheduleDao.queryMusicGroupIds(params);
+            pageInfo.setTotal(courseScheduleDao.countMusicGroupIds(params));
         }
         courseListDtos = new ArrayList<>();
         //获取学员所购买的vip课列表详情
         List<CourseListDto> vipCourses = classGroupDao.queryStudentVipCourses(StringUtils.join(musicGroupIds, ","), userId);
         //获取vip课的学生列表
         Set<String> vipIds = vipCourses.stream().map(CourseListDto::getMusicGroupId).collect(Collectors.toSet());
-        Map<String, String> vipStuNames = MapUtil.convertMybatisMap(classGroupDao.findVipStuNames(StringUtils.join(vipIds, ",")));
+        Map<String, String> vipStuNames = MapUtil.convertIntegerMap(classGroupDao.findVipStuNames(StringUtils.join(vipIds, ",")));
         //获取学员的乐团列表详情
         courseListDtos.addAll(classGroupDao.queryStudentMusicGroupCourses(StringUtils.join(musicGroupIds, ","), userId));
         courseListDtos.addAll(vipCourses);
@@ -597,7 +601,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 }
             }
         });
-        pageInfo.setTotal(courseListDtos.size());
         pageInfo.setRows(courseListDtos);
         return pageInfo;
     }
@@ -1968,4 +1971,34 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
         return true;
     }
+
+    @Override
+    public void updateClassGroupInfo(Integer classGroupId) {
+        ClassGroup classGroup=classGroupDao.get(classGroupId);
+        List<CourseSchedule> courseSchedules = courseScheduleDao.findClassGroupCourseSchedules(classGroupId);
+        int totalClassTimes=courseSchedules.size();
+        int currentClassTimes=0;
+        for (CourseSchedule courseSchedule : courseSchedules) {
+            if(courseSchedule.getStatus().equals(CourseStatusEnum.OVER)){
+                currentClassTimes+=1;
+            }
+        }
+        classGroup.setTotalClassTimes(totalClassTimes);
+        classGroup.setCurrentClassTimes(currentClassTimes);
+        Integer studentNum = classGroupStudentMapperDao.countClassGroupStudentNum(classGroupId);
+        classGroup.setStudentNum(studentNum);
+        if(classGroup.getGroupType().equals(GroupType.VIP)){
+            VipGroup vipGroup=vipGroupDao.get(Long.parseLong(classGroup.getMusicGroupId()));
+            if (currentClassTimes<totalClassTimes
+                    &&vipGroup.getStatus().equals(VipGroupStatusEnum.FINISHED)){
+                vipGroup.setStatus(VipGroupStatusEnum.PROGRESS);
+            }
+            if(currentClassTimes>=totalClassTimes
+                &&vipGroup.getStatus().equals(VipGroupStatusEnum.PROGRESS)){
+                vipGroup.setStatus(VipGroupStatusEnum.FINISHED);
+            }
+            vipGroupDao.update(vipGroup);
+        }
+        classGroupDao.update(classGroup);
+    }
 }

+ 22 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupTeacherMapperServiceImpl.java

@@ -302,7 +302,10 @@ public class ClassGroupTeacherMapperServiceImpl extends BaseServiceImpl<Long, Cl
                 if (classGroupNoStartCourseSchedule.getType().equals(CourseSchedule.CourseScheduleType.HIGH)) {
                     //课程时长与结算单位时长占比
                     classTimeDuty = new BigDecimal(duration).divide(new BigDecimal(45), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
-                    baseSalary = classGroupTeacherMapper.getTeacherRole().equals(TeachTypeEnum.BISHOP) ? teacherDefaultMusicGroupSalary.getMainTeacher90MinSalary() : teacherDefaultMusicGroupSalary.getAssistantTeacher90MinSalary();
+                    baseSalary = classGroupTeacherMapper.getTeacherRole().equals(TeachTypeEnum.BISHOP) ? teacherDefaultMusicGroupSalary.getMainTeacher30MinSalary() : teacherDefaultMusicGroupSalary.getAssistantTeacher30MinSalary();
+                    if (musicGroup.getSettlementType().equals(SalarySettlementTypeEnum.GRADIENT_SALARY)) {
+                        baseSalary = classGroupTeacherMapper.getTeacherRole().equals(TeachTypeEnum.BISHOP) ? teacherDefaultMusicGroupSalary.getMainTeacher90MinSalary() : teacherDefaultMusicGroupSalary.getAssistantTeacher90MinSalary();
+                    }
                 }
 
                 salary = baseSalary.multiply(classTimeDuty).setScale(2, BigDecimal.ROUND_HALF_UP);
@@ -443,14 +446,29 @@ public class ClassGroupTeacherMapperServiceImpl extends BaseServiceImpl<Long, Cl
 
         //如果结算方式是教师默认课酬
         if (settlementType.equals(SalarySettlementTypeEnum.TEACHER_DEFAULT.getCode())) {
+            BigDecimal baseTime = new BigDecimal(30);
+            if (courseSchedule.getType().equals(CourseSchedule.CourseScheduleType.HIGH)) {
+                baseTime = new BigDecimal(45);
+            }
+            if (courseSchedule.getType().equals(CourseSchedule.CourseScheduleType.CLASSROOM)) {
+                baseTime = new BigDecimal(40);
+            }
             //课程时长与结算单位时长占比
-            BigDecimal classTimeDuty = new BigDecimal(duration).divide(new BigDecimal(30), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
+            BigDecimal classTimeDuty = new BigDecimal(duration).divide(baseTime, CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
             BigDecimal teacherDefaultSalary = teachType == TeachTypeEnum.BISHOP ? teacherDefaultMusicGroupSalaryWithTeacherId.getMainTeacher30MinSalary() : teacherDefaultMusicGroupSalaryWithTeacherId.getAssistantTeacher30MinSalary();
             teacherSalary = teacherDefaultSalary.multiply(classTimeDuty).setScale(2, BigDecimal.ROUND_HALF_UP);
         } else if (settlementType.equals(SalarySettlementTypeEnum.GRADIENT_SALARY.getCode())) {
-            //课程时长与结算单位时长占比
-            BigDecimal classTimeDuty = new BigDecimal(duration).divide(new BigDecimal(90), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
             BigDecimal teacherDefaultSalary = teachType == TeachTypeEnum.BISHOP ? teacherDefaultMusicGroupSalaryWithTeacherId.getMainTeacher90MinSalary() : teacherDefaultMusicGroupSalaryWithTeacherId.getAssistantTeacher90MinSalary();
+            BigDecimal baseTime = new BigDecimal(90);
+            if (courseSchedule.getType().equals(CourseSchedule.CourseScheduleType.HIGH)) {
+                baseTime = new BigDecimal(45);
+            }
+            if (courseSchedule.getType().equals(CourseSchedule.CourseScheduleType.CLASSROOM)) {
+                baseTime = new BigDecimal(40);
+                teacherDefaultSalary = teachType == TeachTypeEnum.BISHOP ? teacherDefaultMusicGroupSalaryWithTeacherId.getMainTeacher30MinSalary() : teacherDefaultMusicGroupSalaryWithTeacherId.getAssistantTeacher30MinSalary();
+            }
+            //课程时长与结算单位时长占比
+            BigDecimal classTimeDuty = new BigDecimal(duration).divide(baseTime, CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN);
             teacherSalary = teacherDefaultSalary.multiply(classTimeDuty).setScale(2, BigDecimal.ROUND_HALF_UP);
         }
         CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary(

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

@@ -143,7 +143,6 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 	public SysUserTsign register(Integer userId, String realName, String idCardNo, String mobileNo) {
 
 		SysUserTsign sysUserTsign = sysUserTsignService.get(userId);
-
 		if (sysUserTsign == null) {
 
 			String accountId = eSealPlugin.createUserAccount(realName, idCardNo, mobileNo);

+ 120 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -18,10 +18,10 @@ import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.jiari.JiaRiFeignService;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext.MessageSender;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
-
 import org.apache.commons.collections.ListUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
@@ -79,6 +79,8 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 	private SubjectDao subjectDao;
 	@Autowired
 	private ClassGroupTeacherSalaryDao classGroupTeacherSalaryDao;
+	@Autowired
+	private JiaRiFeignService jiaRiFeignService;
 
 	@Override
 	public BaseDAO<Long, CourseSchedule> getDAO() {
@@ -840,6 +842,117 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 	}
 
 	@Override
+	public void vipCourseAdjust(VipGroupCourseAdjustInfoDto vipGroupCourseAdjustInfo) {
+		if(Objects.isNull(vipGroupCourseAdjustInfo.getVipGroupId())){
+			throw new BizException("请指定小课");
+		}
+		if(Objects.isNull(vipGroupCourseAdjustInfo.getCourseCreateStartTime())){
+			throw new BizException("请指定排课起始时间;");
+		}
+		if(CollectionUtils.isEmpty(vipGroupCourseAdjustInfo.getCourseTimes())){
+			throw new BizException("请指定排课周期");
+		}
+		if(StringUtils.isBlank(vipGroupCourseAdjustInfo.getCourseScheduleIds())){
+			throw new BizException("请指定需要调整的小课课程");
+		}
+		Date courseCreateStartTime = vipGroupCourseAdjustInfo.getCourseCreateStartTime();
+		Date now = new Date();
+		if(courseCreateStartTime.before(now)){
+			throw new BizException("排课起始时间不能小于当前时间");
+		}
+
+		VipGroup vipGroup=vipGroupDao.get(vipGroupCourseAdjustInfo.getVipGroupId().longValue());
+		if(Objects.isNull(vipGroup)){
+			throw new BizException("指定课程不存在");
+		}
+
+		ClassGroup classGroup=classGroupDao.findByGroupAndType(vipGroupCourseAdjustInfo.getVipGroupId().toString(),GroupType.VIP.getCode());
+		if(Objects.isNull(classGroup)){
+			throw new BizException("对应班级不存在");
+		}
+
+		//所有课程编号
+		List<Long> courseScheduleIds = Arrays.asList(vipGroupCourseAdjustInfo.getCourseScheduleIds().split(","))
+				.stream().map(Long::parseLong).collect(Collectors.toList());
+		//所有的课程
+		List<CourseSchedule> courseSchedules = courseScheduleDao.findByCourseScheduleIds(courseScheduleIds);
+
+		if(courseScheduleIds.size()!=courseScheduleIds.size()){
+			throw new BizException("部分课程不存在");
+		}
+
+		//课程对应的签到列表
+		List<TeacherAttendance> teacherAttendances = teacherAttendanceDao.findTeacherIdByCourseSchedule(courseScheduleIds);
+		Map<Long, List<TeacherAttendance>> teacherAttendanceCourseMap = teacherAttendances.stream()
+				.collect(Collectors.groupingBy(TeacherAttendance::getCourseScheduleId));
+
+		Calendar calendar = Calendar.getInstance();
+		calendar.setTime(courseCreateStartTime);
+		List<Date> courseStartDates = new ArrayList<>();
+
+		Map<String, Integer> holidayDays = new HashMap<>();
+		Map<Integer, Map<String, Integer>> holiday = new HashMap<>();;
+		if (vipGroupCourseAdjustInfo.isHoliday()) {
+			holiday = jiaRiFeignService.query(calendar.get(Calendar.YEAR));
+			holidayDays = holiday.get(calendar.get(Calendar.YEAR));
+		}
+
+		while (true) {
+			if(vipGroupCourseAdjustInfo.isHoliday() && !holiday.containsKey(calendar.get(Calendar.YEAR))){
+				holiday = jiaRiFeignService.query(calendar.get(Calendar.YEAR));
+				holidayDays = holiday.get(calendar.get(Calendar.YEAR));
+			}
+			if (vipGroupCourseAdjustInfo.isHoliday() && holidayDays.containsKey(DateUtil.format(calendar.getTime(),"MMdd"))) {
+				calendar.add(Calendar.DATE, 1);
+				continue;
+			}
+			int i = calendar.get(Calendar.DAY_OF_WEEK);
+			if(i==1){
+				i=7;
+			}else{
+				i=--i;
+			}
+			for (CourseTimeDto courseTime : vipGroupCourseAdjustInfo.getCourseTimes()) {
+				if(Objects.isNull(courseTime.getDayOfWeek())){
+					throw new BizException("排课循环周期错误");
+				}
+				if(courseTime.getDayOfWeek()<1||courseTime.getDayOfWeek()>7){
+					throw new BizException("排课循环周期错误");
+				}
+				if(courseTime.getDayOfWeek()==i){
+					String dateYmdStr = DateUtil.dateToString(calendar.getTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT);
+					dateYmdStr = dateYmdStr + " " +courseTime.getStartClassTime();
+					Date courseStartTime = DateUtil.stringToDate(dateYmdStr, "yyyy-MM-dd HH:mm");
+					Date courseEndTime = DateUtil.addMinutes(courseStartTime,vipGroup.getSingleClassMinutes());
+					courseStartDates.add(DateUtil.stringToDate(dateYmdStr, DateUtil.EXPANDED_DATE_TIME_FORMAT));
+					courseSchedules.get(courseStartDates.size()-1).setStatus(CourseStatusEnum.NOT_START);
+					courseSchedules.get(courseStartDates.size()-1).setClassDate(courseStartTime);
+					courseSchedules.get(courseStartDates.size()-1).setStartClassTime(courseStartTime);
+					courseSchedules.get(courseStartDates.size()-1).setEndClassTime(courseEndTime);
+					List<TeacherAttendance> tempTeacherAttendances=teacherAttendanceCourseMap.get(courseSchedules.get(courseStartDates.size()-1).getId());
+					if(!CollectionUtils.isEmpty(tempTeacherAttendances)){
+						TeacherAttendance teacherAttendance=tempTeacherAttendances.get(0);
+						if(Objects.nonNull(teacherAttendance.getSignInTime())
+								||Objects.nonNull(teacherAttendance.getSignOutTime())){
+							throw new BizException("选择的课程中存在已经签到的课程");
+						}
+					}
+				}
+				if(courseStartDates.size()==courseScheduleIds.size()){
+					break;
+				}
+			}
+			if(courseStartDates.size()==courseScheduleIds.size()){
+				break;
+			}
+			calendar.add(Calendar.DATE, 1);
+		}
+		checkNewCourseSchedules(courseSchedules,false);
+		courseScheduleDao.batchUpdate(courseSchedules);
+		classGroupService.updateClassGroupInfo(classGroup.getId());
+	}
+
+	@Override
 	public void courseAdjust(List<CourseSchedule> newCourseSchedules) {
 		Date now=new Date();
 		//课程信息处理
@@ -851,6 +964,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 				.collect(Collectors.groupingBy(CourseSchedule::getId));
 		List<Map<Long, Integer>> courseSettlementMaps = courseScheduleTeacherSalaryDao.checkCoursesIsSettlement(courseScheduleIds);
 		Map<Long, Long> courseSettlementMap = MapUtil.convertIntegerMap(courseSettlementMaps);
+
 		newCourseSchedules.forEach(newCourseSchedule->{
 			Long isSettlement = courseSettlementMap.get(newCourseSchedule.getId().longValue());
 			if(Objects.nonNull(isSettlement)&&isSettlement>0){
@@ -871,6 +985,11 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 				}
 				newCourseSchedule.setSchoolId(oldCourseSchedule.getSchoolId());
 			}
+			if(oldCourseSchedule.getType().equals(CourseSchedule.CourseScheduleType.VIP)){
+				VipGroup vipGroup=vipGroupDao.get(Long.valueOf(oldCourseSchedule.getMusicGroupId()));
+				Date endClassTime = DateUtil.addMinutes(newCourseSchedule.getStartClassTime(),vipGroup.getSingleClassMinutes());
+				newCourseSchedule.setEndClassTime(endClassTime);
+			}
 			if(Objects.isNull(newCourseSchedule.getTeachMode())){
 				newCourseSchedule.setTeachMode(oldCourseSchedule.getTeachMode());
 			}

+ 4 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java

@@ -69,8 +69,9 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                                                      BigDecimal offlineTeacherSalary) {
 
         School school = schoolService.get(vipGroup.getTeacherSchoolId());
-        if (Objects.isNull(school)) {
-            throw new BizException("未找到该教学点");
+        BigDecimal subsidy = new BigDecimal(0);
+        if (Objects.nonNull(school)) {
+            subsidy=school.getSubsidy();
         }
 
         //获取活动信息
@@ -95,7 +96,7 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
                 courseScheduleTeacherSalary.setTeacherRole(TeachTypeEnum.BISHOP);
                 courseScheduleTeacherSalary.setUserId(courseSchedules.get(i).getActualTeacherId().intValue());
                 courseScheduleTeacherSalary.setClassGroupId(courseSchedules.get(i).getClassGroupId());
-                courseScheduleTeacherSalary.setSubsidy(school.getSubsidy());
+                courseScheduleTeacherSalary.setSubsidy(subsidy);
 
                 if (vipGroupActivity.getType() == VipGroupActivityTypeEnum.GIVE_CLASS
                         && vipGroup.getGiveTeachMode() == teachModeEnum

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

@@ -842,13 +842,18 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
     @Override
     public MusicCardDto queryPersonalMusicGroups(Integer userId) {
+        SysUser sysUser = sysUserFeignService.queryUserById(userId);
+        if(sysUser == null){
+            throw new BizException("用户不存在");
+        }
         MusicCardDto musicCardDto = musicGroupDao.queryPersonalMusicGroups(userId);
-        if(musicCardDto != null){
-            musicCardDto.setMusicGroupNum(musicGroupDao.countUserMusicGroups(userId));
-            musicCardDto.setVipClassNum(classGroupStudentMapperDao.countUserGroups(userId, ClassGroupTypeEnum.VIP.getCode()));
-            return musicCardDto;
+        if (musicCardDto == null){
+            musicCardDto = new MusicCardDto();
+            musicCardDto.setUserName(sysUser.getUsername());
         }
-        return new MusicCardDto();
+        musicCardDto.setMusicGroupNum(musicGroupDao.countUserMusicGroups(userId));
+        musicCardDto.setVipClassNum(classGroupStudentMapperDao.countUserGroups(userId, ClassGroupTypeEnum.VIP.getCode()));
+        return musicCardDto;
     }
 
     @Override
@@ -1007,6 +1012,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         }
 
         musicGroup.setPaymentExpireDate(expireDate);
+        musicGroup.setApplyExpireDate(expireDate);
         musicGroup.setUpdateTime(date);
         musicGroupDao.update(musicGroup);
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId,"延长缴费",sysUser.getId(),""));

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PayServiceImpl.java

@@ -55,7 +55,7 @@ public class PayServiceImpl implements PayService {
         String company = "daya";
         if (userId != null) {
             MusicGroup musicGroup = musicGroupDao.findUserMusicGroup(userId);
-            if (musicGroup.getOwnershipType().equals(CooperationOrgan.OwnershipType.COOPERATION)) {
+            if (musicGroup != null && musicGroup.getOwnershipType().equals(CooperationOrgan.OwnershipType.COOPERATION)) {
                 company = "yadie";
             }
         }
@@ -64,7 +64,7 @@ public class PayServiceImpl implements PayService {
         Map unionPay = new HashMap();
         SysAccount routingAccount = getRoutingAccount(company, amount);
         PaymentChannelTypeEnum paymentChannelType = PaymentChannelTypeEnum.COM;
-        if(routingAccount.getType().equals("PER")){
+        if (routingAccount.getType().equals("PER")) {
             paymentChannelType = PaymentChannelTypeEnum.PER;
         }
         Map payMap = null;

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

@@ -1,20 +1,31 @@
 package com.ym.mec.biz.service.impl;
 
+import com.ym.mec.biz.dal.dao.OrganizationDao;
 import com.ym.mec.biz.dal.dao.SchoolDao;
 import com.ym.mec.biz.dal.entity.School;
+import com.ym.mec.biz.dal.page.SchoolQueryInfo;
 import com.ym.mec.biz.service.SchoolService;
 import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.util.collection.MapUtil;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Arrays;
 import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
 
 @Service
 public class SchoolServiceImpl extends BaseServiceImpl<Integer, School>  implements SchoolService {
 	
 	@Autowired
 	private SchoolDao schoolDao;
+	@Autowired
+	private OrganizationDao organizationDao;
 
 	@Override
 	public BaseDAO<Integer, School> getDAO() {
@@ -30,4 +41,16 @@ public class SchoolServiceImpl extends BaseServiceImpl<Integer, School>  impleme
 	public List<School> findVipSchoolByTeacher(Integer teacherId,String organId,Integer isDefault) {
 		return schoolDao.findVipSchoolByUserId(teacherId,organId,isDefault);
 	}
+
+	@Override
+	public PageInfo<School> queryPageDetail(SchoolQueryInfo queryInfo) {
+		PageInfo<School> schoolPageInfo = queryPage(queryInfo);
+		List<School> rows = schoolPageInfo.getRows();
+		Set<Integer> organIds = rows.stream().map(e -> e.getOrganId()).collect(Collectors.toSet());
+		Map<Integer,String> organNames = MapUtil.convertMybatisMap(organizationDao.findOrganNameMap(StringUtils.join(organIds,",")));
+		rows.forEach(e->{
+			e.setOrganName(organNames.get(e.getOrganId()));
+		});
+		return schoolPageInfo;
+	}
 }

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

@@ -138,6 +138,10 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 		courseSchedule.setLeaveStudentNum(leaveStudentNum);
 		courseScheduleDao.update(courseSchedule);
 
+		if(!courseSchedule.getType().equals(CourseSchedule.CourseScheduleType.VIP)){
+			return;
+		}
+
 		if(StringUtils.isBlank(studentAttendanceInfos.getSignInLongitudeLatitude())){
 			throw new BizException("未获取到您的位置");
 		}
@@ -163,7 +167,6 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 
 		TeacherAttendance teacherAttendance=teacherAttendanceDao.findByTeacherAttendanceInfo(sysUser.getId().longValue(),courseSchedule.getId());
 
-
 		Date date = new Date();
 		if(Objects.isNull(teacherAttendance)){
 			teacherAttendance= new TeacherAttendance();

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java

@@ -13,6 +13,7 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.http.HttpUtil;
+import org.apache.commons.collections.MapUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -31,6 +32,8 @@ public class StudentManageServiceImpl implements StudentManageService {
     @Autowired
     private StudentManageDao studentManageDao;
     @Autowired
+    private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
+    @Autowired
     private TeacherDao teacherDao;
     @Autowired
     private StudentRegistrationDao studentRegistrationDao;
@@ -187,6 +190,10 @@ public class StudentManageServiceImpl implements StudentManageService {
             pageInfo.setTotal(count);
             params.put("offset", pageInfo.getOffset());
             dataList = studentManageDao.queryMusicGroupStudent(params);
+            Map<Integer,String> maps = MapUtil.convertIntegerMap(musicGroupStudentFeeDao.findPaymentStatusMap(queryInfo.getMusicGroupId()));
+            dataList.forEach(e->{
+                e.setPaymentStatus(maps.get(e.getUserId()));
+            });
         }
         if (count == 0) {
             dataList = new ArrayList<>();

+ 19 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -507,6 +507,12 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 sysUser.setImToken(register.getToken());
                 teacherDao.updateUser(sysUser);
             } else {
+                sysUser.setPhone(studentRegistration.getParentsPhone());
+                sysUser.setRealName(studentRegistration.getParentsName());
+                sysUser.setUsername(studentRegistration.getName());
+                sysUser.setGender(studentRegistration.getGender());
+                sysUser.setOrganId(studentRegistration.getOrganId());
+                teacherDao.updateUser(sysUser);
                 userId = sysUser.getId();
             }
             studentRegistration.setActualSubjectId(studentRegistration.getSubjectId());
@@ -532,9 +538,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 studentAddDto.setCourseFee(musicOneSubjectClassPlan.getFee());
             }
             Date nextPaymentDate = musicGroupPaymentCalenderService.getNextPaymentDate(musicGroupId);
-            musicGroupStudentFeeDao.insert(new MusicGroupStudentFee(musicGroupId,
-                    userId, studentRegistration.getSubjectId(), studentAddDto.getCourseFee(),
-                    nextPaymentDate, studentAddDto.getTemporaryCourseFee()));
+
             //生成订单
             StudentPaymentOrder studentPaymentOrder = new StudentPaymentOrder();
             studentPaymentOrder.setUserId(userId);
@@ -548,22 +552,33 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             List<StudentPaymentOrderDetail> studentPaymentOrderDetails = studentAddDto.getStudentPaymentOrderDetails();
             if (studentPaymentOrderDetails == null) {
                 studentPaymentOrderDetails = new ArrayList<>();
+            }else {
+                studentPaymentOrderDetails.forEach(e->{
+                    if(e.getPrice() == null){
+                        throw new BizException("请补全订单信息");
+                    }
+                });
             }
             StudentPaymentOrderDetail studentPaymentOrderDetail = new StudentPaymentOrderDetail();
             studentPaymentOrderDetail.setPrice(studentAddDto.getTemporaryCourseFee());
             studentPaymentOrderDetail.setType(OrderDetailTypeEnum.COURSE);
             studentPaymentOrderDetails.add(studentPaymentOrderDetail);
             //汇总金额
+
             BigDecimal reduce = studentPaymentOrderDetails.stream().map(e -> e.getPrice()).reduce(BigDecimal.ZERO, BigDecimal::add);
+            MusicGroupStudentFee.PaymentStatus paymentStatus = MusicGroupStudentFee.PaymentStatus.NON_PAYMENT;
             if (reduce == BigDecimal.ZERO) {
+                paymentStatus = MusicGroupStudentFee.PaymentStatus.PAID_COMPLETED;
                 studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
                 studentRegistration.setPaymentStatus(PaymentStatusEnum.YES);
                 studentPaymentOrder.setActualAmount(reduce);
                 studentPaymentOrder.setPayTime(date);
             }
+            musicGroupStudentFeeDao.insert(new MusicGroupStudentFee(musicGroupId,
+                    userId, studentRegistration.getSubjectId(), studentAddDto.getCourseFee(),
+                    nextPaymentDate, studentAddDto.getTemporaryCourseFee(),paymentStatus));
             studentPaymentOrder.setExpectAmount(reduce);
             //当前学员是否以前存在过当前乐团
-//                StudentRegistration registration = studentRegistrationDao.queryByUserIdAndMusicGroupId(userId, musicGroupId);
             if(phoneAndMusicGroupId != null){
                 studentRegistration.setId(phoneAndMusicGroupId.getId());
                 studentRegistrationDao.update(studentRegistration);

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

@@ -17,4 +17,9 @@ public class SysPaymentConfigServiceImpl extends BaseServiceImpl<Integer, SysPay
     public BaseDAO<Integer, SysPaymentConfig> getDAO() {
         return sysPaymentConfigDao;
     }
+
+    @Override
+    public SysPaymentConfig findPaymentConfigByOrganId(Integer organId) {
+        return sysPaymentConfigDao.findPaymentConfigByOrganId(organId);
+    }
 }

+ 39 - 18
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -335,11 +335,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		memo.put("vipGroupId",vipGroupApplyBaseInfoDto.getId());
 
 		Set<Integer> userIds = musicGroupDao.queryUserIdByRoleId(roleIds,sysUser.getOrganId());
-		if (vipGroup.getVipGroupApplyBaseInfo().getUserId() != null){
-			sysMessageService.batchSeoMessage(userIds,MessageTypeEnum.BACKSTAGE_VIP_COURSE_APPLY, JSONObject.toJSONString(memo),sysUser.getUsername(),sysUser.getUsername());
-		}else {
-			sysMessageService.batchSeoMessage(userIds,MessageTypeEnum.BACKSTAGE_TEACHER_APPLY_VIP, JSONObject.toJSONString(memo),sysUser.getUsername());
-		}
+//		if (vipGroup.getVipGroupApplyBaseInfo().getUserId() != null){
+//			sysMessageService.batchSeoMessage(userIds,MessageTypeEnum.BACKSTAGE_VIP_COURSE_APPLY, JSONObject.toJSONString(memo),sysUser.getUsername(),sysUser.getUsername());
+//		}else {
+		sysMessageService.batchSeoMessage(userIds,MessageTypeEnum.BACKSTAGE_TEACHER_APPLY_VIP, JSONObject.toJSONString(memo),sysUser.getUsername());
+//		}
 	}
 
 	@Override
@@ -1003,8 +1003,17 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		studentPaymentOrderDao.insert(studentPaymentOrder);
 
 		BigDecimal amount=vipGroup.getTotalPrice();
-
-		if(vipGroupBuyParams.isUseBalancePayment() || amount.doubleValue() == 0){
+		if("36".equals(user.getOrganId())){
+			studentPaymentOrder.setPaymentChannel("BALANCE");
+			studentPaymentOrder.setActualAmount(new BigDecimal(0));
+			studentPaymentOrder.setBalancePaymentAmount(amount);
+			studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
+			studentPaymentOrder.setUpdateTime(date);
+			this.orderCallback(studentPaymentOrder);
+			Map<String,Object> result=new HashMap<>();
+			result.put("orderNo",studentPaymentOrder.getOrderNo());
+			return result;
+		}else if(vipGroupBuyParams.isUseBalancePayment() || amount.doubleValue() == 0){
 			SysUserCashAccount userCashAccount = sysUserCashAccountService.getLocked(user.getId());
 			if(userCashAccount == null){
 				throw new BizException("用户账户找不到");
@@ -1036,11 +1045,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				}
 			}
 		}
-
-		try {
-			contractService.register(user.getId(),user.getRealName(),user.getIdCardNo(),user.getPhone());
-		} catch (Exception e) {
-			e.printStackTrace();
+		if(!"36".equals(user.getOrganId())){
+			try {
+				contractService.register(user.getId(),user.getRealName(),user.getIdCardNo(),user.getPhone());
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
 		}
 
 		String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
@@ -1136,7 +1146,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		try {
 			contractService.transferVipGroupCoursesContract(userId,vipGroupId);
 		} catch (Exception e) {
-			e.printStackTrace();
+			LOGGER.error("小课[{}]开课失败:",vipGroupId,e.getMessage());
 		}
 	}
 
@@ -1573,6 +1583,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class)
 	public void updateVipGroupBaseInfo(VipGroupApplyBaseInfoDto vipGroupApplyBaseInfo) {
 		if(Objects.isNull(vipGroupApplyBaseInfo.getId())){
 			throw new BizException("请指定vip课");
@@ -1581,11 +1592,18 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		if(Objects.isNull(oldVipGroupInfo)){
 			throw new BizException("指定的vip课不存在");
 		}
+		if(Objects.isNull(vipGroupApplyBaseInfo.getId())){
+			return;
+		}
+		if(vipGroupApplyBaseInfo.getTeacherSchoolId().equals(oldVipGroupInfo.getTeacherSchoolId())){
+			return;
+		}
+		oldVipGroupInfo.setTeacherSchoolId(vipGroupApplyBaseInfo.getTeacherSchoolId());
 		Date now=new Date();
 		//更新vip课
-		vipGroupApplyBaseInfo.setUpdateTime(now);
-		vipGroupDao.update(vipGroupApplyBaseInfo);
-
+		oldVipGroupInfo.setUpdateTime(now);
+		vipGroupDao.update(oldVipGroupInfo);
+		courseScheduleDao.updateCourseScheduleSchool(GroupType.VIP.getCode(),oldVipGroupInfo.getId().toString(), oldVipGroupInfo.getTeacherSchoolId());
 	}
 
 	@Override
@@ -1684,6 +1702,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			courseScheduleStudentPaymentDao.batchInsert(courseScheduleStudentPayments);
 			imGroupMemberList.add(new ImGroupMember(classGroupStudent.getUserId().toString()));
 		}
+
+		classGroupService.updateClassGroupInfo(classGroup.getId());
+
 		ImGroupMember[] imGroupMembers = imGroupMemberList.toArray(new ImGroupMember[imGroupMemberList.size()]);
 		imFeignService.groupJoin(new ImGroupModel(classGroup.getId().toString(),
 				imGroupMembers, classGroup.getName()));
@@ -1788,8 +1809,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 		classGroupStudentMapperDao.classGroupStudentsInsert(classGroupStudentMappers);
 
-//		classGroup.setStudentNum(classGroupStudentMapperDao.countClassGroupStudentNum(classGroup.getId()));
-//		classGroupDao.update(classGroup);
+		classGroupService.updateClassGroupInfo(classGroup.getId());
 
 		try {
 			ImGroupMember[] imGroupMembers = imGroupMemberList.toArray(new ImGroupMember[imGroupMemberList.size()]);
@@ -1829,6 +1849,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				sysUserIncomeCashAccountDetail.setAttribute(studentPaymentOrder.getTransNo());
 				userCashAccountDetails.add(sysUserIncomeCashAccountDetail);
 			}
+			classGroupStudentMapperDao.updateVipGroupStudentStatus(noCreateSuccessVipGroup.getId().toString(),GroupType.VIP.getCode(),ClassGroupStudentStatusEnum.QUIT.getCode());
 		}
 		if(!CollectionUtils.isEmpty(userCashAccountDetails)){
 			sysUserCashAccountDetailDao.batchInsert(userCashAccountDetails);

+ 18 - 12
mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -136,9 +136,9 @@
     </update>
 
     <!-- 根据主键删除一条记录 -->
-    <delete id="delete">
-        UPDATE class_group SET del_flag_ = 1 WHERE id_ = #{id}
-    </delete>
+    <update id="delete">
+        UPDATE class_group SET del_flag_ = 1,update_time_=NOW() WHERE id_ = #{id}
+    </update>
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="ClassGroup" parameterType="map">
@@ -579,7 +579,7 @@
         LEFT JOIN class_group cg ON cg.id_ = cs.class_group_id_
         LEFT JOIN teacher_attendance ta ON ta.course_schedule_id_ = cs.id_
         <include refid="queryMusicGroupCourseScheduleSql"/>
-        ORDER BY cs.class_date_,cs.start_class_time_
+        ORDER BY cs.class_date_ ,cs.start_class_time_ ,cg.name_
         <include refid="global.limit"/>
     </select>
 
@@ -633,7 +633,7 @@
         FROM vip_group vg
         LEFT JOIN class_group cg ON cg.music_group_id_ = vg.id_
         LEFT JOIN sys_user su ON vg.user_id_ = su.id_
-        WHERE cg.group_type_ = 'VIP' AND FIND_IN_SET(vg.id_,#{musicGroupIds}) AND vg.status_!=3
+        WHERE cg.group_type_ = 'VIP' AND FIND_IN_SET(vg.id_,#{musicGroupIds})
     </select>
     <select id="queryStudentMusicGroupCourses" resultMap="CourseListDto">
         SELECT mg.id_ music_group_id_,mg.name_ music_group_name_,mgsf.payment_status_,
@@ -643,14 +643,14 @@
         LEFT JOIN class_group cg ON cg.music_group_id_ = mg.id_
         LEFT JOIN music_group_student_fee_ mgsf ON mgsf.music_group_id_ = mg.id_
         LEFT JOIN class_group_student_mapper cgsm ON cgsm.class_group_id_ = cg.id_
-        WHERE FIND_IN_SET(mg.id_,#{musicGroupIds}) AND cg.group_type_ = 'MUSIC' AND cg.del_flag_ = 0 AND mgsf.user_id_ =
+        WHERE FIND_IN_SET(mg.id_,#{musicGroupIds}) AND cg.group_type_ = 'MUSIC' AND mgsf.user_id_ =
         #{userId} AND cgsm.user_id_ = #{userId}
         GROUP BY mg.id_,mgsf.payment_status_
     </select>
 
     <!-- 增加实际学生人数 -->
     <update id="addStudentNum" parameterType="com.ym.mec.biz.dal.entity.ClassGroup">
-        UPDATE class_group SET student_num_ = student_num_+1,update_time_=#{classGroup.updateTime}
+        UPDATE class_group SET student_num_ = student_num_+1,update_time_ = NOW()
         WHERE id_ = #{classGroup.id} AND
         student_num_=#{classGroup.studentNum}
     </update>
@@ -663,7 +663,8 @@
     </update>
     <update id="batchUpdateClassGroupCourseTimes" parameterType="map">
         <foreach collection="classGroupCourseTimes.entrySet()" index="key" item="value" open="" close="" separator=";">
-            UPDATE class_group SET total_class_times_=#{value} WHERE id_=#{key}
+            UPDATE class_group SET total_class_times_=#{value},update_time_ = NOW()
+            WHERE id_=#{key}
         </foreach>
     </update>
 
@@ -780,7 +781,7 @@
 
     <!-- 根据主键批量删除班级-->
     <update id="batchSoftDelete">
-        UPDATE class_group SET del_flag_ = 1 WHERE id_ IN
+        UPDATE class_group SET del_flag_ = 1,update_time_=NOW() WHERE id_ IN
         <foreach collection="classGroupIds" item="classGroupId" open="(" close=")" separator=",">
             #{classGroupId}
         </foreach>
@@ -862,15 +863,20 @@
         FROM sys_user su
         WHERE su.id_ IS NOT NULL
     </select>
+    <select id="findByGroupAndType" resultMap="ClassGroup">
+        SELECT * FROM class_group WHERE music_group_id_=#{groupId} AND group_type_=#{groupType}
+    </select>
 
-	<update id="batchUpdateStudentNumMinusOne" parameterType="java.util.List">
-		update class_group set student_num_ = (student_num_ - 1),update_time_ = now() where id_ IN
+    <update id="batchUpdateStudentNumMinusOne" parameterType="java.util.List">
+		update class_group set student_num_ = (student_num_ - 1),update_time_ = now()
+		where id_ IN
       <foreach collection="classGroupIds" item="classGroupId" open="(" close=")" separator=",">
           #{classGroupId}
       </foreach>
 	</update>
     <update id="updateTest">
-      update class_group set del_flag_=#{delFlag,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} where id_=1
+      update class_group set del_flag_=#{delFlag,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},update_time_ = NOW()
+      where id_=1
     </update>
 
 </mapper>

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

@@ -155,11 +155,18 @@
     </select>
 
     <update id="deleteStudentByMusicGroupId" parameterType="map">
-        update class_group_student_mapper set status_ = 'QUIT' where class_group_id_ in (select id_ from class_group where music_group_id_ = #{musicGroupId}) and user_id_ = #{userId}
+        update class_group_student_mapper set status_ = 'QUIT',update_time_ = NOW()
+        where class_group_id_ in (select id_ from class_group where music_group_id_ = #{musicGroupId}) and user_id_ = #{userId}
     </update>
 
     <update id="deleteStudentByClassGroupId">
-        update class_group_student_mapper set status_ = 'QUIT' WHERE class_group_id_=#{classGroupId} AND user_id_=#{userId}
+        update class_group_student_mapper set status_ = 'QUIT',update_time_ = NOW()
+        WHERE class_group_id_=#{classGroupId} AND user_id_=#{userId}
+    </update>
+
+    <update id="updateVipGroupStudentStatus">
+        update class_group_student_mapper set status_ = #{status},update_time_ = NOW()
+        where music_group_id_=#{groupId} and group_type_=#{groupType}
     </update>
 
     <select id="findClassStudentMapperByUserIdAndClassGroupId" resultMap="ClassGroupStudentMapper">
@@ -253,7 +260,7 @@
             AND status_!='QUIT'
     </select>
     <select id="countUserGroups" resultType="int">
-      SELECT COUNT(1)
+      SELECT COUNT(DISTINCT cgsm.music_group_id_)
       FROM class_group_student_mapper cgsm
       LEFT JOIN class_group cg ON cgsm.class_group_id_=cg.id_
       WHERE cgsm.user_id_=#{userId} AND cgsm.group_type_=#{groupType} AND cgsm.status_!='QUIT' AND cg.del_flag_!=1

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

@@ -169,9 +169,6 @@
             <if test="teacherId != null">
                 teacher_id_ = #{teacherId},
             </if>
-            <if test="updateTime != null">
-                update_time_ = NOW(),
-            </if>
             <if test="studentNum != null">
                 student_num_ = #{studentNum},
             </if>
@@ -181,6 +178,7 @@
             <if test="schoolId != null">
                 schoole_id_ = #{schoolId},
             </if>
+            update_time_ = NOW()
         </set>
         WHERE id_ = #{id}
     </update>
@@ -195,11 +193,11 @@
     </delete>
     
     <update id="logicDeleteCourseSchedulesByMusicGroupID">
-    	update course_schedule set del_flag_ = '1' WHERE music_group_id_=#{musicGroupID} AND group_type_='MUSIC' and status_ = 'NOT_START'
+    	update course_schedule set del_flag_ = '1',update_time_ = NOW() WHERE music_group_id_=#{musicGroupID} AND group_type_='MUSIC' and status_ = 'NOT_START'
     </update>
     
     <update id="resumeCourseScheduleByMusicGroupId">
-    	update course_schedule set del_flag_ = '0' WHERE music_group_id_=#{musicGroupID} AND group_type_='MUSIC' and status_ = 'NOT_START' and del_flag_ = '1'
+    	update course_schedule set del_flag_ = '0',update_time_ = NOW() WHERE music_group_id_=#{musicGroupID} AND group_type_='MUSIC' and status_ = 'NOT_START' and del_flag_ = '1'
     </update>
 
     <delete id="batchDeleteCourseSchedules">
@@ -932,9 +930,6 @@
                 <if test="item.teacherId != null">
                     teacher_id_ = #{item.teacherId},
                 </if>
-                <if test="item.updateTime != null">
-                    update_time_ = #{item.updateTime},
-                </if>
                 <if test="item.studentNum != null">
                     student_num_ = #{item.studentNum},
                 </if>
@@ -944,23 +939,30 @@
                 <if test="item.schoolId != null">
                     schoole_id_ = #{item.schoolId},
                 </if>
+                update_time_ = NOW()
             </set>
             WHERE id_ = #{item.id}
         </foreach>
     </update>
     <update id="updateByMusicGroupId">
-        UPDATE course_schedule cs SET cs.schoole_id_ = #{schoolId}
+        UPDATE course_schedule cs SET cs.schoole_id_ = #{schoolId},update_time_ = NOW()
         WHERE cs.class_group_id_ IN (SELECT cg.id_ FROM class_group cg WHERE cg.music_group_id_ = #{musicGroupId} AND cg.group_type_ = 'MUSIC' )
     </update>
 
     <update id="updateCourscheduleStatus">
-        UPDATE course_schedule SET status_ = #{status}
+        UPDATE course_schedule SET status_ = #{status},update_time_ = NOW()
         WHERE id_=#{courseScheduleId}
     </update>
     <update id="updateCourseScheduleSchool">
-        UPDATE course_schedule cs SET cs.schoole_id_ = #{schoolId} WHERE cs.music_group_id_ = #{musicGroupId}
+        UPDATE course_schedule cs SET cs.schoole_id_ = #{schoolId},update_time_ = NOW()
+        WHERE cs.music_group_id_ = #{musicGroupId}
         AND cs.group_type_ = 'MUSIC' AND NOW() &lt; CONCAT(cs.class_date_," ",cs.start_class_time_);
     </update>
+    <update id="updateCourseSchoolByGroup">
+        UPDATE course_schedule cs SET cs.schoole_id_ = #{schoolId},,update_time_ = NOW()
+        WHERE cs.music_group_id_ = #{groupType}
+        AND cs.group_type_ = #{groupType} AND NOW() &lt; CONCAT(cs.class_date_," ",cs.start_class_time_);
+    </update>
 
     <select id="queryNoSignInListByBeforeMinutes" resultMap="CourseSchedule">
         SELECT cs.* FROM course_schedule cs left join teacher_attendance ta on ta.course_schedule_id_ = cs.id_ WHERE ta.sign_in_time_ is null and SUBTIME(start_class_time_, CONCAT(#{minutes},'00')) &lt; CURRENT_TIME()
@@ -1166,20 +1168,36 @@
         WHERE cs.id_=#{courseScheduleId}
     </select>
     <select id="queryMusicGroupIds" resultType="java.lang.String">
+        SELECT DISTINCT cgsm.music_group_id_ FROM class_group_student_mapper cgsm
+        LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
+        WHERE cgsm.user_id_ = #{userId} AND cgsm.status_ != 'QUIT' AND cg.del_flag_ = 0
+        ORDER BY cgsm.music_group_id_
+        <include refid="global.limit"/>
+    </select>
+    <select id="countMusicGroupIds" resultType="int">
+        SELECT COUNT(DISTINCT cgsm.music_group_id_) FROM class_group_student_mapper cgsm
+        LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
+        WHERE cgsm.user_id_ = #{userId} AND cgsm.status_ != 'QUIT' AND cg.del_flag_ = 0
+    </select>
+    <select id="queryMusicGroupIdsWithoutOverGroup" resultType="java.lang.String">
         SELECT DISTINCT spo.music_group_id_ FROM student_payment_order spo
         LEFT JOIN class_group_student_mapper cgsm ON spo.music_group_id_ = cgsm.music_group_id_
+        LEFT JOIN vip_group vg ON vg.id_=spo.music_group_id_ AND spo.group_type_='VIP'
+        LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
         WHERE spo.type_ != 'OTHER' AND spo.music_group_id_ IS NOT NULL
         AND spo.user_id_ = #{userId} AND spo.status_='SUCCESS' AND cgsm.status_ != 'QUIT'
+        AND IF(spo.group_type_ = 'VIP', (vg.status_ = 4 OR vg.status_ = 3),0)=0 AND cg.del_flag_ = 0
         <include refid="global.limit"/>
     </select>
-    <select id="queryMusicGroupIdsWithoutOverGroup" resultType="java.lang.String">
-        SELECT DISTINCT spo.music_group_id_ FROM student_payment_order spo
+
+    <select id="countMusicGroupIdsWithoutOverGroup" resultType="int">
+        SELECT COUNT(DISTINCT spo.music_group_id_) FROM student_payment_order spo
         LEFT JOIN class_group_student_mapper cgsm ON spo.music_group_id_ = cgsm.music_group_id_
         LEFT JOIN vip_group vg ON vg.id_=spo.music_group_id_ AND spo.group_type_='VIP'
+        LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
         WHERE spo.type_ != 'OTHER' AND spo.music_group_id_ IS NOT NULL
         AND spo.user_id_ = #{userId} AND spo.status_='SUCCESS' AND cgsm.status_ != 'QUIT'
-        AND IF(spo.group_type_ = 'VIP', (vg.status_ = 4 OR vg.status_ = 3),0)=0
-        <include refid="global.limit"/>
+        AND IF(spo.group_type_ = 'VIP', (vg.status_ = 4 OR vg.status_ = 3),0)=0 AND cg.del_flag_ = 0
     </select>
     <select id="countExistRepeatInDateZone" resultType="int">
         SELECT
@@ -1502,8 +1520,9 @@
         SELECT cssp.user_id_,cs.actual_teacher_id_ teacher_id_,
         cs.id_ course_schedule_id_,cs.class_group_id_,cs.music_group_id_,cs.group_type_,cg.current_class_times_
         FROM course_schedule_student_payment cssp
-        LEFT JOIN course_schedule cs ON cssp.course_schedule_id_ = cs.id_ LEFT JOIN class_group cg ON cg.id_=cs.class_group_id_
-        LEFT JOIN student_attendance sa ON sa.course_schedule_id_= cssp.course_schedule_id_ AND cssp.user_id_=sa.user_id_
+        LEFT JOIN course_schedule cs ON cssp.course_schedule_id_ = cs.id_
+        LEFT JOIN class_group cg ON cg.id_=cs.class_group_id_
+        LEFT JOIN student_attendance sa ON sa.course_schedule_id_ = cssp.course_schedule_id_ AND cssp.user_id_ = sa.user_id_
         WHERE CONCAT(cs.class_date_,' ',cs.end_class_time_) &lt;= now() AND sa.id_ IS NULL
     </select>
     <select id="getNextCourseSchedule" resultMap="CourseSchedule">
@@ -1541,4 +1560,8 @@
     <select id="countCourseScheduleByMusicGroupId" resultType="java.lang.Integer">
         SELECT count(cs.id_) FROM course_schedule cs WHERE cs.music_group_id_ = #{musicGroupId} LIMIT 1
     </select>
+    <select id="findClassGroupCourseSchedules" resultMap="CourseSchedule">
+        SELECT * FROM course_schedule
+        WHERE class_group_id_=#{classGroupId} AND (del_flag_ = 0 OR del_flag_ IS NULL)
+    </select>
 </mapper>

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

@@ -324,7 +324,7 @@
 	</update>
     <update id="batchUpdateTeacherExpectSalary">
 		UPDATE course_schedule_teacher_salary
-		SET expect_salary_ = 0
+		SET expect_salary_ = 0,update_time_ = NOW()
 		WHERE
 			course_schedule_id_ = #{courseScheduleId}
 			AND user_id_ IN

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

@@ -173,6 +173,9 @@
         LEFT JOIN music_group_subject_plan mgsp ON mgsp.music_group_id_ = sr.music_group_id_ AND mgsp.subject_id_ = sr.actual_subject_id_
         WHERE sr.music_group_status_ != 'QUIT' AND sr.payment_status_ = 2 AND mgsf.id_ IS NULL AND sr.music_group_id_ = #{musicGroupId}
     </select>
+    <select id="findPaymentStatusMap" resultType="java.util.Map">
+        SELECT user_id_ 'key',payment_status_ 'value' FROM music_group_student_fee_ WHERE music_group_id_ = #{musicGroupId}
+    </select>
 
     <update id="batchUpdate" parameterType="java.util.List">
     	<foreach collection="list" item="item" index="index" open="" close="" separator=";">

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

@@ -99,6 +99,9 @@
         <if test="organId != null">
             AND FIND_IN_SET(organ_id_,#{organId})
         </if>
+        <if test="search != null">
+            AND (name_ LIKE CONCAT('%',#{search},'%') OR id_ LIKE CONCAT('%',#{search},'%'))
+        </if>
         ORDER BY id_
         <include refid="global.limit"/>
     </select>
@@ -112,6 +115,9 @@
         <if test="organId != null">
             AND FIND_IN_SET(organ_id_,#{organId})
         </if>
+        <if test="search != null">
+            AND (name_ LIKE CONCAT('%',#{search},'%') OR id_ LIKE CONCAT('%',#{search},'%'))
+        </if>
 	</select>
     <select id="queryByOrganId" resultMap="School">
         SELECT * FROM school

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

@@ -357,6 +357,9 @@
             <if test="search != null and search != ''">
                 AND (su.real_name_ like CONCAT("%",#{search},"%") OR sr.parents_phone_ like CONCAT("%",#{search},"%"))
             </if>
+            <if test="studentName != null">
+                AND su.username_ like CONCAT("%",#{studentName},"%")
+            </if>
             <if test="subjectId != null">
                 AND sr.actual_subject_id_ = #{subjectId}
             </if>
@@ -383,16 +386,19 @@
         <result property="paymentStatus" column="payment_status_"/>
         <result property="musicGroupId" column="music_group_id_"/>
         <result property="isNewStudent" column="is_new_student_"/>
+        <result property="courseFee" column="course_fee_"/>
+        <result property="nextPaymentDate" column="next_payment_date_"/>
     </resultMap>
     <select id="queryMusicGroupStudent" resultMap="MusicGroupStudentsDto">
         SELECT sr.user_id_,su.username_ real_name_,su.gender_,sr.parents_phone_,sr.current_grade_,
-        sr.current_class_,sr.music_group_status_,sr.payment_status_,
+        sr.current_class_,sr.music_group_status_,mgsf.next_payment_date_,mgsf.course_fee_,
         s.name_ subject_name_,sr.music_group_id_,
         IF(DATE_FORMAT(sr.create_time_,'%Y-%m-%d') > DATE_FORMAT(mg.payment_expire_date_,'%Y-%m-%d'),1,0) is_new_student_
         FROM student_registration sr
         LEFT JOIN sys_user su ON sr.user_id_ = su.id_
         LEFT JOIN `subject` s ON s.id_ = sr.actual_subject_id_
         LEFT JOIN music_group mg ON sr.music_group_id_ = mg.id_
+        LEFT JOIN music_group_student_fee_ mgsf ON mgsf.music_group_id_ = mg.id_ AND mgsf.user_id_ = su.id_
         <include refid="queryMusicGroupStudentSql"/>
         ORDER BY sr.create_time_ DESC
         <include refid="global.limit"/>

+ 16 - 1
mec-biz/src/main/resources/config/mybatis/SysPaymentConfigMapper.xml

@@ -5,6 +5,7 @@
         <!--@Table sys_payment_config-->
         <id column="id_" jdbcType="INTEGER" property="id"/>
         <result column="organ_id_" jdbcType="INTEGER" property="organId"/>
+        <result column="type_" jdbcType="INTEGER" property="type"/>
         <result column="organ_name" jdbcType="VARCHAR" property="organName"/>
         <result column="per_scale_" jdbcType="INTEGER" property="perScale"/>
         <result column="com_scale_" jdbcType="INTEGER" property="comScale"/>
@@ -17,7 +18,7 @@
     </resultMap>
     <sql id="Base_Column_List">
         <!--@mbg.generated-->
-        id_, organ_id_, per_scale_, com_scale_, course_fee_, instrument_fee_, accessories_fee_,
+        id_, organ_id_,type_, per_scale_, com_scale_, course_fee_, instrument_fee_, accessories_fee_,
         other_fee_, create_time_, update_time_
     </sql>
     <select id="get" parameterType="java.lang.Integer" resultMap="SysPaymentConfig">
@@ -36,6 +37,9 @@
         <!--@mbg.generated-->
         insert into sys_payment_config
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="type != null">
+                type_,
+            </if>
             <if test="organId != null">
                 organ_id_,
             </if>
@@ -65,6 +69,9 @@
             </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="type != null">
+                #{type,jdbcType=INTEGER},
+            </if>
             <if test="organId != null">
                 #{organId,jdbcType=INTEGER},
             </if>
@@ -98,6 +105,9 @@
         <!--@mbg.generated-->
         update sys_payment_config
         <set>
+            <if test="type != null">
+                type_ = #{type,jdbcType=INTEGER},
+            </if>
             <if test="organId != null">
                 organ_id_ = #{organId,jdbcType=INTEGER},
             </if>
@@ -147,4 +157,9 @@
         SELECT COUNT(*) FROM sys_payment_config
         <include refid="global.limit"/>
     </select>
+
+    <!-- 按分部编号查配置 -->
+    <select id="findPaymentConfigByOrganId" resultMap="SysPaymentConfig">
+        SELECT * FROM sys_payment_config WHERE organ_id_ = #{organId}
+    </select>
 </mapper>

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

@@ -159,6 +159,9 @@
             <if test="teacherId!=null">
                 AND vg.user_id_=#{teacherId}
             </if>
+            <if test="status != null">
+                AND vg.status_ = #{status}
+            </if>
             <if test="activityId!=null">
                 AND vg.vip_group_activity_id_=#{activityId}
             </if>
@@ -545,6 +548,7 @@
     <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="end_class_time_" property="endClassTime"/>
         <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="give_teach_mode_" property="giveTeachMode" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
@@ -573,6 +577,7 @@
         SELECT
             cs.id_,
             CONCAT(cs.class_date_,' ',cs.start_class_time_) start_class_time_,
+            CONCAT(cs.class_date_,' ',cs.end_class_time_) end_class_time_,
             cs.status_,
             cs.teach_mode_,
             cs.student_num_,s.name_ school_name_,

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

@@ -161,6 +161,7 @@ public class MusicGroupController extends BaseController {
         ModelMap model = new ModelMap();
         model.put("musicGroup", musicGroup);
         model.put("amount", amount);
+        model.put("nextPaymentDate", musicGroupStudentFee.getNextPaymentDate());
         model.put("musicGroupSubjectPlan", musicGroupSubjectPlan);
 
         return succeed(model);

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

@@ -49,7 +49,7 @@ public class MusicGroupRegisterController extends BaseController {
         if (hasReg != null) {
             return failed("该乐团您已报名");
         }
-        if (DateUtil.daysBetween(musicGroup.getApplyExpireDate(),date) > 0) {
+        if (DateUtil.daysBetween(musicGroup.getApplyExpireDate(),date) > 1) {
             return failed("乐团已截止报名");
         }
 

+ 0 - 3
mec-teacher/src/main/java/com/ym/mec/teacher/controller/SmsCodeController.java

@@ -4,7 +4,6 @@ import com.google.code.kaptcha.Constants;
 import com.google.code.kaptcha.Producer;
 import com.google.code.kaptcha.servlet.KaptchaServlet;
 import com.ym.mec.biz.service.SmsCodeService;
-import com.ym.mec.biz.service.TeacherService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.security.SecurityConstants;
 import io.swagger.annotations.Api;
@@ -33,8 +32,6 @@ public class SmsCodeController extends BaseController {
     @Autowired
     private SmsCodeService smsCodeService;
     @Autowired
-    private TeacherService teacherService;
-    @Autowired
     private Producer captchaProducer;
     @Autowired
     private RedisTemplate<String,String> redisTemplate;

+ 9 - 0
mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleController.java

@@ -4,6 +4,7 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.ClassGroupTeacherMapperDao;
 import com.ym.mec.biz.dal.dto.CreateCourseScheduleDto;
+import com.ym.mec.biz.dal.dto.VipGroupCourseAdjustInfoDto;
 import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
@@ -258,4 +259,12 @@ public class CourseScheduleController extends BaseController {
     	return succeed(model);
     }
 
+    @ApiOperation(value = "vip课批量调整")
+    @PostMapping("/vipCourseAdjust")
+    @PreAuthorize("@pcs.hasPermissions('courseSchedule/vipCourseAdjust')")
+    public Object vipCourseAdjust(@RequestBody VipGroupCourseAdjustInfoDto vipGroupCourseAdjustInfo){
+        scheduleService.vipCourseAdjust(vipGroupCourseAdjustInfo);
+        return succeed();
+    }
+
 }

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

@@ -85,7 +85,7 @@ public class SchoolController extends BaseController {
 				}
 			}
 		}
-        return succeed(schoolService.queryPage(queryInfo));
+        return succeed(schoolService.queryPageDetail(queryInfo));
     }
 
     @ApiOperation(value = "根据机构编号获取学校列表")

+ 20 - 9
mec-web/src/main/java/com/ym/mec/web/controller/SysPaymentConfigController.java

@@ -3,6 +3,7 @@ package com.ym.mec.web.controller;
 import com.ym.mec.biz.dal.entity.SysPaymentConfig;
 import com.ym.mec.biz.service.SysPaymentConfigService;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.*;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -22,18 +23,28 @@ public class SysPaymentConfigController extends BaseController {
     @ApiOperation(value = "新增支付配置")
     @PostMapping("/add")
     @PreAuthorize("@pcs.hasPermissions('paymentConfig/add')")
-    public Object add(SysPaymentConfig sysPaymentConfig){
+    public HttpResponseResult add(SysPaymentConfig sysPaymentConfig) {
+        if (sysPaymentConfig.getOrganId() == null) {
+            return failed("请选择分部");
+        }
+        SysPaymentConfig paymentConfig = sysPaymentConfigService.findPaymentConfigByOrganId(sysPaymentConfig.getOrganId());
+        if (paymentConfig != null) {
+            return failed("此分部配置已经存在");
+        }
+        Date nowDate = new Date();
+        sysPaymentConfig.setCreateTime(nowDate);
+        sysPaymentConfig.setCreateTime(nowDate);
         return succeed(sysPaymentConfigService.insert(sysPaymentConfig));
     }
 
     @ApiOperation(value = "删除支付配置")
     @PostMapping("/del/{id}")
     @PreAuthorize("@pcs.hasPermissions('paymentConfig/del')")
-    public Object del(@ApiParam(value = "支付配置编号", required = true) @PathVariable("id") Integer id){
-    	SysPaymentConfig sysPaymentConfig = sysPaymentConfigService.get(id);
-    	if(sysPaymentConfig == null){
-    		return failed("参数错误");
-    	}
+    public Object del(@ApiParam(value = "支付配置编号", required = true) @PathVariable("id") Integer id) {
+        SysPaymentConfig sysPaymentConfig = sysPaymentConfigService.get(id);
+        if (sysPaymentConfig == null) {
+            return failed("参数错误");
+        }
         sysPaymentConfigService.delete(id);
         return succeed();
     }
@@ -41,7 +52,7 @@ public class SysPaymentConfigController extends BaseController {
     @ApiOperation(value = "修改支付配置")
     @PostMapping("/update")
     @PreAuthorize("@pcs.hasPermissions('paymentConfig/update')")
-    public Object update(SysPaymentConfig sysPaymentConfig){
+    public Object update(SysPaymentConfig sysPaymentConfig) {
         sysPaymentConfig.setUpdateTime(new Date());
         sysPaymentConfigService.update(sysPaymentConfig);
         return succeed();
@@ -50,14 +61,14 @@ public class SysPaymentConfigController extends BaseController {
     @ApiOperation(value = "根据支付配置编号查询支付配置")
     @GetMapping("/get/{id}")
     @PreAuthorize("@pcs.hasPermissions('paymentConfig/get')")
-    public Object get(@ApiParam(value = "支付配置编号", required = true) @PathVariable("id") Integer id){
+    public Object get(@ApiParam(value = "支付配置编号", required = true) @PathVariable("id") Integer id) {
         return succeed(sysPaymentConfigService.get(id));
     }
 
     @ApiOperation(value = "分页查询支付配置列表")
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('paymentConfig/queryPage')")
-    public Object queryPage(QueryInfo queryInfo){
+    public Object queryPage(QueryInfo queryInfo) {
         return succeed(sysPaymentConfigService.queryPage(queryInfo));
     }
 }

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

@@ -63,7 +63,7 @@ public class VipGroupManageController extends BaseController {
         if(Objects.isNull(sysUser)){
             return failed("请指定指导老师!");
         }
-        vipGroupApplyDto.getVipGroupApplyBaseInfo().setOrganIdList(sysUser.getOrganId().toString());
+        vipGroupApplyDto.getVipGroupApplyBaseInfo().setOrganIdList(sysUser.getOrganId());
         sysUser = sysUserFeignService.queryUserInfo();
         if (sysUser == null) {
             return failed("用户信息获取失败");