Browse Source

增加乐团课程费用的设置

周箭河 5 years ago
parent
commit
e1808d2b6d

+ 16 - 5
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupOrganizationCourseSettings.java

@@ -1,9 +1,9 @@
 package com.ym.mec.biz.dal.entity;
 package com.ym.mec.biz.dal.entity;
 
 
-import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.util.Date;
 import java.util.Date;
+import java.util.List;
 
 
 public class MusicGroupOrganizationCourseSettings {
 public class MusicGroupOrganizationCourseSettings {
     @ApiModelProperty(value="")
     @ApiModelProperty(value="")
@@ -12,8 +12,8 @@ public class MusicGroupOrganizationCourseSettings {
     /**
     /**
     * 课程名称
     * 课程名称
     */
     */
-    @ApiModelProperty(value="课程名称")
-    private Integer name;
+    @ApiModelProperty(value="收费名称")
+    private String name;
 
 
     /**
     /**
     * 分部
     * 分部
@@ -45,6 +45,9 @@ public class MusicGroupOrganizationCourseSettings {
     @ApiModelProperty(value="")
     @ApiModelProperty(value="")
     private Date updateTime;
     private Date updateTime;
 
 
+
+    private List<MusicGroupOrganizationCourseSettingsDetail> details;
+
     public Integer getId() {
     public Integer getId() {
         return id;
         return id;
     }
     }
@@ -53,11 +56,11 @@ public class MusicGroupOrganizationCourseSettings {
         this.id = id;
         this.id = id;
     }
     }
 
 
-    public Integer getName() {
+    public String getName() {
         return name;
         return name;
     }
     }
 
 
-    public void setName(Integer name) {
+    public void setName(String name) {
         this.name = name;
         this.name = name;
     }
     }
 
 
@@ -108,4 +111,12 @@ public class MusicGroupOrganizationCourseSettings {
     public void setUpdateTime(Date updateTime) {
     public void setUpdateTime(Date updateTime) {
         this.updateTime = updateTime;
         this.updateTime = updateTime;
     }
     }
+
+    public List<MusicGroupOrganizationCourseSettingsDetail> getDetails() {
+        return details;
+    }
+
+    public void setDetails(List<MusicGroupOrganizationCourseSettingsDetail> details) {
+        this.details = details;
+    }
 }
 }

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupOrganizationCourseSettingsDetail.java

@@ -14,7 +14,7 @@ public class MusicGroupOrganizationCourseSettingsDetail {
     * 课程类型
     * 课程类型
     */
     */
     @ApiModelProperty(value="课程类型")
     @ApiModelProperty(value="课程类型")
-    private String courseType;
+    private CourseSchedule.CourseScheduleType courseType;
 
 
     /**
     /**
     * 课程总时间
     * 课程总时间
@@ -68,11 +68,11 @@ public class MusicGroupOrganizationCourseSettingsDetail {
         this.musicGroupOrganizationCourseSettingsId = musicGroupOrganizationCourseSettingsId;
         this.musicGroupOrganizationCourseSettingsId = musicGroupOrganizationCourseSettingsId;
     }
     }
 
 
-    public String getCourseType() {
+    public CourseSchedule.CourseScheduleType getCourseType() {
         return courseType;
         return courseType;
     }
     }
 
 
-    public void setCourseType(String courseType) {
+    public void setCourseType(CourseSchedule.CourseScheduleType courseType) {
         this.courseType = courseType;
         this.courseType = courseType;
     }
     }
 
 

+ 19 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/CourseSettingQueryInfo.java

@@ -0,0 +1,19 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+public class CourseSettingQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value="分部id")
+    private Integer organId;
+
+
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+}

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

@@ -6,7 +6,7 @@
     <!--@Table music_group_organization_course_settings_detail-->
     <!--@Table music_group_organization_course_settings_detail-->
     <id column="id_" property="id" />
     <id column="id_" property="id" />
     <result column="music_group_organization_course_settings_id_" property="musicGroupOrganizationCourseSettingsId" />
     <result column="music_group_organization_course_settings_id_" property="musicGroupOrganizationCourseSettingsId" />
-    <result column="course_type_" property="courseType" />
+    <result column="course_type_" property="courseType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
     <result column="course_total_minuties_" property="courseTotalMinuties" />
     <result column="course_total_minuties_" property="courseTotalMinuties" />
     <result column="unit_price_" property="unitPrice" />
     <result column="unit_price_" property="unitPrice" />
     <result column="course_original_price_" property="courseOriginalPrice" />
     <result column="course_original_price_" property="courseOriginalPrice" />

+ 96 - 74
mec-biz/src/main/resources/config/mybatis/MusicGroupOrganizationCourseSettingsMapper.xml

@@ -1,80 +1,102 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?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">
 <!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.MusicGroupOrganizationCourseSettingsDao">
 <mapper namespace="com.ym.mec.biz.dal.dao.MusicGroupOrganizationCourseSettingsDao">
-  <resultMap id="MusicGroupOrganizationCourseSettings" type="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings">
-    <!--@mbg.generated-->
-    <!--@Table music_group_organization_course_settings-->
-    <id column="id_" property="id" />
-    <result column="name_" property="name" />
-    <result column="organ_id_" property="organId" />
-    <result column="charge_type_id_" property="chargeTypeId" />
-    <result column="total_current_price_" property="totalCurrentPrice" />
-    <result column="total_original_price_" property="totalOriginalPrice" />
-    <result column="create_time_" property="createTime" />
-    <result column="update_time_" property="updateTime" />
-  </resultMap>
-  <sql id="Base_Column_List">
-    <!--@mbg.generated-->
-    id_, name_, organ_id_, charge_type_id_, total_current_price_, total_original_price_, 
-    create_time_, update_time_
-  </sql>
-  <select id="get" parameterType="java.lang.Integer" resultMap="MusicGroupOrganizationCourseSettings">
-    <!--@mbg.generated-->
-    select 
-    <include refid="Base_Column_List" />
-    from music_group_organization_course_settings
-    where id_ = #{id}
-  </select>
-  <delete id="delete" parameterType="java.lang.Integer">
-    <!--@mbg.generated-->
-    delete from music_group_organization_course_settings
-    where id_ = #{id}
-  </delete>
-  <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings" useGeneratedKeys="true">
-    <!--@mbg.generated-->
-    insert into music_group_organization_course_settings (name_, organ_id_, charge_type_id_, total_current_price_, total_original_price_, 
-      create_time_, update_time_)
-    values (#{name}, #{organId}, #{chargeTypeId}, #{totalCurrentPrice}, #{totalOriginalPrice}, 
-      #{createTime}, #{updateTime})
-  </insert>
-  <update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings">
-    <!--@mbg.generated-->
-    update music_group_organization_course_settings
-    <set>
-      <if test="name != null">
-        name_ = #{name},
-      </if>
-      <if test="organId != null">
-        organ_id_ = #{organId},
-      </if>
-      <if test="chargeTypeId != null">
-        charge_type_id_ = #{chargeTypeId},
-      </if>
-      <if test="totalCurrentPrice != null">
-        total_current_price_ = #{totalCurrentPrice},
-      </if>
-      <if test="totalOriginalPrice != null">
-        total_original_price_ = #{totalOriginalPrice},
-      </if>
-      <if test="createTime != null">
-        create_time_ = #{createTime},
-      </if>
-      <if test="updateTime != null">
-        update_time_ = #{updateTime},
-      </if>
-    </set>
-    where id_ = #{id}
-  </update>
+    <resultMap id="MusicGroupOrganizationCourseSettings"
+               type="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings">
+        <!--@mbg.generated-->
+        <!--@Table music_group_organization_course_settings-->
+        <id column="id_" property="id"/>
+        <result column="name_" property="name"/>
+        <result column="organ_id_" property="organId"/>
+        <result column="charge_type_id_" property="chargeTypeId"/>
+        <result column="total_current_price_" property="totalCurrentPrice"/>
+        <result column="total_original_price_" property="totalOriginalPrice"/>
+        <result column="create_time_" property="createTime"/>
+        <result column="update_time_" property="updateTime"/>
+        <collection property="details" ofType="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail"
+                    columnPrefix="detail_">
+            <result column="id_" property="id"/>
+            <result column="course_type_" property="courseType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+            <result column="is_student_optional_" property="isStudentOptional"/>
+            <result column="course_total_minuties_" property="courseTotalMinuties"/>
+            <result column="unit_price_" property="unitPrice"/>
+            <result column="course_current_price_" property="courseOriginalPrice"/>
+            <result column="course_original_price_" property="courseCurrentPrice"/>
+        </collection>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
+        id_, name_, organ_id_, charge_type_id_, total_current_price_, total_original_price_,
+        create_time_, update_time_
+    </sql>
+    <select id="get" parameterType="java.lang.Integer" resultMap="MusicGroupOrganizationCourseSettings">
+        <!--@mbg.generated-->
+        select
+        <include refid="Base_Column_List"/>
+        from music_group_organization_course_settings
+        where id_ = #{id}
+    </select>
+    <delete id="delete" parameterType="java.lang.Integer">
+        <!--@mbg.generated-->
+        delete from music_group_organization_course_settings
+        where id_ = #{id}
+    </delete>
+    <insert id="insert" keyColumn="id_" keyProperty="id"
+            parameterType="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings" useGeneratedKeys="true">
+        <!--@mbg.generated-->
+        insert into music_group_organization_course_settings (name_, organ_id_, charge_type_id_, total_current_price_,
+        total_original_price_,
+        create_time_, update_time_)
+        values (#{name}, #{organId}, #{chargeTypeId}, #{totalCurrentPrice}, #{totalOriginalPrice},
+        #{createTime}, #{updateTime})
+    </insert>
+    <update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings">
+        <!--@mbg.generated-->
+        update music_group_organization_course_settings
+        <set>
+            <if test="name != null">
+                name_ = #{name},
+            </if>
+            <if test="organId != null">
+                organ_id_ = #{organId},
+            </if>
+            <if test="chargeTypeId != null">
+                charge_type_id_ = #{chargeTypeId},
+            </if>
+            <if test="totalCurrentPrice != null">
+                total_current_price_ = #{totalCurrentPrice},
+            </if>
+            <if test="totalOriginalPrice != null">
+                total_original_price_ = #{totalOriginalPrice},
+            </if>
+            <if test="createTime != null">
+                create_time_ = #{createTime},
+            </if>
+            <if test="updateTime != null">
+                update_time_ = #{updateTime},
+            </if>
+        </set>
+        where id_ = #{id}
+    </update>
 
 
-  <!-- 分页查询 -->
-  <select id="queryPage" resultMap="MusicGroupOrganizationCourseSettings" parameterType="map">
-    SELECT * FROM music_group_organization_course_settings ORDER BY id_
-    <include refid="global.limit" />
-  </select>
+    <!-- 分页查询 -->
+    <select id="queryPage" resultMap="MusicGroupOrganizationCourseSettings" parameterType="map">
+        SELECT mgocs.*,mgocsd.id_ detail_id_,mgocsd.course_type_ detail_course_type_, mgocsd.is_student_optional_
+        detail_is_student_optional_,mgocsd.course_total_minuties_ detail_course_total_minuties_,
+        mgocsd.unit_price_ detail_unit_price_,mgocsd.course_current_price_ detail_course_current_price_,
+        mgocsd.course_original_price_ detail_course_original_price_,mgocsd.course_current_price_
+        detail_course_current_price_
+        FROM music_group_organization_course_settings mgocs
+        LEFT JOIN music_group_organization_course_settings_detail mgocsd ON mgocs.id_ =
+        mgocsd.music_group_organization_course_settings_id_
+        <include refid="global.limit"/>
+    </select>
 
 
-  <!-- 查询当前表的总记录数 -->
-  <select id="queryCount" resultType="int">
-    SELECT COUNT(*) FROM
-      music_group_organization_course_settings
-  </select>
+    <!-- 查询当前表的总记录数 -->
+    <select id="queryCount" resultType="int">
+        SELECT COUNT(*)
+        FROM music_group_organization_course_settings mgocs
+                 LEFT JOIN music_group_organization_course_settings_detail mgocsd
+                           ON mgocs.id_ = mgocsd.music_group_organization_course_settings_id_
+    </select>
 </mapper>
 </mapper>

+ 33 - 0
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupOrganizationCourseSettingsController.java

@@ -0,0 +1,33 @@
+package com.ym.mec.web.controller;
+
+import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings;
+import com.ym.mec.biz.dal.page.CourseSettingQueryInfo;
+import com.ym.mec.biz.dal.page.HfMemberQueryInfo;
+import com.ym.mec.biz.service.MusicGroupOrganizationCourseSettingsService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.page.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+@RequestMapping("musicGroupOrganizationCourseSettings")
+@Api(tags = "收费方式设置")
+@RestController
+public class MusicGroupOrganizationCourseSettingsController extends BaseController {
+    @Autowired
+    private MusicGroupOrganizationCourseSettingsService musicGroupOrganizationCourseSettingsService;
+
+    @ApiOperation(value = "获取设置列表")
+    @GetMapping("/queryPage")
+    @PreAuthorize("@pcs.hasPermissions('musicGroupOrganizationCourseSettings/queryPage')")
+    public HttpResponseResult<PageInfo<MusicGroupOrganizationCourseSettings>> queryPage(CourseSettingQueryInfo queryInfo) {
+        return succeed(musicGroupOrganizationCourseSettingsService.queryPage(queryInfo));
+    }
+
+}