소스 검색

添加客户基本信息

dujinyan 7 년 전
부모
커밋
ed69f41b40

+ 17 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/customer/CustomerBasicInfoSaveService.java

@@ -5,6 +5,9 @@ import com.iamberry.rst.core.address.*;
 import com.iamberry.rst.core.address.City;
 import com.iamberry.rst.core.address.Province;
 import com.iamberry.rst.core.customer.*;
+import com.iamberry.rst.core.order.Product;
+import com.iamberry.rst.core.order.ProductColor;
+import com.iamberry.rst.core.order.ProductType;
 
 import java.util.List;
 
@@ -82,6 +85,20 @@ public interface CustomerBasicInfoSaveService {
      */
     public List<ChannelDivisionInfo> queryChannelTypeList(String channelCategoryId);
 
+    /**
+     * 查询销售产品
+     * @param promotingProductsInfo
+     * @return
+     */
+    public List<Product> queryPromotingProductsList(String promotingProductsInfo);
+
+    /**
+     * 根据产品初始化价格
+     * @param promotingProductsId
+     * @return
+     */
+    public List<ProductColor> querySupplyPriceList(String promotingProductsId);
+
 
     /**
      * 添加对接联系人信息

+ 10 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/customer/CustomerBasicInfoSaveServiceImpl.java

@@ -4,6 +4,8 @@ import com.iamberry.rst.core.address.*;
 import com.iamberry.rst.core.address.City;
 import com.iamberry.rst.core.address.Province;
 import com.iamberry.rst.core.customer.*;
+import com.iamberry.rst.core.order.Product;
+import com.iamberry.rst.core.order.ProductColor;
 import com.iamberry.rst.faces.customer.CustomerBasicInfoSaveService;
 import com.iamberry.rst.service.customer.mapper.CustomerBasicInfoSaveMapper;
 import org.slf4j.Logger;
@@ -99,6 +101,14 @@ public class CustomerBasicInfoSaveServiceImpl implements CustomerBasicInfoSaveSe
     public List<ChannelDivisionInfo> queryChannelTypeList(String channelCategoryId){
         return (List<ChannelDivisionInfo>)customerBasicInfoSaveMapper.queryChannelTypeList(channelCategoryId);
     }
+
+    public List<Product> queryPromotingProductsList(String promotingProductsInfo){
+        return (List<Product>)customerBasicInfoSaveMapper.queryPromotingProductsList(promotingProductsInfo);
+    }
+
+    public List<ProductColor> querySupplyPriceList(String promotingProductsId){
+        return (List<ProductColor>)customerBasicInfoSaveMapper.querySupplyPriceList(promotingProductsId);
+    }
     /*@Override
     public void saveDockedContactInfo(DockedContactInfo dockedContactInfo) {
         customerBasicInfoSaveMapper.saveDockedContactInfo(dockedContactInfo);

+ 14 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/customer/mapper/CustomerBasicInfoSaveMapper.java

@@ -3,6 +3,8 @@ package com.iamberry.rst.service.customer.mapper;
 import com.iamberry.rst.core.address.City;
 import com.iamberry.rst.core.address.Province;
 import com.iamberry.rst.core.customer.*;
+import com.iamberry.rst.core.order.Product;
+import com.iamberry.rst.core.order.ProductColor;
 
 import java.util.List;
 
@@ -112,5 +114,17 @@ public interface CustomerBasicInfoSaveMapper {
      */
     public List<ChannelDivisionInfo> queryChannelTypeList(String channelCategoryId);
 
+    /**
+     * 查询销售产品
+     * @param promotingProductsInfo
+     * @return
+     */
+    public List<Product> queryPromotingProductsList(String promotingProductsInfo);
 
+    /**
+     * 查询销售产品价格
+     * @param promotingProductsId
+     * @return
+     */
+    public List<ProductColor> querySupplyPriceList(String promotingProductsId);
 }

+ 45 - 6
watero-rst-service/src/main/java/com/iamberry/rst/service/customer/mapper/CustomerBasicInfoSaveMapper.xml

@@ -73,14 +73,24 @@
     </resultMap>
     <!--查询所有渠道类别-->
     <resultMap type="com.iamberry.rst.core.customer.ChannelDivisionInfo" id="queryChannelCategoryResult">
-        <id property="channelDivisionId" column="channel_division_id"/>
         <result property="channelCategory" column="channel_category" />
         <result property="channelName" column="channel_categoryId" />
     </resultMap>
     <!--根据渠道类别查询渠道类型-->
     <resultMap type="com.iamberry.rst.core.customer.ChannelDivisionInfo" id="queryChannelTypeResult">
-        <id property="channelDivisionId" column="channel_division _id"/>
+        <!--<id property="channelDivisionId" column="channel_division_id"/>-->
         <result property="channelType" column="channel_type" />
+        <result property="channelName" column="channel_categoryId" />
+    </resultMap>
+    <!--查询销售产品-->
+    <resultMap type="com.iamberry.rst.core.order.Product" id="queryPromotingProductsResult">
+        <id property="productId" column="product_id"/>
+        <result property="productName" column="product_name" />
+    </resultMap>
+    <!--查询销售产品价格-->
+    <resultMap type="com.iamberry.rst.core.order.ProductColor" id="querySupplyPriceResult">
+        <result property="colorId" column="color_id" />
+        <result property="colorPrice" column="color_price" />
     </resultMap>
     <!--映射结果集 end-->
 
@@ -245,9 +255,10 @@
     </select>
     <!--查询所有渠道类别-->
     <select id="queryChannelCategoryList" parameterType="java.lang.String" resultMap="queryChannelCategoryResult">
-        SELECT  t.channel_division_id,t.channel_category,
+        SELECT
+            DISTINCT (t.channel_category),
             CASE
-            WHEN    t.channel_category = 1 THEN '电商'
+            WHEN t.channel_category = 1 THEN '电商'
             WHEN t.channel_category = 2 THEN '特殊渠道'
             WHEN t.channel_category = 3 THEN '线下'
             ELSE '海外'
@@ -260,8 +271,14 @@
     <!--根据渠道类别查询渠道类型-->
     <select id="queryChannelTypeList" parameterType="java.lang.String" resultMap="queryChannelTypeResult">
         SELECT
-        t.channel_division_id,
-        t.channel_type
+        /*t.channel_division_id,*/
+        DISTINCT (t.channel_type),
+        CASE
+            WHEN t.channel_category = 1 THEN '电商'
+            WHEN t.channel_category = 2 THEN '特殊渠道'
+            WHEN t.channel_category = 3 THEN '线下'
+            ELSE '海外'
+            END AS 'channel_categoryId'
         FROM
         tb_rst_channel_division_info t
         WHERE
@@ -269,4 +286,26 @@
         ORDER BY
         t.channel_division_id ASC
     </select>
+    <!--查询销售产品-->
+    <select id="queryPromotingProductsList" parameterType="java.lang.String" resultMap="queryPromotingProductsResult">
+        SELECT
+        t.product_id,
+        t.product_name
+        FROM
+        tb_rst_product_info t
+        ORDER BY
+        t.product_id ASC
+    </select>
+    <!--查询销售产品价格-->
+    <select id="querySupplyPriceList" parameterType="java.lang.String" resultMap="querySupplyPriceResult">
+        SELECT
+        t.color_id,
+        t.color_price
+        FROM
+        tb_rst_product_color t
+        WHERE
+        t.color_product_id = #{id}
+        ORDER BY
+        t.color_id ASC
+    </select>
 </mapper>

+ 46 - 3
watero-rst-web/src/main/java/com/iamberry/rst/controllers/customer/CustomerBasicInfoSaveController.java

@@ -3,6 +3,9 @@ package com.iamberry.rst.controllers.customer;
 import com.iamberry.rst.core.address.City;
 import com.iamberry.rst.core.address.Province;
 import com.iamberry.rst.core.customer.*;
+import com.iamberry.rst.core.order.Product;
+import com.iamberry.rst.core.order.ProductColor;
+import com.iamberry.rst.core.order.ProductType;
 import com.iamberry.rst.faces.customer.CustomerBasicInfoSaveService;
 import com.iamberry.wechat.tools.ResponseJson;
 import org.apache.commons.lang.StringUtils;
@@ -172,12 +175,12 @@ public class CustomerBasicInfoSaveController {
     @ResponseBody
     @RequestMapping(value = "/query_channelCategoryList")
     public ResponseJson queryChannelCategoryList(HttpServletRequest request) {
-        String channelCategoryId =  request.getParameter("provinceListInfo");
+        String channelCategoryId =  request.getParameter("channelCategoryId");
         List<ChannelDivisionInfo> channelCategoryList = null;
         channelCategoryList = customerBasicInfoSaveService.queryChannelCategoryList(channelCategoryId);
         if (channelCategoryList != null || channelCategoryList.size() > 0) {
             ResponseJson rj =new ResponseJson(200, "查询成功", 200);
-            rj.addResponseKeyValue("provinceList", channelCategoryList);
+            rj.addResponseKeyValue("channelCategoryList", channelCategoryList);
             return rj;
         } else {
             return new ResponseJson(500, "查询失败", 500);
@@ -192,7 +195,7 @@ public class CustomerBasicInfoSaveController {
     @ResponseBody
     @RequestMapping(value = "/query_channelTypeList")
     public ResponseJson queryChannelTypeList(HttpServletRequest request) {
-        String channelCategoryId =  request.getParameter("channelCategory");
+        String channelCategoryId =  request.getParameter("channelCategoryId");
         List<ChannelDivisionInfo> channelTypeList = null;
         channelTypeList = customerBasicInfoSaveService.queryChannelTypeList(channelCategoryId);
         if (channelTypeList != null || channelTypeList.size() > 0) {
@@ -205,6 +208,46 @@ public class CustomerBasicInfoSaveController {
     }
 
     /**
+     * 初始化销售产品
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/query_promotingProductsList")
+    public ResponseJson queryPromotingProductsList(HttpServletRequest request) {
+        String promotingProductsInfo =  request.getParameter("promotingProductsInfo");
+        List<Product> promotingProductsList = null;
+        promotingProductsList = customerBasicInfoSaveService.queryPromotingProductsList(promotingProductsInfo);
+        if (promotingProductsList != null || promotingProductsList.size() > 0) {
+            ResponseJson rj =new ResponseJson(200, "查询成功", 200);
+            rj.addResponseKeyValue("promotingProductsList", promotingProductsList);
+            return rj;
+        } else {
+            return new ResponseJson(500, "查询失败", 500);
+        }
+    }
+
+    /**
+     * 根据销售产品初始化价格
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/query_supplyPriceList")
+    public ResponseJson querySupplyPriceList(HttpServletRequest request) {
+        String promotingProductsId =  request.getParameter("promotingProductsId");
+        List<ProductColor> supplyPriceList = null;
+        supplyPriceList = customerBasicInfoSaveService.querySupplyPriceList(promotingProductsId);
+        if (supplyPriceList != null || supplyPriceList.size() > 0) {
+            ResponseJson rj =new ResponseJson(200, "查询成功", 200);
+            rj.addResponseKeyValue("supplyPriceList", supplyPriceList);
+            return rj;
+        } else {
+            return new ResponseJson(500, "查询失败", 500);
+        }
+    }
+
+    /**
      * 验证方法
      *
      * @param customerBasicInfo