Pārlūkot izejas kodu

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

yonge 5 gadi atpakaļ
vecāks
revīzija
0f8df01d5f

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

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

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

@@ -47,6 +47,10 @@ public class CourseScheduleEvaluate {
 
     private String month;
 
+    @ApiModelProperty(value = "报告版本")
+    private Integer version;
+
+
     public Integer getIsPushed() {
         return isPushed;
     }
@@ -174,4 +178,12 @@ public class CourseScheduleEvaluate {
     public void setMonth(String month) {
         this.month = month;
     }
+
+    public Integer getVersion() {
+        return version;
+    }
+
+    public void setVersion(Integer version) {
+        this.version = version;
+    }
 }

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

@@ -0,0 +1,224 @@
+package com.ym.mec.biz.dal.entity;
+
+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 String 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 void setStatus(String status){
+		this.status = status;
+	}
+	
+	public String getStatus(){
+		return this.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);
+	}
+
+}

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

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

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

@@ -0,0 +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;
+    @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());
+
+    }
+}

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

@@ -14,15 +14,16 @@
         <result column="subject_name_" jdbcType="VARCHAR" property="subjectName"/>
         <result column="is_pushed_" jdbcType="INTEGER" property="isPushed"/>
         <result column="month_" jdbcType="VARCHAR" property="month"/>
+        <result column="version_" jdbcType="INTEGER" property="version"/>
     </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_)
+                                              create_time_,version_)
         values (#{musicGroupId,jdbcType=VARCHAR}, #{classGroupId,jdbcType=INTEGER}, #{courseScheduleId,jdbcType=BIGINT},
                 #{teacherId,jdbcType=INTEGER}, #{item,jdbcType=VARCHAR}, #{comment,jdbcType=LONGVARCHAR},
-                #{createTime,jdbcType=TIMESTAMP})
+                #{createTime,jdbcType=TIMESTAMP},#{version,jdbcType=INTEGER})
     </insert>
 
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleEvaluate">
@@ -34,7 +35,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} LIMIT 1
+        WHERE cse.class_group_id_ = #{classGroupId} ORDER BY create_time_ DESC LIMIT 1
     </select>
 
     <select id="findByClassGroupIds" resultMap="CourseScheduleEvaluate">

+ 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" />
+		<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},#{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="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>

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