Selaa lähdekoodia

上朵分销系统

wangxiaoming 6 vuotta sitten
vanhempi
commit
afcc99c892

+ 101 - 0
tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/channel/BalanceLog.java

@@ -0,0 +1,101 @@
+package com.iamberry.wechat.core.entity.channel;
+
+import  java.util.Date;
+import  java.io.Serializable;
+/**
+ *  余额变动日志表类
+ * @author xm
+ * @Date 2018-07-24
+ */
+public class BalanceLog  implements  Serializable{
+    //日志id
+    private Integer balanceLogId;
+    //渠道id
+    private Integer balanceLogChannelId;
+    //渠道类型 1:主渠道 2:子渠道
+    private Integer balanceLogChannelType;
+    //变动前金额
+    private Integer balanceLogBeforeAmount;
+    //变动后金额
+    private Integer balanceLogAfterAmount;
+    //变动类型 1:返利 2:提现
+    private Integer balanceLogType;
+    //金额
+    private Integer balanceLogAmount;
+    //创建时间
+    private Date balanceLogCreateTime;
+    //修改时间'
+    private Date balanceLogUpdateTime;
+
+    public Integer getBalanceLogId(){
+        return balanceLogId;
+    }
+
+    public void setBalanceLogId(Integer  balanceLogId){
+        this.balanceLogId=balanceLogId;
+    }
+
+    public Integer getBalanceLogChannelId(){
+        return balanceLogChannelId;
+    }
+
+    public void setBalanceLogChannelId(Integer  balanceLogChannelId){
+        this.balanceLogChannelId=balanceLogChannelId;
+    }
+
+    public Integer getBalanceLogChannelType(){
+        return balanceLogChannelType;
+    }
+
+    public void setBalanceLogChannelType(Integer  balanceLogChannelType){
+        this.balanceLogChannelType=balanceLogChannelType;
+    }
+
+    public Integer getBalanceLogBeforeAmount(){
+        return balanceLogBeforeAmount;
+    }
+
+    public void setBalanceLogBeforeAmount(Integer  balanceLogBeforeAmount){
+        this.balanceLogBeforeAmount=balanceLogBeforeAmount;
+    }
+
+    public Integer getBalanceLogAfterAmount(){
+        return balanceLogAfterAmount;
+    }
+
+    public void setBalanceLogAfterAmount(Integer  balanceLogAfterAmount){
+        this.balanceLogAfterAmount=balanceLogAfterAmount;
+    }
+
+    public Integer getBalanceLogType(){
+        return balanceLogType;
+    }
+
+    public void setBalanceLogType(Integer  balanceLogType){
+        this.balanceLogType=balanceLogType;
+    }
+
+    public Integer getBalanceLogAmount(){
+        return balanceLogAmount;
+    }
+
+    public void setBalanceLogAmount(Integer  balanceLogAmount){
+        this.balanceLogAmount=balanceLogAmount;
+    }
+
+    public Date getBalanceLogCreateTime(){
+        return balanceLogCreateTime;
+    }
+
+    public void setBalanceLogCreateTime(Date  balanceLogCreateTime){
+        this.balanceLogCreateTime=balanceLogCreateTime;
+    }
+
+    public Date getBalanceLogUpdateTime(){
+        return balanceLogUpdateTime;
+    }
+
+    public void setBalanceLogUpdateTime(Date  balanceLogUpdateTime){
+        this.balanceLogUpdateTime=balanceLogUpdateTime;
+    }
+}

+ 32 - 2
tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/channel/ChannelPrice.java

@@ -4,19 +4,25 @@ import  java.io.Serializable;
 /**
  *  渠道对应产品返利价格表类
  * @author xm
- * @Date 2018-07-23
+ * @Date 2018-07-24
  */
 public class ChannelPrice  implements  Serializable{
     //返利价格id
     private Integer channelPriceId;
+    //返利渠道类型 1:主渠道 2:子渠道
+    private Integer channelType;
     //渠道id
     private Integer channelId;
     //产品id
     private Integer productId;
     //颜色id
     private Integer colorId;
-    //价格
+    //优惠价价格
     private Integer channelPriceOffer;
+    //原价 划线价
+    private Integer channelOriginalPrice;
+    //返利金额
+    private Integer channelRebateAmount;
     //状态:1使用中 2:未使用
     private Integer channelPriceStatus;
     //创建时间
@@ -32,6 +38,14 @@ public class ChannelPrice  implements  Serializable{
         this.channelPriceId=channelPriceId;
     }
 
+    public Integer getChannelType(){
+        return channelType;
+    }
+
+    public void setChannelType(Integer  channelType){
+        this.channelType=channelType;
+    }
+
     public Integer getChannelId(){
         return channelId;
     }
@@ -64,6 +78,22 @@ public class ChannelPrice  implements  Serializable{
         this.channelPriceOffer=channelPriceOffer;
     }
 
+    public Integer getChannelOriginalPrice(){
+        return channelOriginalPrice;
+    }
+
+    public void setChannelOriginalPrice(Integer  channelOriginalPrice){
+        this.channelOriginalPrice=channelOriginalPrice;
+    }
+
+    public Integer getChannelRebateAmount(){
+        return channelRebateAmount;
+    }
+
+    public void setChannelRebateAmount(Integer  channelRebateAmount){
+        this.channelRebateAmount=channelRebateAmount;
+    }
+
     public Integer getChannelPriceStatus(){
         return channelPriceStatus;
     }

+ 14 - 3
tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/channel/ChannelRebate.java

@@ -2,18 +2,21 @@ package com.iamberry.wechat.core.entity.channel;
 
 import  java.util.Date;
 import  java.io.Serializable;
+
 /**
  *  上朵分销返利记录类
  * @author xm
- * @Date 2018-07-23
+ * @Date 2018-07-24
  */
 public class ChannelRebate  implements  Serializable{
     //返利id
     private Integer rebateId;
     //订单号
     private String rebateSalesOrderId;
-    //订单人openid
+    //订单人
     private String rebackFromOpenId;
+    //返利渠道类型 1:主渠道 2:子渠道
+    private Integer rebackChannelType;
     //返利渠道 渠道id-返利到该渠道
     private Integer rebackChannelId;
     //返利金额
@@ -51,6 +54,14 @@ public class ChannelRebate  implements  Serializable{
         this.rebackFromOpenId=rebackFromOpenId;
     }
 
+    public Integer getRebackChannelType(){
+        return rebackChannelType;
+    }
+
+    public void setRebackChannelType(Integer  rebackChannelType){
+        this.rebackChannelType=rebackChannelType;
+    }
+
     public Integer getRebackChannelId(){
         return rebackChannelId;
     }
@@ -98,4 +109,4 @@ public class ChannelRebate  implements  Serializable{
     public void setRebackUpdateTime(Date  rebackUpdateTime){
         this.rebackUpdateTime=rebackUpdateTime;
     }
-}
+}

+ 37 - 0
tooth-wechat-interface/src/main/java/com/iamberry/wechat/face/channel/BalanceLogService.java

@@ -0,0 +1,37 @@
+package com.iamberry.wechat.face.channel;
+
+import com.iamberry.wechat.core.entity.channel.BalanceLog;
+
+import java.util.List;
+
+/**
+ *  余额变动日志表接口
+ * @author xm
+ * @Date 2018-07-24
+ */
+public interface BalanceLogService {
+    /**
+     * 获取集合
+     * @param  balanceLog
+     * @return List
+     */
+    List<BalanceLog> getBalanceLogList(BalanceLog  balanceLog);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  balanceLog
+     */
+    BalanceLog getBalanceLogById(Integer  id);
+    /**
+     * 增加数据
+     * @param  balanceLog
+     * @return Integer
+     */
+    Integer  save(BalanceLog  balanceLog);
+    /**
+     * 修改数据
+     * @param  balanceLog
+     * @return Integer
+     */
+    Integer  update(BalanceLog  balanceLog);
+}

+ 56 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/channel/BalanceLogServiceImpl.java

@@ -0,0 +1,56 @@
+package com.iamberry.wechat.service.channel;
+
+import com.iamberry.wechat.core.entity.channel.BalanceLog;
+import com.iamberry.wechat.face.channel.BalanceLogService;
+import com.iamberry.wechat.service.mapper.BalanceLogMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ *  余额变动日志表接口
+ * @author xm
+ * @Date 2018-07-24
+ */
+@Service
+public class BalanceLogServiceImpl  implements BalanceLogService {
+    @Autowired
+    private BalanceLogMapper balanceLogMapper;
+    /**
+     * 获取集合
+     * @param  balanceLog
+     * @return List
+     */
+    @Override
+    public List<BalanceLog> getBalanceLogList(BalanceLog  balanceLog){
+        return  balanceLogMapper.getBalanceLogList(balanceLog);
+    }
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  balanceLog
+     */
+    @Override
+    public  BalanceLog  getBalanceLogById(Integer  id){
+        return  balanceLogMapper.getBalanceLogById(id);
+    }
+    /**
+     * 增加数据
+     * @param  balanceLog
+     * @return Integer
+     */
+    @Override
+    public  Integer  save(BalanceLog balanceLog){
+        return  balanceLogMapper.save(balanceLog);
+    }
+    /**
+     * 修改数据
+     * @param  balanceLog
+     * @return Integer
+     */
+    @Override
+    public  Integer  update(BalanceLog  balanceLog){
+        return  balanceLogMapper.update(balanceLog);
+    }
+}

+ 37 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/BalanceLogMapper.java

@@ -0,0 +1,37 @@
+package com.iamberry.wechat.service.mapper;
+
+import com.iamberry.wechat.core.entity.channel.BalanceLog;
+
+import java.util.List;
+
+/**
+ *  余额变动日志表接口
+ * @author xm
+ * @Date 2018-07-24
+ */
+public interface BalanceLogMapper {
+    /**
+     * 获取集合
+     * @param  balanceLog
+     * @return List
+     */
+    List<BalanceLog> getBalanceLogList(BalanceLog  balanceLog);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  balanceLog
+     */
+    BalanceLog  getBalanceLogById(Integer  id);
+    /**
+     * 增加数据
+     * @param  balanceLog
+     * @return Integer
+     */
+    Integer  save(BalanceLog  balanceLog);
+    /**
+     * 修改数据
+     * @param  balanceLog
+     * @return Integer
+     */
+    Integer  update(BalanceLog  balanceLog);
+}

+ 97 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/balanceLogMapper.xml

@@ -0,0 +1,97 @@
+<?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.iamberry.wechat.service.mapper.BalanceLogMapper">
+    <resultMap  id="BaseResultMap" type="BalanceLog" >
+        <result    column="balance_log_id"    property="balanceLogId" />
+        <result    column="balance_log_channel_id"    property="balanceLogChannelId" />
+        <result    column="balance_log_channel_type"    property="balanceLogChannelType" />
+        <result    column="balance_log_before_amount"    property="balanceLogBeforeAmount" />
+        <result    column="balance_log_after_amount"    property="balanceLogAfterAmount" />
+        <result    column="balance_log_type"    property="balanceLogType" />
+        <result    column="balance_log_amount"    property="balanceLogAmount" />
+        <result    column="balance_log_create_time"    property="balanceLogCreateTime" />
+        <result    column="balance_log_update_time"    property="balanceLogUpdateTime" />
+    </resultMap>
+    <sql    id="Base_List" >
+        t.balance_log_id,
+        t.balance_log_channel_id,
+        t.balance_log_channel_type,
+        t.balance_log_before_amount,
+        t.balance_log_after_amount,
+        t.balance_log_type,
+        t.balance_log_amount,
+        t.balance_log_create_time,
+        t.balance_log_update_time
+    </sql>
+    <select id="getBalanceLogList" resultMap="BaseResultMap" parameterType="BalanceLog" >
+        select
+        <include refid="Base_List" />
+        from tb_iamberry_channel_balance_log t
+        <where>
+            <if test="balanceLogId != null ">
+                AND t.balance_log_id = #{balanceLogId}
+            </if >
+            <if test="balanceLogChannelId != null ">
+                AND t.balance_log_channel_id = #{balanceLogChannelId}
+            </if >
+            <if test="balanceLogChannelType != null ">
+                AND t.balance_log_channel_type = #{balanceLogChannelType}
+            </if >
+            <if test="balanceLogType != null ">
+                AND t.balance_log_type = #{balanceLogType}
+            </if >
+        </where>
+    </select>
+    <select id="getBalanceLogById" resultMap="BaseResultMap" parameterType="Integer" >
+        select
+        <include refid="Base_List" />
+        from tb_iamberry_channel_balance_log t
+        where t.balance_log_id= #{balanceLogId}
+    </select>
+    <insert id="save" parameterType="BalanceLog" >
+        insert into
+        tb_iamberry_channel_balance_log
+        (
+        balance_log_channel_id,
+        balance_log_channel_type,
+        balance_log_before_amount,
+        balance_log_after_amount,
+        balance_log_type,
+        balance_log_amount
+        )
+        values
+        (
+        #{balanceLogChannelId},
+        #{balanceLogChannelType},
+        #{balanceLogBeforeAmount},
+        #{balanceLogAfterAmount},
+        #{balanceLogType},
+        #{balanceLogAmount}
+        )
+    </insert>
+    <update id="update" parameterType="BalanceLog" >
+        update
+        tb_iamberry_channel_balance_log
+        <set >
+            <if test="balanceLogChannelId != null ">
+                balance_log_channel_id = #{balanceLogChannelId},
+            </if >
+            <if test="balanceLogChannelType != null ">
+                balance_log_channel_type = #{balanceLogChannelType},
+            </if >
+            <if test="balanceLogBeforeAmount != null ">
+                balance_log_before_amount = #{balanceLogBeforeAmount},
+            </if >
+            <if test="balanceLogAfterAmount != null ">
+                balance_log_after_amount = #{balanceLogAfterAmount},
+            </if >
+            <if test="balanceLogType != null ">
+                balance_log_type = #{balanceLogType},
+            </if >
+            <if test="balanceLogAmount != null ">
+                balance_log_amount = #{balanceLogAmount},
+            </if >
+        </set >
+        where balance_log_id= #{balanceLogId}
+    </update>
+</mapper>

+ 32 - 5
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/channelPriceMapper.xml

@@ -3,20 +3,26 @@
 <mapper namespace="com.iamberry.wechat.service.mapper.ChannelPriceMapper">
     <resultMap  id="BaseResultMap" type="ChannelPrice" >
         <result    column="channel_price_id"    property="channelPriceId" />
+        <result    column="channel_type"    property="channelType" />
         <result    column="channel_id"    property="channelId" />
         <result    column="product_id"    property="productId" />
         <result    column="color_id"    property="colorId" />
         <result    column="channel_price_offer"    property="channelPriceOffer" />
+        <result    column="channel_original_price"    property="channelOriginalPrice" />
+        <result    column="channel_rebate_amount"    property="channelRebateAmount" />
         <result    column="channel_price_status"    property="channelPriceStatus" />
         <result    column="channel_price_create_time"    property="channelPriceCreateTime" />
         <result    column="channel_price_update_time"    property="channelPriceUpdateTime" />
     </resultMap>
     <sql    id="Base_List" >
         t.channel_price_id,
+        t.channel_type,
         t.channel_id,
         t.product_id,
         t.color_id,
         t.channel_price_offer,
+        t.channel_original_price,
+        t.channel_rebate_amount,
         t.channel_price_status,
         t.channel_price_create_time,
         t.channel_price_update_time
@@ -29,6 +35,9 @@
             <if test="channelPriceId != null ">
                 AND t.channel_price_id = #{channelPriceId}
             </if >
+            <if test="channelType != null ">
+                AND t.channel_type = #{channelType}
+            </if >
             <if test="channelId != null ">
                 AND t.channel_id = #{channelId}
             </if >
@@ -38,9 +47,6 @@
             <if test="colorId != null ">
                 AND t.color_id = #{colorId}
             </if >
-            <if test="channelPriceOffer != null ">
-                AND t.channel_price_offer = #{channelPriceOffer}
-            </if >
             <if test="channelPriceStatus != null ">
                 AND t.channel_price_status = #{channelPriceStatus}
             </if >
@@ -56,18 +62,24 @@
         insert into
         tb_iamberry_channel_price
         (
+        channel_type,
         channel_id,
         product_id,
         color_id,
         channel_price_offer,
+        channel_original_price,
+        channel_rebate_amount,
         channel_price_status
         )
         values
         (
+        #{channelType},
         #{channelId},
         #{productId},
         #{colorId},
         #{channelPriceOffer},
+        #{channelOriginalPrice},
+        #{channelRebateAmount},
         #{channelPriceStatus}
         )
     </insert>
@@ -75,6 +87,9 @@
         update
         tb_iamberry_channel_price
         <set >
+            <if test="channelType != null ">
+                channel_type = #{channelType},
+            </if >
             <if test="channelId != null ">
                 channel_id = #{channelId},
             </if >
@@ -87,6 +102,12 @@
             <if test="channelPriceOffer != null ">
                 channel_price_offer = #{channelPriceOffer},
             </if >
+            <if test="channelOriginalPrice != null ">
+                channel_original_price = #{channelOriginalPrice},
+            </if >
+            <if test="channelRebateAmount != null ">
+                channel_rebate_amount = #{channelRebateAmount},
+            </if >
             <if test="channelPriceStatus != null ">
                 channel_price_status = #{channelPriceStatus},
             </if >
@@ -94,7 +115,7 @@
         where channel_price_id= #{channelPriceId}
     </update>
     <delete id="delete" parameterType="Integer" >
-        delete
+        delete FROM
         tb_iamberry_channel_price
         where channel_price_id=#{channelPriceId}
     </delete>
@@ -102,25 +123,31 @@
         insert into
         tb_iamberry_channel_price
         (
+        channel_type,
         channel_id,
         product_id,
         color_id,
         channel_price_offer,
+        channel_original_price,
+        channel_rebate_amount,
         channel_price_status
         )
         values
         <foreach collection="list" item="node" index="index" separator="," open="" close="">
             (
+            #{node.channelType},
             #{node.channelId},
             #{node.productId},
             #{node.colorId},
             #{node.channelPriceOffer},
+            #{node.channelOriginalPrice},
+            #{node.channelRebateAmount},
             #{node.channelPriceStatus}
             )
         </foreach >
     </insert>
     <delete id="deleteList" parameterType="String" >
-        delete
+        delete FROM
         tb_iamberry_channel_price
         where channel_price_id  in
         <foreach collection="ids" item="item" index="index" separator="," open="(" close=")">

+ 70 - 123
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/childChannelMapper.xml

@@ -1,161 +1,108 @@
 <?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.iamberry.wechat.service.mapper.ChildChannelMapper">
-    <resultMap  id="BaseResultMap" type="ChildChannel" >
-        <result    column="child_channel_id"    property="childChannelId" />
-        <result    column="child_channel_open_id"    property="childChannelOpenId" />
-        <result    column="main_channel_id"    property="mainChannelId" />
-        <result    column="child_channel_name"    property="childChannelName" />
-        <result    column="child_channel_docking_name"    property="childChannelDockingName" />
-        <result    column="child_channel_docking_tel"    property="childChannelDockingTel" />
-        <result    column="child_channel_balance"    property="childChannelBalance" />
-        <result    column="child_channel_bank"    property="childChannelBank" />
-        <result    column="child_channel_bank_account"    property="childChannelBankAccount" />
-        <result    column="child_channel_bank_name"    property="childChannelBankName" />
-        <result    column="child_channel_bank_branch"    property="childChannelBankBranch" />
-        <result    column="child_channel_qrcode"    property="childChannelQrcode" />
-        <result    column="child_channel_status"    property="childChannelStatus" />
-        <result    column="child_channel_desc"    property="childChannelDesc" />
-        <result    column="child_channel_create_time"    property="childChannelCreateTime" />
-        <result    column="child_channel_update_time"    property="childChannelUpdateTime" />
+<mapper namespace="com.iamberry.wechat.service.mapper.ChannelRebateMapper">
+    <resultMap  id="BaseResultMap" type="ChannelRebate" >
+        <result    column="rebate_id"    property="rebateId" />
+        <result    column="rebate_sales_order_id"    property="rebateSalesOrderId" />
+        <result    column="reback_from_open_id"    property="rebackFromOpenId" />
+        <result    column="reback_channel_type"    property="rebackChannelType" />
+        <result    column="reback_channel_id"    property="rebackChannelId" />
+        <result    column="reback_amount"    property="rebackAmount" />
+        <result    column="reback_status"    property="rebackStatus" />
+        <result    column="reback_time"    property="rebackTime" />
+        <result    column="reback_create_time"    property="rebackCreateTime" />
+        <result    column="reback_update_time"    property="rebackUpdateTime" />
     </resultMap>
     <sql    id="Base_List" >
-        t.child_channel_id,
-        t.child_channel_open_id,
-        t.main_channel_id,
-        t.child_channel_name,
-        t.child_channel_docking_name,
-        t.child_channel_docking_tel,
-        t.child_channel_balance,
-        t.child_channel_bank,
-        t.child_channel_bank_account,
-        t.child_channel_bank_name,
-        t.child_channel_bank_branch,
-        t.child_channel_qrcode,
-        t.child_channel_status,
-        t.child_channel_desc,
-        t.child_channel_create_time,
-        t.child_channel_update_time
+        t.rebate_id,
+        t.rebate_sales_order_id,
+        t.reback_from_open_id,
+        t.reback_channel_type,
+        t.reback_channel_id,
+        t.reback_amount,
+        t.reback_status,
+        t.reback_time,
+        t.reback_create_time,
+        t.reback_update_time
     </sql>
-    <select id="getChildChannelList" resultMap="BaseResultMap" parameterType="ChildChannel" >
+    <select id="getChannelRebateList" resultMap="BaseResultMap" parameterType="ChannelRebate" >
         select
         <include refid="Base_List" />
-        from tb_iamberry_child_channel t
+        from tb_iamberry_channel_rebate t
         <where>
-            <if test="childChannelId != null ">
-                AND t.child_channel_id = #{childChannelId}
+            <if test="rebateId != null ">
+                AND t.rebate_id = #{rebateId}
             </if >
-            <if test="childChannelOpenId != null and childChannelOpenId != ''">
-                AND t.child_channel_open_id = #{childChannelOpenId}
+            <if test="rebateSalesOrderId != null and rebateSalesOrderId != ''">
+                AND t.rebate_sales_order_id = #{rebateSalesOrderId}
             </if >
-            <if test="mainChannelId != null ">
-                AND t.main_channel_id = #{mainChannelId}
+            <if test="rebackChannelType != null ">
+                AND t.reback_channel_type = #{rebackChannelType}
             </if >
-            <if test="childChannelName != null and childChannelName != ''">
-                AND t.child_channel_name  like  CONCAT ('%',#{childChannelName},'%')
+            <if test="rebackChannelId != null ">
+                AND t.reback_channel_id = #{rebackChannelId}
             </if >
-            <if test="childChannelDockingName != null and childChannelDockingName != ''">
-                AND t.child_channel_docking_name  like  CONCAT ('%',#{childChannelDockingName},'%')
-            </if >
-            <if test="childChannelDockingTel != null and childChannelDockingTel != ''">
-                AND t.child_channel_docking_tel  like  CONCAT ('%',#{childChannelDockingTel},'%')
-            </if >
-            <if test="childChannelStatus != null ">
-                AND t.child_channel_status = #{childChannelStatus}
+            <if test="rebackStatus != null ">
+                AND t.reback_status = #{rebackStatus}
             </if >
         </where>
     </select>
-    <select id="getChildChannelById" resultMap="BaseResultMap" parameterType="Integer" >
+    <select id="getChannelRebateById" resultMap="BaseResultMap" parameterType="Integer" >
         select
         <include refid="Base_List" />
-        from tb_iamberry_child_channel t
-        where t.child_channel_id= #{childChannelId}
+        from tb_iamberry_channel_rebate t
+        where t.rebate_id= #{rebateId}
     </select>
-    <insert id="save" parameterType="ChildChannel" >
+    <insert id="save" parameterType="ChannelRebate" >
         insert into
-        tb_iamberry_child_channel
+        tb_iamberry_channel_rebate
         (
-        child_channel_id,
-        child_channel_open_id,
-        main_channel_id,
-        child_channel_name,
-        child_channel_docking_name,
-        child_channel_docking_tel,
-        child_channel_balance,
-        child_channel_bank,
-        child_channel_bank_account,
-        child_channel_bank_name,
-        child_channel_bank_branch,
-        child_channel_qrcode,
-        child_channel_status,
-        child_channel_desc
+        rebate_sales_order_id,
+        reback_from_open_id,
+        reback_channel_type,
+        reback_channel_id,
+        reback_amount,
+        reback_status,
+        reback_time
         )
         values
         (
-        #{childChannelId},
-        #{childChannelOpenId},
-        #{mainChannelId},
-        #{childChannelName},
-        #{childChannelDockingName},
-        #{childChannelDockingTel},
-        #{childChannelBalance},
-        #{childChannelBank},
-        #{childChannelBankAccount},
-        #{childChannelBankName},
-        #{childChannelBankBranch},
-        #{childChannelQrcode},
-        #{childChannelStatus},
-        #{childChannelDesc}
+        #{rebateSalesOrderId},
+        #{rebackFromOpenId},
+        #{rebackChannelType},
+        #{rebackChannelId},
+        #{rebackAmount},
+        #{rebackStatus},
+        #{rebackTime}
         )
     </insert>
-    <update id="update" parameterType="ChildChannel" >
+    <update id="update" parameterType="ChannelRebate" >
         update
-        tb_iamberry_child_channel
+        tb_iamberry_channel_rebate
         <set >
-            <if test="childChannelId != null ">
-                child_channel_id = #{childChannelId},
-            </if >
-            <if test="childChannelOpenId != null and childChannelOpenId != ''">
-                child_channel_open_id = #{childChannelOpenId},
-            </if >
-            <if test="mainChannelId != null ">
-                main_channel_id = #{mainChannelId},
-            </if >
-            <if test="childChannelName != null and childChannelName != ''">
-                child_channel_name = #{childChannelName},
-            </if >
-            <if test="childChannelDockingName != null and childChannelDockingName != ''">
-                child_channel_docking_name = #{childChannelDockingName},
-            </if >
-            <if test="childChannelDockingTel != null and childChannelDockingTel != ''">
-                child_channel_docking_tel = #{childChannelDockingTel},
-            </if >
-            <if test="childChannelBalance != null ">
-                child_channel_balance = #{childChannelBalance},
-            </if >
-            <if test="childChannelBank != null and childChannelBank != ''">
-                child_channel_bank = #{childChannelBank},
+            <if test="rebateSalesOrderId != null and rebateSalesOrderId != ''">
+                rebate_sales_order_id = #{rebateSalesOrderId},
             </if >
-            <if test="childChannelBankAccount != null and childChannelBankAccount != ''">
-                child_channel_bank_account = #{childChannelBankAccount},
+            <if test="rebackFromOpenId != null and rebackFromOpenId != ''">
+                reback_from_open_id = #{rebackFromOpenId},
             </if >
-            <if test="childChannelBankName != null and childChannelBankName != ''">
-                child_channel_bank_name = #{childChannelBankName},
+            <if test="rebackChannelType != null ">
+                reback_channel_type = #{rebackChannelType},
             </if >
-            <if test="childChannelBankBranch != null and childChannelBankBranch != ''">
-                child_channel_bank_branch = #{childChannelBankBranch},
+            <if test="rebackChannelId != null ">
+                reback_channel_id = #{rebackChannelId},
             </if >
-            <if test="childChannelQrcode != null and childChannelQrcode != ''">
-                child_channel_qrcode = #{childChannelQrcode},
+            <if test="rebackAmount != null ">
+                reback_amount = #{rebackAmount},
             </if >
-            <if test="childChannelStatus != null ">
-                child_channel_status = #{childChannelStatus},
+            <if test="rebackStatus != null ">
+                reback_status = #{rebackStatus},
             </if >
-            <if test="childChannelDesc != null and childChannelDesc != ''">
-                child_channel_desc = #{childChannelDesc},
+            <if test="rebackTime != null and rebackTime != ''">
+                reback_time = #{rebackTime},
             </if >
         </set >
-        where child_channel_id= #{childChannelId}
+        where rebate_id= #{rebateId}
     </update>
 
 </mapper>

+ 63 - 0
tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/cart/ProductInfoHandler.java

@@ -12,7 +12,12 @@ import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.iamberry.wechat.core.entity.channel.ChildChannel;
+import com.iamberry.wechat.core.entity.channel.MainChannel;
 import com.iamberry.wechat.core.entity.product.*;
+import com.iamberry.wechat.face.channel.ChannelPriceService;
+import com.iamberry.wechat.face.channel.ChildChannelService;
+import com.iamberry.wechat.face.channel.MainChannelService;
 import com.iamberry.wechat.face.drp.PlaceInfoService;
 import com.iamberry.wechat.face.porduct.AccessFlowService;
 import com.iamberry.wechat.tools.QrCodeUtil;
@@ -65,6 +70,13 @@ public class ProductInfoHandler {
 	private PlaceInfoService placeInfoService;
 	@Autowired
 	private AccessFlowService accessFlowService;
+	@Autowired
+	private MainChannelService mainChannelService;
+	@Autowired
+	private ChildChannelService childChannelService;
+	@Autowired
+	private ChannelPriceService channelPriceService;
+
 
 
 	/**
@@ -735,6 +747,57 @@ public class ProductInfoHandler {
 		rm.setData(map);
 		return rm ;
 	}
+
+	/**
+	 * 根据产品类型id查询产品列表
+	 * @param pageSize
+	 * @param pageNO
+	 * @return
+	 */
+//	@ResponseBody
+//	@RequestMapping("/ListProductChannel")
+//	public  ResultMsg ListProductChannel(
+//			@RequestParam(value= "channelId") Integer channelId,
+//			@RequestParam(value= "channelType") Integer channelType,
+//			@RequestParam(value= "pageSize",defaultValue= "6" ,required=false) Integer pageSize,
+//			@RequestParam(value = "pageNO", defaultValue = "1",required=false) Integer pageNO){
+//		ResultMsg rm=new ResultMsg();
+//		if(channelId!=null&&channelId<0){
+//			rm.setStatus(false);
+//			rm.setResultCode(ResultInfo.ERRORCODE);
+//			rm.setMessage(NameUtils.getConfig("ERRORINFO"));
+//			return rm;
+//		}
+//
+//		if(channelType == 1){
+//			MainChannel mainChannel = mainChannelService.getMainChannelById(channelId);
+//		}else if(channelType == 1){
+//			ChildChannel childChannel = childChannelService.getChildChannelById(channelId);
+//		}else{
+//
+//		}
+//
+//		ProductColor productColor=new ProductColor();
+//		productColor.setProductType(typeId);
+//		productColor.getPage().setPageSize(pageSize);
+//		productColor.getPage().setPageNumber(pageNO);
+//		productColor.getPage().initRecordBegin();
+//		List<ProductColor> list=productInfoService.listProductColorByTypeId(productColor);
+//		if(list!=null&&list.size()<0){
+//			rm.setStatus(false);
+//			rm.setResultCode(ResultInfo.ERRORCODE);
+//			return rm;
+//		}
+//		Map<String,Object> map=new HashMap<String, Object>();
+//		map.put("productColorList",list);
+//		map.put("typeId",typeId);
+//		rm.setStatus(true);
+//		rm.setResultCode(ResultInfo.SUCCESSCODE);
+//		rm.setMessage(NameUtils.getConfig("SUCCESSINFO"));
+//		rm.setData(map);
+//		return rm ;
+//	}
+
 	/**
 	 * 根据colorId查询产品信息
 	 * @param colorId