Compare commits
200
Commits
2b7bc8deab
...
e7ecc2fd2c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e7ecc2fd2c | ||
|
|
0cc7a0a91d | ||
|
|
93326936c3 | ||
|
|
0c6d59a062 | ||
|
|
b83657b1ea | ||
|
|
67320a4787 | ||
|
|
667bdac868 | ||
|
|
416107e7f8 | ||
|
|
96256c3366 | ||
|
|
658a7cfc6b | ||
|
|
c9f39910f9 | ||
|
|
00287ca3b7 | ||
|
|
1e2aa98c97 | ||
|
|
ef6522fc74 | ||
|
|
2fe4a4e522 | ||
|
|
96c058ca9a | ||
|
|
2f847923ef | ||
|
|
2b131bdc0c | ||
|
|
8e5f91a68b | ||
|
|
17dd0fc6e9 | ||
|
|
934ec7168e | ||
|
|
a4fce1c895 | ||
|
|
deb6a1d888 | ||
|
|
99944dbad3 | ||
|
|
d22f483ef8 | ||
|
|
e7d9e25f57 | ||
|
|
765a37f82e | ||
|
|
2636c9e0c3 | ||
|
|
957641393c | ||
|
|
fe3cdd8e55 | ||
|
|
a0be0ebc0c | ||
|
|
1666184356 | ||
|
|
61460ce32f | ||
|
|
7f8f160863 | ||
|
|
8422ed1d4b | ||
|
|
2332dfba38 | ||
|
|
c1a11d8f86 | ||
|
|
1c66276bb1 | ||
|
|
e68298d177 | ||
|
|
810038864d | ||
|
|
e6eb95f057 | ||
|
|
c36a043751 | ||
|
|
075a9cc876 | ||
|
|
bb1def88d9 | ||
|
|
eec07ac718 | ||
|
|
0894e86d8c | ||
|
|
907a557c34 | ||
|
|
035f077e0c | ||
|
|
cddb87d922 | ||
|
|
9317daa90d | ||
|
|
4e5afdc272 | ||
|
|
33ff7edc2e | ||
|
|
54a431891a | ||
|
|
7db5bfbee5 | ||
|
|
9644338a59 | ||
|
|
bce4bf9ee3 | ||
|
|
f2b185b731 | ||
|
|
ee870fb9d1 | ||
|
|
0fedb2a3ff | ||
|
|
2fb43b4b1f | ||
|
|
43e6df6f72 | ||
|
|
9ddefa377a | ||
|
|
46c9ce8325 | ||
|
|
0e7cab1ab6 | ||
|
|
bcd821e210 | ||
|
|
32d51a3104 | ||
|
|
fb246dc2e4 | ||
|
|
642c616d23 | ||
|
|
cc19707f29 | ||
|
|
789d4071e8 | ||
|
|
d25929e461 | ||
|
|
5e089029a0 | ||
|
|
768267fd21 | ||
|
|
1bf9e94df3 | ||
|
|
736a59eda8 | ||
|
|
8cadef4bcd | ||
|
|
f29cc83be7 | ||
|
|
2d39bbe3c2 | ||
|
|
10a114cf95 | ||
|
|
9787739cff | ||
|
|
ee1736ccf8 | ||
|
|
68e216209a | ||
|
|
32702677fd | ||
|
|
6d1eb5a72a | ||
|
|
8ad4e7ad42 | ||
|
|
7f72fa0244 | ||
|
|
684762fb6c | ||
|
|
ded303b25a | ||
|
|
6e4aa1a2bb | ||
|
|
a2623df7e2 | ||
|
|
255b88a948 | ||
|
|
d7944b52fa | ||
|
|
5ed7afd0fe | ||
|
|
5c98efcbc5 | ||
|
|
1344217733 | ||
|
|
cce4230f0d | ||
|
|
86e8f08242 | ||
|
|
53512b7f9c | ||
|
|
62150787d0 | ||
|
|
39976c1368 | ||
|
|
23c190b11e | ||
|
|
df99986af6 | ||
|
|
780279b936 | ||
|
|
71acd46cb7 | ||
|
|
7cec1477cd | ||
|
|
26b60f81d4 | ||
|
|
e1527c5bd0 | ||
|
|
f1d6e2f2f6 | ||
|
|
d84b294966 | ||
|
|
8990e31f78 | ||
|
|
d84bf561ac | ||
|
|
0a2ec15518 | ||
|
|
bbeef4536a | ||
|
|
5d52c1cd68 | ||
|
|
5dc6a1ebbd | ||
|
|
5b2463cba0 | ||
|
|
186ee48a5e | ||
|
|
45e41f955f | ||
|
|
2a6b9517d5 | ||
|
|
2268b09f7f | ||
|
|
2fe790aa36 | ||
|
|
8e18dda8c8 | ||
|
|
e5f652d9af | ||
|
|
bc92b16b85 | ||
|
|
b576031346 | ||
|
|
05480e806b | ||
|
|
53d6dfd551 | ||
|
|
3d3c8f17e1 | ||
|
|
efc7f1bf27 | ||
|
|
62cecbcff9 | ||
|
|
b661d333e7 | ||
|
|
1294c3fcf6 | ||
|
|
1986c13796 | ||
|
|
b6ab272f7f | ||
|
|
1fc0483fe8 | ||
|
|
5e49326c89 | ||
|
|
7742b7b21d | ||
|
|
d6a384815d | ||
|
|
5fbb2c9b94 | ||
|
|
207d90b48a | ||
|
|
bf1df93b1f | ||
|
|
3758c8c31c | ||
|
|
912a36978a | ||
|
|
24f17f011d | ||
|
|
a8061efa2f | ||
|
|
385e2550da | ||
|
|
84b7874237 | ||
|
|
e3b523b41c | ||
|
|
24a685ae0c | ||
|
|
090d362a82 | ||
|
|
0669710359 | ||
|
|
55e81a41b6 | ||
|
|
003b195e79 | ||
|
|
069e329d9f | ||
|
|
24e4121c11 | ||
|
|
26c3629f7d | ||
|
|
a5ff990b9e | ||
|
|
c81ea9ebe7 | ||
|
|
a7e226d419 | ||
|
|
cb181564e5 | ||
|
|
5eaeefeb37 | ||
|
|
b98853e82b | ||
|
|
daea412d34 | ||
|
|
200cb8390e | ||
|
|
6ad6ebafb2 | ||
|
|
6373eaf4e5 | ||
|
|
f868d94b08 | ||
|
|
9154a813df | ||
|
|
9d02420a51 | ||
|
|
2cf9867971 | ||
|
|
ca6378961d | ||
|
|
c4dc05f87e | ||
|
|
f9cc37dc20 | ||
|
|
b41d85dc2a | ||
|
|
51cd3a9cf5 | ||
|
|
8bb3f14337 | ||
|
|
33f47efad9 | ||
|
|
0843924e06 | ||
|
|
1a9c7d3655 | ||
|
|
5a3d9a4a11 | ||
|
|
92621b51a0 | ||
|
|
f167532bed | ||
|
|
d91a065976 | ||
|
|
d53cfaadab | ||
|
|
00331148f3 | ||
|
|
0db2942043 | ||
|
|
ee6783ab4f | ||
|
|
0a0bccdc54 | ||
|
|
e56d6da230 | ||
|
|
ff25e0e5cf | ||
|
|
8647444e10 | ||
|
|
a3d8df9ad8 | ||
|
|
fbaf8d150d | ||
|
|
1198def17e | ||
|
|
dbee49727e | ||
|
|
e717df69ba | ||
|
|
30cc11c44e | ||
|
|
c303814c09 | ||
|
|
3672f9b5b4 | ||
|
|
cbd6b72f2f |
No files matched your search
@@ -9,6 +9,8 @@ indent_style = tab
|
||||
indent_size = 4
|
||||
continuation_indent_size = 8
|
||||
end_of_line = lf
|
||||
insert_final_newline = false
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{js, html}]
|
||||
indent_style = space
|
||||
|
||||
@@ -133,4 +133,42 @@ CREATE TABLE `third_zy_id_dict`
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci
|
||||
ROW_FORMAT = DYNAMIC COMMENT ='正元字典id对应 id + bizType 唯一';
|
||||
ROW_FORMAT = DYNAMIC COMMENT ='正元字典id对应 id + bizType 唯一';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for third_pay_order
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `third_pay_order`;
|
||||
CREATE TABLE `third_pay_order`
|
||||
(
|
||||
`id` bigint NOT NULL COMMENT '主键',
|
||||
|
||||
`pay_platform_type` varchar(32) NOT NULL COMMENT '支付平台类型',
|
||||
`biz_type` varchar(32) NOT NULL COMMENT '支付类型',
|
||||
`biz_id` varchar(128) NOT NULL COMMENT '支付相关id',
|
||||
`user_id` bigint NOT NULL COMMENT '用户id',
|
||||
`user_code` varchar(64) DEFAULT NULL COMMENT '用户code',
|
||||
`price` int NOT NULL COMMENT '支付金额(分)',
|
||||
`status` varchar(128) DEFAULT NULL COMMENT '支付状态',
|
||||
|
||||
`pay_no` varchar(128) DEFAULT NULL COMMENT '支付订单号',
|
||||
`pay_time` datetime DEFAULT NULL COMMENT '支付时间',
|
||||
`pay_res` text DEFAULT NULL COMMENT '支付返回',
|
||||
|
||||
`refund_no` varchar(128) DEFAULT NULL COMMENT '退款订单号',
|
||||
`refund_time` datetime DEFAULT NULL COMMENT '退款时间',
|
||||
`refund_res` text DEFAULT NULL COMMENT '退款返回',
|
||||
|
||||
`expire_time` datetime DEFAULT NULL COMMENT '订单过期时间',
|
||||
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`create_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
`update_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '删除时间',
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci
|
||||
ROW_FORMAT = DYNAMIC COMMENT ='第三方支付订单';
|
||||
@@ -13,3 +13,26 @@ CREATE TABLE `hard_panel_setting`
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='大屏配置表';
|
||||
|
||||
|
||||
-- app版本控制表
|
||||
CREATE TABLE `app_version`
|
||||
(
|
||||
`id` bigint NOT NULL COMMENT '主键ID',
|
||||
`app_unique_code` varchar(32) DEFAULT NULL COMMENT 'app唯一编码',
|
||||
`platform` varchar(32) NOT NULL COMMENT '平台类型(android、ios)',
|
||||
`version_code` int NOT NULL COMMENT '内部版本号(用于比较大小)',
|
||||
`version_name` varchar(32) NOT NULL COMMENT '展示版本号(字符串)',
|
||||
`update_content` text COMMENT '更新内容/更新日志',
|
||||
`download_url` varchar(512) NOT NULL COMMENT '安装包下载地址(wgt、apk)',
|
||||
`is_force` varchar(32) NOT NULL COMMENT '是否强制更新',
|
||||
`is_silent` varchar(32) NOT NULL COMMENT '是否静默更新(WGT用)',
|
||||
`status` varchar(32) NOT NULL COMMENT '状态(已发布、未发布、已下架)',
|
||||
`create_by` varchar(50) DEFAULT NULL COMMENT '创建者',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_by` varchar(50) DEFAULT NULL COMMENT '更新者',
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`del_flag` char(1) DEFAULT '0' COMMENT '是否删除(0=正常 1=删除)',
|
||||
`tenant_id` bigint(20) DEFAULT NULL COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='app版本控制表';
|
||||
@@ -0,0 +1,43 @@
|
||||
CREATE OR REPLACE VIEW pjcloudx_wallet.v_mch_dept_tree AS
|
||||
WITH RECURSIVE
|
||||
root AS (SELECT m.dept_id AS root_dept_id,
|
||||
m.id AS mch_id,
|
||||
m.name AS mch_name
|
||||
FROM pjcloudx_wallet.mch_manage AS m
|
||||
JOIN pjcloudx.sys_dept AS d
|
||||
ON d.dept_id = m.dept_id
|
||||
AND d.del_flag = '0'
|
||||
WHERE m.del_flag = '0'
|
||||
AND m.types = '1'),
|
||||
r (dept_id, parent_id, dept_name, root_dept_id, mch_id, mch_name, level) AS (SELECT d.dept_id,
|
||||
d.parent_id,
|
||||
d.name,
|
||||
root.root_dept_id,
|
||||
root.mch_id,
|
||||
root.mch_name,
|
||||
0
|
||||
FROM pjcloudx.sys_dept AS d
|
||||
JOIN root
|
||||
ON root.root_dept_id = d.dept_id
|
||||
WHERE d.del_flag = '0'
|
||||
UNION ALL
|
||||
SELECT c.dept_id,
|
||||
c.parent_id,
|
||||
c.name,
|
||||
r.root_dept_id,
|
||||
r.mch_id,
|
||||
r.mch_name,
|
||||
r.level + 1
|
||||
FROM pjcloudx.sys_dept AS c
|
||||
JOIN r
|
||||
ON c.parent_id = r.dept_id
|
||||
WHERE c.del_flag = '0')
|
||||
SELECT root_dept_id AS mchDeptId,
|
||||
mch_id AS mchId,
|
||||
mch_name AS mchName,
|
||||
dept_id AS deptId,
|
||||
parent_id AS parentId,
|
||||
dept_name AS deptName,
|
||||
level AS level
|
||||
FROM r
|
||||
ORDER BY mchDeptId, level, deptId;
|
||||
@@ -571,4 +571,32 @@ CREATE TABLE hard_spu_repertory
|
||||
del_flag char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
|
||||
tenant_id bigint DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE = InnoDB COMMENT ='硬件商品库存更新记录';
|
||||
) ENGINE = InnoDB COMMENT ='硬件商品库存更新记录';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for hard_third_mi_order
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS hard_third_mi_order;
|
||||
CREATE TABLE hard_third_mi_order
|
||||
(
|
||||
id bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
|
||||
biz_type tinytext NOT NULL COMMENT '上架类型',
|
||||
user_id bigint NOT NULL COMMENT '用户id',
|
||||
auth_id bigint COMMENT '授权id',
|
||||
flow_id bigint COMMENT '流程id',
|
||||
order_id bigint COMMENT '订单id',
|
||||
out_order_no varchar(128) COMMENT '外部订单号',
|
||||
third_order_no varchar(128) COMMENT '第三方订单号',
|
||||
create_order_time datetime DEFAULT NULL COMMENT '创建订单时间',
|
||||
pay_order_time datetime DEFAULT NULL COMMENT '支付时间',
|
||||
refund_order_time datetime DEFAULT NULL COMMENT '退款时间',
|
||||
order_status tinyint COMMENT '订单状态',
|
||||
org_json text COMMENT '原始json数据',
|
||||
create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
create_time datetime DEFAULT NULL COMMENT '创建时间',
|
||||
update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
|
||||
update_time datetime DEFAULT NULL COMMENT '修改时间',
|
||||
del_flag char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
|
||||
tenant_id bigint DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE = InnoDB COMMENT ='硬件商品免密订单';
|
||||
@@ -1,3 +1,24 @@
|
||||
create table act_cancel
|
||||
(
|
||||
id BIGINT(19) auto_increment comment '活动项id'
|
||||
primary key,
|
||||
mch_id BIGINT(19) not null comment '活动商户id',
|
||||
notice_id BIGINT(19) not null comment '公告id',
|
||||
active_org_price INT(10) null comment '活动原价',
|
||||
active_cancel_price INT(10) not null comment '活动核销价',
|
||||
start_time DATETIME null comment '开始时间',
|
||||
expire_time DATETIME not null comment '到期时间',
|
||||
act_status CHAR(32) not null comment '活动状态(1:正常 2:关闭)',
|
||||
act_title CHAR(32) not null comment '活动标题',
|
||||
act_content CHAR(32) null comment '活动内容',
|
||||
create_by VARCHAR(64) null comment '创建人',
|
||||
create_time DATETIME null comment '创建时间',
|
||||
update_by VARCHAR(64) null comment '修改人',
|
||||
update_time DATETIME null comment '修改时间',
|
||||
del_flag CHAR default '0' null comment '删除标记',
|
||||
tenant_id BIGINT(19) null comment '租户ID'
|
||||
);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for act_cancel_item
|
||||
-- ----------------------------
|
||||
@@ -20,4 +41,77 @@ CREATE TABLE act_cancel_item
|
||||
del_flag char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
|
||||
tenant_id bigint DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE = InnoDB COMMENT ='核销活动项';
|
||||
) ENGINE = InnoDB COMMENT ='核销活动项';
|
||||
|
||||
DROP TABLE IF EXISTS act_coupon;
|
||||
CREATE TABLE act_coupon
|
||||
(
|
||||
id BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '优惠券ID',
|
||||
parent_act_id BIGINT(20) DEFAULT NULL COMMENT '父活动id',
|
||||
name VARCHAR(128) NOT NULL COMMENT '优惠券名称',
|
||||
type VARCHAR(64) NOT NULL COMMENT '优惠券类型 (1:满减券 2:折扣券 3:立减券 4:兑换券)',
|
||||
face_value INT DEFAULT 0 COMMENT '面额/折扣 (满减/立减单位:分, 折扣单位:百分比)',
|
||||
min_point INT DEFAULT 0 COMMENT '使用门槛 (满多少分可用, 0表示无门槛)',
|
||||
total_count INT NOT NULL DEFAULT 0 COMMENT '发行总量 (-1表示不限量)',
|
||||
surplus_count INT NOT NULL DEFAULT 0 COMMENT '剩余数量',
|
||||
limit_count INT DEFAULT 1 COMMENT '每人限领数量',
|
||||
limit_type VARCHAR(32) DEFAULT NULL COMMENT '限领类型 (once:活动期间一次 day:每天 week:每周 month:每月 year:每年)',
|
||||
valid_type VARCHAR(32) NOT NULL COMMENT '有效期类型 (1:固定日期 2:领取后生效)',
|
||||
valid_start_time DATETIME DEFAULT NULL COMMENT '有效期开始时间',
|
||||
valid_end_time DATETIME DEFAULT NULL COMMENT '有效期结束时间',
|
||||
valid_days INT DEFAULT 0 COMMENT '领取后有效天数',
|
||||
use_scope_type VARCHAR(32) DEFAULT 0 COMMENT '适用范围 (0:全场通用 1:指定商户 2:指定分类 3:指定商品)',
|
||||
scope_id VARCHAR(2048) DEFAULT NULL COMMENT '适用范围ID集合 (商户ID/分类ID/商品ID, 逗号分隔)',
|
||||
status VARCHAR(32) DEFAULT 0 COMMENT '状态 (0:草稿 1:进行中 2:已结束 3:已作废)',
|
||||
description VARCHAR(512) DEFAULT NULL COMMENT '使用说明',
|
||||
|
||||
create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
create_time datetime DEFAULT NULL COMMENT '创建时间',
|
||||
update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
|
||||
update_time datetime DEFAULT NULL COMMENT '修改时间',
|
||||
del_flag char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
|
||||
tenant_id bigint DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (id),
|
||||
KEY idx_status (status),
|
||||
KEY idx_valid_end_time (valid_end_time)
|
||||
) ENGINE = InnoDB COMMENT ='优惠券活动';
|
||||
|
||||
DROP TABLE IF EXISTS act_coupon_record;
|
||||
CREATE TABLE act_coupon_record
|
||||
(
|
||||
id BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '领取记录ID',
|
||||
coupon_id BIGINT(20) NOT NULL COMMENT '优惠券ID',
|
||||
user_id BIGINT(20) NOT NULL COMMENT '用户ID',
|
||||
user_name VARCHAR(64) DEFAULT NULL COMMENT '用户名称',
|
||||
coupon_code VARCHAR(64) NOT NULL COMMENT '券码(唯一标识)',
|
||||
status VARCHAR(32) NOT NULL DEFAULT '0' COMMENT '使用状态 (0:未使用 1:已使用 2:已过期 3:已作废)',
|
||||
|
||||
-- 冗余优惠券快照信息,防止优惠券修改后数据不一致
|
||||
coupon_name VARCHAR(128) NOT NULL COMMENT '优惠券名称',
|
||||
coupon_type VARCHAR(64) NOT NULL COMMENT '优惠券类型',
|
||||
face_value INT DEFAULT 0 COMMENT '面额/折扣',
|
||||
min_point INT DEFAULT 0 COMMENT '使用门槛',
|
||||
|
||||
-- 有效期
|
||||
start_time DATETIME NOT NULL COMMENT '有效开始时间',
|
||||
end_time DATETIME NOT NULL COMMENT '有效结束时间',
|
||||
|
||||
-- 使用信息
|
||||
use_time DATETIME DEFAULT NULL COMMENT '使用时间',
|
||||
order_id VARCHAR(64) DEFAULT NULL COMMENT '关联订单号',
|
||||
use_amount INT DEFAULT 0 COMMENT '抵扣金额(分)',
|
||||
|
||||
create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
create_time datetime DEFAULT NULL COMMENT '领取时间',
|
||||
update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
|
||||
update_time datetime DEFAULT NULL COMMENT '修改时间',
|
||||
del_flag char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
|
||||
tenant_id bigint DEFAULT NULL COMMENT '租户ID',
|
||||
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE KEY uk_coupon_code (coupon_code),
|
||||
KEY idx_user_id (user_id),
|
||||
KEY idx_coupon_id (coupon_id),
|
||||
KEY idx_end_time (end_time),
|
||||
KEY idx_status (status)
|
||||
) ENGINE = InnoDB COMMENT ='优惠券领取记录表';
|
||||
+228
-138
@@ -6,26 +6,30 @@ SET FOREIGN_KEY_CHECKS = 0;
|
||||
-- Table structure for app_article
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `app_article`;
|
||||
CREATE TABLE `app_article` (
|
||||
`id` bigint NOT NULL COMMENT '主键',
|
||||
`cid` bigint NOT NULL COMMENT '分类',
|
||||
`title` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '标题',
|
||||
`intro` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '简介',
|
||||
`summary` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '摘要',
|
||||
`image` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '封面',
|
||||
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '内容',
|
||||
`author` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '作者',
|
||||
`visit` int unsigned NOT NULL DEFAULT '0' COMMENT '浏览',
|
||||
`sort` int unsigned NOT NULL DEFAULT '50' COMMENT '排序',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`create_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人',
|
||||
`update_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '删除时间',
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `cid_idx` (`cid`) USING BTREE COMMENT '分类索引'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='文章资讯表';
|
||||
CREATE TABLE `app_article`
|
||||
(
|
||||
`id` bigint NOT NULL COMMENT '主键',
|
||||
`cid` bigint NOT NULL COMMENT '分类',
|
||||
`title` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '标题',
|
||||
`intro` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '简介',
|
||||
`summary` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '摘要',
|
||||
`image` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '封面',
|
||||
`content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '内容',
|
||||
`author` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '作者',
|
||||
`visit` int unsigned NOT NULL DEFAULT '0' COMMENT '浏览',
|
||||
`sort` int unsigned NOT NULL DEFAULT '50' COMMENT '排序',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`create_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人',
|
||||
`update_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '删除时间',
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `cid_idx` (`cid`) USING BTREE COMMENT '分类索引'
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci
|
||||
ROW_FORMAT = DYNAMIC COMMENT ='文章资讯表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of app_article
|
||||
@@ -37,19 +41,23 @@ COMMIT;
|
||||
-- Table structure for app_article_category
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `app_article_category`;
|
||||
CREATE TABLE `app_article_category` (
|
||||
`id` bigint unsigned NOT NULL COMMENT '主键',
|
||||
`name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '名称',
|
||||
`sort` smallint unsigned NOT NULL DEFAULT '50' COMMENT '排序',
|
||||
`is_show` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '是否显示: 0=否, 1=是',
|
||||
`del_flag` char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '是否删除: 0=否, 1=是',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`create_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '创建人',
|
||||
`update_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人',
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='文章分类表';
|
||||
CREATE TABLE `app_article_category`
|
||||
(
|
||||
`id` bigint unsigned NOT NULL COMMENT '主键',
|
||||
`name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '名称',
|
||||
`sort` smallint unsigned NOT NULL DEFAULT '50' COMMENT '排序',
|
||||
`is_show` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '是否显示: 0=否, 1=是',
|
||||
`del_flag` char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '是否删除: 0=否, 1=是',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`create_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '创建人',
|
||||
`update_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人',
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci
|
||||
ROW_FORMAT = DYNAMIC COMMENT ='文章分类表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of app_article_category
|
||||
@@ -61,18 +69,22 @@ COMMIT;
|
||||
-- Table structure for app_article_collect
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `app_article_collect`;
|
||||
CREATE TABLE `app_article_collect` (
|
||||
`id` bigint unsigned NOT NULL COMMENT '主键',
|
||||
`user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',
|
||||
`article_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '文章ID',
|
||||
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL COMMENT '更新时间',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '是否删除',
|
||||
`create_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
`update_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人',
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='文章收藏表';
|
||||
CREATE TABLE `app_article_collect`
|
||||
(
|
||||
`id` bigint unsigned NOT NULL COMMENT '主键',
|
||||
`user_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',
|
||||
`article_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '文章ID',
|
||||
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL COMMENT '更新时间',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '是否删除',
|
||||
`create_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
`update_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人',
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci
|
||||
ROW_FORMAT = DYNAMIC COMMENT ='文章收藏表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of app_article_collect
|
||||
@@ -84,159 +96,237 @@ COMMIT;
|
||||
-- Table structure for app_page
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `app_page`;
|
||||
CREATE TABLE `app_page` (
|
||||
`id` bigint unsigned NOT NULL COMMENT '主键',
|
||||
`page_type` tinyint unsigned NOT NULL DEFAULT '10' COMMENT '页面类型',
|
||||
`page_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '页面名称',
|
||||
`page_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '页面数据',
|
||||
`create_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
`update_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`del_flag` char(1) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '删除标记',
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='页面装修表';
|
||||
CREATE TABLE `app_page`
|
||||
(
|
||||
`id` bigint unsigned NOT NULL COMMENT '主键',
|
||||
`page_type` tinyint unsigned NOT NULL DEFAULT '10' COMMENT '页面类型',
|
||||
`page_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '页面名称',
|
||||
`page_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '页面数据',
|
||||
`create_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
`update_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '修改时间',
|
||||
`del_flag` char(1) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '删除标记',
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci
|
||||
ROW_FORMAT = DYNAMIC COMMENT ='页面装修表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of app_page
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `app_page` VALUES (1, 1, '商城首页', '[{\"title\":\"搜索\",\"name\":\"search\",\"disabled\":1,\"content\":{},\"styles\":{}},{\"title\":\"首页轮播图\",\"name\":\"banner\",\"content\":{\"enabled\":1,\"data\":[{\"image\":\"/api/static/banner01.png\",\"name\":\"\",\"link\":{\"path\":\"/pages/index/index\",\"name\":\"商城首页\",\"type\":\"shop\"}}]},\"styles\":{}},{\"title\":\"导航菜单\",\"name\":\"nav\",\"content\":{\"enabled\":1,\"data\":[{\"image\":\"https://minio.pjcloud.top/oss/app/nav01.png\",\"name\":\"资讯中心\",\"link\":{\"path\":\"/pages/news/news\",\"name\":\"文章资讯\",\"type\":\"shop\"}},{\"image\":\"https://minio.pjcloud.top/oss/app/nav02.png\",\"name\":\"我的收藏\",\"link\":{\"path\":\"/pages/collection/collection\",\"name\":\"我的收藏\",\"type\":\"shop\"}},{\"image\":\"https://minio.pjcloud.top/oss/app/nav03.png\",\"name\":\"个人设置\",\"link\":{\"path\":\"/pages/user_set/user_set\",\"name\":\"个人设置\",\"type\":\"shop\"}},{\"image\":\"https://minio.pjcloud.top/oss/app/nav04.png\",\"name\":\"联系客服\",\"link\":{\"path\":\"/pages/customer_service/customer_service\",\"name\":\"联系客服\",\"type\":\"shop\"}},{\"image\":\"https://minio.pjcloud.top/oss/app/nav05.png\",\"name\":\"关于我们\",\"link\":{\"path\":\"/pages/as_us/as_us\",\"name\":\"关于我们\",\"type\":\"shop\"}}]},\"styles\":{}},{\"id\":\"l84almsk2uhyf\",\"title\":\"资讯\",\"name\":\"news\",\"disabled\":1,\"content\":{},\"styles\":{}}]', NULL, 'admin', NULL, '2023-06-15 09:18:02', '0',1);
|
||||
INSERT INTO `app_page` VALUES (2, 2, '个人中心', '[{\"title\":\"用户信息\",\"name\":\"user-info\",\"disabled\":1,\"content\":{},\"styles\":{}},{\"title\":\"我的服务\",\"name\":\"my-service\",\"content\":{\"style\":2,\"title\":\"服务中心\",\"data\":[{\"image\":\"https://minio.pjcloud.top/oss/app/user_collect.png\",\"name\":\"我的收藏\",\"link\":{\"path\":\"/pages/collection/collection\",\"name\":\"我的收藏\",\"type\":\"shop\"}},{\"image\":\"https://minio.pjcloud.top/oss/app/user_setting.png\",\"name\":\"个人设置\",\"link\":{\"path\":\"/pages/user_set/user_set\",\"name\":\"个人设置\",\"type\":\"shop\"}},{\"image\":\"https://minio.pjcloud.top/oss/app/user_kefu.png\",\"name\":\"联系客服\",\"link\":{\"path\":\"/pages/customer_service/customer_service\",\"name\":\"联系客服\",\"type\":\"shop\"}}]},\"styles\":{}},{\"title\":\"个人中心广告图\",\"name\":\"user-banner\",\"content\":{\"enabled\":1,\"data\":[{\"image\":\"\",\"name\":\"sdds\",\"link\":{\"path\":\"/pages/user/user\",\"name\":\"个人中心\",\"type\":\"shop\"}}]},\"styles\":{}}]', NULL, 'admin', NULL, '2023-06-18 17:00:05', '0',1);
|
||||
INSERT INTO `app_page` VALUES (3, 3, '客服设置', '[{\"title\":\"客服设置\",\"name\":\"customer-service\",\"content\":{\"title\":\"添加客服二维码\",\"time\":\"早上 9:00 - 22:00\",\"mobile\":\"13800138000\",\"qrcode\":\"/admin/sys-file/local/adc5061f99e9440abcd9b22572909c88.jpg\"},\"styles\":{}}]', NULL, 'admin', NULL, '2023-06-14 13:12:19', '0',1);
|
||||
INSERT INTO `app_page`
|
||||
VALUES (1, 1, '商城首页',
|
||||
'[{\"title\":\"搜索\",\"name\":\"search\",\"disabled\":1,\"content\":{},\"styles\":{}},{\"title\":\"首页轮播图\",\"name\":\"banner\",\"content\":{\"enabled\":1,\"data\":[{\"image\":\"/api/static/banner01.png\",\"name\":\"\",\"link\":{\"path\":\"/pages/index/index\",\"name\":\"商城首页\",\"type\":\"shop\"}}]},\"styles\":{}},{\"title\":\"导航菜单\",\"name\":\"nav\",\"content\":{\"enabled\":1,\"data\":[{\"image\":\"https://minio.pjcloud.top/oss/app/nav01.png\",\"name\":\"资讯中心\",\"link\":{\"path\":\"/pages/news/news\",\"name\":\"文章资讯\",\"type\":\"shop\"}},{\"image\":\"https://minio.pjcloud.top/oss/app/nav02.png\",\"name\":\"我的收藏\",\"link\":{\"path\":\"/pages/collection/collection\",\"name\":\"我的收藏\",\"type\":\"shop\"}},{\"image\":\"https://minio.pjcloud.top/oss/app/nav03.png\",\"name\":\"个人设置\",\"link\":{\"path\":\"/pages/user_set/user_set\",\"name\":\"个人设置\",\"type\":\"shop\"}},{\"image\":\"https://minio.pjcloud.top/oss/app/nav04.png\",\"name\":\"联系客服\",\"link\":{\"path\":\"/pages/customer_service/customer_service\",\"name\":\"联系客服\",\"type\":\"shop\"}},{\"image\":\"https://minio.pjcloud.top/oss/app/nav05.png\",\"name\":\"关于我们\",\"link\":{\"path\":\"/pages/as_us/as_us\",\"name\":\"关于我们\",\"type\":\"shop\"}}]},\"styles\":{}},{\"id\":\"l84almsk2uhyf\",\"title\":\"资讯\",\"name\":\"news\",\"disabled\":1,\"content\":{},\"styles\":{}}]',
|
||||
NULL, 'admin', NULL, '2023-06-15 09:18:02', '0', 1);
|
||||
INSERT INTO `app_page`
|
||||
VALUES (2, 2, '个人中心',
|
||||
'[{\"title\":\"用户信息\",\"name\":\"user-info\",\"disabled\":1,\"content\":{},\"styles\":{}},{\"title\":\"我的服务\",\"name\":\"my-service\",\"content\":{\"style\":2,\"title\":\"服务中心\",\"data\":[{\"image\":\"https://minio.pjcloud.top/oss/app/user_collect.png\",\"name\":\"我的收藏\",\"link\":{\"path\":\"/pages/collection/collection\",\"name\":\"我的收藏\",\"type\":\"shop\"}},{\"image\":\"https://minio.pjcloud.top/oss/app/user_setting.png\",\"name\":\"个人设置\",\"link\":{\"path\":\"/pages/user_set/user_set\",\"name\":\"个人设置\",\"type\":\"shop\"}},{\"image\":\"https://minio.pjcloud.top/oss/app/user_kefu.png\",\"name\":\"联系客服\",\"link\":{\"path\":\"/pages/customer_service/customer_service\",\"name\":\"联系客服\",\"type\":\"shop\"}}]},\"styles\":{}},{\"title\":\"个人中心广告图\",\"name\":\"user-banner\",\"content\":{\"enabled\":1,\"data\":[{\"image\":\"\",\"name\":\"sdds\",\"link\":{\"path\":\"/pages/user/user\",\"name\":\"个人中心\",\"type\":\"shop\"}}]},\"styles\":{}}]',
|
||||
NULL, 'admin', NULL, '2023-06-18 17:00:05', '0', 1);
|
||||
INSERT INTO `app_page`
|
||||
VALUES (3, 3, '客服设置',
|
||||
'[{\"title\":\"客服设置\",\"name\":\"customer-service\",\"content\":{\"title\":\"添加客服二维码\",\"time\":\"早上 9:00 - 22:00\",\"mobile\":\"13800138000\",\"qrcode\":\"/admin/sys-file/local/adc5061f99e9440abcd9b22572909c88.jpg\"},\"styles\":{}}]',
|
||||
NULL, 'admin', NULL, '2023-06-14 13:12:19', '0', 1);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for app_tabbar
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `app_tabbar`;
|
||||
CREATE TABLE `app_tabbar` (
|
||||
`id` bigint unsigned NOT NULL COMMENT '主键',
|
||||
`name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '导航名称',
|
||||
`selected` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '未选图标',
|
||||
`unselected` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '已选图标',
|
||||
`link` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '链接地址',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`create_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
`update_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人',
|
||||
`del_flag` char(1) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '删除标记',
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='底部装修表';
|
||||
CREATE TABLE `app_tabbar`
|
||||
(
|
||||
`id` bigint unsigned NOT NULL COMMENT '主键',
|
||||
`name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '导航名称',
|
||||
`selected` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '未选图标',
|
||||
`unselected` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '已选图标',
|
||||
`link` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '链接地址',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`create_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
`update_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人',
|
||||
`del_flag` char(1) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '删除标记',
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci
|
||||
ROW_FORMAT = DYNAMIC COMMENT ='底部装修表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of app_tabbar
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `app_tabbar` VALUES (1, '首页', 'https://minio.pjcloud.top/oss/app/tabbar0.png', 'https://minio.pjcloud.top/oss/app/tabbar0_0.png', '{\"path\":\"/pages/index/index\",\"name\":\"商城首页\",\"type\":\"shop\"}', NULL, '2023-06-15 09:16:25', NULL, 'admin', '0',1);
|
||||
INSERT INTO `app_tabbar` VALUES (2, '资讯', 'https://minio.pjcloud.top/oss/app/tabbar1.png', 'https://minio.pjcloud.top/oss/app/tabbar1_1.png', '{\"path\":\"/pages/news/news\",\"name\":\"文章资讯\",\"type\":\"shop\"}', NULL, '2023-06-15 09:16:25', NULL, 'admin', '0',1);
|
||||
INSERT INTO `app_tabbar` VALUES (3, '我的', 'https://minio.pjcloud.top/oss/app/tabbar3.png', 'https://minio.pjcloud.top/oss/app/tabbar3_3.png', '{\"path\":\"/pages/user/user\",\"name\":\"个人中心\",\"type\":\"shop\"}', NULL, '2023-06-15 09:16:25', NULL, 'admin', '0',1);
|
||||
INSERT INTO `app_tabbar`
|
||||
VALUES (1, '首页', 'https://minio.pjcloud.top/oss/app/tabbar0.png', 'https://minio.pjcloud.top/oss/app/tabbar0_0.png',
|
||||
'{\"path\":\"/pages/index/index\",\"name\":\"商城首页\",\"type\":\"shop\"}', NULL, '2023-06-15 09:16:25', NULL,
|
||||
'admin', '0', 1);
|
||||
INSERT INTO `app_tabbar`
|
||||
VALUES (2, '资讯', 'https://minio.pjcloud.top/oss/app/tabbar1.png', 'https://minio.pjcloud.top/oss/app/tabbar1_1.png',
|
||||
'{\"path\":\"/pages/news/news\",\"name\":\"文章资讯\",\"type\":\"shop\"}', NULL, '2023-06-15 09:16:25', NULL,
|
||||
'admin', '0', 1);
|
||||
INSERT INTO `app_tabbar`
|
||||
VALUES (3, '我的', 'https://minio.pjcloud.top/oss/app/tabbar3.png', 'https://minio.pjcloud.top/oss/app/tabbar3_3.png',
|
||||
'{\"path\":\"/pages/user/user\",\"name\":\"个人中心\",\"type\":\"shop\"}', NULL, '2023-06-15 09:16:25', NULL,
|
||||
'admin', '0', 1);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for app_role
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `app_role`;
|
||||
CREATE TABLE `app_role` (
|
||||
`role_id` bigint(20) NOT NULL,
|
||||
`role_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`role_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`role_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT ' ' COMMENT '创建人',
|
||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT ' ' COMMENT '修改人',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0',
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`role_id`) USING BTREE,
|
||||
KEY `role_idx1_role_code` (`role_code`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='app角色表';
|
||||
CREATE TABLE `app_role`
|
||||
(
|
||||
`role_id` bigint(20) NOT NULL,
|
||||
`role_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`role_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`role_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT ' ' COMMENT '创建人',
|
||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT ' ' COMMENT '修改人',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0',
|
||||
`tenant_id` bigint(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`role_id`) USING BTREE,
|
||||
KEY `role_idx1_role_code` (`role_code`) USING BTREE
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci
|
||||
ROW_FORMAT = DYNAMIC COMMENT ='app角色表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of app_role
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `app_role` VALUES (1, 'app用户', 'APP_USER', 'app用户角色', '', '', '2022-12-07 06:34:18', '2023-03-09 06:34:42', '0', 1);
|
||||
INSERT INTO `app_role`
|
||||
VALUES (1, 'app用户', 'APP_USER', 'app用户角色', '', '', '2022-12-07 06:34:18', '2023-03-09 06:34:42', '0', 1);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for app_social_details
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `app_social_details`;
|
||||
CREATE TABLE `app_social_details` (
|
||||
`id` bigint(20) NOT NULL COMMENT '主键', -- 主键
|
||||
`type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '社交类型', -- 社交类型
|
||||
`remark` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注', -- 备注
|
||||
`app_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '应用ID', -- 应用ID
|
||||
`app_secret` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '应用密钥', -- 应用密钥
|
||||
`redirect_url` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '重定向URL', -- 重定向URL
|
||||
`ext` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '拓展字段', -- 拓展字段
|
||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT ' ' COMMENT '创建人', -- 创建人
|
||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT ' ' COMMENT '修改人', -- 修改人
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', -- 创建时间
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', -- 更新时间
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志', -- 删除标志
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC
|
||||
COMMENT='系统社交登录账号表'; -- 系统社交登录账号表
|
||||
CREATE TABLE `app_social_details`
|
||||
(
|
||||
`id` bigint(20) NOT NULL COMMENT '主键', -- 主键
|
||||
`type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '社交类型', -- 社交类型
|
||||
`remark` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注', -- 备注
|
||||
`app_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '应用ID', -- 应用ID
|
||||
`app_secret` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '应用密钥', -- 应用密钥
|
||||
`redirect_url` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '重定向URL', -- 重定向URL
|
||||
`ext` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '拓展字段', -- 拓展字段
|
||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT ' ' COMMENT '创建人', -- 创建人
|
||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT ' ' COMMENT '修改人', -- 修改人
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', -- 创建时间
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', -- 更新时间
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志', -- 删除标志
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci
|
||||
ROW_FORMAT = DYNAMIC
|
||||
COMMENT ='系统社交登录账号表';
|
||||
-- 系统社交登录账号表
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of app_social_details
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `app_social_details` VALUES (1, 'MINI', '小程序登录', 'app_id', 'app_secret', 'http://www.baidu.com123', NULL, '', 'admin', '2022-12-09 01:44:42', '2023-04-03 06:12:30', '0');
|
||||
INSERT INTO `app_social_details`
|
||||
VALUES (1, 'MINI', '小程序登录', 'app_id', 'app_secret', 'http://www.baidu.com123', NULL, '', 'admin',
|
||||
'2022-12-09 01:44:42', '2023-04-03 06:12:30', '0');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for app_user
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `app_user`;
|
||||
CREATE TABLE `app_user` (
|
||||
`user_id` bigint(20) NOT NULL COMMENT '用户id',
|
||||
`username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '用户名',
|
||||
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '密码',
|
||||
`salt` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '盐值',
|
||||
`phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '手机号码',
|
||||
`avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '头像图片链接',
|
||||
`nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '拓展字段:昵称',
|
||||
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '拓展字段:姓名',
|
||||
`email` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '拓展字段:邮箱',
|
||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT ' ' COMMENT '修改人',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志',
|
||||
`tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '所属租户id',
|
||||
`last_modified_time` datetime DEFAULT NULL COMMENT '最后一次密码修改时间',
|
||||
`lock_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '锁定状态',
|
||||
`wx_openid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '微信登录openId',
|
||||
PRIMARY KEY (`user_id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='app用户表';
|
||||
CREATE TABLE `app_user`
|
||||
(
|
||||
`user_id` bigint(20) NOT NULL COMMENT '用户id',
|
||||
`username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '用户名',
|
||||
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '密码',
|
||||
`salt` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '盐值',
|
||||
`phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '手机号码',
|
||||
`avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '头像图片链接',
|
||||
`nickname` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '拓展字段:昵称',
|
||||
`name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '拓展字段:姓名',
|
||||
`email` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '拓展字段:邮箱',
|
||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT ' ' COMMENT '修改人',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志',
|
||||
`tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '所属租户id',
|
||||
`last_modified_time` datetime DEFAULT NULL COMMENT '最后一次密码修改时间',
|
||||
`lock_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '锁定状态',
|
||||
`wx_openid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '微信登录openId',
|
||||
PRIMARY KEY (`user_id`) USING BTREE
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci
|
||||
ROW_FORMAT = DYNAMIC COMMENT ='app用户表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of app_user
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `app_user` VALUES (1, 'appuser', '$2a$10$XQu3TmORLqDWayFspQN.U.LigJ5TWPTdXPIn/6SxGHKED3PVpuMH6', NULL, '13054729089', NULL, 'aeizzz', '刘洪磊', 'aeizzz@foxmail.com', '', 'appuser', '2022-12-07 02:59:38', '2023-03-09 15:14:44', '0', 1, NULL, '0', 'oBxPy5EnbDiN-gGEaovCpp_IkrkQ');
|
||||
INSERT INTO `app_user`
|
||||
VALUES (1, 'appuser', '$2a$10$XQu3TmORLqDWayFspQN.U.LigJ5TWPTdXPIn/6SxGHKED3PVpuMH6', NULL, '13054729089', NULL,
|
||||
'aeizzz', '刘洪磊', 'aeizzz@foxmail.com', '', 'appuser', '2022-12-07 02:59:38', '2023-03-09 15:14:44', '0', 1,
|
||||
NULL, '0', 'oBxPy5EnbDiN-gGEaovCpp_IkrkQ');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for app_user_role
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `app_user_role`;
|
||||
CREATE TABLE `app_user_role` (
|
||||
`user_id` bigint(20) NOT NULL COMMENT '用户ID',
|
||||
`role_id` bigint(20) NOT NULL COMMENT '角色ID',
|
||||
PRIMARY KEY (`user_id`,`role_id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='用户角色表';
|
||||
CREATE TABLE `app_user_role`
|
||||
(
|
||||
`user_id` bigint(20) NOT NULL COMMENT '用户ID',
|
||||
`role_id` bigint(20) NOT NULL COMMENT '角色ID',
|
||||
PRIMARY KEY (`user_id`, `role_id`) USING BTREE
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci
|
||||
ROW_FORMAT = DYNAMIC COMMENT ='用户角色表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for app_menu
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `app_menu`;
|
||||
CREATE TABLE `app_menu`
|
||||
(
|
||||
`id` bigint(20) NOT NULL COMMENT '用户id',
|
||||
|
||||
`platform` varchar(32) DEFAULT NULL COMMENT '平台(小程序、支付宝)',
|
||||
`type` varchar(32) DEFAULT NULL COMMENT '菜单类型',
|
||||
`icon` varchar(258) DEFAULT NULL COMMENT '图标',
|
||||
`page` varchar(258) NOT NULL COMMENT '页面路径(包含参数)',
|
||||
`title` varchar(32) NOT NULL COMMENT '页面标题',
|
||||
`visible` varchar(32) NOT NULL COMMENT '是否显示',
|
||||
`sort` int NOT NULL COMMENT '排序',
|
||||
|
||||
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT ' ' COMMENT '修改人',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标志',
|
||||
`tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '所属租户id',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci
|
||||
ROW_FORMAT = DYNAMIC COMMENT ='app菜单表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of app_user_role
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `app_user_role` VALUES (1, 1);
|
||||
INSERT INTO `app_user_role`
|
||||
VALUES (1, 1);
|
||||
COMMIT;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
@@ -0,0 +1,4 @@
|
||||
MYSQL_HOST=123.157.250.162
|
||||
MYSQL_PORT=33905
|
||||
MYSQL_USER=root@sys
|
||||
MYSQL_PWD=bsd.1799
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.bsd.pjcloud.app.api.constant;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* app用户类型
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum AppUserTypeEnum {
|
||||
|
||||
MINI_WECHAT("10", "微信小程序用户"),
|
||||
MINI_ALIPAY("20", "支付宝小程序用户"),
|
||||
;
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static AppUserTypeEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.bsd.pjcloud.app.api.constant.menu;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* app菜单平台
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum AppMenuPlatformEnum {
|
||||
|
||||
WECHAT("10", "微信小程序"),
|
||||
ZZD("30", "浙政钉"),
|
||||
;
|
||||
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static AppMenuPlatformEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.bsd.pjcloud.app.api.constant.menu;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* app菜单类型
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum AppMenuTypeEnum {
|
||||
DASHBOARD_TAB("10", "菜单面板tab"),
|
||||
;
|
||||
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static AppMenuTypeEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.bsd.pjcloud.app.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.app.api.constant.AppUserTypeEnum;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AppAdminSyncDto {
|
||||
|
||||
private String uniqueCode;
|
||||
|
||||
private AppUserTypeEnum userTypeEnum;
|
||||
|
||||
private Long adminUserId;
|
||||
|
||||
private String username;
|
||||
|
||||
private String avatarImage;
|
||||
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.bsd.pjcloud.app.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.app.api.constant.menu.AppMenuPlatformEnum;
|
||||
import com.bsd.pjcloud.app.api.constant.menu.AppMenuTypeEnum;
|
||||
import com.bsd.pjcloud.app.api.entity.AppMenuEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AppMenuDto extends AppMenuEntity {
|
||||
|
||||
/**
|
||||
* 平台(小程序、支付宝)
|
||||
*/
|
||||
private AppMenuPlatformEnum platformEnum;
|
||||
|
||||
/**
|
||||
* 菜单类型
|
||||
*/
|
||||
private AppMenuTypeEnum typeEnum;
|
||||
|
||||
}
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
package com.bsd.pjcloud.app.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 菜单管理
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("app_menu")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "菜单管理")
|
||||
public class AppMenuEntity extends Model<AppMenuEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 平台(小程序、支付宝)
|
||||
*/
|
||||
@Schema(description = "平台(小程序、支付宝)")
|
||||
private String platform;
|
||||
|
||||
/**
|
||||
* 菜单类型
|
||||
*/
|
||||
@Schema(description = "菜单类型")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
@Schema(description = "图标")
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 页面路径(包含参数)
|
||||
*/
|
||||
@Schema(description = "页面路径(包含参数)")
|
||||
private String page;
|
||||
|
||||
/**
|
||||
* 页面标题
|
||||
*/
|
||||
@Schema(description = "页面标题")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 是否显示
|
||||
*/
|
||||
@Schema(description = "是否显示")
|
||||
private String visible;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标志
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标志")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 所属租户id
|
||||
*/
|
||||
@Schema(description = "所属租户id")
|
||||
private Long tenantId;
|
||||
}
|
||||
+111
-99
@@ -40,122 +40,134 @@ import java.time.LocalDateTime;
|
||||
@Schema(description = "app用户表")
|
||||
public class AppUser extends Model<AppUser> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* userId
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "userId")
|
||||
private Long userId;
|
||||
/**
|
||||
* userId
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "userId")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
@Schema(description = "用户类型")
|
||||
private String userType;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 随机盐
|
||||
*/
|
||||
@JsonIgnore
|
||||
@Schema(description = "随机盐")
|
||||
private String salt;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
/**
|
||||
* 随机盐
|
||||
*/
|
||||
@JsonIgnore
|
||||
@Schema(description = "随机盐")
|
||||
private String salt;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@Schema(description = "头像")
|
||||
private String avatar;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@Schema(description = "拓展字段:昵称")
|
||||
private String nickname;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@Schema(description = "头像")
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@Schema(description = "拓展字段:姓名")
|
||||
private String name;
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@Schema(description = "拓展字段:昵称")
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@Schema(description = "拓展字段:邮箱")
|
||||
private String email;
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@Schema(description = "拓展字段:姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Schema(description = "创建人")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@Schema(description = "拓展字段:邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@Schema(description = "修改人")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private String updateBy;
|
||||
/**
|
||||
* 第三方登录扩展字段
|
||||
*/
|
||||
@Schema(description = "第三方登录扩展字段")
|
||||
private String loginExtJson;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
/**
|
||||
* openId
|
||||
*/
|
||||
@Schema(description = "openId")
|
||||
private String openid;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Schema(description = "创建人")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@Schema(description = "修改人")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 所属租户
|
||||
*/
|
||||
@Schema(description = "所属租户", hidden = true)
|
||||
private Long tenantId;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 最后一次密码修改时间
|
||||
*/
|
||||
@Schema(description = "最后一次密码修改时间")
|
||||
private LocalDateTime lastModifiedTime;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@Schema(description = "修改时间")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 锁定标记
|
||||
*/
|
||||
@Schema(description = "锁定标记")
|
||||
private String lockFlag;
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@Schema(description = "删除标记,1:已删除,0:正常")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 微信小程序登录openId
|
||||
*/
|
||||
@Schema(description = "微信小程序登录openId")
|
||||
private String wxOpenid;
|
||||
/**
|
||||
* 所属租户
|
||||
*/
|
||||
@Schema(description = "所属租户", hidden = true)
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 最后一次密码修改时间
|
||||
*/
|
||||
@Schema(description = "最后一次密码修改时间")
|
||||
private LocalDateTime lastModifiedTime;
|
||||
|
||||
/**
|
||||
* 锁定标记
|
||||
*/
|
||||
@Schema(description = "锁定标记")
|
||||
private String lockFlag;
|
||||
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2018-2025, pjcloud All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: pjcloud
|
||||
*
|
||||
*/
|
||||
|
||||
package com.bsd.pjcloud.app.api.feign;
|
||||
|
||||
import com.bsd.pjcloud.app.api.constant.menu.AppMenuPlatformEnum;
|
||||
import com.bsd.pjcloud.app.api.constant.menu.AppMenuTypeEnum;
|
||||
import com.bsd.pjcloud.app.api.entity.AppMenuEntity;
|
||||
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.feign.annotation.NoToken;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(contextId = "remoteAppMenuService", value = ServiceNameConstants.APP_SERVER)
|
||||
public interface RemoteAppMenuService {
|
||||
|
||||
/**
|
||||
* 与 AppMenuController GET /app-menu/app/list 一致,内部调用
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/app-menu/inner/app/list")
|
||||
R<List<AppMenuEntity>> innerAppList(
|
||||
@RequestParam(value = "typeEnum", required = false) AppMenuTypeEnum typeEnum,
|
||||
@RequestParam(value = "platformEnum", required = false) AppMenuPlatformEnum platformEnum);
|
||||
}
|
||||
+25
-22
@@ -19,6 +19,7 @@
|
||||
|
||||
package com.bsd.pjcloud.app.api.feign;
|
||||
|
||||
import com.bsd.pjcloud.app.api.dto.AppAdminSyncDto;
|
||||
import com.bsd.pjcloud.app.api.dto.AppUserInfo;
|
||||
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
@@ -26,33 +27,35 @@ import com.bsd.pjcloud.common.feign.annotation.NoToken;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
|
||||
/**
|
||||
* @author pjcloud
|
||||
* @date 2018/6/22
|
||||
*/
|
||||
@FeignClient(contextId = "remoteAppUserService", value = ServiceNameConstants.APP_SERVER)
|
||||
public interface RemoteAppUserService {
|
||||
|
||||
/**
|
||||
* 通过用户名查询用户、角色信息
|
||||
* @param username 用户名
|
||||
* @param from 调用标志
|
||||
* @return R
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/appuser/info/{username}")
|
||||
R<AppUserInfo> info(@PathVariable("username") String username);
|
||||
/**
|
||||
* 通过用户名查询用户、角色信息
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/appuser/info/{username}")
|
||||
R<AppUserInfo> info(@PathVariable("username") String username);
|
||||
|
||||
/**
|
||||
* 通过社交账号或手机号查询用户、角色信息
|
||||
* @param inStr appid@code
|
||||
* @param from 调用标志
|
||||
* @return
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/appsocial/info/{inStr}")
|
||||
R<AppUserInfo> social(@PathVariable("inStr") String inStr);
|
||||
@NoToken
|
||||
@GetMapping("/appuser/infoByUserId/{userId}")
|
||||
R<AppUserInfo> infoByUserId(@PathVariable("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 通过社交账号或手机号查询用户、角色信息
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/appsocial/info/{inStr}")
|
||||
R<AppUserInfo> social(@PathVariable("inStr") String inStr);
|
||||
|
||||
/**
|
||||
* 同步admin账户信息为app账户
|
||||
*/
|
||||
@NoToken
|
||||
@PostMapping("/appsocial/sync-admin-account-info")
|
||||
R<AppUserInfo> syncAdminAccountInfo(@RequestBody AppAdminSyncDto appAdminSyncDto);
|
||||
}
|
||||
+1
@@ -1 +1,2 @@
|
||||
com.bsd.pjcloud.app.api.feign.RemoteAppUserService
|
||||
com.bsd.pjcloud.app.api.feign.RemoteAppMenuService
|
||||
@@ -104,12 +104,23 @@
|
||||
<groupId>com.bsd</groupId>
|
||||
<artifactId>pjcloud-common-swagger</artifactId>
|
||||
</dependency>
|
||||
<!-- 引入分布式事务-->
|
||||
<!-- 引入分布式事务 -->
|
||||
<dependency>
|
||||
<groupId>com.bsd</groupId>
|
||||
<artifactId>pjcloud-common-seata</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 支付宝SDK -->
|
||||
<dependency>
|
||||
<groupId>com.alipay.sdk</groupId>
|
||||
<artifactId>alipay-sdk-java</artifactId>
|
||||
<version>4.40.251.ALL</version>
|
||||
</dependency>
|
||||
<!-- 微信登录(小程序) -->
|
||||
<dependency>
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>wx-java-miniapp-spring-boot-starter</artifactId>
|
||||
<version>4.7.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.bsd.pjcloud.app.config;
|
||||
|
||||
import cn.binarywang.wx.miniapp.api.WxMaService;
|
||||
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
|
||||
import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Slf4j
|
||||
@Configuration
|
||||
@EnableConfigurationProperties(MiniWechatConf.class)
|
||||
public class MinWechatConfiguration {
|
||||
|
||||
private final MiniWechatConf properties;
|
||||
|
||||
@Autowired
|
||||
public MinWechatConfiguration(MiniWechatConf properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public WxMaService wxMaService() {
|
||||
|
||||
WxMaDefaultConfigImpl wxMaDefaultConfig = new WxMaDefaultConfigImpl();
|
||||
wxMaDefaultConfig.setAppid(properties.getAppId());
|
||||
wxMaDefaultConfig.setSecret(properties.getAppSecret());
|
||||
wxMaDefaultConfig.setMsgDataFormat("JSON");
|
||||
|
||||
WxMaService maService = new WxMaServiceImpl();
|
||||
maService.setWxMaConfig(wxMaDefaultConfig);
|
||||
return maService;
|
||||
}
|
||||
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.bsd.pjcloud.app.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 支付宝支付配置
|
||||
*/
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "mini-ali-pay")
|
||||
@Data
|
||||
public class MiniAlipayConf {
|
||||
|
||||
/**
|
||||
* 应用ID
|
||||
*/
|
||||
private String appId;
|
||||
|
||||
/**
|
||||
* 私钥
|
||||
*/
|
||||
private String privateKey;
|
||||
|
||||
/**
|
||||
* 公钥
|
||||
*/
|
||||
private String publicKey;
|
||||
|
||||
/**
|
||||
* 支付宝公钥
|
||||
*/
|
||||
private String alipayPublicKey;
|
||||
|
||||
/**
|
||||
* 回调地址
|
||||
*/
|
||||
private String callbackUrl;
|
||||
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.bsd.pjcloud.app.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
/**
|
||||
* 微信小程序配置
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties(prefix = "mini-wechat-pay")
|
||||
public class MiniWechatConf {
|
||||
/**
|
||||
* 应用ID
|
||||
*/
|
||||
private String appId;
|
||||
|
||||
private String appSecret;
|
||||
}
|
||||
+139
@@ -0,0 +1,139 @@
|
||||
package com.bsd.pjcloud.app.controller;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.app.api.constant.menu.AppMenuPlatformEnum;
|
||||
import com.bsd.pjcloud.app.api.constant.menu.AppMenuTypeEnum;
|
||||
import com.bsd.pjcloud.app.api.dto.AppMenuDto;
|
||||
import com.bsd.pjcloud.app.api.entity.AppMenuEntity;
|
||||
import com.bsd.pjcloud.common.core.constant.enums.YesNoEnum;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.app.service.AppMenuService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 菜单管理
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/app-menu")
|
||||
@Tag(description = "app-menu", name = "菜单管理管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppMenuController {
|
||||
|
||||
private final AppMenuService appMenuService;
|
||||
|
||||
/* ************************************* start app start ************************************* */
|
||||
|
||||
/**
|
||||
* 列表差
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/app/list")
|
||||
public R<List<AppMenuEntity>> appList(@ParameterObject AppMenuDto dto) {
|
||||
return listVisibleAppMenus(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务间调用:与 {@link #appList} 数据一致,需 Feign 携带内部调用头(见 {@code @NoToken} 与 {@link Inner})。
|
||||
*/
|
||||
@Inner(value = true)
|
||||
@Operation(summary = "内部-App菜单列表", description = "供 integrated 等经 Feign 拉取,与 /app-menu/app/list 一致")
|
||||
@GetMapping("/inner/app/list")
|
||||
public R<List<AppMenuEntity>> innerAppList(@ParameterObject AppMenuDto dto) {
|
||||
return listVisibleAppMenus(dto);
|
||||
}
|
||||
|
||||
private R<List<AppMenuEntity>> listVisibleAppMenus(AppMenuDto dto) {
|
||||
dto.setVisible(YesNoEnum.YES.getCode());
|
||||
if (ObjectUtil.isNotEmpty(dto.getPlatformEnum())) {
|
||||
dto.setPlatform(dto.getPlatformEnum().getType());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getTypeEnum())) {
|
||||
dto.setType(dto.getTypeEnum().getType());
|
||||
}
|
||||
return R.ok(appMenuService.scopeList(dto, null));
|
||||
}
|
||||
|
||||
/* ************************************* end app end ************************************* */
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('app_appMenu_view')")
|
||||
public R getAppMenuPage(@ParameterObject Page page, @ParameterObject AppMenuEntity dto) {
|
||||
return R.ok(appMenuService.scopePage(page, dto, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询菜单管理
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('app_appMenu_view')")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(appMenuService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增菜单管理
|
||||
*/
|
||||
@Operation(summary = "新增菜单管理", description = "新增菜单管理")
|
||||
@SysLog("新增菜单管理")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appMenu_add')")
|
||||
public R save(@RequestBody AppMenuEntity appMenu) {
|
||||
return R.ok(appMenuService.save(appMenu));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改菜单管理
|
||||
*/
|
||||
@Operation(summary = "修改菜单管理", description = "修改菜单管理")
|
||||
@SysLog("修改菜单管理")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appMenu_edit')")
|
||||
public R updateById(@RequestBody AppMenuEntity appMenu) {
|
||||
return R.ok(appMenuService.updateById(appMenu));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除菜单管理
|
||||
*/
|
||||
@Operation(summary = "通过id删除菜单管理", description = "通过id删除菜单管理")
|
||||
@SysLog("通过id删除菜单管理")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('app_appMenu_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(appMenuService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('app_appMenu_export')")
|
||||
public List<AppMenuEntity> export(AppMenuEntity appMenu, Long[] ids) {
|
||||
return appMenuService.list(Wrappers.lambdaQuery(appMenu).in(ArrayUtil.isNotEmpty(ids), AppMenuEntity::getId, ids));
|
||||
}
|
||||
|
||||
}
|
||||
+84
-82
@@ -20,6 +20,8 @@ package com.bsd.pjcloud.app.controller;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.app.api.dto.AppAdminSyncDto;
|
||||
import com.bsd.pjcloud.app.api.dto.AppUserInfo;
|
||||
import com.bsd.pjcloud.app.api.entity.AppSocialDetails;
|
||||
import com.bsd.pjcloud.app.service.AppSocialDetailsService;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
@@ -28,6 +30,8 @@ import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.common.security.annotation.HasPermission;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
@@ -45,95 +49,93 @@ import java.util.List;
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppSocialDetailsController {
|
||||
|
||||
private final AppSocialDetailsService appSocialDetailsService;
|
||||
private final AppSocialDetailsService appSocialDetailsService;
|
||||
|
||||
/**
|
||||
* 社交登录账户简单分页查询
|
||||
* @param page 分页对象
|
||||
* @param appSocialDetails 社交登录
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R getSocialDetailsPage(Page page, AppSocialDetails appSocialDetails) {
|
||||
return R.ok(appSocialDetailsService.page(page, Wrappers.query(appSocialDetails)));
|
||||
}
|
||||
/* ************************************* start 设备端 start ************************************* */
|
||||
|
||||
/**
|
||||
* 信息
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R getinfo(@PathVariable("id") Long id) {
|
||||
return R.ok(appSocialDetailsService.getById(id));
|
||||
}
|
||||
/**
|
||||
* 同步admin账户信息为app账户
|
||||
*/
|
||||
@Inner(value = true)
|
||||
@PostMapping("/sync-admin-account-info")
|
||||
public R<AppUserInfo> syncAdminAccountInfo(@RequestBody AppAdminSyncDto dto) {
|
||||
return R.ok(appSocialDetailsService.syncAdminAccountInfo(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
* @param appSocialDetails
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("保存三方信息")
|
||||
@PostMapping
|
||||
@HasPermission("app_social_details_add")
|
||||
public R save(@Valid @RequestBody AppSocialDetails appSocialDetails) {
|
||||
return R.ok(appSocialDetailsService.save(appSocialDetails));
|
||||
}
|
||||
/* ************************************* end 设备端 end ************************************* */
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param appSocialDetails
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("修改三方信息")
|
||||
@PutMapping
|
||||
@HasPermission("app_social_details_edit")
|
||||
public R updateById(@Validated({ ValidGroup.Update.class }) @RequestBody AppSocialDetails appSocialDetails) {
|
||||
appSocialDetailsService.updateById(appSocialDetails);
|
||||
return R.ok(Boolean.TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param ids
|
||||
* @return R
|
||||
*/
|
||||
@SysLog("删除三方信息")
|
||||
@DeleteMapping
|
||||
@HasPermission("app_social_details_del")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(appSocialDetailsService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
/**
|
||||
* 社交登录账户简单分页查询
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public R getSocialDetailsPage(Page page, AppSocialDetails appSocialDetails) {
|
||||
return R.ok(appSocialDetailsService.page(page, Wrappers.query(appSocialDetails)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过社交账号、手机号查询用户、角色信息
|
||||
* @param inStr appid@code
|
||||
* @return
|
||||
*/
|
||||
@Inner
|
||||
@GetMapping("/info/{inStr}")
|
||||
public R getUserInfo(@PathVariable String inStr) {
|
||||
return R.ok(appSocialDetailsService.getUserInfo(inStr));
|
||||
}
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R getinfo(@PathVariable("id") Long id) {
|
||||
return R.ok(appSocialDetailsService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定社交账号
|
||||
* @param state 类型
|
||||
* @param code code
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/bind")
|
||||
public R bindSocial(String state, String code) {
|
||||
return R.ok(appSocialDetailsService.bindSocial(state, code));
|
||||
}
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@SysLog("保存三方信息")
|
||||
@PostMapping
|
||||
@HasPermission("app_social_details_add")
|
||||
public R save(@Valid @RequestBody AppSocialDetails appSocialDetails) {
|
||||
return R.ok(appSocialDetailsService.save(appSocialDetails));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
@GetMapping("/export")
|
||||
@ResponseExcel
|
||||
public List<AppSocialDetails> export(AppSocialDetails appSocialDetails) {
|
||||
return appSocialDetailsService.list(Wrappers.query(appSocialDetails));
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@SysLog("修改三方信息")
|
||||
@PutMapping
|
||||
@HasPermission("app_social_details_edit")
|
||||
public R updateById(@Validated({ValidGroup.Update.class}) @RequestBody AppSocialDetails appSocialDetails) {
|
||||
appSocialDetailsService.updateById(appSocialDetails);
|
||||
return R.ok(Boolean.TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@SysLog("删除三方信息")
|
||||
@DeleteMapping
|
||||
@HasPermission("app_social_details_del")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(appSocialDetailsService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过社交账号、手机号查询用户、角色信息
|
||||
*/
|
||||
@Inner
|
||||
@GetMapping("/info/{inStr}")
|
||||
public R getUserInfo(@PathVariable String inStr) {
|
||||
return R.ok(appSocialDetailsService.getUserInfo(inStr));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定社交账号
|
||||
*/
|
||||
@PostMapping("/bind")
|
||||
public R bindSocial(String state, String code) {
|
||||
return R.ok(appSocialDetailsService.bindSocial(state, code));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
@GetMapping("/export")
|
||||
@ResponseExcel
|
||||
public List<AppSocialDetails> export(AppSocialDetails appSocialDetails) {
|
||||
return appSocialDetailsService.list(Wrappers.query(appSocialDetails));
|
||||
}
|
||||
|
||||
}
|
||||
+16
-107
@@ -24,6 +24,7 @@ import com.bsd.pjcloud.admin.api.dto.UserTokenDTO;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUser;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteTokenService;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteUserService;
|
||||
import com.bsd.pjcloud.app.api.dto.AppUserDTO;
|
||||
import com.bsd.pjcloud.app.service.AppUserService;
|
||||
import com.bsd.pjcloud.canteen.api.feign.RemoteCanteenSpuService;
|
||||
import com.bsd.pjcloud.canteen.api.feign.RemoteDailyMenuService;
|
||||
@@ -33,13 +34,13 @@ import com.bsd.pjcloud.canteen.entity.CanteenSpuEntity;
|
||||
import com.bsd.pjcloud.canteen.vo.app.CanteenOnlineSpuAppVO;
|
||||
import com.bsd.pjcloud.canteen.vo.app.DailyMenuAppVO;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.thirdparty.api.feign.RemoterThirdPartyAuthService;
|
||||
import com.bsd.pjcloud.thirdparty.dto.SHJNSSODTO;
|
||||
import com.bsd.pjcloud.thirdparty.dto.UrlTokenDTO;
|
||||
import com.bsd.pjcloud.thirdparty.dto.ZZDUserDTO;
|
||||
import com.bsd.pjcloud.thirdparty.entity.ThirdPartyUserEntity;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@@ -88,111 +89,18 @@ public class AppUserAutoLoginController {
|
||||
private final RemoteOnlineCanteenSpuService remoteOnlineCanteenSpuService;
|
||||
private final RemoteDailyMenuService remoteDailyMenuService;
|
||||
|
||||
/*
|
||||
*
|
||||
* @param token 浙政钉前端获取的token
|
||||
* @return
|
||||
/**
|
||||
* 路径参数历史命名为 token,实为浙政钉 H5 {@code authCode},转发 thirdParty 统一单点(含短信核验等逻辑)。
|
||||
*/
|
||||
@GetMapping("/zzdsso/{token}")
|
||||
@Operation(summary = "浙政钉单点登录")
|
||||
@Inner(value = false)
|
||||
@GlobalTransactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
//todo 引入seata分布式事务
|
||||
public R zzdsso(@PathVariable(name = "token") String token) {
|
||||
|
||||
//获取数字政务token通过浙政钉前端获取的token,调试阶段先写死
|
||||
String json = "{" +
|
||||
"\"username\": \"李宗相\"," +
|
||||
"\"organizationId\": 2," +
|
||||
"\"userId\": 1340," +
|
||||
"\"nickName\": \"李宗相\"," +
|
||||
"\"mobile\": \"18576496089\"," +
|
||||
"\"regionCode\": null," +
|
||||
"\"ext\": {" +
|
||||
"\"employeeCode\": \"GE_ae12bdf21598498eb48bf2cf2c45a3e1\"," +
|
||||
"\"organizationCode\": \"GO_63e77077d5e041789bbbe1d0d20bcf41\"," +
|
||||
"\"nickNameCn\": \"李宗相\"," +
|
||||
"\"openid\": \"1b51f0e11fc73b8adddcbaf7982daab6\"," +
|
||||
"\"realmId\": \"196729\"," +
|
||||
"\"mobile\": null" +
|
||||
"}" +
|
||||
"}";
|
||||
|
||||
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
ZZDUserDTO zzdUserDTO;
|
||||
try {
|
||||
zzdUserDTO = objectMapper.readValue(json, ZZDUserDTO.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
//暂时先注释,模拟一下就行
|
||||
// R zzdsso = remoterThirdPartyAuthService.zzdsso(token);
|
||||
// ZZDUserDTO zzdUserDTO = (ZZDUserDTO) zzdsso.getData();
|
||||
ZZDUserDTO.Ext ext = zzdUserDTO.getExt();
|
||||
String employeeCode = ext.getEmployeeCode();
|
||||
String mobile = zzdUserDTO.getMobile();
|
||||
|
||||
//两种方式,手机号+员工钉钉号,查到相同就视为同一个人,然后登录
|
||||
//先系统表里面查看是否有,在第三方数据库表里面看下是否有
|
||||
|
||||
//1.根据手机号或者钉钉号先查询是否有这个人
|
||||
R<List<SysUser>> userByMobileOrEmployeeCode = remoteUserService.getUserByMobileOrEmployeeCode(employeeCode, mobile);
|
||||
List<SysUser> sysUserList = userByMobileOrEmployeeCode.getData();
|
||||
|
||||
if(!CollectionUtils.isEmpty(sysUserList)){
|
||||
//登录成功生成token
|
||||
UserTokenDTO userTokenDTO = new UserTokenDTO();
|
||||
userTokenDTO.setSysUser(sysUserList.get(0));
|
||||
remoteTokenService.generateToken(userTokenDTO);
|
||||
}
|
||||
//2.根据浙政钉的员工钉钉号查询是否有这个人
|
||||
R<List<ThirdPartyUserEntity>> thirdPartyUserEntityR=remoterThirdPartyAuthService.getUserByEmployeeCode(employeeCode);
|
||||
List<ThirdPartyUserEntity> thirdPartyUserEntityList = thirdPartyUserEntityR.getData();
|
||||
|
||||
UserDTO userDTO = new UserDTO();
|
||||
//写死,新加入到部门表的全部归类到其他部门里面,不按照浙政钉的部门
|
||||
userDTO.setDeptId(1865990541445263361L);
|
||||
userDTO.setUsername(zzdUserDTO.getUsername());
|
||||
userDTO.setName(zzdUserDTO.getUsername());
|
||||
userDTO.setNickname(zzdUserDTO.getUsername());
|
||||
//浙里办用户
|
||||
userDTO.setSystemType("1");
|
||||
//取上面的手机号
|
||||
userDTO.setPhone(mobile);
|
||||
userDTO.setDingtalkEmployeeCode(employeeCode);
|
||||
//随便写死给个密码
|
||||
userDTO.setPassword("pj"+mobile);
|
||||
/* if(!CollectionUtils.isEmpty(thirdPartyUserEntityList)){
|
||||
//todo 这一步现在是没用的,这个最终要考虑是否通过浙政钉里面的人员来限制移动端的使用用户来决定
|
||||
//第三方数据库里面有
|
||||
//这里只在第三方库里查到,所以要对系统用户表进行新增当前用户,插入一条信息进去
|
||||
R<Boolean> booleanR = remoteUserService.registerUser(userDTO);
|
||||
//通过唯一手机号查询到刚注册的用户信息,生成token
|
||||
R<List<SysUser>> userByMobile=remoteUserService.getUserByMobile(mobile);
|
||||
SysUser sysUser = userByMobile.getData().get(0);
|
||||
UserTokenDTO userTokenDTO = new UserTokenDTO();
|
||||
userTokenDTO.setSysUser(sysUser);
|
||||
//登录成功,根据新注册的用户信息返回token
|
||||
remoteTokenService.generateToken(userTokenDTO);
|
||||
}
|
||||
else {
|
||||
//两个表都没查到人员不能够使用移动端的系统
|
||||
}*/
|
||||
|
||||
// log.info("用户不存在,尝试创建用户");
|
||||
|
||||
R<Boolean> booleanR = remoteUserService.registerUser(userDTO);
|
||||
//通过唯一手机号查询到刚注册的用户信息,生成token
|
||||
|
||||
R<List<SysUser>> userByMobile=remoteUserService.getUserByMobile(mobile);
|
||||
SysUser sysUser = userByMobile.getData().get(0);
|
||||
int i=8/0;
|
||||
UserTokenDTO userTokenDTO = new UserTokenDTO();
|
||||
userTokenDTO.setSysUser(sysUser);
|
||||
//登录成功,根据新注册的用户信息返回token
|
||||
return remoteTokenService.generateToken(userTokenDTO);
|
||||
UrlTokenDTO body = new UrlTokenDTO();
|
||||
body.setAuthCode(token);
|
||||
return remoterThirdPartyAuthService.zzdsso(body);
|
||||
}
|
||||
|
||||
|
||||
@@ -387,12 +295,13 @@ public class AppUserAutoLoginController {
|
||||
// return appUserService.importUser(excelVOList, bindingResult);
|
||||
// }
|
||||
//
|
||||
// @Operation(summary = "注册app用户表", description = "注册app用户表")
|
||||
// @SysLog("注册app用户表")
|
||||
// @Inner(value = false)
|
||||
// @PostMapping("/register")
|
||||
// public R register(@RequestBody AppUserDTO appUser) {
|
||||
// return appUserService.registerAppUser(appUser);
|
||||
// }
|
||||
|
||||
//@Operation(summary = "注册app用户表", description = "注册app用户表")
|
||||
//@SysLog("注册app用户表")
|
||||
//@Inner(value = false)
|
||||
//@PostMapping("/register")
|
||||
//public R register(@RequestBody AppUserDTO appUser) {
|
||||
// return appUserService.registerAppUser(appUser);
|
||||
//}
|
||||
|
||||
}
|
||||
+108
-147
@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserInfo;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteUserService;
|
||||
import com.bsd.pjcloud.app.api.dto.AppUserDTO;
|
||||
import com.bsd.pjcloud.app.api.dto.AppUserInfo;
|
||||
import com.bsd.pjcloud.app.api.entity.AppUser;
|
||||
import com.bsd.pjcloud.app.api.feign.RemoteAppUserService;
|
||||
import com.bsd.pjcloud.app.api.vo.AppUserExcelVO;
|
||||
@@ -61,155 +62,115 @@ import java.util.List;
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class AppUserController {
|
||||
|
||||
private final AppUserService appUserService;
|
||||
|
||||
|
||||
@Inner
|
||||
@GetMapping("/info/{username}")
|
||||
public R info(@PathVariable String username) {
|
||||
AppUser user = appUserService.getOne(Wrappers.<AppUser>query()
|
||||
.lambda()
|
||||
.eq(AppUser::getUsername, username)
|
||||
.or()
|
||||
.eq(AppUser::getPhone, username));
|
||||
if (user == null) {
|
||||
return R.failed(MsgUtils.getMessage(ErrorCodes.APP_USER_USERINFO_EMPTY, username));
|
||||
}
|
||||
return R.ok(appUserService.findUserInfo(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户全部信息
|
||||
* @return 用户信息
|
||||
*/
|
||||
@GetMapping(value = { "/info" })
|
||||
public R info() {
|
||||
String username = SecurityUtils.getUser().getUsername();
|
||||
AppUser user = appUserService.getOne(Wrappers.<AppUser>query().lambda().eq(AppUser::getUsername, username));
|
||||
if (user == null) {
|
||||
return R.failed(MsgUtils.getMessage(ErrorCodes.SYS_USER_QUERY_ERROR));
|
||||
}
|
||||
return R.ok(appUserService.findUserInfo(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param appUserDTO app用户表
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getAppUserPage(Page page, AppUserDTO appUserDTO) {
|
||||
return R.ok(appUserService.getUsersWithRolePage(page, appUserDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询app用户表
|
||||
* @param userId id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/details/{userId}")
|
||||
public R getById(@PathVariable("userId") Long userId) {
|
||||
return R.ok(appUserService.selectUserVoById(userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过userName查询", description = "通过userName查询")
|
||||
@GetMapping("/details")
|
||||
public R getByUserName(AppUser user) {
|
||||
AppUser one = appUserService.getOne(Wrappers.query(user), false);
|
||||
return R.ok(one == null ? null : CommonConstants.SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增app用户表
|
||||
* @param appUser app用户表
|
||||
* @return R
|
||||
*/
|
||||
// @Operation(summary = "新增app用户表", description = "新增app用户表")
|
||||
// @SysLog("新增app用户表")
|
||||
// @PostMapping
|
||||
// @HasPermission("app_appuser_add")
|
||||
// public R save(@RequestBody AppUserDTO appUser) {
|
||||
// appUserService.saveUser(appUser);
|
||||
// return R.ok();
|
||||
// }
|
||||
|
||||
/**
|
||||
* 修改app用户表
|
||||
* @param appUser app用户表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改app用户表", description = "修改app用户表")
|
||||
@SysLog("修改app用户表")
|
||||
@PutMapping
|
||||
@HasPermission("app_appuser_edit")
|
||||
public R updateById(@RequestBody AppUserDTO appUser) {
|
||||
return R.ok(appUserService.updateUser(appUser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除app用户表
|
||||
* @param ids userIds
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过ids删除app用户表", description = "通过ids删除app用户表")
|
||||
@SysLog("通过id删除app用户表")
|
||||
@DeleteMapping
|
||||
@HasPermission("app_appuser_del")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(appUserService.deleteAppUserByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
// * @param appUser 查询条件
|
||||
* @return excel 文件流
|
||||
*/
|
||||
// @ResponseExcel
|
||||
// @GetMapping("/export")
|
||||
// @HasPermission("app_appuser_export")
|
||||
// public List<AppUserExcelVO> export(AppUserDTO appUser) {
|
||||
// return appUserService.listUser(appUser);
|
||||
// }
|
||||
|
||||
@SysLog("修改个人信息")
|
||||
@PutMapping("/edit")
|
||||
public R updateUserInfo(@Valid @RequestBody AppUserDTO userDto) {
|
||||
if (UserTypeEnum.TOC.getStatus().equals(SecurityUtils.getUser().getUserType())) {
|
||||
userDto.setUserId(SecurityUtils.getUser().getId());
|
||||
// TOC 以手机号为key
|
||||
userDto.setUsername(SecurityUtils.getUser().getUsername());
|
||||
}
|
||||
return appUserService.updateUserInfo(userDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入用户
|
||||
* @param excelVOList 用户列表
|
||||
* @param bindingResult 错误信息列表
|
||||
* @return R
|
||||
*/
|
||||
// @PostMapping("/import")
|
||||
// @HasPermission("app_appuser_export")
|
||||
// public R importUser(@RequestExcel List<AppUserExcelVO> excelVOList, BindingResult bindingResult) {
|
||||
// return appUserService.importUser(excelVOList, bindingResult);
|
||||
// }
|
||||
|
||||
// @Operation(summary = "注册app用户表", description = "注册app用户表")
|
||||
// @SysLog("注册app用户表")
|
||||
// @Inner(value = false)
|
||||
// @PostMapping("/register")
|
||||
// public R register(@RequestBody AppUserDTO appUser) {
|
||||
// return appUserService.registerAppUser(appUser);
|
||||
// }
|
||||
|
||||
private final AppUserService appUserService;
|
||||
|
||||
/* ************************************* start app start ************************************* */
|
||||
|
||||
/**
|
||||
* 获取当前用户全部信息
|
||||
*/
|
||||
@GetMapping(value = {"/info"})
|
||||
public R<AppUserInfo> info() {
|
||||
Long userId = SecurityUtils.getUser().getId();
|
||||
AppUser user = appUserService.getOne(Wrappers.<AppUser>query().lambda().eq(AppUser::getUserId, userId));
|
||||
if (user == null) {
|
||||
return R.failed(MsgUtils.getMessage(ErrorCodes.SYS_USER_QUERY_ERROR));
|
||||
}
|
||||
return R.ok(appUserService.findUserInfo(user));
|
||||
}
|
||||
|
||||
/* ************************************* end app end ************************************* */
|
||||
|
||||
/* ************************************* start 远程调用 start ************************************* */
|
||||
|
||||
@Inner
|
||||
@GetMapping("/info/{username}")
|
||||
public R info(@PathVariable String username) {
|
||||
AppUser user = appUserService.getOne(Wrappers.<AppUser>query()
|
||||
.lambda()
|
||||
.eq(AppUser::getUsername, username)
|
||||
.or()
|
||||
.eq(AppUser::getPhone, username));
|
||||
if (user == null) {
|
||||
return R.failed(MsgUtils.getMessage(ErrorCodes.APP_USER_USERINFO_EMPTY, username));
|
||||
}
|
||||
return R.ok(appUserService.findUserInfo(user));
|
||||
}
|
||||
|
||||
@Inner
|
||||
@GetMapping("/infoByUserId/{userId}")
|
||||
public R<AppUserInfo> infoByUserId(@PathVariable Long userId) {
|
||||
AppUser user = appUserService.getOne(Wrappers.<AppUser>query()
|
||||
.lambda()
|
||||
.eq(AppUser::getUserId, userId)
|
||||
);
|
||||
if (user == null) return R.failed();
|
||||
return R.ok(appUserService.findUserInfo(user));
|
||||
}
|
||||
|
||||
/* ************************************* end 远程调用 end ************************************* */
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getAppUserPage(Page page, AppUserDTO appUserDTO) {
|
||||
return R.ok(appUserService.getUsersWithRolePage(page, appUserDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询app用户表
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/details/{userId}")
|
||||
public R getById(@PathVariable("userId") Long userId) {
|
||||
return R.ok(appUserService.selectUserVoById(userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过userName查询", description = "通过userName查询")
|
||||
@GetMapping("/details")
|
||||
public R getByUserName(AppUser user) {
|
||||
AppUser one = appUserService.getOne(Wrappers.query(user), false);
|
||||
return R.ok(one == null ? null : CommonConstants.SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改app用户表
|
||||
*/
|
||||
@Operation(summary = "修改app用户表", description = "修改app用户表")
|
||||
@SysLog("修改app用户表")
|
||||
@PutMapping
|
||||
@HasPermission("app_appuser_edit")
|
||||
public R updateById(@RequestBody AppUserDTO appUser) {
|
||||
return R.ok(appUserService.updateUser(appUser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除app用户表
|
||||
*/
|
||||
@Operation(summary = "通过ids删除app用户表", description = "通过ids删除app用户表")
|
||||
@SysLog("通过id删除app用户表")
|
||||
@DeleteMapping
|
||||
@HasPermission("app_appuser_del")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(appUserService.deleteAppUserByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
@SysLog("修改个人信息")
|
||||
@PutMapping("/edit")
|
||||
public R updateUserInfo(@Valid @RequestBody AppUserDTO userDto) {
|
||||
if (UserTypeEnum.TOC.getStatus().equals(SecurityUtils.getUser().getUserType())) {
|
||||
userDto.setUserId(SecurityUtils.getUser().getId());
|
||||
// TOC 以手机号为key
|
||||
userDto.setUsername(SecurityUtils.getUser().getUsername());
|
||||
}
|
||||
return appUserService.updateUserInfo(userDto);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
package com.bsd.pjcloud.app.handler;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alipay.api.AlipayClient;
|
||||
import com.alipay.api.AlipayConfig;
|
||||
import com.alipay.api.DefaultAlipayClient;
|
||||
import com.alipay.api.request.AlipaySystemOauthTokenRequest;
|
||||
import com.alipay.api.response.AlipaySystemOauthTokenResponse;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.bsd.pjcloud.app.api.constant.AppUserTypeEnum;
|
||||
import com.bsd.pjcloud.app.api.dto.AppUserInfo;
|
||||
import com.bsd.pjcloud.app.api.entity.AppUser;
|
||||
import com.bsd.pjcloud.app.config.MiniAlipayConf;
|
||||
import com.bsd.pjcloud.app.mapper.AppSocialDetailsMapper;
|
||||
import com.bsd.pjcloud.app.service.AppUserService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 支付宝小程序
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("MINI_ALIPAY")
|
||||
@AllArgsConstructor
|
||||
public class MiniAlipayLoginHandler extends AbstractLoginHandler {
|
||||
|
||||
private final MiniAlipayConf miniAlipayConf;
|
||||
|
||||
private final AppUserService appUserService;
|
||||
|
||||
private final AppSocialDetailsMapper appSocialDetailsMapper;
|
||||
|
||||
static private AlipayClient alipayClient = null;
|
||||
|
||||
public AlipayClient getAlipay() {
|
||||
if (ObjectUtil.isNotEmpty(miniAlipayConf)) return getAlipayClient();
|
||||
return getAlipayClient();
|
||||
}
|
||||
|
||||
private synchronized AlipayClient getAlipayClient() {
|
||||
if (alipayClient == null) {
|
||||
try {
|
||||
alipayClient = new DefaultAlipayClient(getAlipayConfig());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("初始化支付宝客户端失败error:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
return alipayClient;
|
||||
}
|
||||
|
||||
private AlipayConfig getAlipayConfig() {
|
||||
AlipayConfig alipayConfig = new AlipayConfig();
|
||||
alipayConfig.setServerUrl("https://openapi.alipay.com/gateway.do");
|
||||
alipayConfig.setAppId(miniAlipayConf.getAppId());
|
||||
alipayConfig.setPrivateKey(miniAlipayConf.getPrivateKey());
|
||||
alipayConfig.setFormat("json");
|
||||
alipayConfig.setAlipayPublicKey(miniAlipayConf.getAlipayPublicKey());
|
||||
alipayConfig.setCharset("UTF-8");
|
||||
alipayConfig.setSignType("RSA2");
|
||||
return alipayConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取支付宝openId
|
||||
*/
|
||||
public AlipaySystemOauthTokenResponse getOpenId(String code, String refreshToken) {
|
||||
AlipaySystemOauthTokenRequest request = new AlipaySystemOauthTokenRequest();
|
||||
// 设置刷新令牌
|
||||
if (ObjectUtil.isNotEmpty(refreshToken)) {
|
||||
request.setRefreshToken(refreshToken);
|
||||
request.setGrantType("refresh_token");
|
||||
}
|
||||
// 设置授权码
|
||||
if (ObjectUtil.isNotEmpty(code)) {
|
||||
request.setCode(code);
|
||||
request.setGrantType("authorization_code");
|
||||
}
|
||||
try {
|
||||
AlipaySystemOauthTokenResponse response = getAlipay().execute(request);
|
||||
if (!response.isSuccess()) {
|
||||
log.error("|获取支付宝openId|错误error:{}", response.getSubMsg());
|
||||
}
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|获取支付宝openId|意外的错误error:{}", e.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过用户传入获取唯一标识
|
||||
*/
|
||||
@Override
|
||||
public String identify(String loginStr) {
|
||||
AlipaySystemOauthTokenResponse res = getOpenId(loginStr, null);
|
||||
if (ObjectUtil.isEmpty(res) || ObjectUtil.isEmpty(res.getOpenId())) {
|
||||
return null;
|
||||
}
|
||||
return res.getOpenId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
*/
|
||||
@Override
|
||||
public AppUserInfo info(String openId) {
|
||||
AppUser user = appUserService.getOne(Wrappers.<AppUser>query().lambda().eq(AppUser::getOpenid, openId));
|
||||
if (ObjectUtil.isEmpty(user)) {
|
||||
log.info("支付宝小程序openId:{},创建新的用户", openId);
|
||||
String name = "支付宝游客-" + openId;
|
||||
AppUser appUser = new AppUser();
|
||||
appUser.setOpenid(openId);
|
||||
appUser.setUserType(AppUserTypeEnum.MINI_ALIPAY.getType());
|
||||
appUser.setUsername(name);
|
||||
appUser.setName(name);
|
||||
appUser.setCreateBy(openId);
|
||||
appUser.setUpdateBy(openId);
|
||||
appUserService.saveOrUpdate(appUser);
|
||||
return appUserService.findUserInfo(user);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(user.getLoginExtJson())) {
|
||||
|
||||
}
|
||||
return appUserService.findUserInfo(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定逻辑
|
||||
*/
|
||||
@Override
|
||||
public Boolean bind(AppUser user, String identify) {
|
||||
user.setOpenid(identify);
|
||||
appUserService.updateById(user);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+30
-38
@@ -17,18 +17,15 @@
|
||||
|
||||
package com.bsd.pjcloud.app.handler;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import cn.binarywang.wx.miniapp.api.WxMaService;
|
||||
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.bsd.pjcloud.app.api.constant.AppUserTypeEnum;
|
||||
import com.bsd.pjcloud.app.api.dto.AppUserInfo;
|
||||
import com.bsd.pjcloud.app.api.entity.AppSocialDetails;
|
||||
import com.bsd.pjcloud.app.api.entity.AppUser;
|
||||
import com.bsd.pjcloud.app.mapper.AppSocialDetailsMapper;
|
||||
import com.bsd.pjcloud.app.service.AppUserService;
|
||||
import com.bsd.pjcloud.common.core.constant.SecurityConstants;
|
||||
import com.bsd.pjcloud.common.core.constant.enums.LoginTypeEnum;
|
||||
import com.bsd.pjcloud.common.core.exception.CheckedException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -36,20 +33,19 @@ import org.springframework.stereotype.Component;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author pjcloud
|
||||
* @date 2019年11月02日
|
||||
* <p>
|
||||
* 微信小程序
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("APP-MINI")
|
||||
@Component("MINI_WECHAT")
|
||||
@AllArgsConstructor
|
||||
public class MiniAppLoginHandler extends AbstractLoginHandler {
|
||||
public class MiniWechatLoginHandler extends AbstractLoginHandler {
|
||||
|
||||
private final AppUserService appUserService;
|
||||
|
||||
private final AppSocialDetailsMapper appSocialDetailsMapper;
|
||||
|
||||
private final WxMaService wxMaService;
|
||||
|
||||
/**
|
||||
* 小程序登录传入code
|
||||
* <p>
|
||||
@@ -60,20 +56,16 @@ public class MiniAppLoginHandler extends AbstractLoginHandler {
|
||||
*/
|
||||
@Override
|
||||
public String identify(String code) {
|
||||
AppSocialDetails condition = new AppSocialDetails();
|
||||
condition.setType(LoginTypeEnum.MINI_APP.getType());
|
||||
AppSocialDetails socialDetails = appSocialDetailsMapper.selectOne(new QueryWrapper<>(condition));
|
||||
|
||||
String url = String.format(SecurityConstants.MINI_APP_AUTHORIZATION_CODE_URL, socialDetails.getAppId(),
|
||||
socialDetails.getAppSecret(), code);
|
||||
String result = HttpUtil.get(url);
|
||||
log.debug("微信小程序响应报文:{}", result);
|
||||
|
||||
if (JSONUtil.parseObj(result).containsKey("openid")) {
|
||||
return JSONUtil.parseObj(result).get("openid").toString();
|
||||
} else {
|
||||
log.error("微信小程序登录失败:{}", result);
|
||||
throw new CheckedException("微信小程序登录失败");
|
||||
try {
|
||||
WxMaJscode2SessionResult session = wxMaService.getUserService().getSessionInfo(code);
|
||||
if (ObjectUtil.isNotEmpty(session) && ObjectUtil.isNotEmpty(session.getOpenid())) {
|
||||
return session.getOpenid();
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("微信小程序登录失败:{}", e.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,23 +77,23 @@ public class MiniAppLoginHandler extends AbstractLoginHandler {
|
||||
*/
|
||||
@Override
|
||||
public AppUserInfo info(String openId) {
|
||||
AppUser user = appUserService.getOne(Wrappers.<AppUser>query().lambda().eq(AppUser::getWxOpenid, openId));
|
||||
|
||||
// 未注册用户自动注册
|
||||
if (Objects.isNull(user)) {
|
||||
log.info("微信小程序未绑定:{},创建新的用户", openId);
|
||||
AppUser user = appUserService.getOne(Wrappers.<AppUser>query().lambda().eq(AppUser::getOpenid, openId));
|
||||
if (ObjectUtil.isEmpty(user)) {
|
||||
log.info("微信小程序openId:{},创建新的用户", openId);
|
||||
String name = "微信游客-" + openId;
|
||||
AppUser appUser = new AppUser();
|
||||
appUser.setWxOpenid(openId);
|
||||
appUser.setUsername(openId);
|
||||
appUser.setOpenid(openId);
|
||||
appUser.setUserType(AppUserTypeEnum.MINI_ALIPAY.getType());
|
||||
appUser.setUsername(name);
|
||||
appUser.setName(name);
|
||||
appUser.setCreateBy(openId);
|
||||
appUser.setUpdateBy(openId);
|
||||
appUserService.saveOrUpdate(appUser);
|
||||
|
||||
AppUserInfo appUserDTO = new AppUserInfo();
|
||||
appUserDTO.setAppUser(appUser);
|
||||
return appUserDTO;
|
||||
return appUserService.findUserInfo(user);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(user.getLoginExtJson())) {
|
||||
|
||||
}
|
||||
return appUserService.findUserInfo(user);
|
||||
}
|
||||
|
||||
@@ -114,7 +106,7 @@ public class MiniAppLoginHandler extends AbstractLoginHandler {
|
||||
*/
|
||||
@Override
|
||||
public Boolean bind(AppUser user, String identify) {
|
||||
user.setWxOpenid(identify);
|
||||
user.setOpenid(identify);
|
||||
appUserService.updateById(user);
|
||||
return true;
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.bsd.pjcloud.app.mapper;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.app.api.entity.AppMenuEntity;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface AppMenuMapper extends PjcloudBaseMapper<AppMenuEntity> {
|
||||
|
||||
default LambdaQueryWrapper conditionWrapper(AppMenuEntity dto) {
|
||||
LambdaQueryWrapper<AppMenuEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getPlatform()), AppMenuEntity::getPlatform, dto.getPlatform())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getType()), AppMenuEntity::getType, dto.getType())
|
||||
.eq(ObjectUtil.isNotEmpty(dto.getVisible()), AppMenuEntity::getVisible, dto.getVisible())
|
||||
.orderByAsc(AppMenuEntity::getSort)
|
||||
.orderByDesc(AppMenuEntity::getCreateTime);
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
default List<AppMenuEntity> scopeList(AppMenuEntity dto, DataScope dataScope) {
|
||||
return selectList(conditionWrapper(dto));
|
||||
}
|
||||
|
||||
default Page<AppMenuEntity> scopePage(Page page, AppMenuEntity dto, DataScope dataScope) {
|
||||
return selectPage(page, conditionWrapper(dto));
|
||||
}
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.bsd.pjcloud.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.app.api.entity.AppMenuEntity;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface AppMenuService extends IService<AppMenuEntity> {
|
||||
|
||||
List<AppMenuEntity> scopeList(AppMenuEntity dto, DataScope dataScope);
|
||||
|
||||
Page<AppMenuEntity> scopePage(Page page, AppMenuEntity dto, DataScope dataScope);
|
||||
}
|
||||
+14
-16
@@ -18,30 +18,28 @@
|
||||
package com.bsd.pjcloud.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.app.api.dto.AppAdminSyncDto;
|
||||
import com.bsd.pjcloud.app.api.dto.AppUserInfo;
|
||||
import com.bsd.pjcloud.app.api.entity.AppSocialDetails;
|
||||
|
||||
/**
|
||||
* 系统社交登录账号表
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2018-08-16 21:30:41
|
||||
*/
|
||||
public interface AppSocialDetailsService extends IService<AppSocialDetails> {
|
||||
|
||||
/**
|
||||
* 绑定社交账号
|
||||
* @param state 类型
|
||||
* @param code code
|
||||
* @return
|
||||
*/
|
||||
Boolean bindSocial(String state, String code);
|
||||
|
||||
/**
|
||||
* 根据入参查询用户信息
|
||||
* @param inStr
|
||||
* @return
|
||||
*/
|
||||
AppUserInfo getUserInfo(String inStr);
|
||||
/**
|
||||
* 同步admin账户信息为app账户
|
||||
*/
|
||||
AppUserInfo syncAdminAccountInfo(AppAdminSyncDto dto);
|
||||
|
||||
/**
|
||||
* 绑定社交账号
|
||||
*/
|
||||
Boolean bindSocial(String state, String code);
|
||||
|
||||
/**
|
||||
* 根据入参查询用户信息
|
||||
*/
|
||||
AppUserInfo getUserInfo(String inStr);
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.bsd.pjcloud.app.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.app.api.entity.AppMenuEntity;
|
||||
import com.bsd.pjcloud.app.mapper.AppMenuMapper;
|
||||
import com.bsd.pjcloud.app.service.AppMenuService;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 菜单管理
|
||||
*/
|
||||
@Service
|
||||
public class AppMenuServiceImpl extends ServiceImpl<AppMenuMapper, AppMenuEntity> implements AppMenuService {
|
||||
|
||||
@Override
|
||||
public List<AppMenuEntity> scopeList(AppMenuEntity dto, DataScope dataScope) {
|
||||
return baseMapper.scopeList(dto, dataScope);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<AppMenuEntity> scopePage(Page page, AppMenuEntity dto, DataScope dataScope) {
|
||||
return baseMapper.scopePage(page, dto, dataScope);
|
||||
}
|
||||
|
||||
}
|
||||
+56
-34
@@ -17,8 +17,12 @@
|
||||
|
||||
package com.bsd.pjcloud.app.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.app.api.constant.AppUserTypeEnum;
|
||||
import com.bsd.pjcloud.app.api.dto.AppAdminSyncDto;
|
||||
import com.bsd.pjcloud.app.api.dto.AppUserInfo;
|
||||
import com.bsd.pjcloud.app.api.entity.AppSocialDetails;
|
||||
import com.bsd.pjcloud.app.api.entity.AppUser;
|
||||
@@ -26,6 +30,7 @@ import com.bsd.pjcloud.app.handler.LoginHandler;
|
||||
import com.bsd.pjcloud.app.mapper.AppSocialDetailsMapper;
|
||||
import com.bsd.pjcloud.app.mapper.AppUserMapper;
|
||||
import com.bsd.pjcloud.app.service.AppSocialDetailsService;
|
||||
import com.bsd.pjcloud.app.service.AppUserService;
|
||||
import com.bsd.pjcloud.common.core.constant.CacheConstants;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -42,45 +47,62 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
@Service("appSocialDetailsService")
|
||||
public class AppSocialDetailsServiceImpl extends ServiceImpl<AppSocialDetailsMapper, AppSocialDetails>
|
||||
implements AppSocialDetailsService {
|
||||
public class AppSocialDetailsServiceImpl extends ServiceImpl<AppSocialDetailsMapper, AppSocialDetails> implements AppSocialDetailsService {
|
||||
|
||||
private final Map<String, LoginHandler> loginHandlerMap;
|
||||
private final Map<String, LoginHandler> loginHandlerMap;
|
||||
|
||||
private final CacheManager cacheManager;
|
||||
private final CacheManager cacheManager;
|
||||
|
||||
private final AppUserMapper appUserMapper;
|
||||
private final AppUserMapper appUserMapper;
|
||||
|
||||
/**
|
||||
* 绑定社交账号
|
||||
* @param type type
|
||||
* @param code code
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean bindSocial(String type, String code) {
|
||||
LoginHandler loginHandler = loginHandlerMap.get(type);
|
||||
// 绑定逻辑
|
||||
String identify = loginHandler.identify(code);
|
||||
AppUser user = appUserMapper.selectById(SecurityUtils.getUser().getId());
|
||||
loginHandler.bind(user, identify);
|
||||
private final AppUserService appUserService;
|
||||
|
||||
// 更新緩存
|
||||
cacheManager.getCache(CacheConstants.USER_DETAILS_MINI).evict(user.getUsername());
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
@Override
|
||||
public AppUserInfo syncAdminAccountInfo(AppAdminSyncDto dto) {
|
||||
AppUser user = appUserService.getOne(Wrappers.<AppUser>query().lambda()
|
||||
.eq(AppUser::getOpenid, dto.getUniqueCode())
|
||||
.eq(AppUser::getUserType, dto.getUserTypeEnum().getType())
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(user)) {
|
||||
return appUserService.findUserInfo(user);
|
||||
}
|
||||
AppUser appUser = new AppUser();
|
||||
appUser.setOpenid(dto.getUniqueCode());
|
||||
appUser.setUserType(AppUserTypeEnum.MINI_ALIPAY.getType());
|
||||
appUser.setUsername(dto.getUsername());
|
||||
appUser.setName(dto.getUsername());
|
||||
appUser.setAvatar(dto.getAvatarImage());
|
||||
appUser.setCreateBy(dto.getUniqueCode());
|
||||
appUser.setUpdateBy(dto.getUniqueCode());
|
||||
appUserService.saveOrUpdate(appUser);
|
||||
return appUserService.findUserInfo(appUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据入参查询用户信息
|
||||
* @param inStr TYPE@code
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AppUserInfo getUserInfo(String inStr) {
|
||||
String[] inStrs = inStr.split(StringPool.AT);
|
||||
String type = inStrs[0];
|
||||
String loginStr = inStr.substring(type.length() + 1);
|
||||
return loginHandlerMap.get(type).handle(loginStr);
|
||||
}
|
||||
/**
|
||||
* 绑定社交账号
|
||||
*/
|
||||
@Override
|
||||
public Boolean bindSocial(String type, String code) {
|
||||
LoginHandler loginHandler = loginHandlerMap.get(type);
|
||||
// 绑定逻辑
|
||||
String identify = loginHandler.identify(code);
|
||||
AppUser user = appUserMapper.selectById(SecurityUtils.getUser().getId());
|
||||
loginHandler.bind(user, identify);
|
||||
|
||||
// 更新緩存
|
||||
cacheManager.getCache(CacheConstants.USER_DETAILS_MINI).evict(user.getUsername());
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据入参查询用户信息
|
||||
*/
|
||||
@Override
|
||||
public AppUserInfo getUserInfo(String inStr) {
|
||||
String[] inStrs = inStr.split(StringPool.AT);
|
||||
String type = inStrs[0];
|
||||
String loginStr = inStr.substring(type.length() + 1);
|
||||
return loginHandlerMap.get(type).handle(loginStr);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,3 +16,15 @@ spring:
|
||||
import:
|
||||
- optional:nacos:application-@profiles.active@.yml
|
||||
- optional:nacos:${spring.application.name}-@profiles.active@.yml
|
||||
|
||||
mini-ali-pay:
|
||||
app-id: 2021005197658445
|
||||
private-key: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCTYHY0AW2cjbHoOinD8f4CKMKasDmbRw4CEMasG5IzckmeuTqut3GmxxRRls62zlXRVOCDYgnGhzEhD/nMYx0TMBX2mYo+fH9XUMtZMKY+p2rPTXTlPnGfbQ4edUYofR0tq1ug+wHOD5/jxuwO1zPfB7t8dX3gNa4M43fTPK2mPDeo/UiRB45DPjUWvbMX59ltYYMgmAW0TAbXmRAGKFxrmX3HddJK0jSwEpTcHaRV3C6FrYV48vWHEliviVBUsLRIpwv3T3FYZm0a19LcGQtybeThXaaCYrj7Lwoffk8v8DL2g28IAeiFtjjkWbPFKKMCsSe/LVkvdQTuhncuDayTAgMBAAECggEAJvreiMbP7RZ1Nc0cet0op/2L60otEmrqw5UYVzE7rCvQWRD4+nk+sDP7pdDTf/p3LFTcxSNLHp1nWy1UjsCwUgDn7j+SFxDqxXdzMXXyoqO5VndQMcogV2CK2Xd/RPpCm2+1XpDFW3E6gw58JTi6WYU8C6Ev1/uau4H2kYJ9E3h2W0P0PyY+Q9QNHEpG2hLQdiWLHz3xzmSNSDXiknEg/Whew7IMVKNgxg5VVEBTerwCH5Grvn56CKx6acb6JlU+VFsmW3J1tMYLgxVhJWVVAK6NltmxE5apIxTkG3wEOMuuBCZHQ1Lm0rrGKJh8WmYRs6ho5wSjHYG3hyKRm/0TEQKBgQDcDDPyOWw/o9ZqB3N7qxUi63V7wU7X8QL/CmQO4tu/ng/4Drm8QESjk+ib3O3pCC7xwcte/U1Otw3AmSSj1CWvT8a0yLJM9GVOJwZFVyzy6yVFPyn6l4ndRdargyFokM2lgVTgEHo4WSMbLQsA8/KTB3anqo6bYLjqjsBgY49fpQKBgQCrdLMh5ayJOUK9UeBHXr0c/OLDzwoSUVMyNLfX3pIBC21meFxigNMiy+UKpslM2QMH1yyfwsUKv/i7y1kRFj9Go7pYU0HxglfHecllqXPunWJYuSm38x8WWAG/oqcLPGSlJjHYhU6IAkDuHHaW5DKLxr0x2DkZ/c4TcyYal9Ol1wKBgD4Lls4S0On02W1WIoLZT4FkIOE/NWsAAxdEp8fmwY17FQedp1NkT7ZL60efeNm/O/Vg7mYfSCAMz2ziAYnMNMAE34N0H4pBUxtBN6xvkzX/hafL0ptdBTuGCKydsdrZEZM8L2FqY/vlbleoULT5FAnPDe7i0YkQMbO5gpbrG68dAoGAFv+tc7OSREn5CNotwoUTywqlBG0GRdTA2zA1JPDHFvrIbwFgKxpqt/UvwREEWZmWjXuwkbGXqsx7ef1Z8i/QxxH5UhXA97trOOe+OzPSyEQ2R/52eSVUmzOs8F7KF3i/a2PHNesT0Ky0tvv8cFsl6Jf9Eu2VI0ZnWTaN+u04x7sCgYEAlhpr3RSJk2EnLPR3BxKboTxSGsK/2U4xz/WqX96B+lQ5h7NSMJC35vZJ5dm2vHtLcucHaK49YNsJdq+nzhhwxDz+Dd/5rcIp7AcdHqDsVLHYIN7JWxa9QiC3gvrnWsij1DShydOLpGMYveFz0LyRIUDW4CTs55oDFsIR4HdwtM0=
|
||||
public-key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAk2B2NAFtnI2x6Dopw/H+AijCmrA5m0cOAhDGrBuSM3JJnrk6rrdxpscUUZbOts5V0VTgg2IJxocxIQ/5zGMdEzAV9pmKPnx/V1DLWTCmPqdqz0105T5xn20OHnVGKH0dLatboPsBzg+f48bsDtcz3we7fHV94DWuDON30zytpjw3qP1IkQeOQz41Fr2zF+fZbWGDIJgFtEwG15kQBihca5l9x3XSStI0sBKU3B2kVdwuha2FePL1hxJYr4lQVLC0SKcL909xWGZtGtfS3BkLcm3k4V2mgmK4+y8KH35PL/Ay9oNvCAHohbY45FmzxSijArEnvy1ZL3UE7oZ3Lg2skwIDAQAB
|
||||
alipay-public-key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqnCB+N172m5gxf1Rolfx5LErSiVwQCh0XQdDrVy6aTuVF5EtdqahSHtADyEPsBWudMBhzCfqpoZvfnvH7a+PED6uZ3DoXt7ETh8TmNM5yc+WTnD8pSphQvuHDJ3zMks489KNxiX6sXag71k9H1MXklJGPOUaljHqy/QlRn2ZLT7pFgaFH9LEcVoQBPIOurUn95078h848RFD30jZFW3fakxUGAGVVZaHH62z5OEWOmcA+CwxsEDMa1XMt02RGXgAAq4WOj+BqOGiFmhM8rnrUMchTyvx4umOzGvbF2Y9irN3aBZ5lfg+bzYcJpIOMzlM/V00LnEWzCblJzXNyH4hJQIDAQAB
|
||||
callback-url: https://rj4jv5rwqs.by.takin.cc/hard/hard-ali-pay/callback
|
||||
# callback-url: https://stgl.pj.gov.cn/api/hard/hard-ali-pay/callback
|
||||
|
||||
mini-wechat-pay:
|
||||
app-id: wx95481f43b14565e5
|
||||
app-secret: 0aee1289b5ae14c0c69b8f5e9a4e518e
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.bsd.pjcloud.app.mapper.AppMenuMapper">
|
||||
|
||||
</mapper>
|
||||
+4
@@ -119,4 +119,8 @@ public class CanteenCategoryEntity extends Model<CanteenCategoryEntity> {
|
||||
*/
|
||||
@Schema(description = "商家id")
|
||||
private Long merchantId;
|
||||
|
||||
|
||||
@Schema(description = "是否涨价")
|
||||
private Boolean isPriceIncreased;
|
||||
}
|
||||
+124
-117
@@ -10,6 +10,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
@@ -26,182 +27,188 @@ import java.time.LocalDateTime;
|
||||
public class CanteenSpuEntity extends Model<CanteenSpuEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 商品 SPU 编号,自增
|
||||
*/
|
||||
/**
|
||||
* 商品 SPU 编号,自增
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="商品 SPU 编号,自增")
|
||||
@Schema(description = "商品 SPU 编号,自增")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@Schema(description="商品名称")
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@Schema(description = "商品名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 商品简介
|
||||
*/
|
||||
@Schema(description="商品简介")
|
||||
/**
|
||||
* 商品简介
|
||||
*/
|
||||
@Schema(description = "商品简介")
|
||||
private String introduction;
|
||||
|
||||
/**
|
||||
* 商品详情
|
||||
*/
|
||||
@Schema(description="商品详情")
|
||||
/**
|
||||
* 商品详情
|
||||
*/
|
||||
@Schema(description = "商品详情")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 商品分类编号
|
||||
*/
|
||||
@Schema(description="商品分类编号")
|
||||
/**
|
||||
* 商品分类编号
|
||||
*/
|
||||
@Schema(description = "商品分类编号")
|
||||
private Long categoryId;
|
||||
|
||||
/**
|
||||
* 商品封面图
|
||||
*/
|
||||
@Schema(description="商品封面图")
|
||||
/**
|
||||
* 商品封面图
|
||||
*/
|
||||
@Schema(description = "商品封面图")
|
||||
private String picUrl;
|
||||
|
||||
/**
|
||||
* 商品轮播图地址
|
||||
数组,以逗号分隔
|
||||
最多上传15张
|
||||
*/
|
||||
@Schema(description="商品轮播图")
|
||||
/**
|
||||
* 商品轮播图地址
|
||||
* 数组,以逗号分隔
|
||||
* 最多上传15张
|
||||
*/
|
||||
@Schema(description = "商品轮播图")
|
||||
private String sliderPicUrls;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
@Schema(description="排序字段")
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
@Schema(description = "排序字段")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 商品状态: 1 上架(开启) 0 下架(禁用) -1 回收
|
||||
*/
|
||||
@Schema(description="商品状态: 1 上架(开启) 0 下架(禁用) -1 回收")
|
||||
/**
|
||||
* 商品状态: 1 上架(开启) 0 下架(禁用) -1 回收
|
||||
*/
|
||||
@Schema(description = "商品状态: 1 上架(开启) 0 下架(禁用) -1 回收")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 规格类型:0 单规格 1 多规格
|
||||
*/
|
||||
@Schema(description="规格类型:0 单规格 1 多规格")
|
||||
/**
|
||||
* 规格类型:0 单规格 1 多规格
|
||||
*/
|
||||
@Schema(description = "规格类型:0 单规格 1 多规格")
|
||||
private Boolean specType;
|
||||
|
||||
/**
|
||||
* 商品价格,单位使用:分
|
||||
*/
|
||||
@Schema(description="商品价格,单位使用:分")
|
||||
/**
|
||||
* 商品价格,单位使用:分
|
||||
*/
|
||||
@Schema(description = "商品价格,单位使用:分")
|
||||
// @JsonSerialize(using = MoneySerializer.class) // 分 -> 元
|
||||
// @JsonDeserialize(using = MoneyDeserializer.class) // 元 -> 分
|
||||
private Integer price;
|
||||
|
||||
/**
|
||||
* 市场价,单位使用:分
|
||||
*/
|
||||
@Schema(description="市场价,单位使用:分")
|
||||
/**
|
||||
* 市场价,单位使用:分
|
||||
*/
|
||||
@Schema(description = "市场价,单位使用:分")
|
||||
// @JsonSerialize(using = MoneySerializer.class) // 分 -> 元
|
||||
// @JsonDeserialize(using = MoneyDeserializer.class) // 元 -> 分
|
||||
private Integer marketPrice;
|
||||
|
||||
/**
|
||||
* 成本价,单位: 分
|
||||
*/
|
||||
@Schema(description="成本价,单位: 分")
|
||||
/**
|
||||
* 成本价,单位: 分
|
||||
*/
|
||||
@Schema(description = "成本价,单位: 分")
|
||||
// @JsonSerialize(using = MoneySerializer.class) // 分 -> 元
|
||||
// @JsonDeserialize(using = MoneyDeserializer.class) // 元 -> 分
|
||||
private Integer costPrice;
|
||||
|
||||
/**
|
||||
* 库存
|
||||
*/
|
||||
@Schema(description="库存")
|
||||
/**
|
||||
* 库存
|
||||
*/
|
||||
@Schema(description = "库存")
|
||||
private Integer stock;
|
||||
|
||||
/**
|
||||
* 赠送积分
|
||||
*/
|
||||
@Schema(description="赠送积分")
|
||||
/**
|
||||
* 赠送积分
|
||||
*/
|
||||
@Schema(description = "赠送积分")
|
||||
private Integer giveIntegral;
|
||||
|
||||
/**
|
||||
* 商品销量
|
||||
*/
|
||||
@Schema(description="商品销量")
|
||||
/**
|
||||
* 商品销量
|
||||
*/
|
||||
@Schema(description = "商品销量")
|
||||
private Integer salesCount;
|
||||
|
||||
/**
|
||||
* 虚拟销量
|
||||
*/
|
||||
@Schema(description="虚拟销量")
|
||||
/**
|
||||
* 虚拟销量
|
||||
*/
|
||||
@Schema(description = "虚拟销量")
|
||||
private Integer virtualSalesCount;
|
||||
|
||||
/**
|
||||
* 商品点击量
|
||||
*/
|
||||
@Schema(description="商品点击量")
|
||||
/**
|
||||
* 商品点击量
|
||||
*/
|
||||
@Schema(description = "商品点击量")
|
||||
private Integer browseCount;
|
||||
|
||||
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "是否删除 -1:已删除 0:正常")
|
||||
private String delFlag;
|
||||
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "是否删除 -1:已删除 0:正常")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 系统类型 2每日 3在线订餐
|
||||
*/
|
||||
@Schema(description="系统类型 2每日 3在线订餐")
|
||||
/**
|
||||
* 系统类型 2每日 3在线订餐
|
||||
*/
|
||||
@Schema(description = "系统类型 2每日 3在线订餐")
|
||||
private Long systemType;
|
||||
|
||||
/**
|
||||
* 商户编号
|
||||
*/
|
||||
@Schema(description="商户编号")
|
||||
/**
|
||||
* 商户编号
|
||||
*/
|
||||
@Schema(description = "商户编号")
|
||||
private Long merchantId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description="部门id")
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description = "部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建人")
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建时间")
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="更新人")
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="更新时间")
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 租户编号
|
||||
*/
|
||||
@Schema(description="租户编号")
|
||||
/**
|
||||
* 租户编号
|
||||
*/
|
||||
@Schema(description = "租户编号")
|
||||
private Long tenantId;
|
||||
|
||||
@Schema(description="是否显示")
|
||||
private String isShow;
|
||||
@Schema(description = "是否显示")
|
||||
private String isShow;
|
||||
|
||||
@Schema(description = "是否涨价")
|
||||
private String isPriceIncreased;
|
||||
|
||||
@Schema(description = "大于等于的价格")
|
||||
@TableField(exist = false)
|
||||
private Long gePrice;
|
||||
}
|
||||
+6
@@ -1,5 +1,6 @@
|
||||
package com.bsd.pjcloud.canteen.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@@ -44,4 +45,9 @@ public class ADCanteenDailyMenuListVO {
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 是否涨价
|
||||
*/
|
||||
private String isPriceIncreased;
|
||||
}
|
||||
+13
-12
@@ -15,71 +15,72 @@ public class ADCanteenSpuListVO {
|
||||
/**
|
||||
* 商品 SPU 编号,自增
|
||||
*/
|
||||
@Schema(description="商品 SPU 编号,自增")
|
||||
@Schema(description = "商品 SPU 编号,自增")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@Schema(description="商品名称")
|
||||
@Schema(description = "商品名称")
|
||||
private String name;
|
||||
|
||||
|
||||
/**
|
||||
* 商品分类编号
|
||||
*/
|
||||
@Schema(description="商品分类编号")
|
||||
@Schema(description = "商品分类编号")
|
||||
private Long categoryId;
|
||||
|
||||
/**
|
||||
* 商品封面图
|
||||
*/
|
||||
@Schema(description="商品封面图")
|
||||
@Schema(description = "商品封面图")
|
||||
private String picUrl;
|
||||
|
||||
|
||||
/**
|
||||
* 商品价格,单位使用:分
|
||||
*/
|
||||
@Schema(description="商品价格,单位使用:分")
|
||||
@Schema(description = "商品价格,单位使用:分")
|
||||
private Integer price;
|
||||
|
||||
|
||||
/**
|
||||
* 市场价,单位使用:分
|
||||
*/
|
||||
@Schema(description="市场价,单位使用:分")
|
||||
@Schema(description = "市场价,单位使用:分")
|
||||
private Integer marketPrice;
|
||||
|
||||
|
||||
/**
|
||||
* 库存
|
||||
*/
|
||||
@Schema(description="库存")
|
||||
@Schema(description = "库存")
|
||||
private Integer stock;
|
||||
|
||||
|
||||
/**
|
||||
* 商品销量
|
||||
*/
|
||||
@Schema(description="商品销量")
|
||||
@Schema(description = "商品销量")
|
||||
private Integer salesCount;
|
||||
|
||||
|
||||
/**
|
||||
* 商户编号
|
||||
*/
|
||||
@Schema(description="商户编号")
|
||||
@Schema(description = "商户编号")
|
||||
private Long merchantId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description="部门id")
|
||||
@Schema(description = "部门id")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "是否涨价")
|
||||
private String isPriceIncreased;
|
||||
|
||||
|
||||
@Schema(description="餐段类型")
|
||||
@Schema(description = "餐段类型")
|
||||
private String categoryType;
|
||||
}
|
||||
+19
-13
@@ -1,5 +1,6 @@
|
||||
package com.bsd.pjcloud.canteen.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
@@ -46,6 +47,7 @@ public class CanteenSpuServiceImpl extends ServiceImpl<CanteenSpuMapper, Canteen
|
||||
private final CanteenCategoryMapper canteenCategoryMapper;
|
||||
private final CanteenStockMapper canteenStockMapper;
|
||||
private final CanteenOnlineSpuMapper canteenOnlineSpuMapper;
|
||||
|
||||
@Override
|
||||
public Object selectFoodList(LambdaQueryWrapper<CanteenSpuEntity> wrapper) {
|
||||
return baseMapper.selectListByScope(wrapper, DataScope.of());
|
||||
@@ -59,11 +61,11 @@ public class CanteenSpuServiceImpl extends ServiceImpl<CanteenSpuMapper, Canteen
|
||||
// 查询当前库存
|
||||
CanteenSpuEntity spu = baseMapper.selectById(item.getId());
|
||||
if (spu == null) {
|
||||
R.failed(spu.getName()+"商品不存在");
|
||||
R.failed(spu.getName() + "商品不存在");
|
||||
}
|
||||
// 检查库存是否足够
|
||||
if (item.getIncrCount() < 0 && Math.abs(item.getIncrCount()) > spu.getStock()) {
|
||||
R.failed(spu.getName()+"库存不足,无法完成操作");
|
||||
R.failed(spu.getName() + "库存不足,无法完成操作");
|
||||
}
|
||||
int i = baseMapper.updateStock(item.getId(), item.getIncrCount());
|
||||
// if (item.getIncrCount() <= 0) {
|
||||
@@ -89,7 +91,7 @@ public class CanteenSpuServiceImpl extends ServiceImpl<CanteenSpuMapper, Canteen
|
||||
Map<Long, List<CanteenCategoryEntity>> listMap = canteenCategoryEntities.stream().collect(Collectors.groupingBy(CanteenCategoryEntity::getId));
|
||||
|
||||
bean.forEach(item -> {
|
||||
if (null!=listMap.get(item.getCategoryId()).get(0).getCategoryType()){
|
||||
if (null != listMap.get(item.getCategoryId()).get(0).getCategoryType()) {
|
||||
item.setCategoryType(listMap.get(item.getCategoryId()).get(0).getCategoryType());
|
||||
}
|
||||
});
|
||||
@@ -127,7 +129,7 @@ public class CanteenSpuServiceImpl extends ServiceImpl<CanteenSpuMapper, Canteen
|
||||
LambdaQueryWrapper<CanteenCategoryEntity> canteenCategoryEntityLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
canteenCategoryEntityLambdaQueryWrapper.like(CanteenCategoryEntity::getCategoryType, canteenDailySpuDTO.getHourType());
|
||||
List<CanteenCategoryEntity> canteenCategoryEntities = canteenCategoryMapper.selectList(canteenCategoryEntityLambdaQueryWrapper);
|
||||
List<Long> caIds = canteenCategoryEntities.stream().map(CanteenCategoryEntity::getId).collect(Collectors.toList());
|
||||
List<Long> caIds = canteenCategoryEntities.stream().map(CanteenCategoryEntity::getId).collect(Collectors.toList());
|
||||
|
||||
wrapper.in(!CollectionUtils.isEmpty(caIds), CanteenSpuEntity::getCategoryId, caIds);
|
||||
// wrapper.orderByAsc(CanteenSpuEntity::getSort);
|
||||
@@ -164,32 +166,32 @@ public class CanteenSpuServiceImpl extends ServiceImpl<CanteenSpuMapper, Canteen
|
||||
// 查询SPU分页数据
|
||||
Page<CanteenSpuEntity> pageData = baseMapper.selectPageByScope(page, wrapper, DataScope.of());
|
||||
List<CanteenSpuEntity> records = pageData.getRecords();
|
||||
|
||||
|
||||
// 构建返回的VO列表
|
||||
List<CanteenSpuStockVO> resultList = new ArrayList<>();
|
||||
|
||||
|
||||
if (!CollectionUtils.isEmpty(records)) {
|
||||
// 获取所有SPU ID
|
||||
List<Long> spuIds = records.stream()
|
||||
.map(CanteenSpuEntity::getId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
||||
// 查询对应的库存信息
|
||||
LambdaQueryWrapper<CanteenStockEntity> stockWrapper = Wrappers.lambdaQuery();
|
||||
stockWrapper.in(CanteenStockEntity::getItemId, spuIds);
|
||||
stockWrapper.eq(CanteenStockEntity::getItemType, "2"); // 假设"成品"表示菜品的类型
|
||||
List<CanteenStockEntity> stockList = canteenStockMapper.selectList(stockWrapper);
|
||||
|
||||
|
||||
// 将库存信息映射到SPU ID
|
||||
Map<Long, CanteenStockEntity> stockMap = stockList.stream()
|
||||
.collect(Collectors.toMap(CanteenStockEntity::getItemId, stock -> stock, (v1, v2) -> v1));
|
||||
|
||||
|
||||
// 构建返回结果
|
||||
for (CanteenSpuEntity spu : records) {
|
||||
CanteenSpuStockVO vo = new CanteenSpuStockVO();
|
||||
vo.setName(spu.getName());
|
||||
vo.setPicUrl(spu.getPicUrl());
|
||||
|
||||
|
||||
// 设置库存信息
|
||||
CanteenStockEntity stock = stockMap.get(spu.getId());
|
||||
if (stock != null) {
|
||||
@@ -205,11 +207,11 @@ public class CanteenSpuServiceImpl extends ServiceImpl<CanteenSpuMapper, Canteen
|
||||
vo.setInventoryUpperLimit(0);
|
||||
vo.setInventoryLowerLimit(0);
|
||||
}
|
||||
|
||||
|
||||
resultList.add(vo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 构建分页返回对象
|
||||
Page<CanteenSpuStockVO> resultPage = new Page<>();
|
||||
resultPage.setRecords(resultList);
|
||||
@@ -217,7 +219,7 @@ public class CanteenSpuServiceImpl extends ServiceImpl<CanteenSpuMapper, Canteen
|
||||
resultPage.setSize(pageData.getSize());
|
||||
resultPage.setCurrent(pageData.getCurrent());
|
||||
resultPage.setPages(pageData.getPages());
|
||||
|
||||
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
@@ -226,6 +228,10 @@ public class CanteenSpuServiceImpl extends ServiceImpl<CanteenSpuMapper, Canteen
|
||||
LambdaQueryWrapper<CanteenSpuEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.like(StrUtil.isNotBlank(canteenSpu.getName()), CanteenSpuEntity::getName, canteenSpu.getName());
|
||||
wrapper.eq(Objects.nonNull(canteenSpu.getCategoryId()), CanteenSpuEntity::getCategoryId, canteenSpu.getCategoryId());
|
||||
wrapper.eq(Objects.nonNull(canteenSpu.getIsPriceIncreased()), CanteenSpuEntity::getIsPriceIncreased, canteenSpu.getIsPriceIncreased());
|
||||
if (ObjectUtil.isNotEmpty(canteenSpu.getGePrice()) && canteenSpu.getGePrice() > 0) {
|
||||
wrapper.ge(CanteenSpuEntity::getPrice, canteenSpu.getGePrice() * 100);
|
||||
}
|
||||
wrapper.orderByAsc(CanteenSpuEntity::getSort).orderByDesc(CanteenSpuEntity::getId);
|
||||
|
||||
LambdaQueryWrapper<CanteenOnlineSpuEntity> canteenOnlineSpuEntityLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
+2
@@ -28,6 +28,7 @@
|
||||
<result property="stock" column="stock"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="hourType" column="hour_type"/>
|
||||
<result property="isPriceIncreased" column="is_price_increased"/>
|
||||
</resultMap>
|
||||
<select id="selectTimeFood" resultType="com.bsd.pjcloud.canteen.vo.DailyMenuVO">
|
||||
SELECT
|
||||
@@ -63,6 +64,7 @@
|
||||
sp.stock,
|
||||
sp.category_id,
|
||||
sp.sort,
|
||||
sp.is_price_increased,
|
||||
t.dept_id,
|
||||
t.create_by
|
||||
FROM canteen_daily_menu t
|
||||
|
||||
+12
@@ -135,12 +135,24 @@ public interface CacheConstants {
|
||||
|
||||
String WALLET_DETAIL = "wallet:detail:manage";
|
||||
|
||||
// 根据钱包id查询钱包详情
|
||||
String WALLET_DETAIL_ID = "wallet:detail:id";
|
||||
|
||||
// 根据用户id钱包类型查询钱包详情
|
||||
String WALLET_DETAIL_USER_ID_WALLET_TYPE = "wallet:detail:user_id_wallet_type";
|
||||
|
||||
String WALLET_TYPE_DETAIL = "wallet:detail:type";
|
||||
|
||||
String WALLET_SETTING_DETAIL = "wallet:detail:setting";
|
||||
|
||||
String WALLET_RULE_PRICE_CONFIG_DETAIL = "wallet:detail:rule_price_config";
|
||||
|
||||
// 用户消费机的额外价格
|
||||
String WALLET_USER_DISCOUNTS_LIST = "wallet:detail:user_discounts_list";
|
||||
|
||||
// 用户的食堂商户(从视图里查询)
|
||||
String WALLET_VIEWS_CANTEEN_MCH = "wallet:detail:view_canteen_mch";
|
||||
|
||||
/* ************************************* end 钱包相关 end ************************************* */
|
||||
|
||||
/* ************************************* start 第三方对接相关 start ************************************* */
|
||||
|
||||
+10
@@ -250,6 +250,16 @@ public interface SecurityConstants {
|
||||
*/
|
||||
String APP = "mobile";
|
||||
|
||||
/**
|
||||
* 游客登录(微信,小程序)
|
||||
*/
|
||||
String VISITOR = "visitor";
|
||||
|
||||
/**
|
||||
* 游客登录(微信,小程序) openId
|
||||
*/
|
||||
String VISITOR_OPEN_ID = "openId";
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*/
|
||||
|
||||
+18
-9
@@ -1,22 +1,31 @@
|
||||
package com.bsd.pjcloud.common.core.constant.enums;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum UserTypeEnum {
|
||||
|
||||
TOB("0", "面向后台应用"), TOC("1", "面向小程序");
|
||||
TOB("0", "面向后台应用"),
|
||||
TOC("1", "面向小程序");
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final String status;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final String status;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private final String description;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private final String description;
|
||||
|
||||
public static UserTypeEnum valueOfByStatus(String status) {
|
||||
if (ObjectUtil.isEmpty(status)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(status, v.getStatus())).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
}
|
||||
+7
@@ -81,6 +81,13 @@ public class R<T> implements Serializable {
|
||||
return restResult(null, CommonConstants.FAIL, msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 失败并指定业务码(非 0),便于前端区分提示(如浙政钉绑定后无系统用户)。
|
||||
*/
|
||||
public static <T> R<T> failed(int code, String msg) {
|
||||
return restResult(null, code, msg);
|
||||
}
|
||||
|
||||
public static <T> R<T> failed(T data) {
|
||||
return restResult(data, CommonConstants.FAIL, null);
|
||||
}
|
||||
|
||||
+2
-2
@@ -20,9 +20,9 @@ public class SelectCountByScope extends AbstractMethod {
|
||||
|
||||
@Override
|
||||
public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) {
|
||||
SqlMethod sqlMethod = SqlMethod.SELECT_LIST;
|
||||
SqlMethod sqlMethod = SqlMethod.SELECT_COUNT;
|
||||
|
||||
String sql = String.format(sqlMethod.getSql(), this.sqlFirst(), this.sqlSelectColumns(tableInfo, true),
|
||||
String sql = String.format(sqlMethod.getSql(), this.sqlFirst(), "*",
|
||||
tableInfo.getTableName(), this.sqlWhereEntityWrapper(true, tableInfo), this.sqlOrderBy(tableInfo),
|
||||
this.sqlComment());
|
||||
SqlSource sqlSource = languageDriver.createSqlSource(configuration, sql, modelClass);
|
||||
|
||||
+154
-134
@@ -53,159 +53,179 @@ import java.util.Map;
|
||||
@RequiredArgsConstructor
|
||||
public class DruidSqlLogFilter extends FilterEventAdapter {
|
||||
|
||||
private static final SQLUtils.FormatOption FORMAT_OPTION = new SQLUtils.FormatOption(false, false);
|
||||
private static final SQLUtils.FormatOption FORMAT_OPTION = new SQLUtils.FormatOption(false, false);
|
||||
|
||||
private final PjcloudMybatisProperties properties;
|
||||
private final PjcloudMybatisProperties properties;
|
||||
|
||||
@Override
|
||||
protected void statementExecuteBefore(StatementProxy statement, String sql) {
|
||||
statement.setLastExecuteStartNano();
|
||||
}
|
||||
@Override
|
||||
protected void statementExecuteBefore(StatementProxy statement, String sql) {
|
||||
statement.setLastExecuteStartNano();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void statementExecuteBatchBefore(StatementProxy statement) {
|
||||
statement.setLastExecuteStartNano();
|
||||
}
|
||||
@Override
|
||||
protected void statementExecuteBatchBefore(StatementProxy statement) {
|
||||
statement.setLastExecuteStartNano();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void statementExecuteUpdateBefore(StatementProxy statement, String sql) {
|
||||
statement.setLastExecuteStartNano();
|
||||
}
|
||||
@Override
|
||||
protected void statementExecuteUpdateBefore(StatementProxy statement, String sql) {
|
||||
statement.setLastExecuteStartNano();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void statementExecuteQueryBefore(StatementProxy statement, String sql) {
|
||||
statement.setLastExecuteStartNano();
|
||||
}
|
||||
@Override
|
||||
protected void statementExecuteQueryBefore(StatementProxy statement, String sql) {
|
||||
statement.setLastExecuteStartNano();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void statementExecuteAfter(StatementProxy statement, String sql, boolean firstResult) {
|
||||
statement.setLastExecuteTimeNano();
|
||||
}
|
||||
@Override
|
||||
protected void statementExecuteAfter(StatementProxy statement, String sql, boolean firstResult) {
|
||||
statement.setLastExecuteTimeNano();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void statementExecuteBatchAfter(StatementProxy statement, int[] result) {
|
||||
statement.setLastExecuteTimeNano();
|
||||
}
|
||||
@Override
|
||||
protected void statementExecuteBatchAfter(StatementProxy statement, int[] result) {
|
||||
statement.setLastExecuteTimeNano();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void statementExecuteQueryAfter(StatementProxy statement, String sql, ResultSetProxy resultSet) {
|
||||
statement.setLastExecuteTimeNano();
|
||||
}
|
||||
@Override
|
||||
protected void statementExecuteQueryAfter(StatementProxy statement, String sql, ResultSetProxy resultSet) {
|
||||
statement.setLastExecuteTimeNano();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void statementExecuteUpdateAfter(StatementProxy statement, String sql, int updateCount) {
|
||||
statement.setLastExecuteTimeNano();
|
||||
}
|
||||
@Override
|
||||
protected void statementExecuteUpdateAfter(StatementProxy statement, String sql, int updateCount) {
|
||||
statement.setLastExecuteTimeNano();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void statement_close(FilterChain chain, StatementProxy statement) throws SQLException {
|
||||
// 先调用父类关闭 statement
|
||||
super.statement_close(chain, statement);
|
||||
// 支持动态开启
|
||||
if (!properties.isShowSql()) {
|
||||
return;
|
||||
}
|
||||
@Override
|
||||
public void statement_close(FilterChain chain, StatementProxy statement) throws SQLException {
|
||||
// 先调用父类关闭 statement
|
||||
super.statement_close(chain, statement);
|
||||
// 支持动态开启
|
||||
if (!properties.isShowSql()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 是否开启调试
|
||||
if (!log.isInfoEnabled()) {
|
||||
return;
|
||||
}
|
||||
// 是否开启调试
|
||||
if (!log.isInfoEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 打印可执行的 sql
|
||||
String sql = statement.getBatchSql();
|
||||
// sql 为空直接返回
|
||||
if (StringUtils.isEmpty(sql)) {
|
||||
return;
|
||||
}
|
||||
// 打印可执行的 sql
|
||||
String sql = statement.getBatchSql();
|
||||
// sql 为空直接返回
|
||||
if (StringUtils.isEmpty(sql)) {
|
||||
return;
|
||||
}
|
||||
|
||||
String dbType = statement.getConnectionProxy().getDirectDataSource().getDbType();
|
||||
String dbType = statement.getConnectionProxy().getDirectDataSource().getDbType();
|
||||
|
||||
// 判断表名是配置了匹配过滤
|
||||
if (CollUtil.isNotEmpty(properties.getSkipTable())) {
|
||||
List<String> skipTableList = properties.getSkipTable();
|
||||
// 判断表名是配置了匹配过滤
|
||||
if (CollUtil.isNotEmpty(properties.getSkipTable())) {
|
||||
List<String> skipTableList = properties.getSkipTable();
|
||||
|
||||
List<String> tableNameList = getTablesBydruid(sql, dbType);
|
||||
if (tableNameList.stream()
|
||||
.anyMatch(tableName -> StrUtil.containsAnyIgnoreCase(tableName,
|
||||
ArrayUtil.toArray(skipTableList, String.class)))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
List<String> tableNameList = getTablesBydruid(sql, dbType);
|
||||
if (tableNameList.stream()
|
||||
.anyMatch(tableName -> StrUtil.containsAnyIgnoreCase(tableName,
|
||||
ArrayUtil.toArray(skipTableList, String.class)))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
int parametersSize = statement.getParametersSize();
|
||||
List<Object> parameters = new ArrayList<>(parametersSize);
|
||||
for (int i = 0; i < parametersSize; ++i) {
|
||||
// 转换参数,处理 java8 时间
|
||||
parameters.add(getJdbcParameter(statement.getParameter(i)));
|
||||
}
|
||||
String formattedSql = SQLUtils.format(sql, DbType.of(dbType), parameters, FORMAT_OPTION);
|
||||
printSql(formattedSql, statement);
|
||||
}
|
||||
int parametersSize = statement.getParametersSize();
|
||||
List<Object> parameters = new ArrayList<>(parametersSize);
|
||||
for (int i = 0; i < parametersSize; ++i) {
|
||||
// 转换参数,处理 java8 时间
|
||||
parameters.add(getJdbcParameter(statement.getParameter(i)));
|
||||
}
|
||||
String formattedSql = SQLUtils.format(sql, DbType.of(dbType), parameters, FORMAT_OPTION);
|
||||
printSql(formattedSql, statement);
|
||||
}
|
||||
|
||||
private static Object getJdbcParameter(JdbcParameter jdbcParam) {
|
||||
if (jdbcParam == null) {
|
||||
return null;
|
||||
}
|
||||
Object value = jdbcParam.getValue();
|
||||
// 处理 java8 时间
|
||||
if (value instanceof TemporalAccessor) {
|
||||
return value.toString();
|
||||
}
|
||||
return value;
|
||||
}
|
||||
private static Object getJdbcParameter(JdbcParameter jdbcParam) {
|
||||
if (jdbcParam == null) {
|
||||
return null;
|
||||
}
|
||||
Object value = jdbcParam.getValue();
|
||||
// 处理 java8 时间
|
||||
if (value instanceof TemporalAccessor) {
|
||||
return value.toString();
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
private static void printSql(String sql, StatementProxy statement) {
|
||||
// 打印 sql
|
||||
String sqlLogger = "\n\n======= Sql Logger ======================" + "\n{}"
|
||||
+ "\n======= Sql Execute Time: {} =======\n";
|
||||
log.info(sqlLogger, sql.trim(), format(statement.getLastExecuteTimeNano()));
|
||||
}
|
||||
private static void printSql(String sql, StatementProxy statement) {
|
||||
// 打印 sql
|
||||
String sqlLogger = "\n\n======= Sql Logger ======================" + "\n{}"
|
||||
+ "\n======= Sql Execute Time: {} =======\n";
|
||||
log.info(sqlLogger, sql.trim(), format(statement.getLastExecuteTimeNano()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化执行时间,单位为 ms 和 s,保留三位小数
|
||||
* @param nanos 纳秒
|
||||
* @return 格式化后的时间
|
||||
*/
|
||||
private static String format(long nanos) {
|
||||
if (nanos < 1) {
|
||||
return "0ms";
|
||||
}
|
||||
double millis = (double) nanos / (1000 * 1000);
|
||||
// 不够 1 ms,最小单位为 ms
|
||||
if (millis > 1000) {
|
||||
return String.format("%.3fs", millis / 1000);
|
||||
}
|
||||
else {
|
||||
return String.format("%.3fms", millis);
|
||||
}
|
||||
}
|
||||
private static void printSqlV2(String sql, StatementProxy statement) {
|
||||
// 打印 sql 和调用堆栈
|
||||
StringBuilder sqlLogger = new StringBuilder();
|
||||
sqlLogger.append("\n\n======= Sql Logger V2 ======================\n");
|
||||
sqlLogger.append("{}\n"); // SQL语句占位符
|
||||
sqlLogger.append("======= Sql Execute Time: {} =======\n"); // 执行时间占位符
|
||||
sqlLogger.append("======= Call Stack ======================\n");
|
||||
|
||||
/**
|
||||
* 从SQL中提取表名(sql中出现的所有表)
|
||||
* @param sql sql语句
|
||||
* @param dbType dbType
|
||||
* @return List<String>
|
||||
*/
|
||||
public static List<String> getTablesBydruid(String sql, String dbType) {
|
||||
List<String> result = new ArrayList<String>();
|
||||
List<SQLStatement> stmtList = SQLUtils.parseStatements(sql, dbType);
|
||||
for (SQLStatement stmt : stmtList) {
|
||||
// 也可以用更精确的解析器,如MySqlSchemaStatVisitor
|
||||
SchemaStatVisitor visitor;
|
||||
// SQL server 数据库特殊处理
|
||||
if (DbType.sqlserver.name().equalsIgnoreCase(dbType)) {
|
||||
visitor = new SQLServerSchemaStatVisitor();
|
||||
}
|
||||
else {
|
||||
visitor = new SchemaStatVisitor();
|
||||
}
|
||||
stmt.accept(visitor);
|
||||
Map<TableStat.Name, TableStat> tables = visitor.getTables();
|
||||
for (TableStat.Name name : tables.keySet()) {
|
||||
result.add(name.getName());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
// 获取调用堆栈信息
|
||||
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
|
||||
for (int i = 3; i < stackTrace.length; i++) { // 跳过前几个内部调用
|
||||
if (stackTrace[i].getClassName().contains("com.bsd.pjcloud")) { // 只记录项目相关的调用
|
||||
sqlLogger.append(" at ").append(stackTrace[i].toString()).append("\n");
|
||||
}
|
||||
}
|
||||
sqlLogger.append("=========================================\n");
|
||||
|
||||
log.info(sqlLogger.toString(), sql.trim(), format(statement.getLastExecuteTimeNano()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化执行时间,单位为 ms 和 s,保留三位小数
|
||||
*
|
||||
* @param nanos 纳秒
|
||||
* @return 格式化后的时间
|
||||
*/
|
||||
private static String format(long nanos) {
|
||||
if (nanos < 1) {
|
||||
return "0ms";
|
||||
}
|
||||
double millis = (double) nanos / (1000 * 1000);
|
||||
// 不够 1 ms,最小单位为 ms
|
||||
if (millis > 1000) {
|
||||
return String.format("%.3fs", millis / 1000);
|
||||
} else {
|
||||
return String.format("%.3fms", millis);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从SQL中提取表名(sql中出现的所有表)
|
||||
*
|
||||
* @param sql sql语句
|
||||
* @param dbType dbType
|
||||
* @return List<String>
|
||||
*/
|
||||
public static List<String> getTablesBydruid(String sql, String dbType) {
|
||||
List<String> result = new ArrayList<String>();
|
||||
List<SQLStatement> stmtList = SQLUtils.parseStatements(sql, dbType);
|
||||
for (SQLStatement stmt : stmtList) {
|
||||
// 也可以用更精确的解析器,如MySqlSchemaStatVisitor
|
||||
SchemaStatVisitor visitor;
|
||||
// SQL server 数据库特殊处理
|
||||
if (DbType.sqlserver.name().equalsIgnoreCase(dbType)) {
|
||||
visitor = new SQLServerSchemaStatVisitor();
|
||||
} else {
|
||||
visitor = new SchemaStatVisitor();
|
||||
}
|
||||
stmt.accept(visitor);
|
||||
Map<TableStat.Name, TableStat> tables = visitor.getTables();
|
||||
for (TableStat.Name name : tables.keySet()) {
|
||||
result.add(name.getName());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -33,7 +33,7 @@
|
||||
<description>pjcloud excel 操作</description>
|
||||
|
||||
<properties>
|
||||
<easyexcel.version>4.0.2</easyexcel.version>
|
||||
<easyexcel.version>4.0.3</easyexcel.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
+2
-2
@@ -23,13 +23,13 @@ public enum TaskCheckStatusEnum {
|
||||
public static TaskCheckStatusEnum descOf(String description) {
|
||||
return Arrays.stream(TaskCheckStatusEnum.values())
|
||||
.filter(v -> ObjectUtil.equal(v.getDesc(), description))
|
||||
.findFirst().get();
|
||||
.findFirst().orElse(null);
|
||||
}
|
||||
|
||||
public static TaskCheckStatusEnum codeOf(String code) {
|
||||
return Arrays.stream(TaskCheckStatusEnum.values())
|
||||
.filter(v -> ObjectUtil.equal(v.getCode(), code))
|
||||
.findFirst().get();
|
||||
.findFirst().orElse(null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -98,6 +98,10 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bsd</groupId>
|
||||
<artifactId>pjcloud-common-idempotent</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<profiles>
|
||||
<profile>
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
package com.bsd.pjcloud.flow.task.controller;
|
||||
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.idempotent.annotation.Idempotent;
|
||||
import com.bsd.pjcloud.flow.task.dto.BatchCompleteTaskDto;
|
||||
import com.bsd.pjcloud.flow.task.dto.TaskParamDto;
|
||||
import com.bsd.pjcloud.flow.task.service.ITaskService;
|
||||
@@ -51,8 +52,8 @@ public class TaskController {
|
||||
*/
|
||||
@SneakyThrows
|
||||
@PostMapping("completeTask")
|
||||
@Idempotent(expireTime = 3, key = "'/task/completeTask/' + #completeParamDto.getTaskId()", info = "正在操作中,请勿重复操作")
|
||||
public R completeTask(@RequestBody TaskParamDto completeParamDto) {
|
||||
|
||||
return taskService.completeTask(completeParamDto);
|
||||
|
||||
}
|
||||
|
||||
+1
@@ -15,6 +15,7 @@ import java.util.Arrays;
|
||||
public enum HardAuthTypeEnum {
|
||||
|
||||
HARD_DDOR_AUTH("10", "智能柜授权"),
|
||||
HARD_DDOR_TOC_AUTH("20", "TOC用户智能柜授权"),
|
||||
;
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.bsd.pjcloud.hard.api.constant;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 第三方免密支付状态
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum HardThirdMiStatusEnum {
|
||||
|
||||
CREATE_ORDER("10", "创建订单"),
|
||||
PAY_SUCCESS("20", "支付成功"),
|
||||
PAY_ERROR("21", "支付失败"),
|
||||
REFUND("30", "取消/退款"),
|
||||
;
|
||||
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static HardThirdMiStatusEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.bsd.pjcloud.hard.api.constant;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 第三方免密类型
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum HardThirdMiTypeEnum {
|
||||
|
||||
MI_WECHAT("10", "微信免密支付"),
|
||||
MI_ALIPAY("20", "支付宝-芝麻先享"),
|
||||
;
|
||||
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static HardThirdMiTypeEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+5
-2
@@ -20,14 +20,17 @@ public enum HardTypeEnum {
|
||||
READ_CARD("3", "读卡器"),
|
||||
DOOR("4", "生鲜柜"),
|
||||
MERCHANT_QR_CODE("5", "商户二维码扣款牌"),
|
||||
OTHER("6","其他支付方式(第三方接口对接)"),
|
||||
OTHER("6", "其他支付方式(第三方接口对接)"),
|
||||
MERCHANT_ACT("7", "商户活动"),
|
||||
FARMER("8", "共富商城(助农)"),
|
||||
YYX("10", "4G-云音响"),
|
||||
YYX_WIFI("11", "wifi-云音响"),
|
||||
;
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
// 是否能预定
|
||||
public static final List<HardTypeEnum> isReserveList = List.of(SUPERMARKET, CANTEEN);
|
||||
public static final List<HardTypeEnum> isReserveList = List.of(SUPERMARKET, CANTEEN, FARMER);
|
||||
|
||||
// 不需要创建购物车
|
||||
public static final List<HardTypeEnum> isNoneCar = List.of(MERCHANT_QR_CODE);
|
||||
|
||||
+3
-1
@@ -19,6 +19,8 @@ public enum HardOrderTypeEnum {
|
||||
STRIDE_DEPT("4", "跨单位"),
|
||||
ZY("5", "正元公务餐"),
|
||||
LB("6", "宁波银行(美好生活)"),
|
||||
FARMER("7", "共富商城(助农)"),
|
||||
TOC_VISITOR("8", "toc访客购买(不记名用户)"),
|
||||
;
|
||||
private final String type;
|
||||
private final String description;
|
||||
@@ -28,7 +30,7 @@ public enum HardOrderTypeEnum {
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
public static final List<HardOrderTypeEnum> refundList = List.of(BELOW, RESERVE, FOREIGN_TICKET, ZY, LB);
|
||||
public static final List<HardOrderTypeEnum> refundList = List.of(BELOW, RESERVE, FOREIGN_TICKET, ZY, LB, FARMER);
|
||||
|
||||
public static final List<HardOrderTypeEnum> payList = List.of(BELOW, RESERVE);
|
||||
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.bsd.pjcloud.hard.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.common.core.constant.enums.UserTypeEnum;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardAppThirdOpenDoorDto {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
private UserTypeEnum userType;
|
||||
|
||||
/**
|
||||
* 授权id
|
||||
*/
|
||||
@NotNull(message = "授权id不能为空")
|
||||
private Long authId;
|
||||
|
||||
}
|
||||
+6
@@ -1,5 +1,6 @@
|
||||
package com.bsd.pjcloud.hard.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.common.core.constant.enums.UserTypeEnum;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
@@ -12,6 +13,11 @@ public class HardAuthAppDto {
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
private UserTypeEnum userType;
|
||||
|
||||
/**
|
||||
* 授权id
|
||||
*/
|
||||
|
||||
+6
@@ -1,5 +1,6 @@
|
||||
package com.bsd.pjcloud.hard.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.common.core.constant.enums.UserTypeEnum;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
@@ -12,6 +13,11 @@ public class HardGetAuthAppDto {
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
private UserTypeEnum userType;
|
||||
|
||||
/**
|
||||
* 智能柜设备id
|
||||
*/
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.bsd.pjcloud.hard.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.hard.api.entity.HardThirdMiOrderEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class HardThirdMiOrderDto extends HardThirdMiOrderEntity {
|
||||
|
||||
/**
|
||||
* 创建订单时间
|
||||
*/
|
||||
private LocalDateTime[] createOrderTimeList;
|
||||
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
private LocalDateTime[] payOrderTimeList;
|
||||
|
||||
/**
|
||||
* 退款时间
|
||||
*/
|
||||
private LocalDateTime[] refundOrderTimeList;
|
||||
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.bsd.pjcloud.hard.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardThirdMiPayDto {
|
||||
|
||||
private Long id;
|
||||
|
||||
}
|
||||
+3
@@ -19,4 +19,7 @@ public class HardAppCreateOrderScancode {
|
||||
@NotNull(message = "自定义金额不能为空")
|
||||
private Integer customPrice;
|
||||
|
||||
@Schema(description = "优惠券id")
|
||||
private Long actCouponRecordId;
|
||||
|
||||
}
|
||||
+3
@@ -38,4 +38,7 @@ public class OfflineCar {
|
||||
|
||||
@Schema(description = "单商品总价(分)")
|
||||
private Long totalPrice;
|
||||
|
||||
@Schema(description = "是否额外收费")
|
||||
private Boolean isPriceIncreased;
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.bsd.pjcloud.hard.api.dto.hard;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HandCancelActCodeDto {
|
||||
|
||||
@Schema(description = "用户id不能为空")
|
||||
@NotNull(message = "核销活动子id不能为空")
|
||||
private Long actItemId;
|
||||
|
||||
@Schema(description = "用户id")
|
||||
@NotNull(message = "用户id不能为空")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "设备id")
|
||||
@NotNull(message = "设备id不能为空")
|
||||
private Long hardwareId;
|
||||
|
||||
}
|
||||
+3
@@ -73,6 +73,9 @@ public class HardCreateOrderDto {
|
||||
@Schema(description = "钱包id")
|
||||
private Long walletId;
|
||||
|
||||
@Schema(description = "额外价格(分)")
|
||||
private Integer extraPrice;
|
||||
|
||||
@Schema(description = "离线支付是否成功")
|
||||
private Boolean offlinePaySuccess;
|
||||
}
|
||||
+8
@@ -11,8 +11,16 @@ public class HardCarDto extends HardCarEntity {
|
||||
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 0 yyyy-MM-dd
|
||||
* 1 yyyy-MM
|
||||
*/
|
||||
private String createTimeType = "0";
|
||||
|
||||
private String createTimeStr;
|
||||
|
||||
private String createTimeYearStr;
|
||||
|
||||
private LocalDate[] createTimeList;
|
||||
|
||||
private List<String> orderStatusCodes;
|
||||
|
||||
+3
@@ -24,4 +24,7 @@ public class HardCreateCarDto {
|
||||
// TODO 超市特有
|
||||
@Schema(description = "重量", requiredMode = Schema.RequiredMode.REQUIRED, example = "20798")
|
||||
private BigDecimal productWeight;
|
||||
|
||||
@Schema(description = "是否额外收费")
|
||||
private Boolean isPriceIncreased;
|
||||
}
|
||||
+18
@@ -3,6 +3,7 @@ package com.bsd.pjcloud.hard.api.dto.order;
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseIsIncludeTreeInterface;
|
||||
import com.bsd.pjcloud.common.core.constant.enums.DateRangeTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
@@ -36,6 +37,12 @@ public class HardOrderDto extends HardOrderEntity implements BaseIsIncludeTreeIn
|
||||
|
||||
private List<String> orderStatusCodes;
|
||||
|
||||
private String createTimeYearStr;
|
||||
|
||||
private String payTimeYearStr;
|
||||
|
||||
private String auditTimeYearStr;
|
||||
|
||||
private LocalDateTime[] createTimeList;
|
||||
|
||||
private LocalDateTime[] payTimeList;
|
||||
@@ -60,6 +67,12 @@ public class HardOrderDto extends HardOrderEntity implements BaseIsIncludeTreeIn
|
||||
*/
|
||||
private String afterSaleNo;
|
||||
|
||||
/**
|
||||
* 0 yyyy-MM-dd
|
||||
* 1 yyyy-MM
|
||||
*/
|
||||
private String createTimeType = "0";
|
||||
|
||||
private String createTimeStr;
|
||||
|
||||
/**
|
||||
@@ -72,4 +85,9 @@ public class HardOrderDto extends HardOrderEntity implements BaseIsIncludeTreeIn
|
||||
*/
|
||||
private Boolean productDescIsNotEmpty = false;
|
||||
|
||||
/**
|
||||
* 是否为优惠商品
|
||||
*/
|
||||
private String isDiscountsProduct;
|
||||
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.bsd.pjcloud.hard.api.dto.order;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class HardSelectOrderMerchIdsDto {
|
||||
|
||||
private List<Long> merchIds;
|
||||
|
||||
private List<String> merchTypes;
|
||||
|
||||
private String payTimeYearStr;
|
||||
|
||||
private LocalDateTime[] createTimeList;
|
||||
|
||||
}
|
||||
+3
-7
@@ -10,13 +10,9 @@ public class HardCreateActOrderDto {
|
||||
@Schema(description = "活动类型")
|
||||
private String actType;
|
||||
|
||||
@Schema(description = "活动id")
|
||||
@NotNull(message = "活动id")
|
||||
private Long actId;
|
||||
|
||||
@Schema(description = "总金额不能为空")
|
||||
@NotNull(message = "总金额")
|
||||
private Integer totalPrice;
|
||||
@Schema(description = "核销id")
|
||||
@NotNull(message = "核销id不能为空")
|
||||
private Long cancelId;
|
||||
|
||||
@Schema(description = "核销用户id")
|
||||
private Long cancelUserId;
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.bsd.pjcloud.hard.api.dto.order.app;
|
||||
|
||||
import com.bsd.pjcloud.hard.api.constant.HardTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.order.HardOrderTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.order.HardPayTypeEnum;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletTypeEnum;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class HardAppCreateFarmerOrderDto {
|
||||
|
||||
@NotNull(message = "购物车id不能为空")
|
||||
private Long carParentId;
|
||||
|
||||
// @NotNull(message = "钱包类型id")
|
||||
private Long walletTypeId;
|
||||
|
||||
@NotNull(message = "自提点id不能为空")
|
||||
private Long pickUpId;
|
||||
|
||||
private HardOrderTypeEnum orderType;
|
||||
|
||||
private HardPayTypeEnum payType;
|
||||
|
||||
private HardTypeEnum hardType;
|
||||
|
||||
private Long userId;
|
||||
|
||||
}
|
||||
+3
@@ -48,4 +48,7 @@ public class HardAppCreateOrderDto {
|
||||
// 预约id
|
||||
private Long apptId;
|
||||
|
||||
// 优惠券id
|
||||
private Long actCouponRecordId;
|
||||
|
||||
}
|
||||
+9
@@ -23,6 +23,15 @@ public class PanelProductDto {
|
||||
|
||||
private List<Long> classifyIds;
|
||||
|
||||
private List<Long> excludeClassifyIds;
|
||||
|
||||
private List<String> orderStatus;
|
||||
|
||||
/**
|
||||
* 排除当天在食堂吃饭的数据
|
||||
*/
|
||||
private String excludeCanteenPay;
|
||||
|
||||
private String hourTypeIsNull;
|
||||
|
||||
private String hourType;
|
||||
|
||||
+6
@@ -37,6 +37,12 @@ public class HardDoorFlowEntity extends Model<HardDoorFlowEntity> {
|
||||
@Schema(description = "用户编号")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
@Schema(description = "用户类型")
|
||||
private String userType;
|
||||
|
||||
/**
|
||||
* 业务类型
|
||||
*/
|
||||
|
||||
+190
@@ -0,0 +1,190 @@
|
||||
package com.bsd.pjcloud.hard.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 硬件商品免密订单
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("hard_third_mi_order")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "硬件商品免密订单")
|
||||
public class HardThirdMiOrderEntity extends Model<HardThirdMiOrderEntity> {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 上架类型
|
||||
*/
|
||||
@Schema(description = "上架类型")
|
||||
private String bizType;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
@Schema(description = "用户类型")
|
||||
private String userType;
|
||||
|
||||
/**
|
||||
* 授权id
|
||||
*/
|
||||
@Schema(description = "授权id")
|
||||
private Long authId;
|
||||
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
@Schema(description = "流程id")
|
||||
private Long flowId;
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
@Schema(description = "订单id")
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 退款id
|
||||
*/
|
||||
@Schema(description = "退款id")
|
||||
private Long refundId;
|
||||
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
@Schema(description = "设备id")
|
||||
private Long hardId;
|
||||
|
||||
/**
|
||||
* 外部订单号
|
||||
*/
|
||||
@Schema(description = "外部订单号")
|
||||
private String outOrderNo;
|
||||
|
||||
/**
|
||||
* 第三方订单号
|
||||
*/
|
||||
@Schema(description = "第三方订单号")
|
||||
private String thirdOrderNo;
|
||||
|
||||
/**
|
||||
* 创建订单时间
|
||||
*/
|
||||
@Schema(description = "创建订单时间")
|
||||
private LocalDateTime createOrderTime;
|
||||
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
@Schema(description = "支付时间")
|
||||
private LocalDateTime payOrderTime;
|
||||
|
||||
/**
|
||||
* 退款时间
|
||||
*/
|
||||
@Schema(description = "退款时间")
|
||||
private LocalDateTime refundOrderTime;
|
||||
|
||||
/**
|
||||
* 订单状态
|
||||
*/
|
||||
@Schema(description = "订单状态")
|
||||
private String orderStatus;
|
||||
|
||||
/**
|
||||
* 押金
|
||||
*/
|
||||
@Schema(description = "押金")
|
||||
private int depositPrice;
|
||||
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
@Schema(description = "订单金额")
|
||||
private int orderPrice;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
@Schema(description = "支付金额")
|
||||
private int payPrice;
|
||||
|
||||
/**
|
||||
* 退款金额
|
||||
*/
|
||||
@Schema(description = "退款金额")
|
||||
private int refundPrice;
|
||||
|
||||
/**
|
||||
* 原始 sign json 数据
|
||||
*/
|
||||
@Schema(description = "原始 sign json 数据")
|
||||
private String orgSignJson;
|
||||
|
||||
/**
|
||||
* 原始json数据
|
||||
*/
|
||||
@Schema(description = "原始json数据")
|
||||
private String orgOrderJson;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
}
|
||||
+12
@@ -78,6 +78,18 @@ public class HardDoorCabinetEntity extends Model<HardDoorCabinetEntity> {
|
||||
@Schema(description = "url二维码")
|
||||
private String urlQrCode;
|
||||
|
||||
/**
|
||||
* 支付宝小程序二维码
|
||||
*/
|
||||
@Schema(description = "支付宝小程序二维码")
|
||||
private String urlAlipayQrCode;
|
||||
|
||||
/**
|
||||
* 微信小程序二维码
|
||||
*/
|
||||
@Schema(description = "微信小程序二维码")
|
||||
private String urlWechatQrCode;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
|
||||
+6
@@ -83,6 +83,12 @@ public class HardCarEntity extends Model<HardCarEntity> {
|
||||
@Schema(description = "重量")
|
||||
private BigDecimal productWeight;
|
||||
|
||||
/**
|
||||
* 是否为优惠商品
|
||||
*/
|
||||
@Schema(description = "是否为优惠商品")
|
||||
private String isDiscountsProduct;
|
||||
|
||||
/**
|
||||
* 总价(分)
|
||||
*/
|
||||
|
||||
+12
@@ -219,6 +219,18 @@ public class HardOrderEntity extends Model<HardOrderEntity> {
|
||||
@Schema(description = "离线自动支付是否成功")
|
||||
private String offlinePaySuccess;
|
||||
|
||||
/**
|
||||
* 优惠券id
|
||||
*/
|
||||
@Schema(description = "优惠券id")
|
||||
private String couponRecordId;
|
||||
|
||||
/**
|
||||
* 优惠金额
|
||||
*/
|
||||
@Schema(description = "优惠金额")
|
||||
private Integer couponPrice;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
|
||||
+5
@@ -39,6 +39,11 @@ public class HardPanelSettingShare {
|
||||
*/
|
||||
private List<Long> zsCategoryIds;
|
||||
|
||||
/**
|
||||
* 复购排行需要排除的菜品分类
|
||||
*/
|
||||
private List<Long> repurchaseTopExcludeCategoryIds;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.bsd.pjcloud.hard.api.vo;
|
||||
|
||||
import com.bsd.pjcloud.hard.api.entity.HardThirdMiOrderEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.base.BaseHardInterface;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class HardThirdMiOrderVo extends HardThirdMiOrderEntity implements BaseHardInterface {
|
||||
|
||||
/**
|
||||
* 用户相关
|
||||
*/
|
||||
private String username;
|
||||
|
||||
private String userMobile;
|
||||
|
||||
private String userAvatar;
|
||||
|
||||
/**
|
||||
* 设备相关
|
||||
*/
|
||||
private String hardName;
|
||||
|
||||
private String hardType;
|
||||
|
||||
private List<String> hardTypeCodes;
|
||||
|
||||
}
|
||||
+15
-1
@@ -113,6 +113,20 @@ public class PanelPorductVo {
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class ProductListByTimeItemVo {
|
||||
|
||||
private String timeStr;
|
||||
|
||||
private LocalDateTime time;
|
||||
|
||||
private List<PanelPorductVo> list;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@@ -155,7 +169,7 @@ public class PanelPorductVo {
|
||||
private ProductTypeItemVo zs;
|
||||
}
|
||||
|
||||
public static List<PanelPorductVo> generatePanelCanteenList(LocalDateTime[] totalTimeList, DateRangeTypeEnum dateRangeType) {
|
||||
public static List<PanelPorductVo> generatePanelPorductVoList(LocalDateTime[] totalTimeList, DateRangeTypeEnum dateRangeType) {
|
||||
List<PanelPorductVo> dateList = new LinkedList<>();
|
||||
LocalDate startTime = totalTimeList[0].toLocalDate();
|
||||
LocalDate endTime = totalTimeList[1].toLocalDate();
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.bsd.pjcloud.hard.api.vo.order;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardAppCreateThirdDoorOrderVo {
|
||||
|
||||
private Long authId;
|
||||
|
||||
/**
|
||||
* 支付宝订单号
|
||||
*/
|
||||
private String alipayOrderStr;
|
||||
}
|
||||
+3
@@ -27,6 +27,9 @@ public class HardCanteenProductTotalVo {
|
||||
@Schema(description = "购买日期(年月日)")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "购买日期自定义格式")
|
||||
private String createTimeStr;
|
||||
|
||||
@Schema(description = "用餐时间段(早中晚)")
|
||||
private String hourType;
|
||||
|
||||
|
||||
+12
@@ -67,4 +67,16 @@ public class HardOrderCsVo implements BaseMchInterface, BaseHardInterface {
|
||||
@Schema(description = "列号")
|
||||
private Long lineNumber;
|
||||
|
||||
@Data
|
||||
static public class Month {
|
||||
|
||||
@Schema(description = "日期")
|
||||
private String day;
|
||||
|
||||
@Schema(description = "总盈利金额(元)")
|
||||
private double totalProfitPrice;
|
||||
|
||||
@Schema(description = "总盈利次数")
|
||||
private long totalProfitCount;
|
||||
}
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
package com.bsd.pjcloud.hard.api.vo.order.excel;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 商户流水导出
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(30)
|
||||
public class HardMchOrderExcelVo {
|
||||
|
||||
@ExcelProperty("商户")
|
||||
private String merchantName;
|
||||
|
||||
@ExcelProperty("姓名")
|
||||
private String username;
|
||||
|
||||
@ExcelProperty("手机号")
|
||||
private String userMobile;
|
||||
|
||||
@ExcelProperty("支付方式")
|
||||
private String payType;
|
||||
|
||||
@ExcelProperty("商品总价")
|
||||
private Double totalPrice;
|
||||
|
||||
@ExcelProperty("额外支付")
|
||||
private Double extraPrice;
|
||||
|
||||
@ExcelProperty("实际支付")
|
||||
private Double payPrice;
|
||||
|
||||
@ExcelProperty("退款金额")
|
||||
private Double refundPrice;
|
||||
|
||||
@ExcelProperty("订单支付时间")
|
||||
private LocalDateTime payTime;
|
||||
|
||||
/**
|
||||
* 导出相关
|
||||
*/
|
||||
@Schema(description = "列号")
|
||||
private Long lineNumber;
|
||||
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
package com.bsd.pjcloud.hard.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 支付宝支付配置
|
||||
*/
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "mini-ali-pay")
|
||||
@Data
|
||||
public class MiniAlipayConf {
|
||||
|
||||
/**
|
||||
* 应用ID
|
||||
*/
|
||||
private String appId;
|
||||
|
||||
/**
|
||||
* 商户号
|
||||
*/
|
||||
private String merchantId;
|
||||
|
||||
/**
|
||||
* 商户账号
|
||||
*/
|
||||
private String merchantAccount;
|
||||
|
||||
/**
|
||||
* 冻结金额
|
||||
*/
|
||||
private String freezeAmount;
|
||||
|
||||
/**
|
||||
* 芝麻服务id
|
||||
*/
|
||||
private String zmServiceId;
|
||||
|
||||
/**
|
||||
* 私钥
|
||||
*/
|
||||
private String privateKey;
|
||||
|
||||
/**
|
||||
* 公钥
|
||||
*/
|
||||
private String publicKey;
|
||||
|
||||
/**
|
||||
* 支付宝公钥
|
||||
*/
|
||||
private String alipayPublicKey;
|
||||
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.bsd.pjcloud.hard.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "yyx")
|
||||
@Data
|
||||
public class YyxConf {
|
||||
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 模板
|
||||
* ${price}-价格
|
||||
* ${phone-last}-手机尾号
|
||||
* 浦江智慧后勤,收款${price}元
|
||||
*/
|
||||
private String template;
|
||||
|
||||
}
|
||||
+3
-4
@@ -35,16 +35,15 @@ public class HardApptController {
|
||||
|
||||
private final HardApptService hardApptService;
|
||||
|
||||
|
||||
/* ************************************* start app start ************************************* */
|
||||
|
||||
@Operation(summary = "app预约时间列表", description = "app预约时间列表")
|
||||
@GetMapping("/app/list")
|
||||
public R<List<HardApptEntity>> appList() {
|
||||
List<HardApptEntity> list = hardApptService.list(new LambdaQueryWrapper<HardApptEntity>()
|
||||
.eq(HardApptEntity::getStatus, YesNoEnum.YES.getCode())
|
||||
.orderByDesc(HardApptEntity::getSort)
|
||||
);
|
||||
.eq(HardApptEntity::getStatus, YesNoEnum.YES.getCode())
|
||||
.orderByDesc(HardApptEntity::getSort)
|
||||
);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
|
||||
+23
-1
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.constant.enums.UserTypeEnum;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.idempotent.annotation.Idempotent;
|
||||
@@ -14,6 +15,7 @@ import com.bsd.pjcloud.hard.api.dto.*;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardAuthEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.HardAuthVo;
|
||||
import com.bsd.pjcloud.hard.api.vo.HardGetAuthAppVo;
|
||||
import com.bsd.pjcloud.hard.api.vo.order.HardAppCreateThirdDoorOrderVo;
|
||||
import com.bsd.pjcloud.hard.service.HardAuthService;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -48,17 +50,37 @@ public class HardAuthController {
|
||||
public R<HardGetAuthAppVo> appGetAuthHardDoor(@Valid @RequestBody HardGetAuthAppDto dto) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
dto.setUserId(user.getId());
|
||||
dto.setUserType(UserTypeEnum.valueOfByStatus(user.getUserType()));
|
||||
return R.ok(hardAuthService.appGetAuthHardDoor(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "app智能柜授权", description = "app智能柜授权")
|
||||
@PostMapping("/app/auth-hard-door")
|
||||
public R appAuthHardDoor(@Valid @RequestBody HardAuthAppDto dto) {
|
||||
public R<Long> appAuthHardDoor(@Valid @RequestBody HardAuthAppDto dto) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
dto.setUserId(user.getId());
|
||||
dto.setUserType(UserTypeEnum.TOB);
|
||||
return R.ok(hardAuthService.appAuthHardDoor(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "app创建第三方免密支付", description = "app创建第三方免密支付")
|
||||
@PostMapping("/app/auth-create-third-door-order")
|
||||
public R<HardAppCreateThirdDoorOrderVo> appCreateThirdDoorOrder(@Valid @RequestBody HardAuthAppDto dto) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
dto.setUserId(user.getId());
|
||||
dto.setUserType(UserTypeEnum.TOC);
|
||||
return R.ok(hardAuthService.appCreateThirdDoorOrder(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "app创建第三方免密开门", description = "app创建第三方免密开门")
|
||||
@PostMapping("/app/third-door-open")
|
||||
public R<Long> appThirdDoorOpen(@Valid @RequestBody HardAppThirdOpenDoorDto dto) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
dto.setUserId(user.getId());
|
||||
dto.setUserType(UserTypeEnum.TOC);
|
||||
return R.ok(hardAuthService.appThirdDoorOpen(dto));
|
||||
}
|
||||
|
||||
/* ************************************* end app end ************************************* */
|
||||
|
||||
@Operation(summary = "流程错误手动处理", description = "流程错误手动处理")
|
||||
|
||||
+132
@@ -0,0 +1,132 @@
|
||||
package com.bsd.pjcloud.hard.controller;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.hard.api.dto.HardThirdMiOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.HardThirdMiPayDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardThirdMiOrderEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.HardThirdMiOrderVo;
|
||||
import com.bsd.pjcloud.hard.service.HardThirdMiOrderService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 硬件商品免密订单
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/hard-third-mi-order")
|
||||
@Tag(description = "hardThirdMiOrder", name = "硬件商品免密订单管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class HardThirdMiOrderController {
|
||||
|
||||
private final HardThirdMiOrderService hardThirdMiOrderService;
|
||||
|
||||
/**
|
||||
* 刷新订单
|
||||
*/
|
||||
@Operation(summary = "刷新订单", description = "刷新订单")
|
||||
@GetMapping("/refresh")
|
||||
public R refresh(@RequestParam("id") Long id) {
|
||||
hardThirdMiOrderService.refresh(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付订单
|
||||
*/
|
||||
@Operation(summary = "支付订单", description = "支付订单")
|
||||
@PostMapping("/admin-pay")
|
||||
public R adminPay(@RequestBody HardThirdMiPayDto dto) {
|
||||
hardThirdMiOrderService.adminPay(dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款
|
||||
*/
|
||||
@Operation(summary = "退款", description = "退款")
|
||||
@GetMapping("/refund")
|
||||
public R refund(@RequestParam("id") Long id) {
|
||||
hardThirdMiOrderService.refund(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('thirdmi_hardThirdMiOrder_view')")
|
||||
public R<Page<HardThirdMiOrderVo>> getHardThirdMiOrderPage(@ParameterObject Page page, @ParameterObject HardThirdMiOrderDto dto) {
|
||||
return R.ok(hardThirdMiOrderService.scopePageJoin(page, dto, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询硬件商品免密订单
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('thirdmi_hardThirdMiOrder_view')")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(hardThirdMiOrderService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增硬件商品免密订单
|
||||
*/
|
||||
@Operation(summary = "新增硬件商品免密订单", description = "新增硬件商品免密订单")
|
||||
@SysLog("新增硬件商品免密订单")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('thirdmi_hardThirdMiOrder_add')")
|
||||
public R save(@RequestBody HardThirdMiOrderEntity hardThirdMiOrder) {
|
||||
return R.ok(hardThirdMiOrderService.save(hardThirdMiOrder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改硬件商品免密订单
|
||||
*/
|
||||
@Operation(summary = "修改硬件商品免密订单", description = "修改硬件商品免密订单")
|
||||
@SysLog("修改硬件商品免密订单")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('thirdmi_hardThirdMiOrder_edit')")
|
||||
public R updateById(@RequestBody HardThirdMiOrderEntity hardThirdMiOrder) {
|
||||
return R.ok(hardThirdMiOrderService.updateById(hardThirdMiOrder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除硬件商品免密订单
|
||||
*/
|
||||
@Operation(summary = "通过id删除硬件商品免密订单", description = "通过id删除硬件商品免密订单")
|
||||
@SysLog("通过id删除硬件商品免密订单")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('thirdmi_hardThirdMiOrder_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(hardThirdMiOrderService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('thirdmi_hardThirdMiOrder_export')")
|
||||
public List<HardThirdMiOrderEntity> export(HardThirdMiOrderEntity hardThirdMiOrder, Long[] ids) {
|
||||
return hardThirdMiOrderService.list(Wrappers.lambdaQuery(hardThirdMiOrder).in(ArrayUtil.isNotEmpty(ids), HardThirdMiOrderEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
+9
-5
@@ -9,10 +9,7 @@ import com.bsd.pjcloud.hard.api.constant.HardProductNatureEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.HardTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.order.HardPayTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.dto.async.SyncOfflineReqVo;
|
||||
import com.bsd.pjcloud.hard.api.dto.hard.HandCancelCodeDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.hard.HardBindDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.hard.HardCreateOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.hard.HardDoneHardQrCodeScanOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.hard.*;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.HardChartLatitudeVo;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.HardCreateCarDto;
|
||||
import com.bsd.pjcloud.hard.api.vo.HardInvoiceVo;
|
||||
@@ -121,7 +118,7 @@ public class HardApiController {
|
||||
|
||||
@PostMapping("/cancel-code")
|
||||
@Operation(summary = "核销二维码")
|
||||
@Idempotent(expireTime = 10, info = "正在核销中,请勿重复操作")
|
||||
@Idempotent(expireTime = 10, key = "'/hard-api/ad/cancel-code' + #dto.getOrderId() ", info = "正在核销中,请勿重复操作")
|
||||
public R<Boolean> handCancelCode(@RequestBody HandCancelCodeDto dto) {
|
||||
if (!ObjectUtil.isAllNotEmpty(dto.getOrderId(), dto.getHardwareId())) {
|
||||
throw new RuntimeException("参数不正确");
|
||||
@@ -129,6 +126,13 @@ public class HardApiController {
|
||||
return R.ok(hardwareOrderService.handCancelCode(dto));
|
||||
}
|
||||
|
||||
@PostMapping("/cancel-act-code")
|
||||
@Operation(summary = "核销二维码")
|
||||
@Idempotent(expireTime = 10, key = "'/hard-api/ad/cancel-act-code' + #dto.getActItemId() ", info = "正在核销中,请勿重复操作")
|
||||
public R<Boolean> handCancelActCode(@Validated @RequestBody HandCancelActCodeDto dto) {
|
||||
return R.ok(hardwareOrderService.handCancelActCode(dto));
|
||||
}
|
||||
|
||||
@GetMapping("/generate-invoice")
|
||||
@Operation(summary = "生成发票")
|
||||
@Idempotent(expireTime = 10, info = "正在生成中,请勿重复操作")
|
||||
|
||||
+1
-1
@@ -114,7 +114,7 @@ public class HardAfterSaleController {
|
||||
|
||||
@PostMapping(value = "/admin-reinforce-refund")
|
||||
@Operation(summary = "后台强化退款")
|
||||
@Idempotent(expireTime = 5, info = "正在退款中,请勿重复操作")
|
||||
@Idempotent(expireTime = 5, key = "'/hard-after-sale/admin-reinforce-refund' + #dto.getOrderId() ", info = "正在退款中,请勿重复操作")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardAfterSale_adminRefund')")
|
||||
public R<Boolean> adminReinforceRefund(@RequestBody HardAdminRefundReinforceDto dto) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
|
||||
+37
-2
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
@@ -21,11 +22,14 @@ import com.bsd.pjcloud.hard.service.HardCanteenTotalService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -82,7 +86,7 @@ public class HardCanteenTotalController {
|
||||
return R.ok(canteenTotalService.productLikeTop(dto));
|
||||
}
|
||||
|
||||
/* ************************************* start app start ************************************* */
|
||||
/* ************************************* end app end ************************************* */
|
||||
@Operation(summary = "根据部门 食堂菜品购买统计", description = "根据部门 食堂菜品购买统计")
|
||||
@PostMapping("/proudct-total-by-dept")
|
||||
public R<List<HardCanteenProductTotalVo>> productTotalByDept(@ParameterObject Page page, @RequestBody HardOrderDto dto) {
|
||||
@@ -90,17 +94,48 @@ public class HardCanteenTotalController {
|
||||
return R.ok(canteenTotalService.productTotalByDept(page, dto, dataScope));
|
||||
}
|
||||
|
||||
@Operation(summary = "食堂菜品购买统计", description = "食堂菜品购买统计")
|
||||
@Operation(summary = "食堂菜品购买统计(按天统计)", description = "食堂菜品购买统计(按天统计)")
|
||||
@PostMapping("/proudct-total")
|
||||
public R<Page<HardCanteenProductTotalVo>> productTotal(@ParameterObject Page page, @RequestBody HardOrderDto dto) {
|
||||
DataScope dataScope = null;
|
||||
return R.ok(canteenTotalService.productTotal(page, dto, dataScope));
|
||||
}
|
||||
|
||||
@Operation(summary = "食堂菜品购买统计(按月统计)", description = "食堂菜品购买统计(按月统计)")
|
||||
@PostMapping("/proudct-total-by-month")
|
||||
public R<Page<HardCanteenProductTotalVo>> productTotalByMonth(@ParameterObject Page page, @RequestBody HardOrderDto dto) {
|
||||
DataScope dataScope = null;
|
||||
return R.ok(canteenTotalService.productTotalByMonth(page, dto, dataScope));
|
||||
}
|
||||
|
||||
@Operation(summary = "菜品出售统计", description = "菜品出售统计")
|
||||
@PostMapping("/proudct-query")
|
||||
public R<Page<HardCarVo>> proudctQuery(@ParameterObject Page page, @RequestBody HardCarDto dto) {
|
||||
return R.ok(canteenTotalService.proudctQuery(page, dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "食堂菜品购买统计导出(按天统计)", description = "食堂菜品购买统计导出(按天统计)")
|
||||
@PostMapping("/proudct-total-export-by-day")
|
||||
@SysLog("食堂菜品购买统计导出(按天统计)")
|
||||
public void productTotalExportByDay(HttpServletResponse response, @RequestBody HardOrderDto dto) {
|
||||
if (ObjectUtil.isEmpty(dto.getCreateTimeList())) {
|
||||
throw new RuntimeException("请选择创建时间(天)");
|
||||
}
|
||||
// 导出最多只能导出一年
|
||||
long days = Math.abs(ChronoUnit.DAYS.between(dto.getCreateTimeList()[0].toLocalDate(), dto.getCreateTimeList()[1].toLocalDate()));
|
||||
if (days > 366) {
|
||||
throw new RuntimeException("最多只能导出一年的数据");
|
||||
}
|
||||
canteenTotalService.productTotalExportByDay(response, dto);
|
||||
}
|
||||
|
||||
@Operation(summary = "食堂菜品购买统计导出(按月统计)", description = "食堂菜品购买统计导出(按月统计)")
|
||||
@PostMapping("/proudct-total-export-by-month")
|
||||
@SysLog("食堂菜品购买统计导出(按月统计)")
|
||||
public void productTotalExportByMonth(HttpServletResponse response, @RequestBody HardOrderDto dto) {
|
||||
if (ObjectUtil.isEmpty(dto.getCreateTimeYearStr())) {
|
||||
throw new RuntimeException("请选择创建时间(年)");
|
||||
}
|
||||
canteenTotalService.productTotalExportByMonth(response, dto);
|
||||
}
|
||||
}
|
||||
+62
-4
@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserInfo;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteUserService;
|
||||
import com.bsd.pjcloud.canteen.constant.OrderTypeEnum;
|
||||
import com.bsd.pjcloud.common.core.constant.enums.MerchantTypeEnum;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
@@ -32,6 +33,7 @@ import com.bsd.pjcloud.hard.api.dto.hard.HardOfflinePayDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.HardOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.HardOrderPreferencesDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.act.HardCreateActOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.app.HardAppCreateFarmerOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.app.HardAppCreateOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.order.HardOrderVo;
|
||||
@@ -124,6 +126,16 @@ public class HardOrderController {
|
||||
return R.ok(hardwareOrderService.pagejoin(page, dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "app查询toc自提柜订单", description = "app查询toc自提柜订单")
|
||||
@GetMapping("/app/toc-door-page-join")
|
||||
public R appTocDoorPageJoin(@ParameterObject Page page, @ParameterObject HardOrderDto dto) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
dto.setUserId(user.getId());
|
||||
dto.setIsFindCarList(true);
|
||||
dto.setOrderTypeCodes(List.of(HardOrderTypeEnum.TOC_VISITOR.getType()));
|
||||
return R.ok(hardwareOrderService.pagejoin(page, dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "app查询食堂订单列表", description = "app查询订单列表")
|
||||
@GetMapping("/app/caneen-page-join")
|
||||
public R appCaneenPageJoin(@ParameterObject Page page, @ParameterObject HardOrderDto dto) {
|
||||
@@ -134,6 +146,16 @@ public class HardOrderController {
|
||||
return R.ok(hardwareOrderService.pagejoin(page, dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "app查询共富商城列表", description = "app查询共富商城列表")
|
||||
@GetMapping("/app/farmer-page-join")
|
||||
public R appFarmerPageJoin(@ParameterObject Page page, @ParameterObject HardOrderDto dto) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
dto.setUserId(user.getId());
|
||||
dto.setIsFindCarList(true);
|
||||
dto.setMchTypeCodes(List.of(MerchantTypeEnum.FARMER.getType()));
|
||||
return R.ok(hardwareOrderService.pagejoin(page, dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "app商户查询订单列表", description = "app商户查询订单列表")
|
||||
@GetMapping("/app/mch-page-join")
|
||||
public R appMchPageJoin(@ParameterObject Page page, @ParameterObject HardOrderDto dto) {
|
||||
@@ -144,7 +166,7 @@ public class HardOrderController {
|
||||
// 判断是否为合作超市管理员工
|
||||
if (!hardManagerService.isSuperMarketAdmin(user)) return R.ok(new Page());
|
||||
// 查询用户属于的商户
|
||||
MchManageVo mch = mchService.getFirstMchByDeptId(userInfo.getSysUser().getDeptId(), MerchantTypeEnum.SUPERMARKET).getData();
|
||||
MchManageVo mch = mchService.getFirstMchByDeptId(userInfo.getSysUser().getDeptId(), List.of(MerchantTypeEnum.SUPERMARKET, MerchantTypeEnum.FARMER)).getData();
|
||||
if (ObjectUtil.isEmpty(mch)) throw new RuntimeException("该用户下不存在商户");
|
||||
// 查询商户和下面的子商户
|
||||
List<Long> mchDtoIds = new java.util.ArrayList<>(List.of(mch.getId()));
|
||||
@@ -164,7 +186,7 @@ public class HardOrderController {
|
||||
|
||||
@Operation(summary = "app创建食堂预定订单", description = "app创建食堂预定订单")
|
||||
@GetMapping("/app/create-order")
|
||||
@Idempotent(expireTime = 3, info = "正在创建订单中,请勿重复操作")
|
||||
@Idempotent(expireTime = 3, key = "'/app/hard-order/app/create-order' + #carParentId ", info = "正在创建订单中,请勿重复操作")
|
||||
public R appCreateOrder(@RequestParam Long carParentId, @RequestParam Long apptId, @RequestParam HardTypeEnum hardType) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
HardAppCreateOrderDto dto = HardAppCreateOrderDto.builder().carParentId(carParentId).walletType(WalletTypeEnum.EAT).hardType(hardType).userId(user.getId()).orderType(HardOrderTypeEnum.RESERVE).payType(HardPayTypeEnum.WALLET_DEFAULT).apptId(apptId).build();
|
||||
@@ -173,7 +195,7 @@ public class HardOrderController {
|
||||
|
||||
@Operation(summary = "app创建线上超市预定订单", description = "app创建线上超市预定订单")
|
||||
@GetMapping("/app/create-supermarket-order")
|
||||
@Idempotent(expireTime = 3, info = "正在创建订单中,请勿重复操作")
|
||||
@Idempotent(expireTime = 3, key = "'/app/hard-order/app/create-supermarket-order' + #carParentId ", info = "正在创建订单中,请勿重复操作")
|
||||
public R<Long> appCreateSupermarketReserveOrder(@RequestParam Long carParentId, @RequestParam HardTypeEnum hardType) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
HardAppCreateOrderDto dto = HardAppCreateOrderDto.builder()
|
||||
@@ -188,6 +210,18 @@ public class HardOrderController {
|
||||
return R.ok(hardwareOrderService.appCreateSupermarketReserveOrder(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "创建共富商城预约订单", description = "app创建线上超市预定订单")
|
||||
@PostMapping("/app/create-farmer-order")
|
||||
@Idempotent(expireTime = 3, key = "'/app/hard-order/app/create-farmer-order' + #body.getCarParentId() ", info = "正在创建订单中,请勿重复操作")
|
||||
public R<Long> appCreateFarmerReserveOrder(@RequestBody HardAppCreateFarmerOrderDto body) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
body.setHardType(HardTypeEnum.FARMER);
|
||||
body.setUserId(user.getId());
|
||||
body.setOrderType(HardOrderTypeEnum.FARMER);
|
||||
body.setPayType(HardPayTypeEnum.WALLET_DEFAULT);
|
||||
return R.ok(hardwareOrderService.appCreateFarmerReserveOrder(body));
|
||||
}
|
||||
|
||||
@Operation(summary = "app创建订单扫一扫", description = "app创建订单扫一扫")
|
||||
@PostMapping("/app/create-order-scan-qrcode")
|
||||
@Idempotent(expireTime = 5, info = "正在创建订单中,请勿重复操作")
|
||||
@@ -201,13 +235,14 @@ public class HardOrderController {
|
||||
.hardType(HardTypeEnum.MERCHANT_QR_CODE)
|
||||
.orderType(HardOrderTypeEnum.BELOW)
|
||||
.payType(HardPayTypeEnum.WALLET_QR_CODE_SCAN)
|
||||
.actCouponRecordId(body.getActCouponRecordId())
|
||||
.build();
|
||||
return R.ok(hardwareOrderService.appCreateOrderScancode(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "app创建活动订单", description = "app创建活动订单")
|
||||
@PostMapping("/app/create-act-order")
|
||||
@Idempotent(expireTime = 5, info = "正在创建订单中,请勿重复操作")
|
||||
@Idempotent(expireTime = 3, key = "'/hard-order/app/create-act-order' + #body.getCancelId() ", info = "正在创建订单中,请勿重复操作")
|
||||
public R<Long> appCreateActOrder(@Validated @RequestBody HardCreateActOrderDto body) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
body.setCancelUserId(user.getId());
|
||||
@@ -251,6 +286,29 @@ public class HardOrderController {
|
||||
return R.ok(hardwareOrderService.scopePageList(page, dto, dataScope));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询未识别订单", description = "分页查询未识别订单")
|
||||
@PostMapping("/no-recog/page-join")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardwareOrderNoRecog_view')")
|
||||
public R<Page<HardOrderVo>> noRecogPageJoin(@ParameterObject Page page, @RequestBody HardOrderDto dto) {
|
||||
DataScope dataScope = DataScope.of().func(DataScopeFuncEnum.ALL);
|
||||
dataScope.setScopeDeptName("merchant_dept_id");
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
CurrentUserHardTypeInfoDto hardTypeInfo = hardManagerService.getCurrentUserHardTypeInfo(user);
|
||||
dto.setMchTypeCodes(hardTypeInfo.getHardTypeList());
|
||||
// 查询商户和下面的子商户
|
||||
List<Long> mchDtoIds = dto.getMchIds();
|
||||
if (ObjectUtil.isNotEmpty(mchDtoIds) && mchDtoIds.size() == 1) {
|
||||
Long mchId = mchDtoIds.get(0);
|
||||
List<MchManageVo> mchList = mchService.getByParentId(mchId).getData();
|
||||
if (ObjectUtil.isNotEmpty(mchList)) {
|
||||
List<Long> mchIds = mchList.stream().map(MchManageVo::getId).toList();
|
||||
mchDtoIds.addAll(mchIds);
|
||||
dto.setMchIds(mchDtoIds);
|
||||
}
|
||||
}
|
||||
return R.ok(hardwareOrderService.noRecogScopePageJoin(page, dto, dataScope));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardwareOrder_view')")
|
||||
|
||||
+142
-6
@@ -12,7 +12,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserInfo;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteUserService;
|
||||
import com.bsd.pjcloud.common.core.constant.enums.MerchantTypeEnum;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
@@ -21,11 +23,12 @@ import com.bsd.pjcloud.hard.api.constant.order.HardOrderStatusEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.order.HardPayTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.HardDeptTotalDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.HardOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.vo.order.HardDeptTotalVo;
|
||||
import com.bsd.pjcloud.hard.api.vo.order.HardOrderCsVo;
|
||||
import com.bsd.pjcloud.hard.api.vo.order.HardOrderPayTypeVo;
|
||||
import com.bsd.pjcloud.hard.api.vo.order.HardOrderSbVo;
|
||||
import com.bsd.pjcloud.hard.api.vo.HardDoorFlowVo;
|
||||
import com.bsd.pjcloud.hard.api.vo.order.*;
|
||||
import com.bsd.pjcloud.hard.api.vo.order.excel.HardMchOrderExcelVo;
|
||||
import com.bsd.pjcloud.hard.mapper.order.HardOrderMapper;
|
||||
import com.bsd.pjcloud.hard.service.HardManagerService;
|
||||
import com.bsd.pjcloud.hard.service.HardOrderService;
|
||||
import com.bsd.pjcloud.hard.service.HardOrderTotalService;
|
||||
import com.bsd.pjcloud.wallet.api.feign.RemoteMchService;
|
||||
import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
|
||||
@@ -54,9 +57,12 @@ import java.util.Map;
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class HardOrderTotalController {
|
||||
|
||||
private final HardOrderService hardOrderService;
|
||||
private final HardOrderTotalService hardOrderTotalService;
|
||||
private final HardManagerService hardManagerService;
|
||||
|
||||
private final HardOrderMapper hardOrderMapper;
|
||||
|
||||
private final RemoteMchService mchService;
|
||||
private final RemoteUserService userService;
|
||||
|
||||
@@ -75,7 +81,7 @@ public class HardOrderTotalController {
|
||||
// 判断是否为合作超市管理员工
|
||||
if (!hardManagerService.isSuperMarketAdmin(user)) return R.ok(new Page());
|
||||
// 查询用户属于的商户
|
||||
MchManageVo mch = mchService.getFirstMchByDeptId(userInfo.getSysUser().getDeptId(), MerchantTypeEnum.SUPERMARKET).getData();
|
||||
MchManageVo mch = mchService.getFirstMchByDeptId(userInfo.getSysUser().getDeptId(), List.of(MerchantTypeEnum.SUPERMARKET, MerchantTypeEnum.FARMER)).getData();
|
||||
if (ObjectUtil.isEmpty(mch)) throw new RuntimeException("该用户下不存在商户");
|
||||
List<Long> mchDtoIds = new ArrayList<>(List.of(mch.getId()));
|
||||
// 查询商户和下面的子商户
|
||||
@@ -97,7 +103,7 @@ public class HardOrderTotalController {
|
||||
// 判断是否为合作超市管理员工
|
||||
if (!hardManagerService.isSuperMarketAdmin(user)) return R.ok(new Page());
|
||||
// 查询用户属于的商户
|
||||
MchManageVo mch = mchService.getFirstMchByDeptId(userInfo.getSysUser().getDeptId(), MerchantTypeEnum.SUPERMARKET).getData();
|
||||
MchManageVo mch = mchService.getFirstMchByDeptId(userInfo.getSysUser().getDeptId(), List.of(MerchantTypeEnum.SUPERMARKET, MerchantTypeEnum.FARMER)).getData();
|
||||
if (ObjectUtil.isEmpty(mch)) throw new RuntimeException("该用户下不存在商户");
|
||||
List<Long> mchDtoIds = new ArrayList<>(List.of(mch.getId()));
|
||||
// 查询商户和下面的子商户
|
||||
@@ -137,6 +143,25 @@ public class HardOrderTotalController {
|
||||
return R.ok(hardOrderTotalService.listCs(dto));
|
||||
}
|
||||
|
||||
@PostMapping("/page-list-cs-by-month")
|
||||
@Operation(summary = "商户交易记录(按商户、月)查询")
|
||||
public R<Page<HardOrderCsVo>> pageListCsByMonth(@ParameterObject Page page, @RequestBody HardOrderDto dto) {
|
||||
dto.setOrderStatusCodes(HardOrderStatusEnum.getPaySuccessCodes());
|
||||
// 查询商户和下面的子商户
|
||||
List<Long> mchDtoIds = new ArrayList<>();
|
||||
if (ObjectUtil.isNotEmpty(dto.getMerchantId())) {
|
||||
List<MchManageVo> mchList = mchService.getByParentId(dto.getMerchantId()).getData();
|
||||
if (ObjectUtil.isNotEmpty(mchList)) {
|
||||
List<Long> mchIds = mchList.stream().map(MchManageVo::getId).toList();
|
||||
mchDtoIds.add(dto.getMerchantId());
|
||||
mchDtoIds.addAll(mchIds);
|
||||
dto.setMerchantId(null);
|
||||
dto.setMchIds(mchDtoIds);
|
||||
}
|
||||
}
|
||||
return R.ok(hardOrderTotalService.pageListCsByMonth(page, dto));
|
||||
}
|
||||
|
||||
@PostMapping("/page-list-payType")
|
||||
@Operation(summary = "支付方式交易记录")
|
||||
public R<List<HardOrderPayTypeVo>> pageListPayType(@RequestBody HardOrderDto dto) {
|
||||
@@ -222,6 +247,96 @@ public class HardOrderTotalController {
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "单个商户交易流水导出", description = "单个商户交易流水导出")
|
||||
@PostMapping("/export-mch-cs")
|
||||
@SysLog("单个商户交易流水导出")
|
||||
public void exportMchCs(HttpServletResponse response, @RequestBody HardOrderDto dto) throws IOException {
|
||||
dto.setOrderStatusCodes(HardOrderStatusEnum.getPayPrice());
|
||||
// 查询商户和下面的子商户
|
||||
List<Long> mchDtoIds = new ArrayList<>();
|
||||
if (ObjectUtil.isNotEmpty(dto.getMerchantId())) {
|
||||
List<MchManageVo> mchList = mchService.getByParentId(dto.getMerchantId()).getData();
|
||||
if (ObjectUtil.isNotEmpty(mchList)) {
|
||||
List<Long> mchIds = mchList.stream().map(MchManageVo::getId).toList();
|
||||
mchDtoIds.add(dto.getMerchantId());
|
||||
mchDtoIds.addAll(mchIds);
|
||||
dto.setMerchantId(null);
|
||||
dto.setMchIds(mchDtoIds);
|
||||
}
|
||||
}
|
||||
// 查询商户
|
||||
MchManageVo mch = mchService.getById(dto.getMerchantId()).getData();
|
||||
if (ObjectUtil.isEmpty(mch)) throw new RuntimeException("商户不存在");
|
||||
|
||||
Long count = hardOrderMapper.count(dto, DataScope.of());
|
||||
if (count > 5 * 10000) throw new RuntimeException("导出数据超出100000条,请缩小查询范围");
|
||||
|
||||
try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).withTemplate(ResourceUtil.getStream("file/商户交易流水导出.xlsx")).build()) {
|
||||
WriteSheet writeSheet = EasyExcel.writerSheet().build();
|
||||
FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
if (ObjectUtil.isNotEmpty(dto.getPayTimeList())) {
|
||||
map.put("timeSpan", " 到 ");
|
||||
map.put("startTime", LocalDateTimeUtil.format(dto.getPayTimeList()[0], DatePattern.NORM_DATETIME_PATTERN));
|
||||
map.put("endTime", LocalDateTimeUtil.format(dto.getPayTimeList()[1], DatePattern.NORM_DATETIME_PATTERN));
|
||||
}
|
||||
map.put("merchantName", mch.getName());
|
||||
// 统计
|
||||
BigDecimal totalPriceSum = BigDecimal.ZERO;
|
||||
BigDecimal extraPriceSum = BigDecimal.ZERO;
|
||||
BigDecimal payPriceSum = BigDecimal.ZERO;
|
||||
BigDecimal refundPriceSum = BigDecimal.ZERO;
|
||||
// 列号
|
||||
Long lineNumber = 1L;
|
||||
// 分页相关
|
||||
long currentPage = 1;
|
||||
long pageSize = 1000;
|
||||
|
||||
while (true) {
|
||||
Page<HardOrderVo> page = hardOrderService.scopePageList(new Page(currentPage, pageSize), dto, DataScope.of());
|
||||
List<HardOrderVo> records = page.getRecords();
|
||||
if (ObjectUtil.isEmpty(records)) break;
|
||||
List<HardMchOrderExcelVo> excelList = BeanUtils.toBean(records, HardMchOrderExcelVo.class);
|
||||
// 处理excel start
|
||||
for (HardMchOrderExcelVo v : excelList) {
|
||||
v.setLineNumber(lineNumber);
|
||||
lineNumber++;
|
||||
if (ObjectUtil.isNotEmpty(v.getTotalPrice())) {
|
||||
totalPriceSum = totalPriceSum.add(BigDecimal.valueOf(v.getTotalPrice()));
|
||||
v.setTotalPrice(BigDecimal.valueOf(v.getTotalPrice()).divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(v.getExtraPrice())) {
|
||||
extraPriceSum = extraPriceSum.add(BigDecimal.valueOf(v.getExtraPrice()));
|
||||
v.setExtraPrice(BigDecimal.valueOf(v.getExtraPrice()).divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(v.getPayPrice())) {
|
||||
payPriceSum = payPriceSum.add(BigDecimal.valueOf(v.getPayPrice()));
|
||||
v.setPayPrice(BigDecimal.valueOf(v.getPayPrice()).divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(v.getRefundPrice())) {
|
||||
refundPriceSum = refundPriceSum.add(BigDecimal.valueOf(v.getRefundPrice()));
|
||||
v.setRefundPrice(BigDecimal.valueOf(v.getRefundPrice()).divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(v.getPayType())) {
|
||||
HardPayTypeEnum hardPayTypeEnum = HardPayTypeEnum.valueOfByType(v.getPayType());
|
||||
if (ObjectUtil.isNotEmpty(hardPayTypeEnum)) {
|
||||
v.setPayType(hardPayTypeEnum.getDescription());
|
||||
}
|
||||
}
|
||||
}
|
||||
excelWriter.fill(excelList, fillConfig, writeSheet);
|
||||
// 处理excel end
|
||||
if (page.getTotal() < pageSize) break;
|
||||
currentPage++;
|
||||
}
|
||||
map.put("totalPriceSum", totalPriceSum.divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).toString());
|
||||
map.put("extraPriceSum", extraPriceSum.divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).toString());
|
||||
map.put("payPriceSum", payPriceSum.divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).toString());
|
||||
map.put("refundPriceSum", refundPriceSum.divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).toString());
|
||||
|
||||
excelWriter.fill(map, writeSheet);
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "商户交易记录导出", description = "商户交易记录导出")
|
||||
@PostMapping("/export-cs")
|
||||
@@ -308,6 +423,27 @@ public class HardOrderTotalController {
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "商户交易记录导出(按月)", description = "商户交易记录导出(按月)")
|
||||
@PostMapping("/export-cs-by-month")
|
||||
@SysLog("商户交易记录导出(按月)")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardTotal_export_cs')")
|
||||
public void exportCsByMonth(HttpServletResponse response, @RequestBody HardOrderDto dto) {
|
||||
dto.setOrderStatusCodes(HardOrderStatusEnum.getPaySuccessCodes());
|
||||
// 查询商户和下面的子商户
|
||||
List<Long> mchDtoIds = new ArrayList<>();
|
||||
if (ObjectUtil.isNotEmpty(dto.getMerchantId())) {
|
||||
List<MchManageVo> mchList = mchService.getByParentId(dto.getMerchantId()).getData();
|
||||
if (ObjectUtil.isNotEmpty(mchList)) {
|
||||
List<Long> mchIds = mchList.stream().map(MchManageVo::getId).toList();
|
||||
mchDtoIds.add(dto.getMerchantId());
|
||||
mchDtoIds.addAll(mchIds);
|
||||
dto.setMerchantId(null);
|
||||
dto.setMchIds(mchDtoIds);
|
||||
}
|
||||
}
|
||||
hardOrderTotalService.exportCsByMonth(response, dto);
|
||||
}
|
||||
|
||||
@Operation(summary = "支付方式交易记录", description = "支付方式交易记录")
|
||||
@PostMapping("/export-payType")
|
||||
@SysLog("支付方式交易记录")
|
||||
|
||||
+1
@@ -73,6 +73,7 @@ public class PanelCanteenController {
|
||||
dto.setTotalTimeList(DateRangeTool.transitionDateTypeToDateTimeList(dto.getDateRangeType()));
|
||||
}
|
||||
dto.setMchTypeCodes(List.of(MerchantTypeEnum.CANTEEN.getType()));
|
||||
dto.setLimit(5L);
|
||||
return R.ok(panelCanteenService.mchPayPersonCount(dto));
|
||||
}
|
||||
|
||||
|
||||
+52
@@ -1,12 +1,20 @@
|
||||
package com.bsd.pjcloud.hard.controller.panel;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bsd.pjcloud.common.core.constant.enums.DateRangeTypeEnum;
|
||||
import com.bsd.pjcloud.common.core.constant.enums.MerchantTypeEnum;
|
||||
import com.bsd.pjcloud.common.core.constant.enums.YesNoEnum;
|
||||
import com.bsd.pjcloud.common.core.util.DateRangeTool;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.hard.api.constant.order.HardOrderStatusEnum;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.HardOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.panel.PanelProductDto;
|
||||
import com.bsd.pjcloud.hard.api.vo.hard.PanelPorductVo;
|
||||
import com.bsd.pjcloud.hard.api.vo.order.HardOrderCsVo;
|
||||
import com.bsd.pjcloud.hard.service.HardOrderTotalService;
|
||||
import com.bsd.pjcloud.hard.service.PanelNutritionService;
|
||||
import com.bsd.pjcloud.wallet.api.feign.RemoteMchService;
|
||||
import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@@ -18,6 +26,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@@ -28,6 +37,9 @@ import java.util.List;
|
||||
public class PanelNutritionController {
|
||||
|
||||
private final PanelNutritionService panelNutritionService;
|
||||
private final HardOrderTotalService hardOrderTotalService;
|
||||
|
||||
private final RemoteMchService mchService;
|
||||
|
||||
@PostMapping(value = "/class-count")
|
||||
@Operation(summary = "食堂用餐分类统计")
|
||||
@@ -36,6 +48,7 @@ public class PanelNutritionController {
|
||||
dto.setTotalTimeList(DateRangeTool.transitionDateTypeToDateTimeList(dto.getDateRangeType()));
|
||||
}
|
||||
dto.setMchTypeCodes(List.of(MerchantTypeEnum.CANTEEN.getType()));
|
||||
dto.setOrderStatus(HardOrderStatusEnum.getPayPrice());
|
||||
return R.ok(panelNutritionService.classCount(dto));
|
||||
}
|
||||
|
||||
@@ -46,6 +59,7 @@ public class PanelNutritionController {
|
||||
dto.setTotalTimeList(DateRangeTool.transitionDateTypeToDateTimeList(dto.getDateRangeType()));
|
||||
}
|
||||
dto.setMchTypeCodes(List.of(MerchantTypeEnum.CANTEEN.getType()));
|
||||
dto.setOrderStatus(HardOrderStatusEnum.getPayPrice());
|
||||
return R.ok(panelNutritionService.cuisineTop(dto));
|
||||
}
|
||||
|
||||
@@ -56,6 +70,7 @@ public class PanelNutritionController {
|
||||
dto.setTotalTimeList(DateRangeTool.transitionDateTypeToDateTimeList(dto.getDateRangeType()));
|
||||
}
|
||||
dto.setMchTypeCodes(List.of(MerchantTypeEnum.CANTEEN.getType()));
|
||||
dto.setOrderStatus(HardOrderStatusEnum.getPayPrice());
|
||||
return R.ok(panelNutritionService.nutritionByTime(dto));
|
||||
}
|
||||
|
||||
@@ -66,6 +81,7 @@ public class PanelNutritionController {
|
||||
dto.setTotalTimeList(DateRangeTool.transitionDateTypeToDateTimeList(dto.getDateRangeType()));
|
||||
}
|
||||
dto.setMchTypeCodes(List.of(MerchantTypeEnum.CANTEEN.getType()));
|
||||
dto.setOrderStatus(HardOrderStatusEnum.getPayPrice());
|
||||
return R.ok(panelNutritionService.nutritionTotal(dto));
|
||||
}
|
||||
|
||||
@@ -77,17 +93,53 @@ public class PanelNutritionController {
|
||||
LocalDateTime.now().withHour(23).withMinute(59).withSecond(59)
|
||||
});
|
||||
dto.setMchTypeCodes(List.of(MerchantTypeEnum.CANTEEN.getType()));
|
||||
dto.setOrderStatus(HardOrderStatusEnum.getPayPrice());
|
||||
return R.ok(panelNutritionService.nutritionByTime(dto));
|
||||
}
|
||||
|
||||
@PostMapping(value = "/repurchase")
|
||||
@Operation(summary = "复购排行榜")
|
||||
public R<List<PanelPorductVo>> repurchase(@RequestBody PanelProductDto dto) {
|
||||
dto.setDateRangeType(DateRangeTypeEnum.TODAY);
|
||||
if (ObjectUtil.isNotEmpty(dto.getDateRangeType()) && ObjectUtil.isEmpty(dto.getTotalTimeList())) {
|
||||
dto.setTotalTimeList(DateRangeTool.transitionDateTypeToDateTimeList(dto.getDateRangeType()));
|
||||
}
|
||||
dto.setMchTypeCodes(List.of(MerchantTypeEnum.CANTEEN.getType()));
|
||||
dto.setOrderStatus(HardOrderStatusEnum.getPayPrice());
|
||||
dto.setLimit(5L);
|
||||
return R.ok(panelNutritionService.repurchase(dto));
|
||||
}
|
||||
|
||||
@PostMapping(value = "/external")
|
||||
@Operation(summary = "外部就餐情况(合作商家)")
|
||||
public R<PanelPorductVo.HourTypeVo> external(@RequestBody PanelProductDto dto) {
|
||||
if (ObjectUtil.isNotEmpty(dto.getDateRangeType()) && ObjectUtil.isEmpty(dto.getTotalTimeList())) {
|
||||
dto.setTotalTimeList(DateRangeTool.transitionDateTypeToDateTimeList(dto.getDateRangeType()));
|
||||
}
|
||||
dto.setMchTypeCodes(List.of(MerchantTypeEnum.SUPERMARKET.getType()));
|
||||
dto.setOrderStatus(HardOrderStatusEnum.getPayPrice());
|
||||
dto.setExcludeCanteenPay(YesNoEnum.YES.getCode());
|
||||
return R.ok(panelNutritionService.external(dto));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = "/report")
|
||||
@Operation(summary = "营养分析报表")
|
||||
public R<List<HardOrderCsVo>> canteenReport(@RequestBody HardOrderDto dto) {
|
||||
dto.setOrderStatusCodes(HardOrderStatusEnum.getPaySuccessCodes());
|
||||
dto.setMchTypeCodes(List.of(MerchantTypeEnum.SUPERMARKET.getType(), MerchantTypeEnum.SELF_SUPERMARKET.getType()));
|
||||
List<Long> mchDtoIds = new ArrayList<>();
|
||||
if (ObjectUtil.isNotEmpty(dto.getMerchantId())) {
|
||||
List<MchManageVo> mchList = mchService.getByParentId(dto.getMerchantId()).getData();
|
||||
if (ObjectUtil.isNotEmpty(mchList)) {
|
||||
List<Long> mchIds = mchList.stream().map(MchManageVo::getId).toList();
|
||||
mchDtoIds.add(dto.getMerchantId());
|
||||
mchDtoIds.addAll(mchIds);
|
||||
dto.setMerchantId(null);
|
||||
dto.setMchIds(mchDtoIds);
|
||||
}
|
||||
}
|
||||
return R.ok(hardOrderTotalService.listCs(dto));
|
||||
}
|
||||
|
||||
}
|
||||
+32
@@ -55,6 +55,7 @@ public class PanelShopController {
|
||||
}
|
||||
dto.setMchTypeCodes(List.of(MerchantTypeEnum.SELF_SUPERMARKET.getType()));
|
||||
dto.setHourTypeIsNull(YesNoEnum.YES.getCode());
|
||||
dto.setOrderStatus(HardOrderStatusEnum.getPayPrice());
|
||||
return R.ok(panelShopService.mchPayPersonCount(dto));
|
||||
}
|
||||
|
||||
@@ -67,6 +68,7 @@ public class PanelShopController {
|
||||
});
|
||||
dto.setMchTypeCodes(List.of(MerchantTypeEnum.SELF_SUPERMARKET.getType()));
|
||||
dto.setHourTypeIsNull(YesNoEnum.YES.getCode());
|
||||
dto.setOrderStatus(HardOrderStatusEnum.getPayPrice());
|
||||
return R.ok(panelShopService.mchPayCount(dto));
|
||||
}
|
||||
|
||||
@@ -120,13 +122,43 @@ public class PanelShopController {
|
||||
@PostMapping(value = "/mch-pay-count-top")
|
||||
@Operation(summary = "排行榜")
|
||||
public R<List<PanelPorductVo>> mchPayCountTop(@RequestBody PanelProductDto dto) {
|
||||
dto.setDateRangeType(DateRangeTypeEnum.TODAY);
|
||||
if (ObjectUtil.isNotEmpty(dto.getDateRangeType()) && ObjectUtil.isEmpty(dto.getTotalTimeList())) {
|
||||
dto.setTotalTimeList(DateRangeTool.transitionDateTypeToDateTimeList(dto.getDateRangeType()));
|
||||
}
|
||||
dto.setLimit(5L);
|
||||
dto.setMchTypeCodes(List.of(MerchantTypeEnum.SELF_SUPERMARKET.getType()));
|
||||
dto.setHourTypeIsNull(YesNoEnum.YES.getCode());
|
||||
dto.setOrderStatus(HardOrderStatusEnum.getPayPrice());
|
||||
return R.ok(panelShopService.mchPayCountTop(dto));
|
||||
}
|
||||
|
||||
@PostMapping(value = "/today-trend")
|
||||
@Operation(summary = "当天超市购买次数趋势统计")
|
||||
public R<List<PanelPorductVo>> todayTrend(@RequestBody PanelProductDto dto) {
|
||||
dto.setDateRangeType(DateRangeTypeEnum.TODAY);
|
||||
if (ObjectUtil.isNotEmpty(dto.getDateRangeType()) && ObjectUtil.isEmpty(dto.getTotalTimeList())) {
|
||||
dto.setTotalTimeList(DateRangeTool.transitionDateTypeToDateTimeList(dto.getDateRangeType()));
|
||||
}
|
||||
dto.setMchTypeCodes(List.of(MerchantTypeEnum.SELF_SUPERMARKET.getType()));
|
||||
dto.setHourTypeIsNull(YesNoEnum.YES.getCode());
|
||||
dto.setOrderStatus(HardOrderStatusEnum.getPayPrice());
|
||||
return R.ok(panelShopService.todayTrend(dto));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = "/hot-product")
|
||||
@Operation(summary = "热卖商品")
|
||||
public R<List<PanelPorductVo>> hotProduct(@RequestBody PanelProductDto dto) {
|
||||
dto.setDateRangeType(DateRangeTypeEnum.THIS_WEEK);
|
||||
if (ObjectUtil.isNotEmpty(dto.getDateRangeType()) && ObjectUtil.isEmpty(dto.getTotalTimeList())) {
|
||||
dto.setTotalTimeList(DateRangeTool.transitionDateTypeToDateTimeList(dto.getDateRangeType()));
|
||||
}
|
||||
dto.setMchTypeCodes(List.of(MerchantTypeEnum.SELF_SUPERMARKET.getType()));
|
||||
dto.setOrderStatus(HardOrderStatusEnum.getPayPrice());
|
||||
dto.setLimit(10L);
|
||||
return R.ok(panelShopService.hotProduct(dto));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+2
-2
@@ -97,8 +97,8 @@ public class HardSpuController {
|
||||
|
||||
@Operation(summary = "拉取旷世商品", description = "拉取旷世商品")
|
||||
@GetMapping("/async-all")
|
||||
public R asyncAll() {
|
||||
hardSpuService.asyncAll();
|
||||
public R asyncAll(@ParameterObject HardSpuDto dto) {
|
||||
hardSpuService.asyncAll(dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.bsd.pjcloud.hard.controller.yyx;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.bsd.pjcloud.common.core.constant.enums.YesNoEnum;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardApptEntity;
|
||||
import com.bsd.pjcloud.hard.service.YyxService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 云音箱
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/yyx")
|
||||
@Tag(description = "hard-appt", name = "设备预约管理管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class HardYyxController {
|
||||
|
||||
private final YyxService yyxService;
|
||||
|
||||
// @Operation(summary = "发送消息", description = "发送消息")
|
||||
// @GetMapping("/send")
|
||||
// @Inner(value = false)
|
||||
// public R<Boolean> send() {
|
||||
// yyxService.send(1931916121241079810L, 100, "17683843144");
|
||||
// return R.ok(true);
|
||||
// }
|
||||
|
||||
}
|
||||
Loaded 100 of 460 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user