feat:智能柜错误处理
This commit is contained in:
1 parent
796985f3c6
commit
2ecc2e78ce
8 files changed
+208
-55
No files matched your search
+2
-2
@@ -11,7 +11,7 @@ import java.util.Arrays;
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum HardDoorFlowEnum {
|
||||
public enum HardDoorFlowBizEnum {
|
||||
PAY_OPEN("10", "购买开门"),
|
||||
REPERTORY_OPEN("20", "上架开门"),
|
||||
ACCESS_OPEN("20", "检修开门"),
|
||||
@@ -19,7 +19,7 @@ public enum HardDoorFlowEnum {
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static HardDoorFlowEnum valueOfByType(String type) {
|
||||
public static HardDoorFlowBizEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.bsd.pjcloud.hard.api.constant.flow;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 智能柜流程
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum HardDoorFlowEnum {
|
||||
FLOW_AUTH("10", "用户授权", "20"),
|
||||
FLOW_APPLY_OPEN("20", "智能柜申请开门", "30"),
|
||||
FLOW_CALLBACK_OPEN("30", "智能柜开门响应", "40"),
|
||||
FLOW_CALLBACK_VIDEO("40", "智能柜视频回调", "50"),
|
||||
FLOW_SUBMIT_RECOGNITION("50", "旷世提交识别", "60"),
|
||||
FLOW_CALLBACK_RECOGNITION("60", "旷世识别响应", "70"),
|
||||
FLOW_PAY_ORDER("60", "订单结算", null),
|
||||
;
|
||||
private final String type;
|
||||
private final String description;
|
||||
private final String nextType;
|
||||
|
||||
public static HardDoorFlowEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
public static HardDoorFlowEnum getNextType(HardDoorFlowEnum type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
String nextType = Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get().getNextType();
|
||||
if (ObjectUtil.isEmpty(nextType)) return null;
|
||||
return valueOfByType(nextType);
|
||||
}
|
||||
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.bsd.pjcloud.hard.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.hard.api.constant.HardDoorFlowEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.HardDoorFlowBizEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.HardDoorOpenTypeEnum;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
@@ -28,7 +28,7 @@ public class HardDoorFlowOpenDto {
|
||||
/**
|
||||
* 流程类型
|
||||
*/
|
||||
private HardDoorFlowEnum flowType;
|
||||
private HardDoorFlowBizEnum flowType;
|
||||
|
||||
/**
|
||||
* 开门操作类型
|
||||
|
||||
+18
@@ -176,6 +176,24 @@ public class HardDoorFlowEntity extends Model<HardDoorFlowEntity> {
|
||||
@Schema(description = "sku识别主动获取时间")
|
||||
private LocalDateTime skuDrivingTime;
|
||||
|
||||
/**
|
||||
* 流程状态
|
||||
*/
|
||||
@Schema(description = "流程状态")
|
||||
private String flowStatus;
|
||||
|
||||
/**
|
||||
* 流程错误信息
|
||||
*/
|
||||
@Schema(description = "流程错误信息")
|
||||
private String error;
|
||||
|
||||
/**
|
||||
* 流程错误描述(展示)
|
||||
*/
|
||||
@Schema(description = "流程错误描述(展示)")
|
||||
private String errorDesc;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user