Compare commits
366 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9616c27efa | ||
|
|
0b5f830d7c | ||
|
|
d0f952bd68 | ||
|
|
2876a39ff5 | ||
|
|
6bcf6da165 | ||
|
|
9fe633d228 | ||
|
|
b32bf41443 | ||
|
|
e4e073b6f0 | ||
|
|
e960ee2f40 | ||
|
|
a689bb83ee | ||
|
|
0940d9aec8 | ||
|
|
c5da640432 | ||
|
|
a5f924841a | ||
|
|
fda3b5b1cc | ||
|
|
10b8f83737 | ||
|
|
ea5da365c7 | ||
|
|
f6eb72332b | ||
|
|
fcb401c89b | ||
|
|
2b0dc1d0a3 | ||
|
|
a0139b84e1 | ||
|
|
6cb511ba10 | ||
|
|
7483f19fc6 | ||
|
|
f8d2ab5e17 | ||
|
|
9cd591efe3 | ||
|
|
e655fdf67f | ||
|
|
9aa253b56f | ||
|
|
1d5a2008e1 | ||
|
|
1f1b534b13 | ||
|
|
5c78711d8e | ||
|
|
191709e983 | ||
|
|
da6a17cd61 | ||
|
|
acb88a6b2a | ||
|
|
96b5b50ee0 | ||
|
|
6639ec8971 | ||
|
|
9aa7a6dcf3 | ||
|
|
4dc183cdf5 | ||
|
|
bbe3399c90 | ||
|
|
29e43d299a | ||
|
|
a4ee4df71b | ||
|
|
64dbe6708a | ||
|
|
f375a9f9db | ||
|
|
15a8800b15 | ||
|
|
77e526c22f | ||
|
|
f235f66c19 | ||
|
|
1b44bedf42 | ||
|
|
40e16c4d1b | ||
|
|
0c383ac7e9 | ||
|
|
0ec2688f17 | ||
|
|
346550182f | ||
|
|
24568e0f00 | ||
|
|
64f2f4668b | ||
|
|
f4e1d891a7 | ||
|
|
3972e0231c | ||
|
|
039e85d5e5 | ||
|
|
936397c59f | ||
|
|
23ddca6f82 | ||
|
|
286214d9c3 | ||
|
|
6d0dd09b5b | ||
|
|
38469d42ef | ||
|
|
696bfe0a2c | ||
|
|
3de2b9834d | ||
|
|
d5fdc47936 | ||
|
|
27e82423f0 | ||
|
|
576b5b213e | ||
|
|
145406be32 | ||
|
|
a65f0ad384 | ||
|
|
5051fc7b0b | ||
|
|
7164036d4c | ||
|
|
cb0a9121e5 | ||
|
|
96e779eb28 | ||
|
|
27397f1602 | ||
|
|
2d1cfde76b | ||
|
|
007d69a887 | ||
|
|
f3965cecd5 | ||
|
|
4fb170e5c7 | ||
|
|
8e1ade5423 | ||
|
|
0b081c2d85 | ||
|
|
ab1e9f806f | ||
|
|
e961711dcb | ||
|
|
90185d8c32 | ||
|
|
68ef46195c | ||
|
|
0c234e78af | ||
|
|
ca1851570b | ||
|
|
cf0d1378c8 | ||
|
|
b13a5d5f2a | ||
|
|
575458afb3 | ||
|
|
b2d4b7bb23 | ||
|
|
def6247e9f | ||
|
|
6409d0dc2d | ||
|
|
f253ae9c31 | ||
|
|
b93d10eeea | ||
|
|
801f1cbd4c | ||
|
|
f8260c3b29 | ||
|
|
9e74c15413 | ||
|
|
65e7f9750a | ||
|
|
62804941c2 | ||
|
|
05818baf7a | ||
|
|
1c28e0bd5f | ||
|
|
0460e219f9 | ||
|
|
eec3611218 | ||
|
|
87f637099c | ||
|
|
5f0241768d | ||
|
|
60b4ab5c5b | ||
|
|
bbed7afdcb | ||
|
|
459a736ebc | ||
|
|
bdbc620515 | ||
|
|
3c905ffd8b | ||
|
|
20d32b1f8f | ||
|
|
f57a373d47 | ||
|
|
77a714e64c | ||
|
|
4a3c978e07 | ||
|
|
a4d458bace | ||
|
|
b0843aa744 | ||
|
|
eddcbc2ecb | ||
|
|
62fd1f3012 | ||
|
|
23264d5d9b | ||
|
|
cc7d2c0c82 | ||
|
|
9bed8e57df | ||
|
|
ad35168876 | ||
|
|
ec8d511e9e | ||
|
|
d2cab9f4a1 | ||
|
|
c1ca4764f0 | ||
|
|
366d1b8846 | ||
|
|
7a8dd54e5c | ||
|
|
37393bb7f8 | ||
|
|
3904bfd91d | ||
|
|
f720e00132 | ||
|
|
f723c11a84 | ||
|
|
643e8c8157 | ||
|
|
11f9ddaeb6 | ||
|
|
5d96d434d6 | ||
|
|
ad1f086e4d | ||
|
|
3fa3991cfa | ||
|
|
9a6102e887 | ||
|
|
e23d3a48cc | ||
|
|
ddd7c336cf | ||
|
|
ee79b19d20 | ||
|
|
383cbc0b53 | ||
|
|
e8d9556a4b | ||
|
|
5958f06986 | ||
|
|
0c4aef307a | ||
|
|
20436653af | ||
|
|
814533a2c2 | ||
|
|
d4ca3d5817 | ||
|
|
194d0b6ac2 | ||
|
|
832b065a46 | ||
|
|
fa443a091f | ||
|
|
31c2f555fc | ||
|
|
74e5e86eff | ||
|
|
a318eb82c7 | ||
|
|
6465dc2b73 | ||
|
|
082d241c8f | ||
|
|
5a6012530e | ||
|
|
35e4538160 | ||
|
|
125bb372ed | ||
|
|
92e56d7153 | ||
|
|
c8272ec90d | ||
|
|
b6d01cb850 | ||
|
|
5e1eb3e03b | ||
|
|
f4c94bd8d6 | ||
|
|
8484d3f810 | ||
|
|
07f5fbca47 | ||
|
|
68d03196af | ||
|
|
a9ef62dfb0 | ||
|
|
9f6d33f6e8 | ||
|
|
ff158fd0e4 | ||
|
|
4de5e616e5 | ||
|
|
b6db829b04 | ||
|
|
821aa74669 | ||
|
|
c3221a6fff | ||
|
|
cbbfbae772 | ||
|
|
c65fd99b15 | ||
|
|
4d49d3c77a | ||
|
|
aad32a4a1f | ||
|
|
ec912efa01 | ||
|
|
bf2fdc2761 | ||
|
|
168c630a13 | ||
|
|
e7563203fe | ||
|
|
9bf1dbe030 | ||
|
|
dbcee40b93 | ||
|
|
2af334d793 | ||
|
|
f9a8675942 | ||
|
|
521a6174fe | ||
|
|
c85bc7b8ea | ||
|
|
825e44b353 | ||
|
|
ed840a95a1 | ||
|
|
ef31d6af83 | ||
|
|
b1e70ebf12 | ||
|
|
3af0031214 | ||
|
|
b648aa94b3 | ||
|
|
0e864043a6 | ||
|
|
eb25827937 | ||
|
|
f4a07b2911 | ||
|
|
cdfeb5dbdc | ||
|
|
40bc890870 | ||
|
|
18874e3755 | ||
|
|
a3d2b84ecb | ||
|
|
5f16a5c791 | ||
|
|
f086a58096 | ||
|
|
dfcf71aec7 | ||
|
|
f2e8d03f80 | ||
|
|
0736f1c550 | ||
|
|
bdd1195d20 | ||
|
|
e5511d5c09 | ||
|
|
7634801f7c | ||
|
|
1db86f2865 | ||
|
|
626e58b515 | ||
|
|
787617f504 | ||
|
|
3fb4e488bb | ||
|
|
c5187a63b9 | ||
|
|
e5f725cf16 | ||
|
|
3d56c9cc81 | ||
|
|
0ae1ae5df4 | ||
|
|
c0c530adad | ||
|
|
e962a594ba | ||
|
|
0ac7900948 | ||
|
|
6748b2911a | ||
|
|
3e4152fd9b | ||
|
|
7dfffd60b8 | ||
|
|
3ba4d24041 | ||
|
|
e99d0f45fd | ||
|
|
351745d31f | ||
|
|
bfa960d803 | ||
|
|
7572e8d56f | ||
|
|
82e773243f | ||
|
|
795440850b | ||
|
|
6adcb46f29 | ||
|
|
6cd31e630c | ||
|
|
23b3e72579 | ||
|
|
bda7a12c2a | ||
|
|
e8f44ef6f2 | ||
|
|
e4047fbd30 | ||
|
|
7dcdb43acf | ||
|
|
9f75e1fae8 | ||
|
|
78c0de664c | ||
|
|
efc4b37782 | ||
|
|
6253590326 | ||
|
|
f0b43ddd32 | ||
|
|
51e7b4f15d | ||
|
|
0ef244b373 | ||
|
|
97a1502eb2 | ||
|
|
2536e3b9f6 | ||
|
|
7aed7254a0 | ||
|
|
44e061f321 | ||
|
|
a9ddcfeb95 | ||
|
|
822e332aaa | ||
|
|
c3fbad7dbf | ||
|
|
07348357d0 | ||
|
|
947fc457f2 | ||
|
|
b719e96838 | ||
|
|
cafeb1f20f | ||
|
|
9ae798a11a | ||
|
|
d188068b10 | ||
|
|
abb4b8cb66 | ||
|
|
ef8615cfe5 | ||
|
|
ee0cb6d225 | ||
|
|
0da8f7f8f6 | ||
|
|
f8b44d9f9b | ||
|
|
b55f5ab6ae | ||
|
|
90e550934d | ||
|
|
ff757d2151 | ||
|
|
a3f838d8e6 | ||
|
|
d9d19f8cbd | ||
|
|
036ad6defb | ||
|
|
520c09b801 | ||
|
|
f850e4adaa | ||
|
|
450041bb02 | ||
|
|
2e99c26654 | ||
|
|
2e5f383db4 | ||
|
|
357b214192 | ||
|
|
c301c55905 | ||
|
|
1764e6956b | ||
|
|
a7509e1125 | ||
|
|
9ec3322574 | ||
|
|
3658f027bb | ||
|
|
9a04bb2d71 | ||
|
|
343e5e332c | ||
|
|
28a6cf1cb1 | ||
|
|
e2777b2f0a | ||
|
|
d8da258898 | ||
|
|
8616854e00 | ||
|
|
7b98d1d9d0 | ||
|
|
b8b14df39b | ||
|
|
8ddf622d0f | ||
|
|
00ffd246a9 | ||
|
|
ac86715062 | ||
|
|
2c8df21671 | ||
|
|
d16cf44f4a | ||
|
|
6d3fbd7cf0 | ||
|
|
f9f723c47a | ||
|
|
3ac28ac218 | ||
|
|
ece66ba16a | ||
|
|
f24019d306 | ||
|
|
ea80777ef6 | ||
|
|
f7ab6dc6ae | ||
|
|
a8698fbd1a | ||
|
|
62b5162c7e | ||
|
|
aa9466b8d1 | ||
|
|
70b12dfd3e | ||
|
|
0912872de2 | ||
|
|
9016090c67 | ||
|
|
79e4386d1e | ||
|
|
5e4973fae5 | ||
|
|
4228ac4570 | ||
|
|
152dbac29d | ||
|
|
2241e90798 | ||
|
|
613a808cec | ||
|
|
af52a68abc | ||
|
|
9c2738399e | ||
|
|
385a4ae618 | ||
|
|
b0d39324ef | ||
|
|
c224ad568e | ||
|
|
6184ba9b82 | ||
|
|
bea807c7b4 | ||
|
|
323bc6b775 | ||
|
|
7c87d13ba2 | ||
|
|
3e10c891ab | ||
|
|
643d966740 | ||
|
|
94968799c3 | ||
|
|
30d53fa41e | ||
|
|
00805d6a49 | ||
|
|
0e7665f59d | ||
|
|
96cc2bd37f | ||
|
|
71e51b3b6f | ||
|
|
5f90e422e6 | ||
|
|
b65cdfc1fb | ||
|
|
a3c597b3c5 | ||
|
|
db587fda30 | ||
|
|
7170e3a16a | ||
|
|
61aa3ca3d2 | ||
|
|
96f57b7df8 | ||
|
|
d16df738d3 | ||
|
|
9ae0921f69 | ||
|
|
5dd1c95294 | ||
|
|
404fecd83c | ||
|
|
a4fb3db3cd | ||
|
|
92d64db0b7 | ||
|
|
033ec0fd61 | ||
|
|
dc36274212 | ||
|
|
817587522b | ||
|
|
58648c3ece | ||
|
|
16f314bd80 | ||
|
|
f8408030a9 | ||
|
|
c276b1595c | ||
|
|
71cc57959b | ||
|
|
dbd35c18b5 | ||
|
|
1e868c2335 | ||
|
|
59461175d9 | ||
|
|
aee5d4be2e | ||
|
|
e9c18935c5 | ||
|
|
b80aa48735 | ||
|
|
c32999aa03 | ||
|
|
56d486e010 | ||
|
|
d83f82a340 | ||
|
|
2f49292672 | ||
|
|
c09b6061fc | ||
|
|
1d14a0adb5 | ||
|
|
840a2eabdb | ||
|
|
f2be8e6abd | ||
|
|
71fb4b2b2b | ||
|
|
3cabf0a32c | ||
|
|
8416fd49ae | ||
|
|
3a15c2eaa7 | ||
|
|
e0eb76e120 | ||
|
|
8a29ce048d | ||
|
|
d43b679f8d |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -10,6 +10,7 @@ target
|
|||||||
.factorypath
|
.factorypath
|
||||||
|
|
||||||
log/
|
log/
|
||||||
|
logs/
|
||||||
*.factorypath
|
*.factorypath
|
||||||
lili-shop/src/main/java/cn/lili/generator/CodeGenerator.java
|
lili-shop/src/main/java/cn/lili/generator/CodeGenerator.java
|
||||||
lili-logs
|
lili-logs
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
## PS:数据库位置
|
## PS:数据库位置
|
||||||
|
|
||||||
点击跳转 https://gitee.com/beijing_hongye_huicheng/docker/tree/master/init/mysql 这里有与tag版本一致的sql,根据tag获取sql,如果使用master代码,则需要在lilishop项目根目录的update-sql目录中,获取对应的升级sql。
|
点击跳转 https://gitee.com/beijing_hongye_huicheng/docker/tree/master/init/mysql 这里有与tag版本一致的sql,根据tag获取sql,如果使用master代码,则需要在lilishop项目根目录的update-sql目录中,获取对应的升级sql。
|
||||||
|
|
||||||
|
|
||||||
|
使用master分支代码时,可能会无法运行,执行完初始化sql之后需要执行当前目录下'versiontXXXXtoMASTER.sql'。
|
||||||
2
DB/version4.2.3to4.2.4.sql
Normal file
2
DB/version4.2.3to4.2.4.sql
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
/** 新增已退货数量 **/
|
||||||
|
ALTER TABLE li_order_item ADD return_goods_number int DEFAULT 0 COMMENT '退货数量 ';
|
||||||
64
DB/version4.2.3toMASTER.sql
Normal file
64
DB/version4.2.3toMASTER.sql
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
/** 新增已退货数量 **/
|
||||||
|
ALTER TABLE li_order_item ADD return_goods_number int DEFAULT 0 COMMENT '退货数量 ';
|
||||||
|
|
||||||
|
|
||||||
|
-- 促销重构sql
|
||||||
|
ALTER TABLE li_coupon DROP COLUMN promotion_status;
|
||||||
|
|
||||||
|
ALTER TABLE li_coupon_activity DROP COLUMN promotion_status;
|
||||||
|
ALTER TABLE li_coupon_activity ADD `scope_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '范围关联的ID';
|
||||||
|
ALTER TABLE li_coupon_activity ADD `scope_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'PORTION_GOODS' COMMENT '关联范围类型';
|
||||||
|
|
||||||
|
ALTER TABLE li_full_discount DROP COLUMN promotion_status;
|
||||||
|
ALTER TABLE li_full_discount ADD `scope_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '范围关联的ID';
|
||||||
|
ALTER TABLE li_full_discount ADD `scope_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'PORTION_GOODS' COMMENT '关联范围类型';
|
||||||
|
|
||||||
|
ALTER TABLE li_kanjia_activity_goods DROP COLUMN promotion_status;
|
||||||
|
ALTER TABLE li_kanjia_activity_goods ADD `scope_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '范围关联的ID';
|
||||||
|
ALTER TABLE li_kanjia_activity_goods ADD `scope_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'PORTION_GOODS' COMMENT '关联范围类型';
|
||||||
|
ALTER TABLE li_kanjia_activity_goods ADD `goods_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL;
|
||||||
|
|
||||||
|
ALTER TABLE li_pintuan DROP COLUMN promotion_status;
|
||||||
|
ALTER TABLE li_pintuan ADD `scope_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '范围关联的ID';
|
||||||
|
ALTER TABLE li_pintuan ADD `scope_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'PORTION_GOODS' COMMENT '关联范围类型';
|
||||||
|
|
||||||
|
ALTER TABLE li_points_goods DROP COLUMN promotion_status;
|
||||||
|
ALTER TABLE li_points_goods ADD `scope_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '范围关联的ID';
|
||||||
|
ALTER TABLE li_points_goods ADD `scope_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'PORTION_GOODS' COMMENT '关联范围类型';
|
||||||
|
ALTER TABLE li_points_goods ADD `original_price` double(10,2) DEFAULT NULL COMMENT '原价';
|
||||||
|
ALTER TABLE li_points_goods ADD `thumbnail` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '缩略图';
|
||||||
|
ALTER TABLE li_points_goods ADD `goods_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '商品编号';
|
||||||
|
ALTER TABLE li_points_goods ADD `goods_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '货品名称';
|
||||||
|
|
||||||
|
ALTER TABLE li_promotion_goods DROP COLUMN promotion_status;
|
||||||
|
ALTER TABLE li_promotion_goods ADD `scope_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '范围关联的ID';
|
||||||
|
ALTER TABLE li_promotion_goods ADD `scope_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'PORTION_GOODS' COMMENT '关联范围类型';
|
||||||
|
ALTER TABLE li_promotion_goods ADD `original_price` double(10,2) DEFAULT NULL COMMENT '原价';
|
||||||
|
ALTER TABLE li_promotion_goods ADD `points` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '兑换积分';
|
||||||
|
ALTER TABLE li_promotion_goods ADD `goods_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '商品编号';
|
||||||
|
|
||||||
|
ALTER TABLE li_seckill DROP COLUMN promotion_status;
|
||||||
|
ALTER TABLE li_seckill ADD `scope_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin COMMENT '范围关联的ID';
|
||||||
|
ALTER TABLE li_seckill ADD `scope_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT 'PORTION_GOODS' COMMENT '关联范围类型';
|
||||||
|
|
||||||
|
ALTER TABLE li_full_discount RENAME COLUMN is_coupon TO coupon_flag;
|
||||||
|
ALTER TABLE li_full_discount RENAME COLUMN is_free_freight TO free_freight_flag;
|
||||||
|
ALTER TABLE li_full_discount RENAME COLUMN is_full_minus TO full_minus_flag;
|
||||||
|
ALTER TABLE li_full_discount RENAME COLUMN is_full_rate TO full_rate_flag;
|
||||||
|
ALTER TABLE li_full_discount RENAME COLUMN is_gift TO gift_flag;
|
||||||
|
ALTER TABLE li_full_discount RENAME COLUMN is_point TO point_flag;
|
||||||
|
|
||||||
|
ALTER TABLE li_member_coupon RENAME COLUMN is_platform TO platform_flag;
|
||||||
|
|
||||||
|
ALTER TABLE li_goods RENAME COLUMN is_auth TO auth_flag;
|
||||||
|
|
||||||
|
ALTER TABLE li_goods_sku RENAME COLUMN is_promotion TO promotion_flag;
|
||||||
|
ALTER TABLE li_goods_sku RENAME COLUMN is_auth TO auth_flag;
|
||||||
|
|
||||||
|
|
||||||
|
-- 增加会员表索引
|
||||||
|
ALTER TABLE li_member ADD INDEX query_mobile (`mobile`) COMMENT 'query_member';
|
||||||
|
-- 会员签到唯一索引 惠券查询索引
|
||||||
|
ALTER TABLE li_member_sign ADD INDEX query_create_time (`create_time`) COMMENT 'query_create_time';
|
||||||
|
ALTER TABLE li_member_sign ADD INDEX query_member_id (`member_id`) COMMENT 'query_member_id';
|
||||||
|
ALTER TABLE li_member_sign add unique uk_member_day (member_id, create_time) COMMENT 'uk_member_day';
|
||||||
119
README.md
119
README.md
@@ -1,15 +1,18 @@
|
|||||||
## 🔥 Lilishop B2B2C商城系统
|
## Lilishop B2B2C商城系统
|
||||||
|
|
||||||
##### 🌹 开源不易,如有帮助请点Star
|
##### 开源不易,如有帮助请点Star
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### 欢迎交流需求,交流业务,交流技术(基础问题自行解决,进群先看文档后提问)
|
#### 欢迎交流需求,交流业务,交流技术(基础问题自行解决,进群先看文档后提问)
|
||||||
|
|
||||||
|
|
||||||
##### 交流 qq 1群 961316482(已满)
|
##### 交流 qq 1群 961316482(已满)
|
||||||
|
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=BAhURE3DG2YWhQk6kRxVapbLykqMoPS8&jump_from=webapi"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="Lilishop交流群" title="Lilishop交流群">点击快捷加群</a>
|
||||||
|
|
||||||
##### 交流 qq 2群 875294241
|
##### 交流 qq 2群 875294241
|
||||||
|
|
||||||
|
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=_lrekOvr5k2p5uTn5GRidI-chKEmpCX3&jump_from=webapi"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="Lilishop交流群2群" title="Lilishop交流群2群">点击快捷加群</a>
|
||||||
|
|
||||||
|
|
||||||
##### 体验 公众号/小程序/APP 体验,扫描二维码
|
##### 体验 公众号/小程序/APP 体验,扫描二维码
|
||||||
@@ -20,51 +23,33 @@
|
|||||||

|

|
||||||
|
|
||||||
|
|
||||||
### 🔥 商城介绍
|
### 商城介绍
|
||||||
**官网**:https://pickmall.cn
|
**官网**:https://pickmall.cn
|
||||||
|
|
||||||
Lilishop商城系统支持商家入驻,后端基于SpringBoot 研发,前端使用 Vue、uniapp开发, **系统全端全部代码开源**
|
Lilishop商城系统支持商家入驻,后端基于SpringBoot 研发,前端使用 Vue、uniapp开发, **系统全端全部代码开源**
|
||||||
|
|
||||||
商城前后端分离,支持分布式部署,各个API独立,并且有独立的消费者。
|
商城前后端分离,支持分布式部署,支持Docker,各个API独立,并且有独立的消费者。
|
||||||
|
|
||||||
商城包含 会员模块、**第三方登录模块**、**第三方支付模块**、**楼层装修模块**、订单模块、商品模块、促销模块、分销模块、文章模块、系统设置模块、流量分析模块和平台运营模块
|
|
||||||
|
|
||||||
商城包含各种中间件、搜索引擎、多级缓存、分布式事务、分布式任务调度等,支持Docker,支持k8s。是一款高性能、支持分布式、支持扩展的商城系统。
|
|
||||||
|
|
||||||
### 商城 API/消费者 聚合版
|
### 商城 API/消费者 聚合版
|
||||||
api不需要单独部署,只需启动一个jar包就可以正常运转 如有需要,可以点击跳转
|
api不需要单独部署,只需启动一个jar包就可以正常运转 如有需要,可以点击跳转
|
||||||
https://gitee.com/beijing_hongye_huicheng/lilishop-simplify
|
https://gitee.com/beijing_hongye_huicheng/lilishop-simplify
|
||||||
|
|
||||||
### ☃️ 商城 开发/使用/常见问题 帮助文档
|
### 商城 开发/使用/常见问题 帮助文档
|
||||||
|
|
||||||
https://docs.pickmall.cn
|
https://docs.pickmall.cn
|
||||||
|
|
||||||
### 💧 开源商城项目地址(gitee)
|
### 项目地址
|
||||||
|
|
||||||
**API(商城所有API)**:https://gitee.com/beijing_hongye_huicheng/lilishop.git
|
gitee : https://gitee.com/beijing_hongye_huicheng
|
||||||
|
|
||||||
**UI(平台管理端/商家端/买家PC端)**: https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
|
github 镜像: https://github.com/lilishop?tab=repositories
|
||||||
|
|
||||||
**uniapp(商城移动端,支持小程序/APP/H5)**:https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
|
商城UI 项目下3个文件夹
|
||||||
|
buyer:买家PC端,seller:商家端,manager:后台管理端
|
||||||
**docker一键部署(商城部署脚本)**:https://gitee.com/beijing_hongye_huicheng/docker.git
|
|
||||||
|
|
||||||
### 💧 开源商城项目地址(github)
|
|
||||||
|
|
||||||
**API(商城所有API)**:https://github.com/hongyehuicheng/lilishop.git
|
|
||||||
|
|
||||||
**UI(平台管理端/商家端/买家PC端)**: https://github.com/hongyehuicheng/lilishop-ui.git
|
|
||||||
|
|
||||||
**uniapp(商城移动端,支持小程序/APP/H5)**:https://github.com/hongyehuicheng/lilishop-uniapp.git
|
|
||||||
|
|
||||||
**docker一键部署(商城部署脚本)**:https://github.com/hongyehuicheng/docker.git
|
|
||||||
|
|
||||||
|
|
||||||
|
### 演示地址
|
||||||
☃️ UI 项目下3个文件夹 buyer:买家PC端,seller:商家端,manager:后台管理端
|
PS:手机验证码为 ‘111111’
|
||||||
|
|
||||||
|
|
||||||
### 💧 演示地址(手机验证码为 ‘111111’)
|
|
||||||
|
|
||||||
**平台管理端**:https://admin-b2b2c.pickmall.cn 账号:admin/123456
|
**平台管理端**:https://admin-b2b2c.pickmall.cn 账号:admin/123456
|
||||||
|
|
||||||
@@ -72,88 +57,54 @@ https://docs.pickmall.cn
|
|||||||
|
|
||||||
**商城PC页面**:https://pc-b2b2c.pickmall.cn
|
**商城PC页面**:https://pc-b2b2c.pickmall.cn
|
||||||
|
|
||||||
**商城移动端(请使浏览器手机模式,或者用手机浏览器打开)**:https://m-b2b2c.pickmall.cn
|
**商城 小程序/公众号/APP**:扫描二维码
|
||||||
|
|
||||||
**商城 小程序/公众号/APP(支持ios、android)**:扫描二维码
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 🚙 3行命令搭建本地商城(注:只能本机访问,前端镜像固定访问 127.0.0.1,如果是非本机体验,请自行下载源码操作镜像)
|
### 快速部署本地商城
|
||||||
|
|
||||||
温馨提示:由于服务中间件较多,如果笔记本环境启动内存没有32g可能无法启动成功(macbookpro 2020 16g内存启动无法成功),台式机在16g内存、AMD 3700x 的ubuntu系统成功运行。
|
[点击跳转](https://docs.pickmall.cn/deploy/%E8%BF%90%E8%A1%8C%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87.html)
|
||||||
|
|
||||||
##### docker环境安装 [点击跳转](https://docs.pickmall.cn/deploy/%E8%BF%90%E8%A1%8C%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87.html)
|
**商城数据库**
|
||||||
|
使用docker-compose部署数据库,自动初始化数据库,不需要手动下载等操作
|
||||||
|
|
||||||
##### 下载docker-compose脚本
|
如果手动部署,才需要获取sql [点击跳转](https://gitee.com/beijing_hongye_huicheng/docker/tree/master/init/mysql) (PS:这里有与tag版本一致的sql,如果是历史版本,则docker项目也切换至历史版本获取sql即可,历史版本升级则根据java相聚的根目录DB目录下的升级sql,按需执行)。
|
||||||
`git clone https://gitee.com/beijing_hongye_huicheng/docker.git `
|
|
||||||
|
|
||||||
##### 部署商城所需中间件
|
|
||||||
`docker-compose up -d`
|
|
||||||
|
|
||||||
##### 部署商城应用
|
|
||||||
`docker-compose -f docker-compose-application.yml up -d`
|
|
||||||
|
|
||||||
PS:商城数据库非docker部署
|
|
||||||
https://gitee.com/beijing_hongye_huicheng/docker/tree/master/init/mysql
|
|
||||||
|
|
||||||
这里有与tag版本一致的sql,根据tag获取sql,如果使用master代码
|
|
||||||
|
|
||||||
##### 商城 API/UI 地址
|
|
||||||
|
|
||||||
| API | 地址 |
|
|
||||||
| -------------- | --------------- |
|
|
||||||
| 买家API | http://127.0.0.1:8888 |
|
|
||||||
| 商家API | http://127.0.0.1:8889 |
|
|
||||||
| 管理端API | http://127.0.0.1:8887 |
|
|
||||||
| 通用API | http://127.0.0.1:8890 |
|
|
||||||
|
|
||||||
| 前端演示 | 地址 |
|
|
||||||
| -------------- | --------------- |
|
|
||||||
| 商城PC端 | http://127.0.0.1:10000 |
|
|
||||||
| 商城H5端 | http://127.0.0.1:10001 |
|
|
||||||
| 卖家端 | http://127.0.0.1:10002 |
|
|
||||||
| 平台管理端 | http://127.0.0.1:10003 |
|
|
||||||
|
|
||||||
其他小程序/app等需自行打包。
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### ⚾️ 功能列表
|
### 功能列表
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### 🥎 平台管理端功能
|
#### 平台管理端功能
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### 🥎 卖家功能
|
#### 卖家功能
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
### 商城前端功能展示
|
||||||
|
|
||||||
|
#### 商城移动端
|
||||||
|
|
||||||
### 🧩 商城前端功能展示
|
|
||||||
|
|
||||||
#### ⚽️ 商城移动端
|
|
||||||
|
|
||||||
<img src="https://pickmall.cn/assets/imgs/other/app.gif" alt="移动端功能展示" style="zoom:50%;" />
|
<img src="https://pickmall.cn/assets/imgs/other/app.gif" alt="移动端功能展示" style="zoom:50%;" />
|
||||||
|
|
||||||
#### ⚽️ 平台管理端
|
#### 平台管理端
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
### 技术选型
|
### 技术选型
|
||||||
|
|
||||||
#### 🥅 架构图
|
#### 架构图
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
##### 🕹 后台技术选型
|
##### 后台技术选型
|
||||||
|
|
||||||
| 说明 | 框架 | 说明 | |
|
| 说明 | 框架 | 说明 | |
|
||||||
| -------------- | --------------- | -------------- | ------------- |
|
| -------------- | --------------- | -------------- | ------------- |
|
||||||
@@ -167,7 +118,7 @@ https://gitee.com/beijing_hongye_huicheng/docker/tree/master/init/mysql
|
|||||||
| 短信 | 阿里云短信 | 认证 | JWT |
|
| 短信 | 阿里云短信 | 认证 | JWT |
|
||||||
| 日志处理 | Log4j | 接口规范 | RESTful |
|
| 日志处理 | Log4j | 接口规范 | RESTful |
|
||||||
|
|
||||||
##### 🖥 前端-运营后台、店铺后台
|
##### 前端-运营后台、店铺后台
|
||||||
|
|
||||||
| 说明 | 框架 | 说明 | 框架 |
|
| 说明 | 框架 | 说明 | 框架 |
|
||||||
| ---------- | ---------- | ---------- | ------- |
|
| ---------- | ---------- | ---------- | ------- |
|
||||||
@@ -177,14 +128,14 @@ https://gitee.com/beijing_hongye_huicheng/docker/tree/master/init/mysql
|
|||||||
| 基础UI库 | iView | UI界面基于 | iView |
|
| 基础UI库 | iView | UI界面基于 | iView |
|
||||||
| 网络请求 | axios | | |
|
| 网络请求 | axios | | |
|
||||||
|
|
||||||
##### 📱前端-移动端
|
##### 前端-移动端
|
||||||
|
|
||||||
| 说明 | 架构 | 说明 | 架构 |
|
| 说明 | 架构 | 说明 | 架构 |
|
||||||
| --------- | ------- | -------- | ------- |
|
| --------- | ------- | -------- | ------- |
|
||||||
| 基础UI库 | uViewui | 基础框架 | uni-app |
|
| 基础UI库 | uViewui | 基础框架 | uni-app |
|
||||||
| CSS预处理 | scss | 地图引擎 | amap |
|
| CSS预处理 | scss | 地图引擎 | amap |
|
||||||
|
|
||||||
### 🌟 版本升级
|
### 版本升级
|
||||||
|
|
||||||
```
|
```
|
||||||
商城后续会持续版本升级,修复bug,完善功能,覆盖更多业务场景 o2o/b2b/s2b2b2c/跨境电商
|
商城后续会持续版本升级,修复bug,完善功能,覆盖更多业务场景 o2o/b2b/s2b2b2c/跨境电商
|
||||||
@@ -193,7 +144,7 @@ https://gitee.com/beijing_hongye_huicheng/docker/tree/master/init/mysql
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### ⚠️ 开源须知
|
### 开源须知
|
||||||
1.仅允许用于个人学习研究使用.
|
1.仅允许用于个人学习研究使用.
|
||||||
|
|
||||||
2.禁止将本开源的代码和资源进行任何形式任何名义的出售.
|
2.禁止将本开源的代码和资源进行任何形式任何名义的出售.
|
||||||
@@ -203,7 +154,7 @@ https://gitee.com/beijing_hongye_huicheng/docker/tree/master/init/mysql
|
|||||||
4.限制商用,如果需要商业使用请联系我们。QQ3409056806.
|
4.限制商用,如果需要商业使用请联系我们。QQ3409056806.
|
||||||
|
|
||||||
|
|
||||||
### 🐧 交流群
|
### 交流群
|
||||||
|
|
||||||
##### 官方qq 1群 961316482(已满)
|
##### 官方qq 1群 961316482(已满)
|
||||||
##### 官方qq 2群 875294241
|
##### 官方qq 2群 875294241
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package cn.lili.controller.other.distribution;
|
package cn.lili.controller.distribution;
|
||||||
|
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
@@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,分销员接口")
|
@Api(tags = "买家端,分销员接口")
|
||||||
@RequestMapping("/buyer/distribution")
|
@RequestMapping("/buyer/distribution/distribution")
|
||||||
public class DistributionBuyerController {
|
public class DistributionBuyerController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package cn.lili.controller.other.distribution;
|
package cn.lili.controller.distribution;
|
||||||
|
|
||||||
|
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
|
||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.exception.ServiceException;
|
import cn.lili.common.exception.ServiceException;
|
||||||
@@ -13,6 +14,7 @@ import io.swagger.annotations.ApiImplicitParam;
|
|||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@@ -33,6 +35,7 @@ import javax.validation.constraints.NotNull;
|
|||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,分销商品佣金提现接口")
|
@Api(tags = "买家端,分销商品佣金提现接口")
|
||||||
@RequestMapping("/buyer/distribution/cash")
|
@RequestMapping("/buyer/distribution/cash")
|
||||||
|
@Validated
|
||||||
public class DistributionCashBuyerController {
|
public class DistributionCashBuyerController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -47,15 +50,16 @@ public class DistributionCashBuyerController {
|
|||||||
private DistributionCashService distributorCashService;
|
private DistributionCashService distributorCashService;
|
||||||
|
|
||||||
|
|
||||||
|
@PreventDuplicateSubmissions
|
||||||
@ApiOperation(value = "分销员提现")
|
@ApiOperation(value = "分销员提现")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "price", value = "申请金额", required = true, paramType = "query", dataType = "double")
|
@ApiImplicitParam(name = "price", value = "申请金额", required = true, paramType = "query", dataType = "double")
|
||||||
})
|
})
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public ResultMessage<Object> cash(@Max(value = 1000, message = "提现金额单次最多允许提现1000元")
|
public ResultMessage<Object> cash(@Validated @Max(value = 9999, message = "提现金额单次最多允许提现9999元")
|
||||||
@Min(value = 1, message = "提现金额单次最少提现金额为1元")
|
@Min(value = 1, message = "提现金额单次最少提现金额为1元")
|
||||||
@NotNull @ApiIgnore Double price) {
|
@NotNull @ApiIgnore Double price) {
|
||||||
if (distributionCashService.cash(price)) {
|
if (Boolean.TRUE.equals(distributionCashService.cash(price))) {
|
||||||
return ResultUtil.success();
|
return ResultUtil.success();
|
||||||
}
|
}
|
||||||
throw new ServiceException(ResultCode.ERROR);
|
throw new ServiceException(ResultCode.ERROR);
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package cn.lili.controller.other.distribution;
|
package cn.lili.controller.distribution;
|
||||||
|
|
||||||
|
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
|
||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.exception.ServiceException;
|
import cn.lili.common.exception.ServiceException;
|
||||||
@@ -29,7 +30,7 @@ import javax.validation.constraints.NotNull;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,分销商品接口")
|
@Api(tags = "买家端,分销商品接口")
|
||||||
@RequestMapping("/buyer/distributionGoods")
|
@RequestMapping("/buyer/distribution/goods")
|
||||||
public class DistributionGoodsBuyerController {
|
public class DistributionGoodsBuyerController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,6 +51,7 @@ public class DistributionGoodsBuyerController {
|
|||||||
return ResultUtil.data(distributionGoodsService.goodsPage(distributionGoodsSearchParams));
|
return ResultUtil.data(distributionGoodsService.goodsPage(distributionGoodsSearchParams));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreventDuplicateSubmissions
|
||||||
@ApiOperation(value = "选择分销商品")
|
@ApiOperation(value = "选择分销商品")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "distributionGoodsId", value = "分销ID", required = true, dataType = "String", paramType = "path"),
|
@ApiImplicitParam(name = "distributionGoodsId", value = "分销ID", required = true, dataType = "String", paramType = "path"),
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package cn.lili.controller.other.distribution;
|
package cn.lili.controller.distribution;
|
||||||
|
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
@@ -25,7 +25,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,商品分类接口")
|
@Api(tags = "买家端,商品分类接口")
|
||||||
@RequestMapping("/buyer/category")
|
@RequestMapping("/buyer/goods/category")
|
||||||
public class CategoryBuyerController {
|
public class CategoryBuyerController {
|
||||||
/**
|
/**
|
||||||
* 商品分类
|
* 商品分类
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ import java.util.Map;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@Api(tags = "买家端,商品接口")
|
@Api(tags = "买家端,商品接口")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/buyer/goods")
|
@RequestMapping("/buyer/goods/goods")
|
||||||
public class GoodsBuyerController {
|
public class GoodsBuyerController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,浏览历史接口")
|
@Api(tags = "买家端,浏览历史接口")
|
||||||
@RequestMapping("/buyer/footprint")
|
@RequestMapping("/buyer/member/footprint")
|
||||||
public class FootprintController {
|
public class FootprintController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
package cn.lili.controller.member;
|
package cn.lili.controller.member;
|
||||||
|
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
|
import cn.lili.common.security.OperationalJudgment;
|
||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.member.entity.dos.MemberAddress;
|
import cn.lili.modules.member.entity.dos.MemberAddress;
|
||||||
import cn.lili.modules.member.service.MemberAddressService;
|
import cn.lili.modules.member.service.MemberAddressService;
|
||||||
import cn.lili.modules.system.utils.OperationalJudgment;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
@@ -26,7 +26,7 @@ import java.util.Objects;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,会员地址接口")
|
@Api(tags = "买家端,会员地址接口")
|
||||||
@RequestMapping("/buyer/memberAddress")
|
@RequestMapping("/buyer/member/address")
|
||||||
public class MemberAddressBuyerController {
|
public class MemberAddressBuyerController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package cn.lili.controller.member;
|
package cn.lili.controller.member;
|
||||||
|
|
||||||
|
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.enums.SwitchEnum;
|
import cn.lili.common.enums.SwitchEnum;
|
||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
@@ -28,7 +29,7 @@ import javax.validation.constraints.NotNull;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,会员商品评价接口")
|
@Api(tags = "买家端,会员商品评价接口")
|
||||||
@RequestMapping("/buyer/memberEvaluation")
|
@RequestMapping("/buyer/member/evaluation")
|
||||||
public class MemberEvaluationBuyerController {
|
public class MemberEvaluationBuyerController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,10 +38,11 @@ public class MemberEvaluationBuyerController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private MemberEvaluationService memberEvaluationService;
|
private MemberEvaluationService memberEvaluationService;
|
||||||
|
|
||||||
|
@PreventDuplicateSubmissions
|
||||||
@ApiOperation(value = "添加会员评价")
|
@ApiOperation(value = "添加会员评价")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public ResultMessage<MemberEvaluationDTO> save(@Valid MemberEvaluationDTO memberEvaluationDTO) {
|
public ResultMessage<MemberEvaluationDTO> save(@Valid MemberEvaluationDTO memberEvaluationDTO) {
|
||||||
return ResultUtil.data(memberEvaluationService.addMemberEvaluation(memberEvaluationDTO));
|
return ResultUtil.data(memberEvaluationService.addMemberEvaluation(memberEvaluationDTO, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查看会员评价详情")
|
@ApiOperation(value = "查看会员评价详情")
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package cn.lili.controller.member;
|
package cn.lili.controller.member;
|
||||||
|
|
||||||
|
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.member.entity.dos.MemberSign;
|
import cn.lili.modules.member.entity.dos.MemberSign;
|
||||||
@@ -27,6 +28,8 @@ public class MemberSignBuyerController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private MemberSignService memberSignService;
|
private MemberSignService memberSignService;
|
||||||
|
|
||||||
|
|
||||||
|
@PreventDuplicateSubmissions
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@ApiOperation(value = "会员签到")
|
@ApiOperation(value = "会员签到")
|
||||||
public ResultMessage<Boolean> memberSign() {
|
public ResultMessage<Boolean> memberSign() {
|
||||||
|
|||||||
@@ -1,57 +0,0 @@
|
|||||||
package cn.lili.controller.member;
|
|
||||||
|
|
||||||
import cn.lili.common.enums.ResultUtil;
|
|
||||||
import cn.lili.common.vo.PageVO;
|
|
||||||
import cn.lili.common.vo.ResultMessage;
|
|
||||||
import cn.lili.modules.system.entity.dos.ServiceNotice;
|
|
||||||
import cn.lili.modules.system.service.ServiceNoticeService;
|
|
||||||
import cn.lili.mybatis.util.PageUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 买家端,会员站服务消息接口
|
|
||||||
*
|
|
||||||
* @author Chopper
|
|
||||||
* @since 2020/11/17 2:31 下午
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/service/notice")
|
|
||||||
@Api(tags = "买家端,会员站服务消息接口")
|
|
||||||
public class ServiceNoticeBuyerController {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 服务消息
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
private ServiceNoticeService serviceNoticeService;
|
|
||||||
|
|
||||||
@ApiOperation(value = "获取消息详情")
|
|
||||||
@ApiImplicitParam(name = "id", value = "商品ID", required = true, dataType = "Long", paramType = "path")
|
|
||||||
@GetMapping(value = "/{id}")
|
|
||||||
public ResultMessage<ServiceNotice> get(@PathVariable String id) {
|
|
||||||
ServiceNotice serviceNotice = serviceNoticeService.getById(id);
|
|
||||||
return ResultUtil.data(serviceNotice);
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation(value = "分页获取服务消息")
|
|
||||||
@GetMapping
|
|
||||||
@ApiImplicitParam(name = "storeId", value = "商家id,默认为-1,代表平台消息,如果查询某商家发布的消息,传递商家id即可", dataType = "int", paramType = "query")
|
|
||||||
public ResultMessage<IPage<ServiceNotice>> getByPage(PageVO page, String storeId) {
|
|
||||||
ServiceNotice serviceNotice = new ServiceNotice();
|
|
||||||
if (storeId == null) {
|
|
||||||
storeId = "-1";
|
|
||||||
}
|
|
||||||
serviceNotice.setStoreId(storeId);
|
|
||||||
IPage<ServiceNotice> data = serviceNoticeService.page(PageUtil.initPage(page));
|
|
||||||
return ResultUtil.data(data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package cn.lili.controller.member;
|
package cn.lili.controller.message;
|
||||||
|
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
@@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,会员站内消息接口")
|
@Api(tags = "买家端,会员站内消息接口")
|
||||||
@RequestMapping("/buyer/member/message")
|
@RequestMapping("/buyer/message/member")
|
||||||
public class MemberMessageBuyerController {
|
public class MemberMessageBuyerController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1,19 +1,20 @@
|
|||||||
package cn.lili.controller.trade;
|
package cn.lili.controller.order;
|
||||||
|
|
||||||
|
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
|
import cn.lili.common.security.OperationalJudgment;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.order.order.entity.dos.AfterSale;
|
import cn.lili.modules.order.aftersale.entity.dos.AfterSale;
|
||||||
import cn.lili.modules.order.order.entity.dos.AfterSaleReason;
|
import cn.lili.modules.order.aftersale.entity.dos.AfterSaleLog;
|
||||||
import cn.lili.modules.order.order.entity.dto.AfterSaleDTO;
|
import cn.lili.modules.order.aftersale.entity.dos.AfterSaleReason;
|
||||||
import cn.lili.modules.order.order.entity.vo.AfterSaleApplyVO;
|
import cn.lili.modules.order.aftersale.entity.dto.AfterSaleDTO;
|
||||||
import cn.lili.modules.order.order.entity.vo.AfterSaleSearchParams;
|
import cn.lili.modules.order.aftersale.entity.vo.AfterSaleApplyVO;
|
||||||
import cn.lili.modules.order.order.entity.vo.AfterSaleVO;
|
import cn.lili.modules.order.aftersale.entity.vo.AfterSaleSearchParams;
|
||||||
import cn.lili.modules.order.order.service.AfterSaleLogService;
|
import cn.lili.modules.order.aftersale.entity.vo.AfterSaleVO;
|
||||||
import cn.lili.modules.order.order.service.AfterSaleReasonService;
|
import cn.lili.modules.order.aftersale.service.AfterSaleLogService;
|
||||||
import cn.lili.modules.order.order.service.AfterSaleService;
|
import cn.lili.modules.order.aftersale.service.AfterSaleReasonService;
|
||||||
import cn.lili.modules.order.trade.entity.dos.AfterSaleLog;
|
import cn.lili.modules.order.aftersale.service.AfterSaleService;
|
||||||
import cn.lili.modules.store.entity.dto.StoreAfterSaleAddressDTO;
|
import cn.lili.modules.store.entity.dto.StoreAfterSaleAddressDTO;
|
||||||
import cn.lili.modules.system.utils.OperationalJudgment;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
@@ -35,7 +36,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,售后管理接口")
|
@Api(tags = "买家端,售后管理接口")
|
||||||
@RequestMapping("/buyer/afterSale")
|
@RequestMapping("/buyer/order/afterSale")
|
||||||
public class AfterSaleBuyerController {
|
public class AfterSaleBuyerController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -77,6 +78,7 @@ public class AfterSaleBuyerController {
|
|||||||
return ResultUtil.data(afterSaleService.getAfterSaleVO(sn));
|
return ResultUtil.data(afterSaleService.getAfterSaleVO(sn));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreventDuplicateSubmissions
|
||||||
@PostMapping(value = "/save/{orderItemSn}")
|
@PostMapping(value = "/save/{orderItemSn}")
|
||||||
@ApiImplicitParam(name = "orderItemSn", value = "订单货物编号", required = true, paramType = "query")
|
@ApiImplicitParam(name = "orderItemSn", value = "订单货物编号", required = true, paramType = "query")
|
||||||
@ApiOperation(value = "申请售后")
|
@ApiOperation(value = "申请售后")
|
||||||
@@ -101,6 +103,7 @@ public class AfterSaleBuyerController {
|
|||||||
return ResultUtil.data(afterSaleService.buyerDelivery(afterSaleSn, logisticsNo, logisticsId, mDeliverTime));
|
return ResultUtil.data(afterSaleService.buyerDelivery(afterSaleSn, logisticsNo, logisticsId, mDeliverTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreventDuplicateSubmissions
|
||||||
@ApiOperation(value = "售后,取消售后")
|
@ApiOperation(value = "售后,取消售后")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "afterSaleSn", value = "售后sn", required = true, dataType = "String", paramType = "path")
|
@ApiImplicitParam(name = "afterSaleSn", value = "售后sn", required = true, dataType = "String", paramType = "path")
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
package cn.lili.controller.trade;
|
package cn.lili.controller.order;
|
||||||
|
|
||||||
|
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
|
||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
import cn.lili.common.exception.ServiceException;
|
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
|
import cn.lili.common.exception.ServiceException;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
||||||
import cn.lili.modules.order.cart.entity.enums.CartTypeEnum;
|
import cn.lili.modules.order.cart.entity.enums.CartTypeEnum;
|
||||||
@@ -235,6 +236,7 @@ public class CartController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PreventDuplicateSubmissions
|
||||||
@ApiOperation(value = "创建交易")
|
@ApiOperation(value = "创建交易")
|
||||||
@PostMapping(value = "/create/trade", consumes = "application/json", produces = "application/json")
|
@PostMapping(value = "/create/trade", consumes = "application/json", produces = "application/json")
|
||||||
public ResultMessage<Object> crateTrade(@RequestBody TradeParams tradeParams) {
|
public ResultMessage<Object> crateTrade(@RequestBody TradeParams tradeParams) {
|
||||||
@@ -246,7 +248,7 @@ public class CartController {
|
|||||||
throw se;
|
throw se;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(ResultCode.ORDER_ERROR.message(), e);
|
log.error(ResultCode.ORDER_ERROR.message(), e);
|
||||||
throw new ServiceException(ResultCode.ORDER_ERROR);
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
package cn.lili.controller.trade;
|
package cn.lili.controller.order;
|
||||||
|
|
||||||
|
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
|
||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.exception.ServiceException;
|
import cn.lili.common.exception.ServiceException;
|
||||||
import cn.lili.common.security.AuthUser;
|
import cn.lili.common.security.AuthUser;
|
||||||
|
import cn.lili.common.security.OperationalJudgment;
|
||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.order.order.entity.dos.Order;
|
import cn.lili.modules.order.order.entity.dos.Order;
|
||||||
@@ -12,7 +14,6 @@ import cn.lili.modules.order.order.entity.enums.OrderStatusEnum;
|
|||||||
import cn.lili.modules.order.order.entity.vo.OrderDetailVO;
|
import cn.lili.modules.order.order.entity.vo.OrderDetailVO;
|
||||||
import cn.lili.modules.order.order.entity.vo.OrderSimpleVO;
|
import cn.lili.modules.order.order.entity.vo.OrderSimpleVO;
|
||||||
import cn.lili.modules.order.order.service.OrderService;
|
import cn.lili.modules.order.order.service.OrderService;
|
||||||
import cn.lili.modules.system.utils.OperationalJudgment;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
@@ -34,7 +35,7 @@ import java.util.Objects;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,订单接口")
|
@Api(tags = "买家端,订单接口")
|
||||||
@RequestMapping("/buyer/orders")
|
@RequestMapping("/buyer/order/order")
|
||||||
public class OrderBuyerController {
|
public class OrderBuyerController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -62,6 +63,7 @@ public class OrderBuyerController {
|
|||||||
return ResultUtil.data(orderDetailVO);
|
return ResultUtil.data(orderDetailVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreventDuplicateSubmissions
|
||||||
@ApiOperation(value = "确认收货")
|
@ApiOperation(value = "确认收货")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "orderSn", value = "订单编号", required = true, paramType = "path")
|
@ApiImplicitParam(name = "orderSn", value = "订单编号", required = true, paramType = "path")
|
||||||
@@ -80,6 +82,7 @@ public class OrderBuyerController {
|
|||||||
return ResultUtil.success();
|
return ResultUtil.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreventDuplicateSubmissions
|
||||||
@ApiOperation(value = "取消订单")
|
@ApiOperation(value = "取消订单")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "orderSn", value = "订单编号", required = true, dataType = "String", paramType = "path"),
|
@ApiImplicitParam(name = "orderSn", value = "订单编号", required = true, dataType = "String", paramType = "path"),
|
||||||
@@ -91,6 +94,7 @@ public class OrderBuyerController {
|
|||||||
return ResultUtil.success();
|
return ResultUtil.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreventDuplicateSubmissions
|
||||||
@ApiOperation(value = "删除订单")
|
@ApiOperation(value = "删除订单")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "orderSn", value = "订单编号", required = true, dataType = "String", paramType = "path")
|
@ApiImplicitParam(name = "orderSn", value = "订单编号", required = true, dataType = "String", paramType = "path")
|
||||||
@@ -113,6 +117,7 @@ public class OrderBuyerController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PreventDuplicateSubmissions
|
||||||
@ApiOperation(value = "开票")
|
@ApiOperation(value = "开票")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "orderSn", value = "订单编号", required = true, dataType = "String", paramType = "path")
|
@ApiImplicitParam(name = "orderSn", value = "订单编号", required = true, dataType = "String", paramType = "path")
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
package cn.lili.controller.trade;
|
package cn.lili.controller.order;
|
||||||
|
|
||||||
|
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.security.AuthUser;
|
import cn.lili.common.security.AuthUser;
|
||||||
|
import cn.lili.common.security.OperationalJudgment;
|
||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
@@ -13,7 +15,6 @@ import cn.lili.modules.order.order.entity.vo.OrderComplaintSearchParams;
|
|||||||
import cn.lili.modules.order.order.entity.vo.OrderComplaintVO;
|
import cn.lili.modules.order.order.entity.vo.OrderComplaintVO;
|
||||||
import cn.lili.modules.order.order.service.OrderComplaintCommunicationService;
|
import cn.lili.modules.order.order.service.OrderComplaintCommunicationService;
|
||||||
import cn.lili.modules.order.order.service.OrderComplaintService;
|
import cn.lili.modules.order.order.service.OrderComplaintService;
|
||||||
import cn.lili.modules.system.utils.OperationalJudgment;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
@@ -33,7 +34,7 @@ import java.util.Objects;
|
|||||||
**/
|
**/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,交易投诉接口")
|
@Api(tags = "买家端,交易投诉接口")
|
||||||
@RequestMapping("/buyer/complain")
|
@RequestMapping("/buyer/order/complain")
|
||||||
public class OrderComplaintBuyerController {
|
public class OrderComplaintBuyerController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -66,6 +67,7 @@ public class OrderComplaintBuyerController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreventDuplicateSubmissions
|
||||||
@ApiOperation(value = "添加交易投诉")
|
@ApiOperation(value = "添加交易投诉")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public ResultMessage<OrderComplaint> add(@Valid OrderComplaintDTO orderComplaintDTO) {
|
public ResultMessage<OrderComplaint> add(@Valid OrderComplaintDTO orderComplaintDTO) {
|
||||||
@@ -85,6 +87,7 @@ public class OrderComplaintBuyerController {
|
|||||||
return ResultUtil.data(communicationVO);
|
return ResultUtil.data(communicationVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreventDuplicateSubmissions
|
||||||
@ApiOperation(value = "取消售后")
|
@ApiOperation(value = "取消售后")
|
||||||
@ApiImplicitParam(name = "id", value = "投诉单ID", required = true, paramType = "path")
|
@ApiImplicitParam(name = "id", value = "投诉单ID", required = true, paramType = "path")
|
||||||
@PutMapping(value = "/status/{id}")
|
@PutMapping(value = "/status/{id}")
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package cn.lili.controller.trade;
|
package cn.lili.controller.order;
|
||||||
|
|
||||||
|
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
@@ -41,6 +42,7 @@ public class ReceiptBuyerController {
|
|||||||
return ResultUtil.data(this.receiptService.getReceiptData(searchParams, pageVO));
|
return ResultUtil.data(this.receiptService.getReceiptData(searchParams, pageVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreventDuplicateSubmissions
|
||||||
@ApiOperation(value = "保存发票信息")
|
@ApiOperation(value = "保存发票信息")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public ResultMessage<Receipt> save(@Valid Receipt receipt) {
|
public ResultMessage<Receipt> save(@Valid Receipt receipt) {
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
package cn.lili.controller.trade;
|
package cn.lili.controller.order;
|
||||||
|
|
||||||
|
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.order.trade.entity.dos.Recharge;
|
import cn.lili.modules.wallet.entity.dos.Recharge;
|
||||||
import cn.lili.modules.order.trade.service.RechargeService;
|
import cn.lili.modules.wallet.service.RechargeService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@@ -26,12 +26,12 @@ import javax.validation.constraints.Min;
|
|||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,预存款充值记录接口")
|
@Api(tags = "买家端,预存款充值记录接口")
|
||||||
@RequestMapping("/buyer/trade/recharge")
|
@RequestMapping("/buyer/trade/recharge")
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public class RechargeTradeBuyerController {
|
public class RechargeTradeBuyerController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RechargeService rechargeService;
|
private RechargeService rechargeService;
|
||||||
|
|
||||||
|
@PreventDuplicateSubmissions
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@ApiOperation(value = "创建余额充值订单")
|
@ApiOperation(value = "创建余额充值订单")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@@ -25,7 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,APP版本")
|
@Api(tags = "买家端,APP版本")
|
||||||
@RequestMapping("/buyer/appVersion")
|
@RequestMapping("/buyer/other/appVersion")
|
||||||
public class AppVersionBuyerController {
|
public class AppVersionBuyerController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,文章接口")
|
@Api(tags = "买家端,文章接口")
|
||||||
@RequestMapping("/buyer/article")
|
@RequestMapping("/buyer/other/article")
|
||||||
public class ArticleBuyerController {
|
public class ArticleBuyerController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package cn.lili.controller.other;
|
package cn.lili.controller.other;
|
||||||
|
|
||||||
|
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
@@ -22,7 +23,7 @@ import javax.validation.Valid;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,意见反馈接口")
|
@Api(tags = "买家端,意见反馈接口")
|
||||||
@RequestMapping("/buyer/feedback")
|
@RequestMapping("/buyer/other/feedback")
|
||||||
public class FeedbackBuyerController {
|
public class FeedbackBuyerController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,6 +32,7 @@ public class FeedbackBuyerController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private FeedbackService feedbackService;
|
private FeedbackService feedbackService;
|
||||||
|
|
||||||
|
@PreventDuplicateSubmissions
|
||||||
@ApiOperation(value = "添加意见反馈")
|
@ApiOperation(value = "添加意见反馈")
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
public ResultMessage<Object> save(@Valid Feedback feedback) {
|
public ResultMessage<Object> save(@Valid Feedback feedback) {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,物流公司接口")
|
@Api(tags = "买家端,物流公司接口")
|
||||||
@RequestMapping("/buyer/logistics")
|
@RequestMapping("/buyer/other/logistics")
|
||||||
public class LogisticsBuyerController {
|
public class LogisticsBuyerController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,页面接口")
|
@Api(tags = "买家端,页面接口")
|
||||||
@RequestMapping("/buyer/pageData")
|
@RequestMapping("/buyer/other/pageData")
|
||||||
public class PageBuyerController {
|
public class PageBuyerController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package cn.lili.controller.other.purchase;
|
package cn.lili.controller.other.purchase;
|
||||||
|
|
||||||
|
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
|
||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
@@ -29,7 +30,7 @@ import javax.validation.constraints.NotNull;
|
|||||||
*/
|
*/
|
||||||
@Api(tags = "买家端,采购接口")
|
@Api(tags = "买家端,采购接口")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/buyer/purchase")
|
@RequestMapping("/buyer/other/purchase/purchase")
|
||||||
public class PurchaseBuyerController {
|
public class PurchaseBuyerController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -48,6 +49,8 @@ public class PurchaseBuyerController {
|
|||||||
return ResultUtil.data(goodsUnitService.page(PageUtil.initPage(pageVO)));
|
return ResultUtil.data(goodsUnitService.page(PageUtil.initPage(pageVO)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PreventDuplicateSubmissions
|
||||||
@ApiOperation(value = "添加采购单")
|
@ApiOperation(value = "添加采购单")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public ResultMessage<PurchaseOrderVO> addPurchaseOrderVO(@RequestBody PurchaseOrderVO purchaseOrderVO) {
|
public ResultMessage<PurchaseOrderVO> addPurchaseOrderVO(@RequestBody PurchaseOrderVO purchaseOrderVO) {
|
||||||
@@ -74,6 +77,7 @@ public class PurchaseBuyerController {
|
|||||||
return ResultUtil.data(purchaseOrderService.page(purchaseOrderSearchParams));
|
return ResultUtil.data(purchaseOrderService.page(purchaseOrderSearchParams));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreventDuplicateSubmissions
|
||||||
@ApiOperation(value = "关闭采购单")
|
@ApiOperation(value = "关闭采购单")
|
||||||
@ApiImplicitParam(name = "id", value = "采购单ID", required = true, dataType = "Long", paramType = "path")
|
@ApiImplicitParam(name = "id", value = "采购单ID", required = true, dataType = "Long", paramType = "path")
|
||||||
@PutMapping("/{id}")
|
@PutMapping("/{id}")
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Api(tags = "买家端,采购报价接口")
|
@Api(tags = "买家端,采购报价接口")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/buyer/purchaseQuoted")
|
@RequestMapping("/buyer/other/purchase/purchaseQuoted")
|
||||||
public class PurchaseQuotedController {
|
public class PurchaseQuotedController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
package cn.lili.controller.passport;
|
package cn.lili.controller.passport;
|
||||||
|
|
||||||
|
import cn.lili.common.enums.ResultCode;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
|
import cn.lili.common.exception.ServiceException;
|
||||||
import cn.lili.common.security.enums.UserEnums;
|
import cn.lili.common.security.enums.UserEnums;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.member.entity.dos.Member;
|
import cn.lili.modules.member.entity.dos.Member;
|
||||||
import cn.lili.modules.member.entity.dto.MemberEditDTO;
|
import cn.lili.modules.member.entity.dto.MemberEditDTO;
|
||||||
import cn.lili.modules.member.service.MemberService;
|
import cn.lili.modules.member.service.MemberService;
|
||||||
import cn.lili.modules.system.sms.SmsUtil;
|
import cn.lili.modules.sms.SmsUtil;
|
||||||
import cn.lili.modules.verification.enums.VerificationEnums;
|
import cn.lili.modules.verification.entity.enums.VerificationEnums;
|
||||||
import cn.lili.modules.verification.service.VerificationService;
|
import cn.lili.modules.verification.service.VerificationService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
@@ -26,7 +28,7 @@ import javax.validation.constraints.NotNull;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,会员接口")
|
@Api(tags = "买家端,会员接口")
|
||||||
@RequestMapping("/buyer/members")
|
@RequestMapping("/buyer/passport/member")
|
||||||
public class MemberBuyerController {
|
public class MemberBuyerController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -66,8 +68,11 @@ public class MemberBuyerController {
|
|||||||
public ResultMessage<Object> smsLogin(@NotNull(message = "手机号为空") @RequestParam String mobile,
|
public ResultMessage<Object> smsLogin(@NotNull(message = "手机号为空") @RequestParam String mobile,
|
||||||
@NotNull(message = "验证码为空") @RequestParam String code,
|
@NotNull(message = "验证码为空") @RequestParam String code,
|
||||||
@RequestHeader String uuid) {
|
@RequestHeader String uuid) {
|
||||||
smsUtil.verifyCode(mobile, VerificationEnums.LOGIN, uuid, code);
|
if (smsUtil.verifyCode(mobile, VerificationEnums.LOGIN, uuid, code)) {
|
||||||
return ResultUtil.data(memberService.mobilePhoneLogin(mobile));
|
return ResultUtil.data(memberService.mobilePhoneLogin(mobile));
|
||||||
|
} else {
|
||||||
|
throw new ServiceException(ResultCode.VERIFICATION_SMS_CHECKED_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "注册用户")
|
@ApiOperation(value = "注册用户")
|
||||||
@@ -84,8 +89,11 @@ public class MemberBuyerController {
|
|||||||
@RequestHeader String uuid,
|
@RequestHeader String uuid,
|
||||||
@NotNull(message = "验证码不能为空") @RequestParam String code) {
|
@NotNull(message = "验证码不能为空") @RequestParam String code) {
|
||||||
|
|
||||||
smsUtil.verifyCode(mobilePhone, VerificationEnums.REGISTER, uuid, code);
|
if (smsUtil.verifyCode(mobilePhone, VerificationEnums.REGISTER, uuid, code)) {
|
||||||
return ResultUtil.data(memberService.register(username, password, mobilePhone));
|
return ResultUtil.data(memberService.register(username, password, mobilePhone));
|
||||||
|
} else {
|
||||||
|
throw new ServiceException(ResultCode.VERIFICATION_SMS_CHECKED_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,11 +114,13 @@ public class MemberBuyerController {
|
|||||||
@NotNull(message = "验证码为空") @RequestParam String code,
|
@NotNull(message = "验证码为空") @RequestParam String code,
|
||||||
@RequestHeader String uuid) {
|
@RequestHeader String uuid) {
|
||||||
//校验短信验证码是否正确
|
//校验短信验证码是否正确
|
||||||
smsUtil.verifyCode(mobile, VerificationEnums.FIND_USER, uuid, code);
|
if (smsUtil.verifyCode(mobile, VerificationEnums.FIND_USER, uuid, code)) {
|
||||||
//校验是否通过手机号可获取会员,存在则将会员信息存入缓存,有效时间3分钟
|
//校验是否通过手机号可获取会员,存在则将会员信息存入缓存,有效时间3分钟
|
||||||
memberService.findByMobile(uuid, mobile);
|
memberService.findByMobile(uuid, mobile);
|
||||||
|
return ResultUtil.success();
|
||||||
return ResultUtil.success();
|
} else {
|
||||||
|
throw new ServiceException(ResultCode.VERIFICATION_SMS_CHECKED_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "修改密码")
|
@ApiOperation(value = "修改密码")
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,app/小程序 联合登录")
|
@Api(tags = "买家端,app/小程序 联合登录")
|
||||||
@RequestMapping("/buyer/connect/bind")
|
@RequestMapping("/buyer/passport/connect/bind")
|
||||||
public class ConnectBuyerBindController {
|
public class ConnectBuyerBindController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -2,16 +2,16 @@ package cn.lili.controller.passport.connect;
|
|||||||
|
|
||||||
|
|
||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.exception.ServiceException;
|
import cn.lili.common.exception.ServiceException;
|
||||||
import cn.lili.common.security.token.Token;
|
import cn.lili.common.security.token.Token;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.utils.UuidUtils;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.connect.entity.dto.AuthCallback;
|
import cn.lili.modules.connect.entity.dto.AuthCallback;
|
||||||
import cn.lili.modules.connect.entity.dto.ConnectAuthUser;
|
import cn.lili.modules.connect.entity.dto.ConnectAuthUser;
|
||||||
import cn.lili.modules.connect.request.AuthRequest;
|
import cn.lili.modules.connect.request.AuthRequest;
|
||||||
import cn.lili.modules.connect.service.ConnectService;
|
import cn.lili.modules.connect.service.ConnectService;
|
||||||
import cn.lili.modules.connect.util.ConnectUtil;
|
import cn.lili.modules.connect.util.ConnectUtil;
|
||||||
import cn.lili.modules.connect.util.UuidUtils;
|
|
||||||
import cn.lili.modules.member.service.MemberService;
|
import cn.lili.modules.member.service.MemberService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
@@ -33,7 +33,7 @@ import java.io.IOException;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,web联合登录")
|
@Api(tags = "买家端,web联合登录")
|
||||||
@RequestMapping("/buyer/connect")
|
@RequestMapping("/buyer/passport/connect/connect")
|
||||||
public class ConnectBuyerWebController {
|
public class ConnectBuyerWebController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
package cn.lili.controller.passport.connect;
|
package cn.lili.controller.passport.connect;
|
||||||
|
|
||||||
import cn.lili.common.security.token.Token;
|
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
|
import cn.lili.common.security.token.Token;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.connect.entity.dto.WechatMPLoginParams;
|
import cn.lili.modules.connect.entity.dto.WechatMPLoginParams;
|
||||||
import cn.lili.modules.connect.service.ConnectService;
|
import cn.lili.modules.connect.service.ConnectService;
|
||||||
import cn.lili.modules.message.entity.dos.WechatMPMessage;
|
|
||||||
import cn.lili.modules.message.service.ShortLinkService;
|
import cn.lili.modules.message.service.ShortLinkService;
|
||||||
import cn.lili.modules.message.service.WechatMPMessageService;
|
import cn.lili.modules.wechat.entity.dos.WechatMPMessage;
|
||||||
import cn.lili.modules.message.util.WechatMpCodeUtil;
|
import cn.lili.modules.wechat.service.WechatMPMessageService;
|
||||||
|
import cn.lili.modules.wechat.util.WechatMpCodeUtil;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -26,7 +26,7 @@ import java.util.List;
|
|||||||
* @since 2021/2/19 09:28
|
* @since 2021/2/19 09:28
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/buyer/mini-program")
|
@RequestMapping("/buyer/passport/connect/miniProgram")
|
||||||
@Api(tags = "买家端,小程序登录接口")
|
@Api(tags = "买家端,小程序登录接口")
|
||||||
public class MiniProgramBuyerController {
|
public class MiniProgramBuyerController {
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,收银台接口")
|
@Api(tags = "买家端,收银台接口")
|
||||||
@RequestMapping("/buyer/cashier")
|
@RequestMapping("/buyer/payment/cashier")
|
||||||
public class CashierController {
|
public class CashierController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
*/
|
*/
|
||||||
@Api(tags = "买家端,退款回调")
|
@Api(tags = "买家端,退款回调")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/buyer/cashier/refund")
|
@RequestMapping("/buyer/payment/cashierRefund")
|
||||||
public class CashierRefundController {
|
public class CashierRefundController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -1,16 +1,19 @@
|
|||||||
package cn.lili.controller.member;
|
package cn.lili.controller.promotion;
|
||||||
|
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.security.AuthUser;
|
import cn.lili.common.security.AuthUser;
|
||||||
|
import cn.lili.common.security.OperationalJudgment;
|
||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.promotion.entity.dos.MemberCoupon;
|
import cn.lili.modules.promotion.entity.dos.MemberCoupon;
|
||||||
import cn.lili.modules.promotion.entity.vos.CouponSearchParams;
|
import cn.lili.modules.promotion.entity.dto.search.CouponSearchParams;
|
||||||
|
import cn.lili.modules.promotion.entity.dto.search.MemberCouponSearchParams;
|
||||||
|
import cn.lili.modules.promotion.entity.enums.CouponGetEnum;
|
||||||
|
import cn.lili.modules.promotion.entity.enums.PromotionsStatusEnum;
|
||||||
import cn.lili.modules.promotion.entity.vos.CouponVO;
|
import cn.lili.modules.promotion.entity.vos.CouponVO;
|
||||||
import cn.lili.modules.promotion.service.CouponService;
|
import cn.lili.modules.promotion.service.CouponService;
|
||||||
import cn.lili.modules.promotion.service.MemberCouponService;
|
import cn.lili.modules.promotion.service.MemberCouponService;
|
||||||
import cn.lili.modules.system.utils.OperationalJudgment;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
@@ -51,13 +54,15 @@ public class CouponBuyerController {
|
|||||||
@GetMapping
|
@GetMapping
|
||||||
@ApiOperation(value = "获取可领取优惠券列表")
|
@ApiOperation(value = "获取可领取优惠券列表")
|
||||||
public ResultMessage<IPage<CouponVO>> getCouponList(CouponSearchParams queryParam, PageVO page) {
|
public ResultMessage<IPage<CouponVO>> getCouponList(CouponSearchParams queryParam, PageVO page) {
|
||||||
IPage<CouponVO> canUseCoupons = couponService.getCanReceiveCoupons(queryParam, page);
|
queryParam.setPromotionStatus(PromotionsStatusEnum.START.name());
|
||||||
|
queryParam.setGetType(CouponGetEnum.FREE.name());
|
||||||
|
IPage<CouponVO> canUseCoupons = couponService.pageVOFindAll(queryParam, page);
|
||||||
return ResultUtil.data(canUseCoupons);
|
return ResultUtil.data(canUseCoupons);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "获取当前会员的优惠券列表")
|
@ApiOperation(value = "获取当前会员的优惠券列表")
|
||||||
@GetMapping("/getCoupons")
|
@GetMapping("/getCoupons")
|
||||||
public ResultMessage<IPage<MemberCoupon>> getCoupons(CouponSearchParams param, PageVO pageVo) {
|
public ResultMessage<IPage<MemberCoupon>> getCoupons(MemberCouponSearchParams param, PageVO pageVo) {
|
||||||
AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser());
|
AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser());
|
||||||
param.setMemberId(currentUser.getId());
|
param.setMemberId(currentUser.getId());
|
||||||
return ResultUtil.data(memberCouponService.getMemberCoupons(param, pageVo));
|
return ResultUtil.data(memberCouponService.getMemberCoupons(param, pageVo));
|
||||||
@@ -65,7 +70,7 @@ public class CouponBuyerController {
|
|||||||
|
|
||||||
@ApiOperation(value = "获取当前会员的对于当前商品可使用的优惠券列表")
|
@ApiOperation(value = "获取当前会员的对于当前商品可使用的优惠券列表")
|
||||||
@GetMapping("/canUse")
|
@GetMapping("/canUse")
|
||||||
public ResultMessage<IPage<MemberCoupon>> getCouponsByCanUse(CouponSearchParams param, Double totalPrice, PageVO pageVo) {
|
public ResultMessage<IPage<MemberCoupon>> getCouponsByCanUse(MemberCouponSearchParams param, Double totalPrice, PageVO pageVo) {
|
||||||
AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser());
|
AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser());
|
||||||
param.setMemberId(currentUser.getId());
|
param.setMemberId(currentUser.getId());
|
||||||
return ResultUtil.data(memberCouponService.getMemberCouponsByCanUse(param, totalPrice, pageVo));
|
return ResultUtil.data(memberCouponService.getMemberCouponsByCanUse(param, totalPrice, pageVo));
|
||||||
@@ -84,8 +89,7 @@ public class CouponBuyerController {
|
|||||||
@GetMapping("/receive/{couponId}")
|
@GetMapping("/receive/{couponId}")
|
||||||
public ResultMessage<Object> receiveCoupon(@NotNull(message = "优惠券ID不能为空") @PathVariable("couponId") String couponId) {
|
public ResultMessage<Object> receiveCoupon(@NotNull(message = "优惠券ID不能为空") @PathVariable("couponId") String couponId) {
|
||||||
AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser());
|
AuthUser currentUser = Objects.requireNonNull(UserContext.getCurrentUser());
|
||||||
memberCouponService.checkCouponLimit(couponId, currentUser.getId());
|
memberCouponService.receiveBuyerCoupon(couponId, currentUser.getId(), currentUser.getNickName());
|
||||||
memberCouponService.receiveCoupon(couponId, currentUser.getId(), currentUser.getNickName());
|
|
||||||
return ResultUtil.success();
|
return ResultUtil.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,16 +1,20 @@
|
|||||||
package cn.lili.controller.promotion;
|
package cn.lili.controller.promotion;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.promotion.entity.dos.KanjiaActivity;
|
import cn.lili.modules.promotion.entity.dos.KanjiaActivity;
|
||||||
import cn.lili.modules.promotion.entity.dos.KanjiaActivityLog;
|
import cn.lili.modules.promotion.entity.dos.KanjiaActivityLog;
|
||||||
import cn.lili.modules.promotion.entity.dto.KanJiaActivityLogQuery;
|
import cn.lili.modules.promotion.entity.dto.search.KanJiaActivityLogQuery;
|
||||||
import cn.lili.modules.promotion.entity.dto.KanjiaActivityQuery;
|
import cn.lili.modules.promotion.entity.dto.search.KanjiaActivityGoodsParams;
|
||||||
import cn.lili.modules.promotion.entity.enums.PromotionStatusEnum;
|
import cn.lili.modules.promotion.entity.dto.search.KanjiaActivityQuery;
|
||||||
import cn.lili.modules.promotion.entity.vos.kanjia.*;
|
import cn.lili.modules.promotion.entity.dto.search.KanjiaActivitySearchParams;
|
||||||
|
import cn.lili.modules.promotion.entity.enums.PromotionsStatusEnum;
|
||||||
|
import cn.lili.modules.promotion.entity.vos.kanjia.KanjiaActivityGoodsListVO;
|
||||||
|
import cn.lili.modules.promotion.entity.vos.kanjia.KanjiaActivityGoodsVO;
|
||||||
|
import cn.lili.modules.promotion.entity.vos.kanjia.KanjiaActivityVO;
|
||||||
import cn.lili.modules.promotion.service.KanjiaActivityGoodsService;
|
import cn.lili.modules.promotion.service.KanjiaActivityGoodsService;
|
||||||
import cn.lili.modules.promotion.service.KanjiaActivityLogService;
|
import cn.lili.modules.promotion.service.KanjiaActivityLogService;
|
||||||
import cn.lili.modules.promotion.service.KanjiaActivityService;
|
import cn.lili.modules.promotion.service.KanjiaActivityService;
|
||||||
@@ -52,9 +56,9 @@ public class KanjiaGoodsActivityBuyerController {
|
|||||||
@ApiOperation(value = "分页获取砍价商品")
|
@ApiOperation(value = "分页获取砍价商品")
|
||||||
public ResultMessage<IPage<KanjiaActivityGoodsListVO>> kanjiaActivityGoodsPage(KanjiaActivityGoodsParams kanjiaActivityGoodsParams, PageVO page) {
|
public ResultMessage<IPage<KanjiaActivityGoodsListVO>> kanjiaActivityGoodsPage(KanjiaActivityGoodsParams kanjiaActivityGoodsParams, PageVO page) {
|
||||||
// 会员端查询到的肯定是已经开始的活动商品
|
// 会员端查询到的肯定是已经开始的活动商品
|
||||||
kanjiaActivityGoodsParams.setPromotionStatus(PromotionStatusEnum.START.name());
|
kanjiaActivityGoodsParams.setPromotionStatus(PromotionsStatusEnum.START.name());
|
||||||
kanjiaActivityGoodsParams.setStartTime(System.currentTimeMillis());
|
// kanjiaActivityGoodsParams.setStartTime(System.currentTimeMillis());
|
||||||
kanjiaActivityGoodsParams.setEndTime(System.currentTimeMillis());
|
// kanjiaActivityGoodsParams.setEndTime(System.currentTimeMillis());
|
||||||
return ResultUtil.data(kanJiaActivityGoodsService.kanjiaGoodsVOPage(kanjiaActivityGoodsParams, page));
|
return ResultUtil.data(kanJiaActivityGoodsService.kanjiaGoodsVOPage(kanjiaActivityGoodsParams, page));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,7 +79,7 @@ public class KanjiaGoodsActivityBuyerController {
|
|||||||
@ApiOperation(value = "获取砍价活动")
|
@ApiOperation(value = "获取砍价活动")
|
||||||
public ResultMessage<KanjiaActivityVO> getKanJiaActivity(KanjiaActivitySearchParams kanjiaActivitySearchParams) {
|
public ResultMessage<KanjiaActivityVO> getKanJiaActivity(KanjiaActivitySearchParams kanjiaActivitySearchParams) {
|
||||||
//如果是非被邀请关系则填写会员ID
|
//如果是非被邀请关系则填写会员ID
|
||||||
if (StrUtil.isEmpty(kanjiaActivitySearchParams.getKanjiaActivityId())) {
|
if (CharSequenceUtil.isEmpty(kanjiaActivitySearchParams.getKanjiaActivityId())) {
|
||||||
kanjiaActivitySearchParams.setMemberId(UserContext.getCurrentUser().getId());
|
kanjiaActivitySearchParams.setMemberId(UserContext.getCurrentUser().getId());
|
||||||
}
|
}
|
||||||
return ResultUtil.data(kanJiaActivityService.getKanjiaActivityVO(kanjiaActivitySearchParams));
|
return ResultUtil.data(kanJiaActivityService.getKanjiaActivityVO(kanjiaActivitySearchParams));
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
package cn.lili.controller.promotion;
|
package cn.lili.controller.promotion;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.lili.common.enums.PromotionTypeEnum;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.promotion.entity.dto.PromotionGoodsDTO;
|
import cn.lili.modules.promotion.entity.dos.PromotionGoods;
|
||||||
import cn.lili.modules.promotion.entity.enums.PromotionStatusEnum;
|
import cn.lili.modules.promotion.entity.dto.search.PromotionGoodsSearchParams;
|
||||||
import cn.lili.common.enums.PromotionTypeEnum;
|
import cn.lili.modules.promotion.entity.enums.PromotionsStatusEnum;
|
||||||
import cn.lili.modules.promotion.entity.vos.PintuanMemberVO;
|
import cn.lili.modules.promotion.entity.vos.PintuanMemberVO;
|
||||||
import cn.lili.modules.promotion.entity.vos.PintuanShareVO;
|
import cn.lili.modules.promotion.entity.vos.PintuanShareVO;
|
||||||
import cn.lili.modules.promotion.entity.vos.PromotionGoodsSearchParams;
|
|
||||||
import cn.lili.modules.promotion.service.PintuanService;
|
import cn.lili.modules.promotion.service.PintuanService;
|
||||||
import cn.lili.modules.promotion.service.PromotionGoodsService;
|
import cn.lili.modules.promotion.service.PromotionGoodsService;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@@ -40,14 +39,13 @@ public class PintuanBuyerController {
|
|||||||
|
|
||||||
@ApiOperation(value = "获取拼团商品")
|
@ApiOperation(value = "获取拼团商品")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public ResultMessage<IPage<PromotionGoodsDTO>> getPintuanCategory(String goodsName, String categoryPath, PageVO pageVo) {
|
public ResultMessage<IPage<PromotionGoods>> getPintuanCategory(String goodsName, String categoryPath, PageVO pageVo) {
|
||||||
PromotionGoodsSearchParams searchParams = new PromotionGoodsSearchParams();
|
PromotionGoodsSearchParams searchParams = new PromotionGoodsSearchParams();
|
||||||
searchParams.setGoodsName(goodsName);
|
searchParams.setGoodsName(goodsName);
|
||||||
searchParams.setPromotionType(PromotionTypeEnum.PINTUAN.name());
|
searchParams.setPromotionType(PromotionTypeEnum.PINTUAN.name());
|
||||||
searchParams.setPromotionStatus(PromotionStatusEnum.START.name());
|
searchParams.setPromotionStatus(PromotionsStatusEnum.START.name());
|
||||||
searchParams.setCategoryPath(categoryPath);
|
searchParams.setCategoryPath(categoryPath);
|
||||||
searchParams.setEndTime(DateUtil.date().getTime());
|
return ResultUtil.data(promotionGoodsService.pageFindAll(searchParams, pageVo));
|
||||||
return ResultUtil.data(promotionGoodsService.getPromotionGoods(searchParams, pageVo));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ package cn.lili.controller.promotion;
|
|||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
|
import cn.lili.modules.promotion.entity.dos.PointsGoods;
|
||||||
import cn.lili.modules.promotion.entity.dos.PointsGoodsCategory;
|
import cn.lili.modules.promotion.entity.dos.PointsGoodsCategory;
|
||||||
import cn.lili.modules.promotion.entity.vos.PointsGoodsSearchParams;
|
import cn.lili.modules.promotion.entity.dto.search.PointsGoodsSearchParams;
|
||||||
|
import cn.lili.modules.promotion.entity.enums.PromotionsStatusEnum;
|
||||||
import cn.lili.modules.promotion.entity.vos.PointsGoodsVO;
|
import cn.lili.modules.promotion.entity.vos.PointsGoodsVO;
|
||||||
import cn.lili.modules.promotion.service.PointsGoodsCategoryService;
|
import cn.lili.modules.promotion.service.PointsGoodsCategoryService;
|
||||||
import cn.lili.modules.promotion.service.PointsGoodsService;
|
import cn.lili.modules.promotion.service.PointsGoodsService;
|
||||||
@@ -35,8 +37,9 @@ public class PointsGoodsBuyerController {
|
|||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@ApiOperation(value = "分页获取积分商品")
|
@ApiOperation(value = "分页获取积分商品")
|
||||||
public ResultMessage<IPage<PointsGoodsVO>> getPointsGoodsPage(PointsGoodsSearchParams searchParams, PageVO page) {
|
public ResultMessage<IPage<PointsGoods>> getPointsGoodsPage(PointsGoodsSearchParams searchParams, PageVO page) {
|
||||||
IPage<PointsGoodsVO> pointsGoodsByPage = pointsGoodsService.getPointsGoodsByPage(searchParams, page);
|
searchParams.setPromotionStatus(PromotionsStatusEnum.START.name());
|
||||||
|
IPage<PointsGoods> pointsGoodsByPage = pointsGoodsService.pageFindAll(searchParams, page);
|
||||||
return ResultUtil.data(pointsGoodsByPage);
|
return ResultUtil.data(pointsGoodsByPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,12 +4,13 @@ import cn.lili.common.enums.ResultUtil;
|
|||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
|
import cn.lili.modules.goods.entity.vos.StoreGoodsLabelVO;
|
||||||
|
import cn.lili.modules.goods.service.StoreGoodsLabelService;
|
||||||
import cn.lili.modules.store.entity.dto.StoreBankDTO;
|
import cn.lili.modules.store.entity.dto.StoreBankDTO;
|
||||||
import cn.lili.modules.store.entity.dto.StoreCompanyDTO;
|
import cn.lili.modules.store.entity.dto.StoreCompanyDTO;
|
||||||
import cn.lili.modules.store.entity.dto.StoreOtherInfoDTO;
|
import cn.lili.modules.store.entity.dto.StoreOtherInfoDTO;
|
||||||
import cn.lili.modules.store.entity.vos.*;
|
import cn.lili.modules.store.entity.vos.*;
|
||||||
import cn.lili.modules.store.service.StoreDetailService;
|
import cn.lili.modules.store.service.StoreDetailService;
|
||||||
import cn.lili.modules.store.service.StoreGoodsLabelService;
|
|
||||||
import cn.lili.modules.store.service.StoreService;
|
import cn.lili.modules.store.service.StoreService;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -30,7 +31,7 @@ import java.util.List;
|
|||||||
* @since 2020/11/17 2:32 下午
|
* @since 2020/11/17 2:32 下午
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/buyer/store")
|
@RequestMapping("/buyer/store/store")
|
||||||
@Api(tags = "买家端,店铺接口")
|
@Api(tags = "买家端,店铺接口")
|
||||||
public class StoreBuyerController {
|
public class StoreBuyerController {
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package cn.lili.controller.member;
|
package cn.lili.controller.wallet;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
@@ -23,7 +24,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,会员发票接口")
|
@Api(tags = "买家端,会员发票接口")
|
||||||
@RequestMapping("/buyer/member/receipt")
|
@RequestMapping("/buyer/wallet/receipt")
|
||||||
public class MemberReceiptController {
|
public class MemberReceiptController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -35,6 +36,7 @@ public class MemberReceiptController {
|
|||||||
return ResultUtil.data(memberReceiptService.getPage(memberReceiptVO, page));
|
return ResultUtil.data(memberReceiptService.getPage(memberReceiptVO, page));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreventDuplicateSubmissions
|
||||||
@ApiOperation(value = "新增会员发票")
|
@ApiOperation(value = "新增会员发票")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public ResultMessage<Object> add(MemberReceiptAddVO memberReceiptAddVO) {
|
public ResultMessage<Object> add(MemberReceiptAddVO memberReceiptAddVO) {
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package cn.lili.controller.member;
|
package cn.lili.controller.wallet;
|
||||||
|
|
||||||
|
import cn.lili.common.aop.annotation.PreventDuplicateSubmissions;
|
||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.exception.ServiceException;
|
import cn.lili.common.exception.ServiceException;
|
||||||
@@ -7,12 +8,12 @@ import cn.lili.common.security.AuthUser;
|
|||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.member.entity.dos.Member;
|
import cn.lili.modules.member.entity.dos.Member;
|
||||||
import cn.lili.modules.member.entity.dos.MemberWallet;
|
|
||||||
import cn.lili.modules.member.entity.vo.MemberWalletVO;
|
|
||||||
import cn.lili.modules.member.service.MemberService;
|
import cn.lili.modules.member.service.MemberService;
|
||||||
import cn.lili.modules.member.service.MemberWalletService;
|
import cn.lili.modules.verification.entity.enums.VerificationEnums;
|
||||||
import cn.lili.modules.verification.enums.VerificationEnums;
|
|
||||||
import cn.lili.modules.verification.service.VerificationService;
|
import cn.lili.modules.verification.service.VerificationService;
|
||||||
|
import cn.lili.modules.wallet.entity.dos.MemberWallet;
|
||||||
|
import cn.lili.modules.wallet.entity.vo.MemberWalletVO;
|
||||||
|
import cn.lili.modules.wallet.service.MemberWalletService;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
@@ -34,7 +35,7 @@ import javax.validation.constraints.Pattern;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,会员余额接口")
|
@Api(tags = "买家端,会员余额接口")
|
||||||
@RequestMapping("/buyer/members/wallet")
|
@RequestMapping("/buyer/wallet/wallet")
|
||||||
public class MemberWalletBuyerController {
|
public class MemberWalletBuyerController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -120,12 +121,13 @@ public class MemberWalletBuyerController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PreventDuplicateSubmissions
|
||||||
@PostMapping(value = "/withdrawal")
|
@PostMapping(value = "/withdrawal")
|
||||||
@ApiOperation(value = "会员中心余额提现")
|
@ApiOperation(value = "会员中心余额提现")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "price", value = "提现金额", required = true, dataType = "double", paramType = "query")
|
@ApiImplicitParam(name = "price", value = "提现金额", required = true, dataType = "double", paramType = "query")
|
||||||
})
|
})
|
||||||
public ResultMessage<Boolean> withdrawal(@Max(value = 1000, message = "充值金额单次最多允许提现1000元") @Min(value = 1, message = "充值金额单次最少提现金额为1元") Double price) {
|
public ResultMessage<Boolean> withdrawal(@Max(value = 9999, message = "充值金额单次最多允许提现9999元") @Min(value = 1, message = "充值金额单次最少提现金额为1元") Double price) {
|
||||||
return ResultUtil.data(memberWalletService.applyWithdrawal(price));
|
return ResultUtil.data(memberWalletService.applyWithdrawal(price));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,18 +1,17 @@
|
|||||||
package cn.lili.controller.member;
|
package cn.lili.controller.wallet;
|
||||||
|
|
||||||
|
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.member.entity.dos.MemberWithdrawApply;
|
import cn.lili.modules.wallet.entity.dos.MemberWithdrawApply;
|
||||||
import cn.lili.modules.member.entity.vo.MemberWithdrawApplyQueryVO;
|
import cn.lili.modules.wallet.entity.vo.MemberWithdrawApplyQueryVO;
|
||||||
import cn.lili.modules.member.service.MemberWithdrawApplyService;
|
import cn.lili.modules.wallet.service.MemberWithdrawApplyService;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@@ -27,7 +26,6 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,余额提现记录接口")
|
@Api(tags = "买家端,余额提现记录接口")
|
||||||
@RequestMapping("/buyer/member/withdrawApply")
|
@RequestMapping("/buyer/member/withdrawApply")
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public class MemberWithdrawApplyBuyerController {
|
public class MemberWithdrawApplyBuyerController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private MemberWithdrawApplyService memberWithdrawApplyService;
|
private MemberWithdrawApplyService memberWithdrawApplyService;
|
||||||
@@ -1,17 +1,16 @@
|
|||||||
package cn.lili.controller.member;
|
package cn.lili.controller.wallet;
|
||||||
|
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.order.trade.entity.dos.Recharge;
|
|
||||||
import cn.lili.modules.order.trade.entity.vo.RechargeQueryVO;
|
import cn.lili.modules.order.trade.entity.vo.RechargeQueryVO;
|
||||||
import cn.lili.modules.order.trade.service.RechargeService;
|
import cn.lili.modules.wallet.entity.dos.Recharge;
|
||||||
|
import cn.lili.modules.wallet.service.RechargeService;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@@ -24,8 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "买家端,预存款充值记录接口")
|
@Api(tags = "买家端,预存款充值记录接口")
|
||||||
@RequestMapping("/buyer/member/recharge")
|
@RequestMapping("/buyer/wallet/recharge")
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public class RechargeBuyerController {
|
public class RechargeBuyerController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
package cn.lili.controller.trade;
|
package cn.lili.controller.wallet;
|
||||||
|
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.security.AuthUser;
|
import cn.lili.common.security.AuthUser;
|
||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.order.trade.entity.dos.WalletLog;
|
import cn.lili.modules.wallet.entity.dos.WalletLog;
|
||||||
import cn.lili.modules.order.trade.service.WalletLogService;
|
import cn.lili.modules.wallet.service.WalletLogService;
|
||||||
import cn.lili.mybatis.util.PageUtil;
|
import cn.lili.mybatis.util.PageUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@@ -3,12 +3,19 @@ server:
|
|||||||
|
|
||||||
servlet:
|
servlet:
|
||||||
context-path: /
|
context-path: /
|
||||||
|
#
|
||||||
tomcat:
|
# tomcat:
|
||||||
uri-encoding: UTF-8
|
# #最大链接数,默认不设置,默认是10000
|
||||||
threads:
|
# max-connections: 6500
|
||||||
min-spare: 50
|
# #最大等待队列长度,允许HTTP请求缓存到请求队列的最大个数,默认不限制
|
||||||
max: 1000
|
# accept-count: 1000
|
||||||
|
# threads:
|
||||||
|
# #最少闲置
|
||||||
|
# min-spare: 50
|
||||||
|
# #最大线程数 ,默认是200
|
||||||
|
# max: 800
|
||||||
|
netty:
|
||||||
|
connection-timeout:
|
||||||
|
|
||||||
# 与Spring Boot 2一样,默认情况下,大多数端点都不通过http公开,我们公开了所有端点。对于生产,您应该仔细选择要公开的端点。
|
# 与Spring Boot 2一样,默认情况下,大多数端点都不通过http公开,我们公开了所有端点。对于生产,您应该仔细选择要公开的端点。
|
||||||
management:
|
management:
|
||||||
@@ -43,16 +50,6 @@ spring:
|
|||||||
#关闭jackson 对json做解析
|
#关闭jackson 对json做解析
|
||||||
fail-on-empty-beans: false
|
fail-on-empty-beans: false
|
||||||
|
|
||||||
# mongodb
|
|
||||||
data:
|
|
||||||
mongodb:
|
|
||||||
uri: 127.0.0.1:27017
|
|
||||||
database: lilishop
|
|
||||||
username: root
|
|
||||||
password: lilishop
|
|
||||||
authentication-database: admin
|
|
||||||
# replica-set-name: mongoreplset
|
|
||||||
|
|
||||||
# Redis
|
# Redis
|
||||||
redis:
|
redis:
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
@@ -79,10 +76,10 @@ spring:
|
|||||||
url: jdbc:mysql://127.0.0.1:3306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://127.0.0.1:3306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||||
username: root
|
username: root
|
||||||
password: lilishop
|
password: lilishop
|
||||||
maxActive: 20
|
maxActive: 50
|
||||||
initialSize: 5
|
initialSize: 10
|
||||||
maxWait: 60000
|
maxWait: 60000
|
||||||
minIdle: 5
|
minIdle: 10
|
||||||
timeBetweenEvictionRunsMillis: 60000
|
timeBetweenEvictionRunsMillis: 60000
|
||||||
minEvictableIdleTimeMillis: 300000
|
minEvictableIdleTimeMillis: 300000
|
||||||
validationQuery: SELECT 1 FROM DUAL
|
validationQuery: SELECT 1 FROM DUAL
|
||||||
@@ -120,7 +117,7 @@ spring:
|
|||||||
props:
|
props:
|
||||||
#是否打印逻辑SQL语句和实际SQL语句,建议调试时打印,在生产环境关闭
|
#是否打印逻辑SQL语句和实际SQL语句,建议调试时打印,在生产环境关闭
|
||||||
sql:
|
sql:
|
||||||
show: true
|
show: false
|
||||||
|
|
||||||
# 忽略TOKEN 鉴权 的url
|
# 忽略TOKEN 鉴权 的url
|
||||||
ignored:
|
ignored:
|
||||||
@@ -131,21 +128,23 @@ ignored:
|
|||||||
- /MP_verify_qSyvBPhDsPdxvOhC.txt
|
- /MP_verify_qSyvBPhDsPdxvOhC.txt
|
||||||
- /weixin/**
|
- /weixin/**
|
||||||
- /source/**
|
- /source/**
|
||||||
- /buyer/mini-program/**
|
- /buyer/payment/cashier/**
|
||||||
- /buyer/cashier/**
|
- /buyer/payment/cashierRefund/**
|
||||||
- /buyer/pageData/**
|
- /buyer/other/pageData/**
|
||||||
- /buyer/article/**
|
- /buyer/other/article/**
|
||||||
- /buyer/goods/**
|
- /buyer/goods/**
|
||||||
- /buyer/category/**
|
|
||||||
- /buyer/store/**
|
- /buyer/store/**
|
||||||
- /buyer/connect/**
|
- /buyer/passport/connect/**
|
||||||
- /buyer/members/**
|
- /buyer/members/**
|
||||||
|
- /buyer/passport/member/**
|
||||||
|
- /buyer/passport/member/refresh/**
|
||||||
- /buyer/promotion/pintuan/**
|
- /buyer/promotion/pintuan/**
|
||||||
- /buyer/promotion/seckill/**
|
- /buyer/promotion/seckill/**
|
||||||
- /buyer/promotion/pointsGoods/**
|
- /buyer/promotion/pointsGoods/**
|
||||||
- /buyer/memberEvaluation/**/goodsEvaluation
|
- /buyer/promotion/coupon
|
||||||
- /buyer/memberEvaluation/**/evaluationNumber
|
- /buyer/member/evaluation/**/goodsEvaluation
|
||||||
- /buyer/appVersion/**
|
- /buyer/member/evaluation/**/evaluationNumber
|
||||||
|
- /buyer/other/appVersion/**
|
||||||
- /buyer/broadcast/studio/**
|
- /buyer/broadcast/studio/**
|
||||||
- /druid/**
|
- /druid/**
|
||||||
- /swagger-ui.html
|
- /swagger-ui.html
|
||||||
@@ -186,10 +185,8 @@ logging:
|
|||||||
config: classpath:logback-spring.xml
|
config: classpath:logback-spring.xml
|
||||||
# 输出级别
|
# 输出级别
|
||||||
level:
|
level:
|
||||||
cn.lili: debug
|
root: info
|
||||||
org.hibernate: debug
|
|
||||||
# org.springframework: debug
|
# org.springframework: debug
|
||||||
# org.springframework.data.mongodb.core: debug
|
|
||||||
file:
|
file:
|
||||||
# 指定路径
|
# 指定路径
|
||||||
path: lili-logs
|
path: lili-logs
|
||||||
|
|||||||
@@ -25,16 +25,6 @@ spring:
|
|||||||
admin:
|
admin:
|
||||||
client:
|
client:
|
||||||
url: http://192.168.0.116:8000
|
url: http://192.168.0.116:8000
|
||||||
# mongodb
|
|
||||||
data:
|
|
||||||
mongodb:
|
|
||||||
host: 192.168.0.116
|
|
||||||
port: 27017
|
|
||||||
database: lilishop
|
|
||||||
username: root
|
|
||||||
password: lilishop
|
|
||||||
authentication-database: admin
|
|
||||||
# replica-set-name: mongoreplset
|
|
||||||
cache:
|
cache:
|
||||||
type: redis
|
type: redis
|
||||||
#amqp
|
#amqp
|
||||||
@@ -186,7 +176,6 @@ logging:
|
|||||||
cn.lili: info
|
cn.lili: info
|
||||||
# org.hibernate: debug
|
# org.hibernate: debug
|
||||||
# org.springframework: debug
|
# org.springframework: debug
|
||||||
# org.springframework.data.mongodb.core: debug
|
|
||||||
file:
|
file:
|
||||||
# 指定路径
|
# 指定路径
|
||||||
path: lili-logs
|
path: lili-logs
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ package cn.lili.controller.common;
|
|||||||
|
|
||||||
import cn.lili.cache.Cache;
|
import cn.lili.cache.Cache;
|
||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.exception.ServiceException;
|
import cn.lili.common.exception.ServiceException;
|
||||||
import cn.lili.common.security.AuthUser;
|
import cn.lili.common.security.AuthUser;
|
||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
import cn.lili.common.security.enums.UserEnums;
|
import cn.lili.common.security.enums.UserEnums;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.common.vo.SearchVO;
|
import cn.lili.common.vo.SearchVO;
|
||||||
@@ -30,8 +30,8 @@ import java.util.List;
|
|||||||
* @since 2020/11/26 15:41
|
* @since 2020/11/26 15:41
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "文件管理管理接口")
|
@Api(tags = "文件管理接口")
|
||||||
@RequestMapping("/common/file")
|
@RequestMapping("/common/common/file")
|
||||||
public class FileController {
|
public class FileController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -78,9 +78,7 @@ public class FileController {
|
|||||||
}
|
}
|
||||||
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
|
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
|
||||||
case MANAGER:
|
case MANAGER:
|
||||||
if (file.getUserEnums().equals(authUser.getRole().name())) {
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
|
throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
* 2021-09-16 15:32
|
* 2021-09-16 15:32
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/common/IM")
|
@RequestMapping("/common/common/IM")
|
||||||
@Api(tags = "IM 中心")
|
@Api(tags = "IM 中心")
|
||||||
public class IMController {
|
public class IMController {
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package cn.lili.controller.member;
|
package cn.lili.controller.common;
|
||||||
|
|
||||||
import cn.lili.common.utils.IpHelper;
|
import cn.lili.common.utils.IpHelper;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
@@ -19,8 +19,8 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
* @since 2020-02-25 14:10:16
|
* @since 2020-02-25 14:10:16
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "管理端,IP接口")
|
@Api(tags = "获取IP信息以及天气")
|
||||||
@RequestMapping("/manager/common/ip")
|
@RequestMapping("/common/common/ip")
|
||||||
public class IpInfoManagerController {
|
public class IpInfoManagerController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IpHelper ipHelper;
|
private IpHelper ipHelper;
|
||||||
@@ -19,8 +19,8 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
* @since 2020/11/26 15:41
|
* @since 2020/11/26 15:41
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "文件管理管理接口")
|
@Api(tags = "文件管理接口")
|
||||||
@RequestMapping("/common/logo")
|
@RequestMapping("/common/common/logo")
|
||||||
public class LogoController {
|
public class LogoController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "地址信息接口")
|
@Api(tags = "地址信息接口")
|
||||||
@RequestMapping("/common/region")
|
@RequestMapping("/common/common/region")
|
||||||
public class RegionController {
|
public class RegionController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package cn.lili.controller.common;
|
|||||||
import cn.lili.cache.limit.annotation.LimitPoint;
|
import cn.lili.cache.limit.annotation.LimitPoint;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.verification.enums.VerificationEnums;
|
import cn.lili.modules.verification.entity.enums.VerificationEnums;
|
||||||
import cn.lili.modules.verification.service.VerificationService;
|
import cn.lili.modules.verification.service.VerificationService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
@@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/common/slider")
|
@RequestMapping("/common/common/slider")
|
||||||
@Api(tags = "滑块验证码接口")
|
@Api(tags = "滑块验证码接口")
|
||||||
public class SliderImageController {
|
public class SliderImageController {
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import cn.lili.cache.limit.annotation.LimitPoint;
|
|||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
import cn.lili.modules.system.sms.SmsUtil;
|
import cn.lili.modules.sms.SmsUtil;
|
||||||
import cn.lili.modules.verification.enums.VerificationEnums;
|
import cn.lili.modules.verification.entity.enums.VerificationEnums;
|
||||||
import cn.lili.modules.verification.service.VerificationService;
|
import cn.lili.modules.verification.service.VerificationService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
@@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "短信验证码接口")
|
@Api(tags = "短信验证码接口")
|
||||||
@RequestMapping("/common/sms")
|
@RequestMapping("/common/common/sms")
|
||||||
public class SmsController {
|
public class SmsController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import cn.lili.cache.Cache;
|
|||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.exception.ServiceException;
|
import cn.lili.common.exception.ServiceException;
|
||||||
import cn.lili.common.properties.SystemSettingProperties;
|
|
||||||
import cn.lili.common.security.AuthUser;
|
import cn.lili.common.security.AuthUser;
|
||||||
import cn.lili.common.security.context.UserContext;
|
import cn.lili.common.security.context.UserContext;
|
||||||
import cn.lili.common.security.enums.UserEnums;
|
import cn.lili.common.security.enums.UserEnums;
|
||||||
@@ -40,7 +39,7 @@ import java.util.Objects;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "文件上传接口")
|
@Api(tags = "文件上传接口")
|
||||||
@RequestMapping("/common/upload")
|
@RequestMapping("/common/common/upload")
|
||||||
public class UploadController {
|
public class UploadController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -52,9 +51,6 @@ public class UploadController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private Cache cache;
|
private Cache cache;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SystemSettingProperties systemSettingProperties;
|
|
||||||
|
|
||||||
@ApiOperation(value = "文件上传")
|
@ApiOperation(value = "文件上传")
|
||||||
@PostMapping(value = "/file")
|
@PostMapping(value = "/file")
|
||||||
public ResultMessage<Object> upload(MultipartFile file,
|
public ResultMessage<Object> upload(MultipartFile file,
|
||||||
|
|||||||
@@ -29,15 +29,6 @@ spring:
|
|||||||
admin:
|
admin:
|
||||||
client:
|
client:
|
||||||
url: http://127.0.0.1:8000
|
url: http://127.0.0.1:8000
|
||||||
# mongodb
|
|
||||||
data:
|
|
||||||
mongodb:
|
|
||||||
uri: 127.0.0.1:27017
|
|
||||||
database: lilishop
|
|
||||||
username: root
|
|
||||||
password: lilishop
|
|
||||||
authentication-database: admin
|
|
||||||
# replica-set-name: mongoreplset
|
|
||||||
cache:
|
cache:
|
||||||
type: redis
|
type: redis
|
||||||
# Redis
|
# Redis
|
||||||
@@ -117,7 +108,7 @@ spring:
|
|||||||
props:
|
props:
|
||||||
#是否打印逻辑SQL语句和实际SQL语句,建议调试时打印,在生产环境关闭
|
#是否打印逻辑SQL语句和实际SQL语句,建议调试时打印,在生产环境关闭
|
||||||
sql:
|
sql:
|
||||||
show: true
|
show: false
|
||||||
|
|
||||||
# 忽略鉴权url
|
# 忽略鉴权url
|
||||||
ignored:
|
ignored:
|
||||||
@@ -128,24 +119,8 @@ ignored:
|
|||||||
- /MP_verify_qSyvBPhDsPdxvOhC.txt
|
- /MP_verify_qSyvBPhDsPdxvOhC.txt
|
||||||
- /weixin/**
|
- /weixin/**
|
||||||
- /source/**
|
- /source/**
|
||||||
- /buyer/mini-program/**
|
- /common/common/slider/**
|
||||||
- /buyer/cashier/**
|
- /common/common/sms/**
|
||||||
- /buyer/pageData/**
|
|
||||||
- /buyer/article/**
|
|
||||||
- /buyer/goods/**
|
|
||||||
- /buyer/category/**
|
|
||||||
- /buyer/shop/**
|
|
||||||
- /buyer/connect/**
|
|
||||||
- /buyer/members/smsLogin
|
|
||||||
- /buyer/members/refresh/*
|
|
||||||
- /buyer/members/refresh**
|
|
||||||
- /buyer/promotion/pintuan
|
|
||||||
- /buyer/promotion/seckill
|
|
||||||
- /buyer/memberEvaluation/**/goodsEvaluation
|
|
||||||
- /buyer/memberEvaluation/**/evaluationNumber
|
|
||||||
- /store/login/**
|
|
||||||
- /manager/user/login
|
|
||||||
- /manager/user/refresh/**
|
|
||||||
- /druid/**
|
- /druid/**
|
||||||
- /swagger-ui.html
|
- /swagger-ui.html
|
||||||
- /doc.html
|
- /doc.html
|
||||||
@@ -185,10 +160,9 @@ logging:
|
|||||||
config: classpath:logback-spring.xml
|
config: classpath:logback-spring.xml
|
||||||
# 输出级别
|
# 输出级别
|
||||||
level:
|
level:
|
||||||
cn.lili: info
|
root: info
|
||||||
# org.hibernate: debug
|
# org.hibernate: debug
|
||||||
# org.springframework: debug
|
# org.springframework: debug
|
||||||
# org.springframework.data.mongodb.core: debug
|
|
||||||
file:
|
file:
|
||||||
# 指定路径
|
# 指定路径
|
||||||
path: lili-logs
|
path: lili-logs
|
||||||
|
|||||||
@@ -72,8 +72,8 @@ spring:
|
|||||||
url: jdbc:mysql://192.168.0.116:3306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://192.168.0.116:3306/lilishop?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||||
username: root
|
username: root
|
||||||
password: lilishop
|
password: lilishop
|
||||||
maxActive: 20
|
maxActive: 50
|
||||||
initialSize: 5
|
initialSize: 20
|
||||||
maxWait: 60000
|
maxWait: 60000
|
||||||
minIdle: 5
|
minIdle: 5
|
||||||
timeBetweenEvictionRunsMillis: 60000
|
timeBetweenEvictionRunsMillis: 60000
|
||||||
@@ -124,26 +124,31 @@ ignored:
|
|||||||
- /MP_verify_qSyvBPhDsPdxvOhC.txt
|
- /MP_verify_qSyvBPhDsPdxvOhC.txt
|
||||||
- /weixin/**
|
- /weixin/**
|
||||||
- /source/**
|
- /source/**
|
||||||
- /buyer/mini-program/**
|
- /store/passport/login/**
|
||||||
- /buyer/cashier/**
|
- /store/passport/login/refresh/**
|
||||||
- /buyer/pageData/**
|
- /common/common/slider/**
|
||||||
- /buyer/article/**
|
- /common/common/sms/**
|
||||||
|
- /buyer/payment/cashier/**
|
||||||
|
- /buyer/other/pageData/**
|
||||||
|
- /buyer/other/article/**
|
||||||
- /buyer/goods/**
|
- /buyer/goods/**
|
||||||
- /buyer/category/**
|
|
||||||
- /buyer/store/**
|
- /buyer/store/**
|
||||||
- /buyer/connect/**
|
- /buyer/passport/connect/**
|
||||||
- /buyer/members/**
|
- /buyer/members/**
|
||||||
|
- /buyer/passport/member/**
|
||||||
|
- /buyer/passport/member/refresh/**
|
||||||
- /buyer/promotion/pintuan/**
|
- /buyer/promotion/pintuan/**
|
||||||
- /buyer/promotion/seckill/**
|
- /buyer/promotion/seckill/**
|
||||||
- /buyer/promotion/pointsGoods/**
|
- /buyer/promotion/pointsGoods/**
|
||||||
- /buyer/promotion/coupon
|
- /buyer/promotion/coupon
|
||||||
- /buyer/memberEvaluation/**/goodsEvaluation
|
- /buyer/member/evaluation/**/goodsEvaluation
|
||||||
- /buyer/memberEvaluation/**/evaluationNumber
|
- /buyer/member/evaluation/**/evaluationNumber
|
||||||
- /buyer/appVersion/**
|
- /buyer/other/appVersion/**
|
||||||
- /buyer/broadcast/studio/**
|
- /buyer/broadcast/studio/**
|
||||||
- /store/login/**
|
- /manager/passport/user/login
|
||||||
- /manager/user/login
|
- /manager/passport/user/refresh/**
|
||||||
- /manager/user/refresh/**
|
- /manager/other/elasticsearch
|
||||||
|
- /manager/other/customWords
|
||||||
- /druid/**
|
- /druid/**
|
||||||
- /swagger-ui.html
|
- /swagger-ui.html
|
||||||
- /doc.html
|
- /doc.html
|
||||||
@@ -232,7 +237,7 @@ lili:
|
|||||||
# 0:不做脱敏处理
|
# 0:不做脱敏处理
|
||||||
# 1:管理端用户手机号等信息脱敏
|
# 1:管理端用户手机号等信息脱敏
|
||||||
# 2:商家端信息脱敏(为2时,表示管理端,商家端同时脱敏)
|
# 2:商家端信息脱敏(为2时,表示管理端,商家端同时脱敏)
|
||||||
# sensitiveLevel: 2
|
sensitiveLevel: 1
|
||||||
|
|
||||||
statistics:
|
statistics:
|
||||||
# 在线人数统计 X 小时。这里设置48,即统计过去48小时每小时在线人数
|
# 在线人数统计 X 小时。这里设置48,即统计过去48小时每小时在线人数
|
||||||
@@ -304,7 +309,6 @@ lili:
|
|||||||
notice-send-group: lili_send_notice_group
|
notice-send-group: lili_send_notice_group
|
||||||
rocketmq:
|
rocketmq:
|
||||||
name-server: 192.168.0.116:9876
|
name-server: 192.168.0.116:9876
|
||||||
namesrvAddr: 192.168.0.116:9876
|
|
||||||
isVIPChannel: false
|
isVIPChannel: false
|
||||||
producer:
|
producer:
|
||||||
group: lili_group
|
group: lili_group
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package cn.lili.event;
|
package cn.lili.event;
|
||||||
|
|
||||||
|
|
||||||
import cn.lili.modules.order.order.entity.dos.AfterSale;
|
import cn.lili.modules.order.aftersale.entity.dos.AfterSale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 售后单改变状态
|
* 售后单改变状态
|
||||||
|
|||||||
19
consumer/src/main/java/cn/lili/event/MemberLoginEvent.java
Normal file
19
consumer/src/main/java/cn/lili/event/MemberLoginEvent.java
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
package cn.lili.event;
|
||||||
|
|
||||||
|
import cn.lili.modules.member.entity.dos.Member;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员登录消息
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @since 2020/11/17 7:13 下午
|
||||||
|
*/
|
||||||
|
public interface MemberLoginEvent {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员登录
|
||||||
|
*
|
||||||
|
* @param member 会员
|
||||||
|
*/
|
||||||
|
void memberLogin(Member member);
|
||||||
|
}
|
||||||
@@ -11,7 +11,7 @@ import cn.lili.modules.member.entity.dos.Member;
|
|||||||
public interface MemberRegisterEvent {
|
public interface MemberRegisterEvent {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员登录
|
* 会员注册
|
||||||
*
|
*
|
||||||
* @param member 会员
|
* @param member 会员
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package cn.lili.event;
|
package cn.lili.event;
|
||||||
|
|
||||||
import cn.lili.modules.member.entity.dto.MemberWithdrawalMessage;
|
import cn.lili.modules.wallet.entity.dto.MemberWithdrawalMessage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员提现消息
|
* 会员提现消息
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import cn.lili.modules.distribution.entity.dos.DistributionOrder;
|
|||||||
import cn.lili.modules.distribution.entity.enums.DistributionOrderStatusEnum;
|
import cn.lili.modules.distribution.entity.enums.DistributionOrderStatusEnum;
|
||||||
import cn.lili.modules.distribution.mapper.DistributionOrderMapper;
|
import cn.lili.modules.distribution.mapper.DistributionOrderMapper;
|
||||||
import cn.lili.modules.distribution.service.DistributionOrderService;
|
import cn.lili.modules.distribution.service.DistributionOrderService;
|
||||||
import cn.lili.modules.order.order.entity.dos.AfterSale;
|
import cn.lili.modules.order.aftersale.entity.dos.AfterSale;
|
||||||
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
||||||
import cn.lili.modules.order.trade.entity.enums.AfterSaleStatusEnum;
|
import cn.lili.modules.order.trade.entity.enums.AfterSaleStatusEnum;
|
||||||
import cn.lili.timetask.handler.EveryDayExecute;
|
import cn.lili.timetask.handler.EveryDayExecute;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import cn.lili.common.utils.SnowFlake;
|
|||||||
import cn.lili.event.OrderStatusChangeEvent;
|
import cn.lili.event.OrderStatusChangeEvent;
|
||||||
import cn.lili.event.TradeEvent;
|
import cn.lili.event.TradeEvent;
|
||||||
import cn.lili.modules.goods.entity.dos.GoodsSku;
|
import cn.lili.modules.goods.entity.dos.GoodsSku;
|
||||||
|
import cn.lili.modules.goods.entity.enums.GoodsTypeEnum;
|
||||||
import cn.lili.modules.goods.service.GoodsSkuService;
|
import cn.lili.modules.goods.service.GoodsSkuService;
|
||||||
import cn.lili.modules.member.entity.enums.PointTypeEnum;
|
import cn.lili.modules.member.entity.enums.PointTypeEnum;
|
||||||
import cn.lili.modules.member.service.MemberService;
|
import cn.lili.modules.member.service.MemberService;
|
||||||
@@ -26,7 +27,7 @@ import cn.lili.modules.order.trade.entity.dos.OrderLog;
|
|||||||
import cn.lili.modules.order.trade.service.OrderLogService;
|
import cn.lili.modules.order.trade.service.OrderLogService;
|
||||||
import cn.lili.modules.promotion.service.MemberCouponService;
|
import cn.lili.modules.promotion.service.MemberCouponService;
|
||||||
import cn.lili.rocketmq.RocketmqSendCallbackBuilder;
|
import cn.lili.rocketmq.RocketmqSendCallbackBuilder;
|
||||||
import cn.lili.rocketmq.tags.MqOrderTagsEnum;
|
import cn.lili.rocketmq.tags.OrderTagsEnum;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -34,6 +35,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单状态处理类
|
* 订单状态处理类
|
||||||
@@ -82,7 +84,7 @@ public class FullDiscountExecute implements TradeEvent, OrderStatusChangeEvent {
|
|||||||
if ((cartVO.getGiftList() != null && !cartVO.getGiftList().isEmpty())
|
if ((cartVO.getGiftList() != null && !cartVO.getGiftList().isEmpty())
|
||||||
|| (cartVO.getGiftPoint() != null && cartVO.getGiftPoint() > 0)
|
|| (cartVO.getGiftPoint() != null && cartVO.getGiftPoint() > 0)
|
||||||
|| (cartVO.getGiftCouponList() != null && !cartVO.getGiftCouponList().isEmpty())) {
|
|| (cartVO.getGiftCouponList() != null && !cartVO.getGiftCouponList().isEmpty())) {
|
||||||
cache.put(CachePrefix.ORDER.getPrefix() + cartVO.getSn(), cartVO);
|
cache.put(CachePrefix.ORDER.getPrefix() + cartVO.getSn(), JSONUtil.toJsonStr(cartVO));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -90,9 +92,10 @@ public class FullDiscountExecute implements TradeEvent, OrderStatusChangeEvent {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void orderChange(OrderMessage orderMessage) {
|
public void orderChange(OrderMessage orderMessage) {
|
||||||
|
//如果订单已支付
|
||||||
if (orderMessage.getNewStatus().equals(OrderStatusEnum.PAID)) {
|
if (orderMessage.getNewStatus().equals(OrderStatusEnum.PAID)) {
|
||||||
log.debug("满减活动,订单状态操作 {}", CachePrefix.ORDER.getPrefix() + orderMessage.getOrderSn());
|
log.debug("满减活动,订单状态操作 {}", CachePrefix.ORDER.getPrefix() + orderMessage.getOrderSn());
|
||||||
renderGift((CartVO) cache.get(CachePrefix.ORDER.getPrefix() + orderMessage.getOrderSn()), orderMessage);
|
renderGift(JSONUtil.toBean(cache.getString(CachePrefix.ORDER.getPrefix() + orderMessage.getOrderSn()), CartVO.class), orderMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,58 +145,96 @@ public class FullDiscountExecute implements TradeEvent, OrderStatusChangeEvent {
|
|||||||
* @param originOrder 赠品原订单信息
|
* @param originOrder 赠品原订单信息
|
||||||
*/
|
*/
|
||||||
private void generatorGiftOrder(List<String> skuIds, Order originOrder) {
|
private void generatorGiftOrder(List<String> skuIds, Order originOrder) {
|
||||||
|
//获取赠品列表
|
||||||
|
List<GoodsSku> goodsSkus = goodsSkuService.getGoodsSkuByIdFromCache(skuIds);
|
||||||
|
|
||||||
|
//赠品判定
|
||||||
|
if (goodsSkus == null || goodsSkus.isEmpty()) {
|
||||||
|
log.error("赠品不存在:{}", skuIds);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//赠品分类,分为实体商品/虚拟商品/电子卡券
|
||||||
|
List<GoodsSku> physicalSkus = goodsSkus.stream().filter(goodsSku -> goodsSku.getGoodsType().equals(GoodsTypeEnum.PHYSICAL_GOODS.name())).collect(Collectors.toList());
|
||||||
|
List<GoodsSku> virtualSkus = goodsSkus.stream().filter(goodsSku -> goodsSku.getGoodsType().equals(GoodsTypeEnum.VIRTUAL_GOODS.name())).collect(Collectors.toList());
|
||||||
|
List<GoodsSku> eCouponSkus = goodsSkus.stream().filter(goodsSku -> goodsSku.getGoodsType().equals(GoodsTypeEnum.E_COUPON.name())).collect(Collectors.toList());
|
||||||
|
|
||||||
|
//如果赠品不为空,则生成对应的赠品订单
|
||||||
|
if (!physicalSkus.isEmpty()) {
|
||||||
|
giftOrderHandler(physicalSkus, originOrder, OrderTypeEnum.NORMAL);
|
||||||
|
}
|
||||||
|
if (!virtualSkus.isEmpty()) {
|
||||||
|
giftOrderHandler(virtualSkus, originOrder, OrderTypeEnum.VIRTUAL);
|
||||||
|
}
|
||||||
|
if (!eCouponSkus.isEmpty()) {
|
||||||
|
giftOrderHandler(eCouponSkus, originOrder, OrderTypeEnum.E_COUPON);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 赠品订单处理
|
||||||
|
*
|
||||||
|
* @param skuList 赠品列表
|
||||||
|
* @param originOrder 原始订单
|
||||||
|
* @param orderTypeEnum 订单类型
|
||||||
|
*/
|
||||||
|
private void giftOrderHandler(List<GoodsSku> skuList, Order originOrder, OrderTypeEnum orderTypeEnum) {
|
||||||
|
//初始化订单对象/订单日志/自订单
|
||||||
|
Order order = new Order();
|
||||||
List<OrderItem> orderItems = new ArrayList<>();
|
List<OrderItem> orderItems = new ArrayList<>();
|
||||||
List<OrderLog> orderLogs = new ArrayList<>();
|
List<OrderLog> orderLogs = new ArrayList<>();
|
||||||
Order order = new Order();
|
//初始化价格详情
|
||||||
PriceDetailDTO priceDetailDTO = new PriceDetailDTO();
|
PriceDetailDTO priceDetailDTO = new PriceDetailDTO();
|
||||||
|
//复制通用属性
|
||||||
BeanUtil.copyProperties(originOrder, order, "id");
|
BeanUtil.copyProperties(originOrder, order, "id");
|
||||||
BeanUtil.copyProperties(priceDetailDTO, order, "id");
|
BeanUtil.copyProperties(priceDetailDTO, order, "id");
|
||||||
|
//生成订单参数
|
||||||
order.setSn(SnowFlake.createStr("G"));
|
order.setSn(SnowFlake.createStr("G"));
|
||||||
order.setOrderType(OrderPromotionTypeEnum.GIFT.name());
|
order.setOrderPromotionType(OrderPromotionTypeEnum.GIFT.name());
|
||||||
order.setOrderStatus(OrderStatusEnum.UNPAID.name());
|
order.setOrderStatus(OrderStatusEnum.UNPAID.name());
|
||||||
order.setPayStatus(PayStatusEnum.PAID.name());
|
order.setPayStatus(PayStatusEnum.PAID.name());
|
||||||
order.setDeliverStatus(DeliverStatusEnum.UNDELIVERED.name());
|
order.setOrderType(orderTypeEnum.name());
|
||||||
order.setNeedReceipt(false);
|
order.setNeedReceipt(false);
|
||||||
order.setPriceDetailDTO(priceDetailDTO);
|
order.setPriceDetailDTO(priceDetailDTO);
|
||||||
order.setClientType(originOrder.getClientType());
|
order.setClientType(originOrder.getClientType());
|
||||||
|
//订单日志
|
||||||
String message = "赠品订单[" + order.getSn() + "]创建";
|
String message = "赠品订单[" + order.getSn() + "]创建";
|
||||||
orderLogs.add(new OrderLog(order.getSn(), originOrder.getMemberId(), UserEnums.MEMBER.name(), originOrder.getMemberName(), message));
|
orderLogs.add(new OrderLog(order.getSn(), originOrder.getMemberId(), UserEnums.MEMBER.name(), originOrder.getMemberName(), message));
|
||||||
|
|
||||||
for (String skuId : skuIds) {
|
//生成子订单
|
||||||
GoodsSku goodsSkuByIdFromCache = goodsSkuService.getGoodsSkuByIdFromCache(skuId);
|
for (GoodsSku goodsSku : skuList) {
|
||||||
OrderItem orderItem = new OrderItem();
|
OrderItem orderItem = new OrderItem();
|
||||||
BeanUtil.copyProperties(goodsSkuByIdFromCache, orderItem, "id");
|
BeanUtil.copyProperties(goodsSku, orderItem, "id");
|
||||||
BeanUtil.copyProperties(priceDetailDTO, orderItem, "id");
|
BeanUtil.copyProperties(priceDetailDTO, orderItem, "id");
|
||||||
orderItem.setAfterSaleStatus(OrderItemAfterSaleStatusEnum.NEW.name());
|
orderItem.setAfterSaleStatus(OrderItemAfterSaleStatusEnum.NEW.name());
|
||||||
orderItem.setCommentStatus(CommentStatusEnum.NEW.name());
|
orderItem.setCommentStatus(CommentStatusEnum.NEW.name());
|
||||||
orderItem.setComplainStatus(OrderComplaintStatusEnum.NEW.name());
|
orderItem.setComplainStatus(OrderComplaintStatusEnum.NEW.name());
|
||||||
orderItem.setNum(1);
|
orderItem.setNum(1);
|
||||||
orderItem.setOrderSn(order.getSn());
|
orderItem.setOrderSn(order.getSn());
|
||||||
orderItem.setImage(goodsSkuByIdFromCache.getThumbnail());
|
orderItem.setImage(goodsSku.getThumbnail());
|
||||||
orderItem.setGoodsName(goodsSkuByIdFromCache.getGoodsName());
|
orderItem.setGoodsName(goodsSku.getGoodsName());
|
||||||
orderItem.setSkuId(goodsSkuByIdFromCache.getId());
|
orderItem.setSkuId(goodsSku.getId());
|
||||||
orderItem.setCategoryId(goodsSkuByIdFromCache.getCategoryPath().substring(
|
orderItem.setCategoryId(goodsSku.getCategoryPath().substring(
|
||||||
goodsSkuByIdFromCache.getCategoryPath().lastIndexOf(",") + 1
|
goodsSku.getCategoryPath().lastIndexOf(",") + 1
|
||||||
));
|
));
|
||||||
orderItem.setGoodsPrice(goodsSkuByIdFromCache.getPrice());
|
orderItem.setGoodsPrice(goodsSku.getPrice());
|
||||||
orderItem.setPriceDetailDTO(priceDetailDTO);
|
orderItem.setPriceDetailDTO(priceDetailDTO);
|
||||||
orderItems.add(orderItem);
|
orderItems.add(orderItem);
|
||||||
}
|
}
|
||||||
|
//保存订单
|
||||||
orderService.save(order);
|
orderService.save(order);
|
||||||
orderItemService.saveBatch(orderItems);
|
orderItemService.saveBatch(orderItems);
|
||||||
orderLogService.saveBatch(orderLogs);
|
orderLogService.saveBatch(orderLogs);
|
||||||
|
|
||||||
|
|
||||||
//发送订单已付款消息
|
//发送订单已付款消息(PS:不在这里处理逻辑是因为期望加交给消费者统一处理库存等等问题)
|
||||||
OrderMessage orderMessage = new OrderMessage();
|
OrderMessage orderMessage = new OrderMessage();
|
||||||
orderMessage.setOrderSn(order.getSn());
|
orderMessage.setOrderSn(order.getSn());
|
||||||
orderMessage.setPaymentMethod(order.getPaymentMethod());
|
orderMessage.setPaymentMethod(order.getPaymentMethod());
|
||||||
orderMessage.setNewStatus(OrderStatusEnum.PAID);
|
orderMessage.setNewStatus(OrderStatusEnum.PAID);
|
||||||
|
|
||||||
String destination = rocketmqCustomProperties.getOrderTopic() + ":" + MqOrderTagsEnum.STATUS_CHANGE.name();
|
String destination = rocketmqCustomProperties.getOrderTopic() + ":" + OrderTagsEnum.STATUS_CHANGE.name();
|
||||||
//发送订单变更mq消息
|
//发送订单变更mq消息
|
||||||
rocketMQTemplate.asyncSend(destination, JSONUtil.toJsonStr(orderMessage), RocketmqSendCallbackBuilder.commonCallback());
|
rocketMQTemplate.asyncSend(destination, JSONUtil.toJsonStr(orderMessage), RocketmqSendCallbackBuilder.commonCallback());
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
25
consumer/src/main/java/cn/lili/event/impl/MemberExecute.java
Normal file
25
consumer/src/main/java/cn/lili/event/impl/MemberExecute.java
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
package cn.lili.event.impl;
|
||||||
|
|
||||||
|
import cn.lili.event.MemberLoginEvent;
|
||||||
|
import cn.lili.modules.member.entity.dos.Member;
|
||||||
|
import cn.lili.modules.member.service.MemberService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员自身业务
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @version v1.0
|
||||||
|
* 2022-01-11 11:08
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MemberExecute implements MemberLoginEvent {
|
||||||
|
@Autowired
|
||||||
|
private MemberService memberService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void memberLogin(Member member) {
|
||||||
|
memberService.updateMemberLoginTime(member.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package cn.lili.event.impl;
|
package cn.lili.event.impl;
|
||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.convert.Convert;
|
|
||||||
import cn.lili.common.utils.CurrencyUtil;
|
import cn.lili.common.utils.CurrencyUtil;
|
||||||
import cn.lili.common.utils.StringUtils;
|
import cn.lili.common.utils.StringUtils;
|
||||||
import cn.lili.event.AfterSaleStatusChangeEvent;
|
import cn.lili.event.AfterSaleStatusChangeEvent;
|
||||||
@@ -12,11 +11,10 @@ import cn.lili.modules.member.entity.dos.Member;
|
|||||||
import cn.lili.modules.member.entity.dos.MemberEvaluation;
|
import cn.lili.modules.member.entity.dos.MemberEvaluation;
|
||||||
import cn.lili.modules.member.entity.enums.PointTypeEnum;
|
import cn.lili.modules.member.entity.enums.PointTypeEnum;
|
||||||
import cn.lili.modules.member.service.MemberService;
|
import cn.lili.modules.member.service.MemberService;
|
||||||
import cn.lili.modules.order.order.entity.dos.AfterSale;
|
import cn.lili.modules.order.aftersale.entity.dos.AfterSale;
|
||||||
import cn.lili.modules.order.order.entity.dos.Order;
|
import cn.lili.modules.order.order.entity.dos.Order;
|
||||||
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
||||||
import cn.lili.modules.order.order.entity.enums.OrderPromotionTypeEnum;
|
import cn.lili.modules.order.order.entity.enums.OrderPromotionTypeEnum;
|
||||||
import cn.lili.modules.order.order.entity.enums.OrderStatusEnum;
|
|
||||||
import cn.lili.modules.order.order.entity.enums.PayStatusEnum;
|
import cn.lili.modules.order.order.entity.enums.PayStatusEnum;
|
||||||
import cn.lili.modules.order.order.service.OrderService;
|
import cn.lili.modules.order.order.service.OrderService;
|
||||||
import cn.lili.modules.order.trade.entity.enums.AfterSaleStatusEnum;
|
import cn.lili.modules.order.trade.entity.enums.AfterSaleStatusEnum;
|
||||||
@@ -105,14 +103,18 @@ public class MemberPointExecute implements MemberRegisterEvent, GoodsCommentComp
|
|||||||
}
|
}
|
||||||
case COMPLETED: {
|
case COMPLETED: {
|
||||||
Order order = orderService.getBySn(orderMessage.getOrderSn());
|
Order order = orderService.getBySn(orderMessage.getOrderSn());
|
||||||
//根据订单编号获取订单数据,如果订单促销类型不为空,并且订单促销类型为积分订单 则直接返回
|
//如果是积分订单 则直接返回
|
||||||
if (StringUtils.isNotEmpty(order.getOrderPromotionType()) && order.getOrderPromotionType().equals(OrderPromotionTypeEnum.POINTS.name())) {
|
if (StringUtils.isNotEmpty(order.getOrderPromotionType())
|
||||||
|
&& order.getOrderPromotionType().equals(OrderPromotionTypeEnum.POINTS.name())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//获取积分设置
|
//获取积分设置
|
||||||
PointSetting pointSetting = getPointSetting();
|
PointSetting pointSetting = getPointSetting();
|
||||||
|
if (pointSetting.getConsumer() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
//计算赠送积分数量
|
//计算赠送积分数量
|
||||||
Double point = CurrencyUtil.mul(pointSetting.getMoney(), order.getFlowPrice(), 0);
|
Double point = CurrencyUtil.mul(pointSetting.getConsumer(), order.getFlowPrice(), 0);
|
||||||
//赠送会员积分
|
//赠送会员积分
|
||||||
memberService.updateMemberPoint(point.longValue(), PointTypeEnum.INCREASE.name(), order.getMemberId(), "会员下单,赠送积分" + point + "分");
|
memberService.updateMemberPoint(point.longValue(), PointTypeEnum.INCREASE.name(), order.getMemberId(), "会员下单,赠送积分" + point + "分");
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ package cn.lili.event.impl;
|
|||||||
|
|
||||||
import cn.lili.event.MemberRegisterEvent;
|
import cn.lili.event.MemberRegisterEvent;
|
||||||
import cn.lili.modules.member.entity.dos.Member;
|
import cn.lili.modules.member.entity.dos.Member;
|
||||||
import cn.lili.modules.member.service.MemberWalletService;
|
import cn.lili.modules.wallet.service.MemberWalletService;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -22,6 +21,7 @@ public class MemberWalletExecute implements MemberRegisterEvent {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void memberRegister(Member member) {
|
public void memberRegister(Member member) {
|
||||||
memberWalletService.save(member.getId(),member.getUsername());
|
// 有些情况下,会同时创建一个member_id的两条数据
|
||||||
|
// memberWalletService.save(member.getId(),member.getUsername());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,22 +2,22 @@ package cn.lili.event.impl;
|
|||||||
|
|
||||||
import cn.lili.event.*;
|
import cn.lili.event.*;
|
||||||
import cn.lili.modules.member.entity.dto.MemberPointMessage;
|
import cn.lili.modules.member.entity.dto.MemberPointMessage;
|
||||||
import cn.lili.modules.member.entity.dto.MemberWithdrawalMessage;
|
|
||||||
import cn.lili.modules.member.entity.enums.MemberWithdrawalDestinationEnum;
|
|
||||||
import cn.lili.modules.member.entity.enums.PointTypeEnum;
|
import cn.lili.modules.member.entity.enums.PointTypeEnum;
|
||||||
import cn.lili.modules.member.entity.enums.WithdrawStatusEnum;
|
|
||||||
import cn.lili.modules.message.entity.dto.NoticeMessageDTO;
|
import cn.lili.modules.message.entity.dto.NoticeMessageDTO;
|
||||||
import cn.lili.modules.message.entity.enums.NoticeMessageNodeEnum;
|
import cn.lili.modules.message.entity.enums.NoticeMessageNodeEnum;
|
||||||
import cn.lili.modules.message.entity.enums.NoticeMessageParameterEnum;
|
import cn.lili.modules.message.entity.enums.NoticeMessageParameterEnum;
|
||||||
import cn.lili.modules.message.service.NoticeMessageService;
|
import cn.lili.modules.message.service.NoticeMessageService;
|
||||||
|
import cn.lili.modules.order.aftersale.entity.dos.AfterSale;
|
||||||
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
||||||
import cn.lili.modules.order.order.entity.dos.AfterSale;
|
|
||||||
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
||||||
import cn.lili.modules.order.order.entity.enums.OrderPromotionTypeEnum;
|
import cn.lili.modules.order.order.entity.enums.OrderPromotionTypeEnum;
|
||||||
import cn.lili.modules.order.order.entity.vo.OrderDetailVO;
|
import cn.lili.modules.order.order.entity.vo.OrderDetailVO;
|
||||||
import cn.lili.modules.order.order.service.OrderService;
|
import cn.lili.modules.order.order.service.OrderService;
|
||||||
import cn.lili.modules.order.trade.entity.enums.AfterSaleStatusEnum;
|
import cn.lili.modules.order.trade.entity.enums.AfterSaleStatusEnum;
|
||||||
import cn.lili.modules.order.trade.entity.enums.AfterSaleTypeEnum;
|
import cn.lili.modules.order.trade.entity.enums.AfterSaleTypeEnum;
|
||||||
|
import cn.lili.modules.wallet.entity.dto.MemberWithdrawalMessage;
|
||||||
|
import cn.lili.modules.wallet.entity.enums.MemberWithdrawalDestinationEnum;
|
||||||
|
import cn.lili.modules.wallet.entity.enums.WithdrawStatusEnum;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import cn.lili.modules.order.order.entity.dos.Receipt;
|
|||||||
import cn.lili.modules.order.order.entity.vo.OrderVO;
|
import cn.lili.modules.order.order.entity.vo.OrderVO;
|
||||||
import cn.lili.modules.order.order.entity.vo.ReceiptVO;
|
import cn.lili.modules.order.order.entity.vo.ReceiptVO;
|
||||||
import cn.lili.modules.order.order.service.ReceiptService;
|
import cn.lili.modules.order.order.service.ReceiptService;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -34,25 +33,23 @@ public class OrderCreateReceiptExecute implements TradeEvent {
|
|||||||
//获取发票信息
|
//获取发票信息
|
||||||
ReceiptVO receiptVO = tradeDTO.getReceiptVO();
|
ReceiptVO receiptVO = tradeDTO.getReceiptVO();
|
||||||
//如果需要获取发票则保存发票信息
|
//如果需要获取发票则保存发票信息
|
||||||
if (tradeDTO.getNeedReceipt()) {
|
if (Boolean.TRUE.equals(tradeDTO.getNeedReceipt()) && !orderList.isEmpty()) {
|
||||||
if (orderList.size() > 0) {
|
List<Receipt> receipts = new ArrayList<>();
|
||||||
List<Receipt> receipts = new ArrayList<>();
|
for (OrderVO orderVO : orderList) {
|
||||||
for (OrderVO orderVO : orderList) {
|
Receipt receipt = new Receipt();
|
||||||
Receipt receipt = new Receipt();
|
BeanUtil.copyProperties(receiptVO, receipt);
|
||||||
BeanUtil.copyProperties(receiptVO, receipt);
|
receipt.setMemberId(orderVO.getMemberId());
|
||||||
receipt.setMemberId(orderVO.getMemberId());
|
receipt.setMemberName(orderVO.getMemberName());
|
||||||
receipt.setMemberName(orderVO.getMemberName());
|
receipt.setStoreId(orderVO.getStoreId());
|
||||||
receipt.setStoreId(orderVO.getStoreId());
|
receipt.setStoreName(orderVO.getStoreName());
|
||||||
receipt.setStoreName(orderVO.getStoreName());
|
receipt.setOrderSn(orderVO.getSn());
|
||||||
receipt.setOrderSn(orderVO.getSn());
|
receipt.setReceiptDetail(JSONUtil.toJsonStr(orderVO.getOrderItems()));
|
||||||
receipt.setReceiptDetail(JSONUtil.toJsonStr(orderVO.getOrderItems()));
|
receipt.setReceiptPrice(orderVO.getFlowPrice());
|
||||||
receipt.setReceiptPrice(orderVO.getFlowPrice());
|
receipt.setReceiptStatus(0);
|
||||||
receipt.setReceiptStatus(0);
|
receipts.add(receipt);
|
||||||
receipts.add(receipt);
|
|
||||||
}
|
|
||||||
//保存发票
|
|
||||||
receiptService.saveBatch(receipts);
|
|
||||||
}
|
}
|
||||||
|
//保存发票
|
||||||
|
receiptService.saveBatch(receipts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,10 @@ import cn.lili.event.MemberRegisterEvent;
|
|||||||
import cn.lili.modules.member.entity.dos.Member;
|
import cn.lili.modules.member.entity.dos.Member;
|
||||||
import cn.lili.modules.promotion.entity.dos.CouponActivity;
|
import cn.lili.modules.promotion.entity.dos.CouponActivity;
|
||||||
import cn.lili.modules.promotion.entity.enums.CouponActivityTypeEnum;
|
import cn.lili.modules.promotion.entity.enums.CouponActivityTypeEnum;
|
||||||
import cn.lili.modules.promotion.entity.enums.PromotionStatusEnum;
|
import cn.lili.modules.promotion.entity.enums.PromotionsStatusEnum;
|
||||||
import cn.lili.modules.promotion.service.CouponActivityService;
|
import cn.lili.modules.promotion.service.CouponActivityService;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import cn.lili.modules.promotion.tools.PromotionTools;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@@ -32,10 +33,9 @@ public class RegisteredCouponActivityExecute implements MemberRegisterEvent {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void memberRegister(Member member) {
|
public void memberRegister(Member member) {
|
||||||
List<CouponActivity> couponActivities = couponActivityService.list(new LambdaQueryWrapper<CouponActivity>()
|
List<CouponActivity> couponActivities = couponActivityService.list(new QueryWrapper<CouponActivity>()
|
||||||
.eq(CouponActivity::getCouponActivityType, CouponActivityTypeEnum.REGISTERED.name())
|
.eq("coupon_activity_type", CouponActivityTypeEnum.REGISTERED.name())
|
||||||
.eq(CouponActivity::getPromotionStatus, PromotionStatusEnum.START.name()));
|
.and(PromotionTools.queryPromotionStatus(PromotionsStatusEnum.START)));
|
||||||
couponActivityService.registered(couponActivities, member);
|
couponActivityService.registered(couponActivities, member);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,14 +14,18 @@ import cn.lili.modules.order.order.service.OrderService;
|
|||||||
import cn.lili.modules.promotion.entity.dos.KanjiaActivity;
|
import cn.lili.modules.promotion.entity.dos.KanjiaActivity;
|
||||||
import cn.lili.modules.promotion.entity.dos.PromotionGoods;
|
import cn.lili.modules.promotion.entity.dos.PromotionGoods;
|
||||||
import cn.lili.modules.promotion.entity.dto.KanjiaActivityGoodsDTO;
|
import cn.lili.modules.promotion.entity.dto.KanjiaActivityGoodsDTO;
|
||||||
|
import cn.lili.modules.promotion.entity.dto.search.PromotionGoodsSearchParams;
|
||||||
import cn.lili.modules.promotion.entity.vos.PointsGoodsVO;
|
import cn.lili.modules.promotion.entity.vos.PointsGoodsVO;
|
||||||
import cn.lili.modules.promotion.service.*;
|
import cn.lili.modules.promotion.service.KanjiaActivityGoodsService;
|
||||||
|
import cn.lili.modules.promotion.service.KanjiaActivityService;
|
||||||
|
import cn.lili.modules.promotion.service.PointsGoodsService;
|
||||||
|
import cn.lili.modules.promotion.service.PromotionGoodsService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
import org.springframework.data.redis.core.script.DefaultRedisScript;
|
import org.springframework.data.redis.core.script.DefaultRedisScript;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -62,11 +66,6 @@ public class StockUpdateExecute implements OrderStatusChangeEvent {
|
|||||||
*/
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
private PromotionGoodsService promotionGoodsService;
|
private PromotionGoodsService promotionGoodsService;
|
||||||
/**
|
|
||||||
* 促销商品
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
private SeckillApplyService seckillApplyService;
|
|
||||||
/**
|
/**
|
||||||
* 缓存
|
* 缓存
|
||||||
*/
|
*/
|
||||||
@@ -79,10 +78,9 @@ public class StockUpdateExecute implements OrderStatusChangeEvent {
|
|||||||
private KanjiaActivityGoodsService kanjiaActivityGoodsService;
|
private KanjiaActivityGoodsService kanjiaActivityGoodsService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private PointsGoodsService pointsGoodsService;
|
private PointsGoodsService pointsGoodsService;
|
||||||
@Autowired
|
|
||||||
private MongoTemplate mongoTemplate;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void orderChange(OrderMessage orderMessage) {
|
public void orderChange(OrderMessage orderMessage) {
|
||||||
|
|
||||||
switch (orderMessage.getNewStatus()) {
|
switch (orderMessage.getNewStatus()) {
|
||||||
@@ -158,14 +156,11 @@ public class StockUpdateExecute implements OrderStatusChangeEvent {
|
|||||||
* @param stocks
|
* @param stocks
|
||||||
*/
|
*/
|
||||||
private void checkStocks(List<Integer> stocks, OrderDetailVO order) {
|
private void checkStocks(List<Integer> stocks, OrderDetailVO order) {
|
||||||
for (int i = 0; i < stocks.size(); i++) {
|
if (order.getOrderItems().size() == stocks.size()) {
|
||||||
if (null == stocks.get(i)) {
|
return;
|
||||||
initSkuCache(order.getOrderItems());
|
|
||||||
initPromotionCache(order.getOrderItems());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
initSkuCache(order.getOrderItems());
|
||||||
|
initPromotionCache(order.getOrderItems());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -202,10 +197,10 @@ public class StockUpdateExecute implements OrderStatusChangeEvent {
|
|||||||
|
|
||||||
switch (promotionTypeEnum) {
|
switch (promotionTypeEnum) {
|
||||||
case KANJIA:
|
case KANJIA:
|
||||||
cache.put(cacheKey, kanjiaActivityGoodsService.getKanJiaGoodsBySku(orderItem.getSkuId()).getStock().intValue());
|
cache.put(cacheKey, kanjiaActivityGoodsService.getKanjiaGoodsBySkuId(orderItem.getSkuId()).getStock());
|
||||||
return;
|
return;
|
||||||
case POINTS_GOODS:
|
case POINTS_GOODS:
|
||||||
cache.put(cacheKey, pointsGoodsService.getPointsGoodsVOByMongo(orderItem.getSkuId()).getActiveStock().intValue());
|
cache.put(cacheKey, pointsGoodsService.getPointsGoodsDetailBySkuId(orderItem.getSkuId()).getActiveStock());
|
||||||
return;
|
return;
|
||||||
case SECKILL:
|
case SECKILL:
|
||||||
case PINTUAN:
|
case PINTUAN:
|
||||||
@@ -294,23 +289,27 @@ public class StockUpdateExecute implements OrderStatusChangeEvent {
|
|||||||
kanjiaActivityGoodsDTO.setStock(stock);
|
kanjiaActivityGoodsDTO.setStock(stock);
|
||||||
|
|
||||||
kanjiaActivityGoodsService.updateById(kanjiaActivityGoodsDTO);
|
kanjiaActivityGoodsService.updateById(kanjiaActivityGoodsDTO);
|
||||||
this.mongoTemplate.save(kanjiaActivityGoodsDTO);
|
|
||||||
//修改积分商品库存
|
//修改积分商品库存
|
||||||
} else if (promotionTypeEnum.equals(PromotionTypeEnum.POINTS_GOODS)) {
|
} else if (promotionTypeEnum.equals(PromotionTypeEnum.POINTS_GOODS)) {
|
||||||
PointsGoodsVO pointsGoodsVO = pointsGoodsService.getPointsGoodsDetail(orderItem.getPromotionId());
|
PointsGoodsVO pointsGoodsVO = pointsGoodsService.getPointsGoodsDetail(orderItem.getPromotionId());
|
||||||
Integer stock = Integer.parseInt(cache.get(PromotionGoodsService.getPromotionGoodsStockCacheKey(promotionTypeEnum, orderItem.getPromotionId(), orderItem.getSkuId())).toString());
|
Integer stock = Integer.parseInt(cache.get(PromotionGoodsService.getPromotionGoodsStockCacheKey(promotionTypeEnum, orderItem.getPromotionId(), orderItem.getSkuId())).toString());
|
||||||
pointsGoodsVO.setActiveStock(stock);
|
pointsGoodsVO.setActiveStock(stock);
|
||||||
pointsGoodsService.updateById(pointsGoodsVO);
|
pointsGoodsService.updateById(pointsGoodsVO);
|
||||||
this.mongoTemplate.save(pointsGoodsVO);
|
|
||||||
} else {
|
} else {
|
||||||
PromotionGoods pGoods = promotionGoodsService.getPromotionGoods(promotionTypeEnum, orderItem.getPromotionId(), orderItem.getSkuId());
|
PromotionGoodsSearchParams searchParams = new PromotionGoodsSearchParams();
|
||||||
|
searchParams.setPromotionType(promotionTypeEnum.name());
|
||||||
|
searchParams.setPromotionId(orderItem.getPromotionId());
|
||||||
|
searchParams.setSkuId(orderItem.getSkuId());
|
||||||
|
PromotionGoods pGoods = promotionGoodsService.getPromotionsGoods(searchParams);
|
||||||
//记录需要更新的促销库存信息
|
//记录需要更新的促销库存信息
|
||||||
promotionKey.add(
|
promotionKey.add(
|
||||||
PromotionGoodsService.getPromotionGoodsStockCacheKey(
|
PromotionGoodsService.getPromotionGoodsStockCacheKey(
|
||||||
promotionTypeEnum,
|
promotionTypeEnum,
|
||||||
orderItem.getPromotionId(), orderItem.getSkuId())
|
orderItem.getPromotionId(), orderItem.getSkuId())
|
||||||
);
|
);
|
||||||
promotionGoods.add(pGoods);
|
if (pGoods != null) {
|
||||||
|
promotionGoods.add(pGoods);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
goodsSkus.add(goodsSku);
|
goodsSkus.add(goodsSku);
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ package cn.lili.event.impl;
|
|||||||
|
|
||||||
import cn.lili.event.OrderStatusChangeEvent;
|
import cn.lili.event.OrderStatusChangeEvent;
|
||||||
import cn.lili.event.TradeEvent;
|
import cn.lili.event.TradeEvent;
|
||||||
import cn.lili.modules.message.util.WechatMessageUtil;
|
|
||||||
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
||||||
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
||||||
import cn.lili.modules.order.order.entity.vo.OrderVO;
|
import cn.lili.modules.order.order.entity.vo.OrderVO;
|
||||||
|
import cn.lili.modules.wechat.util.WechatMessageUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|||||||
34
consumer/src/main/java/cn/lili/init/SensitiveWordsInit.java
Normal file
34
consumer/src/main/java/cn/lili/init/SensitiveWordsInit.java
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
package cn.lili.init;
|
||||||
|
|
||||||
|
import cn.lili.modules.system.service.SensitiveWordsService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.ApplicationArguments;
|
||||||
|
import org.springframework.boot.ApplicationRunner;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SensitiveWordsInit
|
||||||
|
*
|
||||||
|
* @author Chopper
|
||||||
|
* @version v1.0
|
||||||
|
* 2021-11-29 11:38
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class SensitiveWordsInit implements ApplicationRunner {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SensitiveWordsService sensitiveWordsService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* consumer 启动时,实时更新一下过滤词
|
||||||
|
*
|
||||||
|
* @param args 启动参数
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void run(ApplicationArguments args) {
|
||||||
|
sensitiveWordsService.resetCache();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
package cn.lili.listener;
|
package cn.lili.listener;
|
||||||
|
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import cn.lili.rocketmq.tags.AfterSaleTagsEnum;
|
|
||||||
import cn.lili.event.AfterSaleStatusChangeEvent;
|
import cn.lili.event.AfterSaleStatusChangeEvent;
|
||||||
import cn.lili.modules.order.order.entity.dos.AfterSale;
|
import cn.lili.modules.order.aftersale.entity.dos.AfterSale;
|
||||||
|
import cn.lili.rocketmq.tags.AfterSaleTagsEnum;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.rocketmq.common.message.MessageExt;
|
import org.apache.rocketmq.common.message.MessageExt;
|
||||||
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
|
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
|
||||||
@@ -17,7 +17,6 @@ import java.util.List;
|
|||||||
* 售后通知
|
* 售后通知
|
||||||
*
|
*
|
||||||
* @author paulG
|
* @author paulG
|
||||||
* @since 2020/12/9
|
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
|
|||||||
@@ -3,52 +3,44 @@ package cn.lili.listener;
|
|||||||
import cn.hutool.core.map.MapUtil;
|
import cn.hutool.core.map.MapUtil;
|
||||||
import cn.hutool.core.text.CharSequenceUtil;
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
import cn.hutool.core.util.ArrayUtil;
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
|
import cn.hutool.core.util.ClassLoaderUtil;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import cn.lili.common.properties.RocketmqCustomProperties;
|
|
||||||
import cn.lili.event.GoodsCommentCompleteEvent;
|
import cn.lili.event.GoodsCommentCompleteEvent;
|
||||||
import cn.lili.modules.distribution.entity.dos.DistributionGoods;
|
import cn.lili.modules.distribution.entity.dos.DistributionGoods;
|
||||||
import cn.lili.modules.distribution.entity.dos.DistributionSelectedGoods;
|
import cn.lili.modules.distribution.entity.dto.DistributionGoodsSearchParams;
|
||||||
import cn.lili.modules.distribution.service.DistributionGoodsService;
|
import cn.lili.modules.distribution.service.DistributionGoodsService;
|
||||||
import cn.lili.modules.distribution.service.DistributionSelectedGoodsService;
|
import cn.lili.modules.distribution.service.DistributionSelectedGoodsService;
|
||||||
import cn.lili.modules.goods.entity.dos.Brand;
|
import cn.lili.modules.goods.entity.dos.*;
|
||||||
import cn.lili.modules.goods.entity.dos.Category;
|
|
||||||
import cn.lili.modules.goods.entity.dos.Goods;
|
|
||||||
import cn.lili.modules.goods.entity.dos.GoodsSku;
|
|
||||||
import cn.lili.modules.goods.entity.dto.GoodsCompleteMessage;
|
import cn.lili.modules.goods.entity.dto.GoodsCompleteMessage;
|
||||||
import cn.lili.modules.goods.entity.dto.GoodsParamsDTO;
|
import cn.lili.modules.goods.entity.dto.GoodsParamsDTO;
|
||||||
|
import cn.lili.modules.goods.entity.dto.GoodsSearchParams;
|
||||||
import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;
|
import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;
|
||||||
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
|
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
|
||||||
import cn.lili.modules.goods.service.BrandService;
|
import cn.lili.modules.goods.service.*;
|
||||||
import cn.lili.modules.goods.service.CategoryService;
|
|
||||||
import cn.lili.modules.goods.service.GoodsService;
|
|
||||||
import cn.lili.modules.goods.service.GoodsSkuService;
|
|
||||||
import cn.lili.modules.member.entity.dos.FootPrint;
|
import cn.lili.modules.member.entity.dos.FootPrint;
|
||||||
import cn.lili.modules.member.entity.dos.MemberEvaluation;
|
import cn.lili.modules.member.entity.dos.MemberEvaluation;
|
||||||
import cn.lili.modules.member.service.FootprintService;
|
import cn.lili.modules.member.service.FootprintService;
|
||||||
import cn.lili.modules.member.service.GoodsCollectionService;
|
import cn.lili.modules.member.service.GoodsCollectionService;
|
||||||
|
import cn.lili.modules.promotion.entity.dos.BasePromotions;
|
||||||
|
import cn.lili.modules.promotion.entity.dos.PromotionGoods;
|
||||||
|
import cn.lili.modules.promotion.entity.dto.search.PromotionGoodsSearchParams;
|
||||||
|
import cn.lili.modules.promotion.entity.enums.PromotionsScopeTypeEnum;
|
||||||
|
import cn.lili.modules.promotion.service.PromotionGoodsService;
|
||||||
|
import cn.lili.modules.promotion.service.PromotionService;
|
||||||
import cn.lili.modules.search.entity.dos.EsGoodsIndex;
|
import cn.lili.modules.search.entity.dos.EsGoodsIndex;
|
||||||
import cn.lili.modules.search.service.EsGoodsIndexService;
|
import cn.lili.modules.search.service.EsGoodsIndexService;
|
||||||
import cn.lili.modules.search.utils.EsIndexUtil;
|
|
||||||
import cn.lili.modules.store.entity.dos.StoreGoodsLabel;
|
|
||||||
import cn.lili.modules.store.service.StoreGoodsLabelService;
|
|
||||||
import cn.lili.modules.store.service.StoreService;
|
import cn.lili.modules.store.service.StoreService;
|
||||||
import cn.lili.rocketmq.RocketmqSendCallbackBuilder;
|
|
||||||
import cn.lili.rocketmq.tags.GoodsTagsEnum;
|
import cn.lili.rocketmq.tags.GoodsTagsEnum;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.rocketmq.common.message.MessageExt;
|
import org.apache.rocketmq.common.message.MessageExt;
|
||||||
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
|
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
|
||||||
import org.apache.rocketmq.spring.core.RocketMQListener;
|
import org.apache.rocketmq.spring.core.RocketMQListener;
|
||||||
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Arrays;
|
import java.util.stream.Collectors;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品消息
|
* 商品消息
|
||||||
@@ -122,16 +114,11 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private StoreGoodsLabelService storeGoodsLabelService;
|
private StoreGoodsLabelService storeGoodsLabelService;
|
||||||
|
|
||||||
/**
|
|
||||||
* rocketMq
|
|
||||||
*/
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RocketMQTemplate rocketMQTemplate;
|
private PromotionService promotionService;
|
||||||
/**
|
|
||||||
* rocketMq配置
|
|
||||||
*/
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RocketmqCustomProperties rocketmqCustomProperties;
|
private PromotionGoodsService promotionGoodsService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMessage(MessageExt messageExt) {
|
public void onMessage(MessageExt messageExt) {
|
||||||
@@ -145,17 +132,31 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
//生成索引
|
//生成索引
|
||||||
case GENERATOR_GOODS_INDEX:
|
case GENERATOR_GOODS_INDEX:
|
||||||
try {
|
try {
|
||||||
String goodsJsonStr = new String(messageExt.getBody());
|
String goodsId = new String(messageExt.getBody());
|
||||||
Goods goods = JSONUtil.toBean(goodsJsonStr, Goods.class);
|
log.info("生成索引: {}", goodsId);
|
||||||
|
Goods goods = this.goodsService.getById(goodsId);
|
||||||
updateGoodsIndex(goods);
|
updateGoodsIndex(goods);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("生成商品索引事件执行异常,商品信息 {}", new String(messageExt.getBody()));
|
log.error("生成商品索引事件执行异常,商品信息 {}", new String(messageExt.getBody()));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case UPDATE_GOODS_INDEX_PROMOTIONS:
|
||||||
|
this.updateGoodsIndexPromotions(new String(messageExt.getBody()));
|
||||||
|
break;
|
||||||
|
case DELETE_GOODS_INDEX_PROMOTIONS:
|
||||||
|
BasePromotions promotions = JSONUtil.toBean(new String(messageExt.getBody()), BasePromotions.class);
|
||||||
|
if (CharSequenceUtil.isNotEmpty(promotions.getScopeId())) {
|
||||||
|
this.goodsIndexService.deleteEsGoodsPromotionByPromotionId(Arrays.asList(promotions.getScopeId().split(",")), promotions.getId());
|
||||||
|
} else {
|
||||||
|
this.goodsIndexService.deleteEsGoodsPromotionByPromotionId(null, promotions.getId());
|
||||||
|
}
|
||||||
|
break;
|
||||||
case UPDATE_GOODS_INDEX:
|
case UPDATE_GOODS_INDEX:
|
||||||
try {
|
try {
|
||||||
String goodsIdsJsonStr = new String(messageExt.getBody());
|
String goodsIdsJsonStr = new String(messageExt.getBody());
|
||||||
List<Goods> goodsList = goodsService.list(new LambdaQueryWrapper<Goods>().in(Goods::getId, JSONUtil.toList(goodsIdsJsonStr, String.class)));
|
GoodsSearchParams searchParams = new GoodsSearchParams();
|
||||||
|
searchParams.setId(ArrayUtil.join(JSONUtil.toList(goodsIdsJsonStr, String.class).toArray(), ","));
|
||||||
|
List<Goods> goodsList = goodsService.queryListByParams(searchParams);
|
||||||
this.updateGoodsIndex(goodsList);
|
this.updateGoodsIndex(goodsList);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("更新商品索引事件执行异常,商品信息 {}", new String(messageExt.getBody()));
|
log.error("更新商品索引事件执行异常,商品信息 {}", new String(messageExt.getBody()));
|
||||||
@@ -185,12 +186,29 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
break;
|
break;
|
||||||
//审核商品
|
//审核商品
|
||||||
case GOODS_AUDIT:
|
case GOODS_AUDIT:
|
||||||
updateGoodsNum(messageExt);
|
Goods goods = JSONUtil.toBean(new String(messageExt.getBody()), Goods.class);
|
||||||
|
updateGoodsNum(goods);
|
||||||
|
updateGoodsIndex(goods);
|
||||||
break;
|
break;
|
||||||
//删除商品
|
//删除商品
|
||||||
case GOODS_DELETE:
|
case GOODS_DELETE:
|
||||||
deleteGoods(messageExt);
|
try {
|
||||||
updateGoodsNum(messageExt);
|
String goodsIdsJsonStr = new String(messageExt.getBody());
|
||||||
|
for (String goodsId : JSONUtil.toList(goodsIdsJsonStr, String.class)) {
|
||||||
|
Goods goodsById = this.goodsService.getById(goodsId);
|
||||||
|
if (goodsById != null) {
|
||||||
|
this.deleteGoods(goodsById);
|
||||||
|
this.updateGoodsNum(goodsById);
|
||||||
|
List<String> skuIdsByGoodsId = this.goodsSkuService.getSkuIdsByGoodsId(goodsId);
|
||||||
|
if (skuIdsByGoodsId != null && !skuIdsByGoodsId.isEmpty()) {
|
||||||
|
this.goodsIndexService.deleteIndexByIds(skuIdsByGoodsId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("删除商品索引事件执行异常,商品信息 {}", new String(messageExt.getBody()));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
//规格删除
|
//规格删除
|
||||||
case SKU_DELETE:
|
case SKU_DELETE:
|
||||||
@@ -198,10 +216,6 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
List<String> skuIds = JSONUtil.toList(message, String.class);
|
List<String> skuIds = JSONUtil.toList(message, String.class);
|
||||||
goodsCollectionService.deleteSkuCollection(skuIds);
|
goodsCollectionService.deleteSkuCollection(skuIds);
|
||||||
break;
|
break;
|
||||||
//收藏商品
|
|
||||||
case GOODS_COLLECTION:
|
|
||||||
storeService.updateStoreCollectionNum(new String(messageExt.getBody()));
|
|
||||||
break;
|
|
||||||
//商品评价
|
//商品评价
|
||||||
case GOODS_COMMENT_COMPLETE:
|
case GOODS_COMMENT_COMPLETE:
|
||||||
MemberEvaluation memberEvaluation = JSONUtil.toBean(new String(messageExt.getBody()), MemberEvaluation.class);
|
MemberEvaluation memberEvaluation = JSONUtil.toBean(new String(messageExt.getBody()), MemberEvaluation.class);
|
||||||
@@ -226,6 +240,35 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateGoodsIndexPromotions(String promotionsJsonStr) {
|
||||||
|
try {
|
||||||
|
log.info("更新商品索引促销信息: {}", promotionsJsonStr);
|
||||||
|
JSONObject jsonObject = JSONUtil.parseObj(promotionsJsonStr);
|
||||||
|
BasePromotions promotions = (BasePromotions) jsonObject.get("promotions",
|
||||||
|
ClassLoaderUtil.loadClass(jsonObject.get("promotionsType").toString()));
|
||||||
|
String esPromotionKey = jsonObject.get("esPromotionKey").toString();
|
||||||
|
if (PromotionsScopeTypeEnum.PORTION_GOODS.name().equals(promotions.getScopeType())) {
|
||||||
|
PromotionGoodsSearchParams searchParams = new PromotionGoodsSearchParams();
|
||||||
|
searchParams.setPromotionId(promotions.getId());
|
||||||
|
List<PromotionGoods> promotionGoodsList = this.promotionGoodsService.listFindAll(searchParams);
|
||||||
|
List<String> skuIds = promotionGoodsList.stream().map(PromotionGoods::getSkuId).collect(Collectors.toList());
|
||||||
|
this.goodsIndexService.deleteEsGoodsPromotionByPromotionId(skuIds, promotions.getId());
|
||||||
|
this.goodsIndexService.updateEsGoodsIndexByList(promotionGoodsList, promotions, esPromotionKey);
|
||||||
|
} else if (PromotionsScopeTypeEnum.PORTION_GOODS_CATEGORY.name().equals(promotions.getScopeType())) {
|
||||||
|
GoodsSearchParams searchParams = new GoodsSearchParams();
|
||||||
|
searchParams.setCategoryPath(promotions.getScopeId());
|
||||||
|
List<GoodsSku> goodsSkuByList = this.goodsSkuService.getGoodsSkuByList(searchParams);
|
||||||
|
List<String> skuIds = goodsSkuByList.stream().map(GoodsSku::getId).collect(Collectors.toList());
|
||||||
|
this.goodsIndexService.deleteEsGoodsPromotionByPromotionId(skuIds, promotions.getId());
|
||||||
|
this.goodsIndexService.updateEsGoodsIndexPromotions(skuIds, promotions, esPromotionKey);
|
||||||
|
} else if (PromotionsScopeTypeEnum.ALL.name().equals(promotions.getScopeType())) {
|
||||||
|
this.goodsIndexService.updateEsGoodsIndexAllByList(promotions, esPromotionKey);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("生成商品索引促销信息执行异常", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新商品索引
|
* 更新商品索引
|
||||||
*
|
*
|
||||||
@@ -235,8 +278,11 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
List<EsGoodsIndex> goodsIndices = new ArrayList<>();
|
List<EsGoodsIndex> goodsIndices = new ArrayList<>();
|
||||||
for (Goods goods : goodsList) {
|
for (Goods goods : goodsList) {
|
||||||
//如果商品通过审核&&并且已上架
|
//如果商品通过审核&&并且已上架
|
||||||
List<GoodsSku> goodsSkuList = this.goodsSkuService.list(new LambdaQueryWrapper<GoodsSku>().eq(GoodsSku::getGoodsId, goods.getId()).gt(GoodsSku::getQuantity, 0));
|
GoodsSearchParams searchParams = new GoodsSearchParams();
|
||||||
if (goods.getIsAuth().equals(GoodsAuthEnum.PASS.name())
|
searchParams.setGoodsId(goods.getId());
|
||||||
|
searchParams.setGeQuantity(0);
|
||||||
|
List<GoodsSku> goodsSkuList = this.goodsSkuService.getGoodsSkuByList(searchParams);
|
||||||
|
if (goods.getAuthFlag().equals(GoodsAuthEnum.PASS.name())
|
||||||
&& goods.getMarketEnable().equals(GoodsStatusEnum.UPPER.name())
|
&& goods.getMarketEnable().equals(GoodsStatusEnum.UPPER.name())
|
||||||
&& Boolean.FALSE.equals(goods.getDeleteFlag())) {
|
&& Boolean.FALSE.equals(goods.getDeleteFlag())) {
|
||||||
goodsSkuList.forEach(goodsSku -> {
|
goodsSkuList.forEach(goodsSku -> {
|
||||||
@@ -264,8 +310,12 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
*/
|
*/
|
||||||
private void updateGoodsIndex(Goods goods) {
|
private void updateGoodsIndex(Goods goods) {
|
||||||
//如果商品通过审核&&并且已上架
|
//如果商品通过审核&&并且已上架
|
||||||
List<GoodsSku> goodsSkuList = this.goodsSkuService.list(new LambdaQueryWrapper<GoodsSku>().eq(GoodsSku::getGoodsId, goods.getId()));
|
GoodsSearchParams searchParams = new GoodsSearchParams();
|
||||||
if (goods.getIsAuth().equals(GoodsAuthEnum.PASS.name())
|
searchParams.setGoodsId(goods.getId());
|
||||||
|
List<GoodsSku> goodsSkuList = this.goodsSkuService.getGoodsSkuByList(searchParams);
|
||||||
|
log.info("goods:{}", goods);
|
||||||
|
log.info("goodsSkuList:{}", goodsSkuList);
|
||||||
|
if (goods.getAuthFlag().equals(GoodsAuthEnum.PASS.name())
|
||||||
&& goods.getMarketEnable().equals(GoodsStatusEnum.UPPER.name())
|
&& goods.getMarketEnable().equals(GoodsStatusEnum.UPPER.name())
|
||||||
&& Boolean.FALSE.equals(goods.getDeleteFlag())) {
|
&& Boolean.FALSE.equals(goods.getDeleteFlag())) {
|
||||||
this.generatorGoodsIndex(goods, goodsSkuList);
|
this.generatorGoodsIndex(goods, goodsSkuList);
|
||||||
@@ -293,6 +343,8 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
EsGoodsIndex esGoodsOld = goodsIndexService.findById(goodsSku.getId());
|
EsGoodsIndex esGoodsOld = goodsIndexService.findById(goodsSku.getId());
|
||||||
EsGoodsIndex goodsIndex = this.settingUpGoodsIndexData(goods, goodsSku);
|
EsGoodsIndex goodsIndex = this.settingUpGoodsIndexData(goods, goodsSku);
|
||||||
goodsIndex.setSkuSource(skuSource--);
|
goodsIndex.setSkuSource(skuSource--);
|
||||||
|
log.info("goodsSku:{}", goodsSku);
|
||||||
|
log.info("esGoodsOld:{}", esGoodsOld);
|
||||||
//如果商品库存不为0,并且es中有数据
|
//如果商品库存不为0,并且es中有数据
|
||||||
if (goodsSku.getQuantity() > 0 && esGoodsOld == null) {
|
if (goodsSku.getQuantity() > 0 && esGoodsOld == null) {
|
||||||
log.info("生成商品索引 {}", goodsIndex);
|
log.info("生成商品索引 {}", goodsIndex);
|
||||||
@@ -309,7 +361,7 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
List<GoodsParamsDTO> goodsParamDTOS = JSONUtil.toList(goods.getParams(), GoodsParamsDTO.class);
|
List<GoodsParamsDTO> goodsParamDTOS = JSONUtil.toList(goods.getParams(), GoodsParamsDTO.class);
|
||||||
goodsIndex = new EsGoodsIndex(goodsSku, goodsParamDTOS);
|
goodsIndex = new EsGoodsIndex(goodsSku, goodsParamDTOS);
|
||||||
}
|
}
|
||||||
goodsIndex.setIsAuth(goods.getIsAuth());
|
goodsIndex.setAuthFlag(goods.getAuthFlag());
|
||||||
goodsIndex.setMarketEnable(goods.getMarketEnable());
|
goodsIndex.setMarketEnable(goods.getMarketEnable());
|
||||||
this.settingUpGoodsIndexOtherParam(goodsIndex);
|
this.settingUpGoodsIndexOtherParam(goodsIndex);
|
||||||
return goodsIndex;
|
return goodsIndex;
|
||||||
@@ -336,6 +388,11 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
goodsIndex.setStoreCategoryNamePath(ArrayUtil.join(storeGoodsLabels.stream().map(StoreGoodsLabel::getLabelName).toArray(), ","));
|
goodsIndex.setStoreCategoryNamePath(ArrayUtil.join(storeGoodsLabels.stream().map(StoreGoodsLabel::getLabelName).toArray(), ","));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (goodsIndex.getPromotionMap() == null || goodsIndex.getPromotionMap().isEmpty()) {
|
||||||
|
Map<String, Object> goodsCurrentPromotionMap = promotionService.getGoodsSkuPromotionMap(goodsIndex.getStoreId(), goodsIndex.getId());
|
||||||
|
goodsIndex.setPromotionMapJson(JSONUtil.toJsonStr(goodsCurrentPromotionMap));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -345,38 +402,37 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
* 2.删除分销员-分销商品绑定关系
|
* 2.删除分销员-分销商品绑定关系
|
||||||
* 3.删除分销商品
|
* 3.删除分销商品
|
||||||
*
|
*
|
||||||
* @param messageExt 消息
|
* @param goods 消息
|
||||||
*/
|
*/
|
||||||
private void deleteGoods(MessageExt messageExt) {
|
private void deleteGoods(Goods goods) {
|
||||||
Goods goods = JSONUtil.toBean(new String(messageExt.getBody()), Goods.class);
|
|
||||||
|
|
||||||
|
DistributionGoodsSearchParams searchParams = new DistributionGoodsSearchParams();
|
||||||
|
searchParams.setGoodsId(goods.getId());
|
||||||
//删除获取分销商品
|
//删除获取分销商品
|
||||||
DistributionGoods distributionGoods = distributionGoodsService.getOne(new LambdaQueryWrapper<DistributionGoods>()
|
DistributionGoods distributionGoods = distributionGoodsService.getDistributionGoods(searchParams);
|
||||||
.eq(DistributionGoods::getGoodsId, goods.getId()));
|
|
||||||
|
|
||||||
//删除分销商品绑定关系
|
if (distributionGoods != null) {
|
||||||
distributionSelectedGoodsService.remove(new LambdaQueryWrapper<DistributionSelectedGoods>()
|
|
||||||
.eq(DistributionSelectedGoods::getDistributionGoodsId, distributionGoods.getId()));
|
|
||||||
|
|
||||||
//删除分销商品
|
//删除分销商品绑定关系
|
||||||
distributionGoodsService.removeById(distributionGoods.getId());
|
distributionSelectedGoodsService.deleteByDistributionGoodsId(distributionGoods.getId());
|
||||||
|
|
||||||
|
//删除分销商品
|
||||||
|
distributionGoodsService.removeById(distributionGoods.getId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改商品数量
|
* 修改商品数量
|
||||||
*
|
*
|
||||||
* @param messageExt 信息体
|
* @param goods 信息体
|
||||||
*/
|
*/
|
||||||
private void updateGoodsNum(MessageExt messageExt) {
|
private void updateGoodsNum(Goods goods) {
|
||||||
|
|
||||||
Goods goods;
|
|
||||||
try {
|
try {
|
||||||
goods = JSONUtil.toBean(new String(messageExt.getBody()), Goods.class);
|
|
||||||
//更新店铺商品数量
|
//更新店铺商品数量
|
||||||
assert goods != null;
|
assert goods != null;
|
||||||
storeService.updateStoreGoodsNum(goods.getStoreId());
|
storeService.updateStoreGoodsNum(goods.getStoreId());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("商品MQ信息错误:{}", messageExt.toString());
|
log.error("修改商品数量错误");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -399,9 +455,7 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
goods.setBuyCount(0);
|
goods.setBuyCount(0);
|
||||||
}
|
}
|
||||||
int buyCount = goods.getBuyCount() + goodsCompleteMessage.getBuyNum();
|
int buyCount = goods.getBuyCount() + goodsCompleteMessage.getBuyNum();
|
||||||
goodsService.update(new LambdaUpdateWrapper<Goods>()
|
this.goodsService.updateGoodsBuyCount(goodsCompleteMessage.getGoodsId(), buyCount);
|
||||||
.eq(Goods::getId, goodsCompleteMessage.getGoodsId())
|
|
||||||
.set(Goods::getBuyCount, buyCount));
|
|
||||||
} else {
|
} else {
|
||||||
log.error("商品Id为[" + goodsCompleteMessage.getGoodsId() + "的商品不存在,更新商品失败!");
|
log.error("商品Id为[" + goodsCompleteMessage.getGoodsId() + "的商品不存在,更新商品失败!");
|
||||||
}
|
}
|
||||||
@@ -415,13 +469,10 @@ public class GoodsMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
goodsSku.setBuyCount(buyCount);
|
goodsSku.setBuyCount(buyCount);
|
||||||
goodsSkuService.update(goodsSku);
|
goodsSkuService.update(goodsSku);
|
||||||
|
|
||||||
//修改规格索引,发送mq消息
|
this.goodsIndexService.updateIndex(
|
||||||
Map<String, Object> updateIndexFieldsMap = EsIndexUtil.getUpdateIndexFieldsMap(
|
MapUtil.builder(new HashMap<String, Object>()).put("id", goodsCompleteMessage.getSkuId()).build(),
|
||||||
MapUtil.builder().put("id", goodsCompleteMessage.getSkuId()).build(),
|
MapUtil.builder(new HashMap<String, Object>()).put("buyCount", buyCount).build());
|
||||||
MapUtil.builder().put("buyCount", buyCount).build());
|
|
||||||
String destination = rocketmqCustomProperties.getGoodsTopic() + ":" + GoodsTagsEnum.UPDATE_GOODS_INDEX_FIELD.name();
|
|
||||||
rocketMQTemplate.asyncSend(destination, JSONUtil.toJsonStr(updateIndexFieldsMap), RocketmqSendCallbackBuilder.commonCallback());
|
|
||||||
goodsIndexService.updateIndex(goodsCompleteMessage.getSkuId(), new EsGoodsIndex().setBuyCount(buyCount));
|
|
||||||
} else {
|
} else {
|
||||||
log.error("商品SkuId为[" + goodsCompleteMessage.getGoodsId() + "的商品不存在,更新商品失败!");
|
log.error("商品SkuId为[" + goodsCompleteMessage.getGoodsId() + "的商品不存在,更新商品失败!");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
package cn.lili.listener;
|
package cn.lili.listener;
|
||||||
|
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import cn.lili.rocketmq.tags.MemberTagsEnum;
|
import cn.lili.event.MemberLoginEvent;
|
||||||
import cn.lili.event.MemberPointChangeEvent;
|
import cn.lili.event.MemberPointChangeEvent;
|
||||||
import cn.lili.event.MemberRegisterEvent;
|
import cn.lili.event.MemberRegisterEvent;
|
||||||
import cn.lili.event.MemberWithdrawalEvent;
|
import cn.lili.event.MemberWithdrawalEvent;
|
||||||
import cn.lili.modules.member.entity.dos.Member;
|
import cn.lili.modules.member.entity.dos.Member;
|
||||||
import cn.lili.modules.member.entity.dos.MemberSign;
|
import cn.lili.modules.member.entity.dos.MemberSign;
|
||||||
import cn.lili.modules.member.entity.dto.MemberPointMessage;
|
import cn.lili.modules.member.entity.dto.MemberPointMessage;
|
||||||
import cn.lili.modules.member.entity.dto.MemberWithdrawalMessage;
|
|
||||||
import cn.lili.modules.member.service.MemberSignService;
|
import cn.lili.modules.member.service.MemberSignService;
|
||||||
|
import cn.lili.modules.wallet.entity.dto.MemberWithdrawalMessage;
|
||||||
|
import cn.lili.rocketmq.tags.MemberTagsEnum;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.rocketmq.common.message.MessageExt;
|
import org.apache.rocketmq.common.message.MessageExt;
|
||||||
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
|
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
|
||||||
@@ -51,6 +52,12 @@ public class MemberMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private List<MemberRegisterEvent> memberSignEvents;
|
private List<MemberRegisterEvent> memberSignEvents;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员注册
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private List<MemberLoginEvent> memberLoginEvents;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMessage(MessageExt messageExt) {
|
public void onMessage(MessageExt messageExt) {
|
||||||
@@ -69,6 +76,21 @@ public class MemberMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MEMBER_LOGIN:
|
||||||
|
|
||||||
|
for (MemberLoginEvent memberLoginEvent : memberLoginEvents) {
|
||||||
|
try {
|
||||||
|
Member member = JSONUtil.toBean(new String(messageExt.getBody()), Member.class);
|
||||||
|
memberLoginEvent.memberLogin(member);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("会员{},在{}业务中,状态修改事件执行异常",
|
||||||
|
new String(messageExt.getBody()),
|
||||||
|
memberLoginEvent.getClass().getName(),
|
||||||
|
e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
//会员签到
|
//会员签到
|
||||||
case MEMBER_SING:
|
case MEMBER_SING:
|
||||||
MemberSign memberSign = JSONUtil.toBean(new String(messageExt.getBody()), MemberSign.class);
|
MemberSign memberSign = JSONUtil.toBean(new String(messageExt.getBody()), MemberSign.class);
|
||||||
|
|||||||
@@ -5,20 +5,19 @@ import cn.lili.common.enums.SwitchEnum;
|
|||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.modules.member.entity.vo.MemberSearchVO;
|
import cn.lili.modules.member.entity.vo.MemberSearchVO;
|
||||||
import cn.lili.modules.member.entity.vo.MemberVO;
|
import cn.lili.modules.member.entity.vo.MemberVO;
|
||||||
import cn.lili.modules.member.mapper.MemberMapper;
|
|
||||||
import cn.lili.modules.member.service.MemberService;
|
import cn.lili.modules.member.service.MemberService;
|
||||||
import cn.lili.modules.message.entity.dos.MemberMessage;
|
import cn.lili.modules.message.entity.dos.MemberMessage;
|
||||||
import cn.lili.modules.message.entity.dos.Message;
|
import cn.lili.modules.message.entity.dos.Message;
|
||||||
import cn.lili.modules.message.entity.dos.StoreMessage;
|
import cn.lili.modules.message.entity.dos.StoreMessage;
|
||||||
import cn.lili.modules.message.entity.dto.SmsReachDTO;
|
|
||||||
import cn.lili.modules.message.entity.enums.MessageSendClient;
|
import cn.lili.modules.message.entity.enums.MessageSendClient;
|
||||||
import cn.lili.modules.message.entity.enums.MessageStatusEnum;
|
import cn.lili.modules.message.entity.enums.MessageStatusEnum;
|
||||||
import cn.lili.modules.message.entity.enums.RangeEnum;
|
import cn.lili.modules.message.entity.enums.RangeEnum;
|
||||||
import cn.lili.modules.message.service.MemberMessageService;
|
import cn.lili.modules.message.service.MemberMessageService;
|
||||||
import cn.lili.modules.message.service.StoreMessageService;
|
import cn.lili.modules.message.service.StoreMessageService;
|
||||||
|
import cn.lili.modules.sms.SmsUtil;
|
||||||
|
import cn.lili.modules.sms.entity.dto.SmsReachDTO;
|
||||||
import cn.lili.modules.store.entity.dos.Store;
|
import cn.lili.modules.store.entity.dos.Store;
|
||||||
import cn.lili.modules.store.service.StoreService;
|
import cn.lili.modules.store.service.StoreService;
|
||||||
import cn.lili.modules.system.sms.SmsUtil;
|
|
||||||
import cn.lili.rocketmq.tags.OtherTagsEnum;
|
import cn.lili.rocketmq.tags.OtherTagsEnum;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@@ -28,7 +27,6 @@ import org.apache.rocketmq.spring.core.RocketMQListener;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -42,11 +40,6 @@ import java.util.List;
|
|||||||
@RocketMQMessageListener(topic = "${lili.data.rocketmq.notice-send-topic}", consumerGroup = "${lili.data.rocketmq.notice-send-group}")
|
@RocketMQMessageListener(topic = "${lili.data.rocketmq.notice-send-topic}", consumerGroup = "${lili.data.rocketmq.notice-send-group}")
|
||||||
public class NoticeSendMessageListener implements RocketMQListener<MessageExt> {
|
public class NoticeSendMessageListener implements RocketMQListener<MessageExt> {
|
||||||
|
|
||||||
/**
|
|
||||||
* 会员
|
|
||||||
*/
|
|
||||||
@Resource
|
|
||||||
private MemberMapper memberMapper;
|
|
||||||
/**
|
/**
|
||||||
* 短信
|
* 短信
|
||||||
*/
|
*/
|
||||||
@@ -82,7 +75,7 @@ public class NoticeSendMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
//发送全部会员
|
//发送全部会员
|
||||||
if (smsReachDTO.getSmsRange().equals(RangeEnum.ALL.name())) {
|
if (smsReachDTO.getSmsRange().equals(RangeEnum.ALL.name())) {
|
||||||
//获取所有会员的手机号
|
//获取所有会员的手机号
|
||||||
List<String> list = memberMapper.getAllMemberMobile();
|
List<String> list = memberService.getAllMemberMobile();
|
||||||
smsUtil.sendBatchSms(smsReachDTO.getSignName(), list, smsReachDTO.getMessageCode());
|
smsUtil.sendBatchSms(smsReachDTO.getSignName(), list, smsReachDTO.getMessageCode());
|
||||||
//判断为发送部分用户
|
//判断为发送部分用户
|
||||||
} else {
|
} else {
|
||||||
@@ -158,12 +151,12 @@ public class NoticeSendMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
//查询所有会员总数,因为会员总数比较大 如果一次性查出来会占用数据库资源,所以要分页查询
|
//查询所有会员总数,因为会员总数比较大 如果一次性查出来会占用数据库资源,所以要分页查询
|
||||||
MemberSearchVO memberSearchVO = new MemberSearchVO();
|
MemberSearchVO memberSearchVO = new MemberSearchVO();
|
||||||
memberSearchVO.setDisabled(SwitchEnum.OPEN.name());
|
memberSearchVO.setDisabled(SwitchEnum.OPEN.name());
|
||||||
Integer memberNum = memberService.getMemberNum(memberSearchVO);
|
long memberNum = memberService.getMemberNum(memberSearchVO);
|
||||||
//构建分页查询参数
|
//构建分页查询参数
|
||||||
//100条查一次
|
//100条查一次
|
||||||
Integer pageSize = 100;
|
int pageSize = 100;
|
||||||
Integer pageCount = 0;
|
int pageCount;
|
||||||
pageCount = memberNum / pageSize;
|
pageCount = (int) (memberNum / pageSize);
|
||||||
pageCount = memberNum % pageSize > 0 ? pageCount + 1 : pageCount;
|
pageCount = memberNum % pageSize > 0 ? pageCount + 1 : pageCount;
|
||||||
for (int i = 1; i <= pageCount; i++) {
|
for (int i = 1; i <= pageCount; i++) {
|
||||||
PageVO pageVO = new PageVO();
|
PageVO pageVO = new PageVO();
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ package cn.lili.listener;
|
|||||||
|
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import cn.lili.cache.Cache;
|
import cn.lili.cache.Cache;
|
||||||
import cn.lili.rocketmq.tags.MqOrderTagsEnum;
|
|
||||||
import cn.lili.event.OrderStatusChangeEvent;
|
import cn.lili.event.OrderStatusChangeEvent;
|
||||||
import cn.lili.event.TradeEvent;
|
import cn.lili.event.TradeEvent;
|
||||||
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
import cn.lili.modules.order.cart.entity.dto.TradeDTO;
|
||||||
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
||||||
|
import cn.lili.rocketmq.tags.OrderTagsEnum;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.rocketmq.common.message.MessageExt;
|
import org.apache.rocketmq.common.message.MessageExt;
|
||||||
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
|
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
|
||||||
@@ -58,11 +58,11 @@ public class OrderMessageListener implements RocketMQListener<MessageExt> {
|
|||||||
*/
|
*/
|
||||||
public void orderStatusEvent(MessageExt messageExt) {
|
public void orderStatusEvent(MessageExt messageExt) {
|
||||||
|
|
||||||
switch (MqOrderTagsEnum.valueOf(messageExt.getTags())) {
|
switch (OrderTagsEnum.valueOf(messageExt.getTags())) {
|
||||||
//订单创建
|
//订单创建
|
||||||
case ORDER_CREATE:
|
case ORDER_CREATE:
|
||||||
String key = new String(messageExt.getBody());
|
String key = new String(messageExt.getBody());
|
||||||
TradeDTO tradeDTO = (TradeDTO) cache.get(key);
|
TradeDTO tradeDTO = JSONUtil.toBean(cache.getString(key), TradeDTO.class);
|
||||||
boolean result = true;
|
boolean result = true;
|
||||||
for (TradeEvent event : tradeEvent) {
|
for (TradeEvent event : tradeEvent) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
package cn.lili.service;
|
|
||||||
|
|
||||||
import cn.lili.event.OrderStatusChangeEvent;
|
|
||||||
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 消息发送
|
|
||||||
*
|
|
||||||
* @author paulG
|
|
||||||
* @since 2020/12/9
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
public class NoticeSendMessageConsumer implements OrderStatusChangeEvent {
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void orderChange(OrderMessage orderMessage) {
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -3,13 +3,12 @@ package cn.lili.timetask.handler.impl.bill;
|
|||||||
import cn.hutool.core.date.DateTime;
|
import cn.hutool.core.date.DateTime;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.lili.modules.store.entity.dto.StoreSettlementDay;
|
import cn.lili.modules.store.entity.dto.StoreSettlementDay;
|
||||||
import cn.lili.modules.store.mapper.StoreDetailMapper;
|
|
||||||
import cn.lili.modules.store.service.BillService;
|
import cn.lili.modules.store.service.BillService;
|
||||||
|
import cn.lili.modules.store.service.StoreDetailService;
|
||||||
import cn.lili.timetask.handler.EveryDayExecute;
|
import cn.lili.timetask.handler.EveryDayExecute;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -29,8 +28,8 @@ public class BillExecute implements EveryDayExecute {
|
|||||||
/**
|
/**
|
||||||
* 店铺详情
|
* 店铺详情
|
||||||
*/
|
*/
|
||||||
@Resource
|
@Autowired
|
||||||
private StoreDetailMapper storeDetailMapper;
|
private StoreDetailService storeDetailService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 1.查询今日待结算的商家
|
* 1.查询今日待结算的商家
|
||||||
@@ -44,18 +43,18 @@ public class BillExecute implements EveryDayExecute {
|
|||||||
int day = DateUtil.date().dayOfMonth();
|
int day = DateUtil.date().dayOfMonth();
|
||||||
|
|
||||||
//获取待结算商家列表
|
//获取待结算商家列表
|
||||||
List<StoreSettlementDay> storeList = storeDetailMapper.getSettlementStore(day);
|
List<StoreSettlementDay> storeList = storeDetailService.getSettlementStore(day);
|
||||||
|
|
||||||
//获取当前时间
|
//获取当前时间
|
||||||
DateTime endTime =DateUtil.date();
|
DateTime endTime = DateUtil.date();
|
||||||
//批量商家结算
|
//批量商家结算
|
||||||
for (StoreSettlementDay storeSettlementDay : storeList) {
|
for (StoreSettlementDay storeSettlementDay : storeList) {
|
||||||
|
|
||||||
//生成结算单
|
//生成结算单
|
||||||
billService.createBill(storeSettlementDay.getStoreId(), storeSettlementDay.getSettlementDay(),endTime);
|
billService.createBill(storeSettlementDay.getStoreId(), storeSettlementDay.getSettlementDay(), endTime);
|
||||||
|
|
||||||
//修改店铺结算时间
|
//修改店铺结算时间
|
||||||
storeDetailMapper.updateSettlementDay(storeSettlementDay.getStoreId(), endTime);
|
storeDetailService.updateSettlementDay(storeSettlementDay.getStoreId(), endTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package cn.lili.timetask.handler.impl.coupon;
|
package cn.lili.timetask.handler.impl.coupon;
|
||||||
|
|
||||||
import cn.lili.common.utils.DateUtil;
|
|
||||||
import cn.lili.modules.promotion.entity.dos.MemberCoupon;
|
import cn.lili.modules.promotion.entity.dos.MemberCoupon;
|
||||||
import cn.lili.modules.promotion.entity.enums.MemberCouponStatusEnum;
|
import cn.lili.modules.promotion.entity.enums.MemberCouponStatusEnum;
|
||||||
import cn.lili.modules.promotion.service.MemberCouponService;
|
import cn.lili.modules.promotion.service.MemberCouponService;
|
||||||
@@ -43,7 +42,7 @@ public class CouponExecute implements EveryDayExecute {
|
|||||||
this.memberCouponService.update(updateWrapper);
|
this.memberCouponService.update(updateWrapper);
|
||||||
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.set(Calendar.DAY_OF_MONTH, calendar.get(Calendar.DAY_OF_MONTH) + EXPIRATION_DAY);
|
calendar.set(Calendar.DAY_OF_MONTH, calendar.get(Calendar.DAY_OF_MONTH) - EXPIRATION_DAY);
|
||||||
Date removeTime = calendar.getTime();
|
Date removeTime = calendar.getTime();
|
||||||
//删除过期/已使用的优惠券
|
//删除过期/已使用的优惠券
|
||||||
LambdaUpdateWrapper<MemberCoupon> deleteWrapper = new LambdaUpdateWrapper<MemberCoupon>()
|
LambdaUpdateWrapper<MemberCoupon> deleteWrapper = new LambdaUpdateWrapper<MemberCoupon>()
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import cn.lili.common.exception.ServiceException;
|
|||||||
import cn.lili.modules.member.entity.dto.MemberEvaluationDTO;
|
import cn.lili.modules.member.entity.dto.MemberEvaluationDTO;
|
||||||
import cn.lili.modules.member.entity.enums.EvaluationGradeEnum;
|
import cn.lili.modules.member.entity.enums.EvaluationGradeEnum;
|
||||||
import cn.lili.modules.member.service.MemberEvaluationService;
|
import cn.lili.modules.member.service.MemberEvaluationService;
|
||||||
|
import cn.lili.modules.order.aftersale.service.AfterSaleService;
|
||||||
import cn.lili.modules.order.order.entity.dos.Order;
|
import cn.lili.modules.order.order.entity.dos.Order;
|
||||||
import cn.lili.modules.order.order.entity.dos.OrderItem;
|
import cn.lili.modules.order.order.entity.dos.OrderItem;
|
||||||
import cn.lili.modules.order.order.entity.enums.CommentStatusEnum;
|
import cn.lili.modules.order.order.entity.enums.CommentStatusEnum;
|
||||||
@@ -15,7 +16,6 @@ import cn.lili.modules.order.order.entity.enums.OrderComplaintStatusEnum;
|
|||||||
import cn.lili.modules.order.order.entity.enums.OrderItemAfterSaleStatusEnum;
|
import cn.lili.modules.order.order.entity.enums.OrderItemAfterSaleStatusEnum;
|
||||||
import cn.lili.modules.order.order.entity.enums.OrderStatusEnum;
|
import cn.lili.modules.order.order.entity.enums.OrderStatusEnum;
|
||||||
import cn.lili.modules.order.order.mapper.OrderItemMapper;
|
import cn.lili.modules.order.order.mapper.OrderItemMapper;
|
||||||
import cn.lili.modules.order.order.service.AfterSaleService;
|
|
||||||
import cn.lili.modules.order.order.service.OrderItemService;
|
import cn.lili.modules.order.order.service.OrderItemService;
|
||||||
import cn.lili.modules.order.order.service.OrderService;
|
import cn.lili.modules.order.order.service.OrderService;
|
||||||
import cn.lili.modules.system.entity.dos.Setting;
|
import cn.lili.modules.system.entity.dos.Setting;
|
||||||
@@ -146,7 +146,7 @@ public class OrderEveryDayTaskExecute implements EveryDayExecute {
|
|||||||
memberEvaluationDTO.setDescriptionScore(5);
|
memberEvaluationDTO.setDescriptionScore(5);
|
||||||
memberEvaluationDTO.setServiceScore(5);
|
memberEvaluationDTO.setServiceScore(5);
|
||||||
|
|
||||||
memberEvaluationService.addMemberEvaluation(memberEvaluationDTO);
|
memberEvaluationService.addMemberEvaluation(memberEvaluationDTO, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ import cn.hutool.core.date.DateTime;
|
|||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import cn.lili.modules.order.order.entity.enums.PayStatusEnum;
|
import cn.lili.modules.order.order.entity.enums.PayStatusEnum;
|
||||||
import cn.lili.modules.order.trade.entity.dos.Recharge;
|
|
||||||
import cn.lili.modules.order.trade.service.RechargeService;
|
|
||||||
import cn.lili.modules.system.entity.dos.Setting;
|
import cn.lili.modules.system.entity.dos.Setting;
|
||||||
import cn.lili.modules.system.entity.dto.OrderSetting;
|
import cn.lili.modules.system.entity.dto.OrderSetting;
|
||||||
import cn.lili.modules.system.entity.enums.SettingEnum;
|
import cn.lili.modules.system.entity.enums.SettingEnum;
|
||||||
import cn.lili.modules.system.service.SettingService;
|
import cn.lili.modules.system.service.SettingService;
|
||||||
|
import cn.lili.modules.wallet.entity.dos.Recharge;
|
||||||
|
import cn.lili.modules.wallet.service.RechargeService;
|
||||||
import cn.lili.timetask.handler.EveryMinuteExecute;
|
import cn.lili.timetask.handler.EveryMinuteExecute;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|||||||
@@ -1,34 +1,18 @@
|
|||||||
package cn.lili.timetask.handler.impl.promotion;
|
package cn.lili.timetask.handler.impl.promotion;
|
||||||
|
|
||||||
import cn.lili.modules.order.cart.entity.vo.FullDiscountVO;
|
|
||||||
import cn.lili.modules.promotion.entity.dos.MemberCoupon;
|
|
||||||
import cn.lili.modules.promotion.entity.dos.PromotionGoods;
|
|
||||||
import cn.lili.modules.promotion.entity.dos.Seckill;
|
import cn.lili.modules.promotion.entity.dos.Seckill;
|
||||||
import cn.lili.modules.promotion.entity.enums.MemberCouponStatusEnum;
|
import cn.lili.modules.promotion.service.SeckillService;
|
||||||
import cn.lili.modules.promotion.entity.enums.PromotionStatusEnum;
|
|
||||||
import cn.lili.modules.promotion.entity.vos.CouponVO;
|
|
||||||
import cn.lili.modules.promotion.entity.vos.PintuanVO;
|
|
||||||
import cn.lili.modules.promotion.service.*;
|
|
||||||
import cn.lili.modules.search.service.EsGoodsIndexService;
|
import cn.lili.modules.search.service.EsGoodsIndexService;
|
||||||
import cn.lili.modules.system.entity.dos.Setting;
|
import cn.lili.modules.system.entity.dos.Setting;
|
||||||
import cn.lili.modules.system.entity.dto.SeckillSetting;
|
import cn.lili.modules.system.entity.dto.SeckillSetting;
|
||||||
import cn.lili.modules.system.entity.enums.SettingEnum;
|
import cn.lili.modules.system.entity.enums.SettingEnum;
|
||||||
import cn.lili.modules.system.service.SettingService;
|
import cn.lili.modules.system.service.SettingService;
|
||||||
import cn.lili.timetask.handler.EveryDayExecute;
|
import cn.lili.timetask.handler.EveryDayExecute;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
|
||||||
import org.springframework.data.mongodb.core.query.Criteria;
|
|
||||||
import org.springframework.data.mongodb.core.query.Query;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 促销活动每日定时器
|
* 促销活动每日定时器
|
||||||
*
|
*
|
||||||
@@ -39,41 +23,11 @@ import java.util.List;
|
|||||||
@Component
|
@Component
|
||||||
public class PromotionEverydayExecute implements EveryDayExecute {
|
public class PromotionEverydayExecute implements EveryDayExecute {
|
||||||
|
|
||||||
/**
|
|
||||||
* Mongo
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
private MongoTemplate mongoTemplate;
|
|
||||||
/**
|
/**
|
||||||
* ES商品索引
|
* ES商品索引
|
||||||
*/
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
private EsGoodsIndexService esGoodsIndexService;
|
private EsGoodsIndexService esGoodsIndexService;
|
||||||
/**
|
|
||||||
* 满额活动
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
private FullDiscountService fullDiscountService;
|
|
||||||
/**
|
|
||||||
* 拼团
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
private PintuanService pintuanService;
|
|
||||||
/**
|
|
||||||
* 优惠券
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
private CouponService couponService;
|
|
||||||
/**
|
|
||||||
* 会员优惠券
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
private MemberCouponService memberCouponService;
|
|
||||||
/**
|
|
||||||
* 促销商品
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
private PromotionGoodsService promotionGoodsService;
|
|
||||||
/**
|
/**
|
||||||
* 系统设置
|
* 系统设置
|
||||||
*/
|
*/
|
||||||
@@ -90,123 +44,19 @@ public class PromotionEverydayExecute implements EveryDayExecute {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
//mongo查询条件
|
|
||||||
Query query = new Query();
|
|
||||||
//结束条件 活动未关闭/活动未结束
|
|
||||||
query.addCriteria(Criteria.where("promotionStatus").ne(PromotionStatusEnum.END.name())
|
|
||||||
.orOperator(Criteria.where("promotionStatus").ne(PromotionStatusEnum.CLOSE.name())));
|
|
||||||
//结束条件 活动结束时间大于当前时间
|
|
||||||
query.addCriteria(Criteria.where("endTime").lte(new Date()));
|
|
||||||
|
|
||||||
//结束满减活动
|
|
||||||
endFullDiscount(query);
|
|
||||||
|
|
||||||
//关闭拼团活动
|
|
||||||
endPintuan(query);
|
|
||||||
|
|
||||||
//结束优惠券
|
|
||||||
endCoupon(query);
|
|
||||||
|
|
||||||
//定时创建活动
|
|
||||||
addSeckill();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结束优惠券活动
|
|
||||||
*
|
|
||||||
* @param query
|
|
||||||
*/
|
|
||||||
private void endCoupon(Query query) {
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//关闭优惠券活动
|
//清除所有商品索引的无效促销活动
|
||||||
List<CouponVO> couponVOS = mongoTemplate.find(query, CouponVO.class);
|
this.esGoodsIndexService.cleanInvalidPromotion();
|
||||||
if (!couponVOS.isEmpty()) {
|
|
||||||
List<String> ids = new ArrayList<>();
|
|
||||||
// //关闭的优惠券活动
|
|
||||||
for (CouponVO vo : couponVOS) {
|
|
||||||
vo.setPromotionStatus(PromotionStatusEnum.END.name());
|
|
||||||
if (vo.getPromotionGoodsList() != null && !vo.getPromotionGoodsList().isEmpty()) {
|
|
||||||
for (PromotionGoods promotionGoods : vo.getPromotionGoodsList()) {
|
|
||||||
promotionGoods.setPromotionStatus(PromotionStatusEnum.END.name());
|
|
||||||
esGoodsIndexService.deleteEsGoodsPromotionByPromotionId(promotionGoods.getSkuId(), vo.getId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mongoTemplate.save(vo);
|
|
||||||
ids.add(vo.getId());
|
|
||||||
}
|
|
||||||
couponService.update(this.getUpdatePromotionWrapper(ids));
|
|
||||||
LambdaUpdateWrapper<MemberCoupon> memberCouponLambdaUpdateWrapper = new LambdaUpdateWrapper<MemberCoupon>().in(MemberCoupon::getCouponId, ids).set(MemberCoupon::getMemberCouponStatus, MemberCouponStatusEnum.EXPIRE.name());
|
|
||||||
memberCouponService.update(memberCouponLambdaUpdateWrapper);
|
|
||||||
//将活动商品对照表进行结束处理
|
|
||||||
promotionGoodsService.update(this.getUpdatePromotionGoodsWrapper(ids));
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("优惠券活动关闭错误", e);
|
log.error("清楚商品索引中无效促销异常", e);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结束拼团活动
|
|
||||||
*
|
|
||||||
* @param query
|
|
||||||
*/
|
|
||||||
private void endPintuan(Query query) {
|
|
||||||
try {
|
try {
|
||||||
//关闭拼团活动
|
//定时创建活动
|
||||||
List<PintuanVO> pintuanVOS = mongoTemplate.find(query, PintuanVO.class);
|
addSeckill();
|
||||||
if (!pintuanVOS.isEmpty()) {
|
|
||||||
//准备修改活动的id
|
|
||||||
List<String> ids = new ArrayList<>();
|
|
||||||
for (PintuanVO vo : pintuanVOS) {
|
|
||||||
vo.setPromotionStatus(PromotionStatusEnum.END.name());
|
|
||||||
if (vo.getPromotionGoodsList() != null && !vo.getPromotionGoodsList().isEmpty()) {
|
|
||||||
for (PromotionGoods promotionGoods : vo.getPromotionGoodsList()) {
|
|
||||||
promotionGoods.setPromotionStatus(PromotionStatusEnum.END.name());
|
|
||||||
esGoodsIndexService.deleteEsGoodsPromotionByPromotionId(promotionGoods.getSkuId(), vo.getId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mongoTemplate.save(vo);
|
|
||||||
ids.add(vo.getId());
|
|
||||||
}
|
|
||||||
pintuanService.update(this.getUpdatePromotionWrapper(ids));
|
|
||||||
//将活动商品对照表进行结束处理
|
|
||||||
promotionGoodsService.update(this.getUpdatePromotionGoodsWrapper(ids));
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("拼团活动关闭错误", e);
|
log.error("秒杀活动添加异常", e);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结束满减活动
|
|
||||||
*
|
|
||||||
* @param query
|
|
||||||
*/
|
|
||||||
private void endFullDiscount(Query query) {
|
|
||||||
try {
|
|
||||||
//关闭满减活动
|
|
||||||
List<FullDiscountVO> fullDiscountVOS = mongoTemplate.find(query, FullDiscountVO.class);
|
|
||||||
if (!fullDiscountVOS.isEmpty()) {
|
|
||||||
List<String> ids = new ArrayList<>();
|
|
||||||
//循环活动 关闭活动
|
|
||||||
for (FullDiscountVO vo : fullDiscountVOS) {
|
|
||||||
vo.setPromotionStatus(PromotionStatusEnum.END.name());
|
|
||||||
if (vo.getPromotionGoodsList() != null && !vo.getPromotionGoodsList().isEmpty()) {
|
|
||||||
for (PromotionGoods promotionGoods : vo.getPromotionGoodsList()) {
|
|
||||||
promotionGoods.setPromotionStatus(PromotionStatusEnum.END.name());
|
|
||||||
esGoodsIndexService.deleteEsGoodsPromotionByPromotionId(promotionGoods.getSkuId(), vo.getId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mongoTemplate.save(vo);
|
|
||||||
ids.add(vo.getId());
|
|
||||||
}
|
|
||||||
fullDiscountService.update(this.getUpdatePromotionWrapper(ids));
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("满减活动关闭错误", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -217,33 +67,9 @@ public class PromotionEverydayExecute implements EveryDayExecute {
|
|||||||
private void addSeckill() {
|
private void addSeckill() {
|
||||||
Setting setting = settingService.get(SettingEnum.SECKILL_SETTING.name());
|
Setting setting = settingService.get(SettingEnum.SECKILL_SETTING.name());
|
||||||
SeckillSetting seckillSetting = new Gson().fromJson(setting.getSettingValue(), SeckillSetting.class);
|
SeckillSetting seckillSetting = new Gson().fromJson(setting.getSettingValue(), SeckillSetting.class);
|
||||||
Seckill seckill = new Seckill(SeckillService.PRE_CREATION, seckillSetting.getHours(), seckillSetting.getSeckillRule());
|
for (int i = 1; i <= SeckillService.PRE_CREATION; i++) {
|
||||||
seckillService.saveSeckill(seckill);
|
Seckill seckill = new Seckill(i, seckillSetting.getHours(), seckillSetting.getSeckillRule());
|
||||||
}
|
seckillService.savePromotions(seckill);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* 获取促销修改查询条件 修改活动状态
|
|
||||||
*
|
|
||||||
* @param ids 促销活动ID
|
|
||||||
* @return 促销活动商品查询Wrapper
|
|
||||||
*/
|
|
||||||
private UpdateWrapper getUpdatePromotionWrapper(List<String> ids) {
|
|
||||||
UpdateWrapper updateWrapper = new UpdateWrapper<>();
|
|
||||||
updateWrapper.in("id", ids);
|
|
||||||
updateWrapper.set("promotion_status", PromotionStatusEnum.END.name());
|
|
||||||
return updateWrapper;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取商品的促销修改查询条件 修改商品状态
|
|
||||||
*
|
|
||||||
* @param ids 促销活动ID
|
|
||||||
* @return 促销活动商品修改Wrapper
|
|
||||||
*/
|
|
||||||
private UpdateWrapper getUpdatePromotionGoodsWrapper(List<String> ids) {
|
|
||||||
UpdateWrapper updateWrapper = new UpdateWrapper<>();
|
|
||||||
updateWrapper.in("promotion_id", ids);
|
|
||||||
updateWrapper.set("promotion_status", PromotionStatusEnum.END.name());
|
|
||||||
return updateWrapper;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package cn.lili.timetask.handler.impl.statistics;
|
package cn.lili.timetask.handler.impl.statistics;
|
||||||
|
|
||||||
import cn.lili.modules.statistics.entity.dos.MemberStatisticsData;
|
import cn.lili.modules.statistics.entity.dos.MemberStatisticsData;
|
||||||
import cn.lili.modules.statistics.service.MemberStatisticsDataService;
|
import cn.lili.modules.statistics.service.MemberStatisticsService;
|
||||||
import cn.lili.timetask.handler.EveryDayExecute;
|
import cn.lili.timetask.handler.EveryDayExecute;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -24,7 +24,7 @@ public class MemberStatisticsExecute implements EveryDayExecute {
|
|||||||
* 会员统计
|
* 会员统计
|
||||||
*/
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
private MemberStatisticsDataService memberStatisticsDataService;
|
private MemberStatisticsService memberStatisticsService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
@@ -43,30 +43,13 @@ public class MemberStatisticsExecute implements EveryDayExecute {
|
|||||||
calendar.set(Calendar.DAY_OF_MONTH, calendar.get(Calendar.DAY_OF_MONTH) - 1);
|
calendar.set(Calendar.DAY_OF_MONTH, calendar.get(Calendar.DAY_OF_MONTH) - 1);
|
||||||
startTime = calendar.getTime();
|
startTime = calendar.getTime();
|
||||||
MemberStatisticsData memberStatisticsData = new MemberStatisticsData();
|
MemberStatisticsData memberStatisticsData = new MemberStatisticsData();
|
||||||
memberStatisticsData.setMemberCount(memberStatisticsDataService.memberCount(endTime));
|
memberStatisticsData.setMemberCount(memberStatisticsService.memberCount(endTime));
|
||||||
memberStatisticsData.setCreateDate(startTime);
|
memberStatisticsData.setCreateDate(startTime);
|
||||||
memberStatisticsData.setActiveQuantity(memberStatisticsDataService.activeQuantity(startTime));
|
memberStatisticsData.setActiveQuantity(memberStatisticsService.activeQuantity(startTime));
|
||||||
memberStatisticsData.setNewlyAdded(memberStatisticsDataService.newlyAdded(startTime, endTime));
|
memberStatisticsData.setNewlyAdded(memberStatisticsService.newlyAdded(startTime, endTime));
|
||||||
memberStatisticsDataService.save(memberStatisticsData);
|
memberStatisticsService.save(memberStatisticsData);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("每日会员统计功能异常:", e);
|
log.error("每日会员统计功能异常:", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
|
|
||||||
//统计的时间(开始。结束时间)
|
|
||||||
Date startTime, endTime;
|
|
||||||
//初始值
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
calendar.set(Calendar.SECOND, 0);
|
|
||||||
calendar.set(Calendar.MILLISECOND, 1);
|
|
||||||
calendar.set(Calendar.MINUTE, 0);
|
|
||||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
|
||||||
endTime = calendar.getTime();
|
|
||||||
//-1天,即为开始时间
|
|
||||||
calendar.set(Calendar.DAY_OF_MONTH, calendar.get(Calendar.DAY_OF_MONTH) - 1);
|
|
||||||
startTime = calendar.getTime();
|
|
||||||
System.out.println(startTime);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,7 @@ import cn.lili.cache.Cache;
|
|||||||
import cn.lili.cache.CachePrefix;
|
import cn.lili.cache.CachePrefix;
|
||||||
import cn.lili.common.utils.BeanUtil;
|
import cn.lili.common.utils.BeanUtil;
|
||||||
import cn.lili.modules.statistics.entity.dos.PlatformViewData;
|
import cn.lili.modules.statistics.entity.dos.PlatformViewData;
|
||||||
import cn.lili.modules.statistics.service.PlatformViewDataService;
|
import cn.lili.modules.statistics.service.PlatformViewService;
|
||||||
import cn.lili.timetask.handler.EveryDayExecute;
|
import cn.lili.timetask.handler.EveryDayExecute;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -37,7 +37,7 @@ public class PageViewStatisticsExecute implements EveryDayExecute {
|
|||||||
* 平台PV统计
|
* 平台PV统计
|
||||||
*/
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
private PlatformViewDataService platformViewDataService;
|
private PlatformViewService platformViewService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
@@ -123,7 +123,7 @@ public class PageViewStatisticsExecute implements EveryDayExecute {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
void batchSave(List<String> pvKeys, List<String> uvKeys, List<PlatformViewData> platformViewData) {
|
void batchSave(List<String> pvKeys, List<String> uvKeys, List<PlatformViewData> platformViewData) {
|
||||||
log.debug("批量保存流量数据,共计【{}】条", platformViewData.size());
|
log.debug("批量保存流量数据,共计【{}】条", platformViewData.size());
|
||||||
platformViewDataService.saveBatch(platformViewData);
|
platformViewService.saveBatch(platformViewData);
|
||||||
//批量删除缓存key
|
//批量删除缓存key
|
||||||
cache.multiDel(pvKeys);
|
cache.multiDel(pvKeys);
|
||||||
cache.multiDel(uvKeys);
|
cache.multiDel(uvKeys);
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ import cn.lili.cache.Cache;
|
|||||||
import cn.lili.common.utils.ThreadPoolUtil;
|
import cn.lili.common.utils.ThreadPoolUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.ApplicationRunner;
|
||||||
import org.springframework.data.redis.core.DefaultTypedTuple;
|
import org.springframework.data.redis.core.DefaultTypedTuple;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
* @since 2020/11/7
|
* @since 2020/11/7
|
||||||
**/
|
**/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public abstract class AbstractDelayQueueListen {
|
public abstract class AbstractDelayQueueListen implements ApplicationRunner {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private Cache cache;
|
private Cache cache;
|
||||||
@@ -87,7 +87,6 @@ public abstract class AbstractDelayQueueListen {
|
|||||||
/**
|
/**
|
||||||
* 监听队列
|
* 监听队列
|
||||||
*/
|
*/
|
||||||
@PostConstruct
|
|
||||||
public void init() {
|
public void init() {
|
||||||
ThreadPoolUtil.getPool().execute(this::startDelayQueueMachine);
|
ThreadPoolUtil.getPool().execute(this::startDelayQueueMachine);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,11 @@
|
|||||||
package cn.lili.trigger.executor;
|
package cn.lili.trigger.executor;
|
||||||
|
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import cn.lili.common.properties.RocketmqCustomProperties;
|
|
||||||
import cn.lili.modules.order.order.service.OrderService;
|
import cn.lili.modules.order.order.service.OrderService;
|
||||||
import cn.lili.modules.promotion.entity.enums.PromotionStatusEnum;
|
import cn.lili.modules.promotion.entity.dos.Pintuan;
|
||||||
import cn.lili.modules.promotion.service.PromotionService;
|
|
||||||
import cn.lili.trigger.TimeTriggerExecutor;
|
import cn.lili.trigger.TimeTriggerExecutor;
|
||||||
import cn.lili.trigger.interfaces.TimeTrigger;
|
|
||||||
import cn.lili.trigger.message.PintuanOrderMessage;
|
import cn.lili.trigger.message.PintuanOrderMessage;
|
||||||
import cn.lili.trigger.message.PromotionMessage;
|
|
||||||
import cn.lili.trigger.model.TimeExecuteConstant;
|
import cn.lili.trigger.model.TimeExecuteConstant;
|
||||||
import cn.lili.trigger.model.TimeTriggerMsg;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -25,21 +20,6 @@ import org.springframework.stereotype.Component;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@Component(TimeExecuteConstant.PROMOTION_EXECUTOR)
|
@Component(TimeExecuteConstant.PROMOTION_EXECUTOR)
|
||||||
public class PromotionTimeTriggerExecutor implements TimeTriggerExecutor {
|
public class PromotionTimeTriggerExecutor implements TimeTriggerExecutor {
|
||||||
/**
|
|
||||||
* 促销
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
private PromotionService promotionService;
|
|
||||||
/**
|
|
||||||
* RocketMQ
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
private RocketmqCustomProperties rocketmqCustomProperties;
|
|
||||||
/**
|
|
||||||
* 延时任务
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
private TimeTrigger timeTrigger;
|
|
||||||
/**
|
/**
|
||||||
* 订单
|
* 订单
|
||||||
*/
|
*/
|
||||||
@@ -49,32 +29,6 @@ public class PromotionTimeTriggerExecutor implements TimeTriggerExecutor {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(Object object) {
|
public void execute(Object object) {
|
||||||
PromotionMessage promotionMessage = JSONUtil.toBean(JSONUtil.parseObj(object), PromotionMessage.class);
|
|
||||||
//促销延时信息
|
|
||||||
if (promotionMessage != null && promotionMessage.getPromotionId() != null) {
|
|
||||||
log.info("促销活动信息消费:{}", promotionMessage);
|
|
||||||
//如果为促销活动开始,则需要发布促销活动结束的定时任务
|
|
||||||
if (PromotionStatusEnum.START.name().equals(promotionMessage.getPromotionStatus())) {
|
|
||||||
if (!promotionService.updatePromotionStatus(promotionMessage)) {
|
|
||||||
log.error("开始促销活动失败: {}", promotionMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//促销活动开始后,设置促销活动结束的定时任务
|
|
||||||
promotionMessage.setPromotionStatus(PromotionStatusEnum.END.name());
|
|
||||||
String uniqueKey = "{TIME_TRIGGER_" + promotionMessage.getPromotionType() + "}_" + promotionMessage.getPromotionId();
|
|
||||||
if (promotionMessage.getEndTime() != null) {
|
|
||||||
//结束时间(延时一分钟)
|
|
||||||
long closeTime = promotionMessage.getEndTime().getTime() + 60000;
|
|
||||||
TimeTriggerMsg timeTriggerMsg = new TimeTriggerMsg(TimeExecuteConstant.PROMOTION_EXECUTOR, closeTime, promotionMessage, uniqueKey, rocketmqCustomProperties.getPromotionTopic());
|
|
||||||
//添加延时任务
|
|
||||||
timeTrigger.addDelay(timeTriggerMsg);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
//不是开始,则修改活动状态
|
|
||||||
promotionService.updatePromotionStatus(promotionMessage);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//拼团订单消息
|
//拼团订单消息
|
||||||
PintuanOrderMessage pintuanOrderMessage = JSONUtil.toBean(JSONUtil.parseObj(object), PintuanOrderMessage.class);
|
PintuanOrderMessage pintuanOrderMessage = JSONUtil.toBean(JSONUtil.parseObj(object), PintuanOrderMessage.class);
|
||||||
if (pintuanOrderMessage != null && pintuanOrderMessage.getPintuanId() != null) {
|
if (pintuanOrderMessage != null && pintuanOrderMessage.getPintuanId() != null) {
|
||||||
@@ -82,6 +36,10 @@ public class PromotionTimeTriggerExecutor implements TimeTriggerExecutor {
|
|||||||
//拼团订单自动处理
|
//拼团订单自动处理
|
||||||
orderService.agglomeratePintuanOrder(pintuanOrderMessage.getPintuanId(), pintuanOrderMessage.getOrderSn());
|
orderService.agglomeratePintuanOrder(pintuanOrderMessage.getPintuanId(), pintuanOrderMessage.getOrderSn());
|
||||||
}
|
}
|
||||||
|
Pintuan pintuan = JSONUtil.toBean(JSONUtil.parseObj(object), Pintuan.class);
|
||||||
|
if (pintuan != null && pintuan.getId() != null) {
|
||||||
|
this.orderService.checkFictitiousOrder(pintuan.getId(), pintuan.getRequiredNum(), pintuan.getFictitious());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
package cn.lili.trigger.listen;
|
package cn.lili.trigger.listen;
|
||||||
|
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import cn.lili.trigger.AbstractDelayQueueListen;
|
||||||
import cn.lili.trigger.enums.DelayQueueEnums;
|
import cn.lili.trigger.enums.DelayQueueEnums;
|
||||||
import cn.lili.trigger.interfaces.TimeTrigger;
|
import cn.lili.trigger.interfaces.TimeTrigger;
|
||||||
import cn.lili.trigger.model.TimeTriggerMsg;
|
import cn.lili.trigger.model.TimeTriggerMsg;
|
||||||
import cn.lili.trigger.AbstractDelayQueueListen;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.ApplicationArguments;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,4 +32,9 @@ public class PromotionDelayQueueListen extends AbstractDelayQueueListen {
|
|||||||
public String setDelayQueueName() {
|
public String setDelayQueueName() {
|
||||||
return DelayQueueEnums.PROMOTION.name();
|
return DelayQueueEnums.PROMOTION.name();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(ApplicationArguments args) throws Exception {
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,15 +32,6 @@ spring:
|
|||||||
admin:
|
admin:
|
||||||
client:
|
client:
|
||||||
url: http://127.0.0.1:8000
|
url: http://127.0.0.1:8000
|
||||||
# mongodb
|
|
||||||
data:
|
|
||||||
mongodb:
|
|
||||||
uri: 127.0.0.1:27017
|
|
||||||
database: lilishop
|
|
||||||
username: root
|
|
||||||
password: lilishop
|
|
||||||
authentication-database: admin
|
|
||||||
# replica-set-name: mongoreplset
|
|
||||||
cache:
|
cache:
|
||||||
type: redis
|
type: redis
|
||||||
# Redis
|
# Redis
|
||||||
@@ -120,7 +111,7 @@ spring:
|
|||||||
props:
|
props:
|
||||||
#是否打印逻辑SQL语句和实际SQL语句,建议调试时打印,在生产环境关闭
|
#是否打印逻辑SQL语句和实际SQL语句,建议调试时打印,在生产环境关闭
|
||||||
sql:
|
sql:
|
||||||
show: true
|
show: false
|
||||||
|
|
||||||
# 忽略鉴权url
|
# 忽略鉴权url
|
||||||
ignored:
|
ignored:
|
||||||
@@ -188,10 +179,9 @@ logging:
|
|||||||
config: classpath:logback-spring.xml
|
config: classpath:logback-spring.xml
|
||||||
# 输出级别
|
# 输出级别
|
||||||
level:
|
level:
|
||||||
cn.lili: info
|
root: info
|
||||||
# org.hibernate: debug
|
# org.hibernate: debug
|
||||||
# org.springframework: debug
|
# org.springframework: debug
|
||||||
# org.springframework.data.mongodb.core: debug
|
|
||||||
file:
|
file:
|
||||||
# 指定路径
|
# 指定路径
|
||||||
path: lili-logs
|
path: lili-logs
|
||||||
|
|||||||
61
consumer/src/test/java/cn/lili/buyer/test/bill/BillTest.java
Normal file
61
consumer/src/test/java/cn/lili/buyer/test/bill/BillTest.java
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
package cn.lili.buyer.test.bill;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.lili.modules.store.entity.dto.StoreSettlementDay;
|
||||||
|
import cn.lili.modules.store.service.BillService;
|
||||||
|
import cn.lili.modules.store.service.StoreDetailService;
|
||||||
|
import org.junit.jupiter.api.Assertions;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author paulG
|
||||||
|
* @since 2022/1/10
|
||||||
|
**/
|
||||||
|
@ExtendWith(SpringExtension.class)
|
||||||
|
@SpringBootTest
|
||||||
|
public class BillTest {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结算单
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private BillService billService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺详情
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private StoreDetailService storeDetailService;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void createBillTest() {
|
||||||
|
//获取当前天数
|
||||||
|
int day = DateUtil.date().dayOfMonth();
|
||||||
|
|
||||||
|
//获取待结算商家列表
|
||||||
|
List<StoreSettlementDay> storeList = storeDetailService.getSettlementStore(day);
|
||||||
|
|
||||||
|
//获取当前时间
|
||||||
|
DateTime endTime = DateUtil.date();
|
||||||
|
//批量商家结算
|
||||||
|
for (StoreSettlementDay storeSettlementDay : storeList) {
|
||||||
|
|
||||||
|
//生成结算单
|
||||||
|
billService.createBill(storeSettlementDay.getStoreId(), storeSettlementDay.getSettlementDay(), endTime);
|
||||||
|
|
||||||
|
//修改店铺结算时间
|
||||||
|
storeDetailService.updateSettlementDay(storeSettlementDay.getStoreId(), endTime);
|
||||||
|
}
|
||||||
|
Assertions.assertTrue(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -15,6 +15,11 @@
|
|||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-properties-migrator</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.junit.vintage</groupId>
|
<groupId>org.junit.vintage</groupId>
|
||||||
<artifactId>junit-vintage-engine</artifactId>
|
<artifactId>junit-vintage-engine</artifactId>
|
||||||
@@ -26,9 +31,27 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!--定时任务-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-quartz</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>log4j-to-slf4j</artifactId>
|
||||||
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
@@ -55,6 +78,10 @@
|
|||||||
<artifactId>HdrHistogram</artifactId>
|
<artifactId>HdrHistogram</artifactId>
|
||||||
<groupId>org.hdrhistogram</groupId>
|
<groupId>org.hdrhistogram</groupId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -64,49 +91,61 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.integration</groupId>
|
<groupId>org.springframework.integration</groupId>
|
||||||
<artifactId>spring-integration-redis</artifactId>
|
<artifactId>spring-integration-redis</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-pool2</artifactId>
|
<artifactId>commons-pool2</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--mongodb依赖配置-->
|
<!-- <!– Websocket –>-->
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>org.springframework.boot</groupId>
|
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||||
<artifactId>spring-boot-starter-data-mongodb</artifactId>
|
<!-- <artifactId>spring-boot-starter-websocket</artifactId>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
<!-- <!– Websocket –>-->
|
|
||||||
<!-- <dependency>-->
|
|
||||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
|
||||||
<!-- <artifactId>spring-boot-starter-websocket</artifactId>-->
|
|
||||||
<!-- </dependency>-->
|
|
||||||
<!-- MybatisPlus -->
|
<!-- MybatisPlus -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.baomidou</groupId>
|
<groupId>com.baomidou</groupId>
|
||||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
<version>${mybatis-plus-version}</version>
|
<version>${mybatis-plus-version}</version>
|
||||||
</dependency>
|
<exclusions>
|
||||||
<dependency>
|
<exclusion>
|
||||||
<groupId>org.mybatis.spring.boot</groupId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
<artifactId>mybatis-spring-boot-starter-test</artifactId>
|
<groupId>org.slf4j</groupId>
|
||||||
<version>1.3.2</version>
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Mysql Connector -->
|
<!-- Mysql Connector -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mysql</groupId>
|
<groupId>mysql</groupId>
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
<version>${mysql-connector-version}</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Redis-->
|
<!-- Redis-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Swagger API文档 -->
|
<!-- https://mvnrepository.com/artifact/org.redisson/redisson-spring-boot-starter -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.redisson</groupId>
|
||||||
|
<artifactId>redisson</artifactId>
|
||||||
|
<version>${redisson}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.xiaoymin</groupId>
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||||
<version>${knife4j.version}</version>
|
<version>${knife4j.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Hutool工具包 -->
|
<!-- Hutool工具包 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -136,6 +175,12 @@
|
|||||||
<groupId>com.aliyun</groupId>
|
<groupId>com.aliyun</groupId>
|
||||||
<artifactId>aliyun-java-sdk-core</artifactId>
|
<artifactId>aliyun-java-sdk-core</artifactId>
|
||||||
<version>${aliyun-version}</version>
|
<version>${aliyun-version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- 阿里云OSS -->
|
<!-- 阿里云OSS -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -154,6 +199,16 @@
|
|||||||
<groupId>com.aliyun</groupId>
|
<groupId>com.aliyun</groupId>
|
||||||
<artifactId>dysmsapi20170525</artifactId>
|
<artifactId>dysmsapi20170525</artifactId>
|
||||||
<version>${aliyun-sdk-dysms-version}</version>
|
<version>${aliyun-sdk-dysms-version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>org.jacoco.agent</artifactId>
|
||||||
|
<groupId>org.jacoco</groupId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>bcprov-jdk15on</artifactId>
|
||||||
|
<groupId>org.bouncycastle</groupId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--脚本编程-->
|
<!--脚本编程-->
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -165,6 +220,16 @@
|
|||||||
<groupId>org.apache.rocketmq</groupId>
|
<groupId>org.apache.rocketmq</groupId>
|
||||||
<artifactId>rocketmq-spring-boot-starter</artifactId>
|
<artifactId>rocketmq-spring-boot-starter</artifactId>
|
||||||
<version>${rocketmq-version}</version>
|
<version>${rocketmq-version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>fastjson</artifactId>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- token加密 -->
|
<!-- token加密 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -188,6 +253,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 解决版本提示问题 -->
|
<!-- 解决版本提示问题 -->
|
||||||
@@ -213,6 +284,18 @@
|
|||||||
<artifactId>groovy</artifactId>
|
<artifactId>groovy</artifactId>
|
||||||
<groupId>org.codehaus.groovy</groupId>
|
<groupId>org.codehaus.groovy</groupId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>commons-collections4</artifactId>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>antlr4-runtime</artifactId>
|
||||||
|
<groupId>org.antlr</groupId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
@@ -220,6 +303,12 @@
|
|||||||
<groupId>org.apache.shardingsphere</groupId>
|
<groupId>org.apache.shardingsphere</groupId>
|
||||||
<artifactId>sharding-jdbc-spring-namespace</artifactId>
|
<artifactId>sharding-jdbc-spring-namespace</artifactId>
|
||||||
<version>${sharding-jdbc-version}</version>
|
<version>${sharding-jdbc-version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--druid-->
|
<!--druid-->
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -241,6 +330,20 @@
|
|||||||
<groupId>com.alipay.sdk</groupId>
|
<groupId>com.alipay.sdk</groupId>
|
||||||
<artifactId>alipay-sdk-java</artifactId>
|
<artifactId>alipay-sdk-java</artifactId>
|
||||||
<version>${alipay-sdk-version}</version>
|
<version>${alipay-sdk-version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>bcprov-jdk15on</artifactId>
|
||||||
|
<groupId>org.bouncycastle</groupId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>commons-logging</artifactId>
|
||||||
|
<groupId>commons-logging</groupId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>xml-apis</artifactId>
|
||||||
|
<groupId>xml-apis</groupId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--用户端类型处理-->
|
<!--用户端类型处理-->
|
||||||
@@ -265,11 +368,6 @@
|
|||||||
<artifactId>logstash-logback-encoder</artifactId>
|
<artifactId>logstash-logback-encoder</artifactId>
|
||||||
<version>${logstash-logback-encoder}</version>
|
<version>${logstash-logback-encoder}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- <dependency>-->
|
|
||||||
<!-- <groupId>javax.interceptor</groupId>-->
|
|
||||||
<!-- <artifactId>javax.interceptor-api</artifactId>-->
|
|
||||||
<!-- <version>${interceptor-api}</version>-->
|
|
||||||
<!-- </dependency>-->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>de.codecentric</groupId>
|
<groupId>de.codecentric</groupId>
|
||||||
<artifactId>spring-boot-admin-starter-client</artifactId>
|
<artifactId>spring-boot-admin-starter-client</artifactId>
|
||||||
@@ -307,6 +405,12 @@
|
|||||||
<groupId>com.googlecode.owasp-java-html-sanitizer</groupId>
|
<groupId>com.googlecode.owasp-java-html-sanitizer</groupId>
|
||||||
<artifactId>owasp-java-html-sanitizer</artifactId>
|
<artifactId>owasp-java-html-sanitizer</artifactId>
|
||||||
<version>${owasp-java-html-sanitizer}</version>
|
<version>${owasp-java-html-sanitizer}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>guava</artifactId>
|
||||||
|
<groupId>com.google.guava</groupId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
@@ -211,6 +211,14 @@ public interface Cache<T> {
|
|||||||
* @return 计数器结果
|
* @return 计数器结果
|
||||||
*/
|
*/
|
||||||
Long incr(String key, long liveTime);
|
Long incr(String key, long liveTime);
|
||||||
|
/**
|
||||||
|
* redis 计数器 累加
|
||||||
|
* 注:到达liveTime之后,该次增加取消,即自动-1,而不是redis值为空
|
||||||
|
*
|
||||||
|
* @param key 为累计的key,同一key每次调用则值 +1
|
||||||
|
* @return 计数器结果
|
||||||
|
*/
|
||||||
|
Long incr(String key);
|
||||||
//-----------------------------------------------redis计数---------------------------------------------
|
//-----------------------------------------------redis计数---------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -480,7 +480,11 @@ public enum CachePrefix {
|
|||||||
/**
|
/**
|
||||||
* 订单暂时缓存
|
* 订单暂时缓存
|
||||||
*/
|
*/
|
||||||
ORDER;
|
ORDER,
|
||||||
|
/**
|
||||||
|
* 敏感词
|
||||||
|
*/
|
||||||
|
SENSITIVE;
|
||||||
|
|
||||||
|
|
||||||
public static String removePrefix(String str) {
|
public static String removePrefix(String str) {
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
package cn.lili.cache.config.mongo;
|
|
||||||
|
|
||||||
import com.mongodb.MongoClientSettings;
|
|
||||||
import com.mongodb.MongoCredential;
|
|
||||||
import com.mongodb.ServerAddress;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.data.mongodb.config.AbstractMongoClientConfiguration;
|
|
||||||
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author paulG
|
|
||||||
* @since 2020/10/22
|
|
||||||
**/
|
|
||||||
@Configuration
|
|
||||||
@EnableMongoRepositories
|
|
||||||
public class MongoConfig extends AbstractMongoClientConfiguration {
|
|
||||||
|
|
||||||
@Value("${spring.data.mongodb.database}")
|
|
||||||
private String databaseName;
|
|
||||||
|
|
||||||
@Value("${spring.data.mongodb.uri}")
|
|
||||||
private List<String> uri = new ArrayList<>();
|
|
||||||
|
|
||||||
@Value("${spring.data.mongodb.username}")
|
|
||||||
private String username;
|
|
||||||
|
|
||||||
@Value("${spring.data.mongodb.password}")
|
|
||||||
private String password;
|
|
||||||
|
|
||||||
@Value("${spring.data.mongodb.authentication-database}")
|
|
||||||
private String authenticationDatabase;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected String getDatabaseName() {
|
|
||||||
return databaseName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void configureClientSettings(MongoClientSettings.Builder builder) {
|
|
||||||
builder.credential(MongoCredential.createCredential(username, authenticationDatabase, password.toCharArray()))
|
|
||||||
.applyToClusterSettings(settings -> {
|
|
||||||
List<ServerAddress> serverAddresses = new ArrayList<>();
|
|
||||||
for (String s : uri) {
|
|
||||||
String[] node = s.split(":");
|
|
||||||
serverAddresses.add(new ServerAddress(node[0], Integer.parseInt(node[1])));
|
|
||||||
}
|
|
||||||
settings.hosts(serverAddresses);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,17 @@
|
|||||||
package cn.lili.cache.config.redis;
|
package cn.lili.cache.config.redis;
|
||||||
|
|
||||||
|
import cn.hutool.core.text.CharSequenceUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.parser.ParserConfig;
|
import com.alibaba.fastjson.parser.ParserConfig;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.codec.digest.DigestUtils;
|
import org.apache.commons.codec.digest.DigestUtils;
|
||||||
|
import org.redisson.Redisson;
|
||||||
|
import org.redisson.api.RedissonClient;
|
||||||
|
import org.redisson.config.ClusterServersConfig;
|
||||||
|
import org.redisson.config.Config;
|
||||||
|
import org.redisson.config.SentinelServersConfig;
|
||||||
|
import org.redisson.config.SingleServerConfig;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
@@ -28,7 +36,9 @@ import org.springframework.data.redis.serializer.RedisSerializationContext;
|
|||||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,6 +59,9 @@ public class RedisConfig extends CachingConfigurerSupport {
|
|||||||
@Value("${lili.cache.timeout:7200}")
|
@Value("${lili.cache.timeout:7200}")
|
||||||
private Integer timeout;
|
private Integer timeout;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisProperties redisProperties;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当有多个管理器的时候,必须使用该注解在一个管理器上注释:表示该管理器为默认的管理器
|
* 当有多个管理器的时候,必须使用该注解在一个管理器上注释:表示该管理器为默认的管理器
|
||||||
@@ -78,6 +91,7 @@ public class RedisConfig extends CachingConfigurerSupport {
|
|||||||
可参考 https://blog.csdn.net/u012240455/article/details/80538540
|
可参考 https://blog.csdn.net/u012240455/article/details/80538540
|
||||||
*/
|
*/
|
||||||
ParserConfig.getGlobalInstance().addAccept("cn.lili.");
|
ParserConfig.getGlobalInstance().addAccept("cn.lili.");
|
||||||
|
ParserConfig.getGlobalInstance().addAccept("cn.hutool.json.");
|
||||||
|
|
||||||
return cacheManager;
|
return cacheManager;
|
||||||
}
|
}
|
||||||
@@ -98,6 +112,44 @@ public class RedisConfig extends CachingConfigurerSupport {
|
|||||||
return template;
|
return template;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean(destroyMethod = "shutdown")
|
||||||
|
public RedissonClient redisson() {
|
||||||
|
Config config = new Config();
|
||||||
|
|
||||||
|
if (redisProperties.getSentinel() != null && !redisProperties.getSentinel().getNodes().isEmpty()) {
|
||||||
|
// 哨兵模式
|
||||||
|
SentinelServersConfig sentinelServersConfig = config.useSentinelServers();
|
||||||
|
sentinelServersConfig.setMasterName(redisProperties.getSentinel().getMaster());
|
||||||
|
List<String> sentinelAddress = new ArrayList<>();
|
||||||
|
for (String node : redisProperties.getCluster().getNodes()) {
|
||||||
|
sentinelAddress.add("redis://" + node);
|
||||||
|
}
|
||||||
|
sentinelServersConfig.setSentinelAddresses(sentinelAddress);
|
||||||
|
if (CharSequenceUtil.isNotEmpty(redisProperties.getSentinel().getPassword())) {
|
||||||
|
sentinelServersConfig.setSentinelPassword(redisProperties.getSentinel().getPassword());
|
||||||
|
}
|
||||||
|
} else if (redisProperties.getCluster() != null && !redisProperties.getCluster().getNodes().isEmpty()) {
|
||||||
|
// 集群模式
|
||||||
|
ClusterServersConfig clusterServersConfig = config.useClusterServers();
|
||||||
|
List<String> clusterNodes = new ArrayList<>();
|
||||||
|
for (String node : redisProperties.getCluster().getNodes()) {
|
||||||
|
clusterNodes.add("redis://" + node);
|
||||||
|
}
|
||||||
|
clusterServersConfig.setNodeAddresses(clusterNodes);
|
||||||
|
if (CharSequenceUtil.isNotEmpty(redisProperties.getPassword())) {
|
||||||
|
clusterServersConfig.setPassword(redisProperties.getPassword());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
SingleServerConfig singleServerConfig = config.useSingleServer();
|
||||||
|
singleServerConfig.setAddress("redis://" + redisProperties.getHost() + ":" + redisProperties.getPort());
|
||||||
|
if (CharSequenceUtil.isNotEmpty(redisProperties.getPassword())) {
|
||||||
|
singleServerConfig.setPassword(redisProperties.getPassword());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Redisson.create(config);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义缓存key生成策略,默认将使用该策略
|
* 自定义缓存key生成策略,默认将使用该策略
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ public class RedisCache implements Cache {
|
|||||||
@Override
|
@Override
|
||||||
public Boolean remove(Object key) {
|
public Boolean remove(Object key) {
|
||||||
|
|
||||||
return redisTemplate.delete(key);
|
return redisTemplate.delete(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -207,13 +207,19 @@ public class RedisCache implements Cache {
|
|||||||
RedisAtomicLong entityIdCounter = new RedisAtomicLong(key, redisTemplate.getConnectionFactory());
|
RedisAtomicLong entityIdCounter = new RedisAtomicLong(key, redisTemplate.getConnectionFactory());
|
||||||
Long increment = entityIdCounter.getAndIncrement();
|
Long increment = entityIdCounter.getAndIncrement();
|
||||||
//初始设置过期时间
|
//初始设置过期时间
|
||||||
if ((null == increment || increment == 0) && liveTime > 0) {
|
if (increment == 0 && liveTime > 0) {
|
||||||
entityIdCounter.expire(liveTime, TimeUnit.SECONDS);
|
entityIdCounter.expire(liveTime, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
return increment;
|
return increment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long incr(String key) {
|
||||||
|
RedisAtomicLong entityIdCounter = new RedisAtomicLong(key, redisTemplate.getConnectionFactory());
|
||||||
|
return entityIdCounter.getAndIncrement();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 使用Sorted Set记录keyword
|
* 使用Sorted Set记录keyword
|
||||||
* zincrby命令,对于一个Sorted Set,存在的就把分数加x(x可自行设定),不存在就创建一个分数为1的成员
|
* zincrby命令,对于一个Sorted Set,存在的就把分数加x(x可自行设定),不存在就创建一个分数为1的成员
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package cn.lili.cache.limit.interceptor;
|
package cn.lili.cache.limit.interceptor;
|
||||||
|
|
||||||
import cn.lili.cache.limit.enums.LimitTypeEnums;
|
|
||||||
import cn.lili.cache.limit.annotation.LimitPoint;
|
import cn.lili.cache.limit.annotation.LimitPoint;
|
||||||
|
import cn.lili.cache.limit.enums.LimitTypeEnums;
|
||||||
import cn.lili.common.enums.ResultCode;
|
import cn.lili.common.enums.ResultCode;
|
||||||
import cn.lili.common.exception.ServiceException;
|
import cn.lili.common.exception.ServiceException;
|
||||||
|
import cn.lili.common.utils.IpUtils;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@@ -16,7 +17,6 @@ import org.springframework.data.redis.core.script.DefaultRedisScript;
|
|||||||
import org.springframework.web.context.request.RequestContextHolder;
|
import org.springframework.web.context.request.RequestContextHolder;
|
||||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -54,7 +54,8 @@ public class LimitInterceptor {
|
|||||||
key = limitPointAnnotation.key();
|
key = limitPointAnnotation.key();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
key = limitPointAnnotation.key() + getIpAddress();
|
key = limitPointAnnotation.key() + IpUtils
|
||||||
|
.getIpAddress(((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||||
}
|
}
|
||||||
ImmutableList<String> keys = ImmutableList.of(StringUtils.join(limitPointAnnotation.prefix(), key));
|
ImmutableList<String> keys = ImmutableList.of(StringUtils.join(limitPointAnnotation.prefix(), key));
|
||||||
try {
|
try {
|
||||||
@@ -71,32 +72,8 @@ public class LimitInterceptor {
|
|||||||
} catch (ServiceException e) {
|
} catch (ServiceException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException("服务器异常,请稍后再试");
|
throw new ServiceException(ResultCode.ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 默认unknown常量值
|
|
||||||
*/
|
|
||||||
private static final String UNKNOWN = "unknown";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取ip
|
|
||||||
* @return ip
|
|
||||||
*/
|
|
||||||
public String getIpAddress() {
|
|
||||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
||||||
String ip = request.getHeader("x-forwarded-for");
|
|
||||||
if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) {
|
|
||||||
ip = request.getHeader("Proxy-Client-IP");
|
|
||||||
}
|
|
||||||
if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) {
|
|
||||||
ip = request.getHeader("WL-Proxy-Client-IP");
|
|
||||||
}
|
|
||||||
if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) {
|
|
||||||
ip = request.getRemoteAddr();
|
|
||||||
}
|
|
||||||
return ip;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,250 +0,0 @@
|
|||||||
package cn.lili.cache.util;
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.data.redis.core.DefaultTypedTuple;
|
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Redis封装工具类
|
|
||||||
*
|
|
||||||
* @author paulG
|
|
||||||
* @since 2020/11/7
|
|
||||||
**/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
public class RedisUtil {
|
|
||||||
@Autowired
|
|
||||||
private RedisTemplate redisTemplate;
|
|
||||||
|
|
||||||
//=============================common============================
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 指定缓存失效时间
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param time 时间(秒)
|
|
||||||
* @return 操作结果
|
|
||||||
*/
|
|
||||||
public boolean expire(String key, long time) {
|
|
||||||
try {
|
|
||||||
if (time > 0) {
|
|
||||||
redisTemplate.expire(key, time, TimeUnit.SECONDS);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("指定缓存失效时间错误",e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//============================String=============================
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 普通缓存获取
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @return 值
|
|
||||||
*/
|
|
||||||
public Object get(String key) {
|
|
||||||
return key == null ? null : redisTemplate.opsForValue().get(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 普通缓存获取
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @return 值
|
|
||||||
*/
|
|
||||||
public <T> T get(String key, Class<T> clazz) {
|
|
||||||
Object o = key == null ? null : redisTemplate.opsForValue().get(key);
|
|
||||||
return (T) o;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 普通缓存放入
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param value 值
|
|
||||||
* @return true成功 false失败
|
|
||||||
*/
|
|
||||||
public boolean set(String key, Object value) {
|
|
||||||
try {
|
|
||||||
redisTemplate.opsForValue().set(key, value);
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("缓存放入错误",e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 普通缓存放入并设置时间
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param value 值
|
|
||||||
* @param time 时间(秒) time要大于0 如果time小于等于0 将设置无限期
|
|
||||||
* @return true成功 false 失败
|
|
||||||
*/
|
|
||||||
public boolean set(String key, Object value, long time) {
|
|
||||||
try {
|
|
||||||
if (time > 0) {
|
|
||||||
redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);
|
|
||||||
} else {
|
|
||||||
set(key, value);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("普通缓存放入并设置时间错误",e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//================================Map=================================
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 将数据放入set缓存
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param values 值 可以是多个
|
|
||||||
* @return 成功个数
|
|
||||||
*/
|
|
||||||
public long sSet(String key, Object... values) {
|
|
||||||
try {
|
|
||||||
return redisTemplate.opsForSet().add(key, values);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("将数据放入set缓存错误",e);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 将list放入缓存
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param value 值
|
|
||||||
* @return 操作结果
|
|
||||||
*/
|
|
||||||
public boolean lSet(String key, Object value) {
|
|
||||||
try {
|
|
||||||
redisTemplate.opsForList().rightPush(key, value);
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("将list放入缓存错误",e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 将list放入缓存
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param value 值
|
|
||||||
* @param time 时间(秒)
|
|
||||||
* @return 操作结果
|
|
||||||
*/
|
|
||||||
public boolean lSet(String key, Object value, long time) {
|
|
||||||
try {
|
|
||||||
redisTemplate.opsForList().rightPush(key, value);
|
|
||||||
if (time > 0) {
|
|
||||||
expire(key, time);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("将list放入缓存错误",e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 将list放入缓存
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param value 值
|
|
||||||
* @return 操作结果
|
|
||||||
*/
|
|
||||||
public boolean lSet(String key, List<Object> value) {
|
|
||||||
try {
|
|
||||||
redisTemplate.opsForList().rightPushAll(key, value);
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("将list放入缓存错误",e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 将list放入缓存
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param value 值
|
|
||||||
* @param time 时间(秒)
|
|
||||||
* @return 操作结果
|
|
||||||
*/
|
|
||||||
public boolean lSet(String key, List<Object> value, long time) {
|
|
||||||
try {
|
|
||||||
redisTemplate.opsForList().rightPushAll(key, value);
|
|
||||||
if (time > 0) {
|
|
||||||
expire(key, time);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("将list放入缓存错误",e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//===============================ZSet=================================
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 向Zset里添加成员
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param score 分数
|
|
||||||
* @param value 值
|
|
||||||
* @return 操作结果
|
|
||||||
*/
|
|
||||||
public boolean zadd(String key, long score, String value) {
|
|
||||||
return redisTemplate.opsForZSet().add(key, value, score);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取 某key 下 某一分值区间的队列
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param from 起始位置
|
|
||||||
* @param to 结束为止
|
|
||||||
* @return 符合条件的结果集
|
|
||||||
*/
|
|
||||||
public Set<DefaultTypedTuple> zrangeByScoreWithScores(String key, int from, long to) {
|
|
||||||
Set<DefaultTypedTuple> set = redisTemplate.opsForZSet().rangeByScoreWithScores(key, from, to);
|
|
||||||
return set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 移除 Zset队列值
|
|
||||||
*
|
|
||||||
* @param key 键
|
|
||||||
* @param value 值集合
|
|
||||||
* @return 移除数量
|
|
||||||
*/
|
|
||||||
public Long zremove(String key, String... value) {
|
|
||||||
return redisTemplate.opsForZSet().remove(key, value);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
package cn.lili.modules.system.aspect.annotation;
|
package cn.lili.common.aop.annotation;
|
||||||
|
|
||||||
import java.lang.annotation.*;
|
import java.lang.annotation.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 演示站点注解
|
* 演示站点注解
|
||||||
|
* <p>
|
||||||
|
* PS 此注解需要用户登录之后才可以使用
|
||||||
*
|
*
|
||||||
* @author Bulbasaur
|
* @author Bulbasaur
|
||||||
* @since 2021/7/9 1:40 上午
|
* @since 2021/7/9 1:40 上午
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user