浏览代码

上朵分销系统

wangxiaoming 6 年之前
父节点
当前提交
1d2f55670b

+ 2 - 2
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/channelRebateMapper.xml

@@ -1,7 +1,7 @@
 <?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.ChannelRebateMapper">
-    <resultMap  id="BaseResultMap" type="ChannelRebate" >
+   <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" />
@@ -23,7 +23,7 @@
         t.reback_create_time,
         t.reback_update_time
     </sql>
-    <select id="getChannelRebateList" resultMap="BaseResultMap" parameterType="ChannelRebate" >
+   <select id="getChannelRebateList" resultMap="BaseResultMap" parameterType="ChannelRebate" >
         select
         <include refid="Base_List" />
         from tb_iamberry_channel_rebate t

+ 132 - 71
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/childChannelMapper.xml

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

+ 35 - 80
tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/cart/ProductInfoHandler.java

@@ -1,53 +1,50 @@
 package com.iamberry.wechat.handles.cart;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.ServletContext;
-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;
-import org.apache.commons.lang.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
-
 import com.iamberry.wechat.core.entity.ResultMsg;
 import com.iamberry.wechat.core.entity.WechatUtils;
 import com.iamberry.wechat.core.entity.cart.ShopSalesOrderDto;
 import com.iamberry.wechat.core.entity.cart.UserGiftDto;
+import com.iamberry.wechat.core.entity.channel.ChannelPrice;
 import com.iamberry.wechat.core.entity.drp.PlaceInfo;
 import com.iamberry.wechat.core.entity.member.Member;
+import com.iamberry.wechat.core.entity.product.*;
 import com.iamberry.wechat.face.admin.SystemService;
 import com.iamberry.wechat.face.cart.CartService;
 import com.iamberry.wechat.face.cart.ProductInfoService;
+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.member.MemberService;
+import com.iamberry.wechat.face.porduct.AccessFlowService;
 import com.iamberry.wechat.face.porduct.ProductColorService;
 import com.iamberry.wechat.face.porduct.ProductImageTextService;
 import com.iamberry.wechat.face.porduct.ProductPictureService;
 import com.iamberry.wechat.tools.NameUtils;
+import com.iamberry.wechat.tools.QrCodeUtil;
 import com.iamberry.wechat.tools.ResultInfo;
 import com.iamberry.wechat.tools.StaticInfo;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.context.ContextLoader;
 import org.springframework.web.context.WebApplicationContext;
 
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 @Controller
 @RequestMapping("/wechat/product")
 public class ProductInfoHandler {
@@ -202,9 +199,17 @@ public class ProductInfoHandler {
 	@ResponseBody
 	@RequestMapping("/getProductByProductId")
 	public ResultMsg getProductByProductId(HttpServletRequest request,HttpServletResponse response,
-//										   @RequestParam(value = "productId",defaultValue = "") String productId,
+										   @RequestParam(value = "channelType",defaultValue = "0") Integer channelType,
+										   @RequestParam(value = "channelId",defaultValue = "0") Integer channelId,
 										   @RequestParam("colorId") Integer colorId
 	) throws Exception {
+		if(channelType > 0 && channelId > 0){
+			ChannelPrice channelPrice = new ChannelPrice();
+			channelPrice.setChannelId(channelId);
+			channelPrice.setChannelType(channelType);
+			channelPrice.setColorId(colorId);
+			List<ChannelPrice> channelPriceList = channelPriceService.getChannelPriceList(channelPrice);
+		}
 
 		ResultMsg remsg = new ResultMsg();
 		Member member =  WechatUtils.getUserBySession(request);
@@ -749,56 +754,6 @@ public class ProductInfoHandler {
 	}
 
 	/**
-	 * 根据产品类型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
 	 * @return