Merge branch 'master' of https://gitee.com/beijing_hongye_huicheng/lilishop
This commit is contained in:
commit
a3bd0f2c0b
@ -7,6 +7,7 @@
|
|||||||
Source Host : 192.168.0.116:3306
|
Source Host : 192.168.0.116:3306
|
||||||
Source Schema : lilishop
|
Source Schema : lilishop
|
||||||
|
|
||||||
|
|
||||||
Target Server Type : MySQL
|
Target Server Type : MySQL
|
||||||
Target Server Version : 80023
|
Target Server Version : 80023
|
||||||
File Encoding : 65001
|
File Encoding : 65001
|
||||||
|
@ -6,7 +6,7 @@ ALTER TABLE li_distribution ADD settlement_bank_branch_name varchar ( 200 );
|
|||||||
/** 文章分类添加默认值**/
|
/** 文章分类添加默认值**/
|
||||||
ALTER TABLE li_article_category alter column sort set default 0;
|
ALTER TABLE li_article_category alter column sort set default 0;
|
||||||
/** 添加分销提现菜单**/
|
/** 添加分销提现菜单**/
|
||||||
INSERT INTO `lilishop`.`li_menu`(`id`, `create_by`, `create_time`, `delete_flag`, `update_by`, `update_time`, `description`, `front_route`, `icon`, `level`, `name`, `parent_id`, `path`, `sort_order`, `title`, `front_component`) VALUES (1410862675914764290, 'admin', '2021-07-02 15:27:29', b'0', 'admin', '2021-07-02 15:27:45', 'null', 'distribution/distributionCash', '', 2, 'distributionCash', '1374173575405109248', 'distributionCash', 5.00, '分销提现', 'null');
|
INSERT INTO `rxshop`.`li_menu`(`id`, `create_by`, `create_time`, `delete_flag`, `update_by`, `update_time`, `description`, `front_route`, `icon`, `level`, `name`, `parent_id`, `path`, `sort_order`, `title`, `front_component`) VALUES (1410862675914764290, 'admin', '2021-07-02 15:27:29', b'0', 'admin', '2021-07-02 15:27:45', 'null', 'distribution/distributionCash', '', 2, 'distributionCash', '1374173575405109248', 'distributionCash', 5.00, '分销提现', 'null');
|
||||||
|
|
||||||
/** 促销商品添加商品类型**/
|
/** 促销商品添加商品类型**/
|
||||||
ALTER TABLE li_promotion_goods ADD goods_type varchar (200);
|
ALTER TABLE li_promotion_goods ADD goods_type varchar (200);
|
||||||
@ -16,7 +16,7 @@ update li_member_points_history set point_type = 'INCREASE' where point_type=1;
|
|||||||
update li_member_points_history set point_type = 'REDUCE' where point_type=0;
|
update li_member_points_history set point_type = 'REDUCE' where point_type=0;
|
||||||
|
|
||||||
/** 添加分词管理菜单*/
|
/** 添加分词管理菜单*/
|
||||||
INSERT INTO `lilishop`.`li_menu` (`id`, `create_by`, `create_time`, `delete_flag`, `update_by`, `update_time`, `description`, `front_route`, `icon`, `level`, `name`, `parent_id`, `path`, `sort_order`, `title`, `front_component`) VALUES (1349247640584085511, 'admin', '2021-01-13 14:51:20', b'0', 'admin', '2021-02-25 09:02:59', 'null', 'customWords/index', 'ios-american-football', 2, 'customWords', '1349237129847005184', 'customWords', 8.00, '分词管理', 'null');
|
INSERT INTO `rxshop`.`li_menu` (`id`, `create_by`, `create_time`, `delete_flag`, `update_by`, `update_time`, `description`, `front_route`, `icon`, `level`, `name`, `parent_id`, `path`, `sort_order`, `title`, `front_component`) VALUES (1349247640584085511, 'admin', '2021-01-13 14:51:20', b'0', 'admin', '2021-02-25 09:02:59', 'null', 'customWords/index', 'ios-american-football', 2, 'customWords', '1349237129847005184', 'customWords', 8.00, '分词管理', 'null');
|
||||||
|
|
||||||
/** 修改会员评价店铺图片字段类型 **/
|
/** 修改会员评价店铺图片字段类型 **/
|
||||||
alter table li_member_evaluation modify column reply_image text;
|
alter table li_member_evaluation modify column reply_image text;
|
||||||
@ -25,4 +25,4 @@ alter table li_member_evaluation modify column reply_image text;
|
|||||||
alter table li_after_sale modify column after_sale_image text;
|
alter table li_after_sale modify column after_sale_image text;
|
||||||
|
|
||||||
/** 提现申请审核sql **/
|
/** 提现申请审核sql **/
|
||||||
INSERT INTO `lilishop`.`li_menu`(`id`, `create_by`, `create_time`, `delete_flag`, `update_by`, `update_time`, `description`, `front_route`, `icon`, `level`, `name`, `parent_id`, `path`, `sort_order`, `title`, `front_component`) VALUES (1367042804944994305, 'admin', '2021-03-03 09:22:58', b'0', NULL, NULL, NULL, 'member/advance/withdrawApply', 'ios-alert', 2, 'withdrawApply', '1367042490443497472', 'withdrawApply', 1.00, '提现申请', NULL);
|
INSERT INTO `rxshop`.`li_menu`(`id`, `create_by`, `create_time`, `delete_flag`, `update_by`, `update_time`, `description`, `front_route`, `icon`, `level`, `name`, `parent_id`, `path`, `sort_order`, `title`, `front_component`) VALUES (1367042804944994305, 'admin', '2021-03-03 09:22:58', b'0', NULL, NULL, NULL, 'member/advance/withdrawApply', 'ios-alert', 2, 'withdrawApply', '1367042490443497472', 'withdrawApply', 1.00, '提现申请', NULL);
|
||||||
|
521
DB/version4.2.4to4.2.5.sql
Normal file
521
DB/version4.2.4to4.2.5.sql
Normal file
@ -0,0 +1,521 @@
|
|||||||
|
/**增加店铺发货信息**/
|
||||||
|
ALTER TABLE li_store_detail ADD `sales_consignor_address_id` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发货地址id';
|
||||||
|
ALTER TABLE li_store_detail ADD `sales_consignor_address_path` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发货地址名称';
|
||||||
|
ALTER TABLE li_store_detail ADD `sales_consignor_detail` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发货详细地址';
|
||||||
|
ALTER TABLE li_store_detail ADD `sales_consignor_mobile` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发货人手机';
|
||||||
|
ALTER TABLE li_store_detail ADD `sales_consignor_name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '发货人姓名';
|
||||||
|
|
||||||
|
/**增加电子面单店铺信息**/
|
||||||
|
ALTER TABLE `li_store_logistics` ADD `customer_name` varchar(255) DEFAULT NULL COMMENT '客户代码';
|
||||||
|
ALTER TABLE `li_store_logistics` ADD `customer_pwd` varchar(255) DEFAULT NULL COMMENT '客户密码';
|
||||||
|
ALTER TABLE `li_store_logistics` ADD `month_code` varchar(255) DEFAULT NULL COMMENT '月结号/密钥';
|
||||||
|
ALTER TABLE `li_store_logistics` ADD `send_site` varchar(255) DEFAULT NULL COMMENT '归属网点';
|
||||||
|
ALTER TABLE `li_store_logistics` ADD `send_staff` varchar(255) DEFAULT NULL COMMENT '收件快递员';
|
||||||
|
ALTER TABLE `li_store_logistics` ADD `face_sheet_flag` bit(1) DEFAULT NULL COMMENT '是否使用电子面单';
|
||||||
|
ALTER TABLE `li_store_logistics` ADD `pay_type` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '支付方式';
|
||||||
|
ALTER TABLE `li_store_logistics` ADD `exp_type` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '快递类型';
|
||||||
|
|
||||||
|
/** 店铺--默认页面是否开启**/
|
||||||
|
ALTER TABLE li_store ADD page_show bit(1) DEFAULT NULL COMMENT '默认页面是否开启';
|
||||||
|
|
||||||
|
/** 创建店员表 **/
|
||||||
|
/*
|
||||||
|
Navicat Premium Data Transfer
|
||||||
|
|
||||||
|
Source Server : lilishop
|
||||||
|
Source Server Type : MySQL
|
||||||
|
Source Server Version : 80025
|
||||||
|
Source Host : 192.168.0.116:3306
|
||||||
|
Source Schema : zhimai1
|
||||||
|
|
||||||
|
Target Server Type : MySQL
|
||||||
|
Target Server Version : 80025
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 03/03/2022 19:30:20
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for li_clerk
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `li_clerk`;
|
||||||
|
CREATE TABLE `li_clerk` (
|
||||||
|
`id` bigint NOT NULL COMMENT 'ID',
|
||||||
|
`create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建者',
|
||||||
|
`create_time` datetime(6) NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`delete_flag` bit(1) NULL DEFAULT NULL COMMENT '删除标志 true/false 删除/未删除',
|
||||||
|
`update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新者',
|
||||||
|
`update_time` datetime(6) NULL DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`clerk_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '店员名称',
|
||||||
|
`member_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '会员id',
|
||||||
|
`store_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '店铺id',
|
||||||
|
`department_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '部门id',
|
||||||
|
`role_ids` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '角色',
|
||||||
|
`shopkeeper` bit(1) NULL DEFAULT NULL COMMENT '是否是店主',
|
||||||
|
`is_super` bit(1) NULL DEFAULT NULL COMMENT '是否是超级管理员 超级管理员/普通管理员',
|
||||||
|
`status` bit(1) NULL DEFAULT NULL COMMENT '状态',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|
||||||
|
|
||||||
|
/** 店员角色**/
|
||||||
|
/*
|
||||||
|
Navicat Premium Data Transfer
|
||||||
|
|
||||||
|
Source Server : lilishop
|
||||||
|
Source Server Type : MySQL
|
||||||
|
Source Server Version : 80025
|
||||||
|
Source Host : 192.168.0.116:3306
|
||||||
|
Source Schema : zhimai1
|
||||||
|
|
||||||
|
Target Server Type : MySQL
|
||||||
|
Target Server Version : 80025
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 03/03/2022 19:30:39
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for li_clerk_role
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `li_clerk_role`;
|
||||||
|
CREATE TABLE `li_clerk_role` (
|
||||||
|
`id` bigint NOT NULL COMMENT 'ID',
|
||||||
|
`clerk_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '店员唯一id',
|
||||||
|
`role_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '角色唯一id',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|
||||||
|
|
||||||
|
/** 店铺部门 **/
|
||||||
|
/*
|
||||||
|
Navicat Premium Data Transfer
|
||||||
|
|
||||||
|
Source Server : lilishop
|
||||||
|
Source Server Type : MySQL
|
||||||
|
Source Server Version : 80025
|
||||||
|
Source Host : 192.168.0.116:3306
|
||||||
|
Source Schema : zhimai1
|
||||||
|
|
||||||
|
Target Server Type : MySQL
|
||||||
|
Target Server Version : 80025
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 03/03/2022 19:31:39
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for li_store_department
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `li_store_department`;
|
||||||
|
CREATE TABLE `li_store_department` (
|
||||||
|
`id` bigint NOT NULL COMMENT 'ID',
|
||||||
|
`create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建者',
|
||||||
|
`create_time` datetime(6) NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`delete_flag` bit(1) NULL DEFAULT NULL COMMENT '删除标志 true/false 删除/未删除',
|
||||||
|
`update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新者',
|
||||||
|
`update_time` datetime(6) NULL DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '部门名称',
|
||||||
|
`store_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '店铺id',
|
||||||
|
`parent_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '父id',
|
||||||
|
`sort_order` decimal(20, 2) NULL DEFAULT NULL COMMENT '排序值',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|
||||||
|
/** 部门角色关联 **/
|
||||||
|
/*
|
||||||
|
Navicat Premium Data Transfer
|
||||||
|
|
||||||
|
Source Server : lilishop
|
||||||
|
Source Server Type : MySQL
|
||||||
|
Source Server Version : 80025
|
||||||
|
Source Host : 192.168.0.116:3306
|
||||||
|
Source Schema : zhimai1
|
||||||
|
|
||||||
|
Target Server Type : MySQL
|
||||||
|
Target Server Version : 80025
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 03/03/2022 19:32:01
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for li_store_department_role
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `li_store_department_role`;
|
||||||
|
CREATE TABLE `li_store_department_role` (
|
||||||
|
`id` bigint NOT NULL COMMENT 'ID',
|
||||||
|
`create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建者',
|
||||||
|
`create_time` datetime(6) NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`delete_flag` bit(1) NULL DEFAULT NULL COMMENT '删除标志 true/false 删除/未删除',
|
||||||
|
`update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新者',
|
||||||
|
`update_time` datetime(6) NULL DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`role_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '角色id',
|
||||||
|
`department_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '部门id',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|
||||||
|
/**店铺角色菜单**/
|
||||||
|
/*
|
||||||
|
Navicat Premium Data Transfer
|
||||||
|
|
||||||
|
Source Server : lilishop
|
||||||
|
Source Server Type : MySQL
|
||||||
|
Source Server Version : 80025
|
||||||
|
Source Host : 192.168.0.116:3306
|
||||||
|
Source Schema : zhimai1
|
||||||
|
|
||||||
|
Target Server Type : MySQL
|
||||||
|
Target Server Version : 80025
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 03/03/2022 19:34:42
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for li_store_menu_role
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `li_store_menu_role`;
|
||||||
|
CREATE TABLE `li_store_menu_role` (
|
||||||
|
`id` bigint NOT NULL COMMENT 'ID',
|
||||||
|
`create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建者',
|
||||||
|
`create_time` datetime(6) NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`delete_flag` bit(1) NULL DEFAULT NULL COMMENT '删除标志 true/false 删除/未删除',
|
||||||
|
`update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新者',
|
||||||
|
`update_time` datetime(6) NULL DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`role_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '角色id',
|
||||||
|
`menu_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '菜单',
|
||||||
|
`store_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '店铺id',
|
||||||
|
`is_super` bit(1) NULL DEFAULT NULL COMMENT '是否拥有操作数据权限,为否则只有查看权限',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|
||||||
|
|
||||||
|
/**店铺角色**/
|
||||||
|
/*
|
||||||
|
Navicat Premium Data Transfer
|
||||||
|
|
||||||
|
Source Server : lilishop
|
||||||
|
Source Server Type : MySQL
|
||||||
|
Source Server Version : 80025
|
||||||
|
Source Host : 192.168.0.116:3306
|
||||||
|
Source Schema : zhimai1
|
||||||
|
|
||||||
|
Target Server Type : MySQL
|
||||||
|
Target Server Version : 80025
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 03/03/2022 19:32:59
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for li_store_role
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `li_store_role`;
|
||||||
|
CREATE TABLE `li_store_role` (
|
||||||
|
`id` bigint NOT NULL COMMENT 'ID',
|
||||||
|
`create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建者',
|
||||||
|
`create_time` datetime(6) NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`delete_flag` bit(1) NULL DEFAULT NULL COMMENT '删除标志 true/false 删除/未删除',
|
||||||
|
`update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新者',
|
||||||
|
`update_time` datetime(6) NULL DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '角色名称',
|
||||||
|
`store_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '店铺id',
|
||||||
|
`default_role` bit(1) NULL DEFAULT NULL COMMENT '是否为注册默认角色',
|
||||||
|
`description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '备注',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = DYNAMIC;
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Navicat Premium Data Transfer
|
||||||
|
|
||||||
|
Source Server : lilishop
|
||||||
|
Source Server Type : MySQL
|
||||||
|
Source Server Version : 80025
|
||||||
|
Source Host : 192.168.0.116:3306
|
||||||
|
Source Schema : zhimai1
|
||||||
|
|
||||||
|
Target Server Type : MySQL
|
||||||
|
Target Server Version : 80025
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 02/03/2022 09:57:49
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for li_menu
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `li_menu`;
|
||||||
|
CREATE TABLE `li_menu` (
|
||||||
|
`id` bigint NOT NULL COMMENT 'ID',
|
||||||
|
`create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建者',
|
||||||
|
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`delete_flag` bit(1) NULL DEFAULT NULL COMMENT '删除标志 true/false 删除/未删除',
|
||||||
|
`update_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新者',
|
||||||
|
`update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '说明备注',
|
||||||
|
`front_route` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '前端路由',
|
||||||
|
`icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图标',
|
||||||
|
`level` int NULL DEFAULT NULL COMMENT '层级',
|
||||||
|
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '菜单/权限名称',
|
||||||
|
`parent_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '父id',
|
||||||
|
`path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '赋权API地址,正则表达式',
|
||||||
|
`sort_order` decimal(10, 2) NULL DEFAULT NULL COMMENT '排序值',
|
||||||
|
`title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '菜单标题',
|
||||||
|
`front_component` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '文件地址',
|
||||||
|
`permission` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限url',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of li_menu
|
||||||
|
-- ----------------------------
|
||||||
|
INSERT INTO `li_menu` VALUES (1348810750596767744, 'admin', '2021-01-12 09:55:17', b'0', 'admin', '2021-01-15 09:42:50', 'null', '1', 'ios-american-football', 0, 'settings', '0', '1', 2.00, '设置', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1348810864748945408, 'admin', '2021-01-12 09:55:45', b'0', 'admin', '2021-03-15 20:57:12', 'null', 'null', 'ios-american-football', 0, 'log', '0', 'null', 3.00, '日志', 'null', '/manager/setting/log*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349237129847005184, 'admin', '2021-01-13 14:09:34', b'0', 'admin', '2021-01-15 09:43:16', 'null', 'Main', 'ios-american-football', 1, 'sys', '1348810750596767744', '/sys', 1.00, '系统设置', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1349237207378714624, 'admin', '2021-01-13 14:09:53', b'0', 'admin', '2021-07-27 16:07:49', 'null', 'Main', 'ios-american-football', 1, 'member', '1348810750596767744', '/member', 0.00, '用户管理', 'null', '/manager/permission/department*,/manager/passport/user*,/manager/permission/role*,/manager/permission/menu*,/manager/passport/user/admin/edit*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349237928434098176, 'admin', '2021-01-13 14:13:03', b'0', 'admin', '2021-07-27 16:09:11', 'null', 'Main', 'ios-american-football', 1, 'log', '1348810864748945408', '/log', 1.00, '系统监控', 'null', '/manager/log*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349246048900243456, 'admin', '2021-01-13 14:45:00', b'0', 'admin', '2021-07-27 16:07:57', 'null', 'sys/setting-manage/settingManage', 'ios-american-football', 2, 'setting', '1349237129847005184', 'setting', 1.00, '系统设置', 'null', '/manager/system/setting/get*,/manager/system/setting/put*,/manager/setting/setting*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349246347597602816, 'admin', '2021-01-13 14:46:12', b'0', 'admin', '2021-07-27 16:08:03', 'null', 'sys/oss-manage/ossManage', 'ios-american-football', 2, 'oss-manage', '1349237129847005184', 'oss-manage', 3.00, 'OSS资源', '', '/manager/common/file*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349246468775239680, 'admin', '2021-01-13 14:46:41', b'0', 'admin', '2021-07-27 16:08:14', 'null', 'region/index', 'ios-american-football', 2, 'region', '1349237129847005184', 'region', 4.00, '行政地区', 'null', '/manager/region*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349246671158796288, 'admin', '2021-01-13 14:47:29', b'0', 'admin', '2021-07-27 16:08:09', 'null', 'logistics/index', 'ios-american-football', 2, 'logistics', '1349237129847005184', 'logistics', 5.00, '物流公司', 'null', '/manager/other/logistics*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349246896661356544, 'admin', '2021-01-13 14:48:23', b'0', 'admin', '2021-07-27 16:08:23', 'null', 'sys/setting-manage/settingManage', 'ios-american-football', 2, 'authLogin', '1349237129847005184', 'authLogin', 6.00, '信任登录', 'null', '/manager/system/setting/get*,/manager/system/setting/put*,/manager/setting/setting*\r\n');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349247081504333824, 'admin', '2021-01-13 14:49:07', b'0', 'admin', '2021-07-27 16:08:45', 'null', 'sys/setting-manage/settingManage', 'ios-american-football', 2, 'pay', '1349237129847005184', 'pay', 7.00, '支付设置', 'null', '/manager/system/setting/get*,/manager/system/setting/put*,/manager/system/setting*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349247640584085504, 'admin', '2021-01-13 14:51:20', b'0', 'admin', '2021-07-27 16:08:56', 'null', 'sensitiveWords/index', 'ios-american-football', 2, 'sensitiveWords', '1349237129847005184', 'sensitiveWords', 8.00, '敏感词', 'null', '/manager/other/sensitiveWords*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349254815809298432, 'admin', '2021-01-13 15:19:51', b'0', 'admin', '2021-01-15 11:15:40', 'null', 'sys/user-manage/userManage', 'ios-american-football', 2, 'user-manage', '1349237207378714624', 'user-manage', 1.00, '用户管理', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1349255214977015808, 'admin', '2021-01-13 15:21:26', b'0', 'admin', '2021-01-15 11:16:21', 'null', 'sys/department-manage/departmentManage', 'ios-american-football', 2, 'department-manage', '1349237207378714624', 'department-manage', 3.00, '部门管理', 'null', '/manager/permission/department*,/manager/permission/departmentRole*,');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349255404425338880, 'admin', '2021-01-13 15:22:11', b'0', 'admin', '2021-02-24 09:22:21', 'null', 'sys/role-manage/roleManage', 'ios-american-football', 2, 'role-manage', '1349237207378714624', 'role-manage', 4.00, '角色权限', 'null', '/manager/permission/role*,/manager/permission/roleMenu*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1349256082979840000, 'admin', '2021-01-13 15:24:53', b'0', 'admin', '2021-01-15 11:18:14', 'null', 'sys/log-manage/logManage', 'ios-american-football', 2, 'log-manage', '1349237928434098176', 'log-manage', 2.00, '日志管理', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1357584224760102912, 'admin', '2021-02-05 06:57:57', b'0', 'admin', '2021-07-27 16:09:02', 'null', 'sys/app-version/appVersion', 'ios-american-football', 2, 'appVersion', '1349237129847005184', 'appVersion', 9.00, 'APP版本', 'null', '/manager/other/appVersion*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1357873097859923969, 'admin', '2021-02-24 09:53:02', b'0', 'admin', '2021-02-24 09:53:12', NULL, 'sys/menu-manage/menuManage', 'ios-american-football', 2, 'menuManage', '1349237207378714624', 'menu-manage', 2.00, '菜单管理', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367038467288072192, 'admin', '2021-03-03 09:05:44', b'0', 'admin', '2021-03-03 09:09:27', 'null', 'null', 'ios-person-add', 0, 'member', '0', 'null', 0.00, '会员', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367039534616805376, 'admin', '2021-03-03 09:09:58', b'0', 'admin', '2021-05-18 10:51:12', 'null', 'null', 'md-reorder', 0, 'order', '0', 'null', 0.00, '订单', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367039950368800768, 'admin', '2021-03-03 09:11:37', b'0', NULL, NULL, NULL, NULL, 'ios-share', 0, 'goods', '0', NULL, 0.20, '商品', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367040067201138688, 'admin', '2021-03-03 09:12:05', b'0', 'admin', '2021-12-02 19:45:22', NULL, 'null', 'ios-hammer', 0, 'promotions', '0', 'null', 0.30, '促销', NULL, 'null');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367040599596728320, 'admin', '2021-03-03 09:14:12', b'0', 'admin', '2021-03-03 09:52:13', 'null', 'null', 'ios-color-palette', 0, 'operate', '0', 'null', 0.50, '运营', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367040819248234496, 'admin', '2021-03-03 09:15:04', b'0', 'lili_ftyy', '2022-03-01 15:13:04', NULL, 'null', 'ios-stats', 0, 'statistics', '0', 'null', 0.70, '统计', NULL, 'null');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367041332861730816, 'admin', '2021-03-03 09:17:07', b'0', NULL, NULL, NULL, 'Main', 'ios-aperture', 1, '/', '1367038467288072192', '/', 0.00, '会员管理', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367041461194850304, 'admin', '2021-03-03 09:17:37', b'0', 'admin', '2021-07-27 16:02:17', NULL, 'member/list/index', 'ios-aperture', 2, 'memberList', '1367041332861730816', 'memberList', 0.00, '会员列表', NULL, '/manager/common/file*,/manager/passport/member*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367041575619657728, 'admin', '2021-03-03 09:18:05', b'0', 'admin', '2021-07-27 15:59:50', NULL, 'member/list/memberRecycle', 'ios-aperture', 2, 'memberRecycle', '1367041332861730816', 'memberRecycle', 1.00, '回收站', NULL, '/manager/member*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367042490443497472, 'admin', '2021-03-03 09:21:43', b'0', NULL, NULL, NULL, 'Main', 'ios-aperture', 1, '/', '1367038467288072192', '/', 1.00, '预存款', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367042664410644480, 'admin', '2021-03-03 09:22:24', b'0', 'admin', '2021-07-27 16:02:44', 'null', 'member/advance/walletLog', 'ios-aperture', 2, 'walletLog', '1367042490443497472', 'walletLog', 0.00, '会员资金', 'null', '/manager/wallet/log*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367042804944994304, 'admin', '2021-03-03 09:22:58', b'0', 'admin', '2021-07-27 16:02:48', NULL, 'member/advance/recharge', 'ios-alert', 2, 'recharge', '1367042490443497472', 'recharge', 1.00, '充值记录', NULL, '/manager/wallet/recharge*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367042804944994305, 'admin', '2021-03-03 09:22:58', b'0', 'admin', '2021-07-27 16:02:52', NULL, 'member/advance/withdrawApply', 'ios-alert', 2, 'withdrawApply', '1367042490443497472', 'withdrawApply', 1.00, '提现申请', NULL, '/manager/wallet/withdrawApply*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367042917113266176, 'admin', '2021-03-03 09:23:25', b'0', NULL, NULL, NULL, 'Main', 'ios-aperture', 1, 'commont', '1367038467288072192', '/', 0.00, '评价', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367043020976816128, 'admin', '2021-03-03 09:23:49', b'0', 'admin', '2021-07-27 16:02:35', NULL, 'goods/goods-review/index', 'md-aperture', 2, 'goodsReview', '1367042917113266176', 'goodsReview', 0.00, '会员评价', NULL, '/manager/memberEvaluation*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367043443917848576, 'admin', '2021-03-03 09:25:30', b'0', 'admin', '2021-07-27 16:03:00', NULL, 'Main', 'md-aperture', 1, 'order', '1367039534616805376', '/', 0.00, '订单', NULL, '/manager/orders*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367043505771249664, 'admin', '2021-03-03 09:25:45', b'0', NULL, NULL, NULL, 'Main', 'md-aperture', 1, 'aftersale', '1367039534616805376', '/', 0.00, '售后', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367043642379730944, 'admin', '2021-03-03 09:26:17', b'0', NULL, NULL, NULL, 'order/order/orderList', 'ios-aperture', 2, 'orderList', '1367043443917848576', 'orderList', 0.00, '商品订单', NULL, '/manager/order/order*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367043791105556480, 'admin', '2021-03-03 09:26:53', b'0', NULL, NULL, NULL, 'order/order/fictitiousOrderList', 'ios-aperture', 2, 'fictitiousOrderList', '1367043443917848576', 'fictitiousOrderList', 1.00, '虚拟订单', NULL, '/manager/order/order*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367043980407078912, 'admin', '2021-03-03 09:27:38', b'0', 'admin', '2021-07-27 16:03:43', NULL, 'order/after-order/afterSaleOrder', 'md-alert', 2, 'afterSaleOrder', '1367043505771249664', 'afterSaleOrder', 0.00, '售后管理', NULL, '/manager/order/afterSale*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367044121163726848, 'admin', '2021-03-03 09:28:12', b'0', 'admin', '2021-07-27 16:03:48', NULL, 'order/after-order/orderComplaint', 'md-alert', 2, 'orderComplaint', '1367043505771249664', 'orderComplaint', 2.00, '交易投诉', NULL, '/manager/order/complain*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367044247978508288, 'admin', '2021-03-03 09:28:42', b'0', 'admin', '2021-07-27 16:03:52', NULL, 'order/after-order/afterSale', 'md-aperture', 2, 'afterSaleReason', '1367043505771249664', 'afterSaleReason', 3.00, '售后原因', NULL, '/manager/order/afterSaleReason*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367044376391319552, 'admin', '2021-03-03 09:29:12', b'0', 'admin', '2021-07-27 16:04:08', NULL, 'Main', 'md-aperture', 1, 'goodsManager', '1367039950368800768', '/', 0.00, '商品管理', NULL, '/manager/goods*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367044657296441344, 'admin', '2021-03-03 09:30:19', b'0', NULL, NULL, NULL, 'Main', 'ios-aperture', 1, 'association', '1367039950368800768', '/', 1.00, '关联管理', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367045529720061952, 'admin', '2021-03-03 09:33:47', b'0', 'admin', '2021-07-27 15:38:46', NULL, 'goods/goods-info/goods', 'md-aperture', 2, 'managerGoods', '1367044376391319552', 'managerGoods', 0.00, '平台商品', NULL, 'null');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367045630710513664, 'admin', '2021-03-03 09:34:11', b'0', 'admin', '2021-07-27 15:38:56', NULL, 'goods/goods-info/goodsApply', 'ios-alert', 2, 'applyGoods', '1367044376391319552', 'applyGoods', 1.00, '商品审核', NULL, 'null');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367045794284175360, 'admin', '2021-03-03 09:34:50', b'0', 'admin', '2021-07-27 16:04:18', NULL, 'goods/goods-manage/category', 'md-alert', 2, 'goodsCategory', '1367044657296441344', 'goodsCategory', 0.00, '商品分类', NULL, '/manager/goods/category*,/manager/goods/brand*,/manager/goods/spec*,/manager/goods/parameters*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367045921434501120, 'admin', '2021-03-03 09:35:21', b'0', 'admin', '2021-07-27 16:04:23', NULL, 'goods/goods-manage/brand', 'md-alert', 2, 'goodsBrand', '1367044657296441344', 'goodsBrand', 1.00, '品牌列表', NULL, '/manager/goods/brand*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367046068369358848, 'admin', '2021-03-03 09:35:56', b'0', 'admin', '2021-07-27 16:04:27', NULL, 'goods/goods-manage/spec', 'md-aperture', 2, 'goodsSpec', '1367044657296441344', 'goodsSpec', 2.00, '规格列表', NULL, '/manager/goods/spec*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367046266214678528, 'admin', '2021-03-03 09:36:43', b'0', 'admin', '2021-07-27 16:04:32', NULL, 'goods-unit/index', 'md-alert', 2, 'goodsUnit', '1367044657296441344', 'goodsUnit', 4.00, '计量单位', NULL, '/manager/goods/goodsUnit*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367048084701315072, 'admin', '2021-03-03 09:43:57', b'0', 'admin', '2021-03-03 09:52:17', 'null', 'null', 'ios-pricetags', 0, 'shop', '0', 'null', 0.40, '店铺', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367048684339986432, 'admin', '2021-03-03 09:46:20', b'0', NULL, NULL, NULL, 'Main', 'md-aperture', 1, 'shopManager', '1367048084701315072', '/', 0.00, '店铺管理', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367048754229673984, 'admin', '2021-03-03 09:46:36', b'0', NULL, NULL, NULL, 'Main', 'md-aperture', 1, 'bill', '1367048084701315072', '/', 0.00, ' 店铺结算', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367048832210173952, 'admin', '2021-03-03 09:46:55', b'0', 'admin', '2021-07-27 16:05:30', NULL, 'seller/shop/shopList', 'md-aperture', 2, 'shopList', '1367048684339986432', 'shopList', 0.00, '店铺列表', NULL, '/manager/order/order*,/manager/store*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367048967635861504, 'admin', '2021-03-03 09:47:27', b'0', 'admin', '2021-07-27 16:05:32', NULL, 'seller/shop/shopAuditList', 'md-alert', 2, 'shopAuth', '1367048684339986432', 'shopAuth', 1.00, '店铺审核', NULL, '/manager/store*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367049068122996736, 'admin', '2021-03-03 09:47:51', b'0', 'admin', '2021-07-27 16:05:36', NULL, 'seller/bill/bill', 'md-alert', 2, 'billList', '1367048754229673984', 'billList', 0.00, '店铺结算', NULL, '/manager/order/bill*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367049214198022144, 'admin', '2021-03-03 09:48:26', b'0', 'admin', '2021-12-02 19:45:28', NULL, 'Main', 'md-aperture', 1, 'promotionsManager', '1367040067201138688', '/', 0.00, '促销管理', NULL, 'null');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367049384792948736, 'admin', '2021-03-03 09:49:07', b'0', 'admin', '2021-12-02 19:54:12', NULL, 'promotions/coupon/coupon', 'md-alert', 2, 'promotions/coupon', '1367049214198022144', 'promotions/coupon', 0.00, '优惠券', NULL, '/manager/promotion/coupon*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367049500782231552, 'admin', '2021-03-03 09:49:34', b'0', 'admin', '2021-12-02 19:41:37', 'null', 'promotions/full-discount/full-discount', 'md-alert', 2, 'promotions/full-discount', '1367049214198022144', 'promotions/full-discount', 1.00, '满额活动', 'null', '/manager/promotion/fullDiscount*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367049611578966016, 'admin', '2021-03-03 09:50:01', b'0', 'admin', '2021-12-02 20:16:10', 'null', 'promotions/seckill/seckill', 'md-alert', 2, 'promotions/seckill', '1367049214198022144', 'promotions/seckill', 2.00, '秒杀活动', 'null', '/manager/promotion/seckill*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367049712657498112, 'admin', '2021-03-03 09:50:25', b'0', 'admin', '2021-12-02 20:22:04', 'null', 'promotions/pintuan/pintuan', 'md-alert', 2, 'promotions/pintuan', '1367049214198022144', 'promotions/pintuan', 3.00, '拼团活动', 'null', '/manager/promotion/pintuan*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367050250249830400, 'admin', '2021-03-03 09:52:33', b'0', 'admin', '2021-03-22 20:38:14', 'null', 'Main', 'md-aperture', 1, 'document', '1367040599596728320', '/', 2.00, '文章管理', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367050320584114176, 'admin', '2021-03-03 09:52:50', b'0', 'admin', '2021-07-27 16:05:49', NULL, 'Main', 'md-aperture', 1, 'floor', '1367040599596728320', '/', 0.00, '楼层装修', NULL, '/manager/pageData*,/manager/file*,/manager/article-category*,/manager/article*,/manager/promotion*,/manager/goods*,/manager/store*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367050530030878720, 'admin', '2021-03-03 09:53:40', b'0', 'admin', '2021-03-04 01:05:57', 'null', 'page-decoration/floorList', 'md-alert', 2, 'pcFloor', '1367050320584114176', 'pcFloor', 0.00, 'PC端', 'null', '/manager/other/pageData*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367050673312497664, 'admin', '2021-03-03 09:54:14', b'0', 'admin', '2021-03-04 01:06:04', 'null', 'page-decoration/wap/wapList', 'md-aperture', 2, 'wapList', '1367050320584114176', 'wapList', 1.00, '移动端', 'null', '/manager/other/pageData*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367050829697122304, 'admin', '2021-03-03 09:54:51', b'0', 'admin', '2021-07-27 16:06:32', 'null', 'page/article-manage/hotWords', 'md-aperture', 2, 'hotKeyWord', '1367050250249830400', 'hotKeyWord', 0.00, '搜索热词', 'null', '/manager/hotwords*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367050939084570624, 'admin', '2021-03-03 09:55:17', b'0', 'admin', '2021-07-27 16:06:38', NULL, 'page/article-manage/ArticleCategory', 'md-aperture', 2, 'article-category', '1367050250249830400', 'article-category', 1.00, '文章分类', NULL, '/manager/other/articleCategory*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367051048232943616, 'admin', '2021-03-03 09:55:43', b'0', 'admin', '2021-07-27 16:06:42', NULL, 'page/article-manage/articleList', 'md-alert', 2, 'articleList', '1367050250249830400', 'articleList', 3.00, '文章管理', NULL, '/manager/other/article*,/manager/other/articleCategory*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367052616634204160, 'admin', '2021-03-03 10:01:57', b'0', 'admin', '2021-07-27 16:07:38', NULL, 'Main', 'md-aperture', 1, 'statistics', '1367040819248234496', '/', 0.00, '统计', NULL, '/manager/store*,/manager/member*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1367052705725415424, 'admin', '2021-03-03 10:02:18', b'0', 'admin', '2021-03-11 22:11:05', 'null', 'statistics/member', 'md-alert', 2, 'memberStatistics', '1367052616634204160', 'memberStatistics', 0.00, '会员统计', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367052805503713280, 'admin', '2021-03-03 10:02:42', b'0', 'admin', '2021-03-11 22:11:14', 'null', 'statistics/order', 'md-alert', 2, 'orderStatistics', '1367052616634204160', 'orderStatistics', 1.00, '订单统计', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367052915314786304, 'admin', '2021-03-03 10:03:08', b'0', 'admin', '2021-03-11 22:11:23', 'null', 'statistics/goods', 'md-alert', 2, 'goodsStatistics', '1367052616634204160', 'goodsStatistics', 2.00, '商品统计', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1367053087121866752, 'admin', '2021-03-03 10:03:49', b'0', 'admin', '2021-03-11 22:11:34', 'null', 'statistics/traffic', 'md-alert', 2, 'trafficStatistics', '1367052616634204160', 'trafficStatistics', 4.00, '流量统计', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1372807928452481024, 'admin', '2021-03-19 02:11:30', b'0', NULL, NULL, NULL, 'Main', 'ios-aperture', 1, 'flow', '1367039534616805376', '/', 3.00, '流水', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1372808148565360640, 'admin', '2021-03-19 02:12:23', b'0', 'admin', '2021-07-27 16:03:57', NULL, 'order/flow/paymentLog', 'md-alert', 2, 'paymentLog', '1372807928452481024', 'paymentLog', 1.00, '收款记录', NULL, '/manager/order/paymentLog*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1372808352295288832, 'admin', '2021-03-19 02:13:11', b'0', 'admin', '2021-07-27 16:04:01', NULL, 'order/flow/refundLog', 'ios-aperture', 2, 'refundLog', '1372807928452481024', 'refundLog', 2.00, '退款流水', NULL, '/manager/order/refundLog*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1373166892465782784, 'admin', '2021-03-20 01:57:54', b'0', 'admin', '2021-03-22 20:13:48', 'null', 'Main', 'ios-aperture', 1, '/', '1367038467288072192', '/', 0.00, '积分', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1373167227385151488, 'admin', '2021-03-20 01:59:14', b'0', 'admin', '2021-07-27 16:02:40', 'null', 'member/point/point', 'ios-aperture', 2, 'point', '1373166892465782784', 'point', 0.00, '积分历史', 'null', '/manager/member/memberPointsHistory*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1373791578371391488, 'admin', '2021-03-21 19:20:11', b'0', 'admin', '2021-07-27 16:05:38', NULL, 'seller/bill/accountStatementBill', 'md-alert', 2, 'accountStatementBill', '1367048754229673984', 'accountStatementBill', 0.00, '商家对账', NULL, '/manager/order/bill*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1374154349697040384, 'admin', '2021-03-22 19:21:42', b'0', 'admin', '2021-07-27 16:06:55', 'null', 'Main', 'md-aperture', 1, 'feedback', '1367040599596728320', '/', 3.00, '意见反馈', 'null', '/manager/other/feedback*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1374155741123837952, 'admin', '2021-03-22 19:27:14', b'0', 'admin', '2021-07-27 15:41:40', 'null', 'page/feedback/feedback', 'md-aperture', 2, 'feedback', '1374154349697040384', 'feedback', 0.00, '意见反馈', 'null', 'null');
|
||||||
|
INSERT INTO `li_menu` VALUES (1374173575405109248, 'admin', '2021-03-22 20:38:06', b'0', 'admin', '2021-03-22 20:52:58', 'null', 'Main', 'ios-analytics', 1, 'distributionManager', '1367040599596728320', '/', 1.00, '分销管理', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1374177618072436736, 'admin', '2021-03-22 20:54:10', b'0', 'admin', '2021-07-27 16:05:58', 'null', 'distribution/distributionSetting', 'ios-basketball', 2, 'distributionSetting', '1374173575405109248', 'distributionSetting', 0.00, '分销设置', 'null', '/manager/system/setting/put/DISTRIBUTION_SETTING*,/manager/system/setting/get/DISTRIBUTION_SETTING*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1374177789581721600, 'admin', '2021-03-22 20:54:51', b'0', 'admin', '2021-07-27 16:06:15', 'null', 'distribution/distributionGoods', 'ios-chatbubbles', 2, 'distributionGoods', '1374173575405109248', 'distributionGoods', 3.00, '分销商品', 'null', '/manager/distribution/goods*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1374177910411231232, 'admin', '2021-03-22 20:55:19', b'0', 'admin', '2021-07-27 16:06:20', 'null', 'distribution/distributionOrder', 'ios-cloudy', 2, 'distributionOrder', '1374173575405109248', 'distributionOrder', 4.00, '分销订单', 'null', '/manager/distribution/order*,/manager/store*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1374178079181635584, 'admin', '2021-03-22 20:56:00', b'0', 'admin', '2021-07-27 16:06:05', 'null', 'distribution/distributionApply', 'md-egg', 2, 'distributionApply', '1374173575405109248', 'distributionApply', 1.00, '分销申请', 'null', '/manager/distribution*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1374178303975358464, 'admin', '2021-03-22 20:56:53', b'0', 'admin', '2021-07-27 16:06:08', 'null', 'distribution/distribution', 'md-person', 2, 'distribution', '1374173575405109248', 'distribution', 2.00, '分销员', 'null', '/manager/distribution*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1374916594269945856, 'admin', '2021-03-24 21:50:35', b'0', 'admin', '2021-07-27 16:08:51', NULL, 'sys/slider/slider', 'ios-aperture', 2, 'slider', '1349237129847005184', 'slider', 7.00, '验证码', NULL, '/manager/other/verificationSource*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1376450531517530112, 'admin', '2021-03-29 03:25:55', b'0', NULL, NULL, NULL, 'Main', 'md-basketball', 1, 'notice', '1367040599596728320', '/', 5.00, '站内信', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1376450662098796544, 'admin', '2021-03-29 03:26:26', b'0', 'admin', '2021-07-27 16:07:23', NULL, 'sys/message/noticeMessageTemplate', 'ios-american-football', 2, 'noticeMessageTemplate', '1376450531517530112', 'noticeMessageTemplate', 1.00, '站内信', NULL, '/manager/other/message*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1376450766817984512, 'admin', '2021-03-29 03:26:51', b'0', 'admin', '2021-03-29 03:27:25', 'null', 'Main', 'md-checkmark', 1, 'sms', '1367040599596728320', '/', 6.00, '短信管理', 'null', NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1376450876423536640, 'admin', '2021-03-29 03:27:17', b'0', 'admin', '2021-07-27 16:07:29', NULL, 'sys/message/sms', 'ios-timer', 2, 'sms', '1376450766817984512', 'sms', 1.00, '短信', NULL, '/manager/sms/sms*,/manager/passport/member*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1384035281702748160, 'admin', '2021-04-19 14:45:00', b'0', 'admin', '2021-07-27 16:08:18', 'null', 'member/message-manage/weChatMessageManager', 'md-aperture', 2, 'message-manage', '1349237129847005184', 'message-manage', 5.00, '微信消息', 'null', '/manager/wechat/wechatMessage*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1403988156444962818, 'admin', '2021-06-13 16:10:36', b'0', 'admin', '2021-12-02 19:54:37', 'null', 'promotions/coupon-activity/coupon', '', 2, 'promotions/coupon-activity', '1367049214198022144', 'promotions/coupon-activity', 0.00, '券活动', 'null', '/manager/promotion/couponActivity*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1407601962899230721, 'admin', '2021-06-23 15:30:35', b'0', 'admin', '2021-07-27 16:05:08', NULL, 'Main', '', 1, 'liveManage', '1367040067201138688', '/', 2.00, '直播管理', NULL, '/manager/broadcast*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1407602049759072258, 'admin', '2021-06-23 15:30:55', b'0', 'admin', '2021-12-07 10:54:54', NULL, 'promotions/live/live', '', 2, 'promotions/live', '1407601962899230721', 'promotions/live', 1.00, '直播管理', NULL, 'null');
|
||||||
|
INSERT INTO `li_menu` VALUES (1407602441964244994, 'admin', '2021-06-23 15:32:29', b'0', NULL, NULL, NULL, 'Main', '', 1, 'pointManage', '1367040067201138688', '/', 3.00, '积分活动', NULL, NULL);
|
||||||
|
INSERT INTO `li_menu` VALUES (1407602516912263170, 'admin', '2021-06-23 15:32:47', b'0', 'admin', '2021-12-03 19:18:30', NULL, 'promotions/points-goods/points-goods', '', 2, 'promotions/points-goods', '1407602441964244994', 'promotions/points-goods', 1.00, '积分商品', NULL, '/manager/promotion/pointsGoods*,/manager/goods*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1407602673334636546, 'admin', '2021-06-23 15:33:24', b'0', 'admin', '2021-12-03 19:19:23', NULL, 'promotions/points-goods-category/points-goods-category', '', 2, 'promotions/points-goods-category', '1407602441964244994', 'promotions/points-goods-category', 2.00, '积分分类', NULL, '/manager/promotion/pointsGoodsCategory*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1410862675914764290, 'admin', '2021-07-02 15:27:29', b'0', 'admin', '2021-07-27 16:06:26', 'null', 'distribution/distributionCash', '', 2, 'distributionCash', '1374173575405109248', 'distributionCash', 5.00, '分销提现', 'null', '/manager/distribution/cash*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1419926569920536578, 'admin', '2021-07-27 15:44:10', b'0', 'admin', '2021-07-27 16:07:10', NULL, 'customWords/index', NULL, 2, 'customWords', '1367050250249830400', 'customWords', 4.00, 'ES分词', NULL, '/manager/other/customWords*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1430799171593535490, 'admin', '2021-08-26 15:48:00', b'0', 'admin', '2021-12-02 20:21:34', NULL, 'promotions/kanjia/kanjia-activity-goods', NULL, 2, 'promotions/kanjia', '1367049214198022144', 'promotions/kanjia', 6.00, '砍价活动', NULL, '/manager/promotion/kanJiaGoods*');
|
||||||
|
INSERT INTO `li_menu` VALUES (1495665663207432193, 'admin', '2022-02-21 15:44:17', b'0', 'admin', '2022-02-21 15:45:44', NULL, 'distribution/distrbutionGrade', NULL, 2, 'distrbutionGrade', '1374173575405109248', 'distrbutionGrade', 0.00, '分销等级', NULL, '/manager/distrbutionGrade*');
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Navicat Premium Data Transfer
|
||||||
|
|
||||||
|
Source Server : lilishop
|
||||||
|
Source Server Type : MySQL
|
||||||
|
Source Server Version : 80025
|
||||||
|
Source Host : 192.168.0.116:3306
|
||||||
|
Source Schema : zhimai1
|
||||||
|
|
||||||
|
Target Server Type : MySQL
|
||||||
|
Target Server Version : 80025
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 01/03/2022 15:36:03
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for li_store_menu
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `li_store_menu`;
|
||||||
|
CREATE TABLE `li_store_menu` (
|
||||||
|
`id` bigint NOT NULL COMMENT 'ID',
|
||||||
|
`create_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建者',
|
||||||
|
`create_time` datetime(6) NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`delete_flag` bit(1) NULL DEFAULT NULL COMMENT '删除标志 true/false 删除/未删除',
|
||||||
|
`update_by` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '更新者',
|
||||||
|
`update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
|
||||||
|
`description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '说明备注',
|
||||||
|
`front_route` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '前端路由',
|
||||||
|
`icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '图标',
|
||||||
|
`level` int NULL DEFAULT NULL COMMENT '层级',
|
||||||
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '菜单/权限名称',
|
||||||
|
`parent_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '父id',
|
||||||
|
`path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '赋权API地址,正则表达式',
|
||||||
|
`sort_order` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '排序值',
|
||||||
|
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '菜单标题',
|
||||||
|
`permission` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '权限url',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = DYNAMIC;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of li_store_menu
|
||||||
|
-- ----------------------------
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1348810750596767744, NULL, '2022-01-11 22:35:33.000000', b'0', NULL, '2022-01-11 22:36:52', NULL, 'Main', 'ios-american-football', 0, 'goods', '0', '/', '1', '商品', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1348810864748945408, NULL, '2022-01-11 22:35:37.000000', b'0', NULL, '2022-01-11 22:36:55', NULL, 'Main', 'ios-american-football', 1, 'Main', '1348810750596767744', '/', '1.1', '商品管理', '');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349237129847005184, NULL, '2022-01-11 22:35:40.000000', b'0', NULL, '2022-01-11 22:36:59', NULL, 'goods-operation', 'ios-american-football', 2, 'goods-operation', '1348810864748945408', '/goods-operation', '1.11', '商品发布', '/store/goods/category*,/store/goods/categorySpec*,/store/goods/categoryParameters*,/store/goods/draftGoods*,/store/goods/label*,/store/goods/goods*,/store/goods/goodsUnit*,/store/goods/spec*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349237207378714624, NULL, '2022-01-11 22:35:42.000000', b'0', NULL, '2022-01-11 22:37:02', NULL, 'goods/goods-seller/goods', 'ios-american-football', 2, 'goods', '1348810864748945408', 'goods', '1.12', '商品列表', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349237928434098176, NULL, '2022-01-11 22:35:45.000000', b'0', NULL, '2022-01-11 22:37:05', NULL, 'goods/goods-seller/draftGoods', 'ios-american-football', 2, 'template-goods', '1348810864748945408', 'template-goods', '1.13', '商品模板', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349246048900243456, NULL, '2022-01-11 22:35:48.000000', b'0', NULL, '2022-01-11 22:37:08', NULL, 'goods/goods-manage/category', 'ios-american-football', 2, 'category', '1348810864748945408', 'category', '1.14', '店铺分类', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349246347597602816, NULL, '2022-01-11 22:35:51.000000', b'0', NULL, '2022-01-11 22:37:11', NULL, 'Main', 'ios-american-football', 0, 'order', '0', '/', '2', '订单', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349246468775239680, NULL, '2022-01-11 22:38:28.000000', b'0', NULL, '2022-01-11 22:38:31', NULL, 'Main', 'ios-american-football', 1, 'Main', '1349246347597602816', '/', '2.1', '订单管理', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349246671158796288, NULL, '2022-01-11 22:38:42.000000', b'0', NULL, '2022-01-11 22:38:35', NULL, 'order/order/orderList', 'ios-american-football', 2, 'orderList', '1349246468775239680', 'orderList', '2.11', '商品订单', '/store/order/order*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349246896661356544, NULL, '2022-01-11 22:40:27.000000', b'0', NULL, '2022-01-11 22:40:34', NULL, 'order/order/virtualOrderList', 'ios-american-football', 2, 'virtualOrderList', '1349246468775239680', 'virtualOrderList', '2.12', '虚拟订单', '/store/order/order*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349247081504333824, NULL, '2022-01-11 22:41:47.000000', b'0', NULL, '2022-01-11 22:41:50', NULL, 'Main', 'ios-american-football', 1, 'Main', '1349246347597602816', '/', '2.2', '评价管理', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349247640584085504, NULL, '2022-01-11 22:43:29.000000', b'0', NULL, '2022-01-11 22:45:47', NULL, 'member/memberComment', 'ios-american-football', 2, 'memberComment', '1349247081504333824', 'memberComment', '2.21', '评价管理', '/store/member/evaluation*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349254815809298432, NULL, '2022-01-11 22:45:35.000000', b'0', NULL, '2022-01-11 22:45:50', NULL, 'Main', 'ios-american-football', 1, 'Main', '1349246347597602816', '/', '2.3', '售后管理', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349255214977015808, NULL, '2022-01-11 22:49:22.000000', b'0', NULL, '2022-01-11 22:49:27', NULL, 'order/after-order/returnGoodsOrder', 'ios-american-football', 2, 'returnGoodsOrder', '1349254815809298432', 'returnGoodsOrder', '2.31', '退货管理', '/store/order/afterSale*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349255404425338880, NULL, '2022-01-11 22:51:20.000000', b'0', NULL, '2022-01-11 22:51:22', NULL, 'order/after-order/returnMoneyOrder', 'ios-american-football', 2, 'returnMoneyOrder', '1349254815809298432', 'returnMoneyOrder', '2.32', '退款管理', '/store/order/afterSale*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1349256082979840000, NULL, '2022-01-11 22:52:50.000000', b'0', NULL, '2022-01-11 22:52:55', NULL, 'order/after-order/orderComplaint', 'ios-american-football', 2, 'orderComplaint', '1349254815809298432', 'orderComplaint', '2.33', '投诉管理', '/store/order/complain*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1357584224760102912, NULL, '2022-01-11 23:02:20.000000', b'0', NULL, '2022-01-11 23:02:25', NULL, 'Main', 'ios-american-football', 0, 'bill', '0', '/', '3', '财务', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1357873097859923969, NULL, '2022-01-11 23:04:13.000000', b'0', NULL, '2022-01-11 23:04:17', NULL, 'Main', 'ios-american-football', 1, 'Main', '1357584224760102912', '/', '3.1', '财务管理', '');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367038467288072192, NULL, '2022-01-11 23:06:11.000000', b'0', NULL, '2022-01-11 23:06:16', NULL, 'shop/bill/accountStatementBill', 'ios-american-football', 2, 'accountStatementBill', '1357873097859923969', 'accountStatementBill', '3.11', '财务对账', '/store/order/bill*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367039534616805376, NULL, '2022-01-11 23:07:54.000000', b'0', NULL, '2022-01-11 23:07:57', NULL, 'shop/bill/storeBill', 'ios-american-football', 2, 'storeBill', '1357873097859923969', 'storeBill', '3.12', '店铺结算', '/store/order/bill*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367039950368800768, NULL, '2022-01-11 23:09:26.000000', b'0', NULL, '2022-01-11 23:09:29', NULL, 'Main', 'ios-american-football', 1, 'Main', '1357584224760102912', '/', '3.2', '发票管理', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367040067201138688, NULL, '2022-01-11 23:11:14.000000', b'0', NULL, '2022-01-11 23:11:18', NULL, 'order/receiptManager/receipt', 'ios-american-football', 2, 'receipt', '1367039950368800768', 'receipt', '3.21', '发票管理', '/store/trade/receipt*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367040599596728320, NULL, '2022-01-11 23:12:49.000000', b'0', NULL, '2022-01-11 23:12:52', NULL, 'Main', 'ios-american-football', 0, 'promotion', '0', '/', '4', '营销', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367040819248234496, NULL, '2022-01-11 23:14:35.000000', b'0', NULL, '2022-01-11 23:14:38', NULL, 'Main', 'ios-american-football', 1, 'Main', '1367040599596728320', '/', '4.1', '平台活动', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367041332861730816, NULL, '2022-01-11 23:15:42.000000', b'0', NULL, '2022-01-11 23:15:48', NULL, 'promotion/pintuan/pintuan', 'ios-american-football', 2, 'pintuan', '1367040819248234496', 'pintuan', '4.11', '拼团活动', '/store/promotion/pintuan*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367041461194850304, NULL, '2022-01-11 23:17:32.000000', b'0', NULL, '2022-01-11 23:17:44', NULL, 'promotion/seckill/seckill', 'ios-american-football', 2, 'seckill', '1367040819248234496', 'seckill', '4.12', '秒杀活动', '/store/promotion/seckill*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367041575619657728, NULL, '2022-01-11 23:20:19.000000', b'0', NULL, '2022-01-11 23:20:24', NULL, 'Main', 'ios-american-football', 1, 'Main', '1367040599596728320', '/', '4.2', '直播活动', '');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367042490443497472, NULL, '2022-01-11 23:21:13.000000', b'0', NULL, '2022-01-11 23:21:22', NULL, 'promotion/live/live', 'ios-american-football', 2, 'live', '1367041575619657728', 'live', '4.21', '直播管理', '/store/broadcast/studio*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367042664410644480, NULL, '2022-01-11 23:22:42.000000', b'0', NULL, '2022-01-11 23:22:59', NULL, 'promotion/live/liveGoods', 'ios-american-football', 2, 'liveGoods', '1367041575619657728', 'liveGoods', '4.22', '直播商品', '/store/broadcast/commodity*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367042804944994304, NULL, '2022-01-11 23:24:24.000000', b'0', NULL, '2022-01-11 23:24:38', NULL, 'Main', 'ios-american-football', 1, 'Main', '1367040599596728320', '/', '4.3', '商家活动', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367042804944994305, NULL, '2022-01-11 23:24:29.000000', b'0', NULL, '2022-01-11 23:24:42', NULL, 'promotion/full-discount/full-discount', 'ios-american-football', 2, 'full-cut', '1367042804944994304', 'full-discount', '4.31', '满额活动', '/store/promotion/fullDiscount*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367042917113266176, NULL, '2022-01-11 23:26:45.000000', b'0', NULL, '2022-01-11 23:26:50', NULL, 'promotion/coupon/coupon', 'ios-american-football', 2, 'coupon', '1367042804944994304', 'coupon', '4.32', '优惠券', '/store/promotion/coupon*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367043020976816128, NULL, '2022-01-11 23:28:50.000000', b'0', NULL, '2022-01-11 23:29:02', NULL, 'Main', 'ios-american-football', 1, 'Main', '1367040599596728320', '/', '4.4', '分销管理', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367043443917848576, NULL, '2022-01-11 23:28:53.000000', b'0', NULL, '2022-01-11 23:29:04', NULL, 'distribution/distributionGoods', 'ios-american-football', 2, 'distributionGoods', '1367043020976816128', 'distributionGoods', '4.41', '分销商品', '/store/distribution/goods*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367043505771249664, NULL, '2022-01-11 23:28:56.000000', b'0', NULL, '2022-01-11 23:29:07', NULL, 'distribution/distributionOrder', 'ios-american-football', 2, 'distributionOrder', '1367043020976816128', 'distributionOrderdistributionOrder', '4.42', '分销订单', '/store/distribution/order*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367044121163726848, NULL, '2022-01-12 21:47:03.000000', b'0', NULL, '2022-01-12 21:47:25', NULL, 'Main', 'ios-american-football', 0, 'statistics', '0', '/', '5', '统计', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367044247978508288, NULL, '2022-01-12 21:47:19.000000', b'0', NULL, '2022-01-12 21:47:28', NULL, 'Main', 'ios-american-football', 1, 'Main', '1367044121163726848', '/', '5.1', '统计管理', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367044376391319552, NULL, '2022-01-12 21:49:45.000000', b'0', NULL, '2022-01-12 21:50:01', NULL, 'statistics/goods', 'ios-american-football', 2, 'goodsStatistics', '1367044247978508288', 'goodsStatistics', '5.11', '商品统计', '/store/statistics/goods*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367044657296441344, NULL, '2022-01-12 21:49:48.000000', b'0', NULL, '2022-01-12 21:49:58', NULL, 'statistics/order', 'ios-american-football', 2, 'orderStatistics', '1367044247978508288', 'orderStatistics', '5.12', '订单统计', '/store/statistics/order*,/store/statistics/order*,/store/statistics/order*,/store/statistics/order*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367045529720061952, NULL, '2022-01-12 21:49:51.000000', b'0', NULL, '2022-01-12 21:50:03', NULL, 'statistics/traffic', 'ios-american-football', 2, 'trafficStatistics', '1367044247978508288', 'trafficStatistics', '5.13', '流量统计', '/store/statistics/view*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367045630710513664, NULL, '2022-01-12 21:52:59.000000', b'0', NULL, '2022-01-12 21:53:09', NULL, 'Main', 'ios-american-football', 0, 'settings', '0', '/', '6', '设置', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367045794284175360, NULL, '2022-01-12 21:53:03.000000', b'0', NULL, '2022-01-12 21:53:12', NULL, 'Main', 'ios-american-football', 1, 'Main', '1367045630710513664', '/', '6.1', '配送设置', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367045921434501120, NULL, '2022-01-12 21:55:49.000000', b'0', NULL, '2022-01-12 21:55:52', NULL, 'shop/ship/shipTemplate', 'ios-american-football', 2, 'shipTemplate', '1367045794284175360', 'shipTemplate', '6.11', '配送模板', '/store/setting/freightTemplate*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367046068369358848, NULL, '2022-01-12 21:58:05.000000', b'0', NULL, '2022-01-12 21:58:13', NULL, 'shop/ship/logistics', 'ios-american-football', 2, 'logistics', '1367045794284175360', 'logistics', '6.12', '物流公司', '/store/other/logistics*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367046266214678528, NULL, '2022-01-12 21:59:07.000000', b'0', NULL, '2022-01-12 21:59:43', NULL, 'Main', 'ios-american-football', 1, 'Main', '1367045630710513664', '/', '6.2', '店铺管理', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367048084701315072, NULL, '2022-01-12 21:59:32.000000', b'0', NULL, '2022-01-12 21:59:48', NULL, 'shop/shopSetting', 'ios-american-football', 2, 'shopSetting', '1367046266214678528', 'shopSetting', '6.21', '店铺设置', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367048684339986432, NULL, '2022-01-12 21:59:36.000000', b'0', NULL, '2022-01-12 21:59:51', NULL, 'shop/shopAddress', 'ios-american-football', 2, 'shopAddress', '1367046266214678528', 'shopAddress', '6.22', '自提管理', '/store/member/storeAddress*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367048754229673984, NULL, '2022-01-12 22:02:11.000000', b'0', NULL, '2022-01-12 22:04:36', NULL, 'Main', 'ios-american-football', 0, 'Main', '0', '/', '7', '消息', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367048832210173952, NULL, '2022-01-12 22:02:49.000000', b'0', NULL, '2022-01-12 22:04:39', NULL, 'Main', 'ios-american-football', 1, 'Main', '1367048754229673984', '/', '7.1', '系统消息', NULL);
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367048967635861503, NULL, '2022-02-18 16:08:30.000000', b'0', NULL, '2022-02-18 16:08:36', NULL, 'Main', 'ios-american-football', 1, 'Main', '1367045630710513664', '/', '6.3', '店员设置', '');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367048967635861504, NULL, '2022-01-12 22:02:51.000000', b'0', NULL, '2022-01-12 22:04:45', NULL, 'message', 'ios-american-football', 2, 'message_index', '1367048832210173952', 'message', '7.11', '系统消息', '/store/message/storeMessage*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367048967635861505, NULL, '2022-02-18 16:12:18.000000', b'0', NULL, '2022-02-18 16:12:21', NULL, 'shop/system/clerk/clerkManage', 'ios-american-football', 2, '\nclerkManage', '1367048967635861503', '\nclerkManage', '6.31', '店员管理', '/store/department*,/store/clerk*,/store/role*,/store/department*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367048967635861506, NULL, '2022-02-18 16:25:27.000000', NULL, NULL, '2022-02-18 16:25:31', NULL, 'shop/system/department/storeDepartmentManage', 'ios-american-football', 2, 'storeDepartmentManage', '1367048967635861503', 'storeDepartmentManage', '6.32', '部门管理', '/store/department*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367048967635861507, NULL, '2022-02-18 16:27:28.000000', NULL, NULL, '2022-02-18 16:27:30', NULL, 'shop/system/role/storeRoleManage', 'ios-american-football', 2, 'storeRoleManage', '1367048967635861503', 'storeRoleManage', '6.33', '角色权限', '/store/role*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367048967635861510, NULL, '2022-03-07 14:45:10.000000', b'0', NULL, '2022-03-07 14:45:13', NULL, 'shop/floorList', 'ios-american-football', 2, 'floorList', '1367046266214678528', 'floorList', '6.23', 'PC端', '/store/other/pageData*');
|
||||||
|
INSERT INTO `li_store_menu` VALUES (1367048967635861511, NULL, '2022-03-07 15:13:52.000000', b'0', NULL, '2022-03-07 15:13:55', NULL, 'shop/wap/wapList', 'ios-american-football', 2, 'wapList', '1367046266214678528', 'wapList', '6.24', '移动端', '/store/other/pageData*');
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
|
||||||
|
|
||||||
|
insert li_clerk(id,create_by,create_time,store_id,clerk_name,member_id,shopkeeper,is_super,`status`) select id,member_name,current_date(),id,member_name,member_id ,TRUE,TRUE,TRUE from li_store
|
||||||
|
|
||||||
|
|
@ -44,3 +44,8 @@ CREATE TABLE `li_wholesale`
|
|||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT '批发规则表';
|
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT '批发规则表';
|
||||||
|
|
||||||
|
ALTER TABLE li_wholesale
|
||||||
|
ADD template_id bigint DEFAULT NULL COMMENT '商品模版id';
|
||||||
|
|
||||||
|
/** 店铺--默认页面是否开启**/
|
||||||
|
ALTER TABLE li_store ADD page_show bit(1) DEFAULT NULL COMMENT '默认页面是否开启';
|
22
README.md
22
README.md
@ -2,19 +2,14 @@
|
|||||||
|
|
||||||
#### 欢迎交流需求,交流业务,交流技术(基础问题自行解决,其他问题先看文档后提问)
|
#### 欢迎交流需求,交流业务,交流技术(基础问题自行解决,其他问题先看文档后提问)
|
||||||
|
|
||||||
|
#### 不用削尖脑袋往老群里加,老群活跃度较低,很多潜水党,新群相对而言活跃一些 :tw-1f606: :tw-1f606: :tw-1f606: :tw-1f606: :tw-1f606: :tw-1f606:
|
||||||
|
|
||||||
|
#### PS: **演示站点所有环境均部署master分支。如果有演示站点问题,可以反馈,如果演示站点没问题本地运行有问题,需自行处理**
|
||||||
|
|
||||||
##### 交流 qq 1群 961316482(已满)
|
##### 交流 qq 1群 961316482(已满)
|
||||||
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=BAhURE3DG2YWhQk6kRxVapbLykqMoPS8&jump_from=webapi"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="Lilishop交流群" title="Lilishop交流群">点击快捷加群</a>
|
|
||||||
|
|
||||||
##### 交流 qq 2群 875294241(已满)
|
##### 交流 qq 2群 875294241(已满)
|
||||||
|
##### 交流 qq 3群 263785057(已满)
|
||||||
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=_lrekOvr5k2p5uTn5GRidI-chKEmpCX3&jump_from=webapi"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="Lilishop交流群2群" title="Lilishop交流群2群">点击快捷加群</a>
|
##### 交流 qq 4群 674617534
|
||||||
|
|
||||||
|
|
||||||
##### 交流 qq 3群 263785057
|
|
||||||
|
|
||||||
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=VUogkDvaso4zLTFH8nxFPDRKq0EthUn1&jump_from=webapi"><img border="0" src="//pub.idqqimg.com/wpa/images/group.png" alt="Lilishop交流群3群" title="Lilishop交流群3群">点击快捷加群</a>
|
|
||||||
|
|
||||||
|
|
||||||
##### 体验 公众号/小程序/APP 体验,扫描二维码
|
##### 体验 公众号/小程序/APP 体验,扫描二维码
|
||||||
|
|
||||||
@ -166,6 +161,7 @@ PS:手机验证码为 ‘111111’
|
|||||||
|
|
||||||
### 交流群
|
### 交流群
|
||||||
|
|
||||||
##### 官方qq 1群 961316482(已满)
|
##### 交流 qq 1群 961316482(已满)
|
||||||
##### 官方qq 2群 875294241(已满)
|
##### 交流 qq 2群 875294241(已满)
|
||||||
##### 官网qq 3群 263785057
|
##### 交流 qq 3群 263785057(已满)
|
||||||
|
##### 交流 qq 4群 674617534
|
||||||
|
@ -32,10 +32,10 @@
|
|||||||
<artifactId>logstash-logback-encoder</artifactId>
|
<artifactId>logstash-logback-encoder</artifactId>
|
||||||
<version>${logstash-logback-encoder}</version>
|
<version>${logstash-logback-encoder}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- <dependency>-->
|
<!-- <dependency>-->
|
||||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||||
<!-- <artifactId>spring-boot-starter-mail</artifactId>-->
|
<!-- <artifactId>spring-boot-starter-mail</artifactId>-->
|
||||||
<!-- </dependency> -->
|
<!-- </dependency> -->
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -16,5 +16,6 @@ spring.mail.username=1814994716@qq.com
|
|||||||
spring.mail.password=abcdefg123456!@#$%^
|
spring.mail.password=abcdefg123456!@#$%^
|
||||||
# 日志文件路径
|
# 日志文件路径
|
||||||
logging.file.path=lili-logs/admin
|
logging.file.path=lili-logs/admin
|
||||||
|
lili.data.logstash.server=106.124.130.167:4560
|
||||||
# 文件格式
|
# 文件格式
|
||||||
logging.pattern.file=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(${PID}){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wEx
|
logging.pattern.file=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(${PID}){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wEx
|
||||||
|
@ -48,7 +48,7 @@ public class MemberEvaluationBuyerController {
|
|||||||
@ApiOperation(value = "查看会员评价详情")
|
@ApiOperation(value = "查看会员评价详情")
|
||||||
@ApiImplicitParam(name = "id", value = "评价ID", required = true, paramType = "path")
|
@ApiImplicitParam(name = "id", value = "评价ID", required = true, paramType = "path")
|
||||||
@GetMapping(value = "/get/{id}")
|
@GetMapping(value = "/get/{id}")
|
||||||
public ResultMessage<MemberEvaluationVO> save(@NotNull(message = "评价ID不能为空") @PathVariable("id") String id) {
|
public ResultMessage<MemberEvaluationVO> get(@NotNull(message = "评价ID不能为空") @PathVariable("id") String id) {
|
||||||
return ResultUtil.data(memberEvaluationService.queryById(id));
|
return ResultUtil.data(memberEvaluationService.queryById(id));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ public class OrderComplaintBuyerController {
|
|||||||
@PostMapping("/communication")
|
@PostMapping("/communication")
|
||||||
public ResultMessage<OrderComplaintCommunicationVO> addCommunication(@RequestParam String complainId, @RequestParam String content) {
|
public ResultMessage<OrderComplaintCommunicationVO> addCommunication(@RequestParam String complainId, @RequestParam String content) {
|
||||||
AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser());
|
AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser());
|
||||||
OrderComplaintCommunicationVO communicationVO = new OrderComplaintCommunicationVO(complainId, content, CommunicationOwnerEnum.BUYER.name(), currentUser.getId(), currentUser.getNickName());
|
OrderComplaintCommunicationVO communicationVO = new OrderComplaintCommunicationVO(complainId, content, CommunicationOwnerEnum.BUYER.name(), currentUser.getNickName(), currentUser.getId());
|
||||||
orderComplaintCommunicationService.addCommunication(communicationVO);
|
orderComplaintCommunicationService.addCommunication(communicationVO);
|
||||||
return ResultUtil.data(communicationVO);
|
return ResultUtil.data(communicationVO);
|
||||||
}
|
}
|
||||||
|
@ -2,17 +2,17 @@ package cn.lili.controller.other;
|
|||||||
|
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
|
import cn.lili.modules.page.entity.dos.PageData;
|
||||||
import cn.lili.modules.page.entity.dto.PageDataDTO;
|
import cn.lili.modules.page.entity.dto.PageDataDTO;
|
||||||
import cn.lili.modules.page.entity.enums.PageEnum;
|
import cn.lili.modules.page.entity.enums.PageEnum;
|
||||||
import cn.lili.modules.page.entity.vos.PageDataVO;
|
import cn.lili.modules.page.entity.vos.PageDataVO;
|
||||||
import cn.lili.modules.page.service.PageDataService;
|
import cn.lili.modules.page.service.PageDataService;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 买家端,页面接口
|
* 买家端,页面接口
|
||||||
@ -36,12 +36,63 @@ public class PageBuyerController {
|
|||||||
public ResultMessage<PageDataVO> getIndex(@RequestParam String clientType) {
|
public ResultMessage<PageDataVO> getIndex(@RequestParam String clientType) {
|
||||||
PageDataDTO pageDataDTO = new PageDataDTO(PageEnum.INDEX.name());
|
PageDataDTO pageDataDTO = new PageDataDTO(PageEnum.INDEX.name());
|
||||||
pageDataDTO.setPageClientType(clientType);
|
pageDataDTO.setPageClientType(clientType);
|
||||||
return ResultUtil.data(pageService.getPageData(pageDataDTO));
|
PageDataVO pageDataVO=pageService.getPageData(pageDataDTO);
|
||||||
|
return ResultUtil.data(pageDataVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "获取页面数据")
|
@ApiOperation(value = "获取页面数据")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public ResultMessage<PageDataVO> get(PageDataDTO pageDataDTO) {
|
public ResultMessage<PageDataVO> get(PageDataDTO pageDataDTO) {
|
||||||
return ResultUtil.data(pageService.getPageData(pageDataDTO));
|
PageDataVO pageDataVO=pageService.getPageData(pageDataDTO);
|
||||||
|
return ResultUtil.data(pageDataVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取店铺首页")
|
||||||
|
@GetMapping("/getStore")
|
||||||
|
public ResultMessage<PageDataVO> getShopPage(@RequestParam String clientType,String storeId) {
|
||||||
|
PageDataDTO pageDataDTO = new PageDataDTO(PageEnum.STORE.name());
|
||||||
|
pageDataDTO.setPageClientType(clientType);
|
||||||
|
pageDataDTO.setNum(storeId);
|
||||||
|
PageDataVO pageDataVO=pageService.getPageData(pageDataDTO);
|
||||||
|
return ResultUtil.data(pageDataVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取页面数据")
|
||||||
|
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "String", paramType = "path")
|
||||||
|
@GetMapping("/get/{id}")
|
||||||
|
public ResultMessage<PageData> getPage(@PathVariable("id") String id) {
|
||||||
|
return ResultUtil.data(pageService.getSpecial(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取专题页面数据(根据消息内容得知)")
|
||||||
|
@GetMapping("/getSpecial")
|
||||||
|
public ResultMessage<PageData> getSpecial(@RequestParam String body) {
|
||||||
|
String name = "";
|
||||||
|
if (body.indexOf("』") >= 0 && body.indexOf("『") >= 0) {
|
||||||
|
name = body.substring(body.indexOf("『") + 1, body.lastIndexOf("』"));
|
||||||
|
} else if (body.indexOf("〉") >= 0 && body.indexOf("〈") >= 0) {
|
||||||
|
name = body.substring(body.indexOf("〈") + 1, body.lastIndexOf("〉"));
|
||||||
|
} else if (body.indexOf("」") >= 0 && body.indexOf("「") >= 0) {
|
||||||
|
name = body.substring(body.indexOf("「") + 1, body.lastIndexOf("」"));
|
||||||
|
} else if (body.indexOf("》") >= 0 && body.indexOf("《") >= 0) {
|
||||||
|
name = body.substring(body.indexOf("《") + 1, body.lastIndexOf("》"));
|
||||||
|
} else if (body.indexOf(")") >= 0 && body.indexOf("(") >= 0) {
|
||||||
|
name = body.substring(body.indexOf("(") + 1, body.lastIndexOf(")"));
|
||||||
|
} else if (body.indexOf("】") >= 0 && body.indexOf("【") >= 0) {
|
||||||
|
name = body.substring(body.indexOf("【") + 1, body.lastIndexOf("】"));
|
||||||
|
} else if (body.indexOf("}") >= 0 && body.indexOf("{") >= 0) {
|
||||||
|
name = body.substring(body.indexOf("{") + 1, body.lastIndexOf("}"));
|
||||||
|
} else if (body.indexOf("!") >= 0) {
|
||||||
|
name = body.substring(body.indexOf("!") + 1, body.lastIndexOf("!"));
|
||||||
|
} else if (body.indexOf("|") >= 0) {
|
||||||
|
name = body.substring(body.indexOf("|") + 1, body.lastIndexOf("|"));
|
||||||
|
}
|
||||||
|
|
||||||
|
PageData pageData = pageService.getOne(
|
||||||
|
new LambdaQueryWrapper<PageData>()
|
||||||
|
.eq(PageData::getPageType, PageEnum.SPECIAL.name())
|
||||||
|
.eq(PageData::getName, name));
|
||||||
|
return ResultUtil.data(pageData);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,8 @@ import cn.lili.common.security.enums.UserEnums;
|
|||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.member.entity.dos.Member;
|
import cn.lili.modules.member.entity.dos.Member;
|
||||||
import cn.lili.modules.member.entity.dto.MemberEditDTO;
|
import cn.lili.modules.member.entity.dto.MemberEditDTO;
|
||||||
|
import cn.lili.modules.member.entity.enums.QRCodeLoginSessionStatusEnum;
|
||||||
|
import cn.lili.modules.member.entity.vo.QRLoginResultVo;
|
||||||
import cn.lili.modules.member.service.MemberService;
|
import cn.lili.modules.member.service.MemberService;
|
||||||
import cn.lili.modules.sms.SmsUtil;
|
import cn.lili.modules.sms.SmsUtil;
|
||||||
import cn.lili.modules.verification.entity.enums.VerificationEnums;
|
import cn.lili.modules.verification.entity.enums.VerificationEnums;
|
||||||
@ -15,10 +17,18 @@ import io.swagger.annotations.Api;
|
|||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.context.request.async.DeferredResult;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 买家端,会员接口
|
* 买家端,会员接口
|
||||||
@ -26,6 +36,7 @@ import javax.validation.constraints.NotNull;
|
|||||||
* @author Chopper
|
* @author Chopper
|
||||||
* @since 2020/11/16 10:07 下午
|
* @since 2020/11/16 10:07 下午
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,会员接口")
|
@Api(tags = "买家端,会员接口")
|
||||||
@RequestMapping("/buyer/passport/member")
|
@RequestMapping("/buyer/passport/member")
|
||||||
@ -39,6 +50,73 @@ public class MemberBuyerController {
|
|||||||
private VerificationService verificationService;
|
private VerificationService verificationService;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "web-获取登录二维码")
|
||||||
|
@PostMapping(value = "/pc_session", produces = "application/json;charset=UTF-8")
|
||||||
|
public ResultMessage<Object> createPcSession() {
|
||||||
|
return ResultUtil.data(memberService.createPcSession());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 长轮询:参考nacos
|
||||||
|
*
|
||||||
|
* @param token
|
||||||
|
* @param beforeSessionStatus 上次记录的session状态
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "web-二维码登录")
|
||||||
|
@PostMapping(value = "/session_login/{token}", produces = "application/json;charset=UTF-8")
|
||||||
|
public Object loginWithSession(@PathVariable("token") String token, Integer beforeSessionStatus) {
|
||||||
|
log.info("receive login with session key {}", token);
|
||||||
|
ResponseEntity<ResultMessage<Object>> timeoutResponseEntity =
|
||||||
|
new ResponseEntity<>(ResultUtil.error(ResultCode.ERROR), HttpStatus.OK);
|
||||||
|
int timeoutSecond = 20;
|
||||||
|
DeferredResult<ResponseEntity<Object>> deferredResult = new DeferredResult<>(timeoutSecond * 1000L, timeoutResponseEntity);
|
||||||
|
CompletableFuture.runAsync(() -> {
|
||||||
|
try {
|
||||||
|
int i = 0;
|
||||||
|
while (i < timeoutSecond) {
|
||||||
|
QRLoginResultVo queryResult = memberService.loginWithSession(token);
|
||||||
|
int status = queryResult.getStatus();
|
||||||
|
if (status == beforeSessionStatus
|
||||||
|
&& (QRCodeLoginSessionStatusEnum.WAIT_SCANNING.getCode() == status
|
||||||
|
|| QRCodeLoginSessionStatusEnum.SCANNING.getCode() == status)) {
|
||||||
|
//睡眠一秒种,继续等待结果
|
||||||
|
TimeUnit.SECONDS.sleep(1);
|
||||||
|
} else {
|
||||||
|
deferredResult.setResult(new ResponseEntity<>(ResultUtil.data(queryResult), HttpStatus.OK));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("获取登录状态异常,", e);
|
||||||
|
deferredResult.setResult(new ResponseEntity<>(ResultUtil.error(ResultCode.ERROR), HttpStatus.OK));
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
|
}
|
||||||
|
}, Executors.newCachedThreadPool());
|
||||||
|
return deferredResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "app扫码")
|
||||||
|
@PostMapping(value = "/app_scanner", produces = "application/json;charset=UTF-8")
|
||||||
|
public ResultMessage<Object> appScanner(String token) {
|
||||||
|
return ResultUtil.data(memberService.appScanner(token));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "app扫码-登录确认:同意/拒绝")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "token", value = "sessionToken", required = true, paramType = "query"),
|
||||||
|
@ApiImplicitParam(name = "code", value = "操作:0拒绝登录,1同意登录", required = true, paramType = "query")
|
||||||
|
})
|
||||||
|
@PostMapping(value = "/app_confirm", produces = "application/json;charset=UTF-8")
|
||||||
|
public ResultMessage<Object> appSConfirm(String token, Integer code) {
|
||||||
|
boolean flag = memberService.appSConfirm(token, code);
|
||||||
|
return flag ? ResultUtil.success() : ResultUtil.error(ResultCode.ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "登录接口")
|
@ApiOperation(value = "登录接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "username", value = "用户名", required = true, paramType = "query"),
|
@ApiImplicitParam(name = "username", value = "用户名", required = true, paramType = "query"),
|
||||||
|
0
buyer-api/src/main/java/cn/lili/security/BuyerAuthenticationFilter.java
Executable file → Normal file
0
buyer-api/src/main/java/cn/lili/security/BuyerAuthenticationFilter.java
Executable file → Normal file
@ -1,36 +0,0 @@
|
|||||||
package cn.lili.controller.common;
|
|
||||||
|
|
||||||
import cn.lili.common.enums.ResultUtil;
|
|
||||||
import cn.lili.common.vo.ResultMessage;
|
|
||||||
import cn.lili.modules.system.entity.enums.SettingEnum;
|
|
||||||
import cn.lili.modules.system.service.SettingService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件管理管理接口
|
|
||||||
*
|
|
||||||
* @author Chopper
|
|
||||||
* @since 2020/11/26 15:41
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@Api(tags = "文件管理接口")
|
|
||||||
@RequestMapping("/common/common/logo")
|
|
||||||
public class LogoController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SettingService settingService;
|
|
||||||
|
|
||||||
@ApiOperation(value = "获取logo")
|
|
||||||
@GetMapping
|
|
||||||
public ResultMessage<Object> getFileList() {
|
|
||||||
return ResultUtil.data(settingService.get(SettingEnum.BASE_SETTING.name()));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -11,23 +11,25 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 滑块验证码接口
|
* 站点基础配置获取
|
||||||
*
|
*
|
||||||
* @author Chopper
|
* @author liushuai(liushuai711 @ gmail.com)
|
||||||
* @since 2020/11/26 15:41
|
* @version v4.0
|
||||||
|
* @Description:
|
||||||
|
* @since 2022/9/22 17:49
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/common/common/site")
|
@RequestMapping("/common/common/site")
|
||||||
@Api(tags = "系统基础接口")
|
@Api(tags = "站点基础接口")
|
||||||
public class SiteController {
|
public class SiteController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SettingService settingService;
|
private SettingService settingService;
|
||||||
|
|
||||||
@ApiOperation(value = "获取系统基础信息")
|
@ApiOperation(value = "获取站点基础信息")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public ResultMessage<Object> getFileList() {
|
public ResultMessage<Object> baseSetting() {
|
||||||
return ResultUtil.data(settingService.get(SettingEnum.BASE_SETTING.name()));
|
return ResultUtil.data(settingService.get(SettingEnum.BASE_SETTING.name()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,43 +1,43 @@
|
|||||||
package cn.lili.controller.common;
|
package cn.lili.controller.common;
|
||||||
|
|
||||||
import cn.lili.cache.limit.annotation.LimitPoint;
|
import cn.lili.cache.limit.annotation.LimitPoint;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.verification.entity.enums.VerificationEnums;
|
import cn.lili.modules.verification.entity.enums.VerificationEnums;
|
||||||
import cn.lili.modules.verification.service.VerificationService;
|
import cn.lili.modules.verification.service.VerificationService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 滑块验证码接口
|
* 滑块验证码接口
|
||||||
*
|
*
|
||||||
* @author Chopper
|
* @author Chopper
|
||||||
* @since 2020/11/26 15:41
|
* @since 2020/11/26 15:41
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/common/common/slider")
|
@RequestMapping("/common/common/slider")
|
||||||
@Api(tags = "滑块验证码接口")
|
@Api(tags = "滑块验证码接口")
|
||||||
public class SliderImageController {
|
public class SliderImageController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private VerificationService verificationService;
|
private VerificationService verificationService;
|
||||||
|
|
||||||
@LimitPoint(name = "slider_image", key = "verification")
|
@LimitPoint(name = "slider_image", key = "verification")
|
||||||
@GetMapping("/{verificationEnums}")
|
@GetMapping("/{verificationEnums}")
|
||||||
@ApiOperation(value = "获取校验接口,一分钟同一个ip请求10次")
|
@ApiOperation(value = "获取校验接口,一分钟同一个ip请求10次")
|
||||||
public ResultMessage getSliderImage(@RequestHeader String uuid, @PathVariable VerificationEnums verificationEnums) {
|
public ResultMessage getSliderImage(@RequestHeader String uuid, @PathVariable VerificationEnums verificationEnums) {
|
||||||
return ResultUtil.data(verificationService.createVerification(verificationEnums, uuid));
|
return ResultUtil.data(verificationService.createVerification(verificationEnums, uuid));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@LimitPoint(name = "slider_image", key = "verification_pre_check", limit = 600)
|
@LimitPoint(name = "slider_image", key = "verification_pre_check", limit = 600)
|
||||||
@PostMapping("/{verificationEnums}")
|
@PostMapping("/{verificationEnums}")
|
||||||
@ApiOperation(value = "验证码预校验")
|
@ApiOperation(value = "验证码预校验")
|
||||||
public ResultMessage verificationImage(Integer xPos, @RequestHeader String uuid, @PathVariable VerificationEnums verificationEnums) {
|
public ResultMessage verificationImage(Integer xPos, @RequestHeader String uuid, @PathVariable VerificationEnums verificationEnums) {
|
||||||
return ResultUtil.data(verificationService.preCheck(xPos, uuid, verificationEnums));
|
return ResultUtil.data(verificationService.preCheck(xPos, uuid, verificationEnums));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,48 +1,48 @@
|
|||||||
package cn.lili.controller.common;
|
package cn.lili.controller.common;
|
||||||
|
|
||||||
import cn.lili.cache.limit.annotation.LimitPoint;
|
import cn.lili.cache.limit.annotation.LimitPoint;
|
||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.sms.SmsUtil;
|
import cn.lili.modules.sms.SmsUtil;
|
||||||
import cn.lili.modules.verification.entity.enums.VerificationEnums;
|
import cn.lili.modules.verification.entity.enums.VerificationEnums;
|
||||||
import cn.lili.modules.verification.service.VerificationService;
|
import cn.lili.modules.verification.service.VerificationService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 短信验证码接口
|
* 短信验证码接口
|
||||||
*
|
*
|
||||||
* @author Chopper
|
* @author Chopper
|
||||||
* @since 2020/11/26 15:41
|
* @since 2020/11/26 15:41
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "短信验证码接口")
|
@Api(tags = "短信验证码接口")
|
||||||
@RequestMapping("/common/common/sms")
|
@RequestMapping("/common/common/sms")
|
||||||
public class SmsController {
|
public class SmsController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SmsUtil smsUtil;
|
private SmsUtil smsUtil;
|
||||||
@Autowired
|
@Autowired
|
||||||
private VerificationService verificationService;
|
private VerificationService verificationService;
|
||||||
|
|
||||||
@LimitPoint(name = "sms_send", key = "sms")
|
@LimitPoint(name = "sms_send", key = "sms")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(paramType = "path", dataType = "String", name = "mobile", value = "手机号"),
|
@ApiImplicitParam(paramType = "path", dataType = "String", name = "mobile", value = "手机号"),
|
||||||
@ApiImplicitParam(paramType = "header", dataType = "String", name = "uuid", value = "uuid"),
|
@ApiImplicitParam(paramType = "header", dataType = "String", name = "uuid", value = "uuid"),
|
||||||
})
|
})
|
||||||
@GetMapping("/{verificationEnums}/{mobile}")
|
@GetMapping("/{verificationEnums}/{mobile}")
|
||||||
@ApiOperation(value = "发送短信验证码,一分钟同一个ip请求1次")
|
@ApiOperation(value = "发送短信验证码,一分钟同一个ip请求1次")
|
||||||
public ResultMessage getSmsCode(
|
public ResultMessage getSmsCode(
|
||||||
@RequestHeader String uuid,
|
@RequestHeader String uuid,
|
||||||
@PathVariable String mobile,
|
@PathVariable String mobile,
|
||||||
@PathVariable VerificationEnums verificationEnums) {
|
@PathVariable VerificationEnums verificationEnums) {
|
||||||
verificationService.check(uuid, verificationEnums);
|
verificationService.check(uuid, verificationEnums);
|
||||||
smsUtil.sendSmsCode(mobile, verificationEnums, uuid);
|
smsUtil.sendSmsCode(mobile, verificationEnums, uuid);
|
||||||
return ResultUtil.success(ResultCode.VERIFICATION_SEND_SUCCESS);
|
return ResultUtil.success(ResultCode.VERIFICATION_SEND_SUCCESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,6 @@ import cn.lili.common.utils.Base64DecodeMultipartFile;
|
|||||||
import cn.lili.common.utils.CommonUtil;
|
import cn.lili.common.utils.CommonUtil;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.file.entity.File;
|
import cn.lili.modules.file.entity.File;
|
||||||
import cn.lili.modules.file.plugin.FilePlugin;
|
|
||||||
import cn.lili.modules.file.plugin.FilePluginFactory;
|
import cn.lili.modules.file.plugin.FilePluginFactory;
|
||||||
import cn.lili.modules.file.service.FileService;
|
import cn.lili.modules.file.service.FileService;
|
||||||
import cn.lili.modules.system.entity.dos.Setting;
|
import cn.lili.modules.system.entity.dos.Setting;
|
||||||
@ -64,11 +63,14 @@ public class UploadController {
|
|||||||
if (authUser == null) {
|
if (authUser == null) {
|
||||||
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
|
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
|
||||||
}
|
}
|
||||||
|
if (file == null) {
|
||||||
|
throw new ServiceException(ResultCode.FILE_NOT_EXIST_ERROR);
|
||||||
|
}
|
||||||
Setting setting = settingService.get(SettingEnum.OSS_SETTING.name());
|
Setting setting = settingService.get(SettingEnum.OSS_SETTING.name());
|
||||||
if (setting == null || CharSequenceUtil.isBlank(setting.getSettingValue())) {
|
if (setting == null || CharSequenceUtil.isBlank(setting.getSettingValue())) {
|
||||||
throw new ServiceException(ResultCode.OSS_NOT_EXIST);
|
throw new ServiceException(ResultCode.OSS_NOT_EXIST);
|
||||||
}
|
}
|
||||||
if (file == null || CharSequenceUtil.isEmpty(file.getContentType())) {
|
if (CharSequenceUtil.isEmpty(file.getContentType())) {
|
||||||
throw new ServiceException(ResultCode.IMAGE_FILE_EXT_ERROR);
|
throw new ServiceException(ResultCode.IMAGE_FILE_EXT_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
package cn.lili.controller.security;
|
package cn.lili.controller.security;
|
||||||
|
|
||||||
import cn.lili.cache.Cache;
|
|
||||||
import cn.lili.common.security.CustomAccessDeniedHandler;
|
|
||||||
import cn.lili.common.properties.IgnoredUrlsProperties;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
@ -25,19 +22,10 @@ import org.springframework.web.cors.CorsConfigurationSource;
|
|||||||
public class CommonSecurityConfig extends WebSecurityConfigurerAdapter {
|
public class CommonSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 忽略验权配置
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
private IgnoredUrlsProperties ignoredUrlsProperties;
|
|
||||||
/**
|
/**
|
||||||
* spring security -》 权限不足处理
|
* spring security -》 权限不足处理
|
||||||
*/
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
private CustomAccessDeniedHandler accessDeniedHandler;
|
|
||||||
@Autowired
|
|
||||||
private Cache<String> cache;
|
|
||||||
@Autowired
|
|
||||||
private CorsConfigurationSource corsConfigurationSource;
|
private CorsConfigurationSource corsConfigurationSource;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -122,6 +122,7 @@ ignored:
|
|||||||
- /common/common/slider/**
|
- /common/common/slider/**
|
||||||
- /common/common/sms/**
|
- /common/common/sms/**
|
||||||
- /common/common/logo
|
- /common/common/logo
|
||||||
|
- /common/common/site
|
||||||
- /druid/**
|
- /druid/**
|
||||||
- /swagger-ui.html
|
- /swagger-ui.html
|
||||||
- /doc.html
|
- /doc.html
|
||||||
|
@ -29,7 +29,7 @@ spring:
|
|||||||
type: redis
|
type: redis
|
||||||
# Redis
|
# Redis
|
||||||
redis:
|
redis:
|
||||||
host: 192.168.0.116
|
host: 127.0.0.1
|
||||||
port: 6379
|
port: 6379
|
||||||
password: lilishop
|
password: lilishop
|
||||||
lettuce:
|
lettuce:
|
||||||
@ -60,7 +60,7 @@ spring:
|
|||||||
default-datasource:
|
default-datasource:
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://192.168.0.116:3306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://127.0.0.1:3306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||||
username: root
|
username: root
|
||||||
password: lilishop
|
password: lilishop
|
||||||
maxActive: 50
|
maxActive: 50
|
||||||
@ -119,6 +119,7 @@ ignored:
|
|||||||
- /store/passport/login/refresh/**
|
- /store/passport/login/refresh/**
|
||||||
- /common/common/slider/**
|
- /common/common/slider/**
|
||||||
- /common/common/sms/**
|
- /common/common/sms/**
|
||||||
|
- /common/common/site
|
||||||
- /buyer/payment/cashier/**
|
- /buyer/payment/cashier/**
|
||||||
- /buyer/other/pageData/**
|
- /buyer/other/pageData/**
|
||||||
- /buyer/other/article/**
|
- /buyer/other/article/**
|
||||||
@ -268,7 +269,7 @@ lili:
|
|||||||
data:
|
data:
|
||||||
elasticsearch:
|
elasticsearch:
|
||||||
cluster-name: elasticsearch
|
cluster-name: elasticsearch
|
||||||
cluster-nodes: 192.168.0.116:9200
|
cluster-nodes: 127.0.0.1:9200
|
||||||
index:
|
index:
|
||||||
number-of-replicas: 0
|
number-of-replicas: 0
|
||||||
number-of-shards: 3
|
number-of-shards: 3
|
||||||
@ -279,7 +280,7 @@ lili:
|
|||||||
# password: LiLiShopES
|
# password: LiLiShopES
|
||||||
|
|
||||||
logstash:
|
logstash:
|
||||||
server: 192.168.0.116:4560
|
server: 127.0.0.1:4560
|
||||||
rocketmq:
|
rocketmq:
|
||||||
promotion-topic: lili_promotion_topic
|
promotion-topic: lili_promotion_topic
|
||||||
promotion-group: lili_promotion_group
|
promotion-group: lili_promotion_group
|
||||||
@ -300,7 +301,7 @@ lili:
|
|||||||
after-sale-topic: lili_after_sale_topic
|
after-sale-topic: lili_after_sale_topic
|
||||||
after-sale-group: lili_after_sale_group
|
after-sale-group: lili_after_sale_group
|
||||||
rocketmq:
|
rocketmq:
|
||||||
name-server: 192.168.0.116:9876
|
name-server: 127.0.0.1:9876
|
||||||
isVIPChannel: false
|
isVIPChannel: false
|
||||||
producer:
|
producer:
|
||||||
group: lili_group
|
group: lili_group
|
||||||
@ -309,7 +310,7 @@ rocketmq:
|
|||||||
xxl:
|
xxl:
|
||||||
job:
|
job:
|
||||||
admin:
|
admin:
|
||||||
addresses: http://192.168.0.116:9001/xxl-job-admin
|
addresses: http://127.0.0.1:9001/xxl-job-admin
|
||||||
executor:
|
executor:
|
||||||
appname: xxl-job-executor-lilishop
|
appname: xxl-job-executor-lilishop
|
||||||
address:
|
address:
|
||||||
|
@ -0,0 +1,65 @@
|
|||||||
|
package cn.lili.event.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.ListUtil;
|
||||||
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
|
import cn.lili.event.AfterSaleStatusChangeEvent;
|
||||||
|
import cn.lili.event.OrderStatusChangeEvent;
|
||||||
|
import cn.lili.modules.order.aftersale.entity.dos.AfterSale;
|
||||||
|
import cn.lili.modules.order.order.entity.dos.Order;
|
||||||
|
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
||||||
|
import cn.lili.modules.order.order.entity.enums.OrderStatusEnum;
|
||||||
|
import cn.lili.modules.order.order.service.OrderService;
|
||||||
|
import cn.lili.modules.order.trade.entity.enums.AfterSaleStatusEnum;
|
||||||
|
import cn.lili.modules.promotion.service.MemberCouponService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员优惠券执行类
|
||||||
|
*
|
||||||
|
* @author paulG
|
||||||
|
* @since 2022/8/12
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
public class MemberCouponExecute implements OrderStatusChangeEvent, AfterSaleStatusChangeEvent {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private OrderService orderService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MemberCouponService memberCouponService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void orderChange(OrderMessage orderMessage) {
|
||||||
|
// 订单取消返还优惠券
|
||||||
|
if (orderMessage.getNewStatus() == OrderStatusEnum.CANCELLED) {
|
||||||
|
this.refundCoupon(orderMessage.getOrderSn());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterSaleStatusChange(AfterSale afterSale) {
|
||||||
|
// 售后完成返还优惠券
|
||||||
|
if (afterSale.getServiceStatus().equals(AfterSaleStatusEnum.COMPLETE.name())) {
|
||||||
|
this.refundCoupon(afterSale.getOrderSn());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款返还优惠券
|
||||||
|
* @param orderSn 订单编号
|
||||||
|
*/
|
||||||
|
private void refundCoupon(String orderSn) {
|
||||||
|
Order order = orderService.getBySn(orderSn);
|
||||||
|
if (CharSequenceUtil.isNotEmpty(order.getUseStoreMemberCouponIds())) {
|
||||||
|
memberCouponService.recoveryMemberCoupon(ListUtil.toList(order.getUseStoreMemberCouponIds().split(",")));
|
||||||
|
}
|
||||||
|
if (CharSequenceUtil.isNotEmpty(order.getUsePlatformMemberCouponId())) {
|
||||||
|
memberCouponService.recoveryMemberCoupon(ListUtil.toList(order.getUsePlatformMemberCouponId().split(",")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,8 +1,8 @@
|
|||||||
package cn.lili.event.impl;
|
package cn.lili.event.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
import cn.lili.common.utils.CurrencyUtil;
|
import cn.lili.common.utils.CurrencyUtil;
|
||||||
import cn.lili.common.utils.StringUtils;
|
|
||||||
import cn.lili.event.AfterSaleStatusChangeEvent;
|
import cn.lili.event.AfterSaleStatusChangeEvent;
|
||||||
import cn.lili.event.GoodsCommentCompleteEvent;
|
import cn.lili.event.GoodsCommentCompleteEvent;
|
||||||
import cn.lili.event.MemberRegisterEvent;
|
import cn.lili.event.MemberRegisterEvent;
|
||||||
@ -104,7 +104,7 @@ public class MemberPointExecute implements MemberRegisterEvent, GoodsCommentComp
|
|||||||
case COMPLETED: {
|
case COMPLETED: {
|
||||||
Order order = orderService.getBySn(orderMessage.getOrderSn());
|
Order order = orderService.getBySn(orderMessage.getOrderSn());
|
||||||
//如果是积分订单 则直接返回
|
//如果是积分订单 则直接返回
|
||||||
if (StringUtils.isNotEmpty(order.getOrderPromotionType())
|
if (CharSequenceUtil.isNotEmpty(order.getOrderPromotionType())
|
||||||
&& order.getOrderPromotionType().equals(OrderPromotionTypeEnum.POINTS.name())) {
|
&& order.getOrderPromotionType().equals(OrderPromotionTypeEnum.POINTS.name())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -205,10 +205,16 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
for (String goodsId : JSONUtil.toList(goodsIdsJsonStr, String.class)) {
|
for (String goodsId : JSONUtil.toList(goodsIdsJsonStr, String.class)) {
|
||||||
goodsIndexService.deleteIndex(MapUtil.builder(new HashMap<String, Object>()).put("goodsId", goodsId).build());
|
goodsIndexService.deleteIndex(MapUtil.builder(new HashMap<String, Object>()).put("goodsId", goodsId).build());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
promotionService.removeByGoodsIds(goodsIdsJsonStr);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("删除商品索引事件执行异常,商品信息: " + new String(messageExt.getBody()), e);
|
log.error("删除商品索引事件执行异常,商品信息: " + new String(messageExt.getBody()), e);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case DOWN:
|
||||||
|
String goodsIdsJsonStr = new String(messageExt.getBody());
|
||||||
|
promotionService.removeByGoodsIds(goodsIdsJsonStr);
|
||||||
|
break;
|
||||||
//规格删除
|
//规格删除
|
||||||
case SKU_DELETE:
|
case SKU_DELETE:
|
||||||
String message = new String(messageExt.getBody());
|
String message = new String(messageExt.getBody());
|
||||||
@ -253,14 +259,17 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
try {
|
try {
|
||||||
log.info("更新商品索引促销信息: {}", promotionsJsonStr);
|
log.info("更新商品索引促销信息: {}", promotionsJsonStr);
|
||||||
JSONObject jsonObject = JSONUtil.parseObj(promotionsJsonStr);
|
JSONObject jsonObject = JSONUtil.parseObj(promotionsJsonStr);
|
||||||
|
// 转换为详细的促销信息(注:促销信息必须继承自 BasePromotions,且必须保证派生类存在与sdk包下)
|
||||||
BasePromotions promotions = (BasePromotions) jsonObject.get("promotions",
|
BasePromotions promotions = (BasePromotions) jsonObject.get("promotions",
|
||||||
ClassLoaderUtil.loadClass(jsonObject.get("promotionsType").toString()));
|
ClassLoaderUtil.loadClass(jsonObject.get("promotionsType").toString()));
|
||||||
|
// 获取促销唯一key,由 促销类型 + 促销id 组成
|
||||||
String esPromotionKey = jsonObject.get("esPromotionKey").toString();
|
String esPromotionKey = jsonObject.get("esPromotionKey").toString();
|
||||||
if (PromotionsScopeTypeEnum.PORTION_GOODS.name().equals(promotions.getScopeType())) {
|
if (PromotionsScopeTypeEnum.PORTION_GOODS.name().equals(promotions.getScopeType())) {
|
||||||
PromotionGoodsSearchParams searchParams = new PromotionGoodsSearchParams();
|
PromotionGoodsSearchParams searchParams = new PromotionGoodsSearchParams();
|
||||||
searchParams.setPromotionId(promotions.getId());
|
searchParams.setPromotionId(promotions.getId());
|
||||||
List<PromotionGoods> promotionGoodsList = this.promotionGoodsService.listFindAll(searchParams);
|
List<PromotionGoods> promotionGoodsList = this.promotionGoodsService.listFindAll(searchParams);
|
||||||
List<String> skuIds = promotionGoodsList.stream().map(PromotionGoods::getSkuId).collect(Collectors.toList());
|
List<String> skuIds = promotionGoodsList.stream().map(PromotionGoods::getSkuId).collect(Collectors.toList());
|
||||||
|
// 更新商品索引促销信息(删除原索引中相关的促销信息,更新索引中促销信息)
|
||||||
this.goodsIndexService.deleteEsGoodsPromotionByPromotionKey(skuIds, esPromotionKey);
|
this.goodsIndexService.deleteEsGoodsPromotionByPromotionKey(skuIds, esPromotionKey);
|
||||||
this.goodsIndexService.updateEsGoodsIndexByList(promotionGoodsList, promotions, esPromotionKey);
|
this.goodsIndexService.updateEsGoodsIndexByList(promotionGoodsList, promotions, esPromotionKey);
|
||||||
} else if (PromotionsScopeTypeEnum.PORTION_GOODS_CATEGORY.name().equals(promotions.getScopeType())) {
|
} else if (PromotionsScopeTypeEnum.PORTION_GOODS_CATEGORY.name().equals(promotions.getScopeType())) {
|
||||||
@ -268,10 +277,10 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
searchParams.setCategoryPath(promotions.getScopeId());
|
searchParams.setCategoryPath(promotions.getScopeId());
|
||||||
List<GoodsSku> goodsSkuByList = this.goodsSkuService.getGoodsSkuByList(searchParams);
|
List<GoodsSku> goodsSkuByList = this.goodsSkuService.getGoodsSkuByList(searchParams);
|
||||||
List<String> skuIds = goodsSkuByList.stream().map(GoodsSku::getId).collect(Collectors.toList());
|
List<String> skuIds = goodsSkuByList.stream().map(GoodsSku::getId).collect(Collectors.toList());
|
||||||
|
// 更新商品索引促销信息(删除原索引中相关的促销信息,更新索引中促销信息)
|
||||||
this.goodsIndexService.deleteEsGoodsPromotionByPromotionKey(skuIds, esPromotionKey);
|
this.goodsIndexService.deleteEsGoodsPromotionByPromotionKey(skuIds, esPromotionKey);
|
||||||
this.goodsIndexService.updateEsGoodsIndexPromotions(skuIds, promotions, esPromotionKey);
|
this.goodsIndexService.updateEsGoodsIndexPromotions(skuIds, promotions, esPromotionKey);
|
||||||
} else if (PromotionsScopeTypeEnum.ALL.name().equals(promotions.getScopeType())) {
|
} else if (PromotionsScopeTypeEnum.ALL.name().equals(promotions.getScopeType())) {
|
||||||
this.goodsIndexService.deleteEsGoodsPromotionByPromotionKey(esPromotionKey);
|
|
||||||
this.goodsIndexService.updateEsGoodsIndexAllByList(promotions, esPromotionKey);
|
this.goodsIndexService.updateEsGoodsIndexAllByList(promotions, esPromotionKey);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -285,32 +294,9 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
* @param goodsList 商品列表消息
|
* @param goodsList 商品列表消息
|
||||||
*/
|
*/
|
||||||
private void updateGoodsIndex(List<Goods> goodsList) {
|
private void updateGoodsIndex(List<Goods> goodsList) {
|
||||||
List<EsGoodsIndex> goodsIndices = new ArrayList<>();
|
|
||||||
for (Goods goods : goodsList) {
|
for (Goods goods : goodsList) {
|
||||||
//如果商品通过审核&&并且已上架
|
this.updateGoodsIndex(goods);
|
||||||
GoodsSearchParams searchParams = new GoodsSearchParams();
|
|
||||||
searchParams.setGoodsId(goods.getId());
|
|
||||||
searchParams.setGeQuantity(0);
|
|
||||||
List<GoodsSku> goodsSkuList = this.goodsSkuService.getGoodsSkuByList(searchParams);
|
|
||||||
if (goods.getAuthFlag().equals(GoodsAuthEnum.PASS.name())
|
|
||||||
&& goods.getMarketEnable().equals(GoodsStatusEnum.UPPER.name())
|
|
||||||
&& Boolean.FALSE.equals(goods.getDeleteFlag())) {
|
|
||||||
goodsSkuList.forEach(goodsSku -> {
|
|
||||||
EsGoodsIndex goodsIndex = this.settingUpGoodsIndexData(goods, goodsSku);
|
|
||||||
goodsIndices.add(goodsIndex);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//如果商品状态值不支持es搜索,那么将商品信息做下架处理
|
|
||||||
else {
|
|
||||||
for (GoodsSku goodsSku : goodsSkuList) {
|
|
||||||
EsGoodsIndex esGoodsOld = goodsIndexService.findById(goodsSku.getId());
|
|
||||||
if (esGoodsOld != null) {
|
|
||||||
goodsIndexService.deleteIndexById(goodsSku.getId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
goodsIndexService.updateBulkIndex(goodsIndices);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -370,11 +356,8 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
EsGoodsIndex goodsIndex = this.settingUpGoodsIndexData(goods, goodsSku);
|
EsGoodsIndex goodsIndex = this.settingUpGoodsIndexData(goods, goodsSku);
|
||||||
goodsIndex.setSkuSource(skuSource--);
|
goodsIndex.setSkuSource(skuSource--);
|
||||||
log.info("goodsSku:{}", goodsSku);
|
log.info("goodsSku:{}", goodsSku);
|
||||||
//如果商品库存不为0,并且es中有数据
|
log.info("生成商品索引 {}", goodsIndex);
|
||||||
if (goodsSku.getQuantity() > 0) {
|
esGoodsIndices.add(goodsIndex);
|
||||||
log.info("生成商品索引 {}", goodsIndex);
|
|
||||||
esGoodsIndices.add(goodsIndex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.goodsIndexService.deleteIndex(MapUtil.builder(new HashMap<String, Object>()).put("goodsId", goods.getId()).build());
|
this.goodsIndexService.deleteIndex(MapUtil.builder(new HashMap<String, Object>()).put("goodsId", goods.getId()).build());
|
||||||
this.goodsIndexService.addIndex(esGoodsIndices);
|
this.goodsIndexService.addIndex(esGoodsIndices);
|
||||||
|
@ -71,7 +71,7 @@ public class TimedTaskJobHandler {
|
|||||||
try {
|
try {
|
||||||
everyHourExecutes.get(i).execute();
|
everyHourExecutes.get(i).execute();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("每分钟任务异常", e);
|
log.error("每小时任务异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ReturnT.SUCCESS;
|
return ReturnT.SUCCESS;
|
||||||
@ -94,7 +94,7 @@ public class TimedTaskJobHandler {
|
|||||||
try {
|
try {
|
||||||
everyDayExecutes.get(i).execute();
|
everyDayExecutes.get(i).execute();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("每分钟任务异常", e);
|
log.error("每日任务异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ReturnT.SUCCESS;
|
return ReturnT.SUCCESS;
|
||||||
|
@ -34,7 +34,7 @@ public class CouponExecute implements EveryDayExecute {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
//将过期优惠券变更为过期状体
|
//将过期优惠券变更为过期状态
|
||||||
LambdaUpdateWrapper<MemberCoupon> updateWrapper = new LambdaUpdateWrapper<MemberCoupon>()
|
LambdaUpdateWrapper<MemberCoupon> updateWrapper = new LambdaUpdateWrapper<MemberCoupon>()
|
||||||
.eq(MemberCoupon::getMemberCouponStatus, MemberCouponStatusEnum.NEW.name())
|
.eq(MemberCoupon::getMemberCouponStatus, MemberCouponStatusEnum.NEW.name())
|
||||||
.le(MemberCoupon::getEndTime, new Date())
|
.le(MemberCoupon::getEndTime, new Date())
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
package cn.lili.timetask.handler.impl.promotion;
|
package cn.lili.timetask.handler.impl.promotion;
|
||||||
|
|
||||||
|
import cn.lili.common.enums.PromotionTypeEnum;
|
||||||
import cn.lili.modules.promotion.entity.dos.Seckill;
|
import cn.lili.modules.promotion.entity.dos.Seckill;
|
||||||
import cn.lili.modules.promotion.service.SeckillService;
|
import cn.lili.modules.promotion.service.SeckillService;
|
||||||
|
import cn.lili.modules.promotion.tools.PromotionTools;
|
||||||
import cn.lili.modules.search.service.EsGoodsIndexService;
|
import cn.lili.modules.search.service.EsGoodsIndexService;
|
||||||
import cn.lili.modules.system.entity.dos.Setting;
|
import cn.lili.modules.system.entity.dos.Setting;
|
||||||
import cn.lili.modules.system.entity.dto.SeckillSetting;
|
import cn.lili.modules.system.entity.dto.SeckillSetting;
|
||||||
import cn.lili.modules.system.entity.enums.SettingEnum;
|
import cn.lili.modules.system.entity.enums.SettingEnum;
|
||||||
import cn.lili.modules.system.service.SettingService;
|
import cn.lili.modules.system.service.SettingService;
|
||||||
import cn.lili.timetask.handler.EveryDayExecute;
|
import cn.lili.timetask.handler.EveryDayExecute;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -72,10 +73,9 @@ public class PromotionEverydayExecute implements EveryDayExecute {
|
|||||||
for (int i = 1; i <= SeckillService.PRE_CREATION; i++) {
|
for (int i = 1; i <= SeckillService.PRE_CREATION; i++) {
|
||||||
Seckill seckill = new Seckill(i, seckillSetting.getHours(), seckillSetting.getSeckillRule());
|
Seckill seckill = new Seckill(i, seckillSetting.getHours(), seckillSetting.getSeckillRule());
|
||||||
|
|
||||||
LambdaQueryWrapper<Seckill> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
lambdaQueryWrapper.eq(Seckill::getStartTime, seckill.getStartTime());
|
|
||||||
//如果已经存在促销,则不再次保存
|
//如果已经存在促销,则不再次保存
|
||||||
if (seckillService.list(lambdaQueryWrapper).isEmpty()) {
|
if (seckillService.list(
|
||||||
|
PromotionTools.checkActiveTime(seckill.getStartTime(), seckill.getEndTime(), PromotionTypeEnum.SECKILL, null, seckill.getId())).isEmpty()) {
|
||||||
boolean result = seckillService.savePromotions(seckill);
|
boolean result = seckillService.savePromotions(seckill);
|
||||||
log.info("生成秒杀活动参数:{},结果:{}", seckill, result);
|
log.info("生成秒杀活动参数:{},结果:{}", seckill, result);
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ spring:
|
|||||||
default-datasource:
|
default-datasource:
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://127.0.0.1:3306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://127.0.0.1:3306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||||
username: root
|
username: root
|
||||||
password: lilishop
|
password: lilishop
|
||||||
maxActive: 20
|
maxActive: 20
|
||||||
|
651
deploy-api.yml
Normal file
651
deploy-api.yml
Normal file
@ -0,0 +1,651 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: lilishop-service
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: buyer-api-service
|
||||||
|
namespace: lilishop-service
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: buyer-api-service
|
||||||
|
app.kubernetes.io/instance: api
|
||||||
|
app.kubernetes.io/version: "4.2.4.1"
|
||||||
|
app.kubernetes.io/component: api
|
||||||
|
app.kubernetes.io/part-of: lilishop
|
||||||
|
tier: "api-service"
|
||||||
|
spec:
|
||||||
|
type: NodePort
|
||||||
|
ports:
|
||||||
|
- name: "8888"
|
||||||
|
nodePort: 30888
|
||||||
|
port: 8888
|
||||||
|
targetPort: buyer8888
|
||||||
|
selector:
|
||||||
|
lilishop.service: buyer-api
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: common-api-service
|
||||||
|
namespace: lilishop-service
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: common-api-service
|
||||||
|
app.kubernetes.io/instance: api
|
||||||
|
app.kubernetes.io/version: "4.2.4.1"
|
||||||
|
app.kubernetes.io/component: api
|
||||||
|
app.kubernetes.io/part-of: lilishop
|
||||||
|
tier: "api-service"
|
||||||
|
spec:
|
||||||
|
type: NodePort
|
||||||
|
ports:
|
||||||
|
- name: "8890"
|
||||||
|
nodePort: 30890
|
||||||
|
port: 8890
|
||||||
|
targetPort: common8890
|
||||||
|
selector:
|
||||||
|
lilishop.service: common-api
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: seller-api-service
|
||||||
|
namespace: lilishop-service
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: seller-api-service
|
||||||
|
app.kubernetes.io/instance: api
|
||||||
|
app.kubernetes.io/version: "4.2.4.1"
|
||||||
|
app.kubernetes.io/component: api
|
||||||
|
app.kubernetes.io/part-of: lilishop
|
||||||
|
tier: "api-service"
|
||||||
|
spec:
|
||||||
|
type: NodePort
|
||||||
|
ports:
|
||||||
|
- name: "8889"
|
||||||
|
nodePort: 30889
|
||||||
|
port: 8889
|
||||||
|
targetPort: seller8889
|
||||||
|
selector:
|
||||||
|
lilishop.service: seller-api
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: manager-api-service
|
||||||
|
namespace: lilishop-service
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: manager-api-service
|
||||||
|
app.kubernetes.io/instance: api
|
||||||
|
app.kubernetes.io/version: "4.2.4.1"
|
||||||
|
app.kubernetes.io/component: api
|
||||||
|
app.kubernetes.io/part-of: lilishop
|
||||||
|
tier: "api-service"
|
||||||
|
spec:
|
||||||
|
type: NodePort
|
||||||
|
ports:
|
||||||
|
- name: "8887"
|
||||||
|
nodePort: 30887
|
||||||
|
port: 8887
|
||||||
|
targetPort: manager8887
|
||||||
|
selector:
|
||||||
|
lilishop.service: manager-api
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: api-config
|
||||||
|
namespace: lilishop-service
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: mysql-db-config
|
||||||
|
app.kubernetes.io/instance: mysql-single
|
||||||
|
app.kubernetes.io/version: "8.0.28"
|
||||||
|
app.kubernetes.io/component: database
|
||||||
|
app.kubernetes.io/part-of: lilishop
|
||||||
|
data:
|
||||||
|
application.yml: |
|
||||||
|
server:
|
||||||
|
servlet:
|
||||||
|
context-path: /
|
||||||
|
|
||||||
|
tomcat:
|
||||||
|
uri-encoding: UTF-8
|
||||||
|
threads:
|
||||||
|
min-spare: 50
|
||||||
|
max: 1000
|
||||||
|
|
||||||
|
# 与Spring Boot 2一样,默认情况下,大多数端点都不通过http公开,我们公开了所有端点。对于生产,您应该仔细选择要公开的端点。
|
||||||
|
management:
|
||||||
|
# health:
|
||||||
|
# elasticsearch:
|
||||||
|
# enabled: false
|
||||||
|
# datasource:
|
||||||
|
# enabled: false
|
||||||
|
endpoints:
|
||||||
|
web:
|
||||||
|
exposure:
|
||||||
|
include: '*'
|
||||||
|
spring:
|
||||||
|
# 要在其中注册的Spring Boot Admin Server的URL。
|
||||||
|
boot:
|
||||||
|
admin:
|
||||||
|
client:
|
||||||
|
url: http://192.168.0.116:8000
|
||||||
|
cache:
|
||||||
|
type: redis
|
||||||
|
# Redis
|
||||||
|
redis:
|
||||||
|
host: redis-service.lilishop-middleware
|
||||||
|
port: 6379
|
||||||
|
password: lilishop
|
||||||
|
lettuce:
|
||||||
|
pool:
|
||||||
|
# 连接池最大连接数(使用负值表示没有限制) 默认 8
|
||||||
|
max-active: 200
|
||||||
|
# 连接池最大阻塞等待时间(使用负值表示没有限制) 默认 -1
|
||||||
|
max-wait: 20
|
||||||
|
# 连接池中的最大空闲连接 默认 8
|
||||||
|
max-idle: 10
|
||||||
|
# 连接池中的最小空闲连接 默认 8
|
||||||
|
min-idle: 8
|
||||||
|
# 文件大小上传配置
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
max-file-size: 20MB
|
||||||
|
max-request-size: 20MB
|
||||||
|
jackson:
|
||||||
|
time-zone: GMT+8
|
||||||
|
serialization:
|
||||||
|
#关闭jackson 对json做解析
|
||||||
|
fail-on-empty-beans: false
|
||||||
|
|
||||||
|
shardingsphere:
|
||||||
|
datasource:
|
||||||
|
# 数据库名称,可自定义,可以为多个,以逗号隔开,每个在这里定义的库,都要在下面定义连接属性
|
||||||
|
names: default-datasource
|
||||||
|
default-datasource:
|
||||||
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
|
url: jdbc:mysql://mysql.lilishop-middleware:3306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||||
|
username: root
|
||||||
|
password: lilishop
|
||||||
|
maxActive: 50
|
||||||
|
initialSize: 20
|
||||||
|
maxWait: 60000
|
||||||
|
minIdle: 5
|
||||||
|
timeBetweenEvictionRunsMillis: 60000
|
||||||
|
minEvictableIdleTimeMillis: 300000
|
||||||
|
validationQuery: SELECT 1 FROM DUAL
|
||||||
|
testWhileIdle: true
|
||||||
|
testOnBorrow: false
|
||||||
|
testOnReturn: false
|
||||||
|
#是否缓存preparedStatement,也就是PSCache。在mysql下建议关闭。 PSCache对支持游标的数据库性能提升巨大,比如说oracle。
|
||||||
|
poolPreparedStatements: false
|
||||||
|
#要启用PSCache,-1为关闭 必须配置大于0,当大于0时,poolPreparedStatements自动触发修改为true 可以把这个数值配置大一些,比如说100
|
||||||
|
maxOpenPreparedStatements: -1
|
||||||
|
#配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
|
||||||
|
filters: stat,wall,log4j2
|
||||||
|
#通过connectProperties属性来打开mergeSql功能;慢SQL记录
|
||||||
|
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
|
||||||
|
#合并多个DruidDataSource的监控数据
|
||||||
|
useGlobalDataSourceStat: true
|
||||||
|
loginUsername: druid
|
||||||
|
loginPassword: druid
|
||||||
|
# sharding:
|
||||||
|
# default-data-source-name: default-datasource
|
||||||
|
# #需要拆分的表,可以设置多个 在 li_order 级别即可
|
||||||
|
# tables:
|
||||||
|
# #需要进行分表的逻辑表名
|
||||||
|
# li_order:
|
||||||
|
# #实际的表结点,下面代表的是li_order_为开头的所有表,如果能确定表的范围例如按月份分表,这里的写法是data2020.li_order_$->{2020..2021}_$->{01..12} 表示例如 li_order_2020_01 li_order_2020_03 li_order_2021_01
|
||||||
|
# actual-data-nodes: data2020.li_order_$->{2019..2021}_$->{01..12}
|
||||||
|
# table-strategy:
|
||||||
|
# # 分表策略,根据创建日期
|
||||||
|
# standard:
|
||||||
|
# sharding-column: create_time
|
||||||
|
# #分表策略
|
||||||
|
# precise-algorithm-class-name: cn.lili.mybatis.sharding.CreateTimeShardingTableAlgorithm
|
||||||
|
# #范围查询实现
|
||||||
|
# range-algorithm-class-name: cn.lili.mybatis.sharding.CreateTimeShardingTableAlgorithm
|
||||||
|
props:
|
||||||
|
#是否打印逻辑SQL语句和实际SQL语句,建议调试时打印,在生产环境关闭
|
||||||
|
sql:
|
||||||
|
show: true
|
||||||
|
|
||||||
|
# 忽略鉴权url
|
||||||
|
ignored:
|
||||||
|
urls:
|
||||||
|
- /editor-app/**
|
||||||
|
- /actuator**
|
||||||
|
- /actuator/**
|
||||||
|
- /MP_verify_qSyvBPhDsPdxvOhC.txt
|
||||||
|
- /weixin/**
|
||||||
|
- /source/**
|
||||||
|
- /store/passport/login/**
|
||||||
|
- /store/passport/login/refresh/**
|
||||||
|
- /common/common/slider/**
|
||||||
|
- /common/common/sms/**
|
||||||
|
- /buyer/payment/cashier/**
|
||||||
|
- /buyer/other/pageData/**
|
||||||
|
- /buyer/other/article/**
|
||||||
|
- /buyer/goods/**
|
||||||
|
- /buyer/store/**
|
||||||
|
- /buyer/passport/connect/**
|
||||||
|
- /buyer/members/**
|
||||||
|
- /buyer/passport/member/**
|
||||||
|
- /buyer/passport/member/refresh/**
|
||||||
|
- /buyer/promotion/pintuan/**
|
||||||
|
- /buyer/promotion/seckill/**
|
||||||
|
- /buyer/promotion/pointsGoods/**
|
||||||
|
- /buyer/promotion/coupon
|
||||||
|
- /buyer/member/evaluation/**/goodsEvaluation
|
||||||
|
- /buyer/member/evaluation/**/evaluationNumber
|
||||||
|
- /buyer/other/appVersion/**
|
||||||
|
- /buyer/broadcast/studio/**
|
||||||
|
- /manager/passport/user/login
|
||||||
|
- /manager/passport/user/refresh/**
|
||||||
|
- /manager/other/elasticsearch
|
||||||
|
- /manager/other/customWords
|
||||||
|
- /druid/**
|
||||||
|
- /swagger-ui.html
|
||||||
|
- /doc.html
|
||||||
|
- /swagger-resources/**
|
||||||
|
- /swagger/**
|
||||||
|
- /webjars/**
|
||||||
|
- /v2/api-docs**
|
||||||
|
- /configuration/ui
|
||||||
|
- /boot-admin
|
||||||
|
- /manager/promotion/seckill/init
|
||||||
|
- /**/*.js
|
||||||
|
- /**/*.css
|
||||||
|
- /**/*.png
|
||||||
|
- /**/*.ico
|
||||||
|
|
||||||
|
# Swagger界面内容配置
|
||||||
|
swagger:
|
||||||
|
title: lilishop API接口文档
|
||||||
|
description: lilishop Api Documentation
|
||||||
|
version: 4.2.2
|
||||||
|
termsOfServiceUrl: https://pickmall.cn
|
||||||
|
contact:
|
||||||
|
name: lili
|
||||||
|
url: https://pickmall.cn
|
||||||
|
email: admin@pickmall.com
|
||||||
|
|
||||||
|
# Mybatis-plus
|
||||||
|
mybatis-plus:
|
||||||
|
mapper-locations: classpath*:mapper/*.xml
|
||||||
|
configuration:
|
||||||
|
#缓存开启
|
||||||
|
cache-enabled: true
|
||||||
|
#日志
|
||||||
|
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
|
|
||||||
|
# 日志
|
||||||
|
logging:
|
||||||
|
# 输出级别
|
||||||
|
level:
|
||||||
|
cn.lili: info
|
||||||
|
# org.hibernate: debug
|
||||||
|
# org.springframework: debug
|
||||||
|
file:
|
||||||
|
# 指定路径
|
||||||
|
path: logs
|
||||||
|
logback:
|
||||||
|
rollingpolicy:
|
||||||
|
# 最大保存天数
|
||||||
|
max-history: 7
|
||||||
|
# 每个文件最大大小
|
||||||
|
max-file-size: 5MB
|
||||||
|
#加密参数
|
||||||
|
jasypt:
|
||||||
|
encryptor:
|
||||||
|
password: lili
|
||||||
|
|
||||||
|
|
||||||
|
lili:
|
||||||
|
#验证码设置
|
||||||
|
verification-code:
|
||||||
|
#图形验证码有效时间 秒 包含滑块验证码有效时间, 以及验证通过之后,缓存中存储的验证结果有效时间
|
||||||
|
effectiveTime: 300
|
||||||
|
#水印
|
||||||
|
watermark: LILI-SHOP
|
||||||
|
#干扰项数量 最大2 默认0
|
||||||
|
interfereNum: 1
|
||||||
|
#允许误差像素
|
||||||
|
faultTolerant: 3
|
||||||
|
#短信模版配置
|
||||||
|
sms:
|
||||||
|
#登录
|
||||||
|
LOGIN: SMS_205755300
|
||||||
|
#注册
|
||||||
|
REGISTER: SMS_205755298
|
||||||
|
#找回密码
|
||||||
|
FIND_USER: SMS_205755301
|
||||||
|
#设置密码
|
||||||
|
UPDATE_PASSWORD: SMS_205755297
|
||||||
|
#支付密码
|
||||||
|
WALLET_PASSWORD: SMS_205755301
|
||||||
|
system:
|
||||||
|
isDemoSite: false
|
||||||
|
isTestModel: true
|
||||||
|
# 脱敏级别:
|
||||||
|
# 0:不做脱敏处理
|
||||||
|
# 1:管理端用户手机号等信息脱敏
|
||||||
|
# 2:商家端信息脱敏(为2时,表示管理端,商家端同时脱敏)
|
||||||
|
sensitiveLevel: 1
|
||||||
|
|
||||||
|
statistics:
|
||||||
|
# 在线人数统计 X 小时。这里设置48,即统计过去48小时每小时在线人数
|
||||||
|
onlineMember: 48
|
||||||
|
# 当前在线人数刷新时间间隔,单位秒,设置为600,则每10分钟刷新一次
|
||||||
|
currentOnlineUpdate: 600
|
||||||
|
#qq lbs 申请
|
||||||
|
lbs:
|
||||||
|
key: 4BYBZ-7MT6S-PUAOA-6BNWL-FJUD7-UUFXT
|
||||||
|
sk: zhNKVrJK6UPOhqIjn8AQvG37b9sz6
|
||||||
|
#域名
|
||||||
|
domain:
|
||||||
|
pc: http://192.168.0.116:8888
|
||||||
|
wap: http://192.168.0.116:8888
|
||||||
|
seller: http://192.168.0.116:8888
|
||||||
|
admin: http://192.168.0.116:8888
|
||||||
|
#api地址
|
||||||
|
api:
|
||||||
|
buyer: http://192.168.0.116:8888
|
||||||
|
base: http://192.168.0.116:8888
|
||||||
|
manager: http://192.168.0.116:8888
|
||||||
|
seller: http://192.168.0.116:8888
|
||||||
|
|
||||||
|
# jwt 细节设定
|
||||||
|
jwt-setting:
|
||||||
|
# token过期时间(分钟)
|
||||||
|
tokenExpireTime: 30
|
||||||
|
|
||||||
|
# 使用Spring @Cacheable注解失效时间
|
||||||
|
cache:
|
||||||
|
# 过期时间 单位秒 永久不过期设为-1
|
||||||
|
timeout: 1500
|
||||||
|
#多线程配置
|
||||||
|
thread:
|
||||||
|
corePoolSize: 5
|
||||||
|
maxPoolSize: 50
|
||||||
|
queueCapacity: 50
|
||||||
|
data:
|
||||||
|
elasticsearch:
|
||||||
|
cluster-name: elasticsearch
|
||||||
|
cluster-nodes: elasticsearch.lilishop-middleware:9200
|
||||||
|
index:
|
||||||
|
number-of-replicas: 0
|
||||||
|
number-of-shards: 3
|
||||||
|
index-prefix: lili
|
||||||
|
schema: http
|
||||||
|
# account:
|
||||||
|
# username: elastic
|
||||||
|
# password: LiLiShopES
|
||||||
|
|
||||||
|
logstash:
|
||||||
|
server: logstash-service.lilishop-middleware:4560
|
||||||
|
rocketmq:
|
||||||
|
promotion-topic: lili_promotion_topic
|
||||||
|
promotion-group: lili_promotion_group
|
||||||
|
msg-ext-topic: lili_msg_topic
|
||||||
|
msg-ext-group: lili_msg_group
|
||||||
|
goods-topic: lili_goods_topic
|
||||||
|
goods-group: lili_goods_group
|
||||||
|
order-topic: lili_order_topic
|
||||||
|
order-group: lili_order_group
|
||||||
|
member-topic: lili_member_topic
|
||||||
|
member-group: lili_member_group
|
||||||
|
other-topic: lili_other_topic
|
||||||
|
other-group: lili_other_group
|
||||||
|
notice-topic: lili_notice_topic
|
||||||
|
notice-group: lili_notice_group
|
||||||
|
notice-send-topic: lili_send_notice_topic
|
||||||
|
notice-send-group: lili_send_notice_group
|
||||||
|
after-sale-topic: lili_after_sale_topic
|
||||||
|
after-sale-group: lili_after_sale_group
|
||||||
|
rocketmq:
|
||||||
|
name-server: rocketmq.lilishop-middleware:9876
|
||||||
|
isVIPChannel: false
|
||||||
|
producer:
|
||||||
|
group: lili_group
|
||||||
|
send-message-timeout: 30000
|
||||||
|
|
||||||
|
xxl:
|
||||||
|
job:
|
||||||
|
admin:
|
||||||
|
addresses: http://xxl-job-service.lilishop-middleware:9001/xxl-job-admin
|
||||||
|
executor:
|
||||||
|
appname: xxl-job-executor-lilishop
|
||||||
|
address:
|
||||||
|
ip:
|
||||||
|
port: 8891
|
||||||
|
logpath: ./xxl-job/executor
|
||||||
|
logretentiondays: 7
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: buyer-api
|
||||||
|
namespace: lilishop-service
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: buyer-api-service
|
||||||
|
app.kubernetes.io/instance: buyer-api
|
||||||
|
app.kubernetes.io/version: "4.2.4.1"
|
||||||
|
app.kubernetes.io/component: api
|
||||||
|
app.kubernetes.io/part-of: lilishop
|
||||||
|
tier: "api-service"
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
lilishop.service: buyer-api
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
lilishop.service: buyer-api
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: 192.168.0.108:31320/buyer-api:4.2.4.1
|
||||||
|
name: buyer-api
|
||||||
|
env:
|
||||||
|
- name: TZ
|
||||||
|
value: Asia/Shanghai
|
||||||
|
- name: JAVA_OPTS
|
||||||
|
value: -XX:MetaspaceSize=64m -XX:MaxMetaspaceSize=128m -Xms128m -Xmx256m -Xmn128m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC
|
||||||
|
ports:
|
||||||
|
- name: buyer8888
|
||||||
|
containerPort: 8888
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /application.yml
|
||||||
|
name: application-yml
|
||||||
|
subPath: application.yml
|
||||||
|
restartPolicy: Always
|
||||||
|
volumes:
|
||||||
|
- configMap:
|
||||||
|
name: api-config
|
||||||
|
name: application-yml
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: common-api
|
||||||
|
namespace: lilishop-service
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: common-api-service
|
||||||
|
app.kubernetes.io/instance: common-api
|
||||||
|
app.kubernetes.io/version: "4.2.4.1"
|
||||||
|
app.kubernetes.io/component: api
|
||||||
|
app.kubernetes.io/part-of: lilishop
|
||||||
|
tier: "api-service"
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
lilishop.service: common-api
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
lilishop.service: common-api
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: 192.168.0.108:31320/common-api:4.2.4.1
|
||||||
|
name: common-api
|
||||||
|
env:
|
||||||
|
- name: TZ
|
||||||
|
value: Asia/Shanghai
|
||||||
|
- name: JAVA_OPTS
|
||||||
|
value: -XX:MetaspaceSize=64m -XX:MaxMetaspaceSize=128m -Xms128m -Xmx256m -Xmn128m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC
|
||||||
|
ports:
|
||||||
|
- name: common8890
|
||||||
|
containerPort: 8890
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /application.yml
|
||||||
|
name: application-yml
|
||||||
|
subPath: application.yml
|
||||||
|
restartPolicy: Always
|
||||||
|
volumes:
|
||||||
|
- configMap:
|
||||||
|
name: api-config
|
||||||
|
name: application-yml
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: seller-api
|
||||||
|
namespace: lilishop-service
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: seller-api-service
|
||||||
|
app.kubernetes.io/instance: seller-api
|
||||||
|
app.kubernetes.io/version: "4.2.4.1"
|
||||||
|
app.kubernetes.io/component: api
|
||||||
|
app.kubernetes.io/part-of: lilishop
|
||||||
|
tier: "api-service"
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
lilishop.service: seller-api
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
lilishop.service: seller-api
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: 192.168.0.108:31320/seller-api:4.2.4.1
|
||||||
|
name: seller-api
|
||||||
|
env:
|
||||||
|
- name: TZ
|
||||||
|
value: Asia/Shanghai
|
||||||
|
- name: JAVA_OPTS
|
||||||
|
value: -XX:MetaspaceSize=64m -XX:MaxMetaspaceSize=128m -Xms128m -Xmx256m -Xmn128m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC
|
||||||
|
ports:
|
||||||
|
- name: seller8889
|
||||||
|
containerPort: 8889
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /application.yml
|
||||||
|
name: application-yml
|
||||||
|
subPath: application.yml
|
||||||
|
restartPolicy: Always
|
||||||
|
volumes:
|
||||||
|
- configMap:
|
||||||
|
name: api-config
|
||||||
|
name: application-yml
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: manager-api
|
||||||
|
namespace: lilishop-service
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: manager-api-service
|
||||||
|
app.kubernetes.io/instance: manager-api
|
||||||
|
app.kubernetes.io/version: "4.2.4.1"
|
||||||
|
app.kubernetes.io/component: api
|
||||||
|
app.kubernetes.io/part-of: lilishop
|
||||||
|
tier: "api-service"
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
lilishop.service: manager-api
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
lilishop.service: manager-api
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: 192.168.0.108:31320/manager-api:4.2.4.1
|
||||||
|
name: manager-api
|
||||||
|
env:
|
||||||
|
- name: TZ
|
||||||
|
value: Asia/Shanghai
|
||||||
|
- name: JAVA_OPTS
|
||||||
|
value: -XX:MetaspaceSize=64m -XX:MaxMetaspaceSize=128m -Xms128m -Xmx256m -Xmn128m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC
|
||||||
|
ports:
|
||||||
|
- name: manager8887
|
||||||
|
containerPort: 8887
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /application.yml
|
||||||
|
name: application-yml
|
||||||
|
subPath: application.yml
|
||||||
|
restartPolicy: Always
|
||||||
|
volumes:
|
||||||
|
- configMap:
|
||||||
|
name: api-config
|
||||||
|
name: application-yml
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: consumer
|
||||||
|
namespace: lilishop-service
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: consumer-service
|
||||||
|
app.kubernetes.io/instance: buyer-api
|
||||||
|
app.kubernetes.io/version: "4.2.4.1"
|
||||||
|
app.kubernetes.io/component: api
|
||||||
|
app.kubernetes.io/part-of: lilishop
|
||||||
|
tier: "api-service"
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
lilishop.service: consumer
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
lilishop.service: consumer
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: 192.168.0.108:31320/consumer:4.2.4.1
|
||||||
|
name: consumer
|
||||||
|
env:
|
||||||
|
- name: TZ
|
||||||
|
value: Asia/Shanghai
|
||||||
|
- name: JAVA_OPTS
|
||||||
|
value: -XX:MetaspaceSize=64m -XX:MaxMetaspaceSize=128m -Xms128m -Xmx256m -Xmn128m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /application.yml
|
||||||
|
name: application-yml
|
||||||
|
subPath: application.yml
|
||||||
|
restartPolicy: Always
|
||||||
|
volumes:
|
||||||
|
- configMap:
|
||||||
|
name: api-config
|
||||||
|
name: application-yml
|
@ -15,6 +15,15 @@
|
|||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.qiniu</groupId>
|
||||||
|
<artifactId>qiniu-java-sdk</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.qiniu</groupId>
|
||||||
|
<artifactId>qiniu-java-sdk</artifactId>
|
||||||
|
<version>7.4.0</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-properties-migrator</artifactId>
|
<artifactId>spring-boot-properties-migrator</artifactId>
|
||||||
|
13
framework/src/main/java/cn/lili/cache/Cache.java
vendored
13
framework/src/main/java/cn/lili/cache/Cache.java
vendored
@ -153,7 +153,15 @@ public interface Cache<T> {
|
|||||||
* @param pattern 模糊key
|
* @param pattern 模糊key
|
||||||
* @return 缓存中的数据
|
* @return 缓存中的数据
|
||||||
*/
|
*/
|
||||||
List<String> keys(String pattern);
|
List<Object> keys(String pattern);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 原生阻塞keys 不推荐使用
|
||||||
|
*
|
||||||
|
* @param pattern 模糊key
|
||||||
|
* @return 缓存中的数据
|
||||||
|
*/
|
||||||
|
List<Object> keysBlock(String pattern);
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------用于特殊场景,redis去重计数---------------------------------------------
|
//-----------------------------------------------用于特殊场景,redis去重计数---------------------------------------------
|
||||||
@ -211,11 +219,12 @@ public interface Cache<T> {
|
|||||||
* @return 计数器结果
|
* @return 计数器结果
|
||||||
*/
|
*/
|
||||||
Long incr(String key, long liveTime);
|
Long incr(String key, long liveTime);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* redis 计数器 累加
|
* redis 计数器 累加
|
||||||
* 注:到达liveTime之后,该次增加取消,即自动-1,而不是redis值为空
|
* 注:到达liveTime之后,该次增加取消,即自动-1,而不是redis值为空
|
||||||
*
|
*
|
||||||
* @param key 为累计的key,同一key每次调用则值 +1
|
* @param key 为累计的key,同一key每次调用则值 +1
|
||||||
* @return 计数器结果
|
* @return 计数器结果
|
||||||
*/
|
*/
|
||||||
Long incr(String key);
|
Long incr(String key);
|
||||||
|
@ -473,13 +473,25 @@ public enum CachePrefix {
|
|||||||
* 店铺分类
|
* 店铺分类
|
||||||
*/
|
*/
|
||||||
STORE_CATEGORY,
|
STORE_CATEGORY,
|
||||||
|
/**
|
||||||
|
* 用户菜单
|
||||||
|
*/
|
||||||
|
MENU_USER_ID,
|
||||||
/**
|
/**
|
||||||
* 用户菜单
|
* 用户菜单
|
||||||
* <p>
|
* <p>
|
||||||
* 这个缓存并非永久缓存,而是300秒缓存,也就是说修改用户关联的部门,关联的角色,
|
* 这个缓存并非永久缓存,而是300秒缓存,也就是说修改用户关联的部门,关联的角色,
|
||||||
* 部门关联的角色,角色关联的菜单等等,最多需要5分钟才能生效
|
* 部门关联的角色,角色关联的菜单等等,最多需要5分钟才能生效
|
||||||
*/
|
*/
|
||||||
|
STORE_MENU_USER_ID,
|
||||||
|
/**
|
||||||
|
* 用户菜单
|
||||||
|
*/
|
||||||
USER_MENU,
|
USER_MENU,
|
||||||
|
/**
|
||||||
|
* 用户菜单
|
||||||
|
*/
|
||||||
|
STORE_USER_MENU,
|
||||||
/**
|
/**
|
||||||
* 订单暂时缓存
|
* 订单暂时缓存
|
||||||
*/
|
*/
|
||||||
@ -487,7 +499,16 @@ public enum CachePrefix {
|
|||||||
/**
|
/**
|
||||||
* 敏感词
|
* 敏感词
|
||||||
*/
|
*/
|
||||||
SENSITIVE;
|
SENSITIVE,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫码登录
|
||||||
|
* @param str
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
QR_CODE_LOGIN_SESSION
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
public static String removePrefix(String str) {
|
public static String removePrefix(String str) {
|
||||||
|
@ -6,6 +6,7 @@ import org.springframework.data.redis.serializer.RedisSerializer;
|
|||||||
import org.springframework.data.redis.serializer.SerializationException;
|
import org.springframework.data.redis.serializer.SerializationException;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 要实现对象的缓存,定义自己的序列化和反序列化器。使用阿里的fastjson来实现的比较多
|
* 要实现对象的缓存,定义自己的序列化和反序列化器。使用阿里的fastjson来实现的比较多
|
||||||
@ -13,8 +14,8 @@ import java.nio.charset.Charset;
|
|||||||
* @author Bulbasaur
|
* @author Bulbasaur
|
||||||
*/
|
*/
|
||||||
public class FastJsonRedisSerializer<T> implements RedisSerializer<T> {
|
public class FastJsonRedisSerializer<T> implements RedisSerializer<T> {
|
||||||
private static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8");
|
private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8;
|
||||||
private Class<T> clazz;
|
private final Class<T> clazz;
|
||||||
|
|
||||||
public FastJsonRedisSerializer(Class<T> clazz) {
|
public FastJsonRedisSerializer(Class<T> clazz) {
|
||||||
super();
|
super();
|
||||||
@ -26,7 +27,10 @@ public class FastJsonRedisSerializer<T> implements RedisSerializer<T> {
|
|||||||
if (null == t) {
|
if (null == t) {
|
||||||
return new byte[0];
|
return new byte[0];
|
||||||
}
|
}
|
||||||
return JSON.toJSONString(t, SerializerFeature.WriteClassName).getBytes(DEFAULT_CHARSET);
|
return JSON.toJSONString(t,
|
||||||
|
SerializerFeature.WriteClassName,
|
||||||
|
SerializerFeature.DisableCircularReferenceDetect)
|
||||||
|
.getBytes(DEFAULT_CHARSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -90,14 +90,13 @@ public class RedisCache implements Cache {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void vagueDel(Object key) {
|
public void vagueDel(Object key) {
|
||||||
Set<Object> keys = redisTemplate.keys(key + "*");
|
List keys = this.keys(key + "*");
|
||||||
redisTemplate.delete(keys);
|
redisTemplate.delete(keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clear() {
|
public void clear() {
|
||||||
|
List keys = this.keys("*");
|
||||||
Set keys = redisTemplate.keys("*");
|
|
||||||
redisTemplate.delete(keys);
|
redisTemplate.delete(keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,8 +132,8 @@ public class RedisCache implements Cache {
|
|||||||
* @return 模糊匹配key
|
* @return 模糊匹配key
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<String> keys(String pattern) {
|
public List<Object> keys(String pattern) {
|
||||||
List<String> keys = new ArrayList<>();
|
List<Object> keys = new ArrayList<>();
|
||||||
this.scan(pattern, item -> {
|
this.scan(pattern, item -> {
|
||||||
//符合条件的key
|
//符合条件的key
|
||||||
String key = new String(item, StandardCharsets.UTF_8);
|
String key = new String(item, StandardCharsets.UTF_8);
|
||||||
@ -143,6 +142,13 @@ public class RedisCache implements Cache {
|
|||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Object> keysBlock(String pattern) {
|
||||||
|
Set<Object> set = redisTemplate.keys(pattern);
|
||||||
|
List<Object> list = new ArrayList<>();
|
||||||
|
list.addAll(set);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* scan 实现
|
* scan 实现
|
||||||
|
@ -45,24 +45,23 @@ public class LimitInterceptor {
|
|||||||
@Before("@annotation(limitPointAnnotation)")
|
@Before("@annotation(limitPointAnnotation)")
|
||||||
public void interceptor(LimitPoint limitPointAnnotation) {
|
public void interceptor(LimitPoint limitPointAnnotation) {
|
||||||
LimitTypeEnums limitTypeEnums = limitPointAnnotation.limitType();
|
LimitTypeEnums limitTypeEnums = limitPointAnnotation.limitType();
|
||||||
String name = limitPointAnnotation.name();
|
|
||||||
String key;
|
String key;
|
||||||
int limitPeriod = limitPointAnnotation.period();
|
int limitPeriod = limitPointAnnotation.period();
|
||||||
int limitCount = limitPointAnnotation.limit();
|
int limitCount = limitPointAnnotation.limit();
|
||||||
switch (limitTypeEnums) {
|
if (limitTypeEnums == LimitTypeEnums.CUSTOMER) {
|
||||||
case CUSTOMER:
|
key = limitPointAnnotation.key();
|
||||||
key = limitPointAnnotation.key();
|
} else {
|
||||||
break;
|
key = limitPointAnnotation.key() + IpUtils
|
||||||
default:
|
.getIpAddress(((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
key = limitPointAnnotation.key() + IpUtils
|
|
||||||
.getIpAddress(((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
|
||||||
}
|
}
|
||||||
ImmutableList<String> keys = ImmutableList.of(StringUtils.join(limitPointAnnotation.prefix(), key));
|
ImmutableList<String> keys = ImmutableList.of(StringUtils.join(limitPointAnnotation.prefix(), key));
|
||||||
try {
|
try {
|
||||||
Number count = redisTemplate.execute(limitScript, keys, limitCount, limitPeriod);
|
Number count = redisTemplate.execute(limitScript, keys, limitCount, limitPeriod);
|
||||||
|
assert count != null;
|
||||||
log.info("限制请求{}, 当前请求{},缓存key{}", limitCount, count.intValue(), key);
|
log.info("限制请求{}, 当前请求{},缓存key{}", limitCount, count.intValue(), key);
|
||||||
//如果缓存里没有值,或者他的值小于限制频率
|
//如果缓存里没有值,或者他的值小于限制频率
|
||||||
if (count.intValue() >= limitCount) {
|
if (count.intValue() > limitCount) {
|
||||||
throw new ServiceException(ResultCode.LIMIT_ERROR);
|
throw new ServiceException(ResultCode.LIMIT_ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -72,6 +71,7 @@ public class LimitInterceptor {
|
|||||||
} catch (ServiceException e) {
|
} catch (ServiceException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
log.error("限流异常", e);
|
||||||
throw new ServiceException(ResultCode.ERROR);
|
throw new ServiceException(ResultCode.ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,12 @@ public @interface PreventDuplicateSubmissions {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 过期时间
|
* 过期时间 默认3秒,即3秒内无法重复点击。
|
||||||
*/
|
*/
|
||||||
long expire() default 3;
|
long expire() default 3;
|
||||||
|
/**
|
||||||
|
* 用户间隔离,默认false。
|
||||||
|
* 如果为true则全局限制,为true需要用户登录状态,否则则是全局隔离
|
||||||
|
*/
|
||||||
|
boolean userIsolation() default false;
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,19 @@
|
|||||||
package cn.lili.common.aop.interceptor;
|
package cn.lili.common.aop.interceptor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 防重复提交业务
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @version v1.0
|
||||||
|
* 2022-01-25 09:20
|
||||||
|
*/
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import cn.lili.cache.Cache;
|
import cn.lili.cache.Cache;
|
||||||
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
|
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
|
||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
import cn.lili.common.exception.ServiceException;
|
import cn.lili.common.exception.ServiceException;
|
||||||
|
import cn.lili.common.security.AuthUser;
|
||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.aspectj.lang.annotation.Aspect;
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
@ -15,13 +25,6 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
/**
|
|
||||||
* 防重复提交业务
|
|
||||||
*
|
|
||||||
* @author Chopper
|
|
||||||
* @version v1.0
|
|
||||||
* 2022-01-25 09:20
|
|
||||||
*/
|
|
||||||
@Aspect
|
@Aspect
|
||||||
@Component
|
@Component
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@ -35,9 +38,11 @@ public class PreventDuplicateSubmissionsInterceptor {
|
|||||||
public void interceptor(PreventDuplicateSubmissions preventDuplicateSubmissions) {
|
public void interceptor(PreventDuplicateSubmissions preventDuplicateSubmissions) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Long count = cache.incr(getParams(), preventDuplicateSubmissions.expire());
|
String redisKey = getParams(preventDuplicateSubmissions.userIsolation());
|
||||||
//如果超过2或者设置的参数,则表示重复提交了
|
Long count = cache.incr(redisKey, preventDuplicateSubmissions.expire());
|
||||||
if (count.intValue() >= 2) {
|
log.debug("防重复提交:params-{},value-{}", redisKey, count);
|
||||||
|
//如果超过0或者设置的参数,则表示重复提交了
|
||||||
|
if (count.intValue() > 0) {
|
||||||
throw new ServiceException(ResultCode.LIMIT_ERROR);
|
throw new ServiceException(ResultCode.LIMIT_ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -47,6 +52,7 @@ public class PreventDuplicateSubmissionsInterceptor {
|
|||||||
} catch (ServiceException e) {
|
} catch (ServiceException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
log.error("防重复提交拦截器异常", e);
|
||||||
throw new ServiceException(ResultCode.ERROR);
|
throw new ServiceException(ResultCode.ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -54,12 +60,33 @@ public class PreventDuplicateSubmissionsInterceptor {
|
|||||||
/**
|
/**
|
||||||
* 获取表单参数
|
* 获取表单参数
|
||||||
*
|
*
|
||||||
* @return
|
* @param userIsolation 用户是否隔离
|
||||||
|
* @return 计数器key
|
||||||
*/
|
*/
|
||||||
private String getParams() {
|
private String getParams(Boolean userIsolation) {
|
||||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||||
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
|
//拼接请求地址
|
||||||
|
stringBuilder.append(request.getRequestURI());
|
||||||
|
|
||||||
|
//参数不为空则拼接参数
|
||||||
|
if (!request.getParameterMap().isEmpty()) {
|
||||||
|
stringBuilder.append(JSONUtil.toJsonStr(request.getParameterMap()));
|
||||||
|
}
|
||||||
|
//用户隔离设置为开启,则选择当前用回顾
|
||||||
|
if (userIsolation) {
|
||||||
|
AuthUser authUser = UserContext.getCurrentUser();
|
||||||
|
//用户为空则发出警告,但不拼接,否则拼接用户id
|
||||||
|
if (authUser == null) {
|
||||||
|
log.warn("user isolation settings are on,but current user is null");
|
||||||
|
}
|
||||||
|
// 不为空则拼接用户id
|
||||||
|
else {
|
||||||
|
stringBuilder.append(authUser.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
//请求地址
|
//请求地址
|
||||||
return request.getRequestURI() + UserContext.getCurrentUser().getId() + UserContext.getCurrentUser().getUsername();
|
return stringBuilder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ public enum ResultCode {
|
|||||||
LIMIT_ERROR(1003, "访问过于频繁,请稍后再试"),
|
LIMIT_ERROR(1003, "访问过于频繁,请稍后再试"),
|
||||||
ILLEGAL_REQUEST_ERROR(1004, "非法请求,请重新刷新页面操作"),
|
ILLEGAL_REQUEST_ERROR(1004, "非法请求,请重新刷新页面操作"),
|
||||||
IMAGE_FILE_EXT_ERROR(1005, "不支持图片格式"),
|
IMAGE_FILE_EXT_ERROR(1005, "不支持图片格式"),
|
||||||
|
FILE_NOT_EXIST_ERROR(1011, "上传文件不能为空"),
|
||||||
FILE_TYPE_NOT_SUPPORT(1010, "不支持上传的文件类型!"),
|
FILE_TYPE_NOT_SUPPORT(1010, "不支持上传的文件类型!"),
|
||||||
PLATFORM_NOT_SUPPORTED_IM(1006, "平台未开启IM"),
|
PLATFORM_NOT_SUPPORTED_IM(1006, "平台未开启IM"),
|
||||||
STORE_NOT_SUPPORTED_IM(1007, "店铺未开启IM"),
|
STORE_NOT_SUPPORTED_IM(1007, "店铺未开启IM"),
|
||||||
@ -79,6 +80,8 @@ public enum ResultCode {
|
|||||||
MUST_HAVE_SALES_MODEL(11022, "销售模式为批发时必须要有批发规则!"),
|
MUST_HAVE_SALES_MODEL(11022, "销售模式为批发时必须要有批发规则!"),
|
||||||
|
|
||||||
HAVE_INVALID_SALES_MODEL(11023, "批发规则存在小于等于0的无效数据!"),
|
HAVE_INVALID_SALES_MODEL(11023, "批发规则存在小于等于0的无效数据!"),
|
||||||
|
MUST_HAVE_GOODS_SKU_VALUE(11024, "规格值不能为空!"),
|
||||||
|
DO_NOT_MATCH_WHOLESALE(11025, "批发商品购买数量不能低于起拍量!"),
|
||||||
|
|
||||||
GOODS_PARAMS_ERROR(11013, "商品参数错误,刷新后重试"),
|
GOODS_PARAMS_ERROR(11013, "商品参数错误,刷新后重试"),
|
||||||
PHYSICAL_GOODS_NEED_TEMP(11014, "实物商品需选择配送模板"),
|
PHYSICAL_GOODS_NEED_TEMP(11014, "实物商品需选择配送模板"),
|
||||||
@ -137,7 +140,14 @@ public enum ResultCode {
|
|||||||
USER_CONNECT_BANDING_ERROR(20023, "当前联合登陆方式,已绑定其他账号,需进行解绑操作"),
|
USER_CONNECT_BANDING_ERROR(20023, "当前联合登陆方式,已绑定其他账号,需进行解绑操作"),
|
||||||
USER_CONNECT_NOT_EXIST_ERROR(20024, "暂无联合登陆信息,无法实现一键注册功能,请点击第三方登录进行授权"),
|
USER_CONNECT_NOT_EXIST_ERROR(20024, "暂无联合登陆信息,无法实现一键注册功能,请点击第三方登录进行授权"),
|
||||||
USER_POINTS_ERROR(20024, "用户积分不足"),
|
USER_POINTS_ERROR(20024, "用户积分不足"),
|
||||||
|
CLERK_SUPPER(20025, "店主无法操作"),
|
||||||
|
CLERK_SAVE_ERROR(20026, "店员保存失败"),
|
||||||
|
CLERK_NOT_FOUND_ERROR(20027, "店员不存在"),
|
||||||
|
USER_STATUS_ERROR(20028, "用户已禁用"),
|
||||||
|
CLERK_USER_ERROR(20029, "此账户已经绑定其他店铺"),
|
||||||
|
CLERK_ALREADY_EXIT_ERROR(20030, "店员已经存在"),
|
||||||
|
CLERK_DISABLED_ERROR(20031, "店员已禁用"),
|
||||||
|
CLERK_CURRENT_SUPPER(20032, "无法删除当前登录店员"),
|
||||||
/**
|
/**
|
||||||
* 权限
|
* 权限
|
||||||
*/
|
*/
|
||||||
@ -146,6 +156,10 @@ public enum ResultCode {
|
|||||||
PERMISSION_MENU_ROLE_ERROR(21003, "菜单已绑定角色,请先删除或编辑角色"),
|
PERMISSION_MENU_ROLE_ERROR(21003, "菜单已绑定角色,请先删除或编辑角色"),
|
||||||
PERMISSION_DEPARTMENT_DELETE_ERROR(21004, "部门已经绑定管理员,请先删除或编辑管理员"),
|
PERMISSION_DEPARTMENT_DELETE_ERROR(21004, "部门已经绑定管理员,请先删除或编辑管理员"),
|
||||||
PERMISSION_BEYOND_TEN(21005, "最多可以设置10个角色"),
|
PERMISSION_BEYOND_TEN(21005, "最多可以设置10个角色"),
|
||||||
|
PERMISSION_NOT_FOUND_ERROR(21006, "部门不存在"),
|
||||||
|
PERMISSION_ROLE_NOT_FOUND_ERROR(21007, "角色不存在"),
|
||||||
|
PERMISSION_CLERK_BAND_ERROR(21008, "此手机号码已绑定其他店铺 "),
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分销
|
* 分销
|
||||||
@ -278,11 +292,6 @@ public enum ResultCode {
|
|||||||
COUPON_RECEIVE_ERROR(41005, "当前优惠券已经被领取完了,下次要早点来哦"),
|
COUPON_RECEIVE_ERROR(41005, "当前优惠券已经被领取完了,下次要早点来哦"),
|
||||||
COUPON_NUM_INSUFFICIENT_ERROR(41006, "优惠券剩余领取数量不足"),
|
COUPON_NUM_INSUFFICIENT_ERROR(41006, "优惠券剩余领取数量不足"),
|
||||||
COUPON_NOT_EXIST(41007, "当前优惠券不存在"),
|
COUPON_NOT_EXIST(41007, "当前优惠券不存在"),
|
||||||
COUPON_DO_NOT_RECEIVER(41030, "当前优惠券不允许主动领取"),
|
|
||||||
COUPON_ACTIVITY_NOT_EXIST(410022, "当前优惠券活动不存在"),
|
|
||||||
COUPON_SAVE_ERROR(41020, "保存优惠券失败"),
|
|
||||||
COUPON_ACTIVITY_SAVE_ERROR(41023, "保存优惠券活动失败"),
|
|
||||||
COUPON_DELETE_ERROR(41021, "删除优惠券失败"),
|
|
||||||
COUPON_LIMIT_NUM_LESS_THAN_0(41008, "领取限制数量不能为负数"),
|
COUPON_LIMIT_NUM_LESS_THAN_0(41008, "领取限制数量不能为负数"),
|
||||||
COUPON_LIMIT_GREATER_THAN_PUBLISH(41009, "领取限制数量超出发行数量"),
|
COUPON_LIMIT_GREATER_THAN_PUBLISH(41009, "领取限制数量超出发行数量"),
|
||||||
COUPON_DISCOUNT_ERROR(41010, "优惠券折扣必须小于10且大于0"),
|
COUPON_DISCOUNT_ERROR(41010, "优惠券折扣必须小于10且大于0"),
|
||||||
@ -293,6 +302,15 @@ public enum ResultCode {
|
|||||||
COUPON_MEMBER_NOT_EXIST(41015, "没有当前会员优惠券"),
|
COUPON_MEMBER_NOT_EXIST(41015, "没有当前会员优惠券"),
|
||||||
COUPON_MEMBER_STATUS_ERROR(41016, "当前会员优惠券已过期/作废无法变更状态!"),
|
COUPON_MEMBER_STATUS_ERROR(41016, "当前会员优惠券已过期/作废无法变更状态!"),
|
||||||
|
|
||||||
|
SPECIAL_CANT_USE(41019, "特殊商品不能使用优惠券,不能使用"),
|
||||||
|
|
||||||
|
COUPON_SAVE_ERROR(41020, "保存优惠券失败"),
|
||||||
|
COUPON_DELETE_ERROR(41021, "删除优惠券失败"),
|
||||||
|
COUPON_ACTIVITY_NOT_EXIST(41022, "当前优惠券活动不存在"),
|
||||||
|
COUPON_ACTIVITY_SAVE_ERROR(41023, "保存优惠券活动失败"),
|
||||||
|
COUPON_ACTIVITY_MAX_NUM(41024, "优惠券活动赠券数量最多为3"),
|
||||||
|
|
||||||
|
COUPON_DO_NOT_RECEIVER(41030, "当前优惠券不允许主动领取"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼团
|
* 拼团
|
||||||
@ -385,11 +403,12 @@ public enum ResultCode {
|
|||||||
|
|
||||||
STORE_NOT_EXIST(50001, "此店铺不存在"),
|
STORE_NOT_EXIST(50001, "此店铺不存在"),
|
||||||
STORE_NAME_EXIST_ERROR(50002, "店铺名称已存在!"),
|
STORE_NAME_EXIST_ERROR(50002, "店铺名称已存在!"),
|
||||||
STORE_APPLY_DOUBLE_ERROR(50003, "已有店铺,无需重复申请!"),
|
STORE_APPLY_DOUBLE_ERROR(50003, "已经拥有店铺!"),
|
||||||
STORE_NOT_OPEN(50004, "该会员未开通店铺"),
|
STORE_NOT_OPEN(50004, "该会员未开通店铺"),
|
||||||
STORE_NOT_LOGIN_ERROR(50005, "未登录店铺"),
|
STORE_NOT_LOGIN_ERROR(50005, "未登录店铺"),
|
||||||
STORE_CLOSE_ERROR(50006, "店铺关闭,请联系管理员"),
|
STORE_CLOSE_ERROR(50006, "店铺关闭,请联系管理员"),
|
||||||
FREIGHT_TEMPLATE_NOT_EXIST(50010, "当前模版不存在"),
|
FREIGHT_TEMPLATE_NOT_EXIST(50010, "当前模版不存在"),
|
||||||
|
STORE_STATUS_ERROR(50011, "店铺状态异常,无法申请"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 结算单
|
* 结算单
|
||||||
|
@ -21,9 +21,9 @@ public class TransactionCommitSendMQEvent extends ApplicationEvent {
|
|||||||
private final String tag;
|
private final String tag;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final String message;
|
private final Object message;
|
||||||
|
|
||||||
public TransactionCommitSendMQEvent(Object source, String topic, String tag, String message) {
|
public TransactionCommitSendMQEvent(Object source, String topic, String tag, Object message) {
|
||||||
super(source);
|
super(source);
|
||||||
this.topic = topic;
|
this.topic = topic;
|
||||||
this.tag = tag;
|
this.tag = tag;
|
||||||
|
@ -18,7 +18,7 @@ import javax.validation.ConstraintViolationException;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 全局异常异常处理
|
* 异常处理
|
||||||
*
|
*
|
||||||
* @author Chopper
|
* @author Chopper
|
||||||
*/
|
*/
|
||||||
@ -74,6 +74,15 @@ public class GlobalControllerExceptionHandler {
|
|||||||
}
|
}
|
||||||
return ResultUtil.error(ResultCode.ERROR.code(), errorMsg);
|
return ResultUtil.error(ResultCode.ERROR.code(), errorMsg);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
@ExceptionHandler(ConstraintViolationException.class)
|
||||||
|
@ResponseStatus(value = HttpStatus.BAD_REQUEST)
|
||||||
|
public ResultMessage<Object> constraintExceptionHandler(HttpServletRequest request, final Exception e, HttpServletResponse response) {
|
||||||
|
|
||||||
|
log.error("全局异常[RuntimeException]:", e);
|
||||||
|
|
||||||
|
return ResultUtil.error(001, e.getMessage());
|
||||||
|
}*/
|
||||||
|
|
||||||
@ExceptionHandler(RuntimeException.class)
|
@ExceptionHandler(RuntimeException.class)
|
||||||
@ResponseStatus(value = HttpStatus.BAD_REQUEST)
|
@ResponseStatus(value = HttpStatus.BAD_REQUEST)
|
||||||
|
@ -16,21 +16,21 @@ public class SmsTemplateProperties {
|
|||||||
/**
|
/**
|
||||||
* 登录
|
* 登录
|
||||||
*/
|
*/
|
||||||
private String lOGIN = "SMS_205755300";
|
private String lOGIN = "SMS_185821482";
|
||||||
/**
|
/**
|
||||||
* 注册
|
* 注册
|
||||||
*/
|
*/
|
||||||
private String REGISTER = "SMS_205755298";
|
private String REGISTER = "SMS_185821482";
|
||||||
/**
|
/**
|
||||||
* 找回密码
|
* 找回密码
|
||||||
*/
|
*/
|
||||||
private String FIND_USER = "SMS_205755301";
|
private String FIND_USER = "SMS_185821482";
|
||||||
/**
|
/**
|
||||||
* 设置密码
|
* 设置密码
|
||||||
*/
|
*/
|
||||||
private String UPDATE_PASSWORD = "SMS_205755297";
|
private String UPDATE_PASSWORD = "SMS_185821482";
|
||||||
/**
|
/**
|
||||||
* 设置支付密码
|
* 设置支付密码
|
||||||
*/
|
*/
|
||||||
private String WALLET_PASSWORD = "SMS_205755297";
|
private String WALLET_PASSWORD = "SMS_185821482";
|
||||||
}
|
}
|
||||||
|
@ -24,8 +24,7 @@ public class VerificationCodeProperties {
|
|||||||
/**
|
/**
|
||||||
* 水印
|
* 水印
|
||||||
*/
|
*/
|
||||||
private String watermark = "LILI-SHOP";
|
private String watermark = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 干扰数量 最大数量
|
* 干扰数量 最大数量
|
||||||
*/
|
*/
|
||||||
|
@ -51,6 +51,11 @@ public class AuthUser implements Serializable {
|
|||||||
* storeId
|
* storeId
|
||||||
*/
|
*/
|
||||||
private String storeId;
|
private String storeId;
|
||||||
|
/**
|
||||||
|
* 如果角色是商家,则存在此店铺id字段
|
||||||
|
* clerkId
|
||||||
|
*/
|
||||||
|
private String clerkId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 如果角色是商家,则存在此店铺名称字段
|
* 如果角色是商家,则存在此店铺名称字段
|
||||||
@ -79,4 +84,14 @@ public class AuthUser implements Serializable {
|
|||||||
this.isSuper = isSuper;
|
this.isSuper = isSuper;
|
||||||
this.nickName = nickName;
|
this.nickName = nickName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AuthUser(String username, String id, UserEnums manager, String nickName, Boolean isSuper, String clerkId,String face) {
|
||||||
|
this.username = username;
|
||||||
|
this.id = id;
|
||||||
|
this.role = manager;
|
||||||
|
this.isSuper = isSuper;
|
||||||
|
this.nickName = nickName;
|
||||||
|
this.clerkId = clerkId;
|
||||||
|
this.face = face;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package cn.lili.common.security.context;
|
package cn.lili.common.security.context;
|
||||||
|
|
||||||
import cn.lili.cache.Cache;
|
import cn.lili.cache.Cache;
|
||||||
|
import cn.lili.cache.CachePrefix;
|
||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
import cn.lili.common.exception.ServiceException;
|
import cn.lili.common.exception.ServiceException;
|
||||||
import cn.lili.common.security.AuthUser;
|
import cn.lili.common.security.AuthUser;
|
||||||
@ -60,10 +61,13 @@ public class UserContext {
|
|||||||
*/
|
*/
|
||||||
public static AuthUser getAuthUser(Cache cache, String accessToken) {
|
public static AuthUser getAuthUser(Cache cache, String accessToken) {
|
||||||
try {
|
try {
|
||||||
if (cache.keys("*" + accessToken).isEmpty()) {
|
AuthUser authUser = getAuthUser(accessToken);
|
||||||
|
assert authUser != null;
|
||||||
|
|
||||||
|
if (!cache.hasKey(CachePrefix.ACCESS_TOKEN.getPrefix(authUser.getRole()) + accessToken)) {
|
||||||
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
|
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
|
||||||
}
|
}
|
||||||
return getAuthUser(accessToken);
|
return authUser;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -181,7 +181,7 @@ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
|||||||
//将resultMap转换为json字符串
|
//将resultMap转换为json字符串
|
||||||
String resultStr = JSONUtil.toJsonStr(resultMap);
|
String resultStr = JSONUtil.toJsonStr(resultMap);
|
||||||
//将json字符串转换为字节
|
//将json字符串转换为字节
|
||||||
final ByteArrayInputStream resultBIS = new ByteArrayInputStream(resultStr.getBytes());
|
final ByteArrayInputStream resultBIS = new ByteArrayInputStream(resultStr.getBytes(StandardCharsets.UTF_8));
|
||||||
|
|
||||||
//实现接口
|
//实现接口
|
||||||
return new ServletInputStream() {
|
return new ServletInputStream() {
|
||||||
|
@ -17,7 +17,7 @@ public class SecretKeyUtil {
|
|||||||
public static SecretKey generalKey() {
|
public static SecretKey generalKey() {
|
||||||
//自定义
|
//自定义
|
||||||
byte[] encodedKey = Base64.decodeBase64("cuAihCz53DZRjZwbsGcZJ2Ai6At+T142uphtJMsk7iQ=");
|
byte[] encodedKey = Base64.decodeBase64("cuAihCz53DZRjZwbsGcZJ2Ai6At+T142uphtJMsk7iQ=");
|
||||||
javax.crypto.SecretKey key = Keys.hmacShaKeyFor(encodedKey);
|
SecretKey key = Keys.hmacShaKeyFor(encodedKey);
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,9 +34,9 @@ public class TokenUtil {
|
|||||||
/**
|
/**
|
||||||
* 构建token
|
* 构建token
|
||||||
*
|
*
|
||||||
* @param username 主体
|
* @param username 主体
|
||||||
* @param claim 私有声明
|
* @param claim 私有声明
|
||||||
* @param longTerm 长时间特殊token 如:移动端,微信小程序等
|
* @param longTerm 长时间特殊token 如:移动端,微信小程序等
|
||||||
* @param userEnums 用户枚举
|
* @param userEnums 用户枚举
|
||||||
* @return TOKEN
|
* @return TOKEN
|
||||||
*/
|
*/
|
||||||
@ -62,7 +62,7 @@ public class TokenUtil {
|
|||||||
* 刷新token
|
* 刷新token
|
||||||
*
|
*
|
||||||
* @param oldRefreshToken 刷新token
|
* @param oldRefreshToken 刷新token
|
||||||
* @param userEnums 用户枚举
|
* @param userEnums 用户枚举
|
||||||
* @return token
|
* @return token
|
||||||
*/
|
*/
|
||||||
public Token refreshToken(String oldRefreshToken, UserEnums userEnums) {
|
public Token refreshToken(String oldRefreshToken, UserEnums userEnums) {
|
||||||
|
@ -55,7 +55,7 @@ public class IpUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ("0:0:0:0:0:0:0:1".equals(ip)) {
|
if ("0:0:0:0:0:0:0:1".equals(ip)) {
|
||||||
ip = "127.0.0.1";
|
ip = "106.124.130.167";
|
||||||
}
|
}
|
||||||
return ip;
|
return ip;
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户名验证工具类
|
* 用户名验证工具类
|
||||||
|
*
|
||||||
* @author Chopper
|
* @author Chopper
|
||||||
*/
|
*/
|
||||||
public class RegularUtil {
|
public class RegularUtil {
|
||||||
@ -20,21 +21,88 @@ public class RegularUtil {
|
|||||||
*/
|
*/
|
||||||
private static final Pattern EMAIL = Pattern.compile("^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.[a-zA-Z0-9]{2,6}$");
|
private static final Pattern EMAIL = Pattern.compile("^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.[a-zA-Z0-9]{2,6}$");
|
||||||
|
|
||||||
public static boolean mobile(String v){
|
//sql正则
|
||||||
|
|
||||||
|
static Pattern sqlPattern = Pattern.compile("(select|update|and|delete|insert|trancate|char|substr|ascii|declare|exec|count|master|into|drop|execute" +
|
||||||
|
// 可能涉及英文查询参数问题
|
||||||
|
// "|in|not in exists|not exists" +
|
||||||
|
// "|between|not between" +
|
||||||
|
// "|like|not like" +
|
||||||
|
// "|is null|is not null" +
|
||||||
|
")", Pattern.CASE_INSENSITIVE);
|
||||||
|
|
||||||
|
//符号正则
|
||||||
|
static Pattern symbolPattern = Pattern.compile("[\\s~·`!!@#¥$%^……&*(())\\-——\\-_=+【\\[\\]】{{}}\\|、\\\\;;::‘'“”\",,《<。.》>、/??]");
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验手机号
|
||||||
|
*
|
||||||
|
* @param v
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean mobile(String v) {
|
||||||
|
|
||||||
Matcher m = MOBILE.matcher(v);
|
Matcher m = MOBILE.matcher(v);
|
||||||
if(m.matches()){
|
if (m.matches()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean email(String v){
|
//校验邮箱
|
||||||
|
public static boolean email(String v) {
|
||||||
|
|
||||||
Matcher m = EMAIL.matcher(v);
|
Matcher m = EMAIL.matcher(v);
|
||||||
if(m.matches()){
|
if (m.matches()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索参数过滤
|
||||||
|
*
|
||||||
|
* @param str 字符串
|
||||||
|
* @return 过滤后的字符串
|
||||||
|
*/
|
||||||
|
public static String replace(String str) {
|
||||||
|
|
||||||
|
return symbolReplace(sqlReplace(str));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过滤sql关键字
|
||||||
|
*
|
||||||
|
* @param str 字符串
|
||||||
|
* @return 过滤后的字符串
|
||||||
|
*/
|
||||||
|
public static String sqlReplace(String str) {
|
||||||
|
if (StringUtils.isEmpty(str)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
Matcher sqlMatcher = sqlPattern.matcher(str);
|
||||||
|
return sqlMatcher.replaceAll("");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 符号过滤
|
||||||
|
*
|
||||||
|
* @param str 字符串
|
||||||
|
* @return 过滤后的字符串
|
||||||
|
*/
|
||||||
|
public static String symbolReplace(String str) {
|
||||||
|
if (StringUtils.isEmpty(str)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
Matcher symbolMatcher = symbolPattern.matcher(str);
|
||||||
|
return symbolMatcher.replaceAll("");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println(replace("selectSELECTINORNOTIN123阿松大asdfa!@#$%^&&*()_+{}[]!?>?").trim());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ public abstract class BaseElasticsearchService {
|
|||||||
log.info(" whether all of the nodes have acknowledged the request : {}", createIndexResponse.isAcknowledged());
|
log.info(" whether all of the nodes have acknowledged the request : {}", createIndexResponse.isAcknowledged());
|
||||||
log.info(" Indicates whether the requisite number of shard copies were started for each shard in the index before timing out :{}", createIndexResponse.isShardsAcknowledged());
|
log.info(" Indicates whether the requisite number of shard copies were started for each shard in the index before timing out :{}", createIndexResponse.isShardsAcknowledged());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("创建索引错误",e);
|
log.error("创建索引错误", e);
|
||||||
throw new ElasticsearchException("创建索引 {" + index + "} 失败:" + e.getMessage());
|
throw new ElasticsearchException("创建索引 {" + index + "} 失败:" + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -339,8 +339,7 @@ public abstract class BaseElasticsearchService {
|
|||||||
" }\n" +
|
" }\n" +
|
||||||
" }\n";
|
" }\n";
|
||||||
|
|
||||||
PutMappingRequest request = new PutMappingRequest(index)
|
PutMappingRequest request = new PutMappingRequest(index).source(source, XContentType.JSON);
|
||||||
.source(source, XContentType.JSON);
|
|
||||||
CountDownLatch latch = new CountDownLatch(1);
|
CountDownLatch latch = new CountDownLatch(1);
|
||||||
client.indices().putMappingAsync(
|
client.indices().putMappingAsync(
|
||||||
request,
|
request,
|
||||||
@ -445,7 +444,7 @@ public abstract class BaseElasticsearchService {
|
|||||||
try {
|
try {
|
||||||
searchResponse = client.search(searchRequest, COMMON_OPTIONS);
|
searchResponse = client.search(searchRequest, COMMON_OPTIONS);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.error("es 搜索错误",e);
|
log.error("es 搜索错误", e);
|
||||||
}
|
}
|
||||||
return searchResponse;
|
return searchResponse;
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,11 @@ public class AuthConfig {
|
|||||||
/**
|
/**
|
||||||
* 针对国外服务可以单独设置代理
|
* 针对国外服务可以单独设置代理
|
||||||
* HttpConfig config = new HttpConfig();
|
* HttpConfig config = new HttpConfig();
|
||||||
|
<<<<<<< HEAD
|
||||||
|
* config.setProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("106.124.130.167", 10080)));
|
||||||
|
=======
|
||||||
* config.setProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080)));
|
* config.setProxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", 10080)));
|
||||||
|
>>>>>>> ae0c4aea12996d3d72eca7c6ccdc97922373e4d7
|
||||||
* config.setTimeout(15000);
|
* config.setTimeout(15000);
|
||||||
*
|
*
|
||||||
* @since 1.15.5
|
* @since 1.15.5
|
||||||
|
@ -8,7 +8,9 @@ import cn.lili.cache.CachePrefix;
|
|||||||
import cn.lili.common.context.ThreadContextHolder;
|
import cn.lili.common.context.ThreadContextHolder;
|
||||||
import cn.lili.common.enums.ClientTypeEnum;
|
import cn.lili.common.enums.ClientTypeEnum;
|
||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
|
import cn.lili.common.event.TransactionCommitSendMQEvent;
|
||||||
import cn.lili.common.exception.ServiceException;
|
import cn.lili.common.exception.ServiceException;
|
||||||
|
import cn.lili.common.properties.RocketmqCustomProperties;
|
||||||
import cn.lili.common.security.AuthUser;
|
import cn.lili.common.security.AuthUser;
|
||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
import cn.lili.common.security.token.Token;
|
import cn.lili.common.security.token.Token;
|
||||||
@ -29,11 +31,13 @@ import cn.lili.modules.system.entity.dto.connect.WechatConnectSetting;
|
|||||||
import cn.lili.modules.system.entity.dto.connect.dto.WechatConnectSettingItem;
|
import cn.lili.modules.system.entity.dto.connect.dto.WechatConnectSettingItem;
|
||||||
import cn.lili.modules.system.entity.enums.SettingEnum;
|
import cn.lili.modules.system.entity.enums.SettingEnum;
|
||||||
import cn.lili.modules.system.service.SettingService;
|
import cn.lili.modules.system.service.SettingService;
|
||||||
|
import cn.lili.rocketmq.tags.MemberTagsEnum;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.ApplicationEventPublisher;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@ -66,6 +70,14 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
|||||||
private MemberTokenGenerate memberTokenGenerate;
|
private MemberTokenGenerate memberTokenGenerate;
|
||||||
@Autowired
|
@Autowired
|
||||||
private Cache cache;
|
private Cache cache;
|
||||||
|
/**
|
||||||
|
* RocketMQ 配置
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private RocketmqCustomProperties rocketmqCustomProperties;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ApplicationEventPublisher applicationEventPublisher;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@ -235,6 +247,8 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
|||||||
memberService.save(newMember);
|
memberService.save(newMember);
|
||||||
newMember = memberService.findByUsername(newMember.getUsername());
|
newMember = memberService.findByUsername(newMember.getUsername());
|
||||||
bindMpMember(openId, unionId, newMember);
|
bindMpMember(openId, unionId, newMember);
|
||||||
|
// 发送会员注册信息
|
||||||
|
applicationEventPublisher.publishEvent(new TransactionCommitSendMQEvent("new member register", rocketmqCustomProperties.getMemberTopic(), MemberTagsEnum.MEMBER_REGISTER.name(), newMember));
|
||||||
return memberTokenGenerate.createToken(newMember, true);
|
return memberTokenGenerate.createToken(newMember, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,9 +276,9 @@ public class ConnectServiceImpl extends ServiceImpl<ConnectMapper, Connect> impl
|
|||||||
* 这样,微信小程序注册之后,其他app 公众号页面,都可以实现绑定自动登录功能
|
* 这样,微信小程序注册之后,其他app 公众号页面,都可以实现绑定自动登录功能
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @param openId 微信openid
|
* @param openId 微信openid
|
||||||
* @param unionId 微信unionid
|
* @param unionId 微信unionid
|
||||||
* @param member 会员
|
* @param member 会员
|
||||||
*/
|
*/
|
||||||
private void bindMpMember(String openId, String unionId, Member member) {
|
private void bindMpMember(String openId, String unionId, Member member) {
|
||||||
|
|
||||||
|
@ -47,9 +47,9 @@ public class AuthChecker {
|
|||||||
if (!GlobalAuthUtils.isHttpProtocol(redirectUri) && !GlobalAuthUtils.isHttpsProtocol(redirectUri)) {
|
if (!GlobalAuthUtils.isHttpProtocol(redirectUri) && !GlobalAuthUtils.isHttpsProtocol(redirectUri)) {
|
||||||
throw new AuthException(AuthResponseStatus.ILLEGAL_REDIRECT_URI, connectAuth);
|
throw new AuthException(AuthResponseStatus.ILLEGAL_REDIRECT_URI, connectAuth);
|
||||||
}
|
}
|
||||||
//支付宝在创建回调地址时,不允许使用localhost或者127.0.0.1
|
//支付宝在创建回调地址时,不允许使用localhost或者106.124.130.167
|
||||||
if (ConnectAuthEnum.ALIPAY == connectAuth && GlobalAuthUtils.isLocalHost(redirectUri)) {
|
if (ConnectAuthEnum.ALIPAY == connectAuth && GlobalAuthUtils.isLocalHost(redirectUri)) {
|
||||||
//The redirect uri of alipay is forbidden to use localhost or 127.0.0.1
|
//The redirect uri of alipay is forbidden to use localhost or 106.124.130.167
|
||||||
throw new AuthException(AuthResponseStatus.ILLEGAL_REDIRECT_URI, connectAuth);
|
throw new AuthException(AuthResponseStatus.ILLEGAL_REDIRECT_URI, connectAuth);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,7 @@ public class GlobalAuthUtils {
|
|||||||
* @return true: 本地主机(域名), false: 非本地主机(域名)
|
* @return true: 本地主机(域名), false: 非本地主机(域名)
|
||||||
*/
|
*/
|
||||||
public static boolean isLocalHost(String url) {
|
public static boolean isLocalHost(String url) {
|
||||||
return StringUtils.isEmpty(url) || url.contains("127.0.0.1") || url.contains("localhost");
|
return StringUtils.isEmpty(url) || url.contains("106.124.130.167") || url.contains("localhost");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,6 +50,9 @@ public class DistributionOrder extends BaseIdEntity {
|
|||||||
private String distributionId;
|
private String distributionId;
|
||||||
@ApiModelProperty(value = "分销员名称")
|
@ApiModelProperty(value = "分销员名称")
|
||||||
private String distributionName;
|
private String distributionName;
|
||||||
|
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@ApiModelProperty(value = "解冻日期")
|
@ApiModelProperty(value = "解冻日期")
|
||||||
private Date settleCycle;
|
private Date settleCycle;
|
||||||
@ApiModelProperty(value = "提成金额")
|
@ApiModelProperty(value = "提成金额")
|
||||||
|
@ -20,8 +20,8 @@ public interface DistributionOrderMapper extends BaseMapper<DistributionOrder> {
|
|||||||
* @param settleCycle 时间
|
* @param settleCycle 时间
|
||||||
*/
|
*/
|
||||||
@Update("UPDATE li_distribution AS d " +
|
@Update("UPDATE li_distribution AS d " +
|
||||||
"SET d.can_rebate =(d.can_rebate +(SELECT SUM( dorder.rebate ) FROM li_distribution_order AS dorder WHERE dorder.distribution_order_status = #{distributionOrderStatus} AND dorder.settle_cycle< #{settleCycle} AND dorder.distribution_id = d.id ))" +
|
"SET d.can_rebate =(ifnull(d.can_rebate,0) +(SELECT SUM( dorder.rebate ) FROM li_distribution_order AS dorder WHERE dorder.distribution_order_status = #{distributionOrderStatus} AND dorder.settle_cycle< #{settleCycle} AND dorder.distribution_id = d.id ))" +
|
||||||
",d.commission_frozen =(d.commission_frozen -(SELECT SUM( dorder.rebate ) FROM li_distribution_order AS dorder WHERE dorder.distribution_order_status = #{distributionOrderStatus} AND dorder.settle_cycle< #{settleCycle} AND dorder.distribution_id = d.id ) )")
|
",d.commission_frozen =(ifnull(d.commission_frozen,0) -(SELECT SUM( dorder.rebate ) FROM li_distribution_order AS dorder WHERE dorder.distribution_order_status = #{distributionOrderStatus} AND dorder.settle_cycle< #{settleCycle} AND dorder.distribution_id = d.id ) )")
|
||||||
void rebate(String distributionOrderStatus, DateTime settleCycle);
|
void rebate(String distributionOrderStatus, DateTime settleCycle);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -73,6 +73,7 @@ public class DistributionCashServiceImpl extends ServiceImpl<DistributionCashMap
|
|||||||
}
|
}
|
||||||
//将提现金额存入冻结金额,扣减可提现金额
|
//将提现金额存入冻结金额,扣减可提现金额
|
||||||
distribution.setCanRebate(CurrencyUtil.sub(distribution.getCanRebate(), applyMoney));
|
distribution.setCanRebate(CurrencyUtil.sub(distribution.getCanRebate(), applyMoney));
|
||||||
|
distribution.setCommissionFrozen(CurrencyUtil.add(distribution.getCommissionFrozen(), applyMoney));
|
||||||
distributionService.updateById(distribution);
|
distributionService.updateById(distribution);
|
||||||
//提现申请记录
|
//提现申请记录
|
||||||
DistributionCash distributionCash = new DistributionCash("D" + SnowFlake.getId(), distribution.getId(), applyMoney, distribution.getMemberName());
|
DistributionCash distributionCash = new DistributionCash("D" + SnowFlake.getId(), distribution.getId(), applyMoney, distribution.getMemberName());
|
||||||
|
@ -94,6 +94,9 @@ public class DistributionOrderServiceImpl extends ServiceImpl<DistributionOrderM
|
|||||||
//循环店铺流水记录判断是否包含分销商品
|
//循环店铺流水记录判断是否包含分销商品
|
||||||
//包含分销商品则进行记录分销订单、计算分销总额
|
//包含分销商品则进行记录分销订单、计算分销总额
|
||||||
for (StoreFlow storeFlow : storeFlowList) {
|
for (StoreFlow storeFlow : storeFlowList) {
|
||||||
|
if (storeFlow.getDistributionRebate() == null || storeFlow.getDistributionRebate() == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
rebate = CurrencyUtil.add(rebate, storeFlow.getDistributionRebate());
|
rebate = CurrencyUtil.add(rebate, storeFlow.getDistributionRebate());
|
||||||
DistributionOrder distributionOrder = new DistributionOrder(storeFlow);
|
DistributionOrder distributionOrder = new DistributionOrder(storeFlow);
|
||||||
distributionOrder.setDistributionId(order.getDistributionId());
|
distributionOrder.setDistributionId(order.getDistributionId());
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package cn.lili.modules.file.plugin.impl;
|
package cn.lili.modules.file.plugin.impl;
|
||||||
|
|
||||||
|
import cn.lili.common.enums.ResultCode;
|
||||||
|
import cn.lili.common.exception.ServiceException;
|
||||||
import cn.lili.modules.file.entity.enums.OssEnum;
|
import cn.lili.modules.file.entity.enums.OssEnum;
|
||||||
import cn.lili.modules.file.plugin.FilePlugin;
|
import cn.lili.modules.file.plugin.FilePlugin;
|
||||||
import cn.lili.modules.system.entity.dto.OssSetting;
|
import cn.lili.modules.system.entity.dto.OssSetting;
|
||||||
@ -62,10 +64,9 @@ public class MinioFilePlugin implements FilePlugin {
|
|||||||
public String pathUpload(String filePath, String key) {
|
public String pathUpload(String filePath, String key) {
|
||||||
try {
|
try {
|
||||||
return this.inputStreamUpload(new FileInputStream(filePath), key);
|
return this.inputStreamUpload(new FileInputStream(filePath), key);
|
||||||
} catch (FileNotFoundException e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
throw new ServiceException(ResultCode.OSS_DELETE_ERROR, e.getMessage());
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -77,18 +78,15 @@ public class MinioFilePlugin implements FilePlugin {
|
|||||||
PutObjectArgs putObjectArgs = PutObjectArgs.builder()
|
PutObjectArgs putObjectArgs = PutObjectArgs.builder()
|
||||||
.bucket(bucket).stream(inputStream, inputStream.available(), 5 * 1024 * 1024)
|
.bucket(bucket).stream(inputStream, inputStream.available(), 5 * 1024 * 1024)
|
||||||
.object(key)
|
.object(key)
|
||||||
.contentType("image/png")
|
.contentType("image/png" )
|
||||||
.build();
|
.build();
|
||||||
client.putObject(putObjectArgs);
|
client.putObject(putObjectArgs);
|
||||||
} catch (ErrorResponseException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("上传失败2,", e);
|
log.error("上传失败2,", e);
|
||||||
return null;
|
throw new ServiceException(ResultCode.OSS_DELETE_ERROR, e.getMessage());
|
||||||
}
|
}
|
||||||
//拼接出可访问的url地址
|
//拼接出可访问的url地址
|
||||||
return ossSetting.getM_endpoint() + "/" + bucket + "/" + key;
|
return ossSetting.getM_frontUrl() + "/" + bucket + "/" + key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -125,12 +123,14 @@ public class MinioFilePlugin implements FilePlugin {
|
|||||||
//创建bucket
|
//创建bucket
|
||||||
MakeBucketArgs makeBucketArgs = MakeBucketArgs.builder().bucket(ossSetting.getM_bucketName()).build();
|
MakeBucketArgs makeBucketArgs = MakeBucketArgs.builder().bucket(ossSetting.getM_bucketName()).build();
|
||||||
this.minioClient.makeBucket(makeBucketArgs);
|
this.minioClient.makeBucket(makeBucketArgs);
|
||||||
setBucketPolicy(this.minioClient, ossSetting.getM_bucketName(), "read-write");
|
setBucketPolicy(this.minioClient, ossSetting.getM_bucketName(), "read-write" );
|
||||||
log.info("创建minio桶成功{}", ossSetting.getM_bucketName());
|
log.info("创建minio桶成功{}", ossSetting.getM_bucketName());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
//晴空配置
|
||||||
|
minioClient = null;
|
||||||
log.error("创建[{}]bucket失败", ossSetting.getM_bucketName());
|
log.error("创建[{}]bucket失败", ossSetting.getM_bucketName());
|
||||||
|
throw new ServiceException(ResultCode.OSS_DELETE_ERROR, e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -153,7 +153,7 @@ public class MinioFilePlugin implements FilePlugin {
|
|||||||
client.setBucketPolicy(SetBucketPolicyArgs.builder().bucket(bucket).config(WRITE_ONLY.replace(BUCKET_PARAM, bucket)).build());
|
client.setBucketPolicy(SetBucketPolicyArgs.builder().bucket(bucket).config(WRITE_ONLY.replace(BUCKET_PARAM, bucket)).build());
|
||||||
break;
|
break;
|
||||||
case "read-write":
|
case "read-write":
|
||||||
client.setBucketPolicy(SetBucketPolicyArgs.builder().bucket(bucket).region("public").config(READ_WRITE.replace(BUCKET_PARAM, bucket)).build());
|
client.setBucketPolicy(SetBucketPolicyArgs.builder().bucket(bucket).region("public" ).config(READ_WRITE.replace(BUCKET_PARAM, bucket)).build());
|
||||||
break;
|
break;
|
||||||
case "none":
|
case "none":
|
||||||
default:
|
default:
|
||||||
|
@ -4,6 +4,7 @@ import cn.hutool.core.text.CharSequenceUtil;
|
|||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
import cn.lili.common.exception.ServiceException;
|
import cn.lili.common.exception.ServiceException;
|
||||||
import cn.lili.common.security.AuthUser;
|
import cn.lili.common.security.AuthUser;
|
||||||
|
import cn.lili.mybatis.util.PageUtil;
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.common.vo.SearchVO;
|
import cn.lili.common.vo.SearchVO;
|
||||||
import cn.lili.modules.file.entity.File;
|
import cn.lili.modules.file.entity.File;
|
||||||
@ -12,7 +13,6 @@ import cn.lili.modules.file.mapper.FileMapper;
|
|||||||
import cn.lili.modules.file.plugin.FilePlugin;
|
import cn.lili.modules.file.plugin.FilePlugin;
|
||||||
import cn.lili.modules.file.plugin.FilePluginFactory;
|
import cn.lili.modules.file.plugin.FilePluginFactory;
|
||||||
import cn.lili.modules.file.service.FileService;
|
import cn.lili.modules.file.service.FileService;
|
||||||
import cn.lili.mybatis.util.PageUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
@ -111,7 +111,7 @@ public class DraftGoods extends BaseEntity {
|
|||||||
private String goodsVideo;
|
private String goodsVideo;
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否为推荐商品")
|
@ApiModelProperty(value = "是否为推荐商品")
|
||||||
private boolean recommend;
|
private Boolean recommend;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see cn.lili.modules.goods.entity.enums.GoodsSalesModeEnum
|
* @see cn.lili.modules.goods.entity.enums.GoodsSalesModeEnum
|
||||||
|
@ -6,6 +6,7 @@ import cn.hutool.http.HtmlUtil;
|
|||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
import cn.lili.common.exception.ServiceException;
|
import cn.lili.common.exception.ServiceException;
|
||||||
|
import cn.lili.modules.goods.entity.dto.DraftGoodsDTO;
|
||||||
import cn.lili.modules.goods.entity.dto.GoodsOperationDTO;
|
import cn.lili.modules.goods.entity.dto.GoodsOperationDTO;
|
||||||
import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;
|
import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;
|
||||||
import cn.lili.modules.goods.entity.enums.GoodsSalesModeEnum;
|
import cn.lili.modules.goods.entity.enums.GoodsSalesModeEnum;
|
||||||
@ -13,7 +14,6 @@ import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
|
|||||||
import cn.lili.modules.goods.entity.enums.GoodsTypeEnum;
|
import cn.lili.modules.goods.entity.enums.GoodsTypeEnum;
|
||||||
import cn.lili.mybatis.BaseEntity;
|
import cn.lili.mybatis.BaseEntity;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import com.xkcoding.http.util.StringUtil;
|
import com.xkcoding.http.util.StringUtil;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
@ -148,7 +148,6 @@ public class Goods extends BaseEntity {
|
|||||||
private String goodsType;
|
private String goodsType;
|
||||||
|
|
||||||
@ApiModelProperty(value = "商品参数json", hidden = true)
|
@ApiModelProperty(value = "商品参数json", hidden = true)
|
||||||
@JsonIgnore
|
|
||||||
private String params;
|
private String params;
|
||||||
|
|
||||||
|
|
||||||
@ -196,10 +195,40 @@ public class Goods extends BaseEntity {
|
|||||||
if (!sku.containsKey("quantity") || StringUtil.isEmpty(sku.get("quantity").toString()) || Convert.toInt(sku.get("quantity").toString()) < 0) {
|
if (!sku.containsKey("quantity") || StringUtil.isEmpty(sku.get("quantity").toString()) || Convert.toInt(sku.get("quantity").toString()) < 0) {
|
||||||
throw new ServiceException(ResultCode.GOODS_SKU_QUANTITY_ERROR);
|
throw new ServiceException(ResultCode.GOODS_SKU_QUANTITY_ERROR);
|
||||||
}
|
}
|
||||||
|
sku.values().forEach(i -> {
|
||||||
|
if (CharSequenceUtil.isBlank(i.toString())) {
|
||||||
|
throw new ServiceException(ResultCode.MUST_HAVE_GOODS_SKU_VALUE);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Goods(DraftGoodsDTO goodsDTO) {
|
||||||
|
this.goodsName = goodsDTO.getGoodsName();
|
||||||
|
this.categoryPath = goodsDTO.getCategoryPath();
|
||||||
|
this.storeCategoryPath = goodsDTO.getStoreCategoryPath();
|
||||||
|
this.brandId = goodsDTO.getBrandId();
|
||||||
|
this.templateId = goodsDTO.getTemplateId();
|
||||||
|
this.recommend = goodsDTO.getRecommend();
|
||||||
|
this.sellingPoint = goodsDTO.getSellingPoint();
|
||||||
|
this.salesModel = goodsDTO.getSalesModel();
|
||||||
|
this.goodsUnit = goodsDTO.getGoodsUnit();
|
||||||
|
this.intro = goodsDTO.getIntro();
|
||||||
|
this.mobileIntro = goodsDTO.getMobileIntro();
|
||||||
|
this.goodsVideo = goodsDTO.getGoodsVideo();
|
||||||
|
this.price = goodsDTO.getPrice();
|
||||||
|
if (goodsDTO.getGoodsParamsDTOList() != null && goodsDTO.getGoodsParamsDTOList().isEmpty()) {
|
||||||
|
this.params = JSONUtil.toJsonStr(goodsDTO.getGoodsParamsDTOList());
|
||||||
|
}
|
||||||
|
//如果立即上架则
|
||||||
|
this.marketEnable = GoodsStatusEnum.DOWN.name();
|
||||||
|
this.goodsType = goodsDTO.getGoodsType();
|
||||||
|
this.grade = 100D;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public String getIntro() {
|
public String getIntro() {
|
||||||
if (CharSequenceUtil.isNotEmpty(intro)) {
|
if (CharSequenceUtil.isNotEmpty(intro)) {
|
||||||
return HtmlUtil.unescape(intro);
|
return HtmlUtil.unescape(intro);
|
||||||
|
@ -23,6 +23,8 @@ public class Wholesale extends BaseIdEntity {
|
|||||||
private String goodsId;
|
private String goodsId;
|
||||||
@ApiModelProperty(value = "SkuID")
|
@ApiModelProperty(value = "SkuID")
|
||||||
private String skuId;
|
private String skuId;
|
||||||
|
@ApiModelProperty(value = "模版id")
|
||||||
|
private String templateId;
|
||||||
@ApiModelProperty(value = "数量")
|
@ApiModelProperty(value = "数量")
|
||||||
private Integer num;
|
private Integer num;
|
||||||
@ApiModelProperty(value = "金额")
|
@ApiModelProperty(value = "金额")
|
||||||
|
@ -30,4 +30,10 @@ public class DraftGoodsDTO extends DraftGoods {
|
|||||||
@Valid
|
@Valid
|
||||||
private List<Map<String, Object>> skuList;
|
private List<Map<String, Object>> skuList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批发商品规则
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "批发商品规则")
|
||||||
|
private List<WholesaleDTO> wholesaleList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package cn.lili.modules.goods.entity.dto;
|
package cn.lili.modules.goods.entity.dto;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
import cn.lili.modules.goods.entity.enums.DraftGoodsSaveType;
|
import cn.lili.modules.goods.entity.enums.DraftGoodsSaveType;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
@ -26,7 +26,7 @@ public class DraftGoodsSearchParams extends GoodsSearchParams {
|
|||||||
@Override
|
@Override
|
||||||
public <T> QueryWrapper<T> queryWrapper() {
|
public <T> QueryWrapper<T> queryWrapper() {
|
||||||
QueryWrapper<T> queryWrapper = super.queryWrapper();
|
QueryWrapper<T> queryWrapper = super.queryWrapper();
|
||||||
if (StrUtil.isNotEmpty(saveType)) {
|
if (CharSequenceUtil.isNotEmpty(saveType)) {
|
||||||
queryWrapper.eq("save_type", saveType);
|
queryWrapper.eq("save_type", saveType);
|
||||||
}
|
}
|
||||||
return queryWrapper;
|
return queryWrapper;
|
||||||
|
@ -0,0 +1,67 @@
|
|||||||
|
package cn.lili.modules.goods.entity.dto;
|
||||||
|
|
||||||
|
import cn.lili.modules.goods.entity.dos.Category;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品导入DTO
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class GoodsImportDTO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商品名称")
|
||||||
|
private String goodsName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商品卖点")
|
||||||
|
private String sellingPoint;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商品分类")
|
||||||
|
private Category category;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "运费模板")
|
||||||
|
private String template;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "计量单位")
|
||||||
|
private String goodsUnit;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "发布状态")
|
||||||
|
private Boolean release;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商品图片")
|
||||||
|
private List<Map<String, String>> images;
|
||||||
|
private List<String> goodsGalleryList;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "成本价")
|
||||||
|
private Double cost;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "销售价")
|
||||||
|
private Double price;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "库存")
|
||||||
|
private Integer quantity;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "重量")
|
||||||
|
private Double weight;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "货号")
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "详情")
|
||||||
|
private String intro;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "规格项")
|
||||||
|
private String skuKey;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "规格值")
|
||||||
|
private String skuValue;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1,14 +1,18 @@
|
|||||||
package cn.lili.modules.goods.entity.dto;
|
package cn.lili.modules.goods.entity.dto;
|
||||||
|
|
||||||
import cn.lili.common.validation.EnumValue;
|
import cn.lili.common.validation.EnumValue;
|
||||||
|
import cn.lili.modules.goods.entity.enums.GoodsSalesModeEnum;
|
||||||
|
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
|
||||||
|
import cn.lili.modules.goods.entity.enums.GoodsTypeEnum;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.*;
|
||||||
import lombok.ToString;
|
|
||||||
import org.hibernate.validator.constraints.Length;
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -20,6 +24,9 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@ToString
|
@ToString
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
public class GoodsOperationDTO implements Serializable {
|
public class GoodsOperationDTO implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -509667581371776913L;
|
private static final long serialVersionUID = -509667581371776913L;
|
||||||
@ -116,15 +123,57 @@ public class GoodsOperationDTO implements Serializable {
|
|||||||
@Valid
|
@Valid
|
||||||
private List<Map<String, Object>> skuList;
|
private List<Map<String, Object>> skuList;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否为商品模版")
|
||||||
|
private Boolean goodsTemplateFlag = false;
|
||||||
/**
|
/**
|
||||||
* 批发商品规则
|
* 批发商品规则
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "批发商品规则")
|
@ApiModelProperty(value = "批发商品规则")
|
||||||
private List<WholesaleDTO> wholesaleList;
|
private List<WholesaleDTO> wholesaleList;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "注意事项")
|
||||||
|
private String needingAttention;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否为年度会员专属")
|
||||||
|
private Boolean annualFeeExclusive;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "浏览权限")
|
||||||
|
private String browsePermissions;
|
||||||
|
|
||||||
public String getGoodsName() {
|
public String getGoodsName() {
|
||||||
//对商品对名称做一个极限处理。这里没有用xss过滤是因为xss过滤为全局过滤,影响很大。
|
//对商品对名称做一个极限处理。这里没有用xss过滤是因为xss过滤为全局过滤,影响很大。
|
||||||
// 业务中,全局代码中只有商品名称不能拥有英文逗号,是由于商品名称存在一个数据库联合查询,结果要根据逗号分组
|
// 业务中,全局代码中只有商品名称不能拥有英文逗号,是由于商品名称存在一个数据库联合查询,结果要根据逗号分组
|
||||||
return goodsName.replace(",", "");
|
return goodsName.replace(",", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GoodsOperationDTO(GoodsImportDTO goodsImportDTO) {
|
||||||
|
this.price = goodsImportDTO.getPrice();
|
||||||
|
this.goodsName = goodsImportDTO.getGoodsName();
|
||||||
|
this.intro = goodsImportDTO.getIntro();
|
||||||
|
this.mobileIntro = goodsImportDTO.getIntro();
|
||||||
|
this.quantity = goodsImportDTO.getQuantity();
|
||||||
|
this.goodsGalleryList = goodsImportDTO.getGoodsGalleryList();
|
||||||
|
this.templateId = goodsImportDTO.getTemplate();
|
||||||
|
this.sellingPoint = goodsImportDTO.getSellingPoint();
|
||||||
|
this.salesModel = GoodsSalesModeEnum.RETAIL.name();
|
||||||
|
this.goodsUnit = goodsImportDTO.getGoodsUnit();
|
||||||
|
this.goodsType = GoodsTypeEnum.PHYSICAL_GOODS.name();
|
||||||
|
this.release = goodsImportDTO.getRelease();
|
||||||
|
this.recommend=false;
|
||||||
|
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("sn", goodsImportDTO.getSn());
|
||||||
|
map.put("price", goodsImportDTO.getPrice());
|
||||||
|
map.put("cost", goodsImportDTO.getCost());
|
||||||
|
map.put("weight", goodsImportDTO.getWeight());
|
||||||
|
map.put("quantity", goodsImportDTO.getQuantity());
|
||||||
|
map.put(goodsImportDTO.getSkuKey(), goodsImportDTO.getSkuValue());
|
||||||
|
map.put("images", goodsImportDTO.getImages());
|
||||||
|
|
||||||
|
List<Map<String, Object>> skuList = new ArrayList<>();
|
||||||
|
skuList.add(map);
|
||||||
|
this.skuList = skuList;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,7 @@ import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;
|
|||||||
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
|
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.*;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
@ -19,6 +18,9 @@ import java.util.Arrays;
|
|||||||
*/
|
*/
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class GoodsSearchParams extends PageVO {
|
public class GoodsSearchParams extends PageVO {
|
||||||
|
|
||||||
private static final long serialVersionUID = 2544015852728566887L;
|
private static final long serialVersionUID = 2544015852728566887L;
|
||||||
|
@ -3,6 +3,8 @@ package cn.lili.modules.goods.entity.dto;
|
|||||||
import cn.lili.modules.goods.entity.dos.Wholesale;
|
import cn.lili.modules.goods.entity.dos.Wholesale;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author paulG
|
* @author paulG
|
||||||
@ -10,7 +12,12 @@ import lombok.EqualsAndHashCode;
|
|||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@NoArgsConstructor
|
||||||
public class WholesaleDTO extends Wholesale {
|
public class WholesaleDTO extends Wholesale {
|
||||||
|
|
||||||
private static final long serialVersionUID = 853297561151783335L;
|
private static final long serialVersionUID = 853297561151783335L;
|
||||||
|
|
||||||
|
public WholesaleDTO(Wholesale wholesale) {
|
||||||
|
BeanUtils.copyProperties(wholesale, this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package cn.lili.modules.goods.entity.vos;
|
package cn.lili.modules.goods.entity.vos;
|
||||||
|
|
||||||
import cn.lili.modules.goods.entity.dos.DraftGoods;
|
import cn.lili.modules.goods.entity.dos.DraftGoods;
|
||||||
|
import cn.lili.modules.goods.entity.dos.Wholesale;
|
||||||
import cn.lili.modules.goods.entity.dto.GoodsParamsDTO;
|
import cn.lili.modules.goods.entity.dto.GoodsParamsDTO;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -29,4 +30,10 @@ public class DraftGoodsVO extends DraftGoods {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "sku列表")
|
@ApiModelProperty(value = "sku列表")
|
||||||
private List<GoodsSkuVO> skuList;
|
private List<GoodsSkuVO> skuList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批发商品规则
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "批发商品规则")
|
||||||
|
private List<Wholesale> wholesaleList;
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品品牌业务层
|
* 商品品牌业务层
|
||||||
@ -40,6 +41,14 @@ public interface BrandService extends IService<Brand> {
|
|||||||
*/
|
*/
|
||||||
List<Brand> getBrandsByCategory(String categoryId);
|
List<Brand> getBrandsByCategory(String categoryId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分类ID获取品牌列表
|
||||||
|
*
|
||||||
|
* @param categoryIds 分类ID
|
||||||
|
* @return 品牌列表
|
||||||
|
*/
|
||||||
|
List<Map<String, Object>> getBrandsMapsByCategory(List<String> categoryIds, String columns);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加品牌
|
* 添加品牌
|
||||||
*
|
*
|
||||||
|
@ -6,6 +6,7 @@ import cn.lili.modules.goods.entity.vos.CategoryVO;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品分类业务层
|
* 商品分类业务层
|
||||||
@ -41,6 +42,14 @@ public interface CategoryService extends IService<Category> {
|
|||||||
*/
|
*/
|
||||||
List<Category> listByIdsOrderByLevel(List<String> ids);
|
List<Category> listByIdsOrderByLevel(List<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分类id集合获取所有分类根据层级排序
|
||||||
|
*
|
||||||
|
* @param ids 分类ID集合
|
||||||
|
* @return 商品分类列表
|
||||||
|
*/
|
||||||
|
List<Map<String, Object>> listMapsByIdsOrderByLevel(List<String> ids, String columns);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取分类树
|
* 获取分类树
|
||||||
*
|
*
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
package cn.lili.modules.goods.service;
|
||||||
|
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
public interface GoodsImportService {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载导入列表
|
||||||
|
* @param response
|
||||||
|
*/
|
||||||
|
void download(HttpServletResponse response);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入商品
|
||||||
|
*/
|
||||||
|
void importExcel(MultipartFile files) throws Exception;
|
||||||
|
}
|
@ -184,4 +184,4 @@ public interface GoodsService extends IService<Goods> {
|
|||||||
*/
|
*/
|
||||||
long countStoreGoodsNum(String storeId);
|
long countStoreGoodsNum(String storeId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -82,6 +82,14 @@ public interface GoodsSkuService extends IService<GoodsSku> {
|
|||||||
*/
|
*/
|
||||||
GoodsSku getGoodsSkuByIdFromCache(String id);
|
GoodsSku getGoodsSkuByIdFromCache(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从缓存中获取可参与促销商品
|
||||||
|
*
|
||||||
|
* @param skuId skuid
|
||||||
|
* @return 商品详情
|
||||||
|
*/
|
||||||
|
GoodsSku getCanPromotionGoodsSkuByIdFromCache(String skuId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取商品sku详情
|
* 获取商品sku详情
|
||||||
*
|
*
|
||||||
@ -143,7 +151,7 @@ public interface GoodsSkuService extends IService<GoodsSku> {
|
|||||||
/**
|
/**
|
||||||
* 分页查询商品sku信息
|
* 分页查询商品sku信息
|
||||||
*
|
*
|
||||||
* @param page 分页参数
|
* @param page 分页参数
|
||||||
* @param queryWrapper 查询参数
|
* @param queryWrapper 查询参数
|
||||||
* @return 商品sku信息
|
* @return 商品sku信息
|
||||||
*/
|
*/
|
||||||
@ -173,13 +181,6 @@ public interface GoodsSkuService extends IService<GoodsSku> {
|
|||||||
*/
|
*/
|
||||||
void updateGoodsSkuStatusByStoreId(String storeId, String marketEnable, String authFlag);
|
void updateGoodsSkuStatusByStoreId(String storeId, String marketEnable, String authFlag);
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送生成ES商品索引
|
|
||||||
*
|
|
||||||
* @param goods 商品信息
|
|
||||||
*/
|
|
||||||
void generateEs(Goods goods);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新SKU库存
|
* 更新SKU库存
|
||||||
*
|
*
|
||||||
@ -240,4 +241,12 @@ public interface GoodsSkuService extends IService<GoodsSku> {
|
|||||||
* @return sku总数
|
* @return sku总数
|
||||||
*/
|
*/
|
||||||
Long countSkuNum(String storeId);
|
Long countSkuNum(String storeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量渲染商品sku
|
||||||
|
*
|
||||||
|
* @param goodsSkuList SKU基础数据列表
|
||||||
|
* @param goodsOperationDTO 商品操作信息
|
||||||
|
*/
|
||||||
|
void renderGoodsSkuList(List<GoodsSku> goodsSkuList, GoodsOperationDTO goodsOperationDTO);
|
||||||
}
|
}
|
@ -5,6 +5,7 @@ import cn.lili.modules.goods.entity.vos.StoreGoodsLabelVO;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺商品分类业务层
|
* 店铺商品分类业务层
|
||||||
@ -30,6 +31,14 @@ public interface StoreGoodsLabelService extends IService<StoreGoodsLabel> {
|
|||||||
*/
|
*/
|
||||||
List<StoreGoodsLabel> listByStoreIds(List<String> ids);
|
List<StoreGoodsLabel> listByStoreIds(List<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分类id集合获取所有店铺分类根据层级排序
|
||||||
|
*
|
||||||
|
* @param ids 商家ID
|
||||||
|
* @return 店铺分类列表
|
||||||
|
*/
|
||||||
|
List<Map<String, Object>> listMapsByStoreIds(List<String> ids, String columns);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加商品分类
|
* 添加商品分类
|
||||||
*
|
*
|
||||||
|
@ -53,7 +53,7 @@ public interface StudioService extends IService<Studio> {
|
|||||||
* @param storeId 店铺ID
|
* @param storeId 店铺ID
|
||||||
* @return 操作结果
|
* @return 操作结果
|
||||||
*/
|
*/
|
||||||
Boolean push(Integer roomId,Integer goodsId, String storeId);
|
Boolean push(Integer roomId,Integer liveGoodsId, String storeId, String goodsId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除商品
|
* 删除商品
|
||||||
|
@ -14,8 +14,13 @@ public interface WholesaleService extends IService<Wholesale> {
|
|||||||
|
|
||||||
List<Wholesale> findByGoodsId(String goodsId);
|
List<Wholesale> findByGoodsId(String goodsId);
|
||||||
|
|
||||||
|
List<Wholesale> findByTemplateId(String templateId);
|
||||||
|
|
||||||
Boolean removeByGoodsId(String goodsId);
|
Boolean removeByGoodsId(String goodsId);
|
||||||
|
|
||||||
|
|
||||||
|
Boolean removeByTemplateId(String templateId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 匹配批发规则
|
* 匹配批发规则
|
||||||
*
|
*
|
||||||
|
@ -23,6 +23,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@ -68,6 +69,14 @@ public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand> implements
|
|||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> getBrandsMapsByCategory(List<String> categoryIds, String columns) {
|
||||||
|
QueryWrapper<Brand> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.select(columns);
|
||||||
|
queryWrapper.in("id", categoryIds);
|
||||||
|
return this.listMaps(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean addBrand(BrandVO brandVO) {
|
public boolean addBrand(BrandVO brandVO) {
|
||||||
|
|
||||||
|
@ -25,10 +25,7 @@ import org.springframework.cache.annotation.Cacheable;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@ -80,6 +77,14 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
|
|||||||
return this.list(new LambdaQueryWrapper<Category>().in(Category::getId, ids).orderByAsc(Category::getLevel));
|
return this.list(new LambdaQueryWrapper<Category>().in(Category::getId, ids).orderByAsc(Category::getLevel));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> listMapsByIdsOrderByLevel(List<String> ids, String columns) {
|
||||||
|
QueryWrapper<Category> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.select(columns);
|
||||||
|
queryWrapper.in("id", ids).orderByAsc("level");
|
||||||
|
return this.listMaps(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CategoryVO> categoryTree() {
|
public List<CategoryVO> categoryTree() {
|
||||||
List<CategoryVO> categoryVOList = (List<CategoryVO>) cache.get(CachePrefix.CATEGORY.getPrefix());
|
List<CategoryVO> categoryVOList = (List<CategoryVO>) cache.get(CachePrefix.CATEGORY.getPrefix());
|
||||||
|
@ -1,29 +1,25 @@
|
|||||||
package cn.lili.modules.goods.serviceimpl;
|
package cn.lili.modules.goods.serviceimpl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.json.JSONArray;
|
import cn.hutool.json.JSONArray;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import cn.lili.modules.goods.entity.dos.Category;
|
import cn.lili.modules.goods.entity.dos.*;
|
||||||
import cn.lili.modules.goods.entity.dos.DraftGoods;
|
import cn.lili.modules.goods.entity.dto.*;
|
||||||
import cn.lili.modules.goods.entity.dos.GoodsGallery;
|
|
||||||
import cn.lili.modules.goods.entity.dos.GoodsSku;
|
|
||||||
import cn.lili.modules.goods.entity.dto.DraftGoodsDTO;
|
|
||||||
import cn.lili.modules.goods.entity.dto.DraftGoodsSearchParams;
|
|
||||||
import cn.lili.modules.goods.entity.dto.GoodsParamsDTO;
|
|
||||||
import cn.lili.modules.goods.entity.vos.DraftGoodsVO;
|
import cn.lili.modules.goods.entity.vos.DraftGoodsVO;
|
||||||
import cn.lili.modules.goods.mapper.DraftGoodsMapper;
|
import cn.lili.modules.goods.mapper.DraftGoodsMapper;
|
||||||
import cn.lili.modules.goods.service.CategoryService;
|
import cn.lili.modules.goods.service.*;
|
||||||
import cn.lili.modules.goods.service.DraftGoodsService;
|
import cn.lili.modules.goods.sku.GoodsSkuBuilder;
|
||||||
import cn.lili.modules.goods.service.GoodsGalleryService;
|
|
||||||
import cn.lili.modules.goods.service.GoodsSkuService;
|
|
||||||
import cn.lili.mybatis.util.PageUtil;
|
import cn.lili.mybatis.util.PageUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 草稿商品业务层实现
|
* 草稿商品业务层实现
|
||||||
@ -49,6 +45,9 @@ public class DraftGoodsServiceImpl extends ServiceImpl<DraftGoodsMapper, DraftGo
|
|||||||
@Autowired
|
@Autowired
|
||||||
private GoodsSkuService goodsSkuService;
|
private GoodsSkuService goodsSkuService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private WholesaleService wholesaleService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean addGoodsDraft(DraftGoodsDTO draftGoods) {
|
public boolean addGoodsDraft(DraftGoodsDTO draftGoods) {
|
||||||
draftGoods.setGoodsGalleryListJson(JSONUtil.toJsonStr(draftGoods.getGoodsGalleryList()));
|
draftGoods.setGoodsGalleryListJson(JSONUtil.toJsonStr(draftGoods.getGoodsGalleryList()));
|
||||||
@ -74,15 +73,33 @@ public class DraftGoodsServiceImpl extends ServiceImpl<DraftGoodsMapper, DraftGo
|
|||||||
draftGoods.setSmall(goodsGallery.getSmall());
|
draftGoods.setSmall(goodsGallery.getSmall());
|
||||||
draftGoods.setThumbnail(goodsGallery.getThumbnail());
|
draftGoods.setThumbnail(goodsGallery.getThumbnail());
|
||||||
}
|
}
|
||||||
|
// 商品图片
|
||||||
draftGoods.setGoodsGalleryListJson(JSONUtil.toJsonStr(draftGoods.getGoodsGalleryList()));
|
draftGoods.setGoodsGalleryListJson(JSONUtil.toJsonStr(draftGoods.getGoodsGalleryList()));
|
||||||
draftGoods.setSkuListJson(JSONUtil.toJsonStr(this.getGoodsSkuList(draftGoods.getSkuList())));
|
// 商品参数
|
||||||
draftGoods.setGoodsParamsListJson(JSONUtil.toJsonStr(draftGoods.getGoodsParamsDTOList()));
|
draftGoods.setGoodsParamsListJson(JSONUtil.toJsonStr(draftGoods.getGoodsParamsDTOList()));
|
||||||
this.saveOrUpdate(draftGoods);
|
boolean result = this.saveOrUpdate(draftGoods);
|
||||||
|
if (result && draftGoods.getSkuList() != null && !draftGoods.getSkuList().isEmpty()) {
|
||||||
|
List<GoodsSku> goodsSkus = GoodsSkuBuilder.buildBatch(new Goods(draftGoods), draftGoods.getSkuList());
|
||||||
|
GoodsOperationDTO.GoodsOperationDTOBuilder goodsOperationDTOBuilder = GoodsOperationDTO.builder().goodsTemplateFlag(true).salesModel(draftGoods.getSalesModel());
|
||||||
|
if (draftGoods.getWholesaleList() != null && !draftGoods.getWholesaleList().isEmpty()) {
|
||||||
|
|
||||||
|
for (WholesaleDTO wholesaleDTO : draftGoods.getWholesaleList()) {
|
||||||
|
wholesaleDTO.setTemplateId(draftGoods.getId());
|
||||||
|
}
|
||||||
|
goodsOperationDTOBuilder.wholesaleList(draftGoods.getWholesaleList());
|
||||||
|
}
|
||||||
|
goodsSkuService.renderGoodsSkuList(goodsSkus, goodsOperationDTOBuilder.build());
|
||||||
|
LambdaUpdateWrapper<DraftGoods> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.eq(DraftGoods::getId, draftGoods.getId());
|
||||||
|
updateWrapper.set(DraftGoods::getSkuListJson, JSONUtil.toJsonStr(goodsSkus));
|
||||||
|
this.update(updateWrapper);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteGoodsDraft(String id) {
|
public void deleteGoodsDraft(String id) {
|
||||||
this.removeById(id);
|
this.removeById(id);
|
||||||
|
this.wholesaleService.removeByTemplateId(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -104,6 +121,10 @@ public class DraftGoodsServiceImpl extends ServiceImpl<DraftGoodsMapper, DraftGo
|
|||||||
JSONArray jsonArray = JSONUtil.parseArray(draftGoods.getSkuListJson());
|
JSONArray jsonArray = JSONUtil.parseArray(draftGoods.getSkuListJson());
|
||||||
List<GoodsSku> list = JSONUtil.toList(jsonArray, GoodsSku.class);
|
List<GoodsSku> list = JSONUtil.toList(jsonArray, GoodsSku.class);
|
||||||
draftGoodsVO.setSkuList(goodsSkuService.getGoodsSkuVOList(list));
|
draftGoodsVO.setSkuList(goodsSkuService.getGoodsSkuVOList(list));
|
||||||
|
List<Wholesale> wholesaleList = wholesaleService.findByTemplateId(draftGoods.getId());
|
||||||
|
if (CollUtil.isNotEmpty(wholesaleList)) {
|
||||||
|
draftGoodsVO.setWholesaleList(wholesaleList);
|
||||||
|
}
|
||||||
return draftGoodsVO;
|
return draftGoodsVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,48 +133,4 @@ public class DraftGoodsServiceImpl extends ServiceImpl<DraftGoodsMapper, DraftGo
|
|||||||
return this.page(PageUtil.initPage(searchParams), searchParams.queryWrapper());
|
return this.page(PageUtil.initPage(searchParams), searchParams.queryWrapper());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取sku集合
|
|
||||||
*
|
|
||||||
* @param skuList sku列表
|
|
||||||
* @return sku集合
|
|
||||||
*/
|
|
||||||
private List<GoodsSku> getGoodsSkuList(List<Map<String, Object>> skuList) {
|
|
||||||
List<GoodsSku> skus = new ArrayList<>();
|
|
||||||
for (Map<String, Object> skuVO : skuList) {
|
|
||||||
GoodsSku add = this.add(skuVO);
|
|
||||||
skus.add(add);
|
|
||||||
}
|
|
||||||
return skus;
|
|
||||||
}
|
|
||||||
|
|
||||||
private GoodsSku add(Map<String, Object> map) {
|
|
||||||
Map<String, Object> specMap = new HashMap<>(2);
|
|
||||||
GoodsSku sku = new GoodsSku();
|
|
||||||
for (Map.Entry<String, Object> m : map.entrySet()) {
|
|
||||||
switch (m.getKey()) {
|
|
||||||
case "sn":
|
|
||||||
sku.setSn(m.getValue() != null ? m.getValue().toString() : "");
|
|
||||||
break;
|
|
||||||
case "cost":
|
|
||||||
sku.setCost(Convert.toDouble(m.getValue()));
|
|
||||||
break;
|
|
||||||
case "price":
|
|
||||||
sku.setPrice(Convert.toDouble(m.getValue()));
|
|
||||||
break;
|
|
||||||
case "quantity":
|
|
||||||
sku.setQuantity(Convert.toInt(m.getValue()));
|
|
||||||
break;
|
|
||||||
case "weight":
|
|
||||||
sku.setWeight(Convert.toDouble(m.getValue()));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
specMap.put(m.getKey(), m.getValue());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sku.setSpecs(JSONUtil.toJsonStr(specMap));
|
|
||||||
return sku;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,281 @@
|
|||||||
|
package cn.lili.modules.goods.serviceimpl;
|
||||||
|
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import cn.hutool.poi.excel.ExcelReader;
|
||||||
|
import cn.hutool.poi.excel.ExcelUtil;
|
||||||
|
import cn.lili.common.exception.ServiceException;
|
||||||
|
import cn.lili.modules.goods.entity.dos.Category;
|
||||||
|
import cn.lili.modules.goods.entity.dos.GoodsUnit;
|
||||||
|
import cn.lili.modules.goods.entity.dto.GoodsImportDTO;
|
||||||
|
import cn.lili.modules.goods.entity.dto.GoodsOperationDTO;
|
||||||
|
import cn.lili.modules.goods.entity.vos.CategoryVO;
|
||||||
|
import cn.lili.modules.goods.service.CategoryService;
|
||||||
|
import cn.lili.modules.goods.service.GoodsImportService;
|
||||||
|
import cn.lili.modules.goods.service.GoodsService;
|
||||||
|
import cn.lili.modules.goods.service.GoodsUnitService;
|
||||||
|
import cn.lili.modules.store.entity.vos.FreightTemplateVO;
|
||||||
|
import cn.lili.modules.store.service.FreightTemplateService;
|
||||||
|
import cn.lili.modules.store.service.StoreDetailService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.poi.hssf.usermodel.DVConstraint;
|
||||||
|
import org.apache.poi.hssf.usermodel.HSSFDataValidation;
|
||||||
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||||
|
import org.apache.poi.ss.usermodel.*;
|
||||||
|
import org.apache.poi.ss.util.CellRangeAddressList;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.ServletOutputStream;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class GoodsImportServiceImpl implements GoodsImportService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FreightTemplateService freightTemplateService;
|
||||||
|
@Autowired
|
||||||
|
private StoreDetailService storeDetailService;
|
||||||
|
@Autowired
|
||||||
|
private CategoryService categoryService;
|
||||||
|
@Autowired
|
||||||
|
private GoodsUnitService goodsUnitService;
|
||||||
|
@Autowired
|
||||||
|
private GoodsService goodsService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void download(HttpServletResponse response) {
|
||||||
|
String storeId = "1376369067769724928";
|
||||||
|
// //Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId();
|
||||||
|
//创建Excel工作薄对象
|
||||||
|
Workbook workbook = new HSSFWorkbook();
|
||||||
|
//生成一个表格 设置:页签
|
||||||
|
Sheet sheet = workbook.createSheet("导入模板");
|
||||||
|
//创建第1行
|
||||||
|
Row row0 = sheet.createRow(0);
|
||||||
|
row0.createCell(0).setCellValue("商品名称");
|
||||||
|
row0.createCell(1).setCellValue("商品卖点");
|
||||||
|
row0.createCell(2).setCellValue("商品分类");
|
||||||
|
row0.createCell(3).setCellValue("运费模板");
|
||||||
|
row0.createCell(4).setCellValue("计量单位");
|
||||||
|
row0.createCell(5).setCellValue("发布状态");
|
||||||
|
row0.createCell(6).setCellValue("商品图片");
|
||||||
|
row0.createCell(7).setCellValue("成本价");
|
||||||
|
row0.createCell(8).setCellValue("销售价");
|
||||||
|
row0.createCell(9).setCellValue("库存");
|
||||||
|
row0.createCell(10).setCellValue("重量");
|
||||||
|
row0.createCell(11).setCellValue("货号");
|
||||||
|
row0.createCell(12).setCellValue("详情");
|
||||||
|
row0.createCell(13).setCellValue("规格项");
|
||||||
|
row0.createCell(14).setCellValue("规格值");
|
||||||
|
|
||||||
|
|
||||||
|
sheet.setColumnWidth(0, 7000);
|
||||||
|
sheet.setColumnWidth(1, 7000);
|
||||||
|
sheet.setColumnWidth(2, 7000);
|
||||||
|
sheet.setColumnWidth(3, 7000);
|
||||||
|
sheet.setColumnWidth(4, 7000);
|
||||||
|
sheet.setColumnWidth(5, 3000);
|
||||||
|
sheet.setColumnWidth(6, 7000);
|
||||||
|
sheet.setColumnWidth(7, 3000);
|
||||||
|
sheet.setColumnWidth(8, 3000);
|
||||||
|
sheet.setColumnWidth(9, 3000);
|
||||||
|
sheet.setColumnWidth(10, 3000);
|
||||||
|
sheet.setColumnWidth(11, 7000);
|
||||||
|
sheet.setColumnWidth(12, 7000);
|
||||||
|
sheet.setColumnWidth(13, 3000);
|
||||||
|
sheet.setColumnWidth(14, 3000);
|
||||||
|
|
||||||
|
String goodsManagementCategory = storeDetailService.getStoreDetail(storeId).getGoodsManagementCategory();
|
||||||
|
List<CategoryVO> categoryVOList = this.categoryService.getStoreCategory(goodsManagementCategory.split(","));
|
||||||
|
List<String> categoryNameList = new ArrayList<>();
|
||||||
|
|
||||||
|
//先简单写,后期优化
|
||||||
|
//循环三次添加值
|
||||||
|
//循环列表,存放ID-分类名称
|
||||||
|
for (CategoryVO categoryVO1 : categoryVOList) {
|
||||||
|
for (CategoryVO categoryVO2 : categoryVO1.getChildren()) {
|
||||||
|
for (CategoryVO categoryVO3 : categoryVO2.getChildren()) {
|
||||||
|
categoryNameList.add(categoryVO3.getId() + "-" + categoryVO3.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<String> freightTemplateNameList = new ArrayList<>();
|
||||||
|
//循环列表,存放ID-运费模板名称
|
||||||
|
for (FreightTemplateVO freightTemplateVO : freightTemplateService.getFreightTemplateList(storeId)) {
|
||||||
|
freightTemplateNameList.add(freightTemplateVO.getId() + "-" + freightTemplateVO.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取计量单位
|
||||||
|
List<String> goodsUnitList = new ArrayList<>();
|
||||||
|
List<GoodsUnit> goodsUnitListVO = goodsUnitService.list();
|
||||||
|
for (GoodsUnit goodsUnit : goodsUnitListVO) {
|
||||||
|
goodsUnitList.add(goodsUnit.getId() + "-" + goodsUnit.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
//添加分类
|
||||||
|
this.excelTo255(workbook, "hiddenCategoryVO", 1, categoryNameList.toArray(new String[]{}), 1, 5000, 2, 2);
|
||||||
|
|
||||||
|
//添加运费模板
|
||||||
|
this.excelTo255(workbook, "hiddenFreightTemplateVO", 2, freightTemplateNameList.toArray(new String[]{}), 1, 5000, 3, 3);
|
||||||
|
|
||||||
|
//添加计量单位
|
||||||
|
this.excelTo255(workbook, "hiddenGoodsUnit", 3, goodsUnitList.toArray(new String[]{}), 1, 5000, 4, 4);
|
||||||
|
|
||||||
|
//添加计量单位
|
||||||
|
this.excelTo255(workbook, "hiddenRelease", 4, new String[]{"上架", "仓库中"}, 1, 5000, 5, 5);
|
||||||
|
|
||||||
|
|
||||||
|
ServletOutputStream out = null;
|
||||||
|
try {
|
||||||
|
//设置公共属性,列表名称
|
||||||
|
response.setContentType("application/vnd.ms-excel;charset=utf-8");
|
||||||
|
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("下载商品导入模板", "UTF8") + ".xls");
|
||||||
|
out = response.getOutputStream();
|
||||||
|
workbook.write(out);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("下载商品导入模板错误", e);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
out.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void importExcel(MultipartFile files) throws Exception {
|
||||||
|
InputStream inputStream;
|
||||||
|
List<GoodsImportDTO> goodsImportDTOList = new ArrayList<>();
|
||||||
|
|
||||||
|
inputStream = files.getInputStream();
|
||||||
|
ExcelReader excelReader = ExcelUtil.getReader(inputStream);
|
||||||
|
// 读取列表
|
||||||
|
// 检测数据-查看分类、模板、计量单位是否存在
|
||||||
|
List<List<Object>> read = excelReader.read(1, excelReader.getRowCount());
|
||||||
|
for (List<Object> objects : read) {
|
||||||
|
GoodsImportDTO goodsImportDTO = new GoodsImportDTO();
|
||||||
|
|
||||||
|
String categoryId = objects.get(2).toString().substring(0, objects.get(2).toString().indexOf("-"));
|
||||||
|
|
||||||
|
Category category = categoryService.getCategoryById(categoryId);
|
||||||
|
if (category == null) {
|
||||||
|
throw new ServiceException("商品分类不存在:" + objects.get(2).toString().substring(objects.get(2).toString().indexOf("-")));
|
||||||
|
}
|
||||||
|
|
||||||
|
String templateId = objects.get(3).toString().substring(0, objects.get(3).toString().indexOf("-"));
|
||||||
|
FreightTemplateVO freightTemplateVO = freightTemplateService.getFreightTemplate(templateId);
|
||||||
|
if (freightTemplateVO == null) {
|
||||||
|
throw new ServiceException("配送模板不存在:" + objects.get(3).toString().substring(objects.get(3).toString().indexOf("-")));
|
||||||
|
}
|
||||||
|
|
||||||
|
goodsImportDTO.setGoodsName(objects.get(0).toString());
|
||||||
|
goodsImportDTO.setSellingPoint(objects.get(1).toString());
|
||||||
|
goodsImportDTO.setCategory(category);
|
||||||
|
goodsImportDTO.setTemplate(templateId);
|
||||||
|
goodsImportDTO.setGoodsUnit(objects.get(4).toString().substring(objects.get(4).toString().indexOf("-") + 1));
|
||||||
|
goodsImportDTO.setRelease(objects.get(5).toString().equals("上架") ? true : false);
|
||||||
|
|
||||||
|
List<Map<String, String>> images = new ArrayList<>();
|
||||||
|
List<String> goodsGalleryList = new ArrayList<>();
|
||||||
|
Map<String, String> map = new HashMap<>();
|
||||||
|
map.put("url", objects.get(6).toString());
|
||||||
|
images.add(map);
|
||||||
|
goodsGalleryList.add(objects.get(6).toString());
|
||||||
|
goodsImportDTO.setImages(images);
|
||||||
|
goodsImportDTO.setGoodsGalleryList(goodsGalleryList);
|
||||||
|
|
||||||
|
goodsImportDTO.setCost(Convert.toDouble(objects.get(7)));
|
||||||
|
goodsImportDTO.setPrice(Convert.toDouble(objects.get(8)));
|
||||||
|
goodsImportDTO.setQuantity(Convert.toInt(objects.get(9)));
|
||||||
|
goodsImportDTO.setWeight(Convert.toDouble(objects.get(10)));
|
||||||
|
goodsImportDTO.setSn(objects.get(11).toString());
|
||||||
|
goodsImportDTO.setIntro("<p>" + objects.get(12).toString() + "</p>");
|
||||||
|
goodsImportDTO.setSkuKey(objects.get(13).toString());
|
||||||
|
goodsImportDTO.setSkuValue(objects.get(14).toString());
|
||||||
|
goodsImportDTOList.add(goodsImportDTO);
|
||||||
|
}
|
||||||
|
//添加商品
|
||||||
|
addGoodsList(goodsImportDTOList);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加商品
|
||||||
|
*
|
||||||
|
* @param goodsImportDTOList
|
||||||
|
*/
|
||||||
|
private void addGoodsList(List<GoodsImportDTO> goodsImportDTOList) {
|
||||||
|
|
||||||
|
for (GoodsImportDTO goodsImportDTO : goodsImportDTOList) {
|
||||||
|
GoodsOperationDTO goodsOperationDTO = new GoodsOperationDTO(goodsImportDTO);
|
||||||
|
|
||||||
|
//获取父
|
||||||
|
Category parentCategory = categoryService.getCategoryById(goodsImportDTO.getCategory().getParentId());
|
||||||
|
goodsOperationDTO.setCategoryPath(parentCategory.getParentId() + "," + parentCategory.getId() + "," + goodsImportDTO.getCategory().getParentId());
|
||||||
|
//添加商品
|
||||||
|
goodsService.addGoods(goodsOperationDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表格
|
||||||
|
*
|
||||||
|
* @param workbook 表格
|
||||||
|
* @param sheetName sheet名称
|
||||||
|
* @param sheetNameIndex 开始
|
||||||
|
* @param sheetData 数据
|
||||||
|
* @param firstRow 开始行
|
||||||
|
* @param lastRow 结束行
|
||||||
|
* @param firstCol 开始列
|
||||||
|
* @param lastCol 结束列
|
||||||
|
*/
|
||||||
|
private void excelTo255(Workbook workbook, String sheetName, int sheetNameIndex, String[] sheetData,
|
||||||
|
int firstRow, int lastRow, int firstCol, int lastCol) {
|
||||||
|
//将下拉框数据放到新的sheet里,然后excle通过新的sheet数据加载下拉框数据
|
||||||
|
Sheet hidden = workbook.createSheet(sheetName);
|
||||||
|
|
||||||
|
//创建单元格对象
|
||||||
|
Cell cell = null;
|
||||||
|
//遍历我们上面的数组,将数据取出来放到新sheet的单元格中
|
||||||
|
for (int i = 0, length = sheetData.length; i < length; i++) {
|
||||||
|
//取出数组中的每个元素
|
||||||
|
String name = sheetData[i];
|
||||||
|
//根据i创建相应的行对象(说明我们将会把每个元素单独放一行)
|
||||||
|
Row row = hidden.createRow(i);
|
||||||
|
//创建每一行中的第一个单元格
|
||||||
|
cell = row.createCell(0);
|
||||||
|
//然后将数组中的元素赋值给这个单元格
|
||||||
|
cell.setCellValue(name);
|
||||||
|
}
|
||||||
|
// 创建名称,可被其他单元格引用
|
||||||
|
Name namedCell = workbook.createName();
|
||||||
|
namedCell.setNameName(sheetName);
|
||||||
|
// 设置名称引用的公式
|
||||||
|
namedCell.setRefersToFormula(sheetName + "!$A$1:$A$" + (sheetData.length > 0 ? sheetData.length : 1));
|
||||||
|
//加载数据,将名称为hidden的sheet中的数据转换为List形式
|
||||||
|
DVConstraint constraint = DVConstraint.createFormulaListConstraint(sheetName);
|
||||||
|
|
||||||
|
// 设置第一列的3-65534行为下拉列表
|
||||||
|
// (3, 65534, 2, 2) ====> (起始行,结束行,起始列,结束列)
|
||||||
|
CellRangeAddressList regions = new CellRangeAddressList(firstRow, lastRow, firstCol, lastCol);
|
||||||
|
// 将设置下拉选的位置和数据的对应关系 绑定到一起
|
||||||
|
DataValidation dataValidation = new HSSFDataValidation(regions, constraint);
|
||||||
|
|
||||||
|
//将第二个sheet设置为隐藏
|
||||||
|
workbook.setSheetHidden(sheetNameIndex, true);
|
||||||
|
//将数据赋给下拉列表
|
||||||
|
workbook.getSheetAt(0).addValidationData(dataValidation);
|
||||||
|
}
|
||||||
|
}
|
@ -7,6 +7,7 @@ import cn.hutool.json.JSONUtil;
|
|||||||
import cn.lili.cache.Cache;
|
import cn.lili.cache.Cache;
|
||||||
import cn.lili.cache.CachePrefix;
|
import cn.lili.cache.CachePrefix;
|
||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
|
import cn.lili.common.event.TransactionCommitSendMQEvent;
|
||||||
import cn.lili.common.exception.ServiceException;
|
import cn.lili.common.exception.ServiceException;
|
||||||
import cn.lili.common.properties.RocketmqCustomProperties;
|
import cn.lili.common.properties.RocketmqCustomProperties;
|
||||||
import cn.lili.common.security.AuthUser;
|
import cn.lili.common.security.AuthUser;
|
||||||
@ -50,6 +51,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.ApplicationEventPublisher;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@ -106,6 +108,9 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RocketmqCustomProperties rocketmqCustomProperties;
|
private RocketmqCustomProperties rocketmqCustomProperties;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ApplicationEventPublisher applicationEventPublisher;
|
||||||
@Autowired
|
@Autowired
|
||||||
private FreightTemplateService freightTemplateService;
|
private FreightTemplateService freightTemplateService;
|
||||||
|
|
||||||
@ -129,6 +134,10 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
List<String> list = this.baseMapper.getGoodsIdByStoreId(storeId);
|
List<String> list = this.baseMapper.getGoodsIdByStoreId(storeId);
|
||||||
//下架店铺下的商品
|
//下架店铺下的商品
|
||||||
updateGoodsMarketAble(list, GoodsStatusEnum.DOWN, "店铺关闭");
|
updateGoodsMarketAble(list, GoodsStatusEnum.DOWN, "店铺关闭");
|
||||||
|
|
||||||
|
applicationEventPublisher.publishEvent(new TransactionCommitSendMQEvent("下架商品",
|
||||||
|
rocketmqCustomProperties.getGoodsTopic(), GoodsTagsEnum.DOWN.name(), JSONUtil.toJsonStr(list)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -161,7 +170,9 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
//检查商品
|
//检查商品
|
||||||
this.checkGoods(goods);
|
this.checkGoods(goods);
|
||||||
//向goods加入图片
|
//向goods加入图片
|
||||||
this.setGoodsGalleryParam(goodsOperationDTO.getGoodsGalleryList().get(0), goods);
|
if (goodsOperationDTO.getGoodsGalleryList().size() > 0 ) {
|
||||||
|
this.setGoodsGalleryParam(goodsOperationDTO.getGoodsGalleryList().get(0), goods);
|
||||||
|
}
|
||||||
//添加商品参数
|
//添加商品参数
|
||||||
if (goodsOperationDTO.getGoodsParamsDTOList() != null && !goodsOperationDTO.getGoodsParamsDTOList().isEmpty()) {
|
if (goodsOperationDTO.getGoodsParamsDTOList() != null && !goodsOperationDTO.getGoodsParamsDTOList().isEmpty()) {
|
||||||
//给商品参数填充值
|
//给商品参数填充值
|
||||||
@ -175,9 +186,11 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
if (goodsOperationDTO.getGoodsGalleryList() != null && !goodsOperationDTO.getGoodsGalleryList().isEmpty()) {
|
if (goodsOperationDTO.getGoodsGalleryList() != null && !goodsOperationDTO.getGoodsGalleryList().isEmpty()) {
|
||||||
this.goodsGalleryService.add(goodsOperationDTO.getGoodsGalleryList(), goods.getId());
|
this.goodsGalleryService.add(goodsOperationDTO.getGoodsGalleryList(), goods.getId());
|
||||||
}
|
}
|
||||||
|
this.generateEs(goods);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void editGoods(GoodsOperationDTO goodsOperationDTO, String goodsId) {
|
public void editGoods(GoodsOperationDTO goodsOperationDTO, String goodsId) {
|
||||||
@ -203,8 +216,10 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
this.deleteEsGoods(Collections.singletonList(goodsId));
|
this.deleteEsGoods(Collections.singletonList(goodsId));
|
||||||
}
|
}
|
||||||
cache.remove(CachePrefix.GOODS.getPrefix() + goodsId);
|
cache.remove(CachePrefix.GOODS.getPrefix() + goodsId);
|
||||||
|
this.generateEs(goods);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GoodsVO getGoodsVO(String goodsId) {
|
public GoodsVO getGoodsVO(String goodsId) {
|
||||||
//缓存获取,如果没有则读取缓存
|
//缓存获取,如果没有则读取缓存
|
||||||
@ -330,13 +345,13 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean updateGoodsMarketAbleByStoreId(String storeId, GoodsStatusEnum goodsStatusEnum, String underReason) {
|
public Boolean updateGoodsMarketAbleByStoreId(String storeId, GoodsStatusEnum goodsStatusEnum, String underReason) {
|
||||||
boolean result;
|
|
||||||
|
|
||||||
LambdaUpdateWrapper<Goods> updateWrapper = this.getUpdateWrapperByStoreAuthority();
|
LambdaUpdateWrapper<Goods> updateWrapper = this.getUpdateWrapperByStoreAuthority();
|
||||||
updateWrapper.set(Goods::getMarketEnable, goodsStatusEnum.name());
|
updateWrapper.set(Goods::getMarketEnable, goodsStatusEnum.name());
|
||||||
updateWrapper.set(Goods::getUnderMessage, underReason);
|
updateWrapper.set(Goods::getUnderMessage, underReason);
|
||||||
updateWrapper.eq(Goods::getStoreId, storeId);
|
updateWrapper.eq(Goods::getStoreId, storeId);
|
||||||
result = this.update(updateWrapper);
|
boolean result = this.update(updateWrapper);
|
||||||
|
|
||||||
//修改规格商品
|
//修改规格商品
|
||||||
this.goodsSkuService.updateGoodsSkuStatusByStoreId(storeId, goodsStatusEnum.name(), null);
|
this.goodsSkuService.updateGoodsSkuStatusByStoreId(storeId, goodsStatusEnum.name(), null);
|
||||||
@ -420,6 +435,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
LambdaUpdateWrapper<Goods> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
LambdaUpdateWrapper<Goods> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
||||||
lambdaUpdateWrapper.set(Goods::getQuantity, quantity);
|
lambdaUpdateWrapper.set(Goods::getQuantity, quantity);
|
||||||
lambdaUpdateWrapper.eq(Goods::getId, goodsId);
|
lambdaUpdateWrapper.eq(Goods::getId, goodsId);
|
||||||
|
cache.remove(CachePrefix.GOODS.getPrefix() + goodsId);
|
||||||
this.update(lambdaUpdateWrapper);
|
this.update(lambdaUpdateWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -478,17 +494,6 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新店铺商品数量
|
|
||||||
*
|
|
||||||
* @param storeId 信息体
|
|
||||||
*/
|
|
||||||
void updateGoodsNum(String storeId) {
|
|
||||||
Long num = goodsSkuService.countSkuNum(storeId);
|
|
||||||
storeService.updateStoreGoodsNum(storeId, num);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新商品状态
|
* 更新商品状态
|
||||||
*
|
*
|
||||||
@ -506,7 +511,40 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
|
|
||||||
if (GoodsStatusEnum.DOWN.equals(goodsStatusEnum)) {
|
if (GoodsStatusEnum.DOWN.equals(goodsStatusEnum)) {
|
||||||
this.deleteEsGoods(goodsIds);
|
this.deleteEsGoods(goodsIds);
|
||||||
|
} else {
|
||||||
|
this.updateEsGoods(goodsIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//下架商品发送消息
|
||||||
|
if (goodsStatusEnum.equals(GoodsStatusEnum.DOWN)) {
|
||||||
|
applicationEventPublisher.publishEvent(new TransactionCommitSendMQEvent("下架商品",
|
||||||
|
rocketmqCustomProperties.getGoodsTopic(), GoodsTagsEnum.DOWN.name(), JSONUtil.toJsonStr(goodsIds)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送生成ES商品索引
|
||||||
|
*
|
||||||
|
* @param goods 商品信息
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
public void generateEs(Goods goods) {
|
||||||
|
// 不生成没有审核通过且没有上架的商品
|
||||||
|
if (!GoodsStatusEnum.UPPER.name().equals(goods.getMarketEnable()) || !GoodsAuthEnum.PASS.name().equals(goods.getAuthFlag())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
applicationEventPublisher.publishEvent(new TransactionCommitSendMQEvent("生成商品", rocketmqCustomProperties.getGoodsTopic(), GoodsTagsEnum.GENERATOR_GOODS_INDEX.name(), goods.getId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送生成ES商品索引
|
||||||
|
*
|
||||||
|
* @param goodsIds 商品id
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
public void updateEsGoods(List<String> goodsIds) {
|
||||||
|
applicationEventPublisher.publishEvent(new TransactionCommitSendMQEvent("更新商品", rocketmqCustomProperties.getGoodsTopic(), GoodsTagsEnum.UPDATE_GOODS_INDEX.name(), goodsIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -514,11 +552,9 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
*
|
*
|
||||||
* @param goodsIds 商品id
|
* @param goodsIds 商品id
|
||||||
*/
|
*/
|
||||||
private void deleteEsGoods(List<String> goodsIds) {
|
@Transactional
|
||||||
//商品删除消息
|
public void deleteEsGoods(List<String> goodsIds) {
|
||||||
String destination = rocketmqCustomProperties.getGoodsTopic() + ":" + GoodsTagsEnum.GOODS_DELETE.name();
|
applicationEventPublisher.publishEvent(new TransactionCommitSendMQEvent("删除商品", rocketmqCustomProperties.getGoodsTopic(), GoodsTagsEnum.GOODS_DELETE.name(), JSONUtil.toJsonStr(goodsIds)));
|
||||||
//发送mq消息
|
|
||||||
rocketMQTemplate.asyncSend(destination, JSONUtil.toJsonStr(goodsIds), RocketmqSendCallbackBuilder.commonCallback());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -554,7 +590,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
break;
|
break;
|
||||||
case "VIRTUAL_GOODS":
|
case "VIRTUAL_GOODS":
|
||||||
if (!"0".equals(goods.getTemplateId())) {
|
if (!"0".equals(goods.getTemplateId())) {
|
||||||
throw new ServiceException(ResultCode.VIRTUAL_GOODS_NOT_NEED_TEMP);
|
goods.setTemplateId("0");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -667,4 +703,4 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
return queryWrapper;
|
return queryWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ import cn.lili.modules.goods.entity.dto.GoodsSearchParams;
|
|||||||
import cn.lili.modules.goods.entity.dto.GoodsSkuDTO;
|
import cn.lili.modules.goods.entity.dto.GoodsSkuDTO;
|
||||||
import cn.lili.modules.goods.entity.dto.GoodsSkuStockDTO;
|
import cn.lili.modules.goods.entity.dto.GoodsSkuStockDTO;
|
||||||
import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;
|
import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;
|
||||||
|
import cn.lili.modules.goods.entity.enums.GoodsSalesModeEnum;
|
||||||
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
|
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
|
||||||
import cn.lili.modules.goods.entity.vos.GoodsSkuSpecVO;
|
import cn.lili.modules.goods.entity.vos.GoodsSkuSpecVO;
|
||||||
import cn.lili.modules.goods.entity.vos.GoodsSkuVO;
|
import cn.lili.modules.goods.entity.vos.GoodsSkuVO;
|
||||||
@ -42,6 +43,7 @@ import cn.lili.modules.promotion.service.PromotionGoodsService;
|
|||||||
import cn.lili.modules.search.entity.dos.EsGoodsIndex;
|
import cn.lili.modules.search.entity.dos.EsGoodsIndex;
|
||||||
import cn.lili.modules.search.service.EsGoodsIndexService;
|
import cn.lili.modules.search.service.EsGoodsIndexService;
|
||||||
import cn.lili.modules.search.utils.EsIndexUtil;
|
import cn.lili.modules.search.utils.EsIndexUtil;
|
||||||
|
import cn.lili.mybatis.BaseEntity;
|
||||||
import cn.lili.mybatis.util.PageUtil;
|
import cn.lili.mybatis.util.PageUtil;
|
||||||
import cn.lili.rocketmq.RocketmqSendCallbackBuilder;
|
import cn.lili.rocketmq.RocketmqSendCallbackBuilder;
|
||||||
import cn.lili.rocketmq.tags.GoodsTagsEnum;
|
import cn.lili.rocketmq.tags.GoodsTagsEnum;
|
||||||
@ -130,13 +132,12 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
|||||||
throw new ServiceException(ResultCode.MUST_HAVE_GOODS_SKU);
|
throw new ServiceException(ResultCode.MUST_HAVE_GOODS_SKU);
|
||||||
}
|
}
|
||||||
// 检查是否需要生成索引
|
// 检查是否需要生成索引
|
||||||
List<GoodsSku> goodsSkus = GoodsSkuBuilder.buildBatch(goods, goodsOperationDTO);
|
List<GoodsSku> goodsSkus = GoodsSkuBuilder.buildBatch(goods, goodsOperationDTO.getSkuList());
|
||||||
renderGoodsSkuList(goodsSkus, goodsOperationDTO);
|
renderGoodsSkuList(goodsSkus, goodsOperationDTO);
|
||||||
|
|
||||||
if (!goodsSkus.isEmpty()) {
|
if (!goodsSkus.isEmpty()) {
|
||||||
this.saveOrUpdateBatch(goodsSkus);
|
this.saveOrUpdateBatch(goodsSkus);
|
||||||
this.updateStock(goodsSkus);
|
this.updateStock(goodsSkus);
|
||||||
this.generateEs(goods);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,7 +151,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
|||||||
List<GoodsSku> skuList;
|
List<GoodsSku> skuList;
|
||||||
//删除旧的sku信息
|
//删除旧的sku信息
|
||||||
if (Boolean.TRUE.equals(goodsOperationDTO.getRegeneratorSkuFlag())) {
|
if (Boolean.TRUE.equals(goodsOperationDTO.getRegeneratorSkuFlag())) {
|
||||||
skuList = GoodsSkuBuilder.buildBatch(goods, goodsOperationDTO);
|
skuList = GoodsSkuBuilder.buildBatch(goods, goodsOperationDTO.getSkuList());
|
||||||
renderGoodsSkuList(skuList, goodsOperationDTO);
|
renderGoodsSkuList(skuList, goodsOperationDTO);
|
||||||
List<GoodsSkuVO> goodsListByGoodsId = getGoodsListByGoodsId(goods.getId());
|
List<GoodsSkuVO> goodsListByGoodsId = getGoodsListByGoodsId(goods.getId());
|
||||||
List<String> oldSkuIds = new ArrayList<>();
|
List<String> oldSkuIds = new ArrayList<>();
|
||||||
@ -160,7 +161,6 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
|||||||
cache.remove(GoodsSkuService.getCacheKeys(goodsSkuVO.getId()));
|
cache.remove(GoodsSkuService.getCacheKeys(goodsSkuVO.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.remove(new LambdaQueryWrapper<GoodsSku>().eq(GoodsSku::getGoodsId, goods.getId()));
|
|
||||||
//删除sku相册
|
//删除sku相册
|
||||||
goodsGalleryService.removeByGoodsId(goods.getId());
|
goodsGalleryService.removeByGoodsId(goods.getId());
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
|||||||
} else {
|
} else {
|
||||||
skuList = new ArrayList<>();
|
skuList = new ArrayList<>();
|
||||||
for (Map<String, Object> map : goodsOperationDTO.getSkuList()) {
|
for (Map<String, Object> map : goodsOperationDTO.getSkuList()) {
|
||||||
GoodsSku sku = GoodsSkuBuilder.build(goods, map, goodsOperationDTO);
|
GoodsSku sku = GoodsSkuBuilder.build(goods, map);
|
||||||
renderGoodsSku(sku, goodsOperationDTO);
|
renderGoodsSku(sku, goodsOperationDTO);
|
||||||
skuList.add(sku);
|
skuList.add(sku);
|
||||||
//如果商品状态值不对,则es索引移除
|
//如果商品状态值不对,则es索引移除
|
||||||
@ -181,10 +181,12 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!skuList.isEmpty()) {
|
if (!skuList.isEmpty()) {
|
||||||
this.remove(new LambdaQueryWrapper<GoodsSku>().eq(GoodsSku::getGoodsId, goods.getId()));
|
LambdaQueryWrapper<GoodsSku> unnecessarySkuIdsQuery = new LambdaQueryWrapper<>();
|
||||||
|
unnecessarySkuIdsQuery.eq(GoodsSku::getGoodsId, goods.getId());
|
||||||
|
unnecessarySkuIdsQuery.notIn(GoodsSku::getId, skuList.stream().map(BaseEntity::getId).collect(Collectors.toList()));
|
||||||
|
this.remove(unnecessarySkuIdsQuery);
|
||||||
this.saveOrUpdateBatch(skuList);
|
this.saveOrUpdateBatch(skuList);
|
||||||
this.updateStock(skuList);
|
this.updateStock(skuList);
|
||||||
this.generateEs(goods);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,6 +239,15 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
|||||||
return goodsSku;
|
return goodsSku;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GoodsSku getCanPromotionGoodsSkuByIdFromCache(String skuId) {
|
||||||
|
GoodsSku goodsSku = this.getGoodsSkuByIdFromCache(skuId);
|
||||||
|
if (goodsSku != null && GoodsSalesModeEnum.WHOLESALE.name().equals(goodsSku.getSalesModel())) {
|
||||||
|
throw new ServiceException(ResultCode.PROMOTION_GOODS_DO_NOT_JOIN_WHOLESALE, goodsSku.getGoodsName());
|
||||||
|
}
|
||||||
|
return goodsSku;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> getGoodsSkuDetail(String goodsId, String skuId) {
|
public Map<String, Object> getGoodsSkuDetail(String goodsId, String skuId) {
|
||||||
Map<String, Object> map = new HashMap<>(16);
|
Map<String, Object> map = new HashMap<>(16);
|
||||||
@ -344,9 +355,6 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
|||||||
cache.remove(GoodsSkuService.getCacheKeys(sku.getId()));
|
cache.remove(GoodsSkuService.getCacheKeys(sku.getId()));
|
||||||
cache.put(GoodsSkuService.getCacheKeys(sku.getId()), sku);
|
cache.put(GoodsSkuService.getCacheKeys(sku.getId()), sku);
|
||||||
}
|
}
|
||||||
if (!goodsSkus.isEmpty()) {
|
|
||||||
this.generateEs(goods);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -395,7 +403,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<GoodsSkuVO> getGoodsListByGoodsId(String goodsId) {
|
public List<GoodsSkuVO> getGoodsListByGoodsId(String goodsId) {
|
||||||
List<GoodsSku> list = this.list(new LambdaQueryWrapper<GoodsSku>().eq(GoodsSku::getGoodsId, goodsId).orderByAsc(GoodsSku::getGoodsName));
|
List<GoodsSku> list = this.list(new LambdaQueryWrapper<GoodsSku>().eq(GoodsSku::getGoodsId, goodsId));
|
||||||
return this.getGoodsSkuVOList(list);
|
return this.getGoodsSkuVOList(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -583,21 +591,6 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
|||||||
return this.baseMapper.getGoodsSkuIdByGoodsId(goodsId);
|
return this.baseMapper.getGoodsSkuIdByGoodsId(goodsId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送生成ES商品索引
|
|
||||||
*
|
|
||||||
* @param goods 商品信息
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void generateEs(Goods goods) {
|
|
||||||
// 不生成没有审核通过且没有上架的商品
|
|
||||||
if (!GoodsStatusEnum.UPPER.name().equals(goods.getMarketEnable()) || !GoodsAuthEnum.PASS.name().equals(goods.getAuthFlag())) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
applicationEventPublisher.publishEvent(new TransactionCommitSendMQEvent("生成商品", rocketmqCustomProperties.getGoodsTopic(), GoodsTagsEnum.GENERATOR_GOODS_INDEX.name(), goods.getId()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean deleteAndInsertGoodsSkus(List<GoodsSku> goodsSkus) {
|
public boolean deleteAndInsertGoodsSkus(List<GoodsSku> goodsSkus) {
|
||||||
@ -646,7 +639,8 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
|||||||
* @param goodsSkuList sku集合
|
* @param goodsSkuList sku集合
|
||||||
* @param goodsOperationDTO 商品操作DTO
|
* @param goodsOperationDTO 商品操作DTO
|
||||||
*/
|
*/
|
||||||
void renderGoodsSkuList(List<GoodsSku> goodsSkuList, GoodsOperationDTO goodsOperationDTO) {
|
@Override
|
||||||
|
public void renderGoodsSkuList(List<GoodsSku> goodsSkuList, GoodsOperationDTO goodsOperationDTO) {
|
||||||
// 商品销售模式渲染器
|
// 商品销售模式渲染器
|
||||||
salesModelRenders.stream().filter(i -> i.getSalesMode().equals(goodsOperationDTO.getSalesModel())).findFirst().ifPresent(i -> i.renderBatch(goodsSkuList, goodsOperationDTO));
|
salesModelRenders.stream().filter(i -> i.getSalesMode().equals(goodsOperationDTO.getSalesModel())).findFirst().ifPresent(i -> i.renderBatch(goodsSkuList, goodsOperationDTO));
|
||||||
for (GoodsSku goodsSku : goodsSkuList) {
|
for (GoodsSku goodsSku : goodsSkuList) {
|
||||||
|
@ -12,6 +12,7 @@ import cn.lili.modules.goods.entity.vos.StoreGoodsLabelVO;
|
|||||||
import cn.lili.modules.goods.mapper.StoreGoodsLabelMapper;
|
import cn.lili.modules.goods.mapper.StoreGoodsLabelMapper;
|
||||||
import cn.lili.modules.goods.service.StoreGoodsLabelService;
|
import cn.lili.modules.goods.service.StoreGoodsLabelService;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@ -22,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺商品分类业务层实现
|
* 店铺商品分类业务层实现
|
||||||
@ -58,6 +60,7 @@ public class StoreGoodsLabelServiceImpl extends ServiceImpl<StoreGoodsLabelMappe
|
|||||||
list.stream()
|
list.stream()
|
||||||
.filter(label -> label.getParentId() != null && label.getParentId().equals(storeGoodsLabel.getId()))
|
.filter(label -> label.getParentId() != null && label.getParentId().equals(storeGoodsLabel.getId()))
|
||||||
.forEach(storeGoodsLabelChild -> storeGoodsLabelVOChildList.add(new StoreGoodsLabelVO(storeGoodsLabelChild.getId(), storeGoodsLabelChild.getLabelName(), storeGoodsLabelChild.getLevel(), storeGoodsLabelChild.getSortOrder())));
|
.forEach(storeGoodsLabelChild -> storeGoodsLabelVOChildList.add(new StoreGoodsLabelVO(storeGoodsLabelChild.getId(), storeGoodsLabelChild.getLabelName(), storeGoodsLabelChild.getLevel(), storeGoodsLabelChild.getSortOrder())));
|
||||||
|
storeGoodsLabelVOChildList.sort(Comparator.comparing(StoreGoodsLabelVO::getSortOrder));
|
||||||
storeGoodsLabelVO.setChildren(storeGoodsLabelVOChildList);
|
storeGoodsLabelVO.setChildren(storeGoodsLabelVOChildList);
|
||||||
storeGoodsLabelVOList.add(storeGoodsLabelVO);
|
storeGoodsLabelVOList.add(storeGoodsLabelVO);
|
||||||
});
|
});
|
||||||
@ -82,6 +85,13 @@ public class StoreGoodsLabelServiceImpl extends ServiceImpl<StoreGoodsLabelMappe
|
|||||||
return this.list(new LambdaQueryWrapper<StoreGoodsLabel>().in(StoreGoodsLabel::getId, ids).orderByAsc(StoreGoodsLabel::getLevel));
|
return this.list(new LambdaQueryWrapper<StoreGoodsLabel>().in(StoreGoodsLabel::getId, ids).orderByAsc(StoreGoodsLabel::getLevel));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> listMapsByStoreIds(List<String> ids, String columns) {
|
||||||
|
QueryWrapper<StoreGoodsLabel> queryWrapper = new QueryWrapper<StoreGoodsLabel>().in("id", ids).orderByAsc("level");
|
||||||
|
queryWrapper.select(columns);
|
||||||
|
return this.listMaps(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public StoreGoodsLabel addStoreGoodsLabel(StoreGoodsLabel storeGoodsLabel) {
|
public StoreGoodsLabel addStoreGoodsLabel(StoreGoodsLabel storeGoodsLabel) {
|
||||||
|
@ -161,12 +161,12 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> impleme
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean push(Integer roomId, Integer goodsId, String storeId) {
|
public Boolean push(Integer roomId, Integer liveGoodsId, String storeId, String goodsId) {
|
||||||
|
|
||||||
//判断直播间是否已添加商品
|
//判断直播间是否已添加商品
|
||||||
if (studioCommodityService.getOne(
|
if (studioCommodityService.getOne(
|
||||||
new LambdaQueryWrapper<StudioCommodity>().eq(StudioCommodity::getRoomId, roomId)
|
new LambdaQueryWrapper<StudioCommodity>().eq(StudioCommodity::getRoomId, roomId)
|
||||||
.eq(StudioCommodity::getGoodsId, goodsId)) != null) {
|
.eq(StudioCommodity::getGoodsId, liveGoodsId)) != null) {
|
||||||
throw new ServiceException(ResultCode.STODIO_GOODS_EXIST_ERROR);
|
throw new ServiceException(ResultCode.STODIO_GOODS_EXIST_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,8 +176,8 @@ public class StudioServiceImpl extends ServiceImpl<StudioMapper, Studio> impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
//调用微信接口添加直播间商品并进行记录
|
//调用微信接口添加直播间商品并进行记录
|
||||||
if (Boolean.TRUE.equals(wechatLivePlayerUtil.pushGoods(roomId, goodsId))) {
|
if (Boolean.TRUE.equals(wechatLivePlayerUtil.pushGoods(roomId, liveGoodsId))) {
|
||||||
studioCommodityService.save(new StudioCommodity(roomId, goodsId));
|
studioCommodityService.save(new StudioCommodity(roomId, liveGoodsId));
|
||||||
//添加直播间商品数量
|
//添加直播间商品数量
|
||||||
Studio studio = this.getByRoomId(roomId);
|
Studio studio = this.getByRoomId(roomId);
|
||||||
studio.setRoomGoodsNum(studio.getRoomGoodsNum() != null ? studio.getRoomGoodsNum() + 1 : 1);
|
studio.setRoomGoodsNum(studio.getRoomGoodsNum() != null ? studio.getRoomGoodsNum() + 1 : 1);
|
||||||
|
@ -2,6 +2,8 @@ package cn.lili.modules.goods.serviceimpl;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.lili.cache.Cache;
|
import cn.lili.cache.Cache;
|
||||||
|
import cn.lili.common.enums.ResultCode;
|
||||||
|
import cn.lili.common.exception.ServiceException;
|
||||||
import cn.lili.modules.goods.entity.dos.Wholesale;
|
import cn.lili.modules.goods.entity.dos.Wholesale;
|
||||||
import cn.lili.modules.goods.mapper.WholesaleMapper;
|
import cn.lili.modules.goods.mapper.WholesaleMapper;
|
||||||
import cn.lili.modules.goods.service.WholesaleService;
|
import cn.lili.modules.goods.service.WholesaleService;
|
||||||
@ -36,6 +38,23 @@ public class WholesaleServiceImpl extends ServiceImpl<WholesaleMapper, Wholesale
|
|||||||
return this.list(queryWrapper).stream().sorted(Comparator.comparing(Wholesale::getNum)).collect(Collectors.toList());
|
return this.list(queryWrapper).stream().sorted(Comparator.comparing(Wholesale::getNum)).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Cacheable(key = "#templateId+'_template'")
|
||||||
|
public List<Wholesale> findByTemplateId(String templateId) {
|
||||||
|
LambdaQueryWrapper<Wholesale> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(Wholesale::getTemplateId, templateId);
|
||||||
|
return this.list(queryWrapper).stream().sorted(Comparator.comparing(Wholesale::getNum)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@CacheEvict(key = "#templateId+'_template'")
|
||||||
|
public Boolean removeByTemplateId(String templateId) {
|
||||||
|
LambdaQueryWrapper<Wholesale> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(Wholesale::getTemplateId, templateId);
|
||||||
|
cache.remove("{wholesale}_" + templateId + "_template");
|
||||||
|
return this.remove(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(key = "#goodsId")
|
@CacheEvict(key = "#goodsId")
|
||||||
public Boolean removeByGoodsId(String goodsId) {
|
public Boolean removeByGoodsId(String goodsId) {
|
||||||
@ -58,7 +77,7 @@ public class WholesaleServiceImpl extends ServiceImpl<WholesaleMapper, Wholesale
|
|||||||
if (CollUtil.isNotEmpty(matchList)) {
|
if (CollUtil.isNotEmpty(matchList)) {
|
||||||
return matchList.get(matchList.size() - 1);
|
return matchList.get(matchList.size() - 1);
|
||||||
} else if (CollUtil.isNotEmpty(wholesaleList) && CollUtil.isEmpty(matchList)) {
|
} else if (CollUtil.isNotEmpty(wholesaleList) && CollUtil.isEmpty(matchList)) {
|
||||||
return wholesaleList.get(0);
|
throw new ServiceException(ResultCode.DO_NOT_MATCH_WHOLESALE);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import cn.hutool.core.lang.Assert;
|
|||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import cn.lili.modules.goods.entity.dos.Goods;
|
import cn.lili.modules.goods.entity.dos.Goods;
|
||||||
import cn.lili.modules.goods.entity.dos.GoodsSku;
|
import cn.lili.modules.goods.entity.dos.GoodsSku;
|
||||||
import cn.lili.modules.goods.entity.dto.GoodsOperationDTO;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -25,50 +24,44 @@ public class GoodsSkuBuilder {
|
|||||||
/**
|
/**
|
||||||
* 构建商品sku
|
* 构建商品sku
|
||||||
*
|
*
|
||||||
* @param goods 商品
|
* @param goods 商品
|
||||||
* @param skuInfo sku信息列表
|
* @param skuInfo sku信息列表
|
||||||
* @param goodsOperationDTO 商品操作信息(如需处理额外信息传递,不需可传空)
|
|
||||||
* @return 商品sku
|
* @return 商品sku
|
||||||
*/
|
*/
|
||||||
public static GoodsSku build(Goods goods, Map<String, Object> skuInfo, GoodsOperationDTO goodsOperationDTO) {
|
public static GoodsSku build(Goods goods, Map<String, Object> skuInfo) {
|
||||||
GoodsSku goodsSku = new GoodsSku(goods);
|
GoodsSku goodsSku = new GoodsSku(goods);
|
||||||
builderSingle(goodsSku, skuInfo, goodsOperationDTO);
|
builderSingle(goodsSku, skuInfo);
|
||||||
return goodsSku;
|
return goodsSku;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量构建商品sku
|
* 批量构建商品sku
|
||||||
*
|
*
|
||||||
* @param goods 商品
|
* @param goods 商品
|
||||||
* @param goodsOperationDTO 商品操作信息
|
|
||||||
* @return 商品sku
|
* @return 商品sku
|
||||||
*/
|
*/
|
||||||
public static List<GoodsSku> buildBatch(Goods goods, GoodsOperationDTO goodsOperationDTO) {
|
public static List<GoodsSku> buildBatch(Goods goods, List<Map<String, Object>> skuList) {
|
||||||
return builderBatch(goods, goodsOperationDTO);
|
Assert.notEmpty(skuList, "skuList不能为空");
|
||||||
|
Assert.notNull(goods, "goods不能为空");
|
||||||
|
List<GoodsSku> goodsSkus = new ArrayList<>();
|
||||||
|
for (Map<String, Object> skuInfo : skuList) {
|
||||||
|
GoodsSku goodsSku = new GoodsSku(goods);
|
||||||
|
builderSingle(goodsSku, skuInfo);
|
||||||
|
goodsSkus.add(goodsSku);
|
||||||
|
}
|
||||||
|
return goodsSkus;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 从已有的商品sku中构建商品sku
|
|
||||||
*
|
|
||||||
* @param goodsSku 原商品sku
|
|
||||||
* @param skuInfo sku信息列表
|
|
||||||
* @param goodsOperationDTO 商品操作信息(如需处理额外信息传递,不需可传空)
|
|
||||||
* @return 商品sku
|
|
||||||
*/
|
|
||||||
public static GoodsSku build(GoodsSku goodsSku, Map<String, Object> skuInfo, GoodsOperationDTO goodsOperationDTO) {
|
|
||||||
builderSingle(goodsSku, skuInfo, goodsOperationDTO);
|
|
||||||
return goodsSku;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void builderSingle(GoodsSku goodsSku, Map<String, Object> skuInfo, GoodsOperationDTO goodsOperationDTO) {
|
private static void builderSingle(GoodsSku goodsSku, Map<String, Object> skuInfo) {
|
||||||
Assert.notNull(goodsSku, "goodsSku不能为空");
|
Assert.notNull(goodsSku, "goodsSku不能为空");
|
||||||
Assert.notEmpty(skuInfo, "skuInfo不能为空");
|
Assert.notEmpty(skuInfo, "skuInfo不能为空");
|
||||||
//规格简短信息
|
//规格简短信息
|
||||||
StringBuilder simpleSpecs = new StringBuilder();
|
StringBuilder simpleSpecs = new StringBuilder();
|
||||||
//商品名称
|
//商品名称
|
||||||
StringBuilder goodsName = new StringBuilder(goodsOperationDTO.getGoodsName());
|
StringBuilder goodsName = new StringBuilder(goodsSku.getGoodsName());
|
||||||
//规格值
|
//规格值
|
||||||
Map<String, Object> specMap = new HashMap<>(16);
|
Map<String, Object> specMap = new LinkedHashMap<>();
|
||||||
|
|
||||||
// 原始规格项
|
// 原始规格项
|
||||||
String[] ignoreOriginKeys = {"id", "sn", "cost", "price", "quantity", "weight"};
|
String[] ignoreOriginKeys = {"id", "sn", "cost", "price", "quantity", "weight"};
|
||||||
@ -100,17 +93,5 @@ public class GoodsSkuBuilder {
|
|||||||
goodsSku.setSimpleSpecs(simpleSpecs.toString());
|
goodsSku.setSimpleSpecs(simpleSpecs.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<GoodsSku> builderBatch(Goods goods, GoodsOperationDTO goodsOperationDTO) {
|
|
||||||
Assert.notEmpty(goodsOperationDTO.getSkuList(), "goodsOperationDTO.getSkuList()不能为空");
|
|
||||||
Assert.notNull(goods, "goods不能为空");
|
|
||||||
List<GoodsSku> goodsSkus = new ArrayList<>();
|
|
||||||
for (Map<String, Object> skuInfo : goodsOperationDTO.getSkuList()) {
|
|
||||||
GoodsSku goodsSku = new GoodsSku(goods);
|
|
||||||
builderSingle(goodsSku, skuInfo, goodsOperationDTO);
|
|
||||||
goodsSkus.add(goodsSku);
|
|
||||||
}
|
|
||||||
return goodsSkus;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,11 @@ public class WholesaleSaleModelRenderImpl implements SalesModelRender {
|
|||||||
skus.setPrice(collect.get(0).getPrice());
|
skus.setPrice(collect.get(0).getPrice());
|
||||||
skus.setCost(collect.get(0).getPrice());
|
skus.setCost(collect.get(0).getPrice());
|
||||||
}
|
}
|
||||||
wholesaleService.removeByGoodsId(goodsSkus.get(0).getGoodsId());
|
if (Boolean.TRUE.equals(goodsOperationDTO.getGoodsTemplateFlag())) {
|
||||||
|
wholesaleService.removeByTemplateId(goodsSkus.get(0).getGoodsId());
|
||||||
|
} else {
|
||||||
|
wholesaleService.removeByGoodsId(goodsSkus.get(0).getGoodsId());
|
||||||
|
}
|
||||||
wholesaleService.saveOrUpdateBatch(collect);
|
wholesaleService.saveOrUpdateBatch(collect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
package cn.lili.modules.kdBrid.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 快递鸟电子面单业务层实现
|
||||||
|
*
|
||||||
|
* @author chc
|
||||||
|
* @since 2022-4-12 10:12:43
|
||||||
|
*/
|
||||||
|
public interface KdNiaoService {
|
||||||
|
/**
|
||||||
|
* 生成电子面单
|
||||||
|
* @param orderSn 订单编号
|
||||||
|
* @param logisticsId 物流公司
|
||||||
|
* @return 电子面单模板
|
||||||
|
*/
|
||||||
|
String createElectronicsFaceSheet(String orderSn, String logisticsId) throws Exception;
|
||||||
|
}
|
@ -0,0 +1,383 @@
|
|||||||
|
package cn.lili.modules.kdBrid.serviceImpl;
|
||||||
|
|
||||||
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
|
import cn.lili.common.enums.ResultCode;
|
||||||
|
import cn.lili.common.exception.ServiceException;
|
||||||
|
import cn.lili.common.security.OperationalJudgment;
|
||||||
|
import cn.lili.modules.kdBrid.service.KdNiaoService;
|
||||||
|
import cn.lili.modules.member.service.StoreLogisticsService;
|
||||||
|
import cn.lili.modules.order.order.aop.OrderLogPoint;
|
||||||
|
import cn.lili.modules.order.order.entity.dos.Order;
|
||||||
|
import cn.lili.modules.order.order.entity.dos.OrderItem;
|
||||||
|
import cn.lili.modules.order.order.entity.enums.DeliverStatusEnum;
|
||||||
|
import cn.lili.modules.order.order.entity.enums.OrderStatusEnum;
|
||||||
|
import cn.lili.modules.order.order.service.OrderItemService;
|
||||||
|
import cn.lili.modules.order.order.service.OrderService;
|
||||||
|
import cn.lili.modules.store.entity.dos.StoreLogistics;
|
||||||
|
import cn.lili.modules.store.entity.dto.StoreDeliverGoodsAddressDTO;
|
||||||
|
import cn.lili.modules.store.service.StoreDetailService;
|
||||||
|
import cn.lili.modules.system.entity.dos.Logistics;
|
||||||
|
import cn.lili.modules.system.entity.dos.Setting;
|
||||||
|
import cn.lili.modules.system.entity.dto.KuaidiSetting;
|
||||||
|
import cn.lili.modules.system.entity.enums.SettingEnum;
|
||||||
|
import cn.lili.modules.system.service.LogisticsService;
|
||||||
|
import cn.lili.modules.system.service.SettingService;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import groovy.util.logging.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.security.MessageDigest;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 快递鸟电子面单业务层实现
|
||||||
|
*
|
||||||
|
* @author chc
|
||||||
|
* @since 2022-4-12 10:12:43
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class KdNiaoServiceImpl implements KdNiaoService {
|
||||||
|
/**
|
||||||
|
* 订单货物
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
OrderItemService orderItemService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
OrderService orderService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物流公司
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
LogisticsService logisticsService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商家店铺
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
StoreDetailService storeDetailService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
SettingService settingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺-物流
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
StoreLogisticsService storeLogisticsService;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@OrderLogPoint(description = "'订单['+#orderSn+']发货,发货单号['+#logisticsNo+'],已打印电子面单'", orderSn = "#orderSn")
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public String createElectronicsFaceSheet(String orderSn, String logisticsId) throws Exception {
|
||||||
|
//电子面单模板
|
||||||
|
String printTemplate = null;
|
||||||
|
//获取订单及子订单
|
||||||
|
Order order = OperationalJudgment.judgment(orderService.getBySn(orderSn));
|
||||||
|
List<OrderItem> orderItems = orderItemService.getByOrderSn(orderSn);
|
||||||
|
|
||||||
|
Setting setting = settingService.get(SettingEnum.KUAIDI_SETTING.name());
|
||||||
|
if (CharSequenceUtil.isBlank(setting.getSettingValue())) {
|
||||||
|
throw new ServiceException(ResultCode.LOGISTICS_NOT_SETTING);
|
||||||
|
}
|
||||||
|
KuaidiSetting kuaidiSetting = new Gson().fromJson(setting.getSettingValue(), KuaidiSetting.class);
|
||||||
|
|
||||||
|
//ID
|
||||||
|
String EBusinessID = kuaidiSetting.getEbusinessID();
|
||||||
|
|
||||||
|
//KEY
|
||||||
|
String AppKey = kuaidiSetting.getAppKey();
|
||||||
|
|
||||||
|
//请求url
|
||||||
|
String ReqURL = kuaidiSetting.getSheetReqURL();
|
||||||
|
|
||||||
|
//如果订单未发货,并且订单状态值等于待发货
|
||||||
|
if (order.getDeliverStatus().equals(DeliverStatusEnum.UNDELIVERED.name()) && order.getOrderStatus().equals(OrderStatusEnum.UNDELIVERED.name())) {
|
||||||
|
|
||||||
|
//获取对应物流
|
||||||
|
Logistics logistics = logisticsService.getById(logisticsId);
|
||||||
|
|
||||||
|
//物流为空,抛出异常
|
||||||
|
if (logistics == null) {
|
||||||
|
throw new ServiceException(ResultCode.ORDER_LOGISTICS_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取店家的物流信息
|
||||||
|
LambdaQueryWrapper<StoreLogistics> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||||
|
lambdaQueryWrapper.eq(StoreLogistics::getLogisticsId, logisticsId);
|
||||||
|
lambdaQueryWrapper.eq(StoreLogistics::getStoreId, order.getStoreId());
|
||||||
|
StoreLogistics storeLogistics = storeLogisticsService.getOne(lambdaQueryWrapper);
|
||||||
|
|
||||||
|
//获取店家信息
|
||||||
|
StoreDeliverGoodsAddressDTO storeDeliverGoodsAddressDTO = storeDetailService.getStoreDeliverGoodsAddressDto(order.getStoreId());
|
||||||
|
//收件人地址
|
||||||
|
String[] ConsigneeAddress = order.getConsigneeAddressPath().split(",");
|
||||||
|
//发件人地址
|
||||||
|
String[] consignorAddress = storeDeliverGoodsAddressDTO.getSalesConsignorAddressPath().split(",");
|
||||||
|
|
||||||
|
//组装快递鸟应用级参数
|
||||||
|
String resultDate = "{" +
|
||||||
|
"'OrderCode': '" + orderSn + "'," + //订单编码
|
||||||
|
"'ShipperCode': '" + logistics.getCode() + "'," + //快递公司编码
|
||||||
|
"'CustomerName': '"+storeLogistics.getCustomerName()+"'," +//客户编码
|
||||||
|
"'CustomerPwd': '"+storeLogistics.getCustomerPwd()+"'," + //客户密码
|
||||||
|
"'MonthCode': '"+storeLogistics.getMonthCode()+"'," + //密钥
|
||||||
|
"'SendSite': '"+storeLogistics.getSendSite()+"'," + //归属网点
|
||||||
|
"'SendStaff': '"+storeLogistics.getSendStaff()+"'," + //收件快递员
|
||||||
|
"'PayType': "+storeLogistics.getPayType()+"," +
|
||||||
|
"'ExpType': "+storeLogistics.getExpType()+"," +
|
||||||
|
//发件人信息
|
||||||
|
"'Sender': {" +
|
||||||
|
"'Name': '" + storeDeliverGoodsAddressDTO.getSalesConsignorName() + "'," +
|
||||||
|
"'Mobile': '" + storeDeliverGoodsAddressDTO.getSalesConsignorMobile() + "'," +
|
||||||
|
"'ProvinceName': '" + consignorAddress[0] + "'," + //省
|
||||||
|
"'CityName': '" + consignorAddress[1] + "'," + //市
|
||||||
|
"'ExpAreaName': '" + consignorAddress[2] + "'," + //区
|
||||||
|
"'Address': '" + storeDeliverGoodsAddressDTO.getSalesConsignorDetail() + "'" + //发件人详细地址
|
||||||
|
"}," +
|
||||||
|
//收件人信息
|
||||||
|
"'Receiver': {" +
|
||||||
|
"'Name': '" + order.getConsigneeName() + "'," +
|
||||||
|
"'Mobile': '" + order.getConsigneeMobile() + "'," +
|
||||||
|
"'ProvinceName': '" + ConsigneeAddress[0] + "'," + //省
|
||||||
|
"'CityName': '" + ConsigneeAddress[1] + "'," + //市
|
||||||
|
"'ExpAreaName': '" + ConsigneeAddress[2] + "'," + //区
|
||||||
|
"'Address': '" + order.getConsigneeDetail() + "'" + //收件人详细地址
|
||||||
|
"}," +
|
||||||
|
//商品信息
|
||||||
|
"'Commodity': [";
|
||||||
|
|
||||||
|
//子订单信息
|
||||||
|
for (OrderItem orderItem : orderItems) {
|
||||||
|
resultDate = resultDate + "{" +
|
||||||
|
"'GoodsName': '" + orderItem.getGoodsName() + "'," +
|
||||||
|
"'Goodsquantity': '" + orderItem.getNum() + "'" +
|
||||||
|
"},";
|
||||||
|
}
|
||||||
|
resultDate = resultDate + "]," +
|
||||||
|
"'Quantity': "+orderItems.size()+"," + //包裹数
|
||||||
|
"'IsReturnPrintTemplate':1,"+ //生成电子面单模板
|
||||||
|
"'Remark': '" + order.getRemark() + "'"+//商家备注
|
||||||
|
"}";
|
||||||
|
|
||||||
|
|
||||||
|
//组织系统级参数
|
||||||
|
Map<String, String> params = new HashMap<>();
|
||||||
|
//进行格式加密
|
||||||
|
params.put("RequestData", urlEncoder(resultDate, "UTF-8"));
|
||||||
|
params.put("EBusinessID", EBusinessID);
|
||||||
|
params.put("RequestType", "1007");
|
||||||
|
|
||||||
|
String dataSign = encrypt(resultDate, AppKey, "UTF-8");
|
||||||
|
params.put("DataSign", dataSign);
|
||||||
|
params.put("DataType", "2");
|
||||||
|
// 以form表单形式提交post请求,post请求体中包含了应用级参数和系统级参数
|
||||||
|
String result = sendPost(ReqURL, params);
|
||||||
|
|
||||||
|
//根据公司业务处理返回的信息......
|
||||||
|
JSONObject obj = JSONObject.parseObject(result);
|
||||||
|
|
||||||
|
if(!"100".equals(obj.getString("ResultCode"))){
|
||||||
|
return obj.getString("Reason");
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject orderJson = JSONObject.parseObject(obj.getString("Order"));
|
||||||
|
|
||||||
|
//电子面单模板
|
||||||
|
printTemplate = obj.getString("PrintTemplate");
|
||||||
|
|
||||||
|
//进行发货
|
||||||
|
orderService.delivery(orderSn, orderJson.getString("LogisticCode"), logisticsId);
|
||||||
|
}
|
||||||
|
return printTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MD5加密
|
||||||
|
*
|
||||||
|
* @param str 内容
|
||||||
|
* @param charset 编码方式
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
private String MD5(String str, String charset) throws Exception {
|
||||||
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||||
|
md.update(str.getBytes(charset));
|
||||||
|
byte[] result = md.digest();
|
||||||
|
StringBuffer sb = new StringBuffer(32);
|
||||||
|
for (int i = 0; i < result.length; i++) {
|
||||||
|
int val = result[i] & 0xff;
|
||||||
|
if (val <= 0xf) {
|
||||||
|
sb.append("0");
|
||||||
|
}
|
||||||
|
sb.append(Integer.toHexString(val));
|
||||||
|
}
|
||||||
|
return sb.toString().toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* base64编码
|
||||||
|
*
|
||||||
|
* @param str 内容
|
||||||
|
* @param charset 编码方式di
|
||||||
|
* @throws UnsupportedEncodingException
|
||||||
|
*/
|
||||||
|
private String base64(String str, String charset) throws UnsupportedEncodingException {
|
||||||
|
return base64Encode(str.getBytes(charset));
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
private String urlEncoder(String str, String charset) throws UnsupportedEncodingException {
|
||||||
|
return URLEncoder.encode(str, charset);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电商Sign签名生成
|
||||||
|
*
|
||||||
|
* @param content 内容
|
||||||
|
* @param keyValue Appkey
|
||||||
|
* @param charset 编码方式
|
||||||
|
* @return DataSign签名
|
||||||
|
* @throws UnsupportedEncodingException ,Exception
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
private String encrypt(String content, String keyValue, String charset) throws Exception {
|
||||||
|
if (keyValue != null) {
|
||||||
|
return base64(MD5(content + keyValue, charset), charset);
|
||||||
|
}
|
||||||
|
return base64(MD5(content, charset), charset);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 向指定 URL 发送POST方法的请求
|
||||||
|
*
|
||||||
|
* @param url 发送请求的 URL
|
||||||
|
* @param params 请求的参数集合
|
||||||
|
* @return 远程资源的响应结果
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
private String sendPost(String url, Map<String, String> params) {
|
||||||
|
OutputStreamWriter out = null;
|
||||||
|
BufferedReader in = null;
|
||||||
|
StringBuilder result = new StringBuilder();
|
||||||
|
try {
|
||||||
|
URL realUrl = new URL(url);
|
||||||
|
HttpURLConnection conn = (HttpURLConnection) realUrl.openConnection();
|
||||||
|
//发送POST请求必须设置如下两行
|
||||||
|
conn.setDoOutput(true);
|
||||||
|
conn.setDoInput(true);
|
||||||
|
//POST方法
|
||||||
|
conn.setRequestMethod("POST");
|
||||||
|
//设置通用的请求属性
|
||||||
|
conn.setRequestProperty("accept", "*/*");
|
||||||
|
conn.setRequestProperty("connection", "Keep-Alive");
|
||||||
|
conn.setRequestProperty("user-agent",
|
||||||
|
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
|
||||||
|
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
|
||||||
|
conn.connect();
|
||||||
|
//获取URLConnection对象对应的输出流
|
||||||
|
out = new OutputStreamWriter(conn.getOutputStream(), StandardCharsets.UTF_8);
|
||||||
|
//发送请求参数
|
||||||
|
if (params != null) {
|
||||||
|
StringBuilder param = new StringBuilder();
|
||||||
|
for (Map.Entry<String, String> entry : params.entrySet()) {
|
||||||
|
if (param.length() > 0) {
|
||||||
|
param.append("&");
|
||||||
|
}
|
||||||
|
param.append(entry.getKey());
|
||||||
|
param.append("=");
|
||||||
|
param.append(entry.getValue());
|
||||||
|
}
|
||||||
|
out.write(param.toString());
|
||||||
|
}
|
||||||
|
//flush输出流的缓冲
|
||||||
|
out.flush();
|
||||||
|
//定义BufferedReader输入流来读取URL的响应
|
||||||
|
in = new BufferedReader(
|
||||||
|
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8));
|
||||||
|
String line;
|
||||||
|
while ((line = in.readLine()) != null) {
|
||||||
|
result.append(line);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
//使用finally块来关闭输出流、输入流
|
||||||
|
finally {
|
||||||
|
try {
|
||||||
|
if (out != null) {
|
||||||
|
out.close();
|
||||||
|
}
|
||||||
|
if (in != null) {
|
||||||
|
in.close();
|
||||||
|
}
|
||||||
|
} catch (IOException ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static final char[] BASE64_ENCODE_CHARS = new char[]{
|
||||||
|
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
|
||||||
|
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
|
||||||
|
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
|
||||||
|
'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
|
||||||
|
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
|
||||||
|
'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
|
||||||
|
'w', 'x', 'y', 'z', '0', '1', '2', '3',
|
||||||
|
'4', '5', '6', '7', '8', '9', '+', '/'};
|
||||||
|
|
||||||
|
public static String base64Encode(byte[] data) {
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
int len = data.length;
|
||||||
|
int i = 0;
|
||||||
|
int b1, b2, b3;
|
||||||
|
while (i < len) {
|
||||||
|
b1 = data[i++] & 0xff;
|
||||||
|
if (i == len) {
|
||||||
|
sb.append(BASE64_ENCODE_CHARS[b1 >>> 2]);
|
||||||
|
sb.append(BASE64_ENCODE_CHARS[(b1 & 0x3) << 4]);
|
||||||
|
sb.append("==");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
b2 = data[i++] & 0xff;
|
||||||
|
if (i == len) {
|
||||||
|
sb.append(BASE64_ENCODE_CHARS[b1 >>> 2]);
|
||||||
|
sb.append(BASE64_ENCODE_CHARS[((b1 & 0x03) << 4) | ((b2 & 0xf0) >>> 4)]);
|
||||||
|
sb.append(BASE64_ENCODE_CHARS[(b2 & 0x0f) << 2]);
|
||||||
|
sb.append("=");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
b3 = data[i++] & 0xff;
|
||||||
|
sb.append(BASE64_ENCODE_CHARS[b1 >>> 2]);
|
||||||
|
sb.append(BASE64_ENCODE_CHARS[((b1 & 0x03) << 4) | ((b2 & 0xf0) >>> 4)]);
|
||||||
|
sb.append(BASE64_ENCODE_CHARS[((b2 & 0x0f) << 2) | ((b3 & 0xc0) >>> 6)]);
|
||||||
|
sb.append(BASE64_ENCODE_CHARS[b3 & 0x3f]);
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,81 @@
|
|||||||
|
package cn.lili.modules.member.entity.dos;
|
||||||
|
|
||||||
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
|
import cn.lili.modules.member.entity.dto.ClerkAddDTO;
|
||||||
|
import cn.lili.modules.store.entity.dos.Store;
|
||||||
|
import cn.lili.mybatis.BaseEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店员Model
|
||||||
|
*
|
||||||
|
* @author wget
|
||||||
|
* @title: Clerk
|
||||||
|
* @projectName lilishop
|
||||||
|
* @date 2021/12/28 7:39 下午
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("li_clerk")
|
||||||
|
@ApiModel(value = "店员")
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class Clerk extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "店员名称")
|
||||||
|
private String clerkName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "会员ID")
|
||||||
|
private String memberId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "店铺ID")
|
||||||
|
private String storeId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所属部门id")
|
||||||
|
private String departmentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "角色id集合")
|
||||||
|
private String roleIds;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否是店主", hidden = true)
|
||||||
|
private Boolean shopkeeper = false;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否是超级管理员 超级管理员/普通管理员")
|
||||||
|
private Boolean isSuper = false;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态 默认true正常 false禁用")
|
||||||
|
private Boolean status = true;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建店员
|
||||||
|
*
|
||||||
|
* @param clerkAddDTO
|
||||||
|
*/
|
||||||
|
public Clerk(ClerkAddDTO clerkAddDTO) {
|
||||||
|
if (clerkAddDTO.getRoles()!=null && !clerkAddDTO.getRoles().isEmpty()) {
|
||||||
|
this.roleIds = CharSequenceUtil.join(",", clerkAddDTO.getRoles());
|
||||||
|
}
|
||||||
|
this.memberId = clerkAddDTO.getMemberId();
|
||||||
|
this.departmentId = clerkAddDTO.getDepartmentId();
|
||||||
|
this.storeId = clerkAddDTO.getStoreId();
|
||||||
|
this.clerkName = clerkAddDTO.getUsername();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Clerk(Store store){
|
||||||
|
this.memberId = store.getMemberId();
|
||||||
|
this.storeId = store.getId();
|
||||||
|
this.clerkName = store.getMemberName();
|
||||||
|
this.setShopkeeper(true);
|
||||||
|
this.setIsSuper(true);
|
||||||
|
this.setStatus(true);
|
||||||
|
}
|
||||||
|
}
|
@ -101,7 +101,7 @@ public class Member extends BaseEntity {
|
|||||||
this.username = username;
|
this.username = username;
|
||||||
this.password = password;
|
this.password = password;
|
||||||
this.mobile = mobile;
|
this.mobile = mobile;
|
||||||
this.nickName = mobile;
|
this.nickName = "临时昵称";
|
||||||
this.disabled = true;
|
this.disabled = true;
|
||||||
this.haveStore = false;
|
this.haveStore = false;
|
||||||
this.sex = 0;
|
this.sex = 0;
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
package cn.lili.modules.member.entity.dos;
|
package cn.lili.modules.member.entity.dos;
|
||||||
|
|
||||||
import cn.lili.mybatis.BaseEntity;
|
|
||||||
import cn.lili.common.enums.SwitchEnum;
|
import cn.lili.common.enums.SwitchEnum;
|
||||||
|
import cn.lili.common.security.sensitive.Sensitive;
|
||||||
|
import cn.lili.common.security.sensitive.enums.SensitiveStrategy;
|
||||||
import cn.lili.common.utils.StringUtils;
|
import cn.lili.common.utils.StringUtils;
|
||||||
import cn.lili.modules.goods.entity.dos.GoodsSku;
|
import cn.lili.modules.goods.entity.dos.GoodsSku;
|
||||||
import cn.lili.modules.member.entity.dto.MemberEvaluationDTO;
|
import cn.lili.modules.member.entity.dto.MemberEvaluationDTO;
|
||||||
import cn.lili.modules.order.order.entity.dos.Order;
|
import cn.lili.modules.order.order.entity.dos.Order;
|
||||||
|
import cn.lili.mybatis.BaseEntity;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
@ -50,6 +52,7 @@ public class MemberEvaluation extends BaseEntity {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@ApiModelProperty(value = "会员名称")
|
@ApiModelProperty(value = "会员名称")
|
||||||
|
@Sensitive(strategy = SensitiveStrategy.PHONE)
|
||||||
private String memberName;
|
private String memberName;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@ -108,28 +111,28 @@ public class MemberEvaluation extends BaseEntity {
|
|||||||
private Integer descriptionScore;
|
private Integer descriptionScore;
|
||||||
|
|
||||||
|
|
||||||
public MemberEvaluation(MemberEvaluationDTO memberEvaluationDTO, GoodsSku goodsSku, Member member,Order order){
|
public MemberEvaluation(MemberEvaluationDTO memberEvaluationDTO, GoodsSku goodsSku, Member member, Order order) {
|
||||||
//复制评价信息
|
//复制评价信息
|
||||||
BeanUtils.copyProperties(memberEvaluationDTO, this);
|
BeanUtils.copyProperties(memberEvaluationDTO, this);
|
||||||
//设置会员
|
//设置会员
|
||||||
this.memberId=member.getId();
|
this.memberId = member.getId();
|
||||||
//会员名称
|
//会员名称
|
||||||
this.memberName=member.getNickName();
|
this.memberName = member.getNickName();
|
||||||
//设置会员头像
|
//设置会员头像
|
||||||
this.memberProfile=member.getFace();
|
this.memberProfile = member.getFace();
|
||||||
//商品名称
|
//商品名称
|
||||||
this.goodsName=goodsSku.getGoodsName();
|
this.goodsName = goodsSku.getGoodsName();
|
||||||
//商品图片
|
//商品图片
|
||||||
this.goodsImage=goodsSku.getThumbnail();
|
this.goodsImage = goodsSku.getThumbnail();
|
||||||
//设置店铺ID
|
//设置店铺ID
|
||||||
this.storeId=order.getStoreId();
|
this.storeId = order.getStoreId();
|
||||||
//设置店铺名称
|
//设置店铺名称
|
||||||
this.storeName=order.getStoreName();
|
this.storeName = order.getStoreName();
|
||||||
//设置订单编号
|
//设置订单编号
|
||||||
this.orderNo=order.getSn();
|
this.orderNo = order.getSn();
|
||||||
//是否包含图片
|
//是否包含图片
|
||||||
this.haveImage=StringUtils.isNotEmpty(memberEvaluationDTO.getImages());
|
this.haveImage = StringUtils.isNotEmpty(memberEvaluationDTO.getImages());
|
||||||
//默认开启评价
|
//默认开启评价
|
||||||
this.status=SwitchEnum.OPEN.name();
|
this.status = SwitchEnum.OPEN.name();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,6 +1,8 @@
|
|||||||
package cn.lili.modules.member.entity.dos;
|
package cn.lili.modules.member.entity.dos;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.lili.common.security.sensitive.Sensitive;
|
||||||
|
import cn.lili.common.security.sensitive.enums.SensitiveStrategy;
|
||||||
import cn.lili.mybatis.BaseIdEntity;
|
import cn.lili.mybatis.BaseIdEntity;
|
||||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
@ -43,6 +45,8 @@ public class MemberPointsHistory extends BaseIdEntity {
|
|||||||
@ApiModelProperty(value = "会员ID")
|
@ApiModelProperty(value = "会员ID")
|
||||||
private String memberId;
|
private String memberId;
|
||||||
|
|
||||||
|
|
||||||
|
@Sensitive(strategy = SensitiveStrategy.PHONE)
|
||||||
@ApiModelProperty(value = "会员名称")
|
@ApiModelProperty(value = "会员名称")
|
||||||
private String memberName;
|
private String memberName;
|
||||||
|
|
||||||
|
@ -0,0 +1,36 @@
|
|||||||
|
package cn.lili.modules.member.entity.dos;
|
||||||
|
|
||||||
|
import cn.lili.mybatis.BaseIdEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户角色
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020/11/19 12:18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("li_clerk_role")
|
||||||
|
@ApiModel(value = "用户角色")
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class StoreClerkRole extends BaseIdEntity {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "店员唯一id")
|
||||||
|
private String clerkId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "角色唯一id")
|
||||||
|
private String roleId;
|
||||||
|
|
||||||
|
public StoreClerkRole(String clerkId, String roleId) {
|
||||||
|
this.clerkId = clerkId;
|
||||||
|
this.roleId = roleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
|||||||
|
package cn.lili.modules.member.entity.dos;
|
||||||
|
|
||||||
|
import cn.lili.mybatis.BaseEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020/11/19 11:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("li_store_department")
|
||||||
|
@ApiModel(value = "店铺部门")
|
||||||
|
public class StoreDepartment extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@ApiModelProperty(value = "店铺id", hidden = true)
|
||||||
|
private String storeId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "部门名称")
|
||||||
|
@NotEmpty(message = "部门名称不能为空")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "父id")
|
||||||
|
@NotEmpty(message = "父id不能为空")
|
||||||
|
private String parentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序值")
|
||||||
|
private Double sortOrder;
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package cn.lili.modules.member.entity.dos;
|
||||||
|
|
||||||
|
import cn.lili.mybatis.BaseEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色部门绑定关系
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020/11/19 12:18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("li_store_department_role")
|
||||||
|
@ApiModel(value = "店铺角色部门")
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class StoreDepartmentRole extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 2342812932116647050L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "角色id")
|
||||||
|
private String roleId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "部门id")
|
||||||
|
private String departmentId;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package cn.lili.modules.member.entity.dos;
|
||||||
|
|
||||||
|
import cn.lili.mybatis.BaseEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 菜单权限
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020/11/19 12:12
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("li_store_menu")
|
||||||
|
@ApiModel(value = "店铺菜单权限")
|
||||||
|
public class StoreMenu extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 7050744476203495207L;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "路由名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "路径")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单层级")
|
||||||
|
private Integer level;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "前端目录文件")
|
||||||
|
private String frontRoute;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "父id")
|
||||||
|
private String parentId = "0";
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序值")
|
||||||
|
private Double sortOrder;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "权限URL,*号模糊匹配,逗号分割")
|
||||||
|
private String permission;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package cn.lili.modules.member.entity.dos;
|
||||||
|
|
||||||
|
import cn.lili.mybatis.BaseEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色权限绑定关系
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020/11/19 12:18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("li_store_menu_role")
|
||||||
|
@ApiModel(value = "店铺角色权限")
|
||||||
|
public class StoreMenuRole extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -4680260092546996026L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "角色id")
|
||||||
|
private String roleId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜单")
|
||||||
|
private String menuId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "店铺id")
|
||||||
|
private String storeId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否拥有操作数据权限,为否则只有查看权限")
|
||||||
|
private Boolean isSuper;
|
||||||
|
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user