Compare commits
31 Commits
develop
...
261a8b4797
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
261a8b4797 | ||
| c283800915 | |||
| 483abcfd83 | |||
| 4ebe4f9ac6 | |||
| 90e28f056a | |||
| a5a10898a2 | |||
|
|
00d4e0c3e8 | ||
| 4042fd297d | |||
|
|
0ce1eae772 | ||
|
|
3497962627 | ||
|
|
15e801e426 | ||
|
|
b2e0cca804 | ||
| 22b96b6feb | |||
| fc62fa3167 | |||
| 190e0e1605 | |||
| 3fbb1383fd | |||
| 191eadbf77 | |||
|
|
7fdf546585 | ||
| b6630f3f61 | |||
| f7d4ef8e4c | |||
|
|
ef99dbe035 | ||
| e5f0d57286 | |||
| de062744b4 | |||
| 2943caf779 | |||
| 4ae13cf1e6 | |||
| 562769f9c0 | |||
| 3f674bd17a | |||
| 52839e17cc | |||
| 1555739fcd | |||
| ea780302e3 | |||
| 5dc7ab49d5 |
326
sql/mysql/order.sql
Normal file
326
sql/mysql/order.sql
Normal file
@@ -0,0 +1,326 @@
|
|||||||
|
-- 基础实体表结构 (BaseDO) 不单独建表,字段会被继承到其他表中
|
||||||
|
CREATE TABLE `tz_trade_order`
|
||||||
|
(
|
||||||
|
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '订单编号,主键自增',
|
||||||
|
`order_num` varchar(64) NOT NULL COMMENT '订单流水号',
|
||||||
|
`order_category_id` bigint NOT NULL COMMENT '订单类目id',
|
||||||
|
`order_category_name` varchar(64) NOT NULL COMMENT '订单类目名称',
|
||||||
|
`order_type` tinyint NOT NULL COMMENT '订单类型 (枚举 TradeOrderTypeEnum)',
|
||||||
|
`order_terminal` tinyint NOT NULL COMMENT '订单来源 (枚举 TerminalEnum)',
|
||||||
|
`order_status` tinyint NOT NULL COMMENT '订单状态 (枚举 TradeOrderStatusEnum)',
|
||||||
|
`user_id` bigint NOT NULL COMMENT '用户编号',
|
||||||
|
`user_ip` varchar(64) DEFAULT NULL COMMENT '用户IP',
|
||||||
|
`user_name` varchar(64) DEFAULT NULL COMMENT '用户昵称',
|
||||||
|
`user_mobile` varchar(11) DEFAULT NULL COMMENT '用户手机号',
|
||||||
|
`user_remark` varchar(512) DEFAULT NULL COMMENT '用户备注',
|
||||||
|
`finish_time` datetime DEFAULT NULL COMMENT '订单完成时间',
|
||||||
|
`cancel_time` datetime DEFAULT NULL COMMENT '订单取消时间',
|
||||||
|
`cancel_type` tinyint DEFAULT NULL COMMENT '取消类型 (枚举 TradeOrderCancelTypeEnum)',
|
||||||
|
`cancel_reason` varchar(128) DEFAULT NULL COMMENT '取消原因',
|
||||||
|
`merchant_id` bigint DEFAULT NULL COMMENT '商家编号',
|
||||||
|
`merchant_name` varchar(64) DEFAULT NULL COMMENT '商家名称',
|
||||||
|
`merchant_remark` varchar(512) DEFAULT NULL COMMENT '商家备注',
|
||||||
|
`comment_status` tinyint(1) DEFAULT NULL COMMENT '是否评价 (true-已评价, false-未评价)',
|
||||||
|
`sub_type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '预约类型(1预约 2 加急)',
|
||||||
|
`sub_time` datetime NOT NULL COMMENT '预约时间',
|
||||||
|
`expense_price` int(11) DEFAULT NULL COMMENT '商品成本(单),单位:分',
|
||||||
|
`price` int(11) DEFAULT NULL COMMENT '商品原价(单),单位:分',
|
||||||
|
`discount_price` int(11) DEFAULT NULL COMMENT '优惠金额(总),单位:分',
|
||||||
|
`delivery_price` int(11) DEFAULT NULL COMMENT '运费金额(总),单位:分',
|
||||||
|
`adjust_price` int(11) DEFAULT NULL COMMENT '订单调价(总),单位:分',
|
||||||
|
`pay_price` int(11) DEFAULT NULL COMMENT '应付金额(总),单位:分',
|
||||||
|
`live_price` int(11) DEFAULT NULL COMMENT '实收金额(总),单位:分',
|
||||||
|
`pay_order_id` bigint DEFAULT NULL COMMENT '支付订单编号',
|
||||||
|
`pay_status` tinyint(1) DEFAULT NULL COMMENT '是否已支付 (true-已支付, false-未支付)',
|
||||||
|
`pay_type` tinyint DEFAULT NULL COMMENT '支付方式(PayTypeEnum)',
|
||||||
|
`pay_time` datetime DEFAULT NULL COMMENT '付款时间',
|
||||||
|
`pay_channel_code` tinyint DEFAULT NULL COMMENT '支付渠道(PayTypeEnum)',
|
||||||
|
`delivery_type` tinyint DEFAULT NULL COMMENT '配送方式 (枚举 DeliveryTypeEnum)',
|
||||||
|
`logistics_id` bigint DEFAULT '0' COMMENT '发货物流公司编号',
|
||||||
|
`logistics_no` varchar(64) DEFAULT '' COMMENT '发货物流单号',
|
||||||
|
`delivery_time` datetime DEFAULT NULL COMMENT '发货时间',
|
||||||
|
`receive_time` datetime DEFAULT NULL COMMENT '收货时间',
|
||||||
|
`receiver_name` varchar(64) DEFAULT NULL COMMENT '收件人名称',
|
||||||
|
`receiver_mobile` varchar(20) DEFAULT NULL COMMENT '收件人手机',
|
||||||
|
`receiver_area_id` int DEFAULT NULL COMMENT '收件人地区编号',
|
||||||
|
`receiver_detail_address` varchar(512) DEFAULT NULL COMMENT '收件人详细地址',
|
||||||
|
`pick_up_store_id` bigint DEFAULT NULL COMMENT '自提门店编号',
|
||||||
|
`pick_up_verify_code` varchar(64) DEFAULT NULL COMMENT '自提核销码',
|
||||||
|
`refund_status` tinyint DEFAULT NULL COMMENT '退款状态 (枚举 TradeOrderRefundStatusEnum)',
|
||||||
|
`refund_price` int DEFAULT NULL COMMENT '退款金额,单位:分',
|
||||||
|
`refund_time` datetime DEFAULT NULL COMMENT '退款时间',
|
||||||
|
`after_sale_id` bigint DEFAULT NULL COMMENT '售后单编号',
|
||||||
|
`after_sale_status` tinyint DEFAULT NULL COMMENT '售后状态 (枚举 TradeOrderItemAfterSaleStatusEnum)',
|
||||||
|
`finance_id` bigint DEFAULT NULL COMMENT '财务单编号',
|
||||||
|
`finance_status` tinyint DEFAULT NULL COMMENT '财务状态 (枚举 TradeOrderItemFinanceEnum)',
|
||||||
|
`version` int NOT NULL DEFAULT '0' COMMENT '版本号(乐观锁)',
|
||||||
|
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`update_time` datetime DEFAULT NULL COMMENT '最后更新时间',
|
||||||
|
`creator` varchar(64) DEFAULT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) DEFAULT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_order_num` (`order_num`),
|
||||||
|
KEY `idx_user_id` (`user_id`),
|
||||||
|
KEY `idx_status` (`order_status`),
|
||||||
|
KEY `idx_pay_status` (`pay_status`)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
AUTO_INCREMENT = 2
|
||||||
|
DEFAULT CHARSET = utf8mb4
|
||||||
|
COLLATE = utf8mb4_0900_ai_ci COMMENT ='交易订单表';
|
||||||
|
|
||||||
|
|
||||||
|
-- 交易订单项表 (trade_order_item)
|
||||||
|
CREATE TABLE `tz_trade_order_item`
|
||||||
|
(
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
|
||||||
|
`user_id` bigint(20) NOT NULL COMMENT '用户编号',
|
||||||
|
`order_id` bigint(20) NOT NULL COMMENT '订单编号',
|
||||||
|
`cart_id` bigint(20) DEFAULT NULL COMMENT '购物车项编号',
|
||||||
|
`spu_id` bigint(20) NOT NULL COMMENT '商品 SPU 编号',
|
||||||
|
`spu_name` varchar(256) NOT NULL COMMENT '商品 SPU 名称',
|
||||||
|
`spu_type` tinyint(1) NOT NULL COMMENT '商品类型(1商品 2服务)',
|
||||||
|
`sku_id` bigint(20) NOT NULL COMMENT '商品 SKU 编号',
|
||||||
|
`sku_name` bigint(20) NOT NULL COMMENT '商品 SKU 名称',
|
||||||
|
`pic_url` varchar(512) NOT NULL COMMENT '商品图片',
|
||||||
|
`count` int(11) NOT NULL COMMENT '购买数量',
|
||||||
|
`unit` varchar(16) NOT NULL COMMENT '商品单位',
|
||||||
|
`expense_price` int(11) NOT NULL COMMENT '商品成本(单),单位:分',
|
||||||
|
`price` int(11) NOT NULL COMMENT '商品原价(单),单位:分',
|
||||||
|
`discount_price` int(11) NOT NULL COMMENT '优惠金额(总),单位:分',
|
||||||
|
`delivery_price` int(11) NOT NULL COMMENT '运费金额(总),单位:分',
|
||||||
|
`adjust_price` int(11) NOT NULL COMMENT '订单调价(总),单位:分',
|
||||||
|
`pay_price` int(11) NOT NULL COMMENT '应付金额(总),单位:分',
|
||||||
|
`live_price` int(11) NOT NULL COMMENT '实收金额(总),单位:分',
|
||||||
|
|
||||||
|
`serve_address` datetime NOT NULL COMMENT '服务地址',
|
||||||
|
`properties` json DEFAULT NULL COMMENT '属性数组',
|
||||||
|
`serve_info` json DEFAULT NULL COMMENT '服务信息',
|
||||||
|
`serve_ext_info` json DEFAULT NULL COMMENT '扩展服务信息,存储额外的服务相关数据',
|
||||||
|
`price_ext_info` json DEFAULT NULL COMMENT '附加费信息',
|
||||||
|
`version` int(11) DEFAULT '0' COMMENT '版本号(乐观锁)',
|
||||||
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL COMMENT '最后更新时间',
|
||||||
|
`creator` varchar(64) NOT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) NOT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `idx_order_id` (`order_id`),
|
||||||
|
KEY `idx_sku_id` (`sku_id`),
|
||||||
|
KEY `idx_user_id` (`user_id`)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8mb4 COMMENT ='交易订单项表';
|
||||||
|
|
||||||
|
|
||||||
|
-- 订单日志表 (trade_order_log)
|
||||||
|
CREATE TABLE `tz_trade_order_log`
|
||||||
|
(
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
|
||||||
|
`user_id` bigint(20) NOT NULL COMMENT '用户编号',
|
||||||
|
`user_type` tinyint(4) NOT NULL COMMENT '用户类型 (枚举 UserTypeEnum)',
|
||||||
|
`order_id` bigint(20) NOT NULL COMMENT '订单号',
|
||||||
|
`before_status` int(11) DEFAULT NULL COMMENT '操作前状态',
|
||||||
|
`after_status` int(11) DEFAULT NULL COMMENT '操作后状态',
|
||||||
|
`operate_type` tinyint(4) NOT NULL COMMENT '操作类型 (枚举 TradeOrderOperateTypeEnum)',
|
||||||
|
`content` varchar(1024) NOT NULL COMMENT '订单日志信息',
|
||||||
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL COMMENT '最后更新时间',
|
||||||
|
`creator` varchar(64) NOT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) NOT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `idx_order_id` (`order_id`),
|
||||||
|
KEY `idx_user_id` (`user_id`)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8mb4 COMMENT ='订单日志表';
|
||||||
|
|
||||||
|
-- 售后订单表 (tz_trade_after_sale)
|
||||||
|
CREATE TABLE `tz_trade_after_sale`
|
||||||
|
(
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '售后编号,主键自增',
|
||||||
|
`no` varchar(64) NOT NULL COMMENT '售后单号',
|
||||||
|
`status` tinyint(4) NOT NULL COMMENT '退款状态 (枚举 AfterSaleStatusEnum)',
|
||||||
|
`way` tinyint(4) NOT NULL COMMENT '售后方式 (枚举 AfterSaleWayEnum)',
|
||||||
|
`type` tinyint(4) NOT NULL COMMENT '售后类型 (枚举 AfterSaleTypeEnum)',
|
||||||
|
`user_id` bigint(20) NOT NULL COMMENT '用户编号',
|
||||||
|
`apply_reason` varchar(256) NOT NULL COMMENT '申请原因',
|
||||||
|
`apply_description` varchar(512) DEFAULT NULL COMMENT '补充描述',
|
||||||
|
`apply_pic_urls` json DEFAULT NULL COMMENT '补充凭证图片',
|
||||||
|
`order_id` bigint(20) NOT NULL COMMENT '交易订单编号',
|
||||||
|
`order_no` varchar(64) NOT NULL COMMENT '订单流水号',
|
||||||
|
`order_item_id` bigint(20) NOT NULL COMMENT '交易订单项编号',
|
||||||
|
`prod_id` bigint(20) NOT NULL COMMENT '商品 SPU 编号',
|
||||||
|
`prod_name` varchar(256) NOT NULL COMMENT '商品 SPU 名称',
|
||||||
|
`sku_id` bigint(20) NOT NULL COMMENT '商品 SKU 编号',
|
||||||
|
`properties` json DEFAULT NULL COMMENT '属性数组',
|
||||||
|
`pic_url` varchar(512) DEFAULT NULL COMMENT '商品图片',
|
||||||
|
`count` int(11) NOT NULL COMMENT '退货商品数量',
|
||||||
|
`audit_time` datetime DEFAULT NULL COMMENT '审批时间',
|
||||||
|
`audit_user_id` bigint(20) DEFAULT NULL COMMENT '审批人',
|
||||||
|
`audit_reason` varchar(512) DEFAULT NULL COMMENT '审批备注',
|
||||||
|
`refund_price` int(11) NOT NULL COMMENT '退款金额,单位:分',
|
||||||
|
`pay_refund_id` bigint(20) DEFAULT NULL COMMENT '支付退款编号',
|
||||||
|
`refund_time` datetime DEFAULT NULL COMMENT '退款时间',
|
||||||
|
`logistics_id` bigint(20) DEFAULT NULL COMMENT '退货物流公司编号',
|
||||||
|
`logistics_no` varchar(64) DEFAULT NULL COMMENT '退货物流单号',
|
||||||
|
`delivery_time` datetime DEFAULT NULL COMMENT '退货时间',
|
||||||
|
`receive_time` datetime DEFAULT NULL COMMENT '收货时间',
|
||||||
|
`receive_reason` varchar(512) DEFAULT NULL COMMENT '收货备注',
|
||||||
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL COMMENT '最后更新时间',
|
||||||
|
`creator` varchar(64) NOT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) NOT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_no` (`no`),
|
||||||
|
KEY `idx_user_id` (`user_id`),
|
||||||
|
KEY `idx_order_id` (`order_id`),
|
||||||
|
KEY `idx_order_item_id` (`order_item_id`),
|
||||||
|
KEY `idx_status` (`status`)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8mb4 COMMENT ='售后订单表';
|
||||||
|
|
||||||
|
-- 交易售后日志表 (tz_trade_after_sale_log)
|
||||||
|
CREATE TABLE `tz_trade_after_sale_log`
|
||||||
|
(
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
|
||||||
|
`user_id` bigint(20) NOT NULL COMMENT '用户编号',
|
||||||
|
`user_type` tinyint(4) NOT NULL COMMENT '用户类型 (枚举 UserTypeEnum)',
|
||||||
|
`after_sale_id` bigint(20) NOT NULL COMMENT '售后编号',
|
||||||
|
`before_status` tinyint(4) DEFAULT NULL COMMENT '操作前状态',
|
||||||
|
`after_status` tinyint(4) DEFAULT NULL COMMENT '操作后状态',
|
||||||
|
`operate_type` tinyint(4) NOT NULL COMMENT '操作类型 (枚举 AfterSaleOperateTypeEnum)',
|
||||||
|
`content` varchar(512) NOT NULL COMMENT '操作明细',
|
||||||
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL COMMENT '最后更新时间',
|
||||||
|
`creator` varchar(64) NOT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) NOT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `idx_after_sale_id` (`after_sale_id`),
|
||||||
|
KEY `idx_user_id` (`user_id`),
|
||||||
|
KEY `idx_operate_type` (`operate_type`)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8mb4 COMMENT ='交易售后日志表';
|
||||||
|
|
||||||
|
|
||||||
|
-- 快递公司表 (trade_delivery_express)
|
||||||
|
CREATE TABLE `tz_trade_delivery_express`
|
||||||
|
(
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号,自增',
|
||||||
|
`code` varchar(64) NOT NULL COMMENT '快递公司 code',
|
||||||
|
`name` varchar(128) NOT NULL COMMENT '快递公司名称',
|
||||||
|
`logo` varchar(512) DEFAULT NULL COMMENT '快递公司 logo',
|
||||||
|
`sort` int(11) DEFAULT NULL COMMENT '排序',
|
||||||
|
`status` tinyint(4) NOT NULL COMMENT '状态 (枚举 CommonStatusEnum)',
|
||||||
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL COMMENT '最后更新时间',
|
||||||
|
`creator` varchar(64) NOT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) NOT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_code` (`code`)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8mb4 COMMENT ='快递公司表';
|
||||||
|
|
||||||
|
-- 快递运费模板表 (trade_delivery_express_template)
|
||||||
|
CREATE TABLE `tz_trade_delivery_express_template`
|
||||||
|
(
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号,自增',
|
||||||
|
`name` varchar(128) NOT NULL COMMENT '模板名称',
|
||||||
|
`charge_mode` tinyint(4) NOT NULL COMMENT '配送计费方式 (枚举 DeliveryExpressChargeModeEnum)',
|
||||||
|
`sort` int(11) DEFAULT NULL COMMENT '排序',
|
||||||
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL COMMENT '最后更新时间',
|
||||||
|
`creator` varchar(64) NOT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) NOT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8mb4 COMMENT ='快递运费模板表';
|
||||||
|
|
||||||
|
-- 快递运费模板计费配置表 (trade_delivery_express_template_charge)
|
||||||
|
CREATE TABLE `tz_trade_delivery_express_template_charge`
|
||||||
|
(
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号,自增',
|
||||||
|
`template_id` bigint(20) NOT NULL COMMENT '配送模板编号',
|
||||||
|
`area_ids` varchar(512) NOT NULL COMMENT '配送区域编号列表',
|
||||||
|
`charge_mode` tinyint(4) NOT NULL COMMENT '配送计费方式',
|
||||||
|
`start_count` double NOT NULL COMMENT '首件数量(件数,重量,或体积)',
|
||||||
|
`start_price` int(11) NOT NULL COMMENT '起步价,单位:分',
|
||||||
|
`extra_count` double NOT NULL COMMENT '续件数量(件, 重量,或体积)',
|
||||||
|
`extra_price` int(11) NOT NULL COMMENT '额外价,单位:分',
|
||||||
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL COMMENT '最后更新时间',
|
||||||
|
`creator` varchar(64) NOT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) NOT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `idx_template_id` (`template_id`),
|
||||||
|
CONSTRAINT `fk_express_template_charge_template_id` FOREIGN KEY (`template_id`) REFERENCES `tz_trade_delivery_express_template` (`id`)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8mb4 COMMENT ='快递运费模板计费配置表';
|
||||||
|
|
||||||
|
-- 快递运费模板包邮配置表 (trade_delivery_express_template_free)
|
||||||
|
CREATE TABLE `tz_trade_delivery_express_template_free`
|
||||||
|
(
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
|
||||||
|
`template_id` bigint(20) NOT NULL COMMENT '配送模板编号',
|
||||||
|
`area_ids` varchar(512) NOT NULL COMMENT '配送区域编号列表',
|
||||||
|
`free_price` int(11) DEFAULT NULL COMMENT '包邮金额,单位:分',
|
||||||
|
`free_count` int(11) DEFAULT NULL COMMENT '包邮件数',
|
||||||
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL COMMENT '最后更新时间',
|
||||||
|
`creator` varchar(64) NOT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) NOT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `idx_template_id` (`template_id`),
|
||||||
|
CONSTRAINT `fk_express_template_free_template_id` FOREIGN KEY (`template_id`) REFERENCES `tz_trade_delivery_express_template` (`id`)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8mb4 COMMENT ='快递运费模板包邮配置表';
|
||||||
|
|
||||||
|
-- 自提门店表 (trade_delivery_pick_up_store)
|
||||||
|
CREATE TABLE `tz_trade_delivery_pick_up_store`
|
||||||
|
(
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
|
||||||
|
`name` varchar(128) NOT NULL COMMENT '门店名称',
|
||||||
|
`introduction` varchar(512) DEFAULT NULL COMMENT '门店简介',
|
||||||
|
`phone` varchar(20) NOT NULL COMMENT '门店手机',
|
||||||
|
`area_id` int(11) NOT NULL COMMENT '区域编号',
|
||||||
|
`detail_address` varchar(512) NOT NULL COMMENT '门店详细地址',
|
||||||
|
`logo` varchar(512) DEFAULT NULL COMMENT '门店 logo',
|
||||||
|
`opening_time` time NOT NULL COMMENT '营业开始时间',
|
||||||
|
`closing_time` time NOT NULL COMMENT '营业结束时间',
|
||||||
|
`latitude` double DEFAULT NULL COMMENT '纬度',
|
||||||
|
`longitude` double DEFAULT NULL COMMENT '经度',
|
||||||
|
`verify_user_ids` varchar(512) DEFAULT NULL COMMENT '核销员工用户编号数组',
|
||||||
|
`status` tinyint(4) NOT NULL COMMENT '门店状态 (枚举 CommonStatusEnum)',
|
||||||
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL COMMENT '最后更新时间',
|
||||||
|
`creator` varchar(64) NOT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) NOT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `idx_area_id` (`area_id`),
|
||||||
|
KEY `idx_status` (`status`)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8mb4 COMMENT ='自提门店表';
|
||||||
|
|
||||||
|
-- 订单预约时间修改记录表 (tz_trade_sub_log)
|
||||||
|
CREATE TABLE `tz_trade_sub_log`
|
||||||
|
(
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
|
||||||
|
`user_id` bigint(20) NOT NULL COMMENT '用户编号',
|
||||||
|
`order_id` bigint(20) NOT NULL COMMENT '订单号',
|
||||||
|
`sub_time` datetime NOT NULL COMMENT '预约时间',
|
||||||
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
`creator` varchar(64) NOT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) NOT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `idx_order_id` (`order_id`),
|
||||||
|
KEY `idx_user_id` (`user_id`)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8mb4 COMMENT ='订单预约时间修改记录表';
|
||||||
|
|
||||||
211
sql/mysql/pay.sql
Normal file
211
sql/mysql/pay.sql
Normal file
@@ -0,0 +1,211 @@
|
|||||||
|
-- 支付应用表 (tz_pay_app)
|
||||||
|
CREATE TABLE `tz_pay_app` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '应用编号,数据库自增',
|
||||||
|
`app_key` varchar(64) NOT NULL COMMENT '应用标识',
|
||||||
|
`name` varchar(128) NOT NULL COMMENT '应用名',
|
||||||
|
`status` tinyint(4) NOT NULL COMMENT '状态 (枚举 CommonStatusEnum)',
|
||||||
|
`remark` varchar(512) DEFAULT NULL COMMENT '备注',
|
||||||
|
`order_notify_url` varchar(512) DEFAULT NULL COMMENT '支付结果的回调地址',
|
||||||
|
`refund_notify_url` varchar(512) DEFAULT NULL COMMENT '退款结果的回调地址',
|
||||||
|
`transfer_notify_url` varchar(512) DEFAULT NULL COMMENT '转账结果的回调地址',
|
||||||
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL COMMENT '最后更新时间',
|
||||||
|
`creator` varchar(64) NOT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) NOT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_app_key` (`app_key`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支付应用表';
|
||||||
|
|
||||||
|
-- 支付渠道表 (tz_pay_channel)
|
||||||
|
CREATE TABLE `tz_pay_channel` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '渠道编号,数据库自增',
|
||||||
|
`code` varchar(32) NOT NULL COMMENT '渠道编码 (枚举 PayChannelEnum)',
|
||||||
|
`status` tinyint(4) NOT NULL COMMENT '状态 (枚举 CommonStatusEnum)',
|
||||||
|
`fee_rate` double DEFAULT NULL COMMENT '渠道费率,单位:百分比',
|
||||||
|
`remark` varchar(512) DEFAULT NULL COMMENT '备注',
|
||||||
|
`app_id` bigint(20) NOT NULL COMMENT '应用编号 (关联 tz_pay_app.id)',
|
||||||
|
`config` json DEFAULT NULL COMMENT '支付渠道配置',
|
||||||
|
`tenant_id` bigint(20) NOT NULL COMMENT '租户ID',
|
||||||
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL COMMENT '最后更新时间',
|
||||||
|
`creator` varchar(64) NOT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) NOT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_code_app_id` (`code`,`app_id`),
|
||||||
|
KEY `idx_app_id` (`app_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支付渠道表';
|
||||||
|
|
||||||
|
-- 支付通知日志表 (tz_pay_notify_log)
|
||||||
|
CREATE TABLE `tz_pay_notify_log` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '日志编号,自增',
|
||||||
|
`task_id` bigint(20) NOT NULL COMMENT '通知任务编号 (关联 tz_pay_notify_task.id)',
|
||||||
|
`notify_times` int(11) NOT NULL COMMENT '第几次被通知',
|
||||||
|
`response` varchar(1024) DEFAULT NULL COMMENT 'HTTP 响应结果',
|
||||||
|
`status` tinyint(4) NOT NULL COMMENT '支付通知状态 (枚举 PayNotifyStatusEnum)',
|
||||||
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL COMMENT '最后更新时间',
|
||||||
|
`creator` varchar(64) NOT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) NOT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `idx_task_id` (`task_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支付通知日志表';
|
||||||
|
|
||||||
|
-- 支付通知任务表 (tz_pay_notify_task)
|
||||||
|
CREATE TABLE `tz_pay_notify_task` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号,自增',
|
||||||
|
`app_id` bigint(20) NOT NULL COMMENT '应用编号 (关联 tz_pay_app.id)',
|
||||||
|
`type` tinyint(4) NOT NULL COMMENT '通知类型 (枚举 PayNotifyTypeEnum)',
|
||||||
|
`data_id` bigint(20) NOT NULL COMMENT '数据编号',
|
||||||
|
`merchant_order_id` varchar(64) DEFAULT NULL COMMENT '商户订单编号',
|
||||||
|
`merchant_transfer_id` varchar(64) DEFAULT NULL COMMENT '商户转账单编号',
|
||||||
|
`status` tinyint(4) NOT NULL COMMENT '通知状态 (枚举 PayNotifyStatusEnum)',
|
||||||
|
`next_notify_time` datetime DEFAULT NULL COMMENT '下一次通知时间',
|
||||||
|
`last_execute_time` datetime DEFAULT NULL COMMENT '最后一次执行时间',
|
||||||
|
`notify_times` int(11) DEFAULT NULL COMMENT '当前通知次数',
|
||||||
|
`max_notify_times` int(11) DEFAULT NULL COMMENT '最大可通知次数',
|
||||||
|
`notify_url` varchar(512) NOT NULL COMMENT '通知地址',
|
||||||
|
`tenant_id` bigint(20) NOT NULL COMMENT '租户ID',
|
||||||
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL COMMENT '最后更新时间',
|
||||||
|
`creator` varchar(64) NOT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) NOT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `idx_app_id` (`app_id`),
|
||||||
|
KEY `idx_type_data_id` (`type`,`data_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支付通知任务表';
|
||||||
|
|
||||||
|
-- 支付订单表 (tz_pay_order)
|
||||||
|
CREATE TABLE `tz_pay_order` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '订单编号,数据库自增',
|
||||||
|
`app_id` bigint(20) NOT NULL COMMENT '应用编号 (关联 tz_pay_app.id)',
|
||||||
|
`channel_id` bigint(20) NOT NULL COMMENT '渠道编号 (关联 tz_pay_channel.id)',
|
||||||
|
`channel_code` varchar(32) NOT NULL COMMENT '渠道编码 (枚举 PayChannelEnum)',
|
||||||
|
`merchant_order_id` varchar(64) NOT NULL COMMENT '商户订单编号',
|
||||||
|
`subject` varchar(256) NOT NULL COMMENT '商品标题',
|
||||||
|
`body` varchar(512) DEFAULT NULL COMMENT '商品描述信息',
|
||||||
|
`notify_url` varchar(512) DEFAULT NULL COMMENT '异步通知地址',
|
||||||
|
`price` int(11) NOT NULL COMMENT '支付金额,单位:分',
|
||||||
|
`channel_fee_rate` double DEFAULT NULL COMMENT '渠道手续费,单位:百分比',
|
||||||
|
`channel_fee_price` int(11) DEFAULT NULL COMMENT '渠道手续金额,单位:分',
|
||||||
|
`status` tinyint(4) NOT NULL COMMENT '支付状态 (枚举 PayOrderStatusEnum)',
|
||||||
|
`user_ip` varchar(32) DEFAULT NULL COMMENT '用户 IP',
|
||||||
|
`expire_time` datetime DEFAULT NULL COMMENT '订单失效时间',
|
||||||
|
`success_time` datetime DEFAULT NULL COMMENT '订单支付成功时间',
|
||||||
|
`extension_id` bigint(20) DEFAULT NULL COMMENT '支付成功的订单拓展单编号 (关联 tz_pay_order_extension.id)',
|
||||||
|
`no` varchar(64) DEFAULT NULL COMMENT '支付成功的外部订单号 (关联 tz_pay_order_extension.no)',
|
||||||
|
`refund_price` int(11) DEFAULT NULL COMMENT '退款总金额,单位:分',
|
||||||
|
`channel_user_id` varchar(128) DEFAULT NULL COMMENT '渠道用户编号',
|
||||||
|
`channel_order_no` varchar(128) DEFAULT NULL COMMENT '渠道订单号',
|
||||||
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL COMMENT '最后更新时间',
|
||||||
|
`creator` varchar(64) NOT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) NOT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_merchant_order_id_app_id` (`merchant_order_id`,`app_id`),
|
||||||
|
KEY `idx_app_id` (`app_id`),
|
||||||
|
KEY `idx_channel_id` (`channel_id`),
|
||||||
|
KEY `idx_status` (`status`),
|
||||||
|
KEY `idx_extension_id` (`extension_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支付订单表';
|
||||||
|
|
||||||
|
-- 支付订单扩展表 (tz_pay_order_extension)
|
||||||
|
CREATE TABLE `tz_pay_order_extension` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '订单拓展编号,数据库自增',
|
||||||
|
`no` varchar(64) NOT NULL COMMENT '外部订单号',
|
||||||
|
`order_id` bigint(20) NOT NULL COMMENT '订单号 (关联 tz_pay_order.id)',
|
||||||
|
`channel_id` bigint(20) NOT NULL COMMENT '渠道编号 (关联 tz_pay_channel.id)',
|
||||||
|
`channel_code` varchar(32) NOT NULL COMMENT '渠道编码',
|
||||||
|
`user_ip` varchar(32) DEFAULT NULL COMMENT '用户 IP',
|
||||||
|
`status` tinyint(4) NOT NULL COMMENT '支付状态 (枚举 PayOrderStatusEnum)',
|
||||||
|
`channel_extras` json DEFAULT NULL COMMENT '支付渠道的额外参数',
|
||||||
|
`channel_error_code` varchar(64) DEFAULT NULL COMMENT '调用渠道的错误码',
|
||||||
|
`channel_error_msg` varchar(512) DEFAULT NULL COMMENT '调用渠道报错时,错误信息',
|
||||||
|
`channel_notify_data` text DEFAULT NULL COMMENT '支付渠道的同步/异步通知的内容',
|
||||||
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL COMMENT '最后更新时间',
|
||||||
|
`creator` varchar(64) NOT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) NOT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_no` (`no`),
|
||||||
|
KEY `idx_order_id` (`order_id`),
|
||||||
|
KEY `idx_channel_id` (`channel_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支付订单扩展表';
|
||||||
|
|
||||||
|
-- 支付退款单表 (tz_pay_refund)
|
||||||
|
CREATE TABLE `tz_pay_refund` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '退款单编号,数据库自增',
|
||||||
|
`no` varchar(64) NOT NULL COMMENT '外部退款号',
|
||||||
|
`app_id` bigint(20) NOT NULL COMMENT '应用编号 (关联 tz_pay_app.id)',
|
||||||
|
`channel_id` bigint(20) NOT NULL COMMENT '渠道编号 (关联 tz_pay_channel.id)',
|
||||||
|
`channel_code` varchar(32) NOT NULL COMMENT '渠道编码 (枚举 PayChannelEnum)',
|
||||||
|
`order_id` bigint(20) NOT NULL COMMENT '订单编号 (关联 tz_pay_order.id)',
|
||||||
|
`order_no` varchar(64) NOT NULL COMMENT '支付订单编号',
|
||||||
|
`merchant_order_id` varchar(64) NOT NULL COMMENT '商户订单编号',
|
||||||
|
`merchant_refund_id` varchar(64) NOT NULL COMMENT '商户退款订单号',
|
||||||
|
`notify_url` varchar(512) DEFAULT NULL COMMENT '异步通知地址',
|
||||||
|
`status` tinyint(4) NOT NULL COMMENT '退款状态 (枚举 PayRefundStatusEnum)',
|
||||||
|
`pay_price` int(11) NOT NULL COMMENT '支付金额,单位:分',
|
||||||
|
`refund_price` int(11) NOT NULL COMMENT '退款金额,单位:分',
|
||||||
|
`reason` varchar(512) DEFAULT NULL COMMENT '退款原因',
|
||||||
|
`user_ip` varchar(32) DEFAULT NULL COMMENT '用户 IP',
|
||||||
|
`channel_order_no` varchar(128) DEFAULT NULL COMMENT '渠道订单号',
|
||||||
|
`channel_refund_no` varchar(128) DEFAULT NULL COMMENT '渠道退款单号',
|
||||||
|
`success_time` datetime DEFAULT NULL COMMENT '退款成功时间',
|
||||||
|
`channel_error_code` varchar(64) DEFAULT NULL COMMENT '调用渠道的错误码',
|
||||||
|
`channel_error_msg` varchar(512) DEFAULT NULL COMMENT '调用渠道的错误提示',
|
||||||
|
`channel_notify_data` text DEFAULT NULL COMMENT '支付渠道的同步/异步通知的内容',
|
||||||
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL COMMENT '最后更新时间',
|
||||||
|
`creator` varchar(64) NOT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) NOT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_no` (`no`),
|
||||||
|
UNIQUE KEY `uk_merchant_refund_id_app_id` (`merchant_refund_id`,`app_id`),
|
||||||
|
KEY `idx_app_id` (`app_id`),
|
||||||
|
KEY `idx_channel_id` (`channel_id`),
|
||||||
|
KEY `idx_order_id` (`order_id`),
|
||||||
|
KEY `idx_status` (`status`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支付退款单表';
|
||||||
|
|
||||||
|
-- 转账单表 (tz_pay_transfer)
|
||||||
|
CREATE TABLE `tz_pay_transfer` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
|
||||||
|
`no` varchar(64) NOT NULL COMMENT '转账单号',
|
||||||
|
`app_id` bigint(20) NOT NULL COMMENT '应用编号 (关联 tz_pay_app.id)',
|
||||||
|
`channel_id` bigint(20) NOT NULL COMMENT '转账渠道编号 (关联 tz_pay_channel.id)',
|
||||||
|
`channel_code` varchar(32) NOT NULL COMMENT '转账渠道编码 (枚举 PayChannelEnum)',
|
||||||
|
`merchant_transfer_id` varchar(64) NOT NULL COMMENT '商户转账单编号',
|
||||||
|
`type` tinyint(4) NOT NULL COMMENT '类型 (枚举 PayTransferTypeEnum)',
|
||||||
|
`subject` varchar(256) NOT NULL COMMENT '转账标题',
|
||||||
|
`price` int(11) NOT NULL COMMENT '转账金额,单位:分',
|
||||||
|
`user_name` varchar(64) DEFAULT NULL COMMENT '收款人姓名',
|
||||||
|
`status` tinyint(4) NOT NULL COMMENT '转账状态 (枚举 PayTransferStatusRespEnum)',
|
||||||
|
`success_time` datetime DEFAULT NULL COMMENT '订单转账成功时间',
|
||||||
|
`alipay_logon_id` varchar(128) DEFAULT NULL COMMENT '支付宝登录号',
|
||||||
|
`openid` varchar(128) DEFAULT NULL COMMENT '微信 openId',
|
||||||
|
`notify_url` varchar(512) DEFAULT NULL COMMENT '异步通知地址',
|
||||||
|
`user_ip` varchar(32) DEFAULT NULL COMMENT '用户 IP',
|
||||||
|
`channel_extras` json DEFAULT NULL COMMENT '渠道的额外参数',
|
||||||
|
`channel_transfer_no` varchar(128) DEFAULT NULL COMMENT '渠道转账单号',
|
||||||
|
`channel_error_code` varchar(64) DEFAULT NULL COMMENT '调用渠道的错误码',
|
||||||
|
`channel_error_msg` varchar(512) DEFAULT NULL COMMENT '调用渠道的错误提示',
|
||||||
|
`channel_notify_data` text DEFAULT NULL COMMENT '渠道的同步/异步通知的内容',
|
||||||
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL COMMENT '最后更新时间',
|
||||||
|
`creator` varchar(64) NOT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) NOT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_no` (`no`),
|
||||||
|
UNIQUE KEY `uk_merchant_transfer_id_app_id` (`merchant_transfer_id`,`app_id`),
|
||||||
|
KEY `idx_app_id` (`app_id`),
|
||||||
|
KEY `idx_channel_id` (`channel_id`),
|
||||||
|
KEY `idx_status` (`status`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='转账单表';
|
||||||
90
sql/mysql/user.sql
Normal file
90
sql/mysql/user.sql
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
-- 登录用户表 (tz_login_user) 后续拓展用户信息表
|
||||||
|
CREATE TABLE `tz_user_login`
|
||||||
|
(
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
|
||||||
|
`mobile` varchar(11) NOT NULL COMMENT '手机',
|
||||||
|
`password` varchar(128) NOT NULL COMMENT '加密后的密码',
|
||||||
|
`status` tinyint(4) NOT NULL COMMENT '帐号状态 (枚举 CommonStatusEnum)',
|
||||||
|
`register_ip` varchar(32) DEFAULT NULL COMMENT '注册 IP',
|
||||||
|
`register_terminal` tinyint(4) DEFAULT NULL COMMENT '注册渠道 (枚举 TerminalEnum)',
|
||||||
|
`register_date` datetime DEFAULT NULL COMMENT '注册时间',
|
||||||
|
`login_ip` varchar(32) DEFAULT NULL COMMENT '最后登录IP',
|
||||||
|
`login_date` datetime DEFAULT NULL COMMENT '最后登录时间',
|
||||||
|
`login_terminal` varchar(32) DEFAULT NULL COMMENT '最后登录设备',
|
||||||
|
`nickname` varchar(64) DEFAULT NULL COMMENT '用户昵称',
|
||||||
|
`avatar` varchar(512) DEFAULT NULL COMMENT '用户头像',
|
||||||
|
`remark` varchar(512) DEFAULT NULL COMMENT '用户备注',
|
||||||
|
`tenant_id` bigint(20) NOT NULL COMMENT '租户ID',
|
||||||
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL COMMENT '最后更新时间',
|
||||||
|
`creator` varchar(64) NOT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) NOT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_mobile` (`mobile`)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8mb4 COMMENT ='登录用户表';
|
||||||
|
|
||||||
|
-- 会员信息表 (tz_user_member)
|
||||||
|
CREATE TABLE `tz_user_member`
|
||||||
|
(
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
|
||||||
|
`name` varchar(64) DEFAULT NULL COMMENT '真实名字',
|
||||||
|
`sex` tinyint DEFAULT NULL COMMENT '性别 (枚举 SexEnum)',
|
||||||
|
`birthday` datetime DEFAULT NULL COMMENT '出生日期',
|
||||||
|
`area_id` int DEFAULT NULL COMMENT '所在地 (关联 Area.id 字段)',
|
||||||
|
`point` int DEFAULT NULL COMMENT '积分',
|
||||||
|
`tag_ids` varchar(512) DEFAULT NULL COMMENT '会员标签列表,以逗号分隔',
|
||||||
|
`level_id` bigint DEFAULT NULL COMMENT '会员级别编号 (关联 MemberLevelDO.id 字段)',
|
||||||
|
`experience` int DEFAULT NULL COMMENT '会员经验',
|
||||||
|
`group_id` bigint DEFAULT NULL COMMENT '用户分组编号 (关联 MemberGroupDO.id 字段)',
|
||||||
|
`tenant_id` bigint(20) NOT NULL COMMENT '租户ID',
|
||||||
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL COMMENT '最后更新时间',
|
||||||
|
`creator` varchar(64) NOT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) NOT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8mb4 COMMENT ='会员信息表';
|
||||||
|
|
||||||
|
-- 会员地址表 (tz_user_member_address)
|
||||||
|
CREATE TABLE `tz_user_member_address`
|
||||||
|
(
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户编号',
|
||||||
|
`name` varchar(128) DEFAULT NULL COMMENT '收件人名称',
|
||||||
|
`mobile` varchar(11) DEFAULT NULL COMMENT '手机号',
|
||||||
|
`areaId` bigint(20) DEFAULT NULL COMMENT '地区编号',
|
||||||
|
`detailAddress` varchar(255) DEFAULT NULL COMMENT '收件详细地址',
|
||||||
|
`defaultStatus` int DEFAULT NULL COMMENT '是否默认',
|
||||||
|
`tenant_id` bigint(20) NOT NULL COMMENT '租户ID',
|
||||||
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL COMMENT '最后更新时间',
|
||||||
|
`creator` varchar(64) NOT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) NOT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8mb4 COMMENT ='会员地址表';
|
||||||
|
|
||||||
|
-- 会员等级表 (tz_user_member_level)
|
||||||
|
CREATE TABLE `tz_user_member_level`
|
||||||
|
(
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||||
|
`level_name` varchar(64) DEFAULT NULL COMMENT '等级名称',
|
||||||
|
`level` int DEFAULT NULL COMMENT '性别 (枚举 SexEnum)',
|
||||||
|
`experience` int DEFAULT NULL COMMENT '会员经验',
|
||||||
|
`discount_percent` int DEFAULT NULL COMMENT '享受折扣',
|
||||||
|
`icon` varchar(128) DEFAULT NULL COMMENT '等级图标',
|
||||||
|
`background_url` varchar(128) DEFAULT NULL COMMENT '等级背景图',
|
||||||
|
`status` int DEFAULT NULL COMMENT '状态',
|
||||||
|
`tenant_id` bigint(20) NOT NULL COMMENT '租户ID',
|
||||||
|
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL COMMENT '最后更新时间',
|
||||||
|
`creator` varchar(64) NOT NULL COMMENT '创建者',
|
||||||
|
`updater` varchar(64) NOT NULL COMMENT '更新者',
|
||||||
|
`deleted` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除',
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE = InnoDB
|
||||||
|
DEFAULT CHARSET = utf8mb4 COMMENT ='会员等级表';
|
||||||
|
|
||||||
@@ -158,6 +158,47 @@
|
|||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-trade-api</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-module-trade</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-pay-api</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-sdk-payment</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-member-api</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-module-pay</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-sdk-payment</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-product-api</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Spring 核心 -->
|
<!-- Spring 核心 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<!-- 用于生成自定义的 Spring @ConfigurationProperties 配置类的说明文件 -->
|
<!-- 用于生成自定义的 Spring @ConfigurationProperties 配置类的说明文件 -->
|
||||||
|
|||||||
@@ -14,6 +14,9 @@
|
|||||||
<module>tashow-infra-api</module>
|
<module>tashow-infra-api</module>
|
||||||
<module>tashow-system-api</module>
|
<module>tashow-system-api</module>
|
||||||
<module>tashow-product-api</module>
|
<module>tashow-product-api</module>
|
||||||
|
<module>tashow-trade-api</module>
|
||||||
|
<module>tashow-pay-api</module>
|
||||||
|
<module>tashow-member-api</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
40
tashow-feign/tashow-member-api/pom.xml
Normal file
40
tashow-feign/tashow-member-api/pom.xml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-feign</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>tashow-member-api</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>${project.artifactId}</name>
|
||||||
|
<description>
|
||||||
|
member 模块 API,暴露给其它模块调用
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 参数校验 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- RPC 远程调用相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.tashow.cloud.memberapi.api.address;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.pojo.CommonResult;
|
||||||
|
import com.tashow.cloud.memberapi.api.address.dto.MemberAddressRespDTO;
|
||||||
|
import com.tashow.cloud.memberapi.enums.ApiConstants;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RPC 服务 - 用户收件地址
|
||||||
|
*/
|
||||||
|
@FeignClient(name = ApiConstants.NAME)
|
||||||
|
public interface MemberAddressApi {
|
||||||
|
|
||||||
|
String PREFIX = ApiConstants.PREFIX + "/address";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得用户收件地址
|
||||||
|
* @param id 收件地址编号
|
||||||
|
* @param userId 用户编号
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(PREFIX + "/get")
|
||||||
|
CommonResult<MemberAddressRespDTO> getAddress(@RequestParam("id") Long id,
|
||||||
|
@RequestParam("userId") Long userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得用户默认收件地址
|
||||||
|
* @param userId 用户编号
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(PREFIX + "/get-default")
|
||||||
|
CommonResult<MemberAddressRespDTO> getDefaultAddress(@RequestParam("userId") Long userId);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.tashow.cloud.memberapi.api.address.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RPC 服务 - 用户收件地址 Response DTO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MemberAddressRespDTO {
|
||||||
|
|
||||||
|
//编号
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
//用户编号
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
//收件人名称
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
//手机号
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
//地区编号
|
||||||
|
private Integer areaId;
|
||||||
|
|
||||||
|
//收件详细地址
|
||||||
|
private String detailAddress;
|
||||||
|
|
||||||
|
//是否默认
|
||||||
|
private Boolean defaultStatus;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
/**
|
||||||
|
* member API 包,定义暴露给其它模块的 API
|
||||||
|
*/
|
||||||
|
package com.tashow.cloud.memberapi.api;
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package com.tashow.cloud.memberapi.api.user;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.pojo.CommonResult;
|
||||||
|
import com.tashow.cloud.memberapi.api.user.dto.MemberUserRespDTO;
|
||||||
|
import com.tashow.cloud.memberapi.enums.ApiConstants;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static com.tashow.cloud.common.util.collection.CollectionUtils.convertMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RPC 服务 - 会员用户
|
||||||
|
*/
|
||||||
|
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||||
|
public interface MemberUserApi {
|
||||||
|
|
||||||
|
String PREFIX = ApiConstants.PREFIX + "/user";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得会员用户 Map
|
||||||
|
*
|
||||||
|
* @param ids 用户编号的数组
|
||||||
|
* @return 会员用户 Map
|
||||||
|
*/
|
||||||
|
default Map<Long, MemberUserRespDTO> getUserMap(Collection<Long> ids) {
|
||||||
|
List<MemberUserRespDTO> list = getUserList(ids).getCheckedData();
|
||||||
|
return convertMap(list, MemberUserRespDTO::getId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得会员用户信息
|
||||||
|
* @param id 编号
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(PREFIX + "/get")
|
||||||
|
CommonResult<MemberUserRespDTO> getUser(@RequestParam("id") Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得会员用户信息们
|
||||||
|
* @param ids 用户编号的数组
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(PREFIX + "/list")
|
||||||
|
CommonResult<List<MemberUserRespDTO>> getUserList(@RequestParam("ids") Collection<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基于用户昵称,模糊匹配用户列表
|
||||||
|
* @param nickname 用户昵称,模糊匹配
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(PREFIX + "/list-by-nickname")
|
||||||
|
CommonResult<List<MemberUserRespDTO>> getUserListByNickname(@RequestParam("nickname") String nickname);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基于手机号,精准匹配用户
|
||||||
|
* @param mobile 基于手机号,精准匹配用户
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(PREFIX + "/get-by-mobile")
|
||||||
|
CommonResult<MemberUserRespDTO> getUserByMobile(@RequestParam("mobile") String mobile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验用户是否存在
|
||||||
|
* @param id 用户编号
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(PREFIX + "/valid")
|
||||||
|
CommonResult<Boolean> validateUser(@RequestParam("id") Long id);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.tashow.cloud.memberapi.api.user.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RPC 服务 - 用户信息 Response DTO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MemberUserRespDTO {
|
||||||
|
|
||||||
|
//用户编号
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
//昵称
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
//帐号状态
|
||||||
|
private Integer status; // 参见 CommonStatusEnum 枚举
|
||||||
|
|
||||||
|
//用户头像
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
//手机号
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
//创建时间
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.tashow.cloud.memberapi.enums;
|
||||||
|
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.enums.RpcConstants;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API 相关的枚举
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
public class ApiConstants {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务名
|
||||||
|
*
|
||||||
|
* 注意,需要保证和 spring.application.name 保持一致
|
||||||
|
*/
|
||||||
|
public static final String NAME = "member-server";
|
||||||
|
|
||||||
|
public static final String PREFIX = RpcConstants.RPC_API_PREFIX + "/member";
|
||||||
|
|
||||||
|
public static final String VERSION = "1.0.0";
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.tashow.cloud.memberapi.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Member 字典类型的枚举类
|
||||||
|
*
|
||||||
|
* @author owen
|
||||||
|
*/
|
||||||
|
public interface DictTypeConstants {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员经验记录 - 业务类型
|
||||||
|
*/
|
||||||
|
String MEMBER_EXPERIENCE_BIZ_TYPE = "member_experience_biz_type";
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.tashow.cloud.memberapi.enums;
|
||||||
|
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.exception.ErrorCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Member 错误码枚举类
|
||||||
|
* <p>
|
||||||
|
* member 系统,使用 1-004-000-000 段
|
||||||
|
*/
|
||||||
|
public interface ErrorCodeConstants {
|
||||||
|
|
||||||
|
// ========== 用户相关 1-004-001-000 ============
|
||||||
|
ErrorCode USER_NOT_EXISTS = new ErrorCode(1_004_001_000, "用户不存在");
|
||||||
|
ErrorCode USER_MOBILE_NOT_EXISTS = new ErrorCode(1_004_001_001, "手机号未注册用户");
|
||||||
|
ErrorCode USER_MOBILE_USED = new ErrorCode(1_004_001_002, "修改手机失败,该手机号({})已经被使用");
|
||||||
|
ErrorCode USER_POINT_NOT_ENOUGH = new ErrorCode(1_004_001_003, "用户积分余额不足");
|
||||||
|
|
||||||
|
// ========== AUTH 模块 1-004-003-000 ==========
|
||||||
|
ErrorCode AUTH_LOGIN_BAD_CREDENTIALS = new ErrorCode(1_004_003_000, "登录失败,账号密码不正确");
|
||||||
|
ErrorCode AUTH_LOGIN_USER_DISABLED = new ErrorCode(1_004_003_001, "登录失败,账号被禁用");
|
||||||
|
ErrorCode AUTH_SOCIAL_USER_NOT_FOUND = new ErrorCode(1_004_003_005, "登录失败,解析不到三方登录信息");
|
||||||
|
ErrorCode AUTH_MOBILE_USED = new ErrorCode(1_004_003_007, "手机号已经被使用");
|
||||||
|
|
||||||
|
// ========== 用户收件地址 1-004-004-000 ==========
|
||||||
|
ErrorCode ADDRESS_NOT_EXISTS = new ErrorCode(1_004_004_000, "用户收件地址不存在");
|
||||||
|
|
||||||
|
//========== 用户标签 1-004-006-000 ==========
|
||||||
|
ErrorCode TAG_NOT_EXISTS = new ErrorCode(1_004_006_000, "用户标签不存在");
|
||||||
|
ErrorCode TAG_NAME_EXISTS = new ErrorCode(1_004_006_001, "用户标签已经存在");
|
||||||
|
ErrorCode TAG_HAS_USER = new ErrorCode(1_004_006_002, "用户标签下存在用户,无法删除");
|
||||||
|
|
||||||
|
//========== 积分配置 1-004-007-000 ==========
|
||||||
|
|
||||||
|
//========== 积分记录 1-004-008-000 ==========
|
||||||
|
ErrorCode POINT_RECORD_BIZ_NOT_SUPPORT = new ErrorCode(1_004_008_000, "用户积分记录业务类型不支持");
|
||||||
|
|
||||||
|
//========== 签到配置 1-004-009-000 ==========
|
||||||
|
ErrorCode SIGN_IN_CONFIG_NOT_EXISTS = new ErrorCode(1_004_009_000, "签到天数规则不存在");
|
||||||
|
ErrorCode SIGN_IN_CONFIG_EXISTS = new ErrorCode(1_004_009_001, "签到天数规则已存在");
|
||||||
|
|
||||||
|
//========== 签到配置 1-004-010-000 ==========
|
||||||
|
ErrorCode SIGN_IN_RECORD_TODAY_EXISTS = new ErrorCode(1_004_010_000, "今日已签到,请勿重复签到");
|
||||||
|
|
||||||
|
//========== 用户等级 1-004-011-000 ==========
|
||||||
|
ErrorCode LEVEL_NOT_EXISTS = new ErrorCode(1_004_011_000, "用户等级不存在");
|
||||||
|
ErrorCode LEVEL_NAME_EXISTS = new ErrorCode(1_004_011_001, "用户等级名称[{}]已被使用");
|
||||||
|
ErrorCode LEVEL_VALUE_EXISTS = new ErrorCode(1_004_011_002, "用户等级值[{}]已被[{}]使用");
|
||||||
|
ErrorCode LEVEL_EXPERIENCE_MIN = new ErrorCode(1_004_011_003, "升级经验必须大于上一个等级[{}]设置的升级经验[{}]");
|
||||||
|
ErrorCode LEVEL_EXPERIENCE_MAX = new ErrorCode(1_004_011_004, "升级经验必须小于下一个等级[{}]设置的升级经验[{}]");
|
||||||
|
ErrorCode LEVEL_HAS_USER = new ErrorCode(1_004_011_005, "用户等级下存在用户,无法删除");
|
||||||
|
|
||||||
|
ErrorCode EXPERIENCE_BIZ_NOT_SUPPORT = new ErrorCode(1_004_011_201, "用户经验业务类型不支持");
|
||||||
|
|
||||||
|
//========== 用户分组 1-004-012-000 ==========
|
||||||
|
ErrorCode GROUP_NOT_EXISTS = new ErrorCode(1_004_012_000, "用户分组不存在");
|
||||||
|
ErrorCode GROUP_HAS_USER = new ErrorCode(1_004_012_001, "用户分组下存在用户,无法删除");
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.tashow.cloud.memberapi.enums;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.EnumUtil;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员经验 - 业务类型
|
||||||
|
*
|
||||||
|
* @author owen
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum MemberExperienceBizTypeEnum {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理员调整、邀请新用户、下单、退单、签到、抽奖
|
||||||
|
*/
|
||||||
|
ADMIN(0, "管理员调整", "管理员调整获得 {} 经验", true),
|
||||||
|
INVITE_REGISTER(1, "邀新奖励", "邀请好友获得 {} 经验", true),
|
||||||
|
SIGN_IN(4, "签到奖励", "签到获得 {} 经验", true),
|
||||||
|
LOTTERY(5, "抽奖奖励", "抽奖获得 {} 经验", true),
|
||||||
|
ORDER_GIVE(11, "下单奖励", "下单获得 {} 经验", true),
|
||||||
|
ORDER_GIVE_CANCEL(12, "下单奖励(整单取消)", "取消订单获得 {} 经验", false), // ORDER_GIVE 的取消
|
||||||
|
ORDER_GIVE_CANCEL_ITEM(13, "下单奖励(单个退款)", "退款订单获得 {} 经验", false), // ORDER_GIVE 的取消
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务类型
|
||||||
|
*/
|
||||||
|
private final int type;
|
||||||
|
/**
|
||||||
|
* 标题
|
||||||
|
*/
|
||||||
|
private final String title;
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
private final String description;
|
||||||
|
/**
|
||||||
|
* 是否为扣减积分
|
||||||
|
*/
|
||||||
|
private final boolean add;
|
||||||
|
|
||||||
|
public static MemberExperienceBizTypeEnum getByType(Integer type) {
|
||||||
|
return EnumUtil.getBy(MemberExperienceBizTypeEnum.class,
|
||||||
|
e -> Objects.equals(type, e.getType()));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package com.tashow.cloud.memberapi.enums.point;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.EnumUtil;
|
||||||
|
import com.tashow.cloud.common.core.ArrayValuable;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员积分的业务类型枚举
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum MemberPointBizTypeEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
|
SIGN(1, "签到", "签到获得 {} 积分", true),
|
||||||
|
ADMIN(2, "管理员修改", "管理员修改 {} 积分", true),
|
||||||
|
|
||||||
|
ORDER_USE(11, "订单积分抵扣", "下单使用 {} 积分", false), // 下单时,扣减积分
|
||||||
|
ORDER_USE_CANCEL(12, "订单积分抵扣(整单取消)", "订单取消,退还 {} 积分", true), // ORDER_USE 的取消
|
||||||
|
ORDER_USE_CANCEL_ITEM(13, "订单积分抵扣(单个退款)", "订单退款,退还 {} 积分", true), // ORDER_USE 的取消
|
||||||
|
|
||||||
|
ORDER_GIVE(21, "订单积分奖励", "下单获得 {} 积分", true), // 支付订单时,赠送积分
|
||||||
|
ORDER_GIVE_CANCEL(22, "订单积分奖励(整单取消)", "订单取消,退还 {} 积分", false), // ORDER_GIVE 的取消
|
||||||
|
ORDER_GIVE_CANCEL_ITEM(23, "订单积分奖励(单个退款)", "订单退款,扣除赠送的 {} 积分", false) // ORDER_GIVE 的取消
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private final Integer type;
|
||||||
|
/**
|
||||||
|
* 名字
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
private final String description;
|
||||||
|
/**
|
||||||
|
* 是否为扣减积分
|
||||||
|
*/
|
||||||
|
private final boolean add;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer[] array() {
|
||||||
|
return new Integer[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static MemberPointBizTypeEnum getByType(Integer type) {
|
||||||
|
return EnumUtil.getBy(MemberPointBizTypeEnum.class,
|
||||||
|
e -> Objects.equals(type, e.getType()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
/**
|
||||||
|
* 消息队列的消息
|
||||||
|
*/
|
||||||
|
package com.tashow.cloud.memberapi.message;
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.tashow.cloud.memberapi.message.user;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员用户创建消息
|
||||||
|
*
|
||||||
|
* @author owen
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MemberUserCreateMessage {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户编号
|
||||||
|
*/
|
||||||
|
@NotNull(message = "用户编号不能为空")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
}
|
||||||
44
tashow-feign/tashow-pay-api/pom.xml
Normal file
44
tashow-feign/tashow-pay-api/pom.xml
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-feign</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>tashow-pay-api</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>${project.artifactId}</name>
|
||||||
|
<description>
|
||||||
|
pay 模块 API,暴露给其它模块调用
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 参数校验 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- RPC 远程调用相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-sdk-payment</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.tashow.cloud.payapi.api.notify.dto;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付单的通知 Request DTO
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PayOrderNotifyReqDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户订单编号
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "商户订单号不能为空")
|
||||||
|
private String merchantOrderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付订单编号
|
||||||
|
*/
|
||||||
|
@NotNull(message = "支付订单编号不能为空")
|
||||||
|
private Long payOrderId;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.tashow.cloud.payapi.api.notify.dto;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款单的通知 Request DTO
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PayRefundNotifyReqDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户退款单编号
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "商户退款单编号不能为空")
|
||||||
|
private String merchantOrderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付退款编号
|
||||||
|
*/
|
||||||
|
@NotNull(message = "支付退款编号不能为空")
|
||||||
|
private Long payRefundId;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.tashow.cloud.payapi.api.notify.dto;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转账单的通知 Request DTO
|
||||||
|
*
|
||||||
|
* @author jason
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PayTransferNotifyReqDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户转账单号
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "商户转账单号不能为空")
|
||||||
|
private String merchantTransferId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转账订单编号
|
||||||
|
*/
|
||||||
|
@NotNull(message = "转账订单编号不能为空")
|
||||||
|
private Long payTransferId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.tashow.cloud.payapi.api.order;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.pojo.CommonResult;
|
||||||
|
import com.tashow.cloud.payapi.api.order.dto.PayOrderCreateReqDTO;
|
||||||
|
import com.tashow.cloud.payapi.enums.ApiConstants;
|
||||||
|
import com.tashow.cloud.sdk.payment.dto.order.PayOrderRespDTO;
|
||||||
|
import jakarta.annotation.security.PermitAll;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RPC 服务 - 支付单
|
||||||
|
*/
|
||||||
|
@FeignClient(name = ApiConstants.NAME) //
|
||||||
|
public interface PayOrderApi {
|
||||||
|
|
||||||
|
String PREFIX = ApiConstants.PREFIX + "/order";
|
||||||
|
|
||||||
|
/*创建支付单*/
|
||||||
|
@PostMapping(PREFIX + "/create")
|
||||||
|
CommonResult<Long> createOrder(@Valid @RequestBody PayOrderCreateReqDTO reqDTO);
|
||||||
|
|
||||||
|
/*获得支付单*/
|
||||||
|
@GetMapping(PREFIX + "/get")
|
||||||
|
@PermitAll
|
||||||
|
CommonResult<PayOrderRespDTO> getOrder(@RequestParam("id") Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新支付订单价格
|
||||||
|
* @param id 支付单编号
|
||||||
|
* @param payPrice 支付单价格
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PutMapping(PREFIX + "/update-price")
|
||||||
|
CommonResult<Boolean> updatePayOrderPrice(@RequestParam("id") Long id ,//支付单编号
|
||||||
|
@RequestParam("payPrice") Integer payPrice);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
package com.tashow.cloud.payapi.api.order.dto;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.DecimalMin;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付单创建 Request DTO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PayOrderCreateReqDTO implements Serializable {
|
||||||
|
|
||||||
|
public static final int SUBJECT_MAX_LENGTH = 32;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用标识
|
||||||
|
*/
|
||||||
|
@NotNull(message = "应用标识不能为空")
|
||||||
|
private String appKey;
|
||||||
|
/**
|
||||||
|
* 用户 IP
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "用户 IP 不能为空")
|
||||||
|
private String userIp;
|
||||||
|
|
||||||
|
// ========== 商户相关字段 ==========
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户订单编号
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "商户订单编号不能为空")
|
||||||
|
private String merchantOrderId;
|
||||||
|
/**
|
||||||
|
* 商品标题
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "商品标题不能为空")
|
||||||
|
@Length(max = SUBJECT_MAX_LENGTH, message = "商品标题不能超过 32")
|
||||||
|
private String subject;
|
||||||
|
/**
|
||||||
|
* 商品描述
|
||||||
|
*/
|
||||||
|
@Length(max = 128, message = "商品描述信息长度不能超过128")
|
||||||
|
private String body;
|
||||||
|
|
||||||
|
// ========== 订单相关字段 ==========
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付金额,单位:分
|
||||||
|
*/
|
||||||
|
@NotNull(message = "支付金额不能为空")
|
||||||
|
@DecimalMin(value = "0", inclusive = false, message = "支付金额必须大于零")
|
||||||
|
private Integer price;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付过期时间
|
||||||
|
*/
|
||||||
|
@NotNull(message = "支付过期时间不能为空")
|
||||||
|
private LocalDateTime expireTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package com.tashow.cloud.payapi.api.order.dto;
|
||||||
|
|
||||||
|
import com.tashow.cloud.payapi.enums.order.PayOrderStatusEnum;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付单信息 Response DTO
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PayOrderRespDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单编号,数据库自增
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 渠道编码
|
||||||
|
*
|
||||||
|
* 枚举 PayChannelEnum
|
||||||
|
*/
|
||||||
|
private String channelCode;
|
||||||
|
|
||||||
|
// ========== 商户相关字段 ==========
|
||||||
|
/**
|
||||||
|
* 商户订单编号
|
||||||
|
* 例如说,内部系统 A 的订单号。需要保证每个 PayMerchantDO 唯一
|
||||||
|
*/
|
||||||
|
private String merchantOrderId;
|
||||||
|
|
||||||
|
// ========== 订单相关字段 ==========
|
||||||
|
/**
|
||||||
|
* 支付金额,单位:分
|
||||||
|
*/
|
||||||
|
private Integer price;
|
||||||
|
/**
|
||||||
|
* 支付状态
|
||||||
|
*
|
||||||
|
* 枚举 {@link PayOrderStatusEnum}
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
// ========== 渠道相关字段 ==========
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.tashow.cloud.payapi.api.refund;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.pojo.CommonResult;
|
||||||
|
import com.tashow.cloud.payapi.api.refund.dto.PayRefundCreateReqDTO;
|
||||||
|
import com.tashow.cloud.payapi.api.refund.dto.PayRefundRespDTO;
|
||||||
|
import com.tashow.cloud.payapi.enums.ApiConstants;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RPC 服务 - 退款单
|
||||||
|
*/
|
||||||
|
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||||
|
public interface PayRefundApi {
|
||||||
|
|
||||||
|
String PREFIX = ApiConstants.PREFIX + "/refund";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建退款单
|
||||||
|
* @param reqDTO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(PREFIX + "/create")
|
||||||
|
CommonResult<Long> createRefund(@Valid @RequestBody PayRefundCreateReqDTO reqDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得退款单
|
||||||
|
* @param id 退款单编号
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(PREFIX + "/get")
|
||||||
|
CommonResult<PayRefundRespDTO> getRefund(@RequestParam("id") Long id);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package com.tashow.cloud.payapi.api.refund.dto;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.Min;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款单创建 Request DTO
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PayRefundCreateReqDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用标识
|
||||||
|
*/
|
||||||
|
@NotNull(message = "应用标识不能为空")
|
||||||
|
private String appKey;
|
||||||
|
/**
|
||||||
|
* 用户 IP
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "用户 IP 不能为空")
|
||||||
|
private String userIp;
|
||||||
|
|
||||||
|
// ========== 商户相关字段 ==========
|
||||||
|
/**
|
||||||
|
* 商户订单编号
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "商户订单编号不能为空")
|
||||||
|
private String merchantOrderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户退款编号
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "商户退款编号不能为空")
|
||||||
|
private String merchantRefundId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款描述
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "退款描述不能为空")
|
||||||
|
@Length(max = 128, message = "退款描述长度不能超过 128")
|
||||||
|
private String reason;
|
||||||
|
|
||||||
|
// ========== 订单相关字段 ==========
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款金额,单位:分
|
||||||
|
*/
|
||||||
|
@NotNull(message = "退款金额不能为空")
|
||||||
|
@Min(value = 1, message = "退款金额必须大于零")
|
||||||
|
private Integer price;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.tashow.cloud.payapi.api.refund.dto;
|
||||||
|
|
||||||
|
import com.tashow.cloud.payapi.enums.refund.PayRefundStatusEnum;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款单信息 Response DTO
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PayRefundRespDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款单编号
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
// ========== 退款相关字段 ==========
|
||||||
|
/**
|
||||||
|
* 退款状态
|
||||||
|
*
|
||||||
|
* 枚举 {@link PayRefundStatusEnum}
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
/**
|
||||||
|
* 退款金额,单位:分
|
||||||
|
*/
|
||||||
|
private Integer refundPrice;
|
||||||
|
|
||||||
|
// ========== 商户相关字段 ==========
|
||||||
|
/**
|
||||||
|
* 商户订单编号
|
||||||
|
*/
|
||||||
|
private String merchantOrderId;
|
||||||
|
/**
|
||||||
|
* 退款成功时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime successTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.tashow.cloud.payapi.api.transfer;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.pojo.CommonResult;
|
||||||
|
import com.tashow.cloud.payapi.api.transfer.dto.PayTransferCreateReqDTO;
|
||||||
|
import com.tashow.cloud.payapi.enums.ApiConstants;
|
||||||
|
import com.tashow.cloud.sdk.payment.dto.transfer.PayTransferRespDTO;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RPC 服务 - 转账单
|
||||||
|
*/
|
||||||
|
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||||
|
public interface PayTransferApi {
|
||||||
|
|
||||||
|
String PREFIX = ApiConstants.PREFIX + "/transfer";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建转账单
|
||||||
|
* @param reqDTO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(PREFIX + "/create")
|
||||||
|
CommonResult<Long> createTransfer(@Valid @RequestBody PayTransferCreateReqDTO reqDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得转账单
|
||||||
|
* @param id 转账单编号
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(PREFIX + "/get")
|
||||||
|
CommonResult<PayTransferRespDTO> getTransfer(@RequestParam("id") Long id);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package com.tashow.cloud.payapi.api.transfer.dto;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.validation.InEnum;
|
||||||
|
import com.tashow.cloud.sdk.payment.enums.transfer.PayTransferTypeEnum;
|
||||||
|
import jakarta.validation.constraints.Min;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转账单创建 Request DTO
|
||||||
|
*
|
||||||
|
* @author jason
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PayTransferCreateReqDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用标识
|
||||||
|
*/
|
||||||
|
@NotNull(message = "应用标识不能为空")
|
||||||
|
private String appKey;
|
||||||
|
|
||||||
|
@NotEmpty(message = "转账渠道不能为空")
|
||||||
|
private String channelCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转账渠道的额外参数
|
||||||
|
*/
|
||||||
|
private Map<String, String> channelExtras;
|
||||||
|
|
||||||
|
@NotEmpty(message = "用户 IP 不能为空")
|
||||||
|
private String userIp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
@NotNull(message = "转账类型不能为空")
|
||||||
|
@InEnum(PayTransferTypeEnum.class)
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户转账单编号
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "商户转账单编号能为空")
|
||||||
|
private String merchantTransferId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转账金额,单位:分
|
||||||
|
*/
|
||||||
|
@Min(value = 1, message = "转账金额必须大于零")
|
||||||
|
@NotNull(message = "转账金额不能为空")
|
||||||
|
private Integer price;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转账标题
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "转账标题不能为空")
|
||||||
|
private String subject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收款人姓名
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "收款人姓名不能为空", groups = {PayTransferTypeEnum.Alipay.class})
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
@NotBlank(message = "支付宝登录号不能为空", groups = {PayTransferTypeEnum.Alipay.class})
|
||||||
|
private String alipayLogonId;
|
||||||
|
|
||||||
|
// ========== 微信转账相关字段 ==========
|
||||||
|
@NotBlank(message = "微信 openId 不能为空", groups = {PayTransferTypeEnum.WxPay.class})
|
||||||
|
private String openid;
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.tashow.cloud.payapi.api.transfer.dto;
|
||||||
|
|
||||||
|
import com.tashow.cloud.payapi.enums.transfer.PayTransferStatusEnum;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PayTransferRespDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编号
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转账单号
|
||||||
|
*/
|
||||||
|
private String no;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转账金额,单位:分
|
||||||
|
*/
|
||||||
|
private Integer price;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转账状态
|
||||||
|
*
|
||||||
|
* 枚举 {@link PayTransferStatusEnum}
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.tashow.cloud.payapi.api.wallet;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.pojo.CommonResult;
|
||||||
|
import com.tashow.cloud.payapi.api.wallet.dto.PayWalletAddBalanceReqDTO;
|
||||||
|
import com.tashow.cloud.payapi.enums.ApiConstants;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RPC 服务 - 钱包
|
||||||
|
*/
|
||||||
|
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||||
|
public interface PayWalletApi {
|
||||||
|
|
||||||
|
String PREFIX = ApiConstants.PREFIX + "/wallet";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加钱包余额
|
||||||
|
* @param reqDTO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(PREFIX + "/add-balance")
|
||||||
|
CommonResult<Boolean> addWalletBalance(@Valid @RequestBody PayWalletAddBalanceReqDTO reqDTO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.tashow.cloud.payapi.api.wallet.dto;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.enums.UserTypeEnum;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 钱包余额增加 Request DTO
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PayWalletAddBalanceReqDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户编号
|
||||||
|
*
|
||||||
|
* 关联 MemberUserDO 的 id 属性,或者 AdminUserDO 的 id 属性
|
||||||
|
*/
|
||||||
|
@NotNull(message = "用户编号不能为空")
|
||||||
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 用户类型
|
||||||
|
*
|
||||||
|
* 关联 {@link UserTypeEnum}
|
||||||
|
*/
|
||||||
|
@NotNull(message = "用户类型不能为空")
|
||||||
|
private Integer userType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联业务分类
|
||||||
|
*/
|
||||||
|
@NotNull(message = "关联业务分类不能为空")
|
||||||
|
private Integer bizType;
|
||||||
|
/**
|
||||||
|
* 关联业务编号
|
||||||
|
*/
|
||||||
|
@NotNull(message = "关联业务编号不能为空")
|
||||||
|
private String bizId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易金额,单位分
|
||||||
|
*
|
||||||
|
* 正值表示余额增加,负值表示余额减少
|
||||||
|
*/
|
||||||
|
@NotNull(message = "交易金额不能为空")
|
||||||
|
private Integer price;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.tashow.cloud.payapi.enums;
|
||||||
|
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.enums.RpcConstants;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API 相关的枚举
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
public class ApiConstants {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务名
|
||||||
|
*
|
||||||
|
* 注意,需要保证和 spring.application.name 保持一致
|
||||||
|
*/
|
||||||
|
public static final String NAME = "pay-server";
|
||||||
|
|
||||||
|
public static final String PREFIX = RpcConstants.RPC_API_PREFIX + "/pay";
|
||||||
|
|
||||||
|
public static final String VERSION = "1.0.0";
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.tashow.cloud.payapi.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pay 字典类型的枚举类
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
public interface DictTypeConstants {
|
||||||
|
|
||||||
|
String CHANNEL_CODE = "pay_channel_code"; // 支付渠道编码
|
||||||
|
|
||||||
|
String ORDER_STATUS = "pay_order_status"; // 支付渠道
|
||||||
|
|
||||||
|
String REFUND_STATUS = "pay_order_status"; // 退款状态
|
||||||
|
|
||||||
|
String NOTIFY_STATUS = "pay_notify_status"; // 回调状态
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
package com.tashow.cloud.payapi.enums;
|
||||||
|
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.exception.ErrorCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pay 错误码 Core 枚举类
|
||||||
|
*
|
||||||
|
* pay 系统,使用 1-007-000-000 段
|
||||||
|
*/
|
||||||
|
public interface ErrorCodeConstants {
|
||||||
|
|
||||||
|
// ========== APP 模块 1-007-000-000 ==========
|
||||||
|
ErrorCode APP_NOT_FOUND = new ErrorCode(1_007_000_000, "App 不存在");
|
||||||
|
ErrorCode APP_IS_DISABLE = new ErrorCode(1_007_000_002, "App 已经被禁用");
|
||||||
|
ErrorCode APP_EXIST_ORDER_CANT_DELETE = new ErrorCode(1_007_000_003, "支付应用存在支付订单,无法删除");
|
||||||
|
ErrorCode APP_EXIST_REFUND_CANT_DELETE = new ErrorCode(1_007_000_004, "支付应用存在退款订单,无法删除");
|
||||||
|
ErrorCode APP_KEY_EXISTS = new ErrorCode(1_007_000_005, "支付应用标识已经存在");
|
||||||
|
|
||||||
|
// ========== CHANNEL 模块 1-007-001-000 ==========
|
||||||
|
ErrorCode CHANNEL_NOT_FOUND = new ErrorCode(1_007_001_000, "支付渠道的配置不存在");
|
||||||
|
ErrorCode CHANNEL_IS_DISABLE = new ErrorCode(1_007_001_001, "支付渠道已经禁用");
|
||||||
|
ErrorCode CHANNEL_EXIST_SAME_CHANNEL_ERROR = new ErrorCode(1_007_001_004, "已存在相同的渠道");
|
||||||
|
|
||||||
|
// ========== ORDER 模块 1-007-002-000 ==========
|
||||||
|
ErrorCode PAY_ORDER_NOT_FOUND = new ErrorCode(1_007_002_000, "支付订单不存在");
|
||||||
|
ErrorCode PAY_ORDER_STATUS_IS_NOT_WAITING = new ErrorCode(1_007_002_001, "支付订单不处于待支付");
|
||||||
|
ErrorCode PAY_ORDER_STATUS_IS_SUCCESS = new ErrorCode(1_007_002_002, "订单已支付,请刷新页面");
|
||||||
|
ErrorCode PAY_ORDER_IS_EXPIRED = new ErrorCode(1_007_002_003, "支付订单已经过期");
|
||||||
|
ErrorCode PAY_ORDER_SUBMIT_CHANNEL_ERROR = new ErrorCode(1_007_002_004, "发起支付报错,错误码:{},错误提示:{}");
|
||||||
|
ErrorCode PAY_ORDER_REFUND_FAIL_STATUS_ERROR = new ErrorCode(1_007_002_005, "支付订单退款失败,原因:状态不是已支付或已退款");
|
||||||
|
|
||||||
|
// ========== ORDER 模块(拓展单) 1-007-003-000 ==========
|
||||||
|
ErrorCode PAY_ORDER_EXTENSION_NOT_FOUND = new ErrorCode(1_007_003_000, "支付交易拓展单不存在");
|
||||||
|
ErrorCode PAY_ORDER_EXTENSION_STATUS_IS_NOT_WAITING = new ErrorCode(1_007_003_001, "支付交易拓展单不处于待支付");
|
||||||
|
ErrorCode PAY_ORDER_EXTENSION_IS_PAID = new ErrorCode(1_007_003_002, "订单已支付,请等待支付结果");
|
||||||
|
|
||||||
|
// ========== 支付模块(退款) 1-007-006-000 ==========
|
||||||
|
ErrorCode REFUND_PRICE_EXCEED = new ErrorCode(1_007_006_000, "退款金额超过订单可退款金额");
|
||||||
|
ErrorCode REFUND_HAS_REFUNDING = new ErrorCode(1_007_006_002, "已经有退款在处理中");
|
||||||
|
ErrorCode REFUND_EXISTS = new ErrorCode(1_007_006_003, "已经存在退款单");
|
||||||
|
ErrorCode REFUND_NOT_FOUND = new ErrorCode(1_007_006_004, "支付退款单不存在");
|
||||||
|
ErrorCode REFUND_STATUS_IS_NOT_WAITING = new ErrorCode(1_007_006_005, "支付退款单不处于待退款");
|
||||||
|
|
||||||
|
// ========== 钱包模块 1-007-007-000 ==========
|
||||||
|
ErrorCode WALLET_NOT_FOUND = new ErrorCode(1_007_007_000, "用户钱包不存在");
|
||||||
|
ErrorCode WALLET_BALANCE_NOT_ENOUGH = new ErrorCode(1_007_007_001, "钱包余额不足");
|
||||||
|
ErrorCode WALLET_TRANSACTION_NOT_FOUND = new ErrorCode(1_007_007_002, "未找到对应的钱包交易");
|
||||||
|
ErrorCode WALLET_REFUND_EXIST = new ErrorCode(1_007_007_003, "已经存在钱包退款");
|
||||||
|
ErrorCode WALLET_FREEZE_PRICE_NOT_ENOUGH = new ErrorCode(1_007_007_004, "钱包冻结余额不足");
|
||||||
|
|
||||||
|
// ========== 钱包充值模块 1-007-008-000 ==========
|
||||||
|
ErrorCode WALLET_RECHARGE_NOT_FOUND = new ErrorCode(1_007_008_000, "钱包充值记录不存在");
|
||||||
|
ErrorCode WALLET_RECHARGE_UPDATE_PAID_STATUS_NOT_UNPAID = new ErrorCode(1_007_008_001, "钱包充值更新支付状态失败,钱包充值记录不是【未支付】状态");
|
||||||
|
ErrorCode WALLET_RECHARGE_UPDATE_PAID_PAY_ORDER_ID_ERROR = new ErrorCode(1_007_008_002, "钱包充值更新支付状态失败,支付单编号不匹配");
|
||||||
|
ErrorCode WALLET_RECHARGE_UPDATE_PAID_PAY_ORDER_STATUS_NOT_SUCCESS = new ErrorCode(1_007_008_003, "钱包充值更新支付状态失败,支付单状态不是【支付成功】状态");
|
||||||
|
ErrorCode WALLET_RECHARGE_UPDATE_PAID_PAY_PRICE_NOT_MATCH = new ErrorCode(1_007_008_004, "钱包充值更新支付状态失败,支付单金额不匹配");
|
||||||
|
ErrorCode WALLET_RECHARGE_REFUND_FAIL_NOT_PAID = new ErrorCode(1_007_008_005, "钱包发起退款失败,钱包充值订单未支付");
|
||||||
|
ErrorCode WALLET_RECHARGE_REFUND_FAIL_REFUNDED = new ErrorCode(1_007_008_006, "钱包发起退款失败,钱包充值订单已退款");
|
||||||
|
ErrorCode WALLET_RECHARGE_REFUND_BALANCE_NOT_ENOUGH = new ErrorCode(1_007_008_007, "钱包发起退款失败,钱包余额不足");
|
||||||
|
ErrorCode WALLET_RECHARGE_REFUND_FAIL_REFUND_ORDER_ID_ERROR = new ErrorCode(1_007_008_008, "钱包退款更新失败,钱包退款单编号不匹配");
|
||||||
|
ErrorCode WALLET_RECHARGE_REFUND_FAIL_REFUND_NOT_FOUND = new ErrorCode(1_007_008_009, "钱包退款更新失败,退款订单不存在");
|
||||||
|
ErrorCode WALLET_RECHARGE_REFUND_FAIL_REFUND_PRICE_NOT_MATCH = new ErrorCode(1_007_008_010, "钱包退款更新失败,退款单金额不匹配");
|
||||||
|
ErrorCode WALLET_RECHARGE_PACKAGE_NOT_FOUND = new ErrorCode(1_007_008_011, "钱包充值套餐不存在");
|
||||||
|
ErrorCode WALLET_RECHARGE_PACKAGE_IS_DISABLE = new ErrorCode(1_007_008_012, "钱包充值套餐已禁用");
|
||||||
|
ErrorCode WALLET_RECHARGE_PACKAGE_NAME_EXISTS = new ErrorCode(1_007_008_013, "钱包充值套餐名称已存在");
|
||||||
|
|
||||||
|
// ========== 转账模块 1-007-009-000 ==========
|
||||||
|
ErrorCode PAY_TRANSFER_SUBMIT_CHANNEL_ERROR = new ErrorCode(1_007_009_000, "发起转账报错,错误码:{},错误提示:{}");
|
||||||
|
ErrorCode PAY_TRANSFER_NOT_FOUND = new ErrorCode(1_007_009_001, "转账单不存在");
|
||||||
|
ErrorCode PAY_SAME_MERCHANT_TRANSFER_TYPE_NOT_MATCH = new ErrorCode(1_007_009_002, "两次相同转账请求的类型不匹配");
|
||||||
|
ErrorCode PAY_SAME_MERCHANT_TRANSFER_PRICE_NOT_MATCH = new ErrorCode(1_007_009_003, "两次相同转账请求的金额不匹配");
|
||||||
|
ErrorCode PAY_MERCHANT_TRANSFER_EXISTS = new ErrorCode(1_007_009_004, "该笔业务的转账已经发起,请查询转账订单相关状态");
|
||||||
|
ErrorCode PAY_TRANSFER_STATUS_IS_NOT_WAITING = new ErrorCode(1_007_009_005, "转账单不处于待转账");
|
||||||
|
ErrorCode PAY_TRANSFER_STATUS_IS_NOT_PENDING = new ErrorCode(1_007_009_006, "转账单不处于待转账或转账中");
|
||||||
|
|
||||||
|
// ========== 示例订单 1-007-900-000 ==========
|
||||||
|
ErrorCode DEMO_ORDER_NOT_FOUND = new ErrorCode(1_007_900_000, "示例订单不存在");
|
||||||
|
ErrorCode DEMO_ORDER_UPDATE_PAID_STATUS_NOT_UNPAID = new ErrorCode(1_007_900_001, "示例订单更新支付状态失败,订单不是【未支付】状态");
|
||||||
|
ErrorCode DEMO_ORDER_UPDATE_PAID_FAIL_PAY_ORDER_ID_ERROR = new ErrorCode(1_007_900_002, "示例订单更新支付状态失败,支付单编号不匹配");
|
||||||
|
ErrorCode DEMO_ORDER_UPDATE_PAID_FAIL_PAY_ORDER_STATUS_NOT_SUCCESS = new ErrorCode(1_007_900_003, "示例订单更新支付状态失败,支付单状态不是【支付成功】状态");
|
||||||
|
ErrorCode DEMO_ORDER_UPDATE_PAID_FAIL_PAY_PRICE_NOT_MATCH = new ErrorCode(1_007_900_004, "示例订单更新支付状态失败,支付单金额不匹配");
|
||||||
|
ErrorCode DEMO_ORDER_REFUND_FAIL_NOT_PAID = new ErrorCode(1_007_900_005, "发起退款失败,示例订单未支付");
|
||||||
|
ErrorCode DEMO_ORDER_REFUND_FAIL_REFUNDED = new ErrorCode(1_007_900_006, "发起退款失败,示例订单已退款");
|
||||||
|
ErrorCode DEMO_ORDER_REFUND_FAIL_REFUND_NOT_FOUND = new ErrorCode(1_007_900_007, "发起退款失败,退款订单不存在");
|
||||||
|
ErrorCode DEMO_ORDER_REFUND_FAIL_REFUND_NOT_SUCCESS = new ErrorCode(1_007_900_008, "发起退款失败,退款订单未退款成功");
|
||||||
|
ErrorCode DEMO_ORDER_REFUND_FAIL_REFUND_ORDER_ID_ERROR = new ErrorCode(1_007_900_009, "发起退款失败,退款单编号不匹配");
|
||||||
|
ErrorCode DEMO_ORDER_REFUND_FAIL_REFUND_PRICE_NOT_MATCH = new ErrorCode(1_007_900_010, "发起退款失败,退款单金额不匹配");
|
||||||
|
|
||||||
|
// ========== 示例转账订单 1-007-901-001 ==========
|
||||||
|
ErrorCode DEMO_TRANSFER_NOT_FOUND = new ErrorCode(1_007_901_001, "示例转账单不存在");
|
||||||
|
ErrorCode DEMO_TRANSFER_FAIL_TRANSFER_ID_ERROR = new ErrorCode(1_007_901_002, "转账失败,转账单编号不匹配");
|
||||||
|
ErrorCode DEMO_TRANSFER_FAIL_PRICE_NOT_MATCH = new ErrorCode(1_007_901_003, "转账失败,转账单金额不匹配");
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.tashow.cloud.payapi.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通知模板枚举类
|
||||||
|
*
|
||||||
|
* @author HUIHUI
|
||||||
|
*/
|
||||||
|
public interface MessageTemplateConstants {
|
||||||
|
|
||||||
|
// ======================= 小程序订阅消息 =======================
|
||||||
|
|
||||||
|
String WXA_WALLET_RECHARGER_PAID = "充值成功通知";
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.tashow.cloud.payapi.enums.notify;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付通知状态枚举
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum PayNotifyStatusEnum {
|
||||||
|
|
||||||
|
WAITING(0, "等待通知"),
|
||||||
|
SUCCESS(10, "通知成功"),
|
||||||
|
FAILURE(20, "通知失败"), // 多次尝试,彻底失败
|
||||||
|
REQUEST_SUCCESS(21, "请求成功,但是结果失败"),
|
||||||
|
REQUEST_FAILURE(22, "请求失败"),
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private final Integer status;
|
||||||
|
/**
|
||||||
|
* 名字
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.tashow.cloud.payapi.enums.notify;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付通知类型
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum PayNotifyTypeEnum {
|
||||||
|
|
||||||
|
ORDER(1, "支付单"),
|
||||||
|
REFUND(2, "退款单"),
|
||||||
|
TRANSFER(3, "转账单")
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private final Integer type;
|
||||||
|
/**
|
||||||
|
* 名字
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package com.tashow.cloud.payapi.enums.order;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.core.ArrayValuable;
|
||||||
|
import com.tashow.cloud.common.util.object.ObjectUtils;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付订单的状态枚举
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum PayOrderStatusEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
|
WAITING(0, "未支付"),
|
||||||
|
SUCCESS(10, "支付成功"),
|
||||||
|
REFUND(20, "已退款"),
|
||||||
|
CLOSED(30, "支付关闭"), // 注意:全部退款后,还是 REFUND 状态
|
||||||
|
;
|
||||||
|
|
||||||
|
private final Integer status;
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer[] array() {
|
||||||
|
return new Integer[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否等待支付
|
||||||
|
*
|
||||||
|
* @param status 状态
|
||||||
|
* @return 是否等待支付
|
||||||
|
*/
|
||||||
|
public static boolean isWaiting(Integer status) {
|
||||||
|
return Objects.equals(status, WAITING.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否支付成功
|
||||||
|
*
|
||||||
|
* @param status 状态
|
||||||
|
* @return 是否支付成功
|
||||||
|
*/
|
||||||
|
public static boolean isSuccess(Integer status) {
|
||||||
|
return Objects.equals(status, SUCCESS.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否支付成功或者已退款
|
||||||
|
*
|
||||||
|
* @param status 状态
|
||||||
|
* @return 是否支付成功或者已退款
|
||||||
|
*/
|
||||||
|
public static boolean isSuccessOrRefund(Integer status) {
|
||||||
|
return ObjectUtils.equalsAny(status,
|
||||||
|
SUCCESS.getStatus(), REFUND.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否支付关闭
|
||||||
|
*
|
||||||
|
* @param status 状态
|
||||||
|
* @return 是否支付关闭
|
||||||
|
*/
|
||||||
|
public static boolean isClosed(Integer status) {
|
||||||
|
return Objects.equals(status, CLOSED.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.tashow.cloud.payapi.enums.refund;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 渠道的退款状态枚举
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum PayRefundStatusEnum {
|
||||||
|
|
||||||
|
WAITING(0, "未退款"),
|
||||||
|
SUCCESS(10, "退款成功"),
|
||||||
|
FAILURE(20, "退款失败");
|
||||||
|
|
||||||
|
private final Integer status;
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
public static boolean isSuccess(Integer status) {
|
||||||
|
return Objects.equals(status, SUCCESS.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isFailure(Integer status) {
|
||||||
|
return Objects.equals(status, FAILURE.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.tashow.cloud.payapi.enums.transfer;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author jason
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum PayTransferStatusEnum {
|
||||||
|
|
||||||
|
WAITING(0, "等待转账"),
|
||||||
|
/**
|
||||||
|
* TODO 转账到银行卡. 会有T+0 T+1 到账的请情况。 还未实现
|
||||||
|
*/
|
||||||
|
IN_PROGRESS(10, "转账进行中"),
|
||||||
|
|
||||||
|
SUCCESS(20, "转账成功"),
|
||||||
|
/**
|
||||||
|
* 转账关闭 (失败,或者其它情况) // TODO 改成 转账失败状态
|
||||||
|
*/
|
||||||
|
CLOSED(30, "转账关闭");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private final Integer status;
|
||||||
|
/**
|
||||||
|
* 状态名
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
public static boolean isSuccess(Integer status) {
|
||||||
|
return Objects.equals(status, SUCCESS.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isClosed(Integer status) {
|
||||||
|
return Objects.equals(status, CLOSED.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isWaiting(Integer status) {
|
||||||
|
return Objects.equals(status, WAITING.getStatus());
|
||||||
|
}
|
||||||
|
public static boolean isInProgress(Integer status) {
|
||||||
|
return Objects.equals(status, IN_PROGRESS.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否处于待转账或者转账中的状态
|
||||||
|
* @param status 状态
|
||||||
|
*/
|
||||||
|
public static boolean isPendingStatus(Integer status) {
|
||||||
|
return Objects.equals(status, WAITING.getStatus()) || Objects.equals(status, IN_PROGRESS.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.tashow.cloud.payapi.enums.transfer;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
|
import com.tashow.cloud.common.core.ArrayValuable;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转账类型枚举
|
||||||
|
*
|
||||||
|
* @author jason
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum PayTransferTypeEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
|
ALIPAY_BALANCE(1, "支付宝余额"),
|
||||||
|
WX_BALANCE(2, "微信余额"),
|
||||||
|
BANK_CARD(3, "银行卡"),
|
||||||
|
WALLET_BALANCE(4, "钱包余额");
|
||||||
|
|
||||||
|
public interface WxPay {
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface Alipay {
|
||||||
|
}
|
||||||
|
|
||||||
|
private final Integer type;
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(PayTransferTypeEnum::getType).toArray(Integer[]::new);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer[] array() {
|
||||||
|
return ARRAYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static PayTransferTypeEnum typeOf(Integer type) {
|
||||||
|
return ArrayUtil.firstMatch(item -> item.getType().equals(type), values());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package com.tashow.cloud.productapi.api.product;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.pojo.CommonResult;
|
||||||
|
import com.tashow.cloud.common.pojo.PageResult;
|
||||||
|
import com.tashow.cloud.productapi.api.product.dto.ProdDO;
|
||||||
|
import com.tashow.cloud.productapi.api.product.vo.prod.ProdListVO;
|
||||||
|
import com.tashow.cloud.productapi.api.product.vo.prod.ProdPageReqVO;
|
||||||
|
import com.tashow.cloud.productapi.api.product.vo.prod.ProdServiceVO;
|
||||||
|
import com.tashow.cloud.productapi.enums.ApiConstants;
|
||||||
|
import jakarta.annotation.security.PermitAll;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||||
|
/** RPC 服务 - 参数配置 */
|
||||||
|
public interface ProdApi {
|
||||||
|
|
||||||
|
String PREFIX = ApiConstants.PREFIX + "/prod";
|
||||||
|
/**
|
||||||
|
* 获取商品详情
|
||||||
|
*
|
||||||
|
* @param id 商品id
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
|
||||||
|
@GetMapping(PREFIX + "/getProdInfo")
|
||||||
|
@PermitAll
|
||||||
|
CommonResult<ProdDO> getProdInfo(@RequestParam(value = "id", required = false) Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取商品服务配置
|
||||||
|
*
|
||||||
|
* @param id 商品id
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
@GetMapping(PREFIX + "/getProdService")
|
||||||
|
ProdServiceVO getProdService(@RequestParam(value = "id", required = false) Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得商品分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 商品分页
|
||||||
|
*/
|
||||||
|
@GetMapping(PREFIX + "/getProdPage")
|
||||||
|
PageResult<ProdListVO> getProdPage(ProdPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.tashow.cloud.productapi.api.product;
|
||||||
|
|
||||||
|
import com.tashow.cloud.productapi.api.product.dto.CategoryDO;
|
||||||
|
import com.tashow.cloud.productapi.api.product.dto.ShopDetailDO;
|
||||||
|
import com.tashow.cloud.productapi.enums.ApiConstants;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||||
|
/** RPC 服务 - 参数配置 */
|
||||||
|
public interface ShopDetailApi {
|
||||||
|
|
||||||
|
String PREFIX = ApiConstants.PREFIX + "/shop";
|
||||||
|
|
||||||
|
@GetMapping(PREFIX + "/getShopInfo")
|
||||||
|
ShopDetailDO getShopInfo(@RequestParam(value = "id", required = false) Long id);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -12,7 +12,6 @@ import java.util.List;
|
|||||||
* @author 芋道源码
|
* @author 芋道源码
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
|
||||||
public class CategoryDto {
|
public class CategoryDto {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -70,6 +70,10 @@ public class ProdListVO {
|
|||||||
* 还剩多少天
|
* 还剩多少天
|
||||||
*/
|
*/
|
||||||
private Long remainingDays;
|
private Long remainingDays;
|
||||||
|
/**
|
||||||
|
* 图片
|
||||||
|
*/
|
||||||
|
private String pic;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 审核备注
|
* 审核备注
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class ApiConstants {
|
|||||||
*/
|
*/
|
||||||
public static final String NAME = "product-server";
|
public static final String NAME = "product-server";
|
||||||
|
|
||||||
public static final String PREFIX = RpcConstants.RPC_API_PREFIX + "/infra";
|
public static final String PREFIX = RpcConstants.RPC_API_PREFIX + "/product";
|
||||||
|
|
||||||
public static final String VERSION = "1.0.0";
|
public static final String VERSION = "1.0.0";
|
||||||
|
|
||||||
|
|||||||
40
tashow-feign/tashow-trade-api/pom.xml
Normal file
40
tashow-feign/tashow-trade-api/pom.xml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-feign</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>tashow-trade-api</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>${project.artifactId}</name>
|
||||||
|
<description>
|
||||||
|
trade 模块 API,暴露给其它模块调用
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 参数校验 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- RPC 远程调用相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.api.order;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.pojo.CommonResult;
|
||||||
|
import com.tashow.cloud.tradeapi.api.order.dto.TradeOrderRespDTO;
|
||||||
|
import com.tashow.cloud.tradeapi.enums.ApiConstants;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@FeignClient(name = ApiConstants.NAME)
|
||||||
|
public interface TradeOrderApi {
|
||||||
|
|
||||||
|
String PREFIX = ApiConstants.PREFIX + "/order";
|
||||||
|
|
||||||
|
/*获得订单列表*/
|
||||||
|
@GetMapping(PREFIX + "/order/list")
|
||||||
|
CommonResult<List<TradeOrderRespDTO>> getOrderList(@RequestParam("ids") Collection<Long> ids);
|
||||||
|
|
||||||
|
/*获得订单*/
|
||||||
|
@GetMapping(PREFIX + "/get")
|
||||||
|
CommonResult<TradeOrderRespDTO> getOrder(@RequestParam("id") Long id);
|
||||||
|
|
||||||
|
@PutMapping(PREFIX + "/cancel-paid")
|
||||||
|
CommonResult<Boolean> cancelPaidOrder(@RequestParam("userId") Long userId,
|
||||||
|
@RequestParam("orderId") Long orderId,
|
||||||
|
@RequestParam("cancelType") Integer cancelType);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.api.order.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单信息 Response DTO
|
||||||
|
* RPC 服务 - 订单信息 Response DTO
|
||||||
|
* @author HUIHUI
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TradeOrderRespDTO {
|
||||||
|
|
||||||
|
// ========== 订单基本信息 ==========
|
||||||
|
|
||||||
|
//订单编号
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
//订单流水号
|
||||||
|
private String no;
|
||||||
|
|
||||||
|
//订单类型
|
||||||
|
private Integer type; // 参见 TradeOrderTypeEnum 枚举
|
||||||
|
|
||||||
|
//订单来源
|
||||||
|
private Integer terminal; // 参见 TerminalEnum 枚举
|
||||||
|
|
||||||
|
//用户编号
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
//用户 IP
|
||||||
|
private String userIp;
|
||||||
|
|
||||||
|
//用户备注
|
||||||
|
private String userRemark;
|
||||||
|
|
||||||
|
//订单状态
|
||||||
|
private Integer status; // 参见 TradeOrderStatusEnum 枚举
|
||||||
|
|
||||||
|
//购买的商品数量
|
||||||
|
private Integer productCount;
|
||||||
|
|
||||||
|
//订单完成时间
|
||||||
|
private LocalDateTime finishTime;
|
||||||
|
|
||||||
|
//订单取消时间
|
||||||
|
private LocalDateTime cancelTime;
|
||||||
|
|
||||||
|
//取消类型
|
||||||
|
private Integer cancelType; // 参见 TradeOrderCancelTypeEnum 枚举
|
||||||
|
|
||||||
|
//商家备注
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
//是否评价
|
||||||
|
private Boolean commentStatus;
|
||||||
|
|
||||||
|
// ========== 价格 + 支付基本信息 ==========
|
||||||
|
|
||||||
|
//支付订单编号
|
||||||
|
private Long payOrderId;
|
||||||
|
|
||||||
|
//是否已支付
|
||||||
|
private Boolean payStatus;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.api;
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums;
|
||||||
|
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.enums.RpcConstants;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API 相关的枚举
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
public class ApiConstants {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务名
|
||||||
|
*
|
||||||
|
* 注意,需要保证和 spring.application.name 保持一致
|
||||||
|
*/
|
||||||
|
public static final String NAME = "trade-server";
|
||||||
|
|
||||||
|
public static final String PREFIX = RpcConstants.RPC_API_PREFIX + "/trade";
|
||||||
|
|
||||||
|
public static final String VERSION = "1.0.0";
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Trade 字典类型的枚举类
|
||||||
|
*
|
||||||
|
* @author owen
|
||||||
|
*/
|
||||||
|
public interface DictTypeConstants {
|
||||||
|
|
||||||
|
String BROKERAGE_WITHDRAW_STATUS = "brokerage_withdraw_status"; // 佣金提现状态
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums;
|
||||||
|
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.exception.ErrorCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Trade 错误码枚举类
|
||||||
|
* trade 系统,使用 1-011-000-000 段
|
||||||
|
*
|
||||||
|
* @author LeeYan9
|
||||||
|
* @since 2022-08-26
|
||||||
|
*/
|
||||||
|
public interface ErrorCodeConstants {
|
||||||
|
|
||||||
|
// ========== Order 模块 1-011-000-000 ==========
|
||||||
|
ErrorCode ORDER_ITEM_NOT_FOUND = new ErrorCode(1_011_000_010, "交易订单项不存在");
|
||||||
|
ErrorCode ORDER_NOT_FOUND = new ErrorCode(1_011_000_011, "交易订单不存在");
|
||||||
|
ErrorCode ORDER_ITEM_UPDATE_AFTER_SALE_STATUS_FAIL = new ErrorCode(1_011_000_012, "交易订单项更新售后状态失败,请重试");
|
||||||
|
ErrorCode ORDER_UPDATE_UNWAITACCEPT_FAIL = new ErrorCode(1_011_000_012, "交易订单更新状态失败,当前订单不处于待验收状态");
|
||||||
|
ErrorCode ORDER_UPDATE_PAID_STATUS_NOT_UNPAID = new ErrorCode(1_011_000_013, "交易订单更新支付状态失败,订单不是【未支付】状态");
|
||||||
|
ErrorCode ORDER_UPDATE_PAID_FAIL_PAY_ORDER_ID_ERROR = new ErrorCode(1_011_000_014, "交易订单更新支付状态失败,支付单编号不匹配");
|
||||||
|
ErrorCode ORDER_UPDATE_PAID_FAIL_PAY_ORDER_STATUS_NOT_SUCCESS = new ErrorCode(1_011_000_015, "交易订单更新支付状态失败,支付单状态不是【支付成功】状态");
|
||||||
|
ErrorCode ORDER_UPDATE_PAID_FAIL_PAY_PRICE_NOT_MATCH = new ErrorCode(1_011_000_016, "交易订单更新支付状态失败,支付单金额不匹配");
|
||||||
|
ErrorCode ORDER_DELIVERY_FAIL_STATUS_NOT_UNDELIVERED = new ErrorCode(1_011_000_017, "交易订单发货失败,订单不是【待发货】状态");
|
||||||
|
ErrorCode ORDER_RECEIVE_FAIL_STATUS_NOT_DELIVERED = new ErrorCode(1_011_000_018, "交易订单收货失败,订单不是【待收货】状态");
|
||||||
|
ErrorCode ORDER_COMMENT_FAIL_STATUS_NOT_COMPLETED = new ErrorCode(1_011_000_019, "创建交易订单项的评价失败,订单不是【已完成】状态");
|
||||||
|
ErrorCode ORDER_COMMENT_STATUS_NOT_FALSE = new ErrorCode(1_011_000_020, "创建交易订单项的评价失败,订单已评价");
|
||||||
|
ErrorCode ORDER_DELIVERY_FAIL_REFUND_STATUS_NOT_NONE = new ErrorCode(1_011_000_021, "交易订单发货失败,订单已退款或部分退款");
|
||||||
|
ErrorCode ORDER_DELIVERY_FAIL_COMBINATION_RECORD_STATUS_NOT_SUCCESS = new ErrorCode(1_011_000_022, "交易订单发货失败,拼团未成功");
|
||||||
|
ErrorCode ORDER_DELIVERY_FAIL_BARGAIN_RECORD_STATUS_NOT_SUCCESS = new ErrorCode(1_011_000_023, "交易订单发货失败,砍价未成功");
|
||||||
|
ErrorCode ORDER_DELIVERY_FAIL_DELIVERY_TYPE_NOT_EXPRESS = new ErrorCode(1_011_000_024, "交易订单发货失败,发货类型不是快递");
|
||||||
|
ErrorCode ORDER_CANCEL_FAIL_STATUS_NOT_UNPAID = new ErrorCode(1_011_000_025, "交易订单取消失败,订单不是【待支付】状态");
|
||||||
|
ErrorCode ORDER_UPDATE_PRICE_FAIL_PAID = new ErrorCode(1_011_000_026, "支付订单调价失败,原因:支付订单已付款,不能调价");
|
||||||
|
ErrorCode ORDER_UPDATE_PRICE_FAIL_ALREADY = new ErrorCode(1_011_000_027, "支付订单调价失败,原因:已经修改过价格");
|
||||||
|
ErrorCode ORDER_UPDATE_PRICE_FAIL_PRICE_ERROR = new ErrorCode(1_011_000_028, "支付订单调价失败,原因:调整后支付价格不能小于 0.01 元");
|
||||||
|
ErrorCode ORDER_DELETE_FAIL_STATUS_NOT_CANCEL = new ErrorCode(1_011_000_029, "交易订单删除失败,订单不是【已取消】状态");
|
||||||
|
ErrorCode ORDER_RECEIVE_FAIL_DELIVERY_TYPE_NOT_PICK_UP = new ErrorCode(1_011_000_030, "交易订单自提失败,收货方式不是【用户自提】");
|
||||||
|
ErrorCode ORDER_UPDATE_ADDRESS_FAIL_STATUS_NOT_DELIVERED = new ErrorCode(1_011_000_031, "交易订单修改收货地址失败,原因:订单不是【待发货】状态");
|
||||||
|
ErrorCode ORDER_CREATE_FAIL_EXIST_UNPAID = new ErrorCode(1_011_000_032, "交易订单创建失败,原因:存在未付款订单");
|
||||||
|
ErrorCode ORDER_CANCEL_PAID_FAIL = new ErrorCode(1_011_000_033, "交易订单取消支付失败,原因:订单不是【{}】状态");
|
||||||
|
ErrorCode ORDER_PICK_UP_FAIL_NOT_VERIFY_USER = new ErrorCode(1_011_000_034, "交易订单自提失败,原因:你没有核销该门店订单的权限");
|
||||||
|
ErrorCode ORDER_CREATE_FAIL_INSUFFICIENT_USER_POINTS = new ErrorCode(1_011_000_035, "交易订单创建失败,原因:用户积分不足");
|
||||||
|
|
||||||
|
// ========== After Sale 模块 1-011-000-100 ==========
|
||||||
|
ErrorCode AFTER_SALE_NOT_FOUND = new ErrorCode(1_011_000_100, "售后单不存在");
|
||||||
|
ErrorCode AFTER_SALE_CREATE_FAIL_REFUND_PRICE_ERROR = new ErrorCode(1_011_000_101, "申请退款金额错误");
|
||||||
|
ErrorCode AFTER_SALE_CREATE_FAIL_ORDER_STATUS_CANCELED = new ErrorCode(1_011_000_102, "订单已关闭,无法申请售后");
|
||||||
|
ErrorCode AFTER_SALE_CREATE_FAIL_ORDER_STATUS_NO_PAID = new ErrorCode(1_011_000_103, "订单未支付,无法申请售后");
|
||||||
|
ErrorCode AFTER_SALE_CREATE_FAIL_ORDER_STATUS_NO_DELIVERED = new ErrorCode(1_011_000_104, "订单未发货,无法申请【退货退款】售后");
|
||||||
|
ErrorCode AFTER_SALE_CREATE_FAIL_ORDER_ITEM_APPLIED = new ErrorCode(1_011_000_105, "订单项已申请售后,无法重复申请");
|
||||||
|
ErrorCode AFTER_SALE_AUDIT_FAIL_STATUS_NOT_APPLY = new ErrorCode(1_011_000_106, "审批失败,售后状态不处于审批中");
|
||||||
|
ErrorCode AFTER_SALE_UPDATE_STATUS_FAIL = new ErrorCode(1_011_000_107, "操作售后单失败,请刷新后重试");
|
||||||
|
ErrorCode AFTER_SALE_DELIVERY_FAIL_STATUS_NOT_SELLER_AGREE = new ErrorCode(1_011_000_108, "退货失败,售后单状态不处于【待买家退货】");
|
||||||
|
ErrorCode AFTER_SALE_CONFIRM_FAIL_STATUS_NOT_BUYER_DELIVERY = new ErrorCode(1_011_000_109, "确认收货失败,售后单状态不处于【待确认收货】");
|
||||||
|
ErrorCode AFTER_SALE_REFUND_FAIL_STATUS_NOT_WAIT_REFUND = new ErrorCode(1_011_000_110, "退款失败,售后单状态不是【待退款】");
|
||||||
|
ErrorCode AFTER_SALE_CANCEL_FAIL_STATUS_NOT_APPLY_OR_AGREE_OR_BUYER_DELIVERY =
|
||||||
|
new ErrorCode(1_011_000_111, "取消售后单失败,售后单状态不是【待审核】或【卖家同意】或【商家待收货】");
|
||||||
|
ErrorCode AFTER_SALE_CREATE_FAIL_ORDER_STATUS_COMBINATION_IN_PROGRESS = new ErrorCode(1_011_000_112, "订单拼团中,无法申请售后");
|
||||||
|
|
||||||
|
// ========== Cart 模块 1-011-002-000 ==========
|
||||||
|
ErrorCode CARD_ITEM_NOT_FOUND = new ErrorCode(1_011_002_000, "购物车项不存在");
|
||||||
|
|
||||||
|
// ========== Price 相关 1-011-003-000 ============
|
||||||
|
ErrorCode PRICE_CALCULATE_PAY_PRICE_ILLEGAL = new ErrorCode(1_011_003_000, "支付价格计算异常,原因:价格小于等于 0");
|
||||||
|
ErrorCode PRICE_CALCULATE_DELIVERY_PRICE_TEMPLATE_NOT_FOUND = new ErrorCode(1_011_003_001, "计算快递运费异常,找不到对应的运费模板");
|
||||||
|
ErrorCode PRICE_CALCULATE_COUPON_NOT_MATCH_NORMAL_ORDER = new ErrorCode(1_011_003_002, "参与秒杀、拼团、砍价的营销商品,无法使用优惠劵");
|
||||||
|
ErrorCode PRICE_CALCULATE_SECKILL_TOTAL_LIMIT_COUNT = new ErrorCode(1_011_003_003, "参与秒杀的商品,超过了秒杀总限购数量");
|
||||||
|
ErrorCode PRICE_CALCULATE_POINT_TOTAL_LIMIT_COUNT = new ErrorCode(1_011_003_004, "参与积分活动的商品,超过了积分活动商品总限购数量");
|
||||||
|
ErrorCode PRICE_CALCULATE_DELIVERY_PRICE_TYPE_ILLEGAL = new ErrorCode(1_011_003_005, "计算快递运费异常,配送方式不匹配");
|
||||||
|
ErrorCode PRICE_CALCULATE_COUPON_CAN_NOT_USE = new ErrorCode(1_011_003_006, "该优惠劵无法使用,原因:{}」");
|
||||||
|
|
||||||
|
// ========== 物流 Express 模块 1-011-004-000 ==========
|
||||||
|
ErrorCode EXPRESS_NOT_EXISTS = new ErrorCode(1_011_004_000, "快递公司不存在");
|
||||||
|
ErrorCode EXPRESS_CODE_DUPLICATE = new ErrorCode(1_011_004_001, "已经存在该编码的快递公司");
|
||||||
|
ErrorCode EXPRESS_CLIENT_NOT_PROVIDE = new ErrorCode(1_011_004_002, "需要接入快递服务商,比如【快递100】");
|
||||||
|
ErrorCode EXPRESS_STATUS_NOT_ENABLE = new ErrorCode(1_011_004_003, "快递公司未启用");
|
||||||
|
|
||||||
|
ErrorCode EXPRESS_API_QUERY_ERROR = new ErrorCode(1_011_004_101, "快递查询接口异常");
|
||||||
|
ErrorCode EXPRESS_API_QUERY_FAILED = new ErrorCode(1_011_004_102, "快递查询返回失败,原因:{}");
|
||||||
|
|
||||||
|
// ========== 物流 Template 模块 1-011-005-000 ==========
|
||||||
|
ErrorCode EXPRESS_TEMPLATE_NAME_DUPLICATE = new ErrorCode(1_011_005_000, "已经存在该运费模板名");
|
||||||
|
ErrorCode EXPRESS_TEMPLATE_NOT_EXISTS = new ErrorCode(1_011_005_001, "运费模板不存在");
|
||||||
|
|
||||||
|
// ========== 物流 PICK_UP 模块 1-011-006-000 ==========
|
||||||
|
ErrorCode PICK_UP_STORE_NOT_EXISTS = new ErrorCode(1_011_006_000, "自提门店不存在");
|
||||||
|
ErrorCode PICK_UP_STORE_STAFF_NOT_EXISTS = new ErrorCode(1_011_006_000, "自提门店店员不存在");
|
||||||
|
|
||||||
|
// ========== 分销用户 模块 1-011-007-000 ==========
|
||||||
|
ErrorCode BROKERAGE_USER_NOT_EXISTS = new ErrorCode(1_011_007_000, "分销用户不存在");
|
||||||
|
ErrorCode BROKERAGE_USER_FROZEN_PRICE_NOT_ENOUGH = new ErrorCode(1_011_007_001, "用户冻结佣金({})数量不足");
|
||||||
|
ErrorCode BROKERAGE_BIND_SELF = new ErrorCode(1_011_007_002, "不能绑定自己");
|
||||||
|
ErrorCode BROKERAGE_BIND_USER_NOT_ENABLED = new ErrorCode(1_011_007_003, "绑定用户没有推广资格");
|
||||||
|
ErrorCode BROKERAGE_BIND_CONDITION_ADMIN = new ErrorCode(1_011_007_004, "仅可在后台绑定推广员");
|
||||||
|
ErrorCode BROKERAGE_BIND_MODE_REGISTER = new ErrorCode(1_011_007_005, "只有在注册时可以绑定");
|
||||||
|
ErrorCode BROKERAGE_BIND_OVERRIDE = new ErrorCode(1_011_007_006, "已绑定了推广人");
|
||||||
|
ErrorCode BROKERAGE_BIND_LOOP = new ErrorCode(1_011_007_007, "下级不能绑定自己的上级");
|
||||||
|
ErrorCode BROKERAGE_USER_LEVEL_NOT_SUPPORT = new ErrorCode(1_011_007_008, "目前只支持 level 小于等于 2");
|
||||||
|
ErrorCode BROKERAGE_CREATE_USER_EXISTS = new ErrorCode(1_011_007_009, "分销用户已存在");
|
||||||
|
|
||||||
|
// ========== 分销提现 模块 1-011-008-000 ==========
|
||||||
|
ErrorCode BROKERAGE_WITHDRAW_NOT_EXISTS = new ErrorCode(1_011_008_000, "佣金提现记录不存在");
|
||||||
|
ErrorCode BROKERAGE_WITHDRAW_STATUS_NOT_AUDITING = new ErrorCode(1_011_008_001, "佣金提现记录状态不是审核中");
|
||||||
|
ErrorCode BROKERAGE_WITHDRAW_MIN_PRICE = new ErrorCode(1_011_008_002, "提现金额不能低于 {} 元");
|
||||||
|
ErrorCode BROKERAGE_WITHDRAW_USER_BALANCE_NOT_ENOUGH = new ErrorCode(1_011_008_003, "您当前最多可提现 {} 元");
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通知模板枚举类
|
||||||
|
*
|
||||||
|
* @author HUIHUI
|
||||||
|
*/
|
||||||
|
public interface MessageTemplateConstants {
|
||||||
|
|
||||||
|
// ======================= 短信消息模版 =======================
|
||||||
|
|
||||||
|
String SMS_ORDER_DELIVERY = "order_delivery"; // 短信模版编号
|
||||||
|
|
||||||
|
// ======================= 小程序订阅消息模版 =======================
|
||||||
|
|
||||||
|
String WXA_ORDER_DELIVERY = "订单发货通知";
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums.aftersale;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 售后操作类型的枚举
|
||||||
|
*
|
||||||
|
* @author 陈賝
|
||||||
|
* @since 2023/6/13 13:53
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum AfterSaleOperateTypeEnum {
|
||||||
|
|
||||||
|
MEMBER_CREATE(10, "会员申请退款"),
|
||||||
|
ADMIN_AGREE_APPLY(11, "商家同意退款"),
|
||||||
|
ADMIN_DISAGREE_APPLY(12, "商家拒绝退款"),
|
||||||
|
MEMBER_DELIVERY(20, "会员填写退货物流信息,快递公司:{deliveryName},快递单号:{logisticsNo}"),
|
||||||
|
ADMIN_AGREE_RECEIVE(21, "商家收货"),
|
||||||
|
ADMIN_DISAGREE_RECEIVE(22, "商家拒绝收货,原因:{reason}"),
|
||||||
|
ADMIN_REFUND(30, "商家退款"),
|
||||||
|
MEMBER_CANCEL(40, "会员取消退款"),
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作类型
|
||||||
|
*/
|
||||||
|
private final Integer type;
|
||||||
|
/**
|
||||||
|
* 操作描述
|
||||||
|
*/
|
||||||
|
private final String content;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums.aftersale;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.core.ArrayValuable;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import static cn.hutool.core.util.ArrayUtil.firstMatch;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 售后状态的枚举
|
||||||
|
*
|
||||||
|
* <a href="https://www.processon.com/view/link/63731a270e3e742ce7b7c194">状态流转</a>
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum AfterSaleStatusEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 【申请售后】
|
||||||
|
*/
|
||||||
|
APPLY(10,"申请中", "会员申请退款"), // 有赞的状态提示:退款申请待商家处理
|
||||||
|
/**
|
||||||
|
* 卖家通过售后;【商品待退货】
|
||||||
|
*/
|
||||||
|
SELLER_AGREE(20, "卖家通过", "商家同意退款"), // 有赞的状态提示:请退货并填写物流信息
|
||||||
|
/**
|
||||||
|
* 买家已退货,等待卖家收货;【商家待收货】
|
||||||
|
*/
|
||||||
|
BUYER_DELIVERY(30,"待卖家收货", "会员填写退货物流信息"), // 有赞的状态提示:退货退款申请待商家处理
|
||||||
|
/**
|
||||||
|
* 卖家已收货,等待平台退款;等待退款【等待退款】
|
||||||
|
*/
|
||||||
|
WAIT_REFUND(40, "等待平台退款", "商家收货"), // 有赞的状态提示:无(有赞无该状态)
|
||||||
|
/**
|
||||||
|
* 完成退款【退款成功】
|
||||||
|
*/
|
||||||
|
COMPLETE(50, "完成", "商家确认退款"), // 有赞的状态提示:退款成功
|
||||||
|
/**
|
||||||
|
* 【买家取消】
|
||||||
|
*/
|
||||||
|
BUYER_CANCEL(61, "买家取消售后", "会员取消退款"), // 有赞的状态提示:退款关闭
|
||||||
|
/**
|
||||||
|
* 卖家拒绝售后;商家拒绝【商家拒绝】
|
||||||
|
*/
|
||||||
|
SELLER_DISAGREE(62,"卖家拒绝", "商家拒绝退款"), // 有赞的状态提示:商家不同意退款申请
|
||||||
|
/**
|
||||||
|
* 卖家拒绝收货,终止售后;【商家拒收货】
|
||||||
|
*/
|
||||||
|
SELLER_REFUSE(63,"卖家拒绝收货", "商家拒绝收货"), // 有赞的状态提示:商家拒绝收货,不同意退款
|
||||||
|
;
|
||||||
|
|
||||||
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(AfterSaleStatusEnum::getStatus).toArray(Integer[]::new);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进行中的售后状态
|
||||||
|
*
|
||||||
|
* 不包括已经结束的状态
|
||||||
|
*/
|
||||||
|
public static final Collection<Integer> APPLYING_STATUSES = Arrays.asList(
|
||||||
|
APPLY.getStatus(),
|
||||||
|
SELLER_AGREE.getStatus(),
|
||||||
|
BUYER_DELIVERY.getStatus(),
|
||||||
|
WAIT_REFUND.getStatus()
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private final Integer status;
|
||||||
|
/**
|
||||||
|
* 状态名
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
/**
|
||||||
|
* 操作内容
|
||||||
|
*
|
||||||
|
* 目的:记录售后日志的内容
|
||||||
|
*/
|
||||||
|
private final String content;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer[] array() {
|
||||||
|
return ARRAYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AfterSaleStatusEnum valueOf(Integer status) {
|
||||||
|
return firstMatch(value -> value.getStatus().equals(status), values());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums.aftersale;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.core.ArrayValuable;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易售后 - 类型
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum AfterSaleTypeEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
|
IN_SALE(10, "售中退款"), // 交易完成前买家申请退款
|
||||||
|
AFTER_SALE(20, "售后退款"); // 交易完成后买家申请退款
|
||||||
|
|
||||||
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(AfterSaleTypeEnum::getType).toArray(Integer[]::new);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private final Integer type;
|
||||||
|
/**
|
||||||
|
* 类型名
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer[] array() {
|
||||||
|
return ARRAYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums.aftersale;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.core.ArrayValuable;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易售后 - 方式
|
||||||
|
*
|
||||||
|
* @author Sin
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum AfterSaleWayEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
|
REFUND(10, "仅退款"),
|
||||||
|
RETURN_AND_REFUND(20, "退货退款");
|
||||||
|
|
||||||
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(AfterSaleWayEnum::getWay).toArray(Integer[]::new);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 方式
|
||||||
|
*/
|
||||||
|
private final Integer way;
|
||||||
|
/**
|
||||||
|
* 方式名
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer[] array() {
|
||||||
|
return ARRAYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums.brokerage;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.core.ArrayValuable;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分销关系绑定模式枚举
|
||||||
|
*
|
||||||
|
* @author owen
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum BrokerageBindModeEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 只要用户没有推广人,随时都可以绑定分销关系
|
||||||
|
*/
|
||||||
|
ANYTIME(1, "首次绑定"),
|
||||||
|
/**
|
||||||
|
* 仅新用户注册时才能绑定推广关系
|
||||||
|
*/
|
||||||
|
REGISTER(2, "注册绑定"),
|
||||||
|
/**
|
||||||
|
* 每次扫码都覆盖
|
||||||
|
*/
|
||||||
|
OVERRIDE(3, "覆盖绑定"),
|
||||||
|
;
|
||||||
|
|
||||||
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BrokerageBindModeEnum::getMode).toArray(Integer[]::new);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模式
|
||||||
|
*/
|
||||||
|
private final Integer mode;
|
||||||
|
/**
|
||||||
|
* 名字
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer[] array() {
|
||||||
|
return ARRAYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums.brokerage;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.core.ArrayValuable;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分佣模式枚举
|
||||||
|
*
|
||||||
|
* @author owen
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum BrokerageEnabledConditionEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所有用户都可以分销
|
||||||
|
*/
|
||||||
|
ALL(1, "人人分销"),
|
||||||
|
/**
|
||||||
|
* 仅可后台手动设置推广员
|
||||||
|
*/
|
||||||
|
ADMIN(2, "指定分销"),
|
||||||
|
;
|
||||||
|
|
||||||
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BrokerageEnabledConditionEnum::getCondition).toArray(Integer[]::new);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模式
|
||||||
|
*/
|
||||||
|
private final Integer condition;
|
||||||
|
/**
|
||||||
|
* 名字
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer[] array() {
|
||||||
|
return ARRAYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums.brokerage;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.core.ArrayValuable;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 佣金记录业务类型枚举
|
||||||
|
*
|
||||||
|
* @author owen
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum BrokerageRecordBizTypeEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
|
ORDER(1, "获得推广佣金", "获得推广佣金 {}", true),
|
||||||
|
WITHDRAW(2, "提现申请", "提现申请扣除佣金 {}", false),
|
||||||
|
WITHDRAW_REJECT(3, "提现申请驳回", "提现申请驳回,返还佣金 {}", true),
|
||||||
|
;
|
||||||
|
|
||||||
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BrokerageRecordBizTypeEnum::getType).toArray(Integer[]::new);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private final Integer type;
|
||||||
|
/**
|
||||||
|
* 标题
|
||||||
|
*/
|
||||||
|
private final String title;
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
private final String description;
|
||||||
|
/**
|
||||||
|
* 是否为增加佣金
|
||||||
|
*/
|
||||||
|
private final boolean add;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer[] array() {
|
||||||
|
return ARRAYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums.brokerage;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.core.ArrayValuable;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 佣金记录状态枚举
|
||||||
|
*
|
||||||
|
* @author owen
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum BrokerageRecordStatusEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
|
WAIT_SETTLEMENT(0, "待结算"),
|
||||||
|
SETTLEMENT(1, "已结算"),
|
||||||
|
CANCEL(2, "已取消"),
|
||||||
|
;
|
||||||
|
|
||||||
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BrokerageRecordStatusEnum::getStatus).toArray(Integer[]::new);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private final Integer status;
|
||||||
|
/**
|
||||||
|
* 名字
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer[] array() {
|
||||||
|
return ARRAYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums.brokerage;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.core.ArrayValuable;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
// TODO 芋艿:提现的打通,在纠结下;
|
||||||
|
/**
|
||||||
|
* 佣金提现状态枚举
|
||||||
|
*
|
||||||
|
* @author owen
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum BrokerageWithdrawStatusEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
|
AUDITING(0, "审核中"),
|
||||||
|
AUDIT_SUCCESS(10, "审核通过"),
|
||||||
|
WITHDRAW_SUCCESS(11, "提现成功"),
|
||||||
|
AUDIT_FAIL(20, "审核不通过"),
|
||||||
|
WITHDRAW_FAIL(21, "提现失败"),
|
||||||
|
;
|
||||||
|
|
||||||
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BrokerageWithdrawStatusEnum::getStatus).toArray(Integer[]::new);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private final Integer status;
|
||||||
|
/**
|
||||||
|
* 名字
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer[] array() {
|
||||||
|
return ARRAYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums.brokerage;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.core.ArrayValuable;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 佣金提现类型枚举
|
||||||
|
*
|
||||||
|
* @author owen
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum BrokerageWithdrawTypeEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
|
WALLET(1, "钱包"),
|
||||||
|
BANK(2, "银行卡"),
|
||||||
|
WECHAT(3, "微信"), // 手动打款
|
||||||
|
ALIPAY(4, "支付宝"),
|
||||||
|
WECHAT_API(5, "微信零钱"), // 自动打款,通过微信转账 API
|
||||||
|
;
|
||||||
|
|
||||||
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(BrokerageWithdrawTypeEnum::getType).toArray(Integer[]::new);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private final Integer type;
|
||||||
|
/**
|
||||||
|
* 名字
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer[] array() {
|
||||||
|
return ARRAYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否通过支付平台的 API 打款
|
||||||
|
*
|
||||||
|
* @param type 类型
|
||||||
|
* @return 是否
|
||||||
|
*/
|
||||||
|
public static boolean isApi(Integer type) {
|
||||||
|
return WECHAT_API.getType().equals(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums.delivery;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
|
import com.tashow.cloud.common.core.ArrayValuable;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 快递配送计费方式枚举
|
||||||
|
*
|
||||||
|
* @author jason
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum DeliveryExpressChargeModeEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
|
COUNT(1, "按件"),
|
||||||
|
WEIGHT(2,"按重量"),
|
||||||
|
VOLUME(3, "按体积");
|
||||||
|
|
||||||
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(DeliveryExpressChargeModeEnum::getType).toArray(Integer[]::new);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private final Integer type;
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer[] array() {
|
||||||
|
return ARRAYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DeliveryExpressChargeModeEnum valueOf(Integer value) {
|
||||||
|
return ArrayUtil.firstMatch(chargeMode -> chargeMode.getType().equals(value), DeliveryExpressChargeModeEnum.values());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums.delivery;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.core.ArrayValuable;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配送方式枚举
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum DeliveryTypeEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
|
EXPRESS(1, "快递发货"),
|
||||||
|
PICK_UP(2, "用户自提"),;
|
||||||
|
|
||||||
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(DeliveryTypeEnum::getType).toArray(Integer[]::new);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配送方式
|
||||||
|
*/
|
||||||
|
private final Integer type;
|
||||||
|
/**
|
||||||
|
* 状态名
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer[] array() {
|
||||||
|
return ARRAYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums.notify;
|
||||||
|
|
||||||
|
// TODO @芋艿:这个枚举的作用?
|
||||||
|
public interface TradeNotifyEnums {
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums.order;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.core.ArrayValuable;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易订单 - 关闭类型
|
||||||
|
*
|
||||||
|
* @author Sin
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum TradeOrderCancelTypeEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
|
PAY_TIMEOUT(10, "超时未支付"),
|
||||||
|
AFTER_SALE_CLOSE(20, "退款关闭"),
|
||||||
|
MEMBER_CANCEL(30, "买家取消"),
|
||||||
|
COMBINATION_CLOSE(40, "拼团关闭");
|
||||||
|
|
||||||
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(TradeOrderCancelTypeEnum::getType).toArray(Integer[]::new);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭类型
|
||||||
|
*/
|
||||||
|
private final Integer type;
|
||||||
|
/**
|
||||||
|
* 关闭类型名
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer[] array() {
|
||||||
|
return ARRAYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums.order;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.tashow.cloud.common.core.ArrayValuable;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易订单项 - 售后状态
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum TradeOrderItemAfterSaleStatusEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
|
NONE(0, "未售后"),
|
||||||
|
APPLY(10, "售后中"),
|
||||||
|
SUCCESS(20, "售后成功");
|
||||||
|
|
||||||
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(TradeOrderItemAfterSaleStatusEnum::getStatus).toArray(Integer[]::new);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态值
|
||||||
|
*/
|
||||||
|
private final Integer status;
|
||||||
|
/**
|
||||||
|
* 状态名
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer[] array() {
|
||||||
|
return ARRAYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断指定状态,是否正处于【未申请】状态
|
||||||
|
*
|
||||||
|
* @param status 指定状态
|
||||||
|
* @return 是否
|
||||||
|
*/
|
||||||
|
public static boolean isNone(Integer status) {
|
||||||
|
return ObjectUtil.equals(status, NONE.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums.order;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单操作类型的枚举
|
||||||
|
*
|
||||||
|
* @author 陈賝
|
||||||
|
* @since 2023/7/6 15:31
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum TradeOrderOperateTypeEnum {
|
||||||
|
|
||||||
|
MEMBER_CREATE(1, "用户下单"),
|
||||||
|
ADMIN_UPDATE_PRICE(2, "订单价格 {oldPayPrice} 修改,调整价格 {adjustPrice},实际支付金额为 {newPayPrice} 元"),
|
||||||
|
MEMBER_PAY(10, "用户付款成功"),
|
||||||
|
ADMIN_UPDATE_ADDRESS(11, "收货地址修改"),
|
||||||
|
ADMIN_DELIVERY(20, "已发货,快递公司:{expressName},快递单号:{logisticsNo}"),
|
||||||
|
MEMBER_RECEIVE(30, "用户已收货"),
|
||||||
|
SYSTEM_RECEIVE(31, "到期未收货,系统自动确认收货"),
|
||||||
|
ADMIN_PICK_UP_RECEIVE(32, "管理员自提收货"),
|
||||||
|
MEMBER_COMMENT(33, "用户评价"),
|
||||||
|
SYSTEM_COMMENT(34, "到期未评价,系统自动评价"),
|
||||||
|
MEMBER_CANCEL(40, "取消订单"),
|
||||||
|
SYSTEM_CANCEL(41, "到期未支付,系统自动取消订单"),
|
||||||
|
ADMIN_CANCEL(42, "管理员取消订单"),
|
||||||
|
// 42 预留:管理员取消订单
|
||||||
|
ADMIN_CANCEL_AFTER_SALE(43, "订单全部售后,管理员自动取消订单"),
|
||||||
|
MEMBER_DELETE(49, "删除订单"),
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作类型
|
||||||
|
*/
|
||||||
|
private final Integer type;
|
||||||
|
/**
|
||||||
|
* 操作描述
|
||||||
|
*/
|
||||||
|
private final String content;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums.order;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.core.ArrayValuable;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易订单 - 退款状态
|
||||||
|
*
|
||||||
|
* @author Sin
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum TradeOrderRefundStatusEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
|
NONE(0, "未退款"),
|
||||||
|
PART(10, "部分退款"),
|
||||||
|
ALL(20, "全部退款");
|
||||||
|
|
||||||
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(TradeOrderRefundStatusEnum::getStatus).toArray(Integer[]::new);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态值
|
||||||
|
*/
|
||||||
|
private final Integer status;
|
||||||
|
/**
|
||||||
|
* 状态名
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer[] array() {
|
||||||
|
return ARRAYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,129 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums.order;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.tashow.cloud.common.core.ArrayValuable;
|
||||||
|
import com.tashow.cloud.common.util.object.ObjectUtils;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易订单 - 状态
|
||||||
|
*
|
||||||
|
* @author Sin
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum TradeOrderStatusEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
|
WAITPAID(10, "等待付款"),
|
||||||
|
WAITCONFIRM(20, "等待确定"),
|
||||||
|
WAITSERVE(30, "等待服务"),
|
||||||
|
WAITACCEPT(40, "等待验收"),
|
||||||
|
COMPLETED(50, "已完成"),
|
||||||
|
CANCELED(60, "已取消"),
|
||||||
|
DELIVERED(70, "已退款"),
|
||||||
|
WAITDELIVERED(80, "待发货"),
|
||||||
|
;
|
||||||
|
|
||||||
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(TradeOrderStatusEnum::getStatus).toArray(Integer[]::new);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态值
|
||||||
|
*/
|
||||||
|
private final Integer status;
|
||||||
|
/**
|
||||||
|
* 状态名
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer[] array() {
|
||||||
|
return ARRAYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========== 问:为什么写了很多 isXXX 和 haveXXX 的判断逻辑呢? ==========
|
||||||
|
// ========== 答:方便找到某一类判断,哪些业务正在使用 ==========
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断指定状态,是否正处于【未付款】状态
|
||||||
|
*
|
||||||
|
* @param status 指定状态
|
||||||
|
* @return 是否
|
||||||
|
*/
|
||||||
|
public static boolean isUnpaid(Integer status) {
|
||||||
|
return ObjectUtil.equal(WAITPAID.getStatus(), status);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 判断指定状态,是否正处于【待验收】状态
|
||||||
|
*
|
||||||
|
* @param status 指定状态
|
||||||
|
* @return 是否
|
||||||
|
*/
|
||||||
|
public static boolean isWaitAccept(Integer status) {
|
||||||
|
return ObjectUtil.equal(WAITACCEPT.getStatus(), status);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断指定状态,是否正处于【待发货】状态
|
||||||
|
*
|
||||||
|
* @param status 指定状态
|
||||||
|
* @return 是否
|
||||||
|
*/
|
||||||
|
public static boolean isUndelivered(Integer status) {
|
||||||
|
return ObjectUtil.equal(WAITDELIVERED.getStatus(), status);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断指定状态,是否正处于【已发货】状态
|
||||||
|
*
|
||||||
|
* @param status 指定状态
|
||||||
|
* @return 是否
|
||||||
|
*/
|
||||||
|
public static boolean isDelivered(Integer status) {
|
||||||
|
return ObjectUtil.equals(status, DELIVERED.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断指定状态,是否正处于【已取消】状态
|
||||||
|
*
|
||||||
|
* @param status 指定状态
|
||||||
|
* @return 是否
|
||||||
|
*/
|
||||||
|
public static boolean isCanceled(Integer status) {
|
||||||
|
return ObjectUtil.equals(status, CANCELED.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断指定状态,是否正处于【已完成】状态
|
||||||
|
*
|
||||||
|
* @param status 指定状态
|
||||||
|
* @return 是否
|
||||||
|
*/
|
||||||
|
public static boolean isCompleted(Integer status) {
|
||||||
|
return ObjectUtil.equals(status, COMPLETED.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断指定状态,是否有过【已付款】状态
|
||||||
|
*
|
||||||
|
* @param status 指定状态
|
||||||
|
* @return 是否
|
||||||
|
*/
|
||||||
|
public static boolean havePaid(Integer status) {
|
||||||
|
return ObjectUtils.equalsAny(status, WAITCONFIRM.getStatus(),
|
||||||
|
DELIVERED.getStatus(), COMPLETED.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断指定状态,是否有过【已发货】状态
|
||||||
|
*
|
||||||
|
* @param status 指定状态
|
||||||
|
* @return 是否
|
||||||
|
*/
|
||||||
|
public static boolean haveDelivered(Integer status) {
|
||||||
|
return ObjectUtils.equalsAny(status, DELIVERED.getStatus(), COMPLETED.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.tashow.cloud.tradeapi.enums.order;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.tashow.cloud.common.core.ArrayValuable;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易订单 - 类型
|
||||||
|
*
|
||||||
|
* @author Sin
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum TradeOrderTypeEnum implements ArrayValuable<Integer> {
|
||||||
|
|
||||||
|
NORMAL(0, "普通订单"),
|
||||||
|
SECKILL(1, "秒杀订单"),
|
||||||
|
BARGAIN(2, "砍价订单"),
|
||||||
|
COMBINATION(3, "拼团订单"),
|
||||||
|
POINT(4, "积分商城"),
|
||||||
|
;
|
||||||
|
|
||||||
|
public static final Integer[] ARRAYS = Arrays.stream(values()).map(TradeOrderTypeEnum::getType).toArray(Integer[]::new);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private final Integer type;
|
||||||
|
/**
|
||||||
|
* 类型名
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer[] array() {
|
||||||
|
return ARRAYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNormal(Integer type) {
|
||||||
|
return ObjectUtil.equal(type, NORMAL.getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isSeckill(Integer type) {
|
||||||
|
return ObjectUtil.equal(type, SECKILL.getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isBargain(Integer type) {
|
||||||
|
return ObjectUtil.equal(type, BARGAIN.getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isCombination(Integer type) {
|
||||||
|
return ObjectUtil.equal(type, COMBINATION.getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isPoint(Integer type) {
|
||||||
|
return ObjectUtil.equal(type, POINT.getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -196,6 +196,15 @@ public class LocalDateTimeUtils {
|
|||||||
return LocalDateTimeUtil.beginOfDay(LocalDateTime.now().minusDays(1));
|
return LocalDateTimeUtil.beginOfDay(LocalDateTime.now().minusDays(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取day 天后的日期
|
||||||
|
*
|
||||||
|
* @return 昨天
|
||||||
|
*/
|
||||||
|
public static LocalDateTime getPlusDay(Integer day) {
|
||||||
|
return LocalDateTimeUtil.beginOfDay(LocalDateTime.now().plusDays(day));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取本月的开始时间
|
* 获取本月的开始时间
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.tashow.cloud.common.util.json.databind;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DatePattern;
|
||||||
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
|
import com.fasterxml.jackson.core.JsonGenerator;
|
||||||
|
import com.fasterxml.jackson.databind.JsonSerializer;
|
||||||
|
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基于字符串的 LocalDateTime 序列化器
|
||||||
|
*
|
||||||
|
* @author 老五
|
||||||
|
*/
|
||||||
|
public class StringLocalDateTimeSerializer extends JsonSerializer<LocalDateTime> {
|
||||||
|
|
||||||
|
public static final StringLocalDateTimeSerializer INSTANCE = new StringLocalDateTimeSerializer();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(LocalDateTime value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
|
||||||
|
// 将 LocalDateTime 对象,转换为 Long 时间戳
|
||||||
|
gen.writeString(LocalDateTimeUtil.format(value, DatePattern.NORM_DATETIME_FORMATTER) );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -29,7 +29,7 @@ import java.util.List;
|
|||||||
* 1. {@link BaseMapper} 为 MyBatis Plus 的基础接口,提供基础的 CRUD 能力
|
* 1. {@link BaseMapper} 为 MyBatis Plus 的基础接口,提供基础的 CRUD 能力
|
||||||
* 2. {@link MPJBaseMapper} 为 MyBatis Plus Join 的基础接口,提供连表 Join 能力
|
* 2. {@link MPJBaseMapper} 为 MyBatis Plus Join 的基础接口,提供连表 Join 能力
|
||||||
*/
|
*/
|
||||||
public interface BaseMapperX<T> extends MPJBaseMapper<T> {
|
public interface BaseMapperX<T> extends MPJBaseMapper<T>,BaseMapper<T> {
|
||||||
|
|
||||||
default PageResult<T> selectPage(SortablePageParam pageParam, @Param("ew") Wrapper<T> queryWrapper) {
|
default PageResult<T> selectPage(SortablePageParam pageParam, @Param("ew") Wrapper<T> queryWrapper) {
|
||||||
return selectPage(pageParam, pageParam.getSortingFields(), queryWrapper);
|
return selectPage(pageParam, pageParam.getSortingFields(), queryWrapper);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class EnvEnvironmentPostProcessor implements EnvironmentPostProcessor {
|
|||||||
environment.getSystemProperties().put(hostNameKey, EnvUtils.getHostName());
|
environment.getSystemProperties().put(hostNameKey, EnvUtils.getHostName());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1.1 如果没有 yudao.env.tag 配置项,则不进行配置项的修改
|
// 1.1 如果没有 tashow.env.tag 配置项,则不进行配置项的修改
|
||||||
String tag = EnvUtils.getTag(environment);
|
String tag = EnvUtils.getTag(environment);
|
||||||
if (StrUtil.isEmpty(tag)) {
|
if (StrUtil.isEmpty(tag)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ public class WebSecurityConfigurerAdapter {
|
|||||||
.requestMatchers(HttpMethod.DELETE, permitAllUrls.get(HttpMethod.DELETE).toArray(new String[0])).permitAll()
|
.requestMatchers(HttpMethod.DELETE, permitAllUrls.get(HttpMethod.DELETE).toArray(new String[0])).permitAll()
|
||||||
.requestMatchers(HttpMethod.HEAD, permitAllUrls.get(HttpMethod.HEAD).toArray(new String[0])).permitAll()
|
.requestMatchers(HttpMethod.HEAD, permitAllUrls.get(HttpMethod.HEAD).toArray(new String[0])).permitAll()
|
||||||
.requestMatchers(HttpMethod.PATCH, permitAllUrls.get(HttpMethod.PATCH).toArray(new String[0])).permitAll()
|
.requestMatchers(HttpMethod.PATCH, permitAllUrls.get(HttpMethod.PATCH).toArray(new String[0])).permitAll()
|
||||||
// 1.3 基于 yudao.security.permit-all-urls 无需认证
|
// 1.3 基于 tashow.security.permit-all-urls 无需认证
|
||||||
.requestMatchers(securityProperties.getPermitAllUrls().toArray(new String[0])).permitAll()
|
.requestMatchers(securityProperties.getPermitAllUrls().toArray(new String[0])).permitAll()
|
||||||
)
|
)
|
||||||
// ②:每个项目的自定义规则
|
// ②:每个项目的自定义规则
|
||||||
|
|||||||
@@ -333,57 +333,57 @@ public class GlobalExceptionHandler {
|
|||||||
}
|
}
|
||||||
// 1. 数据报表
|
// 1. 数据报表
|
||||||
if (message.contains("report_")) {
|
if (message.contains("report_")) {
|
||||||
log.error("[报表模块 yudao-module-report - 表结构未导入][参考 https://cloud.iocoder.cn/report/ 开启]");
|
log.error("[报表模块 yudao-module-report - 表结构未导入]");
|
||||||
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
||||||
"[报表模块 yudao-module-report - 表结构未导入][参考 https://cloud.iocoder.cn/report/ 开启]");
|
"[报表模块 yudao-module-report - 表结构未导入]");
|
||||||
}
|
}
|
||||||
// 2. 工作流
|
// 2. 工作流
|
||||||
if (message.contains("bpm_")) {
|
if (message.contains("bpm_")) {
|
||||||
log.error("[工作流模块 yudao-module-bpm - 表结构未导入][参考 https://cloud.iocoder.cn/bpm/ 开启]");
|
log.error("[工作流模块 yudao-module-bpm - 表结构未导入]");
|
||||||
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
||||||
"[工作流模块 yudao-module-bpm - 表结构未导入][参考 https://cloud.iocoder.cn/bpm/ 开启]");
|
"[工作流模块 yudao-module-bpm - 表结构未导入]");
|
||||||
}
|
}
|
||||||
// 3. 微信公众号
|
// 3. 微信公众号
|
||||||
if (message.contains("mp_")) {
|
if (message.contains("mp_")) {
|
||||||
log.error("[微信公众号 yudao-module-mp - 表结构未导入][参考 https://cloud.iocoder.cn/mp/build/ 开启]");
|
log.error("[微信公众号 yudao-module-mp - 表结构未导入]");
|
||||||
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
||||||
"[微信公众号 yudao-module-mp - 表结构未导入][参考 https://cloud.iocoder.cn/mp/build/ 开启]");
|
"[微信公众号 yudao-module-mp - 表结构未导入]");
|
||||||
}
|
}
|
||||||
// 4. 商城系统
|
// 4. 订单系统
|
||||||
if (StrUtil.containsAny(message, "product_", "promotion_", "trade_")) {
|
if (StrUtil.containsAny(message, "product_", "promotion_", "trade_")) {
|
||||||
log.error("[商城系统 yudao-module-mall - 已禁用][参考 https://cloud.iocoder.cn/mall/build/ 开启]");
|
log.error("[订单系统 tashow-module-trade"+StrUtil.subBetween(message,"Table","does")+"- 表结构未导入]");
|
||||||
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
||||||
"[商城系统 yudao-module-mall - 已禁用][参考 https://cloud.iocoder.cn/mall/build/ 开启]");
|
"[订单系统表结构未导入]");
|
||||||
}
|
}
|
||||||
// 5. ERP 系统
|
// 5. ERP 系统
|
||||||
if (message.contains("erp_")) {
|
if (message.contains("erp_")) {
|
||||||
log.error("[ERP 系统 yudao-module-erp - 表结构未导入][参考 https://cloud.iocoder.cn/erp/build/ 开启]");
|
log.error("[ERP 系统 yudao-module-erp - 表结构未导入]");
|
||||||
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
||||||
"[ERP 系统 yudao-module-erp - 表结构未导入][参考 https://cloud.iocoder.cn/erp/build/ 开启]");
|
"[ERP 系统 yudao-module-erp - 表结构未导入]");
|
||||||
}
|
}
|
||||||
// 6. CRM 系统
|
// 6. CRM 系统
|
||||||
if (message.contains("crm_")) {
|
if (message.contains("crm_")) {
|
||||||
log.error("[CRM 系统 yudao-module-crm - 表结构未导入][参考 https://cloud.iocoder.cn/crm/build/ 开启]");
|
log.error("[CRM 系统 yudao-module-crm - 表结构未导入]");
|
||||||
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
||||||
"[CRM 系统 yudao-module-crm - 表结构未导入][参考 https://cloud.iocoder.cn/crm/build/ 开启]");
|
"[CRM 系统 yudao-module-crm - 表结构未导入]");
|
||||||
}
|
}
|
||||||
// 7. 支付平台
|
// 7. 支付平台
|
||||||
if (message.contains("pay_")) {
|
if (message.contains("pay_")) {
|
||||||
log.error("[支付模块 yudao-module-pay - 表结构未导入][参考 https://cloud.iocoder.cn/pay/build/ 开启]");
|
log.error("[支付模块 yudao-module-pay - 表结构未导入]");
|
||||||
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
||||||
"[支付模块 yudao-module-pay - 表结构未导入][参考 https://cloud.iocoder.cn/pay/build/ 开启]");
|
"[支付模块 yudao-module-pay - 表结构未导入]");
|
||||||
}
|
}
|
||||||
// 8. AI 大模型
|
// 8. AI 大模型
|
||||||
if (message.contains("ai_")) {
|
if (message.contains("ai_")) {
|
||||||
log.error("[AI 大模型 yudao-module-ai - 表结构未导入][参考 https://cloud.iocoder.cn/ai/build/ 开启]");
|
log.error("[AI 大模型 yudao-module-ai - 表结构未导入]");
|
||||||
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
||||||
"[AI 大模型 yudao-module-ai - 表结构未导入][参考 https://cloud.iocoder.cn/ai/build/ 开启]");
|
"[AI 大模型 yudao-module-ai - 表结构未导入]");
|
||||||
}
|
}
|
||||||
// 9. IOT 物联网
|
// 9. IOT 物联网
|
||||||
if (message.contains("iot_")) {
|
if (message.contains("iot_")) {
|
||||||
log.error("[IOT 物联网 yudao-module-iot - 表结构未导入][参考 https://doc.iocoder.cn/iot/build/ 开启]");
|
log.error("[IOT 物联网 yudao-module-iot - 表结构未导入]");
|
||||||
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
return CommonResult.error(NOT_IMPLEMENTED.getCode(),
|
||||||
"[IOT 物联网 yudao-module-iot - 表结构未导入][参考 https://doc.iocoder.cn/iot/build/ 开启]");
|
"[IOT 物联网 yudao-module-iot - 表结构未导入]");
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,9 @@
|
|||||||
<module>tashow-module-app</module>
|
<module>tashow-module-app</module>
|
||||||
<module>tashow-module-product</module>
|
<module>tashow-module-product</module>
|
||||||
<module>tashow-module-ai</module>
|
<module>tashow-module-ai</module>
|
||||||
|
<module>tashow-module-pay</module>
|
||||||
|
<module>tashow-module-trade</module>
|
||||||
|
<module>tashow-module-user</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.tashow.cloud.ai.controller.app.dialog.vo.TranslateReqVo;
|
|||||||
import com.tashow.cloud.ai.controller.app.dialog.vo.TranslateRespVo;
|
import com.tashow.cloud.ai.controller.app.dialog.vo.TranslateRespVo;
|
||||||
import com.tashow.cloud.ai.service.dialog.AiDialogService;
|
import com.tashow.cloud.ai.service.dialog.AiDialogService;
|
||||||
import com.tashow.cloud.common.pojo.CommonResult;
|
import com.tashow.cloud.common.pojo.CommonResult;
|
||||||
|
import com.tashow.cloud.common.pojo.PageParam;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import jakarta.annotation.security.PermitAll;
|
import jakarta.annotation.security.PermitAll;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -15,8 +16,6 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -28,8 +27,6 @@ import static com.tashow.cloud.common.pojo.CommonResult.success;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class DialogController {
|
public class DialogController {
|
||||||
|
|
||||||
List<String> message = List.of("渴了", "饿了", "想睡觉", "想出去玩", "想溜达", "情绪低落", "很开心", "很伤心", "想哭");
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private AiDialogService aiDialogService;
|
private AiDialogService aiDialogService;
|
||||||
|
|
||||||
@@ -39,10 +36,10 @@ public class DialogController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping("/getDialog")
|
@GetMapping("/getDialog")
|
||||||
@PermitAll
|
@PermitAll
|
||||||
public CommonResult<DialogResp> msList() {
|
public CommonResult<DialogResp> msList(PageParam pageParam) {
|
||||||
//获取当前登录用户
|
//获取当前登录用户
|
||||||
Long userId = 1L;
|
Long userId = 1L;
|
||||||
return success(aiDialogService.getDialog(userId));
|
return success(aiDialogService.getDialog(userId,pageParam));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
package com.tashow.cloud.ai.controller.app.dialog.vo;
|
package com.tashow.cloud.ai.controller.app.dialog.vo;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.tashow.cloud.common.util.json.databind.StringLocalDateTimeSerializer;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
import static com.tashow.cloud.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ai-对话消息 DO
|
* ai-对话消息 DO
|
||||||
@@ -70,7 +69,13 @@ public class AiDialogMessageRespVo {
|
|||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
//发送时间
|
||||||
private Date createTime;
|
@JsonSerialize(using = StringLocalDateTimeSerializer.class)
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
private Integer emotion;
|
||||||
|
private String terminal;
|
||||||
|
private String fileType;
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
package com.tashow.cloud.ai.controller.app.dialog.vo;
|
package com.tashow.cloud.ai.controller.app.dialog.vo;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.pojo.PageResult;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "api - 对话 Response VO")
|
@Schema(description = "api - 对话 Response VO")
|
||||||
@Data
|
@Data
|
||||||
@@ -17,5 +16,5 @@ public class DialogResp {
|
|||||||
@Schema(description = "对话状态")
|
@Schema(description = "对话状态")
|
||||||
private String dialogStatus;
|
private String dialogStatus;
|
||||||
@Schema(description = "对话消息内容")
|
@Schema(description = "对话消息内容")
|
||||||
private List<AiDialogMessageRespVo> messages;
|
private PageResult<AiDialogMessageRespVo> messages;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,11 +14,13 @@ public class TranslateReqVo {
|
|||||||
//消息id
|
//消息id
|
||||||
private Long msgId;
|
private Long msgId;
|
||||||
|
|
||||||
|
private String terminal;
|
||||||
|
|
||||||
/** 文件附件 */
|
/** 文件附件 */
|
||||||
private MultipartFile file;
|
private MultipartFile file;
|
||||||
|
|
||||||
//文件时长
|
//文件时长
|
||||||
private String contentDuration;
|
private Long contentDuration;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package com.tashow.cloud.ai.controller.app.dialog.vo;
|
package com.tashow.cloud.ai.controller.app.dialog.vo;
|
||||||
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.tashow.cloud.common.util.json.databind.StringLocalDateTimeSerializer;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import static com.tashow.cloud.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 翻译接口结果vo
|
* 翻译接口结果vo
|
||||||
@@ -39,9 +39,9 @@ public class TranslateRespVo {
|
|||||||
private String transResult;
|
private String transResult;
|
||||||
//文件时长
|
//文件时长
|
||||||
private Long contentDuration;
|
private Long contentDuration;
|
||||||
|
private String terminal;
|
||||||
//发送时间
|
//发送时间
|
||||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
@JsonSerialize(using = StringLocalDateTimeSerializer.class)
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
private LocalDateTime createTime;
|
||||||
private String createTime;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
package com.tashow.cloud.ai.dal.dataobject.dialog;
|
package com.tashow.cloud.ai.dal.dataobject.dialog;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.tashow.cloud.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ai-对话消息 DO
|
* ai-对话消息 DO
|
||||||
*
|
*
|
||||||
@@ -89,6 +93,11 @@ public class AiDialogMessageDO {
|
|||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
@TableField(fill = FieldFill.INSERT)
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
private Integer emotion;
|
||||||
|
private String terminal;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.tashow.cloud.ai.dal.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum EmotionEnums {
|
||||||
|
|
||||||
|
XF(1,"兴奋/玩耍","兴奋"),
|
||||||
|
PJ(2,"平静/放松","平静"),
|
||||||
|
je(3,"乞求/饥饿/口渴","饥饿"),
|
||||||
|
yk(4,"愉快/满足","愉快"),
|
||||||
|
tt(5,"疼痛/沮丧","疼痛"),
|
||||||
|
kj(6,"恐惧/不安","恐惧"),
|
||||||
|
hq(7,"问候/好奇","好奇"),
|
||||||
|
ng(8,"难过/焦虑","难过"),
|
||||||
|
fn(9,"愤怒/警告","愤怒"),
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
private Integer code;
|
||||||
|
private String name;
|
||||||
|
private String aiName;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import com.tashow.cloud.ai.controller.app.dialog.vo.DialogResp;
|
|||||||
import com.tashow.cloud.ai.controller.app.dialog.vo.TranslateReqVo;
|
import com.tashow.cloud.ai.controller.app.dialog.vo.TranslateReqVo;
|
||||||
import com.tashow.cloud.ai.controller.app.dialog.vo.TranslateRespVo;
|
import com.tashow.cloud.ai.controller.app.dialog.vo.TranslateRespVo;
|
||||||
import com.tashow.cloud.ai.dal.dataobject.dialog.AiDialogDO;
|
import com.tashow.cloud.ai.dal.dataobject.dialog.AiDialogDO;
|
||||||
|
import com.tashow.cloud.common.pojo.PageParam;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ai-对话 Service 接口
|
* ai-对话 Service 接口
|
||||||
@@ -14,7 +15,7 @@ import com.tashow.cloud.ai.dal.dataobject.dialog.AiDialogDO;
|
|||||||
public interface AiDialogService extends IService<AiDialogDO> {
|
public interface AiDialogService extends IService<AiDialogDO> {
|
||||||
|
|
||||||
|
|
||||||
DialogResp getDialog(Long userId);
|
DialogResp getDialog(Long userId, PageParam pageParam);
|
||||||
|
|
||||||
TranslateRespVo translate(TranslateReqVo fileReqVo);
|
TranslateRespVo translate(TranslateReqVo fileReqVo);
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.tashow.cloud.ai.service.dialog;
|
package com.tashow.cloud.ai.service.dialog;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.http.HttpRequest;
|
import cn.hutool.http.HttpRequest;
|
||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
@@ -15,6 +17,8 @@ import com.tashow.cloud.ai.dal.dataobject.dialog.AiDialogDO;
|
|||||||
import com.tashow.cloud.ai.dal.dataobject.dialog.AiDialogMessageDO;
|
import com.tashow.cloud.ai.dal.dataobject.dialog.AiDialogMessageDO;
|
||||||
import com.tashow.cloud.ai.dal.mysql.dialog.AiDialogMapper;
|
import com.tashow.cloud.ai.dal.mysql.dialog.AiDialogMapper;
|
||||||
import com.tashow.cloud.ai.dal.mysql.dialog.AiDialogMessageMapper;
|
import com.tashow.cloud.ai.dal.mysql.dialog.AiDialogMessageMapper;
|
||||||
|
import com.tashow.cloud.common.pojo.PageParam;
|
||||||
|
import com.tashow.cloud.common.pojo.PageResult;
|
||||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||||
import com.tashow.cloud.infraapi.api.file.FileApi;
|
import com.tashow.cloud.infraapi.api.file.FileApi;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
@@ -27,11 +31,8 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
|
|
||||||
import javax.sound.sampled.AudioInputStream;
|
import javax.sound.sampled.AudioInputStream;
|
||||||
import javax.sound.sampled.AudioSystem;
|
import javax.sound.sampled.AudioSystem;
|
||||||
import java.io.InputStream;
|
|
||||||
import java.net.HttpURLConnection;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -54,9 +55,65 @@ public class AiDialogServiceImpl extends ServiceImpl<AiDialogMapper, AiDialogDO>
|
|||||||
@Resource
|
@Resource
|
||||||
private FileApi fileApi;
|
private FileApi fileApi;
|
||||||
|
|
||||||
|
private List<String> failedStr =List.of(
|
||||||
|
"刚刚的音符太独特了,我没听清呢~可以再对我说一次吗?",
|
||||||
|
"哇,这是哪来的小可爱?声音太有魅力了,让我一时走了神。请靠近一点,慢慢再说一遍好?",
|
||||||
|
"背景音有点热闹,我有点分心啦~能在一个更安静的地方,让我专心听听TA的声音吗",
|
||||||
|
"报告主人!声波受到不明干扰(可能是零食袋的声音?),翻译任务失败,请求二次输入!",
|
||||||
|
"我的‘物种雷达’刚才打了个盹儿~快让我再听一次这美妙的声音!",
|
||||||
|
"这声音太迷人了,让我CPU过载了!请简化一下环境音,我们再来一次?"
|
||||||
|
);
|
||||||
|
|
||||||
|
private Map<String,List<String>> failedMap =new HashMap<>(){{
|
||||||
|
put("cat",List.of(
|
||||||
|
"听得出是猫猫在说话,但TA似乎在表达一种很深邃的情绪..也许是个小秘密呢?",
|
||||||
|
"喵星人的这段‘加密通话’等级太高了!翻译官正在努力学习中...你能通过TA的尾巴和眼神猜猜看吗?",
|
||||||
|
"警报!警报!接收到喵星最高机密指令,我的权限不足,无法破译!建议提供小鱼干以获取更多线索"
|
||||||
|
));
|
||||||
|
put("dog",List.of(
|
||||||
|
"听得出是狗狗在说话,但TA似乎在表达一种很深邃的情绪...也许是个小秘密呢?",
|
||||||
|
"汪语十级考试失败!这句大概是“今天的我比昨天更爱你了'之类的复杂情感吧",
|
||||||
|
"汪星人的这段‘加密通话’等级太高了!翻译官正在努力学习中..你能通过TA的尾巴和眼神猜猜看吗?"
|
||||||
|
));
|
||||||
|
put("common",List.of(
|
||||||
|
"TA刚才可能用了某种古老的咒语,或者...只是在打一个很有思想的哈欠?",
|
||||||
|
"这句‘话’的哲学深度超出了我的理解范围,TA可能是一位诗人~"
|
||||||
|
));
|
||||||
|
}};
|
||||||
|
|
||||||
|
private Map<String,List<String>> successMap =new HashMap<>(){{
|
||||||
|
put("舒服",List.of(
|
||||||
|
"TA 现在全身心都放松下来啦,正被满满的安全感包围着呢~ ",
|
||||||
|
"听这均匀的呼吸,TA 的心正像云朵一样软绵绵、轻飘飘的哦。",
|
||||||
|
"这是幸福的声音!此刻的TA,觉得自己是全世界最被爱的小宝贝",
|
||||||
|
"环境很安心~主人很贴心~TA 正在小声说:好舒服呀~…"
|
||||||
|
));
|
||||||
|
put("等待喂食",List.of(
|
||||||
|
"小肚肚发出‘咕咕’警报啦!美食雷达正在全面启动,搜寻好吃的!",
|
||||||
|
"来自TA的紧急通讯:‘报告!能量储备严重不足,请求立刻补充!",
|
||||||
|
"你听到了吗?那是小饭碗在思念食物的声音!TA的眼神正在发出渴望的光波~",
|
||||||
|
"“开饭铃”已经摇响!再不开饭,小委屈就要溢出来啦!"
|
||||||
|
));
|
||||||
|
put("生气",List.of(
|
||||||
|
"TA 现在有点小紧张哦,周围可能有让TA不安的东西,快给TA一点安慰吧",
|
||||||
|
"检测到‘心跳加速’模式!TA需要一点空间和一个温柔的声音来平静下来",
|
||||||
|
"TA 现在有点小紧张哦,周围可能有让TA不安的东西,快给TA一点安慰吧"
|
||||||
|
));
|
||||||
|
}};
|
||||||
|
|
||||||
|
private Map<String, String> petAvatars = new HashMap<>() {{
|
||||||
|
put("cat", "https://petshy.tashowz.com/admin-api/infra/file/29/get/默认的猫.png");
|
||||||
|
put("dog", "https://petshy.tashowz.com/admin-api/infra/file/29/get/默认的狗.png");
|
||||||
|
}};
|
||||||
|
|
||||||
|
private Map<String, String> petName = new HashMap<>() {{
|
||||||
|
put("cat", "猫猫・三胖");
|
||||||
|
put("dog", "狗狗・旺财");
|
||||||
|
}};
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DialogResp getDialog(Long userId) {
|
public DialogResp getDialog(Long userId, PageParam pageParam) {
|
||||||
AiDialogDO aiDialogDO = this.getOne(new LambdaQueryWrapper<AiDialogDO>().eq(AiDialogDO::getUserId, userId));
|
AiDialogDO aiDialogDO = this.getOne(new LambdaQueryWrapper<AiDialogDO>().eq(AiDialogDO::getUserId, userId));
|
||||||
if (aiDialogDO == null) {
|
if (aiDialogDO == null) {
|
||||||
aiDialogDO = new AiDialogDO();
|
aiDialogDO = new AiDialogDO();
|
||||||
@@ -65,7 +122,12 @@ public class AiDialogServiceImpl extends ServiceImpl<AiDialogMapper, AiDialogDO>
|
|||||||
aiDialogDO.setUserId(userId);
|
aiDialogDO.setUserId(userId);
|
||||||
this.save(aiDialogDO);
|
this.save(aiDialogDO);
|
||||||
}
|
}
|
||||||
List<AiDialogMessageDO> messageDOS = aiDialogMessageMapper.selectList(new LambdaQueryWrapper<AiDialogMessageDO>().eq(AiDialogMessageDO::getDialogId, aiDialogDO.getId()));
|
|
||||||
|
PageResult<AiDialogMessageDO> messageDOS = aiDialogMessageMapper.selectPage(pageParam,
|
||||||
|
new LambdaQueryWrapper<AiDialogMessageDO>().eq(AiDialogMessageDO::getDialogId, aiDialogDO.getId())
|
||||||
|
.orderByAsc(AiDialogMessageDO::getCreateTime)
|
||||||
|
);
|
||||||
|
|
||||||
DialogResp resp = new DialogResp();
|
DialogResp resp = new DialogResp();
|
||||||
resp.setDialogId(aiDialogDO.getId());
|
resp.setDialogId(aiDialogDO.getId());
|
||||||
resp.setTitle(aiDialogDO.getTitle());
|
resp.setTitle(aiDialogDO.getTitle());
|
||||||
@@ -77,46 +139,23 @@ public class AiDialogServiceImpl extends ServiceImpl<AiDialogMapper, AiDialogDO>
|
|||||||
@Override
|
@Override
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
public TranslateRespVo translate(TranslateReqVo fileReqVo) {
|
public TranslateRespVo translate(TranslateReqVo fileReqVo) {
|
||||||
AiDialogMessageDO messageDO = aiDialogMessageMapper.selectById(fileReqVo.getMsgId());
|
AiDialogMessageDO messageDO = new AiDialogMessageDO();
|
||||||
if (messageDO == null) {
|
String fileName = fileReqVo.getFile().getOriginalFilename();
|
||||||
messageDO = new AiDialogMessageDO();
|
|
||||||
}
|
|
||||||
String fileName = StrUtil.isBlank(messageDO.getFileName()) ? fileReqVo.getFile().getOriginalFilename() : messageDO.getFileName();
|
|
||||||
//上传文件获取文件地址
|
//上传文件获取文件地址
|
||||||
String fileUrl = StrUtil.isBlank(messageDO.getContentText()) ? fileServer + fileApi.createFile(fileName, "", fileReqVo.getFile().getBytes()) : messageDO.getContentText();
|
String fileUrl = fileServer + fileApi.createFile(fileName, "", fileReqVo.getFile().getBytes());
|
||||||
//翻译结果
|
//翻译结果
|
||||||
translate(messageDO, fileUrl, fileName);
|
translate(messageDO, fileUrl, fileName);
|
||||||
|
|
||||||
//创建消息 持久化消息
|
//创建消息
|
||||||
if (messageDO.getId() == null) {
|
|
||||||
messageDO.setFileName(fileName);
|
messageDO.setFileName(fileName);
|
||||||
messageDO.setFileType(fileReqVo.getFile().getContentType());
|
messageDO.setFileType(fileReqVo.getFile().getContentType());
|
||||||
messageDO.setDialogId(fileReqVo.getDialogId());
|
messageDO.setDialogId(fileReqVo.getDialogId());
|
||||||
//前端无法转换时 后端进行转
|
//前端无法转换时 后端进行转
|
||||||
messageDO.setContentDuration(
|
messageDO.setContentDuration(fileReqVo.getContentDuration());
|
||||||
StrUtil.isBlank(fileReqVo.getContentDuration()) || "Infinity".equals(fileReqVo.getContentDuration())
|
|
||||||
? 0 : Long.parseLong(fileReqVo.getContentDuration())
|
|
||||||
);
|
|
||||||
|
|
||||||
messageDO.setContentText(fileUrl);
|
messageDO.setContentText(fileUrl);
|
||||||
messageDO.setContentType(2);
|
messageDO.setContentType(2);
|
||||||
//宠物档案 todo
|
messageDO.setCreateTime(LocalDateTimeUtil.now());
|
||||||
messageDO.setPetId(1l);
|
return BeanUtils.toBean(messageDO, TranslateRespVo.class);
|
||||||
messageDO.setPetName("猫猫翻译");
|
|
||||||
messageDO.setPetAvatar("https://img1.baidu.com/it/u=1224902049,3440357835&fm=253&app=138&f=JPEG?w=801&h=800");
|
|
||||||
//获取当前最后的排序
|
|
||||||
AiDialogMessageDO aiDialogMessageDO = aiDialogMessageMapper.selectOne(new LambdaQueryWrapper<AiDialogMessageDO>()
|
|
||||||
.eq(AiDialogMessageDO::getDialogId, fileReqVo.getDialogId())
|
|
||||||
.orderByDesc(AiDialogMessageDO::getMessageOrder)
|
|
||||||
.last("limit 1")
|
|
||||||
);
|
|
||||||
messageDO.setMessageOrder(aiDialogMessageDO == null ? 1 : aiDialogMessageDO.getMessageOrder() + 1);
|
|
||||||
messageDO.setCreateTime(LocalDateTime.now());
|
|
||||||
}
|
|
||||||
int i = messageDO.getId() == null ? aiDialogMessageMapper.insert(messageDO) : aiDialogMessageMapper.updateById(messageDO);
|
|
||||||
TranslateRespVo bean = BeanUtils.toBean(messageDO, TranslateRespVo.class);
|
|
||||||
bean.setId(messageDO.getId());
|
|
||||||
return bean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
@@ -139,35 +178,54 @@ public class AiDialogServiceImpl extends ServiceImpl<AiDialogMapper, AiDialogDO>
|
|||||||
//数据解析
|
//数据解析
|
||||||
JSONObject translateResult = JSON.parseObject(result);
|
JSONObject translateResult = JSON.parseObject(result);
|
||||||
|
|
||||||
if (translateResult.isEmpty() || !translateResult.containsKey("intent_result") || !translateResult.getBoolean("is_species_sound")) {
|
//翻译失败
|
||||||
|
if (translateResult.isEmpty()
|
||||||
|
|| !translateResult.containsKey("intent_result")
|
||||||
|
|| !translateResult.getBoolean("is_species_sound")
|
||||||
|
|| translateResult.getDouble("confidence") < 0.7
|
||||||
|
) {
|
||||||
messageDO.setTransStatus(0);
|
messageDO.setTransStatus(0);
|
||||||
messageDO.setTransResult("");
|
messageDO.setTransResult(failedStr.get(RandomUtil.randomInt(failedStr.size())));
|
||||||
return messageDO;
|
return messageDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
//标签 如 cat dog
|
//标签 如 cat dog
|
||||||
String speciesLabels = translateResult.getString("species_labels");
|
String speciesLabels = translateResult.getString("species_labels");
|
||||||
//解析翻译结果
|
//解析翻译结果
|
||||||
JSONObject probabilities = translateResult.getJSONObject("intent_result")
|
JSONObject intentResult = translateResult.getJSONObject("intent_result");
|
||||||
.getJSONObject("probabilities");
|
|
||||||
|
|
||||||
|
//宠物档案 todo
|
||||||
|
messageDO.setPetId(1l);
|
||||||
|
messageDO.setPetName(petName.get(speciesLabels));
|
||||||
|
messageDO.setPetAvatar(petAvatars.get(speciesLabels));
|
||||||
|
messageDO.setPetType(speciesLabels);
|
||||||
|
//识别物种,无法翻译音频
|
||||||
|
if (intentResult.getDouble("confidence")<0.7){
|
||||||
|
messageDO.setTransStatus(0);
|
||||||
|
List<String> petFailResult = failedMap.get(speciesLabels);
|
||||||
|
if (petFailResult == null) {
|
||||||
|
petFailResult = failedMap.get("common");
|
||||||
|
}
|
||||||
|
messageDO.setTransResult(petFailResult.get(RandomUtil.randomInt(petFailResult.size())));
|
||||||
|
return messageDO;
|
||||||
|
}
|
||||||
|
//都识别成功后 也有不同的翻译结果
|
||||||
|
JSONObject probabilities = intentResult.getJSONObject("probabilities");
|
||||||
String resultKey = probabilities.entrySet().stream()
|
String resultKey = probabilities.entrySet().stream()
|
||||||
.filter(entry -> entry.getValue() instanceof Number)
|
|
||||||
.max(Comparator.comparingDouble(entry -> ((Number) entry.getValue()).doubleValue()))
|
.max(Comparator.comparingDouble(entry -> ((Number) entry.getValue()).doubleValue()))
|
||||||
.map(Map.Entry::getKey)
|
.map(Map.Entry::getKey)
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
|
//根据key解析结果
|
||||||
//返回结果
|
String emo = StrUtil.isBlank(resultKey) ? "" : resultKey.split(cn.hutool.core.util.StrUtil.UNDERLINE)[1];
|
||||||
messageDO.setPetType(speciesLabels);
|
List<String> emoList = successMap.get(emo);
|
||||||
messageDO.setTransStatus(1);
|
messageDO.setTransStatus(1);
|
||||||
messageDO.setTransResult(StrUtil.isBlank(resultKey) ? "" : resultKey.split(StrUtil.UNDERLINE)[1]);
|
messageDO.setTransResult(emoList.get(RandomUtil.randomInt(emoList.size())));
|
||||||
|
|
||||||
return messageDO;
|
return messageDO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
InputStream inputStream = getInputStreamFromUrl("https://petshy.tashowz.com/admin-api/infra/file/29/get/857def513547ec33a105f71108c8ece329cb64dacc3a4779c94b0fcc3398cc32.webm");
|
|
||||||
AudioInputStream audioStream = AudioSystem.getAudioInputStream(inputStream);
|
|
||||||
System.out.println((long) (audioStream.getFrameLength() / audioStream.getFormat().getFrameRate()));
|
|
||||||
// byte[] bytes = HttpUtil.downloadBytes("http://192.168.1.231:48080/admin-api/infra/file/29/get/c7351abf780f18600c104ec5662d843783ed8c309c01fb427046565217f51102.wav");
|
// byte[] bytes = HttpUtil.downloadBytes("http://192.168.1.231:48080/admin-api/infra/file/29/get/c7351abf780f18600c104ec5662d843783ed8c309c01fb427046565217f51102.wav");
|
||||||
//
|
//
|
||||||
//// File file = new File("http://192.168.1.231:48080/admin-api/infra/file/29/get/c7351abf780f18600c104ec5662d843783ed8c309c01fb427046565217f51102.wav");
|
//// File file = new File("http://192.168.1.231:48080/admin-api/infra/file/29/get/c7351abf780f18600c104ec5662d843783ed8c309c01fb427046565217f51102.wav");
|
||||||
@@ -177,19 +235,4 @@ public class AiDialogServiceImpl extends ServiceImpl<AiDialogMapper, AiDialogDO>
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static InputStream getInputStreamFromUrl(String urlString) throws Exception {
|
|
||||||
URL url = new URL(urlString);
|
|
||||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
|
||||||
connection.setRequestMethod("GET"); // 可以是GET, POST等
|
|
||||||
connection.setConnectTimeout(5000); // 设置连接超时时间
|
|
||||||
connection.setReadTimeout(5000); // 设置读取超时时间
|
|
||||||
int responseCode = connection.getResponseCode(); // 获取响应码
|
|
||||||
if (responseCode == HttpURLConnection.HTTP_OK) { // 状态码200表示成功
|
|
||||||
return connection.getInputStream();
|
|
||||||
} else {
|
|
||||||
// 处理错误情况,例如抛出异常或返回null等
|
|
||||||
throw new RuntimeException("Failed : HTTP error code : " + responseCode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -25,6 +25,14 @@
|
|||||||
<artifactId>tashow-framework-env</artifactId>
|
<artifactId>tashow-framework-env</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.jaudiotagger/jaudiotagger -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jaudiotagger</groupId>
|
||||||
|
<artifactId>jaudiotagger</artifactId>
|
||||||
|
<version>2.0.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<!-- 依赖服务 -->
|
<!-- 依赖服务 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tashow.cloud</groupId>
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
|||||||
@@ -29,14 +29,13 @@ import static com.tashow.cloud.infra.framework.file.core.utils.FileTypeUtils.wri
|
|||||||
@RequestMapping("/infra/file")
|
@RequestMapping("/infra/file")
|
||||||
@Validated
|
@Validated
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@PermitAll
|
|
||||||
public class FileController {
|
public class FileController {
|
||||||
|
|
||||||
@Resource private FileService fileService;
|
@Resource private FileService fileService;
|
||||||
|
|
||||||
/** 上传文件", description = "模式一:后端上传文件 */
|
/** 上传文件", description = "模式一:后端上传文件 */
|
||||||
@PostMapping("/upload")
|
@PostMapping("/upload")
|
||||||
public CommonResult<String> uploadFile(FileUploadReqVO uploadReqVO) throws Exception {
|
public CommonResult<String> uploadFile(@Valid FileUploadReqVO uploadReqVO) throws Exception {
|
||||||
MultipartFile file = uploadReqVO.getFile();
|
MultipartFile file = uploadReqVO.getFile();
|
||||||
String path = uploadReqVO.getPath();
|
String path = uploadReqVO.getPath();
|
||||||
return success(
|
return success(
|
||||||
@@ -88,7 +87,6 @@ public class FileController {
|
|||||||
response.setStatus(HttpStatus.NOT_FOUND.value());
|
response.setStatus(HttpStatus.NOT_FOUND.value());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
response.setContentLength(content.length);
|
|
||||||
writeAttachment(response, path, content);
|
writeAttachment(response, path, content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,20 @@ import com.alibaba.ttl.TransmittableThreadLocal;
|
|||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
import org.apache.tika.Tika;
|
import org.apache.tika.Tika;
|
||||||
|
import org.jaudiotagger.audio.AudioFile;
|
||||||
|
import org.jaudiotagger.audio.AudioFileIO;
|
||||||
|
import org.jaudiotagger.audio.exceptions.CannotReadException;
|
||||||
|
import org.jaudiotagger.audio.exceptions.CannotWriteException;
|
||||||
|
import org.jaudiotagger.audio.exceptions.InvalidAudioFrameException;
|
||||||
|
import org.jaudiotagger.audio.exceptions.ReadOnlyFileException;
|
||||||
|
import org.jaudiotagger.tag.Tag;
|
||||||
|
import org.jaudiotagger.tag.TagException;
|
||||||
|
import org.jaudiotagger.tag.id3.AbstractID3v2Tag;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
|
import java.net.URL;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -64,7 +76,7 @@ public class FileTypeUtils {
|
|||||||
String contentType = getMineType(content, filename);
|
String contentType = getMineType(content, filename);
|
||||||
response.setContentType(contentType);
|
response.setContentType(contentType);
|
||||||
// 针对 video 的特殊处理,解决视频地址在移动端播放的兼容性问题
|
// 针对 video 的特殊处理,解决视频地址在移动端播放的兼容性问题
|
||||||
if (StrUtil.containsIgnoreCase(contentType, "video")) {
|
if (StrUtil.containsIgnoreCase(contentType, "video")||StrUtil.containsIgnoreCase(contentType, "audio")) {
|
||||||
response.setHeader("Content-Length", String.valueOf(content.length - 1));
|
response.setHeader("Content-Length", String.valueOf(content.length - 1));
|
||||||
response.setHeader("Content-Range", String.valueOf(content.length - 1));
|
response.setHeader("Content-Range", String.valueOf(content.length - 1));
|
||||||
response.setHeader("Accept-Ranges", "bytes");
|
response.setHeader("Accept-Ranges", "bytes");
|
||||||
@@ -73,4 +85,21 @@ public class FileTypeUtils {
|
|||||||
IoUtil.write(response.getOutputStream(), false, content);
|
IoUtil.write(response.getOutputStream(), false, content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) throws CannotReadException, TagException, InvalidAudioFrameException, ReadOnlyFileException, IOException, CannotWriteException, URISyntaxException {
|
||||||
|
URL url = new URL("https://petshy.tashowz.com/admin-api/infra/file/29/get/jna2-雪球-难过焦虑.wav");
|
||||||
|
File file = new File(url.getFile());
|
||||||
|
System.out.println(file.exists());
|
||||||
|
AudioFile audioFile = AudioFileIO.read(file);
|
||||||
|
Tag tag = audioFile.getTag();
|
||||||
|
if (tag instanceof AbstractID3v2Tag) {
|
||||||
|
AbstractID3v2Tag id3v2Tag = (AbstractID3v2Tag) tag;
|
||||||
|
// id3v2Tag.delete(); // 删除所有ID3标签
|
||||||
|
} else {
|
||||||
|
System.out.println("The file does not contain ID3v2 tags.");
|
||||||
|
}
|
||||||
|
AudioFileIO.write(audioFile); // 保存更改
|
||||||
|
System.out.println("ID3 tags removed successfully.");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
-- 将该建表 SQL 语句,添加到 yudao-module-${table.moduleName}-biz 模块的 test/resources/sql/create_tables.sql 文件里
|
-- 将该建表 SQL 语句,添加到 yudao-module-${table.moduleName}-biz 模块的 test/resources/sql/create_tableslogin.sql 文件里
|
||||||
CREATE TABLE IF NOT EXISTS "${table.tableName.toLowerCase()}" (
|
CREATE TABLE IF NOT EXISTS "${table.tableName.toLowerCase()}" (
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if (${column.javaType} == 'Long')
|
#if (${column.javaType} == 'Long')
|
||||||
@@ -33,5 +33,5 @@ CREATE TABLE IF NOT EXISTS "${table.tableName.toLowerCase()}" (
|
|||||||
PRIMARY KEY ("${primaryColumn.columnName.toLowerCase()}")
|
PRIMARY KEY ("${primaryColumn.columnName.toLowerCase()}")
|
||||||
) COMMENT '${table.tableComment}';
|
) COMMENT '${table.tableComment}';
|
||||||
|
|
||||||
-- 将该删表 SQL 语句,添加到 yudao-module-${table.moduleName}-biz 模块的 test/resources/sql/clean.sql 文件里
|
-- 将该删表 SQL 语句,添加到 yudao-module-${table.moduleName}-biz 模块的 test/resources/sql/cleanlogin.sql 文件里
|
||||||
DELETE FROM "${table.tableName}";
|
DELETE FROM "${table.tableName}";
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<!-- 引用 Spring Boot 的 logback 基础配置 -->
|
<!-- 引用 Spring Boot 的 logback 基础配置 -->
|
||||||
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
|
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
|
||||||
<!-- 变量 yudao.info.base-package,基础业务包 -->
|
<!-- 变量 yudao.info.base-package,基础业务包 -->
|
||||||
<springProperty scope="context" name="yudao.info.base-package" source="yudao.info.base-package"/>
|
<springProperty scope="context" name="tashow.info.base-package" source="tashow.info.base-package"/>
|
||||||
<!-- 格式化输出:%d 表示日期,%X{tid} SkWalking 链路追踪编号,%thread 表示线程名,%-5level:级别从左显示 5 个字符宽度,%msg:日志消息,%n是换行符 -->
|
<!-- 格式化输出:%d 表示日期,%X{tid} SkWalking 链路追踪编号,%thread 表示线程名,%-5level:级别从左显示 5 个字符宽度,%msg:日志消息,%n是换行符 -->
|
||||||
<property name="PATTERN_DEFAULT" value="%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} | %highlight(${LOG_LEVEL_PATTERN:-%5p} ${PID:- }) | %boldYellow(%thread [%tid]) %boldGreen(%-40.40logger{39}) | %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/>
|
<property name="PATTERN_DEFAULT" value="%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} | %highlight(${LOG_LEVEL_PATTERN:-%5p} ${PID:- }) | %boldYellow(%thread [%tid]) %boldGreen(%-40.40logger{39}) | %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/>
|
||||||
|
|
||||||
|
|||||||
0
tashow-module/tashow-module-pay/Dockerfile
Normal file
0
tashow-module/tashow-module-pay/Dockerfile
Normal file
101
tashow-module/tashow-module-pay/pom.xml
Normal file
101
tashow-module/tashow-module-pay/pom.xml
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-module</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>tashow-module-pay</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>${project.artifactId}</name>
|
||||||
|
<description>
|
||||||
|
pay 模块,我们放支付业务,提供业务的支付能力。
|
||||||
|
例如说:商户、应用、支付、退款等等
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- Spring Cloud 基础 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-framework-env</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 依赖服务 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-pay-api</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Web 相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-framework-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- DB 相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-data-mybatis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-data-redis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- RPC 远程调用相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-framework-rpc</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Registry 注册中心相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Config 配置中心相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 工具类相关 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-data-excel</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tashow.cloud</groupId>
|
||||||
|
<artifactId>tashow-framework-tenant</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<!-- 设置构建的 jar 包名 -->
|
||||||
|
<finalName>${project.artifactId}</finalName>
|
||||||
|
<plugins>
|
||||||
|
<!-- 打包 -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<version>${spring.boot.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal> <!-- 将引入的 jar 打入其中 -->
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user