diff --git a/common/common-framework/src/main/java/cn/iocoder/common/framework/util/CollectionUtils.java b/common/common-framework/src/main/java/cn/iocoder/common/framework/util/CollectionUtils.java index e9d58a44f..caccab73a 100644 --- a/common/common-framework/src/main/java/cn/iocoder/common/framework/util/CollectionUtils.java +++ b/common/common-framework/src/main/java/cn/iocoder/common/framework/util/CollectionUtils.java @@ -48,4 +48,8 @@ public class CollectionUtils { return org.springframework.util.CollectionUtils.containsAny(source, candidates); } + public static T getFirst(List from) { + return !isEmpty(from) ? from.get(0) : null; + } + } diff --git a/docs/sql/old/mall_order.sql b/docs/sql/old/mall_order.sql index 8d95ffc7a..0631edf2f 100644 --- a/docs/sql/old/mall_order.sql +++ b/docs/sql/old/mall_order.sql @@ -1,71 +1,3 @@ -/* - Navicat Premium Data Transfer - - Source Server : onemall - Source Server Type : MySQL - Source Server Version : 50726 - Source Host : 192.168.88.14:3306 - Source Schema : mall_order - - Target Server Type : MySQL - Target Server Version : 50726 - File Encoding : 65001 - - Date: 13/03/2020 07:36:38 -*/ - -SET NAMES utf8mb4; -SET FOREIGN_KEY_CHECKS = 0; - --- ---------------------------- --- Table structure for cart_item --- ---------------------------- -DROP TABLE IF EXISTS `cart_item`; -CREATE TABLE `cart_item` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '编号,唯一自增。', - `status` tinyint(4) NOT NULL DEFAULT '-1' COMMENT '状态\n *\n * 1-正常\n * 2-主动删除\n * 3-下单删除', - `delete_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '商品在购物车中的删除时间', - `selected` bit(1) NOT NULL COMMENT '是否选中', - `user_id` int(11) NOT NULL COMMENT '用户编号', - `spu_id` int(11) NOT NULL COMMENT '商品 SPU 编号', - `sku_id` int(11) NOT NULL COMMENT '商品 SKU 编号', - `quantity` int(11) NOT NULL COMMENT '商品购买数量', - `order_id` int(11) DEFAULT NULL COMMENT '订单编号', - `order_create_time` timestamp NULL DEFAULT NULL COMMENT '订单创建时间', - `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb4 COMMENT='cart_item'; - --- ---------------------------- --- Records of cart_item --- ---------------------------- -BEGIN; -INSERT INTO `cart_item` VALUES (1, 2, '2019-04-17 20:45:25', b'1', 1, 29, 33, 6, NULL, '2019-04-11 17:00:37', '2019-04-11 17:00:37', '2019-04-17 20:45:25'); -INSERT INTO `cart_item` VALUES (2, 2, '2019-04-14 01:27:15', b'1', 1, 28, 32, 1, NULL, '2019-04-13 21:28:36', '2019-04-13 21:28:37', '2019-04-14 01:27:15'); -INSERT INTO `cart_item` VALUES (3, 2, '2019-04-20 19:57:31', b'1', 1, 29, 33, 3, NULL, '2019-04-14 01:37:45', '2019-04-14 01:37:45', '2019-04-20 19:57:31'); -INSERT INTO `cart_item` VALUES (4, 2, '2019-04-20 19:57:31', b'1', 1, 32, 34, 1, NULL, '2019-04-17 10:23:55', '2019-04-17 10:23:56', '2019-04-20 19:57:31'); -INSERT INTO `cart_item` VALUES (5, 1, '2019-04-19 20:35:36', b'1', 29, 32, 34, 1, NULL, '2019-04-19 20:35:36', '2019-04-19 20:35:37', '2019-04-19 20:35:36'); -INSERT INTO `cart_item` VALUES (6, 1, '2019-04-19 20:35:46', b'1', 29, 28, 31, 4, NULL, '2019-04-19 20:35:46', '2019-04-19 20:35:46', '2019-04-19 20:35:46'); -INSERT INTO `cart_item` VALUES (7, 1, '2019-05-05 16:00:18', b'1', 57, 33, 36, 1, NULL, '2019-05-05 16:00:18', '2019-05-05 16:00:19', '2019-05-05 16:00:18'); -INSERT INTO `cart_item` VALUES (8, 1, '2019-05-07 18:14:26', b'1', 62, 41, 50, 1, NULL, '2019-05-07 18:14:26', '2019-05-07 18:14:26', '2019-05-07 18:14:26'); -INSERT INTO `cart_item` VALUES (9, 1, '2019-05-08 16:38:51', b'1', 64, 33, 37, 1, NULL, '2019-05-08 16:38:51', '2019-05-08 16:38:51', '2019-05-08 16:38:51'); -INSERT INTO `cart_item` VALUES (10, 1, '2019-05-08 20:16:26', b'1', 65, 29, 33, 1, NULL, '2019-05-08 20:16:26', '2019-05-08 20:16:26', '2019-05-08 20:16:26'); -INSERT INTO `cart_item` VALUES (11, 1, '2019-05-09 19:37:04', b'1', 66, 32, 34, 1, NULL, NULL, '2019-05-09 19:37:04', '2019-05-09 19:37:04'); -INSERT INTO `cart_item` VALUES (12, 1, '2019-05-09 19:38:22', b'1', 66, 29, 33, 1, NULL, NULL, '2019-05-09 19:38:23', '2019-05-09 19:38:22'); -INSERT INTO `cart_item` VALUES (13, 1, '2019-05-09 19:38:26', b'1', 66, 29, 51, 8, NULL, NULL, '2019-05-09 19:38:27', '2019-05-09 19:38:26'); -INSERT INTO `cart_item` VALUES (14, 2, '2019-05-17 13:51:10', b'1', 1, 35, 40, 1, NULL, NULL, '2019-05-17 13:47:05', '2019-05-17 13:51:10'); -INSERT INTO `cart_item` VALUES (15, 2, '2019-05-17 13:51:10', b'1', 1, 28, 31, 1, NULL, NULL, '2019-05-17 13:47:15', '2019-05-17 13:51:10'); -INSERT INTO `cart_item` VALUES (16, 1, '2019-05-17 17:49:48', b'1', 73, 33, 36, 1, NULL, NULL, '2019-05-17 17:49:48', '2019-05-17 17:49:48'); -INSERT INTO `cart_item` VALUES (17, 1, '2019-05-17 17:49:53', b'1', 73, 33, 37, 1, NULL, NULL, '2019-05-17 17:49:53', '2019-05-17 17:49:53'); -INSERT INTO `cart_item` VALUES (18, 2, '2019-05-17 17:58:51', b'1', 1, 29, 33, 2, NULL, NULL, '2019-05-17 17:58:23', '2019-05-17 17:58:51'); -INSERT INTO `cart_item` VALUES (19, 2, '2019-05-17 17:58:51', b'1', 1, 28, 31, 1, NULL, NULL, '2019-05-17 17:58:40', '2019-05-17 17:58:51'); -INSERT INTO `cart_item` VALUES (20, 1, '2019-08-10 15:37:17', b'1', 195, 34, 38, 1, NULL, NULL, '2019-08-10 15:37:16', '2019-08-10 15:37:17'); -INSERT INTO `cart_item` VALUES (21, 2, '2019-08-12 17:35:07', b'1', 197, 33, 36, 1, NULL, NULL, '2019-08-12 17:29:04', '2019-08-12 17:35:07'); -INSERT INTO `cart_item` VALUES (22, 2, '2019-08-12 18:01:38', b'1', 197, 33, 36, 1, NULL, NULL, '2019-08-12 17:58:38', '2019-08-12 18:01:38'); -INSERT INTO `cart_item` VALUES (23, 1, '2019-08-12 18:29:58', b'1', 197, 33, 36, 1, NULL, NULL, '2019-08-12 18:29:59', '2019-08-12 18:29:58'); -COMMIT; - -- ---------------------------- -- Table structure for order_cancel -- ---------------------------- @@ -81,17 +13,6 @@ CREATE TABLE `order_cancel` ( PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; --- ---------------------------- --- Records of order_cancel --- ---------------------------- -BEGIN; -INSERT INTO `order_cancel` VALUES (5, 11, 'd31a7b9e2bb2483787dc601127f94c4d', 2, NULL, '2019-03-30 17:48:17', NULL); -INSERT INTO `order_cancel` VALUES (6, 47, '29635cff9cc8419', 7, NULL, '2019-04-12 19:55:50', NULL); -INSERT INTO `order_cancel` VALUES (7, 48, '8472c75db7794b', 6, NULL, '2019-04-12 19:56:07', NULL); -INSERT INTO `order_cancel` VALUES (8, 95, '7aa0c5558746431b', 2, NULL, '2019-05-05 19:44:31', NULL); -INSERT INTO `order_cancel` VALUES (9, 49, '00be8f5971c24b', 1, NULL, '2019-05-17 13:34:14', NULL); -COMMIT; - -- ---------------------------- -- Table structure for order_exchange -- ---------------------------- @@ -118,116 +39,6 @@ CREATE TABLE `order_exchange` ( PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- ---------------------------- --- Table structure for order_item --- ---------------------------- -DROP TABLE IF EXISTS `order_item`; -CREATE TABLE `order_item` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id自增长', - `order_id` int(11) NOT NULL COMMENT '订单编号', - `order_no` varchar(50) NOT NULL COMMENT '订单号', - `order_logistics_id` int(11) DEFAULT NULL COMMENT '物流id', - `sku_id` int(11) NOT NULL COMMENT '商品id', - `sku_name` varchar(50) NOT NULL COMMENT '商品名字', - `sku_image` varchar(250) NOT NULL COMMENT '图片名字', - `quantity` int(3) NOT NULL COMMENT '商品数量', - `origin_price` int(11) NOT NULL COMMENT '原始单价,单位:分', - `buy_price` int(11) NOT NULL COMMENT '购买单价,单位:分', - `present_price` int(11) NOT NULL COMMENT '最终价格,单位:分', - `buy_total` int(11) NOT NULL COMMENT '购买总金额,单位:分', - `discount_total` int(11) NOT NULL COMMENT '优惠总金额,单位:分', - `present_total` int(11) NOT NULL COMMENT '最终总金额,单位:分', - `payment_time` datetime DEFAULT NULL COMMENT '付款时间', - `delivery_time` datetime DEFAULT NULL COMMENT '发货时间', - `receiver_time` datetime DEFAULT NULL COMMENT '收货时间', - `closing_time` datetime DEFAULT NULL, - `has_return_exchange` int(11) DEFAULT NULL COMMENT '是否退换货', - `create_time` datetime NOT NULL COMMENT '创建时间', - `update_time` datetime DEFAULT NULL COMMENT '更新时间', - `remark` varchar(250) DEFAULT NULL COMMENT '备注', - `delivery_type` int(2) NOT NULL COMMENT '发送方式', - `status` smallint(2) NOT NULL COMMENT '状态:0、代发货 1、已发货 2、已收货 20、换货中 21、换货成功 40、退货中 41、已退货', - `deleted` smallint(2) NOT NULL COMMENT '删除状态', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=171 DEFAULT CHARSET=utf8; - --- ---------------------------- --- Records of order_item --- ---------------------------- -BEGIN; -INSERT INTO `order_item` VALUES (19, 47, '29635cff9cc841948ef3c2cfc3fb7911', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 1, '2019-04-11 22:15:32', NULL, NULL, 1, 5, 0); -INSERT INTO `order_item` VALUES (20, 48, '8472c75db7794b158ce9c3146fbb4e02', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 1, '2019-04-11 22:16:03', NULL, NULL, 1, 5, 0); -INSERT INTO `order_item` VALUES (21, 49, '00be8f5971c24bbcbddf9014bb0d2310', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 1, '2019-04-11 22:19:17', NULL, NULL, 1, 5, 0); -INSERT INTO `order_item` VALUES (22, 50, 'b4e42922b2634c1a94f01b2d66eeb8bf', 34, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 0, 0, 0, 0, NULL, NULL, '2019-04-12 21:27:14', '2019-05-09 22:44:34', 1, '2019-04-11 22:19:42', NULL, NULL, 1, 4, 0); -INSERT INTO `order_item` VALUES (23, 51, '76c163c61ffb465f', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 6, 10, 60, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 1, '2019-04-14 01:27:15', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (24, 51, '76c163c61ffb465f', NULL, 32, '测试商品', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694b02ef0df7?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 2, 2, 0, 0, 0, 0, NULL, NULL, NULL, NULL, 1, '2019-04-14 01:27:15', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (25, 74, '2186b8b4ca32442c', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 3, 10, 10, 8, 200, 40, 160, NULL, NULL, NULL, NULL, 1, '2019-04-20 19:57:27', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (26, 74, '2186b8b4ca32442c', NULL, 34, '农夫山泉', 'https://img.1000.com/qm-a-img/prod/000000/68635d48f57444c8a5ffd47a257dc3d7.jpg', 1, 125, 50, 50, 1000, 0, 1000, NULL, NULL, NULL, NULL, 1, '2019-04-20 19:57:27', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (27, 75, '0668f5a6d168471c', NULL, 31, '测试商品', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694b02ef0df7?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 1, 1, 1, 100, 0, 100, NULL, NULL, NULL, NULL, 1, '2019-04-20 19:58:10', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (28, 76, '6f465f43b2f34a3f', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 8, 200, 40, 160, NULL, NULL, NULL, NULL, 1, '2019-04-20 22:19:28', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (41, 89, 'd4867f5320bb4d07', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 8, 200, 40, 160, NULL, NULL, NULL, NULL, 1, '2019-04-20 23:42:56', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (42, 90, '2667b89fbb5e49d9', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 8, 200, 40, 160, NULL, NULL, NULL, NULL, 1, '2019-04-20 23:44:43', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (47, 95, '7aa0c5558746431b', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 8, 200, 40, 160, NULL, NULL, NULL, NULL, 1, '2019-04-21 02:17:24', NULL, NULL, 1, 5, 0); -INSERT INTO `order_item` VALUES (49, 97, '2dd9173348c94047', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 8, 200, 40, 160, NULL, NULL, NULL, NULL, 1, '2019-04-21 14:22:49', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (50, 98, '5987e77245064f5c', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 8, 200, 40, 160, NULL, NULL, NULL, NULL, 1, '2019-04-21 15:01:50', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (51, 99, '0aa0ff0bb2a74180', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 8, 200, 40, 160, NULL, NULL, NULL, NULL, 1, '2019-04-21 15:05:21', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (53, 101, 'e7f4804c54774747', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 8, 200, 40, 160, NULL, NULL, NULL, NULL, 1, '2019-04-21 15:06:30', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (54, 102, 'cdff09a25c724c02', NULL, 31, '测试商品', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694b02ef0df7?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 1, 1, 1, 100, 0, 100, NULL, NULL, NULL, NULL, 1, '2019-04-21 15:10:39', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (55, 103, '7de9b6251e434807', NULL, 31, '测试商品', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694b02ef0df7?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 1, 1, 1, 100, 0, 100, NULL, NULL, NULL, NULL, 1, '2019-04-21 15:14:17', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (56, 104, '80475d74fc1f4a56', NULL, 31, '测试商品', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694b02ef0df7?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 1, 1, 1, 100, 0, 100, NULL, NULL, NULL, NULL, 1, '2019-04-21 15:19:19', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (57, 105, 'ce4966bed7104dd5', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 8, 200, 40, 160, NULL, NULL, NULL, NULL, 1, '2019-04-21 18:59:24', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (58, 106, 'a72347c6571f4f74', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 8, 200, 40, 160, NULL, NULL, NULL, NULL, 1, '2019-04-21 19:08:18', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (59, 107, '7dedc1e8c6484530', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 8, 200, 40, 160, NULL, NULL, NULL, NULL, 1, '2019-04-21 19:22:19', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (61, 109, '0635a03e4ad8439d', NULL, 31, '测试商品', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694b02ef0df7?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 1, 1, 1, 100, 0, 100, NULL, NULL, NULL, NULL, 1, '2019-04-21 19:57:14', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (62, 110, '8cfb63d2f17445bb', NULL, 31, '测试商品', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694b02ef0df7?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 1, 1, 1, 100, 0, 100, NULL, NULL, NULL, NULL, 1, '2019-04-21 20:17:04', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (63, 111, '11e64862f6d94ceb', NULL, 34, '农夫山泉', 'https://img.1000.com/qm-a-img/prod/000000/68635d48f57444c8a5ffd47a257dc3d7.jpg', 1, 125, 50, 50, 1000, 0, 1000, NULL, NULL, NULL, NULL, 1, '2019-04-21 20:24:05', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (64, 112, '472994edfd90458d', NULL, 34, '农夫山泉', 'https://img.1000.com/qm-a-img/prod/000000/68635d48f57444c8a5ffd47a257dc3d7.jpg', 1, 125, 50, 50, 1000, 0, 1000, NULL, NULL, '2019-04-22 19:32:42', NULL, 1, '2019-04-21 20:37:45', NULL, NULL, 1, 4, 0); -INSERT INTO `order_item` VALUES (65, 113, 'aee52dfc8bef4603', NULL, 34, '农夫山泉', 'https://img.1000.com/qm-a-img/prod/000000/68635d48f57444c8a5ffd47a257dc3d7.jpg', 1, 125, 50, 50, 1000, 0, 1000, NULL, NULL, NULL, NULL, 1, '2019-04-21 20:51:38', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (66, 114, '2da845ff0da74b8b', NULL, 34, '农夫山泉', 'https://img.1000.com/qm-a-img/prod/000000/68635d48f57444c8a5ffd47a257dc3d7.jpg', 1, 125, 50, 50, 1000, 0, 1000, NULL, NULL, NULL, NULL, 1, '2019-04-21 22:38:24', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (67, 115, '23ce74ee3cbc49d8', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 8, 200, 40, 160, NULL, NULL, NULL, NULL, 1, '2019-04-21 23:29:21', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (70, 118, '6d73bb4e01c349d6', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 8, 200, 40, 160, NULL, NULL, NULL, NULL, 1, '2019-04-22 17:06:00', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (72, 120, '6377703d238e4b88', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 8, 200, 40, 160, NULL, NULL, NULL, NULL, 1, '2019-04-22 19:31:55', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (73, 121, '3dc33dcaf4b24724', NULL, 41, 'Oracle', 'https://static.oschina.net/img/logo/oracle.gif', 1, 2000, 2000, 2000, 44000, 0, 44000, NULL, NULL, NULL, NULL, 1, '2019-04-22 19:35:45', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (74, 122, '6074931dc45541f9', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 8, 200, 40, 160, NULL, NULL, NULL, NULL, 1, '2019-04-22 20:51:39', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (76, 124, 'fc6c662e66a24a86', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 8, 200, 40, 160, NULL, NULL, NULL, NULL, 1, '2019-04-22 22:19:58', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (77, 125, '0c17c9bc441645f2', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 8, 200, 40, 160, NULL, NULL, NULL, NULL, 1, '2019-04-22 22:21:26', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (79, 127, 'af5c4f40bc9c478d', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 10, 10, 0, 10, NULL, NULL, NULL, NULL, 1, '2019-04-22 22:28:21', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (80, 128, '53cd76bff19242e8', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 10, 10, 0, 10, NULL, NULL, NULL, NULL, 1, '2019-04-22 22:29:16', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (81, 129, 'a8a40abdb2cc430b', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 10, 10, 0, 10, NULL, NULL, NULL, NULL, 1, '2019-04-22 22:37:18', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (82, 130, 'e6d4fe973a404508', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 10, 10, 0, 10, NULL, NULL, NULL, NULL, 1, '2019-04-22 22:37:23', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (83, 131, 'e2edc556fff847c5', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 10, 10, 0, 10, NULL, NULL, NULL, NULL, 1, '2019-04-23 00:22:22', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (84, 132, 'a6d7da64863c499e', NULL, 33, 'kafka 实战', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10, 10, 10, 10, 0, 10, NULL, NULL, NULL, NULL, 1, '2019-04-23 10:03:50', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (85, 133, 'e815710ad0014f35', NULL, 36, 'Kafka 书籍汇总', 'http://static.iocoder.cn/kafka.png', 1, 10000, 10000, 10000, 10000, 0, 10000, NULL, NULL, NULL, NULL, 1, '2019-04-27 00:02:20', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (86, 134, 'a624ad4406554db5', NULL, 36, 'Kafka 书籍汇总', 'http://static.iocoder.cn/kafka.png', 1, 10000, 10000, 10000, 10000, 0, 10000, NULL, NULL, NULL, NULL, 1, '2019-04-27 00:43:06', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (87, 135, 'ffff6dd443a844ee', NULL, 36, 'Kafka 书籍汇总', 'http://static.iocoder.cn/kafka.png', 1, 10000, 10000, 10000, 10000, 0, 10000, NULL, NULL, NULL, NULL, 1, '2019-04-27 00:44:09', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (107, 159, '2a5a8df629764732', NULL, 33, 'kafka 实战第一版', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10000000, 10000000, 8000000, 10000000, 2000000, 8000000, NULL, NULL, NULL, NULL, 1, '2019-05-09 01:10:40', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (108, 160, 'c1775cdb254d4700', NULL, 33, 'kafka 实战第一版', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10000000, 10000000, 8000000, 10000000, 2000000, 8000000, NULL, NULL, NULL, NULL, 1, '2019-05-09 01:15:01', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (112, 164, 'c75d9c0abc264f53', NULL, 33, 'kafka 实战第一版', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10000000, 10000000, 8000000, 10000000, 2000000, 8000000, NULL, NULL, NULL, NULL, 1, '2019-05-09 01:47:25', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (113, 165, 'afd122fa875549de', NULL, 33, 'kafka 实战第一版', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10000000, 10000000, 8000000, 10000000, 2000000, 8000000, NULL, NULL, NULL, NULL, 1, '2019-05-09 16:52:09', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (121, 173, '45c90cf80f904cf8', NULL, 33, 'kafka 实战第一版', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10000000, 10000000, 8000000, 10000000, 2000000, 8000000, NULL, NULL, NULL, NULL, 1, '2019-05-09 20:36:10', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (122, 174, 'b646bca1a2f84226', NULL, 38, 'MySQL', 'https://static.oschina.net/img/logo/mysql.png', 1, 2000, 2000, 2000, 2000, 0, 2000, NULL, NULL, NULL, NULL, 1, '2019-05-10 01:16:45', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (124, 176, '56d8e004a4ce4aaa', NULL, 36, 'Kafka 书籍汇总', 'http://static.iocoder.cn/kafka.png', 1, 10000, 10000, 10000, 10000, 0, 10000, NULL, NULL, NULL, NULL, 1, '2019-05-10 21:06:10', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (125, 178, 'bd01be1ea05a4113', NULL, 33, 'kafka 实战第一版', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10000000, 10000000, 8000000, 10000000, 2000000, 8000000, NULL, NULL, NULL, NULL, 1, '2019-05-11 21:38:14', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (126, 179, '06bd26225a7a45b8', NULL, 33, 'kafka 实战第一版', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10000000, 10000000, 8000000, 10000000, 2000000, 8000000, NULL, NULL, NULL, NULL, 1, '2019-05-12 00:06:47', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (132, 193, 'f547cf1a19d84702', NULL, 33, 'kafka 实战第一版', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10000000, 10000000, 8000000, 10000000, 2000000, 8000000, NULL, NULL, NULL, NULL, 1, '2019-05-12 00:33:04', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (133, 194, '3bc06d86646c4624', NULL, 33, 'kafka 实战第一版', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10000000, 10000000, 8000000, 10000000, 2000000, 8000000, NULL, NULL, NULL, NULL, 1, '2019-05-12 00:44:16', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (134, 195, 'e3adfabd987340cb', NULL, 33, 'kafka 实战第一版', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10000000, 10000000, 8000000, 10000000, 2000000, 8000000, NULL, NULL, NULL, NULL, 1, '2019-05-12 00:45:14', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (135, 196, 'f2ab67d45fb444c3', NULL, 33, 'kafka 实战第一版', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 10000000, 10000000, 8000000, 10000000, 2000000, 8000000, NULL, NULL, NULL, NULL, 1, '2019-05-12 00:45:50', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (136, 197, 'd43d4a25052842bf', NULL, 36, 'Kafka 书籍汇总', 'http://static.iocoder.cn/kafka.png', 1, 10000, 10000, 9000, 10000, 1000, 9000, NULL, NULL, NULL, NULL, 1, '2019-05-12 18:38:32', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (158, 216, 'b8300a8bd1084815', NULL, 40, 'Oracle', 'https://static.oschina.net/img/logo/oracle.gif', 1, 5000, 5000, 5000, 5000, 0, 5000, NULL, NULL, NULL, NULL, 1, '2019-05-17 13:51:10', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (159, 216, 'b8300a8bd1084815', NULL, 31, '测试商品', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694b02ef0df7?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 100, 100, 100, 100, 0, 100, NULL, NULL, NULL, NULL, 1, '2019-05-17 13:51:10', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (160, 217, '1ee223bca4ae4ab6', NULL, 31, '测试商品', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694b02ef0df7?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 100, 100, 100, 100, 0, 100, NULL, NULL, NULL, NULL, 1, '2019-05-17 14:11:15', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (161, 218, '4f88cd5b7f5a4654', NULL, 31, '测试商品', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694b02ef0df7?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 100, 100, 49, 100, 51, 49, NULL, NULL, NULL, NULL, 1, '2019-05-17 14:21:18', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (162, 219, '7373c33d88d24c62', NULL, 31, '测试商品', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694b02ef0df7?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 100, 100, 100, 100, 0, 100, NULL, NULL, NULL, NULL, 1, '2019-05-17 15:18:22', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (163, 220, '06cafeb1b5504289', NULL, 36, 'Kafka 书籍汇总', 'http://static.iocoder.cn/kafka.png', 1, 10000, 10000, 9000, 10000, 1000, 9000, NULL, NULL, NULL, NULL, 1, '2019-05-17 17:46:31', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (164, 221, '44fed72a246d4b94', NULL, 33, 'kafka 实战第一版', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694ae392047b?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 2, 10000000, 10000000, 7999996, 20000000, 4000008, 15999992, NULL, NULL, NULL, NULL, 1, '2019-05-17 17:58:51', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (165, 221, '44fed72a246d4b94', NULL, 31, '测试商品', 'https://user-gold-cdn.xitu.io/2019/4/1/169d694b02ef0df7?imageView2/0/w/1280/h/960/format/jpeg/ignore-error/1', 1, 100, 100, 99, 100, 1, 99, NULL, NULL, NULL, NULL, 1, '2019-05-17 17:58:51', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (167, 223, 'fc6625e45ee54930', NULL, 42, 'Java', 'https://static.oschina.net/img/logo/java.png', 1, 5100, 5100, 5100, 5100, 0, 5100, NULL, NULL, NULL, NULL, 1, '2019-05-18 20:26:59', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (168, 224, 'dd6191439a0e431f', NULL, 36, 'Kafka 书籍汇总', 'http://static.iocoder.cn/kafka.png', 1, 10000, 10000, 10000, 10000, 0, 10000, NULL, NULL, NULL, NULL, 1, '2019-08-12 17:35:06', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (169, 225, '96d14ff467ef40e7', NULL, 36, 'Kafka 书籍汇总', 'http://static.iocoder.cn/kafka.png', 1, 10000, 10000, 10000, 10000, 0, 10000, NULL, NULL, NULL, NULL, 1, '2019-08-12 17:35:08', NULL, NULL, 1, 1, 0); -INSERT INTO `order_item` VALUES (170, 226, 'fb6602459e1c48bd', NULL, 36, 'Kafka 书籍汇总', 'http://static.iocoder.cn/kafka.png', 1, 10000, 10000, 10000, 10000, 0, 10000, NULL, NULL, NULL, NULL, 1, '2019-08-12 18:01:38', NULL, NULL, 1, 1, 0); -COMMIT; - -- ---------------------------- -- Table structure for order_logistics -- ---------------------------- @@ -267,13 +78,6 @@ CREATE TABLE `order_logistics_detail` ( PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; --- ---------------------------- --- Records of order_logistics_detail --- ---------------------------- -BEGIN; -INSERT INTO `order_logistics_detail` VALUES (1, 34, '2019-04-12 22:46:15', '已经到上海总部', '2019-04-12 22:46:27', NULL); -INSERT INTO `order_logistics_detail` VALUES (2, 24, '2019-04-12 22:46:42', '一道成都,正在发往长沙', '2019-04-12 22:46:58', NULL); -COMMIT; -- ---------------------------- -- Table structure for order_recipient @@ -292,79 +96,6 @@ CREATE TABLE `order_recipient` ( PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=189 DEFAULT CHARSET=utf8; --- ---------------------------- --- Records of order_recipient --- ---------------------------- -BEGIN; -INSERT INTO `order_recipient` VALUES (22, 47, '110101', 'Andy', '13302925934', 1, '中二环,光电大厦11F 前台收', '2019-04-11 22:15:32', NULL); -INSERT INTO `order_recipient` VALUES (23, 48, '110101', 'Andy', '13302925934', 1, '中二环,光电大厦11F 前台收', '2019-04-11 22:16:03', NULL); -INSERT INTO `order_recipient` VALUES (24, 49, '110101', 'Andy', '13302925934', 1, '中二环,光电大厦11F 前台收', '2019-04-11 22:19:17', NULL); -INSERT INTO `order_recipient` VALUES (25, 50, '110101', 'Andy', '13302925934', 1, '中二环,光电大厦11F 前台收', '2019-04-11 22:19:42', NULL); -INSERT INTO `order_recipient` VALUES (26, 51, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-14 01:27:15', NULL); -INSERT INTO `order_recipient` VALUES (49, 74, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-20 19:57:27', NULL); -INSERT INTO `order_recipient` VALUES (50, 75, '22033', 'sin', '18132019023', 1, '湖南省深圳市北京3环56号', '2019-04-20 19:58:10', NULL); -INSERT INTO `order_recipient` VALUES (51, 76, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-20 22:19:28', NULL); -INSERT INTO `order_recipient` VALUES (64, 89, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-20 23:42:56', NULL); -INSERT INTO `order_recipient` VALUES (65, 90, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-20 23:44:43', NULL); -INSERT INTO `order_recipient` VALUES (70, 95, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-21 02:17:24', NULL); -INSERT INTO `order_recipient` VALUES (72, 97, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-21 14:22:49', NULL); -INSERT INTO `order_recipient` VALUES (73, 98, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-21 15:01:50', NULL); -INSERT INTO `order_recipient` VALUES (74, 99, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-21 15:05:21', NULL); -INSERT INTO `order_recipient` VALUES (76, 101, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-21 15:06:30', NULL); -INSERT INTO `order_recipient` VALUES (77, 102, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-21 15:10:39', NULL); -INSERT INTO `order_recipient` VALUES (78, 103, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-21 15:14:17', NULL); -INSERT INTO `order_recipient` VALUES (79, 104, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-21 15:19:19', NULL); -INSERT INTO `order_recipient` VALUES (80, 105, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-21 18:59:24', NULL); -INSERT INTO `order_recipient` VALUES (81, 106, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-21 19:08:18', NULL); -INSERT INTO `order_recipient` VALUES (82, 107, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-21 19:22:19', NULL); -INSERT INTO `order_recipient` VALUES (84, 109, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-21 19:57:14', NULL); -INSERT INTO `order_recipient` VALUES (85, 110, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-21 20:17:04', NULL); -INSERT INTO `order_recipient` VALUES (86, 111, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-21 20:24:05', NULL); -INSERT INTO `order_recipient` VALUES (87, 112, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-21 20:37:45', NULL); -INSERT INTO `order_recipient` VALUES (88, 113, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-21 20:51:38', NULL); -INSERT INTO `order_recipient` VALUES (89, 114, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-21 22:38:24', NULL); -INSERT INTO `order_recipient` VALUES (90, 115, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-21 23:29:21', NULL); -INSERT INTO `order_recipient` VALUES (93, 118, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-22 17:06:00', NULL); -INSERT INTO `order_recipient` VALUES (95, 120, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-22 19:31:55', NULL); -INSERT INTO `order_recipient` VALUES (96, 121, '22033', 'sin', '18132019023', 1, '湖南省深圳市北京3环56号', '2019-04-22 19:35:45', NULL); -INSERT INTO `order_recipient` VALUES (97, 122, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-22 20:51:39', NULL); -INSERT INTO `order_recipient` VALUES (99, 124, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-22 22:19:58', NULL); -INSERT INTO `order_recipient` VALUES (100, 125, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-22 22:21:26', NULL); -INSERT INTO `order_recipient` VALUES (102, 127, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-22 22:28:21', NULL); -INSERT INTO `order_recipient` VALUES (103, 128, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-22 22:29:16', NULL); -INSERT INTO `order_recipient` VALUES (104, 129, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-22 22:37:18', NULL); -INSERT INTO `order_recipient` VALUES (105, 130, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-22 22:37:23', NULL); -INSERT INTO `order_recipient` VALUES (106, 131, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-23 00:22:22', NULL); -INSERT INTO `order_recipient` VALUES (107, 132, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-23 10:03:50', NULL); -INSERT INTO `order_recipient` VALUES (108, 133, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-27 00:02:20', NULL); -INSERT INTO `order_recipient` VALUES (109, 134, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-27 00:43:06', NULL); -INSERT INTO `order_recipient` VALUES (110, 135, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-04-27 00:44:09', NULL); -INSERT INTO `order_recipient` VALUES (130, 159, '22033', 'sin', '18132019023', 1, '湖南省深圳市北京3环56号', '2019-05-09 01:10:40', NULL); -INSERT INTO `order_recipient` VALUES (131, 160, '22033', 'sin', '18132019023', 1, '湖南省深圳市北京3环56号', '2019-05-09 01:15:01', NULL); -INSERT INTO `order_recipient` VALUES (135, 164, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-05-09 01:47:25', NULL); -INSERT INTO `order_recipient` VALUES (136, 165, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-05-09 16:52:09', NULL); -INSERT INTO `order_recipient` VALUES (144, 173, '22033', 'sin', '18132019023', 1, '湖南省深圳市北京3环56号', '2019-05-09 20:36:10', NULL); -INSERT INTO `order_recipient` VALUES (145, 174, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-05-10 01:16:45', NULL); -INSERT INTO `order_recipient` VALUES (147, 176, '120101', 'xxx', '18670071886', 1, '2`121`2`12', '2019-05-10 21:06:10', NULL); -INSERT INTO `order_recipient` VALUES (148, 178, '22033', 'sin', '18132019023', 1, '湖南省深圳市北京3环56号', '2019-05-11 21:38:09', NULL); -INSERT INTO `order_recipient` VALUES (149, 179, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-05-12 00:06:47', NULL); -INSERT INTO `order_recipient` VALUES (155, 193, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-05-12 00:33:04', NULL); -INSERT INTO `order_recipient` VALUES (156, 194, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-05-12 00:44:16', NULL); -INSERT INTO `order_recipient` VALUES (157, 195, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-05-12 00:45:14', NULL); -INSERT INTO `order_recipient` VALUES (158, 196, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-05-12 00:45:50', NULL); -INSERT INTO `order_recipient` VALUES (159, 197, '22033', 'sin', '18132019023', 1, '湖南省深圳市北京3环56号', '2019-05-12 18:38:32', NULL); -INSERT INTO `order_recipient` VALUES (178, 216, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-05-17 13:51:10', NULL); -INSERT INTO `order_recipient` VALUES (179, 217, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-05-17 14:11:14', NULL); -INSERT INTO `order_recipient` VALUES (180, 218, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-05-17 14:21:18', NULL); -INSERT INTO `order_recipient` VALUES (181, 219, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-05-17 15:18:22', NULL); -INSERT INTO `order_recipient` VALUES (182, 220, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-05-17 17:46:31', NULL); -INSERT INTO `order_recipient` VALUES (183, 221, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-05-17 17:58:51', NULL); -INSERT INTO `order_recipient` VALUES (185, 223, '230102', 'mi', '13302926050', 1, '湖南省深圳市北京去3环', '2019-05-18 20:26:59', NULL); -INSERT INTO `order_recipient` VALUES (186, 224, '110101', '胡家明', '18856655656', 1, '44444444444', '2019-08-12 17:35:06', NULL); -INSERT INTO `order_recipient` VALUES (187, 225, '110101', '胡家明', '18856655656', 1, '44444444444', '2019-08-12 17:35:08', NULL); -INSERT INTO `order_recipient` VALUES (188, 226, '110101', '胡家明', '18856655656', 1, '44444444444', '2019-08-12 18:01:38', NULL); -COMMIT; - -- ---------------------------- -- Table structure for order_return -- ---------------------------- @@ -390,125 +121,6 @@ CREATE TABLE `order_return` ( PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8; --- ---------------------------- --- Records of order_return --- ---------------------------- -BEGIN; -INSERT INTO `order_return` VALUES (1, '1111111', 50, 'b4e42922b2634', 24, 1000, 3, '不要了,不好看', '2019-04-26 00:14:10', '2019-05-09 21:32:31', NULL, NULL, NULL, NULL, 1, NULL, 3); -INSERT INTO `order_return` VALUES (2, '12312312', 50, 'b4e42922b2634', NULL, 1000, 3, '不要了,不好看', '2019-04-26 00:15:29', NULL, NULL, NULL, NULL, NULL, 1, NULL, 3); -INSERT INTO `order_return` VALUES (3, '6754745', 50, 'b4e42922b2634', NULL, 1000, 2, '不要了,不好看', '2019-04-26 00:15:31', '2019-05-09 21:43:56', NULL, NULL, NULL, NULL, 2, NULL, 3); -INSERT INTO `order_return` VALUES (4, '1234124', 50, 'b4e42922b2634', NULL, 1000, 1, '不要了,不好看', '2019-04-26 00:15:33', '2019-05-09 21:45:12', NULL, NULL, NULL, NULL, 2, NULL, 6); -INSERT INTO `order_return` VALUES (5, 'ga12355', 50, 'b4e42922b2634', NULL, 1000, 3, '不要了,不好看', '2019-04-26 00:15:34', '2019-05-09 21:45:36', NULL, NULL, '2019-05-09 22:44:29', '2019-05-09 22:44:33', 1, NULL, 6); -INSERT INTO `order_return` VALUES (6, 'dsgs1241', 50, 'b4e42922b2634', NULL, 1000, 2, '不要了,不好看', '2019-04-26 00:16:21', '2019-05-09 21:41:01', NULL, NULL, '2019-05-09 22:45:20', NULL, 1, NULL, 5); -INSERT INTO `order_return` VALUES (7, 'gad12314', 50, 'b4e42922b2634', NULL, 1000, 2, '不要了,不好看', '2019-04-26 00:16:24', '2019-05-09 22:44:21', NULL, NULL, NULL, NULL, 2, NULL, 2); -INSERT INTO `order_return` VALUES (8, 'ggasd123', 50, 'b4e42922b2634', NULL, 1000, 3, '不要了,不好看', '2019-04-26 00:17:10', '2019-05-09 21:47:20', NULL, NULL, NULL, NULL, 1, NULL, 2); -INSERT INTO `order_return` VALUES (9, 'amsfdl12314', 50, 'b4e42922b2634', NULL, 1000, 1, '不要了,不好看', '2019-04-26 00:17:14', '2019-05-09 21:53:07', NULL, NULL, NULL, NULL, 2, NULL, 2); -INSERT INTO `order_return` VALUES (10, 'lo123', 50, 'b4e42922b2634', NULL, 1000, 3, '不要了,不好看', '2019-04-26 00:17:18', '2019-05-09 21:46:41', NULL, NULL, NULL, NULL, 1, NULL, 2); -INSERT INTO `order_return` VALUES (11, 'sdfan231', 50, 'b4e42922b2634', NULL, 1000, 1, '不要了,不好看', '2019-04-26 00:18:08', '2019-05-09 21:48:29', NULL, NULL, NULL, NULL, 1, NULL, 2); -INSERT INTO `order_return` VALUES (12, 'kdau213j21', 50, 'b4e42922b2634', NULL, 1000, 3, '', '2019-04-26 00:18:59', '2019-05-17 16:35:59', NULL, NULL, NULL, NULL, 2, NULL, 2); -INSERT INTO `order_return` VALUES (13, 'apdamfmn213', 50, 'b4e42922b2634', NULL, 1000, 2, '不要了,不好看', '2019-04-26 00:19:11', '2019-05-09 21:53:11', NULL, NULL, NULL, NULL, 1, NULL, 2); -INSERT INTO `order_return` VALUES (14, 'gi2341', 50, 'b4e42922b2634', NULL, 1000, 1, '123', '2019-04-26 00:22:24', NULL, NULL, NULL, NULL, NULL, 1, NULL, 1); -COMMIT; - --- ---------------------------- --- Table structure for orders --- ---------------------------- -DROP TABLE IF EXISTS `orders`; -CREATE TABLE `orders` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Id,自增长', - `user_id` int(11) NOT NULL COMMENT '用户id\n', - `order_no` varchar(50) NOT NULL COMMENT '订单单号', - `buy_price` int(11) NOT NULL COMMENT '订单金额(总金额)', - `discount_price` int(11) NOT NULL COMMENT '优惠总金额,单位:分', - `logistics_price` int(11) NOT NULL COMMENT '物流金额', - `present_price` int(11) NOT NULL COMMENT '最终金额,单位:分', - `pay_amount` int(10) NOT NULL COMMENT '金额(分)', - `payment_time` datetime DEFAULT NULL COMMENT '付款时间', - `delivery_time` datetime DEFAULT NULL COMMENT '发货时间', - `receiver_time` datetime DEFAULT NULL COMMENT '收货时间', - `closing_time` datetime DEFAULT NULL COMMENT '成交时间', - `has_return_exchange` smallint(6) NOT NULL COMMENT '是否退换货', - `remark` varchar(255) DEFAULT NULL COMMENT '备注', - `status` smallint(2) NOT NULL COMMENT '状态(如果有多个商品分开发货需要全部商品发完才会改变状态) 0、待付款 1、待发货 2、待收货 3、已完成 4、已关闭', - `create_time` datetime DEFAULT NULL COMMENT '订单创建时间', - `update_time` datetime DEFAULT NULL COMMENT '更新时间', - `deleted` smallint(6) NOT NULL COMMENT '删除状态', - PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=227 DEFAULT CHARSET=utf8; - --- ---------------------------- --- Records of orders --- ---------------------------- -BEGIN; -INSERT INTO `orders` VALUES (47, 29, '29635cff9cc8419', 10, 0, 0, 0, 10, NULL, NULL, NULL, NULL, 1, '添加一个测试备注', 5, '2019-04-11 22:15:32', NULL, 0); -INSERT INTO `orders` VALUES (48, 29, '8472c75db7794b', 10, 0, 0, 0, 10, NULL, NULL, NULL, NULL, 1, '', 5, '2019-04-11 22:16:03', NULL, 0); -INSERT INTO `orders` VALUES (49, 29, '00be8f5971c24b', 10, 0, 0, 0, 10, NULL, NULL, NULL, NULL, 1, '', 5, '2019-04-11 22:19:17', NULL, 0); -INSERT INTO `orders` VALUES (50, 29, 'b4e42922b2634', 10, 0, 0, 0, 10, NULL, NULL, '2019-04-12 21:27:13', '2019-05-09 22:44:33', 1, '', 4, '2019-04-11 22:19:42', NULL, 0); -INSERT INTO `orders` VALUES (51, -1, '76c163c61ffb465f', 362, 0, 0, 0, 362, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-14 01:27:15', NULL, 0); -INSERT INTO `orders` VALUES (74, -1, '2186b8b4ca32442c', 1200, 40, 0, 1160, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-20 19:57:27', NULL, 0); -INSERT INTO `orders` VALUES (75, -1, '0668f5a6d168471c', 100, 0, 0, 100, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-20 19:58:10', NULL, 0); -INSERT INTO `orders` VALUES (76, -1, '6f465f43b2f34a3f', 200, 40, 0, 160, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-20 22:19:28', NULL, 0); -INSERT INTO `orders` VALUES (89, -1, 'd4867f5320bb4d07', 200, 40, 0, 160, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-20 23:42:56', NULL, 0); -INSERT INTO `orders` VALUES (90, -1, '2667b89fbb5e49d9', 200, 40, 0, 160, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-20 23:44:43', NULL, 0); -INSERT INTO `orders` VALUES (95, -1, '7aa0c5558746431b', 200, 40, 0, 160, 0, NULL, NULL, NULL, NULL, 1, '', 5, '2019-04-21 02:17:24', NULL, 0); -INSERT INTO `orders` VALUES (97, -1, '2dd9173348c94047', 200, 40, 0, 160, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-21 14:22:49', NULL, 0); -INSERT INTO `orders` VALUES (98, -1, '5987e77245064f5c', 200, 40, 0, 160, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-21 15:01:50', NULL, 0); -INSERT INTO `orders` VALUES (99, -1, '0aa0ff0bb2a74180', 200, 40, 0, 160, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-21 15:05:21', NULL, 0); -INSERT INTO `orders` VALUES (101, -1, 'e7f4804c54774747', 200, 40, 0, 160, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-21 15:06:30', NULL, 0); -INSERT INTO `orders` VALUES (102, -1, 'cdff09a25c724c02', 100, 0, 0, 100, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-21 15:10:39', NULL, 0); -INSERT INTO `orders` VALUES (103, -1, '7de9b6251e434807', 100, 0, 0, 100, 100, '2019-04-21 15:21:26', NULL, NULL, NULL, 1, '', 1, '2019-04-21 15:14:17', NULL, 0); -INSERT INTO `orders` VALUES (104, -1, '80475d74fc1f4a56', 100, 0, 0, 100, 100, '2019-04-21 15:20:12', NULL, NULL, NULL, 1, '', 1, '2019-04-21 15:19:19', NULL, 0); -INSERT INTO `orders` VALUES (105, -1, 'ce4966bed7104dd5', 200, 40, 0, 160, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-21 18:59:24', NULL, 0); -INSERT INTO `orders` VALUES (106, -1, 'a72347c6571f4f74', 200, 40, 0, 160, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-21 19:08:18', NULL, 0); -INSERT INTO `orders` VALUES (107, -1, '7dedc1e8c6484530', 200, 40, 0, 160, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-21 19:22:19', NULL, 0); -INSERT INTO `orders` VALUES (109, -1, '0635a03e4ad8439d', 100, 0, 0, 100, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-21 19:57:13', NULL, 0); -INSERT INTO `orders` VALUES (110, -1, '8cfb63d2f17445bb', 100, 0, 0, 100, 100, '2019-04-21 20:17:20', NULL, NULL, NULL, 1, '', 3, '2019-04-21 20:17:04', NULL, 0); -INSERT INTO `orders` VALUES (111, -1, '11e64862f6d94ceb', 1000, 0, 0, 1000, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-21 20:24:05', NULL, 0); -INSERT INTO `orders` VALUES (112, -1, '472994edfd90458d', 1000, 0, 0, 1000, 1000, '2019-04-22 19:32:35', NULL, '2019-04-22 19:32:42', NULL, 1, '', 4, '2019-04-21 20:37:45', NULL, 0); -INSERT INTO `orders` VALUES (113, -1, 'aee52dfc8bef4603', 1000, 0, 0, 1000, 1000, '2019-04-22 19:35:58', NULL, NULL, NULL, 1, '', 3, '2019-04-21 20:51:38', NULL, 0); -INSERT INTO `orders` VALUES (114, -1, '2da845ff0da74b8b', 1000, 0, 0, 1000, 1000, '2019-04-21 22:38:34', NULL, NULL, NULL, 1, '', 3, '2019-04-21 22:38:24', NULL, 0); -INSERT INTO `orders` VALUES (115, -1, '23ce74ee3cbc49d8', 200, 40, 0, 160, 160, '2019-04-22 19:36:16', NULL, NULL, NULL, 1, '', 3, '2019-04-21 23:29:21', NULL, 0); -INSERT INTO `orders` VALUES (118, -1, '6d73bb4e01c349d6', 200, 40, 0, 160, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-22 17:05:59', NULL, 0); -INSERT INTO `orders` VALUES (120, -1, '6377703d238e4b88', 200, 40, 0, 160, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-22 19:31:55', NULL, 0); -INSERT INTO `orders` VALUES (121, -1, '3dc33dcaf4b24724', 44000, 0, 0, 44000, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-22 19:35:45', NULL, 0); -INSERT INTO `orders` VALUES (122, -1, '6074931dc45541f9', 200, 40, 0, 160, 160, '2019-04-22 20:51:46', NULL, NULL, NULL, 1, '', 3, '2019-04-22 20:51:39', NULL, 0); -INSERT INTO `orders` VALUES (124, -1, 'fc6c662e66a24a86', 200, 40, 0, 160, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-22 22:19:58', NULL, 0); -INSERT INTO `orders` VALUES (125, -1, '0c17c9bc441645f2', 200, 40, 0, 160, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-22 22:21:26', NULL, 0); -INSERT INTO `orders` VALUES (127, -1, 'af5c4f40bc9c478d', 10, 0, 0, 10, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-22 22:28:21', NULL, 0); -INSERT INTO `orders` VALUES (128, 1, '53cd76bff19242e8', 10, 0, 0, 10, 10, '2019-05-09 20:36:53', NULL, NULL, NULL, 1, '', 2, '2019-04-22 22:29:16', NULL, 0); -INSERT INTO `orders` VALUES (129, 1, 'a8a40abdb2cc430b', 10, 0, 0, 10, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-04-22 22:37:18', NULL, 0); -INSERT INTO `orders` VALUES (130, 1, 'e6d4fe973a404508', 10, 0, 0, 10, 10, '2019-04-22 22:37:27', NULL, NULL, NULL, 1, '', 3, '2019-04-22 22:37:23', NULL, 0); -INSERT INTO `orders` VALUES (131, 1, 'e2edc556fff847c5', 10, 0, 0, 10, 10, '2019-04-23 00:22:28', NULL, NULL, NULL, 1, '', 2, '2019-04-23 00:22:22', NULL, 0); -INSERT INTO `orders` VALUES (132, 1, 'a6d7da64863c499e', 10, 0, 0, 10, 10, '2019-04-23 10:03:55', NULL, NULL, NULL, 1, '', 2, '2019-04-23 10:03:50', NULL, 0); -INSERT INTO `orders` VALUES (133, 1, 'e815710ad0014f35', 10000, 0, 0, 10000, 10000, '2019-04-27 00:43:50', NULL, NULL, NULL, 1, '', 2, '2019-04-27 00:02:20', NULL, 0); -INSERT INTO `orders` VALUES (134, 1, 'a624ad4406554db5', 10000, 0, 0, 10000, 10000, '2019-04-27 00:43:17', NULL, NULL, NULL, 1, '', 2, '2019-04-27 00:43:06', NULL, 0); -INSERT INTO `orders` VALUES (135, 1, 'ffff6dd443a844ee', 10000, 0, 0, 10000, 10000, '2019-04-27 00:44:12', NULL, NULL, NULL, 1, '', 2, '2019-04-27 00:44:09', NULL, 0); -INSERT INTO `orders` VALUES (159, 1, '2a5a8df629764732', 10000000, 2000000, 0, 8000000, 8000000, '2019-05-09 01:11:27', NULL, NULL, NULL, 1, '', 2, '2019-05-09 01:10:40', NULL, 0); -INSERT INTO `orders` VALUES (160, 1, 'c1775cdb254d4700', 10000000, 2000000, 0, 8000000, 8000000, '2019-05-09 01:15:22', NULL, NULL, NULL, 1, '', 2, '2019-05-09 01:15:01', NULL, 0); -INSERT INTO `orders` VALUES (164, 1, 'c75d9c0abc264f53', 10000000, 2000000, 0, 8000000, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-05-09 01:47:25', NULL, 0); -INSERT INTO `orders` VALUES (165, 1, 'afd122fa875549de', 10000000, 2000000, 0, 8000000, 0, NULL, NULL, NULL, NULL, 1, '', 1, '2019-05-09 16:52:09', NULL, 0); -INSERT INTO `orders` VALUES (173, 1, '45c90cf80f904cf8', 10000000, 2000000, 0, 8000000, 8000000, '2019-05-09 20:36:33', NULL, NULL, NULL, 1, '', 2, '2019-05-09 20:36:10', NULL, 0); -INSERT INTO `orders` VALUES (174, 1, 'b646bca1a2f84226', 2000, 0, 0, 2000, 2000, '2019-05-10 01:16:50', NULL, NULL, NULL, 1, '', 2, '2019-05-10 01:16:45', NULL, 0); -INSERT INTO `orders` VALUES (176, 67, '56d8e004a4ce4aaa', 10000, 0, 0, 10000, 10000, '2019-05-10 21:06:16', NULL, NULL, NULL, 1, '', 2, '2019-05-10 21:06:10', NULL, 0); -INSERT INTO `orders` VALUES (178, 1, 'bd01be1ea05a4113', 10000000, 2000000, 0, 8000000, 0, NULL, NULL, NULL, NULL, 1, '', 1, NULL, NULL, 0); -INSERT INTO `orders` VALUES (179, 1, '06bd26225a7a45b8', 10000000, 2000000, 0, 8000000, 0, NULL, NULL, NULL, NULL, 1, '', 1, NULL, NULL, 0); -INSERT INTO `orders` VALUES (193, 1, 'f547cf1a19d84702', 10000000, 2000000, 0, 8000000, 0, NULL, NULL, NULL, NULL, 1, '', 1, NULL, NULL, 0); -INSERT INTO `orders` VALUES (194, 1, '3bc06d86646c4624', 10000000, 2000000, 0, 8000000, 0, NULL, NULL, NULL, NULL, 1, '', 1, NULL, NULL, 0); -INSERT INTO `orders` VALUES (195, 1, 'e3adfabd987340cb', 10000000, 2000000, 0, 8000000, 0, NULL, NULL, NULL, NULL, 1, '', 1, NULL, NULL, 0); -INSERT INTO `orders` VALUES (196, 1, 'f2ab67d45fb444c3', 10000000, 2000000, 0, 8000000, 0, NULL, NULL, NULL, NULL, 1, '', 1, NULL, NULL, 0); -INSERT INTO `orders` VALUES (197, 1, 'd43d4a25052842bf', 10000, 1000, 0, 9000, 0, NULL, NULL, NULL, NULL, 1, '', 1, NULL, NULL, 0); -INSERT INTO `orders` VALUES (216, 1, 'b8300a8bd1084815', 5100, 0, 0, 5100, 5100, '2019-05-17 14:21:43', NULL, NULL, NULL, 1, '', 2, NULL, NULL, 0); -INSERT INTO `orders` VALUES (217, 1, '1ee223bca4ae4ab6', 100, 0, 0, 100, 0, NULL, NULL, NULL, NULL, 1, '', 1, NULL, NULL, 0); -INSERT INTO `orders` VALUES (218, 1, '4f88cd5b7f5a4654', 100, 51, 0, 49, 49, '2019-05-17 14:21:36', NULL, NULL, NULL, 1, '', 2, NULL, NULL, 0); -INSERT INTO `orders` VALUES (219, 1, '7373c33d88d24c62', 100, 0, 0, 100, 100, '2019-05-17 15:18:31', NULL, NULL, NULL, 1, '', 2, NULL, NULL, 0); -INSERT INTO `orders` VALUES (220, 1, '06cafeb1b5504289', 10000, 1000, 0, 9000, 0, NULL, NULL, NULL, NULL, 1, '', 1, NULL, NULL, 0); -INSERT INTO `orders` VALUES (221, 1, '44fed72a246d4b94', 20000100, 4000009, 0, 16000091, 0, NULL, NULL, NULL, NULL, 1, '', 1, NULL, NULL, 0); -INSERT INTO `orders` VALUES (223, 1, 'fc6625e45ee54930', 5100, 0, 0, 5100, 0, NULL, NULL, NULL, NULL, 1, '', 1, NULL, NULL, 0); -INSERT INTO `orders` VALUES (224, 197, 'dd6191439a0e431f', 10000, 0, 0, 10000, 0, NULL, NULL, NULL, NULL, 1, '', 1, NULL, NULL, 0); -INSERT INTO `orders` VALUES (225, 197, '96d14ff467ef40e7', 10000, 0, 0, 10000, 0, NULL, NULL, NULL, NULL, 1, '', 1, NULL, NULL, 0); -INSERT INTO `orders` VALUES (226, 197, 'fb6602459e1c48bd', 10000, 0, 0, 10000, 0, NULL, NULL, NULL, NULL, 1, '', 1, NULL, NULL, 0); -COMMIT; - -- ---------------------------- -- Table structure for undo_log -- ---------------------------- @@ -525,41 +137,3 @@ CREATE TABLE `undo_log` ( PRIMARY KEY (`id`), UNIQUE KEY `ux_undo_log` (`xid`,`branch_id`) ) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8; - --- ---------------------------- --- Records of undo_log --- ---------------------------- -BEGIN; -INSERT INTO `undo_log` VALUES (15, 2011489622, '192.168.88.14:8091:2011489621', 0x7B226272616E63684964223A323031313438393632322C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3231367D2C7B226B657954797065223A224E554C4C222C226E616D65223A22757365725F6964222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6E6F222C2274797065223A31322C2276616C7565223A2262383330306138626431303834383135227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F7072696365222C2274797065223A342C2276616C7565223A353130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22646973636F756E745F7072696365222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226C6F676973746963735F7072696365222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F7072696365222C2274797065223A342C2276616C7565223A353130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061795F616D6F756E74222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061796D656E745F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656365697665725F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22636C6F73696E675F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226861735F72657475726E5F65786368616E6765222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656D61726B222C2274797065223A31322C2276616C7565223A22227D2C7B226B657954797065223A224E554C4C222C226E616D65223A22737461747573222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C65746564222C2274797065223A352C2276616C7565223A307D5D7D5D2C227461626C654E616D65223A226F7264657273227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A226F7264657273227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A226F7264657273227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839363231227D, 0, '2019-05-17 13:51:09', '2019-05-17 13:51:09', NULL); -INSERT INTO `undo_log` VALUES (16, 2011489623, '192.168.88.14:8091:2011489621', 0x7B226272616E63684964223A323031313438393632332C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3137387D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6964222C2274797065223A342C2276616C7565223A3231367D2C7B226B657954797065223A224E554C4C222C226E616D65223A22617265615F6E6F222C2274797065223A31322C2276616C7565223A22323330313032227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226E616D65222C2274797065223A31322C2276616C7565223A226D69227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226D6F62696C65222C2274797065223A31322C2276616C7565223A223133333032393236303530227D2C7B226B657954797065223A224E554C4C222C226E616D65223A2274797065222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2261646472657373222C2274797065223A31322C2276616C7565223A22E6B996E58D97E79C81E6B7B1E59CB3E5B882E58C97E4BAACE58EBB33E78EAF227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39332C2276616C7565223A22323031392D30352D31372031333A35313A3130227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D5D7D5D2C227461626C654E616D65223A22606F726465725F726563697069656E7460227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A22606F726465725F726563697069656E7460227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A22606F726465725F726563697069656E7460227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839363231227D, 0, '2019-05-17 13:51:10', '2019-05-17 13:51:10', NULL); -INSERT INTO `undo_log` VALUES (17, 2011489624, '192.168.88.14:8091:2011489621', 0x7B226272616E63684964223A323031313438393632342C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3135387D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6964222C2274797065223A342C2276616C7565223A3231367D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6E6F222C2274797065223A31322C2276616C7565223A2262383330306138626431303834383135227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6C6F676973746963735F6964222C2274797065223A347D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6964222C2274797065223A342C2276616C7565223A34307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6E616D65222C2274797065223A31322C2276616C7565223A224F7261636C65227D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F696D616765222C2274797065223A31322C2276616C7565223A2268747470733A2F2F7374617469632E6F736368696E612E6E65742F696D672F6C6F676F2F6F7261636C652E676966227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227175616E74697479222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726967696E5F7072696365222C2274797065223A342C2276616C7565223A353030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F7072696365222C2274797065223A342C2276616C7565223A353030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F7072696365222C2274797065223A342C2276616C7565223A353030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F746F74616C222C2274797065223A342C2276616C7565223A353030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22646973636F756E745F746F74616C222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F746F74616C222C2274797065223A342C2276616C7565223A353030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061796D656E745F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656365697665725F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22636C6F73696E675F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226861735F72657475726E5F65786368616E6765222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39332C2276616C7565223A22323031392D30352D31372031333A35313A3130227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656D61726B222C2274797065223A31327D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74797065222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A22737461747573222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C65746564222C2274797065223A352C2276616C7565223A307D5D7D2C7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3135397D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6964222C2274797065223A342C2276616C7565223A3231367D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6E6F222C2274797065223A31322C2276616C7565223A2262383330306138626431303834383135227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6C6F676973746963735F6964222C2274797065223A347D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6964222C2274797065223A342C2276616C7565223A33317D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6E616D65222C2274797065223A31322C2276616C7565223A22E6B58BE8AF95E59586E59381227D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F696D616765222C2274797065223A31322C2276616C7565223A2268747470733A2F2F757365722D676F6C642D63646E2E786974752E696F2F323031392F342F312F313639643639346230326566306466373F696D61676556696577322F302F772F313238302F682F3936302F666F726D61742F6A7065672F69676E6F72652D6572726F722F31227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227175616E74697479222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726967696E5F7072696365222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F7072696365222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F7072696365222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F746F74616C222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22646973636F756E745F746F74616C222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F746F74616C222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061796D656E745F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656365697665725F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22636C6F73696E675F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226861735F72657475726E5F65786368616E6765222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39332C2276616C7565223A22323031392D30352D31372031333A35313A3130227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656D61726B222C2274797065223A31327D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74797065222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A22737461747573222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C65746564222C2274797065223A352C2276616C7565223A307D5D7D5D2C227461626C654E616D65223A22606F726465725F6974656D60227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A22606F726465725F6974656D60227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A22606F726465725F6974656D60227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839363231227D, 0, '2019-05-17 13:51:10', '2019-05-17 13:51:10', NULL); -INSERT INTO `undo_log` VALUES (18, 2011489627, '192.168.88.14:8091:2011489626', 0x7B226272616E63684964223A323031313438393632372C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3231377D2C7B226B657954797065223A224E554C4C222C226E616D65223A22757365725F6964222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6E6F222C2274797065223A31322C2276616C7565223A2231656532323362636134616534616236227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F7072696365222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22646973636F756E745F7072696365222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226C6F676973746963735F7072696365222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F7072696365222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061795F616D6F756E74222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061796D656E745F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656365697665725F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22636C6F73696E675F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226861735F72657475726E5F65786368616E6765222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656D61726B222C2274797065223A31322C2276616C7565223A22227D2C7B226B657954797065223A224E554C4C222C226E616D65223A22737461747573222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C65746564222C2274797065223A352C2276616C7565223A307D5D7D5D2C227461626C654E616D65223A226F7264657273227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A226F7264657273227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A226F7264657273227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839363236227D, 0, '2019-05-17 14:11:14', '2019-05-17 14:11:14', NULL); -INSERT INTO `undo_log` VALUES (19, 2011489628, '192.168.88.14:8091:2011489626', 0x7B226272616E63684964223A323031313438393632382C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3137397D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6964222C2274797065223A342C2276616C7565223A3231377D2C7B226B657954797065223A224E554C4C222C226E616D65223A22617265615F6E6F222C2274797065223A31322C2276616C7565223A22323330313032227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226E616D65222C2274797065223A31322C2276616C7565223A226D69227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226D6F62696C65222C2274797065223A31322C2276616C7565223A223133333032393236303530227D2C7B226B657954797065223A224E554C4C222C226E616D65223A2274797065222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2261646472657373222C2274797065223A31322C2276616C7565223A22E6B996E58D97E79C81E6B7B1E59CB3E5B882E58C97E4BAACE58EBB33E78EAF227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39332C2276616C7565223A22323031392D30352D31372031343A31313A3134227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D5D7D5D2C227461626C654E616D65223A22606F726465725F726563697069656E7460227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A22606F726465725F726563697069656E7460227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A22606F726465725F726563697069656E7460227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839363236227D, 0, '2019-05-17 14:11:14', '2019-05-17 14:11:14', NULL); -INSERT INTO `undo_log` VALUES (20, 2011489629, '192.168.88.14:8091:2011489626', 0x7B226272616E63684964223A323031313438393632392C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3136307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6964222C2274797065223A342C2276616C7565223A3231377D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6E6F222C2274797065223A31322C2276616C7565223A2231656532323362636134616534616236227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6C6F676973746963735F6964222C2274797065223A347D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6964222C2274797065223A342C2276616C7565223A33317D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6E616D65222C2274797065223A31322C2276616C7565223A22E6B58BE8AF95E59586E59381227D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F696D616765222C2274797065223A31322C2276616C7565223A2268747470733A2F2F757365722D676F6C642D63646E2E786974752E696F2F323031392F342F312F313639643639346230326566306466373F696D61676556696577322F302F772F313238302F682F3936302F666F726D61742F6A7065672F69676E6F72652D6572726F722F31227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227175616E74697479222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726967696E5F7072696365222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F7072696365222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F7072696365222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F746F74616C222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22646973636F756E745F746F74616C222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F746F74616C222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061796D656E745F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656365697665725F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22636C6F73696E675F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226861735F72657475726E5F65786368616E6765222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39332C2276616C7565223A22323031392D30352D31372031343A31313A3135227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656D61726B222C2274797065223A31327D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74797065222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A22737461747573222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C65746564222C2274797065223A352C2276616C7565223A307D5D7D5D2C227461626C654E616D65223A22606F726465725F6974656D60227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A22606F726465725F6974656D60227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A22606F726465725F6974656D60227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839363236227D, 0, '2019-05-17 14:11:14', '2019-05-17 14:11:14', NULL); -INSERT INTO `undo_log` VALUES (21, 2011489633, '192.168.88.14:8091:2011489631', 0x7B226272616E63684964223A323031313438393633332C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3231387D2C7B226B657954797065223A224E554C4C222C226E616D65223A22757365725F6964222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6E6F222C2274797065223A31322C2276616C7565223A2234663838636435623766356134363534227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F7072696365222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22646973636F756E745F7072696365222C2274797065223A342C2276616C7565223A35317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226C6F676973746963735F7072696365222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F7072696365222C2274797065223A342C2276616C7565223A34397D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061795F616D6F756E74222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061796D656E745F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656365697665725F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22636C6F73696E675F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226861735F72657475726E5F65786368616E6765222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656D61726B222C2274797065223A31322C2276616C7565223A22227D2C7B226B657954797065223A224E554C4C222C226E616D65223A22737461747573222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C65746564222C2274797065223A352C2276616C7565223A307D5D7D5D2C227461626C654E616D65223A226F7264657273227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A226F7264657273227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A226F7264657273227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839363331227D, 0, '2019-05-17 14:21:17', '2019-05-17 14:21:17', NULL); -INSERT INTO `undo_log` VALUES (22, 2011489634, '192.168.88.14:8091:2011489631', 0x7B226272616E63684964223A323031313438393633342C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3138307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6964222C2274797065223A342C2276616C7565223A3231387D2C7B226B657954797065223A224E554C4C222C226E616D65223A22617265615F6E6F222C2274797065223A31322C2276616C7565223A22323330313032227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226E616D65222C2274797065223A31322C2276616C7565223A226D69227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226D6F62696C65222C2274797065223A31322C2276616C7565223A223133333032393236303530227D2C7B226B657954797065223A224E554C4C222C226E616D65223A2274797065222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2261646472657373222C2274797065223A31322C2276616C7565223A22E6B996E58D97E79C81E6B7B1E59CB3E5B882E58C97E4BAACE58EBB33E78EAF227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39332C2276616C7565223A22323031392D30352D31372031343A32313A3138227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D5D7D5D2C227461626C654E616D65223A22606F726465725F726563697069656E7460227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A22606F726465725F726563697069656E7460227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A22606F726465725F726563697069656E7460227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839363331227D, 0, '2019-05-17 14:21:17', '2019-05-17 14:21:17', NULL); -INSERT INTO `undo_log` VALUES (23, 2011489635, '192.168.88.14:8091:2011489631', 0x7B226272616E63684964223A323031313438393633352C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3136317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6964222C2274797065223A342C2276616C7565223A3231387D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6E6F222C2274797065223A31322C2276616C7565223A2234663838636435623766356134363534227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6C6F676973746963735F6964222C2274797065223A347D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6964222C2274797065223A342C2276616C7565223A33317D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6E616D65222C2274797065223A31322C2276616C7565223A22E6B58BE8AF95E59586E59381227D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F696D616765222C2274797065223A31322C2276616C7565223A2268747470733A2F2F757365722D676F6C642D63646E2E786974752E696F2F323031392F342F312F313639643639346230326566306466373F696D61676556696577322F302F772F313238302F682F3936302F666F726D61742F6A7065672F69676E6F72652D6572726F722F31227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227175616E74697479222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726967696E5F7072696365222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F7072696365222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F7072696365222C2274797065223A342C2276616C7565223A34397D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F746F74616C222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22646973636F756E745F746F74616C222C2274797065223A342C2276616C7565223A35317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F746F74616C222C2274797065223A342C2276616C7565223A34397D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061796D656E745F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656365697665725F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22636C6F73696E675F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226861735F72657475726E5F65786368616E6765222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39332C2276616C7565223A22323031392D30352D31372031343A32313A3138227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656D61726B222C2274797065223A31327D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74797065222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A22737461747573222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C65746564222C2274797065223A352C2276616C7565223A307D5D7D5D2C227461626C654E616D65223A22606F726465725F6974656D60227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A22606F726465725F6974656D60227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A22606F726465725F6974656D60227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839363331227D, 0, '2019-05-17 14:21:17', '2019-05-17 14:21:17', NULL); -INSERT INTO `undo_log` VALUES (24, 2011489638, '192.168.88.14:8091:2011489637', 0x7B226272616E63684964223A323031313438393633382C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3231397D2C7B226B657954797065223A224E554C4C222C226E616D65223A22757365725F6964222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6E6F222C2274797065223A31322C2276616C7565223A2237333733633333643838643234633632227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F7072696365222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22646973636F756E745F7072696365222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226C6F676973746963735F7072696365222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F7072696365222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061795F616D6F756E74222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061796D656E745F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656365697665725F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22636C6F73696E675F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226861735F72657475726E5F65786368616E6765222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656D61726B222C2274797065223A31322C2276616C7565223A22227D2C7B226B657954797065223A224E554C4C222C226E616D65223A22737461747573222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C65746564222C2274797065223A352C2276616C7565223A307D5D7D5D2C227461626C654E616D65223A226F7264657273227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A226F7264657273227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A226F7264657273227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839363337227D, 0, '2019-05-17 15:18:21', '2019-05-17 15:18:21', NULL); -INSERT INTO `undo_log` VALUES (25, 2011489639, '192.168.88.14:8091:2011489637', 0x7B226272616E63684964223A323031313438393633392C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3138317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6964222C2274797065223A342C2276616C7565223A3231397D2C7B226B657954797065223A224E554C4C222C226E616D65223A22617265615F6E6F222C2274797065223A31322C2276616C7565223A22323330313032227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226E616D65222C2274797065223A31322C2276616C7565223A226D69227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226D6F62696C65222C2274797065223A31322C2276616C7565223A223133333032393236303530227D2C7B226B657954797065223A224E554C4C222C226E616D65223A2274797065222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2261646472657373222C2274797065223A31322C2276616C7565223A22E6B996E58D97E79C81E6B7B1E59CB3E5B882E58C97E4BAACE58EBB33E78EAF227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39332C2276616C7565223A22323031392D30352D31372031353A31383A3232227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D5D7D5D2C227461626C654E616D65223A22606F726465725F726563697069656E7460227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A22606F726465725F726563697069656E7460227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A22606F726465725F726563697069656E7460227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839363337227D, 0, '2019-05-17 15:18:21', '2019-05-17 15:18:21', NULL); -INSERT INTO `undo_log` VALUES (26, 2011489640, '192.168.88.14:8091:2011489637', 0x7B226272616E63684964223A323031313438393634302C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3136327D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6964222C2274797065223A342C2276616C7565223A3231397D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6E6F222C2274797065223A31322C2276616C7565223A2237333733633333643838643234633632227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6C6F676973746963735F6964222C2274797065223A347D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6964222C2274797065223A342C2276616C7565223A33317D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6E616D65222C2274797065223A31322C2276616C7565223A22E6B58BE8AF95E59586E59381227D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F696D616765222C2274797065223A31322C2276616C7565223A2268747470733A2F2F757365722D676F6C642D63646E2E786974752E696F2F323031392F342F312F313639643639346230326566306466373F696D61676556696577322F302F772F313238302F682F3936302F666F726D61742F6A7065672F69676E6F72652D6572726F722F31227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227175616E74697479222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726967696E5F7072696365222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F7072696365222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F7072696365222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F746F74616C222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22646973636F756E745F746F74616C222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F746F74616C222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061796D656E745F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656365697665725F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22636C6F73696E675F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226861735F72657475726E5F65786368616E6765222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39332C2276616C7565223A22323031392D30352D31372031353A31383A3232227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656D61726B222C2274797065223A31327D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74797065222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A22737461747573222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C65746564222C2274797065223A352C2276616C7565223A307D5D7D5D2C227461626C654E616D65223A22606F726465725F6974656D60227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A22606F726465725F6974656D60227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A22606F726465725F6974656D60227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839363337227D, 0, '2019-05-17 15:18:21', '2019-05-17 15:18:21', NULL); -INSERT INTO `undo_log` VALUES (27, 2011489644, '192.168.88.14:8091:2011489642', 0x7B226272616E63684964223A323031313438393634342C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3232307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22757365725F6964222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6E6F222C2274797065223A31322C2276616C7565223A2230366361666562316235353034323839227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F7072696365222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22646973636F756E745F7072696365222C2274797065223A342C2276616C7565223A313030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226C6F676973746963735F7072696365222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F7072696365222C2274797065223A342C2276616C7565223A393030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061795F616D6F756E74222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061796D656E745F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656365697665725F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22636C6F73696E675F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226861735F72657475726E5F65786368616E6765222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656D61726B222C2274797065223A31322C2276616C7565223A22227D2C7B226B657954797065223A224E554C4C222C226E616D65223A22737461747573222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C65746564222C2274797065223A352C2276616C7565223A307D5D7D5D2C227461626C654E616D65223A226F7264657273227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A226F7264657273227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A226F7264657273227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839363432227D, 0, '2019-05-17 17:46:30', '2019-05-17 17:46:30', NULL); -INSERT INTO `undo_log` VALUES (28, 2011489645, '192.168.88.14:8091:2011489642', 0x7B226272616E63684964223A323031313438393634352C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3138327D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6964222C2274797065223A342C2276616C7565223A3232307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22617265615F6E6F222C2274797065223A31322C2276616C7565223A22323330313032227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226E616D65222C2274797065223A31322C2276616C7565223A226D69227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226D6F62696C65222C2274797065223A31322C2276616C7565223A223133333032393236303530227D2C7B226B657954797065223A224E554C4C222C226E616D65223A2274797065222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2261646472657373222C2274797065223A31322C2276616C7565223A22E6B996E58D97E79C81E6B7B1E59CB3E5B882E58C97E4BAACE58EBB33E78EAF227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39332C2276616C7565223A22323031392D30352D31372031373A34363A3331227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D5D7D5D2C227461626C654E616D65223A22606F726465725F726563697069656E7460227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A22606F726465725F726563697069656E7460227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A22606F726465725F726563697069656E7460227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839363432227D, 0, '2019-05-17 17:46:30', '2019-05-17 17:46:30', NULL); -INSERT INTO `undo_log` VALUES (29, 2011489646, '192.168.88.14:8091:2011489642', 0x7B226272616E63684964223A323031313438393634362C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3136337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6964222C2274797065223A342C2276616C7565223A3232307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6E6F222C2274797065223A31322C2276616C7565223A2230366361666562316235353034323839227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6C6F676973746963735F6964222C2274797065223A347D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6964222C2274797065223A342C2276616C7565223A33367D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6E616D65222C2274797065223A31322C2276616C7565223A224B61666B6120E4B9A6E7B18DE6B187E680BB227D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F696D616765222C2274797065223A31322C2276616C7565223A22687474703A2F2F7374617469632E696F636F6465722E636E2F6B61666B612E706E67227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227175616E74697479222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726967696E5F7072696365222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F7072696365222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F7072696365222C2274797065223A342C2276616C7565223A393030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F746F74616C222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22646973636F756E745F746F74616C222C2274797065223A342C2276616C7565223A313030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F746F74616C222C2274797065223A342C2276616C7565223A393030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061796D656E745F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656365697665725F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22636C6F73696E675F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226861735F72657475726E5F65786368616E6765222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39332C2276616C7565223A22323031392D30352D31372031373A34363A3331227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656D61726B222C2274797065223A31327D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74797065222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A22737461747573222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C65746564222C2274797065223A352C2276616C7565223A307D5D7D5D2C227461626C654E616D65223A22606F726465725F6974656D60227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A22606F726465725F6974656D60227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A22606F726465725F6974656D60227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839363432227D, 0, '2019-05-17 17:46:30', '2019-05-17 17:46:30', NULL); -INSERT INTO `undo_log` VALUES (30, 2011489650, '192.168.88.14:8091:2011489648', 0x7B226272616E63684964223A323031313438393635302C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3232317D2C7B226B657954797065223A224E554C4C222C226E616D65223A22757365725F6964222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6E6F222C2274797065223A31322C2276616C7565223A2234346665643732613234366434623934227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F7072696365222C2274797065223A342C2276616C7565223A32303030303130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22646973636F756E745F7072696365222C2274797065223A342C2276616C7565223A343030303030397D2C7B226B657954797065223A224E554C4C222C226E616D65223A226C6F676973746963735F7072696365222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F7072696365222C2274797065223A342C2276616C7565223A31363030303039317D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061795F616D6F756E74222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061796D656E745F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656365697665725F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22636C6F73696E675F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226861735F72657475726E5F65786368616E6765222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656D61726B222C2274797065223A31322C2276616C7565223A22227D2C7B226B657954797065223A224E554C4C222C226E616D65223A22737461747573222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C65746564222C2274797065223A352C2276616C7565223A307D5D7D5D2C227461626C654E616D65223A226F7264657273227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A226F7264657273227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A226F7264657273227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839363438227D, 0, '2019-05-17 17:58:50', '2019-05-17 17:58:50', NULL); -INSERT INTO `undo_log` VALUES (31, 2011489651, '192.168.88.14:8091:2011489648', 0x7B226272616E63684964223A323031313438393635312C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3138337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6964222C2274797065223A342C2276616C7565223A3232317D2C7B226B657954797065223A224E554C4C222C226E616D65223A22617265615F6E6F222C2274797065223A31322C2276616C7565223A22323330313032227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226E616D65222C2274797065223A31322C2276616C7565223A226D69227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226D6F62696C65222C2274797065223A31322C2276616C7565223A223133333032393236303530227D2C7B226B657954797065223A224E554C4C222C226E616D65223A2274797065222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2261646472657373222C2274797065223A31322C2276616C7565223A22E6B996E58D97E79C81E6B7B1E59CB3E5B882E58C97E4BAACE58EBB33E78EAF227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39332C2276616C7565223A22323031392D30352D31372031373A35383A3531227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D5D7D5D2C227461626C654E616D65223A22606F726465725F726563697069656E7460227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A22606F726465725F726563697069656E7460227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A22606F726465725F726563697069656E7460227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839363438227D, 0, '2019-05-17 17:58:50', '2019-05-17 17:58:50', NULL); -INSERT INTO `undo_log` VALUES (32, 2011489652, '192.168.88.14:8091:2011489648', 0x7B226272616E63684964223A323031313438393635322C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3136347D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6964222C2274797065223A342C2276616C7565223A3232317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6E6F222C2274797065223A31322C2276616C7565223A2234346665643732613234366434623934227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6C6F676973746963735F6964222C2274797065223A347D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6964222C2274797065223A342C2276616C7565223A33337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6E616D65222C2274797065223A31322C2276616C7565223A226B61666B6120E5AE9EE68898E7ACACE4B880E78988227D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F696D616765222C2274797065223A31322C2276616C7565223A2268747470733A2F2F757365722D676F6C642D63646E2E786974752E696F2F323031392F342F312F313639643639346165333932303437623F696D61676556696577322F302F772F313238302F682F3936302F666F726D61742F6A7065672F69676E6F72652D6572726F722F31227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227175616E74697479222C2274797065223A342C2276616C7565223A327D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726967696E5F7072696365222C2274797065223A342C2276616C7565223A31303030303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F7072696365222C2274797065223A342C2276616C7565223A31303030303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F7072696365222C2274797065223A342C2276616C7565223A373939393939367D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F746F74616C222C2274797065223A342C2276616C7565223A32303030303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22646973636F756E745F746F74616C222C2274797065223A342C2276616C7565223A343030303030387D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F746F74616C222C2274797065223A342C2276616C7565223A31353939393939327D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061796D656E745F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656365697665725F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22636C6F73696E675F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226861735F72657475726E5F65786368616E6765222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39332C2276616C7565223A22323031392D30352D31372031373A35383A3531227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656D61726B222C2274797065223A31327D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74797065222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A22737461747573222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C65746564222C2274797065223A352C2276616C7565223A307D5D7D2C7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3136357D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6964222C2274797065223A342C2276616C7565223A3232317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6E6F222C2274797065223A31322C2276616C7565223A2234346665643732613234366434623934227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6C6F676973746963735F6964222C2274797065223A347D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6964222C2274797065223A342C2276616C7565223A33317D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6E616D65222C2274797065223A31322C2276616C7565223A22E6B58BE8AF95E59586E59381227D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F696D616765222C2274797065223A31322C2276616C7565223A2268747470733A2F2F757365722D676F6C642D63646E2E786974752E696F2F323031392F342F312F313639643639346230326566306466373F696D61676556696577322F302F772F313238302F682F3936302F666F726D61742F6A7065672F69676E6F72652D6572726F722F31227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227175616E74697479222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726967696E5F7072696365222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F7072696365222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F7072696365222C2274797065223A342C2276616C7565223A39397D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F746F74616C222C2274797065223A342C2276616C7565223A3130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22646973636F756E745F746F74616C222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F746F74616C222C2274797065223A342C2276616C7565223A39397D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061796D656E745F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656365697665725F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22636C6F73696E675F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226861735F72657475726E5F65786368616E6765222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39332C2276616C7565223A22323031392D30352D31372031373A35383A3531227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656D61726B222C2274797065223A31327D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74797065222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A22737461747573222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C65746564222C2274797065223A352C2276616C7565223A307D5D7D5D2C227461626C654E616D65223A22606F726465725F6974656D60227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A22606F726465725F6974656D60227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A22606F726465725F6974656D60227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839363438227D, 0, '2019-05-17 17:58:50', '2019-05-17 17:58:50', NULL); -INSERT INTO `undo_log` VALUES (33, 2011489656, '192.168.88.14:8091:2011489655', 0x7B226272616E63684964223A323031313438393635362C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3232337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22757365725F6964222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6E6F222C2274797065223A31322C2276616C7565223A2266633636323565343565653534393330227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F7072696365222C2274797065223A342C2276616C7565223A353130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22646973636F756E745F7072696365222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226C6F676973746963735F7072696365222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F7072696365222C2274797065223A342C2276616C7565223A353130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061795F616D6F756E74222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061796D656E745F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656365697665725F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22636C6F73696E675F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226861735F72657475726E5F65786368616E6765222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656D61726B222C2274797065223A31322C2276616C7565223A22227D2C7B226B657954797065223A224E554C4C222C226E616D65223A22737461747573222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C65746564222C2274797065223A352C2276616C7565223A307D5D7D5D2C227461626C654E616D65223A226F7264657273227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A226F7264657273227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A226F7264657273227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839363535227D, 0, '2019-05-18 20:26:58', '2019-05-18 20:26:58', NULL); -INSERT INTO `undo_log` VALUES (35, 2011489659, '192.168.88.14:8091:2011489655', 0x7B226272616E63684964223A323031313438393635392C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3138357D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6964222C2274797065223A342C2276616C7565223A3232337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22617265615F6E6F222C2274797065223A31322C2276616C7565223A22323330313032227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226E616D65222C2274797065223A31322C2276616C7565223A226D69227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226D6F62696C65222C2274797065223A31322C2276616C7565223A223133333032393236303530227D2C7B226B657954797065223A224E554C4C222C226E616D65223A2274797065222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2261646472657373222C2274797065223A31322C2276616C7565223A22E6B996E58D97E79C81E6B7B1E59CB3E5B882E58C97E4BAACE58EBB33E78EAF227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39332C2276616C7565223A22323031392D30352D31382032303A32363A3539227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D5D7D5D2C227461626C654E616D65223A22606F726465725F726563697069656E7460227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A22606F726465725F726563697069656E7460227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A22606F726465725F726563697069656E7460227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839363535227D, 0, '2019-05-18 20:26:58', '2019-05-18 20:26:58', NULL); -INSERT INTO `undo_log` VALUES (37, 2011489660, '192.168.88.14:8091:2011489655', 0x7B226272616E63684964223A323031313438393636302C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3136377D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6964222C2274797065223A342C2276616C7565223A3232337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6E6F222C2274797065223A31322C2276616C7565223A2266633636323565343565653534393330227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6C6F676973746963735F6964222C2274797065223A347D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6964222C2274797065223A342C2276616C7565223A34327D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6E616D65222C2274797065223A31322C2276616C7565223A224A617661227D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F696D616765222C2274797065223A31322C2276616C7565223A2268747470733A2F2F7374617469632E6F736368696E612E6E65742F696D672F6C6F676F2F6A6176612E706E67227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227175616E74697479222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726967696E5F7072696365222C2274797065223A342C2276616C7565223A353130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F7072696365222C2274797065223A342C2276616C7565223A353130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F7072696365222C2274797065223A342C2276616C7565223A353130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F746F74616C222C2274797065223A342C2276616C7565223A353130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22646973636F756E745F746F74616C222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F746F74616C222C2274797065223A342C2276616C7565223A353130307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061796D656E745F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656365697665725F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22636C6F73696E675F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226861735F72657475726E5F65786368616E6765222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39332C2276616C7565223A22323031392D30352D31382032303A32363A3539227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656D61726B222C2274797065223A31327D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74797065222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A22737461747573222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C65746564222C2274797065223A352C2276616C7565223A307D5D7D5D2C227461626C654E616D65223A22606F726465725F6974656D60227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A22606F726465725F6974656D60227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A22606F726465725F6974656D60227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839363535227D, 0, '2019-05-18 20:26:58', '2019-05-18 20:26:58', NULL); -INSERT INTO `undo_log` VALUES (38, 2011489731, '192.168.88.14:8091:2011489730', 0x7B226272616E63684964223A323031313438393733312C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3232347D2C7B226B657954797065223A224E554C4C222C226E616D65223A22757365725F6964222C2274797065223A342C2276616C7565223A3139377D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6E6F222C2274797065223A31322C2276616C7565223A2264643631393134333961306534333166227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F7072696365222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22646973636F756E745F7072696365222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226C6F676973746963735F7072696365222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F7072696365222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061795F616D6F756E74222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061796D656E745F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656365697665725F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22636C6F73696E675F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226861735F72657475726E5F65786368616E6765222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656D61726B222C2274797065223A31322C2276616C7565223A22227D2C7B226B657954797065223A224E554C4C222C226E616D65223A22737461747573222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C65746564222C2274797065223A352C2276616C7565223A307D5D7D5D2C227461626C654E616D65223A226F7264657273227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A226F7264657273227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A226F7264657273227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839373330227D, 0, '2019-08-12 17:35:06', '2019-08-12 17:35:06', NULL); -INSERT INTO `undo_log` VALUES (39, 2011489732, '192.168.88.14:8091:2011489730', 0x7B226272616E63684964223A323031313438393733322C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3138367D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6964222C2274797065223A342C2276616C7565223A3232347D2C7B226B657954797065223A224E554C4C222C226E616D65223A22617265615F6E6F222C2274797065223A31322C2276616C7565223A22313130313031227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226E616D65222C2274797065223A31322C2276616C7565223A22E883A1E5AEB6E6988E227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226D6F62696C65222C2274797065223A31322C2276616C7565223A223138383536363535363536227D2C7B226B657954797065223A224E554C4C222C226E616D65223A2274797065222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2261646472657373222C2274797065223A31322C2276616C7565223A223434343434343434343434227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39332C2276616C7565223A22323031392D30382D31322031373A33353A3036227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D5D7D5D2C227461626C654E616D65223A22606F726465725F726563697069656E7460227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A22606F726465725F726563697069656E7460227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A22606F726465725F726563697069656E7460227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839373330227D, 0, '2019-08-12 17:35:06', '2019-08-12 17:35:06', NULL); -INSERT INTO `undo_log` VALUES (40, 2011489733, '192.168.88.14:8091:2011489730', 0x7B226272616E63684964223A323031313438393733332C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3136387D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6964222C2274797065223A342C2276616C7565223A3232347D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6E6F222C2274797065223A31322C2276616C7565223A2264643631393134333961306534333166227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6C6F676973746963735F6964222C2274797065223A347D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6964222C2274797065223A342C2276616C7565223A33367D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6E616D65222C2274797065223A31322C2276616C7565223A224B61666B6120E4B9A6E7B18DE6B187E680BB227D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F696D616765222C2274797065223A31322C2276616C7565223A22687474703A2F2F7374617469632E696F636F6465722E636E2F6B61666B612E706E67227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227175616E74697479222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726967696E5F7072696365222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F7072696365222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F7072696365222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F746F74616C222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22646973636F756E745F746F74616C222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F746F74616C222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061796D656E745F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656365697665725F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22636C6F73696E675F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226861735F72657475726E5F65786368616E6765222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39332C2276616C7565223A22323031392D30382D31322031373A33353A3036227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656D61726B222C2274797065223A31327D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74797065222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A22737461747573222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C65746564222C2274797065223A352C2276616C7565223A307D5D7D5D2C227461626C654E616D65223A22606F726465725F6974656D60227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A22606F726465725F6974656D60227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A22606F726465725F6974656D60227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839373330227D, 0, '2019-08-12 17:35:06', '2019-08-12 17:35:06', NULL); -INSERT INTO `undo_log` VALUES (41, 2011489736, '192.168.88.14:8091:2011489734', 0x7B226272616E63684964223A323031313438393733362C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3232357D2C7B226B657954797065223A224E554C4C222C226E616D65223A22757365725F6964222C2274797065223A342C2276616C7565223A3139377D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6E6F222C2274797065223A31322C2276616C7565223A2239366431346666343637656634306537227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F7072696365222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22646973636F756E745F7072696365222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226C6F676973746963735F7072696365222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F7072696365222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061795F616D6F756E74222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061796D656E745F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656365697665725F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22636C6F73696E675F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226861735F72657475726E5F65786368616E6765222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656D61726B222C2274797065223A31322C2276616C7565223A22227D2C7B226B657954797065223A224E554C4C222C226E616D65223A22737461747573222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C65746564222C2274797065223A352C2276616C7565223A307D5D7D5D2C227461626C654E616D65223A226F7264657273227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A226F7264657273227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A226F7264657273227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839373334227D, 0, '2019-08-12 17:35:07', '2019-08-12 17:35:07', NULL); -INSERT INTO `undo_log` VALUES (42, 2011489737, '192.168.88.14:8091:2011489734', 0x7B226272616E63684964223A323031313438393733372C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3138377D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6964222C2274797065223A342C2276616C7565223A3232357D2C7B226B657954797065223A224E554C4C222C226E616D65223A22617265615F6E6F222C2274797065223A31322C2276616C7565223A22313130313031227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226E616D65222C2274797065223A31322C2276616C7565223A22E883A1E5AEB6E6988E227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226D6F62696C65222C2274797065223A31322C2276616C7565223A223138383536363535363536227D2C7B226B657954797065223A224E554C4C222C226E616D65223A2274797065222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2261646472657373222C2274797065223A31322C2276616C7565223A223434343434343434343434227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39332C2276616C7565223A22323031392D30382D31322031373A33353A3038227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D5D7D5D2C227461626C654E616D65223A22606F726465725F726563697069656E7460227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A22606F726465725F726563697069656E7460227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A22606F726465725F726563697069656E7460227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839373334227D, 0, '2019-08-12 17:35:07', '2019-08-12 17:35:07', NULL); -INSERT INTO `undo_log` VALUES (43, 2011489738, '192.168.88.14:8091:2011489734', 0x7B226272616E63684964223A323031313438393733382C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3136397D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6964222C2274797065223A342C2276616C7565223A3232357D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6E6F222C2274797065223A31322C2276616C7565223A2239366431346666343637656634306537227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6C6F676973746963735F6964222C2274797065223A347D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6964222C2274797065223A342C2276616C7565223A33367D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6E616D65222C2274797065223A31322C2276616C7565223A224B61666B6120E4B9A6E7B18DE6B187E680BB227D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F696D616765222C2274797065223A31322C2276616C7565223A22687474703A2F2F7374617469632E696F636F6465722E636E2F6B61666B612E706E67227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227175616E74697479222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726967696E5F7072696365222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F7072696365222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F7072696365222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F746F74616C222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22646973636F756E745F746F74616C222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F746F74616C222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061796D656E745F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656365697665725F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22636C6F73696E675F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226861735F72657475726E5F65786368616E6765222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39332C2276616C7565223A22323031392D30382D31322031373A33353A3038227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656D61726B222C2274797065223A31327D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74797065222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A22737461747573222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C65746564222C2274797065223A352C2276616C7565223A307D5D7D5D2C227461626C654E616D65223A22606F726465725F6974656D60227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A22606F726465725F6974656D60227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A22606F726465725F6974656D60227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839373334227D, 0, '2019-08-12 17:35:07', '2019-08-12 17:35:07', NULL); -INSERT INTO `undo_log` VALUES (44, 2011489741, '192.168.88.14:8091:2011489740', 0x7B226272616E63684964223A323031313438393734312C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3232367D2C7B226B657954797065223A224E554C4C222C226E616D65223A22757365725F6964222C2274797065223A342C2276616C7565223A3139377D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6E6F222C2274797065223A31322C2276616C7565223A2266623636303234353965316334386264227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F7072696365222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22646973636F756E745F7072696365222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226C6F676973746963735F7072696365222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F7072696365222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061795F616D6F756E74222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061796D656E745F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656365697665725F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22636C6F73696E675F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226861735F72657475726E5F65786368616E6765222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656D61726B222C2274797065223A31322C2276616C7565223A22227D2C7B226B657954797065223A224E554C4C222C226E616D65223A22737461747573222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C65746564222C2274797065223A352C2276616C7565223A307D5D7D5D2C227461626C654E616D65223A226F7264657273227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A226F7264657273227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A226F7264657273227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839373430227D, 0, '2019-08-12 18:01:37', '2019-08-12 18:01:37', NULL); -INSERT INTO `undo_log` VALUES (45, 2011489742, '192.168.88.14:8091:2011489740', 0x7B226272616E63684964223A323031313438393734322C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3138387D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6964222C2274797065223A342C2276616C7565223A3232367D2C7B226B657954797065223A224E554C4C222C226E616D65223A22617265615F6E6F222C2274797065223A31322C2276616C7565223A22313130313031227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226E616D65222C2274797065223A31322C2276616C7565223A22E883A1E5AEB6E6988E227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226D6F62696C65222C2274797065223A31322C2276616C7565223A223138383536363535363536227D2C7B226B657954797065223A224E554C4C222C226E616D65223A2274797065222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2261646472657373222C2274797065223A31322C2276616C7565223A223434343434343434343434227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39332C2276616C7565223A22323031392D30382D31322031383A30313A3338227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D5D7D5D2C227461626C654E616D65223A22606F726465725F726563697069656E7460227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A22606F726465725F726563697069656E7460227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A22606F726465725F726563697069656E7460227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839373430227D, 0, '2019-08-12 18:01:37', '2019-08-12 18:01:37', NULL); -INSERT INTO `undo_log` VALUES (46, 2011489743, '192.168.88.14:8091:2011489740', 0x7B226272616E63684964223A323031313438393734332C2273716C556E646F4C6F6773223A5B7B226166746572496D616765223A7B22726F7773223A5B7B226669656C6473223A5B7B226B657954797065223A225072696D6172794B6579222C226E616D65223A226964222C2274797065223A342C2276616C7565223A3137307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6964222C2274797065223A342C2276616C7565223A3232367D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6E6F222C2274797065223A31322C2276616C7565223A2266623636303234353965316334386264227D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726465725F6C6F676973746963735F6964222C2274797065223A347D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6964222C2274797065223A342C2276616C7565223A33367D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F6E616D65222C2274797065223A31322C2276616C7565223A224B61666B6120E4B9A6E7B18DE6B187E680BB227D2C7B226B657954797065223A224E554C4C222C226E616D65223A22736B755F696D616765222C2274797065223A31322C2276616C7565223A22687474703A2F2F7374617469632E696F636F6465722E636E2F6B61666B612E706E67227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227175616E74697479222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226F726967696E5F7072696365222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F7072696365222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F7072696365222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A226275795F746F74616C222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A22646973636F756E745F746F74616C222C2274797065223A342C2276616C7565223A307D2C7B226B657954797065223A224E554C4C222C226E616D65223A2270726573656E745F746F74616C222C2274797065223A342C2276616C7565223A31303030307D2C7B226B657954797065223A224E554C4C222C226E616D65223A227061796D656E745F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656365697665725F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A22636C6F73696E675F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A226861735F72657475726E5F65786368616E6765222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A226372656174655F74696D65222C2274797065223A39332C2276616C7565223A22323031392D30382D31322031383A30313A3338227D2C7B226B657954797065223A224E554C4C222C226E616D65223A227570646174655F74696D65222C2274797065223A39337D2C7B226B657954797065223A224E554C4C222C226E616D65223A2272656D61726B222C2274797065223A31327D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C69766572795F74797065222C2274797065223A342C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A22737461747573222C2274797065223A352C2276616C7565223A317D2C7B226B657954797065223A224E554C4C222C226E616D65223A2264656C65746564222C2274797065223A352C2276616C7565223A307D5D7D5D2C227461626C654E616D65223A22606F726465725F6974656D60227D2C226265666F7265496D616765223A7B22726F7773223A5B5D2C227461626C654E616D65223A22606F726465725F6974656D60227D2C2273716C54797065223A22494E53455254222C227461626C654E616D65223A22606F726465725F6974656D60227D5D2C22786964223A223139322E3136382E38382E31343A383039313A32303131343839373430227D, 0, '2019-08-12 18:01:37', '2019-08-12 18:01:37', NULL); -COMMIT; - -SET FOREIGN_KEY_CHECKS = 1; diff --git a/moved/order/order-service-impl/pom.xml b/moved/order/order-service-impl/pom.xml deleted file mode 100644 index 8e199e91e..000000000 --- a/moved/order/order-service-impl/pom.xml +++ /dev/null @@ -1,136 +0,0 @@ - - - - order - cn.iocoder.mall - 1.0-SNAPSHOT - - 4.0.0 - - order-service-impl - - - - - cn.iocoder.mall - user-sdk - 1.0-SNAPSHOT - compile - - - cn.iocoder.mall - product-service-api - 1.0-SNAPSHOT - compile - - - cn.iocoder.mall - pay-service-api - 1.0-SNAPSHOT - - - cn.iocoder.mall - order-service-api - 1.0-SNAPSHOT - - - cn.iocoder.mall - system-service-api - 1.0-SNAPSHOT - - - cn.iocoder.mall - user-service-api - 1.0-SNAPSHOT - - - cn.iocoder.mall - promotion-service-api - 1.0-SNAPSHOT - - - - - mysql - mysql-connector-java - - - - org.springframework - spring-tx - - - org.springframework - spring-jdbc - - - - com.alibaba - druid-spring-boot-starter - - - - com.baomidou - mybatis-plus-boot-starter - - - - - com.alibaba.cloud - spring-cloud-starter-dubbo - - - - - com.alibaba.cloud - spring-cloud-starter-alibaba-nacos-discovery - - - - - com.alibaba.cloud - spring-cloud-alibaba-seata - - - io.seata - seata-spring-boot-starter - - - - - com.alibaba.cloud - spring-cloud-starter-stream-rocketmq - - - - - com.xuxueli - xxl-job-core - - - - - com.google.guava - guava - - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - diff --git a/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCancelDO.java b/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCancelDO.java deleted file mode 100644 index d0f04d40c..000000000 --- a/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCancelDO.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.iocoder.mall.order.biz.dataobject; - -import cn.iocoder.common.framework.dataobject.BaseDO; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 订单关闭 - * - * - 注意:订单只有在用户为付款前取消。 - * - * - 取消订单,这里是取消整个订单,不能对订单 item 单独做取消 - * - * @author Sin - * @time 2019-03-30 16:20 - */ -@Data -@Accessors(chain = true) -public class OrderCancelDO extends BaseDO { - - /** - * id - */ - private Integer id; - /** - * 订单id - */ - private Integer orderId; - /** - * 订单编号 - */ - private String orderNo; - /** - * 关闭订单原因(字典) - */ - private Integer reason; - /** - * 原因(如果选择其他,原因保存在这) - */ - private String otherReason; -} diff --git a/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderDO.java b/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderDO.java deleted file mode 100644 index 554176fcc..000000000 --- a/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderDO.java +++ /dev/null @@ -1,105 +0,0 @@ -package cn.iocoder.mall.order.biz.dataobject; - -import cn.iocoder.common.framework.dataobject.DeletableDO; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.Date; - -/** - * 订单 - * - * @author Sin - * @time 2019-03-16 13:49 - */ -@Data -@Accessors(chain = true) -@TableName(value = "orders") -public class OrderDO extends DeletableDO { - - /** - * id - */ - private Integer id; - /** - * 用户编号 - */ - private Integer userId; - /** - * 订单编号 - */ - private String orderNo; - /** - * 购买(商品)总金额,单位:分 - */ - private Integer buyPrice; - /** - * 优惠总金额,单位:分。 - */ - private Integer discountPrice; - /** - * 物流金额 (分) - */ - private Integer logisticsPrice; - /** - * 最终金额,单位:分 - * - * buyPrice + logisticsPrice - discountPrice = presentPrice - */ - private Integer presentPrice; - /** - * 实际已支付金额,单位:分 - * - * 初始时,金额为 0 。等到支付成功后,会进行更新。 - */ - private Integer payAmount; - - /// - /// 时间信息 - - /** - * 付款时间(待发货) - */ - private Date paymentTime; - /** - * 发货时间(待收货) - */ - private Date deliveryTime; - /** - * 收货时间(已签收) - */ - private Date receiverTime; - /** - * 成交时间(用户确认收货 -> status = 已完成) - */ - private Date closingTime; - - /// - /// 其他 - - /** - * 是否退货 - * - * - 1、没有 - * - 2、换货 - * - 3、退货 - * - 4、换货 + 退货 - */ - private Integer hasReturnExchange; - /** - * 状态(如果有多个商品分开发货需要全部商品发完才会改变状态) - * - * - 1、待付款 - * - 2、待发货 - * - 3、待收获 - * - 4、已完成 - * - 5、已关闭 - */ - private Integer status; - /** - * 备注 - */ - private String remark; - -} diff --git a/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderItemDO.java b/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderItemDO.java deleted file mode 100644 index 4bf5da309..000000000 --- a/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderItemDO.java +++ /dev/null @@ -1,144 +0,0 @@ -package cn.iocoder.mall.order.biz.dataobject; - -import cn.iocoder.common.framework.dataobject.DeletableDO; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.Date; - -/** - * 订单 item - * - * @author Sin - * @time 2019-03-16 14:03 - */ -@Data -@Accessors(chain = true) -public class OrderItemDO extends DeletableDO { - - /** - * 编号 - */ - private Integer id; - /** - * 订单编号 - */ - private Integer orderId; - /** - * 订单号 - */ - private String orderNo; - /** - * 商品编号 - */ - private Integer skuId; - /** - * 物流id - */ - private Integer orderLogisticsId; - /** - * 商品名称 - */ - private String skuName; - /** - * 商品图片 - */ - private String skuImage; - /** - * 数量 - */ - private Integer quantity; - /** - * 原始单价,单位:分。 - */ - private Integer originPrice; - /** - * 购买单价,单位:分 - */ - private Integer buyPrice; - /** - * 最终价格,单位:分。 - */ - private Integer presentPrice; - /** - * 购买总金额,单位:分 - * - * 用途类似 {@link #presentTotal} - */ - private Integer buyTotal; - /** - * 优惠总金额,单位:分。 - */ - private Integer discountTotal; - /** - * 最终总金额,单位:分。 - * - * 注意,presentPrice * quantity 不一定等于 presentTotal 。 - * 因为,存在无法整除的情况。 - * 举个例子,presentPrice = 8.33 ,quantity = 3 的情况,presentTotal 有可能是 24.99 ,也可能是 25 。 - * 所以,需要存储一个该字段。 - */ - private Integer presentTotal; - // 如上字段,举个例子: - // 假设购买三个,即 quantity = 3 。 - // originPrice = 15 - // 使用限时折扣(单品优惠)8 折,buyPrice = 12 - // 开始算总的价格 - // buyTotal = buyPrice * quantity = 12 * 3 = 36 - // discountTotal ,假设有满减送(分组优惠)满 20 减 10 ,并且使用优惠劵满 1.01 减 1 ,则 discountTotal = 10 + 1 = 11 - // presentTotal = buyTotal - discountTotal = 24 - 11 = 13 - // 最终 presentPrice = presentTotal / quantity = 13 / 3 = 4.33 - - /// - /// 时间信息 - - /** - * 付款时间 - */ - private Date paymentTime; - /** - * 发货时间 - */ - private Date deliveryTime; - /** - * 收货时间 - */ - private Date receiverTime; - /** - * 成交时间 - */ - private Date closingTime; - - /// - /// 其他 - - /** - * 是否退货 - * - * - 1、没有 - * - 2、换货 - * - 3、退货 - * - 4、换货 + 退货 - */ - private Integer hasReturnExchange; - /** - * 发货方式 - * - * - 1 未选择 - * - 2 在线下单 - * - 3 自己联系快递 - * - 4 无物流 - */ - private Integer deliveryType; - /** - * 状态 - * - * - 1、待付款 - * - 2、待发货 - * - 3、已发货 - * - 4、已完成 - * - 5、已关闭 - */ - private Integer status; - -} diff --git a/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderRecipientDO.java b/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderRecipientDO.java deleted file mode 100644 index 06946b89f..000000000 --- a/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderRecipientDO.java +++ /dev/null @@ -1,48 +0,0 @@ -package cn.iocoder.mall.order.biz.dataobject; - -import cn.iocoder.common.framework.dataobject.BaseDO; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 订单收件人信息 order_recipient (配送信息) - * - * @author Sin - * @time 2019-03-31 11:37 - */ -@Data -@Accessors(chain = true) -public class OrderRecipientDO extends BaseDO { - - /** - * 编号 - */ - private Integer id; - /** - * 订单id - */ - private Integer orderId; - /** - * 收件区域编号 - */ - private String areaNo; - /** - * 收件人名称 - */ - private String name; - /** - * 收件手机号 - */ - private String mobile; - /** - * 配送类型 - * - * - 1 快递 - */ - private Integer type; - /** - * 收件详细地址 - */ - private String address; - -} diff --git a/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderServiceImpl.java b/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderServiceImpl.java index ade3d8188..2f4f8d943 100644 --- a/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderServiceImpl.java +++ b/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/service/OrderServiceImpl.java @@ -210,151 +210,6 @@ public class OrderServiceImpl implements OrderService { return CommonResult.success(orderInfoBO); } - @Override - @GlobalTransactional -// @Transactional // 使用 Seata 分布事务后,无需在使用 @Transactional 注解。 - public CommonResult createOrder(OrderCreateDTO orderCreateDTO) { - Integer userId = orderCreateDTO.getUserId(); - List orderItemDTOList = orderCreateDTO.getOrderItems(); - List orderItemDOList = OrderItemConvert.INSTANCE.convert(orderItemDTOList); - - // 获取商品信息 - Set skuIds = orderItemDOList.stream().map(OrderItemDO::getSkuId).collect(Collectors.toSet()); - List productList = productSpuService.getProductSkuDetailList(skuIds); - if (orderItemDTOList.size() != productList.size()) { // 校验获得的数量,是否匹配 - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_GET_GOODS_INFO_INCORRECT.getCode()); - } - - // 价格计算 - CalcOrderPriceBO calcOrderPrice = calcOrderPrice(productList, orderCreateDTO); - - // 设置 orderItem - Map productSpuBOMap = productList - .stream().collect(Collectors.toMap(ProductSkuDetailBO::getId, o -> o)); // 商品 SKU 信息的集合 - Map priceItemMap = new HashMap<>(); // 商品 SKU 价格的映射 - calcOrderPrice.getItemGroups().forEach(itemGroup -> - itemGroup.getItems().forEach(item -> priceItemMap.put(item.getId(), item))); - // 遍历 orderItemDOList 数组,将商品信息、商品价格,设置到其中 - for (OrderItemDO orderItemDO : orderItemDOList) { - ProductSkuDetailBO productSkuDetailBO = productSpuBOMap.get(orderItemDO.getSkuId()); - if (productSkuDetailBO.getQuantity() <= 0) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_INSUFFICIENT_INVENTORY.getCode()); - } - if (productSkuDetailBO.getPrice() <= 0) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_GOODS_AMOUNT_INCORRECT.getCode()); - } - // 设置 SKU 信息 - orderItemDO.setSkuImage(Optional.ofNullable(productSkuDetailBO.getSpu().getPicUrls().get(0)).get()); - orderItemDO.setSkuName(productSkuDetailBO.getSpu().getName()); - // 设置价格信息 - CalcOrderPriceBO.Item priceItem = priceItemMap.get(orderItemDO.getSkuId()); - Assert.notNull(priceItem, "商品计算价格为空"); - orderItemDO.setOriginPrice(priceItem.getOriginPrice()) - .setBuyPrice(priceItem.getBuyPrice()) - .setPresentPrice(priceItem.getPresentPrice()) - .setBuyTotal(priceItem.getBuyTotal()) - .setDiscountTotal(priceItem.getDiscountTotal()) - .setPresentTotal(priceItem.getPresentTotal()); - } - - // 标记优惠劵已使用 - if (orderCreateDTO.getCouponCardId() != null) { - couponService.useCouponCard(userId, orderCreateDTO.getCouponCardId()); - } - - // TODO 芋艿,扣除库存 - - // order - - // TODO: 2019-04-11 Sin 订单号需要生成规则 - // TODO FROM 芋艿 to 小范:可以考虑抽象成一个方法,下面几个也是。 - String orderNo = UUID.randomUUID().toString().replace("-", "").substring(0, 16); -// Integer totalAmount = orderCommon.calculatedAmount(orderItemDOList); -// Integer totalPrice = orderCommon.calculatedPrice(orderItemDOList); -// Integer totalLogisticsPrice = orderCommon.calculatedLogisticsPrice(orderItemDOList); - OrderDO orderDO = new OrderDO() - .setUserId(userId) - .setOrderNo(orderNo) - .setBuyPrice(calcOrderPrice.getFee().getBuyTotal()) - .setDiscountPrice(calcOrderPrice.getFee().getDiscountTotal()) - .setLogisticsPrice(calcOrderPrice.getFee().getPostageTotal()) - .setPresentPrice(calcOrderPrice.getFee().getPresentTotal()) - .setPayAmount(0) - .setClosingTime(null) - .setDeliveryTime(null) - .setPaymentTime(null) - .setStatus(OrderStatusEnum.WAITING_PAYMENT.getValue()) - .setHasReturnExchange(OrderHasReturnExchangeEnum.NO.getValue()) - .setRemark(Optional.ofNullable(orderCreateDTO.getRemark()).orElse("")); - orderDO.setDeleted(DeletedStatusEnum.DELETED_NO.getValue()); -// orderDO.setCreateTime(new Date()); -// orderDO.setUpdateTime(null); - orderMapper.insert(orderDO); - - // 收件人信息 - CommonResult userAddressResult = userAddressService.getAddress(userId, orderCreateDTO.getUserAddressId()); - if (userAddressResult.isError()) { - return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_GET_USER_ADDRESS_FAIL.getCode()); - } - UserAddressBO userAddressBO = userAddressResult.getData(); - OrderRecipientDO orderRecipientDO = OrderRecipientConvert.INSTANCE.convert(userAddressBO); - orderRecipientDO - .setOrderId(orderDO.getId()) - .setType(OrderRecipientTypeEnum.EXPRESS.getValue()) - .setCreateTime(new Date()) - .setUpdateTime(null); - orderRecipientMapper.insert(orderRecipientDO); - - // order item - orderItemDOList.forEach(orderItemDO -> { - orderItemDO - .setOrderId(orderDO.getId()) - .setOrderNo(orderDO.getOrderNo()) - .setPaymentTime(null) - .setDeliveryTime(null) - .setReceiverTime(null) - .setClosingTime(null) - .setHasReturnExchange(OrderStatusEnum.WAITING_PAYMENT.getValue()) - .setDeliveryType(OrderDeliveryTypeEnum.NONE.getValue()) - .setStatus(OrderStatusEnum.WAITING_PAYMENT.getValue()) - .setDeleted(DeletedStatusEnum.DELETED_NO.getValue()) - .setCreateTime(new Date()) - .setUpdateTime(null); - }); - // 一次性插入 - orderItemMapper.insert(orderItemDOList); - - // 创建预订单 - createPayTransaction(orderDO, orderItemDOList, orderCreateDTO.getIp()); - -// if (commonResult.isError()) { -// //手动开启事务回滚 -// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_GET_PAY_FAIL.getValue()); -// } - - // TODO: 2019-03-17 Sin 需要发送 创建成果 MQ 消息,业务扩展和统计 - return CommonResult.success( - new OrderCreateBO() - .setId(orderDO.getId()) - .setOrderNo(orderDO.getOrderNo()) - .setPayAmount(orderDO.getPayAmount()) - ); - } - - private CalcOrderPriceBO calcOrderPrice(List skus, OrderCreateDTO orderCreateDTO) { - // 创建计算的 DTO - CalcOrderPriceDTO calcOrderPriceDTO = new CalcOrderPriceDTO() - .setUserId(orderCreateDTO.getUserId()) - .setItems(new ArrayList<>(skus.size())) - .setCouponCardId(orderCreateDTO.getCouponCardId()); - for (OrderCreateDTO.OrderItem item : orderCreateDTO.getOrderItems()) { - calcOrderPriceDTO.getItems().add(new CalcOrderPriceDTO.Item(item.getSkuId(), item.getQuantity(), true)); - } - // 执行计算 - return cartService.calcOrderPrice(calcOrderPriceDTO); - } - private PayTransactionBO createPayTransaction(OrderDO order, List orderItems, String ip) { // TODO sin 支付订单 orderSubject 暂时取第一个子订单商品信息 String orderSubject = orderItems.get(0).getSkuName(); diff --git a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/manager/package-info.java b/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/manager/package-info.java deleted file mode 100644 index ddd8e624e..000000000 --- a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/manager/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package cn.iocoder.mall.orderservice.manager; diff --git a/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/cart/CartItemStatusEnum.java b/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/cart/CartItemStatusEnum.java deleted file mode 100644 index 03ed5bacc..000000000 --- a/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/cart/CartItemStatusEnum.java +++ /dev/null @@ -1,46 +0,0 @@ -package cn.iocoder.mall.order.biz.enums.cart; - -import java.util.Arrays; - -public enum CartItemStatusEnum { - - ENABLE(1, "正常"), - DELETE_BY_MANUAL(2, "主动删除"), - DELETE_BY_ORDER(3, "下单删除"), - ; - - public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CartItemStatusEnum::getValue).toArray(); - - /** - * 状态值 - */ - private Integer value; - /** - * 状态名 - */ - private String name; - - CartItemStatusEnum(Integer value, String name) { - this.value = value; - this.name = name; - } - - public Integer getValue() { - return value; - } - - public CartItemStatusEnum setValue(Integer value) { - this.value = value; - return this; - } - - public String getName() { - return name; - } - - public CartItemStatusEnum setName(String name) { - this.name = name; - return this; - } - -} diff --git a/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderErrorCodeEnum.java b/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderErrorCodeEnum.java deleted file mode 100644 index 13ca7185f..000000000 --- a/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderErrorCodeEnum.java +++ /dev/null @@ -1,68 +0,0 @@ -package cn.iocoder.mall.order.biz.enums.order; - -/** - * 订单错误码 - * - * 错误码区间 [1-008-000-000 ~ 1-008-000-000] - * - * @author Sin - * @time 2019-03-23 11:23 - */ -public enum OrderErrorCodeEnum { - - // order - ORDER_NOT_EXISTENT(1008000000, "获取订单不存在!"), - ORDER_GET_SKU_FAIL(1008000001, "获取商品失败!"), - ORDER_GET_SKU_NOT_EXISTENT(1008000002, "获取的商品不存在!"), - ORDER_PAY_AMOUNT_NOT_NEGATIVE(1008000003, "支付金额不能为负数!"), - ORDER_STATUS_NOT_CANCEL(1008000004, "订单状态不能取消!"), - ORDER_DELIVERY_INCORRECT_DATA(1008000005, "订单发货数据不正确!"), - ORDER_INSUFFICIENT_INVENTORY(1008000006, "库存不足!"), - ORDER_GOODS_AMOUNT_INCORRECT(1008000007, "商品金额非法!"), - ORDER_GET_GOODS_INFO_INCORRECT(1008000008, "获取额商品信息不正确!"), - ORDER_GET_USER_ADDRESS_FAIL(1008000009, "获取用户地址失败!"), - ORDER_GET_PAY_FAIL(1008000010, "调用pay失败!"), - ORDER_NOT_USER_ORDER(1008000011, "不是该用户的订单!"), - ORDER_UNABLE_CONFIRM_ORDER(1008000012, "状态不对不能确认订单!"), - ORDER_CREATE_CART_IS_EMPTY(1008000013, "购物车无选中的商品,无法创建订单"), - ORDER_STATUS_NOT_WAITING_PAYMENT(1008000014, "订单不处于等待支付状态"), - ORDER_PAY_AMOUNT_ERROR(1008000015, "订单金额不正确"), - - // order item - ORDER_ITEM_ONLY_ONE(1008000200, "订单Item只有一个!"), - ORDER_ITEM_SOME_NOT_EXISTS(1008000201, "有不存在的商品!"), - - // 订单退货 - ORDER_RETURN_NO_RETURN_APPLY(1008000400, "未退货申请"), - ORDER_RETURN_NOT_EXISTENT(1008000401, "退货订单不存在"), - ORDER_RETURN_REFUND_FAILED(1008000402, "退款失败"), - - // ========== 购物车 ========== - CARD_ITEM_NOT_FOUND(1008003000, "购物车项不存在"), - CARD_ITEM_SKU_NOT_FOUND(1008003001, "商品不存在"), - CARD_ITEM_SKU_QUANTITY_NOT_ENOUGH(1008003002, "商品库存不足"), - - // 工具类服务 1008004000 - DICT_SERVER_INVOKING_FAIL(1008004000, "字典服务调用失败!"), - ORDER_LOGISTICS_INVOKING_FAIL(1008004001, "订单物流调用失败!"), - - - ; - - private final int code; - private final String message; - - OrderErrorCodeEnum(int code, String message) { - this.code = code; - this.message = message; - } - - public int getCode() { - return code; - } - - public String getMessage() { - return message; - } - -} diff --git a/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderHasReturnExchangeEnum.java b/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderHasReturnExchangeEnum.java deleted file mode 100644 index bd12c3230..000000000 --- a/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderHasReturnExchangeEnum.java +++ /dev/null @@ -1,37 +0,0 @@ -package cn.iocoder.mall.order.biz.enums.order; - -/** - * 订单 - 是否退换货状态 - * - * @author Sin - * @time 2019-03-22 21:34 - */ -public enum OrderHasReturnExchangeEnum { - - NO(1, "没有"), - RETURN_GOODS(2, "退货"), - EXCHANGE_GOODS(3, "换货"), - RETURN_EXCHANGE_GOODS(4, "退换货"); - - /** - * 状态值 - */ - private Integer value; - /** - * 状态名 - */ - private String name; - - OrderHasReturnExchangeEnum(Integer value, String name) { - this.value = value; - this.name = name; - } - - public Integer getValue() { - return value; - } - - public String getName() { - return name; - } -} diff --git a/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderReturnStatusEnum.java b/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderReturnStatusEnum.java deleted file mode 100644 index 3fe0fdfc8..000000000 --- a/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderReturnStatusEnum.java +++ /dev/null @@ -1,45 +0,0 @@ -package cn.iocoder.mall.order.biz.enums.order; - -/** - * 订单退货 status - * - * @author Sin - * @time 2019-03-30 15:56 - */ -public enum OrderReturnStatusEnum { - - /** - * 状态 - * - * - 1、退货申请 - * - 2、申请成功 - * - 3、申请失败 - * - 4、退货中 - * - 5、已收货 - * - 6、拒绝退款 - */ - RETURN_APPLICATION(1, "退货申请"), - APPLICATION_SUCCESSFUL(2, "申请成功"), - APPLICATION_FAIL(3, "申请失败"), - RETURN_IN(4, "退货中"), - ORDER_RECEIPT(5, "确认收货"), - RETURN_SUCCESS(6, "退货成功"), - ; - private final int value; - - private final String name; - - OrderReturnStatusEnum(int value, String name) { - this.value = value; - this.name = name; - } - - public int getValue() { - return value; - } - - public String getName() { - return name; - } - -} diff --git a/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderReturnTypeEnum.java b/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderReturnTypeEnum.java deleted file mode 100644 index a4bfbb2b3..000000000 --- a/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderReturnTypeEnum.java +++ /dev/null @@ -1,31 +0,0 @@ -package cn.iocoder.mall.order.biz.enums.order; - -/** - * 订单退货 类型 - * - * @author Sin - * @time 2019-03-30 15:42 - */ -public enum OrderReturnTypeEnum { - - ORDER(1, "订单"), - ORDER_ITEM(2, "订单item"), - ; - - private final int value; - - private final String name; - - OrderReturnTypeEnum(int value, String name) { - this.value = value; - this.name = name; - } - - public int getValue() { - return value; - } - - public String getName() { - return name; - } -} diff --git a/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderStatusEnum.java b/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderStatusEnum.java deleted file mode 100644 index d7a0933e2..000000000 --- a/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/enums/order/OrderStatusEnum.java +++ /dev/null @@ -1,38 +0,0 @@ -package cn.iocoder.mall.order.biz.enums.order; - -/** - * 订单 - status - * - * @author Sin - * @time 2019-03-16 14:06 - */ -public enum OrderStatusEnum { - - WAITING_PAYMENT(1, "等待付款"), - WAIT_SHIPMENT(2, "等待发货"), - ALREADY_SHIPMENT(3, "已发货"), - COMPLETED(4, "已完成"), - CLOSED(5, "已关闭"); - - /** - * 状态值 - */ - private Integer value; - /** - * 状态名 - */ - private String name; - - OrderStatusEnum(int value, String name) { - this.value = value; - this.name = name; - } - - public int getValue() { - return value; - } - - public String getName() { - return name; - } -} diff --git a/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/package-info.java b/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/package-info.java deleted file mode 100644 index 6c1bb4730..000000000 --- a/order/order-biz-api/src/main/java/cn/iocoder/mall/order/biz/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -/** - * 该项目,主要用于暴露一些共享的枚举类等。 - * - * 例如说,RPC 接口提供错误码给调用方 - */ -package cn.iocoder.mall.order.biz; diff --git a/order/order-biz/pom.xml b/order/order-biz/pom.xml deleted file mode 100644 index 322599e8e..000000000 --- a/order/order-biz/pom.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - system - cn.iocoder.mall - 1.0-SNAPSHOT - - 4.0.0 - - order-biz - - - - cn.iocoder.mall - order-biz-api - 1.0-SNAPSHOT - - - - - org.springframework.boot - spring-boot-starter - - - - - mysql - mysql-connector-java - - - - org.springframework - spring-tx - - - org.springframework - spring-jdbc - - - com.alibaba - druid-spring-boot-starter - - - - cn.iocoder.mall - mall-spring-boot-starter-mybatis - 1.0-SNAPSHOT - - - - - org.springframework.boot - spring-boot-starter-data-mongodb - - - - - org.mapstruct - mapstruct - - - org.mapstruct - mapstruct-jdk8 - - - org.projectlombok - lombok - - - - com.alibaba - fastjson - - - - - - diff --git a/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/config/DatabaseConfiguration.java b/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/config/DatabaseConfiguration.java deleted file mode 100644 index c23aba7b7..000000000 --- a/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/config/DatabaseConfiguration.java +++ /dev/null @@ -1,28 +0,0 @@ -package cn.iocoder.mall.order.biz.config; - -import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector; -import com.baomidou.mybatisplus.core.injector.ISqlInjector; -import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; -import org.mybatis.spring.annotation.MapperScan; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.transaction.annotation.EnableTransactionManagement; - -@Configuration -@MapperScan("cn.iocoder.mall.order.biz.dao") // 扫描对应的 Mapper 接口 -@EnableTransactionManagement(proxyTargetClass = true) // 启动事务管理。为什么使用 proxyTargetClass 参数,参见 https://blog.csdn.net/huang_550/article/details/76492600 -public class DatabaseConfiguration { - - // 数据库连接池 Druid - - @Bean - public ISqlInjector sqlInjector() { - return new DefaultSqlInjector(); // MyBatis Plus 逻辑删除 - } - - @Bean - public PaginationInterceptor paginationInterceptor() { - return new PaginationInterceptor(); // MyBatis Plus 分页插件 - } - -} diff --git a/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/cart/CartMapper.java b/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/cart/CartMapper.java deleted file mode 100644 index e97ea9af2..000000000 --- a/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dao/cart/CartMapper.java +++ /dev/null @@ -1,43 +0,0 @@ -package cn.iocoder.mall.order.biz.dao.cart; - -import cn.iocoder.mall.order.biz.dataobject.CartItemDO; -import org.apache.ibatis.annotations.Param; -import org.springframework.stereotype.Repository; - -@Repository -public interface CartMapper { -// -// CartItemDO selectById(@Param("id") Integer id); -// -// List selectByIds(@Param("ids") Collection ids); -// -// CartItemDO selectByUserIdAndSkuIdAndStatus(@Param("userId") Integer userId, -// @Param("skuId") Integer skuId, -// @Param("status") Integer status); -// -// Integer selectQuantitySumByUserIdAndStatus(@Param("userId") Integer userId, -// @Param("status") Integer status); -// -// List selectByUserIdAndStatusAndSelected(@Param("userId") Integer userId, -// @Param("status") Integer status, -// @Param("selected") Boolean selected); -//// -//// List selectListByTitleLike(@Param("title") String title, -//// @Param("offset") Integer offset, -//// @Param("limit") Integer limit); -// -//// Integer selectCountByTitleLike(@Param("title") String title); -// -// void insert(CartItemDO cartItemDO); -// -// int update(CartItemDO cartItemDO); -// -// int updateQuantity(@Param("id") Integer id, -// @Param("quantityIncr") Integer quantityIncr); -// -// int updateListByUserIdAndSkuId(@Param("userId") Integer userId, -// @Param("skuIds") Collection skuIds, -// @Param("selected") Boolean selected, -// @Param("status") Integer status); - -} diff --git a/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCancelDO.java b/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCancelDO.java deleted file mode 100644 index d930b2168..000000000 --- a/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderCancelDO.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.iocoder.mall.order.biz.dataobject; - -import cn.iocoder.mall.mybatis.core.dataobject.BaseDO; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 订单关闭 - * - * - 注意:订单只有在用户为付款前取消。 - * - * - 取消订单,这里是取消整个订单,不能对订单 item 单独做取消 - * - * @author Sin - * @time 2019-03-30 16:20 - */ -@Data -@Accessors(chain = true) -public class OrderCancelDO extends BaseDO { - - /** - * id - */ - private Integer id; - /** - * 订单id - */ - private Integer orderId; - /** - * 订单编号 - */ - private String orderNo; - /** - * 关闭订单原因(字典) - */ - private Integer reason; - /** - * 原因(如果选择其他,原因保存在这) - */ - private String otherReason; -} diff --git a/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderDO.java b/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderDO.java deleted file mode 100644 index d56f1eb50..000000000 --- a/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderDO.java +++ /dev/null @@ -1,104 +0,0 @@ -package cn.iocoder.mall.order.biz.dataobject; - -import cn.iocoder.mall.mybatis.core.dataobject.DeletableDO; -import com.baomidou.mybatisplus.annotation.TableName; -import java.util.Date; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 订单 - * - * @author Sin - * @time 2019-03-16 13:49 - */ -@Data -@Accessors(chain = true) -@TableName(value = "orders") -public class OrderDO extends DeletableDO { - - /** - * id - */ - private Integer id; - /** - * 用户编号 - */ - private Integer userId; - /** - * 订单编号 - */ - private String orderNo; - /** - * 购买(商品)总金额,单位:分 - */ - private Integer buyPrice; - /** - * 优惠总金额,单位:分。 - */ - private Integer discountPrice; - /** - * 物流金额 (分) - */ - private Integer logisticsPrice; - /** - * 最终金额,单位:分 - * - * buyPrice + logisticsPrice - discountPrice = presentPrice - */ - private Integer presentPrice; - /** - * 实际已支付金额,单位:分 - * - * 初始时,金额为 0 。等到支付成功后,会进行更新。 - */ - private Integer payAmount; - - /// - /// 时间信息 - - /** - * 付款时间(待发货) - */ - private Date paymentTime; - /** - * 发货时间(待收货) - */ - private Date deliveryTime; - /** - * 收货时间(已签收) - */ - private Date receiverTime; - /** - * 成交时间(用户确认收货 -> status = 已完成) - */ - private Date closingTime; - - /// - /// 其他 - - /** - * 是否退货 - * - * - 1、没有 - * - 2、换货 - * - 3、退货 - * - 4、换货 + 退货 - */ - private Integer hasReturnExchange; - /** - * 状态(如果有多个商品分开发货需要全部商品发完才会改变状态) - * - * - 1、待付款 - * - 2、待发货 - * - 3、待收获 - * - 4、已完成 - * - 5、已关闭 - */ - private Integer status; - /** - * 备注 - */ - private String remark; - -} diff --git a/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderPreferentialDO.java b/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderPreferentialDO.java deleted file mode 100644 index b7b06cf42..000000000 --- a/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderPreferentialDO.java +++ /dev/null @@ -1,46 +0,0 @@ -package cn.iocoder.mall.order.biz.dataobject; - -/** - * 订单优惠明细 - */ -// TODO 芋艿 后续在完善 -public class OrderPreferentialDO { - - /** - * 编号 - */ - private Integer id; - /** - * 类型 - * - * 1 - 促销活动 - * 2 - 优惠劵 - */ - private Integer type; - // TODO 芋艿 优惠劵编号 or 促销活动编号 - /** - * 订单编号 - */ - private Integer orderId; - /** - * 商品 SPU 编号 - */ - private Integer spuId; - /** - * 商品 SKU 编号 - */ - private Integer skuId; - /** - * 商品数量 - */ - private Integer quantity; - /** - * 传入时的价格 - */ - private Integer originTotal; - /** - * 总优惠价格 - */ - private Integer discountTotal; - -} diff --git a/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderRecipientDO.java b/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderRecipientDO.java deleted file mode 100644 index 989b51f64..000000000 --- a/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderRecipientDO.java +++ /dev/null @@ -1,48 +0,0 @@ -package cn.iocoder.mall.order.biz.dataobject; - -import cn.iocoder.mall.mybatis.core.dataobject.BaseDO; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 订单收件人信息 order_recipient (配送信息) - * - * @author Sin - * @time 2019-03-31 11:37 - */ -@Data -@Accessors(chain = true) -public class OrderRecipientDO extends BaseDO { - - /** - * 编号 - */ - private Integer id; - /** - * 订单id - */ - private Integer orderId; - /** - * 收件区域编号 - */ - private String areaNo; - /** - * 收件人名称 - */ - private String name; - /** - * 收件手机号 - */ - private String mobile; - /** - * 配送类型 - * - * - 1 快递 - */ - private Integer type; - /** - * 收件详细地址 - */ - private String address; - -} diff --git a/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/CartService.java b/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/CartService.java deleted file mode 100644 index e2aaf0fcd..000000000 --- a/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/CartService.java +++ /dev/null @@ -1,111 +0,0 @@ -package cn.iocoder.mall.order.biz.service; - -public interface CartService { - - -// // ========== 购物车与订单相关的逻辑 ========== -// -// /** -// * 计算订单金额,返回计算结果 -// * -// * @param calcOrderPriceDTO 计算订单金额 DTO -// * @return 计算订单金额结果 -// */ -// CalcOrderPriceBO calcOrderPrice(CalcOrderPriceDTO calcOrderPriceDTO); -// -// /** -// * 计算指定商品 SKU 的金额,并返回计算结果 -// * -// * TODO 芋艿,此处只会计算,限时折扣带来的价格变化。 -// * -// * @param skuId 商品 SKU 编号 -// * @return 计算订单金额结果 -// */ -// CalcSkuPriceBO calcSkuPrice(Integer skuId); // ========== 购物车 Item 的逻辑 ========== -// -// /** -// * 添加商品至购物车 -// * -// * @param userId 用户编号 -// * @param skuId 商品 SKU 编号 -// * @param quantity 数量 -// * @return 是否成功 -// */ -// Boolean add(Integer userId, Integer skuId, Integer quantity); -// -// /** -// * 购物车更新商品数量 -// * -// * @param userId 用户编号 -// * @param skuId 商品 SKU 编号 -// * @param quantity 数量 -// * @return 是否成功 -// */ -// Boolean updateQuantity(Integer userId, Integer skuId, Integer quantity); -// -// /** -// * 购物车更新商品是否选中 -// * -// * @param userId 用户编号 -// * @param skuIds 商品 SKU 编号数组 -// * @param selected 是否选中 -// * @return 是否成功 -// */ -// Boolean updateSelected(Integer userId, Collection skuIds, Boolean selected); -// -// /** -// * 购物车删除商品 -// * -// * @param userId 用户编号 -// * @param skuIds 商品 SKU 编号的数组 -// * -// * @return 是否成功 -// */ -// Boolean deleteList(Integer userId, List skuIds); -// -// /** -// * 清空购物车 -// * -// * @param userId 用户编号 -// * @return 是否成功 -// */ -// Boolean deleteAll(Integer userId); -// -// /** -// * 查询用户在购物车中的商品数量 -// * -// * @param userId 用户编号 -// * @return 商品数量 -// */ -// Integer count(Integer userId); -// -// /** -// * 显示买家购物车中的商品列表,并根据 selected 进行过滤。 -// * -// * @param userId 用户编号 -// * @param selected 是否选中。若为空,则不进行筛选 -// * @return 购物车中商品列表信息 -// */ -// List list(Integer userId, @Nullable Boolean selected); -// -// // ========== 购物车与订单相关的逻辑 ========== -// -// /** -// * 计算订单金额,返回计算结果 -// * -// * @param calcOrderPriceDTO 计算订单金额 DTO -// * @return 计算订单金额结果 -// */ -// CalcOrderPriceBO calcOrderPrice(CalcOrderPriceDTO calcOrderPriceDTO); -// -// /** -// * 计算指定商品 SKU 的金额,并返回计算结果 -// * -// * TODO 芋艿,此处只会计算,限时折扣带来的价格变化。 -// * -// * @param skuId 商品 SKU 编号 -// * @return 计算订单金额结果 -// */ -// CalcSkuPriceBO calcSkuPrice(Integer skuId); - -} diff --git a/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/OrderService.java b/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/OrderService.java deleted file mode 100644 index efce48107..000000000 --- a/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/OrderService.java +++ /dev/null @@ -1,156 +0,0 @@ -package cn.iocoder.mall.order.biz.service; - -/** - * 订单 service - * - * @author Sin - * @time 2019-03-16 13:15 - */ -public interface OrderService { - -// /** -// * 订单 page -// * -// * @param orderQueryDTO -// * @return -// */ -// CommonResult getOrderPage(OrderQueryDTO orderQueryDTO); -// -// /** -// * 获取订单items -// * -// * @param orderId -// * @return -// */ -// CommonResult> getOrderItems(Integer orderId); -// -// /** -// * 订单收件人信息 -// * -// * @param orderId -// * @return -// */ -// CommonResult getOrderRecipientBO(Integer orderId); -// -// /** -// * 订单info -// * -// * @param userId -// * @param orderId -// * @return -// */ -// CommonResult info(Integer userId, Integer orderId); -// -// /** -// * 订单 - 创建 -// * -// * @param orderCreateDTO -// * @return -// */ -// CommonResult createOrder(OrderCreateDTO orderCreateDTO); -// -// /** -// * 订单item - 更新 -// * -// * @param orderItemUpdateDTO -// * -// */ -// CommonResult updateOrderItem(OrderItemUpdateDTO orderItemUpdateDTO); -// -// /** -// * 更新订单item - payAmount(实付金额) -// * -// * @param orderId -// * @param orderItemId -// * @param payAmount -// * @return -// */ -// CommonResult updateOrderItemPayAmount(Integer orderId, Integer orderItemId, Integer payAmount); -// -// /** -// * 订单 - 取消订单 -// * -// * @param orderId -// * @return -// */ -// CommonResult cancelOrder(Integer orderId, Integer reasons, String otherReasons); -// -// /** -// * 订单发货 -// * -// * @param orderDelivery -// * @return -// */ -// CommonResult orderDelivery(OrderDeliveryDTO orderDelivery); -// -// /** -// * 更新订单 - 备注 -// * -// * @param orderId -// * @param remake -// * @return -// */ -// CommonResult updateOrderRemake(Integer orderId, String remake); -// -// /** -// * 删除订单item -// * -// * @param orderItemDeletedDTO -// * @return -// */ -// CommonResult deleteOrderItem(OrderItemDeletedDTO orderItemDeletedDTO); -// -// /** -// * 用户确认订单 -// * -// * @param userId -// * @param orderId -// * @return -// */ -// CommonResult confirmReceiving(Integer userId, Integer orderId); -// -// /** -// * 更新订单 - 收件这信息 -// * -// * 包含: -// * - 详细地址 -// * - 区域编号 -// * - 联系人电话 -// * - 联系人姓名 -// */ -// CommonResult updateLogistics(OrderLogisticsUpdateDTO orderLogisticsDTO); -// -// /** -// * 删除订单 // TODO FROM 芋艿 to 小范。删除订单,不要使用 deleted 字段,对于用户是删除,实际是隐藏。 -// * -// * @param id -// */ -// CommonResult deleteOrder(Integer id); -// -// /** -// * 更新订单支付成功 -// * -// * 如果成功,则返回 success -// * 如果失败,则返回具体原因 -// * -// * @param orderId 订单编号 -// * @param payAmount 支付的订单金额 -// * @return 支付结果 -// */ -// String updatePaySuccess(String orderId, Integer payAmount); -// -// /** -// * 监听确认收货 -// * -// * mq 更新 status -// */ -// CommonResult listenerConfirmGoods(); -// -// /** -// * 监听换货 -// * -// * mq 更新 status -// */ -// CommonResult listenerExchangeGoods(); - -} diff --git a/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/impl/CartServiceImpl.java b/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/impl/CartServiceImpl.java deleted file mode 100644 index 3013129c8..000000000 --- a/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/impl/CartServiceImpl.java +++ /dev/null @@ -1,488 +0,0 @@ -package cn.iocoder.mall.order.biz.service.impl; - -import cn.iocoder.mall.order.biz.service.CartService; -import org.springframework.stereotype.Service; - -/** - * 购物车服务 Service 实现类 - */ -@Service -@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.CartService.version}") -public class CartServiceImpl implements CartService { - -// @Reference(validation = "true", version = "${dubbo.consumer.PromotionActivityService.version}") -// private ProductSpuService productSpuService; -// @Reference(validation = "true", version = "${dubbo.consumer.PromotionActivityService.version}") -// private PromotionActivityService promotionActivityService; -// @Reference(validation = "true", version = "${dubbo.consumer.CouponService.version}") -// private CouponService couponService; -// -// @Autowired -// private CartMapper cartMapper; -// -// @Override -// @SuppressWarnings("Duplicates") -// public Boolean add(Integer userId, Integer skuId, Integer quantity) { -// // 查询 SKU 是否合法 -// ProductSkuBO sku = productSpuService.getProductSku(skuId); -// if (sku == null -// || CommonStatusEnum.DISABLE.getValue().equals(sku.getStatus())) { // sku 被禁用 -// throw ServiceExceptionUtil.exception(OrderErrorCodeEnum.CARD_ITEM_SKU_NOT_FOUND.getCode()); -// } -// // TODO 芋艿,后续基于商品是否上下架进一步完善。 -// // 查询 CartItemDO -// CartItemDO item = cartMapper.selectByUserIdAndSkuIdAndStatus(userId, skuId, CartItemStatusEnum.ENABLE.getValue()); -// // 存在,则进行数量更新 -// if (item != null) { -// return updateQuantity0(item, sku, quantity); -// } -// // 不存在,则进行插入 -// return add0(userId, sku, quantity); -// } -// -// private Boolean add0(Integer userId, ProductSkuBO sku, Integer quantity) { -// // 校验库存 -// if (quantity > sku.getQuantity()) { -// throw ServiceExceptionUtil.exception(OrderErrorCodeEnum.CARD_ITEM_SKU_NOT_FOUND.getCode()); -// } -// // 创建 CartItemDO 对象,并进行保存。 -// CartItemDO item = new CartItemDO() -// // 基础字段 -// .setStatus(CartItemStatusEnum.ENABLE.getValue()).setSelected(true) -// // 买家信息 -// .setUserId(userId) -// // 商品信息 -// .setSpuId(sku.getSpuId()).setSkuId(sku.getId()).setQuantity(quantity); -// item.setCreateTime(new Date()); -// cartMapper.insert(item); -// // 返回成功 -// return true; -// } -// -// @Override -// @SuppressWarnings("Duplicates") -// public Boolean updateQuantity(Integer userId, Integer skuId, Integer quantity) { -// // 查询 SKU 是否合法 -// ProductSkuBO sku = productSpuService.getProductSku(skuId); -// if (sku == null -// || CommonStatusEnum.DISABLE.getValue().equals(sku.getStatus())) { // sku 被禁用 -// throw ServiceExceptionUtil.exception(OrderErrorCodeEnum.CARD_ITEM_SKU_NOT_FOUND.getCode()); -// } -// // 查询 CartItemDO -// CartItemDO item = cartMapper.selectByUserIdAndSkuIdAndStatus(userId, skuId, CartItemStatusEnum.ENABLE.getValue()); -// if (item == null) { -// throw ServiceExceptionUtil.exception(OrderErrorCodeEnum.CARD_ITEM_NOT_FOUND.getCode()); -// } -// // TODO 芋艿,后续基于商品是否上下架进一步完善。 -// return updateQuantity0(item, sku, quantity); -// } -// -// private Boolean updateQuantity0(CartItemDO item, ProductSkuBO sku, Integer quantity) { -// // 校验库存 -// if (item.getQuantity() + quantity > sku.getQuantity()) { -// throw ServiceExceptionUtil.exception(OrderErrorCodeEnum.CARD_ITEM_SKU_NOT_FOUND.getCode()); -// } -// // 更新 CartItemDO -// cartMapper.updateQuantity(item.getId(), quantity); -// // 返回成功 -// return true; -// } -// -// @Override -// public Boolean updateSelected(Integer userId, Collection skuIds, Boolean selected) { -// // 更新 CartItemDO 们 -// cartMapper.updateListByUserIdAndSkuId(userId, skuIds, selected, null); -// // 返回成功 -// return true; -// } -// -// @Override -// public Boolean deleteList(Integer userId, List skuIds) { -// // 更新 CartItemDO 们 -// cartMapper.updateListByUserIdAndSkuId(userId, skuIds, null, CartItemStatusEnum.DELETE_BY_MANUAL.getValue()); -// // 返回成功 -// return true; -// } -// -// @Override -// public Boolean deleteAll(Integer userId) { -// return null; -// } -// -// @Override -// public Integer count(Integer userId) { -// return cartMapper.selectQuantitySumByUserIdAndStatus(userId, CartItemStatusEnum.ENABLE.getValue()); -// } -// -// @Override -// public List list(Integer userId, Boolean selected) { -// List items = cartMapper.selectByUserIdAndStatusAndSelected(userId, CartItemStatusEnum.ENABLE.getValue(), selected); -// return CartConvert.INSTANCE.convert(items); -// } -// -// @Override -// public CalcOrderPriceBO calcOrderPrice(CalcOrderPriceDTO calcOrderPriceDTO) { -// // TODO 芋艿,补充一些表单校验。例如说,需要传入用户编号。 -// // 校验商品都存在 -// Map calcOrderItemMap = calcOrderPriceDTO.getItems().stream() -// .collect(Collectors.toMap(CalcOrderPriceDTO.Item::getSkuId, item -> item)); // KEY:skuId -// List skus = productSpuService.getProductSkuDetailList(calcOrderItemMap.keySet()); -// if (skus.size() != calcOrderPriceDTO.getItems().size()) { -// throw ServiceExceptionUtil.exception(OrderErrorCodeEnum.ORDER_ITEM_SOME_NOT_EXISTS.getCode()); -// } -// // TODO 库存相关 -// // 查询促销活动 -// List activityList = promotionActivityService.getPromotionActivityListBySpuIds( -// skus.stream().map(sku -> sku.getSpu().getId()).collect(Collectors.toSet()), -// Collections.singletonList(PromotionActivityStatusEnum.RUN.getValue())); -// // 拼装结果(主要是计算价格) -// CalcOrderPriceBO calcOrderPriceBO = new CalcOrderPriceBO(); -// // 1. 创建初始的每一项的数组 -// List items = initCalcOrderPriceItems(skus, calcOrderItemMap); -// // 2. 计算【限时折扣】促销 -// modifyPriceByTimeLimitDiscount(items, activityList); -// // 3. 计算【满减送】促销 -// List itemGroups = groupByFullPrivilege(items, activityList); -// calcOrderPriceBO.setItemGroups(itemGroups); -// // 4. 计算优惠劵 -// if (calcOrderPriceDTO.getCouponCardId() != null) { -// Integer result = modifyPriceByCouponCard(calcOrderPriceDTO.getUserId(), calcOrderPriceDTO.getCouponCardId(), itemGroups); -// calcOrderPriceBO.setCouponCardDiscountTotal(result); -// } -// // 5. 计算最终的价格 -// int buyTotal = 0; -// int discountTotal = 0; -// int presentTotal = 0; -// for (CalcOrderPriceBO.ItemGroup itemGroup : calcOrderPriceBO.getItemGroups()) { -// buyTotal += itemGroup.getItems().stream().mapToInt(item -> item.getSelected() ? item.getBuyTotal() : 0).sum(); -// discountTotal += itemGroup.getItems().stream().mapToInt(item -> item.getSelected() ? item.getDiscountTotal() : 0).sum(); -// presentTotal += itemGroup.getItems().stream().mapToInt(item -> item.getSelected() ? item.getPresentTotal() : 0).sum(); -// } -// Assert.isTrue(buyTotal - discountTotal == presentTotal, -// String.format("价格合计( %d - %d == %d )不正确", buyTotal, discountTotal, presentTotal)); -// calcOrderPriceBO.setFee(new CalcOrderPriceBO.Fee(buyTotal, discountTotal, 0, presentTotal)); -// // 返回 -// return calcOrderPriceBO; -// } -// -// @Override -// @SuppressWarnings("Duplicates") -// public CalcSkuPriceBO calcSkuPrice(Integer skuId) { -// // 查询 SKU 是否合法 -// ProductSkuBO sku = productSpuService.getProductSku(skuId); -// if (sku == null -// || CommonStatusEnum.DISABLE.getValue().equals(sku.getStatus())) { // sku 被禁用 -// throw ServiceExceptionUtil.exception(OrderErrorCodeEnum.CARD_ITEM_SKU_NOT_FOUND.getCode()); -// } -// // 查询促销活动 -// List activityList = promotionActivityService.getPromotionActivityListBySpuId(sku.getSpuId(), -// Arrays.asList(PromotionActivityStatusEnum.WAIT.getValue(), PromotionActivityStatusEnum.RUN.getValue())); -// if (activityList.isEmpty()) { // 如果无促销活动,则直接返回默认结果即可 -// return new CalcSkuPriceBO().setOriginalPrice(sku.getPrice()).setBuyPrice(sku.getPrice()); -// } -// // 如果有促销活动,则开始做计算 TODO 芋艿,因为现在暂时只有限时折扣 + 满减送。所以写的比较简单先 -// PromotionActivityBO fullPrivilege = findPromotionActivityByType(activityList, PromotionActivityTypeEnum.FULL_PRIVILEGE); -// PromotionActivityBO timeLimitedDiscount = findPromotionActivityByType(activityList, PromotionActivityTypeEnum.TIME_LIMITED_DISCOUNT); -// Integer presentPrice = calcSkuPriceByTimeLimitDiscount(sku, timeLimitedDiscount); -// // 返回结果 -// return new CalcSkuPriceBO().setFullPrivilege(fullPrivilege).setTimeLimitedDiscount(timeLimitedDiscount) -// .setOriginalPrice(sku.getPrice()).setBuyPrice(presentPrice); -// } -// -// private List initCalcOrderPriceItems(List skus, -// Map calcOrderItemMap) { -// List items = new ArrayList<>(); -// for (ProductSkuDetailBO sku : skus) { -// CalcOrderPriceBO.Item item = CartConvert.INSTANCE.convert(sku); -// items.add(item); -// // 将是否选中,购物数量,复制到 item 中 -// CalcOrderPriceDTO.Item calcOrderItem = calcOrderItemMap.get(sku.getId()); -// item.setSelected(calcOrderItem.getSelected()); -// item.setBuyQuantity(calcOrderItem.getQuantity()); -// // 计算初始价格 -// item.setOriginPrice(sku.getPrice()); -// item.setBuyPrice(sku.getPrice()); -// item.setPresentPrice(sku.getPrice()); -// item.setBuyTotal(sku.getPrice() * calcOrderItem.getQuantity()); -// item.setDiscountTotal(0); -// item.setPresentTotal(item.getBuyTotal()); -// } -// return items; -// } -// -// private void modifyPriceByTimeLimitDiscount(List items, List activityList) { -// for (CalcOrderPriceBO.Item item : items) { -// // 获得符合条件的限时折扣 -// PromotionActivityBO timeLimitedDiscount = activityList.stream() -// .filter(activity -> PromotionActivityTypeEnum.TIME_LIMITED_DISCOUNT.getValue().equals(activity.getActivityType()) -// && activity.getTimeLimitedDiscount().getItems().stream().anyMatch(item0 -> item0.getSpuId().equals(item.getSpu().getId()))) -// .findFirst().orElse(null); -// if (timeLimitedDiscount == null) { -// continue; -// } -// // 计算价格 -// ProductSkuBO sku = new ProductSkuBO().setId(item.getId()).setSpuId(item.getSpu().getId()).setPrice(item.getPrice()); -// Integer newPrice = calcSkuPriceByTimeLimitDiscount(sku, timeLimitedDiscount); -// if (newPrice.equals(item.getPrice())) { -// continue; -// } -// // 设置优惠 -// item.setActivity(timeLimitedDiscount); -// // 设置价格 -// item.setBuyPrice(newPrice); -// item.setBuyTotal(newPrice * item.getBuyQuantity()); -// item.setPresentTotal(item.getBuyTotal() - item.getDiscountTotal()); -// item.setPresentPrice(item.getPresentTotal() / item.getBuyQuantity()); -// } -// } -// -// private List groupByFullPrivilege(List items, List activityList) { -// List itemGroups = new ArrayList<>(); -// // 获得所有满减送促销 -// List fullPrivileges = activityList.stream() -// .filter(activity -> PromotionActivityTypeEnum.FULL_PRIVILEGE.getValue().equals(activity.getActivityType())) -// .collect(Collectors.toList()); -// // 基于满减送促销,进行分组 -// if (!fullPrivileges.isEmpty()) { -// items = new ArrayList<>(items); // 因为下面会修改数组,进行浅拷贝,避免影响传入的 items 。 -// for (PromotionActivityBO fullPrivilege : fullPrivileges) { -// // 创建 fullPrivilege 对应的分组 -// CalcOrderPriceBO.ItemGroup itemGroup = new CalcOrderPriceBO.ItemGroup() -// .setActivity(fullPrivilege) -// .setItems(new ArrayList<>()); -// // 筛选商品到分组中 -// for (Iterator iterator = items.iterator(); iterator.hasNext(); ) { -// CalcOrderPriceBO.Item item = iterator.next(); -// if (!isSpuMatchFullPrivilege(item.getSpu().getId(), fullPrivilege)) { -// continue; -// } -// itemGroup.getItems().add(item); -// iterator.remove(); -// } -// // 如果匹配到,则添加到 itemGroups 中 -// if (!itemGroup.getItems().isEmpty()) { -// itemGroups.add(itemGroup); -// } -// } -// } -// // 处理未参加活动的商品,形成一个分组 -// if (!items.isEmpty()) { -// itemGroups.add(new CalcOrderPriceBO.ItemGroup().setItems(items)); -// } -// // 计算每个分组的价格 -// for (CalcOrderPriceBO.ItemGroup itemGroup : itemGroups) { -// itemGroup.setActivityDiscountTotal(calcSkuPriceByFullPrivilege(itemGroup)); -// } -// // 返回结果 -// return itemGroups; -// } -// -// private Integer modifyPriceByCouponCard(Integer userId, Integer couponCardId, List itemGroups) { -// Assert.isTrue(couponCardId != null, "优惠劵编号不能为空"); -// // 查询优惠劵 -// CouponCardDetailBO couponCard = couponService.getCouponCardDetail(userId, couponCardId); -// // 获得匹配的商品 -// List items = new ArrayList<>(); -// if (RangeTypeEnum.ALL.getValue().equals(couponCard.getRangeType())) { -//// totalPrice = spus.stream().mapToInt(spu -> spu.getPrice() * spu.getQuantity()).sum(); -// itemGroups.forEach(itemGroup -> items.addAll(itemGroup.getItems())); -// } else if (RangeTypeEnum.PRODUCT_INCLUDE_PART.getValue().equals(couponCard.getRangeType())) { -// itemGroups.forEach(itemGroup -> items.forEach(item -> { -// if (couponCard.getRangeValues().contains(item.getSpu().getId())) { -// items.add(item); -// } -// })); -// } else if (RangeTypeEnum.PRODUCT_EXCLUDE_PART.getValue().equals(couponCard.getRangeType())) { -// itemGroups.forEach(itemGroup -> items.forEach(item -> { -// if (!couponCard.getRangeValues().contains(item.getSpu().getId())) { -// items.add(item); -// } -// })); -// } else if (RangeTypeEnum.CATEGORY_INCLUDE_PART.getValue().equals(couponCard.getRangeType())) { -// itemGroups.forEach(itemGroup -> items.forEach(item -> { -// if (couponCard.getRangeValues().contains(item.getSpu().getCid())) { -// items.add(item); -// } -// })); -// } else if (RangeTypeEnum.CATEGORY_EXCLUDE_PART.getValue().equals(couponCard.getRangeType())) { -// itemGroups.forEach(itemGroup -> items.forEach(item -> { -// if (!couponCard.getRangeValues().contains(item.getSpu().getCid())) { -// items.add(item); -// } -// })); -// } -// // 判断是否符合条件 -// int originalTotal = items.stream().mapToInt(CalcOrderPriceBO.Item::getPresentTotal).sum(); // 此处,指的是以优惠劵视角的原价 -// if (originalTotal == 0 || originalTotal < couponCard.getPriceAvailable()) { -// throw ServiceExceptionUtil.exception(PromotionErrorCodeEnum.COUPON_CARD_NOT_MATCH.getCode()); // TODO 芋艿,这种情况,会出现错误码的提示,无法格式化出来。另外,这块的最佳实践,找人讨论下。 -// } -// // 计算价格 -// // 获得到优惠信息,进行价格计算 -// int presentTotal; -// if (PreferentialTypeEnum.PRICE.getValue().equals(couponCard.getPreferentialType())) { // 减价 -// // 计算循环次数。这样,后续优惠的金额就是相乘了 -// presentTotal = originalTotal - couponCard.getPriceOff(); -// Assert.isTrue(presentTotal > 0, "计算后,价格为负数:" + presentTotal); -// } else if (PreferentialTypeEnum.DISCOUNT.getValue().equals(couponCard.getPreferentialType())) { // 打折 -// presentTotal = originalTotal * couponCard.getPercentOff() / 100; -// if (couponCard.getDiscountPriceLimit() != null // 空,代表不限制优惠上限 -// && originalTotal - presentTotal > couponCard.getDiscountPriceLimit()) { -// presentTotal = originalTotal - couponCard.getDiscountPriceLimit(); -// } -// } else { -// throw new IllegalArgumentException(String.format("优惠劵(%s) 的优惠类型不正确", couponCard.toString())); -// } -// int discountTotal = originalTotal - presentTotal; -// Assert.isTrue(discountTotal > 0, "计算后,不产生优惠:" + discountTotal); -// // 按比例,拆分 presentTotal -// splitDiscountPriceToItems(items, discountTotal, presentTotal); -// // 返回优惠金额 -// return originalTotal - presentTotal; -// } -// -// /** -// * 计算指定 SKU 在限时折扣下的价格 -// * -// * @param sku SKU -// * @param timeLimitedDiscount 限时折扣促销。 -// * 传入的该活动,要保证该 SKU 在该促销下一定有优惠。 -// * @return 计算后的价格 -// */ -// private Integer calcSkuPriceByTimeLimitDiscount(ProductSkuBO sku, PromotionActivityBO timeLimitedDiscount) { -// if (timeLimitedDiscount == null) { -// return sku.getPrice(); -// } -// // 获得对应的优惠项 -// PromotionActivityBO.TimeLimitedDiscount.Item item = timeLimitedDiscount.getTimeLimitedDiscount().getItems().stream() -// .filter(item0 -> item0.getSpuId().equals(sku.getSpuId())) -// .findFirst().orElse(null); -// if (item == null) { -// throw new IllegalArgumentException(String.format("折扣活动(%s) 不存在商品(%s) 的优惠配置", -// timeLimitedDiscount.toString(), sku.toString())); -// } -// // 计算价格 -// if (PreferentialTypeEnum.PRICE.getValue().equals(item.getPreferentialType())) { // 减价 -// int presentPrice = sku.getPrice() - item.getPreferentialValue(); -// return presentPrice >= 0 ? presentPrice : sku.getPrice(); // 如果计算优惠价格小于 0 ,则说明无法使用优惠。 -// } -// if (PreferentialTypeEnum.DISCOUNT.getValue().equals(item.getPreferentialType())) { // 打折 -// return sku.getPrice() * item.getPreferentialValue() / 100; -// } -// throw new IllegalArgumentException(String.format("折扣活动(%s) 的优惠类型不正确", timeLimitedDiscount.toString())); -// } -// -// private Integer calcSkuPriceByFullPrivilege(CalcOrderPriceBO.ItemGroup itemGroup) { -// if (itemGroup.getActivity() == null) { -// return null; -// } -// PromotionActivityBO activity = itemGroup.getActivity(); -// Assert.isTrue(PromotionActivityTypeEnum.FULL_PRIVILEGE.getValue().equals(activity.getActivityType()), -// "传入的必须的满减送活动必须是满减送"); -// // 获得优惠信息 -// List items = itemGroup.getItems().stream().filter(CalcOrderPriceBO.Item::getSelected) -// .collect(Collectors.toList()); -// Integer itemCnt = items.stream().mapToInt(CalcOrderPriceBO.Item::getBuyQuantity).sum(); -// Integer originalTotal = items.stream().mapToInt(CalcOrderPriceBO.Item::getPresentTotal).sum(); -// List privileges = activity.getFullPrivilege().getPrivileges().stream() -// .filter(privilege -> { -// if (MeetTypeEnum.PRICE.getValue().equals(privilege.getMeetType())) { -// return originalTotal >= privilege.getMeetValue(); -// } -// if (MeetTypeEnum.QUANTITY.getValue().equals(privilege.getMeetType())) { -// return itemCnt >= privilege.getMeetValue(); -// } -// throw new IllegalArgumentException(String.format("满减送活动(%s) 的匹配(%s)不正确", itemGroup.getActivity().toString(), privilege.toString())); -// }).collect(Collectors.toList()); -// // 获得不到优惠信息,返回原始价格 -// if (privileges.isEmpty()) { -// return null; -// } -// // 获得到优惠信息,进行价格计算 -// PromotionActivityBO.FullPrivilege.Privilege privilege = privileges.get(privileges.size() - 1); -// Integer presentTotal; -// if (PreferentialTypeEnum.PRICE.getValue().equals(privilege.getPreferentialType())) { // 减价 -// // 计算循环次数。这样,后续优惠的金额就是相乘了 -// Integer cycleCount = 1; -// if (activity.getFullPrivilege().getCycled()) { -// if (MeetTypeEnum.PRICE.getValue().equals(privilege.getMeetType())) { -// cycleCount = originalTotal / privilege.getMeetValue(); -// } else if (MeetTypeEnum.QUANTITY.getValue().equals(privilege.getMeetType())) { -// cycleCount = itemCnt / privilege.getMeetValue(); -// } -// } -// presentTotal = originalTotal - cycleCount * privilege.getMeetValue(); -// if (presentTotal < 0) { // 如果计算优惠价格小于 0 ,则说明无法使用优惠。 -// presentTotal = originalTotal; -// } -// } else if (PreferentialTypeEnum.DISCOUNT.getValue().equals(privilege.getPreferentialType())) { // 打折 -// presentTotal = originalTotal * privilege.getPreferentialValue() / 100; -// } else { -// throw new IllegalArgumentException(String.format("满减送促销(%s) 的优惠类型不正确", activity.toString())); -// } -// int discountTotal = originalTotal - presentTotal; -// if (discountTotal == 0) { -// return null; -// } -// // 按比例,拆分 presentTotal -//// for (int i = 0; i < items.size(); i++) { -//// CalcOrderPriceBO.Item item = items.get(i); -//// Integer discountPart; -//// if (i < items.size() - 1) { // 减一的原因,是因为拆分时,如果按照比例,可能会出现.所以最后一个,使用反减 -//// discountPart = (int) (discountTotal * (1.0D * item.getPresentTotal() / presentTotal)); -//// discountTotal -= discountPart; -//// } else { -//// discountPart = discountTotal; -//// } -//// Assert.isTrue(discountPart > 0, "优惠金额必须大于 0"); -//// item.setDiscountTotal(item.getDiscountTotal() + discountPart); -//// item.setPresentTotal(item.getBuyTotal() - item.getDiscountTotal()); -//// item.setPresentPrice(item.getPresentTotal() / item.getBuyQuantity()); -//// } -// splitDiscountPriceToItems(items, discountTotal, presentTotal); -// // 返回优惠金额 -// return originalTotal - presentTotal; -// } -// -// private void splitDiscountPriceToItems(List items, Integer discountTotal, Integer presentTotal) { -// for (int i = 0; i < items.size(); i++) { -// CalcOrderPriceBO.Item item = items.get(i); -// Integer discountPart; -// if (i < items.size() - 1) { // 减一的原因,是因为拆分时,如果按照比例,可能会出现.所以最后一个,使用反减 -// discountPart = (int) (discountTotal * (1.0D * item.getPresentTotal() / presentTotal)); -// discountTotal -= discountPart; -// } else { -// discountPart = discountTotal; -// } -// Assert.isTrue(discountPart > 0, "优惠金额必须大于 0"); -// item.setDiscountTotal(item.getDiscountTotal() + discountPart); -// item.setPresentTotal(item.getBuyTotal() - item.getDiscountTotal()); -// item.setPresentPrice(item.getPresentTotal() / item.getBuyQuantity()); -// } -// } -// -// private PromotionActivityBO findPromotionActivityByType(List activityList, PromotionActivityTypeEnum type) { -// return activityList.stream() -// .filter(activity -> type.getValue().equals(activity.getActivityType())) -// .findFirst().orElse(null); -// } -// -// private List findPromotionActivityListByType(List activityList, PromotionActivityTypeEnum type) { -// return activityList.stream() -// .filter(activity -> type.getValue().equals(activity.getActivityType())) -// .collect(Collectors.toList()); -// } -// -// private boolean isSpuMatchFullPrivilege(Integer spuId, PromotionActivityBO activity) { -// Assert.isTrue(PromotionActivityTypeEnum.FULL_PRIVILEGE.getValue().equals(activity.getActivityType()), -// "传入的必须的促销活动必须是满减送"); -// PromotionActivityBO.FullPrivilege fullPrivilege = activity.getFullPrivilege(); -// if (RangeTypeEnum.ALL.getValue().equals(fullPrivilege.getRangeType())) { -// return true; -// } else if (RangeTypeEnum.PRODUCT_INCLUDE_PART.getValue().equals(fullPrivilege.getRangeType())) { -// return fullPrivilege.getRangeValues().contains(spuId); -// } else { -// throw new IllegalArgumentException(String.format("促销活动(%s) 可用范围的类型是不正确", activity.toString())); -// } -// } - -} diff --git a/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/impl/OrderServiceImpl.java b/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/impl/OrderServiceImpl.java deleted file mode 100644 index ecbfe290d..000000000 --- a/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/service/impl/OrderServiceImpl.java +++ /dev/null @@ -1,604 +0,0 @@ -package cn.iocoder.mall.order.biz.service.impl; - -import cn.iocoder.mall.order.biz.service.OrderService; -import org.springframework.stereotype.Service; - -/** - * 订单 service impl - * - * @author Sin - * @time 2019-03-16 15:08 - */ -@Service -@org.apache.dubbo.config.annotation.Service(validation = "true", version = "${dubbo.provider.OrderService.version}") -public class OrderServiceImpl implements OrderService { - -// /** -// * 支付过期时间 120 分钟 -// */ -// public static final int PAY_EXPIRE_TIME = 120; -// -// @Autowired -// private OrderMapper orderMapper; -// @Autowired -// private OrderItemMapper orderItemMapper; -// @Autowired -// private OrderLogisticsMapper orderLogisticsMapper; -// @Autowired -// private OrderLogisticsDetailMapper orderLogisticsDetailMapper; -// @Autowired -// private OrderRecipientMapper orderRecipientMapper; -// @Autowired -// private OrderCancelMapper orderCancelMapper; -// @Autowired -// private OrderReturnMapper orderReturnMapper; -// -// @Autowired -// private CartServiceImpl cartService; -// -// @Reference(validation = "true", version = "${dubbo.consumer.PromotionActivityService.version}") -// private ProductSpuService productSpuService; -// @Reference(validation = "true", version = "${dubbo.consumer.UserAddressService.version}") -// private UserAddressService userAddressService; -// @Reference(validation = "true", version = "${dubbo.consumer.PayTransactionService.version}") -// private PayTransactionService payTransactionService; -// @Reference(validation = "true", version = "${dubbo.consumer.CouponService.version}") -// private CouponService couponService; -// -// @Override -// public CommonResult getOrderPage(OrderQueryDTO orderQueryDTO) { -// -// int totalCount = orderMapper.selectPageCount(orderQueryDTO); -// if (totalCount == 0) { // TODO FROM 芋艿 TO 小范 Collections.EMPTY_LIST 改成 Collections.emptyList() -// return CommonResult.success(new OrderPageBO().setOrders(Collections.EMPTY_LIST).setTotal(0)); -// } -// -// // 获取订单数据 -// List orderDOList = orderMapper.selectPage(orderQueryDTO); -// -// if (CollectionUtils.isEmpty(orderDOList)) { -// return CommonResult.success(new OrderPageBO().setOrders(Collections.EMPTY_LIST).setTotal(totalCount)); -// } -// -// // 获取订单 id -// Set orderIds = orderDOList.stream() -// .map(orderDO -> orderDO.getId()) // TODO FROM 芋艿 to 小范,记得用 Lambda -// .collect(Collectors.toSet()); -// -// // 获取配送信息 -// List orderRecipientDOList = orderRecipientMapper.selectByOrderIds(orderIds); -// List orderRecipientBOList = OrderRecipientConvert.INSTANCE.convert(orderRecipientDOList); -// Map orderRecipientBOMap -// = orderRecipientBOList.stream().collect(Collectors.toMap(OrderRecipientBO::getOrderId, obj -> obj)); -// -// // 获取 订单的 items -// List orderItemDOList = orderItemMapper -// .selectByDeletedAndOrderIds(orderIds, DeletedStatusEnum.DELETED_NO.getValue()); -// -// List orderItemBOList = OrderItemConvert.INSTANCE.convertOrderItemDO(orderItemDOList); -// Map> orderItemBOMultimap = orderItemBOList.stream().collect( -// Collectors.toMap( -// OrderItemBO::getOrderId, -// item -> Lists.newArrayList(item), -// (oldVal, newVal) -> { -// oldVal.addAll(newVal); -// return oldVal; -// } -// ) -// ); -// -// // 转换 orderDO 为 OrderBO,并设置 item -// List orderPageBOList = OrderConvert.INSTANCE.convertPageBO(orderDOList); -// List result = orderPageBOList.stream().map(orderBO -> { -// if (orderItemBOMultimap.containsKey(orderBO.getId())) { -// orderBO.setOrderItems(orderItemBOMultimap.get(orderBO.getId())); -// } -// if (orderRecipientBOMap.containsKey(orderBO.getId())) { -// orderBO.setOrderRecipient(orderRecipientBOMap.get(orderBO.getId())); -// } -// return orderBO; -// }).collect(Collectors.toList()); -// return CommonResult.success( -// new OrderPageBO() -// .setTotal(totalCount) -// .setOrders(result) -// ); -// } -// -// @Override -// public CommonResult> getOrderItems(Integer orderId) { -// if (orderMapper.selectById(orderId) == null) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode()); -// } -// -// List orderItemDOList = orderItemMapper -// .selectByDeletedAndOrderId(DeletedStatusEnum.DELETED_NO.getValue(), orderId); -// -// List orderItemBOList = OrderItemConvert.INSTANCE.convertOrderItemBO(orderItemDOList); -// return CommonResult.success(orderItemBOList); -// } -// -// @Override -// public CommonResult getOrderRecipientBO(Integer orderId) { -// if (orderMapper.selectById(orderId) == null) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode()); -// } -// -// OrderRecipientDO orderRecipientDO = orderRecipientMapper.selectByOrderId(orderId); -// OrderRecipientBO orderRecipientBO = OrderRecipientConvert.INSTANCE.convert(orderRecipientDO); -// return CommonResult.success(orderRecipientBO); -// } -// -// @Override -// public CommonResult info(Integer userId, Integer orderId) { -// OrderDO orderDO = orderMapper.selectById(orderId); -// if (orderDO == null) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode()); -// } -// -// List itemDOList = orderItemMapper -// .selectByDeletedAndOrderId(DeletedStatusEnum.DELETED_NO.getValue(), orderId); -// -// List orderItems -// = OrderItemConvert.INSTANCE.convertOrderInfoWithOrderItem(itemDOList); -// -// Set orderLogisticsIds = itemDOList.stream() -// .filter(o -> o.getOrderLogisticsId() != null) -// .map(o -> o.getOrderLogisticsId()) -// .collect(Collectors.toSet()); -// -// -// -// // 收件人信息 -// OrderRecipientDO orderRecipientDO = orderRecipientMapper.selectByOrderId(orderId); -// -// // 订单物流信息 -// OrderLogisticsDetailDO orderLogisticsDetailDO = null; -// if (!CollectionUtils.isEmpty(orderLogisticsIds)) { -// orderLogisticsDetailDO = orderLogisticsDetailMapper.selectLast(orderLogisticsIds); -// } -// -// // 检查是否申请退货 -// OrderReturnDO orderReturnDO = orderReturnMapper.selectByOrderId(orderId); -// -// // convert 信息 -// OrderInfoBO.LogisticsDetail logisticsDetail -// = OrderLogisticsDetailConvert.INSTANCE.convertLogisticsDetail(orderLogisticsDetailDO); -// -// OrderInfoBO.Recipient recipient = OrderRecipientConvert.INSTANCE.convertOrderInfoRecipient(orderRecipientDO); -// OrderInfoBO orderInfoBO = OrderConvert.INSTANCE.convert(orderDO); -// orderInfoBO.setRecipient(recipient); -// orderInfoBO.setOrderItems(orderItems); -// orderInfoBO.setLatestLogisticsDetail(logisticsDetail); -// -// // 是否退货 -// if (orderReturnDO != null) { -// orderInfoBO.setHasOrderReturn(orderReturnDO.getStatus()); -// } else { -// orderInfoBO.setHasOrderReturn(-1); -// } -// return CommonResult.success(orderInfoBO); -// } -// -// @Override -// @GlobalTransactional -//// @Transactional // 使用 Seata 分布事务后,无需在使用 @Transactional 注解。 -// public CommonResult createOrder(OrderCreateDTO orderCreateDTO) { -// Integer userId = orderCreateDTO.getUserId(); -// List orderItemDTOList = orderCreateDTO.getOrderItems(); -// List orderItemDOList = OrderItemConvert.INSTANCE.convert(orderItemDTOList); -// -// // 获取商品信息 -// Set skuIds = orderItemDOList.stream().map(OrderItemDO::getSkuId).collect(Collectors.toSet()); -// List productList = productSpuService.getProductSkuDetailList(skuIds); -// if (orderItemDTOList.size() != productList.size()) { // 校验获得的数量,是否匹配 -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_GET_GOODS_INFO_INCORRECT.getCode()); -// } -// -// // 价格计算 -// CalcOrderPriceBO calcOrderPrice = calcOrderPrice(productList, orderCreateDTO); -// -// // 设置 orderItem -// Map productSpuBOMap = productList -// .stream().collect(Collectors.toMap(ProductSkuDetailBO::getId, o -> o)); // 商品 SKU 信息的集合 -// Map priceItemMap = new HashMap<>(); // 商品 SKU 价格的映射 -// calcOrderPrice.getItemGroups().forEach(itemGroup -> -// itemGroup.getItems().forEach(item -> priceItemMap.put(item.getId(), item))); -// // 遍历 orderItemDOList 数组,将商品信息、商品价格,设置到其中 -// for (OrderItemDO orderItemDO : orderItemDOList) { -// ProductSkuDetailBO productSkuDetailBO = productSpuBOMap.get(orderItemDO.getSkuId()); -// if (productSkuDetailBO.getQuantity() <= 0) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_INSUFFICIENT_INVENTORY.getCode()); -// } -// if (productSkuDetailBO.getPrice() <= 0) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_GOODS_AMOUNT_INCORRECT.getCode()); -// } -// // 设置 SKU 信息 -// orderItemDO.setSkuImage(Optional.ofNullable(productSkuDetailBO.getSpu().getPicUrls().get(0)).get()); -// orderItemDO.setSkuName(productSkuDetailBO.getSpu().getName()); -// // 设置价格信息 -// CalcOrderPriceBO.Item priceItem = priceItemMap.get(orderItemDO.getSkuId()); -// Assert.notNull(priceItem, "商品计算价格为空"); -// orderItemDO.setOriginPrice(priceItem.getOriginPrice()) -// .setBuyPrice(priceItem.getBuyPrice()) -// .setPresentPrice(priceItem.getPresentPrice()) -// .setBuyTotal(priceItem.getBuyTotal()) -// .setDiscountTotal(priceItem.getDiscountTotal()) -// .setPresentTotal(priceItem.getPresentTotal()); -// } -// -// // 标记优惠劵已使用 -// if (orderCreateDTO.getCouponCardId() != null) { -// couponService.useCouponCard(userId, orderCreateDTO.getCouponCardId()); -// } -// -// // TODO 芋艿,扣除库存 -// -// // order -// -// // TODO: 2019-04-11 Sin 订单号需要生成规则 -// // TODO FROM 芋艿 to 小范:可以考虑抽象成一个方法,下面几个也是。 -// String orderNo = UUID.randomUUID().toString().replace("-", "").substring(0, 16); -//// Integer totalAmount = orderCommon.calculatedAmount(orderItemDOList); -//// Integer totalPrice = orderCommon.calculatedPrice(orderItemDOList); -//// Integer totalLogisticsPrice = orderCommon.calculatedLogisticsPrice(orderItemDOList); -// OrderDO orderDO = new OrderDO() -// .setUserId(userId) -// .setOrderNo(orderNo) -// .setBuyPrice(calcOrderPrice.getFee().getBuyTotal()) -// .setDiscountPrice(calcOrderPrice.getFee().getDiscountTotal()) -// .setLogisticsPrice(calcOrderPrice.getFee().getPostageTotal()) -// .setPresentPrice(calcOrderPrice.getFee().getPresentTotal()) -// .setPayAmount(0) -// .setClosingTime(null) -// .setDeliveryTime(null) -// .setPaymentTime(null) -// .setStatus(OrderStatusEnum.WAITING_PAYMENT.getValue()) -// .setHasReturnExchange(OrderHasReturnExchangeEnum.NO.getValue()) -// .setRemark(Optional.ofNullable(orderCreateDTO.getRemark()).orElse("")); -// orderDO.setDeleted(DeletedStatusEnum.DELETED_NO.getValue()); -//// orderDO.setCreateTime(new Date()); -//// orderDO.setUpdateTime(null); -// orderMapper.insert(orderDO); -// -// // 收件人信息 -// CommonResult userAddressResult = userAddressService.getAddress(userId, orderCreateDTO.getUserAddressId()); -// if (userAddressResult.isError()) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_GET_USER_ADDRESS_FAIL.getCode()); -// } -// UserAddressBO userAddressBO = userAddressResult.getData(); -// OrderRecipientDO orderRecipientDO = OrderRecipientConvert.INSTANCE.convert(userAddressBO); -// orderRecipientDO -// .setOrderId(orderDO.getId()) -// .setType(OrderRecipientTypeEnum.EXPRESS.getValue()) -// .setCreateTime(new Date()) -// .setUpdateTime(null); -// orderRecipientMapper.insert(orderRecipientDO); -// -// // order item -// orderItemDOList.forEach(orderItemDO -> { -// orderItemDO -// .setOrderId(orderDO.getId()) -// .setOrderNo(orderDO.getOrderNo()) -// .setPaymentTime(null) -// .setDeliveryTime(null) -// .setReceiverTime(null) -// .setClosingTime(null) -// .setHasReturnExchange(OrderStatusEnum.WAITING_PAYMENT.getValue()) -// .setDeliveryType(OrderDeliveryTypeEnum.NONE.getValue()) -// .setStatus(OrderStatusEnum.WAITING_PAYMENT.getValue()) -// .setDeleted(DeletedStatusEnum.DELETED_NO.getValue()) -// .setCreateTime(new Date()) -// .setUpdateTime(null); -// }); -// // 一次性插入 -// orderItemMapper.insert(orderItemDOList); -// -// // 创建预订单 -// createPayTransaction(orderDO, orderItemDOList, orderCreateDTO.getIp()); -// -//// if (commonResult.isError()) { -//// //手动开启事务回滚 -//// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); -//// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_GET_PAY_FAIL.getValue()); -//// } -// -// // TODO: 2019-03-17 Sin 需要发送 创建成果 MQ 消息,业务扩展和统计 -// return CommonResult.success( -// new OrderCreateBO() -// .setId(orderDO.getId()) -// .setOrderNo(orderDO.getOrderNo()) -// .setPayAmount(orderDO.getPayAmount()) -// ); -// } -// -// private CalcOrderPriceBO calcOrderPrice(List skus, OrderCreateDTO orderCreateDTO) { -// // 创建计算的 DTO -// CalcOrderPriceDTO calcOrderPriceDTO = new CalcOrderPriceDTO() -// .setUserId(orderCreateDTO.getUserId()) -// .setItems(new ArrayList<>(skus.size())) -// .setCouponCardId(orderCreateDTO.getCouponCardId()); -// for (OrderCreateDTO.OrderItem item : orderCreateDTO.getOrderItems()) { -// calcOrderPriceDTO.getItems().add(new CalcOrderPriceDTO.Item(item.getSkuId(), item.getQuantity(), true)); -// } -// // 执行计算 -// return cartService.calcOrderPrice(calcOrderPriceDTO); -// } -// -// private PayTransactionBO createPayTransaction(OrderDO order, List orderItems, String ip) { -// // TODO sin 支付订单 orderSubject 暂时取第一个子订单商品信息 -// String orderSubject = orderItems.get(0).getSkuName(); -// Date expireTime = DateUtil.addDate(Calendar.MINUTE, PAY_EXPIRE_TIME); -// return payTransactionService.createTransaction( -// new PayTransactionCreateDTO() -// .setCreateIp(ip) -// .setAppId(PayAppId.APP_ID_SHOP_ORDER) -// .setOrderId(order.getId().toString()) -// .setExpireTime(expireTime) -// .setPrice(order.getPresentPrice()) -// .setOrderSubject(orderSubject) -// .setOrderMemo("测试备注") // TODO 芋艿,后面补充 -// .setOrderDescription("测试描述") // TODO 芋艿,后面补充 -// ); -// } -// -// @Override // TODO 芋艿,需要确认下这个方法的用途。因为涉及修改价格和数量。 -// public CommonResult updateOrderItem(OrderItemUpdateDTO orderUpdateDTO) { -// OrderItemDO orderItemDO = OrderItemConvert.INSTANCE.convert(orderUpdateDTO); -// orderItemMapper.updateById(orderItemDO); -// -// // TODO: 2019-03-24 sin 需要重新计算金额 -// // TODO: 2019-03-24 sin 需要记录日志 -// return CommonResult.success(null); -// } -// -// @Override -// @Transactional -// public CommonResult updateOrderItemPayAmount(Integer orderId, Integer orderItemId, Integer payAmount) { -// OrderDO orderDO = orderMapper.selectById(orderId); -// if (orderDO == null) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode()); -// } -// if (payAmount < 0) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_PAY_AMOUNT_NOT_NEGATIVE.getCode()); -// } -// -// // 先更新金额 -// orderItemMapper.updateById(new OrderItemDO().setId(orderItemId) -//// .setPayAmount(payAmount) TODO 芋艿,这里要修改 -// ); -// -// // 再重新计算订单金额 -// List orderItemDOList = orderItemMapper -// .selectByDeletedAndOrderId(DeletedStatusEnum.DELETED_NO.getValue(), orderId); -//// Integer price = orderCommon.calculatedPrice(orderItemDOList); -//// Integer amount = orderCommon.calculatedAmount(orderItemDOList); -// Integer price = -1; // TODO 芋艿,这里要修改,价格 -// Integer amount = -1; -// orderMapper.updateById( -// new OrderDO() -// .setId(orderId) -//// .setPrice(price) TODO 芋艿,这里要修改 -// .setPayAmount(amount) -// ); -// return CommonResult.success(null); -// } -// -// @Override -// @Transactional // TODO 芋艿,要校验下 userId 。不然可以取消任何用户的订单列。 -// public CommonResult cancelOrder(Integer orderId, Integer reason, String otherReason) { -// // 关闭订单,在用户还未付款的时候可操作 -// OrderDO orderDO = orderMapper.selectById(orderId); -// if (orderDO == null) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode()); -// } -// -// // 检查专题,只有待付款状态才能操作 -// if (!orderDO.getStatus().equals(OrderStatusEnum.WAITING_PAYMENT.getValue())) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_STATUS_NOT_CANCEL.getCode()); -// } -// -// OrderCancelDO orderCancelDO -// = (OrderCancelDO) new OrderCancelDO() -// .setOrderId(orderDO.getId()) -// .setOrderNo(orderDO.getOrderNo()) -// .setReason(reason) -// .setOtherReason(otherReason) -// .setCreateTime(new Date()) -// .setUpdateTime(null); -// -// // 关闭订单,修改状态 item -// // TODO FROM 芋艿 TO 小范,更新的时候,where 里面带下 status 避免并发的问题 -// orderItemMapper.updateByOrderId( -// orderId, -// new OrderItemDO().setStatus(OrderStatusEnum.CLOSED.getValue()) -// ); -// -// // 关闭订单,修改状态 order -// orderMapper.updateById(new OrderDO().setId(orderId).setStatus(OrderStatusEnum.CLOSED.getValue())); -// // 保存取消订单原因 -// orderCancelMapper.insert(orderCancelDO); -// return CommonResult.success(null); -// } -// -// @Override -// @Transactional // TODO FROM 芋艿 TO 小范:泛型,一定要明确哈。 -// public CommonResult orderDelivery(OrderDeliveryDTO orderDelivery) { -// List orderItemIds = orderDelivery.getOrderItemIds(); -// -// // 获取所有订单 items // TODO FROM 芋艿 TO 小范,deleted 是默认条件,所以 by 里面可以不带哈 -// List allOrderItems = orderItemMapper.selectByDeletedAndOrderId(orderDelivery.getOrderId(), DeletedStatusEnum.DELETED_NO.getValue()); -// -// // 当前需要发货订单,检查 id 和 status -// List needDeliveryOrderItems = allOrderItems.stream() -// .filter(orderItemDO -> orderItemIds.contains(orderItemDO.getId()) -// && OrderStatusEnum.WAIT_SHIPMENT.getValue() == orderItemDO.getStatus()) -// .collect(Collectors.toList()); // TODO 芋艿,如果这里只是比对数字,可以用 Lambda 求和,不需要弄成一个集合的 -// // 发货订单,检查 -// if (needDeliveryOrderItems.size() != orderItemIds.size()) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_DELIVERY_INCORRECT_DATA.getCode()); -// } -// -// OrderRecipientDO orderRecipientDO = orderRecipientMapper.selectByOrderId(orderDelivery.getOrderId()); -// OrderLogisticsDO orderLogisticsDO = OrderLogisticsConvert.INSTANCE.convert(orderRecipientDO); -// // 保存物流信息 -// orderLogisticsDO -// .setLogisticsNo(orderDelivery.getLogisticsNo()) -// .setLogistics(orderDelivery.getLogistics()) -// .setCreateTime(new Date()) -// .setUpdateTime(null); -// orderLogisticsMapper.insert(orderLogisticsDO); -// -// // 关联订单item 和 物流信息 -// // TODO FROM 芋艿 TO 小范,更新的时候,where 里面带下 status 避免并发的问题,然后判断下更新数量,不对,就抛出异常。 -// orderItemMapper.updateByIds( -// orderItemIds, -// new OrderItemDO() -// .setOrderLogisticsId(orderLogisticsDO.getId()) -// .setStatus(OrderStatusEnum.ALREADY_SHIPMENT.getValue()) -// ); -// -// // 子订单是否全部发货,如果发完,就更新 order -// List unShippedOrderItems = allOrderItems.stream() -// .filter(orderItemDO -> OrderStatusEnum.WAIT_SHIPMENT.getValue() == orderItemDO.getStatus() -// && !orderItemIds.contains(orderItemDO.getId())) -// .collect(Collectors.toList()); -// if (unShippedOrderItems.size() <= 0) { -// // TODO FROM 芋艿 TO 小范,更新的时候,where 里面带下 status 避免并发的问题 -// orderMapper.updateById( -// new OrderDO() -// .setId(orderDelivery.getOrderId()) -// .setStatus(OrderStatusEnum.ALREADY_SHIPMENT.getValue()) -// ); -// } -// // 返回成功 -// return CommonResult.success(null); -// } -// -// @Override -// public CommonResult updateOrderRemake(Integer orderId, String remake) { -// // 此处不做订单校验,直接设置备注即可 -// orderMapper.updateById(new OrderDO().setId(orderId).setRemark(remake)); -// return CommonResult.success(null); -// } -// -// @Override -// @Transactional // TODO FROM 芋艿 to 小范,先不做这个功能,电商一班不存在这个功能哈。 -// public CommonResult deleteOrderItem(OrderItemDeletedDTO orderItemDeletedDTO) { -// Integer orderId = orderItemDeletedDTO.getOrderId(); -// List orderItemIds = orderItemDeletedDTO.getOrderItemIds(); -// -// // 获取当前有效的订单 item -// List orderItemDOList = orderItemMapper -// .selectByDeletedAndOrderId(DeletedStatusEnum.DELETED_NO.getValue(), orderId); -// -// List effectiveOrderItems = orderItemDOList.stream() -// .filter(orderItemDO -> !orderItemIds.contains(orderItemDO.getId())) -// .collect(Collectors.toList()); -// -// // 检查订单 item,必须要有一个 item -// if (CollectionUtils.isEmpty(effectiveOrderItems)) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_ITEM_ONLY_ONE.getCode()); -// } -// -// // 更新订单 item -// orderItemMapper.updateByIds( -// orderItemIds, -// (OrderItemDO) new OrderItemDO() -// .setDeleted(DeletedStatusEnum.DELETED_YES.getValue()) -// ); -// -// // 更新订单 amount -//// Integer totalAmount = orderCommon.calculatedAmount(effectiveOrderItems); -// Integer totalAmount = -1; // TODO 芋艿,需要修改下,价格相关 -// orderMapper.updateById( -// new OrderDO() -// .setId(orderId) -// .setPayAmount(totalAmount) -// ); -// return CommonResult.success(null); -// } -// -// @Override -// public CommonResult confirmReceiving(Integer userId, Integer orderId) { -// OrderDO orderDO = orderMapper.selectById(orderId); -// -// // 是否该用户的订单 -// if (!userId.equals(orderDO.getUserId())) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_USER_ORDER.getCode()); -// } -// -// if (OrderStatusEnum.ALREADY_SHIPMENT.getValue() != orderDO.getStatus()) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_UNABLE_CONFIRM_ORDER.getCode()); -// } -// -// // TODO FROM 芋艿 TO 小范,更新的时候,where 里面带下 status 避免并发的问题 -// orderMapper.updateById( -// new OrderDO() -// .setId(orderId) -// .setReceiverTime(new Date()) -// .setStatus(OrderStatusEnum.COMPLETED.getValue()) -// -// ); -// -// orderItemMapper.updateByOrderId( -// orderId, -// new OrderItemDO() -// .setStatus(OrderStatusEnum.COMPLETED.getValue()) -// .setReceiverTime(new Date()) -// ); -// return CommonResult.success(null); -// } -// -// @Override -// public CommonResult updateLogistics(OrderLogisticsUpdateDTO orderLogisticsDTO) { -// OrderLogisticsDO orderLogisticsDO = OrderLogisticsConvert.INSTANCE.convert(orderLogisticsDTO); -// orderLogisticsMapper.updateById(orderLogisticsDO); -// return CommonResult.success(null); -// } -// -// @Override -// public CommonResult deleteOrder(Integer id) { -// // 删除订单操作,一般用于 用户端删除,是否存在检查可以过掉 -// orderMapper.updateById((OrderDO) new OrderDO() -// .setId(id) -// .setDeleted(DeletedStatusEnum.DELETED_YES.getValue()) -// ); -// return CommonResult.success(null); -// } -// -// @Override -// public String updatePaySuccess(String orderId, Integer payAmount) { -// OrderDO order = orderMapper.selectById(Integer.valueOf(orderId)); -// if (order == null) { // 订单不存在 -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_NOT_EXISTENT.getCode()).getMessage(); -// } -// if (!order.getStatus().equals(OrderStatusEnum.WAITING_PAYMENT.getValue())) { // 状态不处于等待支付 -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_STATUS_NOT_WAITING_PAYMENT.getCode()).getMessage(); -// } -// if (!order.getPresentPrice().equals(payAmount)) { // 支付金额不正确 -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_PAY_AMOUNT_ERROR.getCode()).getMessage(); -// } -// // 更新 OrderDO 状态为已支付,等待发货 -// OrderDO updateOrderObj = new OrderDO() -// .setStatus(OrderStatusEnum.WAIT_SHIPMENT.getValue()) -// .setPayAmount(payAmount) -// .setPaymentTime(new Date()); -// int updateCount = orderMapper.updateByIdAndStatus(order.getId(), order.getStatus(), updateOrderObj); -// if (updateCount <= 0) { -// return ServiceExceptionUtil.error(OrderErrorCodeEnum.ORDER_STATUS_NOT_WAITING_PAYMENT.getCode()).getMessage(); -// } -// // TODO FROM 芋艿 to 小范,把更新 OrderItem 给补全。 -// return "success"; -// } -// -// @Override -// public CommonResult listenerConfirmGoods() { -// return null; -// } -// -// @Override -// public CommonResult listenerExchangeGoods() { -// return null; -// } -} diff --git a/order/order-biz/src/main/resources/biz.yaml b/order/order-biz/src/main/resources/biz.yaml deleted file mode 100644 index 3adf8f6ea..000000000 --- a/order/order-biz/src/main/resources/biz.yaml +++ /dev/null @@ -1,25 +0,0 @@ -spring: - # 数据源配置项 - datasource: - url: jdbc:mysql://s1.iocoder.cn:3306/mall_order?useSSL=false&useUnicode=true&characterEncoding=UTF-8 - driver-class-name: com.mysql.jdbc.Driver - username: root - password: 3WLiVUBEwTbvAfsh - - #mongodb - data: - mongodb: - uri: mongodb://localhost/order-comment - - -# MyBatis Plus 配置项 -mybatis-plus: - configuration: - map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。 - global-config: - db-config: - id-type: auto - logic-delete-value: 1 # 逻辑已删除值(默认为 1) - logic-not-delete-value: 0 # 逻辑未删除值(默认为 0) - mapper-locations: classpath*:mapper/*.xml - type-aliases-package: cn.iocoder.mall.order.biz.dataobject diff --git a/order/order-biz/src/main/resources/mapper/CartMapper.xml b/order/order-biz/src/main/resources/mapper/CartMapper.xml deleted file mode 100644 index b5ca5f4c4..000000000 --- a/order/order-biz/src/main/resources/mapper/CartMapper.xml +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - id, status, delete_time, selected, user_id, - spu_id, sku_id, quantity, order_id, order_create_time, - create_time - - - - - - - - - - - - - - INSERT INTO cart_item ( - status, delete_time, selected, user_id, - spu_id, sku_id, quantity, order_id, order_create_time, - create_time - ) VALUES ( - #{status}, #{deleteTime}, #{selected}, #{userId}, - #{spuId}, #{skuId}, #{quantity}, #{orderId}, #{orderCreateTime}, - #{createTime} - ) - - - - UPDATE cart_item - - - status = #{status}, - - - delete_time = #{deleteTime}, - - - selected = #{selected}, - - - quantity = #{quantity}, - - - order_id = #{orderId}, - - - order_create_time = #{orderCreateTime}, - - - price = #{price}, - - - quantity = #{quantity}, - - - WHERE id = #{id} - - - - UPDATE cart_item - SET quantity = quantity + #{quantityIncr} - WHERE id = #{id} - - - - UPDATE cart_item - - - selected = #{selected}, - - - status = #{status}, - - - WHERE user_id = #{userId} - AND sku_id IN - - #{skuId} - - -- AND deleted = 0 - - - diff --git a/order/order-biz/src/main/resources/mapper/OrderCancelMapper.xml b/order/order-biz/src/main/resources/mapper/OrderCancelMapper.xml deleted file mode 100644 index 1f36e4891..000000000 --- a/order/order-biz/src/main/resources/mapper/OrderCancelMapper.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - id, order_id, order_no, reason, other_reason, - create_time, update_time - - - - - INSERT INTO `order_cancel` ( - order_id, order_no, reason, other_reason, - create_time, update_time - ) VALUES ( - #{orderId}, #{orderNo}, #{reason}, #{otherReason}, - #{createTime}, #{updateTime} - ) - - diff --git a/order/order-biz/src/main/resources/mapper/OrderItemMapper.xml b/order/order-biz/src/main/resources/mapper/OrderItemMapper.xml deleted file mode 100644 index f4bdf2c3c..000000000 --- a/order/order-biz/src/main/resources/mapper/OrderItemMapper.xml +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - id, order_id, order_no, sku_id, sku_name, sku_image, order_logistics_id, - quantity, origin_price, buy_price, present_price, buy_total, discount_total, present_total, - payment_time, delivery_time, receiver_time, closing_time, - has_return_exchange, delivery_type, status, - create_time, update_time, deleted - - - - - INSERT INTO `order_item` ( - order_id, order_no, sku_id, sku_name, sku_image, order_logistics_id, - quantity, origin_price, buy_price, present_price, buy_total, discount_total, present_total, - payment_time, delivery_time, receiver_time, closing_time, - has_return_exchange, delivery_type, status, - create_time, update_time, deleted - ) VALUES - - (#{item.orderId}, #{item.orderNo}, #{item.skuId}, #{item.skuName}, #{item.skuImage}, #{item.orderLogisticsId}, - #{item.quantity}, #{item.originPrice}, #{item.buyPrice}, #{item.presentPrice}, #{item.buyTotal}, #{item.discountTotal}, #{item.presentTotal}, - #{item.paymentTime}, #{item.deliveryTime}, #{item.receiverTime}, #{item.closingTime}, - #{item.hasReturnExchange}, #{item.deliveryType}, #{item.status}, - #{item.createTime}, #{item.updateTime}, #{item.deleted}) - - - - - - - - , order_id = #{orderItemDO.orderId} - - - , order_no = #{orderItemDO.orderNo} - - - , order_logistics_id = #{orderItemDO.orderLogisticsId} - - - , sku_id = #{orderItemDO.skuId} - - - , sku_name = #{orderItemDO.skuName} - - - , sku_image = #{orderItemDO.skuImage} - - - , quantity = #{orderItemDO.quantity} - - - - - - - - - - - , payment_time = #{orderItemDO.paymentTime} - - - , delivery_time = #{orderItemDO.deliveryTime} - - - , receiver_time = #{orderItemDO.receiverTime} - - - , closing_time = #{orderItemDO.closingTime} - - - - , has_return_exchange = #{orderItemDO.hasReturnExchange} - - - , status = #{orderItemDO.status} - - - , delivery_type = #{orderItemDO.deliveryType} - - - , `deleted` = #{orderItemDO.deleted} - - - , create_time = #{orderItemDO.createTime} - - - , update_time = #{orderItemDO.updateTime} - - - - - - - UPDATE `order_item` - - WHERE id = #{orderItemDO.id} - - - - - UPDATE `order_item` - - WHERE id IN - - #{id} - - - - - - UPDATE `order_item` - - WHERE order_id = #{orderId} - - - - - - - - - - - diff --git a/order/order-biz/src/main/resources/mapper/OrderMapper.xml b/order/order-biz/src/main/resources/mapper/OrderMapper.xml deleted file mode 100644 index 2f03b33f3..000000000 --- a/order/order-biz/src/main/resources/mapper/OrderMapper.xml +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - id, user_id, order_no, buy_price, discount_price, logistics_price, present_price, pay_amount, - payment_time, delivery_time, receiver_time, closing_time, - has_return_exchange, - status, remark, create_time, update_time, `deleted` - - - - - - , order_no = #{orderNo} - - - , buy_price = #{buyPrice} - - - , discount_price = #{discountPrice} - - - , logistics_price = #{logisticsPrice} - - - , logistics_price = #{logisticsPrice} - - - , present_price = #{presentPrice} - - - , pay_amount = #{payAmount} - - - , delivery_time = #{deliveryTime} - - - , payment_time = #{paymentTime} - - - , receiver_time = #{receiverTime} - - - , closing_time = #{closingTime} - - - , has_return_exchange = #{hasReturnExchange} - - - - , status = #{status} - - - , remark = #{remark} - - - , `deleted` = #{deleted} - - - , create_time = #{createTime} - - - , update_time = #{updateTime} - - - - - - UPDATE `orders` - - WHERE id = #{id} - - - - UPDATE `orders` - - - , pay_amount = #{updateObj.payAmount} - - - , payment_time = #{updateObj.paymentTime} - - - , status = #{updateObj.status} - - - WHERE id = #{id} - AND status = #{status} - - - - - - - AND `status` = #{status} - - - AND `user_id` = #{userId} - - - AND `id` = #{id} - - - AND `order_no` = #{orderNo} - - - AND `has_return_exchange` = #{hasReturnExchange} - - - AND `create_time` >= #{startCreateTime} - AND `create_time` <= #{endCreateTime} - - - - - - - - - diff --git a/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/users/OrderCreateRequest.java b/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/users/OrderCreateRequest.java deleted file mode 100644 index 678918fd6..000000000 --- a/order/order-rest/src/main/java/cn/iocoder/mall/order/rest/request/users/OrderCreateRequest.java +++ /dev/null @@ -1,58 +0,0 @@ -package cn.iocoder.mall.order.rest.request.users; - -import java.io.Serializable; -import java.util.List; -import javax.validation.constraints.Max; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - * 订单创建 - * - * @author Sin - * @time 2019-03-16 14:42 - */ -@Data -@Accessors(chain = true) -public class OrderCreateRequest implements Serializable { - - /** - * 收件手机号 - */ - @NotNull(message = "用户地址id不能为空!") - private Integer userAddressId; - /** - * 优惠劵编号 - */ - private Integer couponCardId; - /** - * 备注 - */ - private String remark; - - /// - /// order item - - @NotNull() - @Size(max = 1000, min = 1, message = "用户订单中没有商品!") - private List orderItems; - - @Data - @Accessors(chain = true) - public static class OrderItem { - - /** - * 商品编号 - */ - @NotNull - private Integer skuId; - /** - * 数量 - */ - @NotNull - @Max(value = 1000) - private Integer quantity; - } -} diff --git a/order/order-service-api02/pom.xml b/order/order-service-api02/pom.xml deleted file mode 100644 index 3d0b33294..000000000 --- a/order/order-service-api02/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - order - cn.iocoder.mall - 1.0-SNAPSHOT - - 4.0.0 - - order-service-api02 - - - - - cn.iocoder.mall - common-framework - 1.0-SNAPSHOT - - - cn.iocoder.mall - product-service-api - 1.0-SNAPSHOT - - - cn.iocoder.mall - promotion-service-api - 1.0-SNAPSHOT - - - - - org.mapstruct - mapstruct - - - org.mapstruct - mapstruct-jdk8 - - - - org.projectlombok - lombok - - - diff --git a/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/LogisticsEnum.java b/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/LogisticsEnum.java deleted file mode 100644 index d9b7332aa..000000000 --- a/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/LogisticsEnum.java +++ /dev/null @@ -1,41 +0,0 @@ -package cn.iocoder.mall.order.api.constant; - -/** - * 物流信息 - * - * @author Sin - * @time 2019-03-30 22:33 - */ -public enum LogisticsEnum { - - LOGISTICS_1(1, "顺丰快递"), - LOGISTICS_2(2, "圆通快递"), - LOGISTICS_3(3, "申通快递"), - LOGISTICS_4(4, "韵答快递"), - LOGISTICS_5(5, "天天快递"), - LOGISTICS_6(6, "EMS中国邮政"), - - ; - - /** - * 状态值 - */ - private Integer value; - /** - * 状态名 - */ - private String name; - - LogisticsEnum(int value, String name) { - this.value = value; - this.name = name; - } - - public int getValue() { - return value; - } - - public String getName() { - return name; - } -} diff --git a/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderStatusEnum.java b/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderStatusEnum.java deleted file mode 100644 index 7ec9170b8..000000000 --- a/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/constant/OrderStatusEnum.java +++ /dev/null @@ -1,38 +0,0 @@ -package cn.iocoder.mall.order.api.constant; - -/** - * 订单 - status - * - * @author Sin - * @time 2019-03-16 14:06 - */ -public enum OrderStatusEnum { - - WAITING_PAYMENT(1, "等待付款"), - WAIT_SHIPMENT(2, "等待发货"), - ALREADY_SHIPMENT(3, "已发货"), - COMPLETED(4, "已完成"), - CLOSED(5, "已关闭"); - - /** - * 状态值 - */ - private Integer value; - /** - * 状态名 - */ - private String name; - - OrderStatusEnum(int value, String name) { - this.value = value; - this.name = name; - } - - public int getValue() { - return value; - } - - public String getName() { - return name; - } -} diff --git a/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderCreateDTO.java b/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderCreateDTO.java deleted file mode 100644 index 101b39451..000000000 --- a/order/order-service-api02/src/main/java/cn/iocoder/mall/order/api/dto/OrderCreateDTO.java +++ /dev/null @@ -1,64 +0,0 @@ -package cn.iocoder.mall.order.api.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.Max; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.List; - -/** - * 订单创建 - * - * @author Sin - * @time 2019-03-16 14:42 - */ -@Data -@Accessors(chain = true) -public class OrderCreateDTO implements Serializable { - - /** - * 用户id - */ - private Integer userId; - /** - * 用户地址 - */ - private Integer userAddressId; - /** - * 优惠劵编号 - */ - private Integer couponCardId; - /** - * 备注 - */ - private String remark; - /** - * ip信息 - */ - private String ip; - - /// - /// order item - - private List orderItems; - - - @Data - @Accessors(chain = true) - public static class OrderItem { - - /** - * 商品编号 - */ - @NotNull - private Integer skuId; - /** - * 数量 - */ - @NotNull - @Max(value = 1000) - private Integer quantity; - } -} diff --git a/order/pom.xml b/order/pom.xml deleted file mode 100644 index 168f43a32..000000000 --- a/order/pom.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - onemall - cn.iocoder.mall - 1.0-SNAPSHOT - - 4.0.0 - - order - pom - - - - order-rest - order-service-api02 - order-service-impl - - - - - - cn.iocoder.mall - mall-dependencies - 1.0-SNAPSHOT - pom - import - - - - - diff --git a/pom.xml b/pom.xml index 9d792b671..56004b0e7 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ product-service-project promotion-service-project search-service-project - order-service-project + trade-service-project pom diff --git a/shop-web-app/pom.xml b/shop-web-app/pom.xml index e115cdda4..ea5f5adf0 100644 --- a/shop-web-app/pom.xml +++ b/shop-web-app/pom.xml @@ -69,7 +69,7 @@ cn.iocoder.mall - order-service-api + trade-service-api 1.0-SNAPSHOT diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/client/trade/TradeOrderClient.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/client/trade/TradeOrderClient.java new file mode 100644 index 000000000..f051c4ede --- /dev/null +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/client/trade/TradeOrderClient.java @@ -0,0 +1,21 @@ +package cn.iocoder.mall.shopweb.client.trade; + +import cn.iocoder.common.framework.vo.CommonResult; +import cn.iocoder.mall.tradeservice.rpc.order.TradeOrderRpc; +import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderCreateReqDTO; +import org.apache.dubbo.config.annotation.DubboReference; +import org.springframework.stereotype.Service; + +@Service +public class TradeOrderClient { + + @DubboReference(version = "${dubbo.consumer.TradeOrderRpc.version}") + private TradeOrderRpc tradeOrderRpc; + + public Integer createTradeOrder(TradeOrderCreateReqDTO createReqDTO) { + CommonResult createTradeOrderResult = tradeOrderRpc.createTradeOrder(createReqDTO); + createTradeOrderResult.checkError(); + return createTradeOrderResult.getData(); + } + +} diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/client/user/UserAddressClient.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/client/user/UserAddressClient.java new file mode 100644 index 000000000..7a99063ae --- /dev/null +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/client/user/UserAddressClient.java @@ -0,0 +1,15 @@ +package cn.iocoder.mall.shopweb.client.user; + +import cn.iocoder.mall.userservice.rpc.address.UserAddressRpc; +import org.apache.dubbo.config.annotation.DubboReference; +import org.springframework.stereotype.Service; + +@Service +public class UserAddressClient { + + @DubboReference(version = "${dubbo.consumer.UserAddressRpc.version}") + private UserAddressRpc userAddressRpc; + + + +} diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/order/OrderController.http b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/order/OrderController.http deleted file mode 100644 index 5bc462fda..000000000 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/order/OrderController.http +++ /dev/null @@ -1,11 +0,0 @@ -### /order/confirm-create-order-info 基于商品,确认创建订单 -GET {{shop-api-base-url}}/order/confirm-create-order-info?skuId=33&quantity=1 -Content-Type: application/x-www-form-urlencoded -Authorization: Bearer {{user-access-token}} - -### /order/confirm-create-order-info-from-cart 基于购物车,确认创建订单 -GET {{shop-api-base-url}}/order/confirm-create-order-info-from-cart -Content-Type: application/x-www-form-urlencoded -Authorization: Bearer {{user-access-token}} - -### diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/order/OrderController.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/order/OrderController.java deleted file mode 100644 index 1ce43e979..000000000 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/order/OrderController.java +++ /dev/null @@ -1,49 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.order; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.security.user.core.context.UserSecurityContextHolder; -import cn.iocoder.mall.shopweb.controller.order.vo.order.OrderConfirmCreateInfoRespVO; -import cn.iocoder.mall.shopweb.manager.order.OrderManager; -import cn.iocoder.security.annotations.RequiresAuthenticate; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -@Api(tags = "订单 API") -@RestController -@RequestMapping("/order") -@Validated -public class OrderController { - - @Autowired - private OrderManager orderManager; - - @GetMapping("confirm-create-order-info") - @ApiOperation("基于商品,确认创建订单") - @ApiImplicitParams({ - @ApiImplicitParam(name = "skuId", required = true, value = "商品 SKU 编号", example = "1024"), - @ApiImplicitParam(name = "quantity", required = true, value = "购买数量", example = "2"), - @ApiImplicitParam(name = "couponCardId", value = "优惠劵编号", example = "1"), - }) - @RequiresAuthenticate - public CommonResult getOrderConfirmCreateInfo(@RequestParam("skuId") Integer skuId, - @RequestParam("quantity") Integer quantity, - @RequestParam(value = "couponCardId", required = false) Integer couponCardId) { - return success(orderManager.getOrderConfirmCreateInfo(UserSecurityContextHolder.getUserId(), skuId, quantity, couponCardId)); - } - - @GetMapping("confirm-create-order-info-from-cart") - @ApiOperation("基于购物车,确认创建订单") - @ApiImplicitParam(name = "couponCardId", value = "优惠劵编号", example = "1") - @RequiresAuthenticate - public CommonResult getOrderConfirmCreateInfoFromCart(@RequestParam(value = "couponCardId", required = false) Integer couponCardId) { - return success(orderManager.getOrderConfirmCreateInfoFromCart(UserSecurityContextHolder.getUserId(), couponCardId)); - } - -} diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductCategoryController.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductCategoryController.java index 6927ccd51..df5c037e3 100644 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductCategoryController.java +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductCategoryController.java @@ -2,7 +2,7 @@ package cn.iocoder.mall.shopweb.controller.product; import cn.iocoder.common.framework.vo.CommonResult; import cn.iocoder.mall.shopweb.controller.product.vo.category.ProductCategoryRespVO; -import cn.iocoder.mall.shopweb.manager.product.ProductCategoryManager; +import cn.iocoder.mall.shopweb.service.product.ProductCategoryManager; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductSkuController.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductSkuController.java index 5fc6c3bc2..df5337008 100644 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductSkuController.java +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductSkuController.java @@ -3,7 +3,7 @@ package cn.iocoder.mall.shopweb.controller.product; import cn.iocoder.common.framework.vo.CommonResult; import cn.iocoder.mall.security.user.core.context.UserSecurityContextHolder; import cn.iocoder.mall.shopweb.controller.product.vo.sku.ProductSkuCalcPriceRespVO; -import cn.iocoder.mall.shopweb.manager.product.ProductSkuManager; +import cn.iocoder.mall.shopweb.service.product.ProductSkuManager; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductSpuController.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductSpuController.java index d0f45ac81..4931eca47 100644 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductSpuController.java +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductSpuController.java @@ -6,7 +6,7 @@ import cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuDetailRes import cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuPageReqVO; import cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuRespVO; import cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuSearchConditionRespVO; -import cn.iocoder.mall.shopweb.manager.product.ProductSpuManager; +import cn.iocoder.mall.shopweb.service.product.ProductSpuManager; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/BannerController.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/BannerController.java index 58785ee6c..7474b2891 100644 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/BannerController.java +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/BannerController.java @@ -2,7 +2,7 @@ package cn.iocoder.mall.shopweb.controller.promotion; import cn.iocoder.common.framework.vo.CommonResult; import cn.iocoder.mall.shopweb.controller.promotion.vo.brand.BannerRespVO; -import cn.iocoder.mall.shopweb.manager.promotion.BannerManager; +import cn.iocoder.mall.shopweb.service.promotion.BannerManager; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/CouponCardController.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/CouponCardController.java index 9ca14e00b..2975796ae 100644 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/CouponCardController.java +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/CouponCardController.java @@ -5,7 +5,7 @@ import cn.iocoder.common.framework.vo.PageResult; import cn.iocoder.mall.security.user.core.context.UserSecurityContextHolder; import cn.iocoder.mall.shopweb.controller.promotion.vo.coupon.card.CouponCardPageReqVO; import cn.iocoder.mall.shopweb.controller.promotion.vo.coupon.card.CouponCardRespVO; -import cn.iocoder.mall.shopweb.manager.promotion.CouponCardManager; +import cn.iocoder.mall.shopweb.service.promotion.CouponCardManager; import cn.iocoder.security.annotations.RequiresAuthenticate; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/CouponTemplateController.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/CouponTemplateController.java index 1bc141d44..7b8146b31 100644 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/CouponTemplateController.java +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/CouponTemplateController.java @@ -2,7 +2,7 @@ package cn.iocoder.mall.shopweb.controller.promotion; import cn.iocoder.common.framework.vo.CommonResult; import cn.iocoder.mall.shopweb.controller.promotion.vo.coupon.template.CouponTemplateRespVO; -import cn.iocoder.mall.shopweb.manager.promotion.CouponTemplateManager; +import cn.iocoder.mall.shopweb.service.promotion.CouponTemplateManager; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/ProductRecommendController.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/ProductRecommendController.java index b17a39e2a..df5b4f2a4 100644 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/ProductRecommendController.java +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/promotion/ProductRecommendController.java @@ -2,7 +2,7 @@ package cn.iocoder.mall.shopweb.controller.promotion; import cn.iocoder.common.framework.vo.CommonResult; import cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuRespVO; -import cn.iocoder.mall.shopweb.manager.promotion.ProductRecommendManager; +import cn.iocoder.mall.shopweb.service.promotion.ProductRecommendManager; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/order/CartController.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/CartController.java similarity index 95% rename from shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/order/CartController.java rename to shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/CartController.java index 32cfa2a7d..d1d069bcf 100644 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/order/CartController.java +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/CartController.java @@ -1,9 +1,9 @@ -package cn.iocoder.mall.shopweb.controller.order; +package cn.iocoder.mall.shopweb.controller.trade; import cn.iocoder.common.framework.vo.CommonResult; import cn.iocoder.mall.security.user.core.context.UserSecurityContextHolder; -import cn.iocoder.mall.shopweb.controller.order.vo.cart.CartDetailVO; -import cn.iocoder.mall.shopweb.manager.order.CartManager; +import cn.iocoder.mall.shopweb.controller.trade.vo.cart.CartDetailVO; +import cn.iocoder.mall.shopweb.service.trade.CartManager; import cn.iocoder.security.annotations.RequiresAuthenticate; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/TradeOrderController.http b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/TradeOrderController.http new file mode 100644 index 000000000..76a565d52 --- /dev/null +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/TradeOrderController.http @@ -0,0 +1,18 @@ +### /trade-order/confirm-create-order-info 基于商品,确认创建订单 +GET {{shop-api-base-url}}/trade-order/confirm-create-order-info?skuId=33&quantity=1 +Content-Type: application/x-www-form-urlencoded +Authorization: Bearer {{user-access-token}} + +### /trade-order/confirm-create-order-info-from-cart 基于购物车,确认创建订单 +GET {{shop-api-base-url}}/trade-order/confirm-create-order-info-from-cart +Content-Type: application/x-www-form-urlencoded +Authorization: Bearer {{user-access-token}} + +### /trade-order/confirm-create-order-info-from-cart 基于商品,创建订单 +POST {{shop-api-base-url}}/trade-order/create +Content-Type: application/x-www-form-urlencoded +Authorization: Bearer {{user-access-token}} + +userAddressId=19&remark=我是备注&orderItems[0].skuId=3&orderItems[0].quantity=1 + +### diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/TradeOrderController.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/TradeOrderController.java new file mode 100644 index 000000000..1a1e758de --- /dev/null +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/TradeOrderController.java @@ -0,0 +1,72 @@ +package cn.iocoder.mall.shopweb.controller.trade; + +import cn.iocoder.common.framework.util.HttpUtil; +import cn.iocoder.common.framework.vo.CommonResult; +import cn.iocoder.mall.security.user.core.context.UserSecurityContextHolder; +import cn.iocoder.mall.shopweb.controller.trade.vo.order.TradeOrderConfirmCreateInfoRespVO; +import cn.iocoder.mall.shopweb.controller.trade.vo.order.TradeOrderCreateFromCartReqVO; +import cn.iocoder.mall.shopweb.controller.trade.vo.order.TradeOrderCreateReqVO; +import cn.iocoder.mall.shopweb.service.trade.TradeOrderService; +import cn.iocoder.security.annotations.RequiresAuthenticate; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; + +import static cn.iocoder.common.framework.vo.CommonResult.success; + +@Api(tags = "交易订单 API") +@RestController +@RequestMapping("/trade-order") +@Validated +public class TradeOrderController { + + @Autowired + private TradeOrderService tradeOrderService; + + @GetMapping("confirm-create-order-info") + @ApiOperation("基于商品,确认创建订单") + @ApiImplicitParams({ + @ApiImplicitParam(name = "skuId", required = true, value = "商品 SKU 编号", example = "1024"), + @ApiImplicitParam(name = "quantity", required = true, value = "购买数量", example = "2"), + @ApiImplicitParam(name = "couponCardId", value = "优惠劵编号", example = "1"), + }) + @RequiresAuthenticate + public CommonResult getTradeOrderConfirmCreateInfo( + @RequestParam("skuId") Integer skuId, + @RequestParam("quantity") Integer quantity, + @RequestParam(value = "couponCardId", required = false) Integer couponCardId) { + return success(tradeOrderService.getOrderConfirmCreateInfo(UserSecurityContextHolder.getUserId(), skuId, quantity, couponCardId)); + } + + @GetMapping("confirm-create-order-info-from-cart") + @ApiOperation("基于购物车,确认创建订单") + @ApiImplicitParam(name = "couponCardId", value = "优惠劵编号", example = "1") + @RequiresAuthenticate + public CommonResult getTradeOrderConfirmCreateInfoFromCart( + @RequestParam(value = "couponCardId", required = false) Integer couponCardId) { + return success(tradeOrderService.getOrderConfirmCreateInfoFromCart(UserSecurityContextHolder.getUserId(), couponCardId)); + } + + @PostMapping("create") + @ApiOperation("基于商品,创建订单") + @RequiresAuthenticate + public CommonResult createTradeOrder(TradeOrderCreateReqVO createReqVO, + HttpServletRequest servletRequest) { + return success(tradeOrderService.createTradeOrder(UserSecurityContextHolder.getUserId(), + HttpUtil.getIp(servletRequest), createReqVO)); + } + + @GetMapping("create-from-cart") + @ApiOperation("基于购物车,创建订单") + @RequiresAuthenticate + public CommonResult createTradeOrder(TradeOrderCreateFromCartReqVO createReqVO) { + return null; + } + +} diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/order/vo/cart/CartDetailVO.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/cart/CartDetailVO.java similarity index 98% rename from shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/order/vo/cart/CartDetailVO.java rename to shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/cart/CartDetailVO.java index 5f1546c71..4b1427390 100644 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/order/vo/cart/CartDetailVO.java +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/cart/CartDetailVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.shopweb.controller.order.vo.cart; +package cn.iocoder.mall.shopweb.controller.trade.vo.cart; import cn.iocoder.mall.promotion.api.rpc.activity.dto.PromotionActivityRespDTO; import cn.iocoder.mall.shopweb.controller.product.vo.attr.ProductAttrKeyValueRespVO; diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/order/vo/order/OrderConfirmCreateInfoRespVO.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderConfirmCreateInfoRespVO.java similarity index 96% rename from shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/order/vo/order/OrderConfirmCreateInfoRespVO.java rename to shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderConfirmCreateInfoRespVO.java index 4335c811a..d963db314 100644 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/order/vo/order/OrderConfirmCreateInfoRespVO.java +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderConfirmCreateInfoRespVO.java @@ -1,8 +1,8 @@ -package cn.iocoder.mall.shopweb.controller.order.vo.order; +package cn.iocoder.mall.shopweb.controller.trade.vo.order; import cn.iocoder.mall.promotion.api.rpc.activity.dto.PromotionActivityRespDTO; import cn.iocoder.mall.promotion.api.rpc.coupon.dto.card.CouponCardAvailableRespDTO; -import cn.iocoder.mall.shopweb.controller.order.vo.cart.CartDetailVO; +import cn.iocoder.mall.shopweb.controller.trade.vo.cart.CartDetailVO; import cn.iocoder.mall.shopweb.controller.product.vo.attr.ProductAttrKeyValueRespVO; import io.swagger.annotations.ApiModel; import lombok.Data; @@ -13,7 +13,7 @@ import java.util.List; @ApiModel(value = "订单确认创建信息 Response VO") // TODO 芋艿:swagger 文档完善 @Data @Accessors(chain = true) // TODO 芋艿:和 CartDetailVO、ProductSkuCalcPriceRespVO 有点重复,后续要优化下; -public class OrderConfirmCreateInfoRespVO { +public class TradeOrderConfirmCreateInfoRespVO { /** * 商品分组数组 diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderCreateFromCartReqVO.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderCreateFromCartReqVO.java new file mode 100644 index 000000000..9bab1073b --- /dev/null +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderCreateFromCartReqVO.java @@ -0,0 +1,23 @@ +package cn.iocoder.mall.shopweb.controller.trade.vo.order; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotNull; + +@ApiModel(value = "创建交易订单 VO,基于购物车") +@Data +@Accessors(chain = true) +public class TradeOrderCreateFromCartReqVO { + + @ApiModelProperty(name = "收件地址编号", required = true, example = "1") + @NotNull(message = "用户地址不能为空") + private Integer userAddressId; + @ApiModelProperty(name = "优惠劵编号", example = "1024") + private Integer couponCardId; + @ApiModelProperty(name = "备注", example = "1024") + private String remark; + +} diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderCreateReqVO.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderCreateReqVO.java new file mode 100644 index 000000000..346bd7692 --- /dev/null +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderCreateReqVO.java @@ -0,0 +1,45 @@ +package cn.iocoder.mall.shopweb.controller.trade.vo.order; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; +import java.util.List; + +@ApiModel(value = "创建交易订单 VO,基于商品") +@Data +@Accessors(chain = true) +public class TradeOrderCreateReqVO { + + @ApiModelProperty(name = "收件地址编号", required = true, example = "1") + @NotNull(message = "收件地址不能为空") + private Integer userAddressId; + @ApiModelProperty(name = "优惠劵编号", example = "1024") + private Integer couponCardId; + @ApiModelProperty(name = "备注", example = "1024") + private String remark; + + /** + * 订单商品项列表 + */ + @NotNull(message = "必须选择购买的商品") + private List orderItems; + + @ApiModel(value = "订单商品项") + @Data + @Accessors(chain = true) + public static class OrderItem { + + @ApiModelProperty(name = "商品 SKU 编号", required = true, example = "111") + @NotNull(message = "商品 SKU 编号不能为空") + private Integer skuId; + @ApiModelProperty(name = "商品 SKU 购买数量", required = true, example = "1024") + @NotNull(message = "商品 SKU 购买数量不能为空") + @Min(value = 1, message = "商品 SKU 购买数量必须大于 0") + private Integer quantity; + } + +} diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/order/CartConvert.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/trade/CartConvert.java similarity index 85% rename from shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/order/CartConvert.java rename to shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/trade/CartConvert.java index 2a55499cf..beed9a262 100644 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/order/CartConvert.java +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/trade/CartConvert.java @@ -1,9 +1,9 @@ -package cn.iocoder.mall.shopweb.convert.order; +package cn.iocoder.mall.shopweb.convert.trade; import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuRespDTO; import cn.iocoder.mall.promotion.api.rpc.activity.dto.PromotionActivityRespDTO; import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcRespDTO; -import cn.iocoder.mall.shopweb.controller.order.vo.cart.CartDetailVO; +import cn.iocoder.mall.shopweb.controller.trade.vo.cart.CartDetailVO; import org.mapstruct.Mapper; import org.mapstruct.Mapping; import org.mapstruct.factory.Mappers; diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/order/OrderConvert.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/trade/TradeOrderConvert.java similarity index 64% rename from shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/order/OrderConvert.java rename to shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/trade/TradeOrderConvert.java index 1829749b6..a26d310ae 100644 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/order/OrderConvert.java +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/trade/TradeOrderConvert.java @@ -1,8 +1,10 @@ -package cn.iocoder.mall.shopweb.convert.order; +package cn.iocoder.mall.shopweb.convert.trade; import cn.iocoder.mall.promotion.api.rpc.coupon.dto.card.CouponCardAvailableListReqDTO; import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcRespDTO; -import cn.iocoder.mall.shopweb.controller.order.vo.order.OrderConfirmCreateInfoRespVO; +import cn.iocoder.mall.shopweb.controller.trade.vo.order.TradeOrderConfirmCreateInfoRespVO; +import cn.iocoder.mall.shopweb.controller.trade.vo.order.TradeOrderCreateReqVO; +import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderCreateReqDTO; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; @@ -11,11 +13,11 @@ import java.util.List; import java.util.stream.Collectors; @Mapper -public interface OrderConvert { +public interface TradeOrderConvert { - OrderConvert INSTANCE = Mappers.getMapper(OrderConvert.class); + TradeOrderConvert INSTANCE = Mappers.getMapper(TradeOrderConvert.class); - OrderConfirmCreateInfoRespVO.Fee convert(PriceProductCalcRespDTO.Fee bean); + TradeOrderConfirmCreateInfoRespVO.Fee convert(PriceProductCalcRespDTO.Fee bean); default List convertList(List itemGroups) { List items = new ArrayList<>(); @@ -30,4 +32,6 @@ public interface OrderConvert { return items; } + TradeOrderCreateReqDTO convert(TradeOrderCreateReqVO bean); + } diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/product/ProductCategoryManager.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/product/ProductCategoryManager.java similarity index 96% rename from shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/product/ProductCategoryManager.java rename to shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/product/ProductCategoryManager.java index 8a00fbc80..b9a48a923 100644 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/product/ProductCategoryManager.java +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/product/ProductCategoryManager.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.shopweb.manager.product; +package cn.iocoder.mall.shopweb.service.product; import cn.iocoder.common.framework.enums.CommonStatusEnum; import cn.iocoder.common.framework.vo.CommonResult; diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/product/ProductSkuManager.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/product/ProductSkuManager.java similarity index 98% rename from shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/product/ProductSkuManager.java rename to shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/product/ProductSkuManager.java index abf2fd08c..dc2f272d3 100644 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/product/ProductSkuManager.java +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/product/ProductSkuManager.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.shopweb.manager.product; +package cn.iocoder.mall.shopweb.service.product; import cn.iocoder.common.framework.vo.CommonResult; import cn.iocoder.mall.promotion.api.rpc.activity.PromotionActivityRpc; diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/product/ProductSpuManager.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/product/ProductSpuManager.java similarity index 98% rename from shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/product/ProductSpuManager.java rename to shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/product/ProductSpuManager.java index 0330187f2..02d0523da 100644 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/product/ProductSpuManager.java +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/product/ProductSpuManager.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.shopweb.manager.product; +package cn.iocoder.mall.shopweb.service.product; import cn.iocoder.common.framework.util.CollectionUtils; import cn.iocoder.common.framework.vo.CommonResult; diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/promotion/BannerManager.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/promotion/BannerManager.java similarity index 96% rename from shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/promotion/BannerManager.java rename to shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/promotion/BannerManager.java index acc6599ec..9eac17e6f 100644 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/promotion/BannerManager.java +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/promotion/BannerManager.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.shopweb.manager.promotion; +package cn.iocoder.mall.shopweb.service.promotion; import cn.iocoder.common.framework.enums.CommonStatusEnum; import cn.iocoder.common.framework.vo.CommonResult; diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/promotion/CouponCardManager.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/promotion/CouponCardManager.java similarity index 97% rename from shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/promotion/CouponCardManager.java rename to shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/promotion/CouponCardManager.java index b0fff075b..06552ed3d 100644 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/promotion/CouponCardManager.java +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/promotion/CouponCardManager.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.shopweb.manager.promotion; +package cn.iocoder.mall.shopweb.service.promotion; import cn.iocoder.common.framework.vo.CommonResult; import cn.iocoder.common.framework.vo.PageResult; diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/promotion/CouponTemplateManager.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/promotion/CouponTemplateManager.java similarity index 95% rename from shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/promotion/CouponTemplateManager.java rename to shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/promotion/CouponTemplateManager.java index 30fb8015f..ca40dd761 100644 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/promotion/CouponTemplateManager.java +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/promotion/CouponTemplateManager.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.shopweb.manager.promotion; +package cn.iocoder.mall.shopweb.service.promotion; import cn.iocoder.common.framework.vo.CommonResult; import cn.iocoder.mall.promotion.api.rpc.coupon.CouponTemplateRpc; diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/promotion/ProductRecommendManager.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/promotion/ProductRecommendManager.java similarity index 98% rename from shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/promotion/ProductRecommendManager.java rename to shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/promotion/ProductRecommendManager.java index cf11ae8a3..091693fd8 100644 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/promotion/ProductRecommendManager.java +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/promotion/ProductRecommendManager.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.shopweb.manager.promotion; +package cn.iocoder.mall.shopweb.service.promotion; import cn.iocoder.common.framework.enums.CommonStatusEnum; import cn.iocoder.common.framework.util.CollectionUtils; diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/order/CartManager.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/trade/CartManager.java similarity index 96% rename from shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/order/CartManager.java rename to shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/trade/CartManager.java index acc56c424..fb5836f46 100644 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/order/CartManager.java +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/trade/CartManager.java @@ -1,9 +1,9 @@ -package cn.iocoder.mall.shopweb.manager.order; +package cn.iocoder.mall.shopweb.service.trade; import cn.iocoder.common.framework.util.CollectionUtils; import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.orderservice.rpc.cart.CartRpc; -import cn.iocoder.mall.orderservice.rpc.cart.dto.*; +import cn.iocoder.mall.tradeservice.rpc.cart.CartRpc; +import cn.iocoder.mall.tradeservice.rpc.cart.dto.*; import cn.iocoder.mall.productservice.enums.sku.ProductSkuDetailFieldEnum; import cn.iocoder.mall.productservice.rpc.sku.ProductSkuRpc; import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuListQueryReqDTO; @@ -14,8 +14,8 @@ import cn.iocoder.mall.promotion.api.rpc.activity.dto.PromotionActivityRespDTO; import cn.iocoder.mall.promotion.api.rpc.price.PriceRpc; import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcReqDTO; import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcRespDTO; -import cn.iocoder.mall.shopweb.controller.order.vo.cart.CartDetailVO; -import cn.iocoder.mall.shopweb.convert.order.CartConvert; +import cn.iocoder.mall.shopweb.controller.trade.vo.cart.CartDetailVO; +import cn.iocoder.mall.shopweb.convert.trade.CartConvert; import org.apache.dubbo.config.annotation.DubboReference; import org.springframework.stereotype.Service; diff --git a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/order/OrderManager.java b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/trade/TradeOrderService.java similarity index 78% rename from shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/order/OrderManager.java rename to shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/trade/TradeOrderService.java index b1b853710..b87f49be1 100644 --- a/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/order/OrderManager.java +++ b/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/service/trade/TradeOrderService.java @@ -1,12 +1,16 @@ -package cn.iocoder.mall.shopweb.manager.order; +package cn.iocoder.mall.shopweb.service.trade; import cn.iocoder.common.framework.enums.CommonStatusEnum; import cn.iocoder.common.framework.exception.util.ServiceExceptionUtil; import cn.iocoder.common.framework.util.CollectionUtils; import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.orderservice.rpc.cart.CartRpc; -import cn.iocoder.mall.orderservice.rpc.cart.dto.CartItemListReqDTO; -import cn.iocoder.mall.orderservice.rpc.cart.dto.CartItemRespDTO; +import cn.iocoder.mall.shopweb.client.trade.TradeOrderClient; +import cn.iocoder.mall.shopweb.controller.trade.vo.order.TradeOrderConfirmCreateInfoRespVO; +import cn.iocoder.mall.shopweb.controller.trade.vo.order.TradeOrderCreateReqVO; +import cn.iocoder.mall.shopweb.convert.trade.TradeOrderConvert; +import cn.iocoder.mall.tradeservice.rpc.cart.CartRpc; +import cn.iocoder.mall.tradeservice.rpc.cart.dto.CartItemListReqDTO; +import cn.iocoder.mall.tradeservice.rpc.cart.dto.CartItemRespDTO; import cn.iocoder.mall.productservice.enums.sku.ProductSkuDetailFieldEnum; import cn.iocoder.mall.productservice.rpc.sku.ProductSkuRpc; import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuListQueryReqDTO; @@ -20,10 +24,9 @@ import cn.iocoder.mall.promotion.api.rpc.coupon.dto.card.CouponCardAvailableResp import cn.iocoder.mall.promotion.api.rpc.price.PriceRpc; import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcReqDTO; import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcRespDTO; -import cn.iocoder.mall.shopweb.controller.order.vo.order.OrderConfirmCreateInfoRespVO; -import cn.iocoder.mall.shopweb.convert.order.CartConvert; -import cn.iocoder.mall.shopweb.convert.order.OrderConvert; +import cn.iocoder.mall.shopweb.convert.trade.CartConvert; import org.apache.dubbo.config.annotation.DubboReference; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; @@ -34,11 +37,11 @@ import static cn.iocoder.mall.shopweb.enums.ShopWebErrorCodeConstants.ORDER_PROD import static cn.iocoder.mall.shopweb.enums.ShopWebErrorCodeConstants.ORDER_PRODUCT_SKU_QUANTITY_NOT_ENOUGH; /** - * Order Manager + * 交易订单 Service */ @Service @Validated -public class OrderManager { +public class TradeOrderService { @DubboReference(version = "${dubbo.consumer.PriceRpc.version}") private PriceRpc priceRpc; @@ -51,22 +54,25 @@ public class OrderManager { @DubboReference(version = "${dubbo.consumer.CouponCardRpc.version}") private CouponCardRpc couponCardRpc; - public OrderConfirmCreateInfoRespVO getOrderConfirmCreateInfo(Integer userId, Integer skuId, Integer quantity, Integer couponCardId) { + @Autowired + private TradeOrderClient tradeOrderClient; + + public TradeOrderConfirmCreateInfoRespVO getOrderConfirmCreateInfo(Integer userId, Integer skuId, Integer quantity, Integer couponCardId) { Map skuMap = new HashMap<>(); skuMap.put(skuId, quantity); return this.getOrderConfirmCreateInfo0(userId, skuMap, couponCardId); } - public OrderConfirmCreateInfoRespVO getOrderConfirmCreateInfoFromCart(Integer userId, Integer couponCardId) { + public TradeOrderConfirmCreateInfoRespVO getOrderConfirmCreateInfoFromCart(Integer userId, Integer couponCardId) { // 获得购物车的商品 CommonResult> listCartItemsResult = cartRpc.listCartItems( new CartItemListReqDTO().setUserId(userId).setSelected(true)); listCartItemsResult.checkError(); // 购物车为空时,构造空的 OrderConfirmCreateInfoRespVO 返回 if (CollectionUtils.isEmpty(listCartItemsResult.getData())) { - OrderConfirmCreateInfoRespVO result = new OrderConfirmCreateInfoRespVO(); + TradeOrderConfirmCreateInfoRespVO result = new TradeOrderConfirmCreateInfoRespVO(); result.setItemGroups(Collections.emptyList()); - result.setFee(new OrderConfirmCreateInfoRespVO.Fee(0, 0, 0, 0)); + result.setFee(new TradeOrderConfirmCreateInfoRespVO.Fee(0, 0, 0, 0)); return result; } // 计算商品价格 @@ -75,7 +81,7 @@ public class OrderManager { return this.getOrderConfirmCreateInfo0(userId, skuMap, couponCardId); } - private OrderConfirmCreateInfoRespVO getOrderConfirmCreateInfo0(Integer userId, Map skuMap, Integer couponCardId) { + private TradeOrderConfirmCreateInfoRespVO getOrderConfirmCreateInfo0(Integer userId, Map skuMap, Integer couponCardId) { // 校验商品都存在,并且库存足够 this.checkProductSkus(skuMap); // 获得商品 SKU 信息 @@ -89,11 +95,11 @@ public class OrderManager { // 获得促销活动信息 Map promotionActivityMap = this.getPromotionActivityMap(calcProductPriceResult.getData()); // 拼接结果 - OrderConfirmCreateInfoRespVO createInfoRespVO = new OrderConfirmCreateInfoRespVO(); - createInfoRespVO.setFee(OrderConvert.INSTANCE.convert(calcProductPriceResult.getData().getFee())); + TradeOrderConfirmCreateInfoRespVO createInfoRespVO = new TradeOrderConfirmCreateInfoRespVO(); + createInfoRespVO.setFee(TradeOrderConvert.INSTANCE.convert(calcProductPriceResult.getData().getFee())); createInfoRespVO.setItemGroups(new ArrayList<>(calcProductPriceResult.getData().getItemGroups().size())); for (PriceProductCalcRespDTO.ItemGroup itemGroupDTO : calcProductPriceResult.getData().getItemGroups()) { - OrderConfirmCreateInfoRespVO.ItemGroup itemGroupVO = new OrderConfirmCreateInfoRespVO.ItemGroup(); + TradeOrderConfirmCreateInfoRespVO.ItemGroup itemGroupVO = new TradeOrderConfirmCreateInfoRespVO.ItemGroup(); createInfoRespVO.getItemGroups().add(itemGroupVO); // 活动信息 if (itemGroupDTO.getActivityId() != null) { @@ -108,7 +114,7 @@ public class OrderManager { // 查询可用优惠劵信息 CommonResult> listAvailableCouponCardsResult = couponCardRpc.listAvailableCouponCards( new CouponCardAvailableListReqDTO().setUserId(userId) - .setItems(OrderConvert.INSTANCE.convertList(calcProductPriceResult.getData().getItemGroups()))); + .setItems(TradeOrderConvert.INSTANCE.convertList(calcProductPriceResult.getData().getItemGroups()))); listAvailableCouponCardsResult.checkError(); createInfoRespVO.setCouponCards(listAvailableCouponCardsResult.getData()); return createInfoRespVO; @@ -157,4 +163,9 @@ public class OrderManager { return CollectionUtils.convertMap(listPromotionActivitiesResult.getData(), PromotionActivityRespDTO::getId); } + public Integer createTradeOrder(Integer userId, String ip, TradeOrderCreateReqVO createReqVO) { + return tradeOrderClient.createTradeOrder(TradeOrderConvert.INSTANCE.convert(createReqVO) + .setUserId(userId).setIp(ip)); + } + } diff --git a/shop-web-app/src/main/resources/application-local.yml b/shop-web-app/src/main/resources/application-local.yml index 2e26cd388..12e9ed401 100644 --- a/shop-web-app/src/main/resources/application-local.yml +++ b/shop-web-app/src/main/resources/application-local.yml @@ -6,6 +6,9 @@ spring: discovery: server-addr: 400-infra.server.iocoder.cn:8848 # Nacos 服务器地址 namespace: dev # Nacos 命名空间 + # Spring 主应用配置 + main: + lazy-initialization: true # 开启延迟加载,保证本地开发的性能 # Dubbo 配置项 dubbo: diff --git a/shop-web-app/src/main/resources/application.yml b/shop-web-app/src/main/resources/application.yml index e888bcc4f..38bba1c20 100644 --- a/shop-web-app/src/main/resources/application.yml +++ b/shop-web-app/src/main/resources/application.yml @@ -53,6 +53,8 @@ dubbo: version: 1.0.0 ProductRecommendRpc: version: 1.0.0 + TradeOrderRpc: + version: 1.0.0 # Swagger 配置项 swagger: diff --git a/order-service-project/pom.xml b/trade-service-project/pom.xml similarity index 81% rename from order-service-project/pom.xml rename to trade-service-project/pom.xml index 1af86f9f3..c5c1866dd 100644 --- a/order-service-project/pom.xml +++ b/trade-service-project/pom.xml @@ -9,11 +9,12 @@ 4.0.0 - order-service-project + trade-service-project pom - order-service-api - order-service-app + trade-service-api + trade-service-app + trade-service-integration-test @@ -30,7 +31,7 @@ cn.iocoder.mall - order-service-api + trade-service-api 1.0-SNAPSHOT diff --git a/order-service-project/order-service-api/pom.xml b/trade-service-project/trade-service-api/pom.xml similarity index 90% rename from order-service-project/order-service-api/pom.xml rename to trade-service-project/trade-service-api/pom.xml index 976d0e740..3b0e8d04c 100644 --- a/order-service-project/order-service-api/pom.xml +++ b/trade-service-project/trade-service-api/pom.xml @@ -3,13 +3,13 @@ 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"> - order-service-project + trade-service-project cn.iocoder.mall 1.0-SNAPSHOT 4.0.0 - order-service-api + trade-service-api diff --git a/order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/enums/OrderErrorCodeConstants.java b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/OrderErrorCodeConstants.java similarity index 98% rename from order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/enums/OrderErrorCodeConstants.java rename to trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/OrderErrorCodeConstants.java index 18f3af756..3d3d11a41 100644 --- a/order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/enums/OrderErrorCodeConstants.java +++ b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/OrderErrorCodeConstants.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.orderservice.enums; +package cn.iocoder.mall.tradeservice.enums; import cn.iocoder.common.framework.exception.ErrorCode; diff --git a/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/aftersale/AfterSaleOrderStatusEnum.java b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/aftersale/AfterSaleOrderStatusEnum.java new file mode 100644 index 000000000..8f87302c1 --- /dev/null +++ b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/aftersale/AfterSaleOrderStatusEnum.java @@ -0,0 +1,41 @@ +package cn.iocoder.mall.tradeservice.enums.aftersale; + +import lombok.Getter; + +/** + * 售后订单的状态枚举 + * + * 整体流程,见 https://www.processon.com/view/link/5fbdf47f07912946156305d7 + * + * 1. 在退款的情况下,需要 1 个来回 + * 2. 在退货退款的情况下,需要 2 个来回,额外增加一个买家退货的过程 + * 3. 在换货的情况下,需要 3 个来回,额外增加一个买家退货 + 卖家发货的过程 + */ +@Getter +public enum AfterSaleOrderStatusEnum { + + WAIT_SELLER_AGREE(10, "售后申请待商家处理"), + WAIT_BUYER_RETURN_GOODS(20, "商家同意售后申请,待买家处理"), + SELLER_REFUSE_BUYER(30, "商家不同意售后申请,待买家处理"), + WAIT_SELLER_CONFIRM_GOODS(40, "买家已退货,待商家确认收货"), + WAIT_BUYER_CONFIRM_GOODS(50, "商家已发货,待买家确认收货"), + SELLER_REFUSE_RETURN_GOODS(60, "商家拒绝收货,待买家处理"), + SUCCESS(70, "售后成功"), + CLOSED(80, "售后失败"), + ; + + /** + * 类型 + */ + private final Integer status; + /** + * 描述 + */ + private final String desc; + + AfterSaleOrderStatusEnum(Integer status, String desc) { + this.status = status; + this.desc = desc; + } + +} diff --git a/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/aftersale/AfterSaleTypeEnum.java b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/aftersale/AfterSaleTypeEnum.java new file mode 100644 index 000000000..7dea23d96 --- /dev/null +++ b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/aftersale/AfterSaleTypeEnum.java @@ -0,0 +1,28 @@ +package cn.iocoder.mall.tradeservice.enums.aftersale; + +import lombok.Getter; + +/** + * 售后单的类型枚举 + */ +@Getter +public enum AfterSaleTypeEnum { + + IN_SALE(10, "售中退款"), + AFTER_SALE(20, "售后退款"); + + /** + * 类型 + */ + private final Integer type; + /** + * 描述 + */ + private final String desc; + + AfterSaleTypeEnum(Integer type, String desc) { + this.type = type; + this.desc = desc; + } + +} diff --git a/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/aftersale/AfterSaleWayEnum.java b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/aftersale/AfterSaleWayEnum.java new file mode 100644 index 000000000..8d06828c4 --- /dev/null +++ b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/aftersale/AfterSaleWayEnum.java @@ -0,0 +1,29 @@ +package cn.iocoder.mall.tradeservice.enums.aftersale; + +import lombok.Getter; + +/** + * 售后单的方式枚举 + */ +@Getter +public enum AfterSaleWayEnum { + + REFUND(10, "退款"), + RETURN_AND_REFUND(20, "退货退款"), + EXCHANGE(30, "换货"); + + /** + * 方式 + */ + private final Integer way; + /** + * 描述 + */ + private final String desc; + + AfterSaleWayEnum(Integer way, String desc) { + this.way = way; + this.desc = desc; + } + +} diff --git a/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/logistics/LogisticsDeliveryTypeEnum.java b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/logistics/LogisticsDeliveryTypeEnum.java new file mode 100644 index 000000000..2463bb204 --- /dev/null +++ b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/logistics/LogisticsDeliveryTypeEnum.java @@ -0,0 +1,26 @@ +package cn.iocoder.mall.tradeservice.enums.logistics; + +import lombok.Getter; + +/** + * 物流的配送类型 + */ +@Getter +public enum LogisticsDeliveryTypeEnum { + + /** + * 无需快递 + */ + NULL(0), + /** + * 传统快递 + */ + EXPRESS(1); + + private final Integer deliveryType; + + LogisticsDeliveryTypeEnum(Integer deliveryType) { + this.deliveryType = deliveryType; + } + +} diff --git a/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/order/TradeOrderAfterSaleStatusEnum.java b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/order/TradeOrderAfterSaleStatusEnum.java new file mode 100644 index 000000000..bcfe9c1b6 --- /dev/null +++ b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/order/TradeOrderAfterSaleStatusEnum.java @@ -0,0 +1,29 @@ +package cn.iocoder.mall.tradeservice.enums.order; + +import lombok.Getter; + +/** + * 交易订单的售后状态的枚举 + */ +@Getter +public enum TradeOrderAfterSaleStatusEnum { + + NULL(0, "无"), + IN_PROCESS(10, "售后中"), + END(10, "售后结束"); + + /** + * 状态 + */ + private final Integer status; + /** + * 描述 + */ + private final String desc; + + TradeOrderAfterSaleStatusEnum(Integer status, String desc) { + this.status = status; + this.desc = desc; + } + +} diff --git a/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/order/TradeOrderStatusEnum.java b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/order/TradeOrderStatusEnum.java new file mode 100644 index 000000000..f7a2b4fea --- /dev/null +++ b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/enums/order/TradeOrderStatusEnum.java @@ -0,0 +1,35 @@ +package cn.iocoder.mall.tradeservice.enums.order; + +import lombok.Getter; + +/** + * 交易订单 - 状态蜜桔 + * + * @author Sin + * @time 2019-03-16 14:06 + */ +@Getter +public enum TradeOrderStatusEnum { + + WAITING_PAYMENT(10, "等待付款"), + WAIT_SHIPMENT(20, "等待发货"), + ALREADY_SHIPMENT(30, "已发货"), + COMPLETED(40, "已完成"), + CLOSED(50, "已关闭"); + + /** + * 状态值 + */ + private final Integer value; + /** + * 状态名 + */ + private final String name; + + TradeOrderStatusEnum(int value, String name) { + this.value = value; + this.name = name; + } + +} + diff --git a/order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/CartRpc.java b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/CartRpc.java similarity index 93% rename from order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/CartRpc.java rename to trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/CartRpc.java index 97d8ea2f1..66f46af8a 100644 --- a/order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/CartRpc.java +++ b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/CartRpc.java @@ -1,7 +1,7 @@ -package cn.iocoder.mall.orderservice.rpc.cart; +package cn.iocoder.mall.tradeservice.rpc.cart; import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.orderservice.rpc.cart.dto.*; +import cn.iocoder.mall.tradeservice.rpc.cart.dto.*; import java.util.List; diff --git a/order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/dto/CartItemAddReqDTO.java b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/dto/CartItemAddReqDTO.java similarity index 93% rename from order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/dto/CartItemAddReqDTO.java rename to trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/dto/CartItemAddReqDTO.java index 889be24e0..e27aab27f 100644 --- a/order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/dto/CartItemAddReqDTO.java +++ b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/dto/CartItemAddReqDTO.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.orderservice.rpc.cart.dto; +package cn.iocoder.mall.tradeservice.rpc.cart.dto; import lombok.Data; import lombok.experimental.Accessors; diff --git a/order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/dto/CartItemDeleteListReqDTO.java b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/dto/CartItemDeleteListReqDTO.java similarity index 91% rename from order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/dto/CartItemDeleteListReqDTO.java rename to trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/dto/CartItemDeleteListReqDTO.java index 0956d00a2..3d22779f2 100644 --- a/order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/dto/CartItemDeleteListReqDTO.java +++ b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/dto/CartItemDeleteListReqDTO.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.orderservice.rpc.cart.dto; +package cn.iocoder.mall.tradeservice.rpc.cart.dto; import lombok.Data; import lombok.experimental.Accessors; diff --git a/order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/dto/CartItemListReqDTO.java b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/dto/CartItemListReqDTO.java similarity index 89% rename from order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/dto/CartItemListReqDTO.java rename to trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/dto/CartItemListReqDTO.java index 040ea13a6..c5c9a8080 100644 --- a/order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/dto/CartItemListReqDTO.java +++ b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/dto/CartItemListReqDTO.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.orderservice.rpc.cart.dto; +package cn.iocoder.mall.tradeservice.rpc.cart.dto; import lombok.Data; import lombok.experimental.Accessors; diff --git a/order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/dto/CartItemRespDTO.java b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/dto/CartItemRespDTO.java similarity index 95% rename from order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/dto/CartItemRespDTO.java rename to trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/dto/CartItemRespDTO.java index 068ac06c8..60cfb7ecb 100644 --- a/order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/dto/CartItemRespDTO.java +++ b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/dto/CartItemRespDTO.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.orderservice.rpc.cart.dto; +package cn.iocoder.mall.tradeservice.rpc.cart.dto; import lombok.Data; import lombok.experimental.Accessors; diff --git a/order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/dto/CartItemUpdateQuantityReqDTO.java b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/dto/CartItemUpdateQuantityReqDTO.java similarity index 93% rename from order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/dto/CartItemUpdateQuantityReqDTO.java rename to trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/dto/CartItemUpdateQuantityReqDTO.java index 1f6c5cbac..1b7fefdd7 100644 --- a/order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/dto/CartItemUpdateQuantityReqDTO.java +++ b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/dto/CartItemUpdateQuantityReqDTO.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.orderservice.rpc.cart.dto; +package cn.iocoder.mall.tradeservice.rpc.cart.dto; import lombok.Data; import lombok.experimental.Accessors; diff --git a/order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/dto/CartItemUpdateSelectedReqDTO.java b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/dto/CartItemUpdateSelectedReqDTO.java similarity index 93% rename from order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/dto/CartItemUpdateSelectedReqDTO.java rename to trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/dto/CartItemUpdateSelectedReqDTO.java index b1227c773..c5e59c90f 100644 --- a/order-service-project/order-service-api/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/dto/CartItemUpdateSelectedReqDTO.java +++ b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/dto/CartItemUpdateSelectedReqDTO.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.orderservice.rpc.cart.dto; +package cn.iocoder.mall.tradeservice.rpc.cart.dto; import lombok.Data; import lombok.experimental.Accessors; diff --git a/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/order/TradeOrderRpc.java b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/order/TradeOrderRpc.java new file mode 100644 index 000000000..518ac08e7 --- /dev/null +++ b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/order/TradeOrderRpc.java @@ -0,0 +1,19 @@ +package cn.iocoder.mall.tradeservice.rpc.order; + +import cn.iocoder.common.framework.vo.CommonResult; +import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderCreateReqDTO; + +/** + * 交易订单 Rpc 接口 + */ +public interface TradeOrderRpc { + + /** + * 创建交易订单 + * + * @param createReqDTO 订单信息 + * @return 订单编号 + */ + CommonResult createTradeOrder(TradeOrderCreateReqDTO createReqDTO); + +} diff --git a/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/order/dto/TradeOrderCreateReqDTO.java b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/order/dto/TradeOrderCreateReqDTO.java new file mode 100644 index 000000000..78f7f0deb --- /dev/null +++ b/trade-service-project/trade-service-api/src/main/java/cn/iocoder/mall/tradeservice/rpc/order/dto/TradeOrderCreateReqDTO.java @@ -0,0 +1,69 @@ +package cn.iocoder.mall.tradeservice.rpc.order.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * 交易订单创建 Request DTO + * + * @author Sin + * @time 2019-03-16 14:42 + */ +@Data +@Accessors(chain = true) +public class TradeOrderCreateReqDTO implements Serializable { + + /** + * 用户编号 + */ + @NotNull(message = "用户编号不能为空") + private Integer userId; + /** + * 用户 IP + */ + @NotNull(message = "用户 IP 不能为空") + private String ip; + /** + * 收件地址编号 + */ + @NotNull(message = "用户地址不能为空") + private Integer userAddressId; + /** + * 优惠劵编号 + */ + private Integer couponCardId; + /** + * 备注 + */ + private String remark; + + /** + * 订单商品项列表 + */ + @NotNull(message = "必须选择购买的商品") + private List orderItems; + + + @Data + @Accessors(chain = true) + public static class OrderItem implements Serializable { + + /** + * 商品编号 + */ + @NotNull(message = "商品 SKU 编号不能为空") + private Integer skuId; + /** + * 数量 + */ + @NotNull(message = "商品 SKU 购买数量不能为空") + @Min(value = 1, message = "商品 SKU 购买数量必须大于 0") + private Integer quantity; + } + +} diff --git a/order-service-project/order-service-app/pom.xml b/trade-service-project/trade-service-app/pom.xml similarity index 82% rename from order-service-project/order-service-app/pom.xml rename to trade-service-project/trade-service-app/pom.xml index 2d6efb0c0..cb48a90b6 100644 --- a/order-service-project/order-service-app/pom.xml +++ b/trade-service-project/trade-service-app/pom.xml @@ -3,13 +3,13 @@ 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"> - order-service-project + trade-service-project cn.iocoder.mall 1.0-SNAPSHOT 4.0.0 - order-service-app + trade-service-app @@ -24,6 +24,13 @@ ${project.version} + + + cn.iocoder.mall + user-service-api + 1.0-SNAPSHOT + + cn.iocoder.mall @@ -34,7 +41,14 @@ cn.iocoder.mall - order-service-api + trade-service-api + + + + + cn.iocoder.mall + promotion-service-api + 1.0-SNAPSHOT @@ -102,6 +116,13 @@ aspectjweaver 1.9.6 + + + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/OrderServiceApplication.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/TradeServiceApplication.java similarity index 59% rename from order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/OrderServiceApplication.java rename to trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/TradeServiceApplication.java index dd7635638..8dc4f8733 100644 --- a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/OrderServiceApplication.java +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/TradeServiceApplication.java @@ -1,13 +1,13 @@ -package cn.iocoder.mall.orderservice; +package cn.iocoder.mall.tradeservice; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication -public class OrderServiceApplication { +public class TradeServiceApplication { public static void main(String[] args) { - SpringApplication.run(OrderServiceApplication.class, args); + SpringApplication.run(TradeServiceApplication.class, args); } } diff --git a/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/product/ProductSkuClient.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/product/ProductSkuClient.java new file mode 100644 index 000000000..88b2c9fe3 --- /dev/null +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/product/ProductSkuClient.java @@ -0,0 +1,32 @@ +package cn.iocoder.mall.tradeservice.client.product; + +import cn.iocoder.common.framework.util.CollectionUtils; +import cn.iocoder.common.framework.vo.CommonResult; +import cn.iocoder.mall.productservice.rpc.sku.ProductSkuRpc; +import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuListQueryReqDTO; +import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuRespDTO; +import org.apache.dubbo.config.annotation.DubboReference; +import org.springframework.stereotype.Service; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +@Service +public class ProductSkuClient { + + @DubboReference(version = "${dubbo.consumer.ProductSkuRpc.version}") + private ProductSkuRpc productSkuRpc; + + public List listProductSkus(Collection productSkuIds, String... fields) { + if (CollectionUtils.isEmpty(productSkuIds)) { + return Collections.emptyList(); + } + CommonResult> listProductSkusResult = productSkuRpc.listProductSkus( + new ProductSkuListQueryReqDTO().setProductSkuIds(productSkuIds).setFields(Arrays.asList(fields))); + listProductSkusResult.checkError(); + return listProductSkusResult.getData(); + } + +} diff --git a/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/promotion/CouponCardClient.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/promotion/CouponCardClient.java new file mode 100644 index 000000000..cf6b3dcb2 --- /dev/null +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/promotion/CouponCardClient.java @@ -0,0 +1,21 @@ +package cn.iocoder.mall.tradeservice.client.promotion; + +import cn.iocoder.common.framework.vo.CommonResult; +import cn.iocoder.mall.promotion.api.rpc.coupon.CouponCardRpc; +import cn.iocoder.mall.promotion.api.rpc.coupon.dto.card.CouponCardUseReqDTO; +import org.apache.dubbo.config.annotation.DubboReference; +import org.springframework.stereotype.Service; + +@Service +public class CouponCardClient { + + @DubboReference(version = "${dubbo.consumer.CouponCardRpc.version}") + private CouponCardRpc couponCardRpc; + + public void useCouponCard(Integer userId, Integer couponCardId) { + CommonResult useCouponCardResult = couponCardRpc.useCouponCard(new CouponCardUseReqDTO() + .setUserId(userId).setCouponCardId(couponCardId)); + useCouponCardResult.checkError(); + } + +} diff --git a/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/promotion/PriceClient.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/promotion/PriceClient.java new file mode 100644 index 000000000..5e354c0d2 --- /dev/null +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/promotion/PriceClient.java @@ -0,0 +1,34 @@ +package cn.iocoder.mall.tradeservice.client.promotion; + +import cn.iocoder.common.framework.vo.CommonResult; +import cn.iocoder.mall.promotion.api.rpc.price.PriceRpc; +import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcReqDTO; +import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcRespDTO; +import org.apache.dubbo.config.annotation.DubboReference; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class PriceClient { + + @DubboReference(version = "${dubbo.consumer.PriceRpc.version}") + private PriceRpc priceRpc; + + /** + * 计算商品们的价格 + * + * @param userId 用户编号 + * @param items 商品 SKU 集合 + * @param couponCardId 优惠劵编号,允许为空 + * @return 价格 + */ + public PriceProductCalcRespDTO calcProductPrice(Integer userId, List items, + Integer couponCardId) { + CommonResult calcProductPriceResult = priceRpc.calcProductPrice( + new PriceProductCalcReqDTO().setUserId(userId).setItems(items).setCouponCardId(couponCardId)); + calcProductPriceResult.checkError(); + return calcProductPriceResult.getData(); + } + +} diff --git a/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/user/UserAddressClient.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/user/UserAddressClient.java new file mode 100644 index 000000000..c1cf7992b --- /dev/null +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/client/user/UserAddressClient.java @@ -0,0 +1,28 @@ +package cn.iocoder.mall.tradeservice.client.user; + +import cn.iocoder.common.framework.vo.CommonResult; +import cn.iocoder.mall.userservice.rpc.address.UserAddressRpc; +import cn.iocoder.mall.userservice.rpc.address.dto.UserAddressRespDTO; +import org.apache.dubbo.config.annotation.DubboReference; +import org.springframework.stereotype.Service; + +import java.util.Objects; + +@Service +public class UserAddressClient { + + @DubboReference(version = "${dubbo.consumer.UserAddressRpc.version}") + private UserAddressRpc userAddressRpc; + + public UserAddressRespDTO getUserAddress(Integer userAddressId, Integer userId) { + CommonResult getUserAddressResult = userAddressRpc.getUserAddress(userAddressId); + getUserAddressResult.checkError(); + if (getUserAddressResult.getData() == null) { + return null; + } + // 如果用户编号不匹配,则返回 null + return Objects.equals(getUserAddressResult.getData().getUserId(), userId) ? + getUserAddressResult.getData() : null; + } + +} diff --git a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/config/AopConfiguration.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/config/AopConfiguration.java similarity index 86% rename from order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/config/AopConfiguration.java rename to trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/config/AopConfiguration.java index ae4d9199a..7e905a58e 100644 --- a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/config/AopConfiguration.java +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/config/AopConfiguration.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.orderservice.config; +package cn.iocoder.mall.tradeservice.config; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.EnableAspectJAutoProxy; diff --git a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/config/DatabaseConfiguration.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/config/DatabaseConfiguration.java similarity index 89% rename from order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/config/DatabaseConfiguration.java rename to trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/config/DatabaseConfiguration.java index 4e91f4b69..99f71b602 100644 --- a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/config/DatabaseConfiguration.java +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/config/DatabaseConfiguration.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.orderservice.config; +package cn.iocoder.mall.tradeservice.config; import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector; import com.baomidou.mybatisplus.core.injector.ISqlInjector; @@ -9,7 +9,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.transaction.annotation.EnableTransactionManagement; @Configuration -@MapperScan("cn.iocoder.mall.orderservice.dal.mysql.mapper") // 扫描对应的 Mapper 接口 +@MapperScan("cn.iocoder.mall.tradeservice.dal.mysql.mapper") // 扫描对应的 Mapper 接口 @EnableTransactionManagement(proxyTargetClass = true) // 启动事务管理。 public class DatabaseConfiguration { diff --git a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/convert/cart/CartConvert.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/convert/cart/CartConvert.java similarity index 50% rename from order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/convert/cart/CartConvert.java rename to trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/convert/cart/CartConvert.java index 913ab20bb..5495d835c 100644 --- a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/convert/cart/CartConvert.java +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/convert/cart/CartConvert.java @@ -1,12 +1,12 @@ -package cn.iocoder.mall.orderservice.convert.cart; +package cn.iocoder.mall.tradeservice.convert.cart; -import cn.iocoder.mall.orderservice.dal.mysql.dataobject.cart.CartItemDO; -import cn.iocoder.mall.orderservice.rpc.cart.dto.CartItemAddReqDTO; -import cn.iocoder.mall.orderservice.rpc.cart.dto.CartItemListReqDTO; -import cn.iocoder.mall.orderservice.rpc.cart.dto.CartItemRespDTO; -import cn.iocoder.mall.orderservice.service.cart.bo.CartItemAddBO; -import cn.iocoder.mall.orderservice.service.cart.bo.CartItemBO; -import cn.iocoder.mall.orderservice.service.cart.bo.CartItemListQueryBO; +import cn.iocoder.mall.tradeservice.dal.mysql.dataobject.cart.CartItemDO; +import cn.iocoder.mall.tradeservice.rpc.cart.dto.CartItemAddReqDTO; +import cn.iocoder.mall.tradeservice.rpc.cart.dto.CartItemListReqDTO; +import cn.iocoder.mall.tradeservice.rpc.cart.dto.CartItemRespDTO; +import cn.iocoder.mall.tradeservice.service.cart.bo.CartItemAddBO; +import cn.iocoder.mall.tradeservice.service.cart.bo.CartItemBO; +import cn.iocoder.mall.tradeservice.service.cart.bo.CartItemListQueryBO; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; diff --git a/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/aftersale/AfterSaleOrderDO.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/aftersale/AfterSaleOrderDO.java new file mode 100644 index 000000000..a607f7e5a --- /dev/null +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/aftersale/AfterSaleOrderDO.java @@ -0,0 +1,160 @@ +package cn.iocoder.mall.tradeservice.dal.mysql.dataobject.aftersale; + +import cn.iocoder.mall.mybatis.core.dataobject.DeletableDO; +import cn.iocoder.mall.tradeservice.dal.mysql.dataobject.order.TradeOrderDO; +import cn.iocoder.mall.tradeservice.dal.mysql.dataobject.order.TradeOrderItemDO; +import cn.iocoder.mall.tradeservice.enums.aftersale.AfterSaleTypeEnum; +import cn.iocoder.mall.tradeservice.enums.aftersale.AfterSaleWayEnum; +import cn.iocoder.mall.tradeservice.enums.logistics.LogisticsDeliveryTypeEnum; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.util.Date; + +/** + * 售后订单,用于处理 {@link TradeOrderDO} 交易订单的退货换流程 + * + * TODO 超时机制 + * TODO 用户(买家)和商家每一个步骤,都需要记录协商记录,多设计一个表 + */ +@TableName(value = "after_sale_order") +@Data +@EqualsAndHashCode(callSuper = true) +@Accessors(chain = true) +public class AfterSaleOrderDO extends DeletableDO { + + /** + * 售后订单编号 + */ + private Integer id; + /** + * 售后状态 + */ + private Integer status; + /** + * 用户编号 + */ + private Integer userId; + /** + * 用户手机 + */ + private String userMobile; + /** + * 售后类型 + * + * 枚举 {@link AfterSaleTypeEnum} + */ + private Integer type; + /** + * 售后方式 + * + * 枚举 {@link AfterSaleWayEnum} + */ + private Integer way; + /** + * 货物状态,是否收到货 + */ + private Boolean logisticsReceived; + /** + * 用户售后原因 + * + * TODO 不同情况下的退款,原因不同 + */ + private Integer reasonType; + /** + * 用户售后说明 + */ + private String reasonMemo; + /** + * 用户售后凭证图片的地址数组 + * + * 数组,以逗号分隔 + */ + private String reasonPicUrls; + /** + * 商家拒绝理由 + */ + private String rejectReasonMemo; + + // ========== 交易订单相关 ========== + /** + * 交易订单编号 + * + * 外键 {@link TradeOrderDO#getId()} + */ + private Integer tradeOrderId; + /** + * 交易订单项编号 + * + * 外键 {@link TradeOrderItemDO#getId()} + */ + private Integer tradeOrderItemId; + /** + * 商品 SKU 编号 + */ + private Integer skuId; + /** + * 商品数量 + */ + private Integer quantity; + + // ========== 退款相关 ========== + /** + * 退款金额,单位:分。 + */ + private Integer refundPrice; + + // ========== 退货相关 ========== + /** + * 退货地址,即商家的收件地址 + */ + private String returnDetailAddress; + /** + * 退货物流公司编号 + * + * 使用 DataDict 数据字典 EXPRESS + */ + private String returnLogisticsExpressId; + /** + * 退货物流单号 + */ + private String returnLogisticsExpressNo; + /** + * 退货物流说明 + */ + private String returnLogisticsReasonMemo; + /** + * 退货物流凭证图片的地址数组 + * + * 数组,以逗号分隔 + */ + private String returnLogisticsPicUrls; + /** + * 退货物流的填写时间 + */ + private Date returnLogisticsDate; + + // ========== 换货相关 ========== + /** + * 换货物流的配送方式 + * 这里指的是商家重新给用户(买家)发货 + * + * 枚举 {@link LogisticsDeliveryTypeEnum} + */ + private Integer exchangeLogisticsDeliveryType; + /** + * 换货物流公司编号 + */ + private Integer exchangeLogisticsExpressId; + /** + * 换货物流公司单号 + */ + private String exchangeLogisticsExpressNo; + /** + * 换货物流的填写时间 + */ + private Date exchangeLogisticsDate; + +} diff --git a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/dal/mysql/dataobject/cart/CartItemDO.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/cart/CartItemDO.java similarity index 95% rename from order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/dal/mysql/dataobject/cart/CartItemDO.java rename to trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/cart/CartItemDO.java index 8b9f447cb..48103dc77 100644 --- a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/dal/mysql/dataobject/cart/CartItemDO.java +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/cart/CartItemDO.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.orderservice.dal.mysql.dataobject.cart; +package cn.iocoder.mall.tradeservice.dal.mysql.dataobject.cart; import cn.iocoder.mall.mybatis.core.dataobject.DeletableDO; import com.baomidou.mybatisplus.annotation.TableName; diff --git a/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderPreferentialDO.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/OrderPreferentialDO.java similarity index 80% rename from moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderPreferentialDO.java rename to trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/OrderPreferentialDO.java index b7b06cf42..eb07c2aea 100644 --- a/moved/order/order-service-impl/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderPreferentialDO.java +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/OrderPreferentialDO.java @@ -1,7 +1,9 @@ -package cn.iocoder.mall.order.biz.dataobject; +package cn.iocoder.mall.tradeservice.dal.mysql.dataobject.order; /** * 订单优惠明细 + * + * 可参考 https://jos.jd.com/apilist?apiGroupId=55&apiId=16757&apiName=jingdong.pop.order.coupondetail */ // TODO 芋艿 后续在完善 public class OrderPreferentialDO { diff --git a/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/TradeOrderDO.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/TradeOrderDO.java new file mode 100644 index 000000000..ce365fb17 --- /dev/null +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/TradeOrderDO.java @@ -0,0 +1,154 @@ +package cn.iocoder.mall.tradeservice.dal.mysql.dataobject.order; + +import cn.iocoder.mall.mybatis.core.dataobject.DeletableDO; +import cn.iocoder.mall.tradeservice.enums.logistics.LogisticsDeliveryTypeEnum; +import cn.iocoder.mall.tradeservice.enums.order.TradeOrderAfterSaleStatusEnum; +import cn.iocoder.mall.tradeservice.enums.order.TradeOrderStatusEnum; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.util.Date; + +/** + * 交易订单 + * + * idx_userId 索引:基于 {@link #userId} 字段 + * + * @author Sin + * @time 2019-03-16 13:49 + */ +@TableName(value = "trade_order") +@Data +@EqualsAndHashCode(callSuper = true) +@Accessors(chain = true) +public class TradeOrderDO extends DeletableDO { + + // ========== 订单基本信息 ========== + /** + * 订单编号(主键) + */ + private Integer id; + /** + * 用户编号 + */ + private Integer userId; + /** + * 订单编号(业务) + */ + private String orderNo; + /** + * 订单状态。 + * 如果有多个商品分开发货,需要全部商品发完才会改变状态 + * + * 枚举 {@link TradeOrderStatusEnum} + */ + private Integer orderStatus; + /** + * 备注 + */ + private String remark; + /** + * 订单结束时间 + * + * 即交易订单状态变成 {@link TradeOrderStatusEnum#COMPLETED} 和 {@link TradeOrderStatusEnum#CLOSED} 的时间 + */ + private Date endTime; + + // ========== 价格 + 支付基本信息 ========== + /** + * 购买(商品)总金额,单位:分 + */ + private Integer buyPrice; + /** + * 优惠总金额,单位:分。 + */ + private Integer discountPrice; + /** + * 物流金额 (分) + */ + private Integer logisticsPrice; + /** + * 最终金额,单位:分 + * + * buyPrice + logisticsPrice - discountPrice = presentPrice + */ + private Integer presentPrice; + /** + * 实际已支付金额,单位:分 + * + * 初始时,金额为 0 。等到支付成功后,会进行更新。 + */ + private Integer payPrice; + /** + * 退款金额,单位:分 + * + * 注意,退款并不会影响 {@link #payPrice} 实际支付金额 + * 也就说,一个订单最终产生多少金额的收入 = payPrice - refundPrice + */ + private Integer refundPrice; + /** + * 付款时间 + */ + private Date payTime; + /** + * 支付订单编号 + * + * 对接 pay-service 支付服务的支付订单编号 + */ + private Integer payTransactionId; + /** + * 支付成功的支付渠道 + */ + private Integer payChannel; + + // ========== 收件 + 物流基本信息 ========== + /** + * 配送类型 + * + * 枚举 {@link LogisticsDeliveryTypeEnum} + */ + private Integer deliveryType; + /** + * 发货时间 + */ + private Date deliveryTime; + /** + * 收货时间 + */ + private Date receiveTime; + /** + * 收件人名称 + */ + private String receiverName; + /** + * 收件人手机 + */ + private String receiverMobile; + /** + * 收件人地区编码 + */ + private Integer receiverAreaCode; + /** + * 收件人详细地址 + */ + private String receiverDetailAddress; + + // ========== 售后基本信息 ========== + /** + * 售后状态 + * + * 枚举 {@link TradeOrderAfterSaleStatusEnum} + */ + private Integer afterSaleStatus; + + // ========== 营销基本信息 ========== + /** + * 优惠劵编号 + */ + private Integer couponCardId; + + // TODO 芋艿,这块还要结合营销和价格计算,在去优化下。 + +} diff --git a/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderItemDO.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/TradeOrderItemDO.java similarity index 56% rename from order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderItemDO.java rename to trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/TradeOrderItemDO.java index afb2365ca..4d9d272a1 100644 --- a/order/order-biz/src/main/java/cn/iocoder/mall/order/biz/dataobject/OrderItemDO.java +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/TradeOrderItemDO.java @@ -1,20 +1,29 @@ -package cn.iocoder.mall.order.biz.dataobject; +package cn.iocoder.mall.tradeservice.dal.mysql.dataobject.order; import cn.iocoder.mall.mybatis.core.dataobject.DeletableDO; -import java.util.Date; +import cn.iocoder.mall.tradeservice.dal.mysql.dataobject.aftersale.AfterSaleOrderDO; +import cn.iocoder.mall.tradeservice.enums.order.TradeOrderAfterSaleStatusEnum; +import cn.iocoder.mall.tradeservice.enums.order.TradeOrderStatusEnum; +import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; /** - * 订单 item + * 交易订单的商品项,主要是商品信息等等 + * + * idx_orderId 索引:基于 {@link #orderId} 字段 * * @author Sin * @time 2019-03-16 14:03 */ +@TableName(value = "trade_order_item") @Data @Accessors(chain = true) -public class OrderItemDO extends DeletableDO { +@EqualsAndHashCode(callSuper = true) +public class TradeOrderItemDO extends DeletableDO { + // ========== 订单项基本信息 ========== /** * 编号 */ @@ -24,17 +33,21 @@ public class OrderItemDO extends DeletableDO { */ private Integer orderId; /** - * 订单号 + * 订单项状态 + * + * 枚举 {@link TradeOrderStatusEnum} */ - private String orderNo; + private Integer status; + + // ========== 商品基本信息 ========== /** - * 商品编号 + * 商品 SPU 编号 + */ + private Integer spuId; + /** + * 商品 SKU 编号 */ private Integer skuId; - /** - * 物流id - */ - private Integer orderLogisticsId; /** * 商品名称 */ @@ -44,9 +57,11 @@ public class OrderItemDO extends DeletableDO { */ private String skuImage; /** - * 数量 + * 购买数量 */ private Integer quantity; + + // ========== 价格 + 支付基本信息 ========== /** * 原始单价,单位:分。 */ @@ -56,7 +71,7 @@ public class OrderItemDO extends DeletableDO { */ private Integer buyPrice; /** - * 最终价格,单位:分。 + * 最终单价,单位:分。 */ private Integer presentPrice; /** @@ -87,57 +102,32 @@ public class OrderItemDO extends DeletableDO { // discountTotal ,假设有满减送(分组优惠)满 20 减 10 ,并且使用优惠劵满 1.01 减 1 ,则 discountTotal = 10 + 1 = 11 // presentTotal = buyTotal - discountTotal = 24 - 11 = 13 // 最终 presentPrice = presentTotal / quantity = 13 / 3 = 4.33 - - /// - /// 时间信息 - /** - * 付款时间 + * 退款总金额,单位:分 */ - private Date paymentTime; - /** - * 发货时间 - */ - private Date deliveryTime; - /** - * 收货时间 - */ - private Date receiverTime; - /** - * 成交时间 - */ - private Date closingTime; - - /// - /// 其他 + private Integer refundTotal; + // TODO 芋艿:退款单和这个的关联。例如说,一个子单可以退款多次;需要额外新增表 + // ========== 物流基本信息 ========== /** - * 是否退货 + * 物流编号 * - * - 1、没有 - * - 2、换货 - * - 3、退货 - * - 4、换货 + 退货 + * 外键 {@link TradeOrderLogisticsDO#getId()} */ - private Integer hasReturnExchange; + private Integer logisticsId; + + // ========== 售后基本信息 ========== /** - * 发货方式 + * 售后状态 * - * - 1 未选择 - * - 2 在线下单 - * - 3 自己联系快递 - * - 4 无物流 + * 枚举 {@link TradeOrderAfterSaleStatusEnum} */ - private Integer deliveryType; + private Integer afterSaleStatus; /** - * 状态 + * 售后订单编号 * - * - 1、待付款 - * - 2、待发货 - * - 3、已发货 - * - 4、已完成 - * - 5、已关闭 + * 外键 {@link AfterSaleOrderDO#getId()} */ - private Integer status; + private Integer afterSaleOrderId; } diff --git a/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/TradeOrderLogisticsDO.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/TradeOrderLogisticsDO.java new file mode 100644 index 000000000..87f85d455 --- /dev/null +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/dataobject/order/TradeOrderLogisticsDO.java @@ -0,0 +1,72 @@ +package cn.iocoder.mall.tradeservice.dal.mysql.dataobject.order; + +import cn.iocoder.mall.mybatis.core.dataobject.DeletableDO; +import cn.iocoder.mall.tradeservice.enums.logistics.LogisticsDeliveryTypeEnum; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * 交易订单的物流信息 + */ +@TableName(value = "logistics_order") +@Data +@EqualsAndHashCode(callSuper = true) +@Accessors(chain = true) +public class TradeOrderLogisticsDO extends DeletableDO { + + /** + * 物流订单号 + */ + private Integer id; + /** + * 配送类型 + * + * 枚举 {@link LogisticsDeliveryTypeEnum} + */ + private Integer deliveryType; + /** + * 物流公司编号 + * + * 使用 DataDict 数据字典 EXPRESS + */ + private Integer expressId; + /** + * 物流公司单号 + */ + private String expressNo; + /** + * 交易订单号 + * + * 外键 {@link TradeOrderDO#getId()} + */ + private Integer tradeOrderId; + /** + * 商品列表 + */ + @TableField(typeHandler = FastjsonTypeHandler.class) + private List items; + + /** + * 商品项 + */ + @Data + public static class Item { + + /** + * 商品 SKU 编号 + */ + private Integer skuId; + /** + * 数量 + */ + private Integer quantity; + + } + +} diff --git a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/dal/mysql/mapper/cart/CartItemMapper.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/mapper/cart/CartItemMapper.java similarity index 90% rename from order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/dal/mysql/mapper/cart/CartItemMapper.java rename to trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/mapper/cart/CartItemMapper.java index 361a5d286..81973aac0 100644 --- a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/dal/mysql/mapper/cart/CartItemMapper.java +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/mapper/cart/CartItemMapper.java @@ -1,8 +1,8 @@ -package cn.iocoder.mall.orderservice.dal.mysql.mapper.cart; +package cn.iocoder.mall.tradeservice.dal.mysql.mapper.cart; import cn.iocoder.mall.mybatis.core.query.QueryWrapperX; -import cn.iocoder.mall.orderservice.dal.mysql.dataobject.cart.CartItemDO; -import cn.iocoder.mall.orderservice.service.cart.bo.CartItemListQueryBO; +import cn.iocoder.mall.tradeservice.dal.mysql.dataobject.cart.CartItemDO; +import cn.iocoder.mall.tradeservice.service.cart.bo.CartItemListQueryBO; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Param; diff --git a/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/mapper/order/TradeOrderItemMapper.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/mapper/order/TradeOrderItemMapper.java new file mode 100644 index 000000000..8a351b4d3 --- /dev/null +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/mapper/order/TradeOrderItemMapper.java @@ -0,0 +1,17 @@ +package cn.iocoder.mall.tradeservice.dal.mysql.mapper.order; + +import cn.iocoder.mall.tradeservice.dal.mysql.dataobject.order.TradeOrderItemDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository +public interface TradeOrderItemMapper extends BaseMapper { + + // TODO 芋艿:后续重构到基础库去支持 + default void insertList(List entities) { + entities.forEach(this::insert); + } + +} diff --git a/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/mapper/order/TradeOrderMapper.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/mapper/order/TradeOrderMapper.java new file mode 100644 index 000000000..36918f457 --- /dev/null +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/dal/mysql/mapper/order/TradeOrderMapper.java @@ -0,0 +1,9 @@ +package cn.iocoder.mall.tradeservice.dal.mysql.mapper.order; + +import cn.iocoder.mall.tradeservice.dal.mysql.dataobject.order.TradeOrderDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +@Repository +public interface TradeOrderMapper extends BaseMapper { +} diff --git a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/CartRpcImpl.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/CartRpcImpl.java similarity index 88% rename from order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/CartRpcImpl.java rename to trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/CartRpcImpl.java index 491e9211f..917a982bf 100644 --- a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/rpc/cart/CartRpcImpl.java +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/rpc/cart/CartRpcImpl.java @@ -1,8 +1,8 @@ -package cn.iocoder.mall.orderservice.rpc.cart; +package cn.iocoder.mall.tradeservice.rpc.cart; import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.orderservice.manager.cart.CartManager; -import cn.iocoder.mall.orderservice.rpc.cart.dto.*; +import cn.iocoder.mall.tradeservice.service.cart.CartManager; +import cn.iocoder.mall.tradeservice.rpc.cart.dto.*; import org.apache.dubbo.config.annotation.DubboService; import org.springframework.beans.factory.annotation.Autowired; @@ -10,6 +10,9 @@ import java.util.List; import static cn.iocoder.common.framework.vo.CommonResult.success; +/** + * 购物车 Rpc 实现 + */ @DubboService public class CartRpcImpl implements CartRpc { diff --git a/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/rpc/order/TradeOrderRpcImpl.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/rpc/order/TradeOrderRpcImpl.java new file mode 100644 index 000000000..0e0f00bc4 --- /dev/null +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/rpc/order/TradeOrderRpcImpl.java @@ -0,0 +1,25 @@ +package cn.iocoder.mall.tradeservice.rpc.order; + +import cn.iocoder.common.framework.vo.CommonResult; +import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderCreateReqDTO; +import cn.iocoder.mall.tradeservice.service.order.TradeOrderService; +import org.apache.dubbo.config.annotation.DubboService; +import org.springframework.beans.factory.annotation.Autowired; + +import static cn.iocoder.common.framework.vo.CommonResult.success; + +/** + * 交易订单 Rpc 实现 + */ +@DubboService +public class TradeOrderRpcImpl implements TradeOrderRpc { + + @Autowired + private TradeOrderService tradeOrderService; + + @Override + public CommonResult createTradeOrder(TradeOrderCreateReqDTO createReqDTO) { + return success(tradeOrderService.createTradeOrder(createReqDTO)); + } + +} diff --git a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/manager/cart/CartManager.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/service/cart/CartManager.java similarity index 91% rename from order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/manager/cart/CartManager.java rename to trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/service/cart/CartManager.java index 1c4f3bbfd..5fd12bebc 100644 --- a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/manager/cart/CartManager.java +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/service/cart/CartManager.java @@ -1,12 +1,12 @@ -package cn.iocoder.mall.orderservice.manager.cart; +package cn.iocoder.mall.tradeservice.service.cart; import cn.iocoder.common.framework.enums.CommonStatusEnum; import cn.iocoder.common.framework.exception.util.ServiceExceptionUtil; import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.orderservice.convert.cart.CartConvert; -import cn.iocoder.mall.orderservice.rpc.cart.dto.*; -import cn.iocoder.mall.orderservice.service.cart.CartService; -import cn.iocoder.mall.orderservice.service.cart.bo.CartItemBO; +import cn.iocoder.mall.tradeservice.convert.cart.CartConvert; +import cn.iocoder.mall.tradeservice.rpc.cart.dto.*; +import cn.iocoder.mall.tradeservice.service.cart.CartService; +import cn.iocoder.mall.tradeservice.service.cart.bo.CartItemBO; import cn.iocoder.mall.productservice.rpc.sku.ProductSkuRpc; import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuRespDTO; import org.apache.dubbo.config.annotation.DubboReference; @@ -15,7 +15,7 @@ import org.springframework.stereotype.Service; import java.util.List; -import static cn.iocoder.mall.orderservice.enums.OrderErrorCodeConstants.CARD_ITEM_SKU_NOT_FOUND; +import static cn.iocoder.mall.tradeservice.enums.OrderErrorCodeConstants.CARD_ITEM_SKU_NOT_FOUND; /** * 购物车 Manager diff --git a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/service/cart/CartService.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/service/cart/CartService.java similarity index 89% rename from order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/service/cart/CartService.java rename to trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/service/cart/CartService.java index 3d4470c15..056834cfa 100644 --- a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/service/cart/CartService.java +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/service/cart/CartService.java @@ -1,13 +1,13 @@ -package cn.iocoder.mall.orderservice.service.cart; +package cn.iocoder.mall.tradeservice.service.cart; import cn.iocoder.common.framework.exception.util.ServiceExceptionUtil; import cn.iocoder.common.framework.util.CollectionUtils; -import cn.iocoder.mall.orderservice.convert.cart.CartConvert; -import cn.iocoder.mall.orderservice.dal.mysql.dataobject.cart.CartItemDO; -import cn.iocoder.mall.orderservice.dal.mysql.mapper.cart.CartItemMapper; -import cn.iocoder.mall.orderservice.service.cart.bo.CartItemAddBO; -import cn.iocoder.mall.orderservice.service.cart.bo.CartItemBO; -import cn.iocoder.mall.orderservice.service.cart.bo.CartItemListQueryBO; +import cn.iocoder.mall.tradeservice.convert.cart.CartConvert; +import cn.iocoder.mall.tradeservice.dal.mysql.dataobject.cart.CartItemDO; +import cn.iocoder.mall.tradeservice.dal.mysql.mapper.cart.CartItemMapper; +import cn.iocoder.mall.tradeservice.service.cart.bo.CartItemAddBO; +import cn.iocoder.mall.tradeservice.service.cart.bo.CartItemBO; +import cn.iocoder.mall.tradeservice.service.cart.bo.CartItemListQueryBO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; @@ -16,8 +16,8 @@ import javax.validation.Valid; import java.util.Collection; import java.util.List; -import static cn.iocoder.mall.orderservice.enums.OrderErrorCodeConstants.CARD_ITEM_NOT_FOUND; -import static cn.iocoder.mall.orderservice.enums.OrderErrorCodeConstants.CARD_ITEM_SKU_QUANTITY_NOT_ENOUGH; +import static cn.iocoder.mall.tradeservice.enums.OrderErrorCodeConstants.CARD_ITEM_NOT_FOUND; +import static cn.iocoder.mall.tradeservice.enums.OrderErrorCodeConstants.CARD_ITEM_SKU_QUANTITY_NOT_ENOUGH; /** * 购物车 Service diff --git a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/service/cart/bo/CartItemAddBO.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/service/cart/bo/CartItemAddBO.java similarity index 93% rename from order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/service/cart/bo/CartItemAddBO.java rename to trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/service/cart/bo/CartItemAddBO.java index ce0642c29..20cc4c1c0 100644 --- a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/service/cart/bo/CartItemAddBO.java +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/service/cart/bo/CartItemAddBO.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.orderservice.service.cart.bo; +package cn.iocoder.mall.tradeservice.service.cart.bo; import lombok.Data; import lombok.experimental.Accessors; diff --git a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/service/cart/bo/CartItemBO.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/service/cart/bo/CartItemBO.java similarity index 95% rename from order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/service/cart/bo/CartItemBO.java rename to trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/service/cart/bo/CartItemBO.java index df2061474..d54c7f810 100644 --- a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/service/cart/bo/CartItemBO.java +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/service/cart/bo/CartItemBO.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.orderservice.service.cart.bo; +package cn.iocoder.mall.tradeservice.service.cart.bo; import lombok.Data; import lombok.experimental.Accessors; diff --git a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/service/cart/bo/CartItemListQueryBO.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/service/cart/bo/CartItemListQueryBO.java similarity index 88% rename from order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/service/cart/bo/CartItemListQueryBO.java rename to trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/service/cart/bo/CartItemListQueryBO.java index c94970da1..dc934bc6b 100644 --- a/order-service-project/order-service-app/src/main/java/cn/iocoder/mall/orderservice/service/cart/bo/CartItemListQueryBO.java +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/service/cart/bo/CartItemListQueryBO.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.orderservice.service.cart.bo; +package cn.iocoder.mall.tradeservice.service.cart.bo; import lombok.Data; import lombok.experimental.Accessors; diff --git a/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/service/order/TradeOrderService.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/service/order/TradeOrderService.java new file mode 100644 index 000000000..ce3aee009 --- /dev/null +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/service/order/TradeOrderService.java @@ -0,0 +1,18 @@ +package cn.iocoder.mall.tradeservice.service.order; + +import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderCreateReqDTO; + +/** + * 交易订单 Service 接口 + */ +public interface TradeOrderService { + + /** + * 创建交易订单 + * + * @param createReqDTO 订单信息 + * @return 订单编号 + */ + Integer createTradeOrder(TradeOrderCreateReqDTO createReqDTO); + +} diff --git a/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/service/order/impl/TradeOrderServiceImpl.java b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/service/order/impl/TradeOrderServiceImpl.java new file mode 100644 index 000000000..2df46bd7c --- /dev/null +++ b/trade-service-project/trade-service-app/src/main/java/cn/iocoder/mall/tradeservice/service/order/impl/TradeOrderServiceImpl.java @@ -0,0 +1,175 @@ +package cn.iocoder.mall.tradeservice.service.order.impl; + +import cn.iocoder.common.framework.exception.util.ServiceExceptionUtil; +import cn.iocoder.common.framework.util.CollectionUtils; +import cn.iocoder.common.framework.util.DateUtil; +import cn.iocoder.common.framework.util.MathUtil; +import cn.iocoder.mall.productservice.enums.sku.ProductSkuDetailFieldEnum; +import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuRespDTO; +import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcReqDTO; +import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcRespDTO; +import cn.iocoder.mall.tradeservice.client.product.ProductSkuClient; +import cn.iocoder.mall.tradeservice.client.promotion.CouponCardClient; +import cn.iocoder.mall.tradeservice.client.promotion.PriceClient; +import cn.iocoder.mall.tradeservice.client.user.UserAddressClient; +import cn.iocoder.mall.tradeservice.dal.mysql.dataobject.order.TradeOrderDO; +import cn.iocoder.mall.tradeservice.dal.mysql.dataobject.order.TradeOrderItemDO; +import cn.iocoder.mall.tradeservice.dal.mysql.mapper.order.TradeOrderItemMapper; +import cn.iocoder.mall.tradeservice.dal.mysql.mapper.order.TradeOrderMapper; +import cn.iocoder.mall.tradeservice.enums.logistics.LogisticsDeliveryTypeEnum; +import cn.iocoder.mall.tradeservice.enums.order.TradeOrderAfterSaleStatusEnum; +import cn.iocoder.mall.tradeservice.enums.order.TradeOrderStatusEnum; +import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderCreateReqDTO; +import cn.iocoder.mall.tradeservice.service.order.TradeOrderService; +import cn.iocoder.mall.userservice.rpc.address.dto.UserAddressRespDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +import static cn.iocoder.mall.tradeservice.enums.OrderErrorCodeConstants.*; +import static cn.iocoder.mall.userservice.enums.UserErrorCodeConstants.*; + +/** + * 交易订单 Service 实现 + */ +@Service +public class TradeOrderServiceImpl implements TradeOrderService { + + @Autowired + private TradeOrderMapper tradeOrderMapper; + @Autowired + private TradeOrderItemMapper tradeOrderItemMapper; + + @Autowired // 注入自己,用于调用事务方法 + private TradeOrderServiceImpl self; + + @Autowired + private UserAddressClient userAddressClient; + @Autowired + private ProductSkuClient productSkuClient; + @Autowired + private PriceClient priceClient; + @Autowired + private CouponCardClient couponCardClient; + + @Override +// @GlobalTransactional TODO 芋艿,使用 seata 实现分布式事务 + public Integer createTradeOrder(TradeOrderCreateReqDTO createReqDTO) { + // 获得收件地址 + UserAddressRespDTO userAddressRespDTO = userAddressClient.getUserAddress(createReqDTO.getUserAddressId(), + createReqDTO.getUserId()); + if (userAddressRespDTO == null) { + throw ServiceExceptionUtil.exception(USER_ADDRESS_NOT_FOUND); + } + // 获得商品信息 + List listProductSkus = productSkuClient.listProductSkus( + CollectionUtils.convertSet(createReqDTO.getOrderItems(), TradeOrderCreateReqDTO.OrderItem::getSkuId), + ProductSkuDetailFieldEnum.SPU.getField()); + if (listProductSkus.size() != createReqDTO.getOrderItems().size()) { // 校验获得的数量,是否匹配 + throw ServiceExceptionUtil.exception(ORDER_GET_GOODS_INFO_INCORRECT); + } + // 价格计算 + PriceProductCalcRespDTO priceProductCalcRespDTO = priceClient.calcProductPrice(createReqDTO.getUserId(), + createReqDTO.getOrderItems().stream().map(orderItem -> new PriceProductCalcReqDTO.Item().setSkuId(orderItem.getSkuId()) + .setQuantity(orderItem.getQuantity()).setSelected(true)).collect(Collectors.toList()), + createReqDTO.getCouponCardId()); + + // TODO 芋艿,扣除库存 + + // 标记优惠劵已使用 + if (createReqDTO.getCouponCardId() != null) { + couponCardClient.useCouponCard(createReqDTO.getUserId(), createReqDTO.getCouponCardId()); + } + + // 创建交易订单(本地事务) + Integer tradeOrderId = self.createTradeOrder0(createReqDTO, listProductSkus, priceProductCalcRespDTO, userAddressRespDTO); + + // 创建支付订单,对接支付服务 + createPayTransaction(); + return tradeOrderId; + } + + @Transactional + public Integer createTradeOrder0(TradeOrderCreateReqDTO createReqDTO, List listProductSkus, + PriceProductCalcRespDTO priceProductCalcRespDTO, UserAddressRespDTO userAddressRespDTO) { + // 构建 TradeOrderDO 对象,并进行保存 + TradeOrderDO tradeOrderDO = new TradeOrderDO(); + // 1. 基本信息 + tradeOrderDO.setUserId(createReqDTO.getUserId()).setOrderNo(generateTradeOrderNo()) + .setOrderStatus(TradeOrderStatusEnum.WAITING_PAYMENT.getValue()).setRemark(createReqDTO.getRemark()); + // 2. 价格 + 支付基本信息 + tradeOrderDO.setBuyPrice(priceProductCalcRespDTO.getFee().getBuyTotal()) + .setDiscountPrice(priceProductCalcRespDTO.getFee().getDiscountTotal()) + .setLogisticsPrice(priceProductCalcRespDTO.getFee().getPostageTotal()) + .setPresentPrice(priceProductCalcRespDTO.getFee().getPresentTotal()) + .setPayPrice(0).setRefundPrice(0); + // 3. 收件 + 物流基本信息 + tradeOrderDO.setDeliveryType(LogisticsDeliveryTypeEnum.EXPRESS.getDeliveryType()) + .setReceiverName(userAddressRespDTO.getName()).setReceiverMobile(userAddressRespDTO.getMobile()) + .setReceiverAreaCode(userAddressRespDTO.getAreaCode()).setReceiverDetailAddress(userAddressRespDTO.getDetailAddress()); + // 4. 售后基本信息 + tradeOrderDO.setAfterSaleStatus(TradeOrderAfterSaleStatusEnum.NULL.getStatus()); + // 5. 营销基本信息 + tradeOrderDO.setCouponCardId(createReqDTO.getCouponCardId()); + // 最终保存 + tradeOrderMapper.insert(tradeOrderDO); + + // 创建 TradeOrderItemDO 数组,并进行保存 + List tradeOrderItemDOs = new ArrayList<>(listProductSkus.size()); + Map listProductSkuMap = CollectionUtils.convertMap(listProductSkus, ProductSkuRespDTO::getId); + Map priceItemMap = new HashMap<>(); // 商品 SKU 价格的映射 + priceProductCalcRespDTO.getItemGroups().forEach(itemGroup -> + itemGroup.getItems().forEach(item -> priceItemMap.put(item.getSkuId(), item))); + for (TradeOrderCreateReqDTO.OrderItem orderItem : createReqDTO.getOrderItems()) { + TradeOrderItemDO tradeOrderItemDO = new TradeOrderItemDO(); + tradeOrderItemDOs.add(tradeOrderItemDO); + // 1. 基本信息 + tradeOrderItemDO.setOrderId(tradeOrderDO.getId()).setStatus(tradeOrderDO.getOrderStatus()); + // 2. 商品基本信息 + ProductSkuRespDTO productSkuRespDTO = listProductSkuMap.get(orderItem.getSkuId()); + tradeOrderItemDO.setSpuId(productSkuRespDTO.getSpuId()).setSkuId(productSkuRespDTO.getId()) + .setSkuName(productSkuRespDTO.getSpu().getName()) + .setSkuImage(CollectionUtils.getFirst(productSkuRespDTO.getSpu().getPicUrls())) + .setQuantity(orderItem.getQuantity()); + // 3. 价格 + 支付基本信息 + PriceProductCalcRespDTO.Item priceItem = priceItemMap.get(orderItem.getSkuId()); + tradeOrderItemDO.setOriginPrice(priceItem.getOriginPrice()).setBuyPrice(priceItem.getBuyPrice()) + .setPresentPrice(priceItem.getPresentPrice()).setBuyTotal(priceItem.getBuyTotal()) + .setDiscountTotal(priceItem.getDiscountTotal()).setPresentTotal(priceItem.getPresentTotal()) + .setRefundTotal(0); + // 4. 物流基本信息 + // 5. 售后基本信息 + tradeOrderItemDO.setAfterSaleStatus(TradeOrderAfterSaleStatusEnum.NULL.getStatus()); + } + // 最终保存 + tradeOrderItemMapper.insertList(tradeOrderItemDOs); + + return tradeOrderDO.getId(); + } + + private void createPayTransaction() { + + } + + private String generateTradeOrderNo() { +// wx +// 2014 +// 10 +// 27 +// 20 +// 09 +// 39 +// 5522657 +// a690389285100 + // 目前的算法 + // 时间序列,年月日时分秒 14 位 + // 纯随机,6 位 TODO 此处估计是会有问题的,后续在调整 + return DateUtil.format(new Date(), "yyyyMMddHHmmss") + // 时间序列 + MathUtil.random(100000, 999999) // 随机。为什么是这个范围,因为偷懒 + ; + } + +} diff --git a/order-service-project/order-service-app/src/main/resources/application-dev.yaml b/trade-service-project/trade-service-app/src/main/resources/application-dev.yaml similarity index 84% rename from order-service-project/order-service-app/src/main/resources/application-dev.yaml rename to trade-service-project/trade-service-app/src/main/resources/application-dev.yaml index c571f0544..c0d071890 100644 --- a/order-service-project/order-service-app/src/main/resources/application-dev.yaml +++ b/trade-service-project/trade-service-app/src/main/resources/application-dev.yaml @@ -1,7 +1,7 @@ spring: # 数据源配置项 datasource: - url: jdbc:mysql://400-infra.server.iocoder.cn:3306/mall_order?useSSL=false&useUnicode=true&characterEncoding=UTF-8 + url: jdbc:mysql://400-infra.server.iocoder.cn:3306/mall_trade?useSSL=false&useUnicode=true&characterEncoding=UTF-8 driver-class-name: com.mysql.jdbc.Driver username: root password: 3WLiVUBEwTbvAfsh diff --git a/order-service-project/order-service-app/src/main/resources/application-local.yaml b/trade-service-project/trade-service-app/src/main/resources/application-local.yaml similarity index 75% rename from order-service-project/order-service-app/src/main/resources/application-local.yaml rename to trade-service-project/trade-service-app/src/main/resources/application-local.yaml index 6d315464f..d3b714087 100644 --- a/order-service-project/order-service-app/src/main/resources/application-local.yaml +++ b/trade-service-project/trade-service-app/src/main/resources/application-local.yaml @@ -1,7 +1,7 @@ spring: # 数据源配置项 datasource: - url: jdbc:mysql://400-infra.server.iocoder.cn:3306/mall_order?useSSL=false&useUnicode=true&characterEncoding=UTF-8 + url: jdbc:mysql://400-infra.server.iocoder.cn:3306/mall_trade?useSSL=false&useUnicode=true&characterEncoding=UTF-8 driver-class-name: com.mysql.jdbc.Driver username: root password: 3WLiVUBEwTbvAfsh @@ -12,6 +12,9 @@ spring: discovery: server-addr: 400-infra.server.iocoder.cn:8848 # Nacos 服务器地址 namespace: dev # Nacos 命名空间 +# # Spring 主应用配置 +# main: +# lazy-initialization: true # 开启延迟加载,保证本地开发的性能 # Dubbo 配置项 dubbo: diff --git a/order-service-project/order-service-app/src/main/resources/application.yaml b/trade-service-project/trade-service-app/src/main/resources/application.yaml similarity index 83% rename from order-service-project/order-service-app/src/main/resources/application.yaml rename to trade-service-project/trade-service-app/src/main/resources/application.yaml index 01b683423..a999a53b7 100644 --- a/order-service-project/order-service-app/src/main/resources/application.yaml +++ b/trade-service-project/trade-service-app/src/main/resources/application.yaml @@ -1,7 +1,7 @@ spring: # Application 的配置项 application: - name: order-service + name: trade-service # Profile 的配置项 profiles: active: local @@ -16,7 +16,7 @@ mybatis-plus: logic-delete-value: 1 # 逻辑已删除值(默认为 1) logic-not-delete-value: 0 # 逻辑未删除值(默认为 0) mapper-locations: classpath*:mapper/*.xml - type-aliases-package: cn.iocoder.mall.orderservice.dal.mysql.dataobject + type-aliases-package: cn.iocoder.mall.tradeservice.dal.mysql.dataobject # Dubbo 配置项 dubbo: @@ -29,7 +29,7 @@ dubbo: port: -1 # Dubbo 提供服务的扫描基础包 scan: - base-packages: cn.iocoder.mall.orderservice.rpc + base-packages: cn.iocoder.mall.tradeservice.rpc # Dubbo 服务提供者的配置 provider: filter: -exception @@ -41,6 +41,12 @@ dubbo: version: 1.0.0 ProductSkuRpc: version: 1.0.0 + UserAddressRpc: + version: 1.0.0 + PriceRpc: + version: 1.0.0 + CouponCardRpc: + version: 1.0.0 # RocketMQ 配置项 rocketmq: @@ -59,4 +65,4 @@ mall: # 错误码配置项对应 ErrorCodeProperties 配置类 error-code: group: ${spring.application.name} - constants-class: cn.iocoder.mall.orderservice.enums.OrderErrorCodeConstants + constants-class: cn.iocoder.mall.tradeservice.enums.OrderErrorCodeConstants diff --git a/trade-service-project/trade-service-integration-test/pom.xml b/trade-service-project/trade-service-integration-test/pom.xml new file mode 100644 index 000000000..803cdda90 --- /dev/null +++ b/trade-service-project/trade-service-integration-test/pom.xml @@ -0,0 +1,29 @@ + + + + trade-service-project + cn.iocoder.mall + 1.0-SNAPSHOT + + 4.0.0 + + trade-service-integration-test + + + + cn.iocoder.mall + trade-service-app + 1.0-SNAPSHOT + + + + + org.springframework.boot + spring-boot-starter-test + test + + + + diff --git a/trade-service-project/trade-service-integration-test/src/test/java/cn/iocoder/mall/tradeservice/service/order/impl/TradeOrderServiceImplTest.java b/trade-service-project/trade-service-integration-test/src/test/java/cn/iocoder/mall/tradeservice/service/order/impl/TradeOrderServiceImplTest.java new file mode 100644 index 000000000..bde384ae2 --- /dev/null +++ b/trade-service-project/trade-service-integration-test/src/test/java/cn/iocoder/mall/tradeservice/service/order/impl/TradeOrderServiceImplTest.java @@ -0,0 +1,34 @@ +package cn.iocoder.mall.tradeservice.service.order.impl; + +import cn.iocoder.mall.tradeservice.rpc.order.dto.TradeOrderCreateReqDTO; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.Arrays; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class TradeOrderServiceImplTest { + + @Autowired + private TradeOrderServiceImpl tradeOrderService; + + @Test + public void testCreateTradeOrder() { + TradeOrderCreateReqDTO createReqDTO = new TradeOrderCreateReqDTO() + .setUserId(243) + .setIp("127.0.0.1") + .setUserAddressId(19) + .setCouponCardId(null) + .setRemark("我是备注") + .setOrderItems(Arrays.asList( + new TradeOrderCreateReqDTO.OrderItem().setSkuId(3).setQuantity(1), + new TradeOrderCreateReqDTO.OrderItem().setSkuId(4).setQuantity(2) + )); + tradeOrderService.createTradeOrder(createReqDTO); + } + +} diff --git a/trade-service-project/trade-service-integration-test/src/test/java/cn/iocoder/mall/tradeservice/service/order/package-info.java b/trade-service-project/trade-service-integration-test/src/test/java/cn/iocoder/mall/tradeservice/service/order/package-info.java new file mode 100644 index 000000000..fc14f6ab3 --- /dev/null +++ b/trade-service-project/trade-service-integration-test/src/test/java/cn/iocoder/mall/tradeservice/service/order/package-info.java @@ -0,0 +1 @@ +package cn.iocoder.mall.tradeservice.service.order;