소스 검색

1、陪练课调整
2、付费陪练课可预约时间调整

Joburgess 5 년 전
부모
커밋
925f13f4cc

+ 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;
+    }
+}

+ 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;
 

+ 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;
 

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

@@ -449,4 +449,5 @@ public interface CourseScheduleService extends BaseService<Long, CourseSchedule>
 	 * @param courseScheduleIds
 	 */
     void cleanAttendance(String courseScheduleIds);
+
 }

+ 9 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/CoursesGroupService.java

@@ -1,10 +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> {
 
-    void createCourseGroup(CoursesGroup coursesGroup);
+    /**
+     * @describe 课程创建
+     * @author Joburgess
+     * @date 2020/3/8
+     * @param courseGroupCreateInfo: 课程组创建信息
+     * @return void
+     */
+    void createCourseGroup(CourseGroupCreateDto courseGroupCreateInfo);
 
 }

+ 22 - 13
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CoursesGroupServiceImpl.java

@@ -1,26 +1,35 @@
 package com.ym.mec.biz.service.impl;
 
 import com.ym.mec.biz.dal.dao.CoursesGroupDao;
+import com.ym.mec.biz.dal.dto.CourseGroupCreateDto;
+import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.CoursesGroup;
+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.service.impl.BaseServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service
 public class CoursesGroupServiceImpl extends BaseServiceImpl<Long, CoursesGroup> implements CoursesGroupService {
-	
-	@Autowired
-	private CoursesGroupDao coursesGroupDao;
-
-	@Override
-	public BaseDAO<Long, CoursesGroup> getDAO() {
-		return coursesGroupDao;
-	}
-
-	@Override
-	public void createCourseGroup(CoursesGroup coursesGroup) {
-		
-	}
+
+    @Autowired
+    private CoursesGroupDao coursesGroupDao;
+    @Autowired
+    private CourseScheduleService courseScheduleService;
+
+    @Override
+    public BaseDAO<Long, CoursesGroup> getDAO() {
+        return coursesGroupDao;
+    }
+
+    @Override
+    public void createCourseGroup(CourseGroupCreateDto courseGroupCreateInfo) {
+
+        List<CourseSchedule> newCourses = courseScheduleService.createCourses(courseGroupCreateInfo.getCourseCycleInfo());
+
+    }
 }

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

@@ -45,70 +45,70 @@
 		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},#{memo},#{teacherId},#{maxStudentNum},#{applyClosingDate},#{teachingPlan},#{teacherSalarySettlementMethod},#{totalCoursesPrice},#{totalCourseDiscountPrice},#{createTime},#{updateTime})
+		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},#{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},
-</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="updateTime != null">
-update_time_ = #{updateTime},
-</if>
-<if test="singleClassMinutes != null">
-single_class_minutes_ = #{singleClassMinutes},
-</if>
-</set> WHERE id_ = #{id} 
+		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},
+			</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>
 	
 	<!-- 根据主键删除一条记录 -->