迁移order service 代码

This commit is contained in:
xiaofeng
2020-05-11 23:43:44 +08:00
parent ee735c0ec4
commit 966375beda
131 changed files with 8764 additions and 14 deletions

View File

@@ -0,0 +1,46 @@
package cn.iocoder.mall.order.biz.enums.cart;
import java.util.Arrays;
public enum CartItemStatusEnum {
ENABLE(1, "正常"),
DELETE_BY_MANUAL(2, "主动删除"),
DELETE_BY_ORDER(3, "下单删除"),
;
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CartItemStatusEnum::getValue).toArray();
/**
* 状态值
*/
private Integer value;
/**
* 状态名
*/
private String name;
CartItemStatusEnum(Integer value, String name) {
this.value = value;
this.name = name;
}
public Integer getValue() {
return value;
}
public CartItemStatusEnum setValue(Integer value) {
this.value = value;
return this;
}
public String getName() {
return name;
}
public CartItemStatusEnum setName(String name) {
this.name = name;
return this;
}
}

View File

@@ -0,0 +1,35 @@
package cn.iocoder.mall.order.biz.enums.comment;
/**
*
* 评论回复类型
*
* @author wtz
* @time 2019-06-01 10:30:00
*/
public enum OrderCommentRelpyTypeEnum {
REPLY_REPLY(0, "回复的回复"),
COMMENT_REPLY(1, "评论的回复");
/**
* 状态值
*/
private Integer value;
/**
* 状态名
*/
private String name;
OrderCommentRelpyTypeEnum(Integer value, String name) {
this.value = value;
this.name = name;
}
public Integer getValue() {
return value;
}
public String getName() {
return name;
}
}

View File

@@ -0,0 +1,34 @@
package cn.iocoder.mall.order.biz.enums.comment;
/**
* 订单评论状态
*
* @author wtz
* @time 2019-06-15 14:26
*/
public enum OrderCommentStatusEnum {
WAIT_COMMENT(0, "待评论"),
SUCCESS_COMMENT(1, "评论成功");
/**
* 状态值
*/
private Integer value;
/**
* 状态名
*/
private String name;
OrderCommentStatusEnum(Integer value, String name) {
this.value = value;
this.name = name;
}
public Integer getValue() {
return value;
}
public String getName() {
return name;
}
}

View File

@@ -0,0 +1,36 @@
package cn.iocoder.mall.order.biz.enums.comment;
/**
*
* 评论回复 - 回复的用户的类型
*
* @author wtz
* @time 2019-05-19 15:19
*/
public enum OrderReplyUserTypeEnum {
USER(0, "普通用户"),
MERCHANT(1, "商家");
/**
* 状态值
*/
private Integer value;
/**
* 状态名
*/
private String name;
OrderReplyUserTypeEnum(Integer value, String name) {
this.value = value;
this.name = name;
}
public Integer getValue() {
return value;
}
public String getName() {
return name;
}
}

View File

@@ -0,0 +1,27 @@
package cn.iocoder.mall.order.biz.enums.order;
/**
* 字典 keys 定义
*
* @author Sin
* @time 2019-04-14 17:46
*/
public class DictKeyConstants {
/**
* 订单 - status
*/
public static final String ORDER_STATUS = "order_status";
/**
* 订单 - 物流商家
*/
public static final String ORDER_LOGISTICS_COMPANY = "logistics_company";
/**
* 订单 - 退货原因
*/
public static final String ORDER_RETURN_REASON = "order_return_reason";
/**
* 订单退货 - 退货类型
*/
public static final String ORDER_RETURN_SERVICE_TYPE = "order_return_service_type";
}

View File

@@ -0,0 +1,17 @@
package cn.iocoder.mall.order.biz.enums.order;
import cn.iocoder.common.framework.constant.ModuleErrorCodeInterval;
/**
* 错误码区间
*
* 当前模块化区间:[1-008-000-000 ~ 1-008-000-000]
*
* @author Sin
* @time 2019-03-23 11:35
*/
public class ErrorCodeInterval extends ModuleErrorCodeInterval {
// OrderErrorCodeEnum 错误码区间 [1-008-000-000 ~ 1-008-000-000]
}

View File

@@ -0,0 +1,41 @@
package cn.iocoder.mall.order.biz.enums.order;
/**
* 物流信息
*
* @author Sin
* @time 2019-03-30 22:33
*/
public enum LogisticsEnum {
LOGISTICS_1(1, "顺丰快递"),
LOGISTICS_2(2, "圆通快递"),
LOGISTICS_3(3, "申通快递"),
LOGISTICS_4(4, "韵答快递"),
LOGISTICS_5(5, "天天快递"),
LOGISTICS_6(6, "EMS中国邮政"),
;
/**
* 状态值
*/
private Integer value;
/**
* 状态名
*/
private String name;
LogisticsEnum(int value, String name) {
this.value = value;
this.name = name;
}
public int getValue() {
return value;
}
public String getName() {
return name;
}
}

View File

@@ -0,0 +1,15 @@
package cn.iocoder.mall.order.biz.enums.order;
/**
* MQ 订阅消息
*
* @author Sin
* @time 2019-03-16 15:04
*/
public class MQConstants {
/**
* 订单 - 创建成功 消息
*/
public static final String ORDER_CREATE_SUCCESS = "order.orderCreateSuccess";
}

View File

@@ -0,0 +1,54 @@
package cn.iocoder.mall.order.biz.enums.order;
/**
* 订单取消原因
* order_cancel_reasons
* @author Sin
* @time 2019-03-30 15:08
*/
public enum OrderCancelReasonsEnum {
CANCEL_1(1, "无法联系上买家"),
CANCEL_2(2, "买家误拍或重拍了"),
CANCEL_3(3, "买家无诚意完成交易"),
CANCEL_4(4, "已通过银行线下汇款"),
CANCEL_5(5, "已通过同城见面交易"),
CANCEL_6(6, "已通过货到付款交易"),
CANCEL_7(7, "已通过网上银行直接汇款"),
CANCEL_8(8, "已经缺货无法交易"),
CANCEL_20(20, "其他"),
;
// 无法联系上买家
// 买家误拍或重拍了
// 买家无诚意完成交易
// 已通过银行线下汇款
// 已通过同城见面交易
// 已通过货到付款交易
// 已通过网上银行直接汇款
// 已经缺货无法交易
private final int code;
private final String message;
OrderCancelReasonsEnum(int code, String message) {
this.code = code;
this.message = message;
}
@Override
public String toString() {
return "OrderCancelEnum{" +
"code=" + code +
", message='" + message + '\'' +
'}';
}
public int getCode() {
return code;
}
public String getMessage() {
return message;
}
}

View File

@@ -0,0 +1,41 @@
package cn.iocoder.mall.order.biz.enums.order;
/**
* 发货类型/发货方式
*
* @author Sin
* @time 2019-04-05 16:03
*/
public enum OrderDeliveryTypeEnum {
NONE(1, "未选择"),
ORDER_ONLINE(2, "快递"),
CONTACT_YOURSELF(3, "自己联系"),
NO_DELIVERY(4, "无物流信息"),
;
private Integer value;
private String name;
OrderDeliveryTypeEnum(Integer value, String name) {
this.value = value;
this.name = name;
}
@Override
public String toString() {
return "OrderRecipientTypeEnum{" +
"value=" + value +
", name='" + name + '\'' +
'}';
}
public Integer getValue() {
return value;
}
public String getName() {
return name;
}
}

View File

@@ -0,0 +1,68 @@
package cn.iocoder.mall.order.biz.enums.order;
/**
* 订单错误码
*
* 错误码区间 [1-008-000-000 ~ 1-008-000-000]
*
* @author Sin
* @time 2019-03-23 11:23
*/
public enum OrderErrorCodeEnum {
// order
ORDER_NOT_EXISTENT(1008000000, "获取订单不存在!"),
ORDER_GET_SKU_FAIL(1008000001, "获取商品失败!"),
ORDER_GET_SKU_NOT_EXISTENT(1008000002, "获取的商品不存在!"),
ORDER_PAY_AMOUNT_NOT_NEGATIVE(1008000003, "支付金额不能为负数!"),
ORDER_STATUS_NOT_CANCEL(1008000004, "订单状态不能取消!"),
ORDER_DELIVERY_INCORRECT_DATA(1008000005, "订单发货数据不正确!"),
ORDER_INSUFFICIENT_INVENTORY(1008000006, "库存不足!"),
ORDER_GOODS_AMOUNT_INCORRECT(1008000007, "商品金额非法!"),
ORDER_GET_GOODS_INFO_INCORRECT(1008000008, "获取额商品信息不正确!"),
ORDER_GET_USER_ADDRESS_FAIL(1008000009, "获取用户地址失败!"),
ORDER_GET_PAY_FAIL(1008000010, "调用pay失败!"),
ORDER_NOT_USER_ORDER(1008000011, "不是该用户的订单!"),
ORDER_UNABLE_CONFIRM_ORDER(1008000012, "状态不对不能确认订单!"),
ORDER_CREATE_CART_IS_EMPTY(1008000013, "购物车无选中的商品,无法创建订单"),
ORDER_STATUS_NOT_WAITING_PAYMENT(1008000014, "订单不处于等待支付状态"),
ORDER_PAY_AMOUNT_ERROR(1008000015, "订单金额不正确"),
// order item
ORDER_ITEM_ONLY_ONE(1008000200, "订单Item只有一个!"),
ORDER_ITEM_SOME_NOT_EXISTS(1008000201, "有不存在的商品!"),
// 订单退货
ORDER_RETURN_NO_RETURN_APPLY(1008000400, "未退货申请"),
ORDER_RETURN_NOT_EXISTENT(1008000401, "退货订单不存在"),
ORDER_RETURN_REFUND_FAILED(1008000402, "退款失败"),
// ========== 购物车 ==========
CARD_ITEM_NOT_FOUND(1008003000, "购物车项不存在"),
CARD_ITEM_SKU_NOT_FOUND(1008003001, "商品不存在"),
CARD_ITEM_SKU_QUANTITY_NOT_ENOUGH(1008003002, "商品库存不足"),
// 工具类服务 1008004000
DICT_SERVER_INVOKING_FAIL(1008004000, "字典服务调用失败!"),
ORDER_LOGISTICS_INVOKING_FAIL(1008004001, "订单物流调用失败!"),
;
private final int code;
private final String message;
OrderErrorCodeEnum(int code, String message) {
this.code = code;
this.message = message;
}
public int getCode() {
return code;
}
public String getMessage() {
return message;
}
}

View File

@@ -0,0 +1,40 @@
package cn.iocoder.mall.order.biz.enums.order;
/**
* 订单换货原因
*
* @author Sin
* @time 2019-03-20 21:17
*/
public enum OrderExchangeReasonEnum {
REASON_000(0, "其他"),
REASON_001(1, "尺码不合适"),
REASON_002(2, "质量问题"),
REASON_003(3, "不喜欢"),
;
private Integer value;
private String name;
OrderExchangeReasonEnum(Integer value, String name) {
this.value = value;
this.name = name;
}
@Override
public String toString() {
return "OrderCommonReasonEnum{" +
"value=" + value +
", name=" + name +
'}';
}
public Integer getValue() {
return value;
}
public String getName() {
return name;
}}

View File

@@ -0,0 +1,37 @@
package cn.iocoder.mall.order.biz.enums.order;
/**
* 订单 - 是否退换货状态
*
* @author Sin
* @time 2019-03-22 21:34
*/
public enum OrderHasReturnExchangeEnum {
NO(1, "没有"),
RETURN_GOODS(2, "退货"),
EXCHANGE_GOODS(3, "换货"),
RETURN_EXCHANGE_GOODS(4, "退换货");
/**
* 状态值
*/
private Integer value;
/**
* 状态名
*/
private String name;
OrderHasReturnExchangeEnum(Integer value, String name) {
this.value = value;
this.name = name;
}
public Integer getValue() {
return value;
}
public String getName() {
return name;
}
}

View File

@@ -0,0 +1,34 @@
package cn.iocoder.mall.order.biz.enums.order;
/**
* 订单状态 status
*
* @author Sin
* @time 2019-03-16 14:32
*/
public enum OrderPayStatus {
WAITING_PAYMENT(0, "等待支付"),
SUCCESSFUL_PAYMENT(1, "支付成功"),
REFUND_PAYMENT(2, "退款成功"),
;
private final int value;
private final String name;
OrderPayStatus(int value, String name) {
this.value = value;
this.name = name;
}
public int getValue() {
return value;
}
public String getName() {
return name;
}
}

View File

@@ -0,0 +1,39 @@
package cn.iocoder.mall.order.biz.enums.order;
/**
* 订单收件信息 type配送信息
*
* @author Sin
* @time 2019-04-05 16:03
*/
public enum OrderRecipientTypeEnum {
EXPRESS(1, "快递")
;
private Integer value;
private String name;
OrderRecipientTypeEnum(Integer value, String name) {
this.value = value;
this.name = name;
}
@Override
public String toString() {
return "OrderRecipientTypeEnum{" +
"value=" + value +
", name='" + name + '\'' +
'}';
}
public Integer getValue() {
return value;
}
public String getName() {
return name;
}
}

View File

@@ -0,0 +1,52 @@
package cn.iocoder.mall.order.biz.enums.order;
/**
* 订单退货原因
*
* @author Sin
* @time 2019-03-20 21:17
*/
public enum OrderReturnReasonEnum {
///
/// 未发货情况
REASON_000(0, "其他"),
REASON_001(1, "拍错/勿拍/多拍"),
REASON_002(2, "缺货"),
///
/// 已发货情况
REASON_020(20, "七天无理由"),
REASON_021(21, "质量问题"),
REASON_022(22, "不想要了"),
;
// TODO: 2019-03-20 Sin 已发货情况 补全,需要对照一下 淘宝
private Integer value;
private String name;
OrderReturnReasonEnum(Integer value, String name) {
this.value = value;
this.name = name;
}
@Override
public String toString() {
return "OrderCommonReasonEnum{" +
"value=" + value +
", name=" + name +
'}';
}
public Integer getValue() {
return value;
}
public String getName() {
return name;
}}

View File

@@ -0,0 +1,36 @@
package cn.iocoder.mall.order.biz.enums.order;
/**
* 订单退货 - returnType
*
* @author Sin
* @time 2019-04-27 11:53
*/
public enum OrderReturnServiceTypeEnum {
/**
* 状态
*
* - 1、退货退款
* - 2、退款
*/
RETURN_REFUND(1, "退货退款"),
REFUND(2, "退款")
;
private final int value;
private final String name;
OrderReturnServiceTypeEnum(int value, String name) {
this.value = value;
this.name = name;
}
public int getValue() {
return value;
}
public String getName() {
return name;
}
}

View File

@@ -0,0 +1,45 @@
package cn.iocoder.mall.order.biz.enums.order;
/**
* 订单退货 status
*
* @author Sin
* @time 2019-03-30 15:56
*/
public enum OrderReturnStatusEnum {
/**
* 状态
*
* - 1、退货申请
* - 2、申请成功
* - 3、申请失败
* - 4、退货中
* - 5、已收货
* - 6、拒绝退款
*/
RETURN_APPLICATION(1, "退货申请"),
APPLICATION_SUCCESSFUL(2, "申请成功"),
APPLICATION_FAIL(3, "申请失败"),
RETURN_IN(4, "退货中"),
ORDER_RECEIPT(5, "确认收货"),
RETURN_SUCCESS(6, "退货成功"),
;
private final int value;
private final String name;
OrderReturnStatusEnum(int value, String name) {
this.value = value;
this.name = name;
}
public int getValue() {
return value;
}
public String getName() {
return name;
}
}

View File

@@ -0,0 +1,31 @@
package cn.iocoder.mall.order.biz.enums.order;
/**
* 订单退货 类型
*
* @author Sin
* @time 2019-03-30 15:42
*/
public enum OrderReturnTypeEnum {
ORDER(1, "订单"),
ORDER_ITEM(2, "订单item"),
;
private final int value;
private final String name;
OrderReturnTypeEnum(int value, String name) {
this.value = value;
this.name = name;
}
public int getValue() {
return value;
}
public String getName() {
return name;
}
}

View File

@@ -0,0 +1,38 @@
package cn.iocoder.mall.order.biz.enums.order;
/**
* 订单 - status
*
* @author Sin
* @time 2019-03-16 14:06
*/
public enum OrderStatusEnum {
WAITING_PAYMENT(1, "等待付款"),
WAIT_SHIPMENT(2, "等待发货"),
ALREADY_SHIPMENT(3, "已发货"),
COMPLETED(4, "已完成"),
CLOSED(5, "已关闭");
/**
* 状态值
*/
private Integer value;
/**
* 状态名
*/
private String name;
OrderStatusEnum(int value, String name) {
this.value = value;
this.name = name;
}
public int getValue() {
return value;
}
public String getName() {
return name;
}
}

View File

@@ -0,0 +1,16 @@
package cn.iocoder.mall.order.biz.enums.order;
/**
* 支付 AppId
*
* @author Sin
* @time 2019-04-08 19:54
*/
public class PayAppId {
/**
* 电商
*/
public static final String APP_ID_SHOP_ORDER = "POd4RC6a";
}