wangxiaoming 6 éve
szülő
commit
17a2bebf09

+ 8 - 0
tooth-wechat-interface/src/main/java/com/iamberry/wechat/face/channel/ChannelPriceService.java

@@ -18,6 +18,14 @@ public interface ChannelPriceService {
     List<ChannelPrice> getChannelPriceList(ChannelPrice  channelPrice);
 
     /**
+     * 获取集合-渠道列表展示
+     * @param  channelPrice
+     * @return List
+     */
+
+    public List<ChannelPrice> getChannelProductList(ChannelPrice  channelPrice);
+
+    /**
      * 获取集合
      * @return List
      */

+ 10 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/channel/ChannelPriceServiceImpl.java

@@ -27,6 +27,16 @@ public class ChannelPriceServiceImpl  implements ChannelPriceService {
         return  channelPriceMapper.getChannelPriceList(channelPrice);
     }
 
+    /**
+     * 获取集合-渠道列表展示
+     * @param  channelPrice
+     * @return List
+     */
+    @Override
+    public List<ChannelPrice> getChannelProductList(ChannelPrice  channelPrice){
+        return  channelPriceMapper.getChannelProductList(channelPrice);
+    }
+
     @Override
     public ChannelPrice getChannelPriceByChannel(Integer channelId, Integer channelType, Integer colorId) {
         if(channelId>0 &&  channelType>0 && colorId > 0){

+ 8 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/ChannelPriceMapper.java

@@ -16,6 +16,14 @@ public interface ChannelPriceMapper {
      * @return List
      */
     List<ChannelPrice> getChannelPriceList(ChannelPrice channelPrice);
+
+    /**
+     * 获取集合-渠道列表展示
+     * @param  channelPrice
+     * @return List
+     */
+    public List<ChannelPrice> getChannelProductList(ChannelPrice  channelPrice);
+
     /**
      * 查询单条数据
      * @param  id

+ 29 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/channelPriceMapper.xml

@@ -52,6 +52,35 @@
             </if >
         </where>
     </select>
+
+    <select id="getChannelProductList" resultMap="BaseResultMap" parameterType="ChannelPrice" >
+        select
+        <include refid="Base_List" />
+        from tb_iamberry_channel_price t
+        <where>
+            <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 >
+            <if test="productId != null ">
+                AND t.product_id = #{productId}
+            </if >
+            <if test="colorId != null ">
+                AND t.color_id = #{colorId}
+            </if >
+            <if test="channelPriceStatus != null ">
+                AND t.channel_price_status = #{channelPriceStatus}
+            </if >
+        </where>
+        GROUP BY t.product_id
+        ORDER BY t.channel_price_id
+    </select>
+
     <select id="getChannelPriceById" resultMap="BaseResultMap" parameterType="Integer" >
         select
         <include refid="Base_List" />

+ 1 - 4
tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/apparatus/ApparatusHandler.java

@@ -98,10 +98,7 @@ public class ApparatusHandler {
     public ResultMsg sendPhone(HttpServletRequest request,String phone) throws Exception {
         ResultMsg msg = new ResultMsg();
 
-        String regExp = "^((13[0-9])|(15[0-9])|(18[0-9])|(17[0-9])|(147))\\d{8}$";
-        Pattern p = Pattern.compile(regExp);
-        Matcher m = p.matcher(phone);
-        if(!m.matches()){
+        if(phone.length() != 11){
             msg.setMessage("电话号码错误!");
             return msg;
         }

+ 47 - 0
tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/channel/ChannelAdminHandler.java

@@ -3,17 +3,21 @@ package com.iamberry.wechat.handles.channel;
 import com.iamberry.wechat.core.entity.ResultMsg;
 import com.iamberry.wechat.core.entity.WechatUtils;
 import com.iamberry.wechat.core.entity.channel.ChannelAdmin;
+import com.iamberry.wechat.core.entity.channel.ChannelPrice;
 import com.iamberry.wechat.core.entity.channel.ChildChannel;
 import com.iamberry.wechat.core.entity.member.Member;
 import com.iamberry.wechat.core.entity.order.Order;
 import com.iamberry.wechat.core.entity.order.OrderItem;
 import com.iamberry.wechat.core.entity.page.PageRequest;
 import com.iamberry.wechat.core.entity.page.PagedResult;
+import com.iamberry.wechat.core.entity.product.Product;
 import com.iamberry.wechat.core.entity.receive.ChargerReceive;
 import com.iamberry.wechat.face.channel.ChannelAdminService;
+import com.iamberry.wechat.face.channel.ChannelPriceService;
 import com.iamberry.wechat.face.channel.MainChannelService;
 import com.iamberry.wechat.face.member.MemberService;
 import com.iamberry.wechat.face.order.AdminOrderService;
+import com.iamberry.wechat.face.porduct.ProductService;
 import com.iamberry.wechat.tools.ResultInfo;
 import com.iamberry.wechat.utils.StitchAttrUtil;
 import com.sun.org.apache.xpath.internal.operations.Bool;
@@ -49,6 +53,49 @@ public class ChannelAdminHandler {
     @Autowired
     private AdminOrderService adminOrderService;
 
+    @Autowired
+    private ChannelPriceService channelPriceService;
+
+    @Autowired
+    private ProductService productService;
+
+    /**
+     * 获取当前渠道管理员下面的代理产品-以产品展示
+     * @param request
+     * @return
+     * @throws Exception
+     */
+    @ResponseBody
+    @RequestMapping(value = "/getProductList")
+    public ResultMsg getProductList(HttpServletRequest request,
+                                    @RequestParam(value= "channelType",defaultValue= "0" ,required=false) Integer channelType,
+                                    @RequestParam(value= "channelId",defaultValue= "0" ,required=false) Integer channelId
+    ) throws Exception {
+        ResultMsg msg = ResultMsg.getError();
+
+        if(channelType == 0 || channelId == 0){
+            msg.setMessage("网络错误,请重试!");
+            return msg;
+        }
+
+        ChannelPrice channelPrice = new ChannelPrice();
+        channelPrice.setChannelType(channelType);
+        channelPrice.setChannelId(channelId);
+        List<ChannelPrice> channelPriceList = channelPriceService.getChannelProductList(channelPrice);
+
+        List<Product> productList = new ArrayList<>();
+        for (ChannelPrice cp : channelPriceList){
+            Product product = productService.selectProductByProductId(cp.getProductId());
+            product.setColorId(cp.getColorId());
+            productList.add(product);
+        }
+
+        msg = ResultMsg.getSuccess();
+        msg.setData(productList);
+        return msg;
+    }
+
+
     /**
      *  获取提货列表
      *  主渠道下面所有的提货