Explorar el Código

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

# Conflicts:
#	mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleEvaluateDao.java
#	mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleEvaluate.java
#	mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleService.java
#	mec-biz/src/main/resources/config/mybatis/CourseScheduleEvaluateMapper.xml
#	mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml
zouxuan hace 5 años
padre
commit
172fcce450
Se han modificado 41 ficheros con 1079 adiciones y 108 borrados
  1. 18 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleEvaluateDao.java
  2. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleStudentPaymentDao.java
  3. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CoursesGroupDao.java
  4. 31 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseGroupCreateDto.java
  5. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseScheduleEndDto.java
  6. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseSchedule.java
  7. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleEvaluate.java
  8. 225 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CoursesGroup.java
  9. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentPaymentOrder.java
  10. 33 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Teacher.java
  11. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/ClassGroupTypeEnum.java
  12. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/GroupStatusEnum.java
  13. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/GroupType.java
  14. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentPaymentOrderQueryInfo.java
  15. 18 0
      mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleEvaluateService.java
  16. 18 0
      mec-biz/src/main/java/com/ym/mec/biz/service/CoursesGroupService.java
  17. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/service/PracticeGroupService.java
  18. 13 0
      mec-biz/src/main/java/com/ym/mec/biz/service/TeacherService.java
  19. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java
  20. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleEvaluateServiceImpl.java
  21. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  22. 174 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CoursesGroupServiceImpl.java
  23. 42 35
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/EduPracticeGroupServiceImpl.java
  24. 16 16
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  25. 22 14
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java
  26. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  27. 36 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherServiceImpl.java
  28. 4 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  29. 21 5
      mec-biz/src/main/resources/config/mybatis/CourseScheduleEvaluateMapper.xml
  30. 10 1
      mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml
  31. 128 0
      mec-biz/src/main/resources/config/mybatis/CoursesGroupMapper.xml
  32. 1 1
      mec-biz/src/main/resources/config/mybatis/StudentMapper.xml
  33. 8 2
      mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml
  34. 14 7
      mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml
  35. 13 0
      mec-student/src/main/java/com/ym/mec/student/controller/StudyReportController.java
  36. 43 0
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/CourseGroupController.java
  37. 40 8
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherController.java
  38. 5 3
      mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java
  39. 17 0
      mec-web/src/main/java/com/ym/mec/web/controller/PracticeGroupManageController.java
  40. 26 0
      mec-web/src/main/java/com/ym/mec/web/controller/StudentPaymentOrderController.java
  41. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/education/EduPracticeGroupController.java

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

@@ -25,13 +25,28 @@ public interface CourseScheduleEvaluateDao extends BaseDAO<Long, CourseScheduleE
     List<PracticeGroupsDto> getOrganMoney();
 
     /**
+     * @param expiredDate:
+     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseScheduleEvaluate>
      * @describe 推送指定时间及之前的未推送的报告
      * @author Joburgess
      * @date 2020/2/28
-     * @param expiredDate:
-     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseScheduleEvaluate>
      */
-    List<CourseScheduleEvaluate> findExpiredDateBeforeReport(@Param("expiredDate")Date expiredDate);
+    List<CourseScheduleEvaluate> findExpiredDateBeforeReport(@Param("expiredDate") Date expiredDate);
+
+    /**
+     * 根据课程组id获取报告列表
+     *
+     * @param groupId
+     * @return
+     */
+    List<CourseScheduleEvaluate> findByGroupId(@Param("groupId") Integer groupId);
+
+    /**
+     * 根据id获取报告
+     *
+     * @return
+     */
+    CourseScheduleEvaluate findById(@Param("id") Integer id);
 
     /**
      * 获取当前课程教师的评价列表

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

@@ -229,4 +229,11 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
      * @return
      */
     List<BasicUserDto> findStudents(Long courseScheduleId);
+
+    /**
+     * 获取课程的学员编号列表
+     * @param courseScheduleIds
+     * @return
+     */
+    List<Map<Integer,String>> getStudentIdMap(@Param("courseScheduleIds") List<Long> courseScheduleIds);
 }

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

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

+ 31 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseGroupCreateDto.java

@@ -0,0 +1,31 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.entity.CourseGenerateDto;
+import com.ym.mec.biz.dal.entity.CoursesGroup;
+
+/**
+ * @Author Joburgess
+ * @Date 2020/3/8
+ */
+public class CourseGroupCreateDto {
+
+    private CoursesGroup coursesGroup;
+
+    private CourseGenerateDto courseCycleInfo;
+
+    public CoursesGroup getCoursesGroup() {
+        return coursesGroup;
+    }
+
+    public void setCoursesGroup(CoursesGroup coursesGroup) {
+        this.coursesGroup = coursesGroup;
+    }
+
+    public CourseGenerateDto getCourseCycleInfo() {
+        return courseCycleInfo;
+    }
+
+    public void setCourseCycleInfo(CourseGenerateDto courseCycleInfo) {
+        this.courseCycleInfo = courseCycleInfo;
+    }
+}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseScheduleEndDto.java

@@ -31,6 +31,16 @@ public class CourseScheduleEndDto extends CourseSchedule {
 
     private Date signOutTime;
 
+    private String studentId;
+
+    public String getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(String studentId) {
+        this.studentId = studentId;
+    }
+
     public String getSubjectName() {
         return subjectName;
     }

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

@@ -34,7 +34,7 @@ public class CourseSchedule {
 
 		SINGLE("SINGLE", "单技课"), MIX("MIX", "合奏课"), HIGH("HIGH", "小班课"), VIP("VIP", "vip课"), DEMO("DEMO", "试听课"), COMPREHENSIVE("COMPREHENSIVE", "综合课"), PRACTICE(
 				"PRACTICE", "网管课"), ENLIGHTENMENT("ENLIGHTENMENT", "启蒙课"), TRAINING_SINGLE("TRAINING_SINGLE", "集训单技课"), TRAINING_MIX("TRAINING_MIX", "集训合奏课"), CLASSROOM(
-				"CLASSROOM", "课堂课");
+				"CLASSROOM", "课堂课"),COMM("COMM","对外课程");
 
 		private String code;
 

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

@@ -45,6 +45,11 @@ public class CourseScheduleEvaluate {
 
     private Integer isPushed;
 
+    private String month;
+
+    @ApiModelProperty(value = "报告版本")
+    private Integer version;
+
     private String studentIdList;
 
     public String getStudentIdList() {
@@ -55,6 +60,8 @@ public class CourseScheduleEvaluate {
         this.studentIdList = studentIdList;
     }
 
+
+
     public Integer getIsPushed() {
         return isPushed;
     }
@@ -174,4 +181,20 @@ public class CourseScheduleEvaluate {
     public void setTotalMinutes(Integer totalMinutes) {
         this.totalMinutes = totalMinutes;
     }
+
+    public String getMonth() {
+        return month;
+    }
+
+    public void setMonth(String month) {
+        this.month = month;
+    }
+
+    public Integer getVersion() {
+        return version;
+    }
+
+    public void setVersion(Integer version) {
+        this.version = version;
+    }
 }

+ 225 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CoursesGroup.java

@@ -0,0 +1,225 @@
+package com.ym.mec.biz.dal.entity;
+
+import com.ym.mec.biz.dal.enums.GroupStatusEnum;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(courses_group):
+ */
+public class CoursesGroup {
+
+	/**  */
+	private Long id;
+	
+	/** 课程组名称 */
+	private String name;
+	
+	/** 科目 */
+	private Integer subjectId;
+	
+	/** 课程开始时间 */
+	private java.util.Date coursesStartDate;
+	
+	/** 课程结束时间 */
+	private java.util.Date coursesEndDate;
+	
+	/** 课时安排 */
+	private String teachingArrangement;
+	
+	/** 机构 */
+	private Integer organId;
+	
+	/** 单次课时 */
+	private Integer singleClassMinutes;
+	
+	/** 课程组状态 */
+	private GroupStatusEnum status;
+	
+	/** 备注 */
+	private String memo;
+	
+	/** 授课老师 */
+	private Integer teacherId;
+	
+	/** 最大报名人数 */
+	private Integer maxStudentNum;
+	
+	/** 报名结束时间 */
+	private java.util.Date applyClosingDate;
+	
+	/** 教学规划 */
+	private String teachingPlan;
+	
+	/** 老师课酬结算方式 */
+	private String teacherSalarySettlementMethod;
+	
+	/** 课程总价 */
+	private long totalCoursesPrice;
+	
+	/** 课程折扣价 */
+	private long totalCourseDiscountPrice;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setName(String name){
+		this.name = name;
+	}
+	
+	public String getName(){
+		return this.name;
+	}
+			
+	public void setSubjectId(Integer subjectId){
+		this.subjectId = subjectId;
+	}
+	
+	public Integer getSubjectId(){
+		return this.subjectId;
+	}
+			
+	public void setCoursesStartDate(java.util.Date coursesStartDate){
+		this.coursesStartDate = coursesStartDate;
+	}
+	
+	public java.util.Date getCoursesStartDate(){
+		return this.coursesStartDate;
+	}
+			
+	public void setCoursesEndDate(java.util.Date coursesEndDate){
+		this.coursesEndDate = coursesEndDate;
+	}
+	
+	public java.util.Date getCoursesEndDate(){
+		return this.coursesEndDate;
+	}
+			
+	public void setTeachingArrangement(String teachingArrangement){
+		this.teachingArrangement = teachingArrangement;
+	}
+	
+	public String getTeachingArrangement(){
+		return this.teachingArrangement;
+	}
+			
+	public void setOrganId(Integer organId){
+		this.organId = organId;
+	}
+	
+	public Integer getOrganId(){
+		return this.organId;
+	}
+			
+	public void setSingleClassMinutes(Integer singleClassMinutes){
+		this.singleClassMinutes = singleClassMinutes;
+	}
+	
+	public Integer getSingleClassMinutes(){
+		return this.singleClassMinutes;
+	}
+
+	public GroupStatusEnum getStatus() {
+		return status;
+	}
+
+	public void setStatus(GroupStatusEnum status) {
+		this.status = status;
+	}
+
+	public void setMemo(String memo){
+		this.memo = memo;
+	}
+	
+	public String getMemo(){
+		return this.memo;
+	}
+			
+	public void setTeacherId(Integer teacherId){
+		this.teacherId = teacherId;
+	}
+	
+	public Integer getTeacherId(){
+		return this.teacherId;
+	}
+			
+	public void setMaxStudentNum(Integer maxStudentNum){
+		this.maxStudentNum = maxStudentNum;
+	}
+	
+	public Integer getMaxStudentNum(){
+		return this.maxStudentNum;
+	}
+			
+	public void setApplyClosingDate(java.util.Date applyClosingDate){
+		this.applyClosingDate = applyClosingDate;
+	}
+	
+	public java.util.Date getApplyClosingDate(){
+		return this.applyClosingDate;
+	}
+			
+	public void setTeachingPlan(String teachingPlan){
+		this.teachingPlan = teachingPlan;
+	}
+	
+	public String getTeachingPlan(){
+		return this.teachingPlan;
+	}
+			
+	public void setTeacherSalarySettlementMethod(String teacherSalarySettlementMethod){
+		this.teacherSalarySettlementMethod = teacherSalarySettlementMethod;
+	}
+	
+	public String getTeacherSalarySettlementMethod(){
+		return this.teacherSalarySettlementMethod;
+	}
+			
+	public void setTotalCoursesPrice(long totalCoursesPrice){
+		this.totalCoursesPrice = totalCoursesPrice;
+	}
+	
+	public long getTotalCoursesPrice(){
+		return this.totalCoursesPrice;
+	}
+			
+	public void setTotalCourseDiscountPrice(long totalCourseDiscountPrice){
+		this.totalCourseDiscountPrice = totalCourseDiscountPrice;
+	}
+	
+	public long getTotalCourseDiscountPrice(){
+		return this.totalCourseDiscountPrice;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

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

@@ -34,6 +34,9 @@ public class StudentPaymentOrder {
 	@ApiModelProperty(value = "分部编号",required = true)
 	private Integer organId;
 
+	@ApiModelProperty(value = "分配分部编号",required = true)
+	private Integer routingOrganId;
+
 	/** 订单类型(报名、续费、小课购买、其他) */
 	@ApiModelProperty(value = "订单类型",required = true)
 	private OrderTypeEnum type;
@@ -327,6 +330,14 @@ public class StudentPaymentOrder {
 		this.remitFee = remitFee;
 	}
 
+	public Integer getRoutingOrganId() {
+		return routingOrganId;
+	}
+
+	public void setRoutingOrganId(Integer routingOrganId) {
+		this.routingOrganId = routingOrganId;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 33 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Teacher.java

@@ -100,6 +100,15 @@ public class Teacher extends SysUser {
 	
 	@ApiModelProperty(value = "是否支持额外的网管课", required = false)
 	private Boolean isSupportExtraPracticeLesson;
+	
+	@ApiModelProperty(value = "身份证正面照", required = false)
+	private String idcardFrontImg;
+	
+	@ApiModelProperty(value = "身份证反面照", required = false)
+	private String idcardBackImg;
+	
+	@ApiModelProperty(value = "手持身份证照", required = false)
+	private String idcardHandImg;
 
 	private List<School> teacherSchools;
 
@@ -305,6 +314,30 @@ public class Teacher extends SysUser {
 		this.isSupportExtraPracticeLesson = isSupportExtraPracticeLesson;
 	}
 
+	public String getIdcardFrontImg() {
+		return idcardFrontImg;
+	}
+
+	public void setIdcardFrontImg(String idcardFrontImg) {
+		this.idcardFrontImg = idcardFrontImg;
+	}
+
+	public String getIdcardBackImg() {
+		return idcardBackImg;
+	}
+
+	public void setIdcardBackImg(String idcardBackImg) {
+		this.idcardBackImg = idcardBackImg;
+	}
+
+	public String getIdcardHandImg() {
+		return idcardHandImg;
+	}
+
+	public void setIdcardHandImg(String idcardHandImg) {
+		this.idcardHandImg = idcardHandImg;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

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

@@ -12,7 +12,8 @@ public enum ClassGroupTypeEnum implements BaseEnum<String, ClassGroupTypeEnum> {
 	VIP("VIP", "vip课"),
 	DEMO("DEMO", "试听课"),
 	PRACTICE("PRACTICE", "网管课"),
-	SNAP("SNAP", "临时班级");
+	SNAP("SNAP", "临时班级"),
+	COMM("COMM","对外课程");
 
 	private String code;
 

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/GroupStatusEnum.java

@@ -8,6 +8,8 @@ import com.ym.mec.common.enums.BaseEnum;
  **/
 public enum GroupStatusEnum implements BaseEnum<String, GroupStatusEnum> {
 
+    NOT_START("NOT_START","未开始"),
+    APPLYING("APPLYING","报名中"),
     NORMAL("NORMAL", "正常"),
     LOCK("LOCK", "锁定"),
     FINISH("FINISH", "结束"),

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

@@ -3,7 +3,7 @@ package com.ym.mec.biz.dal.enums;
 import com.ym.mec.common.enums.BaseEnum;
 
 public enum GroupType implements BaseEnum<String, GroupType> {
-	MUSIC("乐团课"), VIP("VIP课"), DEMO("试听课"), SPORADIC("零星收费"), PRACTICE("网管课");
+	MUSIC("乐团课"), VIP("VIP课"), DEMO("试听课"), SPORADIC("零星收费"), PRACTICE("网管课"), COMM("对外课程");
 
 	private String desc;
 

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

@@ -32,6 +32,9 @@ public class StudentPaymentOrderQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "订单类型",required = false)
     private String orderType;
 
+    @ApiModelProperty(value = "分配分部",required = false)
+    private String routingOrganId;
+
     private boolean isExport = false;
 
     public boolean getIsExport() {
@@ -113,4 +116,12 @@ public class StudentPaymentOrderQueryInfo extends QueryInfo {
     public void setOrderType(String orderType) {
         this.orderType = orderType;
     }
+
+    public String getRoutingOrganId() {
+        return routingOrganId;
+    }
+
+    public void setRoutingOrganId(String routingOrganId) {
+        this.routingOrganId = routingOrganId;
+    }
 }

+ 18 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleEvaluateService.java

@@ -5,6 +5,9 @@ import com.ym.mec.biz.dal.entity.TeacherCourseStatistics;
 import com.ym.mec.biz.dal.page.TeacherCourseStatisticsQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 
 public interface CourseScheduleEvaluateService extends BaseService<Long, CourseScheduleEvaluate> {
@@ -13,4 +16,19 @@ public interface CourseScheduleEvaluateService extends BaseService<Long, CourseS
 
     CourseScheduleEvaluate getStudyReport(Integer classGroupId);
 
+    /**
+     * 根据课程组id获取报告列表
+     *
+     * @param groupId
+     * @return
+     */
+    List<CourseScheduleEvaluate> findByGroupId(@Param("groupId") Integer groupId);
+
+    /**
+     * 根据id获取报告
+     *
+     * @return
+     */
+    CourseScheduleEvaluate findById(@Param("id") Integer id);
+
 }

+ 18 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/CoursesGroupService.java

@@ -0,0 +1,18 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.dto.CourseGroupCreateDto;
+import com.ym.mec.biz.dal.entity.CoursesGroup;
+import com.ym.mec.common.service.BaseService;
+
+public interface CoursesGroupService extends BaseService<Long, CoursesGroup> {
+
+    /**
+     * @describe 课程创建
+     * @author Joburgess
+     * @date 2020/3/8
+     * @param courseGroupCreateInfo: 课程组创建信息
+     * @return void
+     */
+    void createCourseGroup(CourseGroupCreateDto courseGroupCreateInfo);
+
+}

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/PracticeGroupService.java

@@ -270,4 +270,6 @@ public interface PracticeGroupService extends BaseService<Long, PracticeGroup> {
 	 */
 	PageInfo<PracticeGroupDto> findPracticeGroupReviews(PracticeGroupQueryInfo queryInfo);
 
+
+
 }

+ 13 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/TeacherService.java

@@ -159,4 +159,17 @@ public interface TeacherService extends BaseService<Integer, Teacher> {
      * @return
      */
     List<BasicUserDto> queryEducationIpa(Integer id, String search);
+    
+    /**
+     * 实名认证
+     * @param userId 用户编号
+     * @param realName 姓名
+     * @param idcardNo 身份证号码
+     * @param idcardFrontImg 身份证正面
+     * @param idcardBackImg 身份证反面
+     * @param idcardHandImg 手持身份照
+     * @return
+     */
+	boolean realNameAuthentication(Integer userId, String realName, String idcardNo, String idcardFrontImg, String idcardBackImg, String idcardHandImg);
+
 }

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

@@ -615,9 +615,9 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         if(classGroupIds.size() > 0){
             courseScheduleEvaluates = courseScheduleEvaluateDao.findByClassGroupIds(classGroupIds);
         }
-        Map<Integer, Long> reportMap = new HashMap<>();
+        Map<Integer, List<CourseScheduleEvaluate>> reportMap = new HashMap<>();
         if(courseScheduleEvaluates.size()>0) {
-            reportMap = courseScheduleEvaluates.stream().collect(Collectors.toMap(CourseScheduleEvaluate::getClassGroupId, CourseScheduleEvaluate::getId));
+            reportMap = courseScheduleEvaluates.stream().collect(Collectors.groupingBy(CourseScheduleEvaluate::getClassGroupId));
         }
 
         Set<String> musicGroupId = musicCourse.stream().map(e -> e.getMusicId()).collect(Collectors.toSet());
@@ -673,7 +673,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             if(ClassGroupTypeEnum.PRACTICE == e.getType()){
                 e.setStudentNames(practiceStuNames.get(e.getPracticeId()));
                 e.setPracticeRenewUrl(practiceRenewUrlConfig.getParanValue() + e.getPracticeId());
-                if(reportMap.containsKey(e.getClassGroupId()) && (new Date()).compareTo(DateUtil.stringToDate("2020-03-01 12:18:00"))>=0){
+                if(reportMap.containsKey(e.getClassGroupId())){
                     e.setHasReport(true);
                     String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
                     e.setStudyReportUrl(baseUrl + "/#/reportDetail?classGroupId=" + e.getClassGroupId());

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

@@ -21,6 +21,7 @@ import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.Date;
+import java.util.List;
 
 
 @Service
@@ -89,4 +90,14 @@ public class CourseScheduleEvaluateServiceImpl extends BaseServiceImpl<Long, Cou
         return studyReport;
 
     }
+
+    @Override
+    public List<CourseScheduleEvaluate> findByGroupId(Integer groupId) {
+        return courseScheduleEvaluateDao.findByGroupId(groupId);
+    }
+
+    @Override
+    public CourseScheduleEvaluate findById(Integer id) {
+        return courseScheduleEvaluateDao.findById(id);
+    }
 }

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

@@ -1181,6 +1181,11 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
                             throw new BizException(courseCheckInfo(preCourseSchedule, backCourseSchedule, existCourseScheduleIds, 1));
                         }
+
+                        if(Objects.isNull(preCourseSchedule.getId())){
+                            continue;
+                        }
+
                         //助教冲突检测
                         if (Objects.isNull(preCourseSchedule.getId())) {
                             IntegerAndIntegerListDto integerAndIntegerListDto = classGroupTeachingTeacherMap.get(preCourseSchedule.getClassGroupId());
@@ -3520,6 +3525,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             List<TeacherAttendance> teacherAttendances = teacherAttendanceDao.findTeacherIdByCourseSchedule(courseScheduleIds);
             Map<Long, List<TeacherAttendance>> courseTeacherAttendanceMap = teacherAttendances.stream().collect(Collectors.groupingBy(TeacherAttendance::getCourseScheduleId));
             Map<Integer, Long> studentNumCourseMap = MapUtil.convertIntegerMap(studentAttendanceDao.countStudentAttendancesByCourses(courseScheduleIds));
+            Map<Long, String> studentIdMap = MapUtil.convertIntegerMap(courseScheduleStudentPaymentDao.getStudentIdMap(courseScheduleIds));
             List<Group> groups=new ArrayList<>();
             groups.add(null);
             List<Integer> teacherIds=new ArrayList<>();
@@ -3547,6 +3553,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
                 }
                 result.setTeacherName(nameIdMap.get(result.getActualTeacherId()));
                 result.setSubjectName(classGroupSubjectNameMap.get(result.getId()));
+                result.setStudentId(studentIdMap.get(result.getId()));
                 List<TeacherAttendance> courseTeacherAttendances = courseTeacherAttendanceMap.get(result.getId());
                 if(!CollectionUtils.isEmpty(courseTeacherAttendances)){
                     TeacherAttendance teacherAttendance=courseTeacherAttendances.get(0);

+ 174 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CoursesGroupServiceImpl.java

@@ -0,0 +1,174 @@
+package com.ym.mec.biz.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.dto.CourseGroupCreateDto;
+import com.ym.mec.biz.dal.dto.CourseTimeDto;
+import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.dal.enums.*;
+import com.ym.mec.biz.service.CourseScheduleService;
+import com.ym.mec.biz.service.CoursesGroupService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
+import java.util.*;
+
+@Service
+public class CoursesGroupServiceImpl extends BaseServiceImpl<Long, CoursesGroup> implements CoursesGroupService {
+
+    @Autowired
+    private CoursesGroupDao coursesGroupDao;
+    @Autowired
+    private CourseScheduleService courseScheduleService;
+    @Autowired
+    private ClassGroupDao classGroupDao;
+    @Autowired
+    private ClassGroupTeacherMapperDao classGroupTeacherMapperDao;
+    @Autowired
+    private ClassGroupTeacherSalaryDao classGroupTeacherSalaryDao;
+    @Autowired
+    private CourseScheduleDao courseScheduleDao;
+    @Autowired
+    private StudentAttendanceDao studentAttendanceDao;
+    @Autowired
+    private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
+    @Autowired
+    private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
+    @Autowired
+    private TeacherAttendanceDao teacherAttendanceDao;
+
+    @Override
+    public BaseDAO<Long, CoursesGroup> getDAO() {
+        return coursesGroupDao;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
+    public void createCourseGroup(CourseGroupCreateDto courseGroupCreateInfo) {
+        CoursesGroup courseGroup = courseGroupCreateInfo.getCoursesGroup();
+        CourseGenerateDto courseCycleInfo = courseGroupCreateInfo.getCourseCycleInfo();
+        if(Objects.isNull(courseGroup.getName())|| StringUtils.isBlank(courseGroup.getName())){
+            throw new BizException("请填写课程班名称");
+        }
+        if(Objects.isNull(courseGroup.getSubjectId())){
+            throw new BizException("请选择科目");
+        }
+        if(Objects.isNull(courseGroup.getMaxStudentNum())){
+            throw new BizException("请填写班级人数");
+        }
+        if(Objects.isNull(courseCycleInfo.getSingleClassMinutes())){
+            throw new BizException("请填写课程时长");
+        }
+        if(Objects.isNull(courseCycleInfo.getCourseCreateStartTime())){
+            throw new BizException("请填写课程开始时间");
+        }
+        if(Objects.isNull(courseCycleInfo.getCourseTimes())){
+            throw new BizException("请填写课程数量");
+        }
+
+        //总课程时长
+        Integer totalCourseTime=courseCycleInfo.getCourseCount()*courseCycleInfo.getSingleClassMinutes();
+
+        Date now=new Date();
+        courseGroup.setSingleClassMinutes(courseCycleInfo.getSingleClassMinutes());
+        courseGroup.setStatus(GroupStatusEnum.APPLYING);
+        List<CourseSchedule> newCourses = courseScheduleService.createCourses(courseGroupCreateInfo.getCourseCycleInfo());
+        for (CourseSchedule newCourse : newCourses) {
+            newCourse.setTeachMode(TeachModeEnum.ONLINE);
+            newCourse.setGroupType(GroupType.COMM);
+            newCourse.setType(CourseSchedule.CourseScheduleType.COMM);
+            newCourse.setTeacherId(courseGroup.getTeacherId());
+            newCourse.setActualTeacherId(courseGroup.getTeacherId());
+            newCourse.setIsLock(1);
+            newCourse.setStatus(CourseStatusEnum.NOT_START);
+            newCourse.setName(courseGroup.getName());
+        }
+        courseScheduleService.checkNewCourseSchedules(newCourses,false);
+
+        CourseSchedule firstCourseSchedule = newCourses.stream().min(Comparator.comparing(CourseSchedule::getStartClassTime)).get();
+        CourseSchedule latestCourseSchedule = newCourses.stream().max(Comparator.comparing(CourseSchedule::getEndClassTime)).get();
+        courseGroup.setCoursesStartDate(firstCourseSchedule.getStartClassTime());
+        courseGroup.setCoursesEndDate(latestCourseSchedule.getEndClassTime());
+
+        JSONArray courseTimesArray=new JSONArray();
+        for (CourseTimeDto courseTime : courseCycleInfo.getCourseTimes()) {
+            JSONObject courseTimeObject=new JSONObject();
+            courseTimeObject.put(String.valueOf(courseTime.getDayOfWeek()),courseTime.getStartClassTime());
+            courseTimesArray.add(courseTimeObject);
+        }
+
+        coursesGroupDao.insert(courseGroup);
+        //创建班级信息
+        ClassGroup classGroup = new ClassGroup();
+        classGroup.setSubjectIdList(courseGroup.getSubjectId().toString());
+        classGroup.setExpectStudentNum(1);
+        classGroup.setStudentNum(1);
+        classGroup.setName(courseGroup.getName());
+        classGroup.setTotalClassTimes(courseCycleInfo.getCourseCount());
+        classGroup.setType(ClassGroupTypeEnum.COMM);
+        classGroup.setDelFlag(0);
+        classGroup.setGroupType(GroupType.COMM);
+        classGroup.setMusicGroupId(courseGroup.getId().toString());
+        classGroup.setCreateTime(now);
+        classGroup.setUpdateTime(now);
+        classGroupDao.insert(classGroup);
+
+        //创建班级老师关联记录
+        ClassGroupTeacherMapper classGroupTeacherMapper = new ClassGroupTeacherMapper();
+        classGroupTeacherMapper.setMusicGroupId(courseGroup.getId().toString());
+        classGroupTeacherMapper.setClassGroupId(classGroup.getId());
+        classGroupTeacherMapper.setTeacherRole(TeachTypeEnum.BISHOP);
+        classGroupTeacherMapper.setUserId(courseGroup.getTeacherId());
+        classGroupTeacherMapper.setGroupType(GroupType.COMM);
+        classGroupTeacherMapper.setCreateTime(now);
+        classGroupTeacherMapper.setUpdateTime(now);
+        classGroupTeacherMapperDao.insert(classGroupTeacherMapper);
+
+        List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries = new ArrayList<>();
+        List<TeacherAttendance> teacherAttendances = new ArrayList<>();
+
+        for (CourseSchedule courseSchedule : newCourses) {
+            //课表
+            courseSchedule.setMusicGroupId(courseGroup.getId().toString());
+            courseSchedule.setClassGroupId(classGroup.getId());
+            courseSchedule.setCreateTime(now);
+            courseSchedule.setUpdateTime(now);
+        }
+        courseScheduleDao.batchAddCourseSchedules(newCourses);
+
+        for (CourseSchedule courseSchedule : newCourses) {
+            //课程与老师薪水表
+            CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
+            courseScheduleTeacherSalary.setCourseScheduleId(courseSchedule.getId());
+            courseScheduleTeacherSalary.setGroupType(GroupType.COMM);
+            courseScheduleTeacherSalary.setMusicGroupId(courseGroup.getId().toString());
+            courseScheduleTeacherSalary.setTeacherRole(classGroupTeacherMapper.getTeacherRole());
+            courseScheduleTeacherSalary.setUserId(courseGroup.getTeacherId());
+            courseScheduleTeacherSalary.setExpectSalary(BigDecimal.ZERO);
+            courseScheduleTeacherSalary.setCreateTime(now);
+            courseScheduleTeacherSalary.setUpdateTime(now);
+            courseScheduleTeacherSalary.setClassGroupId(classGroup.getId());
+            courseScheduleTeacherSalaries.add(courseScheduleTeacherSalary);
+
+            //教师签到记录
+            TeacherAttendance teacherAttendance = new TeacherAttendance();
+            teacherAttendance.setMusicGroupId(courseGroup.getId().toString());
+            teacherAttendance.setTeacherId(courseGroup.getTeacherId());
+            teacherAttendance.setClassGroupId(classGroup.getId());
+            teacherAttendance.setGroupType(GroupType.COMM);
+            teacherAttendance.setCourseScheduleId(courseSchedule.getId());
+            teacherAttendance.setCreateTime(now);
+            teacherAttendances.add(teacherAttendance);
+        }
+        courseScheduleTeacherSalaryDao.batchInsert(courseScheduleTeacherSalaries);
+        teacherAttendanceDao.batchInsert(teacherAttendances);
+    }
+}

+ 42 - 35
mec-biz/src/main/java/com/ym/mec/biz/service/impl/EduPracticeGroupServiceImpl.java

@@ -205,11 +205,19 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
         courseExpiredDate = DateUtil.addSeconds(courseExpiredDate, -1);
         practiceGroupBuyParams.setCoursesExpireDate(courseExpiredDate);
 
-        LocalDate courseStartMonday=courseStartDay.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
+//        LocalDate courseStartMonday=courseStartDay.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
         LocalDate courseExpiredSunday=currentExpiredDay.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.SUNDAY.getValue());
-        Date courseStartMondayDate = Date.from(courseStartMonday.atStartOfDay(DateUtil.zoneId).toInstant());
+//        Date courseStartMondayDate = Date.from(courseStartMonday.atStartOfDay(DateUtil.zoneId).toInstant());
         Date courseExpiredSundayDate = Date.from(courseExpiredSunday.atStartOfDay(DateUtil.zoneId).toInstant());
 
+        practiceGroupBuyParams.setName(subject.getName() + "•" + sysUser.getUsername());
+        List<CourseSchedule> practiceCourses = createPracticeCourses(practiceGroupBuyParams, practiceCourseMinutes);
+        practiceCourses.sort(Comparator.comparing(CourseSchedule::getStartClassTime));
+
+        LocalDate classStartDate=LocalDateTime.ofInstant(practiceCourses.get(0).getClassDate().toInstant(),DateUtil.zoneId).toLocalDate();
+        LocalDate courseStartMonday=classStartDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
+        Date courseStartMondayDate = Date.from(courseStartMonday.atStartOfDay(DateUtil.zoneId).toInstant());
+
         List<CourseSchedule> allTeacherCourses = courseScheduleDao.findTeacherCoursesWithDateRange(practiceGroupBuyParams.getUserId(), courseStartMondayDate, courseExpiredSundayDate);
 
         TeacherFreeTime teacherFreeTime = teacherFreeTimeDao.findTeacherFreeTime(practiceGroupBuyParams.getUserId());
@@ -246,10 +254,6 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
         }
         allTeacherCourses=new ArrayList<>();
 
-        practiceGroupBuyParams.setName(subject.getName() + "•" + sysUser.getUsername());
-
-        List<CourseSchedule> practiceCourses = createPracticeCourses(practiceGroupBuyParams, practiceCourseMinutes);
-
         JSONObject drillTimesObject=new JSONObject();
         for (PracticeDrillTimeDto drillTime : practiceGroupBuyParams.getDrillTimes()) {
             drillTimesObject.put(String.valueOf(drillTime.getWeekNum()),drillTime.getTimeStr());
@@ -431,8 +435,9 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
                 studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
                 studentPaymentOrder.setUpdateTime(now);
                 studentPaymentOrder.setOrganId(practiceGroupBuyParams.getOrganId());
+                studentPaymentOrder.setRoutingOrganId(42);
 
-                sysUserCashAccountService.updateBalance(practiceGroupBuyParams.getStudentId(), studentPaymentOrder.getExpectAmount().negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"教务学生购买");
+                sysUserCashAccountService.updateBalance(practiceGroupBuyParams.getStudentId(), studentPaymentOrder.getExpectAmount().negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,operatorInfo+"教务代买");
 
                 this.orderCallback(studentPaymentOrder);
 
@@ -493,35 +498,37 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
 
         //插入缴费明细
         //收入
-        SysUserCashAccountDetail sysUserIncomeCashAccountDetail = new SysUserCashAccountDetail();
-        sysUserIncomeCashAccountDetail.setUserId(order.getUserId());
-        sysUserIncomeCashAccountDetail.setType(PlatformCashAccountDetailTypeEnum.RECHARGE);
-        sysUserIncomeCashAccountDetail.setStatus(DealStatusEnum.SUCCESS);
-        sysUserIncomeCashAccountDetail.setAmount(order.getActualAmount());
-        sysUserIncomeCashAccountDetail.setBalance(sysUserCashAccount.getBalance().add(order.getActualAmount()));
-        sysUserIncomeCashAccountDetail.setAttribute(order.getTransNo());
-        sysUserIncomeCashAccountDetail.setChannel(studentPaymentOrder.getPaymentChannel());
-        sysUserIncomeCashAccountDetail.setComAmount(studentPaymentOrder.getComAmount());
-        sysUserIncomeCashAccountDetail.setPerAmount(studentPaymentOrder.getPerAmount());
-
-        //支出
-        SysUserCashAccountDetail sysUserExpendCashAccountDetail = new SysUserCashAccountDetail();
-        sysUserExpendCashAccountDetail.setUserId(order.getUserId());
-        sysUserExpendCashAccountDetail.setType(PlatformCashAccountDetailTypeEnum.PAY_FEE);
-        sysUserExpendCashAccountDetail.setStatus(DealStatusEnum.SUCCESS);
-        sysUserExpendCashAccountDetail.setAmount(order.getActualAmount().negate());
-        sysUserExpendCashAccountDetail.setBalance(sysUserCashAccount.getBalance());
-        sysUserExpendCashAccountDetail.setAttribute(order.getTransNo());
-        sysUserExpendCashAccountDetail.setChannel(studentPaymentOrder.getPaymentChannel());
-        if(studentPaymentOrder.getComAmount() != null){
-            sysUserExpendCashAccountDetail.setComAmount(studentPaymentOrder.getComAmount().negate());
-        }
-        if(studentPaymentOrder.getPerAmount() != null){
-            sysUserExpendCashAccountDetail.setPerAmount(studentPaymentOrder.getPerAmount().negate());
-        }
+        if(order.getActualAmount().compareTo(BigDecimal.ZERO)!=0){
+            SysUserCashAccountDetail sysUserIncomeCashAccountDetail = new SysUserCashAccountDetail();
+            sysUserIncomeCashAccountDetail.setUserId(order.getUserId());
+            sysUserIncomeCashAccountDetail.setType(PlatformCashAccountDetailTypeEnum.RECHARGE);
+            sysUserIncomeCashAccountDetail.setStatus(DealStatusEnum.SUCCESS);
+            sysUserIncomeCashAccountDetail.setAmount(order.getActualAmount());
+            sysUserIncomeCashAccountDetail.setBalance(sysUserCashAccount.getBalance().add(order.getActualAmount()));
+            sysUserIncomeCashAccountDetail.setAttribute(order.getTransNo());
+            sysUserIncomeCashAccountDetail.setChannel(studentPaymentOrder.getPaymentChannel());
+            sysUserIncomeCashAccountDetail.setComAmount(studentPaymentOrder.getComAmount());
+            sysUserIncomeCashAccountDetail.setPerAmount(studentPaymentOrder.getPerAmount());
+
+            //支出
+            SysUserCashAccountDetail sysUserExpendCashAccountDetail = new SysUserCashAccountDetail();
+            sysUserExpendCashAccountDetail.setUserId(order.getUserId());
+            sysUserExpendCashAccountDetail.setType(PlatformCashAccountDetailTypeEnum.PAY_FEE);
+            sysUserExpendCashAccountDetail.setStatus(DealStatusEnum.SUCCESS);
+            sysUserExpendCashAccountDetail.setAmount(order.getActualAmount().negate());
+            sysUserExpendCashAccountDetail.setBalance(sysUserCashAccount.getBalance());
+            sysUserExpendCashAccountDetail.setAttribute(order.getTransNo());
+            sysUserExpendCashAccountDetail.setChannel(studentPaymentOrder.getPaymentChannel());
+            if(studentPaymentOrder.getComAmount() != null){
+                sysUserExpendCashAccountDetail.setComAmount(studentPaymentOrder.getComAmount().negate());
+            }
+            if(studentPaymentOrder.getPerAmount() != null){
+                sysUserExpendCashAccountDetail.setPerAmount(studentPaymentOrder.getPerAmount().negate());
+            }
 
-        sysUserCashAccountDetailService.insert(sysUserIncomeCashAccountDetail);
-        sysUserCashAccountDetailService.insert(sysUserExpendCashAccountDetail);
+            sysUserCashAccountDetailService.insert(sysUserIncomeCashAccountDetail);
+            sysUserCashAccountDetailService.insert(sysUserExpendCashAccountDetail);
+        }
 
         PracticeGroup practiceGroup = practiceGroupDao.get(Long.valueOf(order.getMusicGroupId()));
         if(practiceGroup.getGroupStatus().equals(GroupStatusEnum.CANCEL)){

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

@@ -324,8 +324,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         }
 
         studentPaymentOrder.setPaymentChannel("BALANCE");
-        //studentPaymentOrder.setOrganId(chargeInfo.getOrganId());
-        studentPaymentOrder.setOrganId(42);
+        studentPaymentOrder.setOrganId(chargeInfo.getOrganId());
+        studentPaymentOrder.setRoutingOrganId(42);
         studentPaymentOrder.setUpdateTime(date);
         studentPaymentOrderService.update(studentPaymentOrder);
         studentPaymentOrder.setVersion(studentPaymentOrder.getVersion() + 1);
@@ -362,8 +362,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         );
 
         Map<String, BigDecimal> routingFee = (Map<String, BigDecimal>) payMap.get("routingFee");
-        //studentPaymentOrder.setOrganId(chargeInfo.getOrganId());
-        studentPaymentOrder.setOrganId(42);
+        studentPaymentOrder.setOrganId(chargeInfo.getOrganId());
+        studentPaymentOrder.setRoutingOrganId(42);
         studentPaymentOrder.setComAmount(routingFee.get("COM"));
         studentPaymentOrder.setPerAmount(routingFee.get("PER"));
         studentPaymentOrder.setMerNos((String) payMap.get("routingMerNos"));
@@ -541,8 +541,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         }
         studentPaymentOrder.setPaymentChannel("BALANCE");
         studentPaymentOrder.setRemitFee(remitFee);
-        //studentPaymentOrder.setOrganId(musicGroup.getOrganId());
-        studentPaymentOrder.setOrganId(42);
+        studentPaymentOrder.setOrganId(musicGroup.getOrganId());
+        studentPaymentOrder.setRoutingOrganId(42);
         studentPaymentOrder.setUpdateTime(date);
         studentPaymentOrderService.update(studentPaymentOrder);
         studentPaymentOrder.setVersion(studentPaymentOrder.getVersion() + 1);
@@ -596,8 +596,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         );
 
         Map<String, BigDecimal> routingFee = (Map<String, BigDecimal>) payMap.get("routingFee");
-        //studentPaymentOrder.setOrganId(musicGroup.getOrganId());
-        studentPaymentOrder.setOrganId(42);
+        studentPaymentOrder.setOrganId(musicGroup.getOrganId());
+        studentPaymentOrder.setRoutingOrganId(42);
         studentPaymentOrder.setComAmount(routingFee.get("COM"));
         studentPaymentOrder.setPerAmount(routingFee.get("PER"));
         studentPaymentOrder.setMerNos((String) payMap.get("routingMerNos"));
@@ -780,8 +780,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         }
         studentPaymentOrder.setPaymentChannel("BALANCE");
         studentPaymentOrder.setRemitFee(remitFee);
-        //studentPaymentOrder.setOrganId(musicGroup.getOrganId());
-        studentPaymentOrder.setOrganId(42);
+        studentPaymentOrder.setOrganId(musicGroup.getOrganId());
+        studentPaymentOrder.setRoutingOrganId(42);
         studentPaymentOrder.setUpdateTime(date);
         studentPaymentOrderService.update(studentPaymentOrder);
         studentPaymentOrder.setVersion(studentPaymentOrder.getVersion() + 1);
@@ -834,8 +834,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         );
 
         Map<String, BigDecimal> routingFee = (Map<String, BigDecimal>) payMap.get("routingFee");
-        //studentPaymentOrder.setOrganId(musicGroup.getOrganId());
-        studentPaymentOrder.setOrganId(42);
+        studentPaymentOrder.setOrganId(musicGroup.getOrganId());
+        studentPaymentOrder.setRoutingOrganId(42);
         studentPaymentOrder.setComAmount(routingFee.get("COM"));
         studentPaymentOrder.setPerAmount(routingFee.get("PER"));
         studentPaymentOrder.setMerNos((String) payMap.get("routingMerNos"));
@@ -1623,8 +1623,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 studentPaymentOrder.setBalancePaymentAmount(amount);
                 studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
                 studentPaymentOrder.setUpdateTime(date);
-                //studentPaymentOrder.setOrganId(musicGroup.getOrganId());
-                studentPaymentOrder.setOrganId(42);
+                studentPaymentOrder.setOrganId(musicGroup.getOrganId());
+                studentPaymentOrder.setRoutingOrganId(42);
                 studentPaymentOrderService.update(studentPaymentOrder);
 
                 sysUserCashAccountService.updateBalance(userId, amount.negate(), PlatformCashAccountDetailTypeEnum.PAY_FEE, "乐团续费");
@@ -1669,8 +1669,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             );
 
             Map<String, BigDecimal> routingFee = (Map<String, BigDecimal>) payMap.get("routingFee");
-            //studentPaymentOrder.setOrganId(musicGroup.getOrganId());
-            studentPaymentOrder.setOrganId(42);
+            studentPaymentOrder.setOrganId(musicGroup.getOrganId());
+            studentPaymentOrder.setRoutingOrganId(42);
             studentPaymentOrder.setComAmount(routingFee.get("COM"));
             studentPaymentOrder.setPerAmount(routingFee.get("PER"));
             studentPaymentOrder.setMerNos((String) payMap.get("routingMerNos"));

+ 22 - 14
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java

@@ -2697,11 +2697,19 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         courseExpiredDate = DateUtil.addSeconds(courseExpiredDate, -1);
         practiceGroupBuyParams.setCoursesExpireDate(courseExpiredDate);
 
-        LocalDate courseStartMonday=courseStartDay.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
+//        LocalDate courseStartMonday=courseStartDay.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
         LocalDate courseExpiredSunday=currentExpiredDay.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.SUNDAY.getValue());
-        Date courseStartMondayDate = Date.from(courseStartMonday.atStartOfDay(DateUtil.zoneId).toInstant());
+//        Date courseStartMondayDate = Date.from(courseStartMonday.atStartOfDay(DateUtil.zoneId).toInstant());
         Date courseExpiredSundayDate = Date.from(courseExpiredSunday.atStartOfDay(DateUtil.zoneId).toInstant());
 
+        practiceGroupBuyParams.setName(subject.getName() + "•" + sysUser.getUsername());
+        List<CourseSchedule> practiceCourses = createPracticeCourses(practiceGroupBuyParams, practiceCourseMinutes);
+        practiceCourses.sort(Comparator.comparing(CourseSchedule::getStartClassTime));
+
+        LocalDate classStartDate=LocalDateTime.ofInstant(practiceCourses.get(0).getClassDate().toInstant(),DateUtil.zoneId).toLocalDate();
+        LocalDate courseStartMonday=classStartDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
+        Date courseStartMondayDate = Date.from(courseStartMonday.atStartOfDay(DateUtil.zoneId).toInstant());
+
         List<CourseSchedule> allTeacherCourses = courseScheduleDao.findTeacherCoursesWithDateRange(practiceGroupBuyParams.getUserId(), courseStartMondayDate, courseExpiredSundayDate);
 
         TeacherFreeTime teacherFreeTime = teacherFreeTimeDao.findTeacherFreeTime(practiceGroupBuyParams.getUserId());
@@ -2737,10 +2745,10 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             }
         }
         allTeacherCourses=new ArrayList<>();
-
-        practiceGroupBuyParams.setName(subject.getName() + "•" + sysUser.getUsername());
-
-        List<CourseSchedule> practiceCourses = createPracticeCourses(practiceGroupBuyParams, practiceCourseMinutes);
+//
+//        practiceGroupBuyParams.setName(subject.getName() + "•" + sysUser.getUsername());
+//
+//        List<CourseSchedule> practiceCourses = createPracticeCourses(practiceGroupBuyParams, practiceCourseMinutes);
 
         JSONObject drillTimesObject=new JSONObject();
         for (PracticeDrillTimeDto drillTime : practiceGroupBuyParams.getDrillTimes()) {
@@ -2921,8 +2929,8 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
                 studentPaymentOrder.setBalancePaymentAmount(studentPaymentOrder.getExpectAmount());
                 studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
                 studentPaymentOrder.setUpdateTime(now);
-                //studentPaymentOrder.setOrganId(practiceGroupBuyParams.getOrganId());
-                studentPaymentOrder.setOrganId(42);
+                studentPaymentOrder.setOrganId(practiceGroupBuyParams.getOrganId());
+                studentPaymentOrder.setRoutingOrganId(42);
 
                 sysUserCashAccountService.updateBalance(practiceGroupBuyParams.getStudentId(), studentPaymentOrder.getExpectAmount().negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"网管课购买");
 
@@ -2964,8 +2972,8 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
             );
 
             Map<String,BigDecimal> routingFee = (Map<String,BigDecimal>)payMap.get("routingFee");
-            //studentPaymentOrder.setOrganId(practiceGroupBuyParams.getOrganId());
-            studentPaymentOrder.setOrganId(42);
+            studentPaymentOrder.setOrganId(practiceGroupBuyParams.getOrganId());
+            studentPaymentOrder.setRoutingOrganId(42);
             studentPaymentOrder.setComAmount(routingFee.get("COM"));
             studentPaymentOrder.setPerAmount(routingFee.get("PER"));
             studentPaymentOrder.setMerNos((String) payMap.get("routingMerNos"));
@@ -3276,8 +3284,8 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
                 newOrder.setBalancePaymentAmount(newOrder.getExpectAmount());
                 newOrder.setStatus(DealStatusEnum.SUCCESS);
                 newOrder.setUpdateTime(new Date());
-                //newOrder.setOrganId(practiceGroup.getOrganId());
-                newOrder.setOrganId(42);
+                newOrder.setOrganId(practiceGroup.getOrganId());
+                newOrder.setRoutingOrganId(42);
 
                 sysUserCashAccountService.updateBalance(userId, newOrder.getExpectAmount().negate(),PlatformCashAccountDetailTypeEnum.PAY_FEE,"网管课购买");
 
@@ -3320,8 +3328,8 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
 
             Map<String,BigDecimal> routingFee = (Map<String,BigDecimal>)payMap.get("routingFee");
             newOrder.setStatus(DealStatusEnum.ING);
-            //newOrder.setOrganId(practiceGroup.getOrganId());
-            newOrder.setOrganId(42);
+            newOrder.setOrganId(practiceGroup.getOrganId());
+            newOrder.setRoutingOrganId(42);
             newOrder.setComAmount(routingFee.get("COM"));
             newOrder.setPerAmount(routingFee.get("PER"));
             newOrder.setMerNos((String) payMap.get("routingMerNos"));

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

@@ -612,8 +612,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             studentPaymentOrder.setStatus(DealStatusEnum.WAIT_PAY);
             studentPaymentOrder.setMusicGroupId(musicGroupId);
             studentPaymentOrder.setClassGroupId(studentAddDto.getSignClassId());
-            //studentPaymentOrder.setOrganId(musicGroup.getOrganId());
-            studentPaymentOrder.setOrganId(42);
+            studentPaymentOrder.setOrganId(musicGroup.getOrganId());
+            studentPaymentOrder.setRoutingOrganId(42);
 
             //生成订单明细
             List<StudentPaymentOrderDetail> studentPaymentOrderDetails = studentAddDto.getStudentPaymentOrderDetails();

+ 36 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherServiceImpl.java

@@ -19,6 +19,7 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.im.ImFeignService;
 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;
@@ -443,4 +444,39 @@ public class TeacherServiceImpl extends BaseServiceImpl<Integer, Teacher>  imple
 		return teacher;
 	}
 
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public boolean realNameAuthentication(Integer userId, String realName, String idcardNo, String idcardFrontImg, String idcardBackImg, String idcardHandImg) {
+
+		SysUser user = sysUserFeignService.queryUserById(userId);
+		if (user == null) {
+			throw new BizException("用户不存在");
+		}
+
+		Teacher teacher = teacherDao.get(userId);
+		if (teacher == null) {
+			throw new BizException("用户信息不存在");
+		}
+		// 查询是否已实名认证
+		if (StringUtils.isNotBlank(teacher.getIdcardBackImg()) && StringUtils.isNotBlank(teacher.getIdcardFrontImg())
+				&& StringUtils.isNotBlank(teacher.getIdcardHandImg())) {
+			throw new BizException("已实名认证,不能重复操作");
+		}
+
+		Date date = new Date();
+
+		user.setRealName(realName);
+		user.setIdCardNo(idcardNo);
+		user.setUpdateTime(date);
+		sysUserFeignService.updateSysUser(user);
+
+		teacher.setIdcardBackImg(idcardBackImg);
+		teacher.setIdcardFrontImg(idcardFrontImg);
+		teacher.setIdcardHandImg(idcardHandImg);
+		teacher.setUpdateTime(date);
+		teacherDao.update(teacher);
+
+		return true;
+	}
+
 }

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

@@ -1186,8 +1186,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				studentPaymentOrder.setBalancePaymentAmount(amount);
 				studentPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
 				studentPaymentOrder.setUpdateTime(date);
-				//studentPaymentOrder.setOrganId(vipGroup.getOrganId());
-		        studentPaymentOrder.setOrganId(42);
+				studentPaymentOrder.setOrganId(vipGroup.getOrganId());
+		        studentPaymentOrder.setRoutingOrganId(42);
 
 				this.orderCallback(studentPaymentOrder);
 
@@ -1237,8 +1237,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			);
 
 			Map<String,BigDecimal> routingFee = (Map<String,BigDecimal>)payMap.get("routingFee");
-			//studentPaymentOrder.setOrganId(vipGroup.getOrganId());
-			studentPaymentOrder.setOrganId(42);
+			studentPaymentOrder.setOrganId(vipGroup.getOrganId());
+			studentPaymentOrder.setRoutingOrganId(42);
 			studentPaymentOrder.setComAmount(routingFee.get("COM"));
 			studentPaymentOrder.setPerAmount(routingFee.get("PER"));
 			studentPaymentOrder.setMerNos((String) payMap.get("routingMerNos"));

+ 21 - 5
mec-biz/src/main/resources/config/mybatis/CourseScheduleEvaluateMapper.xml

@@ -13,16 +13,18 @@
         <result column="student_id_" jdbcType="INTEGER" property="studentId"/>
         <result column="subject_name_" jdbcType="VARCHAR" property="subjectName"/>
         <result column="is_pushed_" jdbcType="INTEGER" property="isPushed"/>
-        <result column="student_id_list_" jdbcType="VARCHAR" property="studentIdList"/>
+        <result column="month_" jdbcType="VARCHAR" property="month"/>
+        <result column="version_" jdbcType="INTEGER" property="version"/>
+		<result column="student_id_list_" jdbcType="VARCHAR" property="studentIdList"/>
     </resultMap>
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleEvaluate" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
         INSERT INTO course_schedule_evaluate (music_group_id_, class_group_id_, course_schedule_id_,
                                               teacher_id_, item_, comment_,
-                                              create_time_,student_id_list_)
-        VALUES (#{musicGroupId,jdbcType=VARCHAR}, #{classGroupId,jdbcType=INTEGER}, #{courseScheduleId,jdbcType=BIGINT},
+                                              create_time_,student_id_list_,version_)
+        values (#{musicGroupId,jdbcType=VARCHAR}, #{classGroupId,jdbcType=INTEGER}, #{courseScheduleId,jdbcType=BIGINT},
                 #{teacherId,jdbcType=INTEGER}, #{item,jdbcType=VARCHAR}, #{comment,jdbcType=LONGVARCHAR},
-                NOW(),#{studentIdList})
+                NOW(),#{studentIdList},#{version,jdbcType=INTEGER})
     </insert>
 
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleEvaluate">
@@ -34,7 +36,7 @@
         FROM course_schedule_evaluate cse
                  LEFT JOIN practice_group pg ON pg.id_ = cse.music_group_id_
                  LEFT JOIN subject s on s.id_ = pg.subject_id_
-        WHERE cse.class_group_id_ = #{classGroupId}
+        WHERE cse.class_group_id_ = #{classGroupId} ORDER BY create_time_ DESC LIMIT 1
     </select>
 
     <select id="findByClassGroupIds" resultMap="CourseScheduleEvaluate">
@@ -109,6 +111,20 @@
       WHERE create_time_ &lt;= #{expiredDate}
       AND (is_pushed_ = 0 OR is_pushed_ IS NULL)
     </select>
+
+    <select id="findByGroupId" resultMap="CourseScheduleEvaluate">
+        SELECT id_,DATE_FORMAT(create_time_, '%Y年%m月') month_ FROM course_schedule_evaluate WHERE music_group_id_ = #{groupId}
+        ORDER BY create_time_ ASC
+    </select>
+
+    <select id="findById" resultMap="CourseScheduleEvaluate">
+        SELECT cse.*, s.name_ subject_name_, pg.student_id_
+        FROM course_schedule_evaluate cse
+        LEFT JOIN practice_group pg ON pg.id_ = cse.music_group_id_
+        LEFT JOIN subject s on s.id_ = pg.subject_id_
+        WHERE cse.id_ = #{id}
+    </select>
+
     <select id="findByCourseAndTeacher" resultMap="CourseScheduleEvaluate">
         SELECT * FROM course_schedule_evaluate cse
         WHERE cse.teacher_id_ = #{teacherId} AND cse.course_schedule_id_ = #{courseScheduleId}

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

@@ -293,8 +293,17 @@
 		WHERE cssp.course_schedule_id_ = #{courseScheduleId}
 		GROUP BY su.id_
 	</select>
+	<select id="getStudentIdMap" resultType="java.util.Map">
+		SELECT cssp.course_schedule_id_ 'key',GROUP_CONCAT(DISTINCT cssp.user_id_) 'value'
+		FROM course_schedule_student_payment cssp
+		WHERE cssp.course_schedule_id_ IN
+		<foreach collection="courseScheduleIds" item="scheduleId" open="(" close=")" separator=",">
+			#{scheduleId}
+		</foreach>
+		GROUP BY cssp.course_schedule_id_
+	</select>
 
-    <delete id="deleteStudentCourseSchedule">
+	<delete id="deleteStudentCourseSchedule">
 		DELETE FROM course_schedule_student_payment WHERE user_id_ = #{userId} AND course_schedule_id_ IN
 		<foreach collection="courseScheduleList" item="courseSchedule" index="index" open="(" close=")" separator=",">
 			#{courseSchedule.id}

+ 128 - 0
mec-biz/src/main/resources/config/mybatis/CoursesGroupMapper.xml

@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--
+这个文件是自动生成的。
+不要修改此文件。所有改动将在下次重新自动生成时丢失。
+-->
+<mapper namespace="com.ym.mec.biz.dal.dao.CoursesGroupDao">
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.CoursesGroup" id="CoursesGroup">
+		<result column="id_" property="id" />
+		<result column="name_" property="name" />
+		<result column="subject_id_" property="subjectId" />
+		<result column="courses_start_date_" property="coursesStartDate" />
+		<result column="courses_end_date_" property="coursesEndDate" />
+		<result column="teaching_arrangement_" property="teachingArrangement" />
+		<result column="organ_id_" property="organId" />
+		<result column="single_class_minutes_" property="singleClassMinutes" />
+		<result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+		<result column="memo_" property="memo" />
+		<result column="teacher_id_" property="teacherId" />
+		<result column="max_student_num_" property="maxStudentNum" />
+		<result column="apply_closing_date_" property="applyClosingDate" />
+		<result column="teaching_plan_" property="teachingPlan" />
+		<result column="teacher_salary_settlement_method_" property="teacherSalarySettlementMethod" />
+		<result column="total_courses_price_" property="totalCoursesPrice" />
+		<result column="total_course_discount_price_" property="totalCourseDiscountPrice" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="CoursesGroup" >
+		SELECT * FROM courses_group WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="CoursesGroup">
+		SELECT * FROM courses_group ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CoursesGroup" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!--
+		<selectKey resultClass="int" keyProperty="id" > 
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		</selectKey>
+		-->
+		INSERT INTO courses_group (id_,name_,subject_id_,courses_start_date_,courses_end_date_,teaching_arrangement_,organ_id_,single_class_minutes_,status_,memo_,teacher_id_,max_student_num_,apply_closing_date_,teaching_plan_,teacher_salary_settlement_method_,total_courses_price_,total_course_discount_price_,create_time_,update_time_)
+		VALUES(#{id},#{name},#{subjectId},#{coursesStartDate},#{coursesEndDate},#{teachingArrangement},#{organId},#{singleClassMinutes},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{memo},#{teacherId},#{maxStudentNum},#{applyClosingDate},#{teachingPlan},#{teacherSalarySettlementMethod},#{totalCoursesPrice},#{totalCourseDiscountPrice},NOW(),NOW())
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.CoursesGroup">
+		UPDATE courses_group
+		<set>
+			<if test="coursesEndDate != null">
+				courses_end_date_ = #{coursesEndDate},
+			</if>
+			<if test="subjectId != null">
+				subject_id_ = #{subjectId},
+			</if>
+			<if test="status != null">
+				status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+			</if>
+			<if test="organId != null">
+				organ_id_ = #{organId},
+			</if>
+			<if test="totalCourseDiscountPrice != null">
+				total_course_discount_price_ = #{totalCourseDiscountPrice},
+			</if>
+			<if test="id != null">
+				id_ = #{id},
+			</if>
+			<if test="coursesStartDate != null">
+				courses_start_date_ = #{coursesStartDate},
+			</if>
+			<if test="memo != null">
+				memo_ = #{memo},
+			</if>
+			<if test="maxStudentNum != null">
+				max_student_num_ = #{maxStudentNum},
+			</if>
+			<if test="name != null">
+				name_ = #{name},
+			</if>
+			<if test="teacherSalarySettlementMethod != null">
+				teacher_salary_settlement_method_ = #{teacherSalarySettlementMethod},
+			</if>
+			<if test="createTime != null">
+				create_time_ = #{createTime},
+			</if>
+			<if test="teachingPlan != null">
+				teaching_plan_ = #{teachingPlan},
+			</if>
+			<if test="applyClosingDate != null">
+				apply_closing_date_ = #{applyClosingDate},
+			</if>
+			<if test="totalCoursesPrice != null">
+				total_courses_price_ = #{totalCoursesPrice},
+			</if>
+			<if test="teachingArrangement != null">
+				teaching_arrangement_ = #{teachingArrangement},
+			</if>
+			<if test="teacherId != null">
+				teacher_id_ = #{teacherId},
+			</if>
+			<if test="singleClassMinutes != null">
+				single_class_minutes_ = #{singleClassMinutes},
+			</if>
+			update_time_ = NOW()
+		</set> WHERE id_ = #{id}
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM courses_group WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="CoursesGroup" parameterType="map">
+		SELECT * FROM courses_group ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM courses_group
+	</select>
+</mapper>

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

@@ -64,7 +64,7 @@
 		<where>
 			<if test="organIdList!=null">
 				organ_id_ IN
-				<foreach collection="organIdList" item="organId" open="(" close=")">
+				<foreach collection="organIdList" item="organId" open="(" close=")" separator=",">
 					#{organId}
 				</foreach>
 			</if>

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

@@ -83,12 +83,12 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentPaymentOrder" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
         INSERT INTO student_payment_order
-        (id_, group_type_, user_id_,organ_id_, type_, expect_amount_, actual_amount_, com_amount_, per_amount_,
+        (id_, group_type_, user_id_,organ_id_,routing_organ_id_, type_, expect_amount_, actual_amount_, com_amount_, per_amount_,
          balance_payment_amount_, remit_fee_, trans_no_,
          status_, memo_, create_time_, update_time_, payment_channel_, payment_business_channel_,
          payment_account_no_, mer_nos_, order_no_, music_group_id_, class_group_id_)
         VALUES (#{id}, #{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-                #{userId},#{organId}, #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+                #{userId},#{organId},#{routingOrganId}, #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
                 #{expectAmount}, #{actualAmount}, #{comAmount}, #{perAmount}, #{balancePaymentAmount},
                 #{remitFee}, #{transNo},
                 #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{memo}, now(), now(),
@@ -163,6 +163,9 @@
             <if test="organId != null">
                 organ_id_ = #{organId},
             </if>
+            <if test="routingOrganId != null">
+                routing_organ_id_ = #{routingOrganId},
+            </if>
             <if test="payTime != null">
                 pay_time_ = #{payTime},
             </if>
@@ -228,6 +231,9 @@
             <if test='orderType != null and orderType.toString()=="2".toString()'>
                 AND spo.per_amount_ > 0
             </if>
+            <if test="routingOrganId != null">
+                AND FIND_IN_SET(spo.routing_organ_id_,#{routingOrganId})
+            </if>
         </where>
     </sql>
 

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

@@ -28,6 +28,9 @@
         <result column="introduction_" property="introduction"/>
         <result column="is_support_extra_practice_lesson_" property="isSupportExtraPracticeLesson"/>
         <result column="is_support_course_schedule_rewards_rules_" property="isSupportCourseScheduleRewardsRules"/>
+        <result column="idcard_front_img_" property="idcardFrontImg"/>
+        <result column="idcard_back_img_" property="idcardBackImg"/>
+        <result column="idcard_hand_img_" property="idcardHandImg"/>
         <result column="update_time_" property="updateTime"/>
         <result column="create_time_" property="createTime"/>
         <result column="lecture_num_" property="lectureNum"/>
@@ -75,13 +78,8 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.Teacher" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
         INSERT INTO teacher
-        (id_,organ_id_,job_type_,job_nature_,is_probation_period_,education_background_,graduate_school_,
-        technical_titles_,work_unit_,subject_id_,entry_date_,demission_date_,certificate_type_,certificate_num_,
-        flow_organ_range_,introduction_,update_time_,create_time_,is_support_extra_practice_lesson_,is_support_course_schedule_rewards_rules_,lecture_num_)
-        VALUES(#{id},#{organId},#{jobType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{jobNature},
-        #{isProbationPeriod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{educationBackground},
-        #{graduateSchool},#{technicalTitles},#{workUnit},#{subjectId},#{entryDate},#{demissionDate},#{certificateType},
-        #{certificateNum},#{flowOrganRange},#{introduction},now(),now(),#{isSupportExtraPracticeLesson},#{isSupportCourseScheduleRewardsRules}#{lectureNum})
+        (id_,organ_id_,job_type_,job_nature_,is_probation_period_,education_background_,graduate_school_,technical_titles_,work_unit_,subject_id_,entry_date_,demission_date_,certificate_type_,certificate_num_,flow_organ_range_,introduction_,update_time_,create_time_,is_support_extra_practice_lesson_,is_support_course_schedule_rewards_rules_,idcard_front_img_,idcard_back_img_,idcard_hand_img_)
+        VALUES(#{id},#{organId},#{jobType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{jobNature},#{isProbationPeriod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{educationBackground},#{graduateSchool},#{technicalTitles},#{workUnit},#{subjectId},#{entryDate},#{demissionDate},#{certificateType},#{certificateNum},#{flowOrganRange},#{introduction},now(),now(),#{isSupportExtraPracticeLesson},#{isSupportCourseScheduleRewardsRules},#{idcardFrontImg},#{idcardBackImg},#{idcardHandImg})
     </insert>
 
     <insert id="addSysUser" parameterType="com.ym.mec.auth.api.entity.SysUser" useGeneratedKeys="true" keyColumn="id"
@@ -153,6 +151,15 @@
             <if test="isSupportExtraPracticeLesson != null">
                 is_support_extra_practice_lesson_ = #{isSupportExtraPracticeLesson},
             </if>
+            <if test="idcardFrontImg != null">
+                idcard_front_img_ = #{idcardFrontImg},
+            </if>
+            <if test="idcardBackImg != null">
+                idcard_back_img_ = #{idcardBackImg},
+            </if>
+            <if test="idcardHandImg != null">
+                idcard_hand_img_ = #{idcardHandImg},
+            </if>
         </set>
         WHERE id_ = #{id}
     </update>

+ 13 - 0
mec-student/src/main/java/com/ym/mec/student/controller/StudyReportController.java

@@ -5,6 +5,7 @@ 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.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -23,4 +24,16 @@ public class StudyReportController extends BaseController {
 	public Object info(Integer classGroupId) {
 		return succeed(courseScheduleEvaluateService.getStudyReport(classGroupId));
 	}
+
+	@ApiOperation(value = "课程组评论列表")
+	@GetMapping("getGroupReviews")
+	public Object getGroupReviews(Integer groupId) {
+		return succeed(courseScheduleEvaluateService.findByGroupId(groupId));
+	}
+
+	@ApiOperation(value = "评论详情")
+	@GetMapping("getReviewsInfo")
+	public Object getReviewsInfo(Integer id) {
+		return succeed(courseScheduleEvaluateService.findById(id));
+	}
 }

+ 43 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/CourseGroupController.java

@@ -0,0 +1,43 @@
+package com.ym.mec.teacher.controller;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dto.CourseGroupCreateDto;
+import com.ym.mec.biz.service.CoursesGroupService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Objects;
+
+/**
+ * @Author Joburgess
+ * @Date 2020/3/8
+ */
+@Api(tags = "对外课程组服务")
+@RequestMapping("courseGroup")
+@RestController
+public class CourseGroupController extends BaseController {
+
+    @Autowired
+    private CoursesGroupService coursesGroupService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @ApiOperation(value = "创建课程组")
+    @PostMapping("/createCourseGroup")
+    public HttpResponseResult createCourseGroup(@RequestBody CourseGroupCreateDto courseGroupCreateInfo){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(Objects.isNull(sysUser)){
+            return failed(HttpStatus.FORBIDDEN,"请登录");
+        }
+        courseGroupCreateInfo.getCoursesGroup().setTeacherId(sysUser.getId());
+        coursesGroupService.createCourseGroup(courseGroupCreateInfo);
+        return succeed();
+    }
+
+}

+ 40 - 8
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherController.java

@@ -1,5 +1,20 @@
 package com.ym.mec.teacher.controller;
 
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
+import java.util.Date;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.entity.Teacher;
@@ -11,14 +26,6 @@ import com.ym.mec.biz.service.ClassGroupService;
 import com.ym.mec.biz.service.SubjectService;
 import com.ym.mec.biz.service.TeacherService;
 import com.ym.mec.common.controller.BaseController;
-import io.swagger.annotations.*;
-import org.springframework.beans.factory.annotation.Autowired;
-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 java.util.Date;
 
 @RequestMapping("teacher")
 @Api(tags = "教师服务")
@@ -48,6 +55,16 @@ public class TeacherController extends BaseController {
     }
 
     @ApiOperation(value = "根据教师编号查询教师基本信息")
+    @GetMapping("/queryUserInfo")
+    public Object queryUserInfo() {
+    	SysUser user = sysUserFeignService.queryUserInfo();
+		if (user == null) {
+			return failed(HttpStatus.FORBIDDEN, "请登录");
+		}
+        return succeed(teacherService.get(user.getId()));
+    }
+
+    @ApiOperation(value = "根据教师编号查询教师基本信息")
     @GetMapping("/get")
     @ApiParam(value = "教师编号", required = true)
     public Object get(Integer id) {
@@ -118,4 +135,19 @@ public class TeacherController extends BaseController {
     public Object findSubByMusicGroupId(String musicGroupId){
         return succeed(subjectService.findSubByMusicGroupId(musicGroupId));
     }
+
+	@ApiOperation(value = "实名认证")
+	@ApiImplicitParams({ @ApiImplicitParam(name = "realName", value = "姓名", required = true, dataType = "String"),
+			@ApiImplicitParam(name = "idcardNo", value = "身份证号码", required = true, dataType = "String"),
+			@ApiImplicitParam(name = "idcardFrontImg", value = "身份证正面", required = true, dataType = "String"),
+			@ApiImplicitParam(name = "idcardBackImg", value = "身份证背面", required = true, dataType = "String"),
+			@ApiImplicitParam(name = "idcardHandImg", value = "手持身份证照", required = true, dataType = "String") })
+	public Object realNameAuthentication(String realName, String idcardNo, String idcardFrontImg, String idcardBackImg, String idcardHandImg) {
+		SysUser user = sysUserFeignService.queryUserInfo();
+		if (user == null) {
+			return failed(HttpStatus.FORBIDDEN, "请登录");
+		}
+		teacherService.realNameAuthentication(user.getId(), realName, idcardNo, idcardFrontImg, idcardBackImg, idcardHandImg);
+		return succeed();
+	}
 }

+ 5 - 3
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -256,9 +256,9 @@ public class ExportController extends BaseController {
         List<CourseScheduleEndDto> rows = scheduleService.endFindCourseSchedules(queryInfo).getRows();
         try {
             HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部名称", "课程编号", "开始时间", "结束时间", "班级名称", "班级声部", "课程名称", "课程类型", "教学模式",
-                    "教学点", "课程状态", "是否点名", "指导老师", "签到时间", "签退时间","签到备注"}, new String[]{
+                    "教学点", "课程状态", "是否点名", "指导老师", "学员编号", "签到时间", "签退时间","签到备注"}, new String[]{
                     "organName", "id", "startClassTime", "endClassTime", "classGroupName","subjectName", "name",
-                    "groupType.desc", "teachMode.msg", "schoolName", "status.msg", "isCallNames.msg", "teacherName", "signInTime",
+                    "groupType.desc", "teachMode.msg", "schoolName", "status.msg", "isCallNames.msg", "teacherName", "studentId", "signInTime",
                     "signOutTime","remark"}, rows);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
@@ -423,7 +423,9 @@ public class ExportController extends BaseController {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if (!sysUser.getIsSuperAdmin()) {
             Employee employee = employeeDao.get(sysUser.getId());
-            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
+            if(StringUtils.isEmpty(queryInfo.getOrganId()) && queryInfo.getOrderType().equals("3")){
+                queryInfo.setRoutingOrganId(employee.getOrganIdList());
+            }else if (StringUtils.isEmpty(queryInfo.getOrganId())) {
                 queryInfo.setOrganId(employee.getOrganIdList());
             }
         }

+ 17 - 0
mec-web/src/main/java/com/ym/mec/web/controller/PracticeGroupManageController.java

@@ -6,6 +6,7 @@ import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.page.PracticeGroupQueryInfo;
+import com.ym.mec.biz.service.CourseScheduleEvaluateService;
 import com.ym.mec.biz.service.GroupClassService;
 import com.ym.mec.biz.service.PracticeGroupService;
 import com.ym.mec.common.controller.BaseController;
@@ -41,6 +42,8 @@ public class PracticeGroupManageController extends BaseController {
     private EmployeeDao employeeDao;
     @Autowired
     private GroupClassService groupService;
+    @Autowired
+    private CourseScheduleEvaluateService courseScheduleEvaluateService;
 
     @ApiOperation(value = "全查询")
     @GetMapping("/queryAll")
@@ -111,4 +114,18 @@ public class PracticeGroupManageController extends BaseController {
         }
         return succeed(practiceGroupService.findPracticeGroupReviews(queryInfo));
     }
+
+    @ApiOperation(value = "课程组评论列表")
+    @GetMapping("getGroupReviews")
+    @PreAuthorize("@pcs.hasPermissions('practiceGroupManage/getGroupReviews')")
+    public Object getGroupReviews(Integer groupId) {
+        return succeed(courseScheduleEvaluateService.findByGroupId(groupId));
+    }
+
+    @ApiOperation(value = "评论详情")
+    @GetMapping("getReviewsInfo")
+    @PreAuthorize("@pcs.hasPermissions('practiceGroupManage/getReviewsInfo')")
+    public Object getReviewsInfo(Integer id) {
+        return succeed(courseScheduleEvaluateService.findById(id));
+    }
 }

+ 26 - 0
mec-web/src/main/java/com/ym/mec/web/controller/StudentPaymentOrderController.java

@@ -194,5 +194,31 @@ public class StudentPaymentOrderController extends BaseController {
         return succeed(studentPaymentOrderDetailService.verifyMusicalList(musicGroupId));
     }
 
+    @ApiOperation(value = "财务订单列表")
+    @GetMapping("/finance")
+    @PreAuthorize("@pcs.hasPermissions('order/finance')")
+    public Object financeOrder(StudentPaymentOrderQueryInfo queryInfo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        if (!sysUser.getIsSuperAdmin()) {
+            Employee employee = employeeDao.get(sysUser.getId());
+            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
+                queryInfo.setRoutingOrganId(employee.getOrganIdList());
+            } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
+                return failed("用户所在分部异常");
+            } else {
+                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+                if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
+                    return failed("非法请求");
+                }
+            }
+        }
+
+        PageInfo<StudentPaymentOrder> studentPaymentOrderPageInfo = studentPaymentOrderService.OrderQueryPage(queryInfo);
+        return succeed(studentPaymentOrderPageInfo);
+    }
+
 
 }

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

@@ -131,7 +131,7 @@ public class EduPracticeGroupController extends BaseController {
         if(Objects.isNull(practiceGroupBuyParams.getStudentId())){
             throw new BizException("请指定学生");
         }
-        return eduPracticeGroupService.buyPracticeGroup(practiceGroupBuyParams, sysUser.getUsername()+"("+sysUser.getId()+")");
+        return eduPracticeGroupService.buyPracticeGroup(practiceGroupBuyParams, sysUser.getRealName()+"("+sysUser.getId()+")");
     }
 
     @ApiOperation("获取用户历史购买的陪练课")