From 82735e4d46ac7b9969facef2acc8f8e793b68f71 Mon Sep 17 00:00:00 2001 From: doum <doum> Date: 星期一, 15 九月 2025 16:11:42 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- server/services/src/main/java/com/doumee/core/constants/Constants.java | 200 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 189 insertions(+), 11 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 7e8743b..49726e0 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,5 +1,6 @@ package com.doumee.core.constants; +import com.doumee.dao.business.model.Orders; import lombok.AllArgsConstructor; import lombok.Getter; @@ -56,6 +57,7 @@ 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 QYWX = "QYWX"; public static final Integer ONE = 1; @@ -76,6 +78,12 @@ public static final String WORKORDER_LOG_FILE_PATH ="WORKORDER_LOG_FILE_PATH" ; public static final String REDIS_TOKEN_KEY = "token_"; + + public static final String SUCCESS = "SUCCESS"; + public static final String FAIL = "FAIL"; + public static final String CANCELLED = "CANCELLED"; + + public interface uploadType{ String blob = "blob"; String ftp = "ftp"; @@ -136,6 +144,12 @@ d = 0L; } return d.longValue(); + } + public static BigDecimal formatBigDecimal(BigDecimal d) { + if (d == null) { + new BigDecimal(0); + } + return d; } /** @@ -359,9 +373,9 @@ @Getter public enum RevenueType { - YGD_INCOME( 0, "鐢ㄥ伐鍗曟敹鍏�","鐢ㄥ伐鍗曟敹鍏�" ,0), - HYD_INCOME( 1, "璐ц繍鍗曟敹鍏�","璐ц繍鍗曟敹鍏�" ,0), - GCD_INCOME(2, "渚涢鍗曟敹鍏�","渚涢鍗曟敹鍏�" ,0), + YGD_INCOME( 0, "鐢ㄥ伐鍗曟敹鍏�","鐢ㄥ伐鍗�" ,0), + HYD_INCOME( 1, "璐ц繍鍗曟敹鍏�","璐ц繍鍗�" ,0), + GCD_INCOME(2, "渚涢鍗曟敹鍏�","渚涢鍗�" ,0), WITHDRAW_APPLY(3, "鎻愮幇鐢宠","鎻愮幇鐢宠" ,0), REFUND( 4, "鎻愮幇鐢宠閫�鍥�","鎻愮幇鐢宠閫�鍥�" ,0) ; @@ -381,6 +395,22 @@ for (RevenueType c : RevenueType.values()) { if (c.getKey() == index) { return c; + } + } + return null; + } + public static String getName(int index) { + for (RevenueType c : RevenueType.values()) { + if (c.getKey() == index) { + return c.getName(); + } + } + return null; + } + public static String getInfo(int index) { + for (RevenueType c : RevenueType.values()) { + if (c.getKey() == index) { + return c.getInfo(); } } return null; @@ -416,6 +446,8 @@ RELEASE_CANCEL(12, "鍙戝崟鏂�-璁㈠崟鍙栨秷","{userName}宸叉墜鍔ㄥ彇娑堣鍗�",0), AUTO_COMMENT(13, "绯荤粺-鑷姩璇勪环","瓒呭嚭7鏃ユ湭璇勪环锛岀郴缁熷凡鑷姩璇勪环",2), AUTO_AGREE(14, "绯荤粺-鑷姩鍚屾剰","鎺ュ崟鏂硅秴鏃舵湭澶勭悊锛屽凡鑷姩鍚屾剰",2), + + FEE_CONFIRM(15, "鎺ュ崟鏂�-纭璐圭敤","{userName}宸茬‘璁よ垂鐢�",1), ; // 鎴愬憳鍙橀噺 @@ -531,26 +563,91 @@ public enum ordersStatus { - waitPay(0, "寰呮敮浠�"), - wait(1, "寰呮帴鍗�"), - accept(2, "宸叉帴鍗�"), - doing(3, "杩涜涓�"), - done(4, "宸插畬鎴�"), - cancel(99, "宸插彇娑�"), + 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; // 鏋勯�犳柟娉� - ordersStatus(int key, String name) { + orderType(int key, String name) { this.name = name; this.key = key; } // 鏅�氭柟娉� public static String getName(int index) { - for (ordersStatus c : ordersStatus.values()) { + for (orderType c : orderType.values()) { if (c.getKey() == index) { return c.name; } @@ -576,4 +673,85 @@ } + + + 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) { + 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; + + } + + + } -- Gitblit v1.9.3