1
This commit is contained in:
@@ -2,6 +2,7 @@ package com.ruoyi.jarvis.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import com.ruoyi.jarvis.domain.dto.LinkedJdOrderBrief;
|
||||
import lombok.Data;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
@@ -233,4 +234,8 @@ public class OrderRows extends BaseEntity
|
||||
@Transient
|
||||
private GoodsInfo goodsInfo;
|
||||
|
||||
/** 关联本地慢单(jd_order,非表字段) */
|
||||
@Transient
|
||||
private LinkedJdOrderBrief linkedJdOrder;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.ruoyi.jarvis.domain.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 京粉订单关联的本地慢单摘要
|
||||
*/
|
||||
public class LinkedJdOrderBrief {
|
||||
|
||||
private Long id;
|
||||
private String remark;
|
||||
private String orderId;
|
||||
private String buyer;
|
||||
private String modelNumber;
|
||||
private String modelShop;
|
||||
private Double paymentAmount;
|
||||
private Double rebateAmount;
|
||||
private String address;
|
||||
private String status;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date orderTime;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(String orderId) {
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getBuyer() {
|
||||
return buyer;
|
||||
}
|
||||
|
||||
public void setBuyer(String buyer) {
|
||||
this.buyer = buyer;
|
||||
}
|
||||
|
||||
public String getModelNumber() {
|
||||
return modelNumber;
|
||||
}
|
||||
|
||||
public void setModelNumber(String modelNumber) {
|
||||
this.modelNumber = modelNumber;
|
||||
}
|
||||
|
||||
public String getModelShop() {
|
||||
return modelShop;
|
||||
}
|
||||
|
||||
public void setModelShop(String modelShop) {
|
||||
this.modelShop = modelShop;
|
||||
}
|
||||
|
||||
public Double getPaymentAmount() {
|
||||
return paymentAmount;
|
||||
}
|
||||
|
||||
public void setPaymentAmount(Double paymentAmount) {
|
||||
this.paymentAmount = paymentAmount;
|
||||
}
|
||||
|
||||
public Double getRebateAmount() {
|
||||
return rebateAmount;
|
||||
}
|
||||
|
||||
public void setRebateAmount(Double rebateAmount) {
|
||||
this.rebateAmount = rebateAmount;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Date getOrderTime() {
|
||||
return orderTime;
|
||||
}
|
||||
|
||||
public void setOrderTime(Date orderTime) {
|
||||
this.orderTime = orderTime;
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,11 @@ public interface JDOrderMapper {
|
||||
*/
|
||||
JDOrder selectJDOrderByOrderId(String orderId);
|
||||
|
||||
/**
|
||||
* 批量按京东订单号查询最新慢单(每个 order_id 取 id 最大一条)
|
||||
*/
|
||||
List<JDOrder> selectLatestJDOrdersByOrderIds(@org.apache.ibatis.annotations.Param("orderIds") List<String> orderIds);
|
||||
|
||||
/**
|
||||
* 根据物流链接查询订单
|
||||
*/
|
||||
|
||||
@@ -38,6 +38,9 @@ public interface IJDOrderService {
|
||||
/** 根据订单号查询订单 */
|
||||
JDOrder selectJDOrderByOrderId(String orderId);
|
||||
|
||||
/** 批量按京东订单号查询最新慢单 */
|
||||
List<JDOrder> selectLatestJDOrdersByOrderIds(List<String> orderIds);
|
||||
|
||||
/** 根据物流链接查询订单 */
|
||||
JDOrder selectJDOrderByLogisticsLink(String logisticsLink);
|
||||
|
||||
|
||||
@@ -66,6 +66,14 @@ public class JDOrderServiceImpl implements IJDOrderService {
|
||||
return jdOrderMapper.selectJDOrderByOrderId(orderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JDOrder> selectLatestJDOrdersByOrderIds(List<String> orderIds) {
|
||||
if (orderIds == null || orderIds.isEmpty()) {
|
||||
return java.util.Collections.emptyList();
|
||||
}
|
||||
return jdOrderMapper.selectLatestJDOrdersByOrderIds(orderIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JDOrder selectJDOrderByLogisticsLink(String logisticsLink) {
|
||||
return jdOrderMapper.selectJDOrderByLogisticsLink(logisticsLink);
|
||||
|
||||
@@ -276,6 +276,18 @@
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectLatestJDOrdersByOrderIds" resultMap="JDOrderResult">
|
||||
<include refid="selectJDOrderBase"/>
|
||||
where id in (
|
||||
select max(id) from jd_order
|
||||
where order_id in
|
||||
<foreach collection="orderIds" item="oid" open="(" separator="," close=")">
|
||||
#{oid}
|
||||
</foreach>
|
||||
group by order_id
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="selectJDOrderByLogisticsLink" parameterType="string" resultMap="JDOrderResult">
|
||||
<include refid="selectJDOrderBase"/>
|
||||
where logistics_link = #{logisticsLink}
|
||||
|
||||
Reference in New Issue
Block a user