Commit 2444383f by wuwenlong

query order info by order no;

parent 02ef6b7c
......@@ -14,6 +14,7 @@ import share.common.core.domain.R;
import share.common.core.redis.RedisUtil;
import share.common.utils.JsonConvertUtil;
import share.system.domain.SOrder;
import share.system.domain.vo.SOrderVo;
import share.system.request.CreateOrderRequest;
import share.system.request.OrderComputedPriceRequest;
import share.system.response.ComputedOrderPriceResponse;
......@@ -71,6 +72,15 @@ public class SOrderController extends BaseController
}
/**
* 获取订单详细信息
*/
@ApiOperation(value = "通过订单编号查询订单")
@GetMapping(value = "/{orderNo}")
public R<SOrderVo> queryOrderInfoByNo(@PathVariable("orderNo") String orderNo) {
return R.ok(sOrderService.queryOrderInfoByNo(orderNo));
}
/**
* 开门
*/
@ApiOperation(value = "开门")
......
package share.system.domain.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
import java.util.Date;
/**
* 订单对象 s_order
*
* @author ruoyi
* @date 2023-10-09
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="SOrderVo对象", description="订单对象")
public class SOrderVo
{
private static final long serialVersionUID = 1L;
/** 订单ID */
private Long id;
/** 订单流水号 */
@ApiModelProperty(value = "订单编号")
private String orderNo;
@ApiModelProperty(value = "商户订单号")
private String outTradeNo;
/** 订单类型(0:订房订单,1:续房订单,2:充值订单) */
@ApiModelProperty(value = "订单类型(1:订房订单,2:续房订单,3:充值订单)")
private Integer orderType;
@ApiModelProperty(value = "支付类型(1:微信,2:支付宝)")
private Integer payType;
@ApiModelProperty(value = "支付状态(0:未支付,1:已支付)")
private Integer payStatus;
@ApiModelProperty(value = "门店ID")
private Long storeId;
@ApiModelProperty(value = "房间ID")
private Long roomId;
/** 用户ID */
@ApiModelProperty(value = "用户ID")
private Long consumerId;
/** 用户名称 */
@ApiModelProperty(value = "用户名称")
private String consumerName;
/** 用户手机号 */
@ApiModelProperty(value = "用户手机号")
private String consumerPhone;
@ApiModelProperty(value = "套餐ID")
private Long packId;
@ApiModelProperty(value = "套餐金额")
private BigDecimal packPrice;
/** 优惠券id */
@ApiModelProperty(value = "优惠券id")
private Long couponId;
@ApiModelProperty(value = "优惠券金额")
private BigDecimal couponPrice;
@ApiModelProperty(value = "订单总价")
private BigDecimal totalPrice;
@ApiModelProperty(value = "实际支付金额")
private BigDecimal payPrice;
@ApiModelProperty(value = "支付时间")
private Date payTime;
@ApiModelProperty(value = "订单时长(H)")
private String timeLong;
/** 预约开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
@ApiModelProperty(value = "预约开始时间")
private Date preStartDate;
/** 预约结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
@ApiModelProperty(value = "预约结束时间")
private Date preEndDate;
/** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
@ApiModelProperty(value = "开始时间")
private Date startDate;
/** 结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
@ApiModelProperty(value = "结束时间")
private Date endDate;
/** 订单状态(0:待使用/已预约,1:使用中,2:已使用,3:已取消预约/退款中,4:审核中,5:已退费) */
@ApiModelProperty(value = "订单状态(0:待使用/已预约,1:使用中,2:已使用,3:已取消预约/申请退款,4:退款中,5:已退费)")
private Integer status;
@ApiModelProperty(value = "0 未退款 1 申请中 2 退款中 3 已退款 4 拒绝退款")
@TableField(value = "refund_status")
private Integer refundStatus;
@ApiModelProperty(value = "退款说明")
@TableField(value = "refund_reason")
private String refundReason;
@ApiModelProperty(value = "退款时间")
@TableField(value = "refund_reason_time")
private Date refundReasonTime;
@ApiModelProperty(value = "退款金额")
private BigDecimal refundPrice;
//逻辑删除注解(0 未删除 1 已删除)
private Integer isDelete;
private Integer buyType;
/** 创建者 */
private String createBy;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/** 更新者 */
private String updateBy;
/** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/** 备注 */
private String remark;
@ApiModelProperty(value = "门店名称")
private String storeName;
@ApiModelProperty(value = "房间名称")
private String roomName;
/** 门店地址 */
@ApiModelProperty(value = "门店地址")
private String address;
}
......@@ -5,6 +5,7 @@ import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import share.system.domain.SOrder;
import share.system.domain.vo.SOrderVo;
import share.system.request.CreateOrderRequest;
import share.system.request.OrderComputedPriceRequest;
import share.system.request.OrderRefundRequest;
......@@ -124,4 +125,6 @@ public interface ISOrderService extends IService<SOrder>
boolean cancel(String orderNo);
SOrder selectSOrderByOrderNo(String orderNo);
SOrderVo queryOrderInfoByNo(String orderNo);
}
......@@ -25,6 +25,7 @@ import org.springframework.stereotype.Service;
import share.common.utils.bean.BeanUtils;
import share.system.domain.*;
import share.system.domain.vo.FrontTokenComponent;
import share.system.domain.vo.SOrderVo;
import share.system.domain.vo.SRoomVo;
import share.system.mapper.SOrderMapper;
import share.system.request.CreateOrderRequest;
......@@ -60,6 +61,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
private OrderRefundService orderRefundService;
@Autowired
private ISStoreService storeService;
@Autowired
private ISRoomService roomService;
@Autowired
......@@ -176,6 +180,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
response.setStatus(YesNoEnum.yes.getFlag());
response.setOrderNo(sOrder.getOrderNo());
sOrder.setPayStatus(YesNoEnum.yes.getIndex());
sOrder.setPayTime(DateUtils.getNowDate());
}else {
response = orderPayService.payment(sOrder);
// 加入自动未支付自动取消队列
......@@ -250,6 +255,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
SPack pack = packService.getById(sOrder.getPackId());
sOrder.setPackPrice(pack.getPrice());
}
sOrder.setCreateTime(DateUtils.getNowDate());
return sOrder;
}
......@@ -389,6 +395,19 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
}
@Override
public SOrderVo queryOrderInfoByNo(String orderNo) {
SOrder en = getByOrderNo(orderNo);
SOrderVo vo = new SOrderVo();
BeanUtils.copyProperties(en,vo);
SStore store = storeService.getById(vo.getStoreId());
SRoom room = roomService.getById(vo.getRoomId());
vo.setStoreName(store.getName());
vo.setAddress(store.getAddress());
vo.setRoomName(room.getName());
return vo;
}
@Override
public String openDoor(Long id) {
SOrder sOrder = sOrderMapper.selectSOrderById(id);
if (Objects.isNull(sOrder)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment