From b22f741e6918c675fabe5aabc688d2f52858319a Mon Sep 17 00:00:00 2001
From: jiaosong <jiaosong6760@dingtalk.com>
Date: 星期一, 09 十月 2023 09:46:43 +0800
Subject: [PATCH] #pgsql 退款 结算
---
server/services/src/main/java/com/doumee/core/constants/Constants.java | 501 +++++++++++++++++++++++++++++++++++--------------------
1 files changed, 320 insertions(+), 181 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 11b1dc1..c0f4808 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,214 +18,353 @@
public class Constants {
- public static final String DEFAULT_PWD = "DEFAULT_PWD";
- public static final String TRUE = "t";
- public static final String FALSE = "f";
- public static final String TOKEN ="TOKEN" ;
- public static final String SYSTEM ="SYSTEM" ;
- public static final String IMG_DIR = "IMG_DIR";
- public static final String FILE_DIR ="FILE_DIR" ;
- public static String REDIS_DEBUG_STR="test_";
+ public static final String DEFAULT_PWD = "DEFAULT_PWD";
+ public static final String TRUE = "t";
+ public static final String FALSE = "f";
+ public static final String TOKEN = "TOKEN";
+ public static final String SYSTEM = "SYSTEM";
+ public static final String MINI_PROGRAMME = "MINI_PROGRAMME";
+ public static final String IMG_DIR = "IMG_DIR";
+ public static final String FILE_DIR = "FILE_DIR";
+ public static final String PRIVATE_KEY = "PRIVATE_KEY";
+ public static String REDIS_DEBUG_STR = "test_";
- /**
- * 鏁版嵁鏉冮檺鑼冨洿锛�0鍙湅鑷繁锛�1鍙湅鑷繁鎵�鍦ㄦ牎鍖猴紱2鐪嬪叏閮ㄦ牎鍖猴紱3鐪嬫寚瀹氭牎鍖猴紙澶氶�夛級
- */
- public interface PermissionType{
- int self =0;
- int self_campus =1;
- int all =2;
- int partful = 3;
- }
+ /**
+ * 鏁版嵁鏉冮檺鑼冨洿锛�0鍙湅鑷繁锛�1鍙湅鑷繁鎵�鍦ㄦ牎鍖猴紱2鐪嬪叏閮ㄦ牎鍖猴紱3鐪嬫寚瀹氭牎鍖猴紙澶氶�夛級
+ */
+ public interface PermissionType {
+ int self = 0;
+ int self_campus = 1;
+ int all = 2;
+ int partful = 3;
+ }
- public interface RedisKeys {
- public static final String submission_period_key = "sp_";
+ public interface goodsorderStatus {
+ int waitPay = 0;
+ int pay = 1;
+ int cancel = 2;
+ int fail = 3;
+ int over = 4;
+ }
+ public interface goodsorderPayStatus{
+ int waitPay =0;
+ int pay =1;
}
- public static final String ACCESS_ID="ACCESS_ID";
-
- public static final String BUCKETNAME = "BUCKETNAME";
-
- public static final String OSS = "OSS";
-
- public static final String ACCESS_KEY = "ACCESS_KEY";
-
- public static final String SCRATCH_REDIRECT = "SCRATCH_REDIRECT";
-
- public static final String ENDPOINT = "ENDPOINT";
-
- public static final String TESTCASE_UPLOAD_PATH = "TESTCASE_UPLOAD_PATH";
-
- public static final String RESOURCE_PATH = "RESOURCE_PATH";
- public static final String UPLOAD_FILE = "UPLOAD_FILE";
- public static final String AVATAR_FILE = "AVATAR_FILE";
-
- public static final String FILES_DIR = "FILES_DIR";
- public static final String SCRATCH_REDIRECT_URL = "SCRATCH_REDIRECT_URL";
- public static final Integer ZERO = 0 ;
- public static final Integer ONE = 1 ;
- public static final Integer TWO = 2 ;
-
- public static int formatIntegerNum(Integer num){
- if(num == null){
- return 0;
- }
- return num;
- }
-
- public interface UserActionsType{
- String cancelPrePay="CANCEL_PRE_PAY";
-
- //璁㈠崟缁撶畻璁㈠崟
- String close="CLOSE";
- String forceRefund="FORCE_REFUND";
- String login="LOGIN";
- String pay="PAY";
- String preForceRefund="PRE_FORCE_REFUND";
- String prePay="PRE_PAY";
- String preRefund="PRE_REFUND";
- String refund="REFUND";
- String register="REGISTER";
- String rent="RENT";
- }
- public static BigDecimal formatDecimalNum(BigDecimal num){
- if(num == null){
- return new BigDecimal(0);
- }
- return num;
- }
- public static int compareBigdecimal(BigDecimal num,BigDecimal num2){
- if(num == null){
- num =new BigDecimal(0);
- }
- if(num2 == null){
- num2 =new BigDecimal(0);
- }
- if (num.compareTo(num2) == 1) {
- return 1;
- } else if (num.compareTo(num2)== -1) {
- return -1;
- }
- return 0;
- }
-
- public static long formatLongNum(Long num){
- if(num == null){
- return 0;
- }
- return num;
- }
- public static String formatImgPath(String avatar, String imgPath) {
- if(StringUtils.isBlank(avatar)){
- return null;
- }
- return imgPath+avatar;
- }
- public static String getIpAddr(HttpServletRequest request) {
- String ipAddress = request.getHeader("x-forwarded-for");
- if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
- ipAddress = request.getHeader("Proxy-Client-IP");
+public static String getUUID(){
+ return UUID.randomUUID().toString().replace("-","");
+}
+ public interface RedisKeys {
+ public static final String submission_period_key = "sp_";
}
- if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
- ipAddress = request.getHeader("WL-Proxy-Client-IP");
+
+
+ public static final String ACCESS_ID = "ACCESS_ID";
+
+ public static final String BUCKETNAME = "BUCKETNAME";
+
+ public static final String OSS = "OSS";
+
+ public static final String ACCESS_KEY = "ACCESS_KEY";
+
+ public static final String SCRATCH_REDIRECT = "SCRATCH_REDIRECT";
+
+ public static final String ENDPOINT = "ENDPOINT";
+
+ public static final String TESTCASE_UPLOAD_PATH = "TESTCASE_UPLOAD_PATH";
+
+ public static final String RESOURCE_PATH = "RESOURCE_PATH";
+ public static final String UPLOAD_FILE = "UPLOAD_FILE";
+ public static final String AVATAR_FILE = "AVATAR_FILE";
+ //鐢ㄦ埛鍗忚
+ public static final String AGREEMENT = "AGREEMENT";
+ //璁′环瑙勫垯
+ public static final String PRICING_RULE = "PRICING_RULE";
+ //灏忕▼搴忎富棰樺悕绉�
+ public static final String PROJECT_NAME = "PROJECT_NAME";
+ //灏忕▼搴忔湇鍔$鐢佃瘽
+ public static final String SERVER_PHONE = "SERVER_PHONE";
+ //灏忕▼搴忕璧佹祦绋嬭棰�
+ public static final String RENT_TIPS_VIDEO = "RENT_TIPS_VIDEO";
+ //绉熻祦椤荤煡
+ public static final String LEASE_NOTICE = "LEASE_NOTICE";
+ //绉熻祦椤荤煡鍥剧墖
+ public static final String LEASE_NOTICE_URL = "LEASE_NOTICE_URL";
+ //鎶奸噾
+ public static final String RENT_DEPOSIT = "RENT_DEPOSIT";
+ //娓╅Θ鎻愮ず
+ public static final String TIPS = "TIPS";
+
+
+ public static final String FILES_DIR = "FILES_DIR";
+ public static final String SCRATCH_REDIRECT_URL = "SCRATCH_REDIRECT_URL";
+ public static final Integer ZERO = 0;
+ public static final Integer ONE = 1;
+ public static final Integer TWO = 2;
+ public static final Integer THREE = 3;
+
+ public static int formatIntegerNum(Integer num) {
+ if (num == null) {
+ return 0;
+ }
+ return num;
}
- if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
- ipAddress = request.getRemoteAddr();
- String localIp = "127.0.0.1";
- String localIpv6 = "0:0:0:0:0:0:0:1";
- if (ipAddress.equals(localIp) || ipAddress.equals(localIpv6)) {
- // 鏍规嵁缃戝崱鍙栨湰鏈洪厤缃殑IP
- InetAddress inet = null;
- try {
- inet = InetAddress.getLocalHost();
- ipAddress = inet.getHostAddress();
- } catch (UnknownHostException e) {
- e.printStackTrace();
+
+ public interface UserActionsType {
+ String cancelPrePay = "CANCEL_PRE_PAY";
+
+ //璁㈠崟缁撶畻璁㈠崟
+ String close = "CLOSE";
+ String forceRefund = "FORCE_REFUND";
+ String login = "LOGIN";
+ String pay = "PAY";
+ String preForceRefund = "PRE_FORCE_REFUND";
+ String prePay = "PRE_PAY";
+ String preRefund = "PRE_REFUND";
+ String refund = "REFUND";
+ String register = "REGISTER";
+ String rent = "RENT";
+ }
+
+ public enum GOODSORDER_STATUS{
+ // 0寰呮敮浠� 1宸叉敮浠� 2宸插彇娑� 3鏀粯澶辫触 4宸茬粨绠�
+ UN_PAY("寰呮敮浠�", 0,"寰呮敮浠�"),
+
+ HAVING_PAY("宸叉敮浠�", 1,"宸叉敮浠�"),
+
+ CANCEL("宸插彇娑�", 2,"宸插彇娑�"),
+
+ PAY_FAILURE("鏀粯澶辫触", 3,"鏀粯澶辫触"),
+
+ CLOSE("宸茬粨绠�", 4,"宸茬粨绠�"),
+ ;
+ String name;
+
+ Integer key;
+
+ String info;
+
+ GOODSORDER_STATUS(String name, Integer key, String info) {
+ this.name = name;
+ this.key = key;
+ this.info = info;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Integer getKey() {
+ return key;
+ }
+
+ public void setKey(Integer key) {
+ this.key = key;
+ }
+
+ public String getInfo() {
+ return info;
+ }
+
+ public void setInfo(String info) {
+ this.info = info;
+ }
+ }
+
+ public enum MEMBER_RIDES_STATUS{
+// 0璇锋眰寮�閿佷腑 1楠戣涓� 2宸茶繕杞� 3寮�閿佸け璐�
+ LOCKING("璇锋眰寮�閿佷腑", 0,"璇锋眰寮�閿佷腑"),
+
+ RIDES_RUNNING("楠戣涓�", 1,"楠戣涓�"),
+
+ BACK_CYCLING("宸茶繕杞�", 2,"宸茶繕杞�"),
+
+ LOCKING_DEFEAT("寮�閿佸け璐�", 3,"寮�閿佸け璐�")
+ ;
+ String name;
+
+ Integer key;
+
+ String info;
+
+ MEMBER_RIDES_STATUS(String name, Integer key, String info) {
+ this.name = name;
+ this.key = key;
+ this.info = info;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Integer getKey() {
+ return key;
+ }
+
+ public void setKey(Integer key) {
+ this.key = key;
+ }
+
+ public String getInfo() {
+ return info;
+ }
+
+ public void setInfo(String info) {
+ this.info = info;
+ }
+ }
+
+ public static BigDecimal formatDecimalNum(BigDecimal num) {
+ if (num == null) {
+ return new BigDecimal(0);
+ }
+ return num;
+ }
+
+ public static int compareBigdecimal(BigDecimal num, BigDecimal num2) {
+ if (num == null) {
+ num = new BigDecimal(0);
+ }
+ if (num2 == null) {
+ num2 = new BigDecimal(0);
+ }
+ if (num.compareTo(num2) == 1) {
+ return 1;
+ } else if (num.compareTo(num2) == -1) {
+ return -1;
+ }
+ return 0;
+ }
+
+ public static long formatLongNum(Long num) {
+ if (num == null) {
+ return 0;
+ }
+ return num;
+ }
+
+ public static String formatImgPath(String avatar, String imgPath) {
+ if (StringUtils.isBlank(avatar)) {
+ return null;
+ }
+ return imgPath + avatar;
+ }
+
+ public static String getIpAddr(HttpServletRequest request) {
+ String ipAddress = request.getHeader("x-forwarded-for");
+ if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
+ ipAddress = request.getHeader("Proxy-Client-IP");
+ }
+ if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
+ ipAddress = request.getHeader("WL-Proxy-Client-IP");
+ }
+ if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
+ ipAddress = request.getRemoteAddr();
+ String localIp = "127.0.0.1";
+ String localIpv6 = "0:0:0:0:0:0:0:1";
+ if (ipAddress.equals(localIp) || ipAddress.equals(localIpv6)) {
+ // 鏍规嵁缃戝崱鍙栨湰鏈洪厤缃殑IP
+ InetAddress inet = null;
+ try {
+ inet = InetAddress.getLocalHost();
+ ipAddress = inet.getHostAddress();
+ } catch (UnknownHostException e) {
+ e.printStackTrace();
+ }
}
}
- }
- // 瀵逛簬閫氳繃澶氫釜浠g悊鐨勬儏鍐碉紝绗竴涓狪P涓哄鎴风鐪熷疄IP,澶氫釜IP鎸夌収','鍒嗗壊
- String ipSeparate = ",";
- int ipLength = 15;
- if (ipAddress != null && ipAddress.length() > ipLength) {
- if (ipAddress.indexOf(ipSeparate) > 0) {
- ipAddress = ipAddress.substring(0, ipAddress.indexOf(ipSeparate));
+ // 瀵逛簬閫氳繃澶氫釜浠g悊鐨勬儏鍐碉紝绗竴涓狪P涓哄鎴风鐪熷疄IP,澶氫釜IP鎸夌収','鍒嗗壊
+ String ipSeparate = ",";
+ int ipLength = 15;
+ if (ipAddress != null && ipAddress.length() > ipLength) {
+ if (ipAddress.indexOf(ipSeparate) > 0) {
+ ipAddress = ipAddress.substring(0, ipAddress.indexOf(ipSeparate));
+ }
}
+ return ipAddress;
}
- return ipAddress;
- }
- public static String getSHA256Str(String str) {
- MessageDigest messageDigest;
- String encdeStr = "";
- try {
- messageDigest = MessageDigest.getInstance("SHA-256");
- byte[] hash = messageDigest.digest(str.getBytes("UTF-8"));
- encdeStr = Hex.encodeHexString(hash);
- } catch (NoSuchAlgorithmException e) {
- e.printStackTrace();
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
- return encdeStr;
- }
- public static String trimEndSpaceStr(String outPut){
- String newOutPut = "";
- if(StringUtils.isNotBlank(outPut)){
- String[] ostrs = outPut.split("\n");
- for(String str : ostrs){
- String text = str.replace("\n","").replaceAll("\\s+$", "");
- newOutPut += text+"\n";
-
+ public static String getSHA256Str(String str) {
+ MessageDigest messageDigest;
+ String encdeStr = "";
+ try {
+ messageDigest = MessageDigest.getInstance("SHA-256");
+ byte[] hash = messageDigest.digest(str.getBytes("UTF-8"));
+ encdeStr = Hex.encodeHexString(hash);
+ } catch (NoSuchAlgorithmException e) {
+ e.printStackTrace();
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
}
- if(newOutPut.endsWith("\n")){
- newOutPut = newOutPut.substring(0,newOutPut.length()-1);
+ return encdeStr;
+ }
+
+ public static String trimEndSpaceStr(String outPut) {
+ String newOutPut = "";
+ if (StringUtils.isNotBlank(outPut)) {
+ String[] ostrs = outPut.split("\n");
+ for (String str : ostrs) {
+ String text = str.replace("\n", "").replaceAll("\\s+$", "");
+ newOutPut += text + "\n";
+
+ }
+ if (newOutPut.endsWith("\n")) {
+ newOutPut = newOutPut.substring(0, newOutPut.length() - 1);
+ }
}
+ return newOutPut;
}
- return newOutPut;
- }
- public static String delHTMLTag(String htmlStr) {
- if (StringUtils.isBlank(htmlStr)) {
- return "";
+ public static String delHTMLTag(String htmlStr) {
+ if (StringUtils.isBlank(htmlStr)) {
+ return "";
+ }
+ String regEx_script = "<script[^>]*?>[\\s\\S]*?<\\/script>"; // 瀹氫箟script鐨勬鍒欒〃杈惧紡
+ String regEx_style = "<style[^>]*?>[\\s\\S]*?<\\/style>"; // 瀹氫箟style鐨勬鍒欒〃杈惧紡
+ String regEx_html = "<[^>]+>"; // 瀹氫箟HTML鏍囩鐨勬鍒欒〃杈惧紡
+
+ Pattern p_script = Pattern.compile(regEx_script, Pattern.CASE_INSENSITIVE);
+ Matcher m_script = p_script.matcher(htmlStr);
+ htmlStr = m_script.replaceAll(""); // 杩囨护script鏍囩
+
+ Pattern p_style = Pattern.compile(regEx_style, Pattern.CASE_INSENSITIVE);
+ Matcher m_style = p_style.matcher(htmlStr);
+ htmlStr = m_style.replaceAll(""); // 杩囨护style鏍囩
+
+ Pattern p_html = Pattern.compile(regEx_html, Pattern.CASE_INSENSITIVE);
+ Matcher m_html = p_html.matcher(htmlStr);
+ htmlStr = m_html.replaceAll(""); // 杩囨护html鏍囩
+
+ htmlStr = htmlStr.replace(" ", " "); // 杩囨护绌烘牸鏍囩
+ htmlStr = htmlStr.replace(" ", " "); // 杩囨护绌烘牸鏍囩
+
+ return htmlStr.trim(); // 杩斿洖鏂囨湰瀛楃涓�
}
- String regEx_script = "<script[^>]*?>[\\s\\S]*?<\\/script>"; // 瀹氫箟script鐨勬鍒欒〃杈惧紡
- String regEx_style = "<style[^>]*?>[\\s\\S]*?<\\/style>"; // 瀹氫箟style鐨勬鍒欒〃杈惧紡
- String regEx_html = "<[^>]+>"; // 瀹氫箟HTML鏍囩鐨勬鍒欒〃杈惧紡
-
- Pattern p_script = Pattern.compile(regEx_script, Pattern.CASE_INSENSITIVE);
- Matcher m_script = p_script.matcher(htmlStr);
- htmlStr = m_script.replaceAll(""); // 杩囨护script鏍囩
-
- Pattern p_style = Pattern.compile(regEx_style, Pattern.CASE_INSENSITIVE);
- Matcher m_style = p_style.matcher(htmlStr);
- htmlStr = m_style.replaceAll(""); // 杩囨护style鏍囩
-
- Pattern p_html = Pattern.compile(regEx_html, Pattern.CASE_INSENSITIVE);
- Matcher m_html = p_html.matcher(htmlStr);
- htmlStr = m_html.replaceAll(""); // 杩囨护html鏍囩
-
- htmlStr = htmlStr.replace(" "," "); // 杩囨护绌烘牸鏍囩
- htmlStr = htmlStr.replace(" "," "); // 杩囨护绌烘牸鏍囩
-
- return htmlStr.trim(); // 杩斿洖鏂囨湰瀛楃涓�
- }
- public static List<String> checkUUID(String checkValue){
- String [] str = checkValue.split(",");
+ public static List<String> checkUUID(String checkValue) {
+ String[] str = checkValue.split(",");
List<String> strList = new ArrayList<>();
- for (String s:str) {
- try{
+ for (String s : str) {
+ try {
String uuid = UUID.fromString(s).toString();
strList.add(uuid);
//do something
- } catch (IllegalArgumentException exception){
+ } catch (IllegalArgumentException exception) {
continue;
}
}
return strList;
- }
+ }
}
--
Gitblit v1.9.3