From 7eebfc8a64d2cbbd73453a2b653d5a5bfd66a32f Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期四, 16 四月 2026 20:10:44 +0800
Subject: [PATCH] 代码生成

---
 server/services/src/main/java/com/doumee/core/constants/Constants.java |  585 ++++++++++++++++++---------------------------------------
 1 files changed, 188 insertions(+), 397 deletions(-)

diff --git a/server/services/src/main/java/com/doumee/core/constants/Constants.java b/server/services/src/main/java/com/doumee/core/constants/Constants.java
index f415282..0409d47 100644
--- a/server/services/src/main/java/com/doumee/core/constants/Constants.java
+++ b/server/services/src/main/java/com/doumee/core/constants/Constants.java
@@ -1,6 +1,5 @@
 package com.doumee.core.constants;
 
-import com.doumee.dao.business.model.Orders;
 import lombok.AllArgsConstructor;
 import lombok.Getter;
 import org.springframework.web.context.request.RequestContextHolder;
@@ -19,11 +18,8 @@
  */
 public class Constants {
 
-    public static final String HWY_OBS ="HWY_OBS" ;
-    public static final String HWY_OBS_ACCESSID ="HWY_OBS_ACCESSID" ;
-    public static final String HWY_OBS_ACCESSKEY ="HWY_OBS_ACCESSKEY" ;
-    public static final String HWY_OBS_ENDPOINT ="HWY_OBS_ENDPOINT" ;
-    public static final String HWY_OBS_BUCKET ="HWY_OBS_BUCKET" ;
+    public static final String OSS ="OSS" ;
+
     public static final String RESOURCE_PATH ="RESOURCE_PATH" ;
     public static final String QYWX_CORPID = "QYWX_CORPID";
     public static final String QYWX_SECRET = "QYWX_SECRET";
@@ -54,15 +50,11 @@
     public static final String USER_AGREEMENT ="USER_AGREEMENT" ;
     public static final String PRIVACY_AGREEMENT ="PRIVACY_AGREEMENT" ;
 
+    public static final String ACCESS_ID="ACCESS_ID";
+    public static final String BUCKETNAME = "BUCKETNAME";
 
-    public static final String RELEASE_CANCEL_TIMES ="RELEASE_CANCEL_TIMES" ;
-    public static final String RECEIVE_CANCEL_TIMES ="RECEIVE_CANCEL_TIMES" ;
-    public static final String RELEASE_CANCEL_TIME ="RELEASE_CANCEL_TIME" ;
-    public static final String RECEIVE_CANCEL_TIME ="RECEIVE_CANCEL_TIME" ;
-    public static final String AUTO_DISPATCH ="AUTO_DISPATCH" ;
-    public static final String AUTO_DISPATCH_DISTANCE ="AUTO_DISPATCH_DISTANCE" ;
-    public static final String AUTO_CONFIRM ="AUTO_CONFIRM" ;
-    public static final String AUTO_CANCEL_WAIT_PAY ="AUTO_CANCEL_WAIT_PAY" ;
+    public static final String ACCESS_KEY = "ACCESS_KEY";
+    public static final String ENDPOINT = "ENDPOINT";
 
     public static final String QYWX = "QYWX";
     public static final  Integer ONE = 1;
@@ -75,7 +67,21 @@
     public static final String INENTITY_FILES = "INENTITY_FILES";
     public static final String MEMBER_FILES = "MEMBER_FILES";
     public static final String CATEGORY_FILES = "CATEGORY_FILES";
+    public static final String SHOP_FILES = "SHOP_FILES";
+    public static final String DRIVER_FILES = "DRIVER_FILES";
+    public static final String BANNER_FILES = "BANNER_FILES";
     public static final String ORDERS_FILES = "ORDERS_FILES";
+
+    // 杩愯惀閰嶇疆
+    public static final String OPERATION_CONFIG = "OPERATION_CONFIG";
+    public static final String OP_DRIVER_DAILY_CANCEL_LIMIT = "DRIVER_DAILY_CANCEL_LIMIT";
+    public static final String OP_UNPICKED_DISCOUNT = "UNPICKED_DISCOUNT";
+    public static final String OP_SETTLEMENT_DATE = "SETTLEMENT_DATE";
+    public static final String OP_URGENT_COEFFICIENT = "URGENT_COEFFICIENT";
+    public static final String OP_AUTO_CANCEL_TIME = "AUTO_CANCEL_TIME";
+    public static final String OP_INSURANCE_RATE = "INSURANCE_RATE";
+    public static final String OP_ORDER_ACCEPT_LIMIT = "ORDER_ACCEPT_LIMIT";
+    public static final String OP_AUTO_CONFIRM_RECEIPT = "AUTO_CONFIRM_RECEIPT";
     public static boolean WORKORDER_SHE_EMAIL_SENDING = false;
     public static  boolean DEALING_COMPANY_SYNC = false ;
     public static  boolean DEALING_MEMBER_SYNC = false ;
@@ -83,6 +89,18 @@
     public static final String WORKORDER_LOG_FILE_PATH ="WORKORDER_LOG_FILE_PATH" ;
 
     public static final String REDIS_TOKEN_KEY = "token_";
+    public static final String REDIS_VERIFY_CODE_KEY = "verify_code_";
+
+
+
+    public final static String GOODS_ORDER_CREATE_LOCK = "goods:order:create:lock:";
+
+    // 璁㈠崟鏃ュ織鎿嶄綔绫诲瀷
+    public static final int ORDER_LOG_DISPATCH = 1;         // 娲惧崟
+    public static final int ORDER_LOG_URGENT_FEE = 2;       // 鍔犳�ヨ垂
+    public static final int ORDER_LOG_ASSIGN_DRIVER = 3;    // 鎸囨淳鍙告満
+    public static final int ORDER_LOG_CANCEL = 4;           // 鍙栨秷璁㈠崟
+    public static final int ORDER_LOG_CONFIRM_ARRIVE = 5;   // 纭椤惧鍒板簵
 
     public static final String SUCCESS = "SUCCESS";
     public static final String FAIL = "FAIL";
@@ -98,9 +116,6 @@
      * 缂撳瓨Key
      */
     interface CacheKey {
-    }
-    public interface RedisKeys {
-        public static final String ORDER_CODE = "ORDER_CODE";
     }
     /**
      * 鎿嶄綔绫诲瀷锛岀敤浜庡仛鎺ュ彛楠岃瘉鍒嗙粍
@@ -260,26 +275,6 @@
     }
 
 
-    /**
-     * 鏂囦欢闄勪欢绫诲瀷
-     */
-    public interface multiFileType{
-        //0闂涓婃姤 1璺岀粖婊戜笂鎶� 2璺岀粖婊戝鐞� 3鍒嗛厤鐗╀笟涓荤 4鍒嗛厤澶勭悊浜� 5DCA椋庨櫓涓婃姤 6DCA椋庨櫓澶勭悊 7DCA闂宸ュ崟鍥剧墖
-//        int sheUpload = 0;
-//        int dbhUpload = 1;
-//        int dbhDeal = 2;
-//        int dbhAllocation = 3;
-//        int dbhDealUser = 4;
-//        int dcaUpload = 5;
-//        int dcaDeal = 6;
-//        int dcaWorkOrder= 7;
-
-        //0宸ュ崟涓婃姤 1宸ュ崟澶勭悊 2宸ュ崟杞氦
-        int  upload = 0;
-        int deal = 1;
-        int passOn = 2;
-    }
-
 
     public enum WorkOrderStatus{
         waitConfirm( 0, "寰呭垎閰峎TS","{title}涓婃姤","","寰呭垎閰峎TS" ),
@@ -371,395 +366,149 @@
         }
     }
 
+
     /**
-     * 鐢ㄦ埛鏀舵敮涓氬姟绫诲瀷
-     * 鍙樺姩绫诲瀷:0=鐢ㄥ伐鍗曟敹鍏ワ紱1=璐ц繍鍗曟敹鍏ワ紱2=渚涢鍗曟敹鍏ワ紱3=鎻愮幇鐢宠锛�
+     * 闄勪欢绫诲瀷锛堝搴� multifile.objType锛�
      */
     @Getter
-    public enum RevenueType {
+    @AllArgsConstructor
+    public enum FileType {
+        OTHER_MATERIAL(0, "闂ㄥ簵鍏朵粬鏉愭枡"),
+        STORE_INTERIOR(1, "闂ㄥ簵鍐呴儴鐓х墖"),
+        ORDER_DEPOSIT(2, "璁㈠崟瀵勫瓨鍥剧墖"),
+        ORDER_TAKE(3, "闂ㄥ簵鍏ュ簱鍥剧墖"),
+        DRIVER_TAKE(4, "鍙告満鍙栦欢鍥剧墖"),
+        DRIVER_DONE(5, "鍙告満瀹屾垚鍥剧墖"),
+        DRIVER_CAR(6, "鍙告満瀹炲悕璁よ瘉杞﹁締鐓х墖"),
+        DRIVER_LICENSE(7, "鍙告満瀹炲悕璁よ瘉椹鹃┒璇佺収鐗�"),
+        DRIVER_OTHER(8, "鍙告満瀹炲悕璁よ瘉鍏朵粬鍥剧墖"),
+        STORE_FRONT(9, "闂ㄥ簵闂ㄥご鐓�"),
+        SOCIAL_SECURITY(10, "绀句繚缂寸撼璇佹槑"),
+        LABOR_CONTRACT(11, "鏈夋晥鍔冲姩鍚堝悓"),
+        ORDER_FILE(12,"涓嬪崟鍥剧墖"),
+        STORE_OUT(13,"闂ㄥ簵鍑哄簱鍥剧墖"),
+        REFUND_TAKE(14,"閫�娆惧彇浠跺浘鐗�")
 
-        YGD_INCOME(  0, "鐢ㄥ伐鍗曟敹鍏�","鐢ㄥ伐鍗�" ,0),
-        HYD_INCOME(  1, "璐ц繍鍗曟敹鍏�","璐ц繍鍗�" ,0),
-        GCD_INCOME(2, "渚涢鍗曟敹鍏�","渚涢鍗�" ,0),
-        WITHDRAW_APPLY(3, "鎻愮幇鐢宠","鎻愮幇鐢宠" ,0),
-        REFUND(  4, "鎻愮幇鐢宠閫�鍥�","鎻愮幇鐢宠閫�鍥�" ,0)
         ;
 
-        private int key;
-        private String name;
-        private  String info;
-        private int navIndex;
+        private final int key;
+        private final String name;
+    }
 
-        RevenueType(int key, String name, String info,int navIndex) {
-            this.info = info;
-            this.key = key;
-            this.name = name;
-            this.navIndex = navIndex;
-        }
-        public static RevenueType getObj(int index) {
-            for (RevenueType c : RevenueType.values()) {
+    @Getter
+    @AllArgsConstructor
+    public enum OrderLogType {
+        urgent(0, "骞冲彴鍔犳��", "骞冲彴鍔犳�ワ紝濂栧姳閲� {param} 鍏冦��"),
+        dispatch(1, "骞冲彴鎸囨淳", "骞冲彴鎸囨淳鍙告満 {param} 鎺ュ崟銆�")
+        ;
+        private int status;
+        private String title;
+        private String statusInfo;
+    }
+
+    /**
+     * 璁㈠崟鏀粯绫诲瀷
+     */
+    @Getter
+    @AllArgsConstructor
+    public enum OrdersAttach {
+        STORAGE_ORDER("storageOrder", "瀵勫瓨璁㈠崟"),
+        SHOP_DEPOSIT("shopDeposit", "搴楅摵鎶奸噾璁㈠崟"),
+        DRIVER_DEPOSIT("driverDeposit", "鍙告満鎶奸噾璁㈠崟"),
+        OVERDUE_FEE("overdueFee", "璁㈠崟閫炬湡璐圭敤")
+        ;
+
+        private final String key;
+        private final String name;
+    }
+
+
+    /**
+     * 璁㈠崟鐘舵�侊紙灏卞湴/寮傚湴缁熶竴锛�
+     * 灏卞湴瀵勫瓨: 0鈫�1鈫�2鈫�3鈫�(6)鈫�7 / 96~99
+     * 寮傚湴瀵勫瓨: 0鈫�1鈫�2鈫�3鈫�4鈫�5鈫�(6)鈫�7 / 96~99
+     */
+    @Getter
+    @AllArgsConstructor
+    public enum OrderStatus {
+        waitPay(0, "寰呮敮浠�"),
+        waitDeposit(1, "寰呭瘎瀛�"),
+        deposited(2, "宸插瘎瀛�"),
+        accepted(3, "宸叉帴鍗�"),
+        delivering(4, "娲鹃�佷腑"),
+        arrived(5, "宸插埌搴�/宸查�佽揪/寰呭彇浠�"),
+        overdue(6, "瀛樺湪閫炬湡"), //寮冪敤
+        finished(7, "宸插畬鎴�"),
+        closed(96, "璁㈠崟鍏抽棴锛堥��娆撅級"),
+        cancelOverdue(97, "鍙栨秷閫炬湡"), //寮冪敤
+        cancelling(98, "鍙栨秷涓�"),
+        cancelled(99, "宸插彇娑�")
+        ;
+        private final int status;
+        private final String desc;
+
+        public int getKey() { return status; }
+        public String getValue() { return desc; }
+
+        public static OrderStatus getByKey(int index) {
+            for (OrderStatus c : OrderStatus.values()) {
                 if (c.getKey() == index) {
                     return c;
                 }
             }
             return null;
         }
-        public static String getName(int index) {
-            for (RevenueType c : RevenueType.values()) {
+
+        public static String getDescByKey(int index) {
+            for (OrderStatus c : OrderStatus.values()) {
                 if (c.getKey() == index) {
-                    return c.getName();
+                    return c.getValue();
                 }
             }
-            return null;
-        }
-        public static String getInfo(int index) {
-            for (RevenueType c : RevenueType.values()) {
-                if (c.getKey() == index) {
-                    return c.getInfo();
-                }
-            }
-            return null;
-        }
-        public static String getObjName(int index) {
-            for (RevenueType c : RevenueType.values()) {
-                if (c.getKey() == index) {
-                    return c.getName();
-                }
-            }
-            return null;
-        }
-
-
-    }
-
-
-
-
-    public  enum OrdersLog {
-        UPLOAD(0, "鍙戝崟鏂�-鍙戝竷璁㈠崟","{userName}鍙戝竷{param}",0),
-        RECEIVE(1, "鎺ュ崟鏂�-宸叉姠鍗�","{userName}宸叉姠鍗�",1),
-        UPD_ORDER(2, "鍙戝崟鏂�-淇敼璁㈠崟","{userName}淇敼浜嗙敤宸ユ椂闂�",0),
-        UPD_DISAGREE(3, "鎺ュ崟鏂�-涓嶅悓鎰忎慨鏀�,璁㈠崟鍙栨秷","{userName}涓嶅悓鎰忎慨鏀癸紝璁㈠崟鍙栨秷",1),
-        UPD_AGREE(4, "鎺ュ崟鏂�-鍚屾剰淇敼","{userName}鍚屾剰淇敼",1),
-        AUTO(5, "绯荤粺-鑷姩娲惧崟","鏃犱汉鎺ュ崟宸茶嚜鍔ㄦ淳鍗曠粰{userName}",1),
-        CANCEL(6, "鎺ュ崟鏂�-鍙栨秷鎺ュ崟","{userName}宸叉墜鍔ㄥ彇娑堟帴鍗�",1),
-        BEGIN(7, "鍙戝崟鏂�-寮�濮嬩綔涓�","{userName}宸插紑濮嬩綔涓�",0),
-        DONE(8, "鍙戝崟鏂�-瀹屾垚浣滀笟","{userName}宸茬‘璁ゅ畬鎴愪綔涓�",0),
-        PAY(9, "鍙戝崟鏂�-瀹屾垚鏀粯","{userName}宸叉敮浠樿垂鐢�",0),
-        COMMENT(10, "鍙戝崟鏂�-璇勪环瀹屾垚","{userName}瀹屾垚璇勪环",0),
-        SYSTEM_CANCEL(11, "绯荤粺-璁㈠崟鍙栨秷","绯荤粺鍙栨秷",2),
-        RELEASE_CANCEL(12, "鍙戝崟鏂�-璁㈠崟鍙栨秷","{userName}宸叉墜鍔ㄥ彇娑堣鍗�",0),
-        AUTO_COMMENT(13, "绯荤粺-鑷姩璇勪环","瓒呭嚭7鏃ユ湭璇勪环锛岀郴缁熷凡鑷姩璇勪环",2),
-        AUTO_AGREE(14, "绯荤粺-鑷姩鍚屾剰","鎺ュ崟鏂硅秴鏃舵湭澶勭悊锛屽凡鑷姩鍚屾剰",2),
-
-        FEE_CONFIRM(15, "鎺ュ崟鏂�-纭璐圭敤","{userName}宸茬‘璁よ垂鐢�",1),
-
-        ;
-        // 鎴愬憳鍙橀噺
-        private String name;
-        private String info;
-        private int key;
-        private int userType;
-
-        // 鏋勯�犳柟娉�
-        OrdersLog(int key, String name,String info,int userType) {
-            this.name = name;
-            this.info = info;
-            this.key = key;
-            this.userType = userType;
-        }
-
-        // 鏅�氭柟娉�
-        public static String getName(int index) {
-            for (OrdersLog c : OrdersLog.values()) {
-                if (c.getKey() == index) {
-                    return c.name;
-                }
-            }
-            return null;
-        }
-        public static String getInfo(int index) {
-            for (OrdersLog c : OrdersLog.values()) {
-                if (c.getKey() == index) {
-                    return c.info;
-                }
-            }
-            return null;
-        }
-
-        // get set 鏂规硶
-        public String getName() {
-            return name;
-        }
-
-        public void setName(String name) {
-            this.name = name;
-        }
-
-        public int getKey() {
-            return key;
-        }
-
-        public void setKey(int key) {
-            this.key = key;
-        }
-
-        public int getUserType() {
-            return userType;
-        }
-
-        public void setUserType(int key) {
-            this.userType = userType;
-        }
-
-        public String getInfo() {
-            return info;
-        }
-
-        public void setInfo(String info) {
-            this.info = info;
+            return "";
         }
     }
 
-
-    public  enum workType {
-        czg(0, "閲囨憳宸�"),
-        fjg(1, "鍒嗘嫞宸�"),
-        bzg(2, "鍖呰宸�"),
-
+    /**
+     * 浼氬憳绔悎骞惰鍗曠姸鎬侊紙鐢ㄤ簬鍒嗛〉绛涢�夛級
+     */
+    @Getter
+    @AllArgsConstructor
+    public enum OrderCombinedStatus {
+        waitPay(0, "寰呮敮浠�", new int[]{OrderStatus.waitPay.status}),
+        waitDeposit(1, "寰呮牳楠�", new int[]{OrderStatus.waitDeposit.status}),
+        waitDeliver(2, "寰呴厤閫�", new int[]{OrderStatus.accepted.status}),
+        waitReceive(3, "寰呮敹璐�", new int[]{ OrderStatus.delivering.status, OrderStatus.arrived.status}),
+        finished(4, "宸插畬鎴�", new int[]{OrderStatus.finished.status}),
+        refund(5, "閫�娆�", new int[]{OrderStatus.closed.status, OrderStatus.cancelling.status})
         ;
-        // 鎴愬憳鍙橀噺
-        private int key;
-        private String name;
+        private final int key;
+        private final String desc;
+        private final int[] statuses;
 
-        // 鏋勯�犳柟娉�
-        workType(int key, String name) {
-            this.name = name;
-            this.key = key;
-        }
-
-        // 鏅�氭柟娉�
-        public static String getName(int index) {
-            for (workType c : workType.values()) {
-                if (c.getKey() == index) {
-                    return c.name;
-                }
-            }
-            return null;
-        }
-        // get set 鏂规硶
-        public String getName() {
-            return name;
-        }
-
-        public void setName(String name) {
-            this.name = name;
-        }
-
-        public int getKey() {
-            return key;
-        }
-
-        public void setKey(int key) {
-            this.key = key;
-        }
-
-    }
-
-
-    public  enum ordersStatus {
-        waitPay(0, "寰呮敮浠�","寰呮敮浠�"),
-        wait(1, "寰呮帴鍗�","寰呮帴鍗�"),
-        accept(2, "宸叉帴鍗�","宸叉帴鍗�"),
-        doing(3, "杩涜涓�","杩涜涓�"),
-        done(4, "宸插畬鎴�","宸插畬鎴�"),
-        feeconfirm(5, "寰呮敮浠�","寰呭彂鍗曟柟鏀粯"),//閲戦宸茬‘璁�
-        cancel(99, "宸插彇娑�","宸插彇娑�"),
-        ;
-        // 鎴愬憳鍙橀噺
-        private int key;
-        private String name; //鎺ュ崟鏂规枃妗�
-        private String info; //鍙戝崟鏂规枃妗�
-        // 鏋勯�犳柟娉�
-        ordersStatus(int key, String name,String info) {
-            this.name = name;
-            this.key = key;
-            this.info = info;
-        }
-
-        // 鏅�氭柟娉�
-        public static String getName(int index) {
-            for (ordersStatus c : ordersStatus.values()) {
-                if (c.getKey() == index) {
-                    return c.name;
-                }
-            }
-            return null;
-        }
-
-        public static String getInfo(int index) {
-            for (ordersStatus c : ordersStatus.values()) {
-                if (c.getKey() == index) {
-                    return c.info;
-                }
-            }
-            return null;
-        }
-        // get set 鏂规硶
-        public String getName() {
-            return name;
-        }
-
-        public void setName(String name) {
-            this.name = name;
-        }
-
-        public int getKey() {
-            return key;
-        }
-
-        public void setKey(int key) {
-            this.key = key;
-        }
-
-        public String getInfo() {
-            return info;
-        }
-
-        public void setInfo(String info) {
-            this.info = info;
-        }
-
-    }
-
-
-
-    public  enum orderType {
-        ygd(0, "鐢ㄥ伐鍗�"),
-        hyd(1, "璐ц繍鍗�"),
-        scd(2, "閫侀鍗�"),
-
-        ;
-        // 鎴愬憳鍙橀噺
-        private int key;
-        private String name;
-
-        // 鏋勯�犳柟娉�
-        orderType(int key, String name) {
-            this.name = name;
-            this.key = key;
-        }
-
-        // 鏅�氭柟娉�
-        public static String getName(int index) {
-            for (orderType c : orderType.values()) {
-                if (c.getKey() == index) {
-                    return c.name;
-                }
-            }
-            return null;
-        }
-        // get set 鏂规硶
-        public String getName() {
-            return name;
-        }
-
-        public void setName(String name) {
-            this.name = name;
-        }
-
-        public int getKey() {
-            return key;
-        }
-
-        public void setKey(int key) {
-            this.key = key;
-        }
-
-    }
-
-
-
-    public  enum smsContent {
-        accept(0, "SMS_491325122","鎮ㄧ殑{order}璁㈠崟宸茶鎺ュ崟锛佹椂闂达細{time1}-{time2}锛屽彲杩涘叆灏忕▼搴忚仈绯绘帴鍗曟柟銆�"),
-        receiveCancel(1, "SMS_491055243","鎮ㄧ殑{order}璁㈠崟锛屾椂闂达細{time1}-{time2}锛屽凡琚帴鍗曟柟鍙栨秷锛岃鍗曞凡閲嶆柊杩涘叆鎺ュ崟澶у巺銆�"),
-        platformCancel(2, "SMS_491375152","鎮ㄧ殑{order}璁㈠崟锛屾椂闂达細{time1}-{time2},宸茬敱骞冲彴鍙栨秷銆傚鏈夌枒闂鑱旂郴瀹㈡湇銆�"),
-        agreeUpd(3, "SMS_491190259","鎺ュ崟鏂瑰凡鍚屾剰鎮ㄥ皢{order}鐨勮鍗曟椂闂翠慨鏀逛负{time1}鑷硔time2}銆�"),
-        disAgreeUpd(4, "SMS_491085252","鎺ュ崟鏂瑰凡鎷掔粷鎮ㄥ皢{order}鐨勮鍗曟椂闂翠慨鏀逛负{time1}-{time2}銆傜郴缁熷凡閲嶆柊灏嗚鍗曟斁鍏ユ帴鍗曞ぇ鍘呫��"),
-        orderUpd(5, "SMS_491010267","璇锋敞鎰忥紒鎮ㄦ壙鎺ョ殑{order}璁㈠崟锛屽鎴峰皢璁㈠崟鏃堕棿淇敼涓簕time1}-{time2}銆傝鍓嶅線纭鏄惁鎺ュ彈锛岃秴鏃朵笉澶勭悊灏嗚涓哄悓鎰忋��"),
-        releaseCancel(6, "SMS_491150253","鎮ㄦ壙鎺ョ殑{order}璁㈠崟锛屾椂闂达細{time1}-{time2}锛屽凡琚彂鍗曟柟鍙栨秷銆傛偍鍙墠寰�鎺ュ崟澶у巺閲嶆柊鎺ュ崟銆�"),
-        platformCancel2(7, "SMS_491420143","鎮ㄦ壙鎺ョ殑{order}璁㈠崟锛屾椂闂达細{time1}-{time2}锛屽凡鐢卞钩鍙板彇娑堛�傚鏈夌枒闂鑱旂郴瀹㈡湇銆�"),
-        dispatch(8, "SMS_491180276","宸蹭负鎮ㄦ櫤鑳藉尮閰嶈鍗曘�傝鍗曠被鍨嬶細{order}锛屾椂闂达細{time1}-{time2}锛岃窛绂伙細{distance}锛岄璁¤垂鐢▄money}銆傝鍓嶅線纭銆�"),
-        pay(9, "SMS_491180278","鎮ㄦ壙鎺ョ殑{order}璁㈠崟娆鹃」宸插埌璐︼紒鍒拌处閲戦锛歿money}銆傚彲鍦ㄥ皬绋嬪簭璐︽埛浣欓杩涜鏌ョ湅銆�"),
-        authentication(10, "SMS_491055290","鎮ㄧ敵璇风殑{authentication}鐨剓order}璁よ瘉{status}銆傝鍦ㄥ皬绋嬪簭鏌ョ湅璇︽儏銆�"),
-        ;
-        // 鎴愬憳鍙橀噺
-        private int key;
-        private String code;
-        private String name;
-
-        // 鏋勯�犳柟娉�
-        smsContent(int key,String code, String name) {
-            this.name = name;
-            this.code = code;
-            this.key = key;
-        }
-
-        // 鏅�氭柟娉�
-        public static Constants.smsContent getSmsContent(int index) {
-            for (smsContent c : smsContent.values()) {
-                if (c.getKey() == index) {
+        public static OrderCombinedStatus getByKey(int key) {
+            for (OrderCombinedStatus c : OrderCombinedStatus.values()) {
+                if (c.getKey() == key) {
                     return c;
                 }
             }
             return null;
         }
-        // get set 鏂规硶
-        public String getName() {
-            return name;
-        }
-
-        public void setName(String name) {
-            this.name = name;
-        }
-
-        public String getCode() {
-            return code;
-        }
-
-        public void setCode(String code) {
-            this.code = code;
-        }
-
-        public int getKey() {
-            return key;
-        }
-
-        public void setKey(int key) {
-            this.key = key;
-        }
-
     }
 
-
-    public static  String getOrderInfo(Orders orders){
-        String orderTypeInfo = "鐢ㄥ伐鍗�";
-        if(!Constants.equalsInteger(orders.getType(),Constants.ZERO)){
-            orderTypeInfo =   Constants.equalsInteger(orders.getType(),Constants.ONE)?"鐢ㄨ溅鍗�":"閫侀鍗�";
-        }else{
-            if(Constants.equalsInteger(orders.getWorkType(),Constants.ZERO)){
-                orderTypeInfo = orderTypeInfo + "-閲囨憳宸�";
-            }else{
-                orderTypeInfo = orderTypeInfo + (Constants.equalsInteger(orders.getWorkType(),Constants.ONE)?"-鍒嗘嫞宸�":"-鍖呰宸�");
-            }
-        }
-        return orderTypeInfo;
-
-    }
-
-
-    public  static String getIpAddr() {
+    /**
+     * 寰楀埌request瀵硅薄
+     *
+     * @return
+     */
+    public static HttpServletRequest getRequest() {
         HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
+        return request;
+    }
+
+
+    public static String getIpAddr() {
+        HttpServletRequest request = Constants.getRequest();
         String ipAddress = null;
         try {
             ipAddress = request.getHeader("x-forwarded-for");
@@ -798,4 +547,46 @@
     }
 
 
+    /**
+     * 鏍规嵁韬唤璇佸彿鐮佽幏鍙栨�у埆
+     * @param idCard 韬唤璇佸彿鐮侊紙15浣嶆垨18浣嶏級
+     * @return 1-鐢凤紝2-濂筹紝null-鏃犳硶鍒ゆ柇
+     */
+    public static Integer getGenderByIdCard(String idCard) {
+        if (idCard == null || (idCard.length() != 15 && idCard.length() != 18)) {
+            return null;
+        }
+        // 15浣嶈韩浠借瘉锛氭渶鍚庝竴浣嶄负鎬у埆鐮侊紱18浣嶈韩浠借瘉锛氱17浣嶏紙绱㈠紩16锛変负鎬у埆鐮�
+        int genderIndex = idCard.length() == 15 ? 14 : 16;
+        int genderCode = Character.getNumericValue(idCard.charAt(genderIndex));
+        return genderCode % 2 == 1 ? 1 : 2;
+    }
+
+    public static BigDecimal formatBigdecimal4Float(BigDecimal d) {
+        if (d == null) {
+            d = new BigDecimal(0.0);
+        }
+        //淇濈暀涓や綅灏忔暟涓斿洓鑸嶄簲鍏�
+        d = d.setScale(4, BigDecimal.ROUND_HALF_UP);
+        return  d;
+    }
+
+    /**
+     * 鍙告満瀹氱骇锛�5=S 4=A 3=B 2=C 1=D
+     *
+     * @param level 绛夌骇 1-5
+     * @return 绛夌骇鏂囨湰
+     */
+    public static String getDriverLevelName(Integer level) {
+        if (level == null) return null;
+        switch (level) {
+            case 5: return "S";
+            case 4: return "A";
+            case 3: return "B";
+            case 2: return "C";
+            case 1: return "D";
+            default: return null;
+        }
+    }
+
 }

--
Gitblit v1.9.3