Просмотр исходного кода

优化 分页基础类排序字段

dengsixing 3 лет назад
Родитель
Сommit
bdb238b60f

+ 5 - 0
4dkankan-common-utils/src/main/java/com/fdkankan/common/constant/ErrorCode.java

@@ -176,6 +176,11 @@ public enum ErrorCode {
     FAILURE_CODE_8005(8005, "文件转换失败!"),
 
 
+    FAILURE_CODE_9001(9001, "查询不到开票申请"),
+    FAILURE_CODE_9002(9002, "不需要发票"),
+    FAILURE_CODE_9003(9003, "快递单号不能为空"),
+    FAILURE_CODE_9004(9004, "查询不到开票信息"),
+
 
 
     ;

+ 40 - 0
4dkankan-common-utils/src/main/java/com/fdkankan/common/constant/InvoiceType.java

@@ -0,0 +1,40 @@
+package com.fdkankan.common.constant;
+
+/**
+ * 发票类型
+ */
+public enum InvoiceType {
+
+    NO_NEAD(1, "不需要发票"),
+    ORDINARY(2, "普通发票"),
+    SPECIAL(3, "专用发票");
+
+    private Integer code;
+    private String message;
+
+    private InvoiceType(Integer code, String message) {
+        this.code = code;
+        this.message = message;
+    }
+
+    public Integer code() {
+        return code;
+    }
+
+    public String message() {
+        return message;
+    }
+
+    public static InvoiceType get(Integer code){
+        InvoiceType[] values = InvoiceType.values();
+        Integer enumValue = null;
+        for(InvoiceType eachValue : values){
+            enumValue = eachValue.code();
+            if(enumValue.equals(code)){
+                return eachValue;
+            }
+        }
+        return null;
+    }
+
+}

+ 1 - 1
4dkankan-common-utils/src/main/java/com/fdkankan/common/request/RequestBase.java

@@ -13,7 +13,7 @@ public class RequestBase implements Serializable {
 
     private int start;
 
-    private String orderBy;
+    private String orderBy = "id";
 
     /**
      * DESC-降序

+ 3 - 0
4dkankan-utils-db/src/main/java/com/fdkankan/db/base/BaseEntity.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import java.io.Serializable;
 import java.util.Date;
+import lombok.Data;
 
 /**
  * <p>
@@ -13,6 +14,7 @@ import java.util.Date;
  * @author dengsixing
  * @since 2022/2/15
  **/
+@Data
 public class BaseEntity implements Serializable {
 
     private static final long serialVersionUID = 1L;
@@ -45,6 +47,7 @@ public class BaseEntity implements Serializable {
      * 0-有效,1-删除, 2-禁用
      */
     @TableField("tb_status")
+    @TableLogic
     private Integer tbStatus;
 
 }