v4.2.5
This commit is contained in:
commit
5a1c6b9e7f
@ -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
|
||||||
|
189783
DB/lilishop.sql
Normal file
189783
DB/lilishop.sql
Normal file
File diff suppressed because one or more lines are too long
2
DB/update.sql
Normal file
2
DB/update.sql
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/** 店铺--默认页面是否开启**/
|
||||||
|
ALTER TABLE li_store ADD page_show bit(1) DEFAULT NULL COMMENT '默认页面是否开启';
|
@ -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', 'lili-floor-renovation/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', 'lili-floor-renovation/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
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
|
@ -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,53 @@ 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 = "获取页面数据")
|
||||||
|
@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);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
package cn.lili.controller.passport;
|
package cn.lili.controller.passport;
|
||||||
|
|
||||||
|
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.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
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.enums.UserEnums;
|
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;
|
||||||
@ -48,6 +52,18 @@ public class MemberBuyerController {
|
|||||||
private SmsUtil smsUtil;
|
private SmsUtil smsUtil;
|
||||||
@Autowired
|
@Autowired
|
||||||
private VerificationService verificationService;
|
private VerificationService verificationService;
|
||||||
|
@Autowired
|
||||||
|
private Cache cache;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "手机号登录")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "mobile", value = "手机号", required = true, paramType = "query")
|
||||||
|
})
|
||||||
|
@PostMapping("/phoneLogin")
|
||||||
|
public ResultMessage<Object> phoneLogin(@NotNull(message = "手机号为空") @RequestParam String mobile) {
|
||||||
|
return ResultUtil.data(memberService.mobilePhoneLogin(mobile));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "web-获取登录二维码")
|
@ApiOperation(value = "web-获取登录二维码")
|
||||||
@ -194,8 +210,13 @@ public class MemberBuyerController {
|
|||||||
//校验短信验证码是否正确
|
//校验短信验证码是否正确
|
||||||
if (smsUtil.verifyCode(mobile, VerificationEnums.FIND_USER, uuid, code)) {
|
if (smsUtil.verifyCode(mobile, VerificationEnums.FIND_USER, uuid, code)) {
|
||||||
//校验是否通过手机号可获取会员,存在则将会员信息存入缓存,有效时间3分钟
|
//校验是否通过手机号可获取会员,存在则将会员信息存入缓存,有效时间3分钟
|
||||||
memberService.findByMobile(uuid, mobile);
|
Member member = memberService.findByMobile(mobile);
|
||||||
|
if (member == null) {
|
||||||
|
throw new ServiceException(ResultCode.USER_NOT_PHONE);
|
||||||
|
}
|
||||||
|
cache.put(CachePrefix.FIND_MOBILE + uuid, mobile, 300L);
|
||||||
return ResultUtil.success();
|
return ResultUtil.success();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new ServiceException(ResultCode.VERIFICATION_SMS_CHECKED_ERROR);
|
throw new ServiceException(ResultCode.VERIFICATION_SMS_CHECKED_ERROR);
|
||||||
}
|
}
|
||||||
@ -226,7 +247,11 @@ public class MemberBuyerController {
|
|||||||
@PutMapping("/modifyPass")
|
@PutMapping("/modifyPass")
|
||||||
public ResultMessage<Member> modifyPass(@NotNull(message = "旧密码不能为空") @RequestParam String password,
|
public ResultMessage<Member> modifyPass(@NotNull(message = "旧密码不能为空") @RequestParam String password,
|
||||||
@NotNull(message = "新密码不能为空") @RequestParam String newPassword) {
|
@NotNull(message = "新密码不能为空") @RequestParam String newPassword) {
|
||||||
return ResultUtil.data(memberService.modifyPass(password, newPassword));
|
AuthUser tokenUser = UserContext.getCurrentUser();
|
||||||
|
if (tokenUser == null) {
|
||||||
|
throw new ServiceException(ResultCode.USER_NOT_LOGIN);
|
||||||
|
}
|
||||||
|
return ResultUtil.data(memberService.modifyPass(tokenUser.getId(), password, newPassword));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "初始设置密码")
|
@ApiOperation(value = "初始设置密码")
|
||||||
|
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,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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>
|
||||||
|
@ -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,
|
||||||
/**
|
/**
|
||||||
* 订单暂时缓存
|
* 订单暂时缓存
|
||||||
*/
|
*/
|
||||||
|
@ -138,7 +138,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, "无法删除当前登录店员"),
|
||||||
/**
|
/**
|
||||||
* 权限
|
* 权限
|
||||||
*/
|
*/
|
||||||
@ -147,6 +154,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, "此手机号码已绑定其他店铺 "),
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分销
|
* 分销
|
||||||
@ -390,7 +401,7 @@ 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, "店铺关闭,请联系管理员"),
|
||||||
|
@ -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)
|
||||||
|
@ -0,0 +1,30 @@
|
|||||||
|
package cn.lili.common.fulu.core;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/26 0026 15:08
|
||||||
|
*/
|
||||||
|
public interface MethodConst {
|
||||||
|
//卡密下单接口method方法
|
||||||
|
String OPEN_API_CARD_ORDER_ADD = "fulu.order.card.add";
|
||||||
|
// 根据话费查询归属地和城市编码,面值,城市等信息
|
||||||
|
String OPEN_API_CHECK_PHONE = "fulu.mobile.info.get";
|
||||||
|
// 直充下单接口method方法
|
||||||
|
String OPEN_API_DIRECT_ORDER_ADD = "fulu.order.direct.add";
|
||||||
|
// 获取商品信息接口method方法
|
||||||
|
String OPEN_API_GOODS_GET = "fulu.goods.info.get";
|
||||||
|
// 获取商品模板信息接口method方法
|
||||||
|
String OPEN_API_GOODS_TEMPLATE_GET = "fulu.goods.template.get";
|
||||||
|
// 查单接口method方法
|
||||||
|
String OPEN_API_ORDER_GET = "fulu.order.info.get";
|
||||||
|
// 话费下单接口method方法
|
||||||
|
String OPEN_API_PHONE_ORDER_ADD = "fulu.order.mobile.add";
|
||||||
|
// 流量下单接口method方法
|
||||||
|
String OPEN_API_TRAFFIC_ORDER_ADD = "fulu.order.data.add";
|
||||||
|
// 获取用户信息接口method方法
|
||||||
|
String OPEN_API_USER_INFO_GET = "fulu.user.info.get";
|
||||||
|
//获取商品列表method方法
|
||||||
|
String OPEN_API_GOODS_LIST = "fulu.goods.list.get";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,58 @@
|
|||||||
|
package cn.lili.common.fulu.core.http;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.lili.common.fulu.core.utils.HttpUtil;
|
||||||
|
|
||||||
|
import java.util.concurrent.Callable;
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 16:16
|
||||||
|
*/
|
||||||
|
public class FuluClient implements IFuluClient {
|
||||||
|
private static volatile ExecutorService executor;
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
public FuluClient() {
|
||||||
|
this.url = "http://openapi.fulu.com/api/getway";
|
||||||
|
}
|
||||||
|
|
||||||
|
public FuluClient(String url) {
|
||||||
|
this.url = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建线程池
|
||||||
|
*/
|
||||||
|
private static void createThreadPool() {
|
||||||
|
if (executor == null) {
|
||||||
|
synchronized (FuluClient.class) {
|
||||||
|
if (executor == null) {
|
||||||
|
executor = Executors.newCachedThreadPool();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String send(final String postData) {
|
||||||
|
String result = HttpUtil.sendPostJson(this.url, postData);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Future<String> sendAsync(final String postData) {
|
||||||
|
createThreadPool();
|
||||||
|
return executor.submit(new Callable<String>() {
|
||||||
|
@Override
|
||||||
|
public String call() throws Exception {
|
||||||
|
String result = HttpUtil.sendPostJson(url, postData);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package cn.lili.common.fulu.core.http;
|
||||||
|
|
||||||
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 16:15
|
||||||
|
*/
|
||||||
|
public interface IFuluClient {
|
||||||
|
/**
|
||||||
|
* 同步请求openapi2.0
|
||||||
|
*
|
||||||
|
* @param postData
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
String send(final String postData);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异步请求openapi2.0
|
||||||
|
*
|
||||||
|
* @param postData
|
||||||
|
* @return Future<String>
|
||||||
|
*/
|
||||||
|
Future<String> sendAsync(final String postData);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
package cn.lili.common.fulu.core.utils;
|
||||||
|
|
||||||
|
import javax.crypto.Cipher;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
import java.security.Security;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/27 0027 17:38
|
||||||
|
*/
|
||||||
|
public class CardUtil {
|
||||||
|
private static final String ALGORITHM = "AES/ECB/PKCS7Padding";
|
||||||
|
|
||||||
|
|
||||||
|
private CardUtil() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String cardDecode(String str, byte[] key) {
|
||||||
|
byte[] bytes = org.apache.commons.codec.binary.Base64.decodeBase64(str);
|
||||||
|
String result = null;
|
||||||
|
try {
|
||||||
|
Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
|
||||||
|
Cipher cipher = Cipher.getInstance(ALGORITHM, "BC");
|
||||||
|
SecretKeySpec keySpec = new SecretKeySpec(key, "AES");
|
||||||
|
cipher.init(Cipher.DECRYPT_MODE, keySpec);
|
||||||
|
byte[] decoded = cipher.doFinal(bytes);
|
||||||
|
result = new String(decoded, "UTF-8");
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String cardEncode(String str, byte[] key) {
|
||||||
|
byte[] result = null;
|
||||||
|
try {
|
||||||
|
Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
|
||||||
|
Cipher cipher = Cipher.getInstance(ALGORITHM, "BC");
|
||||||
|
SecretKeySpec keySpec = new SecretKeySpec(key, "AES");
|
||||||
|
cipher.init(Cipher.ENCRYPT_MODE, keySpec);
|
||||||
|
result = cipher.doFinal(str.getBytes("UTF-8"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
return new String(org.apache.commons.codec.binary.Base64.encodeBase64(result));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package cn.lili.common.fulu.core.utils;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 15:17
|
||||||
|
*/
|
||||||
|
public class DateFormatUtil {
|
||||||
|
private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
||||||
|
|
||||||
|
private DateFormatUtil() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String currentDateTime() {
|
||||||
|
return new SimpleDateFormat(DATE_FORMAT).format(new Date());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,206 @@
|
|||||||
|
package cn.lili.common.fulu.core.utils;
|
||||||
|
|
||||||
|
|
||||||
|
import org.apache.http.HttpResponse;
|
||||||
|
import org.apache.http.NameValuePair;
|
||||||
|
import org.apache.http.client.HttpClient;
|
||||||
|
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||||
|
import org.apache.http.client.methods.HttpPost;
|
||||||
|
import org.apache.http.impl.client.DefaultHttpClient;
|
||||||
|
import org.apache.http.message.BasicNameValuePair;
|
||||||
|
import org.apache.http.protocol.HTTP;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import java.net.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author cheny
|
||||||
|
*/
|
||||||
|
public class HttpUtil {
|
||||||
|
private static Logger log = LoggerFactory.getLogger(HttpUtil.class);
|
||||||
|
|
||||||
|
public final static int CONNECT_TIMEOUT = 10000;
|
||||||
|
public final static int READ_TIMEOUT = 10000;
|
||||||
|
|
||||||
|
private static final String ENCODING_GBK = "GBK";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST请求,json字符串形式数据
|
||||||
|
*
|
||||||
|
* @param url 请求地址
|
||||||
|
* @param param 请求的json数据
|
||||||
|
* @return response body
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static String sendPostJson(String url, String param) {
|
||||||
|
return sendPostWithHeads(url, param, "application/json", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String sendPostWithHeads(String url, String param, String contentType, Map<String, String> heads) {
|
||||||
|
PrintWriter out = null;
|
||||||
|
BufferedReader in = null;
|
||||||
|
StringBuilder result = new StringBuilder();
|
||||||
|
HttpURLConnection conn = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
URL realUrl = new URL(url);
|
||||||
|
// 打开和URL之间的连接
|
||||||
|
conn = (HttpURLConnection) realUrl.openConnection();
|
||||||
|
// 设置通用的请求属性
|
||||||
|
conn.setRequestMethod("POST");// 提交模式
|
||||||
|
conn.setConnectTimeout(CONNECT_TIMEOUT);// 连接超时 单位毫秒
|
||||||
|
conn.setReadTimeout(READ_TIMEOUT);// 读取超时 单位毫秒
|
||||||
|
if (contentType != null && !contentType.isEmpty()) {
|
||||||
|
conn.setRequestProperty("Content-Type", contentType);
|
||||||
|
}
|
||||||
|
conn.setRequestProperty("accept", "*/*");
|
||||||
|
conn.setRequestProperty("connection", "Keep-Alive");
|
||||||
|
conn.setRequestProperty("user-agent",
|
||||||
|
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36");
|
||||||
|
|
||||||
|
// 添加头信息
|
||||||
|
if (heads != null && !heads.isEmpty()) {
|
||||||
|
for (String key : heads.keySet()) {
|
||||||
|
conn.setRequestProperty(key, heads.get(key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 发送POST请求必须设置如下两行
|
||||||
|
conn.setDoOutput(true);
|
||||||
|
conn.setDoInput(true);
|
||||||
|
// 获取URLConnection对象对应的输出流
|
||||||
|
out = new PrintWriter(conn.getOutputStream());
|
||||||
|
// 发送请求参数
|
||||||
|
out.print(param);
|
||||||
|
// flush输出流的缓冲
|
||||||
|
out.flush();
|
||||||
|
// 定义BufferedReader输入流来读取URL的响应
|
||||||
|
in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
|
||||||
|
String line;
|
||||||
|
while ((line = in.readLine()) != null) {
|
||||||
|
result.append(line);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new RuntimeException("send POST request exception :" + e.getMessage(), e);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if (out != null) {
|
||||||
|
out.close();
|
||||||
|
}
|
||||||
|
if (in != null) {
|
||||||
|
in.close();
|
||||||
|
}
|
||||||
|
if (conn != null) {
|
||||||
|
conn.disconnect();
|
||||||
|
}
|
||||||
|
} catch (Exception e2) {
|
||||||
|
throw new RuntimeException("close Connection exception :" + e2.getMessage(), e2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST请求,String字符串形式数据
|
||||||
|
*
|
||||||
|
* @param url
|
||||||
|
* @param paramXmlStr
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String sendPostXmlStr(String url, String paramXmlStr) {
|
||||||
|
String tmpparamXmlStr = "";
|
||||||
|
try {
|
||||||
|
tmpparamXmlStr = URLEncoder.encode(paramXmlStr, ENCODING_GBK);
|
||||||
|
tmpparamXmlStr = sendPostWithHeads(url, tmpparamXmlStr, "application/xml", null);
|
||||||
|
tmpparamXmlStr = URLDecoder.decode(tmpparamXmlStr,ENCODING_GBK);
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
log.error("post请求URL数据转码报错,{}", e.getMessage());
|
||||||
|
}
|
||||||
|
return tmpparamXmlStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST请求,String字符串形式数据
|
||||||
|
*
|
||||||
|
* @param url
|
||||||
|
* @param paramXmlStr
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String sendPostXmlUrlencode(String url, String paramXmlStr) {
|
||||||
|
String tmpparamXmlStr = "";
|
||||||
|
Map<String, String> rspMap = new LinkedHashMap<>();
|
||||||
|
rspMap.put("req", paramXmlStr);
|
||||||
|
|
||||||
|
try {
|
||||||
|
tmpparamXmlStr = URLEncoder.encode(paramXmlStr, ENCODING_GBK);
|
||||||
|
tmpparamXmlStr = doPostMapParams(url, rspMap);
|
||||||
|
tmpparamXmlStr = URLDecoder.decode(tmpparamXmlStr,ENCODING_GBK);
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
log.error("post请求URL数据转码报错,{}", e.getMessage());
|
||||||
|
}
|
||||||
|
return tmpparamXmlStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送POST请求
|
||||||
|
* @param url String对象为 目的地址
|
||||||
|
* @param parameters 请求参数,Map类型。
|
||||||
|
* @return 远程响应结果
|
||||||
|
*/
|
||||||
|
public static String doPostMapParams(String url, Map<String, String> parameters) {
|
||||||
|
|
||||||
|
BufferedReader in = null;
|
||||||
|
try {
|
||||||
|
// 定义HttpClient
|
||||||
|
HttpClient client = new DefaultHttpClient();
|
||||||
|
// 实例化HTTP方法
|
||||||
|
HttpPost request = new HttpPost();
|
||||||
|
request.setURI(new URI(url));
|
||||||
|
|
||||||
|
//设置参数
|
||||||
|
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
|
||||||
|
for (Iterator iter = parameters.keySet().iterator(); iter.hasNext();) {
|
||||||
|
String name = (String) iter.next();
|
||||||
|
String value = String.valueOf(parameters.get(name));
|
||||||
|
nvps.add(new BasicNameValuePair(name, value));
|
||||||
|
}
|
||||||
|
request.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));
|
||||||
|
|
||||||
|
HttpResponse response = client.execute(request);
|
||||||
|
int code = response.getStatusLine().getStatusCode();
|
||||||
|
if(code == 200){ //请求成功
|
||||||
|
in = new BufferedReader(new InputStreamReader(response.getEntity()
|
||||||
|
.getContent(),"UTF-8"));
|
||||||
|
StringBuffer sb = new StringBuffer("");
|
||||||
|
String line = "";
|
||||||
|
String NL = System.getProperty("line.separator");
|
||||||
|
while ((line = in.readLine()) != null) {
|
||||||
|
sb.append(line + NL);
|
||||||
|
}
|
||||||
|
|
||||||
|
in.close();
|
||||||
|
return sb.toString();
|
||||||
|
}else{
|
||||||
|
System.out.println("状态码:" + code);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
package cn.lili.common.fulu.core.utils;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
public class JSONUtil {
|
||||||
|
private static Gson gson = new Gson();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将 JSON 字符串转为 Java 对象
|
||||||
|
*/
|
||||||
|
public static <T> T fromJSON(String json, Class<T> type) {
|
||||||
|
T obj;
|
||||||
|
try {
|
||||||
|
obj = gson.fromJson(json, type);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* json字符串转list或者map
|
||||||
|
*/
|
||||||
|
public static <T> T fromJSON(String json, TypeToken<T> typeToken) {
|
||||||
|
return gson.fromJson(json, typeToken.getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将 Java 对象转为 JSON 字符串
|
||||||
|
*/
|
||||||
|
public static <T> String toJSON(T obj) {
|
||||||
|
String jsonStr;
|
||||||
|
try {
|
||||||
|
jsonStr = gson.toJson(obj);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return jsonStr;
|
||||||
|
}
|
||||||
|
}
|
342
framework/src/main/java/cn/lili/common/fulu/core/utils/Test.java
Normal file
342
framework/src/main/java/cn/lili/common/fulu/core/utils/Test.java
Normal file
@ -0,0 +1,342 @@
|
|||||||
|
package cn.lili.common.fulu.core.utils;
|
||||||
|
|
||||||
|
import cn.lili.common.fulu.core.MethodConst;
|
||||||
|
import cn.lili.common.fulu.model.*;
|
||||||
|
import cn.lili.common.fulu.sdk.DefaultOpenApiClient;
|
||||||
|
import cn.lili.modules.store.entity.dto.FuLuConfigureDTO;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.concurrent.*;
|
||||||
|
|
||||||
|
public class Test {
|
||||||
|
private final static String APP_KEY = "lzHi7ewuTkplx2ePX0eQzN65TIFRk1zFClcoj1Jim/MHmu0X7ZqxMtSLENhvr1xD";
|
||||||
|
private final static Logger LOGGER = LoggerFactory.getLogger(Test.class);
|
||||||
|
private final static String SYS_SECRET = "9da68b0f8bcb470e84c3d30e343727e2";
|
||||||
|
private final static String URL = "http://openapi.fulu.com/api/getway";
|
||||||
|
|
||||||
|
// private final static String APP_KEY = "i4esv1l+76l/7NQCL3QudG90Fq+YgVfFGJAWgT+7qO1Bm9o/adG/1iwO2qXsAXNB";
|
||||||
|
// private final static Logger LOGGER = LoggerFactory.getLogger(Test.class);
|
||||||
|
// private final static String SYS_SECRET = "0a091b3aa4324435aab703142518a8f7";
|
||||||
|
// private final static String URL = "http://pre.openapi.fulu.com/api/getway";
|
||||||
|
|
||||||
|
private static String repeat(String ch, int num) {
|
||||||
|
StringBuilder str = new StringBuilder();
|
||||||
|
for (int i = 0; i < num; i++) {
|
||||||
|
str.append(ch);
|
||||||
|
}
|
||||||
|
return str.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void waitFor(Future<String> future) throws Exception {
|
||||||
|
while (!future.isDone()) {
|
||||||
|
TimeUnit.MILLISECONDS.sleep(500);
|
||||||
|
}
|
||||||
|
LOGGER.info("excuteAsync:\n{}", future.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡密下单
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static void cardOrderAddTest(FuLuConfigureDTO fuLuConfigureDTO, Integer productId, Integer buyNum,String orderSn) throws Exception {
|
||||||
|
LOGGER.info("\n卡密下单{}", repeat("=", 100));
|
||||||
|
DefaultOpenApiClient client =
|
||||||
|
new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_CARD_ORDER_ADD);
|
||||||
|
InputCardOrderDto dto = new InputCardOrderDto();
|
||||||
|
dto.setProductId(productId);
|
||||||
|
dto.setCustomerOrderNo(orderSn);
|
||||||
|
dto.setBuyNum(buyNum);
|
||||||
|
|
||||||
|
client.setBizObject(dto);
|
||||||
|
LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100));
|
||||||
|
dto.setCustomerOrderNo(UUID.randomUUID().toString());
|
||||||
|
waitFor(client.excuteAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直充下单
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static void directOrderAddTest(FuLuConfigureDTO fuLuConfigureDTO, Integer productId, Integer buyNum,String qrCode,String orderSn) throws Exception {
|
||||||
|
LOGGER.info("\n直充下单{}", repeat("=", 100));
|
||||||
|
DefaultOpenApiClient client =
|
||||||
|
new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_DIRECT_ORDER_ADD);
|
||||||
|
InputDirectOrderDto dto = new InputDirectOrderDto();
|
||||||
|
dto.setProductId(productId);
|
||||||
|
dto.setBuyNum(buyNum);
|
||||||
|
client.setBizObject(dto);
|
||||||
|
int count = 1;
|
||||||
|
|
||||||
|
for (String chargeAccount : Arrays.asList(qrCode)) {
|
||||||
|
dto.setChargeAccount(chargeAccount);
|
||||||
|
dto.setCustomerOrderNo(orderSn);
|
||||||
|
|
||||||
|
LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100));
|
||||||
|
if (count++ >= 3) {
|
||||||
|
waitFor(client.excuteAsync());
|
||||||
|
} else {
|
||||||
|
LOGGER.info("excuteAsync:\n{}\n{}", client.excuteAsync().get(), repeat("-", 100));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号归属地
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void matchPhoneProducGetTest(FuLuConfigureDTO fuLuConfigureDTO) throws Exception {
|
||||||
|
LOGGER.info("\n手机号归属地{}", repeat("=", 100));
|
||||||
|
DefaultOpenApiClient client = new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_CHECK_PHONE);
|
||||||
|
InputMatchPhoneProductListDto dto = new InputMatchPhoneProductListDto();
|
||||||
|
dto.setFaceValue(50D);
|
||||||
|
|
||||||
|
int count = 1;
|
||||||
|
for (String phone : Arrays.asList("15972368779", "13971553804")) {
|
||||||
|
dto.setPhone(phone);
|
||||||
|
|
||||||
|
client.setBizObject(dto);
|
||||||
|
|
||||||
|
LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100));
|
||||||
|
if (count++ >= 2) {
|
||||||
|
waitFor(client.excuteAsync());
|
||||||
|
} else {
|
||||||
|
LOGGER.info("excuteAsync:\n{}\n{}", client.excuteAsync().get(), repeat("-", 100));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单查单
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void orderInfoGetTest(FuLuConfigureDTO fuLuConfigureDTO) throws Exception {
|
||||||
|
LOGGER.info("\n订单查单{}", repeat("=", 100));
|
||||||
|
DefaultOpenApiClient client = new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_ORDER_GET);
|
||||||
|
InputOrderGetDto dto = new InputOrderGetDto();
|
||||||
|
client.setBizObject(dto);
|
||||||
|
int count = 1;
|
||||||
|
|
||||||
|
for (String customerOrderNo : Arrays
|
||||||
|
.asList("0d19f8e4-5af3-490d-a8d8-47fd457da7de", "31b6b96b-a21e-4bc4-bc0c-6e77a2ffb698")) {
|
||||||
|
dto.setCustomerOrderNo(customerOrderNo);
|
||||||
|
|
||||||
|
LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100));
|
||||||
|
if (count++ >= 2) {
|
||||||
|
Future<String> future = client.excuteAsync();
|
||||||
|
waitFor(future);
|
||||||
|
Map<String, String> result = JSONUtil.fromJSON(future.get(), new TypeToken<Map>() {
|
||||||
|
});
|
||||||
|
Map<String, Object> resultMap = JSONUtil.fromJSON(result.get("result"), new TypeToken<Map<String, Object>>() {
|
||||||
|
});
|
||||||
|
|
||||||
|
List<Map<String, String>> cardList = (List<Map<String, String>>) resultMap.get("cards");
|
||||||
|
StringBuilder decodeStr = new StringBuilder();
|
||||||
|
for (Map<String, String> map : cardList) {
|
||||||
|
decodeStr.append("card_number:").append(map.get("card_number")).append(";desc_card_number:")
|
||||||
|
.append(CardUtil.cardDecode(map.get("card_number"), SYS_SECRET.getBytes("UTF-8")));
|
||||||
|
decodeStr.append(" card_pwd:").append(map.get("card_pwd")).append(";card_pwd:")
|
||||||
|
.append(CardUtil.cardDecode(map.get("card_pwd"), SYS_SECRET.getBytes("UTF-8")));
|
||||||
|
decodeStr.append("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println(decodeStr.toString());
|
||||||
|
System.out.println(CardUtil.cardEncode("CD10002502019061217430016421", SYS_SECRET.getBytes("UTF-8")));
|
||||||
|
} else {
|
||||||
|
LOGGER.info("excuteAsync:\n{}\n{}", client.excuteAsync().get(), repeat("-", 100));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 话费下单
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void phoneOrderAddTest(FuLuConfigureDTO fuLuConfigureDTO) throws Exception {
|
||||||
|
LOGGER.info("\n话费下单{}", repeat("=", 100));
|
||||||
|
DefaultOpenApiClient client =
|
||||||
|
new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_PHONE_ORDER_ADD);
|
||||||
|
InputPhoneOrderDto dto = new InputPhoneOrderDto();
|
||||||
|
dto.setChargeValue(Double.valueOf(50));
|
||||||
|
int count = 1;
|
||||||
|
|
||||||
|
for (String chargePhone : Arrays.asList("15972368779", "13971553804")) {
|
||||||
|
dto.setCustomerOrderNo(UUID.randomUUID().toString());
|
||||||
|
dto.setChargePhone(chargePhone);
|
||||||
|
client.setBizObject(dto);
|
||||||
|
|
||||||
|
LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100));
|
||||||
|
dto.setCustomerOrderNo(UUID.randomUUID().toString());
|
||||||
|
if (count++ >= 2) {
|
||||||
|
waitFor(client.excuteAsync());
|
||||||
|
} else {
|
||||||
|
LOGGER.info("excuteAsync:\n{}\n{}", client.excuteAsync().get(), repeat("-", 100));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得商品信息
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static Map<String, Object> productInfoGetTest(FuLuConfigureDTO fuLuConfigureDTO,String productIdS) throws Exception {
|
||||||
|
LOGGER.info("\n获得商品信息{}", repeat("=", 100));
|
||||||
|
DefaultOpenApiClient client = new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_GOODS_GET);
|
||||||
|
InputProductDto dto = new InputProductDto();
|
||||||
|
int count = 1;
|
||||||
|
Map<String, Object> maps = new HashMap();
|
||||||
|
for (String productId : Arrays.asList(productIdS)) {
|
||||||
|
dto.setProductId(productId);
|
||||||
|
client.setBizObject(dto);
|
||||||
|
maps = (Map) JSON.parse(client.excute());
|
||||||
|
LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100));
|
||||||
|
if (count++ >= 10) {
|
||||||
|
waitFor(client.excuteAsync());
|
||||||
|
} else {
|
||||||
|
LOGGER.info("excuteAsync:\n{}\n{}", client.excuteAsync().get(), repeat("-", 100));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return maps;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得商品模板信息
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void productTemplateGetTest(FuLuConfigureDTO fuLuConfigureDTO) throws Exception {
|
||||||
|
LOGGER.info("\n获得商品模板信息{}", repeat("=", 100));
|
||||||
|
DefaultOpenApiClient client =
|
||||||
|
new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_GOODS_TEMPLATE_GET);
|
||||||
|
InputProductTemplateDto dto = new InputProductTemplateDto();
|
||||||
|
dto.setTemplateId("e1dac0ea-dc86-4c9d-a778-c9e19203ecb8");
|
||||||
|
client.setBizObject(dto);
|
||||||
|
LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100));
|
||||||
|
waitFor(client.excuteAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流量下单
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void trafficOrderAddTest(FuLuConfigureDTO fuLuConfigureDTO) throws Exception {
|
||||||
|
LOGGER.info("\n流量下单{}", repeat("=", 100));
|
||||||
|
DefaultOpenApiClient client =
|
||||||
|
new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_TRAFFIC_ORDER_ADD);
|
||||||
|
InputTrafficOrderDto dto = new InputTrafficOrderDto();
|
||||||
|
dto.setChargeValue(Double.valueOf(1024));
|
||||||
|
dto.setPacketKind(4);
|
||||||
|
|
||||||
|
int count = 1;
|
||||||
|
for (String chargePhone : Arrays.asList("15972368779", "13971553804")) {
|
||||||
|
client.setBizObject(dto);
|
||||||
|
dto.setChargePhone(chargePhone);
|
||||||
|
dto.setCustomerOrderNo(UUID.randomUUID().toString());
|
||||||
|
|
||||||
|
LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100));
|
||||||
|
dto.setCustomerOrderNo(UUID.randomUUID().toString());
|
||||||
|
if (count++ >= 2) {
|
||||||
|
waitFor(client.excuteAsync());
|
||||||
|
} else {
|
||||||
|
LOGGER.info("excuteAsync:\n{}\n{}", client.excuteAsync().get(), repeat("-", 100));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户信息
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static void userInfoGetTest(FuLuConfigureDTO fuLuConfigureDTO) throws Exception {
|
||||||
|
LOGGER.info("\n用户信息{}", repeat("=", 100));
|
||||||
|
DefaultOpenApiClient client =
|
||||||
|
new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_USER_INFO_GET);
|
||||||
|
InputUserDto dto = new InputUserDto();
|
||||||
|
client.setBizObject(dto);
|
||||||
|
|
||||||
|
LOGGER.info("excute:\n{}\n{}", client.excute(), repeat("-", 100));
|
||||||
|
waitFor(client.excuteAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户信息:高并发场景
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static void userInfoGetTest2(FuLuConfigureDTO fuLuConfigureDTO) throws Exception {
|
||||||
|
LOGGER.info("\n用户信息:高并发场景{}", repeat("=", 100));
|
||||||
|
Executor executor = Executors.newCachedThreadPool();
|
||||||
|
|
||||||
|
final int count = 10;
|
||||||
|
final CountDownLatch downLatch = new CountDownLatch(count);
|
||||||
|
|
||||||
|
for (int i = 0; i < count; ++i) {
|
||||||
|
executor.execute(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
String name = Thread.currentThread().getName();
|
||||||
|
LOGGER.info("\n线程名:{}{}", name, repeat("+", 100));
|
||||||
|
|
||||||
|
DefaultOpenApiClient client =
|
||||||
|
new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_USER_INFO_GET);
|
||||||
|
InputUserDto dto = new InputUserDto();
|
||||||
|
client.setBizObject(dto);
|
||||||
|
|
||||||
|
LOGGER.info("\n线程名:{}\n{}\n{}", name, client.excute(), repeat("+", 100));
|
||||||
|
waitFor(client.excuteAsync());
|
||||||
|
} catch (Exception ex) {
|
||||||
|
LOGGER.error(ex.getMessage(), ex);
|
||||||
|
} finally {
|
||||||
|
downLatch.countDown();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
downLatch.await();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* 获得商品信息列表
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static String getGoodsInfoList(FuLuConfigureDTO fuLuConfigureDTO) throws Exception {
|
||||||
|
LOGGER.info("\n获得商品信息{}", repeat("=", 100));
|
||||||
|
DefaultOpenApiClient client = new DefaultOpenApiClient(URL, fuLuConfigureDTO.getAppMerchantKey(), fuLuConfigureDTO.getAppSecretKey(), MethodConst.OPEN_API_GOODS_LIST);
|
||||||
|
InputProductDto dto = new InputProductDto();
|
||||||
|
client.setBizObject(dto);
|
||||||
|
return client.excute().toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
try {
|
||||||
|
// productInfoGetTest();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,159 @@
|
|||||||
|
package cn.lili.common.fulu.model;
|
||||||
|
|
||||||
|
import cn.lili.common.fulu.core.utils.DateFormatUtil;
|
||||||
|
import cn.lili.common.fulu.core.utils.JSONUtil;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 10:49
|
||||||
|
*/
|
||||||
|
public class CommonRequest implements Serializable {
|
||||||
|
private static final long serialVersionUID = 2L;
|
||||||
|
|
||||||
|
@SerializedName(value = "app_auth_token")
|
||||||
|
private String appAuthToken = "";
|
||||||
|
@SerializedName(value = "app_key")
|
||||||
|
private String appKey;
|
||||||
|
@SerializedName(value = "biz_content")
|
||||||
|
private String bizContent = "{}";
|
||||||
|
private transient Map<String, Object> bizContentMap = Collections.emptyMap();
|
||||||
|
private String charset;
|
||||||
|
private String format;
|
||||||
|
private String method;
|
||||||
|
private String sign;
|
||||||
|
@SerializedName(value = "sign_type")
|
||||||
|
private String signType;
|
||||||
|
private String timestamp;
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
public CommonRequest() {
|
||||||
|
format = "json";
|
||||||
|
version = "2.0";
|
||||||
|
charset = "utf-8";
|
||||||
|
signType = "md5";
|
||||||
|
// timestamp = "2019-08-20 13:59:38";
|
||||||
|
timestamp = DateFormatUtil.currentDateTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getAppAuthToken() {
|
||||||
|
return appAuthToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppAuthToken(String appAuthToken) {
|
||||||
|
this.appAuthToken = appAuthToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppKey() {
|
||||||
|
return appKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppKey(String appKey) {
|
||||||
|
this.appKey = appKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBizContent() {
|
||||||
|
if (!bizContentMap.isEmpty()) {
|
||||||
|
bizContent = JSONUtil.toJSON(bizContentMap);
|
||||||
|
}
|
||||||
|
return bizContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直接将变量以json格式保存
|
||||||
|
*
|
||||||
|
* @param bizContent bizContent
|
||||||
|
*/
|
||||||
|
public void setBizContent(String bizContent) {
|
||||||
|
if (bizContent != null && !"".equals(bizContent.trim())) {
|
||||||
|
Map<String, Object> dataMap = JSONUtil.fromJSON(bizContent, new TypeToken<Map<String, Object>>() {
|
||||||
|
});
|
||||||
|
|
||||||
|
if (bizContentMap.isEmpty()) {
|
||||||
|
bizContentMap = new HashMap<String, Object>();
|
||||||
|
}
|
||||||
|
bizContentMap.putAll(dataMap);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCharset() {
|
||||||
|
return charset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCharset(String charset) {
|
||||||
|
this.charset = charset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFormat() {
|
||||||
|
return format;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFormat(String format) {
|
||||||
|
this.format = format;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMethod() {
|
||||||
|
return method;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMethod(String method) {
|
||||||
|
this.method = method;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSign() {
|
||||||
|
return sign;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSign(String sign) {
|
||||||
|
this.sign = sign;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSignType() {
|
||||||
|
return signType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSignType(String signType) {
|
||||||
|
this.signType = signType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTimestamp() {
|
||||||
|
return timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTimestamp(String timestamp) {
|
||||||
|
this.timestamp = timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVersion() {
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVersion(String version) {
|
||||||
|
this.version = version;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 以key:value形式保存,程序会转换为json格式
|
||||||
|
*
|
||||||
|
* @param key key
|
||||||
|
* @param value value
|
||||||
|
*/
|
||||||
|
public void setBizContent(String key, Object value) {
|
||||||
|
if (bizContentMap.isEmpty()) {
|
||||||
|
bizContentMap = new HashMap<String, Object>();
|
||||||
|
}
|
||||||
|
bizContentMap.put(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Object getBizContentValue(String key) {
|
||||||
|
return bizContentMap.get(key);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package cn.lili.common.fulu.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡密订单input dto
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 15:35
|
||||||
|
*/
|
||||||
|
public class InputCardOrderDto extends CommonRequest {
|
||||||
|
public InputCardOrderDto() {
|
||||||
|
super();
|
||||||
|
setMethod("fulu.order.card.add");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 购买数量
|
||||||
|
*
|
||||||
|
* @return Integer
|
||||||
|
*/
|
||||||
|
public Integer getBuyNum() {
|
||||||
|
Object value = getBizContentValue("buy_num");
|
||||||
|
return value != null ? Integer.valueOf(value.toString()) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBuyNum(Integer buyNum) {
|
||||||
|
setBizContent("buy_num", buyNum);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部订单号
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getCustomerOrderNo() {
|
||||||
|
Object value = getBizContentValue("customer_order_no");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomerOrderNo(String customerOrderNo) {
|
||||||
|
setBizContent("customer_order_no", customerOrderNo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品编号
|
||||||
|
*
|
||||||
|
* @return Integer
|
||||||
|
*/
|
||||||
|
public Integer getProductId() {
|
||||||
|
Object value = getBizContentValue("product_id");
|
||||||
|
return value != null ? Integer.valueOf(value.toString()) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductId(Integer productId) {
|
||||||
|
setBizContent("product_id", productId);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,213 @@
|
|||||||
|
package cn.lili.common.fulu.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 直充商品订单input dto
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 15:39
|
||||||
|
*/
|
||||||
|
public class InputDirectOrderDto extends CommonRequest {
|
||||||
|
|
||||||
|
public InputDirectOrderDto() {
|
||||||
|
super();
|
||||||
|
setMethod("fulu.order.direct.add");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 购买数量
|
||||||
|
*
|
||||||
|
* @return Integer
|
||||||
|
*/
|
||||||
|
public Integer getBuyNum() {
|
||||||
|
Object value = getBizContentValue("buy_num");
|
||||||
|
return value != null ? Integer.valueOf(value.toString()) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBuyNum(Integer buyNum) {
|
||||||
|
setBizContent("buy_num", buyNum);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值账号
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getChargeAccount() {
|
||||||
|
Object value = getBizContentValue("charge_account");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargeAccount(String chargeAccount) {
|
||||||
|
setBizContent("charge_account", chargeAccount);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值游戏名称
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getChargeGameName() {
|
||||||
|
Object value = getBizContentValue("charge_game_name");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargeGameName(String chargeGameName) {
|
||||||
|
setBizContent("charge_game_name", chargeGameName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值游戏区
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getChargeGameRegion() {
|
||||||
|
Object value = getBizContentValue("charge_game_region");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargeGameRegion(String chargeGameRegion) {
|
||||||
|
setBizContent("charge_game_region", chargeGameRegion);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值游戏角色
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getChargeGameRole() {
|
||||||
|
Object value = getBizContentValue("charge_game_role");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargeGameRole(String chargeGameRole) {
|
||||||
|
setBizContent("charge_game_role", chargeGameRole);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值游戏服
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getChargeGameSrv() {
|
||||||
|
Object value = getBizContentValue("charge_game_srv");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargeGameSrv(String chargeGameSrv) {
|
||||||
|
setBizContent("charge_game_srv", chargeGameSrv);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下单真实Ip,区域商品要传
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getChargeIp() {
|
||||||
|
Object value = getBizContentValue("charge_ip");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargeIp(String chargeIp) {
|
||||||
|
setBizContent("charge_ip", chargeIp);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值密码,部分游戏类要传
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getChargePassword() {
|
||||||
|
Object value = getBizContentValue("charge_password");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargePassword(String chargePassword) {
|
||||||
|
setBizContent("charge_password", chargePassword);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值类型
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getChargeType() {
|
||||||
|
Object value = getBizContentValue("charge_type");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargeType(String chargeType) {
|
||||||
|
setBizContent("charge_type", chargeType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系QQ
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getContactQq() {
|
||||||
|
Object value = getBizContentValue("contact_qq");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContactQq(String contactQq) {
|
||||||
|
setBizContent("contact_qq", contactQq);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系电话
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getContactTel() {
|
||||||
|
Object value = getBizContentValue("contact_tel");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContactTel(String contactTel) {
|
||||||
|
setBizContent("contact_tel", contactTel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部订单号
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getCustomerOrderNo() {
|
||||||
|
Object value = getBizContentValue("customer_order_no");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomerOrderNo(String customerOrderNo) {
|
||||||
|
setBizContent("customer_order_no", customerOrderNo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品编号
|
||||||
|
*
|
||||||
|
* @return Integer
|
||||||
|
*/
|
||||||
|
public Integer getProductId() {
|
||||||
|
Object value = getBizContentValue("product_id");
|
||||||
|
return value != null ? Integer.valueOf(value.toString()) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductId(Integer productId) {
|
||||||
|
setBizContent("product_id", productId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 剩余数量
|
||||||
|
*
|
||||||
|
* @return Integer
|
||||||
|
*/
|
||||||
|
public Integer getRemainingNumber() {
|
||||||
|
Object value = getBizContentValue("remaining_number");
|
||||||
|
return value != null ? Integer.valueOf(value.toString()) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemainingNumber(Integer remainingNumber) {
|
||||||
|
setBizContent("remaining_number", remainingNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package cn.lili.common.fulu.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号归属地input dto
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 16:08
|
||||||
|
*/
|
||||||
|
public class InputMatchPhoneProductListDto extends CommonRequest {
|
||||||
|
|
||||||
|
public InputMatchPhoneProductListDto() {
|
||||||
|
super();
|
||||||
|
setMethod("fulu.mobile.info.get");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 面值
|
||||||
|
*
|
||||||
|
* @return Double
|
||||||
|
*/
|
||||||
|
public Double getFaceValue() {
|
||||||
|
Object value = getBizContentValue("face_value");
|
||||||
|
return value != null ? Double.valueOf(value.toString()) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFaceValue(Double faceValue) {
|
||||||
|
setBizContent("face_value", faceValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getPhone() {
|
||||||
|
Object value = getBizContentValue("phone");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPhone(String phone) {
|
||||||
|
setBizContent("phone", phone);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package cn.lili.common.fulu.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单查单input dto
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 15:23
|
||||||
|
*/
|
||||||
|
public class InputOrderGetDto extends CommonRequest {
|
||||||
|
|
||||||
|
public InputOrderGetDto() {
|
||||||
|
super();
|
||||||
|
setMethod("fulu.order.info.get");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部订单号
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getCustomerOrderNo() {
|
||||||
|
Object value = getBizContentValue("customer_order_no");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomerOrderNo(String customerOrderNo) {
|
||||||
|
setBizContent("customer_order_no", customerOrderNo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
package cn.lili.common.fulu.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 话费订单input dto
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 15:31
|
||||||
|
*/
|
||||||
|
public class InputPhoneOrderDto extends CommonRequest {
|
||||||
|
|
||||||
|
public InputPhoneOrderDto() {
|
||||||
|
super();
|
||||||
|
setMethod("fulu.order.mobile.add");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值手机号
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getChargePhone() {
|
||||||
|
Object value = getBizContentValue("charge_phone");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargePhone(String chargePhone) {
|
||||||
|
setBizContent("charge_phone", chargePhone);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值数额
|
||||||
|
*
|
||||||
|
* @return Double
|
||||||
|
*/
|
||||||
|
public Double getChargeValue() {
|
||||||
|
Object value = getBizContentValue("charge_value");
|
||||||
|
return value != null ? Double.valueOf(value.toString()) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargeValue(Double chargeValue) {
|
||||||
|
setBizContent("charge_value", chargeValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部订单号
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getCustomerOrderNo() {
|
||||||
|
Object value = getBizContentValue("customer_order_no");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomerOrderNo(String customerOrderNo) {
|
||||||
|
setBizContent("customer_order_no", customerOrderNo);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package cn.lili.common.fulu.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品信息input dto
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 16:04
|
||||||
|
*/
|
||||||
|
public class InputProductDto extends CommonRequest {
|
||||||
|
|
||||||
|
public InputProductDto() {
|
||||||
|
super();
|
||||||
|
setMethod("fulu.goods.info.get");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品编号
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getProductId() {
|
||||||
|
Object value = getBizContentValue("product_id");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductId(String productId) {
|
||||||
|
setBizContent("product_id", productId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
package cn.lili.common.fulu.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品模板信息input dto
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 16:01
|
||||||
|
*/
|
||||||
|
public class InputProductTemplateDto extends CommonRequest {
|
||||||
|
|
||||||
|
public InputProductTemplateDto() {
|
||||||
|
super();
|
||||||
|
setMethod("fulu.goods.template.get");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品模板编号
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getTemplateId() {
|
||||||
|
Object value = getBizContentValue("template_id");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTemplateId(String templateId) {
|
||||||
|
setBizContent("template_id", templateId);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
package cn.lili.common.fulu.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流量订单input dto
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 13:50
|
||||||
|
*/
|
||||||
|
public class InputTrafficOrderDto extends CommonRequest {
|
||||||
|
|
||||||
|
public InputTrafficOrderDto() {
|
||||||
|
super();
|
||||||
|
setMethod("fulu.order.data.add");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值手机号
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getChargePhone() {
|
||||||
|
Object value = getBizContentValue("charge_phone");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargePhone(String chargePhone) {
|
||||||
|
setBizContent("charge_phone", chargePhone);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值数额(M)
|
||||||
|
*
|
||||||
|
* @return Double
|
||||||
|
*/
|
||||||
|
public Double getChargeValue() {
|
||||||
|
Object value = getBizContentValue("charge_value");
|
||||||
|
return value != null ? Double.valueOf(value.toString()) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChargeValue(Double chargeValue) {
|
||||||
|
setBizContent("charge_value", chargeValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部订单号
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getCustomerOrderNo() {
|
||||||
|
Object value = getBizContentValue("customer_order_no");
|
||||||
|
return value != null ? String.valueOf(value) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomerOrderNo(String customerOrderNo) {
|
||||||
|
setBizContent("customer_order_no", customerOrderNo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流量性质 1:小时 2:日 3:7天 4:月 5:季度 6:半年 7:年
|
||||||
|
*
|
||||||
|
* @return Integer
|
||||||
|
*/
|
||||||
|
public Integer getPacketKind() {
|
||||||
|
Object value = getBizContentValue("packet_kind");
|
||||||
|
return value != null ? Integer.valueOf(value.toString()) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPacketKind(Integer packetKind) {
|
||||||
|
setBizContent("packet_kind", packetKind);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package cn.lili.common.fulu.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户信息input dto
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 16:06
|
||||||
|
*/
|
||||||
|
public class InputUserDto extends CommonRequest {
|
||||||
|
|
||||||
|
public InputUserDto() {
|
||||||
|
super();
|
||||||
|
setMethod("fulu.user.info.get");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package cn.lili.common.fulu.model.response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 响应对象
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 15:06
|
||||||
|
*/
|
||||||
|
public class DefaultClientResponse {
|
||||||
|
private String code;
|
||||||
|
private String message;
|
||||||
|
private String result;
|
||||||
|
private String sign;
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMessage(String message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getResult() {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResult(String result) {
|
||||||
|
this.result = result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSign() {
|
||||||
|
return sign;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSign(String sign) {
|
||||||
|
this.sign = sign;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,129 @@
|
|||||||
|
package cn.lili.common.fulu.sdk;
|
||||||
|
|
||||||
|
import cn.lili.common.fulu.core.http.FuluClient;
|
||||||
|
import cn.lili.common.fulu.core.http.IFuluClient;
|
||||||
|
import cn.lili.common.fulu.core.utils.JSONUtil;
|
||||||
|
import cn.lili.common.fulu.model.CommonRequest;
|
||||||
|
import org.apache.commons.codec.digest.DigestUtils;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认OpenApi客户请求实现
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 16:45
|
||||||
|
*/
|
||||||
|
public class DefaultOpenApiClient implements IDefaultOpenApiClient {
|
||||||
|
/**
|
||||||
|
* 商户AppKey
|
||||||
|
*/
|
||||||
|
private String appKey;
|
||||||
|
/**
|
||||||
|
* 业务参数
|
||||||
|
*/
|
||||||
|
private CommonRequest bizContent;
|
||||||
|
/**
|
||||||
|
* http请求
|
||||||
|
*/
|
||||||
|
private IFuluClient fuluClient;
|
||||||
|
/**
|
||||||
|
* 方法
|
||||||
|
*/
|
||||||
|
private String method;
|
||||||
|
/**
|
||||||
|
* 应用秘钥
|
||||||
|
*/
|
||||||
|
private String sysSecret;
|
||||||
|
|
||||||
|
// public DefaultOpenApiClient(String url, String appKey, String sysSecret) {
|
||||||
|
// this.appKey = appKey;
|
||||||
|
// this.sysSecret = sysSecret;
|
||||||
|
//
|
||||||
|
// if (url == null || "".equals(url.trim())) {
|
||||||
|
// this.fuluClient = new FuluClient();
|
||||||
|
// } else {
|
||||||
|
// this.fuluClient = new FuluClient(url);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 如果url没改变,可以使用这个构造
|
||||||
|
*
|
||||||
|
* @param appKey appKey
|
||||||
|
* @param sysSecret sysSecret
|
||||||
|
*/
|
||||||
|
// public DefaultOpenApiClient(String appKey, String sysSecret) {
|
||||||
|
// this.appKey = appKey;
|
||||||
|
// this.fuluClient = new FuluClient();
|
||||||
|
// this.sysSecret = sysSecret;
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用public void setBizContent(String bizContent)此方法,method不能为空,必填
|
||||||
|
* 或者使用其它构造,调用fulu.sup.open.api.model.CommonRequest的setMethod也可以
|
||||||
|
*
|
||||||
|
* @param url url
|
||||||
|
* @param appKey appKey
|
||||||
|
* @param sysSecret sysSecret
|
||||||
|
* @param method method
|
||||||
|
*/
|
||||||
|
public DefaultOpenApiClient(String url, String appKey, String sysSecret, String method) {
|
||||||
|
this.appKey = appKey;
|
||||||
|
this.sysSecret = sysSecret;
|
||||||
|
this.method = method;
|
||||||
|
|
||||||
|
if (url == null || "".equals(url.trim())) {
|
||||||
|
this.fuluClient = new FuluClient();
|
||||||
|
} else {
|
||||||
|
this.fuluClient = new FuluClient(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String excute() {
|
||||||
|
doSign();
|
||||||
|
return fuluClient.send(JSONUtil.toJSON(this.bizContent));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Future<String> excuteAsync() {
|
||||||
|
doSign();
|
||||||
|
return fuluClient.sendAsync(JSONUtil.toJSON(this.bizContent));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setBizContent(String bizContent) {
|
||||||
|
this.bizContent = new CommonRequest();
|
||||||
|
this.bizContent.setBizContent(bizContent);
|
||||||
|
this.bizContent.setAppKey(this.appKey);
|
||||||
|
this.bizContent.setMethod(this.method);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setBizObject(CommonRequest bizModel) {
|
||||||
|
this.bizContent = bizModel;
|
||||||
|
this.bizContent.setAppKey(this.appKey);
|
||||||
|
|
||||||
|
if (method != null && !"".equals(method)) {
|
||||||
|
this.bizContent.setMethod(this.method);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void doSign() {
|
||||||
|
if (bizContent.getMethod() == null || "".equals(bizContent.getMethod().trim())) {
|
||||||
|
throw new RuntimeException("param \"method\" can not blank!");
|
||||||
|
}
|
||||||
|
|
||||||
|
this.bizContent.setSign(null);
|
||||||
|
this.bizContent.getBizContent();
|
||||||
|
String json = JSONUtil.toJSON(this.bizContent);
|
||||||
|
char[] charArray = json.toCharArray();
|
||||||
|
Arrays.sort(charArray);
|
||||||
|
String signStr = new String(charArray);
|
||||||
|
signStr = String.format("%s%s", signStr, sysSecret);
|
||||||
|
this.bizContent.setSign(DigestUtils.md5Hex(signStr));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package cn.lili.common.fulu.sdk;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import cn.lili.common.fulu.model.CommonRequest;
|
||||||
|
|
||||||
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认OpenApi客户请求接口
|
||||||
|
*
|
||||||
|
* @Auther: chenYing
|
||||||
|
* @Date: 2019/8/19 0019 16:40
|
||||||
|
*/
|
||||||
|
public interface IDefaultOpenApiClient {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行请求,同步方法
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
String excute();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行请求,异步方法
|
||||||
|
*
|
||||||
|
* @return Future<String>
|
||||||
|
*/
|
||||||
|
Future<String> excuteAsync();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置业务参数
|
||||||
|
*
|
||||||
|
* @param bizContent
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
void setBizContent(String bizContent);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置业务参数
|
||||||
|
*/
|
||||||
|
void setBizObject(CommonRequest bizModel);
|
||||||
|
|
||||||
|
}
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
@ -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");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
package cn.lili.modules.file.plugin;
|
||||||
|
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface QiNiuManagerPlugin {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件流上传
|
||||||
|
*
|
||||||
|
* @param inputStream
|
||||||
|
* @param key
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String inputStreamUpload(InputStream inputStream, String key);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除文件
|
||||||
|
*
|
||||||
|
* @param key
|
||||||
|
*/
|
||||||
|
void deleteFile(List<String> key);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据原图生成规定尺寸的图片
|
||||||
|
*
|
||||||
|
* @param url 连接
|
||||||
|
* @param width 宽
|
||||||
|
* @param height 高
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String getUrl(String url, Integer width, Integer height);
|
||||||
|
}
|
@ -0,0 +1,143 @@
|
|||||||
|
package cn.lili.modules.file.plugin.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.lili.common.enums.ResultCode;
|
||||||
|
import cn.lili.common.exception.ServiceException;
|
||||||
|
import cn.lili.modules.file.plugin.QiNiuManagerPlugin;
|
||||||
|
import cn.lili.modules.system.entity.dos.Setting;
|
||||||
|
import cn.lili.modules.system.entity.dto.OssSetting;
|
||||||
|
import cn.lili.modules.system.entity.enums.SettingEnum;
|
||||||
|
import cn.lili.modules.system.service.SettingService;
|
||||||
|
import com.aliyun.oss.ClientException;
|
||||||
|
import com.aliyun.oss.OSS;
|
||||||
|
import com.aliyun.oss.OSSClientBuilder;
|
||||||
|
import com.aliyun.oss.OSSException;
|
||||||
|
import com.aliyun.oss.model.DeleteObjectsRequest;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.qiniu.common.QiniuException;
|
||||||
|
import com.qiniu.http.Response;
|
||||||
|
import com.qiniu.storage.BucketManager;
|
||||||
|
import com.qiniu.storage.Configuration;
|
||||||
|
import com.qiniu.storage.UploadManager;
|
||||||
|
import com.qiniu.util.Auth;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 阿里oss 文件操作
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class QiNiuFileManagerPlugin implements QiNiuManagerPlugin {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SettingService settingService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下一个初始化配置参数的时间
|
||||||
|
* 这里为了防止多次调用redis,减少与redis的交互时间
|
||||||
|
*/
|
||||||
|
private static Long nextInitSetting;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂时设定3分账请求一次设置
|
||||||
|
*/
|
||||||
|
private static final Long INTERVAL = 60 * 3 * 1000L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 静态设置,最快三分钟更新一次
|
||||||
|
*/
|
||||||
|
private static OssSetting ossSetting;
|
||||||
|
|
||||||
|
private Auth auth;
|
||||||
|
private UploadManager uploadManager;
|
||||||
|
private BucketManager bucketManager;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取oss client
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private OSS getQiNiuOssClient() {
|
||||||
|
OssSetting ossSetting = getSetting();
|
||||||
|
|
||||||
|
return new OSSClientBuilder().build(
|
||||||
|
ossSetting.getEndPoint(),
|
||||||
|
ossSetting.getAccessKeyId(),
|
||||||
|
ossSetting.getAccessKeySecret());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取配置
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private OssSetting getSetting() {
|
||||||
|
//如果没有配置,或者没有下次刷新时间,或者下次刷新时间小于当前时间,则从redis 更新一次
|
||||||
|
if (ossSetting == null || nextInitSetting == null || nextInitSetting < System.currentTimeMillis()) {
|
||||||
|
Setting setting = settingService.get(SettingEnum.OSS_SETTING.name());
|
||||||
|
if (setting == null || StrUtil.isBlank(setting.getSettingValue())) {
|
||||||
|
throw new ServiceException(ResultCode.OSS_NOT_EXIST);
|
||||||
|
}
|
||||||
|
nextInitSetting = System.currentTimeMillis() + INTERVAL;
|
||||||
|
ossSetting = new Gson().fromJson(setting.getSettingValue(), OssSetting.class);
|
||||||
|
return ossSetting;
|
||||||
|
}
|
||||||
|
return ossSetting;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String inputStreamUpload(InputStream inputStream, String key) {
|
||||||
|
OssSetting ossSetting = getSetting();
|
||||||
|
auth = Auth.create(ossSetting.getAccessKeyId(), ossSetting.getAccessKeySecret());
|
||||||
|
uploadManager = new UploadManager(new Configuration());
|
||||||
|
String upToken = auth.uploadToken(ossSetting.getBucketName());
|
||||||
|
|
||||||
|
try {
|
||||||
|
Response response = uploadManager.put(inputStream, ossSetting.getPicLocation() +"/"+ key, upToken, null, "image/jpg");
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
return ossSetting.getEndPoint() + "/"+ ossSetting.getPicLocation() + "/" + key;
|
||||||
|
}
|
||||||
|
} catch (QiniuException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteFile(List<String> key) {
|
||||||
|
OssSetting ossSetting = getSetting();
|
||||||
|
if (bucketManager == null) {
|
||||||
|
if (auth == null) {
|
||||||
|
auth = Auth.create(ossSetting.getAccessKeyId(), ossSetting.getAccessKeySecret());
|
||||||
|
}
|
||||||
|
bucketManager = new BucketManager(auth, new Configuration());
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// for (int i = 0; 0 < key.size(); i++) {
|
||||||
|
// try {
|
||||||
|
// bucketManager.delete(ossSetting.getBucketName()+ "/"+ ossSetting.getPicLocation(), key.get(i));
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUrl(String url, Integer width, Integer height) {
|
||||||
|
//缩略图全路径
|
||||||
|
//返回缩略图全路径
|
||||||
|
return url + "?x-oss-process=style/" + width + "X" + height;
|
||||||
|
}
|
||||||
|
}
|
@ -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;
|
||||||
|
@ -8,6 +8,7 @@ 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.DraftGoodsDTO;
|
||||||
import cn.lili.modules.goods.entity.dto.GoodsOperationDTO;
|
import cn.lili.modules.goods.entity.dto.GoodsOperationDTO;
|
||||||
|
import cn.lili.modules.goods.entity.dto.GoodsOperationFuLuDTO;
|
||||||
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;
|
||||||
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
|
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
|
||||||
|
@ -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,6 +1,9 @@
|
|||||||
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.*;
|
import lombok.*;
|
||||||
import org.hibernate.validator.constraints.Length;
|
import org.hibernate.validator.constraints.Length;
|
||||||
@ -8,6 +11,8 @@ 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;
|
||||||
|
|
||||||
@ -126,9 +131,49 @@ public class GoodsOperationDTO implements Serializable {
|
|||||||
@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;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,137 @@
|
|||||||
|
package cn.lili.modules.goods.entity.dto;
|
||||||
|
|
||||||
|
import cn.lili.common.validation.EnumValue;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品编辑DTO
|
||||||
|
*
|
||||||
|
* @author pikachu
|
||||||
|
* @since 2020-02-24 19:27:20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
public class GoodsOperationFuLuDTO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -509667581371776913L;
|
||||||
|
|
||||||
|
@ApiModelProperty(hidden = true)
|
||||||
|
private String goodsId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商品价格", required = true)
|
||||||
|
@NotNull(message = "商品价格不能为空")
|
||||||
|
@Min(value = 0, message = "商品价格不能为负数")
|
||||||
|
@Max(value = 99999999, message = "商品价格不能超过99999999")
|
||||||
|
private Double price;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分类path")
|
||||||
|
private String categoryPath;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "店铺分类id", required = true)
|
||||||
|
@Size(max = 200, message = "选择了太多店铺分类")
|
||||||
|
private String storeCategoryPath;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "品牌id")
|
||||||
|
@Min(value = 0, message = "品牌值不正确")
|
||||||
|
private String brandId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商品名称", required = true)
|
||||||
|
@NotEmpty(message = "商品名称不能为空")
|
||||||
|
@Length(max = 50, message = "商品名称不能超过50个字符")
|
||||||
|
private String goodsName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "详情")
|
||||||
|
private String intro;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商品移动端详情")
|
||||||
|
private String mobileIntro;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "库存")
|
||||||
|
@Min(value = 0, message = "库存不能为负数")
|
||||||
|
@Max(value = 99999999, message = "库存不能超过99999999")
|
||||||
|
private Integer quantity;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否立即发布")
|
||||||
|
private Boolean release;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否是推荐商品")
|
||||||
|
private Boolean recommend;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商品参数")
|
||||||
|
private List<GoodsParamsDTO> goodsParamsDTOList;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商品图片")
|
||||||
|
private List<String> goodsGalleryList;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "运费模板id,不需要运费模板时值是0", required = true)
|
||||||
|
@NotNull(message = "运费模板不能为空,没有运费模板时,传值0")
|
||||||
|
@Min(value = 0, message = "运费模板值不正确")
|
||||||
|
private String templateId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "sku列表")
|
||||||
|
@Valid
|
||||||
|
private List<Map<String, Object>> skuList;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "卖点")
|
||||||
|
private String sellingPoint;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "销售模式", required = true)
|
||||||
|
private String salesModel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否有规格", hidden = true)
|
||||||
|
private String haveSpec;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "销售模式", required = true)
|
||||||
|
private String goodsUnit;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商品描述")
|
||||||
|
private String info;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否重新生成sku数据")
|
||||||
|
private Boolean regeneratorSkuFlag = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see cn.lili.modules.goods.entity.enums.GoodsTypeEnum
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "商品类型")
|
||||||
|
@EnumValue(strValues = {"PHYSICAL_GOODS", "VIRTUAL_GOODS", "E_COUPON"}, message = "商品类型参数值错误")
|
||||||
|
private String goodsType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品视频
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "商品视频")
|
||||||
|
private String goodsVideo;
|
||||||
|
|
||||||
|
public String getGoodsName() {
|
||||||
|
//对商品对名称做一个极限处理。这里没有用xss过滤是因为xss过滤为全局过滤,影响很大。
|
||||||
|
// 业务中,全局代码中只有商品名称不能拥有英文逗号,是由于商品名称存在一个数据库联合查询,结果要根据逗号分组
|
||||||
|
return goodsName.replace(",", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//福禄所需参数
|
||||||
|
@ApiModelProperty(value = "商品编号", required = true)
|
||||||
|
@Length(max = 30, message = "商品编号太长,不能超过30个字符")
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "市场价格", required = true)
|
||||||
|
@NotNull(message = "市场价格不能为空")
|
||||||
|
private Double cost;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "重量", required = true)
|
||||||
|
@NotNull(message = "商品重量不能为空")
|
||||||
|
@Min(value = 0, message = "重量不能为负数")
|
||||||
|
@Max(value = 99999999, message = "重量不能超过99999999")
|
||||||
|
private Double weight;
|
||||||
|
}
|
@ -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;
|
||||||
|
}
|
@ -2,6 +2,7 @@ package cn.lili.modules.goods.service;
|
|||||||
|
|
||||||
import cn.lili.modules.goods.entity.dos.Goods;
|
import cn.lili.modules.goods.entity.dos.Goods;
|
||||||
import cn.lili.modules.goods.entity.dto.GoodsOperationDTO;
|
import cn.lili.modules.goods.entity.dto.GoodsOperationDTO;
|
||||||
|
import cn.lili.modules.goods.entity.dto.GoodsOperationFuLuDTO;
|
||||||
import cn.lili.modules.goods.entity.dto.GoodsSearchParams;
|
import cn.lili.modules.goods.entity.dto.GoodsSearchParams;
|
||||||
import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;
|
import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;
|
||||||
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
|
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
|
||||||
@ -184,4 +185,4 @@ public interface GoodsService extends IService<Goods> {
|
|||||||
*/
|
*/
|
||||||
long countStoreGoodsNum(String storeId);
|
long countStoreGoodsNum(String storeId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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.GoodsService;
|
||||||
|
import cn.lili.modules.goods.service.GoodsUnitService;
|
||||||
|
import cn.lili.modules.goods.service.GoodsImportService;
|
||||||
|
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);
|
||||||
|
//加载数据,将名称为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);
|
||||||
|
}
|
||||||
|
}
|
@ -18,6 +18,7 @@ import cn.lili.modules.goods.entity.dos.Goods;
|
|||||||
import cn.lili.modules.goods.entity.dos.GoodsGallery;
|
import cn.lili.modules.goods.entity.dos.GoodsGallery;
|
||||||
import cn.lili.modules.goods.entity.dos.Wholesale;
|
import cn.lili.modules.goods.entity.dos.Wholesale;
|
||||||
import cn.lili.modules.goods.entity.dto.GoodsOperationDTO;
|
import cn.lili.modules.goods.entity.dto.GoodsOperationDTO;
|
||||||
|
import cn.lili.modules.goods.entity.dto.GoodsOperationFuLuDTO;
|
||||||
import cn.lili.modules.goods.entity.dto.GoodsParamsDTO;
|
import cn.lili.modules.goods.entity.dto.GoodsParamsDTO;
|
||||||
import cn.lili.modules.goods.entity.dto.GoodsSearchParams;
|
import cn.lili.modules.goods.entity.dto.GoodsSearchParams;
|
||||||
import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;
|
import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;
|
||||||
@ -170,7 +171,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()) {
|
||||||
//给商品参数填充值
|
//给商品参数填充值
|
||||||
@ -188,6 +191,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void editGoods(GoodsOperationDTO goodsOperationDTO, String goodsId) {
|
public void editGoods(GoodsOperationDTO goodsOperationDTO, String goodsId) {
|
||||||
@ -216,6 +220,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
this.generateEs(goods);
|
this.generateEs(goods);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GoodsVO getGoodsVO(String goodsId) {
|
public GoodsVO getGoodsVO(String goodsId) {
|
||||||
//缓存获取,如果没有则读取缓存
|
//缓存获取,如果没有则读取缓存
|
||||||
@ -699,4 +704,4 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
return queryWrapper;
|
return queryWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
@ -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;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
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;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020/11/19 11:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("li_store_role")
|
||||||
|
@ApiModel(value = "店铺角色")
|
||||||
|
public class StoreRole extends BaseEntity {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "角色名")
|
||||||
|
@NotEmpty(message = "角色名称必填")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "店铺id", hidden = true)
|
||||||
|
private String storeId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否为注册默认角色")
|
||||||
|
private Boolean defaultRole = false;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String description;
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
package cn.lili.modules.member.entity.dto;
|
||||||
|
|
||||||
|
import cn.lili.common.security.sensitive.Sensitive;
|
||||||
|
import cn.lili.common.security.sensitive.enums.SensitiveStrategy;
|
||||||
|
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 lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店员dto
|
||||||
|
*
|
||||||
|
* @author wget
|
||||||
|
* @title: Clerk
|
||||||
|
* @projectName lilishop
|
||||||
|
* @date 2021/12/28 7:39 下午
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ClerkAddDTO {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "会员用户名")
|
||||||
|
@NotEmpty(message = "会员用户名不能为空")
|
||||||
|
@Length(max = 30, message = "会员用户名不能超过20个字符")
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "会员密码")
|
||||||
|
@NotEmpty(message = "会员密码不能为空")
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
@NotEmpty(message = "手机号码不能为空")
|
||||||
|
@ApiModelProperty(value = "手机号码", required = true)
|
||||||
|
@Sensitive(strategy = SensitiveStrategy.PHONE)
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所属部门id")
|
||||||
|
private String departmentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否是超级管理员 超级管理员/普通管理员")
|
||||||
|
private Boolean isSuper = false;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "角色")
|
||||||
|
private List<String> roles;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "会员id", required = true)
|
||||||
|
private String memberId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否是店主", hidden = true)
|
||||||
|
private Boolean shopkeeper = false;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "店铺id", hidden = true)
|
||||||
|
private String storeId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package cn.lili.modules.member.entity.dto;
|
||||||
|
|
||||||
|
import cn.lili.common.security.sensitive.Sensitive;
|
||||||
|
import cn.lili.common.security.sensitive.enums.SensitiveStrategy;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店员dto
|
||||||
|
*
|
||||||
|
* @author wget
|
||||||
|
* @title: Clerk
|
||||||
|
* @projectName lilishop
|
||||||
|
* @date 2021/12/28 7:39 下午
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ClerkEditDTO {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "店员id", hidden = true)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "会员密码")
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
private Boolean status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所属部门id")
|
||||||
|
private String departmentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否是超级管理员 超级管理员/普通管理员")
|
||||||
|
private Boolean isSuper = false;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "角色")
|
||||||
|
private List<String> roles;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package cn.lili.modules.member.entity.dto;
|
||||||
|
|
||||||
|
import cn.lili.mybatis.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理员入库dto
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020/11/16 19:55
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "店员操作dto")
|
||||||
|
public class ClerkOperationDTO extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户名")
|
||||||
|
@Length(max = 20,message = "用户名长度不能超过20个字符")
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "密码")
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "昵称")
|
||||||
|
@Length(max = 10,message = "昵称长度不能超过10个字符")
|
||||||
|
private String nickName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "手机")
|
||||||
|
@Length(max = 11,message = "手机号长度不能超过11")
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "头像")
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "描述/详情/备注")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所属部门id")
|
||||||
|
private String departmentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否为超级管理员")
|
||||||
|
private Boolean isSuper;
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
package cn.lili.modules.member.entity.dto;
|
||||||
|
|
||||||
|
import cn.lili.mybatis.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店员查询
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020/11/16 19:55
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "店员查询")
|
||||||
|
public class ClerkQueryDTO extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "店员名称")
|
||||||
|
@Length(max = 20, message = "用户名长度不能超过20个字符")
|
||||||
|
private String clerkName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "手机")
|
||||||
|
@Length(max = 11, message = "手机号长度不能超过11")
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所属部门id")
|
||||||
|
private String departmentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否为超级管理员")
|
||||||
|
private Boolean isSuper;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
private Boolean status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "店铺id", hidden = true)
|
||||||
|
private String storeId;
|
||||||
|
}
|
@ -24,6 +24,10 @@ public class ManagerMemberEditDTO {
|
|||||||
@NotNull(message = "用户ID不能为空")
|
@NotNull(message = "用户ID不能为空")
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "会员用户名,用户名不能进行修改", required = true)
|
||||||
|
@NotNull(message = "会员用户名不能为空")
|
||||||
|
private String username;
|
||||||
|
|
||||||
@ApiModelProperty(value = "会员密码")
|
@ApiModelProperty(value = "会员密码")
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
|
@ -0,0 +1,44 @@
|
|||||||
|
package cn.lili.modules.member.entity.vo;
|
||||||
|
|
||||||
|
import cn.lili.common.utils.BeanUtil;
|
||||||
|
import cn.lili.modules.member.entity.dos.Clerk;
|
||||||
|
import cn.lili.modules.member.entity.dos.StoreMenu;
|
||||||
|
import cn.lili.modules.member.entity.dos.StoreRole;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理员VO
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020-11-22 09:17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ClerkVO extends Clerk {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -2378384199695839312L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "手机号")
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所属部门名称")
|
||||||
|
private String departmentTitle;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户拥有角色")
|
||||||
|
private List<StoreRole> roles;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户拥有的权限")
|
||||||
|
private List<StoreMenu> menus;
|
||||||
|
|
||||||
|
|
||||||
|
public ClerkVO(Clerk clerk) {
|
||||||
|
BeanUtil.copyProperties(clerk, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -28,11 +28,11 @@ public class MemberVO implements Serializable {
|
|||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
@ApiModelProperty(value = "会员用户名")
|
@ApiModelProperty(value = "会员用户名")
|
||||||
@Sensitive(strategy = SensitiveStrategy.PHONE)
|
@Sensitive(strategy = SensitiveStrategy.USERNAME)
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
@ApiModelProperty(value = "昵称")
|
@ApiModelProperty(value = "昵称")
|
||||||
@Sensitive(strategy = SensitiveStrategy.PHONE)
|
|
||||||
private String nickName;
|
private String nickName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "会员性别,1为男,0为女")
|
@ApiModelProperty(value = "会员性别,1为男,0为女")
|
||||||
|
@ -0,0 +1,28 @@
|
|||||||
|
package cn.lili.modules.member.entity.vo;
|
||||||
|
|
||||||
|
import cn.lili.common.utils.BeanUtil;
|
||||||
|
import cn.lili.modules.member.entity.dos.StoreDepartment;
|
||||||
|
import cn.lili.modules.permission.entity.dos.Department;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门VO
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020-11-23 18:48
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class StoreDepartmentVO extends StoreDepartment {
|
||||||
|
|
||||||
|
private List<StoreDepartmentVO> children = new ArrayList<>();
|
||||||
|
|
||||||
|
public StoreDepartmentVO() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public StoreDepartmentVO(StoreDepartment storeDepartment) {
|
||||||
|
BeanUtil.copyProperties(storeDepartment, this);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
package cn.lili.modules.member.entity.vo;
|
||||||
|
|
||||||
|
import cn.lili.common.utils.BeanUtil;
|
||||||
|
import cn.lili.modules.member.entity.dos.StoreMenu;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 菜单VO 展示模型
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020/11/20 15:38
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class StoreMenuVO extends StoreMenu {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "子菜单")
|
||||||
|
private List<StoreMenuVO> children = new ArrayList<>();
|
||||||
|
|
||||||
|
public StoreMenuVO() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public StoreMenuVO(StoreMenu storeMenu) {
|
||||||
|
BeanUtil.copyProperties(storeMenu, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<StoreMenuVO> getChildren() {
|
||||||
|
if (children != null) {
|
||||||
|
children.sort(new Comparator<StoreMenuVO>() {
|
||||||
|
@Override
|
||||||
|
public int compare(StoreMenuVO o1, StoreMenuVO o2) {
|
||||||
|
return o1.getSortOrder().compareTo(o2.getSortOrder());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return children;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
package cn.lili.modules.member.entity.vo;
|
||||||
|
|
||||||
|
import cn.lili.modules.member.entity.dos.StoreMenu;
|
||||||
|
import cn.lili.modules.permission.entity.dos.Menu;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RoleMenuVO
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020-11-24 11:45
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class StoreUserMenuVO extends StoreMenu {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -7478870595109016162L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否是超级管理员
|
||||||
|
*/
|
||||||
|
private Boolean isSuper;
|
||||||
|
|
||||||
|
public Boolean getSuper() {
|
||||||
|
if (this.isSuper == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return isSuper;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package cn.lili.modules.member.mapper;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.lili.modules.member.entity.dos.Clerk;
|
||||||
|
import cn.lili.modules.member.entity.vo.ClerkVO;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店员数据处理层
|
||||||
|
*
|
||||||
|
* @author wget
|
||||||
|
* @title: ClerkMapper
|
||||||
|
* @projectName lilishop
|
||||||
|
* @date 2021/12/28 7:39 下午
|
||||||
|
*/
|
||||||
|
public interface ClerkMapper extends BaseMapper<Clerk> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询店员分页数据
|
||||||
|
* @param page 分页信息
|
||||||
|
* @param ew 店铺ID
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Select("select li_clerk.*,m.id,m.mobile as mobile from li_clerk inner join li_member as m on li_clerk.member_id = m.id ${ew.customSqlSegment}")
|
||||||
|
IPage<ClerkVO> selectClerkPage(Page page, @Param(Constants.WRAPPER) QueryWrapper ew);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -23,7 +23,8 @@ public interface FootprintMapper extends BaseMapper<FootPrint> {
|
|||||||
*
|
*
|
||||||
* @param memberId 会员ID
|
* @param memberId 会员ID
|
||||||
*/
|
*/
|
||||||
@Delete("DELETE FROM li_foot_print l1 WHERE l1.id IN (" +
|
|
||||||
|
@Delete("DELETE FROM li_foot_print WHERE id IN ("+
|
||||||
"SELECT l2.id FROM (" +
|
"SELECT l2.id FROM (" +
|
||||||
"SELECT l3.id FROM li_foot_print l3 WHERE l3.member_id=${memberId} ORDER BY id DESC LIMIT 100,100) l2)")
|
"SELECT l3.id FROM li_foot_print l3 WHERE l3.member_id=${memberId} ORDER BY id DESC LIMIT 100,100) l2)")
|
||||||
void deleteLastFootPrint(String memberId);
|
void deleteLastFootPrint(String memberId);
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
package cn.lili.modules.member.mapper;
|
||||||
|
|
||||||
|
import cn.lili.modules.member.entity.dos.StoreClerkRole;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色权限数据处理层
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020-11-22 09:17
|
||||||
|
*/
|
||||||
|
public interface StoreClerkRoleMapper extends BaseMapper<StoreClerkRole> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package cn.lili.modules.member.mapper;
|
||||||
|
|
||||||
|
import cn.lili.modules.member.entity.dos.StoreDepartment;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门数据处理层
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020-11-22 09:17
|
||||||
|
*/
|
||||||
|
public interface StoreDepartmentMapper extends BaseMapper<StoreDepartment> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package cn.lili.modules.member.mapper;
|
||||||
|
|
||||||
|
import cn.lili.modules.member.entity.dos.StoreDepartmentRole;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺部门角色数据处理层
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020-11-22 09:17
|
||||||
|
*/
|
||||||
|
public interface StoreDepartmentRoleMapper extends BaseMapper<StoreDepartmentRole> {
|
||||||
|
|
||||||
|
}
|
@ -21,7 +21,7 @@ public interface StoreLogisticsMapper extends BaseMapper<StoreLogistics> {
|
|||||||
* @param storeId 店铺ID
|
* @param storeId 店铺ID
|
||||||
* @return 物流公司列表
|
* @return 物流公司列表
|
||||||
*/
|
*/
|
||||||
@Select("SELECT l.* FROM li_logistics l RIGHT JOIN li_store_logistics sl ON l.id=sl.logistics_id WHERE sl.store_id=#{storeId} AND l.disabled='OPEN'")
|
@Select("SELECT l.id as logistics_id,l.name FROM li_logistics l RIGHT JOIN li_store_logistics sl ON l.id=sl.logistics_id WHERE sl.store_id=#{storeId} AND l.disabled='OPEN'")
|
||||||
List<StoreLogisticsVO> getSelectedStoreLogistics(String storeId);
|
List<StoreLogisticsVO> getSelectedStoreLogistics(String storeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -39,7 +39,35 @@ public interface StoreLogisticsMapper extends BaseMapper<StoreLogistics> {
|
|||||||
* @param storeId 店铺列表
|
* @param storeId 店铺列表
|
||||||
* @return 店铺地址VO列表
|
* @return 店铺地址VO列表
|
||||||
*/
|
*/
|
||||||
@Select("SELECT *, ( SELECT sl.id FROM li_store_logistics sl WHERE l.id = sl.logistics_id AND sl.store_id=#{storeId} ) AS selected FROM li_logistics l WHERE l.disabled='OPEN';")
|
@Select("SELECT id as logistics_id , `name` , ( SELECT sl.id FROM li_store_logistics sl WHERE l.id = sl.logistics_id AND sl.store_id=#{storeId} ) AS selected,(SELECT sl.face_sheet_flag FROM li_store_logistics sl WHERE l.id = sl.logistics_id AND sl.store_id = #{storeId}) as face_sheet_flag FROM li_logistics l WHERE l.disabled='OPEN';")
|
||||||
|
//@Select("SELECT *, ( SELECT sl.id FROM li_store_logistics sl WHERE l.id = sl.logistics_id AND sl.store_id=#{storeId} ) AS selected FROM li_logistics l WHERE l.disabled='OPEN';")
|
||||||
List<StoreLogisticsVO> getStoreLogistics(String storeId);
|
List<StoreLogisticsVO> getStoreLogistics(String storeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺已选择的物流公司
|
||||||
|
* @param storeId 店铺Id
|
||||||
|
* @return 物流公司列表
|
||||||
|
*/
|
||||||
|
@Select("SELECT sl.logistics_id,l.name,sl.face_sheet_flag FROM li_logistics l INNER JOIN li_store_logistics sl on sl.logistics_id=l.id WHERE l.disabled = 'OPEN' AND store_id=#{storeId};")
|
||||||
|
List<StoreLogisticsVO> getOpenStoreLogistics(String storeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺未选择的物流公司
|
||||||
|
* @param storeId 店铺Id
|
||||||
|
* @return 物流公司列表
|
||||||
|
*/
|
||||||
|
@Select("SELECT id as logistics_id,name FROM li_logistics WHERE id not in(SELECT logistics_id FROM li_store_logistics WHERE store_id=#{storeId}) AND disabled = 'OPEN'")
|
||||||
|
List<StoreLogisticsVO> getCloseStroreLogistics(String storeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取店铺选择的物流公司并使用了电子面单
|
||||||
|
*
|
||||||
|
* @param storeId 店铺ID
|
||||||
|
* @return 物流公司列表
|
||||||
|
*/
|
||||||
|
@Select("SELECT id as logistics_id , `name` FROM li_logistics WHERE disabled='OPEN'" +
|
||||||
|
"AND id in(SELECT logistics_id FROM li_store_logistics WHERE store_id=#{storeId} and face_sheet_flag=1)")
|
||||||
|
List<StoreLogisticsVO> getSelectedStoreLogisticsUseFaceSheet(String storeId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package cn.lili.modules.member.mapper;
|
||||||
|
|
||||||
|
import cn.lili.modules.member.entity.dos.StoreMenu;
|
||||||
|
import cn.lili.modules.member.entity.vo.StoreUserMenuVO;
|
||||||
|
import cn.lili.modules.permission.entity.dos.Menu;
|
||||||
|
import cn.lili.modules.permission.entity.vo.UserMenuVO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 菜单数据处理层
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020-11-22 09:17
|
||||||
|
*/
|
||||||
|
public interface StoreMenuMapper extends BaseMapper<StoreMenu> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户获取菜单列表
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 菜单列表
|
||||||
|
*/
|
||||||
|
@Select("SELECT menu.* FROM li_store_menu AS menu WHERE menu.id IN (" +
|
||||||
|
"SELECT rm.menu_id FROM li_store_menu_role AS rm WHERE rm.role_id IN (" +
|
||||||
|
"SELECT ur.role_id FROM li_clerk_role AS ur WHERE ur.clerk_id=#{userId}) OR rm.role_id IN (" +
|
||||||
|
"SELECT dr.role_id FROM li_store_department_role AS dr WHERE dr.department_id=(" +
|
||||||
|
"SELECT department_id FROM li_clerk AS au WHERE au.id = #{userId})))")
|
||||||
|
List<StoreMenu> findByUserId(String userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户获取菜单权限
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 用户菜单VO列表
|
||||||
|
*/
|
||||||
|
@Select("SELECT rm.is_super as is_super,m.*FROM li_store_menu AS m INNER JOIN li_store_menu_role AS rm ON rm.menu_id=m.id WHERE rm.role_id IN (" +
|
||||||
|
"SELECT ur.role_id FROM li_clerk_role AS ur WHERE ur.clerk_id=#{userId}) OR rm.role_id IN (" +
|
||||||
|
"SELECT dr.role_id FROM li_store_department_role AS dr INNER JOIN li_clerk AS au ON au.department_id=dr.department_id " +
|
||||||
|
"WHERE au.id=#{userId}) GROUP BY m.id,rm.is_super ORDER BY rm.is_super desc")
|
||||||
|
List<StoreUserMenuVO> getUserRoleMenu(String userId);
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package cn.lili.modules.member.mapper;
|
||||||
|
|
||||||
|
import cn.lili.modules.member.entity.dos.StoreMenuRole;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色菜单数据处理层
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020-11-22 09:17
|
||||||
|
*/
|
||||||
|
public interface StoreMenuRoleMapper extends BaseMapper<StoreMenuRole> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package cn.lili.modules.member.mapper;
|
||||||
|
|
||||||
|
import cn.lili.modules.member.entity.dos.StoreRole;
|
||||||
|
import cn.lili.modules.permission.entity.dos.Role;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺角色数据处理层
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020-11-22 09:17
|
||||||
|
*/
|
||||||
|
public interface StoreRoleMapper extends BaseMapper<StoreRole> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,99 @@
|
|||||||
|
package cn.lili.modules.member.service;
|
||||||
|
|
||||||
|
import cn.lili.common.vo.PageVO;
|
||||||
|
import cn.lili.modules.member.entity.dos.Clerk;
|
||||||
|
import cn.lili.modules.member.entity.dos.Member;
|
||||||
|
import cn.lili.modules.member.entity.dto.ClerkAddDTO;
|
||||||
|
import cn.lili.modules.member.entity.dto.ClerkEditDTO;
|
||||||
|
import cn.lili.modules.member.entity.dto.ClerkQueryDTO;
|
||||||
|
import cn.lili.modules.member.entity.vo.ClerkVO;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店员业务层
|
||||||
|
*
|
||||||
|
* @author wget
|
||||||
|
* @title: ClerkService
|
||||||
|
* @projectName lilishop
|
||||||
|
* @date 2021/12/28 7:42 下午
|
||||||
|
*/
|
||||||
|
public interface ClerkService extends IService<Clerk> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店员查询
|
||||||
|
*
|
||||||
|
* @param page
|
||||||
|
* @param clerkQueryDTO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<ClerkVO> clerkForPage(PageVO page, ClerkQueryDTO clerkQueryDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询店员详细
|
||||||
|
*
|
||||||
|
* @param id 店员id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ClerkVO get(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改店员信息
|
||||||
|
*
|
||||||
|
* @param clerkEditDTO 店员
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Clerk updateClerk(ClerkEditDTO clerkEditDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存店员
|
||||||
|
*
|
||||||
|
* @param clerkAddDTO 店员
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Clerk saveClerk(ClerkAddDTO clerkAddDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据会员id获取店员信息
|
||||||
|
*
|
||||||
|
* @param memberId 会员id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Clerk getClerkByMemberId(String memberId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置店员密码
|
||||||
|
*
|
||||||
|
* @param ids 店员ids
|
||||||
|
*/
|
||||||
|
void resetPassword(List<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除店员
|
||||||
|
*
|
||||||
|
* @param ids 店员ids
|
||||||
|
*/
|
||||||
|
void deleteClerk(List<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测会员有效性
|
||||||
|
*
|
||||||
|
* @param mobile 手机号码
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Member checkClerk(String mobile);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店员状态操作
|
||||||
|
*
|
||||||
|
* @param id 店员id
|
||||||
|
* @param status 状态
|
||||||
|
*/
|
||||||
|
void disable(String id, Boolean status);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -26,7 +26,6 @@ import java.util.Map;
|
|||||||
* @since 2020-02-25 14:10:16
|
* @since 2020-02-25 14:10:16
|
||||||
*/
|
*/
|
||||||
public interface MemberService extends IService<Member> {
|
public interface MemberService extends IService<Member> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 默认密码
|
* 默认密码
|
||||||
*/
|
*/
|
||||||
@ -40,13 +39,12 @@ public interface MemberService extends IService<Member> {
|
|||||||
Member getUserInfo();
|
Member getUserInfo();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否可以通过手机获取用户
|
* 通过手机获取用户
|
||||||
*
|
*
|
||||||
* @param uuid UUID
|
|
||||||
* @param mobile 手机号
|
* @param mobile 手机号
|
||||||
* @return 操作状态
|
* @return 操作状态
|
||||||
*/
|
*/
|
||||||
boolean findByMobile(String uuid, String mobile);
|
Member findByMobile(String mobile);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户名获取用户
|
* 通过用户名获取用户
|
||||||
@ -93,11 +91,22 @@ public interface MemberService extends IService<Member> {
|
|||||||
/**
|
/**
|
||||||
* 修改用户密码
|
* 修改用户密码
|
||||||
*
|
*
|
||||||
|
* @param memberId 会员id
|
||||||
* @param oldPassword 旧密码
|
* @param oldPassword 旧密码
|
||||||
* @param newPassword 新密码
|
* @param newPassword 新密码
|
||||||
* @return 操作结果
|
* @return 操作结果
|
||||||
*/
|
*/
|
||||||
Member modifyPass(String oldPassword, String newPassword);
|
Member modifyPass(String memberId, String oldPassword, String newPassword);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册会员
|
||||||
|
*
|
||||||
|
* @param userName 会员
|
||||||
|
* @param password 密码
|
||||||
|
* @param mobilePhone mobilePhone
|
||||||
|
* @return 处理结果
|
||||||
|
*/
|
||||||
|
Token register(String userName, String password, String mobilePhone);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否可以初始化密码
|
* 是否可以初始化密码
|
||||||
@ -121,17 +130,6 @@ public interface MemberService extends IService<Member> {
|
|||||||
* @return 操作结果
|
* @return 操作结果
|
||||||
*/
|
*/
|
||||||
void cancellation(String password);
|
void cancellation(String password);
|
||||||
|
|
||||||
/**
|
|
||||||
* 注册会员
|
|
||||||
*
|
|
||||||
* @param userName 会员
|
|
||||||
* @param password 密码
|
|
||||||
* @param mobilePhone mobilePhone
|
|
||||||
* @return 处理结果
|
|
||||||
*/
|
|
||||||
Token register(String userName, String password, String mobilePhone);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改当前会员的手机号
|
* 修改当前会员的手机号
|
||||||
*
|
*
|
||||||
@ -252,6 +250,24 @@ public interface MemberService extends IService<Member> {
|
|||||||
*/
|
*/
|
||||||
void logout(UserEnums userEnums);
|
void logout(UserEnums userEnums);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <<<<<<< HEAD
|
||||||
|
* 修改会员是否拥有店铺
|
||||||
|
*
|
||||||
|
* @param haveStore 是否拥有店铺
|
||||||
|
* @param storeId 店铺id
|
||||||
|
* @param memberIds 会员id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void updateHaveShop(Boolean haveStore, String storeId, List<String> memberIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置会员密码为123456
|
||||||
|
*
|
||||||
|
* @param ids 会员id
|
||||||
|
*/
|
||||||
|
void resetPassword(List<String> ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有会员的手机号
|
* 获取所有会员的手机号
|
||||||
*
|
*
|
||||||
@ -269,7 +285,6 @@ public interface MemberService extends IService<Member> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户VO
|
* 获取用户VO
|
||||||
*
|
|
||||||
* @param id 会员id
|
* @param id 会员id
|
||||||
* @return 用户VO
|
* @return 用户VO
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,41 @@
|
|||||||
|
package cn.lili.modules.member.service;
|
||||||
|
|
||||||
|
import cn.lili.modules.member.entity.dos.StoreClerkRole;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺店员角色业务层
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020/11/17 3:46 下午
|
||||||
|
*/
|
||||||
|
public interface StoreClerkRoleService extends IService<StoreClerkRole> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户查看拥有的角色
|
||||||
|
*
|
||||||
|
* @param clerkId 店员id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<StoreClerkRole> listByUserId(String clerkId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据店员id查看角色
|
||||||
|
*
|
||||||
|
* @param clerkId 店员id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<String> listId(String clerkId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新用户拥有的角色
|
||||||
|
*
|
||||||
|
* @param clerkId 店员id
|
||||||
|
* @param storeClerkRoles 角色权限
|
||||||
|
*/
|
||||||
|
void updateClerkRole(String clerkId, List<StoreClerkRole> storeClerkRoles);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
package cn.lili.modules.member.service;
|
||||||
|
|
||||||
|
import cn.lili.modules.member.entity.dos.StoreDepartmentRole;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门角色业务层
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020/11/22 12:08
|
||||||
|
*/
|
||||||
|
public interface StoreDepartmentRoleService extends IService<StoreDepartmentRole> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据部门获取角色集合
|
||||||
|
*
|
||||||
|
* @param storeDepartmentId 店铺部门id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<StoreDepartmentRole> listByDepartmentId(String storeDepartmentId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新部门角色关联
|
||||||
|
*
|
||||||
|
* @param storeDepartmentId 店铺部门id
|
||||||
|
* @param storeDepartmentRoles 店铺部门角色
|
||||||
|
*/
|
||||||
|
void updateByDepartmentId(String storeDepartmentId, List<StoreDepartmentRole> storeDepartmentRoles);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据部门id删除部门与角色关联
|
||||||
|
*
|
||||||
|
* @param ids id集合
|
||||||
|
*/
|
||||||
|
void deleteByDepartment(List<String> ids);
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package cn.lili.modules.member.service;
|
||||||
|
|
||||||
|
import cn.lili.modules.member.entity.dos.StoreDepartment;
|
||||||
|
import cn.lili.modules.member.entity.vo.StoreDepartmentVO;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺部门业务层
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020/11/17 3:43 下午
|
||||||
|
*/
|
||||||
|
public interface StoreDepartmentService extends IService<StoreDepartment> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取部门树
|
||||||
|
*
|
||||||
|
* @param initWrapper
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<StoreDepartmentVO> tree(QueryWrapper<StoreDepartment> initWrapper);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除部门
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
*/
|
||||||
|
void deleteByIds(List<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新店铺部门
|
||||||
|
*
|
||||||
|
* @param storeDepartment 店铺部门
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Boolean update(StoreDepartment storeDepartment);
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
package cn.lili.modules.member.service;
|
package cn.lili.modules.member.service;
|
||||||
|
|
||||||
import cn.lili.modules.store.entity.dos.StoreLogistics;
|
import cn.lili.modules.store.entity.dos.StoreLogistics;
|
||||||
|
import cn.lili.modules.store.entity.dto.StoreLogisticsCustomerDTO;
|
||||||
import cn.lili.modules.system.entity.vo.StoreLogisticsVO;
|
import cn.lili.modules.system.entity.vo.StoreLogisticsVO;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
@ -45,7 +46,48 @@ public interface StoreLogisticsService extends IService<StoreLogistics> {
|
|||||||
* @param storeId 店铺id
|
* @param storeId 店铺id
|
||||||
* @return 店铺物流公司
|
* @return 店铺物流公司
|
||||||
*/
|
*/
|
||||||
StoreLogistics add(String logisticsId, String storeId);
|
StoreLogistics add(String logisticsId, String storeId, StoreLogisticsCustomerDTO storeLogisticsCustomerDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前店铺已选择的物流公司并使用电子面单列表
|
||||||
|
*
|
||||||
|
* @param storeId 店铺id
|
||||||
|
* @return 物流公司列表
|
||||||
|
*/
|
||||||
|
List<StoreLogisticsVO> getStoreSelectedLogisticsUseFaceSheet(String storeId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改店铺-物流公司电子面单参数
|
||||||
|
* @param logisticsId 物流公司设置id
|
||||||
|
* @param storeId 店铺id
|
||||||
|
* @return 店铺物流公司
|
||||||
|
*/
|
||||||
|
StoreLogistics update(String logisticsId, String storeId, StoreLogisticsCustomerDTO storeLogisticsCustomerDTO);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取店铺物流信息回填
|
||||||
|
* @param logisticsId 物流id
|
||||||
|
* @return 店铺物流信息
|
||||||
|
*/
|
||||||
|
StoreLogistics getStoreLogisticsInfo(String logisticsId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前店铺已开启的物流公司列表
|
||||||
|
*
|
||||||
|
* @param storeId 店铺id
|
||||||
|
* @return 物流公司列表
|
||||||
|
*/
|
||||||
|
List<StoreLogisticsVO> getOpenStoreLogistics(String storeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前店铺未开启的物流公司列表
|
||||||
|
*
|
||||||
|
* @param storeId 店铺id
|
||||||
|
* @return 物流公司列表
|
||||||
|
*/
|
||||||
|
List<StoreLogisticsVO> getCloseStoreLogistics(String storeId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
package cn.lili.modules.member.service;
|
||||||
|
|
||||||
|
import cn.lili.modules.member.entity.dos.StoreMenuRole;
|
||||||
|
import cn.lili.modules.member.entity.vo.StoreUserMenuVO;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色菜单接口
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020/11/22 11:43
|
||||||
|
*/
|
||||||
|
public interface StoreMenuRoleService extends IService<StoreMenuRole> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过角色获取菜单权限列表
|
||||||
|
*
|
||||||
|
* @param roleId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<StoreMenuRole> findByRoleId(String roleId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据角色集合获取拥有的菜单具体权限
|
||||||
|
*
|
||||||
|
* @param clerkId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<StoreUserMenuVO> findAllMenu(String clerkId,String memberId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新某角色拥有到菜单
|
||||||
|
*
|
||||||
|
* @param roleId 角色id
|
||||||
|
* @param roleMenus
|
||||||
|
*/
|
||||||
|
void updateRoleMenu(String roleId, List<StoreMenuRole> roleMenus);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据角色id 删除数据
|
||||||
|
*
|
||||||
|
* @param roleId
|
||||||
|
*/
|
||||||
|
void delete(String roleId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据角色id 删除数据
|
||||||
|
*
|
||||||
|
* @param roleId
|
||||||
|
*/
|
||||||
|
void delete(List<String> roleId);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,74 @@
|
|||||||
|
package cn.lili.modules.member.service;
|
||||||
|
|
||||||
|
import cn.lili.modules.member.entity.dos.StoreMenu;
|
||||||
|
import cn.lili.modules.member.entity.vo.StoreMenuVO;
|
||||||
|
import cn.lili.modules.permission.entity.dto.MenuSearchParams;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.springframework.cache.annotation.CacheConfig;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺菜单权限业务层
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020/11/17 3:45 下午
|
||||||
|
*/
|
||||||
|
@CacheConfig(cacheNames = "{store_menu}")
|
||||||
|
public interface StoreMenuService extends IService<StoreMenu> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过用户的菜单权限
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<StoreMenuVO> findUserTree();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过用户id获取
|
||||||
|
*
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<StoreMenu> findUserList(String userId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据角色id获取菜单集合
|
||||||
|
*
|
||||||
|
* @param roleIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<StoreMenu> findByRoleIds(String roleIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 树形结构
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<StoreMenuVO> tree();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询列表
|
||||||
|
*
|
||||||
|
* @param menuSearchParams
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<StoreMenu> searchList(MenuSearchParams menuSearchParams);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
*/
|
||||||
|
void deleteIds(List<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加更新菜单
|
||||||
|
*
|
||||||
|
* @param storeMenu 菜单数据
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
boolean saveOrUpdateMenu(StoreMenu storeMenu);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package cn.lili.modules.member.service;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.lili.modules.member.entity.dos.StoreRole;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色业务层
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020/11/17 3:45 下午
|
||||||
|
*/
|
||||||
|
public interface StoreRoleService extends IService<StoreRole> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取默认角色
|
||||||
|
*
|
||||||
|
* @param defaultRole
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<StoreRole> findByDefaultRole(Boolean defaultRole);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除角色
|
||||||
|
*
|
||||||
|
* @param roleIds
|
||||||
|
*/
|
||||||
|
void deleteRoles(List<String> roleIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改角色
|
||||||
|
*
|
||||||
|
* @param storeRole 店铺角色
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Boolean update(StoreRole storeRole);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存店铺角色
|
||||||
|
*
|
||||||
|
* @param storeRole 店铺角色
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Boolean saveStoreRole(StoreRole storeRole);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前店铺 根据角色id查询角色
|
||||||
|
*
|
||||||
|
* @param ids 角色id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<StoreRole> list(List<String> ids);
|
||||||
|
}
|
@ -0,0 +1,323 @@
|
|||||||
|
package cn.lili.modules.member.serviceimpl;
|
||||||
|
|
||||||
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
|
import cn.lili.common.enums.ResultCode;
|
||||||
|
import cn.lili.common.exception.ServiceException;
|
||||||
|
import cn.lili.common.security.context.UserContext;
|
||||||
|
import cn.lili.common.utils.BeanUtil;
|
||||||
|
import cn.lili.common.utils.StringUtils;
|
||||||
|
import cn.lili.common.vo.PageVO;
|
||||||
|
import cn.lili.modules.member.entity.dos.Clerk;
|
||||||
|
import cn.lili.modules.member.entity.dos.Member;
|
||||||
|
import cn.lili.modules.member.entity.dos.StoreClerkRole;
|
||||||
|
import cn.lili.modules.member.entity.dos.StoreRole;
|
||||||
|
import cn.lili.modules.member.entity.dto.ClerkAddDTO;
|
||||||
|
import cn.lili.modules.member.entity.dto.ClerkEditDTO;
|
||||||
|
import cn.lili.modules.member.entity.dto.ClerkQueryDTO;
|
||||||
|
import cn.lili.modules.member.entity.vo.ClerkVO;
|
||||||
|
import cn.lili.modules.member.mapper.ClerkMapper;
|
||||||
|
import cn.lili.modules.member.service.*;
|
||||||
|
import cn.lili.mybatis.util.PageUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店员业务实现
|
||||||
|
*
|
||||||
|
* @author wget
|
||||||
|
* @title: ClerkServiceImpl
|
||||||
|
* @projectName lilishop
|
||||||
|
* @date 2021/12/28 8:13 下午
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public class ClerkServiceImpl extends ServiceImpl<ClerkMapper, Clerk> implements ClerkService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StoreRoleService storeRoleService;
|
||||||
|
@Autowired
|
||||||
|
private StoreDepartmentService storeDepartmentService;
|
||||||
|
@Autowired
|
||||||
|
private MemberService memberService;
|
||||||
|
@Autowired
|
||||||
|
private StoreClerkRoleService storeClerkRoleService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<ClerkVO> clerkForPage(PageVO page, ClerkQueryDTO clerkQueryDTO) {
|
||||||
|
|
||||||
|
QueryWrapper<ClerkVO> clerkVOQueryWrapper = new QueryWrapper<>();
|
||||||
|
clerkVOQueryWrapper.eq("li_clerk.store_id", UserContext.getCurrentUser().getStoreId());
|
||||||
|
clerkVOQueryWrapper.eq(StringUtils.isNotEmpty(clerkQueryDTO.getDepartmentId()), "li_clerk.department_id", clerkQueryDTO.getDepartmentId());
|
||||||
|
clerkVOQueryWrapper.like(StringUtils.isNotEmpty(clerkQueryDTO.getClerkName()), "li_clerk.clerk_name", clerkQueryDTO.getClerkName());
|
||||||
|
clerkVOQueryWrapper.like(StringUtils.isNotEmpty(clerkQueryDTO.getMobile()), "m.mobile", clerkQueryDTO.getMobile());
|
||||||
|
IPage<ClerkVO> clerkPage = this.baseMapper.selectClerkPage(PageUtil.initPage(page), clerkVOQueryWrapper);
|
||||||
|
|
||||||
|
return clerkPage;
|
||||||
|
|
||||||
|
|
||||||
|
/*Page<Clerk> clerkPage = page(initPage, initWrapper);
|
||||||
|
|
||||||
|
if (clerkPage.getRecords().size() > 0) {
|
||||||
|
List<StoreRole> roles = storeRoleService.list(new QueryWrapper<StoreRole>()
|
||||||
|
.eq("store_id", UserContext.getCurrentUser().getStoreId()));
|
||||||
|
|
||||||
|
List<StoreDepartment> departments = storeDepartmentService.list(new QueryWrapper<StoreDepartment>()
|
||||||
|
.eq("store_id", UserContext.getCurrentUser().getStoreId()));
|
||||||
|
|
||||||
|
List<String> memberIds = new ArrayList<>();
|
||||||
|
clerkPage.getRecords().forEach(clerk -> {
|
||||||
|
memberIds.add(clerk.getMemberId());
|
||||||
|
});
|
||||||
|
List<Member> members = memberService.list(new QueryWrapper<Member>().in("id", memberIds));
|
||||||
|
|
||||||
|
List<ClerkVO> result = new ArrayList<>();
|
||||||
|
|
||||||
|
clerkPage.getRecords().forEach(clerk -> {
|
||||||
|
ClerkVO clerkVO = new ClerkVO(clerk);
|
||||||
|
if (!CharSequenceUtil.isEmpty(clerk.getDepartmentId())) {
|
||||||
|
try {
|
||||||
|
clerkVO.setDepartmentTitle(
|
||||||
|
departments.stream().filter
|
||||||
|
(department -> department.getId().equals(clerk.getDepartmentId()))
|
||||||
|
.collect(Collectors.toList())
|
||||||
|
.get(0)
|
||||||
|
.getTitle()
|
||||||
|
);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("填充部门信息异常", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
clerkVO.setMobile(
|
||||||
|
members.stream().filter
|
||||||
|
(member -> member.getId().equals(clerk.getMemberId()))
|
||||||
|
.collect(Collectors.toList())
|
||||||
|
.get(0)
|
||||||
|
.getMobile()
|
||||||
|
);
|
||||||
|
if (!StringUtils.isEmpty(clerk.getRoleIds())) {
|
||||||
|
try {
|
||||||
|
List<String> memberRoles = Arrays.asList(clerk.getRoleIds().split(","));
|
||||||
|
clerkVO.setRoles(
|
||||||
|
roles.stream().filter
|
||||||
|
(role -> memberRoles.contains(role.getId()))
|
||||||
|
.collect(Collectors.toList())
|
||||||
|
);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("填充部门信息异常", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result.add(clerkVO);
|
||||||
|
});
|
||||||
|
Page<ClerkVO> pageResult = new Page(clerkPage.getCurrent(), clerkPage.getSize(), clerkPage.getTotal());
|
||||||
|
pageResult.setRecords(result);
|
||||||
|
return pageResult;
|
||||||
|
}
|
||||||
|
return new Page<ClerkVO>();*/
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ClerkVO get(String id) {
|
||||||
|
Clerk clerk = this.getById(id);
|
||||||
|
ClerkVO clerkVO = new ClerkVO(clerk);
|
||||||
|
//手机号码
|
||||||
|
clerkVO.setMobile(memberService.getById(clerk.getMemberId()).getMobile());
|
||||||
|
if (!CharSequenceUtil.isEmpty(clerk.getDepartmentId())) {
|
||||||
|
clerkVO.setDepartmentTitle(storeDepartmentService.getById(clerk.getDepartmentId()).getTitle());
|
||||||
|
}
|
||||||
|
if (!StringUtils.isEmpty(clerk.getRoleIds())) {
|
||||||
|
List<String> memberRoles = Arrays.asList(clerk.getRoleIds().split(","));
|
||||||
|
List<StoreRole> roles = storeRoleService.list(new QueryWrapper<StoreRole>()
|
||||||
|
.eq("store_id", UserContext.getCurrentUser().getStoreId()));
|
||||||
|
clerkVO.setRoles(
|
||||||
|
roles.stream().filter
|
||||||
|
(role -> memberRoles.contains(role.getId()))
|
||||||
|
.collect(Collectors.toList())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return clerkVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Clerk updateClerk(ClerkEditDTO clerkEditDTO) {
|
||||||
|
Clerk clerk = this.getById(clerkEditDTO.getId());
|
||||||
|
if (clerk != null) {
|
||||||
|
//校验当前店员是否是当前店铺的
|
||||||
|
if (!clerk.getStoreId().equals(UserContext.getCurrentUser().getStoreId())) {
|
||||||
|
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
|
||||||
|
}
|
||||||
|
if (clerkEditDTO.getIsSuper()) {
|
||||||
|
clerk.setRoleIds("");
|
||||||
|
} else {
|
||||||
|
//角色赋值
|
||||||
|
if (!clerkEditDTO.getRoles().isEmpty()) {
|
||||||
|
clerk.setRoleIds(CharSequenceUtil.join(",", clerkEditDTO.getRoles()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//部门校验
|
||||||
|
if (StringUtils.isNotEmpty(clerkEditDTO.getDepartmentId())) {
|
||||||
|
if (storeDepartmentService.getById(clerkEditDTO.getDepartmentId()) != null) {
|
||||||
|
clerk.setDepartmentId(clerkEditDTO.getDepartmentId());
|
||||||
|
} else {
|
||||||
|
throw new ServiceException(ResultCode.PERMISSION_NOT_FOUND_ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
clerk.setIsSuper(clerkEditDTO.getIsSuper());
|
||||||
|
this.updateById(clerk);
|
||||||
|
return clerk;
|
||||||
|
}
|
||||||
|
throw new ServiceException(ResultCode.CLERK_NOT_FOUND_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Clerk saveClerk(ClerkAddDTO clerkAddDTO) {
|
||||||
|
Clerk clerk = new Clerk(clerkAddDTO);
|
||||||
|
clerk.setShopkeeper(clerkAddDTO.getShopkeeper());
|
||||||
|
clerk.setIsSuper(clerkAddDTO.getIsSuper());
|
||||||
|
//校验此会员是否已经是店员
|
||||||
|
Clerk temp = this.getClerkByMemberId(clerkAddDTO.getMemberId());
|
||||||
|
if (temp != null && !temp.getStoreId().equals(UserContext.getCurrentUser().getStoreId())) {
|
||||||
|
throw new ServiceException(ResultCode.CLERK_USER_ERROR);
|
||||||
|
}
|
||||||
|
if (temp != null && temp.getStoreId().equals(UserContext.getCurrentUser().getStoreId())) {
|
||||||
|
throw new ServiceException(ResultCode.CLERK_ALREADY_EXIT_ERROR);
|
||||||
|
}
|
||||||
|
//部门校验
|
||||||
|
if (StringUtils.isNotEmpty(clerkAddDTO.getDepartmentId())) {
|
||||||
|
if (storeDepartmentService.getById(clerkAddDTO.getDepartmentId()) == null) {
|
||||||
|
throw new ServiceException(ResultCode.PERMISSION_NOT_FOUND_ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//角色校验
|
||||||
|
if (clerkAddDTO.getRoles() != null && clerkAddDTO.getRoles().size() > 0) {
|
||||||
|
List<StoreRole> storeRoles = storeRoleService.list(clerkAddDTO.getRoles());
|
||||||
|
if (storeRoles.size() != clerkAddDTO.getRoles().size()) {
|
||||||
|
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.save(clerk);
|
||||||
|
|
||||||
|
//判断用户角色权限不为超级会员且权限路径不为空
|
||||||
|
if(clerkAddDTO.getIsSuper()==false && clerkAddDTO.getRoles()!=null){
|
||||||
|
//添加店员用户角色
|
||||||
|
List<StoreClerkRole> storeClerkRoleList = new ArrayList<>();
|
||||||
|
|
||||||
|
clerkAddDTO.getRoles().stream().forEach(a -> {
|
||||||
|
storeClerkRoleList.add(StoreClerkRole.builder().clerkId(clerk.getId()).roleId(a).build());
|
||||||
|
});
|
||||||
|
storeClerkRoleService.saveBatch(storeClerkRoleList);
|
||||||
|
}
|
||||||
|
|
||||||
|
return clerk;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Clerk getClerkByMemberId(String memberId) {
|
||||||
|
return this.getOne(new QueryWrapper<Clerk>().eq("member_id", memberId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void resetPassword(List<String> ids) {
|
||||||
|
QueryWrapper<Clerk> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("store_id", UserContext.getCurrentUser().getStoreId());
|
||||||
|
queryWrapper.in("id", ids);
|
||||||
|
List<Clerk> clerks = this.baseMapper.selectList(queryWrapper);
|
||||||
|
//校验要重置的店员是否是当前店铺的店员
|
||||||
|
if (clerks.size() != ids.size()) {
|
||||||
|
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
|
||||||
|
}
|
||||||
|
//店员密码就是会员密码所以要组织会员修改密码参数信息
|
||||||
|
List<String> memberIds = new ArrayList<>();
|
||||||
|
clerks.forEach(clerk -> {
|
||||||
|
//如果是店主无法重置密码
|
||||||
|
if (clerk.getShopkeeper()) {
|
||||||
|
throw new ServiceException(ResultCode.CLERK_SUPPER);
|
||||||
|
}
|
||||||
|
memberIds.add(clerk.getMemberId());
|
||||||
|
});
|
||||||
|
memberService.resetPassword(memberIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteClerk(List<String> ids) {
|
||||||
|
QueryWrapper<Clerk> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("store_id", UserContext.getCurrentUser().getStoreId());
|
||||||
|
queryWrapper.in("id", ids);
|
||||||
|
List<Clerk> clerks = this.baseMapper.selectList(queryWrapper);
|
||||||
|
if (clerks.size() > 0) {
|
||||||
|
//校验要重置的店员是否是当前店铺的店员
|
||||||
|
if (clerks.size() != ids.size()) {
|
||||||
|
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
|
||||||
|
}
|
||||||
|
//删除店员
|
||||||
|
this.removeByIds(ids);
|
||||||
|
//更改会员为为拥有店铺
|
||||||
|
List<String> memberIds = new ArrayList<>();
|
||||||
|
clerks.forEach(clerk -> {
|
||||||
|
//无法删除当前登录的店员
|
||||||
|
if (UserContext.getCurrentUser().getClerkId().equals(clerk.getId())) {
|
||||||
|
throw new ServiceException(ResultCode.CLERK_CURRENT_SUPPER);
|
||||||
|
}
|
||||||
|
//无法删除店主
|
||||||
|
if (clerk.getShopkeeper()) {
|
||||||
|
throw new ServiceException(ResultCode.CLERK_SUPPER);
|
||||||
|
}
|
||||||
|
memberIds.add(clerk.getMemberId());
|
||||||
|
});
|
||||||
|
memberService.updateHaveShop(false, null, memberIds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Member checkClerk(String mobile) {
|
||||||
|
//校验是否已经是会员
|
||||||
|
Member member = memberService.findByMobile(mobile);
|
||||||
|
if (member != null) {
|
||||||
|
//校验要添加的会员是否已经是店主
|
||||||
|
if (member.getHaveStore()) {
|
||||||
|
throw new ServiceException(ResultCode.STORE_APPLY_DOUBLE_ERROR);
|
||||||
|
}
|
||||||
|
//校验会员的有效性
|
||||||
|
if (!member.getDisabled()) {
|
||||||
|
throw new ServiceException(ResultCode.USER_STATUS_ERROR);
|
||||||
|
}
|
||||||
|
//校验此会员是否已经是店员
|
||||||
|
Clerk clerk = this.getClerkByMemberId(member.getId());
|
||||||
|
if (clerk != null && !clerk.getStoreId().equals(UserContext.getCurrentUser().getStoreId())) {
|
||||||
|
throw new ServiceException(ResultCode.CLERK_USER_ERROR);
|
||||||
|
}
|
||||||
|
if (clerk != null && clerk.getStoreId().equals(UserContext.getCurrentUser().getStoreId())) {
|
||||||
|
throw new ServiceException(ResultCode.CLERK_ALREADY_EXIT_ERROR);
|
||||||
|
}
|
||||||
|
return member;
|
||||||
|
}
|
||||||
|
return new Member();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void disable(String id, Boolean status) {
|
||||||
|
Clerk clerk = this.getById(id);
|
||||||
|
if (clerk == null) {
|
||||||
|
throw new ServiceException(ResultCode.USER_NOT_EXIST);
|
||||||
|
}
|
||||||
|
//店主无法禁用
|
||||||
|
if (clerk.getShopkeeper() && clerk.getStatus()) {
|
||||||
|
throw new ServiceException(ResultCode.CLERK_SUPPER);
|
||||||
|
}
|
||||||
|
clerk.setStatus(status);
|
||||||
|
this.updateById(clerk);
|
||||||
|
}
|
||||||
|
}
|
@ -27,7 +27,7 @@ import java.util.List;
|
|||||||
* @since 2020/11/17 3:44 下午
|
* @since 2020/11/17 3:44 下午
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = java.lang.Exception.class)
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
||||||
public class MemberNoticeSenterServiceImpl extends ServiceImpl<MemberNoticeSenterMapper, MemberNoticeSenter> implements MemberNoticeSenterService {
|
public class MemberNoticeSenterServiceImpl extends ServiceImpl<MemberNoticeSenterMapper, MemberNoticeSenter> implements MemberNoticeSenterService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -5,7 +5,6 @@ import cn.hutool.core.convert.Convert;
|
|||||||
import cn.hutool.core.text.CharSequenceUtil;
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
import cn.lili.cache.Cache;
|
import cn.lili.cache.Cache;
|
||||||
import cn.lili.cache.CachePrefix;
|
import cn.lili.cache.CachePrefix;
|
||||||
import cn.lili.common.aop.annotation.DemoSite;
|
|
||||||
import cn.lili.common.context.ThreadContextHolder;
|
import cn.lili.common.context.ThreadContextHolder;
|
||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
import cn.lili.common.enums.SwitchEnum;
|
import cn.lili.common.enums.SwitchEnum;
|
||||||
@ -19,6 +18,7 @@ import cn.lili.common.security.token.Token;
|
|||||||
import cn.lili.common.sensitive.SensitiveWordsFilter;
|
import cn.lili.common.sensitive.SensitiveWordsFilter;
|
||||||
import cn.lili.common.utils.BeanUtil;
|
import cn.lili.common.utils.BeanUtil;
|
||||||
import cn.lili.common.utils.CookieUtil;
|
import cn.lili.common.utils.CookieUtil;
|
||||||
|
import cn.lili.common.utils.StringUtils;
|
||||||
import cn.lili.common.utils.SnowFlake;
|
import cn.lili.common.utils.SnowFlake;
|
||||||
import cn.lili.common.utils.UuidUtils;
|
import cn.lili.common.utils.UuidUtils;
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
@ -43,6 +43,7 @@ import cn.lili.modules.store.entity.dos.Store;
|
|||||||
import cn.lili.modules.store.entity.enums.StoreStatusEnum;
|
import cn.lili.modules.store.entity.enums.StoreStatusEnum;
|
||||||
import cn.lili.modules.store.service.StoreService;
|
import cn.lili.modules.store.service.StoreService;
|
||||||
import cn.lili.mybatis.util.PageUtil;
|
import cn.lili.mybatis.util.PageUtil;
|
||||||
|
import cn.lili.rocketmq.RocketmqSendCallbackBuilder;
|
||||||
import cn.lili.rocketmq.tags.MemberTagsEnum;
|
import cn.lili.rocketmq.tags.MemberTagsEnum;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
@ -50,6 +51,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
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;
|
||||||
|
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.ApplicationEventPublisher;
|
import org.springframework.context.ApplicationEventPublisher;
|
||||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
@ -260,38 +262,6 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
|||||||
// 发送会员注册信息
|
// 发送会员注册信息
|
||||||
applicationEventPublisher.publishEvent(new TransactionCommitSendMQEvent("new member register", rocketmqCustomProperties.getMemberTopic(), MemberTagsEnum.MEMBER_REGISTER.name(), member));
|
applicationEventPublisher.publishEvent(new TransactionCommitSendMQEvent("new member register", rocketmqCustomProperties.getMemberTopic(), MemberTagsEnum.MEMBER_REGISTER.name(), member));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Member editOwn(MemberEditDTO memberEditDTO) {
|
|
||||||
//查询会员信息
|
|
||||||
Member member = this.findByUsername(Objects.requireNonNull(UserContext.getCurrentUser()).getUsername());
|
|
||||||
//传递修改会员信息
|
|
||||||
BeanUtil.copyProperties(memberEditDTO, member);
|
|
||||||
//修改会员
|
|
||||||
this.updateById(member);
|
|
||||||
return member;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@DemoSite
|
|
||||||
public Member modifyPass(String oldPassword, String newPassword) {
|
|
||||||
AuthUser tokenUser = UserContext.getCurrentUser();
|
|
||||||
if (tokenUser == null) {
|
|
||||||
throw new ServiceException(ResultCode.USER_NOT_LOGIN);
|
|
||||||
}
|
|
||||||
Member member = this.getById(tokenUser.getId());
|
|
||||||
//判断旧密码输入是否正确
|
|
||||||
if (!new BCryptPasswordEncoder().matches(oldPassword, member.getPassword())) {
|
|
||||||
throw new ServiceException(ResultCode.USER_OLD_PASSWORD_ERROR);
|
|
||||||
}
|
|
||||||
//修改会员密码
|
|
||||||
LambdaUpdateWrapper<Member> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
|
||||||
lambdaUpdateWrapper.eq(Member::getId, member.getId());
|
|
||||||
lambdaUpdateWrapper.set(Member::getPassword, new BCryptPasswordEncoder().encode(newPassword));
|
|
||||||
this.update(lambdaUpdateWrapper);
|
|
||||||
return member;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canInitPass() {
|
public boolean canInitPass() {
|
||||||
AuthUser tokenUser = UserContext.getCurrentUser();
|
AuthUser tokenUser = UserContext.getCurrentUser();
|
||||||
@ -410,6 +380,11 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Member updateMember(ManagerMemberEditDTO managerMemberEditDTO) {
|
public Member updateMember(ManagerMemberEditDTO managerMemberEditDTO) {
|
||||||
|
//判断是否用户登录并且会员ID为当前登录会员ID
|
||||||
|
AuthUser tokenUser = UserContext.getCurrentUser();
|
||||||
|
if (tokenUser == null) {
|
||||||
|
throw new ServiceException(ResultCode.USER_NOT_LOGIN);
|
||||||
|
}
|
||||||
//过滤会员昵称敏感词
|
//过滤会员昵称敏感词
|
||||||
if (CharSequenceUtil.isNotBlank(managerMemberEditDTO.getNickName())) {
|
if (CharSequenceUtil.isNotBlank(managerMemberEditDTO.getNickName())) {
|
||||||
managerMemberEditDTO.setNickName(SensitiveWordsFilter.filter(managerMemberEditDTO.getNickName()));
|
managerMemberEditDTO.setNickName(SensitiveWordsFilter.filter(managerMemberEditDTO.getNickName()));
|
||||||
@ -649,6 +624,31 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateHaveShop(Boolean haveStore, String storeId, List<String> memberIds) {
|
||||||
|
List<Member> members = this.baseMapper.selectBatchIds(memberIds);
|
||||||
|
if (members.size() > 0) {
|
||||||
|
members.forEach(member -> {
|
||||||
|
member.setHaveStore(haveStore);
|
||||||
|
if (haveStore) {
|
||||||
|
member.setStoreId(storeId);
|
||||||
|
} else {
|
||||||
|
member.setStoreId(null);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.updateBatchById(members);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void resetPassword(List<String> ids) {
|
||||||
|
String password = new BCryptPasswordEncoder().encode(StringUtils.md5("123456"));
|
||||||
|
LambdaUpdateWrapper<Member> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
||||||
|
lambdaUpdateWrapper.in(Member::getId, ids);
|
||||||
|
lambdaUpdateWrapper.set(Member::getPassword, password);
|
||||||
|
this.update(lambdaUpdateWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有会员的手机号
|
* 获取所有会员的手机号
|
||||||
*
|
*
|
||||||
@ -765,4 +765,5 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme
|
|||||||
throw new ServiceException(ResultCode.USER_EXIST);
|
throw new ServiceException(ResultCode.USER_EXIST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
package cn.lili.modules.member.serviceimpl;
|
||||||
|
|
||||||
|
import cn.lili.modules.member.entity.dos.StoreClerkRole;
|
||||||
|
import cn.lili.modules.member.mapper.StoreClerkRoleMapper;
|
||||||
|
import cn.lili.modules.member.service.StoreClerkRoleService;
|
||||||
|
import cn.lili.modules.permission.entity.dos.UserRole;
|
||||||
|
import cn.lili.modules.permission.mapper.UserRoleMapper;
|
||||||
|
import cn.lili.modules.permission.service.UserRoleService;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户权限业务层实现
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020/11/17 3:52 下午
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public class StoreClerkRoleServiceImpl extends ServiceImpl<StoreClerkRoleMapper, StoreClerkRole> implements StoreClerkRoleService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<StoreClerkRole> listByUserId(String clerkId) {
|
||||||
|
QueryWrapper<StoreClerkRole> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("clerk_id", clerkId);
|
||||||
|
return this.baseMapper.selectList(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> listId(String clerkId) {
|
||||||
|
List<StoreClerkRole> userRoleList = this.listByUserId(clerkId);
|
||||||
|
List<String> strings = new ArrayList<>();
|
||||||
|
userRoleList.forEach(item -> strings.add(item.getRoleId()));
|
||||||
|
return strings;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateClerkRole(String clerkId, List<StoreClerkRole> storeClerkRoles) {
|
||||||
|
//删除
|
||||||
|
QueryWrapper<StoreClerkRole> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("clerk_id", clerkId);
|
||||||
|
this.remove(queryWrapper);
|
||||||
|
//保存
|
||||||
|
this.saveBatch(storeClerkRoles);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
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