parent
ef656cf762
commit
3750dc76c7
|
@ -1,6 +1,8 @@
|
|||
package cn.iocoder.yudao.module.trade.controller.app.order.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import cn.iocoder.yudao.framework.common.validation.Mobile;
|
||||
import cn.iocoder.yudao.module.trade.enums.delivery.DeliveryTypeEnum;
|
||||
import cn.iocoder.yudao.module.trade.enums.order.TradeOrderTypeEnum;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
@ -9,6 +11,7 @@ import lombok.Data;
|
|||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.AssertTrue;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -19,17 +22,32 @@ public class AppTradeOrderSettlementReqVO {
|
|||
@NotNull(message = "交易类型不能为空")
|
||||
@InEnum(value = TradeOrderTypeEnum.class, message = "交易类型必须是 {value}")
|
||||
@Deprecated // TODO 芋艿:后续干掉这个字段,对于前端不需要关注这个
|
||||
private Integer type;
|
||||
private Integer type = 1;
|
||||
|
||||
@Schema(description = "商品项数组", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "商品不能为空")
|
||||
@NotEmpty(message = "商品不能为空")
|
||||
private List<Item> items;
|
||||
|
||||
@Schema(description = "优惠劵编号", example = "1024")
|
||||
private Long couponId;
|
||||
|
||||
@Schema(description = "是否使用积分", required = true, example = "true")
|
||||
@NotNull(message = "是否使用积分不能为空")
|
||||
private Boolean pointStatus;
|
||||
|
||||
// ========== 配送相关相关字段 ==========
|
||||
@Schema(description = "配送方式", required = true, example = "1")
|
||||
@InEnum(value = DeliveryTypeEnum.class, message = "配送方式不正确")
|
||||
private Integer deliveryType;
|
||||
|
||||
@Schema(description = "收件地址编号", example = "1")
|
||||
private Long addressId;
|
||||
|
||||
@Schema(description = "优惠劵编号", example = "1024")
|
||||
private Long couponId;
|
||||
@Schema(description = "收件人名称", example = "芋艿") // 选择门店自提时,该字段为联系人名
|
||||
private String receiverName;
|
||||
@Schema(description = "收件人手机", example = "15601691300") // 选择门店自提时,该字段为联系人手机
|
||||
@Mobile(message = "收件人手机格式不正确")
|
||||
private String receiverMobile;
|
||||
|
||||
// ========== 秒杀活动相关字段 ==========
|
||||
@Schema(description = "秒杀活动编号", example = "1024")
|
||||
|
|
|
@ -6,12 +6,16 @@ import lombok.AllArgsConstructor;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "用户 App - 交易订单结算信息 Response VO")
|
||||
@Data
|
||||
public class AppTradeOrderSettlementRespVO {
|
||||
|
||||
@Schema(description = "交易类型", required = true, example = "1") // 对应 TradeOrderTypeEnum 枚举
|
||||
private Integer type = 1; // TODO 芋艿:改成计算
|
||||
|
||||
@Schema(description = "购物项数组", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Item> items;
|
||||
|
||||
|
@ -21,6 +25,12 @@ public class AppTradeOrderSettlementRespVO {
|
|||
@Schema(description = "收件地址", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Address address;
|
||||
|
||||
@Schema(description = "已使用的积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
||||
private Integer usedPoint;
|
||||
|
||||
@Schema(description = "总积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
||||
private Integer totalPoint;
|
||||
|
||||
@Schema(description = "购物项")
|
||||
@Data
|
||||
public static class Item {
|
||||
|
@ -90,26 +100,17 @@ public class AppTradeOrderSettlementRespVO {
|
|||
@Schema(description = "手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15601691300")
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "省份编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer provinceId;
|
||||
@Schema(description = "省份名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "北京")
|
||||
private String provinceName;
|
||||
|
||||
@Schema(description = "城市编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer cityId;
|
||||
@Schema(description = "城市名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "北京")
|
||||
private String cityName;
|
||||
|
||||
@Schema(description = "地区编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer districtId;
|
||||
@Schema(description = "地区名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "朝阳区")
|
||||
private String districtName;
|
||||
@Schema(description = "地区编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "地区编号不能为空")
|
||||
private Long areaId;
|
||||
@Schema(description = "地区名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "上海上海市普陀区")
|
||||
private String areaName;
|
||||
|
||||
@Schema(description = "详细地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "望京悠乐汇 A 座")
|
||||
private String detailAddress;
|
||||
|
||||
@Schema(description = "是否默认收件地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
||||
private Boolean defaulted;
|
||||
private Boolean defaultStatus;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.trade.convert.order;
|
|||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.iocoder.yudao.framework.ip.core.Area;
|
||||
import cn.iocoder.yudao.framework.ip.core.utils.AreaUtils;
|
||||
import cn.iocoder.yudao.module.member.api.address.dto.AddressRespDTO;
|
||||
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
|
||||
|
@ -303,14 +302,11 @@ public interface TradeOrderConvert {
|
|||
default AppTradeOrderSettlementRespVO convert(TradePriceCalculateRespBO calculate, AddressRespDTO address) {
|
||||
AppTradeOrderSettlementRespVO respVO = convert0(calculate, address);
|
||||
if (address != null) {
|
||||
Area area = AreaUtils.getArea(address.getAreaId());
|
||||
respVO.getAddress().setDistrictId(area.getId());
|
||||
respVO.getAddress().setDistrictName(area.getName());
|
||||
respVO.getAddress().setCityId(area.getParent().getId());
|
||||
respVO.getAddress().setCityName(area.getParent().getName());
|
||||
respVO.getAddress().setProvinceId(area.getParent().getParent().getId());
|
||||
respVO.getAddress().setProvinceName(area.getParent().getParent().getName());
|
||||
respVO.getAddress().setAreaName(AreaUtils.format(address.getAreaId()));
|
||||
}
|
||||
// TODO 芋艿:积分的接入;
|
||||
respVO.setUsedPoint(1);
|
||||
respVO.setTotalPoint(100);
|
||||
return respVO;
|
||||
}
|
||||
|
||||
|
|
|
@ -176,6 +176,7 @@ public class TradeOrderDO extends BaseDO {
|
|||
*
|
||||
* 关联 DeliveryTemplateDO 的 id 编号
|
||||
*/
|
||||
// TODO 芋艿:需要删除
|
||||
private Long deliveryTemplateId;
|
||||
/**
|
||||
* 发货物流公司编号
|
||||
|
@ -243,6 +244,7 @@ public class TradeOrderDO extends BaseDO {
|
|||
* 对应 taobao 的 trade.coupon_fee 字段
|
||||
*/
|
||||
private Integer couponPrice;
|
||||
// TODO 芋艿:需要记录使用的积分;
|
||||
/**
|
||||
* 积分抵扣的金额,单位:分
|
||||
*
|
||||
|
|
|
@ -30,19 +30,13 @@ public class AddressRespDTO {
|
|||
* 地区编号
|
||||
*/
|
||||
private Integer areaId;
|
||||
/**
|
||||
* 邮编
|
||||
*/
|
||||
private String postCode;
|
||||
/**
|
||||
* 收件详细地址
|
||||
*/
|
||||
private String detailAddress;
|
||||
/**
|
||||
* 是否默认
|
||||
*
|
||||
* true - 默认收件地址
|
||||
*/
|
||||
private Boolean defaulted;
|
||||
private Boolean defaultStatus;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue