8月新需求修改

This commit is contained in:
dev 2025-08-26 16:58:23 +08:00
parent e56d59967f
commit 2f550fea64
42 changed files with 415 additions and 97 deletions

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
@ -69,7 +70,7 @@ public class BizLogisticsOrder extends TenantEntity {
/**
* 总货件数量商品件数总和
*/
private Long shipmentQuantity;
private BigDecimal shipmentQuantity;
/**
* 亚马逊仓库实际上架日期
@ -98,6 +99,8 @@ public class BizLogisticsOrder extends TenantEntity {
private String status;
private String storeName;
@TableField(exist = false)
private List<BizLogisticsOrderDetail> details;

View File

@ -85,17 +85,17 @@ public class BizLogisticsOrderDetail extends TenantEntity {
/**
* 供应商称重单位KG由供应商提供
*/
private Long supplierWeight;
private BigDecimal supplierWeight;
/**
* 物流商计重单位KG物流商实际测量值
*/
private Long logisticsWeight;
private BigDecimal logisticsWeight;
/**
* 称重差异应用层计算物流商计重 - 供应商称重
*/
private Long weightDiff;
private BigDecimal weightDiff;
/**
* 物流单价单位/KG由合同或报价确定
@ -193,4 +193,13 @@ public class BizLogisticsOrderDetail extends TenantEntity {
private BigDecimal totalPrice;
private BigDecimal length;
private BigDecimal width;
private BigDecimal height;
private BigDecimal totalVolume;
}

View File

@ -6,6 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
import java.math.BigDecimal;
/**
* 物流订单确认对象 biz_logistics_order_quotation
@ -64,7 +65,7 @@ public class BizLogisticsOrderQuotation extends TenantEntity {
/**
* 总货件数量商品件数总和
*/
private Long shipmentQuantity;
private BigDecimal shipmentQuantity;
/**
* 删除标记0=正常1=删除
@ -81,4 +82,8 @@ public class BizLogisticsOrderQuotation extends TenantEntity {
private Long quoteOrderId;
private String storeName;
}

View File

@ -66,7 +66,7 @@ public class BizLogisticsQuote extends TenantEntity {
/**
* 附加费
*/
private Long surcharge;
private BigDecimal surcharge;
/**
* 报价生效日期
@ -125,5 +125,11 @@ public class BizLogisticsQuote extends TenantEntity {
private BigDecimal totalPrice;
private BigDecimal customsDeclarationFee;
private BigDecimal volumeRatio;
}

View File

@ -85,7 +85,7 @@ public class BizSendOrder extends TenantEntity {
/**
* 单箱重量
*/
private Long weightPerBox;
private BigDecimal weightPerBox;
private String sku;

View File

@ -1,5 +1,6 @@
package org.asinkj.amz.domain;
import jakarta.validation.constraints.NotNull;
import org.asinkj.common.tenant.core.TenantEntity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
@ -56,7 +57,11 @@ public class BizShipForward extends TenantEntity {
/**
* 实际发货数量
*/
private BigDecimal quantitySend;
private BigDecimal quantitySend = BigDecimal.ZERO;
// @NotNull(message = "计划发货数量")
private BigDecimal quantityPlan;
/**
* 发货供应商名称

View File

@ -4,6 +4,8 @@ import org.asinkj.common.tenant.core.TenantEntity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
@ -46,7 +48,7 @@ public class BizShipmentItem extends TenantEntity {
/**
* 发货量
*/
private Long quantityShipped;
private BigDecimal quantityShipped;
/**
* 收货量

View File

@ -156,7 +156,7 @@ public class BizShipmentPlan extends TenantEntity {
/**
* 套数系统中的申报量
*/
private Long setTotal;
private BigDecimal setTotal;
/**
* 渠道ID

View File

@ -94,4 +94,7 @@ public class BizLogisticsOrderBo extends BaseEntity {
private String status;
private String storeName;
}

View File

@ -11,6 +11,7 @@ import jakarta.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
@ -43,7 +44,6 @@ public class BizLogisticsOrderDetailBo extends BaseEntity {
private String fbaShipmentId;
/**
* FBA箱号亚马逊系统中箱子的唯一标识
*/
@ -102,7 +102,7 @@ public class BizLogisticsOrderDetailBo extends BaseEntity {
* 物流商计重单位KG物流商实际测量值
*/
@NotNull(message = "物流商计重单位KG物流商实际测量值不能为空", groups = {AddGroup.class, EditGroup.class})
private Long logisticsWeight;
private BigDecimal logisticsWeight;
/**
* 称重差异应用层计算物流商计重 - 供应商称重
@ -219,4 +219,14 @@ public class BizLogisticsOrderDetailBo extends BaseEntity {
*/
@NotNull(message = "根据哪个报价单生成的订单不能为空", groups = {AddGroup.class, EditGroup.class})
private Long quoteOrderId;
private BigDecimal length;
private BigDecimal width;
private BigDecimal height;
private BigDecimal totalVolume;
}

View File

@ -82,5 +82,8 @@ public class BizLogisticsOrderQuotationBo extends BaseEntity {
private String confirm;
private String storeName;
}

View File

@ -118,7 +118,11 @@ public class BizLogisticsQuoteBo extends BaseEntity {
private String backLogisticsType;
private Long totalPrice;
private BigDecimal totalPrice;
private BigDecimal customsDeclarationFee;

View File

@ -71,7 +71,7 @@ public class BizLogisticsQuoteMostBo extends BaseEntity {
* 附加费
*/
@NotNull(message = "附加费不能为空", groups = { AddGroup.class, EditGroup.class })
private Long surcharge;
private BigDecimal surcharge;
@ -130,6 +130,10 @@ public class BizLogisticsQuoteMostBo extends BaseEntity {
private String shipmentId;
private BigDecimal totalPrice;
private BigDecimal customsDeclarationFee;
private BigDecimal volumeRatio;
}

View File

@ -324,6 +324,8 @@ public class BizPurchaseOrderBo extends BaseEntity {
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date deliveryTime;
private String type;
/**
* 订单交付变动天数
*/

View File

@ -72,8 +72,7 @@ public class BizSendOrderBo extends BaseEntity {
* 单箱产品数量
*/
// @NotNull(message = "单箱产品数量不能为空", groups = {AddGroup.class, EditGroup.class})
private Long quantityPerBox;
private BigDecimal quantityPerBox;
/**
@ -92,7 +91,7 @@ public class BizSendOrderBo extends BaseEntity {
* 单箱重量
*/
// @NotNull(message = "单箱重量不能为空", groups = {AddGroup.class, EditGroup.class})
private Long weightPerBox;
private BigDecimal weightPerBox;
/**
* 实际采购店铺

View File

@ -61,7 +61,7 @@ public class BizShipForwardBo extends BaseEntity {
/**
* 实际发货数量
*/
@NotNull(message = "实际发货数量不能为空", groups = {AddGroup.class, EditGroup.class})
// @NotNull(message = "实际发货数量不能为空", groups = {AddGroup.class, EditGroup.class})
private Long quantitySend;
/**
@ -141,6 +141,9 @@ public class BizShipForwardBo extends BaseEntity {
@NotNull(message = "请求类型")
private String type;
@NotNull(message = "计划发货数量")
private Long quantityPlan;
/**
* 预计到达时间

View File

@ -1,5 +1,6 @@
package org.asinkj.amz.domain.vo;
import java.math.BigDecimal;
import java.util.Date;
import com.alibaba.excel.annotation.write.style.ContentStyle;
@ -127,14 +128,14 @@ public class BizLogisticsOrderDetailVo implements Serializable {
*/
@ExcelProperty(value = "物流商计重")
// @ExcelDictFormat(readConverterExp = "单=位KG物流商实际测量值")
private Long logisticsWeight;
private BigDecimal logisticsWeight;
/**
* 称重差异应用层计算物流商计重 - 供应商称重
*/
// @ExcelProperty(value = "称重差异")
// @ExcelDictFormat(readConverterExp = "应=用层计算:物流商计重,-=,供=应商称重")
private Long weightDiff;
private BigDecimal weightDiff;
/**
* 物流单价单位/KG由合同或报价确定
@ -143,6 +144,15 @@ public class BizLogisticsOrderDetailVo implements Serializable {
// @ExcelDictFormat(readConverterExp = "单=位:元/KG由合同或报价确定")
private Long pricePerKg;
private BigDecimal length;
private BigDecimal width;
private BigDecimal height;
private BigDecimal totalVolume;
/**
* 物流计价重量应用层根据业务规则计算
*/

View File

@ -11,7 +11,7 @@ import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
@ -99,6 +99,11 @@ public class BizLogisticsOrderQuotationVo implements Serializable {
private String confirm;
private BizLogisticsQuoteVo quote;
private String storeName;
private List<BizShipmentItemVo> shipmentItems;
}

View File

@ -1,10 +1,13 @@
package org.asinkj.amz.domain.vo;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.asinkj.amz.domain.BizLogisticsOrder;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import org.asinkj.amz.domain.BizShipmentItem;
import org.asinkj.amz.domain.BizShipmentPlan;
import org.asinkj.common.excel.annotation.ExcelDictFormat;
import org.asinkj.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
@ -14,7 +17,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
@ -112,6 +115,32 @@ public class BizLogisticsOrderVo implements Serializable {
private String status;
private BizLogisticsQuoteVo quote;
private BizShipmentPlanVo shipmentPlan;
private List<BizShipmentItemVo> shipmentItems;
private Long quoteOrderId;
private String storeName;
private BigDecimal logisticsWeight;
private BigDecimal settlementPrice;
private BigDecimal totalVolume;
private BigDecimal volumeWeight;
}

View File

@ -139,5 +139,11 @@ public class BizLogisticsQuoteVo implements Serializable {
private BigDecimal totalPrice;
private BigDecimal customsDeclarationFee;
private BigDecimal volumeRatio;
}

View File

@ -112,6 +112,9 @@ public class BizOrderOutItemVo implements Serializable {
@ExcelProperty(value = "转发数量")
private BigDecimal quantityForward = BigDecimal.ZERO;
@ExcelProperty(value = "转发中数量")
private BigDecimal quantityForwardOn = BigDecimal.ZERO;
@ExcelProperty(value = "可转发数量")
private BigDecimal quantityCanForward = BigDecimal.ZERO;

View File

@ -56,6 +56,8 @@ public class BizPurchaseOutOrderVo implements Serializable {
@ExcelProperty(value = "供应商名称")
private String supplierName;
private Long supplierId;
/**
* 业务创建时间 (Jackson格式: yyyy-MM-dd HH:mm:ss)
*/

View File

@ -97,7 +97,7 @@ public class BizSendOrderVo implements Serializable {
* 单箱重量
*/
@ExcelProperty(value = "单箱重量")
private Long weightPerBox;
private BigDecimal weightPerBox;
/**
* 实际采购店铺

View File

@ -3,6 +3,7 @@ package org.asinkj.amz.domain.vo;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotNull;
import org.asinkj.amz.domain.BizShipForward;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
@ -70,6 +71,10 @@ public class BizShipForwardVo implements Serializable {
@ExcelProperty(value = "实际发货数量")
private Long quantitySend;
@NotNull(message = "计划发货数量")
private Long quantityPlan;
/**
* 发货供应商名称
*/

View File

@ -60,21 +60,21 @@ public class BizShipmentPlanOrderExportVo implements Serializable {
private String asin;
@ExcelProperty(value = "申报量")
private Long quantityShipped;
private BigDecimal quantityShipped;
@ExcelProperty(value = "物流中心编码")
private String destination;
@ExcelProperty(value = "供应商称重")
private Long vendorWeight;
private BigDecimal vendorWeight;
@ExcelProperty(value = "物流商称重")
private Long logisticWeight;
private BigDecimal logisticWeight;
@ExcelProperty(value = "称重差异")
private Long weightDiff;
private BigDecimal weightDiff;
@ExcelProperty(value = "物流商名称")

View File

@ -180,17 +180,23 @@ public class BizShipmentPlanOrderVo implements Serializable {
* 供应商称重单位KG物流商实际测量值
*/
@ExcelProperty(value = "供应商称重")
private Long vendorWeight;
private BigDecimal vendorWeight;
@ExcelProperty(value = "物流商称重")
private Long logisticWeight;
private BigDecimal logisticWeight;
private BigDecimal totalVolume;
/**
* 称重差异应用层计算物流商计重 - 供应商称重
*/
private Long weightDiff;
private BigDecimal weightDiff;
/**
* 套数系统中的申报量
@ -237,7 +243,14 @@ public class BizShipmentPlanOrderVo implements Serializable {
@ExcelProperty(value = "发货数量")
private Long quantityShipped;
private BigDecimal quantityShipped;
@ExcelProperty(value = "关联的数量")
private BigDecimal quantityRelated;
@ExcelProperty(value = "剩余的数量")
private BigDecimal quantityRemain;
/**
* 供应商发货单id

View File

@ -182,7 +182,7 @@ public class BizShipmentPlanVo implements Serializable {
* 发货数量
*/
@ExcelProperty(value = "发货数量")
private Long quantityShipped;
private BigDecimal quantityShipped;
/**
* 箱子尺寸

View File

@ -1,6 +1,12 @@
package org.asinkj.amz.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.asinkj.amz.domain.BizInquiryRequest;
import org.asinkj.amz.domain.BizPurchaseOutOrder;
import org.asinkj.amz.domain.vo.BizInquiryRequestVo;
import org.asinkj.amz.domain.vo.BizPurchaseOutOrderVo;
import org.asinkj.common.mybatis.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Mapper;
@ -13,4 +19,10 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface BizPurchaseOutOrderMapper extends BaseMapperPlus<BizPurchaseOutOrder, BizPurchaseOutOrderVo> {
Page<BizPurchaseOutOrderVo> selectCustomPage(
@Param("page") Page<BizPurchaseOutOrderVo> page,
@Param(Constants.WRAPPER) Wrapper<BizPurchaseOutOrder> wrapper
);
}

View File

@ -8,6 +8,7 @@ import org.asinkj.common.mybatis.core.page.PageQuery;
import java.util.Collection;
import java.util.List;
import java.util.Set;
/**
* 货品明细Service接口
@ -69,4 +70,6 @@ public interface IBizShipmentItemService {
List<BizShipmentItem> queryByPlanId(String shipmentId);
List<BizShipmentItem> queryByfbaShipmentIds(Set<String> shipmentIds);
}

View File

@ -15,6 +15,7 @@ import java.io.InputStream;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 货件计划Service接口
@ -101,4 +102,6 @@ public interface IBizShipmentPlanService {
void updateQuoteIdData(String shipmentId, String logicQuoteId);
void queryPageListOrderExport(BizShipmentPlanBo bo, HttpServletResponse response);
List<BizShipmentPlan> queryByfbaShipmentIds(Set<String> shipmentIds);
}

View File

@ -134,9 +134,9 @@ public class BizInquiryRequestServiceImpl implements IBizInquiryRequestService {
// 4. 组装发货单数据到结果对象
for (BizInquiryRequestVo record : result.getRecords()) {
if ("weight".equals(record.getType())) {
// if ("weight".equals(record.getType())) {
record.setSendOrders(ordersMap.getOrDefault(record.getShipmentId(), Collections.emptyList()));
}
// }
}
}
return TableDataInfo.build(result);

View File

@ -1,9 +1,12 @@
package org.asinkj.amz.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.asinkj.amz.domain.*;
import org.asinkj.amz.domain.bo.BizLogisticsQuoteBo;
import org.asinkj.amz.domain.vo.BizLogisticsQuoteVo;
import org.asinkj.amz.domain.vo.BizShipmentItemVo;
import org.asinkj.amz.domain.vo.BizShipmentPlanVo;
import org.asinkj.amz.mapper.BizLogisticsOrderDetailMapper;
import org.asinkj.amz.mapper.BizLogisticsOrderMapper;
@ -29,6 +32,8 @@ import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* 物流订单确认Service业务层处理
@ -89,6 +94,26 @@ public class BizLogisticsOrderQuotationServiceImpl implements IBizLogisticsOrder
public TableDataInfo<BizLogisticsOrderQuotationVo> queryPageList(BizLogisticsOrderQuotationBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<BizLogisticsOrderQuotation> lqw = buildQueryWrapper(bo);
Page<BizLogisticsOrderQuotationVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
Set<Long> quoteOrderIds = result.getRecords().stream().map(BizLogisticsOrderQuotationVo::getQuoteOrderId).collect(Collectors.toSet());
Set<String> shipmentIds = result.getRecords().stream().map(BizLogisticsOrderQuotationVo::getFbaShipmentId).collect(Collectors.toSet());
List<BizShipmentItem> shipmentPlanItems= bizShipmentItemService.queryByfbaShipmentIds(shipmentIds);
Map<String, List<BizShipmentItem>> shipmentPlanItemMap = shipmentPlanItems.stream().collect(Collectors.groupingBy(BizShipmentItem::getShipmentId));
Map<Long, BizLogisticsQuoteVo> quoteMap = new HashMap<>();
if (CollectionUtil.isNotEmpty(quoteOrderIds)){
List<BizLogisticsQuote> bizLogisticsQuotes = bizLogisticsQuoteService.queryQuoteWithQuoteId(quoteOrderIds);
List<BizLogisticsQuoteVo> convert = MapstructUtils.convert(bizLogisticsQuotes, BizLogisticsQuoteVo.class);
quoteMap = convert.stream().collect(Collectors.toMap(BizLogisticsQuoteVo::getId, Function.identity()));
}
for (BizLogisticsOrderQuotationVo record : result.getRecords()) {
record.setQuote(quoteMap.get(record.getQuoteOrderId()));
List<BizShipmentItem> bizShipmentItems = shipmentPlanItemMap.get(record.getFbaShipmentId());
record.setShipmentItems(MapstructUtils.convert(bizShipmentItems, BizShipmentItemVo.class));
}
return TableDataInfo.build(result);
}
@ -206,7 +231,7 @@ public class BizLogisticsOrderQuotationServiceImpl implements IBizLogisticsOrder
List<BizShipmentTracking> trackingList = bizShipmentTrackingService.queryByPlanId(planVo.getShipmentId());
List<BizShipmentItem> itemList = bizShipmentItemService.queryByPlanId(planVo.getShipmentId());
long sum = itemList.stream().filter(item -> item.getQuantityShipped() != null).mapToLong(BizShipmentItem::getQuantityShipped).sum();
BigDecimal sum = itemList.stream().filter(item -> item.getQuantityShipped() != null).map(BizShipmentItem::getQuantityShipped).reduce(BigDecimal.ZERO,BigDecimal::add);
BizLogisticsOrder bizLogisticsOrder = new BizLogisticsOrder();
@ -225,6 +250,9 @@ public class BizLogisticsOrderQuotationServiceImpl implements IBizLogisticsOrder
// 目的地
bizLogisticsOrder.setDestination(quoteVo.getDestination());
bizLogisticsOrder.setStoreName(bo.getStoreName());
//总箱子数量
bizLogisticsOrder.setBoxQuantity((long) trackingList.size());
//总货件数量
@ -244,9 +272,9 @@ public class BizLogisticsOrderQuotationServiceImpl implements IBizLogisticsOrder
detail.setDestination(quoteVo.getDestination());
detail.setTimeliness(quoteVo.getLeadTime());
detail.setEstimatedDeliveryDate(DateUtil.offsetDay(new Date(), Math.toIntExact(quoteVo.getLeadTime())));
detail.setPricePerKg(quoteVo.getPrice());
// detail.setPricePerKg(quoteVo.getPrice());
detail.setPlannedQuantity(bizShipmentTracking.getTotal());
detail.setTotalPrice(quoteVo.getTotalPrice());
// detail.setTotalPrice(quoteVo.getTotalPrice());
detail.setCarrierConfirmTime(DateUtil.date());
BigDecimal lb = new BigDecimal(bizShipmentTracking.getWeight());
@ -258,7 +286,7 @@ public class BizLogisticsOrderQuotationServiceImpl implements IBizLogisticsOrder
kgValue = kgValue.setScale(2, RoundingMode.HALF_UP);
detail.setSupplierWeight(kgValue.longValue());
detail.setSupplierWeight(kgValue);
// detail.setLogisticsStatus("IN_WAREHOUSE");
detail.setLogisticsStatus("BOOKED");
detail.setQuoteOrderId(bo.getQuoteOrderId());

View File

@ -1,13 +1,14 @@
package org.asinkj.amz.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import lombok.extern.slf4j.Slf4j;
import org.asinkj.amz.domain.*;
import org.asinkj.amz.domain.bo.BizLogisticsCreateOrderBo;
import org.asinkj.amz.domain.vo.BizLogisticsQuoteVo;
import org.asinkj.amz.domain.vo.BizShipmentPlanVo;
import org.asinkj.amz.domain.vo.*;
import org.asinkj.amz.mapper.BizLogisticsOrderDetailMapper;
import org.asinkj.amz.mapper.BizLogisticsOrderQuotationMapper;
import org.asinkj.amz.mapper.SysAmazonStoreMapper;
import org.asinkj.amz.service.*;
import org.asinkj.common.core.exception.ServiceException;
import org.asinkj.common.core.utils.MapstructUtils;
@ -23,12 +24,13 @@ import org.asinkj.system.api.RemoteUserService;
import org.asinkj.utils.SerialNoGenerator;
import org.springframework.stereotype.Service;
import org.asinkj.amz.domain.bo.BizLogisticsOrderBo;
import org.asinkj.amz.domain.vo.BizLogisticsOrderVo;
import org.asinkj.amz.mapper.BizLogisticsOrderMapper;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@ -49,6 +51,10 @@ public class BizLogisticsOrderServiceImpl implements IBizLogisticsOrderService {
@Resource
private IBizLogisticsQuoteService bizLogisticsQuoteService;
@Resource
private BizLogisticsOrderDetailMapper detailMapper;
;
@Resource
private IBizShipmentPlanService bizShipmentPlanService;
@ -64,6 +70,10 @@ public class BizLogisticsOrderServiceImpl implements IBizLogisticsOrderService {
@Resource
private BizLogisticsOrderMapper bizOrderMapper;
@Resource
private SysAmazonStoreMapper sysAmazonStoreMapper;
;
@Resource
private BizLogisticsOrderQuotationMapper bizLogisticsOrderQuotationMapper;
@ -93,6 +103,60 @@ public class BizLogisticsOrderServiceImpl implements IBizLogisticsOrderService {
public TableDataInfo<BizLogisticsOrderVo> queryPageList(BizLogisticsOrderBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<BizLogisticsOrder> lqw = buildQueryWrapper(bo);
Page<BizLogisticsOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
List<BizLogisticsOrderVo> records = result.getRecords();
Set<String> shipmentIds = records.stream().map(BizLogisticsOrderVo::getFbaShipmentId).collect(Collectors.toSet());
if (CollectionUtil.isEmpty(shipmentIds)) {
return TableDataInfo.build(result);
}
Set<String> orderIds = records.stream().map(BizLogisticsOrderVo::getOrderId).collect(Collectors.toSet());
LambdaQueryWrapper<BizLogisticsOrderDetail> orderDetailLambdaQueryWrapper = new LambdaQueryWrapper<>();
orderDetailLambdaQueryWrapper.in(CollectionUtil.isNotEmpty(orderIds), BizLogisticsOrderDetail::getOrderId, orderIds);
List<BizLogisticsOrderDetail> bizLogisticsOrderDetails = detailMapper.selectList(orderDetailLambdaQueryWrapper);
Map<String, List<BizLogisticsOrderDetail>> detailMap = bizLogisticsOrderDetails.stream().collect(Collectors.groupingBy(BizLogisticsOrderDetail::getOrderId));
List<BizShipmentPlan> shipmentPlans = bizShipmentPlanService.queryByfbaShipmentIds(shipmentIds);
Map<String, BizShipmentPlan> shipmentPlanMap = shipmentPlans.stream().collect(Collectors.toMap(BizShipmentPlan::getShipmentId, Function.identity()));
List<BizShipmentItem> shipmentPlanItems = bizShipmentItemService.queryByfbaShipmentIds(shipmentIds);
Map<String, List<BizShipmentItem>> shipmentPlanItemMap = shipmentPlanItems.stream().collect(Collectors.groupingBy(BizShipmentItem::getShipmentId));
Set<Long> quoteOrderIds = records.stream().map(BizLogisticsOrderVo::getQuoteOrderId).collect(Collectors.toSet());
Map<Long, BizLogisticsQuoteVo> quoteMap = new HashMap<>();
if (CollectionUtil.isNotEmpty(quoteOrderIds)) {
List<BizLogisticsQuote> bizLogisticsQuotes = bizLogisticsQuoteService.queryQuoteWithQuoteId(quoteOrderIds);
List<BizLogisticsQuoteVo> convert = MapstructUtils.convert(bizLogisticsQuotes, BizLogisticsQuoteVo.class);
quoteMap = convert.stream().collect(Collectors.toMap(BizLogisticsQuoteVo::getId, Function.identity()));
}
for (BizLogisticsOrderVo record : records) {
BizShipmentPlan bizShipmentPlan = shipmentPlanMap.get(record.getFbaShipmentId());
if (bizShipmentPlan != null) {
record.setShipmentPlan(MapstructUtils.convert(bizShipmentPlan, BizShipmentPlanVo.class));
}
List<BizShipmentItem> bizShipmentItems = shipmentPlanItemMap.get(record.getFbaShipmentId());
record.setShipmentItems(MapstructUtils.convert(bizShipmentItems, BizShipmentItemVo.class));
BizLogisticsQuoteVo bizLogisticsQuoteVo = quoteMap.get(record.getQuoteOrderId());
if (bizLogisticsQuoteVo != null) {
record.setQuote(bizLogisticsQuoteVo);
}
List<BizLogisticsOrderDetail> bizLogisticsOrderDetails1 = detailMap.get(record.getOrderId());
BigDecimal collect = bizLogisticsOrderDetails1.stream().filter(item -> item.getLogisticsWeight() != null).map(BizLogisticsOrderDetail::getLogisticsWeight).reduce(BigDecimal.ZERO, BigDecimal::add);
record.setLogisticsWeight(collect);
BigDecimal totalVolume = bizLogisticsOrderDetails1.stream().filter(item -> item.getTotalVolume() != null).map(BizLogisticsOrderDetail::getTotalVolume).reduce(BigDecimal.ZERO, BigDecimal::add);
record.setTotalVolume(totalVolume);
BigDecimal divide = record.getTotalVolume().divide(record.getQuote().getVolumeRatio(),3, RoundingMode.HALF_UP);
record.setVolumeWeight(divide);
if ("weight".equals(record.getQuote().getType())) {
record.setSettlementPrice(record.getQuote().getPrice().multiply(divide.max(record.getLogisticsWeight())).add(record.getQuote().getSurcharge()).add(record.getQuote().getCustomsDeclarationFee()));
} else if ("total".equals(record.getQuote().getType())) {
record.setSettlementPrice(record.getQuote().getPrice().add(record.getQuote().getSurcharge()).add(record.getQuote().getCustomsDeclarationFee()));
} else if ("volume".equals(record.getQuote().getType())) {
record.setSettlementPrice(record.getQuote().getPrice().multiply(record.getTotalVolume()).multiply(new BigDecimal("0.000001")).add(record.getQuote().getSurcharge()).add(record.getQuote().getCustomsDeclarationFee()));
}
}
return TableDataInfo.build(result);
}
@ -227,11 +291,14 @@ public class BizLogisticsOrderServiceImpl implements IBizLogisticsOrderService {
throw new ServiceException("订单已存在");
}
LambdaQueryWrapper<SysAmazonStore> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SysAmazonStore::getSid, planVo.getSid());
SysAmazonStore sysAmazonStore = sysAmazonStoreMapper.selectOne(queryWrapper);
List<BizShipmentTracking> trackingList = bizShipmentTrackingService.queryByPlanId(planVo.getShipmentId());
List<BizShipmentItem> itemList = bizShipmentItemService.queryByPlanId(planVo.getShipmentId());
long sum = itemList.stream().filter(item -> item.getQuantityShipped() != null).mapToLong(BizShipmentItem::getQuantityShipped).sum();
BigDecimal sum = itemList.stream().filter(item -> item.getQuantityShipped() != null).map(BizShipmentItem::getQuantityShipped).reduce(BigDecimal.ZERO, BigDecimal::add);
BizLogisticsOrderQuotation bizLogisticsOrderQuotation = new BizLogisticsOrderQuotation();
@ -249,6 +316,9 @@ public class BizLogisticsOrderServiceImpl implements IBizLogisticsOrderService {
bizLogisticsOrderQuotation.setChannelName(quoteVo.getChannelName());
// 目的地
bizLogisticsOrderQuotation.setDestination(quoteVo.getDestination());
if (sysAmazonStore != null) {
bizLogisticsOrderQuotation.setStoreName(sysAmazonStore.getStoreName());
}
//总箱子数量
bizLogisticsOrderQuotation.setBoxQuantity((long) trackingList.size());

View File

@ -259,11 +259,21 @@ public class BizLogisticsQuoteServiceImpl implements IBizLogisticsQuoteService {
bizLogisticsQuote.setIsSubmitted(bo.getIsSubmitted());
bizLogisticsQuote.setChannelType(bo.getChannelType());
bizLogisticsQuote.setChannelId(bo.getChannelId());
bizLogisticsQuote.setVolumeRatio(bo.getVolumeRatio());
bizLogisticsQuote.setCustomsDeclarationFee(bo.getCustomsDeclarationFee());
bizLogisticsQuote.setIsDdp(bo.getIsDdp());
bizLogisticsQuote.setRemark(bo.getRemark());
bizLogisticsQuote.setUnit(bo.getUnit());
bizLogisticsQuote.setInquiryId(bo.getId());
bizLogisticsQuote.setType(bo.getType());
if ("weight".equals(bo.getType())) {
bizLogisticsQuote.setUnit("元/KG");
} else if ("volume".equals(bo.getType())) {
bizLogisticsQuote.setUnit("元/方");
} else if ("total".equals(bo.getType())) {
bizLogisticsQuote.setUnit("");
}
bizLogisticsQuote.setShipmentId(bo.getShipmentId());
bizLogisticsQuote.setTotalPrice(bo.getTotalPrice());
bizLogisticsQuotes.add(bizLogisticsQuote);
@ -380,7 +390,7 @@ public class BizLogisticsQuoteServiceImpl implements IBizLogisticsQuoteService {
if (StringUtils.isNotBlank(destination)) {
LambdaQueryWrapper<BizLogisticsQuote> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BizLogisticsQuote::getDestination, destination);
queryWrapper.and(wp -> wp.eq(BizLogisticsQuote::getType, "general").or().eq(BizLogisticsQuote::getType, "weight").eq(BizLogisticsQuote::getShipmentId, shipmentId));
// queryWrapper.and(wp -> wp.eq(BizLogisticsQuote::getType, "general").or().eq(BizLogisticsQuote::getType, "weight").eq(BizLogisticsQuote::getShipmentId, shipmentId));
queryWrapper.eq(BizLogisticsQuote::getQuoteDate, date);
return TableDataInfo.build(baseMapper.selectVoList(queryWrapper));

View File

@ -227,6 +227,8 @@ public class BizPurchaseOrderServiceImpl implements IBizPurchaseOrderService {
lqw.eq(StringUtils.isNotBlank(bo.getPayment()), BizPurchaseOrder::getPayment, bo.getPayment());
lqw.eq(bo.getAuditorUid() != null, BizPurchaseOrder::getAuditorUid, bo.getAuditorUid());
lqw.eq(bo.getAuditorTime() != null, BizPurchaseOrder::getAuditorTime, bo.getAuditorTime());
lqw.eq(StringUtils.isNotBlank(bo.getType()), BizPurchaseOrder::getType, bo.getType());
lqw.eq(bo.getLastUid() != null, BizPurchaseOrder::getLastUid, bo.getLastUid());
lqw.eq(bo.getLastTime() != null, BizPurchaseOrder::getLastTime, bo.getLastTime());
lqw.eq(StringUtils.isNotBlank(bo.getReason()), BizPurchaseOrder::getReason, bo.getReason());

View File

@ -88,7 +88,7 @@ public class BizPurchaseOutOrderServiceImpl implements IBizPurchaseOutOrderServi
@Override
public TableDataInfo<BizPurchaseOutOrderVo> queryPageList(BizPurchaseOutOrderBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<BizPurchaseOutOrder> lqw = buildQueryWrapper(bo);
Page<BizPurchaseOutOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
Page<BizPurchaseOutOrderVo> result = baseMapper.selectCustomPage(pageQuery.build(), lqw);
List<BizPurchaseOutOrderVo> records = result.getRecords();
if (result.getTotal() == 0) {
@ -161,10 +161,13 @@ public class BizPurchaseOutOrderServiceImpl implements IBizPurchaseOutOrderServi
if (CollectionUtil.isNotEmpty(bizShipForwards2)) {
BigDecimal reduce = bizShipForwards2.stream().filter(c -> "completed".equals(c.getFwdStatus())).map(BizShipForward::getQuantitySend).reduce(BigDecimal.ZERO, BigDecimal::add);
item.setQuantityForward(reduce);
BigDecimal reduceOn = bizShipForwards2.stream().filter(c -> !"completed".equals(c.getFwdStatus())).map(BizShipForward::getQuantityPlan).reduce(BigDecimal.ZERO, BigDecimal::add);
item.setQuantityForwardOn(reduceOn);
item.setForwards(bizShipForwards2);
}
item.setQuantityCanForward(item.getQuantityReal().subtract(item.getQuantityForward()));
item.setQuantityCanForward(item.getQuantityReal().subtract(item.getQuantityForwardOn().add(item.getQuantityForward())));
if (item.getSupplierName().equals(record.getSupplierName())) {
item.setForwardType("self");

View File

@ -183,7 +183,9 @@ public class BizSendOrderServiceImpl implements IBizSendOrderService {
for (BizShipmentPlan bizShipmentPlan : bizShipmentPlans) {
List<BizShipmentItem> bizShipmentItems1 = shipmentItemsMap.get(bizShipmentPlan.getShipmentId());
if (CollectionUtil.isNotEmpty(bizShipmentItems1)) {
long sum = bizShipmentItems1.stream().mapToLong(BizShipmentItem::getQuantityShipped).sum();
// long sum = bizShipmentItems1.stream().mapToLong(BizShipmentItem::getQuantityShipped).sum();
BigDecimal sum = bizShipmentItems1.stream().map(BizShipmentItem::getQuantityShipped).reduce(BigDecimal.ZERO, BigDecimal::add);
bizShipmentPlan.setSetTotal(sum);
}
}

View File

@ -197,6 +197,9 @@ public class BizShipForwardServiceImpl implements IBizShipForwardService {
updateWrapper.set(ObjectUtil.isNotEmpty(bo.getExpDeliveryDate()), BizShipForward::getExpDeliveryDate, bo.getExpDeliveryDate());
updateWrapper.set(ObjectUtil.isNotEmpty(bo.getBoxNum()), BizShipForward::getBoxNum, bo.getBoxNum());
updateWrapper.set(ObjectUtil.isNotEmpty(bo.getSendTime()), BizShipForward::getSendTime, bo.getSendTime());
updateWrapper.set(ObjectUtil.isNotEmpty(bo.getTotalPrice()), BizShipForward::getTotalPrice, bo.getTotalPrice());
updateWrapper.set(ObjectUtil.isNotEmpty(bo.getQuantitySend()), BizShipForward::getQuantitySend, bo.getQuantitySend());
baseMapper.update(updateWrapper);
}
}

View File

@ -1,5 +1,6 @@
package org.asinkj.amz.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import org.asinkj.common.core.utils.MapstructUtils;
import org.asinkj.common.core.utils.StringUtils;
import org.asinkj.common.mybatis.core.page.TableDataInfo;
@ -18,6 +19,7 @@ import org.asinkj.amz.service.IBizShipmentItemService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
import java.util.Set;
/**
* 货品明细Service业务层处理
@ -144,5 +146,14 @@ public class BizShipmentItemServiceImpl implements IBizShipmentItemService {
return List.of();
}
@Override
public List<BizShipmentItem> queryByfbaShipmentIds(Set<String> shipmentIds) {
if (CollectionUtil.isNotEmpty(shipmentIds)) {
return baseMapper.selectList(Wrappers.lambdaQuery(BizShipmentItem.class)
.in(BizShipmentItem::getShipmentId, shipmentIds));
}
return List.of();
}
}

View File

@ -177,7 +177,7 @@ public class BizShipmentPlanServiceImpl implements IBizShipmentPlanService {
Long count = collect.get(bizShipmentPlanVo.getShipmentId());
// bizShipmentPlanVo.setBoxQuantity(count);
List<BizShipmentItem> bizShipmentItems1 = collect1.get(bizShipmentPlanVo.getShipmentId());
long sum = bizShipmentItems1.stream().mapToLong(BizShipmentItem::getQuantityShipped).sum();
BigDecimal sum = bizShipmentItems1.stream().map(BizShipmentItem::getQuantityShipped).reduce(BigDecimal.ZERO,BigDecimal::add);
bizShipmentPlanVo.setQuantityShipped(sum);
bizShipmentPlanVo.setItemVoList(bizShipmentItems1);
@ -457,7 +457,7 @@ public class BizShipmentPlanServiceImpl implements IBizShipmentPlanService {
List<BizShipmentItem> bizShipmentItems1 = collect1.get(bizShipmentPlanVo.getShipmentId());
bizShipmentPlanVo.setItemVoList(bizShipmentItems1);
long sum = bizShipmentItems1.stream().mapToLong(BizShipmentItem::getQuantityShipped).sum();
BigDecimal sum = bizShipmentItems1.stream().map(BizShipmentItem::getQuantityShipped).reduce(BigDecimal.ZERO,BigDecimal::add);
bizShipmentPlanVo.setQuantityShipped(sum);
@ -468,15 +468,27 @@ public class BizShipmentPlanServiceImpl implements IBizShipmentPlanService {
List<BizSendOrder> bizSendOrders = resultOrderMap.get(bizShipmentPlanVo.getId());
bizShipmentPlanVo.setSendOrders(bizSendOrders);
BigDecimal reduce = bizSendOrders.stream().filter(bizSendOrder -> ObjectUtil.isNotEmpty(bizSendOrder.getWeightPerBox())).map(BizSendOrder::getWeightPerBox).reduce(BigDecimal.ZERO, BigDecimal::add);
bizShipmentPlanVo.setVendorWeight(reduce);
BigDecimal quantityRelated = bizSendOrders.stream().filter(bizSendOrder -> ObjectUtil.isNotEmpty(bizSendOrder.getQuantitySend())).map(BizSendOrder::getQuantitySend).reduce(BigDecimal.ZERO, BigDecimal::add);
bizShipmentPlanVo.setQuantityRelated(quantityRelated);
bizShipmentPlanVo.setQuantityRemain(bizShipmentPlanVo.getQuantityShipped().subtract(quantityRelated));
bizShipmentPlanVo.setDetailList(bizLogisticsOrderDetails1);
if (CollectionUtil.isNotEmpty(bizLogisticsOrderDetails1)) {
BizLogisticsOrderDetail bizLogisticsOrderDetail = bizLogisticsOrderDetails1.get(0);
bizShipmentPlanVo.setTrackingNumber(bizLogisticsOrderDetail.getTrackingNumber());
long sum2 = bizLogisticsOrderDetails1.stream().filter(item -> item.getLogisticsWeight() != null).mapToLong(BizLogisticsOrderDetail::getLogisticsWeight).sum();
bizShipmentPlanVo.setLogisticWeight(sum2);
BigDecimal collect2 = bizLogisticsOrderDetails1.stream().filter(item -> item.getLogisticsWeight() != null).map(BizLogisticsOrderDetail::getLogisticsWeight).reduce(BigDecimal.ZERO, BigDecimal::add);
long l = Optional.ofNullable(bizShipmentPlanVo.getLogisticWeight()).orElse(0L) - Optional.ofNullable(bizShipmentPlanVo.getVendorWeight()).orElse(0L);
bizShipmentPlanVo.setLogisticWeight(collect2);
BigDecimal totalVolume = bizLogisticsOrderDetails1.stream().filter(item -> item.getTotalVolume() != null).map(BizLogisticsOrderDetail::getTotalVolume).reduce(BigDecimal.ZERO, BigDecimal::add);
bizShipmentPlanVo.setTotalVolume(totalVolume);
BigDecimal l = Optional.ofNullable(bizShipmentPlanVo.getLogisticWeight()).orElse(BigDecimal.ZERO).subtract(Optional.ofNullable(bizShipmentPlanVo.getVendorWeight()).orElse(BigDecimal.ZERO));
bizShipmentPlanVo.setWeightDiff(l);
}
bizShipmentPlanVo.setBoxQuantity(count);
@ -484,7 +496,16 @@ public class BizShipmentPlanServiceImpl implements IBizShipmentPlanService {
if (bizLogisticsOrder != null) {
BizLogisticsQuote bizLogisticsQuote = quoteMap.get(bizLogisticsOrder.getQuoteOrderId());
bizShipmentPlanVo.setQuote(bizLogisticsQuote);
bizShipmentPlanVo.setAmountPrice(bizLogisticsQuote.getPrice().multiply(new BigDecimal(Optional.ofNullable(bizShipmentPlanVo.getLogisticWeight()).orElse(0L))).add(BigDecimal.valueOf(bizLogisticsQuote.getSurcharge())));
if ("weight".equals(bizShipmentPlanVo.getQuote().getType())) {
bizShipmentPlanVo.setAmountPrice(bizLogisticsQuote.getPrice().multiply(bizShipmentPlanVo.getLogisticWeight()).add(bizLogisticsQuote.getSurcharge()).add(bizLogisticsQuote.getCustomsDeclarationFee()));
} else if ("total".equals(bizLogisticsQuote.getType())) {
bizShipmentPlanVo.setAmountPrice(bizLogisticsQuote.getPrice().add(bizLogisticsQuote.getSurcharge()).add(bizLogisticsQuote.getCustomsDeclarationFee()));
} else if ("volume".equals(bizLogisticsQuote.getType())) {
bizShipmentPlanVo.setAmountPrice(bizShipmentPlanVo.getQuote().getPrice().multiply(bizShipmentPlanVo.getTotalVolume()).multiply(new BigDecimal("0.000001")).add(bizLogisticsQuote.getSurcharge()).add(bizLogisticsQuote.getCustomsDeclarationFee()));
}
// bizShipmentPlanVo.setAmountPrice(bizLogisticsQuote.getPrice().multiply(bizShipmentPlanVo.getLogisticWeight()).add(bizLogisticsQuote.getSurcharge()));
}
if (CollectionUtil.isNotEmpty(sids)) {
@ -664,7 +685,7 @@ public class BizShipmentPlanServiceImpl implements IBizShipmentPlanService {
exportVo.setPrice(row.getQuote().getPrice());
exportVo.setLeadTime(BigDecimal.valueOf(row.getQuote().getLeadTime()));
exportVo.setTotalPrice(row.getQuote().getTotalPrice());
exportVo.setSurcharge(BigDecimal.valueOf(row.getQuote().getSurcharge()));
exportVo.setSurcharge(row.getQuote().getSurcharge());
}
exportVo.setProductName(sendOrder.getProductName());
exportVo.setSku(sendOrder.getSku());
@ -687,6 +708,14 @@ public class BizShipmentPlanServiceImpl implements IBizShipmentPlanService {
ExcelUtil.exportExcel(exportVos, "导出", BizShipmentPlanOrderExportVo.class, response);
}
@Override
public List<BizShipmentPlan> queryByfbaShipmentIds(Set<String> shipmentIds) {
LambdaQueryWrapper<BizShipmentPlan> eq = new LambdaQueryWrapper<BizShipmentPlan>()
.in(BizShipmentPlan::getShipmentId, shipmentIds);
return baseMapper.selectList(eq);
}
private void checkData(List<BizShipmentPlanFileData> bizShipmentPlanFileDataList) {
boolean isAllSame = bizShipmentPlanFileDataList.stream()
.map(BizShipmentPlanFileData::getShipmentId)

View File

@ -46,6 +46,7 @@ import org.springframework.web.context.request.RequestContextHolder;
import javax.annotation.Resource;
import java.io.IOException;
import java.math.BigDecimal;
import java.time.Duration;
import java.util.*;
import java.util.function.Function;
@ -1073,7 +1074,7 @@ public class SysAmazonStoreServiceImpl implements ISysAmazonStoreService {
bizShipmentPlan.setDestination(shipment.getWarehouseId());
bizShipmentPlan.setItemCount(Long.valueOf(shipment.getItemCount()));
bizShipmentPlan.setStaShipmentDate(shipment.getShipingTime());
bizShipmentPlan.setSetTotal(Long.valueOf(shipment.getItemCount()));
bizShipmentPlan.setSetTotal(new BigDecimal(shipment.getItemCount()));
FbaShipmentApiResponse.Address shipFromAddress = new FbaShipmentApiResponse.Address();
shipFromAddress.setAddressLine1(shipment.getSendAddress().getAddressLine1());
shipFromAddress.setAddressLine2(shipment.getSendAddress().getAddressLine2());
@ -1109,7 +1110,7 @@ public class SysAmazonStoreServiceImpl implements ISysAmazonStoreService {
bizShipmentItem.setSku(item.getSku());
bizShipmentItem.setProductName(item.getProductName());
bizShipmentItem.setAsin(item.getAsin());
bizShipmentItem.setQuantityShipped(Long.valueOf(item.getQuantity()));
bizShipmentItem.setQuantityShipped(new BigDecimal(item.getQuantity()));
bizShipmentItems.add(bizShipmentItem);
}

View File

@ -4,4 +4,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.asinkj.amz.mapper.BizPurchaseOutOrderMapper">
<select id="selectCustomPage" resultType="org.asinkj.amz.domain.vo.BizPurchaseOutOrderVo">
SELECT
req.*,
u.user_id as supplier_id
FROM biz_purchase_out_order req
left join sys_user u on req.supplier_name = u.nick_name
<where>
${ew.sqlSegment} <!-- MyBatis-Plus 动态条件 -->
</where>
</select>
</mapper>