浏览代码

系统收费

zouxuan 4 年之前
父节点
当前提交
ed426883ef
共有 19 个文件被更改,包括 374 次插入139 次删除
  1. 3 3
      codegen/src/main/resources/generateConfigration.xml
  2. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MemberFeeSettingDao.java
  3. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MemberPrivilegesItemDao.java
  4. 3 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MemberRankOrganizationFeeMapperDao.java
  5. 114 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MemberFeeSetting.java
  6. 10 44
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MemberPrivilegesItem.java
  7. 12 46
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MemberRankOrganizationFeeMapper.java
  8. 8 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MemberFeeSettingService.java
  9. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MemberPrivilegesItemService.java
  10. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/service/MemberRankOrganizationFeeMapperService.java
  11. 22 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MemberFeeSettingServiceImpl.java
  12. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MemberPrivilegesItemServiceImpl.java
  13. 32 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MemberRankOrganizationFeeMapperServiceImpl.java
  14. 85 0
      mec-biz/src/main/resources/config/mybatis/MemberFeeSettingMapper.xml
  15. 16 24
      mec-biz/src/main/resources/config/mybatis/MemberPrivilegesItemMapper.xml
  16. 15 19
      mec-biz/src/main/resources/config/mybatis/MemberRankOrganizationFeeMapperMapper.xml
  17. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/MemberPrivilegesItemController.java
  18. 19 0
      mec-web/src/main/java/com/ym/mec/web/controller/MemberRankOrganizationFeeMapperController.java
  19. 9 0
      mec-web/src/main/java/com/ym/mec/web/controller/MemberRankSettingController.java

+ 3 - 3
codegen/src/main/resources/generateConfigration.xml

@@ -2,11 +2,11 @@
 <GenerateConfiguration>
 	<dbConfiguration>
 		<driverClass>com.mysql.jdbc.Driver</driverClass>
-		<url>jdbc:mysql://47.114.1.200:3306/mec_dev</url>
+		<url>jdbc:mysql://47.114.1.200:3306/mec_test</url>
 		<username>mec_dev</username>
 		<password>dayaDataOnline@2019</password>
-		<catalog>mec_dev</catalog>
-		<schema>mec_dev</schema>
+		<catalog>mec_test</catalog>
+		<schema>mec_test</schema>
 	</dbConfiguration>
 	<srcBase>/Users/chenxiaoyu/Documents/javabean</srcBase>
 	<pojoPackageName>com.ym.mec.biz.dal.entity</pojoPackageName>

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

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

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MemberPrivilegesItemDao.java

@@ -16,4 +16,6 @@ public interface MemberPrivilegesItemDao extends BaseDAO<Integer, MemberPrivileg
     List<MemberPrivilegesItem> findList(Integer parentId);
 
     void batchDel(List<Integer> collect);
+
+    void updateFeeAsNull(Integer id);
 }

+ 3 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MemberRankOrganizationFeeMapperDao.java

@@ -2,8 +2,10 @@ package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.biz.dal.entity.MemberRankOrganizationFeeMapper;
+import org.apache.ibatis.annotations.Param;
 
 public interface MemberRankOrganizationFeeMapperDao extends BaseDAO<Integer, MemberRankOrganizationFeeMapper> {
 
-	
+
+    MemberRankOrganizationFeeMapper findByOrganIdAndRankId(@Param("organId") Integer organId, @Param("memberRankSettingId") Integer memberRankSettingId);
 }

+ 114 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MemberFeeSetting.java

@@ -0,0 +1,114 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(member_fee_setting):
+ */
+public class MemberFeeSetting {
+
+	/**  */
+	private Integer id;
+	
+	/**  */
+	private java.math.BigDecimal currentDayFee;
+	
+	/**  */
+	private java.math.BigDecimal originalDayFee;
+	
+	/**  */
+	private java.math.BigDecimal currentMonthFee;
+	
+	/**  */
+	private java.math.BigDecimal originalMonthFee;
+	
+	/**  */
+	private java.math.BigDecimal currentHalfYearFee;
+	
+	/**  */
+	private java.math.BigDecimal originalHalfYearFee;
+	
+	/**  */
+	private java.math.BigDecimal currentYearFee;
+	
+	/**  */
+	private java.math.BigDecimal originalYearFee;
+	
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setCurrentDayFee(java.math.BigDecimal currentDayFee){
+		this.currentDayFee = currentDayFee;
+	}
+	
+	public java.math.BigDecimal getCurrentDayFee(){
+		return this.currentDayFee;
+	}
+			
+	public void setOriginalDayFee(java.math.BigDecimal originalDayFee){
+		this.originalDayFee = originalDayFee;
+	}
+	
+	public java.math.BigDecimal getOriginalDayFee(){
+		return this.originalDayFee;
+	}
+			
+	public void setCurrentMonthFee(java.math.BigDecimal currentMonthFee){
+		this.currentMonthFee = currentMonthFee;
+	}
+	
+	public java.math.BigDecimal getCurrentMonthFee(){
+		return this.currentMonthFee;
+	}
+			
+	public void setOriginalMonthFee(java.math.BigDecimal originalMonthFee){
+		this.originalMonthFee = originalMonthFee;
+	}
+	
+	public java.math.BigDecimal getOriginalMonthFee(){
+		return this.originalMonthFee;
+	}
+			
+	public void setCurrentHalfYearFee(java.math.BigDecimal currentHalfYearFee){
+		this.currentHalfYearFee = currentHalfYearFee;
+	}
+	
+	public java.math.BigDecimal getCurrentHalfYearFee(){
+		return this.currentHalfYearFee;
+	}
+			
+	public void setOriginalHalfYearFee(java.math.BigDecimal originalHalfYearFee){
+		this.originalHalfYearFee = originalHalfYearFee;
+	}
+	
+	public java.math.BigDecimal getOriginalHalfYearFee(){
+		return this.originalHalfYearFee;
+	}
+			
+	public void setCurrentYearFee(java.math.BigDecimal currentYearFee){
+		this.currentYearFee = currentYearFee;
+	}
+	
+	public java.math.BigDecimal getCurrentYearFee(){
+		return this.currentYearFee;
+	}
+			
+	public void setOriginalYearFee(java.math.BigDecimal originalYearFee){
+		this.originalYearFee = originalYearFee;
+	}
+	
+	public java.math.BigDecimal getOriginalYearFee(){
+		return this.originalYearFee;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 10 - 44
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MemberPrivilegesItem.java

@@ -23,18 +23,8 @@ public class MemberPrivilegesItem {
 	
 	/**  */
 	private Integer parentId = 0;
-	
-	/** 按日收费,json格式,包含原价、现价 */
-	private String dayFee;
-	
-	/** 按月收费,json格式,包含原价、现价 */
-	private String monthFee;
-	
-	/** 按半年收费,json格式,包含原价、现价 */
-	private String halfYearFee;
-	
-	/** 按年收费,json格式,包含原价、现价 */
-	private String yearFee;
+
+	private Integer memberFeeSettingId;
 	
 	/**  */
 	private java.util.Date createTime;
@@ -44,6 +34,14 @@ public class MemberPrivilegesItem {
 
 	private List<MemberPrivilegesItem> memberPrivilegesItems;
 
+	public Integer getMemberFeeSettingId() {
+		return memberFeeSettingId;
+	}
+
+	public void setMemberFeeSettingId(Integer memberFeeSettingId) {
+		this.memberFeeSettingId = memberFeeSettingId;
+	}
+
 	public List<MemberPrivilegesItem> getMemberPrivilegesItems() {
 		return memberPrivilegesItems;
 	}
@@ -92,38 +90,6 @@ public class MemberPrivilegesItem {
 		return this.parentId;
 	}
 			
-	public void setDayFee(String dayFee){
-		this.dayFee = dayFee;
-	}
-	
-	public String getDayFee(){
-		return this.dayFee;
-	}
-			
-	public void setMonthFee(String monthFee){
-		this.monthFee = monthFee;
-	}
-	
-	public String getMonthFee(){
-		return this.monthFee;
-	}
-			
-	public void setHalfYearFee(String halfYearFee){
-		this.halfYearFee = halfYearFee;
-	}
-	
-	public String getHalfYearFee(){
-		return this.halfYearFee;
-	}
-			
-	public void setYearFee(String yearFee){
-		this.yearFee = yearFee;
-	}
-	
-	public String getYearFee(){
-		return this.yearFee;
-	}
-			
 	public void setCreateTime(java.util.Date createTime){
 		this.createTime = createTime;
 	}

+ 12 - 46
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/MemberRankOrganizationFeeMapper.java

@@ -15,19 +15,7 @@ public class MemberRankOrganizationFeeMapper {
 	
 	/**  */
 	private Integer memberRankSettingId;
-	
-	/**  */
-	private String dayFee;
-	
-	/**  */
-	private String monthFee;
-	
-	/**  */
-	private String halfYearFee;
-	
-	/**  */
-	private String yearFee;
-	
+
 	/**  */
 	private Integer operatorId;
 	
@@ -41,6 +29,16 @@ public class MemberRankOrganizationFeeMapper {
 
 	private String organName;
 
+	private Integer memberFeeSettingId;
+
+	public Integer getMemberFeeSettingId() {
+		return memberFeeSettingId;
+	}
+
+	public void setMemberFeeSettingId(Integer memberFeeSettingId) {
+		this.memberFeeSettingId = memberFeeSettingId;
+	}
+
 	public String getRankName() {
 		return rankName;
 	}
@@ -80,39 +78,7 @@ public class MemberRankOrganizationFeeMapper {
 	public Integer getMemberRankSettingId(){
 		return this.memberRankSettingId;
 	}
-			
-	public void setDayFee(String dayFee){
-		this.dayFee = dayFee;
-	}
-	
-	public String getDayFee(){
-		return this.dayFee;
-	}
-			
-	public void setMonthFee(String monthFee){
-		this.monthFee = monthFee;
-	}
-	
-	public String getMonthFee(){
-		return this.monthFee;
-	}
-			
-	public void setHalfYearFee(String halfYearFee){
-		this.halfYearFee = halfYearFee;
-	}
-	
-	public String getHalfYearFee(){
-		return this.halfYearFee;
-	}
-			
-	public void setYearFee(String yearFee){
-		this.yearFee = yearFee;
-	}
-	
-	public String getYearFee(){
-		return this.yearFee;
-	}
-			
+
 	public void setOperatorId(Integer operatorId){
 		this.operatorId = operatorId;
 	}

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/MemberFeeSettingService.java

@@ -0,0 +1,8 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.MemberFeeSetting;
+import com.ym.mec.common.service.BaseService;
+
+public interface MemberFeeSettingService extends BaseService<Integer, MemberFeeSetting> {
+
+}

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

@@ -10,4 +10,6 @@ public interface MemberPrivilegesItemService extends BaseService<Integer, Member
     void recursiveDel(Integer id);
 
     PageInfo<MemberPrivilegesItem> queryItemPage(MemberPrivilegesItemQueryInfo queryInfo);
+
+    void add(MemberPrivilegesItem memberPrivilegesItem);
 }

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

@@ -6,4 +6,6 @@ import com.ym.mec.common.service.BaseService;
 public interface MemberRankOrganizationFeeMapperService extends BaseService<Integer,MemberRankOrganizationFeeMapper>{
 
     void add(MemberRankOrganizationFeeMapper memberRankOrganizationFeeMapper);
+
+    Object getMemberDefaultFee(Integer rankId);
 }

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MemberFeeSettingServiceImpl.java

@@ -0,0 +1,22 @@
+package com.ym.mec.biz.service.impl;
+
+import com.ym.mec.common.dal.BaseDAO;
+import org.springframework.beans.factory.annotation.Autowired;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.biz.dal.entity.MemberFeeSetting;
+import com.ym.mec.biz.service.MemberFeeSettingService;
+import com.ym.mec.biz.dal.dao.MemberFeeSettingDao;
+import org.springframework.stereotype.Service;
+
+@Service
+public class MemberFeeSettingServiceImpl extends BaseServiceImpl<Integer, MemberFeeSetting>  implements MemberFeeSettingService {
+	
+	@Autowired
+	private MemberFeeSettingDao memberFeeSettingDao;
+
+	@Override
+	public BaseDAO<Integer, MemberFeeSetting> getDAO() {
+		return memberFeeSettingDao;
+	}
+	
+}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MemberPrivilegesItemServiceImpl.java

@@ -64,4 +64,14 @@ public class MemberPrivilegesItemServiceImpl extends BaseServiceImpl<Integer, Me
 		}
 		return memberPrivilegesItemPageInfo;
 	}
+
+    @Override
+	@Transactional(rollbackFor = Exception.class)
+    public void add(MemberPrivilegesItem memberPrivilegesItem) {
+		memberPrivilegesItemDao.insert(memberPrivilegesItem);
+        //将父级金额设置为空
+		if(memberPrivilegesItem.getParentId() != null){
+			memberPrivilegesItemDao.updateFeeAsNull(memberPrivilegesItem.getParentId());
+		}
+    }
 }

+ 32 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MemberRankOrganizationFeeMapperServiceImpl.java

@@ -1,18 +1,27 @@
 package com.ym.mec.biz.service.impl;
 
 import com.ym.mec.biz.dal.dao.MemberRankOrganizationFeeMapperDao;
+import com.ym.mec.biz.dal.entity.MemberPrivilegesItem;
 import com.ym.mec.biz.dal.entity.MemberRankOrganizationFeeMapper;
+import com.ym.mec.biz.service.MemberPrivilegesItemService;
 import com.ym.mec.biz.service.MemberRankOrganizationFeeMapperService;
 import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 @Service
 public class MemberRankOrganizationFeeMapperServiceImpl extends BaseServiceImpl<Integer, MemberRankOrganizationFeeMapper>  implements MemberRankOrganizationFeeMapperService {
 
 	@Autowired
 	private MemberRankOrganizationFeeMapperDao memberRankOrganizationFeeMapperDao;
+	@Autowired
+	private MemberPrivilegesItemService memberPrivilegesItemService;
 
 	@Override
 	public BaseDAO<Integer, MemberRankOrganizationFeeMapper> getDAO() {
@@ -21,6 +30,28 @@ public class MemberRankOrganizationFeeMapperServiceImpl extends BaseServiceImpl<
 
     @Override
     public void add(MemberRankOrganizationFeeMapper memberRankOrganizationFeeMapper) {
-
+		//一个分部只能关联一个会员
+		MemberRankOrganizationFeeMapper feeMapper = memberRankOrganizationFeeMapperDao.findByOrganIdAndRankId(memberRankOrganizationFeeMapper.getOrganId(),memberRankOrganizationFeeMapper.getMemberRankSettingId());
+		if(feeMapper != null){
+			throw new BizException("操作失败: 该分部会员收费标准已存在");
+		}
+		memberRankOrganizationFeeMapperDao.insert(memberRankOrganizationFeeMapper);
     }
+
+	@Override
+	public Object getMemberDefaultFee(Integer rankId) {
+//		MemberPrivilegesItem privilegesItem = memberPrivilegesItemService.get(rankId);
+//		获取当前会员最后一级特权项
+//		Map<String,Object> param = new HashMap<>(1);
+//		param.put("organId",organId);
+//		List<MemberRankOrganizationFeeMapper> all = memberRankOrganizationFeeMapperDao.findAll(param);
+//		if(all != null && all.size() > 0){
+//
+//			获取会员默认收费
+//			all.forEach(e->{
+//
+//			});
+//		}
+		return null;
+	}
 }

+ 85 - 0
mec-biz/src/main/resources/config/mybatis/MemberFeeSettingMapper.xml

@@ -0,0 +1,85 @@
+<?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.MemberFeeSettingDao">
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.MemberFeeSetting" id="MemberFeeSetting">
+		<result column="id_" property="id" />
+		<result column="current_day_fee_" property="currentDayFee" />
+		<result column="original_day_fee_" property="originalDayFee" />
+		<result column="current_month_fee_" property="currentMonthFee" />
+		<result column="original_month_fee_" property="originalMonthFee" />
+		<result column="current_half_year_fee_" property="currentHalfYearFee" />
+		<result column="original_half_year_fee_" property="originalHalfYearFee" />
+		<result column="current_year_fee_" property="currentYearFee" />
+		<result column="original_year_fee_" property="originalYearFee" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="MemberFeeSetting" >
+		SELECT * FROM member_fee_setting WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="MemberFeeSetting">
+		SELECT * FROM member_fee_setting ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MemberFeeSetting" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!--
+		<selectKey resultClass="int" keyProperty="id" > 
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		</selectKey>
+		-->
+		INSERT INTO member_fee_setting (id_,current_day_fee_,original_day_fee_,current_month_fee_,original_month_fee_,current_half_year_fee_,original_half_year_fee_,current_year_fee_,original_year_fee_) VALUES(#{id},#{currentDayFee},#{originalDayFee},#{currentMonthFee},#{originalMonthFee},#{currentHalfYearFee},#{originalHalfYearFee},#{currentYearFee},#{originalYearFee})
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.MemberFeeSetting">
+		UPDATE member_fee_setting <set>
+		<if test="originalHalfYearFee != null">
+		original_half_year_fee_ = #{originalHalfYearFee},
+		</if>
+		<if test="originalDayFee != null">
+		original_day_fee_ = #{originalDayFee},
+		</if>
+		<if test="currentHalfYearFee != null">
+		current_half_year_fee_ = #{currentHalfYearFee},
+		</if>
+		<if test="currentMonthFee != null">
+		current_month_fee_ = #{currentMonthFee},
+		</if>
+		<if test="currentDayFee != null">
+		current_day_fee_ = #{currentDayFee},
+		</if>
+		<if test="originalMonthFee != null">
+		original_month_fee_ = #{originalMonthFee},
+		</if>
+		<if test="originalYearFee != null">
+		original_year_fee_ = #{originalYearFee},
+		</if>
+		<if test="currentYearFee != null">
+		current_year_fee_ = #{currentYearFee},
+		</if>
+		</set> WHERE id_ = #{id}
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM member_fee_setting WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="MemberFeeSetting" parameterType="map">
+		SELECT * FROM member_fee_setting ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM member_fee_setting
+	</select>
+</mapper>

+ 16 - 24
mec-biz/src/main/resources/config/mybatis/MemberPrivilegesItemMapper.xml

@@ -12,10 +12,7 @@
 		<result column="desc_" property="desc" />
 		<result column="code_" property="code" />
 		<result column="parent_id_" property="parentId" />
-		<result column="day_fee_" property="dayFee" />
-		<result column="month_fee_" property="monthFee" />
-		<result column="half_year_fee_" property="halfYearFee" />
-		<result column="year_fee_" property="yearFee" />
+		<result column="member_fee_setting_id_" property="memberFeeSettingId" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 	</resultMap>
@@ -32,42 +29,37 @@
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MemberPrivilegesItem" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO member_privileges_item (name_,desc_,code_,parent_id_,day_fee_,month_fee_,half_year_fee_,year_fee_,create_time_,update_time_)
-		 VALUES(#{name},#{desc},#{code},#{parentId},#{dayFee},#{monthFee},#{halfYearFee},#{yearFee},NOW(),NOW())
+		INSERT INTO member_privileges_item (name_,desc_,code_,parent_id_,member_fee_setting_id_,create_time_,update_time_)
+		 VALUES(#{name},#{desc},#{code},#{parentId},#{memberFeeSettingId},NOW(),NOW())
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.MemberPrivilegesItem">
 		UPDATE member_privileges_item <set>
 		<if test="parentId != null">
-		parent_id_ = #{parentId},
+			parent_id_ = #{parentId},
 		</if>
-		<if test="monthFee != null">
-		month_fee_ = #{monthFee},
+		<if test="memberFeeSettingId != null">
+			member_fee_setting_id_ = #{memberFeeSettingId},
 		</if>
 		<if test="code != null">
-		code_ = #{code},
-		</if>
-		<if test="yearFee != null">
-		year_fee_ = #{yearFee},
-		</if>
-		<if test="dayFee != null">
-		day_fee_ = #{dayFee},
+			code_ = #{code},
 		</if>
 		<if test="desc != null">
-		desc_ = #{desc},
+			desc_ = #{desc},
 		</if>
 		<if test="name != null">
-		name_ = #{name},
-		</if>
-		<if test="halfYearFee != null">
-		half_year_fee_ = #{halfYearFee},
+			name_ = #{name},
 		</if>
-		update_time_ = NOW()
+			update_time_ = NOW()
 		</set> WHERE id_ = #{id}
 	</update>
-	
-	<!-- 根据主键删除一条记录 -->
+    <update id="updateFeeAsNull">
+		UPDATE member_privileges_item SET day_fee_ = NULL,month_fee_ = NULL,half_year_fee_ = NULL,
+		                                  year_fee_ = NULL,update_time_ = NOW() WHERE id_ = #{id}
+	</update>
+
+    <!-- 根据主键删除一条记录 -->
 	<delete id="delete" >
 		DELETE FROM member_privileges_item WHERE id_ = #{id} 
 	</delete>

+ 15 - 19
mec-biz/src/main/resources/config/mybatis/MemberRankOrganizationFeeMapperMapper.xml

@@ -10,10 +10,7 @@
 		<result column="id_" property="id" />
 		<result column="organ_id_" property="organId" />
 		<result column="member_rank_setting_id_" property="memberRankSettingId" />
-		<result column="day_fee_" property="dayFee" />
-		<result column="month_fee_" property="monthFee" />
-		<result column="half_year_fee_" property="halfYearFee" />
-		<result column="year_fee_" property="yearFee" />
+		<result column="member_fee_setting_id_" property="memberFeeSettingId" />
 		<result column="operator_id_" property="operatorId" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
@@ -32,14 +29,17 @@
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="MemberRankOrganizationFeeMapper">
 		SELECT * FROM member_rank_organization_fee_mapper
+		<where>
+			<if test="organId != null">
+				AND organ_id_ = #{organId}
+			</if>
+		</where>
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.MemberRankOrganizationFeeMapper" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO member_rank_organization_fee_mapper (organ_id_,member_rank_setting_id_,day_fee_,
-		                                                 month_fee_,half_year_fee_,year_fee_,operator_id_,create_time_,update_time_)
-		VALUES(#{organId},#{memberRankSettingId},#{dayFee},#{monthFee},#{halfYearFee},
-		       #{yearFee},#{operatorId},NOW(),NOW())
+		INSERT INTO member_rank_organization_fee_mapper (organ_id_,member_rank_setting_id_,member_fee_setting_id_,operator_id_,create_time_,update_time_)
+		VALUES(#{organId},#{memberRankSettingId},#{memberFeeSettingId},#{operatorId},NOW(),NOW())
 	</insert>
 
 	<update id="update" parameterType="com.ym.mec.biz.dal.entity.MemberRankOrganizationFeeMapper">
@@ -50,17 +50,8 @@
 		<if test="memberRankSettingId != null">
 			member_rank_setting_id_ = #{memberRankSettingId},
 		</if>
-		<if test="dayFee != null">
-			day_fee_ = #{dayFee},
-		</if>
-		<if test="monthFee != null">
-			month_fee_ = #{monthFee},
-		</if>
-		<if test="halfYearFee != null">
-			half_year_fee_ = #{halfYearFee},
-		</if>
-		<if test="yearFee != null">
-			year_fee_ = #{yearFee},
+		<if test="memberFeeSettingId != null">
+			member_fee_setting_id_ = #{memberFeeSettingId},
 		</if>
 		<if test="operatorId != null">
 			operator_id_ = #{operatorId},
@@ -91,4 +82,9 @@
 			</if>
 		</where>
 	</select>
+    <select id="findByOrganIdAndRankId" resultMap="MemberRankOrganizationFeeMapper">
+		SELECT * FROM member_rank_organization_fee_mapper
+		WHERE organ_id_ = #{organId} AND member_rank_setting_id_ = #{memberRankSettingId}
+		LIMIT 1
+	</select>
 </mapper>

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

@@ -24,7 +24,7 @@ public class MemberPrivilegesItemController extends BaseController {
     @PreAuthorize("@pcs.hasPermissions('memberPrivilegesItem/add')")
     @AuditLogAnnotation(operateName = "新增系统功能类型")
     public Object add(@RequestBody MemberPrivilegesItem memberPrivilegesItem) {
-        memberPrivilegesItemService.insert(memberPrivilegesItem);
+        memberPrivilegesItemService.add(memberPrivilegesItem);
         return succeed();
     }
 

+ 19 - 0
mec-web/src/main/java/com/ym/mec/web/controller/MemberRankOrganizationFeeMapperController.java

@@ -9,6 +9,7 @@ import com.ym.mec.biz.dal.page.MemberRankFeeQueryInfo;
 import com.ym.mec.biz.service.MemberRankOrganizationFeeMapperService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.exception.BizException;
+import com.ym.mec.util.collection.MapUtil;
 import com.yonge.log.model.AuditLogAnnotation;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -18,7 +19,9 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 @RequestMapping("memberRankOrganizationFeeMapper")
 @Api(tags = "会员收费设置服务")
@@ -56,6 +59,22 @@ public class MemberRankOrganizationFeeMapperController extends BaseController {
         return succeed(memberRankOrganizationFeeMapperService.get(id));
     }
 
+    @ApiOperation(value = "获取分部活动列表以及活动默认收费金额")
+    @GetMapping("/getMemberDefaultFee")
+    @PreAuthorize("@pcs.hasPermissions('memberRankOrganizationFeeMapper/getMemberDefaultFee')")
+    public Object getMemberDefaultFee(Integer rankId) {
+        return succeed(memberRankOrganizationFeeMapperService.getMemberDefaultFee(rankId));
+    }
+
+    @ApiOperation(value = "获取所有的收费标准")
+    @GetMapping("/findAll")
+    @PreAuthorize("@pcs.hasPermissions('memberRankOrganizationFeeMapper/findAll')")
+    public Object getMemberDefaultFee(MemberRankFeeQueryInfo queryInfo) {
+        Map<String, Object> params = new HashMap<String, Object>();
+        MapUtil.populateMap(params, queryInfo);
+        return succeed(memberRankOrganizationFeeMapperService.findAll(params));
+    }
+
     @ApiOperation(value = "分页查询")
     @GetMapping("/queryPage")
     @PreAuthorize("@pcs.hasPermissions('memberRankOrganizationFeeMapper/queryPage')")

+ 9 - 0
mec-web/src/main/java/com/ym/mec/web/controller/MemberRankSettingController.java

@@ -11,6 +11,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.HashMap;
+
 @RequestMapping("memberRankSetting")
 @Api(tags = "会员等级服务")
 @RestController
@@ -50,4 +52,11 @@ public class MemberRankSettingController extends BaseController {
     public Object queryPage(QueryInfo queryInfo) {
         return succeed(memberRankSettingService.queryPage(queryInfo));
     }
+
+    @ApiOperation(value = "获取所有会员列表")
+    @GetMapping("/findAll")
+    @PreAuthorize("@pcs.hasPermissions('memberRankSetting/findAll')")
+    public Object findAll() {
+        return succeed(memberRankSettingService.findAll(new HashMap<>()));
+    }
 }