feat(商城): 添加订单详情

master
wayn 3 years ago
parent 78828a14f9
commit 416814d298

@ -0,0 +1,179 @@
package com.wayn.common.core.domain.vo.order;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author wayn
* @since 2020-08-11
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class OrderDetailVO implements Serializable {
private static final long serialVersionUID = 3129813461714576208L;
private Long id;
/**
* ID
*/
private Long userId;
/**
*
*/
private String orderSn;
/**
*
*/
private Short orderStatus;
/**
* 0123退45
*/
private Short aftersaleStatus;
/**
*
*/
private String consignee;
/**
*
*/
private String mobile;
/**
*
*/
private String address;
/**
*
*/
private String message;
/**
*
*/
private BigDecimal goodsPrice;
/**
*
*/
private BigDecimal freightPrice;
/**
*
*/
private BigDecimal couponPrice;
/**
*
*/
private BigDecimal integralPrice;
/**
*
*/
private BigDecimal grouponPrice;
/**
* = goods_price + freight_price - coupon_price
*/
private BigDecimal orderPrice;
/**
* = order_price - integral_price
*/
private BigDecimal actualPrice;
/**
*
*/
private String payId;
/**
* 1 2
*/
private Integer payType;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime payTime;
/**
*
*/
private String shipSn;
/**
*
*/
private String shipChannel;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime shipTime;
/**
* 退退
*/
private BigDecimal refundAmount;
/**
* 退
*/
private String refundType;
/**
* 退
*/
private String refundContent;
/**
* 退
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime refundTime;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime confirmTime;
/**
*
*/
private Integer comments;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime orderEndTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
private List<OrderGoodsVO> orderGoodsVOList;
}

@ -0,0 +1,69 @@
package com.wayn.common.core.domain.vo.order;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* <p>
*
* </p>
*
* @author wayn
* @since 2020-08-11
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class OrderGoodsVO implements Serializable {
private static final long serialVersionUID = -8548938788899621492L;
private Long id;
/**
* ID
*/
private Long orderId;
/**
* ID
*/
private Long goodsId;
/**
*
*/
private String goodsName;
/**
*
*/
private String goodsSn;
/**
*
*/
private Integer number;
/**
*
*/
private BigDecimal price;
/**
*
*/
private String[] specifications;
/**
*
*/
private String picUrl;
/**
* -10commentID
*/
private Integer comment;
}

@ -48,6 +48,12 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.7.17</version>
</dependency>
</dependencies>
<build>

@ -1,11 +1,13 @@
package com.wayn.mobile.api.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.internal.util.AlipaySignature;
import com.alipay.api.request.AlipayTradeWapPayRequest;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@ -23,6 +25,8 @@ import com.wayn.common.config.WaynConfig;
import com.wayn.common.constant.Constants;
import com.wayn.common.core.domain.shop.*;
import com.wayn.common.core.domain.vo.OrderVO;
import com.wayn.common.core.domain.vo.order.OrderDetailVO;
import com.wayn.common.core.domain.vo.order.OrderGoodsVO;
import com.wayn.common.core.service.shop.*;
import com.wayn.common.core.util.OrderHandleOption;
import com.wayn.common.core.util.OrderUtil;
@ -163,6 +167,22 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
return success;
}
@Override
public R getOrderDetailByOrderSn(String orderSn) {
R success = R.success();
LambdaQueryWrapper<Order> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(Order::getOrderSn, orderSn);
Order order = getOne(queryWrapper);
OrderDetailVO orderDetailVO = new OrderDetailVO();
MyBeanUtil.copyProperties(order, orderDetailVO);
LambdaQueryWrapper<OrderGoods> queryWrapper1 = Wrappers.lambdaQuery(OrderGoods.class);
queryWrapper1.eq(OrderGoods::getOrderId, order.getId());
List<OrderGoods> list = iOrderGoodsService.list(queryWrapper1);
List<OrderGoodsVO> orderGoodsVOS = BeanUtil.copyToList(list, OrderGoodsVO.class);
orderDetailVO.setOrderGoodsVOList(orderGoodsVOS);
return success.add("order", orderDetailVO);
}
@Override
public R asyncSubmit(OrderVO orderVO) {
OrderDTO orderDTO = new OrderDTO();

Loading…
Cancel
Save