Browse Source

Merge remote-tracking branch 'origin/master'

Joburgess 5 years ago
parent
commit
a50e4b1f91
23 changed files with 909 additions and 213 deletions
  1. 5 9
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ChargeTypeSubjectMapperDao.java
  2. 6 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupOrganizationCourseSettingsDetailDao.java
  3. 16 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/OrganizationCourseUnitPriceSettingsDao.java
  4. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ChargeTypeSubjectMapper.java
  5. 18 7
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupOrganizationCourseSettings.java
  6. 17 15
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MusicGroupOrganizationCourseSettingsDetail.java
  7. 83 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/OrganizationCourseUnitPriceSettings.java
  8. 19 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/CourseSettingQueryInfo.java
  9. 31 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/OrganizationCourseUnitPriceSettingsQueryInfo.java
  10. 7 0
      mec-biz/src/main/java/com/ym/mec/biz/service/ChargeTypeSubjectMapperService.java
  11. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupOrganizationCourseSettingsService.java
  12. 16 0
      mec-biz/src/main/java/com/ym/mec/biz/service/OrganizationCourseUnitPriceSettingsService.java
  13. 4 16
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ChargeTypeServiceImpl.java
  14. 20 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ChargeTypeSubjectMapperServiceImpl.java
  15. 70 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupOrganizationCourseSettingsServiceImpl.java
  16. 29 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/OrganizationCourseUnitPriceSettingsServiceImpl.java
  17. 54 8
      mec-biz/src/main/resources/config/mybatis/ChargeTypeSubjectMapperMapper.xml
  18. 109 84
      mec-biz/src/main/resources/config/mybatis/MusicGroupOrganizationCourseSettingsDetailMapper.xml
  19. 96 74
      mec-biz/src/main/resources/config/mybatis/MusicGroupOrganizationCourseSettingsMapper.xml
  20. 96 0
      mec-biz/src/main/resources/config/mybatis/OrganizationCourseUnitPriceSettingsMapper.xml
  21. 63 0
      mec-web/src/main/java/com/ym/mec/web/controller/ChargeTypeSubjectMapperController.java
  22. 50 0
      mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupOrganizationCourseSettingsController.java
  23. 66 0
      mec-web/src/main/java/com/ym/mec/web/controller/OrganizationCourseUnitPriceSettingsController.java

+ 5 - 9
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ChargeTypeSubjectMapperDao.java

@@ -1,10 +1,9 @@
 package com.ym.mec.biz.dal.dao;
 package com.ym.mec.biz.dal.dao;
 
 
+import java.util.List;
+
 import com.ym.mec.biz.dal.entity.ChargeTypeSubjectMapper;
 import com.ym.mec.biz.dal.entity.ChargeTypeSubjectMapper;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.dal.BaseDAO;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
 
 
 public interface ChargeTypeSubjectMapperDao extends BaseDAO<Long, ChargeTypeSubjectMapper> {
 public interface ChargeTypeSubjectMapperDao extends BaseDAO<Long, ChargeTypeSubjectMapper> {
 
 
@@ -13,10 +12,7 @@ public interface ChargeTypeSubjectMapperDao extends BaseDAO<Long, ChargeTypeSubj
      */
      */
     void deleteByChargeTypeId(Integer chargeTypeId);
     void deleteByChargeTypeId(Integer chargeTypeId);
 
 
-    /**
-     * 批量新增
-     * @param subjectIds
-     * @param chargeTypeId
-     */
-    void batchAdd(@Param("subjectIds") List<Integer> subjectIds, @Param("chargeTypeId")Integer chargeTypeId);
+	int batchInsert(List<ChargeTypeSubjectMapper> chargeTypeSubjectMapperList);
+	
+	int batchUpdate(List<ChargeTypeSubjectMapper> chargeTypeSubjectMapperList);
 }
 }

+ 6 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupOrganizationCourseSettingsDetailDao.java

@@ -2,7 +2,13 @@ package com.ym.mec.biz.dal.dao;
 
 
 import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail;
 import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 
 public interface MusicGroupOrganizationCourseSettingsDetailDao extends BaseDAO<Integer, MusicGroupOrganizationCourseSettingsDetail> {
 public interface MusicGroupOrganizationCourseSettingsDetailDao extends BaseDAO<Integer, MusicGroupOrganizationCourseSettingsDetail> {
 
 
+    int batchInsert(@Param("settingDetails") List<MusicGroupOrganizationCourseSettingsDetail> settingDetails);
+
+    int deleteBySettingId(@Param("settingId") Integer settingId);
 }
 }

+ 16 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/OrganizationCourseUnitPriceSettingsDao.java

@@ -0,0 +1,16 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.biz.dal.entity.OrganizationCourseUnitPriceSettings;
+import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
+import com.ym.mec.common.dal.BaseDAO;
+
+public interface OrganizationCourseUnitPriceSettingsDao extends BaseDAO<Integer, OrganizationCourseUnitPriceSettings> {
+
+	/**
+	 * 根据分部编号以及课程类型查询对象
+	 * @param organId 分部编号
+	 * @param courseType 课程类型
+	 * @return
+	 */
+	OrganizationCourseUnitPriceSettings queryByOrganIdAndCourseType(Integer organId, CourseScheduleType courseType);
+}

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

@@ -42,6 +42,9 @@ public class ChargeTypeSubjectMapper {
 	@ApiModelProperty(value = "课程费用",required = false)
 	@ApiModelProperty(value = "课程费用",required = false)
 	private BigDecimal fee;
 	private BigDecimal fee;
 	
 	
+	@ApiModelProperty(value = "商品折扣率",required = false)
+	private BigDecimal goodsDiscountRate;
+	
 	public void setId(Long id){
 	public void setId(Long id){
 		this.id = id;
 		this.id = id;
 	}
 	}
@@ -106,6 +109,14 @@ public class ChargeTypeSubjectMapper {
 		this.fee = fee;
 		this.fee = fee;
 	}
 	}
 
 
+	public BigDecimal getGoodsDiscountRate() {
+		return goodsDiscountRate;
+	}
+
+	public void setGoodsDiscountRate(BigDecimal goodsDiscountRate) {
+		this.goodsDiscountRate = goodsDiscountRate;
+	}
+
 	@Override
 	@Override
 	public String toString() {
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);
 		return ToStringBuilder.reflectionToString(this);

+ 18 - 7
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;
 
 
     /**
     /**
     * 分部
     * 分部
@@ -31,13 +31,13 @@ public class MusicGroupOrganizationCourseSettings {
     * 总价
     * 总价
     */
     */
     @ApiModelProperty(value="总价")
     @ApiModelProperty(value="总价")
-    private BigDecimal totalCurrentPrice;
+    private BigDecimal totalCurrentPrice = BigDecimal.ZERO;
 
 
     /**
     /**
     * 原价
     * 原价
     */
     */
     @ApiModelProperty(value="原价")
     @ApiModelProperty(value="原价")
-    private BigDecimal totalOriginalPrice;
+    private BigDecimal totalOriginalPrice = BigDecimal.ZERO;
 
 
     @ApiModelProperty(value="")
     @ApiModelProperty(value="")
     private Date createTime;
     private Date createTime;
@@ -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;
+    }
 }
 }

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

@@ -1,6 +1,8 @@
 package com.ym.mec.biz.dal.entity;
 package com.ym.mec.biz.dal.entity;
 
 
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
 import java.util.Date;
 import java.util.Date;
 
 
 public class MusicGroupOrganizationCourseSettingsDetail {
 public class MusicGroupOrganizationCourseSettingsDetail {
@@ -14,31 +16,31 @@ public class MusicGroupOrganizationCourseSettingsDetail {
     * 课程类型
     * 课程类型
     */
     */
     @ApiModelProperty(value="课程类型")
     @ApiModelProperty(value="课程类型")
-    private String courseType;
+    private CourseSchedule.CourseScheduleType courseType;
 
 
     /**
     /**
     * 课程总时间
     * 课程总时间
     */
     */
     @ApiModelProperty(value="课程总时间")
     @ApiModelProperty(value="课程总时间")
-    private String courseTotalMinuties;
+    private Integer courseTotalMinuties;
 
 
     /**
     /**
     * 单价
     * 单价
     */
     */
     @ApiModelProperty(value="单价")
     @ApiModelProperty(value="单价")
-    private String unitPrice;
+    private BigDecimal unitPrice = BigDecimal.ZERO;
 
 
     /**
     /**
     * 课程原价
     * 课程原价
     */
     */
     @ApiModelProperty(value="课程原价")
     @ApiModelProperty(value="课程原价")
-    private String courseOriginalPrice;
+    private BigDecimal courseOriginalPrice=BigDecimal.ZERO;
 
 
     /**
     /**
     * 课程现价
     * 课程现价
     */
     */
     @ApiModelProperty(value="课程现价")
     @ApiModelProperty(value="课程现价")
-    private String courseCurrentPrice;
+    private BigDecimal courseCurrentPrice=BigDecimal.ZERO;
 
 
     /**
     /**
     * 是否学生可选
     * 是否学生可选
@@ -68,43 +70,43 @@ 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;
     }
     }
 
 
-    public String getCourseTotalMinuties() {
+    public Integer getCourseTotalMinuties() {
         return courseTotalMinuties;
         return courseTotalMinuties;
     }
     }
 
 
-    public void setCourseTotalMinuties(String courseTotalMinuties) {
+    public void setCourseTotalMinuties(Integer courseTotalMinuties) {
         this.courseTotalMinuties = courseTotalMinuties;
         this.courseTotalMinuties = courseTotalMinuties;
     }
     }
 
 
-    public String getUnitPrice() {
+    public BigDecimal getUnitPrice() {
         return unitPrice;
         return unitPrice;
     }
     }
 
 
-    public void setUnitPrice(String unitPrice) {
+    public void setUnitPrice(BigDecimal unitPrice) {
         this.unitPrice = unitPrice;
         this.unitPrice = unitPrice;
     }
     }
 
 
-    public String getCourseOriginalPrice() {
+    public BigDecimal getCourseOriginalPrice() {
         return courseOriginalPrice;
         return courseOriginalPrice;
     }
     }
 
 
-    public void setCourseOriginalPrice(String courseOriginalPrice) {
+    public void setCourseOriginalPrice(BigDecimal courseOriginalPrice) {
         this.courseOriginalPrice = courseOriginalPrice;
         this.courseOriginalPrice = courseOriginalPrice;
     }
     }
 
 
-    public String getCourseCurrentPrice() {
+    public BigDecimal getCourseCurrentPrice() {
         return courseCurrentPrice;
         return courseCurrentPrice;
     }
     }
 
 
-    public void setCourseCurrentPrice(String courseCurrentPrice) {
+    public void setCourseCurrentPrice(BigDecimal courseCurrentPrice) {
         this.courseCurrentPrice = courseCurrentPrice;
         this.courseCurrentPrice = courseCurrentPrice;
     }
     }
 
 

+ 83 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/OrganizationCourseUnitPriceSettings.java

@@ -0,0 +1,83 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
+
+/**
+ * 对应数据库表(organization_course_unit_price_settings):
+ */
+public class OrganizationCourseUnitPriceSettings {
+
+	/**  */
+	private Integer id;
+	
+	/**  */
+	private Integer organId;
+	
+	/** 课程类型 */
+	private CourseScheduleType courseType;
+	
+	/** 单价的json串(key-乐团模式,value-单价) */
+	private String unitPriceJson;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setOrganId(Integer organId){
+		this.organId = organId;
+	}
+	
+	public Integer getOrganId(){
+		return this.organId;
+	}
+			
+	public CourseScheduleType getCourseType() {
+		return courseType;
+	}
+
+	public void setCourseType(CourseScheduleType courseType) {
+		this.courseType = courseType;
+	}
+
+	public void setUnitPriceJson(String unitPriceJson){
+		this.unitPriceJson = unitPriceJson;
+	}
+	
+	public String getUnitPriceJson(){
+		return this.unitPriceJson;
+	}
+			
+	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);
+	}
+
+}

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

+ 31 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/OrganizationCourseUnitPriceSettingsQueryInfo.java

@@ -0,0 +1,31 @@
+package com.ym.mec.biz.dal.page;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
+import com.ym.mec.common.page.QueryInfo;
+
+public class OrganizationCourseUnitPriceSettingsQueryInfo extends QueryInfo {
+
+	@ApiModelProperty(value = "分部编号", required = false)
+	private Integer organId;
+	
+	@ApiModelProperty(value = "课程类型", required = false)
+	private CourseScheduleType courseScheduleType;
+
+	public Integer getOrganId() {
+		return organId;
+	}
+
+	public void setOrganId(Integer organId) {
+		this.organId = organId;
+	}
+
+	public CourseScheduleType getCourseScheduleType() {
+		return courseScheduleType;
+	}
+
+	public void setCourseScheduleType(CourseScheduleType courseScheduleType) {
+		this.courseScheduleType = courseScheduleType;
+	}
+}

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

@@ -1,8 +1,15 @@
 package com.ym.mec.biz.service;
 package com.ym.mec.biz.service;
 
 
+import java.util.List;
+
 import com.ym.mec.biz.dal.entity.ChargeTypeSubjectMapper;
 import com.ym.mec.biz.dal.entity.ChargeTypeSubjectMapper;
 import com.ym.mec.common.service.BaseService;
 import com.ym.mec.common.service.BaseService;
 
 
 public interface ChargeTypeSubjectMapperService extends BaseService<Long, ChargeTypeSubjectMapper> {
 public interface ChargeTypeSubjectMapperService extends BaseService<Long, ChargeTypeSubjectMapper> {
 
 
+	boolean deleteById(Long id);
+	
+	boolean batchInsert(List<ChargeTypeSubjectMapper> chargeTypeSubjectMapperList);
+	
+	boolean batchUpdate(List<ChargeTypeSubjectMapper> chargeTypeSubjectMapperList);
 }
 }

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

@@ -2,7 +2,30 @@ package com.ym.mec.biz.service;
 
 
 import com.ym.mec.common.service.BaseService;
 import com.ym.mec.common.service.BaseService;
 import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings;
 import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings;
+
 public interface MusicGroupOrganizationCourseSettingsService extends BaseService<Integer, MusicGroupOrganizationCourseSettings> {
 public interface MusicGroupOrganizationCourseSettingsService extends BaseService<Integer, MusicGroupOrganizationCourseSettings> {
 
 
+    /**
+     * 添加收费方式设置
+     *
+     * @param setting
+     * @return
+     */
+    MusicGroupOrganizationCourseSettings addSetting(MusicGroupOrganizationCourseSettings setting);
+
+    /**
+     * 删除收费方式设置
+     *
+     * @param id
+     * @return
+     */
+    MusicGroupOrganizationCourseSettings delSetting(Integer id);
 
 
+    /**
+     * 修改收费方式设置
+     *
+     * @param setting
+     * @return
+     */
+    MusicGroupOrganizationCourseSettings updateSetting(MusicGroupOrganizationCourseSettings setting);
 }
 }

+ 16 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/OrganizationCourseUnitPriceSettingsService.java

@@ -0,0 +1,16 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.OrganizationCourseUnitPriceSettings;
+import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
+import com.ym.mec.common.service.BaseService;
+
+public interface OrganizationCourseUnitPriceSettingsService extends BaseService<Integer, OrganizationCourseUnitPriceSettings> {
+
+	/**
+	 * 根据分部编号以及课程类型查询对象
+	 * @param organId 分部编号
+	 * @param courseType 课程类型
+	 * @return
+	 */
+	OrganizationCourseUnitPriceSettings queryByOrganIdAndCourseType(Integer organId, CourseScheduleType courseType);
+}

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

@@ -1,21 +1,17 @@
 package com.ym.mec.biz.service.impl;
 package com.ym.mec.biz.service.impl;
 
 
-import com.ym.mec.biz.dal.dao.ChargeTypeSubjectMapperDao;
-import com.ym.mec.biz.dal.entity.ChargeTypeSubjectMapper;
-import com.ym.mec.common.page.PageInfo;
-import com.ym.mec.common.page.QueryInfo;
+import java.util.Date;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 
 import com.ym.mec.biz.dal.dao.ChargeTypeDao;
 import com.ym.mec.biz.dal.dao.ChargeTypeDao;
+import com.ym.mec.biz.dal.dao.ChargeTypeSubjectMapperDao;
 import com.ym.mec.biz.dal.entity.ChargeType;
 import com.ym.mec.biz.dal.entity.ChargeType;
 import com.ym.mec.biz.service.ChargeTypeService;
 import com.ym.mec.biz.service.ChargeTypeService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.Date;
-import java.util.List;
 
 
 @Service
 @Service
 public class ChargeTypeServiceImpl extends BaseServiceImpl<Integer, ChargeType>  implements ChargeTypeService {
 public class ChargeTypeServiceImpl extends BaseServiceImpl<Integer, ChargeType>  implements ChargeTypeService {
@@ -38,23 +34,15 @@ public class ChargeTypeServiceImpl extends BaseServiceImpl<Integer, ChargeType>
 			//修改
 			//修改
 			chargeType.setUpdateTime(new Date());
 			chargeType.setUpdateTime(new Date());
 			chargeTypeDao.update(chargeType);
 			chargeTypeDao.update(chargeType);
-			//删除关联的声部
-			chargeTypeSubjectMapperDao.deleteByChargeTypeId(chargeType.getId());
-			//批量插入关联的声部
-			chargeTypeSubjectMapperDao.batchAdd(chargeType.getSubjectIds(),chargeType.getId());
 		}else {
 		}else {
 			//新增
 			//新增
 			chargeTypeDao.insert(chargeType);
 			chargeTypeDao.insert(chargeType);
-			//批量插入关联的声部
-			chargeTypeSubjectMapperDao.batchAdd(chargeType.getSubjectIds(),chargeType.getId());
 		}
 		}
 	}
 	}
 
 
 	@Override
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	@Transactional(rollbackFor = Exception.class)
 	public void del(Integer chargeTypeId) {
 	public void del(Integer chargeTypeId) {
-		//删除关联的声部
-		chargeTypeSubjectMapperDao.deleteByChargeTypeId(chargeTypeId);
 		chargeTypeDao.delete(chargeTypeId);
 		chargeTypeDao.delete(chargeTypeId);
 	}
 	}
 }
 }

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ChargeTypeSubjectMapperServiceImpl.java

@@ -1,5 +1,7 @@
 package com.ym.mec.biz.service.impl;
 package com.ym.mec.biz.service.impl;
 
 
+import java.util.List;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
@@ -19,5 +21,23 @@ public class ChargeTypeSubjectMapperServiceImpl extends BaseServiceImpl<Long, Ch
 	public BaseDAO<Long, ChargeTypeSubjectMapper> getDAO() {
 	public BaseDAO<Long, ChargeTypeSubjectMapper> getDAO() {
 		return chargeTypeSubjectMapperDao;
 		return chargeTypeSubjectMapperDao;
 	}
 	}
+
+	@Override
+	public boolean deleteById(Long id) {
+		chargeTypeSubjectMapperDao.delete(id);
+		return true;
+	}
+
+	@Override
+	public boolean batchInsert(List<ChargeTypeSubjectMapper> chargeTypeSubjectMapperList) {
+		chargeTypeSubjectMapperDao.batchInsert(chargeTypeSubjectMapperList);
+		return true;
+	}
+
+	@Override
+	public boolean batchUpdate(List<ChargeTypeSubjectMapper> chargeTypeSubjectMapperList) {
+		chargeTypeSubjectMapperDao.batchUpdate(chargeTypeSubjectMapperList);
+		return true;
+	}
 	
 	
 }
 }

+ 70 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupOrganizationCourseSettingsServiceImpl.java

@@ -1,21 +1,91 @@
 package com.ym.mec.biz.service.impl;
 package com.ym.mec.biz.service.impl;
 
 
 import com.ym.mec.biz.dal.dao.MusicGroupOrganizationCourseSettingsDao;
 import com.ym.mec.biz.dal.dao.MusicGroupOrganizationCourseSettingsDao;
+import com.ym.mec.biz.dal.dao.MusicGroupOrganizationCourseSettingsDetailDao;
 import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings;
 import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings;
+import com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail;
 import com.ym.mec.biz.service.MusicGroupOrganizationCourseSettingsService;
 import com.ym.mec.biz.service.MusicGroupOrganizationCourseSettingsService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
 
 
 @Service
 @Service
 public class MusicGroupOrganizationCourseSettingsServiceImpl extends BaseServiceImpl<Integer, MusicGroupOrganizationCourseSettings> implements MusicGroupOrganizationCourseSettingsService {
 public class MusicGroupOrganizationCourseSettingsServiceImpl extends BaseServiceImpl<Integer, MusicGroupOrganizationCourseSettings> implements MusicGroupOrganizationCourseSettingsService {
     @Autowired
     @Autowired
     private MusicGroupOrganizationCourseSettingsDao musicGroupOrganizationCourseSettingsDao;
     private MusicGroupOrganizationCourseSettingsDao musicGroupOrganizationCourseSettingsDao;
+    @Autowired
+    private MusicGroupOrganizationCourseSettingsDetailDao musicGroupOrganizationCourseSettingsDetailDao;
 
 
     @Override
     @Override
     public BaseDAO<Integer, MusicGroupOrganizationCourseSettings> getDAO() {
     public BaseDAO<Integer, MusicGroupOrganizationCourseSettings> getDAO() {
         return musicGroupOrganizationCourseSettingsDao;
         return musicGroupOrganizationCourseSettingsDao;
     }
     }
 
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public MusicGroupOrganizationCourseSettings addSetting(MusicGroupOrganizationCourseSettings setting) {
+        if (setting.getDetails() == null || setting.getDetails().size() <= 0) {
+            throw new BizException("请设置对应课程的收费");
+        }
+
+        for (MusicGroupOrganizationCourseSettingsDetail detail : setting.getDetails()) {
+            if (detail.getCourseTotalMinuties() <= 0) {
+                throw new BizException(detail.getCourseType().getMsg() + "课程总时长必须大于0");
+            }
+            if (detail.getIsStudentOptional()) {
+                setting.setTotalCurrentPrice(setting.getTotalCurrentPrice().add(detail.getCourseCurrentPrice()));
+                setting.setTotalOriginalPrice(setting.getTotalOriginalPrice().add(detail.getCourseOriginalPrice()));
+            }
+        }
+        musicGroupOrganizationCourseSettingsDao.insert(setting);
+        for (MusicGroupOrganizationCourseSettingsDetail detail : setting.getDetails()) {
+            detail.setMusicGroupOrganizationCourseSettingsId(setting.getId());
+            detail.setUnitPrice(detail.getCourseCurrentPrice().divide(new BigDecimal(detail.getCourseTotalMinuties()), 2, BigDecimal.ROUND_DOWN));
+        }
+        musicGroupOrganizationCourseSettingsDetailDao.batchInsert(setting.getDetails());
+        return setting;
+    }
+
+    @Override
+    public MusicGroupOrganizationCourseSettings delSetting(Integer id) {
+        MusicGroupOrganizationCourseSettings setting = musicGroupOrganizationCourseSettingsDao.get(id);
+        if (setting == null) {
+            throw new BizException("收费方式记录不存在,请核查");
+        }
+        musicGroupOrganizationCourseSettingsDetailDao.deleteBySettingId(setting.getId());
+        musicGroupOrganizationCourseSettingsDao.delete(setting.getId());
+        return setting;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public MusicGroupOrganizationCourseSettings updateSetting(MusicGroupOrganizationCourseSettings setting) {
+        if (setting.getDetails() == null || setting.getDetails().size() <= 0) {
+            throw new BizException("请设置对应课程的收费");
+        }
+        musicGroupOrganizationCourseSettingsDetailDao.deleteBySettingId(setting.getId());
+
+        for (MusicGroupOrganizationCourseSettingsDetail detail : setting.getDetails()) {
+            if (detail.getCourseTotalMinuties() <= 0) {
+                throw new BizException(detail.getCourseType().getMsg() + "课程总时长必须大于0");
+            }
+            if (detail.getIsStudentOptional()) {
+                setting.setTotalCurrentPrice(setting.getTotalCurrentPrice().add(detail.getCourseCurrentPrice()));
+                setting.setTotalOriginalPrice(setting.getTotalOriginalPrice().add(detail.getCourseOriginalPrice()));
+            }
+        }
+        musicGroupOrganizationCourseSettingsDao.update(setting);
+        for (MusicGroupOrganizationCourseSettingsDetail detail : setting.getDetails()) {
+            detail.setId(null);
+            detail.setMusicGroupOrganizationCourseSettingsId(setting.getId());
+            detail.setUnitPrice(detail.getCourseCurrentPrice().divide(new BigDecimal(detail.getCourseTotalMinuties()), 2, BigDecimal.ROUND_DOWN));
+        }
+        musicGroupOrganizationCourseSettingsDetailDao.batchInsert(setting.getDetails());
+        return setting;
+    }
 }
 }

+ 29 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/OrganizationCourseUnitPriceSettingsServiceImpl.java

@@ -0,0 +1,29 @@
+package com.ym.mec.biz.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.biz.dal.dao.OrganizationCourseUnitPriceSettingsDao;
+import com.ym.mec.biz.dal.entity.CourseSchedule.CourseScheduleType;
+import com.ym.mec.biz.dal.entity.OrganizationCourseUnitPriceSettings;
+import com.ym.mec.biz.service.OrganizationCourseUnitPriceSettingsService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+
+@Service
+public class OrganizationCourseUnitPriceSettingsServiceImpl extends BaseServiceImpl<Integer, OrganizationCourseUnitPriceSettings>  implements OrganizationCourseUnitPriceSettingsService {
+	
+	@Autowired
+	private OrganizationCourseUnitPriceSettingsDao organizationCourseUnitPriceSettingsDao;
+
+	@Override
+	public BaseDAO<Integer, OrganizationCourseUnitPriceSettings> getDAO() {
+		return organizationCourseUnitPriceSettingsDao;
+	}
+
+	@Override
+	public OrganizationCourseUnitPriceSettings queryByOrganIdAndCourseType(Integer organId, CourseScheduleType courseType) {
+		return organizationCourseUnitPriceSettingsDao.queryByOrganIdAndCourseType(organId, courseType);
+	}
+	
+}

+ 54 - 8
mec-biz/src/main/resources/config/mybatis/ChargeTypeSubjectMapperMapper.xml

@@ -15,6 +15,7 @@
         <result column="kit_group_purchase_type_" property="kitGroupPurchaseTypeEnum" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="kit_group_purchase_type_" property="kitGroupPurchaseTypeEnum" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="deposit_fee_" property="depositFee"/>
         <result column="deposit_fee_" property="depositFee"/>
         <result column="fee_" property="fee"/>
         <result column="fee_" property="fee"/>
+        <result column="goods_discount_rate_" property="goodsDiscountRate"/>
     </resultMap>
     </resultMap>
 
 
     <!-- 根据主键查询一条记录 -->
     <!-- 根据主键查询一条记录 -->
@@ -30,17 +31,20 @@
     <!-- 向数据库增加一条记录 -->
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ChargeTypeSubjectMapper" useGeneratedKeys="true"
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.ChargeTypeSubjectMapper" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
             keyColumn="id" keyProperty="id">
-        INSERT INTO charge_type_subject_mapper (charge_type_id_,subject_id_,kit_group_purchase_type_,deposit_fee_,fee_,create_time_,update_time_)
-        VALUES(#{chargeTypeId},#{subjectId},#{kitGroupPurchaseTypeEnum,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{depositFee},#{fee},now(),now())
+        INSERT INTO charge_type_subject_mapper (charge_type_id_,subject_id_,kit_group_purchase_type_,deposit_fee_,fee_,goods_discount_rate_,create_time_,update_time_)
+        VALUES(#{chargeTypeId},#{subjectId},#{kitGroupPurchaseTypeEnum,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{depositFee},#{fee},#{goodsDiscountRate},now(),now())
     </insert>
     </insert>
-    <insert id="batchAdd">
-        INSERT INTO charge_type_subject_mapper
-        (charge_type_id_,subject_id_,create_time_,update_time_) VALUES
-        <foreach collection="subjectIds" item="item" separator=",">
-            (#{chargeTypeId},#{item},now(),now())
+
+    <!-- 向数据库增加一条记录 -->
+    <insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyColumn="id"
+            keyProperty="id">
+        INSERT INTO charge_type_subject_mapper (charge_type_id_,subject_id_,kit_group_purchase_type_,deposit_fee_,fee_,goods_discount_rate_,create_time_,update_time_)
+        VALUES
+        <foreach collection="list" item="item" separator=",">
+        (#{item.chargeTypeId},#{item.subjectId},#{item.kitGroupPurchaseTypeEnum,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.depositFee},#{item.fee},#{item.goodsDiscountRate},now(),now())
         </foreach>
         </foreach>
     </insert>
     </insert>
-
+    
     <!-- 根据主键查询一条记录 -->
     <!-- 根据主键查询一条记录 -->
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.ChargeTypeSubjectMapper">
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.ChargeTypeSubjectMapper">
         UPDATE charge_type_subject_mapper
         UPDATE charge_type_subject_mapper
@@ -51,12 +55,54 @@
             <if test="chargeTypeId != null">
             <if test="chargeTypeId != null">
                 charge_type_id_ = #{chargeTypeId},
                 charge_type_id_ = #{chargeTypeId},
             </if>
             </if>
+            <if test="kitGroupPurchaseTypeEnum != null">
+                kit_group_purchase_type_ = #{kitGroupPurchaseTypeEnum, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
+            <if test="depositFee != null">
+                deposit_fee_ = #{depositFee},
+            </if>
+            <if test="fee != null">
+                fee_ = #{fee},
+            </if>
+            <if test="goodsDiscountRate != null">
+                goods_discount_rate_ = #{goodsDiscountRate},
+            </if>
             <if test="updateTime != null">
             <if test="updateTime != null">
                 update_time_ = NOW(),
                 update_time_ = NOW(),
             </if>
             </if>
         </set>
         </set>
         WHERE id_ = #{id}
         WHERE id_ = #{id}
     </update>
     </update>
+    
+    <update id="batchUpdate" parameterType="java.util.List">
+        <foreach collection="list" item="item" index="index" open="" close="" separator=";">
+        UPDATE charge_type_subject_mapper
+        <set>
+            <if test="item.subjectId != null">
+                subject_id_ = #{item.subjectId},
+            </if>
+            <if test="item.chargeTypeId != null">
+                charge_type_id_ = #{item.chargeTypeId},
+            </if>
+            <if test="item.kitGroupPurchaseTypeEnum != null">
+                kit_group_purchase_type_ = #{item.kitGroupPurchaseTypeEnum, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
+            <if test="item.depositFee != null">
+                deposit_fee_ = #{item.depositFee},
+            </if>
+            <if test="item.fee != null">
+                fee_ = #{item.fee},
+            </if>
+            <if test="item.goodsDiscountRate != null">
+                goods_discount_rate_ = #{item.goodsDiscountRate},
+            </if>
+            <if test="item.updateTime != null">
+                update_time_ = NOW(),
+            </if>
+        </set>
+            WHERE id_ = #{item.id}
+        </foreach>
+    </update>
 
 
     <!-- 根据主键删除一条记录 -->
     <!-- 根据主键删除一条记录 -->
     <delete id="delete">
     <delete id="delete">

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

@@ -1,90 +1,115 @@
 <?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.MusicGroupOrganizationCourseSettingsDetailDao">
 <mapper namespace="com.ym.mec.biz.dal.dao.MusicGroupOrganizationCourseSettingsDetailDao">
-  <resultMap id="MusicGroupOrganizationCourseSettingsDetail" type="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail">
-    <!--@mbg.generated-->
-    <!--@Table music_group_organization_course_settings_detail-->
-    <id column="id_" property="id" />
-    <result column="music_group_organization_course_settings_id_" property="musicGroupOrganizationCourseSettingsId" />
-    <result column="course_type_" property="courseType" />
-    <result column="course_total_minuties_" property="courseTotalMinuties" />
-    <result column="unit_price_" property="unitPrice" />
-    <result column="course_original_price_" property="courseOriginalPrice" />
-    <result column="course_current_price_" property="courseCurrentPrice" />
-    <result column="is_student_optional_" property="isStudentOptional" />
-    <result column="create_time_" property="createTime" />
-    <result column="update_time_" property="updateTime" />
-  </resultMap>
-  <sql id="Base_Column_List">
-    <!--@mbg.generated-->
-    id_, music_group_organization_course_settings_id_, course_type_, course_total_minuties_, 
-    unit_price_, course_original_price_, course_current_price_, is_student_optional_, 
-    create_time_, update_time_
-  </sql>
-  <select id="get" parameterType="java.lang.Integer" resultMap="MusicGroupOrganizationCourseSettingsDetail">
-    <!--@mbg.generated-->
-    select 
-    <include refid="Base_Column_List" />
-    from music_group_organization_course_settings_detail
-    where id_ = #{id}
-  </select>
-  <delete id="delete" parameterType="java.lang.Integer">
-    <!--@mbg.generated-->
-    delete from music_group_organization_course_settings_detail
-    where id_ = #{id}
-  </delete>
-  <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail" useGeneratedKeys="true">
-    <!--@mbg.generated-->
-    insert into music_group_organization_course_settings_detail (music_group_organization_course_settings_id_, course_type_, course_total_minuties_, 
-      unit_price_, course_original_price_, course_current_price_, is_student_optional_, 
-      create_time_, update_time_)
-    values (#{musicGroupOrganizationCourseSettingsId}, #{courseType}, #{courseTotalMinuties}, 
-      #{unitPrice}, #{courseOriginalPrice}, #{courseCurrentPrice}, #{isStudentOptional}, 
-      #{createTime}, #{updateTime})
-  </insert>
-  <update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail">
-    <!--@mbg.generated-->
-    update music_group_organization_course_settings_detail
-    <set>
-      <if test="musicGroupOrganizationCourseSettingsId != null">
-        music_group_organization_course_settings_id_ = #{musicGroupOrganizationCourseSettingsId},
-      </if>
-      <if test="courseType != null">
-        course_type_ = #{courseType},
-      </if>
-      <if test="courseTotalMinuties != null">
-        course_total_minuties_ = #{courseTotalMinuties},
-      </if>
-      <if test="unitPrice != null">
-        unit_price_ = #{unitPrice},
-      </if>
-      <if test="courseOriginalPrice != null">
-        course_original_price_ = #{courseOriginalPrice},
-      </if>
-      <if test="courseCurrentPrice != null">
-        course_current_price_ = #{courseCurrentPrice},
-      </if>
-      <if test="isStudentOptional != null">
-        is_student_optional_ = #{isStudentOptional},
-      </if>
-      <if test="createTime != null">
-        create_time_ = #{createTime},
-      </if>
-      <if test="updateTime != null">
-        update_time_ = #{updateTime},
-      </if>
-    </set>
-    where id_ = #{id}
-  </update>
+    <resultMap id="MusicGroupOrganizationCourseSettingsDetail"
+               type="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail">
+        <!--@mbg.generated-->
+        <!--@Table music_group_organization_course_settings_detail-->
+        <id column="id_" property="id"/>
+        <result column="music_group_organization_course_settings_id_"
+                property="musicGroupOrganizationCourseSettingsId"/>
+        <result column="course_type_" property="courseType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="course_total_minuties_" property="courseTotalMinuties"/>
+        <result column="unit_price_" property="unitPrice"/>
+        <result column="course_original_price_" property="courseOriginalPrice"/>
+        <result column="course_current_price_" property="courseCurrentPrice"/>
+        <result column="is_student_optional_" property="isStudentOptional"/>
+        <result column="create_time_" property="createTime"/>
+        <result column="update_time_" property="updateTime"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
+        id_, music_group_organization_course_settings_id_, course_type_, course_total_minuties_,
+        unit_price_, course_original_price_, course_current_price_, is_student_optional_,
+        create_time_, update_time_
+    </sql>
+    <select id="get" parameterType="java.lang.Integer" resultMap="MusicGroupOrganizationCourseSettingsDetail">
+        <!--@mbg.generated-->
+        select
+        <include refid="Base_Column_List"/>
+        from music_group_organization_course_settings_detail
+        where id_ = #{id}
+    </select>
+    <delete id="delete" parameterType="java.lang.Integer">
+        <!--@mbg.generated-->
+        delete from music_group_organization_course_settings_detail
+        where id_ = #{id}
+    </delete>
+    <insert id="insert" keyColumn="id_" keyProperty="id"
+            parameterType="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail"
+            useGeneratedKeys="true">
+        <!--@mbg.generated-->
+        insert into music_group_organization_course_settings_detail (music_group_organization_course_settings_id_,
+        course_type_, course_total_minuties_,
+        unit_price_, course_original_price_, course_current_price_, is_student_optional_,
+        create_time_, update_time_)
+        values (#{musicGroupOrganizationCourseSettingsId}, #{courseType}, #{courseTotalMinuties},
+        #{unitPrice}, #{courseOriginalPrice}, #{courseCurrentPrice}, #{isStudentOptional},
+        NOW(),NOW())
+    </insert>
+    <update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail">
+        <!--@mbg.generated-->
+        update music_group_organization_course_settings_detail
+        <set>
+            <if test="musicGroupOrganizationCourseSettingsId != null">
+                music_group_organization_course_settings_id_ = #{musicGroupOrganizationCourseSettingsId},
+            </if>
+            <if test="courseType != null">
+                course_type_ = #{courseType},
+            </if>
+            <if test="courseTotalMinuties != null">
+                course_total_minuties_ = #{courseTotalMinuties},
+            </if>
+            <if test="unitPrice != null">
+                unit_price_ = #{unitPrice},
+            </if>
+            <if test="courseOriginalPrice != null">
+                course_original_price_ = #{courseOriginalPrice},
+            </if>
+            <if test="courseCurrentPrice != null">
+                course_current_price_ = #{courseCurrentPrice},
+            </if>
+            <if test="isStudentOptional != null">
+                is_student_optional_ = #{isStudentOptional},
+            </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="MusicGroupOrganizationCourseSettingsDetail" parameterType="map">
-    SELECT * FROM music_group_organization_course_settings_detail ORDER BY id_
-    <include refid="global.limit" />
-  </select>
+    <insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id_">
+        insert into music_group_organization_course_settings_detail (music_group_organization_course_settings_id_,
+        course_type_, course_total_minuties_,
+        unit_price_, course_original_price_, course_current_price_, is_student_optional_,
+        create_time_, update_time_)
+        VALUE
+        <foreach collection="settingDetails" separator="," item="settingDetail">
+            (#{settingDetail.musicGroupOrganizationCourseSettingsId}, #{settingDetail.courseType},
+            #{settingDetail.courseTotalMinuties},
+            #{settingDetail.unitPrice}, #{settingDetail.courseOriginalPrice}, #{settingDetail.courseCurrentPrice},
+            #{settingDetail.isStudentOptional},
+            NOW(),NOW())
+        </foreach>
+    </insert>
 
 
-  <!-- 查询当前表的总记录数 -->
-  <select id="queryCount" resultType="int">
-    SELECT COUNT(*) FROM music_group_organization_course_settings_detail
-  </select>
+    <!-- 分页查询 -->
+    <select id="queryPage" resultMap="MusicGroupOrganizationCourseSettingsDetail" parameterType="map">
+        SELECT * FROM music_group_organization_course_settings_detail ORDER BY id_
+        <include refid="global.limit"/>
+    </select>
+
+    <!-- 查询当前表的总记录数 -->
+    <select id="queryCount" resultType="int">
+        SELECT COUNT(*)
+        FROM music_group_organization_course_settings_detail
+    </select>
+
+    <delete id="deleteBySettingId" parameterType="java.lang.Integer">
+        DELETE FROM music_group_organization_course_settings_detail WHERE music_group_organization_course_settings_id_ = #{settingId}
+    </delete>
 </mapper>
 </mapper>

+ 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},
+        NOW(),NOW())
+    </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>

+ 96 - 0
mec-biz/src/main/resources/config/mybatis/OrganizationCourseUnitPriceSettingsMapper.xml

@@ -0,0 +1,96 @@
+<?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.OrganizationCourseUnitPriceSettingsDao">
+
+	<resultMap type="com.ym.mec.biz.dal.entity.OrganizationCourseUnitPriceSettings" id="OrganizationCourseUnitPriceSettings">
+		<result column="id_" property="id" />
+		<result column="organ_id_" property="organId" />
+		<result column="course_type_" property="courseType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler" />
+		<result column="unit_price_json_" property="unitPriceJson" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="OrganizationCourseUnitPriceSettings">
+		SELECT * FROM organization_course_unit_price_settings WHERE id_ = #{id}
+	</select>
+
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="OrganizationCourseUnitPriceSettings">
+		SELECT * FROM organization_course_unit_price_settings ORDER BY id_
+	</select>
+
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.OrganizationCourseUnitPriceSettings" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
+			AS ID FROM DUAL </selectKey> -->
+		INSERT INTO organization_course_unit_price_settings
+		(id_,organ_id_,course_type_,unit_price_json_,create_time_,update_time_)
+		VALUES(#{id},#{organId},#{courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{unitPriceJson},#{createTime},#{updateTime})
+	</insert>
+
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.OrganizationCourseUnitPriceSettings">
+		UPDATE organization_course_unit_price_settings
+		<set>
+			<if test="organId != null">
+				organ_id_ = #{organId},
+			</if>
+			<if test="id != null">
+				id_ = #{id},
+			</if>
+			<if test="updateTime != null">
+				update_time_ = #{updateTime},
+			</if>
+			<if test="courseType != null">
+				course_type_ = #{courseType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+			</if>
+			<if test="unitPriceJson != null">
+				unit_price_json_ = #{unitPriceJson},
+			</if>
+			<if test="createTime != null">
+				create_time_ = #{createTime},
+			</if>
+		</set>
+		WHERE id_ = #{id}
+	</update>
+
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete">
+		DELETE FROM organization_course_unit_price_settings WHERE id_ = #{id}
+	</delete>
+
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="OrganizationCourseUnitPriceSettings" parameterType="map">
+		SELECT * FROM organization_course_unit_price_settings 
+		<where>
+			<if test="organId != null">
+				and organ_id_ = #{organId}
+			</if>
+			<if test="courseScheduleType != null">
+				and course_type_ = #{courseScheduleType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+			</if>
+		</where>
+		ORDER BY id_
+		<include refid="global.limit" />
+	</select>
+
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM organization_course_unit_price_settings
+		<where>
+			<if test="organId != null">
+				and organ_id_ = #{organId}
+			</if>
+			<if test="courseScheduleType != null">
+				and course_type_ = #{courseScheduleType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+			</if>
+		</where>
+	</select>
+	
+	<select id="queryByOrganIdAndCourseType" resultMap="OrganizationCourseUnitPriceSettings" parameterType="map">
+		SELECT * FROM organization_course_unit_price_settings WHERE organ_id_ = #{organId} and course_type_ = #{courseScheduleType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+	</select>
+</mapper>

+ 63 - 0
mec-web/src/main/java/com/ym/mec/web/controller/ChargeTypeSubjectMapperController.java

@@ -0,0 +1,63 @@
+package com.ym.mec.web.controller;
+
+import java.util.List;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.ym.mec.biz.dal.entity.ChargeTypeSubjectMapper;
+import com.ym.mec.biz.service.ChargeTypeSubjectMapperService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.page.QueryInfo;
+
+@RequestMapping("chargeTypeSubjectMapper")
+@Api(tags = "收费类型与科目的关联服务")
+@RestController
+public class ChargeTypeSubjectMapperController extends BaseController {
+
+    @Autowired
+    private ChargeTypeSubjectMapperService chargeTypeSubjectMapperService;
+
+    @ApiOperation(value = "分页查询收费类型列表")
+    @GetMapping(value = "/queryPage", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+    @PreAuthorize("@pcs.hasPermissions('chargeTypeSubjectMapper/queryPage')")
+    public Object queryPage(QueryInfo queryInfo) {
+        return succeed();
+    }
+
+    @ApiOperation(value = "新增对象")
+	@PostMapping(value = "/insert", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+    @PreAuthorize("@pcs.hasPermissions('chargeTypeSubjectMapper/insert')")
+    public Object insert(@RequestBody List<ChargeTypeSubjectMapper> chargeTypeSubjectMapperList) {
+    	chargeTypeSubjectMapperService.batchInsert(chargeTypeSubjectMapperList);
+        return succeed();
+    }
+
+    @ApiOperation(value = "修改对象")
+	@PostMapping(value = "/update", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+    @PreAuthorize("@pcs.hasPermissions('chargeTypeSubjectMapper/update')")
+    public Object update(@RequestBody List<ChargeTypeSubjectMapper> chargeTypeSubjectMapperList) {
+    	chargeTypeSubjectMapperService.batchUpdate(chargeTypeSubjectMapperList);
+        return succeed();
+    }
+
+    @ApiOperation(value = "删除收费类型")
+    @PostMapping("/del/{id}")
+    @PreAuthorize("@pcs.hasPermissions('chargeTypeSubjectMapper/del')")
+    public Object del(@ApiParam(value = "收费类型编号", required = true) @PathVariable("id") Long id) {
+    	chargeTypeSubjectMapperService.deleteById(id);
+        return succeed();
+    }
+
+}

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

@@ -0,0 +1,50 @@
+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.*;
+
+@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));
+    }
+
+    @ApiOperation(value = "收费方式添加")
+    @PostMapping("/add")
+    @PreAuthorize("@pcs.hasPermissions('musicGroupOrganizationCourseSettings/add')")
+    public HttpResponseResult<MusicGroupOrganizationCourseSettings> add(@RequestBody MusicGroupOrganizationCourseSettings musicGroupOrganizationCourseSettings) {
+        return succeed(musicGroupOrganizationCourseSettingsService.addSetting(musicGroupOrganizationCourseSettings));
+    }
+
+    @ApiOperation(value = "删除收费方式设置")
+    @PostMapping("/delSetting")
+    @PreAuthorize("@pcs.hasPermissions('musicGroupOrganizationCourseSettings/delSetting')")
+    public HttpResponseResult<MusicGroupOrganizationCourseSettings> delSetting(Integer id) {
+        return succeed(musicGroupOrganizationCourseSettingsService.delSetting(id));
+    }
+
+    @ApiOperation(value = "修改收费方式")
+    @PostMapping("/update")
+    @PreAuthorize("@pcs.hasPermissions('musicGroupOrganizationCourseSettings/update')")
+    public HttpResponseResult<MusicGroupOrganizationCourseSettings> update(@RequestBody MusicGroupOrganizationCourseSettings musicGroupOrganizationCourseSettings) {
+        return succeed(musicGroupOrganizationCourseSettingsService.updateSetting(musicGroupOrganizationCourseSettings));
+    }
+}

+ 66 - 0
mec-web/src/main/java/com/ym/mec/web/controller/OrganizationCourseUnitPriceSettingsController.java

@@ -0,0 +1,66 @@
+package com.ym.mec.web.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.ym.mec.biz.dal.entity.OrganizationCourseUnitPriceSettings;
+import com.ym.mec.biz.dal.page.OrganizationCourseUnitPriceSettingsQueryInfo;
+import com.ym.mec.biz.service.OrganizationCourseUnitPriceSettingsService;
+import com.ym.mec.common.controller.BaseController;
+
+@RequestMapping("organizationCourseUnitPriceSettings")
+@Api(tags = "分部课程单价设置服务")
+@RestController
+public class OrganizationCourseUnitPriceSettingsController extends BaseController {
+
+	@Autowired
+	private OrganizationCourseUnitPriceSettingsService organizationCourseUnitPriceSettingsService;
+
+	@ApiOperation(value = "分页查询列表")
+	@GetMapping(value = "/queryPage", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@PreAuthorize("@pcs.hasPermissions('organizationCourseUnitPriceSettings/queryPage')")
+	public Object queryPage(OrganizationCourseUnitPriceSettingsQueryInfo queryInfo) {
+		return succeed();
+	}
+
+	@ApiOperation(value = "新增对象")
+	@PostMapping(value = "/insert", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@PreAuthorize("@pcs.hasPermissions('organizationCourseUnitPriceSettings/update')")
+	public Object insert(@RequestBody OrganizationCourseUnitPriceSettings organizationCourseUnitPriceSettings) {
+		OrganizationCourseUnitPriceSettings originalObj = organizationCourseUnitPriceSettingsService.queryByOrganIdAndCourseType(
+				organizationCourseUnitPriceSettings.getOrganId(), organizationCourseUnitPriceSettings.getCourseType());
+		if (originalObj != null) {
+			return failed("当前分部已经存在该课程类型的单价");
+		}
+		organizationCourseUnitPriceSettingsService.insert(organizationCourseUnitPriceSettings);
+		return succeed();
+	}
+
+	@ApiOperation(value = "修改对象")
+	@PostMapping(value = "/update", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@PreAuthorize("@pcs.hasPermissions('organizationCourseUnitPriceSettings/update')")
+	public Object update(@RequestBody OrganizationCourseUnitPriceSettings organizationCourseUnitPriceSettings) {
+		organizationCourseUnitPriceSettingsService.update(organizationCourseUnitPriceSettings);
+		return succeed();
+	}
+
+	@ApiOperation(value = "删除收费类型")
+	@PostMapping("/del/{id}")
+	@PreAuthorize("@pcs.hasPermissions('organizationCourseUnitPriceSettings/del')")
+	public Object del(@ApiParam(value = "编号", required = true) @PathVariable("id") Integer id) {
+		organizationCourseUnitPriceSettingsService.delete(id);
+		return succeed();
+	}
+
+}