|
|
@@ -3,17 +3,17 @@ package com.zhongshu.card.server.core.domain.payment;
|
|
|
import cn.hutool.json.JSONObject;
|
|
|
import com.github.microservice.models.type.OrderFromType;
|
|
|
import com.github.microservice.pay.client.model.ledger.TransactionLogModel;
|
|
|
-import com.github.microservice.types.payment.PaymentDeviceType;
|
|
|
-import com.github.microservice.types.payment.PaymentType;
|
|
|
import com.github.microservice.types.OrderModeType;
|
|
|
import com.github.microservice.types.OrderState;
|
|
|
+import com.github.microservice.types.payment.PaymentDeviceType;
|
|
|
+import com.github.microservice.types.payment.PaymentType;
|
|
|
import com.zhongshu.card.client.model.school.AreaSimpleModel;
|
|
|
import com.zhongshu.card.client.type.RefundState;
|
|
|
import com.zhongshu.card.client.type.payment.SettlementState;
|
|
|
+import com.zhongshu.card.client.utils.DateUtils;
|
|
|
import com.zhongshu.card.server.core.domain.base.SuperMain;
|
|
|
import com.zhongshu.card.server.core.domain.org.UserAccount;
|
|
|
import com.zhongshu.card.server.core.domain.school.CardInfo;
|
|
|
-import com.zhongshu.card.client.utils.DateUtils;
|
|
|
import io.swagger.v3.oas.annotations.media.Schema;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.Data;
|
|
|
@@ -28,7 +28,7 @@ import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
- * 消费流水
|
|
|
+ * 消费流水 / 消费订单
|
|
|
*
|
|
|
* @author TRX
|
|
|
* @date 2024/6/17
|
|
|
@@ -47,20 +47,21 @@ public class ExpenseFlow extends SuperMain {
|
|
|
|
|
|
private String token;
|
|
|
|
|
|
+ @Indexed
|
|
|
@Schema(description = "订单的总体状态")
|
|
|
- private OrderState orderType;
|
|
|
+ private OrderState orderState;
|
|
|
|
|
|
- @Schema(description = "订单类型")
|
|
|
+ @Schema(description = "订单创建类型, 是消费还是查询余额")
|
|
|
private OrderModeType orderModeType = OrderModeType.Consume;
|
|
|
|
|
|
- @Schema(description = "支付方式显示")
|
|
|
- @Indexed
|
|
|
- private String paymentWay;
|
|
|
+ @Schema(description = "消费类型,如:餐饮消费、水费、电费 等等")
|
|
|
+ private String payType;
|
|
|
|
|
|
@Indexed
|
|
|
@Schema(description = "支付方式")
|
|
|
private PaymentType paymentType;
|
|
|
|
|
|
+ //----------------------------消费关联的用户信息 start ----------------------
|
|
|
@Schema(description = "消费的用户userId")
|
|
|
private String userId;
|
|
|
|
|
|
@@ -71,6 +72,7 @@ public class ExpenseFlow extends SuperMain {
|
|
|
@DBRef(lazy = true)
|
|
|
private UserAccount userAccount;
|
|
|
|
|
|
+ //-----------------------修复关联的设备信息 start--------------------
|
|
|
@Schema(description = "消费机设备ID")
|
|
|
private String deviceId;
|
|
|
|
|
|
@@ -83,8 +85,13 @@ public class ExpenseFlow extends SuperMain {
|
|
|
@Schema(description = "订单所属的商户")
|
|
|
private String shopOid;
|
|
|
|
|
|
- @Schema(description = "订单所属的学校")
|
|
|
- private String schoolOid;
|
|
|
+ //------------------------------消费关联的卡片信息 ---------------------
|
|
|
+
|
|
|
+ @Schema(description = "支付设备和方式")
|
|
|
+ private PaymentDeviceType paymentDeviceType;
|
|
|
+
|
|
|
+ @Schema(description = "支付来源:刷卡 二维码 刷脸")
|
|
|
+ private OrderFromType orderFromType;
|
|
|
|
|
|
@Schema(description = "卡片的编号,也是终端刷卡的 卡号")
|
|
|
private String cardNo = "";
|
|
|
@@ -92,21 +99,18 @@ public class ExpenseFlow extends SuperMain {
|
|
|
@Schema(description = "卡片信息")
|
|
|
private CardInfo cardInfo;
|
|
|
|
|
|
- @Schema(description = "消费类型,如:餐饮消费")
|
|
|
- private String payType;
|
|
|
-
|
|
|
@Schema(description = "年份,如:2024")
|
|
|
private Integer year;
|
|
|
|
|
|
@Schema(description = "月份,如:6")
|
|
|
private Integer month;
|
|
|
|
|
|
- @Schema(description = "今年第几周,如:32")
|
|
|
- private Integer week;
|
|
|
-
|
|
|
@Schema(description = "当前月的第几天")
|
|
|
private Integer dayOfMonth;
|
|
|
|
|
|
+ @Schema(description = "今年第几周,如:32")
|
|
|
+ private Integer week;
|
|
|
+
|
|
|
@Schema(description = "当前年的第几天")
|
|
|
private Integer dayOfYear;
|
|
|
|
|
|
@@ -118,11 +122,12 @@ public class ExpenseFlow extends SuperMain {
|
|
|
|
|
|
public void setTimes() {
|
|
|
this.year = DateUtils.getCurrentYear();
|
|
|
- this.dayOfYear = DateUtils.getCurrentDayInYear();
|
|
|
this.month = DateUtils.getCurrentMonthInYear();
|
|
|
- this.week = DateUtils.getCurrentWeekInYear();
|
|
|
this.dayOfMonth = DateUtils.getCurrentDayInMonth();
|
|
|
this.hourOfDay = DateUtils.getCurrentHourOfDay();
|
|
|
+
|
|
|
+ this.dayOfYear = DateUtils.getCurrentDayInYear();
|
|
|
+ this.week = DateUtils.getCurrentWeekInYear();
|
|
|
this.paymentTime = DateUtils.paresTime(System.currentTimeMillis(), DateUtils.patternyyyySSS);
|
|
|
}
|
|
|
|
|
|
@@ -133,9 +138,6 @@ public class ExpenseFlow extends SuperMain {
|
|
|
@Schema(description = "支付订单号")
|
|
|
private String paymentNo;
|
|
|
|
|
|
- @Schema(description = "支付来源:刷卡 二维码")
|
|
|
- private OrderFromType orderFromType;
|
|
|
-
|
|
|
@Schema(description = "付款码内容")
|
|
|
private String qr;
|
|
|
|
|
|
@@ -150,12 +152,11 @@ public class ExpenseFlow extends SuperMain {
|
|
|
// 交易模式(0:刷卡扣费 1:现金充值2:余额查询 3:钱包转账 4:现金退款)
|
|
|
private Integer mode = 0;
|
|
|
|
|
|
+ //-----------------------订单创建-支付信息 start----------------------
|
|
|
+
|
|
|
@Schema(description = "订单是否创建成功")
|
|
|
private Boolean isCreateSuccess = Boolean.TRUE;
|
|
|
|
|
|
- @Schema(description = "支付设备和方式")
|
|
|
- private PaymentDeviceType paymentDeviceType;
|
|
|
-
|
|
|
@Schema(description = "验证参数是否符合要求,可以发起支付")
|
|
|
private Boolean verifyParamIsSuccess = Boolean.TRUE;
|
|
|
|
|
|
@@ -170,11 +171,9 @@ public class ExpenseFlow extends SuperMain {
|
|
|
public void setVerifyError(String error) {
|
|
|
verifyParamIsSuccess = Boolean.FALSE;
|
|
|
verifyParamMsg = error;
|
|
|
- orderType = OrderState.PARAM_ERROR;
|
|
|
+ orderState = OrderState.PARAM_ERROR;
|
|
|
}
|
|
|
|
|
|
- //------------------订单类型 start-------------------------
|
|
|
-
|
|
|
@Schema(description = "是否必须支付,当是离线的时候,是先在边缘计算,再后面付款,则这个订单用户必须支付")
|
|
|
private Boolean isMustPay = Boolean.FALSE;
|
|
|
|
|
|
@@ -263,7 +262,7 @@ public class ExpenseFlow extends SuperMain {
|
|
|
this.paymentStatus = "支付失败";
|
|
|
this.isPaySuccess = Boolean.FALSE;
|
|
|
this.payRemark = msg;
|
|
|
- this.orderType = OrderState.PAID_ERROR;
|
|
|
+ this.orderState = OrderState.PAID_ERROR;
|
|
|
this.isPaid = Boolean.TRUE;
|
|
|
}
|
|
|
}
|