diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/MyOrderController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/MyOrderController.java index b6d20ec..beb31f0 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/MyOrderController.java +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/MyOrderController.java @@ -87,7 +87,7 @@ public class MyOrderController { @ApiOperation(value = "根据订单号获取订单详情信息") public ServerResponseEntity orderDetail(@RequestParam(value = "orderNumber") String orderNumber) { - String userId = SecurityUtils.getCurrentInfo().getAccountId(); +// String userId = SecurityUtils.getCurrentInfo().getAccountId(); OrderShopDto orderShopDto = new OrderShopDto(); Order order = orderService.getOrderByOrderNumber(orderNumber); diff --git a/nakadai/src/main/java/com/huoran/nakadai/controller/ProductController.java b/nakadai/src/main/java/com/huoran/nakadai/controller/ProductController.java index 91a3476..5ecaf89 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/controller/ProductController.java +++ b/nakadai/src/main/java/com/huoran/nakadai/controller/ProductController.java @@ -19,6 +19,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.huoran.common.exception.YamiShopBindException; import com.huoran.common.response.R; import com.huoran.common.response.ServerResponseEntity; +import com.huoran.common.utils.SecurityUtils; import com.huoran.common.utils.TokenUtils; import com.huoran.nakadai.entity.model.Product; import com.huoran.nakadai.entity.model.Sku; @@ -90,10 +91,14 @@ public class ProductController { if (productPageReq.getSize()!= null){ page.setSize(productPageReq.getSize()); } + Integer shopId = SecurityUtils.getCurrentInfo().getShopId(); + if (productPageReq.getShopId()!= null){ + shopId = productPageReq.getShopId(); + } IPage products = productService.page(page, new LambdaQueryWrapper() .like(StrUtil.isNotBlank(productPageReq.getProdName()), Product::getProdName, productPageReq.getProdName()) - .eq(Product::getShopId, TokenUtils.getShopIdByJwtToken(request)) + .eq(Product::getShopId, shopId) .eq(productPageReq.getStatus() != null, Product::getStatus, productPageReq.getStatus()) .orderByDesc(Product::getPutawayTime)); List productCount = productService.selectCount(TokenUtils.getShopIdByJwtToken(request)); diff --git a/nakadai/src/main/java/com/huoran/nakadai/entity/req/ProductPageReq.java b/nakadai/src/main/java/com/huoran/nakadai/entity/req/ProductPageReq.java index 142c662..4fd4ade 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/entity/req/ProductPageReq.java +++ b/nakadai/src/main/java/com/huoran/nakadai/entity/req/ProductPageReq.java @@ -13,9 +13,12 @@ public class ProductPageReq { @ApiModelProperty(value = "当前页,默认1") private Integer current = 1; - @ApiModelProperty(value = "默认是0,表示上架, 2下架,3草稿,4审核") + @ApiModelProperty(value = "默认是1,表示上架, 2下架,3草稿,4审核,0为删除") private Integer status; @ApiModelProperty(value = "商品名称") private String prodName; + + @ApiModelProperty(value = "店铺id") + private Integer shopId; } diff --git a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/OrderMapper.xml b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/OrderMapper.xml index 1a22a3d..b24ccb9 100644 --- a/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/OrderMapper.xml +++ b/nakadai/src/main/java/com/huoran/nakadai/mapper/xml/OrderMapper.xml @@ -368,7 +368,7 @@ o.order_number, o.create_time, o.order_type, - GROUP_CONCAT( oi.sku_name ) AS content, + GROUP_CONCAT( oi.prod_name SEPARATOR '、' ) AS content, sum( oi.prod_count ) AS num, CASE WHEN o.order_type = 2 THEN @@ -380,7 +380,7 @@ WHEN o.order_type = 2 THEN kpt.logo_url WHEN o.order_type = 1 THEN - ui.user_avatars + avatars.user_avatars END AS logo FROM tz_order o @@ -394,6 +394,14 @@ LEFT JOIN k_platform_team_account pta ON pta.account_id = ua.id LEFT JOIN k_platform_team kp ON kp.manage_id = pta.manage_id LEFT JOIN k_platform_team_classification kpt ON kpt.id = kp.classification_id + LEFT JOIN ( + SELECT + a.app_open_id, + i.user_avatars + FROM + hr_user_account a + JOIN hr_user_info i ON i.user_id = a.user_id AND a.platform_id = 7 and a.is_del = 0 and i.is_del = 0 + ) avatars ON avatars.app_open_id = ua.app_open_id WHERE o.shop_id = #{orderParam.shopId} @@ -418,7 +426,7 @@ o.order_number, o.create_time, o.order_type, - GROUP_CONCAT( oi.sku_name ) AS content, + GROUP_CONCAT( oi.prod_name SEPARATOR '、' ) AS content, sum( oi.prod_count ) AS num, CASE WHEN o.order_type = 2 THEN @@ -430,7 +438,7 @@ WHEN o.order_type = 2 THEN kpt.logo_url WHEN o.order_type = 1 THEN - ui.user_avatars + avatars.user_avatars END AS logo FROM tz_order o @@ -444,6 +452,14 @@ LEFT JOIN k_platform_team_account pta ON pta.account_id = ua.id LEFT JOIN k_platform_team kp ON kp.manage_id = pta.manage_id LEFT JOIN k_platform_team_classification kpt ON kpt.id = kp.classification_id + LEFT JOIN ( + SELECT + a.app_open_id, + i.user_avatars + FROM + hr_user_account a + JOIN hr_user_info i ON i.user_id = a.user_id AND a.platform_id = 7 and a.is_del = 0 and i.is_del = 0 + ) avatars ON avatars.app_open_id = ua.app_open_id WHERE o.user_id = #{orderParam.userId}