增加商家版查询订单接口
This commit is contained in:
parent
fa087d32ad
commit
7b29201939
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.common.modules.order.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "MchOrderBuyerDTO 对象", description = "商家版订单里的买家实体类")
|
||||
public class MchOrderBuyerDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
// 买家信息
|
||||
@ApiModelProperty(value = "买家编号")
|
||||
private Integer buyer_user_id;
|
||||
|
||||
@ApiModelProperty(value = "买家姓名")
|
||||
private String da_name;
|
||||
|
||||
@ApiModelProperty(value = "买家手机号")
|
||||
private String da_mobile;
|
||||
|
||||
@ApiModelProperty(value = "买家留言备注")
|
||||
private String order_message;
|
||||
|
||||
@ApiModelProperty(value = "买家收货地址维度")
|
||||
private String da_latitude;
|
||||
|
||||
@ApiModelProperty(value = "买家收货地址经度")
|
||||
private String da_longitude;
|
||||
|
||||
@ApiModelProperty(value = "省份")
|
||||
private String da_province;
|
||||
|
||||
@ApiModelProperty(value = "城市")
|
||||
private String da_city;
|
||||
|
||||
@ApiModelProperty(value = "县乡镇")
|
||||
private String da_county;
|
||||
|
||||
@ApiModelProperty(value = "买家收货地址")
|
||||
private String da_address;
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.common.modules.order.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "MchOrderInfoDTO 对象", description = "商家版订单信息实体类")
|
||||
public class MchOrderInfoDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
// 买家信息
|
||||
MchOrderBuyerDTO buyer_info;
|
||||
// 店铺信息
|
||||
MchOrderStoreDTO store_info;
|
||||
// 订单里的商品信息
|
||||
List<MchOrderItemDTO> order_items;
|
||||
// 顺丰同城配送信息
|
||||
MchSFOrderDTO sf_order_info;
|
||||
|
||||
// 订单信息
|
||||
@ApiModelProperty(value = "订单编号")
|
||||
private String order_id;
|
||||
@ApiModelProperty(value = "订单标题")
|
||||
private String order_title;
|
||||
@ApiModelProperty(value = "同城配送取单号")
|
||||
private String order_pickup_num;
|
||||
@ApiModelProperty(value = "下单时间")
|
||||
private Date order_time;
|
||||
@ApiModelProperty(value = "支付时间")
|
||||
private Date payment_time;
|
||||
@ApiModelProperty(value = "预计达到时间戳")
|
||||
private Long arrival_time;
|
||||
@ApiModelProperty(value = "订单原价")
|
||||
private BigDecimal order_product_amount;
|
||||
@ApiModelProperty(value = "应付金额/应支付金额:order_goods_amount - order_discount_amount + order_shipping_fee - order_voucher_price - order_points_fee - order_adjust_fee")
|
||||
private BigDecimal order_payment_amount;
|
||||
@ApiModelProperty(value = "货币编号")
|
||||
private Integer currency_id;
|
||||
@ApiModelProperty(value = "订单状态(LIST):2011-待订单审核;2013-待财务审核;2020-待配货/待出库审核;2030-待发货;2040-已发货/待收货确认;2060-已完成/已签收;2070-已取消/已作废;")
|
||||
private Integer order_state_id;
|
||||
@ApiModelProperty(value = "配送方式: 1-快递配送(运费 10 元)5-自提;10-普通快递;16-顺丰同城;")
|
||||
private Integer delivery_type_id;
|
||||
@ApiModelProperty(value = "订单运费")
|
||||
private BigDecimal order_shipping_fee;
|
||||
@ApiModelProperty(value = "两点距离,单位米")
|
||||
private Integer distance;
|
||||
|
||||
// 快递鸟物流信息
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.common.modules.order.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "MchOrderItemDTO 对象", description = "商家版订单商品子项实体类")
|
||||
public class MchOrderItemDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
// 店铺信息
|
||||
@ApiModelProperty(value = "产品编号")
|
||||
private Long product_id;
|
||||
|
||||
@ApiModelProperty(value = "货品编号")
|
||||
private Integer item_id;
|
||||
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
private String item_name;
|
||||
|
||||
@ApiModelProperty(value = "商品数量")
|
||||
private Integer order_item_quantity;
|
||||
|
||||
@ApiModelProperty(value = "商品价格单价")
|
||||
private BigDecimal item_unit_price;
|
||||
|
||||
@ApiModelProperty(value = "商品成本金额")
|
||||
private BigDecimal item_cost_price;
|
||||
|
||||
@ApiModelProperty(value = "商品条码")
|
||||
private String item_barcode;
|
||||
|
||||
@ApiModelProperty(value = "商品图片")
|
||||
private String order_item_image;
|
||||
|
||||
@ApiModelProperty(value = "商品规格描述")
|
||||
private String spec_info;
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.common.modules.order.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "MchOrderStoreDTO 对象", description = "商家版订单里的店铺实体类")
|
||||
public class MchOrderStoreDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
// 店铺信息
|
||||
@ApiModelProperty(value = "卖家店铺编号")
|
||||
private Integer store_id;
|
||||
@ApiModelProperty(value = "卖家店铺名称")
|
||||
private String store_name;
|
||||
@ApiModelProperty(value = "卖家店铺名称")
|
||||
private String store_logo;
|
||||
@ApiModelProperty(value = "卖家店铺维度")
|
||||
private String store_latitude;
|
||||
@ApiModelProperty(value = "卖家店铺经度")
|
||||
private String store_longitude;
|
||||
@ApiModelProperty(value = "卖家店铺地址")
|
||||
private String store_area;
|
||||
@ApiModelProperty(value = "卖家店铺地址")
|
||||
private String store_address;
|
||||
@ApiModelProperty(value = "卖家店铺等级ID")
|
||||
private String store_grade_id;
|
||||
@ApiModelProperty(value = "卖家店铺等级")
|
||||
private String store_grade_name;
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.common.modules.order.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "MchSFOrderDTO 对象", description = "商家版顺丰订单信息实体类")
|
||||
public class MchSFOrderDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "顺丰订单号")
|
||||
private String sf_order_id;
|
||||
|
||||
@ApiModelProperty(value = "配送员姓名")
|
||||
private String operator_name;
|
||||
|
||||
@ApiModelProperty(value = "配送员手机号")
|
||||
private String operator_phone;
|
||||
|
||||
@ApiModelProperty(value = "配送员经度")
|
||||
private String rider_lng;
|
||||
|
||||
@ApiModelProperty(value = "配送员纬度")
|
||||
private String rider_lat;
|
||||
|
||||
@ApiModelProperty(value = "顺丰订单状态码")
|
||||
private String order_status;
|
||||
|
||||
@ApiModelProperty(value = "顺丰订单状态说明")
|
||||
private String status_desc;
|
||||
|
||||
@ApiModelProperty(value = "顺丰订单取消码")
|
||||
private String cancel_code;
|
||||
|
||||
@ApiModelProperty(value = "顺丰订单取消原因")
|
||||
private String cancel_reason;
|
||||
|
||||
@ApiModelProperty(value = "顺丰订单推送时间")
|
||||
private String push_time;
|
||||
|
||||
@ApiModelProperty(value = "顺丰订单配送轨迹H5页面URL")
|
||||
private String h5_url;
|
||||
|
||||
@ApiModelProperty(value = "顺丰订单状态流轨迹JSON格式")
|
||||
private String feed;
|
||||
|
||||
}
|
||||
@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
@ -23,10 +24,7 @@ import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
@ -219,6 +217,12 @@ public class UserOrderController extends BaseControllerImpl {
|
||||
return CommonResult.success(shopOrderBaseService.listsOrderAndsProduct(pageNum, pageSize));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询移动商家端订单数据(新)", notes = "查询移动商家端订单数据(新)")
|
||||
@RequestMapping(value = "/mch/order/list", method = RequestMethod.POST)
|
||||
public CommonResult selectMchOrderPageList(@RequestBody JSONObject params) {
|
||||
return CommonResult.success(shopOrderBaseService.selectMchOrderPageList(params.getInt("storeId"), params.getStr("keyword"), params.getInt("status"), params.getInt("pageNum"), params.getInt("pageSize")));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询移动商家端订单详情数据", notes = "查询移动商家端订单详情数据")
|
||||
@RequestMapping(value = "/getOrderDetail", method = RequestMethod.GET)
|
||||
public CommonResult getOrderDetail(@RequestParam(name = "order_id") String order_id) {
|
||||
|
||||
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.suisung.mall.common.modules.order.ShopOrderBase;
|
||||
import com.suisung.mall.common.modules.order.dto.MchOrderInfoDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@ -58,4 +59,14 @@ public interface ShopOrderBaseMapper extends BaseMapper<ShopOrderBase> {
|
||||
* @return
|
||||
*/
|
||||
Map getOrderPrintInfo(@Param("orderId") String orderId, Integer payState);
|
||||
|
||||
/**
|
||||
* 商家版订单列表(新)
|
||||
*
|
||||
* @param storeId 店铺Id
|
||||
* @param keyword 关键字
|
||||
* @param status 订单状态
|
||||
* @return
|
||||
*/
|
||||
IPage<MchOrderInfoDTO> selectMchOrderPageList(@Param("storeId") Integer storeId, @Param("keyword") String keyword, @Param("status") Integer status, IPage<MchOrderInfoDTO> page);
|
||||
}
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
package com.suisung.mall.shop.order.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
import com.suisung.mall.common.modules.order.ShopOrderBase;
|
||||
import com.suisung.mall.common.modules.order.ShopOrderInfo;
|
||||
import com.suisung.mall.common.modules.order.ShopOrderLogistics;
|
||||
import com.suisung.mall.common.modules.order.dto.MchOrderInfoDTO;
|
||||
import com.suisung.mall.common.pojo.req.SFCreateOrderReq;
|
||||
import com.suisung.mall.core.web.service.IBaseService;
|
||||
import com.suisung.mall.shop.order.vo.OrdeListVo;
|
||||
@ -530,4 +532,18 @@ public interface ShopOrderBaseService extends IBaseService<ShopOrderBase> {
|
||||
* @return
|
||||
*/
|
||||
SFCreateOrderReq buildSFOrderData(Integer devId, String orderId, Long orderPickupNum);
|
||||
|
||||
|
||||
/**
|
||||
* 商家版订单列表(新)
|
||||
*
|
||||
* @param storeId
|
||||
* @param keyword
|
||||
* @param status
|
||||
* @param pageNum
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
IPage<MchOrderInfoDTO> selectMchOrderPageList(Integer storeId, String keyword, Integer status, Integer pageNum, Integer pageSize);
|
||||
|
||||
}
|
||||
|
||||
@ -48,6 +48,7 @@ import com.suisung.mall.common.modules.invoicing.InvoicingStockBill;
|
||||
import com.suisung.mall.common.modules.invoicing.InvoicingStockBillItem;
|
||||
import com.suisung.mall.common.modules.invoicing.InvoicingWarehouseBase;
|
||||
import com.suisung.mall.common.modules.order.*;
|
||||
import com.suisung.mall.common.modules.order.dto.MchOrderInfoDTO;
|
||||
import com.suisung.mall.common.modules.pay.*;
|
||||
import com.suisung.mall.common.modules.product.ShopProductAnalytics;
|
||||
import com.suisung.mall.common.modules.product.ShopProductIndex;
|
||||
@ -8479,4 +8480,21 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
|
||||
|
||||
return sfCreateOrderReq;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商家版订单列表(新)
|
||||
*
|
||||
* @param storeId 店铺Id
|
||||
* @param keyword
|
||||
* @param status 1-进行中;2-异常配送(超时);3-退款的
|
||||
* @param pageNum 分页页码
|
||||
* @param pageSize 分页每页数量
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<MchOrderInfoDTO> selectMchOrderPageList(Integer storeId, String keyword, Integer status, Integer pageNum, Integer pageSize) {
|
||||
//订单状态(LIST):2011-待订单审核;2013-待财务审核;2020-待配货/待出库审核;2030-待发货;2040-已发货/待收货确认;2060-已完成/已签收;2070-已取消/已作废;
|
||||
Page<MchOrderInfoDTO> page = new Page<>(pageNum, pageSize);
|
||||
return shopOrderBaseMapper.selectMchOrderPageList(storeId, keyword, status, page);
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ public class ShopStoreBizCategoryAdminController extends BaseControllerImpl {
|
||||
return shopStoreBizCategoryService.modify(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "屏蔽店铺分类(类目)", notes = "屏蔽店铺分类(类目)")
|
||||
@ApiOperation(value = "屏蔽/开启店铺分类(类目)", notes = "屏蔽/开启店铺分类(类目)")
|
||||
@RequestMapping(value = "/status/modify", method = RequestMethod.POST)
|
||||
public CommonResult shopStoreBusinessCategoryDisable(@RequestBody JSONObject params) {
|
||||
return shopStoreBizCategoryService.modifyStatus(params);
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.suisung.mall.shop.order.mapper.ShopOrderBaseMapper">
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
order_id
|
||||
@ -170,24 +169,21 @@
|
||||
|
||||
<select id="statisticCount" resultType="java.util.Map">
|
||||
SELECT t1.curr_date,
|
||||
ifnull(t2.effective_count, 0) AS effective_count,
|
||||
ifnull(t3.cancel_count, 0) AS cancel_count
|
||||
FROM (
|
||||
SELECT @num := @num + 1 AS num,date_format( date_add( #{end}, INTERVAL - @num DAY ), '%m/%d' ) AS curr_date
|
||||
FROM account_base_config, ( SELECT @num := -1 ) t
|
||||
WHERE @num + 1 <= ( #{days} - 1)) t1
|
||||
LEFT JOIN (SELECT date_format(order_time, '%m/%d') AS curr_date, count(order_id) AS effective_count
|
||||
FROM shop_order_base
|
||||
where order_state_id != '2070'
|
||||
GROUP BY date_format(order_time, '%m/%d')
|
||||
) t2
|
||||
ON t1.curr_date = t2.curr_date
|
||||
LEFT JOIN (SELECT date_format(order_time, '%m/%d') AS curr_date2, count(order_id) AS cancel_count
|
||||
FROM shop_order_base
|
||||
where order_state_id = '2070'
|
||||
GROUP BY date_format(order_time, '%m/%d')
|
||||
) t3
|
||||
ON t1.curr_date = t3.curr_date2
|
||||
ifnull(t2.effective_count, 0) AS effective_count,
|
||||
ifnull(t3.cancel_count, 0) AS cancel_count
|
||||
FROM (SELECT @num := @num + 1 AS num,date_format( date_add( #{end}, INTERVAL - @num DAY ), '%m/%d' ) AS curr_date
|
||||
FROM account_base_config, ( SELECT @num := -1 ) t
|
||||
WHERE @num + 1 <= ( #{days} - 1)) t1
|
||||
LEFT JOIN (SELECT date_format(order_time, '%m/%d') AS curr_date, count(order_id) AS effective_count
|
||||
FROM shop_order_base
|
||||
where order_state_id != '2070'
|
||||
GROUP BY date_format(order_time, '%m/%d')) t2
|
||||
ON t1.curr_date = t2.curr_date
|
||||
LEFT JOIN (SELECT date_format(order_time, '%m/%d') AS curr_date2, count(order_id) AS cancel_count
|
||||
FROM shop_order_base
|
||||
where order_state_id = '2070'
|
||||
GROUP BY date_format(order_time, '%m/%d')) t3
|
||||
ON t1.curr_date = t3.curr_date2
|
||||
ORDER BY num desc
|
||||
</select>
|
||||
|
||||
@ -515,13 +511,13 @@
|
||||
<if test="subsite_id!=null and subsite_id!=0">
|
||||
and shop_order_info.subsite_id=#{subsite_id}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getOrderPrintInfo" resultType="java.util.Map">
|
||||
select
|
||||
a.order_id,a.store_id,a.store_name,a.buyer_user_id, a.buyer_user_name,a.order_time,a.order_payment_amount,a.order_product_amount,
|
||||
a.order_id,a.store_id,a.store_name,a.buyer_user_id,
|
||||
a.buyer_user_name,a.order_time,a.order_payment_amount,a.order_product_amount,
|
||||
b.order_title, b.delivery_type_id, b.payment_type_id, b.payment_time, b.order_pickup_num,
|
||||
c.order_message, c.order_item_amount, c.order_shipping_fee,c.delivery_time, c.order_shipping_fee_amount,
|
||||
e.store_tel,
|
||||
@ -546,4 +542,173 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<resultMap id="MchOrderResult" type="com.suisung.mall.common.modules.order.dto.MchOrderInfoDTO">
|
||||
<id property="order_id" column="order_id"/>
|
||||
<result property="order_title" column="order_title"/>
|
||||
<result property="order_pickup_num" column="order_pickup_num"/>
|
||||
<result property="order_time" column="order_time"/>
|
||||
<result property="payment_time" column="payment_time"/>
|
||||
<result property="arrival_time" column="arrival_time"/>
|
||||
<result property="order_product_amount" column="order_product_amount"/>
|
||||
<result property="order_payment_amount" column="order_payment_amount"/>
|
||||
<result property="currency_id" column="currency_id"/>
|
||||
<result property="order_state_id" column="order_state_id"/>
|
||||
<result property="delivery_type_id" column="delivery_type_id"/>
|
||||
<result property="order_shipping_fee" column="order_shipping_fee"/>
|
||||
<result property="distance" column="distance"/>
|
||||
|
||||
<!-- 店铺嵌套对象映射 -->
|
||||
<association property="store_info" javaType="com.suisung.mall.common.modules.order.dto.MchOrderStoreDTO">
|
||||
<result property="store_id" column="store_id"/>
|
||||
<result property="store_name" column="store_name"/>
|
||||
<result property="store_logo" column="store_logo"/>
|
||||
<result property="store_latitude" column="store_latitude"/>
|
||||
<result property="store_longitude" column="store_longitude"/>
|
||||
<result property="store_area" column="store_area"/>
|
||||
<result property="store_address" column="store_address"/>
|
||||
<result property="store_grade_id" column="store_grade_id"/>
|
||||
<result property="store_grade_name" column="store_grade_name"/>
|
||||
</association>
|
||||
|
||||
<!-- 买家嵌套对象映射 -->
|
||||
<association property="buyer_info" javaType="com.suisung.mall.common.modules.order.dto.MchOrderBuyerDTO">
|
||||
<result property="buyer_user_id" column="buyer_user_id"/>
|
||||
<result property="da_name" column="da_name"/>
|
||||
<result property="da_mobile" column="da_mobile"/>
|
||||
<result property="order_message" column="order_message"/>
|
||||
<result property="da_latitude" column="da_latitude"/>
|
||||
<result property="da_longitude" column="da_longitude"/>
|
||||
<result property="da_province" column="da_province"/>
|
||||
<result property="da_city" column="da_city"/>
|
||||
<result property="da_county" column="da_county"/>
|
||||
<result property="da_address" column="da_address"/>
|
||||
</association>
|
||||
|
||||
<!-- 顺丰同城订单嵌套对象映射 -->
|
||||
<association property="sf_order_info" javaType="com.suisung.mall.common.modules.order.dto.MchSFOrderDTO">
|
||||
<result property="sf_order_id" column="sf_order_id"/>
|
||||
<result property="operator_name" column="buyer_user_name"/>
|
||||
<result property="operator_phone" column="operator_phone"/>
|
||||
<result property="rider_lng" column="rider_lng"/>
|
||||
<result property="rider_lat" column="rider_lat"/>
|
||||
<result property="order_status" column="order_status"/>
|
||||
<result property="status_desc" column="status_desc"/>
|
||||
<result property="cancel_code" column="cancel_code"/>
|
||||
<result property="cancel_reason" column="cancel_reason"/>
|
||||
<result property="push_time" column="push_time"/>
|
||||
<result property="h5_url" column="h5_url"/>
|
||||
<result property="feed" column="feed"/>
|
||||
</association>
|
||||
|
||||
<collection property="order_items" ofType="com.suisung.mall.common.modules.order.dto.MchOrderItemDTO">
|
||||
<result property="product_id" column="product_id"/>
|
||||
<result property="item_id" column="item_id"/>
|
||||
<result property="item_name" column="item_name"/>
|
||||
<result property="order_item_quantity" column="order_item_quantity"/>
|
||||
<result property="item_unit_price" column="item_unit_price"/>
|
||||
<result property="item_cost_price" column="item_cost_price"/>
|
||||
<result property="item_barcode" column="item_barcode"/>
|
||||
<result property="order_item_image" column="order_item_image"/>
|
||||
<result property="spec_info" column="spec_info"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectMchOrderPageList" resultMap="MchOrderResult">
|
||||
SELECT
|
||||
ob.order_id,
|
||||
ob.order_time,
|
||||
UNIX_TIMESTAMP(ob.order_time) as arrival_time,
|
||||
ob.order_product_amount,
|
||||
ob.order_payment_amount,
|
||||
ob.currency_id,
|
||||
ob.order_state_id,
|
||||
ST_Distance_Sphere(
|
||||
POINT(sb.store_longitude, sb.store_latitude),
|
||||
POINT(oda.da_longitude, oda.da_latitude)
|
||||
) as distance,
|
||||
oi.order_title,
|
||||
oi.order_pickup_num,
|
||||
oi.delivery_type_id,
|
||||
oi.buyer_user_id,
|
||||
oi.payment_time,
|
||||
od.order_shipping_fee,
|
||||
od.order_message,
|
||||
sb.store_id,
|
||||
sb.store_name,
|
||||
sb.store_logo,
|
||||
sb.store_latitude,
|
||||
sb.store_longitude,
|
||||
sb.store_area,
|
||||
sb.store_address,
|
||||
sb.store_grade_id,
|
||||
sbsg.store_grade_name,
|
||||
oit.item_id,
|
||||
oit.product_id,
|
||||
oit.item_name,
|
||||
oit.order_item_quantity,
|
||||
oit.item_unit_price,
|
||||
oit.item_cost_price,
|
||||
spi.item_barcode,
|
||||
oit.order_item_image,
|
||||
oit.spec_info,
|
||||
oda.da_name,
|
||||
oda.da_mobile,
|
||||
oda.da_latitude,
|
||||
oda.da_longitude,
|
||||
oda.da_province,
|
||||
oda.da_city,
|
||||
oda.da_county,
|
||||
oda.da_address,
|
||||
osf.sf_order_id,
|
||||
osf.operator_name,
|
||||
osf.operator_phone,
|
||||
osf.rider_lng,
|
||||
osf.rider_lat,
|
||||
osf.order_status,
|
||||
osf.status_desc,
|
||||
osf.cancel_code,
|
||||
osf.cancel_reason,
|
||||
osf.push_time,
|
||||
osf.h5_url,
|
||||
osf.feed
|
||||
from shop_order_base ob
|
||||
join shop_order_info oi on ob.order_id=oi.order_id
|
||||
join shop_order_data od on ob.order_id=od.order_id
|
||||
join shop_store_base sb on ob.store_id=sb.store_id
|
||||
join shop_order_delivery_address oda on ob.order_id=oda.order_id
|
||||
join shop_order_item oit on ob.order_id=oit.order_id
|
||||
left join shop_store_sf_order osf on ob.order_id=osf.shop_order_id
|
||||
left join shop_product_item spi on oit.product_id=spi.product_id
|
||||
left join shop_base_store_grade sbsg on sb.store_grade_id=sbsg.store_grade_id
|
||||
<where>
|
||||
<if test="storeId!=null and storeId > 0">
|
||||
and ob.store_id=#{storeId}
|
||||
</if>
|
||||
<if test="keyword!=null and keyword != ''">
|
||||
and
|
||||
(ob.order_id LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR oi.order_title LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR oda.da_name LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR oda.da_address LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR sb.store_address LIKE CONCAT('%', #{keyword}, '%')
|
||||
OR spi.item_barcode LIKE CONCAT('%', #{keyword}, '%'))
|
||||
</if>
|
||||
|
||||
<if test="status!=null and status==1">
|
||||
and ob.order_state_id IN (2020, 2030, 2040)
|
||||
and TIMESTAMPADD(MINUTE, 25, oi.order_time) >= NOW()
|
||||
</if>
|
||||
|
||||
<if test="status!=null and status==2">
|
||||
and ob.order_state_id IN (2020, 2030, 2040)
|
||||
and TIMESTAMPADD(MINUTE, 25, oi.order_time) <= NOW()
|
||||
</if>
|
||||
|
||||
<if test="status!=null and status==3">
|
||||
and od.order_refund_status IN (1, 2)
|
||||
</if>
|
||||
</where>
|
||||
order by ob.order_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user