mall:调整 trade 的接口

pull/2/head
YunaiV 2022-08-06 19:10:28 +08:00
parent 10caa6e824
commit face9cae76
28 changed files with 881 additions and 141 deletions

View File

@ -38,12 +38,6 @@ public class ProductCategoryDO extends BaseDO {
*
*/
private Long parentId;
// /**
// * 店铺编号
// *
// * 关联 {@link ShopDO#getId()} TODO 芋艿:多店铺,暂不考虑
// */
// private Long shopId;
/**
*
*/

View File

@ -27,12 +27,6 @@ public class ProductGroupBindDO extends BaseDO {
*/
@TableId
private Long id;
// /**
// * 店铺编号
// *
// * 关联 {@link ShopDO#getId()} TODO 芋艿:多店铺,暂不考虑
// */
// private Long shopId;
/**
*
*

View File

@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.product.dal.dataobject.group;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.module.product.dal.dataobject.shop.ShopDO;
import cn.iocoder.yudao.module.product.enums.group.ProductGroupStyleEnum;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
@ -29,12 +28,6 @@ public class ProductGroupDO extends BaseDO {
*/
@TableId
private Long id;
// /**
// * 店铺编号
// *
// * 关联 {@link ShopDO#getId()} TODO 芋艿:多店铺,暂不考虑
// */
// private Long shopId;
/**
*
*/

View File

@ -27,12 +27,6 @@ public class ProductPropertyDO extends BaseDO {
*/
@TableId
private Long id;
// /**
// * 店铺编号
// *
// * 关联 {@link ShopDO#getId()} TODO 芋艿:多店铺,暂不考虑
// */
// private Long shopId;
/**
*
*/

View File

@ -34,11 +34,5 @@ public class ProductHotSearchDO extends BaseDO {
*
*/
private String content;
// /**
// * 店铺编号
// *
// * 关联 {@link ShopDO#getId()} TODO 芋艿:多店铺,暂不考虑
// */
// private Long shopId;
}

View File

@ -36,13 +36,6 @@ public class ProductSpuDO extends BaseDO {
@TableId
private Long id;
// /**
// * 店铺编号
// *
// * 关联 {@link ShopDO#getId()} TODO 芋艿:多店铺,暂不考虑
// */
// private Long shopId;
// ========== 基本信息 =========
/**
@ -215,4 +208,9 @@ public class ProductSpuDO extends BaseDO {
// TODO poster商品自定义海报
// TODO ========== 待定字段laoji =========
// TODO productType 1 - 普通商品 2 - 预售商品;可能和 type 合并不错
// TODO productUnit 商品单位
// TODO extJson 扩展信息;例如说,预售商品的信息
}

View File

@ -22,7 +22,7 @@ public interface ProductSkuMapper extends BaseMapperX<ProductSkuDO> {
.eqIfPresent(ProductSkuDO::getSpuId, reqVO.getSpuId())
.eqIfPresent(ProductSkuDO::getProperties, reqVO.getProperties())
.eqIfPresent(ProductSkuDO::getPrice, reqVO.getPrice())
.eqIfPresent(ProductSkuDO::getOriginalPrice, reqVO.getOriginalPrice())
// .eqIfPresent(ProductSkuDO::getOriginalPrice, reqVO.getOriginalPrice())
// .eqIfPresent(ProductSkuDO::getCostPrice, reqVO.getCostPrice())
.eqIfPresent(ProductSkuDO::getBarCode, reqVO.getBarCode())
.eqIfPresent(ProductSkuDO::getPicUrl, reqVO.getPicUrl())

View File

@ -24,7 +24,7 @@ public interface ProductSpuMapper extends BaseMapperX<ProductSpuDO> {
.eqIfPresent(ProductSpuDO::getPicUrls, reqVO.getPicUrls())
.eqIfPresent(ProductSpuDO::getSort, reqVO.getSort())
// .eqIfPresent(ProductSpuDO::getLikeCount, reqVO.getLikeCount())
.eqIfPresent(ProductSpuDO::getPrice, reqVO.getPrice())
// .eqIfPresent(ProductSpuDO::getPrice, reqVO.getPrice())
// .eqIfPresent(ProductSpuDO::getQuantity, reqVO.getQuantity())
.eqIfPresent(ProductSpuDO::getStatus, reqVO.getStatus())
.betweenIfPresent(ProductSpuDO::getCreateTime, reqVO.getCreateTime())

View File

@ -105,7 +105,7 @@ public class SkuServiceImplTest extends BaseDbUnitTest {
o.setSpuId(null);
o.setProperties(null);
o.setPrice(null);
o.setOriginalPrice(null);
// o.setOriginalPrice(null);
// o.setCostPrice(null);
o.setBarCode(null);
o.setPicUrl(null);
@ -120,7 +120,7 @@ public class SkuServiceImplTest extends BaseDbUnitTest {
// 测试 price 不匹配
ProductSkuMapper.insert(cloneIgnoreId(dbSku, o -> o.setPrice(null)));
// 测试 originalPrice 不匹配
ProductSkuMapper.insert(cloneIgnoreId(dbSku, o -> o.setOriginalPrice(null)));
// ProductSkuMapper.insert(cloneIgnoreId(dbSku, o -> o.setOriginalPrice(null)));
// 测试 costPrice 不匹配
// ProductSkuMapper.insert(cloneIgnoreId(dbSku, o -> o.setCostPrice(null)));
// 测试 barCode 不匹配

View File

@ -110,7 +110,7 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest {
o.setPicUrls(null);
o.setSort(null);
// o.setLikeCount(null);
o.setPrice(null);
// o.setPrice(null);
// o.setQuantity(null);
o.setStatus(null);
o.setCreateTime(null);
@ -131,7 +131,7 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest {
// 测试 likeCount 不匹配
// ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setLikeCount(null)));
// 测试 price 不匹配
ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setPrice(null)));
// ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setPrice(null)));
// 测试 quantity 不匹配
// ProductSpuMapper.insert(cloneIgnoreId(dbSpu, o -> o.setQuantity(null)));
// 测试 status 不匹配

View File

@ -10,7 +10,7 @@ import lombok.RequiredArgsConstructor;
*/
@RequiredArgsConstructor
@Getter
public enum TradeOrderCloseTypeEnum {
public enum TradeOrderCancelTypeEnum {
PAY_TIMEOUT(10, "超时未支付"),
REFUND_CLOSE(20, "退款关闭"),

View File

@ -15,8 +15,8 @@ public enum TradeOrderStatusEnum {
WAITING_PAYMENT(0, "待付款"),
WAIT_SHIPMENT(1, "待发货"),
ALREADY_SHIPMENT(2, "待收货"),
COMPLETED(3, ""),
CLOSED(4, "失败");
COMPLETED(3, "已完成"),
CANCEL(4, "已关闭");
/**
*

View File

@ -0,0 +1,71 @@
package cn.iocoder.yudao.module.trade.controller.app.cart;
import io.swagger.annotations.Api;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "购物车 API")
@RestController
@RequestMapping("/cart")
@Validated
public class CartController {
// @Autowired
// private CartManager cartManager;
//
// @PostMapping("add")
// @ApiOperation("添加商品到购物车")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "skuId", value = "商品 SKU 编号", required = true, example = "1"),
// @ApiImplicitParam(name = "quantity", value = "增加数量", required = true, example = "1024")
// })
// @RequiresAuthenticate
// public CommonResult<Boolean> addCartItem(@RequestParam("skuId") Integer skuId,
// @RequestParam("quantity") Integer quantity) {
// cartManager.addCartItem(UserSecurityContextHolder.getUserId(), skuId, quantity);
// return success(true);
// }
//
// @GetMapping("sum-quantity")
// @ApiOperation("查询用户在购物车中的商品数量")
// @RequiresAuthenticate
// public CommonResult<Integer> sumCartItemQuantity() {
// return success(cartManager.sumCartItemQuantity(UserSecurityContextHolder.getUserId()));
// }
//
// @GetMapping("/get-detail")
// @ApiOperation("查询用户的购物车的商品列表")
// @RequiresAuthenticate
// public CommonResult<CartDetailVO> getCartDetail() {
// return success(cartManager.getCartDetail(UserSecurityContextHolder.getUserId()));
// }
//
// @PostMapping("update-quantity")
// @ApiOperation("更新购物车商品数量")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "skuId", value = "商品 SKU 编号", required = true, example = "1"),
// @ApiImplicitParam(name = "quantity", value = "增加数量", required = true, example = "1024")
// })
// @RequiresAuthenticate
// public CommonResult<Boolean> updateCartItemQuantity(@RequestParam("skuId") Integer skuId,
// @RequestParam("quantity") Integer quantity) {
// cartManager.updateCartItemQuantity(UserSecurityContextHolder.getUserId(), skuId, quantity);
// return success(true);
// }
//
// @PostMapping("update-selected")
// @ApiOperation("更新购物车商品是否选中")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "skuIds", value = "商品 SKU 编号数组", required = true, example = "1,3"),
// @ApiImplicitParam(name = "selected", value = "是否选中", required = true, example = "true")
// })
// @RequiresAuthenticate
// public CommonResult<Boolean> updateCartItemSelected(@RequestParam("skuIds") Set<Integer> skuIds,
// @RequestParam("selected") Boolean selected) {
// cartManager.updateCartItemSelected(UserSecurityContextHolder.getUserId(), skuIds, selected);
// // 获得目前购物车明细
// return success(true);
// }
}

View File

@ -0,0 +1,211 @@
package cn.iocoder.yudao.module.trade.controller.app.cart.vo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.List;
@ApiModel(value = "用户的购物车明细 Response VO") // TODO 芋艿swagger 文档完善
@Data
@Accessors(chain = true)
public class CartDetailVO {
/**
*
*/
private List<ItemGroup> itemGroups;
/**
*
*/
private Fee fee;
/**
*
*
*
*/
@Data
@Accessors(chain = true)
public static class ItemGroup {
// /**
// * 优惠活动
// */
// private PromotionActivityRespDTO activity; // TODO 芋艿,偷懒
/**
*
*
* 1. null
* 2. Item discountTotal
*/
private Integer activityDiscountTotal;
/**
*
*/
private List<Sku> items;
}
@Data
@Accessors(chain = true)
public static class Sku {
// SKU 自带信息
/**
* sku
*/
private Integer id;
/**
* SPU
*/
private Spu spu;
/**
*
*/
private String picURL;
// /**
// * 规格值数组
// */
// private List<ProductAttrKeyValueRespVO> attrs; // TODO 后面改下
/**
*
*/
private Integer price;
/**
*
*/
private Integer quantity;
// 非 SKU 自带信息
/**
*
*/
private Integer buyQuantity;
/**
*
*/
private Boolean selected;
// /**
// * 优惠活动
// */
// private PromotionActivityRespDTO activity; // TODO 芋艿,偷懒
/**
*
*/
private Integer originPrice;
/**
*
*/
private Integer buyPrice;
/**
*
*/
private Integer presentPrice;
/**
*
*
* {@link #presentTotal}
*/
private Integer buyTotal;
/**
*
*/
private Integer discountTotal;
/**
*
*
* presentPrice * quantity presentTotal
*
* presentPrice = 8.33 quantity = 3 presentTotal 24.99 25
*
*/
private Integer presentTotal;
}
@Data
@Accessors(chain = true)
public static class Spu {
/**
* SPU
*/
private Integer id;
// ========== 基本信息 =========
/**
* SPU
*/
private String name;
/**
*
*/
private Integer cid;
/**
*
*
*
*
* 800*80015
*/
private List<String> picUrls;
}
/**
*
*/
@Data
@Accessors(chain = true)
public static class Fee {
/**
*
*/
private Integer buyTotal;
/**
*
*
*
*/
private Integer discountTotal;
/**
*
*/
private Integer postageTotal;
/**
*
*
* = - +
*/
private Integer presentTotal;
public Fee() {
}
public Fee(Integer buyTotal, Integer discountTotal, Integer postageTotal, Integer presentTotal) {
this.buyTotal = buyTotal;
this.discountTotal = discountTotal;
this.postageTotal = postageTotal;
this.presentTotal = presentTotal;
}
}
/**
* TODO
*/
@Data
@Accessors(chain = true)
public static class Postage {
/**
*
*/
private Integer threshold;
}
}

View File

@ -0,0 +1,31 @@
### /trade-order/confirm-create-order-info 基于商品,确认创建订单
GET {{appApi}}/trade/order/get-create-info?items[0].skuId=1&items[0].count=1
Authorization: Bearer {{user-access-token}}
tenant-id: {{appTenentId}}
### /trade-order/confirm-create-order-info-from-cart 基于购物车,确认创建订单
GET {{shop-api-base-url}}/trade-order/confirm-create-order-info-from-cart
Content-Type: application/x-www-form-urlencoded
Authorization: Bearer {{user-access-token}}
### /trade-order/confirm-create-order-info-from-cart 基于商品,创建订单
POST {{shop-api-base-url}}/trade-order/create
Content-Type: application/json
Authorization: Bearer {{user-access-token}}
{
"userAddressId": 19,
"remark": "我是备注",
"orderItems": [
{
"skuId": 3,
"quantity": 1
}
]
}
### /trade-order/page 获得订单交易分页
GET {{shop-api-base-url}}/trade-order/page?status=1&pageNo=1&pageSize=10
Content-Type: application/x-www-form-urlencoded
###

View File

@ -0,0 +1,61 @@
package cn.iocoder.yudao.module.trade.controller.app.order;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderCreateReqVO;
import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderGetCreateInfoRespVO;
import cn.iocoder.yudao.module.trade.controller.app.order.vo.TradeOrderPageReqVO;
import cn.iocoder.yudao.module.trade.controller.app.order.vo.TradeOrderRespVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
@Api(tags = "用户 App - 交易订单")
@RestController
@RequestMapping("/trade/order")
@Validated
@Slf4j
public class AppTradeOrderController {
// TODO 在思考下;
@GetMapping("/get-create-info")
@ApiOperation("基于商品,确认创建订单")
@PreAuthenticated
public CommonResult<AppTradeOrderGetCreateInfoRespVO> getTradeOrderCreateInfo(AppTradeOrderCreateReqVO createReqVO) {
// return success(tradeOrderService.getOrderConfirmCreateInfo(UserSecurityContextHolder.getUserId(), skuId, quantity, couponCardId));
return null;
}
@PostMapping("/create")
@ApiOperation("创建订单")
@PreAuthenticated
public CommonResult<Integer> createTradeOrder(@RequestBody AppTradeOrderCreateReqVO createReqVO,
HttpServletRequest servletRequest) {
// return success(tradeOrderService.createTradeOrder(UserSecurityContextHolder.getUserId(),
// HttpUtil.getIp(servletRequest), createReqVO));
return null;
}
@GetMapping("/get")
@ApiOperation("获得交易订单")
@ApiImplicitParam(name = "tradeOrderId", value = "交易订单编号", required = true)
public CommonResult<TradeOrderRespVO> getTradeOrder(@RequestParam("tradeOrderId") Integer tradeOrderId) {
// return success(tradeOrderService.getTradeOrder(tradeOrderId));
return null;
}
@GetMapping("/page")
@ApiOperation("获得订单交易分页")
public CommonResult<PageResult<TradeOrderRespVO>> pageTradeOrder(TradeOrderPageReqVO pageVO) {
// return success(tradeOrderService.pageTradeOrder(UserSecurityContextHolder.getUserId(), pageVO));
return null;
}
}

View File

@ -0,0 +1,50 @@
package cn.iocoder.yudao.module.trade.controller.app.order.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.List;
@ApiModel(value = "用户 App - 交易订单创建 Request VO")
@Data
public class AppTradeOrderCreateReqVO {
@ApiModelProperty(name = "收件地址编号", required = true, example = "1")
@NotNull(message = "收件地址不能为空")
private Integer addressId;
@ApiModelProperty(name = "优惠劵编号", example = "1024")
private Integer couponId;
@ApiModelProperty(name = "备注", example = "1024")
private String remark;
@ApiModelProperty(name = "是否来自购物车", required = true, example = "true", notes = "true - 来自购物车false - 立即购买")
@NotNull(message = "是否来自购物车不能为空")
private Boolean fromCart;
/**
*
*/
@NotNull(message = "必须选择购买的商品")
private List<Item> items;
@ApiModel(value = "订单商品项")
@Data
public static class Item {
@ApiModelProperty(name = "商品 SKU 编号", required = true, example = "111")
@NotNull(message = "商品 SKU 编号不能为空")
private Integer skuId;
@ApiModelProperty(name = "商品 SKU 购买数量", required = true, example = "1024")
@NotNull(message = "商品 SKU 购买数量不能为空")
@Min(value = 1, message = "商品 SKU 购买数量必须大于 0")
private Integer count;
}
}

View File

@ -0,0 +1,169 @@
package cn.iocoder.yudao.module.trade.controller.app.order.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.util.List;
@ApiModel(value = "用户 App - 订单获得创建信息 Response VO")
@Data
public class AppTradeOrderGetCreateInfoRespVO {
/**
*
*/
private List<ItemGroup> itemGroups;
/**
*
*/
private Fee fee;
// /**
// * 优惠劵列表 TODO 芋艿,后续改改
// */
// private List<CouponCardAvailableRespDTO> coupons;
@ApiModel(value = "商品分组", description = "多个商品,参加同一个活动,从而形成分组")
@Data
public static class ItemGroup {
// /**
// * 优惠活动
// */
// private PromotionActivityRespDTO activity; // TODO 芋艿,偷懒
/**
* SKU
*/
private List<Sku> items;
}
@ApiModel("商品 SKU")
@Data
public static class Sku {
// SKU 自带信息
@ApiModelProperty(value = "SKU 编号", required = true, example = "1024")
private Integer id;
/**
* SPU
*/
private Spu spu;
/**
*
*/
private String picURL;
// /**
// * 规格值数组
// */
// private List<ProductAttrKeyValueRespVO> attrs; // TODO 后面改下
/**
*
*/
private Integer price;
/**
*
*/
private Integer stock;
// 非 SKU 自带信息
/**
*
*/
private Integer buyQuantity;
// /**
// * 优惠活动
// */
// private PromotionActivityRespDTO activity; // TODO 芋艿,偷懒
/**
*
*/
private Integer originPrice;
/**
*
*/
private Integer buyPrice;
/**
*
*/
private Integer presentPrice;
/**
*
*
* {@link #presentTotal}
*/
private Integer buyTotal;
/**
*
*/
private Integer discountTotal;
/**
*
*
* presentPrice * quantity presentTotal
*
* presentPrice = 8.33 quantity = 3 presentTotal 24.99 25
*
*/
private Integer presentTotal;
}
@Data
public static class Spu {
/**
* SPU
*/
private Integer id;
// ========== 基本信息 =========
/**
* SPU
*/
private String name;
/**
*
*/
private Integer cid;
/**
*
*
*
*
* 800*80015
*/
private List<String> picUrls;
}
@ApiModel("费用(合计)")
@Data
@AllArgsConstructor
public static class Fee {
@ApiModelProperty(value = "购买总价", required = true, example = "1024")
private Integer buyPrice;
/**
*
*
*
*/
private Integer discountTotal;
/**
*
*/
private Integer postageTotal;
/**
*
*
* = - +
*/
private Integer presentTotal;
}
}

View File

@ -0,0 +1,53 @@
package cn.iocoder.yudao.module.trade.controller.app.order.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@ApiModel("交易订单项 Response VO")
@Data
public class TradeOrderItemRespVO {
@ApiModelProperty(value = "id自增长", required = true)
private Integer id;
@ApiModelProperty(value = "订单编号", required = true)
private Integer orderId;
@ApiModelProperty(value = "订单项状态", required = true)
private Integer status;
@ApiModelProperty(value = "商品 SKU 编号", required = true)
private Integer skuId;
@ApiModelProperty(value = "商品 SPU 编号", required = true)
private Integer spuId;
@ApiModelProperty(value = "商品名字", required = true)
private String skuName;
@ApiModelProperty(value = "图片名字", required = true)
private String skuImage;
@ApiModelProperty(value = "商品数量", required = true)
private Integer quantity;
@ApiModelProperty(value = "原始单价,单位:分", required = true)
private Integer originPrice;
@ApiModelProperty(value = "购买单价,单位:分", required = true)
private Integer buyPrice;
@ApiModelProperty(value = "最终价格,单位:分", required = true)
private Integer presentPrice;
@ApiModelProperty(value = "购买总金额,单位:分", required = true)
private Integer buyTotal;
@ApiModelProperty(value = "优惠总金额,单位:分", required = true)
private Integer discountTotal;
@ApiModelProperty(value = "最终总金额,单位:分", required = true)
private Integer presentTotal;
@ApiModelProperty(value = "退款总金额,单位:分", required = true)
private Integer refundTotal;
@ApiModelProperty(value = "物流id")
private Integer logisticsId;
@ApiModelProperty(value = "售后状态", required = true)
private Integer afterSaleStatus;
@ApiModelProperty(value = "售后订单编号")
private Integer afterSaleOrderId;
@ApiModelProperty(value = "创建时间", required = true)
private Date createTime;
}

View File

@ -0,0 +1,17 @@
package cn.iocoder.yudao.module.trade.controller.app.order.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ApiModel("交易订单分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
public class TradeOrderPageReqVO extends PageParam {
@ApiModelProperty(value = "订单状态", example = "1", notes = "参见 TradeOrderStatusEnum 枚举")
private Integer orderStatus;
}

View File

@ -0,0 +1,70 @@
package cn.iocoder.yudao.module.trade.controller.app.order.vo;
import lombok.*;
import io.swagger.annotations.*;
import java.util.*;
@ApiModel("订单交易 Response VO")
@Data
public class TradeOrderRespVO {
@ApiModelProperty(value = "订单编号", required = true)
private Integer id;
@ApiModelProperty(value = "用户编号", required = true)
private Integer userId;
@ApiModelProperty(value = "订单单号", required = true)
private String orderNo;
@ApiModelProperty(value = "订单状态", required = true)
private Integer orderStatus;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "订单结束时间")
private Date endTime;
@ApiModelProperty(value = "订单金额(总金额),单位:分", required = true)
private Integer buyPrice;
@ApiModelProperty(value = "优惠总金额,单位:分", required = true)
private Integer discountPrice;
@ApiModelProperty(value = "物流金额,单位:分", required = true)
private Integer logisticsPrice;
@ApiModelProperty(value = "最终金额,单位:分", required = true)
private Integer presentPrice;
@ApiModelProperty(value = "支付金额,单位:分", required = true)
private Integer payPrice;
@ApiModelProperty(value = "退款金额,单位:分", required = true)
private Integer refundPrice;
@ApiModelProperty(value = "付款时间")
private Date payTime;
@ApiModelProperty(value = "支付订单编号")
private Integer payTransactionId;
@ApiModelProperty(value = "支付渠道")
private Integer payChannel;
@ApiModelProperty(value = "配送类型", required = true)
private Integer deliveryType;
@ApiModelProperty(value = "发货时间")
private Date deliveryTime;
@ApiModelProperty(value = "收货时间")
private Date receiveTime;
@ApiModelProperty(value = "收件人名称", required = true)
private String receiverName;
@ApiModelProperty(value = "手机号", required = true)
private String receiverMobile;
@ApiModelProperty(value = "地区编码", required = true)
private Integer receiverAreaCode;
@ApiModelProperty(value = "收件详细地址", required = true)
private String receiverDetailAddress;
@ApiModelProperty(value = "售后状态", required = true)
private Integer afterSaleStatus;
@ApiModelProperty(value = "优惠劵编号")
private Integer couponCardId;
@ApiModelProperty(value = "创建时间", required = true)
private Date createTime;
/**
*
*
* // TODO 芋艿,后续考虑怎么优化下,目前是内嵌了别的 dto
*/
private List<TradeOrderItemRespVO> orderItems;
}

View File

@ -0,0 +1,4 @@
package cn.iocoder.yudao.module.trade.controller.app.refund;
public class TradeRefundController {
}

View File

@ -0,0 +1,6 @@
/**
* RESTful API
* 1. admin yudao-ui-admin
* 2. app APP yudao-ui-app Controller VO App
*/
package cn.iocoder.yudao.module.trade.controller;

View File

@ -36,12 +36,6 @@ public class CartItemDO extends BaseDO {
// ========= 买家信息 BEGIN =========
// /**
// * 店铺编号
// *
// * 关联 {@link ShopDO#getId()} TODO 芋艿:多店铺,暂不考虑
// */
// private Long shopId;
/**
*
*

View File

@ -3,10 +3,10 @@ package cn.iocoder.yudao.module.trade.dal.dataobject.order;
import cn.iocoder.yudao.framework.common.enums.TerminalEnum;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.module.product.enums.delivery.DeliveryTypeEnum;
import cn.iocoder.yudao.module.trade.enums.order.TradeOrderCloseTypeEnum;
import cn.iocoder.yudao.module.trade.enums.order.TradeOrderCancelTypeEnum;
import cn.iocoder.yudao.module.trade.enums.order.TradeOrderRefundStatusEnum;
import cn.iocoder.yudao.module.trade.enums.order.TradeOrderStatusEnum;
import cn.iocoder.yudao.module.trade.enums.order.TradeOrderTypeEnum;
import cn.iocoder.yudao.module.trade.enums.order.TradeOrderRefundStatusEnum;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
@ -32,67 +32,68 @@ public class TradeOrderDO extends BaseDO {
/**
*
*/
private Integer id;
private Long id;
/**
*
*
* 1146347329394184195
*/
private String sn;
// TODO 芋艿order_type 订单类型
/**
*
*
* {@link TradeOrderTypeEnum}
*/
private Integer type;
private Integer type; // TODO order_promotion_type
/**
*
*
* {@link TerminalEnum}
*/
private Integer terminal;
// /**
// * 店铺编号
// *
// * 关联 {@link ShopDO#getId()} TODO 芋艿:多店铺,暂不考虑
// */
// private Long shopId;
/**
*
*
* MemberUserDO id
*/
private Long userId;
/**
* IP
*/
private String userIp;
/**
*
*/
private String userRemark;
/**
*
*
* {@link TradeOrderStatusEnum}
*/
private Integer status;
/**
*
*
* {@link TradeOrderCloseTypeEnum}
*/
private Integer closeType;
// TODO 芋艿:要不要存储 prod_name 购买的商品名门?
/**
*
*/
private Integer productCount; // total_num
/**
*
*
*/
private String remark;
/**
*
*/
private Date confirmTakeTime;
private Date finishTime;
/**
*
*/
private Date cancelTime;
/**
*
*
* {@link TradeOrderCancelTypeEnum}
*/
private Integer cancelType;
/**
*
*/
private String remark;
// ========== 价格 + 支付基本信息 ==========
/**
@ -101,39 +102,33 @@ public class TradeOrderDO extends BaseDO {
* true -
* false -
*/
private Boolean payed; // TODO payStatus 0 - 待付款1 - 已付款2 - 已退款
private Boolean payed;
/**
*
*/
private Date payTime;
// TODO 芋艿delete_status 用户订单删除状态0 - 未删除1 - 回收站2 - 永久删除
// ========== 价格 + 支付基本信息 ==========
/**
*
*/
private Integer buyPrice; // total
private Integer buyPrice; // niu - goods_money
/**
*
*
*/
private Integer discountPrice; // reduce_amount
/**
* ()
*/
private Integer logisticsPrice; // freight_amount; freight_price
private Integer deliveryPrice; // niu - delivery_money
/**
*
*
* buyPrice + logisticsPrice - discountPrice = presentPrice
* presentPrice = buyPrice + deliveryPrice - couponPrice - integralPrice - marketPrice
*/
private Integer presentPrice; // actual_total
private Integer presentPrice; // niu - order_money
/**
*
*
* 0
*/
private Integer payPrice;
private Integer payPrice; // niu - pay_money
/**
*
*
@ -148,10 +143,19 @@ public class TradeOrderDO extends BaseDO {
// ========== 收件 + 物流基本信息 ==========
/**
*
*
*
* {@link DeliveryTypeEnum}
*/
private Integer deliveryType;
/**
*
*
*
* 0 -
* {@link DeliveryTypeEnum}
*/
private Integer actualDeliveryType; // like - shipping_status
/**
*
*
@ -162,6 +166,13 @@ public class TradeOrderDO extends BaseDO {
*
*/
private String expressNo; // dvy_flow_id
/**
*
*
* true -
* false -
*/
private Boolean deliveryStatus;
/**
*
*/
@ -210,26 +221,35 @@ public class TradeOrderDO extends BaseDO {
/**
*
*/
private Integer couponId;
// TODO 芋艿,这块还要结合营销和价格计算,在去优化下。
private Long couponId;
/**
*
*/
private Integer couponPrice; // niu - coupon_money
/**
*
*
*
*/
private Integer marketPrice; // niu - promotion_money
/**
*
*/
private Integer integralPrice;
/**
* 使
*/
private Integer useIntegral;
// TODO ========== 待定字段yv =========
// TODO cart_id购物车 id
// TODO total_postage邮费
// TODO pay_postage支付邮费
// TODO coupon_price优惠劵金额
// TODO refund_status0 未退款1 申请中2 已退款
// TODO refund_reason_wap_img退款图片
// TODO refund_reason_wap_explain退款用户说明
// TODO refund_reason_time退款时间
// TODO refund_reason_wap前台退款原因
// TODO refund_reason不退款的理由
// TODO refund_price退款金额
// TODO gain_integral消费赚取积分
// TODO use_integral使用积分
// TODO pay_integral实际支付积分
// TODO back_integral给用户退了多少积分
// TODO combination_id拼团产品id
@ -246,18 +266,19 @@ public class TradeOrderDO extends BaseDO {
// TODO is_alter_price是否改价
// TODO out_trade_no商户系统内部的订单号 String
// TODO ========== 待定字段lf =========
// TODO integral_amount积分抵扣金额
// TODO shipping_status发货状态
// TODO shipping_time最后新发货时间
// TODO ========== 待定字段lf =========
// TODO settle_id未结算
// TODO settle_amount结算金额
// TODO use_integral使用的积分
// TODO team_found_id: 拼团id
// TODO team_id: 拼团活动id
// TODO delivery_id: 发货单ID
// TODO attach_values: 附带的值(赠送时机,赠送积分成长值什么的)Json格式
// TODO ========== 待定字段nf =========
// TODO delivery_code整体提货编码
// TODO ========== 待定字段niu =========
// TODO adjust_money '订单调整金额'
// TODO balance_money ''余额支付金额''
}

View File

@ -26,13 +26,7 @@ public class TradeOrderItemDO extends BaseDO {
/**
*
*/
private Integer id;
// /**
// * 店铺编号
// *
// * 关联 {@link ShopDO#getId()} TODO 芋艿:多店铺,暂不考虑
// */
// private Long shopId;
private Long id;
/**
*
*
@ -47,12 +41,6 @@ public class TradeOrderItemDO extends BaseDO {
private Long orderId;
// ========== 商品基本信息 ==========
/**
* SPU
*
* ProductSpuDO id
*/
private Long spuId;
/**
* SKU
*
@ -75,7 +63,7 @@ public class TradeOrderItemDO extends BaseDO {
/**
*
*/
private Integer stock;
private Integer count;
/**
*
*
@ -85,37 +73,47 @@ public class TradeOrderItemDO extends BaseDO {
private Boolean commented;
// ========== 价格 + 支付基本信息 ==========
/**
*
*/
private Integer originPrice; // price
/**
*
*
* ProductSkuDO price
*/
private Integer buyPrice;
private Integer buyPrice; // like - original_priceniu - costPrice
/**
*
*/
private Integer presentPrice;
private Integer presentPrice; // like - goods_priceniu - price
/**
*
*
* {@link #presentTotal}
*/
private Integer buyTotal;
/**
*
*/
private Integer discountTotal;
private Integer buyTotal; // like - total_priceniu - 暂无
/**
*
*
* presentPrice * stock presentTotal
* presentPrice * count presentTotal
*
* presentPrice = 8.33 stock = 3 presentTotal 24.99 25
*
*/
private Integer presentTotal; // product_total_amount
private Integer presentTotal; // like - total_pay_priceniu - goods_money
// ========== 营销基本信息 ==========
/**
*
*/
private Integer couponTotal; // like - discount_priceniu - coupon_money
/**
*
*/
private Integer marketTotal; // like - discount_priceniu - promotion_money
/**
*
*/
private Integer integralTotal; // like - integral_priceniu - point_money
/**
* 使
*/
private Integer useIntegral; // niu - use_point
// ========== 退款基本信息 ==========
/**
@ -123,7 +121,7 @@ public class TradeOrderItemDO extends BaseDO {
*
* {@link TradeOrderItemRefundStatusEnum}
*/
private Integer refundStatus;
private Integer refundStatus; // TODO 芋艿:可以考虑去查
// 如上字段,举个例子:
// 假设购买三个,即 stock = 3 。
// originPrice = 15
@ -178,4 +176,22 @@ public class TradeOrderItemDO extends BaseDO {
// TODO goods_info 商品信息
// TODO integral_price积分抵扣的金额
// TODO 待确定niu
// TODO is_virtual '是否是虚拟商品'
// TODO goods_class '商品种类(1.实物 2.虚拟3.卡券)'
// TODO adjust_money ''调整金额''
// TODO is_fenxiao 是否分销,
// TODO adjust_money 是否分销,
// TODO delivery_status '配送状态'
// TODO delivery_no ''配送单号''
// TODO gift_flag '赠品标识'
// TODO gift_flag '赠品标识'
// TODO refund_status '退款状态'
// TODO refund_type '退款状态'
// TODO 一堆退款字段
}

View File

@ -42,12 +42,6 @@ public class TradeRefundDO extends BaseDO {
* {@link TradeOrderRefundStatusEnum}
*/
private Integer status;
// /**
// * 店铺编号
// *
// * 关联 {@link ShopDO#getId()} TODO 芋艿:多店铺,暂不考虑
// */
// private Long shopId;
/**
*
*

View File

@ -51,6 +51,11 @@
<artifactId>yudao-module-product-biz</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-trade-biz</artifactId>
<version>${revision}</version>
</dependency>
<!-- 数据报表 -->
<!-- <dependency>-->
<!-- <groupId>cn.iocoder.boot</groupId>-->