|
@@ -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;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 获取提货列表
|
|
|
* 主渠道下面所有的提货
|