From e50954f0708ecbbc672352102ae3b24279d40cc1 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期四, 16 四月 2026 20:12:50 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/gtzxinglijicun
---
server/services/src/main/java/com/doumee/core/constants/Constants.java | 219 ++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 192 insertions(+), 27 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 0e3677d..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
@@ -18,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";
@@ -53,6 +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 ACCESS_KEY = "ACCESS_KEY";
+ public static final String ENDPOINT = "ENDPOINT";
public static final String QYWX = "QYWX";
public static final Integer ONE = 1;
@@ -66,6 +68,20 @@
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 ;
@@ -73,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";
@@ -247,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" ),
@@ -368,7 +376,7 @@
OTHER_MATERIAL(0, "闂ㄥ簵鍏朵粬鏉愭枡"),
STORE_INTERIOR(1, "闂ㄥ簵鍐呴儴鐓х墖"),
ORDER_DEPOSIT(2, "璁㈠崟瀵勫瓨鍥剧墖"),
- ORDER_TAKE(3, "璁㈠崟鍙栦欢鍥剧墖"),
+ ORDER_TAKE(3, "闂ㄥ簵鍏ュ簱鍥剧墖"),
DRIVER_TAKE(4, "鍙告満鍙栦欢鍥剧墖"),
DRIVER_DONE(5, "鍙告満瀹屾垚鍥剧墖"),
DRIVER_CAR(6, "鍙告満瀹炲悕璁よ瘉杞﹁締鐓х墖"),
@@ -377,15 +385,130 @@
STORE_FRONT(9, "闂ㄥ簵闂ㄥご鐓�"),
SOCIAL_SECURITY(10, "绀句繚缂寸撼璇佹槑"),
LABOR_CONTRACT(11, "鏈夋晥鍔冲姩鍚堝悓"),
+ ORDER_FILE(12,"涓嬪崟鍥剧墖"),
+ STORE_OUT(13,"闂ㄥ簵鍑哄簱鍥剧墖"),
+ REFUND_TAKE(14,"閫�娆惧彇浠跺浘鐗�")
+
;
private final int key;
private final String name;
}
+ @Getter
+ @AllArgsConstructor
+ public enum OrderLogType {
+ urgent(0, "骞冲彴鍔犳��", "骞冲彴鍔犳�ワ紝濂栧姳閲� {param} 鍏冦��"),
+ dispatch(1, "骞冲彴鎸囨淳", "骞冲彴鎸囨淳鍙告満 {param} 鎺ュ崟銆�")
+ ;
+ private int status;
+ private String title;
+ private String statusInfo;
+ }
- public static String getIpAddr() {
+ /**
+ * 璁㈠崟鏀粯绫诲瀷
+ */
+ @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 getDescByKey(int index) {
+ for (OrderStatus c : OrderStatus.values()) {
+ if (c.getKey() == index) {
+ return c.getValue();
+ }
+ }
+ return "";
+ }
+ }
+
+ /**
+ * 浼氬憳绔悎骞惰鍗曠姸鎬侊紙鐢ㄤ簬鍒嗛〉绛涢�夛級
+ */
+ @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 final int key;
+ private final String desc;
+ private final int[] statuses;
+
+ public static OrderCombinedStatus getByKey(int key) {
+ for (OrderCombinedStatus c : OrderCombinedStatus.values()) {
+ if (c.getKey() == key) {
+ return c;
+ }
+ }
+ return null;
+ }
+ }
+
+ /**
+ * 寰楀埌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");
@@ -424,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