Quellcode durchsuchen

添加客户基本信息

dujinyan vor 7 Jahren
Ursprung
Commit
7c510553c2

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

@@ -68,6 +68,20 @@ public interface CustomerBasicInfoSaveService {
      */
     public List<City> queryCityList(String provinceId);
 
+    /**
+     * 查询所有渠道类别
+     * @param channelCategoryId
+     * @return
+     */
+    public List<ChannelDivisionInfo> queryChannelCategoryList(String channelCategoryId);
+
+    /**
+     * 根据渠道类别查询渠道类型
+     * @param channelCategoryId
+     * @return
+     */
+    public List<ChannelDivisionInfo> queryChannelTypeList(String channelCategoryId);
+
 
     /**
      * 添加对接联系人信息

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

@@ -91,6 +91,14 @@ public class CustomerBasicInfoSaveServiceImpl implements CustomerBasicInfoSaveSe
     public List<City> queryCityList(String provinceId){
         return (List<City>)customerBasicInfoSaveMapper.queryCityList(provinceId);
     }
+
+    public List<ChannelDivisionInfo> queryChannelCategoryList(String channelCategoryId){
+        return (List<ChannelDivisionInfo>)customerBasicInfoSaveMapper.queryChannelCategoryList(channelCategoryId);
+    }
+
+    public List<ChannelDivisionInfo> queryChannelTypeList(String channelCategoryId){
+        return (List<ChannelDivisionInfo>)customerBasicInfoSaveMapper.queryChannelTypeList(channelCategoryId);
+    }
     /*@Override
     public void saveDockedContactInfo(DockedContactInfo dockedContactInfo) {
         customerBasicInfoSaveMapper.saveDockedContactInfo(dockedContactInfo);

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

@@ -98,4 +98,19 @@ public interface CustomerBasicInfoSaveMapper {
      */
     public List<City> queryCityList(String provinceId);
 
+    /**
+     * 查询所有渠道类别
+     * @param channelCategoryId
+     * @return
+     */
+    public List<ChannelDivisionInfo> queryChannelCategoryList(String channelCategoryId);
+
+    /**
+     * 根据渠道类别查询渠道类型
+     * @param channelCategoryId
+     * @return
+     */
+    public List<ChannelDivisionInfo> queryChannelTypeList(String channelCategoryId);
+
+
 }

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

@@ -71,6 +71,17 @@
         <result property="city" column="city" />
         <!--<result property="provinceNum" column="provinceid" />-->
     </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"/>
+        <result property="channelType" column="channel_type" />
+    </resultMap>
     <!--映射结果集 end-->
 
     <!--新增部分 start-->
@@ -227,7 +238,35 @@
         t.city
         FROM
         tb_rst_address_city t
+        WHERE
+        t.province_id = #{id}
         ORDER BY
         t.city_id ASC
     </select>
+    <!--查询所有渠道类别-->
+    <select id="queryChannelCategoryList" parameterType="java.lang.String" resultMap="queryChannelCategoryResult">
+        SELECT  t.channel_division_id,t.channel_category,
+            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
+        ORDER BY
+        t.channel_division_id ASC
+    </select>
+    <!--根据渠道类别查询渠道类型-->
+    <select id="queryChannelTypeList" parameterType="java.lang.String" resultMap="queryChannelTypeResult">
+        SELECT
+        t.channel_division_id,
+        t.channel_type
+        FROM
+        tb_rst_channel_division_info t
+        WHERE
+        t.channel_category = #{id}
+        ORDER BY
+        t.channel_division_id ASC
+    </select>
 </mapper>

+ 48 - 9
watero-rst-web/src/main/java/com/iamberry/rst/controllers/customer/CustomerBasicInfoSaveController.java

@@ -130,16 +130,16 @@ public class CustomerBasicInfoSaveController {
     @ResponseBody
     @RequestMapping(value = "/query_provinceList")
     public ResponseJson queryProvinceList(HttpServletRequest request) {
-        Province province = new Province();
+        //Province province = new Province();
         String provinceId =  request.getParameter("provinceListInfo");
         List<Province> provinceList = null;
         provinceList = customerBasicInfoSaveService.queryProvinceList(provinceId);
-        if (provinceList == null || provinceList.size() < 1) {
-            return new ResponseJson(500, "查询失败", 500);
-        } else {
+        if (provinceList != null || provinceList.size() > 0) {
             ResponseJson rj =new ResponseJson(200, "查询成功", 200);
             rj.addResponseKeyValue("provinceList", provinceList);
             return rj;
+        } else {
+            return new ResponseJson(500, "查询失败", 500);
         }
     }
 
@@ -151,19 +151,58 @@ public class CustomerBasicInfoSaveController {
     @ResponseBody
     @RequestMapping(value = "/query_cityList")
     public ResponseJson queryCityList(HttpServletRequest request) {
-        Province province = new Province();
-        String provinceId =  request.getParameter("cityList");
+        //Province province = new Province();
+        String provinceId =  request.getParameter("provinceId");
         List<City> cityList = null;
         cityList = customerBasicInfoSaveService.queryCityList(provinceId);
-        if (cityList == null || cityList.size() < 1) {
-            return new ResponseJson(500, "查询失败", 500);
-        } else {
+        if (cityList != null || cityList.size() > 0) {
             ResponseJson rj =new ResponseJson(200, "查询成功", 200);
             rj.addResponseKeyValue("cityList", cityList);
             return rj;
+        } else {
+            return new ResponseJson(500, "查询失败", 500);
         }
     }
 
+    /**
+     * 查询所有渠道类别
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/query_channelCategoryList")
+    public ResponseJson queryChannelCategoryList(HttpServletRequest request) {
+        String channelCategoryId =  request.getParameter("provinceListInfo");
+        List<ChannelDivisionInfo> channelCategoryList = null;
+        channelCategoryList = customerBasicInfoSaveService.queryChannelCategoryList(channelCategoryId);
+        if (channelCategoryList != null || channelCategoryList.size() > 0) {
+            ResponseJson rj =new ResponseJson(200, "查询成功", 200);
+            rj.addResponseKeyValue("provinceList", channelCategoryList);
+            return rj;
+        } else {
+            return new ResponseJson(500, "查询失败", 500);
+        }
+    }
+
+    /**
+     * 根据渠道类别查询渠道类型
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/query_channelTypeList")
+    public ResponseJson queryChannelTypeList(HttpServletRequest request) {
+        String channelCategoryId =  request.getParameter("channelCategory");
+        List<ChannelDivisionInfo> channelTypeList = null;
+        channelTypeList = customerBasicInfoSaveService.queryChannelTypeList(channelCategoryId);
+        if (channelTypeList != null || channelTypeList.size() > 0) {
+            ResponseJson rj =new ResponseJson(200, "查询成功", 200);
+            rj.addResponseKeyValue("channelTypeList", channelTypeList);
+            return rj;
+        } else {
+            return new ResponseJson(500, "查询失败", 500);
+        }
+    }
 
     /**
      * 验证方法