jiaosong
2023-10-09 b22f741e6918c675fabe5aabc688d2f52858319a
server/services/src/main/java/com/doumee/core/constants/Constants.java
@@ -38,6 +38,7 @@
    int all =2;
    int partful = 3;
  }
    public interface goodsorderStatus{
        int waitPay =0;
        int pay =1;
@@ -96,10 +97,6 @@
    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 ;
@@ -129,12 +126,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);
@@ -156,12 +251,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)) {
@@ -210,6 +307,7 @@
        }
        return encdeStr;
    }
    public static String trimEndSpaceStr(String outPut){
        String newOutPut = "";
        if(StringUtils.isNotBlank(outPut)){