| | |
| | | public static final int ORDER_LOG_CANCEL = 4; // 取消订单 |
| | | public static final int ORDER_LOG_CONFIRM_ARRIVE = 5; // 确认顾客到店 |
| | | public static final int ORDER_LOG_DRIVER_PICKUP = 6; // 司机完成取件 |
| | | public static final int ORDER_LOG_DRIVER_DELIVER = 7; // 司机确认送达 |
| | | |
| | | public static final String SUCCESS = "SUCCESS"; |
| | | public static final String FAIL = "FAIL"; |
| | |
| | | return null; |
| | | } |
| | | |
| | | public static String getDescByKey(int index) { |
| | | public static String getDescByKey(int index,int type) { |
| | | for (OrderStatus c : OrderStatus.values()) { |
| | | if (c.getKey() == index) { |
| | | if (c.getKey() == 5) { |
| | | if(Constants.equalsInteger(type,Constants.ZERO)){ |
| | | return "待取件"; |
| | | }else{ |
| | | return Constants.equalsInteger(type,Constants.ONE)?"已到店":"已送达"; |
| | | } |
| | | } |
| | | return c.getValue(); |
| | | } |
| | | } |
| | |
| | | waitDeliver(2, "待配送", new int[]{OrderStatus.accepted.status}), |
| | | waitReceive(3, "待收货", new int[]{ OrderStatus.delivering.status, OrderStatus.arrived.status}), |
| | | finished(4, "已完成", new int[]{OrderStatus.finished.status}), |
| | | refund(5, "退款", new int[]{OrderStatus.closed.status, OrderStatus.cancelling.status}) |
| | | refund(5, "退款", new int[]{OrderStatus.closed.status, OrderStatus.cancelling.status}), |
| | | home(6, "首页查询", new int[]{OrderStatus.waitPay.status, OrderStatus.waitDeposit.status, OrderStatus.deposited.status |
| | | , OrderStatus.accepted.status, OrderStatus.delivering.status, OrderStatus.arrived.status}) |
| | | ; |
| | | private final int key; |
| | | private final String desc; |
| | |
| | | for (OrderCombinedStatus c : OrderCombinedStatus.values()) { |
| | | if (c.getKey() == key) { |
| | | return c; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 首页订单状态提示枚举 |
| | | * status: 订单状态值 |
| | | * desc: 状态描述 |
| | | * tipTemplate: 提示文案模板,占位符用 {xxx} 表示 |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum OrderStatusTip { |
| | | waitPay(0, "待支付", "请在{timeout}分钟内完成支付,超时订单将自动取消"), |
| | | waitDeposit(1, "待寄存", "订单已支付,请前往门店寄存"), |
| | | deposited(2, "已寄存", null), // 就地/异地文案不同,动态处理 |
| | | accepted(3, "已接单", "已有司机抢单,正前往取件地点"), |
| | | delivering(4, "派送中", "司机已取件,正运往目的地"), |
| | | arrived(5, "待取件", null), // 就地/异地/有无取件门店文案不同,动态处理 |
| | | ; |
| | | |
| | | private final int status; |
| | | private final String desc; |
| | | private final String tipTemplate; |
| | | |
| | | public static OrderStatusTip getByStatus(int status) { |
| | | for (OrderStatusTip t : OrderStatusTip.values()) { |
| | | if (t.status == status) { |
| | | return t; |
| | | } |
| | | } |
| | | return null; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 司机订单站内信通知枚举 |
| | | * title: 通知标题 |
| | | * content: 通知文案模板,占位符用 {xxx} 表示 |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum DriverOrderNotify { |
| | | WAIT_DELIVER("waitDeliver", "订单待配送", "您已抢单成功,订单:{orderNo}请按时到{shopName}取件"), |
| | | DELIVERING("delivering", "配送中", "行李订单:{orderNo}已取件,正在配送中,请按时送达"), |
| | | ARRIVED("arrived", "已送达", "行李订单:{orderNo}已送达{destination},请联系用户确认签收"), |
| | | FINISHED("finished", "订单已完成", "行李订单:{orderNo}已完成,相关订单结算会在{settleDays}个工作日内结算"), |
| | | EVALUATED("evaluated", "订单已评价", "行李订单:{orderNo}用户已完成评价,可前往订单查看评价内容"), |
| | | REFUNDING("refunding", "退款中", "行李订单:{orderNo}用户已提交退款申请,该订单任务已取消,请勿前往。"), |
| | | SETTLED("settled", "订单已结算", "行李订单:{orderNo}平台已完成结算,金额为{amount}元,请注意查收。"), |
| | | CANCELLED("cancelled", "订单取消成功", "行李订单:{orderNo}已帮您取消,您今日还可主动取消{cancelLimit}次订单,请合理安排接单。") |
| | | ; |
| | | |
| | | private final String key; |
| | | private final String title; |
| | | private final String content; |
| | | |
| | | /** |
| | | * 格式化通知内容 |
| | | * @param params 键值对,如 "orderNo","123" 交替传入 |
| | | */ |
| | | public String format(String... params) { |
| | | String result = this.content; |
| | | for (int i = 0; i < params.length - 1; i += 2) { |
| | | result = result.replace("{" + params[i] + "}", params[i + 1]); |
| | | } |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 得到request对象 |
| | | * |
| | | * @return |