jiangping
2023-10-09 70f25657a7f1c5b1bfb1189759b9fa6f33b6922e
server/services/src/main/java/com/doumee/core/constants/Constants.java
@@ -18,6 +18,7 @@
public class Constants {
<<<<<<< HEAD
  public static final String DEFAULT_PWD = "DEFAULT_PWD";
  public static final String TRUE = "t";
  public static final String FALSE = "f";
@@ -55,7 +56,12 @@
        int waitPay =0;
        int pay =1;
    }
    public interface transactionsType{
        int deposit =0;
        int consumption =1;
        int refund =2;
        int platformRefund = 3;
    }
public static  String getUUID(){
      return UUID.randomUUID().toString().replace("-","");
@@ -73,14 +79,11 @@
  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";
@@ -100,10 +103,6 @@
    public static final String RENT_DEPOSIT = "RENT_DEPOSIT";
    //温馨提示
    public static final String TIPS = "TIPS";
  public static final String FILES_DIR = "FILES_DIR";
@@ -135,12 +134,110 @@
      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);
@@ -162,12 +259,14 @@
   }
   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)) {
@@ -216,6 +315,7 @@
        }
        return encdeStr;
    }
    public static String trimEndSpaceStr(String outPut){
        String newOutPut = "";
        if(StringUtils.isNotBlank(outPut)){