rk
2025-09-28 2304d7b140c5c5b4bf3a83f9ced8bff37d20c42e
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;
@@ -142,6 +144,12 @@
            d = 0L;
        }
        return d.longValue();
    }
    public static BigDecimal formatBigDecimal(BigDecimal d) {
        if (d == null) {
            new BigDecimal(0);
        }
        return d;
    }
    /**
@@ -439,6 +447,8 @@
        AUTO_COMMENT(13, "系统-自动评价","超出7日未评价,系统已自动评价",2),
        AUTO_AGREE(14, "系统-自动同意","接单方超时未处理,已自动同意",2),
        FEE_CONFIRM(15, "接单方-确认费用","{userName}已确认费用",1),
        ;
        // 成员变量
        private String name;
@@ -553,21 +563,23 @@
    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 name; //接单方文案
        private String info; //发单方文案
        // 构造方法
        ordersStatus(int key, String name) {
        ordersStatus(int key, String name,String info) {
            this.name = name;
            this.key = key;
            this.info = info;
        }
        // 普通方法
@@ -575,6 +587,15 @@
            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;
@@ -594,6 +615,14 @@
        public void setKey(int key) {
            this.key = key;
        }
        public String getInfo() {
            return info;
        }
        public void setInfo(String info) {
            this.info = info;
        }
    }
@@ -647,7 +676,7 @@
    public  enum smsContent {
        accept(0, "SMS_491325122","您的{order}订单已被接单!时间:{time1}-{time2},接单方:{name}。"),
        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}。"),
@@ -708,6 +737,21 @@
    }
    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;
    }
}