生成订单
优惠券字段
This commit is contained in:
@@ -121,6 +121,12 @@ public class ShopCouponDTO implements Serializable {
|
||||
*/
|
||||
private BigDecimal discountAmount;
|
||||
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Long proId;
|
||||
private String proName;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
|
||||
package com.czg.order.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单表 实体类。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2025-02-13
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CheckOrderPay implements Serializable {
|
||||
|
||||
private Long orderId;
|
||||
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用餐人数
|
||||
*/
|
||||
private Integer seatNum;
|
||||
|
||||
/**
|
||||
* 订单原金额(包含打包费+餐位费) 不含折扣价格
|
||||
*/
|
||||
private BigDecimal originAmount;
|
||||
|
||||
/**
|
||||
* 折扣比例(计算时 向上取整保留 两位小数)
|
||||
*/
|
||||
private BigDecimal discountRatio;
|
||||
/**
|
||||
* 手动优惠金额
|
||||
*/
|
||||
private BigDecimal discountAmount;
|
||||
|
||||
/**
|
||||
* 商品优惠券抵扣金额
|
||||
*/
|
||||
private BigDecimal productCouponDiscountAmount;
|
||||
/**
|
||||
* 满减优惠券抵扣金额
|
||||
*/
|
||||
private BigDecimal fullCouponDiscountAmount;
|
||||
/**
|
||||
* 用户使用的卡券
|
||||
*/
|
||||
private List<Long> couponList;
|
||||
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
private BigDecimal orderAmount;
|
||||
/**
|
||||
* 抹零金额 减免多少钱
|
||||
*/
|
||||
private BigDecimal roundAmount;
|
||||
|
||||
/**
|
||||
* 积分抵扣金额(tb_points_basic_setting表)
|
||||
*/
|
||||
private BigDecimal pointsDiscountAmount;
|
||||
|
||||
/**
|
||||
* 使用的积分数量 (扣除各类折扣 enable_deduction后使用)
|
||||
*/
|
||||
private Integer pointsNum;
|
||||
|
||||
|
||||
public Integer getSeatNum() {
|
||||
return seatNum == null ? 0 : seatNum;
|
||||
}
|
||||
|
||||
public Integer getPointsNum() {
|
||||
return pointsNum == null ? 0 : pointsNum;
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,6 @@ import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单表 实体类。
|
||||
@@ -47,47 +46,6 @@ public class OrderInfoAddDTO implements Serializable {
|
||||
*/
|
||||
private BigDecimal originAmount;
|
||||
|
||||
/**
|
||||
* 折扣比例(计算时 向上取整保留 两位小数)
|
||||
*/
|
||||
private BigDecimal discountRatio;
|
||||
/**
|
||||
* 手动优惠金额
|
||||
*/
|
||||
private BigDecimal discountAmount;
|
||||
|
||||
/**
|
||||
* 商品优惠券抵扣金额
|
||||
*/
|
||||
private BigDecimal productCouponDiscountAmount;
|
||||
/**
|
||||
* 满减优惠券抵扣金额
|
||||
*/
|
||||
private BigDecimal fullCouponDiscountAmount;
|
||||
/**
|
||||
* 用户使用的卡券
|
||||
*/
|
||||
private List<Long> couponList;
|
||||
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
private BigDecimal orderAmount;
|
||||
/**
|
||||
* 抹零金额 减免多少钱
|
||||
*/
|
||||
private BigDecimal roundAmount;
|
||||
|
||||
/**
|
||||
* 积分抵扣金额(tb_points_basic_setting表)
|
||||
*/
|
||||
private BigDecimal pointsDiscountAmount;
|
||||
|
||||
/**
|
||||
* 使用的积分数量 (扣除各类折扣 enable_deduction后使用)
|
||||
*/
|
||||
private Integer pointsNum;
|
||||
|
||||
/**
|
||||
* 台桌Id
|
||||
*/
|
||||
@@ -109,6 +67,13 @@ public class OrderInfoAddDTO implements Serializable {
|
||||
* APP APP管理端
|
||||
*/
|
||||
private String platformType;
|
||||
/**
|
||||
* 支付模式:
|
||||
* 后付费 after-pay
|
||||
* 先付费 before-pay
|
||||
* 无桌码 no-table
|
||||
*/
|
||||
private String payMode;
|
||||
|
||||
/**
|
||||
* 用餐模式 堂食 dine-in 外带 take-out 外卖 take-away
|
||||
@@ -116,12 +81,6 @@ public class OrderInfoAddDTO implements Serializable {
|
||||
@NotBlank(message = "用餐模式不能为空")
|
||||
private String dineMode;
|
||||
|
||||
/**
|
||||
* 支付模式: afterPay 后付费 normal 正常模式 buyer 挂账模式
|
||||
*/
|
||||
@NotBlank(message = "付款模式不能为空")
|
||||
private String payMode;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@@ -152,8 +111,4 @@ public class OrderInfoAddDTO implements Serializable {
|
||||
public String getDineMode() {
|
||||
return StrUtil.isBlank(dineMode) ? "dine-in" : dineMode;
|
||||
}
|
||||
|
||||
public Integer getPointsNum() {
|
||||
return pointsNum == null ? 0 : pointsNum;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public class OrderInfoDTO implements Serializable {
|
||||
/**
|
||||
* 折扣比例
|
||||
*/
|
||||
private String discountRatio;
|
||||
private BigDecimal discountRatio;
|
||||
|
||||
/**
|
||||
* 打包费
|
||||
@@ -143,7 +143,10 @@ public class OrderInfoDTO implements Serializable {
|
||||
private String dineMode;
|
||||
|
||||
/**
|
||||
* 支付模式: afterPay 后付费 normal 正常模式 buyer 挂账模式
|
||||
* 支付模式:
|
||||
* 后付费 after-pay
|
||||
* 先付费 before-pay
|
||||
* 无桌码 no-table
|
||||
*/
|
||||
private String payMode;
|
||||
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
|
||||
package com.czg.order.dto;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.order.entity.OrderDetail;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 退单Dto。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2025-02-13
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OrderInfoRefundDTO implements Serializable {
|
||||
|
||||
@NotNull(message = "订单Id不能为空")
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 退单总金额
|
||||
*/
|
||||
@NotNull(message = "退单金额不能为空")
|
||||
private BigDecimal refundAmount;
|
||||
|
||||
/**
|
||||
* 退款金额 默认为 退单数量*单价 的和
|
||||
* 整单退款 为订单orderAmount
|
||||
* 如果自定义退款金额 则金额不进行校验 直接退款
|
||||
*/
|
||||
private boolean modify;
|
||||
|
||||
private String refundReason;
|
||||
|
||||
/**
|
||||
* 退单明细
|
||||
* id: orderDetailId
|
||||
* num: 退单数量
|
||||
* returnAmount: 退单金额
|
||||
*/
|
||||
private List<OrderDetail> refundDetails;
|
||||
|
||||
public String getRefundReason() {
|
||||
if (StrUtil.isNotBlank(refundReason)) {
|
||||
refundReason = refundReason.trim().replaceAll(" ", ",");
|
||||
return refundReason;
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
|
||||
package com.czg.order.dto;
|
||||
|
||||
import com.czg.order.entity.OrderDetail;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单表 实体类。
|
||||
*
|
||||
* @author ww
|
||||
* @since 2025-02-13
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OrderInfoUpDTO implements Serializable {
|
||||
|
||||
@NotNull(message = "订单Id不能为空")
|
||||
private Long orderId;
|
||||
|
||||
private Integer seatNum;
|
||||
|
||||
private List<OrderDetail> detailList;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.czg.order.entity;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
@@ -157,4 +158,15 @@ public class OrderDetail implements Serializable {
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
public BigDecimal getRefundNum() {
|
||||
return refundNum == null ? BigDecimal.ZERO : refundNum;
|
||||
}
|
||||
|
||||
public BigDecimal getReturnAmount() {
|
||||
return returnAmount == null ? BigDecimal.ZERO : returnAmount;
|
||||
}
|
||||
|
||||
public String getRefundRemark() {
|
||||
return StrUtil.isBlank(refundRemark) ? "" : refundRemark + " ";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ public class OrderInfo implements Serializable {
|
||||
/**
|
||||
* 折扣比例
|
||||
*/
|
||||
private String discountRatio;
|
||||
private BigDecimal discountRatio;
|
||||
|
||||
/**
|
||||
* 打包费
|
||||
@@ -148,7 +148,10 @@ public class OrderInfo implements Serializable {
|
||||
private String dineMode;
|
||||
|
||||
/**
|
||||
* 支付模式: afterPay 后付费 normal 正常模式 buyer 挂账模式
|
||||
* 支付模式:
|
||||
* 后付费 after-pay
|
||||
* 先付费 before-pay
|
||||
* 无桌码 no-table
|
||||
*/
|
||||
private String payMode;
|
||||
|
||||
@@ -164,6 +167,7 @@ public class OrderInfo implements Serializable {
|
||||
private String payType;
|
||||
|
||||
/**
|
||||
* OrderStatusEnums 枚举类
|
||||
* 状态: unpaid-待支付;in-production 制作中;wait-out 待取餐;;done-订单完成;refunding-申请退单;refund-退单;part-refund 部分退单;cancelled-取消订单
|
||||
*/
|
||||
private String status;
|
||||
@@ -258,47 +262,8 @@ public class OrderInfo implements Serializable {
|
||||
*/
|
||||
private Integer isDel;
|
||||
|
||||
public BigDecimal getOriginAmount() {
|
||||
return originAmount == null ? BigDecimal.ZERO : originAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getRoundAmount() {
|
||||
return roundAmount == null ? BigDecimal.ZERO : roundAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getOrderAmount() {
|
||||
return orderAmount == null ? BigDecimal.ZERO : orderAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getPointsDiscountAmount() {
|
||||
return pointsDiscountAmount == null ? BigDecimal.ZERO : pointsDiscountAmount;
|
||||
}
|
||||
|
||||
public Integer getPointsNum() {
|
||||
return pointsNum == null ? 0 : pointsNum;
|
||||
}
|
||||
|
||||
public BigDecimal getProductCouponDiscountAmount() {
|
||||
return productCouponDiscountAmount == null ? BigDecimal.ZERO : productCouponDiscountAmount;
|
||||
}
|
||||
|
||||
public String getCouponInfoList() {
|
||||
return StrUtil.isBlank(couponInfoList) ? "" : couponInfoList;
|
||||
}
|
||||
|
||||
public BigDecimal getFullCouponDiscountAmount() {
|
||||
return fullCouponDiscountAmount == null ? BigDecimal.ZERO : fullCouponDiscountAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getDiscountAmount() {
|
||||
return discountAmount == null ? BigDecimal.ZERO : discountAmount;
|
||||
}
|
||||
|
||||
public String getDiscountRatio() {
|
||||
return discountRatio == null ? "" : discountRatio + ",";
|
||||
}
|
||||
|
||||
public BigDecimal getPackFee() {
|
||||
return packFee == null ? BigDecimal.ZERO : packFee;
|
||||
public String getRefundRemark() {
|
||||
return StrUtil.isBlank(refundRemark) ? "" : refundRemark + " ";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.czg.order.service;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.czg.order.dto.OrderInfoAddDTO;
|
||||
import com.czg.order.dto.OrderInfoQueryDTO;
|
||||
import com.czg.order.dto.*;
|
||||
import com.czg.order.entity.OrderInfo;
|
||||
import com.czg.order.enums.PayEnums;
|
||||
import com.czg.order.vo.OrderInfoVo;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
@@ -25,6 +25,12 @@ public interface OrderInfoService extends IService<OrderInfo> {
|
||||
Page<OrderInfoVo> getOrderByPage(OrderInfoQueryDTO param);
|
||||
OrderInfo createOrder(OrderInfoAddDTO param);
|
||||
|
||||
// void updateOrder(OrderInfoUpDTO upDTO);
|
||||
|
||||
BigDecimal checkOrderPay(CheckOrderPay param);
|
||||
|
||||
CzgResult<Object> refundOrder(OrderInfoRefundDTO param);
|
||||
|
||||
void payCallBackOrder(@NotBlank String orderNo, @NotNull JSONObject resultJson);
|
||||
|
||||
void refundCallBackOrder(@NotBlank String orderNo, @NotNull JSONObject resultJson);
|
||||
|
||||
Reference in New Issue
Block a user