供应商店铺查询

main
cheney 11 months ago
parent b9bdd8500b
commit 520ed8d28a
  1. 2
      nakadai/src/main/java/com/huoran/nakadai/controller/MyOrderController.java
  2. 7
      nakadai/src/main/java/com/huoran/nakadai/controller/ProductController.java
  3. 5
      nakadai/src/main/java/com/huoran/nakadai/entity/req/ProductPageReq.java
  4. 24
      nakadai/src/main/java/com/huoran/nakadai/mapper/xml/OrderMapper.xml

@ -87,7 +87,7 @@ public class MyOrderController {
@ApiOperation(value = "根据订单号获取订单详情信息") @ApiOperation(value = "根据订单号获取订单详情信息")
public ServerResponseEntity<OrderShopDto> orderDetail(@RequestParam(value = "orderNumber") String orderNumber) { public ServerResponseEntity<OrderShopDto> orderDetail(@RequestParam(value = "orderNumber") String orderNumber) {
String userId = SecurityUtils.getCurrentInfo().getAccountId(); // String userId = SecurityUtils.getCurrentInfo().getAccountId();
OrderShopDto orderShopDto = new OrderShopDto(); OrderShopDto orderShopDto = new OrderShopDto();
Order order = orderService.getOrderByOrderNumber(orderNumber); Order order = orderService.getOrderByOrderNumber(orderNumber);

@ -19,6 +19,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.huoran.common.exception.YamiShopBindException; import com.huoran.common.exception.YamiShopBindException;
import com.huoran.common.response.R; import com.huoran.common.response.R;
import com.huoran.common.response.ServerResponseEntity; import com.huoran.common.response.ServerResponseEntity;
import com.huoran.common.utils.SecurityUtils;
import com.huoran.common.utils.TokenUtils; import com.huoran.common.utils.TokenUtils;
import com.huoran.nakadai.entity.model.Product; import com.huoran.nakadai.entity.model.Product;
import com.huoran.nakadai.entity.model.Sku; import com.huoran.nakadai.entity.model.Sku;
@ -90,10 +91,14 @@ public class ProductController {
if (productPageReq.getSize()!= null){ if (productPageReq.getSize()!= null){
page.setSize(productPageReq.getSize()); page.setSize(productPageReq.getSize());
} }
Integer shopId = SecurityUtils.getCurrentInfo().getShopId();
if (productPageReq.getShopId()!= null){
shopId = productPageReq.getShopId();
}
IPage<Product> products = productService.page(page, IPage<Product> products = productService.page(page,
new LambdaQueryWrapper<Product>() new LambdaQueryWrapper<Product>()
.like(StrUtil.isNotBlank(productPageReq.getProdName()), Product::getProdName, productPageReq.getProdName()) .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()) .eq(productPageReq.getStatus() != null, Product::getStatus, productPageReq.getStatus())
.orderByDesc(Product::getPutawayTime)); .orderByDesc(Product::getPutawayTime));
List<ProductCount> productCount = productService.selectCount(TokenUtils.getShopIdByJwtToken(request)); List<ProductCount> productCount = productService.selectCount(TokenUtils.getShopIdByJwtToken(request));

@ -13,9 +13,12 @@ public class ProductPageReq {
@ApiModelProperty(value = "当前页,默认1") @ApiModelProperty(value = "当前页,默认1")
private Integer current = 1; private Integer current = 1;
@ApiModelProperty(value = "默认是0,表示上架, 2下架,3草稿,4审核") @ApiModelProperty(value = "默认是1,表示上架, 2下架,3草稿,4审核,0为删除")
private Integer status; private Integer status;
@ApiModelProperty(value = "商品名称") @ApiModelProperty(value = "商品名称")
private String prodName; private String prodName;
@ApiModelProperty(value = "店铺id")
private Integer shopId;
} }

@ -368,7 +368,7 @@
o.order_number, o.order_number,
o.create_time, o.create_time,
o.order_type, o.order_type,
GROUP_CONCAT( oi.sku_name ) AS content, GROUP_CONCAT( oi.prod_name SEPARATOR '、' ) AS content,
sum( oi.prod_count ) AS num, sum( oi.prod_count ) AS num,
CASE CASE
WHEN o.order_type = 2 THEN WHEN o.order_type = 2 THEN
@ -380,7 +380,7 @@
WHEN o.order_type = 2 THEN WHEN o.order_type = 2 THEN
kpt.logo_url kpt.logo_url
WHEN o.order_type = 1 THEN WHEN o.order_type = 1 THEN
ui.user_avatars avatars.user_avatars
END AS logo END AS logo
FROM FROM
tz_order o 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_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 kp ON kp.manage_id = pta.manage_id
LEFT JOIN k_platform_team_classification kpt ON kpt.id = kp.classification_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 WHERE
o.shop_id = #{orderParam.shopId} o.shop_id = #{orderParam.shopId}
<if test="orderParam.queryCriteria != null and orderParam.queryCriteria != ''"> <if test="orderParam.queryCriteria != null and orderParam.queryCriteria != ''">
@ -418,7 +426,7 @@
o.order_number, o.order_number,
o.create_time, o.create_time,
o.order_type, o.order_type,
GROUP_CONCAT( oi.sku_name ) AS content, GROUP_CONCAT( oi.prod_name SEPARATOR '、' ) AS content,
sum( oi.prod_count ) AS num, sum( oi.prod_count ) AS num,
CASE CASE
WHEN o.order_type = 2 THEN WHEN o.order_type = 2 THEN
@ -430,7 +438,7 @@
WHEN o.order_type = 2 THEN WHEN o.order_type = 2 THEN
kpt.logo_url kpt.logo_url
WHEN o.order_type = 1 THEN WHEN o.order_type = 1 THEN
ui.user_avatars avatars.user_avatars
END AS logo END AS logo
FROM FROM
tz_order o 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_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 kp ON kp.manage_id = pta.manage_id
LEFT JOIN k_platform_team_classification kpt ON kpt.id = kp.classification_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 WHERE
o.user_id = #{orderParam.userId} o.user_id = #{orderParam.userId}
<if test="orderParam.queryCriteria != null and orderParam.queryCriteria != ''"> <if test="orderParam.queryCriteria != null and orderParam.queryCriteria != ''">

Loading…
Cancel
Save