| | |
| | | package com.doumee.core.constants; |
| | | |
| | | import com.doumee.dao.business.model.Orders; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | |
| | | */ |
| | | public class Constants { |
| | | |
| | | public static final String HWY_OBS ="HWY_OBS" ; |
| | | public static final String HWY_OBS_ACCESSID ="HWY_OBS_ACCESSID" ; |
| | | public static final String HWY_OBS_ACCESSKEY ="HWY_OBS_ACCESSKEY" ; |
| | | public static final String HWY_OBS_ENDPOINT ="HWY_OBS_ENDPOINT" ; |
| | | public static final String HWY_OBS_BUCKET ="HWY_OBS_BUCKET" ; |
| | | public static final String OSS ="OSS" ; |
| | | |
| | | public static final String RESOURCE_PATH ="RESOURCE_PATH" ; |
| | | public static final String QYWX_CORPID = "QYWX_CORPID"; |
| | | public static final String QYWX_SECRET = "QYWX_SECRET"; |
| | |
| | | public static final String USER_AGREEMENT ="USER_AGREEMENT" ; |
| | | public static final String PRIVACY_AGREEMENT ="PRIVACY_AGREEMENT" ; |
| | | |
| | | public static final String ACCESS_ID="ACCESS_ID"; |
| | | public static final String BUCKETNAME = "BUCKETNAME"; |
| | | |
| | | public static final String RELEASE_CANCEL_TIMES ="RELEASE_CANCEL_TIMES" ; |
| | | public static final String RECEIVE_CANCEL_TIMES ="RECEIVE_CANCEL_TIMES" ; |
| | | public static final String RELEASE_CANCEL_TIME ="RELEASE_CANCEL_TIME" ; |
| | | public static final String RECEIVE_CANCEL_TIME ="RECEIVE_CANCEL_TIME" ; |
| | | 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 ACCESS_KEY = "ACCESS_KEY"; |
| | | public static final String ENDPOINT = "ENDPOINT"; |
| | | |
| | | public static final String QYWX = "QYWX"; |
| | | public static final Integer ONE = 1; |
| | |
| | | public static final String INENTITY_FILES = "INENTITY_FILES"; |
| | | public static final String MEMBER_FILES = "MEMBER_FILES"; |
| | | public static final String CATEGORY_FILES = "CATEGORY_FILES"; |
| | | public static final String SHOP_FILES = "SHOP_FILES"; |
| | | public static final String DRIVER_FILES = "DRIVER_FILES"; |
| | | public static final String BANNER_FILES = "BANNER_FILES"; |
| | | public static final String ORDERS_FILES = "ORDERS_FILES"; |
| | | |
| | | // 运营配置 |
| | | public static final String OPERATION_CONFIG = "OPERATION_CONFIG"; |
| | | public static final String OP_DRIVER_DAILY_CANCEL_LIMIT = "DRIVER_DAILY_CANCEL_LIMIT"; |
| | | public static final String OP_UNPICKED_DISCOUNT = "UNPICKED_DISCOUNT"; |
| | | public static final String OP_SETTLEMENT_DATE = "SETTLEMENT_DATE"; |
| | | public static final String OP_URGENT_COEFFICIENT = "URGENT_COEFFICIENT"; |
| | | public static final String OP_AUTO_CANCEL_TIME = "AUTO_CANCEL_TIME"; |
| | | public static final String OP_INSURANCE_RATE = "INSURANCE_RATE"; |
| | | public static final String OP_ORDER_ACCEPT_LIMIT = "ORDER_ACCEPT_LIMIT"; |
| | | public static final String OP_AUTO_CONFIRM_RECEIPT = "AUTO_CONFIRM_RECEIPT"; |
| | | public static boolean WORKORDER_SHE_EMAIL_SENDING = false; |
| | | public static boolean DEALING_COMPANY_SYNC = false ; |
| | | public static boolean DEALING_MEMBER_SYNC = false ; |
| | |
| | | public static final String WORKORDER_LOG_FILE_PATH ="WORKORDER_LOG_FILE_PATH" ; |
| | | |
| | | public static final String REDIS_TOKEN_KEY = "token_"; |
| | | public static final String REDIS_VERIFY_CODE_KEY = "verify_code_"; |
| | | |
| | | |
| | | |
| | | public final static String GOODS_ORDER_CREATE_LOCK = "goods:order:create:lock:"; |
| | | |
| | | // 订单日志操作类型 |
| | | public static final int ORDER_LOG_DISPATCH = 1; // 派单 |
| | | public static final int ORDER_LOG_URGENT_FEE = 2; // 加急费 |
| | | public static final int ORDER_LOG_ASSIGN_DRIVER = 3; // 指派司机 |
| | | 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 String SUCCESS = "SUCCESS"; |
| | | public static final String FAIL = "FAIL"; |
| | |
| | | * 缓存Key |
| | | */ |
| | | interface CacheKey { |
| | | } |
| | | public interface RedisKeys { |
| | | public static final String ORDER_CODE = "ORDER_CODE"; |
| | | } |
| | | /** |
| | | * 操作类型,用于做接口验证分组 |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 文件附件类型 |
| | | */ |
| | | public interface multiFileType{ |
| | | //0问题上报 1跌绊滑上报 2跌绊滑处理 3分配物业主管 4分配处理人 5DCA风险上报 6DCA风险处理 7DCA问题工单图片 |
| | | // int sheUpload = 0; |
| | | // int dbhUpload = 1; |
| | | // int dbhDeal = 2; |
| | | // int dbhAllocation = 3; |
| | | // int dbhDealUser = 4; |
| | | // int dcaUpload = 5; |
| | | // int dcaDeal = 6; |
| | | // int dcaWorkOrder= 7; |
| | | |
| | | //0工单上报 1工单处理 2工单转交 |
| | | int upload = 0; |
| | | int deal = 1; |
| | | int passOn = 2; |
| | | } |
| | | |
| | | |
| | | public enum WorkOrderStatus{ |
| | | waitConfirm( 0, "待分配WTS","{title}上报","","待分配WTS" ), |
| | | waitAllocation(1, "待分配任务","待分配任务","","待分配任务"), |
| | | waitDeal(2, "待处理","待处理","","待工程师处理"), |
| | | sheClose(3, "已解决","SHE已关闭","","SHE已关闭"), |
| | | wtsClose(4, "已解决","WTS已关闭","","WTS已关闭"), |
| | | close(5, "已解决","已解决","","工程师关闭"), |
| | | urge (6, "催促","","","") |
| | | ; |
| | | |
| | | private int status; |
| | | private String statusInfo; |
| | | private String statusName; |
| | | private String logTitle; |
| | | private String noticeContent; |
| | | |
| | | // 构造方法 |
| | | WorkOrderStatus(int status, String statusInfo,String logTitle,String noticeContent,String statusName ) { |
| | | this.status = status; |
| | | this.statusInfo = statusInfo; |
| | | this.logTitle = logTitle; |
| | | this.noticeContent = noticeContent; |
| | | this.statusName = statusName; |
| | | } |
| | | public static String getName(int index) { |
| | | for (WorkOrderStatus c : WorkOrderStatus.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.statusInfo; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | public static String getStatusName(int index) { |
| | | for (WorkOrderStatus c : WorkOrderStatus.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.statusName; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public int getKey() { |
| | | return status; |
| | | } |
| | | |
| | | public void setKey(int key) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public int getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(int status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getStatusName() { |
| | | return statusName; |
| | | } |
| | | |
| | | public void setStatusName(String statusName) { |
| | | this.statusName = statusName; |
| | | } |
| | | |
| | | public String getStatusInfo() { |
| | | return statusInfo; |
| | | } |
| | | |
| | | public void setStatusInfo(String statusInfo) { |
| | | this.statusInfo = statusInfo; |
| | | } |
| | | |
| | | public String getLogTitle() { |
| | | return logTitle; |
| | | } |
| | | |
| | | public void setLogTitle(String logTitle) { |
| | | this.logTitle = logTitle; |
| | | } |
| | | |
| | | public String getNoticeContent() { |
| | | return noticeContent; |
| | | } |
| | | |
| | | public void setNoticeContent(String noticeContent) { |
| | | this.noticeContent = noticeContent; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 用户收支业务类型 |
| | | * 变动类型:0=用工单收入;1=货运单收入;2=供餐单收入;3=提现申请; |
| | | * 附件类型(对应 multifile.objType) |
| | | */ |
| | | @Getter |
| | | public enum RevenueType { |
| | | @AllArgsConstructor |
| | | public enum FileType { |
| | | OTHER_MATERIAL(0, "门店其他材料"), |
| | | STORE_INTERIOR(1, "门店内部照片"), |
| | | ORDER_DEPOSIT(2, "订单寄存图片"), |
| | | ORDER_TAKE(3, "门店入库图片"), |
| | | DRIVER_TAKE(4, "司机取件图片"), |
| | | DRIVER_DONE(5, "司机完成图片"), |
| | | DRIVER_CAR(6, "司机实名认证车辆照片"), |
| | | DRIVER_LICENSE(7, "司机实名认证驾驶证照片"), |
| | | DRIVER_OTHER(8, "司机实名认证其他图片"), |
| | | STORE_FRONT(9, "门店门头照"), |
| | | SOCIAL_SECURITY(10, "社保缴纳证明"), |
| | | LABOR_CONTRACT(11, "有效劳动合同"), |
| | | ORDER_FILE(12,"下单图片"), |
| | | STORE_OUT(13,"门店出库图片"), |
| | | REFUND_TAKE(14,"退款取件图片") |
| | | |
| | | YGD_INCOME( 0, "用工单收入","用工单" ,0), |
| | | HYD_INCOME( 1, "货运单收入","货运单" ,0), |
| | | GCD_INCOME(2, "供餐单收入","供餐单" ,0), |
| | | WITHDRAW_APPLY(3, "提现申请","提现申请" ,0), |
| | | REFUND( 4, "提现申请退回","提现申请退回" ,0) |
| | | ; |
| | | |
| | | private int key; |
| | | private String name; |
| | | private String info; |
| | | private int navIndex; |
| | | private final int key; |
| | | private final String name; |
| | | } |
| | | |
| | | RevenueType(int key, String name, String info,int navIndex) { |
| | | this.info = info; |
| | | this.key = key; |
| | | this.name = name; |
| | | this.navIndex = navIndex; |
| | | } |
| | | public static RevenueType getObj(int index) { |
| | | for (RevenueType c : RevenueType.values()) { |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum OrderLogType { |
| | | urgent(0, "平台加急", "平台加急,奖励金 {param} 元。"), |
| | | dispatch(1, "平台指派", "平台指派司机 {param} 接单。") |
| | | ; |
| | | private int status; |
| | | private String title; |
| | | private String statusInfo; |
| | | } |
| | | |
| | | /** |
| | | * 订单支付类型 |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum OrdersAttach { |
| | | STORAGE_ORDER("storageOrder", "寄存订单"), |
| | | SHOP_DEPOSIT("shopDeposit", "店铺押金订单"), |
| | | DRIVER_DEPOSIT("driverDeposit", "司机押金订单"), |
| | | OVERDUE_FEE("overdueFee", "订单逾期费用") |
| | | ; |
| | | |
| | | private final String key; |
| | | private final String name; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 订单状态(就地/异地统一) |
| | | * 就地寄存: 0→1→2→3→(6)→7 / 96~99 |
| | | * 异地寄存: 0→1→2→3→4→5→(6)→7 / 96~99 |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum OrderStatus { |
| | | waitPay(0, "待支付"), |
| | | waitDeposit(1, "待寄存"), |
| | | deposited(2, "已寄存"), |
| | | accepted(3, "已接单"), |
| | | delivering(4, "派送中"), |
| | | arrived(5, "已到店/已送达/待取件"), |
| | | overdue(6, "存在逾期"), //弃用 |
| | | finished(7, "已完成"), |
| | | closed(96, "订单关闭(退款)"), |
| | | cancelOverdue(97, "取消逾期"), //弃用 |
| | | cancelling(98, "取消中"), |
| | | cancelled(99, "已取消") |
| | | ; |
| | | private final int status; |
| | | private final String desc; |
| | | |
| | | public int getKey() { return status; } |
| | | public String getValue() { return desc; } |
| | | |
| | | public static OrderStatus getByKey(int index) { |
| | | for (OrderStatus c : OrderStatus.values()) { |
| | | if (c.getKey() == index) { |
| | | return c; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | public static String getName(int index) { |
| | | for (RevenueType c : RevenueType.values()) { |
| | | |
| | | public static String getDescByKey(int index) { |
| | | for (OrderStatus c : OrderStatus.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.getName(); |
| | | return c.getValue(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | public static String getInfo(int index) { |
| | | for (RevenueType c : RevenueType.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.getInfo(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | public static String getObjName(int index) { |
| | | for (RevenueType c : RevenueType.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.getName(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public enum OrdersLog { |
| | | UPLOAD(0, "发单方-发布订单","{userName}发布{param}",0), |
| | | RECEIVE(1, "接单方-已抢单","{userName}已抢单",1), |
| | | UPD_ORDER(2, "发单方-修改订单","{userName}修改了用工时间",0), |
| | | UPD_DISAGREE(3, "接单方-不同意修改,订单取消","{userName}不同意修改,订单取消",1), |
| | | UPD_AGREE(4, "接单方-同意修改","{userName}同意修改",1), |
| | | AUTO(5, "系统-自动派单","无人接单已自动派单给{userName}",1), |
| | | CANCEL(6, "接单方-取消接单","{userName}已手动取消接单",1), |
| | | BEGIN(7, "发单方-开始作业","{userName}已开始作业",0), |
| | | DONE(8, "发单方-完成作业","{userName}已确认完成作业",0), |
| | | PAY(9, "发单方-完成支付","{userName}已支付费用",0), |
| | | COMMENT(10, "发单方-评价完成","{userName}完成评价",0), |
| | | SYSTEM_CANCEL(11, "系统-订单取消","系统取消",2), |
| | | RELEASE_CANCEL(12, "发单方-订单取消","{userName}已手动取消订单",0), |
| | | AUTO_COMMENT(13, "系统-自动评价","超出7日未评价,系统已自动评价",2), |
| | | AUTO_AGREE(14, "系统-自动同意","接单方超时未处理,已自动同意",2), |
| | | |
| | | FEE_CONFIRM(15, "接单方-确认费用","{userName}已确认费用",1), |
| | | |
| | | ; |
| | | // 成员变量 |
| | | private String name; |
| | | private String info; |
| | | private int key; |
| | | private int userType; |
| | | |
| | | // 构造方法 |
| | | OrdersLog(int key, String name,String info,int userType) { |
| | | this.name = name; |
| | | this.info = info; |
| | | this.key = key; |
| | | this.userType = userType; |
| | | } |
| | | |
| | | // 普通方法 |
| | | public static String getName(int index) { |
| | | for (OrdersLog c : OrdersLog.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.name; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | public static String getInfo(int index) { |
| | | for (OrdersLog c : OrdersLog.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.info; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | // get set 方法 |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public int getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(int key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | public int getUserType() { |
| | | return userType; |
| | | } |
| | | |
| | | public void setUserType(int key) { |
| | | this.userType = userType; |
| | | } |
| | | |
| | | public String getInfo() { |
| | | return info; |
| | | } |
| | | |
| | | public void setInfo(String info) { |
| | | this.info = info; |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | |
| | | public enum workType { |
| | | czg(0, "采摘工"), |
| | | fjg(1, "分拣工"), |
| | | bzg(2, "包装工"), |
| | | |
| | | /** |
| | | * 会员端合并订单状态(用于分页筛选) |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum OrderCombinedStatus { |
| | | waitPay(0, "待支付", new int[]{OrderStatus.waitPay.status}), |
| | | waitDeposit(1, "待核验", new int[]{OrderStatus.waitDeposit.status}), |
| | | 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}) |
| | | ; |
| | | // 成员变量 |
| | | private int key; |
| | | private String name; |
| | | private final int key; |
| | | private final String desc; |
| | | private final int[] statuses; |
| | | |
| | | // 构造方法 |
| | | workType(int key, String name) { |
| | | this.name = name; |
| | | this.key = key; |
| | | } |
| | | |
| | | // 普通方法 |
| | | public static String getName(int index) { |
| | | for (workType c : workType.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.name; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | // get set 方法 |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public int getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(int key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | public enum ordersStatus { |
| | | waitPay(0, "待支付","待支付"), |
| | | wait(1, "待接单","待接单"), |
| | | accept(2, "已接单","已接单"), |
| | | doing(3, "进行中","进行中"), |
| | | done(4, "已完成","已完成"), |
| | | feeconfirm(5, "待支付","待发单方支付"),//金额已确认 |
| | | cancel(99, "已取消","已取消"), |
| | | ; |
| | | // 成员变量 |
| | | private int key; |
| | | private String name; //接单方文案 |
| | | private String info; //发单方文案 |
| | | // 构造方法 |
| | | ordersStatus(int key, String name,String info) { |
| | | this.name = name; |
| | | this.key = key; |
| | | this.info = info; |
| | | } |
| | | |
| | | // 普通方法 |
| | | public static String getName(int index) { |
| | | 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; |
| | | } |
| | | // get set 方法 |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public int getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(int key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | public String getInfo() { |
| | | return info; |
| | | } |
| | | |
| | | public void setInfo(String info) { |
| | | this.info = info; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | public enum orderType { |
| | | ygd(0, "用工单"), |
| | | hyd(1, "货运单"), |
| | | scd(2, "送餐单"), |
| | | |
| | | ; |
| | | // 成员变量 |
| | | private int key; |
| | | private String name; |
| | | |
| | | // 构造方法 |
| | | orderType(int key, String name) { |
| | | this.name = name; |
| | | this.key = key; |
| | | } |
| | | |
| | | // 普通方法 |
| | | public static String getName(int index) { |
| | | for (orderType c : orderType.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.name; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | // get set 方法 |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public int getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(int key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | public enum smsContent { |
| | | 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}。"), |
| | | disAgreeUpd(4, "SMS_491085252","接单方已拒绝您将{order}的订单时间修改为{time1}-{time2}。系统已重新将订单放入接单大厅。"), |
| | | orderUpd(5, "SMS_491010267","请注意!您承接的{order}订单,客户将订单时间修改为{time1}-{time2}。请前往确认是否接受,超时不处理将视为同意。"), |
| | | releaseCancel(6, "SMS_491150253","您承接的{order}订单,时间:{time1}-{time2},已被发单方取消。您可前往接单大厅重新接单。"), |
| | | platformCancel2(7, "SMS_491420143","您承接的{order}订单,时间:{time1}-{time2},已由平台取消。如有疑问请联系客服。"), |
| | | dispatch(8, "SMS_491180276","已为您智能匹配订单。订单类型:{order},时间:{time1}-{time2},距离:{distance},预计费用{money}。请前往确认。"), |
| | | pay(9, "SMS_491180278","您承接的{order}订单款项已到账!到账金额:{money}。可在小程序账户余额进行查看。"), |
| | | authentication(10, "SMS_491055290","您申请的{authentication}的{order}认证{status}。请在小程序查看详情。"), |
| | | ; |
| | | // 成员变量 |
| | | private int key; |
| | | private String code; |
| | | private String name; |
| | | |
| | | // 构造方法 |
| | | smsContent(int key,String code, String name) { |
| | | this.name = name; |
| | | this.code = code; |
| | | this.key = key; |
| | | } |
| | | |
| | | // 普通方法 |
| | | public static Constants.smsContent getSmsContent(int index) { |
| | | for (smsContent c : smsContent.values()) { |
| | | if (c.getKey() == index) { |
| | | public static OrderCombinedStatus getByKey(int key) { |
| | | for (OrderCombinedStatus c : OrderCombinedStatus.values()) { |
| | | if (c.getKey() == key) { |
| | | return c; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | // get set 方法 |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(String code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public int getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(int key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 订单站内信通知枚举 |
| | | * title: 通知标题 |
| | | * content: 通知文案模板,占位符用 {xxx} 表示 |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum MemberOrderNotify { |
| | | WAIT_PAY("waitPay", "订单待支付", "您的行李订单:{orderNo}已创建,请在{timeout}分钟内完成支付,超时将自动取消"), |
| | | WAIT_VERIFY("waitVerify", "订单待核验", "您的行李订单:{orderNo}已提交,等待门店核验物品信息,存件码{storeCode}"), |
| | | WAIT_GRAB("waitGrab", "订单待抢单", "您的行李订单:{orderNo}已核验,正在为您安排取件司机"), |
| | | WAIT_PICKUP_REMIND("waitPickupRemind", "订单待取件", "订单{orderNo}行李已寄存,请记得在预约取件时间凭取件码前往指定门店取回"), |
| | | WAIT_PICKUP_GRABBED("waitPickupGrabbed", "订单已抢单", "您的行李订单:已有司机{driverName}抢单,正前往取件地点"), |
| | | DELIVERING("delivering", "订单配送中", "您的行李订单:{orderNo}已由司机{driverName}取件,正运往目的地"), |
| | | ARRIVED_NO_SHOP("arrivedNoShop", "订单已送达", "您的行李订单:{orderNo}已送达{destination},请及时确认收货"), |
| | | ARRIVED_HAS_SHOP("arrivedHasShop", "订单已送达", "您的行李订单:{orderNo}已送达{destination},请及时取件,取件码{pickupCode}"), |
| | | FINISHED("finished", "订单已完成", "您的行李订单:{orderNo}已完成,感谢您的支持,请对本次服务做出评价"), |
| | | EVALUATED("evaluated", "订单已评价", "您的行李订单:{orderNo}评价已提交,感谢您的用心评价,祝您出行顺利,旅途愉快!"), |
| | | CANCELLED("cancelled", "订单已取消", "您的行李订单:{orderNo}已取消,感谢您的支持,欢迎下次再会!"), |
| | | DRIVER_CHANGED("driverChanged", "司机变更提醒", "您的行李订单:{orderNo}原司机已取消,系统正在为您匹配新司机,请留意通知。"), |
| | | REFUNDING("refunding", "订单退款中", "您的行李订单:{orderNo}退款申请已提交,平台会将尽快为您处理退款"), |
| | | REFUNDED("refunded", "订单已退款", "您的行李订单:{orderNo}退款已完成,金额{amount}元将原路退回,请注意查收") |
| | | ; |
| | | |
| | | 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)?"-分拣工":"-包装工"); |
| | | 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; |
| | | } |
| | | return orderTypeInfo; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 门店订单站内信通知枚举 |
| | | * title: 通知标题 |
| | | * content: 通知文案模板,占位符用 {xxx} 表示 |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum ShopOrderNotify { |
| | | WAIT_VERIFY("waitVerify", "订单待核验", "新行李订单:{orderNo}已支付,请尽快核验用户物品信息"), |
| | | WAIT_PICKUP("waitPickup", "订单待取件", "行李订单:{orderNo}已抢单,等待{name}取件"), |
| | | REFUNDING("refunding", "订单退款中", "行李订单:{orderNo}用户提交退款申请,请知悉"), |
| | | DELIVERING("delivering", "订单配送中", "行李订单:{orderNo}已由司机{driverName}取件,正在配送中"), |
| | | ARRIVED("arrived", "已送达", "行李订单:{orderNo}已送达{destination},请联系用户确认签收"), |
| | | FINISHED("finished", "订单已完成", "行李订单:{orderNo}已完成,相关订单结算会在{settleDays}个工作日内完成"), |
| | | EVALUATED("evaluated", "订单已评价", "行李订单:{orderNo}用户已完成评价,可查看评价内容"), |
| | | SETTLED("settled", "订单结算", "行李订单:{orderNo}平台已完成结算,金额为{amount}元,请注意查收。") |
| | | ; |
| | | |
| | | public static String getIpAddr() { |
| | | 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 |
| | | */ |
| | | public static HttpServletRequest getRequest() { |
| | | HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); |
| | | return request; |
| | | } |
| | | |
| | | |
| | | public static String getIpAddr() { |
| | | HttpServletRequest request = Constants.getRequest(); |
| | | String ipAddress = null; |
| | | try { |
| | | ipAddress = request.getHeader("x-forwarded-for"); |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据身份证号码获取性别 |
| | | * @param idCard 身份证号码(15位或18位) |
| | | * @return 1-男,2-女,null-无法判断 |
| | | */ |
| | | public static Integer getGenderByIdCard(String idCard) { |
| | | if (idCard == null || (idCard.length() != 15 && idCard.length() != 18)) { |
| | | return null; |
| | | } |
| | | // 15位身份证:最后一位为性别码;18位身份证:第17位(索引16)为性别码 |
| | | int genderIndex = idCard.length() == 15 ? 14 : 16; |
| | | int genderCode = Character.getNumericValue(idCard.charAt(genderIndex)); |
| | | return genderCode % 2 == 1 ? 1 : 2; |
| | | } |
| | | |
| | | public static BigDecimal formatBigdecimal4Float(BigDecimal d) { |
| | | if (d == null) { |
| | | d = new BigDecimal(0.0); |
| | | } |
| | | //保留两位小数且四舍五入 |
| | | d = d.setScale(4, BigDecimal.ROUND_HALF_UP); |
| | | return d; |
| | | } |
| | | |
| | | /** |
| | | * 司机定级:5=S 4=A 3=B 2=C 1=D |
| | | * |
| | | * @param level 等级 1-5 |
| | | * @return 等级文本 |
| | | */ |
| | | public static String getDriverLevelName(Integer level) { |
| | | if (level == null) return null; |
| | | switch (level) { |
| | | case 5: return "S"; |
| | | case 4: return "A"; |
| | | case 3: return "B"; |
| | | case 2: return "C"; |
| | | case 1: return "D"; |
| | | default: return null; |
| | | } |
| | | } |
| | | |
| | | } |