Compare commits
984 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
0de787b742 | |
|
|
2708b28bdb | |
|
|
185d3ba433 | |
|
|
2c787269be | |
|
|
e87f8f47b1 | |
|
|
4f5661bff3 | |
|
|
07b55f8508 | |
|
|
f96c92b260 | |
|
|
03a0226fcb | |
|
|
c2260304e5 | |
|
|
dcf5b53bd5 | |
|
|
c0e115da80 | |
|
|
318ab208be | |
|
|
92732dcd0b | |
|
|
07635d91d1 | |
|
|
9055a4c4ff | |
|
|
d64b4d0fa1 | |
|
|
f56c7f6426 | |
|
|
de42363874 | |
|
|
ddcdc4ccbc | |
|
|
9ba5040702 | |
|
|
29a0d5c511 | |
|
|
01d57b8c68 | |
|
|
1ebd1a3950 | |
|
|
2d00348376 | |
|
|
e4a0407016 | |
|
|
9a2d058b63 | |
|
|
874ca79ef8 | |
|
|
e8e788cff4 | |
|
|
20874d4204 | |
|
|
ede52b1944 | |
|
|
558eb355b3 | |
|
|
6c175343ee | |
|
|
01bfff0f25 | |
|
|
3eb2311ea9 | |
|
|
51f0a2b71c | |
|
|
3e895b4a7d | |
|
|
0320057bc9 | |
|
|
63574fda34 | |
|
|
9a568fe1e3 | |
|
|
d96d692b61 | |
|
|
ac904d0c19 | |
|
|
94f46b8894 | |
|
|
ec27cec15e | |
|
|
e9157f9093 | |
|
|
6063121fac | |
|
|
62e46d9539 | |
|
|
033db28c0b | |
|
|
1b501a998d | |
|
|
ae0e85fb04 | |
|
|
80ed05718b | |
|
|
9ab868ac6b | |
|
|
8a99c54729 | |
|
|
cdfba5d579 | |
|
|
0a4a89edbb | |
|
|
13a00bcefd | |
|
|
7279430489 | |
|
|
61f7cf1058 | |
|
|
bde0552cf8 | |
|
|
181064a38c | |
|
|
d9d92011e5 | |
|
|
353b170975 | |
|
|
5b520fa0ea | |
|
|
e574a6456d | |
|
|
44636808d9 | |
|
|
d01d3615b1 | |
|
|
17e58f9158 | |
|
|
c1b15950ba | |
|
|
02cea05706 | |
|
|
3ea25c831e | |
|
|
fe0c9f26c7 | |
|
|
6530f24f2a | |
|
|
608921b366 | |
|
|
3c05e97462 | |
|
|
dafc70aea4 | |
|
|
2d60b5823e | |
|
|
90f4b0479d | |
|
|
f617343a01 | |
|
|
84cc064fd9 | |
|
|
b4068fbd3b | |
|
|
2ef59654ef | |
|
|
5bb1e28310 | |
|
|
2123606bf5 | |
|
|
bbc1eadd71 | |
|
|
2180aa9c6d | |
|
|
ffbc0d0a30 | |
|
|
b64c2fa598 | |
|
|
ad8c293579 | |
|
|
cb1cb88347 | |
|
|
7996129a7c | |
|
|
f40a6b9e8e | |
|
|
35bc20c77e | |
|
|
4d120c1621 | |
|
|
fdba1146e5 | |
|
|
c75b6944a0 | |
|
|
fbf2871e81 | |
|
|
e99ccf8e13 | |
|
|
aa36ee79a1 | |
|
|
df4810d64a | |
|
|
78abd6e9fa | |
|
|
86e6714f97 | |
|
|
84d2420c59 | |
|
|
84816c8a8c | |
|
|
052f2c24f6 | |
|
|
9b8f5d26da | |
|
|
2e10fbe7b9 | |
|
|
d7552d47b9 | |
|
|
713016b6e9 | |
|
|
dbf288160a | |
|
|
330200a11d | |
|
|
f628b57673 | |
|
|
8c04903988 | |
|
|
10edfc836e | |
|
|
6d5d9fda85 | |
|
|
70e7fa6df1 | |
|
|
4699959fae | |
|
|
0b9f15939a | |
|
|
60ac492f9a | |
|
|
f9a22f31f2 | |
|
|
0018f86dfc | |
|
|
ad530a01f0 | |
|
|
139dd18e45 | |
|
|
320e2871fd | |
|
|
df7251553c | |
|
|
ea69c2714d | |
|
|
e345589956 | |
|
|
d2eb98e8b7 | |
|
|
74ae88c7fe | |
|
|
05fbdb0826 | |
|
|
3c2d32bf92 | |
|
|
f40b7c498f | |
|
|
50730ce702 | |
|
|
6fe5149412 | |
|
|
b637195ae9 | |
|
|
a4a0f7b2d9 | |
|
|
e15c58fc32 | |
|
|
d96e4f304d | |
|
|
8bd9b29b7a | |
|
|
9ed1548487 | |
|
|
92f0d5e5b5 | |
|
|
82d675a2c5 | |
|
|
55360f22ef | |
|
|
d125249994 | |
|
|
27d1cff67c | |
|
|
cd9acb3678 | |
|
|
96ecb86d42 | |
|
|
cb5f006c22 | |
|
|
26ef4f20e7 | |
|
|
b85286b7f0 | |
|
|
7a4a9a1db2 | |
|
|
86c359315e | |
|
|
1765f1c782 | |
|
|
f8cf41b9fc | |
|
|
4cae2309c6 | |
|
|
dbeef93af8 | |
|
|
3995b95148 | |
|
|
d6708cf5d3 | |
|
|
e1741d444b | |
|
|
12fdb6aefe | |
|
|
3820d86c8a | |
|
|
c027336989 | |
|
|
2c17e5dcdf | |
|
|
759a393b7d | |
|
|
656ef5165b | |
|
|
6709965e28 | |
|
|
2f5053ebeb | |
|
|
ac67323f0d | |
|
|
554ac3bf6a | |
|
|
5e99bd272c | |
|
|
306e14b299 | |
|
|
e59b9036b0 | |
|
|
1f1bd65bb1 | |
|
|
1bbe60f413 | |
|
|
d0decccb22 | |
|
|
3a9dc2be14 | |
|
|
fc3b817824 | |
|
|
dd64b83c37 | |
|
|
89a013ac92 | |
|
|
ab97f4aa3e | |
|
|
f078333d37 | |
|
|
242ccbf95e | |
|
|
54d7d73b25 | |
|
|
da9681d9a0 | |
|
|
8efad50d8d | |
|
|
f96f60e9cf | |
|
|
1e1474659e | |
|
|
2a23d080d0 | |
|
|
e19457de26 | |
|
|
ffde41dd97 | |
|
|
0c3d5a0fcc | |
|
|
182fb84d3c | |
|
|
abb579dfde | |
|
|
9614b670d9 | |
|
|
911ca038ae | |
|
|
9794dbaa05 | |
|
|
848d23148f | |
|
|
e7d407de1d | |
|
|
89fe82f491 | |
|
|
9e5a18b80b | |
|
|
a101862f34 | |
|
|
118f0145be | |
|
|
4d81c79443 | |
|
|
e788503426 | |
|
|
f662c9f458 | |
|
|
82aab9e28e | |
|
|
29e15b5ad5 | |
|
|
98db120f1f | |
|
|
bd36913fdc | |
|
|
5b1ce2f582 | |
|
|
4285cc7bbd | |
|
|
31a3ac76df | |
|
|
de28c59bd5 | |
|
|
fdc0f6816f | |
|
|
acc65c35a1 | |
|
|
a3ee3031ee | |
|
|
ddf97b138a | |
|
|
dc96552896 | |
|
|
f8788a7786 | |
|
|
464bb80755 | |
|
|
fae7d9ed5d | |
|
|
4a65b4a2c2 | |
|
|
3fbafafcf4 | |
|
|
4675910f77 | |
|
|
922f1bce15 | |
|
|
2212e1d14c | |
|
|
faac76cc33 | |
|
|
655b545bdb | |
|
|
618286703e | |
|
|
c199711e4d | |
|
|
5f78e3e0c2 | |
|
|
fc7ebf5922 | |
|
|
95a9d30e78 | |
|
|
1562554160 | |
|
|
f616d520d0 | |
|
|
e3236d47a9 | |
|
|
e99125725f | |
|
|
30c513d71d | |
|
|
b355cd0ba7 | |
|
|
993b65caae | |
|
|
9fe5a3d25a | |
|
|
6b726bbb35 | |
|
|
9a99cc6e1d | |
|
|
1166fca22f | |
|
|
e2103d4d0d | |
|
|
0ef7e2643e | |
|
|
ff32ec71c1 | |
|
|
5b518f674b | |
|
|
1b47bdd8f3 | |
|
|
4c7cc285ea | |
|
|
727beadca3 | |
|
|
708f939917 | |
|
|
70679110e2 | |
|
|
1faf6cccbb | |
|
|
16f357f78e | |
|
|
0bb5214696 | |
|
|
0b6a54b914 | |
|
|
ea1c656034 | |
|
|
4b8fc8a15c | |
|
|
7762a5bc36 | |
|
|
de02f98141 | |
|
|
f83945f8f5 | |
|
|
acd952a8a1 | |
|
|
11c3b4f178 | |
|
|
d5daa207ad | |
|
|
9b4354ae70 | |
|
|
0d2a930ae8 | |
|
|
da7ddb8128 | |
|
|
94fd4fc34d | |
|
|
618374564e | |
|
|
9881299f64 | |
|
|
316b618e24 | |
|
|
b4cba628d4 | |
|
|
d6c7402b11 | |
|
|
fb191b0539 | |
|
|
eb7f4824d2 | |
|
|
7944f63aed | |
|
|
0c991194af | |
|
|
292f799820 | |
|
|
1f8b2cba50 | |
|
|
abca38dd53 | |
|
|
d8171cfb75 | |
|
|
078b8d1c5d | |
|
|
aed955c513 | |
|
|
1560e5a36f | |
|
|
3c2af59c4c | |
|
|
33e2a12618 | |
|
|
cf492b32f1 | |
|
|
30f35128fd | |
|
|
670446215a | |
|
|
a1c8f649ff | |
|
|
fed18330b5 | |
|
|
4d6cac0e1f | |
|
|
58f9622656 | |
|
|
827cc937e1 | |
|
|
49755e6354 | |
|
|
e6ad8baeeb | |
|
|
b73ca2c6e7 | |
|
|
bf083f698e | |
|
|
39984116d0 | |
|
|
0adb5333ee | |
|
|
122e084a04 | |
|
|
5b9ddbe91c | |
|
|
89dfeb8a20 | |
|
|
f809c40a64 | |
|
|
00cbb7bc4f | |
|
|
9ec1f7c175 | |
|
|
9929065487 | |
|
|
db3b892616 | |
|
|
39b8ecb575 | |
|
|
249c6b4a6e | |
|
|
7c18e80c88 | |
|
|
6118711919 | |
|
|
22ab03ea51 | |
|
|
bd529b2425 | |
|
|
7bb6198798 | |
|
|
423b6f303f | |
|
|
8ed14ed241 | |
|
|
a4c77c2403 | |
|
|
3ee1e1efbf | |
|
|
2d0d9ba573 | |
|
|
7fa139e6fb | |
|
|
de7236f624 | |
|
|
c943a77a27 | |
|
|
f77d8c216e | |
|
|
8fd22fb1d8 | |
|
|
57ef7f91a1 | |
|
|
ac002cb1dd | |
|
|
f1341b8c7f | |
|
|
d685d437aa | |
|
|
4b08359ddd | |
|
|
6c3f5e22d7 | |
|
|
4d53c5a015 | |
|
|
7ce6667841 | |
|
|
3fd64d4806 | |
|
|
1d153a2c4d | |
|
|
fa868f6414 | |
|
|
69c0de7651 | |
|
|
56dfdcd523 | |
|
|
ee219f637c | |
|
|
826d91b64d | |
|
|
3b2a657ea4 | |
|
|
d1acc9da71 | |
|
|
bc14da11f5 | |
|
|
5853d2b333 | |
|
|
1f34a8c227 | |
|
|
47bae409f9 | |
|
|
96e3e9a68f | |
|
|
eef047d3ff | |
|
|
7e6b791ac9 | |
|
|
0104323702 | |
|
|
500860109a | |
|
|
b93e6d72cd | |
|
|
8985676d5b | |
|
|
46820794d7 | |
|
|
5d7687830b | |
|
|
fbd98b52a5 | |
|
|
a6a202ce46 | |
|
|
dc79450b44 | |
|
|
48c5f09687 | |
|
|
23a0aeae48 | |
|
|
0d8f030b77 | |
|
|
678ed7bf8a | |
|
|
475e74dafe | |
|
|
d23bcde03e | |
|
|
09b2fe2a74 | |
|
|
1746d6b664 | |
|
|
c68faf5914 | |
|
|
4e198d8213 | |
|
|
6ded7fb0de | |
|
|
6f9bcb7f2d | |
|
|
e239ecf6d7 | |
|
|
3792b20748 | |
|
|
a22bf5040b | |
|
|
9cb7244eaa | |
|
|
08b7e66bac | |
|
|
598ed3c4de | |
|
|
4247e019e4 | |
|
|
77b487a060 | |
|
|
2f7d139769 | |
|
|
586bc3461b | |
|
|
87da3e9bb2 | |
|
|
328cd3bb66 | |
|
|
ca68666a36 | |
|
|
9c3f4db39a | |
|
|
7e175d8c6d | |
|
|
c89673d4ea | |
|
|
f210284292 | |
|
|
45fe70f28d | |
|
|
7ccdddef1e | |
|
|
b84655a7c0 | |
|
|
60ca3e40fd | |
|
|
f0c4ea2242 | |
|
|
3658dce209 | |
|
|
022dafec0b | |
|
|
86282ee1ac | |
|
|
15d93a54cd | |
|
|
1fc478dbc8 | |
|
|
10a3a27533 | |
|
|
da10f7a387 | |
|
|
2542d664ca | |
|
|
0051c6e24e | |
|
|
4968f5ce6d | |
|
|
e7e1fae4ce | |
|
|
d3d7371236 | |
|
|
3cc352755e | |
|
|
fd34cbcd0e | |
|
|
08814a21a3 | |
|
|
447b38d68a | |
|
|
d69161796e | |
|
|
5b6c1a24cd | |
|
|
f0af7d927f | |
|
|
a07ee3f58b | |
|
|
a2cd91bf75 | |
|
|
2503acef47 | |
|
|
81ad6f433c | |
|
|
f7568202df | |
|
|
b56f27c753 | |
|
|
80c5bc6fec | |
|
|
02cbb27eac | |
|
|
0f07ebf8e4 | |
|
|
d9ee6b21ec | |
|
|
2154ebae15 | |
|
|
b024f2b627 | |
|
|
2c00b8214f | |
|
|
23e3cd0d76 | |
|
|
370555aa66 | |
|
|
e491d77e65 | |
|
|
ae84ca9f15 | |
|
|
0390cc4576 | |
|
|
46a86a2c82 | |
|
|
5bef4af600 | |
|
|
0b710bd391 | |
|
|
166d550fe6 | |
|
|
a826af831c | |
|
|
dde3759772 | |
|
|
9fa8d50073 | |
|
|
b6f1709219 | |
|
|
c361fe651d | |
|
|
e0fc346f26 | |
|
|
2b286e6a07 | |
|
|
bbec3575e7 | |
|
|
2e3885cfac | |
|
|
9646b7458d | |
|
|
05a3be5ecb | |
|
|
78af79294d | |
|
|
dc9feaa61b | |
|
|
e7876a5776 | |
|
|
e71ae0e163 | |
|
|
a685819158 | |
|
|
3a1c30398c | |
|
|
53ea3ca898 | |
|
|
cf6200ee19 | |
|
|
e5b775a834 | |
|
|
b825373174 | |
|
|
14f1085262 | |
|
|
9a196e4d4a | |
|
|
a970d129e0 | |
|
|
c045b38f26 | |
|
|
ef8e3da576 | |
|
|
d52ca37519 | |
|
|
af53aee3fc | |
|
|
d430e8dacf | |
|
|
9881e50176 | |
|
|
8d41b4c2a9 | |
|
|
fc6aaf8b35 | |
|
|
15e826ddc1 | |
|
|
29e57fbfda | |
|
|
d8f36c57bf | |
|
|
ea744fc033 | |
|
|
a1ef6dd6da | |
|
|
f9e7387c85 | |
|
|
a095f7dc73 | |
|
|
237b1f3b88 | |
|
|
a1886bd26c | |
|
|
0afcba22df | |
|
|
17d872e7c4 | |
|
|
b67969e032 | |
|
|
a86a2fbdac | |
|
|
ba78b3368f | |
|
|
95982b58f8 | |
|
|
e96b01c57f | |
|
|
9bdb09232c | |
|
|
1e480dd2d9 | |
|
|
fde003728b | |
|
|
b16237467d | |
|
|
c4cd9bc231 | |
|
|
780afe8803 | |
|
|
2e116de9a8 | |
|
|
6b9d5aa3a3 | |
|
|
3baab6ce6f | |
|
|
41511d4f75 | |
|
|
8fc2ed90d5 | |
|
|
f186426a15 | |
|
|
419678eb44 | |
|
|
e0bda8f53d | |
|
|
7cc7c1a9e3 | |
|
|
f6b7ea18b1 | |
|
|
8b6369ce8f | |
|
|
bd61e9d512 | |
|
|
04a45099a9 | |
|
|
2f727b65e6 | |
|
|
a26357e47e | |
|
|
b4f52dd555 | |
|
|
75ce21c95c | |
|
|
e1e2061d4b | |
|
|
e09abbbb62 | |
|
|
8ed6fae67f | |
|
|
0f45681f8a | |
|
|
9cb9dda109 | |
|
|
13d3e70c84 | |
|
|
bb0aa1f5da | |
|
|
473a648e55 | |
|
|
701ca5066c | |
|
|
e8fa579cc9 | |
|
|
1d1f271388 | |
|
|
9000ee1a22 | |
|
|
be6ce13888 | |
|
|
f98ffcae1a | |
|
|
f98e41f725 | |
|
|
2842d53ab2 | |
|
|
6e39b90840 | |
|
|
26cde08873 | |
|
|
28476cb343 | |
|
|
d87e84c5bb | |
|
|
2deac81268 | |
|
|
7e0be5f7db | |
|
|
1510493305 | |
|
|
8bb97188ab | |
|
|
5bd4fd8091 | |
|
|
c3bc743f71 | |
|
|
eb49945e0f | |
|
|
5a18dcf8a0 | |
|
|
234a1cbda4 | |
|
|
706b8e64d3 | |
|
|
d6ca529ca4 | |
|
|
66ecbeb7df | |
|
|
8b8107bd49 | |
|
|
3c354bbced | |
|
|
d226882eec | |
|
|
57dd228b91 | |
|
|
59a16d15b7 | |
|
|
95f3e11250 | |
|
|
7d28f42fba | |
|
|
261ddda88a | |
|
|
819c6c1749 | |
|
|
0549dce6b0 | |
|
|
bfecca686d | |
|
|
4bdca32ea9 | |
|
|
d342e736ab | |
|
|
47cea3310c | |
|
|
b2c287d368 | |
|
|
86e96d48a4 | |
|
|
71a658e8a9 | |
|
|
f22f32daf9 | |
|
|
67f1db23ae | |
|
|
4062cdea57 | |
|
|
19b410aadd | |
|
|
fa5e8893f5 | |
|
|
7654096a32 | |
|
|
6d580ba7ef | |
|
|
a8e8a62c5b | |
|
|
2858463928 | |
|
|
f2f90221ed | |
|
|
120933024f | |
|
|
b5dd99fa62 | |
|
|
c40df0294d | |
|
|
46ef03d4bc | |
|
|
66373edde6 | |
|
|
a315472bb1 | |
|
|
9d424108c5 | |
|
|
85dfc14f6c | |
|
|
b10d65946c | |
|
|
da97bce83d | |
|
|
9f18fa3ddb | |
|
|
b857f1de0a | |
|
|
64ec96ecf1 | |
|
|
bcb2373c3d | |
|
|
2547a2b0d1 | |
|
|
0adc5ad23c | |
|
|
0dbb0bf821 | |
|
|
73b56e7513 | |
|
|
1637287974 | |
|
|
004377cc7e | |
|
|
82518adc0d | |
|
|
3cf3669f37 | |
|
|
6ca8e1c9b8 | |
|
|
0c34fd0959 | |
|
|
5de49a0912 | |
|
|
ccf791b53b | |
|
|
46faa2cf16 | |
|
|
017cf6656b | |
|
|
8ac90f970f | |
|
|
7c88de3a07 | |
|
|
5290229609 | |
|
|
47d4690f03 | |
|
|
1d36efdfe8 | |
|
|
b1e5427561 | |
|
|
f01ccf65ce | |
|
|
6f0c25c16c | |
|
|
069c3c80bb | |
|
|
d9669f7dfa | |
|
|
51c6ade4e4 | |
|
|
421e800f53 | |
|
|
043acf12a2 | |
|
|
e469ffd30c | |
|
|
ad14b7ec56 | |
|
|
5054534e01 | |
|
|
9a9b72e038 | |
|
|
c2e4ccc124 | |
|
|
8223dc8d97 | |
|
|
0cbbc4a028 | |
|
|
4d44fa9ef4 | |
|
|
9ce881c6b8 | |
|
|
aba764a187 | |
|
|
28824c23ff | |
|
|
7346d542df | |
|
|
612a2e6128 | |
|
|
1e5b4b3d5b | |
|
|
7f488f9da1 | |
|
|
8b32b3966f | |
|
|
713be9843d | |
|
|
be5ea6498b | |
|
|
64e069f469 | |
|
|
d1b7203d19 | |
|
|
7a1bd3dc00 | |
|
|
970994b51a | |
|
|
cd481bd9e9 | |
|
|
22042eb66e | |
|
|
0e53da8d18 | |
|
|
ce6cd6b3da | |
|
|
47e1fee03d | |
|
|
b1c6f85e46 | |
|
|
6f0601c165 | |
|
|
91bdf7508a | |
|
|
54e36ffb45 | |
|
|
48c1c2b250 | |
|
|
76542a365a | |
|
|
4a8417e2f1 | |
|
|
759be01d4f | |
|
|
b6b107b8f6 | |
|
|
0f3e628c38 | |
|
|
037c9fb465 | |
|
|
9d4137840b | |
|
|
87a9d8b976 | |
|
|
7f072067f3 | |
|
|
af8c75157c | |
|
|
df3eed844b | |
|
|
472bb4c700 | |
|
|
7f48aa15bc | |
|
|
7fbc7a9b73 | |
|
|
4d37f79650 | |
|
|
089c30982c | |
|
|
a4ebedec28 | |
|
|
eaf761d9b4 | |
|
|
6bf00106e4 | |
|
|
138e6a88ea | |
|
|
49b704409c | |
|
|
43ef068ab1 | |
|
|
427cee9f6b | |
|
|
ca6039bb55 | |
|
|
1fa9d34e7d | |
|
|
c58695ebcb | |
|
|
7cce74dea8 | |
|
|
5ccb47a9fa | |
|
|
1f9a220487 | |
|
|
6e3980cf8f | |
|
|
0ce330ef5d | |
|
|
646f166cb0 | |
|
|
0701690a12 | |
|
|
d69b115aa0 | |
|
|
6b15b624e3 | |
|
|
8d788ff987 | |
|
|
a5a308c1b0 | |
|
|
f08f33b794 | |
|
|
6808a19b70 | |
|
|
4899eeae89 | |
|
|
e6b5528248 | |
|
|
d8796602c8 | |
|
|
8869de273a | |
|
|
47b9bee58a | |
|
|
96796fd381 | |
|
|
d3b4eaa4b9 | |
|
|
14aadbc0dc | |
|
|
2129ae5f8b | |
|
|
3a802bc7ff | |
|
|
7487e028b0 | |
|
|
99f42514cf | |
|
|
4f0e0acacb | |
|
|
bdc7b208c0 | |
|
|
76d69a7c5c | |
|
|
080be5ac18 | |
|
|
e5b0fe5102 | |
|
|
5bd31743e4 | |
|
|
f2dee35c29 | |
|
|
524e3186ad | |
|
|
699c3684dd | |
|
|
f48d7a6f8c | |
|
|
aebf4abae3 | |
|
|
4f327a4517 | |
|
|
7153a7dfed | |
|
|
8609643524 | |
|
|
228082bf44 | |
|
|
36829066d3 | |
|
|
79f287dbdd | |
|
|
f7bc38994a | |
|
|
0846ae21e7 | |
|
|
06006aa431 | |
|
|
1524d70ccf | |
|
|
2943b3d3da | |
|
|
79775c27b1 | |
|
|
d586eb0cac | |
|
|
a12b87d47e | |
|
|
c34a1d1f88 | |
|
|
629cb43741 | |
|
|
b7d28c29d9 | |
|
|
ab1a2ed907 | |
|
|
0b46c55ce9 | |
|
|
a4e8dd6254 | |
|
|
ed35c0a6be | |
|
|
25f3bea5fe | |
|
|
32f50f003b | |
|
|
94c96d124e | |
|
|
713944e201 | |
|
|
e77ff15059 | |
|
|
066a1cb205 | |
|
|
b3e84d142c | |
|
|
d26f789b66 | |
|
|
cbef1e5fd4 | |
|
|
1152ea91fe | |
|
|
d9698b5e13 | |
|
|
34089ce86d | |
|
|
56a9728f28 | |
|
|
548f582d49 | |
|
|
547143920b | |
|
|
9b04cca3d7 | |
|
|
2fa2ea6ea3 | |
|
|
7df089f070 | |
|
|
8ec3fbd1f7 | |
|
|
ab17010291 | |
|
|
0ca1fc947d | |
|
|
b409268b49 | |
|
|
9c877ea969 | |
|
|
a59f76cd76 | |
|
|
83a929b063 | |
|
|
ca7435c813 | |
|
|
bb55084b30 | |
|
|
51fde65ddb | |
|
|
253a6cfbd2 | |
|
|
8a0bd59e9c | |
|
|
f5936d627c | |
|
|
050b369aa5 | |
|
|
d1c78ebfa0 | |
|
|
9063aa5a84 | |
|
|
670ef1f87b | |
|
|
3227be2aa2 | |
|
|
8fc90285fe | |
|
|
ac8d11bea7 | |
|
|
3c9e8b93a7 | |
|
|
daa7ad95cd | |
|
|
5bda429767 | |
|
|
2cbdf201a2 | |
|
|
d15f0ec207 | |
|
|
9dbd002211 | |
|
|
a069d14657 | |
|
|
2e99dd5745 | |
|
|
1b826b2782 | |
|
|
006dbc8dde | |
|
|
e9581d9cfd | |
|
|
9313f0f5d5 | |
|
|
467c597134 | |
|
|
00b79a40b4 | |
|
|
3751056ce8 | |
|
|
7ceb16478a | |
|
|
b6ef494987 | |
|
|
a4fa332a19 | |
|
|
a2a2b78f91 | |
|
|
a6b874c91d | |
|
|
6e1cb349ad | |
|
|
fac4805780 | |
|
|
66a4f44d6d | |
|
|
8bb4568d0b | |
|
|
88541a6c5c | |
|
|
72f5d23db6 | |
|
|
f79f26d155 | |
|
|
80cc0c2497 | |
|
|
c5cce14825 | |
|
|
3fa5d93755 | |
|
|
ab95c69bc6 | |
|
|
1de653a03e | |
|
|
86bff44e04 | |
|
|
70b8a5e9cc | |
|
|
9c44754b58 | |
|
|
59a779b5b8 | |
|
|
25a7ac1f68 | |
|
|
c5b3cfeb72 | |
|
|
a4d36a470c | |
|
|
f5b6f5829c | |
|
|
e18dbe51d6 | |
|
|
60bcef1e9b | |
|
|
31b22f9413 | |
|
|
339ac0ff8b | |
|
|
c7f5acf2e1 | |
|
|
ac7af967a1 | |
|
|
11916b677c | |
|
|
56a85c6a76 | |
|
|
25667f16e5 | |
|
|
080554f620 | |
|
|
8d4a8aac15 | |
|
|
d34c422425 | |
|
|
56ed87e3b5 | |
|
|
8b6dfabd8e | |
|
|
c3d1524c40 | |
|
|
23f3a197ad | |
|
|
ff56a9c5ac | |
|
|
03ff241236 | |
|
|
e08b8faf16 | |
|
|
06de9a1c5e | |
|
|
6b08b9070c | |
|
|
930ca57ddf | |
|
|
818751740d | |
|
|
dfb19c9ae6 | |
|
|
d0e230a1b8 | |
|
|
aafe9937a8 | |
|
|
bb7ef94706 | |
|
|
d4a8aa2685 | |
|
|
cef8f16ac8 | |
|
|
2ce3deea3c | |
|
|
49ab81c9b1 | |
|
|
764edfe8df | |
|
|
5c41fb8d67 | |
|
|
e7e48bfcca | |
|
|
0d5cb268b0 | |
|
|
31005bd6c7 | |
|
|
35e2f9abe5 | |
|
|
0acab5ce5c | |
|
|
1e39877bb0 | |
|
|
b5e6077321 | |
|
|
c9c5e37783 | |
|
|
657eef3b8a | |
|
|
f0fabd5d73 | |
|
|
76640b17a7 | |
|
|
6bcf58aafc | |
|
|
f4b6e68eff | |
|
|
d99f5121ed | |
|
|
d756d179ef | |
|
|
d3018a1536 | |
|
|
2aa5064d5f | |
|
|
97f920b6c7 | |
|
|
bf35cd843f | |
|
|
630899f901 | |
|
|
5cd753cc1c | |
|
|
55f488db7f | |
|
|
c659a887e7 | |
|
|
a2ead3d0d3 | |
|
|
46b86ca505 | |
|
|
440e6fae1a | |
|
|
8630a62c6d | |
|
|
a31bdc2396 | |
|
|
62b117865e | |
|
|
307ebac8fa | |
|
|
887746e9d3 | |
|
|
9f9b292919 | |
|
|
fc2757ff17 | |
|
|
eb31057b3e | |
|
|
2673440426 | |
|
|
39b37ea8bc | |
|
|
ce2af8c5be | |
|
|
95d2c0d809 | |
|
|
dcb68f5717 | |
|
|
e4c6a7082e | |
|
|
4d9773226e | |
|
|
8e95d7f68d | |
|
|
64b1841782 | |
|
|
d9b314df18 | |
|
|
d23cb8b71b | |
|
|
61f1a8de71 | |
|
|
409153fe76 | |
|
|
4e82692582 | |
|
|
2d9c1b4815 | |
|
|
537aeb09a1 | |
|
|
84f0cb0a9b | |
|
|
6756f35db6 | |
|
|
0db2362077 | |
|
|
4710fc4e71 | |
|
|
e44ceece68 | |
|
|
61a8c31e31 | |
|
|
02fe159249 | |
|
|
4aa63b5c92 | |
|
|
78f3c5e0bc | |
|
|
84acedfff6 | |
|
|
af6f23c6ca | |
|
|
25c606c856 | |
|
|
f32aa4c7a0 | |
|
|
c04eceb097 | |
|
|
949eb9b158 | |
|
|
db3027a2ed | |
|
|
31e11323c6 | |
|
|
08d87469ff | |
|
|
66369da7f1 | |
|
|
a0c5903aa6 | |
|
|
42fbc8ba65 | |
|
|
74e3b6526b | |
|
|
a962372583 | |
|
|
8e345b5737 | |
|
|
ddf3bf7697 | |
|
|
154401fafb | |
|
|
3e81ea93b6 | |
|
|
de08266971 | |
|
|
b4fb2afd68 | |
|
|
d620ccf564 | |
|
|
caeee47520 | |
|
|
696ffc49ae | |
|
|
ec1e94fdaf | |
|
|
d006a2dce3 | |
|
|
5ef41403e0 | |
|
|
dca94cc848 | |
|
|
77ac277856 | |
|
|
db50c78049 | |
|
|
212f27daa6 | |
|
|
c110695843 | |
|
|
02e5684c0f | |
|
|
0794ac7569 | |
|
|
e6fe3e66c7 | |
|
|
cedcec2cac | |
|
|
7d405f9455 | |
|
|
536560322c | |
|
|
97fc5a65f4 | |
|
|
1b111262ad | |
|
|
f2007bb881 | |
|
|
3b53b460fd | |
|
|
2e69148249 | |
|
|
55a36bc4da | |
|
|
44d3a084c8 | |
|
|
f703028fa1 | |
|
|
d01f66d6a4 | |
|
|
10817c01a0 | |
|
|
6bf8ee2c0b | |
|
|
2d302f31a8 | |
|
|
ccb76143cc | |
|
|
f9aa237f98 | |
|
|
449db66e2c | |
|
|
484d39819c | |
|
|
bd47a96228 | |
|
|
5dd5e09770 | |
|
|
f2b3a96303 | |
|
|
8a980114cf | |
|
|
3dbc5e8f55 | |
|
|
bb0ef6e778 | |
|
|
a8c34e628a | |
|
|
31678fa6f1 | |
|
|
2f88f54b0f | |
|
|
9c728249f7 | |
|
|
8ad76d3844 | |
|
|
daee376547 | |
|
|
5776984a42 | |
|
|
6d5fd5a39a | |
|
|
855ee133fe | |
|
|
f7da6eac1e | |
|
|
d7b41d61e3 | |
|
|
32f9746d30 | |
|
|
e6b88058b8 | |
|
|
de5229051c | |
|
|
5a6a34d85b | |
|
|
adae3380c3 | |
|
|
0f922d6978 | |
|
|
01bf1d6500 | |
|
|
cb00b99d00 | |
|
|
35d257bc56 | |
|
|
37be357a4f | |
|
|
65ba0e18ce | |
|
|
3f252fa669 | |
|
|
f1f4256fc9 | |
|
|
328a59f6b4 | |
|
|
6e5a0df70b | |
|
|
a5b791f007 | |
|
|
83cc406ec0 | |
|
|
956c5d2b2a | |
|
|
37e384b491 | |
|
|
240b54467d | |
|
|
25c6b49733 | |
|
|
df11252cd0 | |
|
|
bfbcb7301a | |
|
|
cde4185dea | |
|
|
b3f378f528 |
|
|
@ -60,3 +60,4 @@ build/
|
|||
/cash-api/order-server/src/main/resources/application-zs.yml
|
||||
/cash-api/product-server/src/main/resources/application-zs.yml
|
||||
/cash-api/system-server/src/main/resources/application-zs.yml
|
||||
/cash-service/code-generator/src/main/java/com/czg/Main.java
|
||||
|
|
|
|||
|
|
@ -0,0 +1,178 @@
|
|||
package com.czg.controller;
|
||||
|
||||
import com.czg.account.entity.UserInfo;
|
||||
import com.czg.account.service.UserInfoService;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentException;
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.Element;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 公众号 通知
|
||||
*
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/notify")
|
||||
public class NotifyController {
|
||||
|
||||
private static final String SUCCESS = "SUCCESS";
|
||||
|
||||
@Resource
|
||||
private UserInfoService userInfoService;
|
||||
private static final String TOKEN = "DZjyHBq3nTujF0NM1dnXikU8ZCvy";
|
||||
|
||||
|
||||
@RequestMapping(produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
public String notify(HttpServletRequest request,
|
||||
@RequestParam(required = false) String signature,
|
||||
@RequestParam(required = false) String timestamp,
|
||||
@RequestParam(required = false) String nonce,
|
||||
@RequestParam(required = false) String echostr) {
|
||||
|
||||
// 1. 处理 GET 请求(微信开发者验证)
|
||||
if ("GET".equals(request.getMethod())) {
|
||||
log.info("接收到微信验证请求 - signature: {}, timestamp: {}, nonce: {}, echostr: {}",
|
||||
signature, timestamp, nonce, echostr);
|
||||
return echostr;
|
||||
}
|
||||
|
||||
// 2. 处理 POST 请求(微信消息推送,如关注、消息等)
|
||||
else if ("POST".equals(request.getMethod())) {
|
||||
log.info("接收到微信 POST 消息请求 - signature: {}, timestamp: {}, nonce: {}",
|
||||
signature, timestamp, nonce);
|
||||
// 1. 读取请求体中的 XML 数据
|
||||
String xmlData = readPostXml(request);
|
||||
if (xmlData.isEmpty()) {
|
||||
log.error("微信 POST 消息体为空");
|
||||
return "";
|
||||
}
|
||||
log.info("微信 POST 消息 XML 原始内容: {}", xmlData);
|
||||
|
||||
// 2. 解析 XML 为 Map(便于获取字段)
|
||||
Map<String, String> messageMap;
|
||||
try {
|
||||
messageMap = parseXmlToMap(xmlData);
|
||||
} catch (DocumentException e) {
|
||||
log.error("XML 解析失败,原始内容: {}", xmlData, e);
|
||||
return "";
|
||||
}
|
||||
log.info("微信 POST 消息内容: {}", messageMap);
|
||||
// 获取消息类型(如 event)
|
||||
String msgType = messageMap.get("MsgType");
|
||||
// 获取事件类型(如 unsubscribe:用户取消关注 subscribe:用户关注)
|
||||
String event = messageMap.get("Event");
|
||||
// 获取用户 OpenID
|
||||
String openId = messageMap.get("FromUserName");
|
||||
//携带参数
|
||||
String eventKey = messageMap.get("EventKey");
|
||||
Long userId = null;
|
||||
log.info("解析结果 - 消息类型: {}, 事件类型: {}, 用户 OpenID: {} 携带参数: {}", msgType, event, openId, eventKey);
|
||||
if (eventKey != null && eventKey.startsWith("qrscene_")) {
|
||||
try {
|
||||
// 截取 "qrscene_" 前缀后的字符串(长度为 8),并转为 Long
|
||||
String numberStr = eventKey.substring("qrscene_".length());
|
||||
userId = Long.parseLong(numberStr);
|
||||
} catch (NumberFormatException e) {
|
||||
log.error("EventKey 后缀不是有效数字,eventKey: {}", eventKey, e);
|
||||
}
|
||||
}
|
||||
updateUserInfoIsAc(event, openId, userId);
|
||||
// 处理完成后,微信要求返回 "SUCCESS" 或空字符串(否则会重试推送)
|
||||
return SUCCESS;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
//更新userInfo openId 以及 关注表示isAc
|
||||
private void updateUserInfoIsAc(String event, String openId, Long userId) {
|
||||
if ("subscribe".equals(event) && userId != null) {
|
||||
// 关注事件,更新用户关注状态为 1
|
||||
UserInfo userInfo = new UserInfo();
|
||||
userInfo.setIsAc(1);
|
||||
userInfo.setWechatAcOpenId(openId);
|
||||
userInfoService.update(userInfo, new QueryWrapper().eq(UserInfo::getId, userId));
|
||||
} else if ("unsubscribe".equals(event)) {
|
||||
// 取消关注事件,更新用户关注状态为 0
|
||||
UserInfo userInfo = new UserInfo();
|
||||
userInfo.setIsAc(0);
|
||||
userInfoService.update(userInfo, new QueryWrapper().eq(UserInfo::getWechatAcOpenId, openId));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 工具方法:读取 POST 请求体中的 XML 数据
|
||||
*/
|
||||
private String readPostXml(HttpServletRequest request) {
|
||||
StringBuilder xmlSb = new StringBuilder();
|
||||
try (BufferedReader reader = request.getReader()) {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
xmlSb.append(line);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error("读取微信 POST 消息体失败", e);
|
||||
}
|
||||
return xmlSb.toString();
|
||||
}
|
||||
|
||||
|
||||
// 将 XML 字符串解析为 Map<String, String>
|
||||
private static Map<String, String> parseXmlToMap(String xmlData) throws DocumentException {
|
||||
Map<String, String> resultMap = new HashMap<>(16);
|
||||
Document document = DocumentHelper.parseText(xmlData);
|
||||
Element rootElement = document.getRootElement();
|
||||
|
||||
// 遍历所有子节点,将节点名和文本值存入 Map
|
||||
Iterator<Element> elementIterator = rootElement.elementIterator();
|
||||
while (elementIterator.hasNext()) {
|
||||
Element childElement = elementIterator.next();
|
||||
resultMap.put(childElement.getName(), childElement.getTextTrim());
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
String str = "<xml><ToUserName><![CDATA[gh_11fc27b7ef34]]></ToUserName><FromUserName><![CDATA[owWHW7Tzeh2gx3WmFsFSxBq2JUTk]]></FromUserName><CreateTime>1761095747</CreateTime><MsgType><![CDATA[event]]></MsgType><Event><![CDATA[subscribe]]></Event><EventKey><![CDATA[qrscene_275]]></EventKey><Ticket><![CDATA[gQGF8DwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyUTZDVHRTMXhmbUoxYUlYdk5GY2sAAgSsLvhoAwQAjScA]]></Ticket></xml>";
|
||||
// 2. 解析 XML 为 Map(便于获取字段)
|
||||
Map<String, String> messageMap = new HashMap<>();
|
||||
try {
|
||||
messageMap = parseXmlToMap(str);
|
||||
} catch (DocumentException e) {
|
||||
log.error("XML 解析失败,", e);
|
||||
}
|
||||
log.info("微信 POST 消息内容: {}", messageMap);
|
||||
//携带参数
|
||||
String eventKey = messageMap.get("EventKey");
|
||||
Long userId = null;
|
||||
if (eventKey != null && eventKey.startsWith("qrscene_")) {
|
||||
try {
|
||||
// 截取 "qrscene_" 前缀后的字符串(长度为 8),并转为 Long
|
||||
String numberStr = eventKey.substring("qrscene_".length());
|
||||
userId = Long.parseLong(numberStr);
|
||||
} catch (NumberFormatException e) {
|
||||
log.error("EventKey 后缀不是有效数字,eventKey: {}", eventKey, e);
|
||||
}
|
||||
}
|
||||
System.out.println("userId: " + userId);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.account.dto.freeding.FreeDineConfigEditDTO;
|
||||
import com.czg.account.entity.FreeDineConfig;
|
||||
import com.czg.account.service.FreeDineConfigService;
|
||||
import com.czg.account.vo.FreeDineConfigVO;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.annotation.SaCheckMainShop;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import jakarta.annotation.Resource;
|
||||
|
|
@ -25,8 +26,8 @@ public class FreeDingController {
|
|||
*/
|
||||
@SaAdminCheckPermission(value = "freeDing:detail", name = "获取霸王餐配置信息")
|
||||
@GetMapping
|
||||
public CzgResult<FreeDineConfig> getConfig() {
|
||||
return CzgResult.success(freeDineConfigService.getConfig(StpKit.USER.getShopId()));
|
||||
public CzgResult<FreeDineConfigVO> getConfig() {
|
||||
return CzgResult.success(freeDineConfigService.getConfig(StpKit.USER.getMainShopId()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -36,7 +37,8 @@ public class FreeDingController {
|
|||
*/
|
||||
@SaAdminCheckPermission(value = "freeDing:edit", name = "修改霸王餐配置信息")
|
||||
@PutMapping
|
||||
@SaCheckMainShop
|
||||
public CzgResult<Boolean> edit(@RequestBody FreeDineConfigEditDTO freeDineConfigEditDTO) {
|
||||
return CzgResult.success(freeDineConfigService.edit(StpKit.USER.getShopId(), freeDineConfigEditDTO));
|
||||
return CzgResult.success(freeDineConfigService.edit(StpKit.USER.getMainShopId(), freeDineConfigEditDTO));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,14 +7,11 @@ import com.czg.account.service.HandoverRecordService;
|
|||
import com.czg.account.vo.HandoverProductListVo;
|
||||
import com.czg.account.vo.HandoverTotalVo;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.annotation.SaStaffCheckPermission;
|
||||
import com.czg.config.RabbitPublisher;
|
||||
import com.czg.enums.YesNoEnum;
|
||||
import com.czg.log.annotation.OperationLog;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.pig4cloud.plugin.excel.annotation.ResponseExcel;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
|
@ -32,8 +29,6 @@ import java.util.List;
|
|||
@RequestMapping("/admin/handoverRecord")
|
||||
public class HandoverRecordController {
|
||||
private final HandoverRecordService handoverRecordService;
|
||||
@Resource
|
||||
private RabbitPublisher rabbitPublisher;
|
||||
|
||||
/**
|
||||
* 交班记录-分页
|
||||
|
|
@ -44,7 +39,7 @@ public class HandoverRecordController {
|
|||
@GetMapping("page")
|
||||
@OperationLog("交班记录-分页")
|
||||
// @SaStaffCheckPermission("yun_xu_cha_kan_suo_you_jiao_ban_ji_lu")
|
||||
@SaAdminCheckPermission("handoverRecord:page")
|
||||
@SaAdminCheckPermission(value = "handoverRecord:page",name = "交班记录-分页")
|
||||
public CzgResult<Page<HandoverRecordDTO>> page(@RequestParam(required = false) String beginDate, @RequestParam(required = false) String endDate) {
|
||||
Page<HandoverRecordDTO> page = handoverRecordService.getHandoverRecordPage(beginDate, endDate);
|
||||
return CzgResult.success(page);
|
||||
|
|
@ -58,7 +53,7 @@ public class HandoverRecordController {
|
|||
@GetMapping("{id}")
|
||||
@OperationLog("交班记录-查看")
|
||||
// @SaStaffCheckPermission("yun_xu_cha_kan_suo_you_jiao_ban_ji_lu")
|
||||
@SaAdminCheckPermission("handoverRecord:info")
|
||||
@SaAdminCheckPermission(value = "handoverRecord:info",name = "交班记录-查看")
|
||||
public CzgResult<List<HandoverProductListVo>> info(@PathVariable Long id) {
|
||||
List<HandoverProductListVo> data = handoverRecordService.getHandoverProductListById(id);
|
||||
return CzgResult.success(data);
|
||||
|
|
@ -73,7 +68,7 @@ public class HandoverRecordController {
|
|||
@GetMapping("/export/{id}")
|
||||
@OperationLog("交班记录-导出")
|
||||
// @SaStaffCheckPermission("yun_xu_cha_kan_suo_you_jiao_ban_ji_lu")
|
||||
@SaAdminCheckPermission("handoverRecord:export")
|
||||
@SaAdminCheckPermission(value = "handoverRecord:export",name = "交班记录-导出")
|
||||
public List<HandoverProductListVo> export(@PathVariable Long id) {
|
||||
return handoverRecordService.getHandoverProductListById(id);
|
||||
}
|
||||
|
|
@ -84,7 +79,7 @@ public class HandoverRecordController {
|
|||
@GetMapping("total")
|
||||
@OperationLog("收银机-交班数据统计")
|
||||
// @SaStaffCheckPermission("yun_xu_cha_kan_suo_you_jiao_ban_ji_lu")
|
||||
@SaAdminCheckPermission("handoverRecord:total")
|
||||
@SaAdminCheckPermission(value = "handoverRecord:total",name = "收银机-交班数据统计")
|
||||
public CzgResult<HandoverTotalVo> total() {
|
||||
HandoverTotalVo data = handoverRecordService.totalHandoverData();
|
||||
return CzgResult.success(data);
|
||||
|
|
@ -98,7 +93,7 @@ public class HandoverRecordController {
|
|||
@PostMapping("handover")
|
||||
@OperationLog("收银机-交班/关班")
|
||||
// @SaStaffCheckPermission("yun_xu_jiao_ban")
|
||||
@SaAdminCheckPermission("handoverRecord:handover")
|
||||
@SaAdminCheckPermission(value = "handoverRecord:handover",name = "收银机-交班/关班")
|
||||
public CzgResult<Long> handover(@RequestParam Integer isPrint) {
|
||||
Long id = handoverRecordService.handover();
|
||||
return CzgResult.success(id);
|
||||
|
|
@ -112,7 +107,7 @@ public class HandoverRecordController {
|
|||
@PostMapping("/network/print/{id}")
|
||||
@OperationLog("收银机-交班/关班-网络打印机打印交班小票")
|
||||
// @SaStaffCheckPermission("yun_xu_cha_kan_suo_you_jiao_ban_ji_lu")
|
||||
@SaAdminCheckPermission("handoverRecord:networkPrint")
|
||||
@SaAdminCheckPermission(value = "handoverRecord:networkPrint",name = "收银机-交班/关班-网络打印机打印交班小票")
|
||||
public CzgResult<Void> handover(@PathVariable Long id) {
|
||||
handoverRecordService.printHandoverReceipt(id, YesNoEnum.YES.value());
|
||||
return CzgResult.success();
|
||||
|
|
@ -127,6 +122,7 @@ public class HandoverRecordController {
|
|||
@GetMapping("/detail/{id}")
|
||||
@OperationLog("交班记录-详情")
|
||||
//@SaAdminCheckPermission("handoverRecord:detail")
|
||||
@SaAdminCheckPermission(value = "handoverRecord:detail",name = "交班记录-详情")
|
||||
public CzgResult<HandoverRecordDTO> detail(@PathVariable Long id) {
|
||||
HandoverRecord entity = handoverRecordService.getById(id);
|
||||
HandoverRecordDTO data = BeanUtil.copyProperties(entity, HandoverRecordDTO.class);
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public class MenuController {
|
|||
@SaAdminCheckPermission(value = "menu:list", name = "菜单列表")
|
||||
@GetMapping("/list")
|
||||
public CzgResult<List<MenuVO>> all(String title, String startTime, String endTime) {
|
||||
return CzgResult.success(menuService.getAll(title, startTime, endTime));
|
||||
return CzgResult.success(menuService.getAll(title, startTime, endTime));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,86 +0,0 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.account.dto.ShopActivateDTO;
|
||||
import com.czg.account.service.ShopActivateService;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.config.RedisCst;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.service.RedisService;
|
||||
import com.czg.service.account.util.WechatAuthUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 店铺充值活动管理
|
||||
*
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/admin/activate")
|
||||
public class ShopActivateController {
|
||||
@Resource
|
||||
private ShopActivateService shopActivateService;
|
||||
@Resource
|
||||
private RedisService redisService;
|
||||
@Resource
|
||||
private WechatAuthUtil wechatUtil;
|
||||
|
||||
/**
|
||||
* 店铺充值活动列表
|
||||
* 权限标识: activate:list
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "activate:list", name = "店铺充值活动列表")
|
||||
@GetMapping
|
||||
public CzgResult<List<ShopActivateDTO>> detail(@RequestParam(required = false) Long shopId) {
|
||||
return CzgResult.success(shopActivateService.getList(shopId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺充值活动新增
|
||||
* 权限标识: activate:add
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "activate:add", name = "店铺充值活动新增")
|
||||
@PostMapping
|
||||
public CzgResult<Boolean> add(@RequestBody @Validated ShopActivateDTO activateDTO) {
|
||||
activateDTO.setShopId(StpKit.USER.getShopId());
|
||||
return CzgResult.success(shopActivateService.add(activateDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺充值活动修改
|
||||
* 权限标识: activate:edit
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "activate:edit", name = "店铺充值活动修改")
|
||||
@PutMapping
|
||||
public CzgResult<Boolean> edit(@RequestBody @Validated ShopActivateDTO activateDTO) {
|
||||
return CzgResult.success(shopActivateService.edit(activateDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会员码
|
||||
* @param params shopId 必填
|
||||
* env_version 存在即生成体验版
|
||||
*/
|
||||
@PostMapping("/getVipCode")
|
||||
public CzgResult<Object> getVipCode(@RequestBody Map<String, Object> params) throws Exception {
|
||||
if (CollectionUtils.isEmpty(params) || !params.containsKey("shopId")) {
|
||||
throw new CzgException("参数错误");
|
||||
}
|
||||
String redisKey = RedisCst.SHOP_VIP_CODE + params.get("shopId");
|
||||
if (redisService.hasKey(redisKey)) {
|
||||
return CzgResult.success(redisService.get(redisKey));
|
||||
}
|
||||
return CzgResult.success(wechatUtil.getFetchQrCode(params));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.account.dto.QueryReceiveDto;
|
||||
import com.czg.account.dto.ShopCouponDTO;
|
||||
import com.czg.account.service.ShopCouponService;
|
||||
import com.czg.account.vo.CouponReceiveVo;
|
||||
import com.czg.account.vo.UserCouponVo;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店铺优惠券
|
||||
*
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/admin/coupon")
|
||||
public class ShopCouponController {
|
||||
@Resource
|
||||
private ShopCouponService couponService;
|
||||
|
||||
/**
|
||||
* 店铺优惠券列表
|
||||
* 权限标识: coupon:list
|
||||
* 状态 0 未使用 1已使用 2已过期
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "coupon:list", name = "优惠券列表")
|
||||
@GetMapping
|
||||
public CzgResult<List<ShopCouponDTO>> detail(@RequestParam(required = false) Integer type,
|
||||
@RequestParam(required = false) Integer status) {
|
||||
return CzgResult.success(couponService.getList(StpKit.USER.getShopId(), type, status));
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺优惠券新增
|
||||
* 权限标识: coupon:add
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "coupon:add", name = "优惠券添加")
|
||||
@PostMapping
|
||||
public CzgResult<Boolean> add(@RequestBody @Validated ShopCouponDTO couponDTO) {
|
||||
couponDTO.setShopId(StpKit.USER.getShopId());
|
||||
return CzgResult.success(couponService.add(couponDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺优惠券修改
|
||||
* 权限标识: coupon:edit
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "coupon:edit", name = "优惠券修改")
|
||||
@PutMapping
|
||||
public CzgResult<Boolean> edit(@RequestBody @Validated ShopCouponDTO couponDTO) {
|
||||
couponDTO.setShopId(StpKit.USER.getShopId());
|
||||
return CzgResult.success(couponService.edit(couponDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺优惠券获取记录
|
||||
* 权限标识: coupon:delete
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "coupon:queryReceive", name = "优惠券领取记录")
|
||||
@GetMapping("/queryReceive")
|
||||
public CzgResult<Page<CouponReceiveVo>> queryReceive(@Validated QueryReceiveDto param) {
|
||||
return CzgResult.success(couponService.queryReceive(param));
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成订单后使用
|
||||
* 通过用户Id 查找优惠券
|
||||
*
|
||||
* @param shopUserId 店铺用户Id
|
||||
*/
|
||||
@GetMapping("/findCoupon")
|
||||
public CzgResult<List<UserCouponVo>> findCoupon(@RequestParam Long shopUserId, @RequestParam(required = false) Integer type) {
|
||||
return CzgResult.success(couponService.findCoupon(StpKit.USER.getShopId(), shopUserId, type));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -30,14 +30,11 @@ import java.util.List;
|
|||
@RestController
|
||||
@RequestMapping("/admin/shopInfo")
|
||||
public class ShopInfoController {
|
||||
private final ShopInfoService shopInfoService;
|
||||
@Resource
|
||||
private ShopInfoService shopInfoService;
|
||||
@Resource
|
||||
private AuthorizationService authorizationService;
|
||||
|
||||
public ShopInfoController(ShopInfoService shopInfoService) {
|
||||
this.shopInfoService = shopInfoService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺列表, 只允许管理员调用
|
||||
* 权限标识: shopInfo:list
|
||||
|
|
@ -49,6 +46,15 @@ public class ShopInfoController {
|
|||
return CzgResult.success(shopInfoService.get(pageDTO, shopName, status, isHeadShop));
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺的 店铺列表
|
||||
*
|
||||
*/
|
||||
@GetMapping("/otherShop")
|
||||
public CzgResult<Page<ShopInfo>> getShopByMainId(PageDTO pageDTO, String shopName, Integer status) {
|
||||
return CzgResult.success(shopInfoService.getShopByMainId(pageDTO, shopName, status));
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺详情
|
||||
* 权限标识: shopInfo:detail
|
||||
|
|
@ -99,19 +105,7 @@ public class ShopInfoController {
|
|||
*/
|
||||
@GetMapping("branchList")
|
||||
public CzgResult<List<ShopBranchSelectDTO>> findShopBranch() {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
String tokenValue = StpKit.USER.getTokenInfo().getTokenValue();
|
||||
Long headId = StpKit.USER.getHeadId();
|
||||
List<TokenSign> tokenSignList = StpKit.USER.getSession().getTokenSignList();
|
||||
if (headId != null && CollUtil.isEmpty(tokenSignList)) {
|
||||
shopId = StpKit.USER.getHeadShopId();
|
||||
} else {
|
||||
long count = tokenSignList.stream().filter(obj -> tokenValue.equals(obj.getValue())).count();
|
||||
if (headId != null && count == 0) {
|
||||
shopId = StpKit.USER.getHeadShopId();
|
||||
}
|
||||
}
|
||||
List<ShopBranchSelectDTO> data = shopInfoService.findShopBranch(shopId);
|
||||
List<ShopBranchSelectDTO> data = shopInfoService.findShopBranch(StpKit.USER.getShopId());
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,54 +1,54 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.account.dto.ShopShareDTO;
|
||||
import com.czg.account.service.ShopShareService;
|
||||
import com.czg.account.vo.ShopShareRecordVO;
|
||||
import com.czg.account.vo.ShopShareVO;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 小程序分享奖励管理
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/shopShare")
|
||||
public class ShopShareController {
|
||||
@Resource
|
||||
private ShopShareService shopShareService;
|
||||
|
||||
/**
|
||||
* 获取分享奖励配置
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "shopShare:list", name = "分享好友信息")
|
||||
@GetMapping
|
||||
public CzgResult<ShopShareVO> get() {
|
||||
return CzgResult.success(shopShareService.get(StpKit.USER.getShopId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分享奖励配置
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "shopShare:add", name = "分享好友信息添加")
|
||||
@PostMapping
|
||||
public CzgResult<Boolean> add(@RequestBody @Validated ShopShareDTO shopShareDTO) {
|
||||
return CzgResult.success(shopShareService.add(StpKit.USER.getShopId(), shopShareDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分享奖励记录
|
||||
* @param key 邀请人/被邀请人手机号或昵称
|
||||
* @param status 0 非新用户 1 未领取 2 已领取 3 已使用 不传递为全部
|
||||
* @return 分页数据
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "shopShare:record", name = "分享邀请记录")
|
||||
@GetMapping("/record")
|
||||
public CzgResult<Page<ShopShareRecordVO>> record(String key, Integer status) {
|
||||
return CzgResult.success(shopShareService.recordPage(StpKit.USER.getShopId(), key, status));
|
||||
}
|
||||
}
|
||||
//package com.czg.controller.admin;
|
||||
//
|
||||
//import com.czg.account.dto.ShopShareDTO;
|
||||
//import com.czg.account.service.ShopShareService;
|
||||
//import com.czg.account.vo.ShopShareRecordVO;
|
||||
//import com.czg.account.vo.ShopShareVO;
|
||||
//import com.czg.annotation.SaAdminCheckPermission;
|
||||
//import com.czg.resp.CzgResult;
|
||||
//import com.czg.sa.StpKit;
|
||||
//import com.mybatisflex.core.paginate.Page;
|
||||
//import jakarta.annotation.Resource;
|
||||
//import org.springframework.validation.annotation.Validated;
|
||||
//import org.springframework.web.bind.annotation.*;
|
||||
//
|
||||
///**
|
||||
// * 小程序分享奖励管理
|
||||
// * @author Administrator
|
||||
// */
|
||||
//@RestController
|
||||
//@RequestMapping("/admin/shopShare")
|
||||
//public class ShopShareController {
|
||||
// @Resource
|
||||
// private ShopShareService shopShareService;
|
||||
//
|
||||
// /**
|
||||
// * 获取分享奖励配置
|
||||
// */
|
||||
// @SaAdminCheckPermission(value = "shopShare:list", name = "分享好友信息")
|
||||
// @GetMapping
|
||||
// public CzgResult<ShopShareVO> get() {
|
||||
// return CzgResult.success(shopShareService.get(StpKit.USER.getShopId()));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 修改分享奖励配置
|
||||
// */
|
||||
// @SaAdminCheckPermission(value = "shopShare:add", name = "分享好友信息添加")
|
||||
// @PostMapping
|
||||
// public CzgResult<Boolean> add(@RequestBody @Validated ShopShareDTO shopShareDTO) {
|
||||
// return CzgResult.success(shopShareService.add(StpKit.USER.getShopId(), shopShareDTO));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 分享奖励记录
|
||||
// * @param key 邀请人/被邀请人手机号或昵称
|
||||
// * @param status 0 非新用户 1 未领取 2 已领取 3 已使用 不传递为全部
|
||||
// * @return 分页数据
|
||||
// */
|
||||
// @SaAdminCheckPermission(value = "shopShare:record", name = "分享邀请记录")
|
||||
// @GetMapping("/record")
|
||||
// public CzgResult<Page<ShopShareRecordVO>> record(String key, Integer status) {
|
||||
// return CzgResult.success(shopShareService.recordPage(StpKit.USER.getShopId(), key, status));
|
||||
// }
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -2,14 +2,15 @@ package com.czg.controller.admin;
|
|||
|
||||
import com.czg.account.dto.shopuser.*;
|
||||
import com.czg.account.entity.ShopUser;
|
||||
import com.czg.account.service.AShopUserService;
|
||||
import com.czg.account.service.ShopUserFlowService;
|
||||
import com.czg.account.service.ShopUserService;
|
||||
import com.czg.account.vo.ShopUserFlowVO;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.annotation.SaStaffCheckPermission;
|
||||
import com.czg.enums.ShopUserFlowBizEnum;
|
||||
import com.czg.market.entity.SmsPushEventUser;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
|
@ -29,7 +30,7 @@ import java.math.BigDecimal;
|
|||
public class ShopUserController {
|
||||
|
||||
@Resource
|
||||
private ShopUserService shopUserService;
|
||||
private AShopUserService shopUserService;
|
||||
@Resource
|
||||
private ShopUserFlowService shopUserFlowService;
|
||||
|
||||
|
|
@ -43,7 +44,7 @@ public class ShopUserController {
|
|||
@GetMapping("/summary")
|
||||
// @SaStaffCheckPermission("yun_xu_guan_li_hui_yuan_xin_xi")
|
||||
public CzgResult<ShopUserSummaryDTO> summary(Integer isVip) {
|
||||
return CzgResult.success(shopUserService.getSummary(StpKit.USER.getUsableShopId(), isVip));
|
||||
return CzgResult.success(shopUserService.getSummary(StpKit.USER.getHeadShopIdBySession(), isVip));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -67,7 +68,7 @@ public class ShopUserController {
|
|||
@GetMapping("/flow")
|
||||
// @SaStaffCheckPermission("yun_xu_guan_li_hui_yuan_xin_xi")
|
||||
public CzgResult<Page<ShopUserFlowVO>> flow(Integer userId, String bizCode, String startTime, String endTime) {
|
||||
return CzgResult.success(shopUserFlowService.pageInfo(StpKit.USER.getUsableShopId(), userId, bizCode, startTime, endTime));
|
||||
return CzgResult.success(shopUserFlowService.pageInfo(StpKit.USER.getShopId(), userId, bizCode, startTime, endTime));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -83,7 +84,7 @@ public class ShopUserController {
|
|||
@GetMapping("/flow/download")
|
||||
// @SaStaffCheckPermission("yun_xu_guan_li_hui_yuan_xin_xi")
|
||||
public void flowDownload(Integer userId, String bizCode, String startTime, String endTime, HttpServletResponse response) throws IOException {
|
||||
shopUserFlowService.flowDownload(StpKit.USER.getUsableShopId(), userId, bizCode, startTime, endTime, response);
|
||||
shopUserFlowService.flowDownload(StpKit.USER.getHeadShopIdBySession(), userId, bizCode, startTime, endTime, response);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -100,6 +101,11 @@ public class ShopUserController {
|
|||
return CzgResult.success(shopUserService.getPage(key, isVip, amount));
|
||||
}
|
||||
|
||||
@GetMapping("/getPage")
|
||||
public CzgResult<Page<ShopUser>> getPage(@RequestParam(required = false)String key,@RequestParam(required = false) Integer isVip) {
|
||||
return CzgResult.success(shopUserService.getPage(key, isVip));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺用户详情
|
||||
* @param id 会员用户id
|
||||
|
|
@ -125,7 +131,7 @@ public class ShopUserController {
|
|||
@SaAdminCheckPermission(value = "shopUser:add", name = "店铺用户添加")
|
||||
@PostMapping
|
||||
public CzgResult<Boolean> add(@RequestBody @Validated ShopUserAddDTO shopUserAddDTO) {
|
||||
return CzgResult.success(shopUserService.add(StpKit.USER.getUsableShopId(), shopUserAddDTO));
|
||||
return CzgResult.success(shopUserService.add(StpKit.USER.getHeadShopIdBySession(), shopUserAddDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -137,7 +143,7 @@ public class ShopUserController {
|
|||
@SaAdminCheckPermission(value = "shopUser:edit", name = "店铺用户修改")
|
||||
@PutMapping
|
||||
public CzgResult<Boolean> edit(@RequestBody @Validated ShopUserEditDTO shopUserEditDTO) {
|
||||
return CzgResult.success(shopUserService.updateInfo(StpKit.USER.getUsableShopId(), shopUserEditDTO));
|
||||
return CzgResult.success(shopUserService.updateInfo(StpKit.USER.getHeadShopIdBySession(), shopUserEditDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -150,7 +156,29 @@ public class ShopUserController {
|
|||
@PutMapping("/money")
|
||||
public CzgResult<Boolean> editMoney(@RequestBody @Validated ShopUserMoneyEditDTO shopUserMoneyEditDTO) {
|
||||
shopUserMoneyEditDTO.setBizEnum(ShopUserFlowBizEnum.ADMIN_IN);
|
||||
return CzgResult.success(shopUserService.updateMoney(StpKit.USER.getUsableShopId(), shopUserMoneyEditDTO) > 0L);
|
||||
return CzgResult.success(shopUserService.updateMoney(shopUserMoneyEditDTO) > 0L);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取营销推送任务用户列表
|
||||
* @param smsPushEventUser 营销推送任务用户
|
||||
* @return 用户列表
|
||||
*/
|
||||
@PostMapping("/getPushEventUser")
|
||||
public CzgResult<Page<ShopUser>> getPushEventUser(@RequestBody @Validated SmsPushEventUser smsPushEventUser) {
|
||||
AssertUtil.isNull(smsPushEventUser.getShopId(), "店铺id不能为空");
|
||||
return CzgResult.success(shopUserService.getPushEventUser(smsPushEventUser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取公众号推送任务用户列表
|
||||
* @param pushEventUser 公众号推送任务用户
|
||||
* @return 用户列表
|
||||
*/
|
||||
@PostMapping("/getAcPushEventUser")
|
||||
public CzgResult<Page<ShopUser>> getAcPushEventUser(@RequestBody @Validated SmsPushEventUser pushEventUser) {
|
||||
AssertUtil.isNull(pushEventUser.getShopId(), "店铺id不能为空");
|
||||
return CzgResult.success(shopUserService.getAcPushEventUser(pushEventUser));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,55 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.account.entity.SysImageLibrary;
|
||||
import com.czg.account.service.SysImageLibraryService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 自用图库接口
|
||||
*
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/image")
|
||||
public class SysImageLibraryController {
|
||||
|
||||
@Resource
|
||||
private SysImageLibraryService sysImageLibraryService;
|
||||
|
||||
/**
|
||||
* 获取系统图库分页列表
|
||||
* @param name 文件名称 模糊匹配
|
||||
* @return 系统图库分页列表
|
||||
*/
|
||||
@GetMapping("/get")
|
||||
public CzgResult<Page<SysImageLibrary>> get(@RequestParam(required = false) String name) {
|
||||
return CzgResult.success(sysImageLibraryService.getImagePage(name));
|
||||
}
|
||||
/**
|
||||
* 保存系统图库
|
||||
* @param sysImageLibrary 系统图库
|
||||
* @return 无
|
||||
*/
|
||||
@PostMapping("/saveOrUpdate")
|
||||
public CzgResult<Void> saveOrUpdate(@RequestBody SysImageLibrary sysImageLibrary) {
|
||||
sysImageLibraryService.saveOrUpdate(sysImageLibrary);
|
||||
return CzgResult.success();
|
||||
}
|
||||
/**
|
||||
* 上传系统图库图片
|
||||
* @param fileName 图片文件名 必填
|
||||
* @param suffix 图片扩展名 必填
|
||||
* @param file 图片文件 必填
|
||||
* @return 图片地址
|
||||
*/
|
||||
@PostMapping("/upload")
|
||||
public CzgResult<String> upload(@RequestParam String fileName, @RequestParam String suffix, @RequestParam MultipartFile file) throws Exception {
|
||||
return CzgResult.success(sysImageLibraryService.upload(file.getBytes(), fileName, suffix));
|
||||
}
|
||||
}
|
||||
|
|
@ -3,23 +3,27 @@ package com.czg.controller.user;
|
|||
import com.czg.account.dto.shopuser.ShopUserAddDTO;
|
||||
import com.czg.account.dto.shopuser.ShopUserDetailDTO;
|
||||
import com.czg.account.dto.shopuser.ShopUserVipCardDTO;
|
||||
import com.czg.account.entity.MemberPointsLog;
|
||||
import com.czg.account.entity.ShopUser;
|
||||
import com.czg.account.entity.ShopUserFlow;
|
||||
import com.czg.account.entity.*;
|
||||
import com.czg.account.service.MemberPointsLogService;
|
||||
import com.czg.account.service.PointsExchangeRecordService;
|
||||
import com.czg.account.service.ShopUserFlowService;
|
||||
import com.czg.account.service.ShopUserService;
|
||||
import com.czg.account.service.UShopUserService;
|
||||
import com.czg.account.vo.MemberPointsLogVO;
|
||||
import com.czg.account.vo.PointsShopListVO;
|
||||
import com.czg.account.vo.ShopUserFlowInfoVO;
|
||||
import com.czg.annotation.Debounce;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.utils.MyQueryWrapper;
|
||||
import com.czg.utils.PageUtil;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryCondition;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店铺会员相关
|
||||
*
|
||||
|
|
@ -29,12 +33,10 @@ import org.springframework.web.bind.annotation.*;
|
|||
@RequestMapping("/user/shopUser")
|
||||
public class UShopUserController {
|
||||
@Resource
|
||||
private ShopUserService shopUserService;
|
||||
private UShopUserService shopUserService;
|
||||
@Resource
|
||||
private ShopUserFlowService shopUserFlowService;
|
||||
@Resource
|
||||
private PointsExchangeRecordService pointsExchangeRecordService;
|
||||
@Resource
|
||||
private MemberPointsLogService memberPointsLogService;
|
||||
|
||||
/**
|
||||
|
|
@ -45,7 +47,7 @@ public class UShopUserController {
|
|||
*/
|
||||
@GetMapping
|
||||
public CzgResult<ShopUserDetailDTO> get(Long shopId) {
|
||||
return CzgResult.success(shopUserService.getInfo(shopId == null ? StpKit.USER.getUsableShopId() : shopId, StpKit.USER.getLoginIdAsLong()));
|
||||
return CzgResult.success(shopUserService.getInfo(shopId == null ? StpKit.USER.getShopId() : shopId, StpKit.USER.getLoginIdAsLong()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -65,7 +67,7 @@ public class UShopUserController {
|
|||
*/
|
||||
@GetMapping("/code")
|
||||
public CzgResult<String> code(Long shopId) {
|
||||
return shopUserService.getCode(StpKit.USER.getLoginIdAsLong(), shopId == null ? StpKit.USER.getUsableShopId() : shopId);
|
||||
return shopUserService.getCode(StpKit.USER.getLoginIdAsLong(), shopId == null ? StpKit.USER.getShopId() : shopId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -76,7 +78,7 @@ public class UShopUserController {
|
|||
@PostMapping
|
||||
@Debounce("#shopUserAddDTO.phone")
|
||||
public CzgResult<Boolean> join(@RequestBody @Validated ShopUserAddDTO shopUserAddDTO) {
|
||||
return CzgResult.success(shopUserService.join(StpKit.USER.getUsableShopId(), StpKit.USER.getLoginIdAsLong(), shopUserAddDTO));
|
||||
return CzgResult.success(shopUserService.join(StpKit.USER.getShopId(), StpKit.USER.getLoginIdAsLong(), shopUserAddDTO));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -85,9 +87,12 @@ public class UShopUserController {
|
|||
* @return 分页数据
|
||||
*/
|
||||
@GetMapping("/moneyRecord")
|
||||
public CzgResult<Page<ShopUserFlow>> getMoneyRecord() {
|
||||
return CzgResult.success(shopUserFlowService.page(PageUtil.buildPage(), new QueryWrapper().eq(ShopUserFlow::getShopId, StpKit.USER.getShopId())
|
||||
.eq(ShopUserFlow::getUserId, StpKit.USER.getLoginIdAsLong()).orderBy(ShopUserFlow::getId, false)));
|
||||
public CzgResult<Page<ShopUserFlowInfoVO>> getMoneyRecord(@RequestParam Long shopId) {
|
||||
return CzgResult.success(shopUserFlowService.pageAs(PageUtil.buildPage(), new MyQueryWrapper().eq(ShopUserFlow::getShopId, shopId)
|
||||
.selectAll(ShopUserFlow.class)
|
||||
.eq(ShopUserFlow::getUserId, StpKit.USER.getLoginIdAsLong()).leftJoin(ShopInfo.class).on(ShopUserFlow::getShopId, ShopInfo::getId)
|
||||
.select(ShopInfo::getShopName)
|
||||
.orderBy(ShopUserFlow::getId, false), ShopUserFlowInfoVO.class));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -96,20 +101,32 @@ public class UShopUserController {
|
|||
* @return 明细数据
|
||||
*/
|
||||
@GetMapping("/moneyRecord/detail")
|
||||
public CzgResult<ShopUserFlow> getMoneyRecordDetail(@RequestParam Long id) {
|
||||
return CzgResult.success(shopUserFlowService.getOne(new QueryWrapper().eq(ShopUserFlow::getShopId, StpKit.USER.getShopId())
|
||||
public CzgResult<ShopUserFlow> getMoneyRecordDetail(@RequestParam Long id, @RequestParam Long shopId) {
|
||||
return CzgResult.success(shopUserFlowService.getOne(new QueryWrapper().eq(ShopUserFlow::getShopId, shopId)
|
||||
.eq(ShopUserFlow::getUserId, StpKit.USER.getLoginIdAsLong()).eq(ShopUserFlow::getId, id)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户所有门店下积分列表
|
||||
*/
|
||||
@GetMapping("/pointsShopList")
|
||||
public CzgResult<List<PointsShopListVO>> getList(@RequestParam(required = false) String shopName) {
|
||||
return CzgResult.success(memberPointsLogService.getList(StpKit.USER.getLoginIdAsLong(), shopName));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取积分明细
|
||||
* @return 分页数据
|
||||
*/
|
||||
@GetMapping("/pointsRecord")
|
||||
public CzgResult<Page<MemberPointsLog>> getPointsRecord() {
|
||||
ShopUser shopUser = shopUserService.getOne(new QueryWrapper().eq(ShopUser::getShopId, StpKit.USER.getShopId()).eq(ShopUser::getUserId, StpKit.USER.getLoginIdAsLong()));
|
||||
return CzgResult.success(memberPointsLogService.page(PageUtil.buildPage(), new QueryWrapper().eq(MemberPointsLog::getShopId, StpKit.USER.getShopId())
|
||||
.eq(MemberPointsLog::getShopUserId, shopUser.getId()).orderBy(MemberPointsLog::getId, false)));
|
||||
public CzgResult<Page<MemberPointsLogVO>> getPointsRecord(@RequestParam Long shopId) {
|
||||
ShopUser shopUser = shopUserService.getShopUserInfo(shopId, StpKit.USER.getLoginIdAsLong());
|
||||
return CzgResult.success(memberPointsLogService.pageAs(PageUtil.buildPage(), new MyQueryWrapper().eq(MemberPointsLog::getShopId, shopId)
|
||||
.eq(MemberPointsLog::getShopUserId, shopUser.getId())
|
||||
.selectAll(MemberPointsLog.class)
|
||||
.select(ShopInfo::getShopName)
|
||||
.leftJoin(ShopInfo.class).on(MemberPointsLog::getShopId, ShopInfo::getId)
|
||||
.orderBy(MemberPointsLog::getId, false), MemberPointsLogVO.class));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -118,14 +135,9 @@ public class UShopUserController {
|
|||
* @return 明细数据
|
||||
*/
|
||||
@GetMapping("/pointsRecord/detail")
|
||||
public CzgResult<MemberPointsLog> getPointsRecordDetail(@RequestParam Long id) {
|
||||
ShopUser shopUser = shopUserService.getOne(new QueryWrapper().eq(ShopUser::getShopId, StpKit.USER.getShopId()).eq(ShopUser::getUserId, StpKit.USER.getLoginIdAsLong()));
|
||||
return CzgResult.success(memberPointsLogService.getOne(new QueryWrapper().eq(MemberPointsLog::getShopId, StpKit.USER.getShopId())
|
||||
public CzgResult<MemberPointsLog> getPointsRecordDetail(@RequestParam Long id,@RequestParam Long shopId) {
|
||||
ShopUser shopUser = shopUserService.getShopUserInfo(shopId, StpKit.USER.getLoginIdAsLong());
|
||||
return CzgResult.success(memberPointsLogService.getOne(new QueryWrapper().eq(MemberPointsLog::getShopId, shopId)
|
||||
.eq(MemberPointsLog::getShopUserId, shopUser.getId()).eq(MemberPointsLog::getId, id)));
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,11 @@ public class UserAuthorizationController {
|
|||
return CzgResult.success(userAuthorizationService.login(userAuthorizationLoginDTO));
|
||||
}
|
||||
|
||||
@PostMapping("/test")
|
||||
public CzgResult<String> test() {
|
||||
return CzgResult.success(StpKit.USER.getTokenValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取手机号
|
||||
* @param getPhoneDTO 获取手机号信息
|
||||
|
|
@ -69,14 +74,4 @@ public class UserAuthorizationController {
|
|||
"shopName", shopInfo.getShopName()
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序登录
|
||||
* @return 登录信息
|
||||
*/
|
||||
@PostMapping("/test")
|
||||
public CzgResult<String> login(@RequestParam long id) {
|
||||
StpKit.USER.login(id, "2342", null, "", MyStpLogic.LoginType.USER, false, "");
|
||||
return CzgResult.success(StpKit.USER.getTokenValue());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.czg.controller.user;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.account.dto.user.userinfo.UserInfoDTO;
|
||||
import com.czg.account.dto.user.userinfo.UserInfoEditDTO;
|
||||
import com.czg.account.dto.user.userinfo.UserInfoPwdEditDTO;
|
||||
|
|
@ -34,7 +35,7 @@ public class UserController {
|
|||
*/
|
||||
@PutMapping
|
||||
public CzgResult<Boolean> update(@RequestBody UserInfoEditDTO userInfoEditDTO) {
|
||||
return CzgResult.success(userInfoService.updateInfo(StpKit.USER.getUsableShopId(), StpKit.USER.getLoginIdAsLong(), userInfoEditDTO));
|
||||
return CzgResult.success(userInfoService.updateInfo(StpKit.USER.getShopId(), StpKit.USER.getLoginIdAsLong(), userInfoEditDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -43,7 +44,7 @@ public class UserController {
|
|||
*/
|
||||
@PutMapping("/pwd")
|
||||
public CzgResult<Boolean> updatePwd(@RequestBody UserInfoPwdEditDTO userInfoPwdEditDTO) {
|
||||
if (!userInfoPwdEditDTO.getPayPwd().equals(userInfoPwdEditDTO.getCheckPayPwd())) {
|
||||
if (StrUtil.isNotBlank(userInfoPwdEditDTO.getCheckPayPwd()) && !userInfoPwdEditDTO.getPayPwd().equals(userInfoPwdEditDTO.getCheckPayPwd())) {
|
||||
return CzgResult.failure("两次密码不一致");
|
||||
}
|
||||
return CzgResult.success(userInfoService.updatePwd(StpKit.USER.getLoginIdAsLong(), userInfoPwdEditDTO));
|
||||
|
|
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
package com.czg.controller.user;
|
||||
|
||||
import com.czg.account.dto.ShopActivateDTO;
|
||||
import com.czg.account.service.ShopActivateService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户店铺充值活动管理
|
||||
*
|
||||
* @author ww
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user/activate")
|
||||
public class UserShopActivateController {
|
||||
@Resource
|
||||
private ShopActivateService shopActivateService;
|
||||
|
||||
/**
|
||||
* 店铺充值活动列表
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<List<ShopActivateDTO>> detail(@RequestParam(required = false) Long shopId) {
|
||||
return CzgResult.success(shopActivateService.getList(shopId));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
package com.czg.controller.user;
|
||||
|
||||
import com.czg.account.entity.ShopActivateCouponRecord;
|
||||
import com.czg.account.service.ShopCouponService;
|
||||
import com.czg.account.vo.UserCouponVo;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店铺优惠券
|
||||
*
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/user/coupon")
|
||||
public class UserShopCouponController {
|
||||
@Resource
|
||||
private ShopCouponService couponService;
|
||||
|
||||
/**
|
||||
* 通过用户Id 查找优惠券
|
||||
*
|
||||
* @param status 0 未使用 1已使用 2已过期
|
||||
*/
|
||||
@GetMapping("/findByUserId")
|
||||
public CzgResult<Page<ShopActivateCouponRecord>> findByUserId(
|
||||
@RequestParam(required = false) Integer status,
|
||||
@RequestParam(required = false) Long shopId) {
|
||||
return CzgResult.success(couponService.find(StpKit.USER.getLoginIdAsLong(), shopId, status));
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成订单后使用
|
||||
* 通过用户Id 查找优惠券
|
||||
*
|
||||
* @param shopUserId 店铺用户Id
|
||||
*/
|
||||
@GetMapping("/findCoupon")
|
||||
public CzgResult<List<UserCouponVo>> findCoupon(@RequestHeader String shopId, @RequestParam Long shopUserId, @RequestParam(required = false) Integer type) {
|
||||
AssertUtil.isBlank(shopId, "店铺Id不能为空");
|
||||
return CzgResult.success(couponService.findCoupon(Long.parseLong(shopId), shopUserId, type));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
traceConsumerFilter=com.czg.config.TraceConsumerFilter
|
||||
traceProviderFilter=com.czg.config.TraceProviderFilter
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://192.168.1.31:3306/czg_cashier?useUnicode=true&characterEncoding=utf-8
|
||||
url: jdbc:mysql://192.168.1.42:3306/czg_cashier?useUnicode=true&characterEncoding=utf-8
|
||||
username: root
|
||||
password: Chaozg123.
|
||||
|
||||
data:
|
||||
redis:
|
||||
host: 192.168.1.31
|
||||
host: 192.168.1.42
|
||||
port: 6379
|
||||
password: Chaozg123.
|
||||
timeout: 1000
|
||||
|
|
@ -48,4 +48,3 @@ seata:
|
|||
server-addr: 121.40.109.122:8848
|
||||
namespace:
|
||||
group: group_seata
|
||||
|
||||
|
|
|
|||
|
|
@ -51,3 +51,4 @@ seata:
|
|||
namespace:
|
||||
group: group_seata
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -51,3 +51,4 @@ seata:
|
|||
namespace:
|
||||
group: group_seata
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,11 +3,12 @@ server:
|
|||
|
||||
spring:
|
||||
application:
|
||||
name: account-server
|
||||
name: account
|
||||
profiles:
|
||||
active: dev
|
||||
include: tools
|
||||
|
||||
|
||||
logging:
|
||||
config: classpath:logback.xml
|
||||
|
||||
|
|
@ -44,5 +45,8 @@ pagehelper:
|
|||
support-methods-arguments: true
|
||||
|
||||
dubbo:
|
||||
provider:
|
||||
filter: traceProviderFilter
|
||||
consumer:
|
||||
filter: traceConsumerFilter
|
||||
check: false
|
||||
|
|
|
|||
|
|
@ -2,9 +2,10 @@
|
|||
<configuration scan="true" scanPeriod="30 seconds" debug="false">
|
||||
<contextName>account-server</contextName>
|
||||
<property name="log.charset" value="utf-8" />
|
||||
<property name="log.pattern" value="%yellow(%d{yyyy-MM-dd HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) - %msg%n" />
|
||||
<property name="log.pattern"
|
||||
value="%yellow(%d{yyyy-MM-dd HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) [traceId=%X{traceId:-}] - %msg%n" />
|
||||
<!--写入文件格式-->
|
||||
<property name="p_file" value="%d | [%thread] %-5level %c [%L] - %msg %n"/>
|
||||
<property name="p_file" value="%d |[traceId=%X{traceId:-}] | [%thread] %-5level %c [%L] - %msg %n "/>
|
||||
<!--输出到控制台-->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.czg</groupId>
|
||||
<artifactId>cash-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<name>营销相关API</name>
|
||||
<description>营销相关API</description>
|
||||
<artifactId>market-server</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.czg</groupId>
|
||||
<artifactId>cash-common-log</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.czg</groupId>
|
||||
<artifactId>market-service</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.czg;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
/**
|
||||
* @author ww
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableDiscoveryClient
|
||||
@EnableTransactionManagement
|
||||
@MapperScan("com.czg.service.market.mapper")
|
||||
@EnableDubbo
|
||||
@EnableScheduling
|
||||
@Slf4j
|
||||
public class MarketApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(MarketApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.market.dto.MkShopConsumerCouponDTO;
|
||||
import com.czg.market.service.MkShopConsumerCouponService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.validator.group.DefaultGroup;
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 消费赠券
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/consumerCoupon")
|
||||
public class AConsumerCouponController {
|
||||
|
||||
@Resource
|
||||
private MkShopConsumerCouponService mkShopConsumerCouponService;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
@GetMapping("/getConsumerCouponPage")
|
||||
public CzgResult<Page<MkShopConsumerCouponDTO>> getConsumerCouponPage(MkShopConsumerCouponDTO param) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
param.setShopId(shopId);
|
||||
return CzgResult.success(mkShopConsumerCouponService.getConsumerCouponPage(param));
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@GetMapping("/getConsumerCouponById")
|
||||
public CzgResult<MkShopConsumerCouponDTO> getConsumerCouponById(Long id) {
|
||||
return CzgResult.success(mkShopConsumerCouponService.getConsumerCouponById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PostMapping("/addConsumerCoupon")
|
||||
public CzgResult<Void> addConsumerCoupon(@RequestBody MkShopConsumerCouponDTO param) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
param.setShopId(shopId);
|
||||
param.setLeftNum(param.getGiveNum());
|
||||
mkShopConsumerCouponService.addConsumerCoupon(param);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
@PutMapping("/updateConsumerCouponById")
|
||||
public CzgResult<Void> updateConsumerCouponById(@RequestBody @Validated({UpdateGroup.class, DefaultGroup.class}) MkShopConsumerCouponDTO param) {
|
||||
mkShopConsumerCouponService.updateConsumerCouponById(param);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@DeleteMapping("/deleteConsumerCoupon")
|
||||
public CzgResult<Void> deleteConsumerCoupon(Long id) {
|
||||
mkShopConsumerCouponService.deleteConsumerCoupon(id);
|
||||
return CzgResult.success();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,217 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import com.czg.account.vo.UserCouponVo;
|
||||
import com.czg.log.annotation.OperationLog;
|
||||
import com.czg.market.dto.*;
|
||||
import com.czg.market.service.MkCouponGiftService;
|
||||
import com.czg.market.service.MkShopCouponRecordService;
|
||||
import com.czg.market.service.ShopCouponService;
|
||||
import com.czg.product.service.ShopSyncService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.task.CouponTask;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.czg.validator.group.DefaultGroup;
|
||||
import com.czg.validator.group.InsertGroup;
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 优惠券
|
||||
*
|
||||
* @author ww
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/coupon")
|
||||
public class ACouponController {
|
||||
@Resource
|
||||
private ShopCouponService shopCouponService;
|
||||
@Resource
|
||||
private MkCouponGiftService couponGiftService;
|
||||
@Resource
|
||||
private MkShopCouponRecordService couponRecordService;
|
||||
@DubboReference
|
||||
private ShopSyncService shopSyncService;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
@GetMapping("page")
|
||||
// @OperationLog("优惠券列表-分页")
|
||||
// @SaAdminCheckPermission("coupon:page")
|
||||
public CzgResult<Page<ShopCouponDTO>> getCouponPage(ShopCouponDTO param) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
param.setShopId(shopId);
|
||||
Page<ShopCouponDTO> data = shopCouponService.getCouponPage(param);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param id 主键id
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
// @OperationLog("优惠券-详情")
|
||||
// @SaAdminCheckPermission("coupon:info")
|
||||
public CzgResult<ShopCouponDTO> getCouponById(@PathVariable("id") Long id) {
|
||||
AssertUtil.isNull(id, "{}不能为空", "id");
|
||||
ShopCouponDTO data = shopCouponService.getCouponById(id);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PostMapping
|
||||
@OperationLog("优惠券-新增")
|
||||
// @SaAdminCheckPermission("coupon:add")
|
||||
public CzgResult<Void> addCoupon(@RequestBody @Validated({InsertGroup.class, DefaultGroup.class}) ShopCouponDTO dto) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
dto.setShopId(shopId);
|
||||
dto.setLeftNum(dto.getGiveNum());
|
||||
shopCouponService.addCoupon(dto);
|
||||
asyncToBranchShop(dto.getId(), 1);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@PutMapping
|
||||
@OperationLog("优惠券-修改")
|
||||
// @SaAdminCheckPermission("coupon:update")
|
||||
public CzgResult<Void> updateCoupon(@RequestBody @Validated({UpdateGroup.class, DefaultGroup.class}) ShopCouponDTO dto) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
dto.setShopId(shopId);
|
||||
shopCouponService.updateCouponById(dto);
|
||||
couponGiftService.upCouponName(dto.getId(), dto.getTitle());
|
||||
asyncToBranchShop(dto.getId(), 2);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@DeleteMapping
|
||||
@OperationLog("优惠券-删除")
|
||||
// @SaAdminCheckPermission("prodGroup:delete")
|
||||
public CzgResult<String> deleteCoupon(@RequestParam Long id, @RequestParam Integer type) {
|
||||
AssertUtil.isNull(id, "{}不能为空", "id");
|
||||
if (type != 1) {
|
||||
List<MkCouponGiftDTO> gifts = couponGiftService.getCouponGiftBySourceId(id, 3);
|
||||
if (CollUtil.isNotEmpty(gifts)) {
|
||||
String collect = gifts.stream()
|
||||
.map(MkCouponGiftDTO::getSourceName)
|
||||
.filter(name -> name != null && !name.isEmpty())
|
||||
.collect(Collectors.joining(","));
|
||||
return CzgResult.success(collect);
|
||||
}
|
||||
}
|
||||
shopCouponService.deleteCoupon(id);
|
||||
couponGiftService.deleteCoupon(id);
|
||||
asyncToBranchShop(id, 3);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取该券关联的功能列表
|
||||
*
|
||||
* @param couponId 如果syncId有值 则为syncId 否则为id
|
||||
*/
|
||||
@GetMapping("/gifts")
|
||||
public CzgResult<Page<MkCouponGiftDTO>> getCouponGiftPage(@RequestParam Long couponId, @RequestParam(required = false) Integer type) {
|
||||
Page<MkCouponGiftDTO> data = couponGiftService.getCouponGiftPage(couponId, type);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 消费赠券已领取详情
|
||||
*/
|
||||
@GetMapping("/consumerRecord")
|
||||
public CzgResult<Page<MkShopCouponRecordDTO>> getConsumerRecord(
|
||||
@RequestParam(required = false) String startTime,
|
||||
@RequestParam(required = false) String endTime,
|
||||
MkShopCouponRecordDTO param) {
|
||||
Page<MkShopCouponRecordDTO> data = couponRecordService.getConsumerRecord(param, startTime, endTime);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 优惠券列表/已领取详情
|
||||
*/
|
||||
@GetMapping("/record")
|
||||
public CzgResult<Page<MkShopCouponRecordDTO>> getRecordByCoupon(
|
||||
@RequestParam(required = false) String startTime,
|
||||
@RequestParam(required = false) String endTime,
|
||||
MkShopCouponRecordDTO param) {
|
||||
Page<MkShopCouponRecordDTO> data = couponRecordService.getRecord(param, startTime, endTime);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 优惠券列表/已领取详情
|
||||
*
|
||||
* @param param 用户的优惠券列表 使用该对象的UserId
|
||||
*/
|
||||
@GetMapping("/getRecordByUser")
|
||||
public CzgResult<Page<MkShopCouponRecordDTO>> getRecordByUser(
|
||||
@RequestParam(required = false) String startTime,
|
||||
@RequestParam(required = false) String endTime,
|
||||
MkShopCouponRecordDTO param) {
|
||||
Page<MkShopCouponRecordDTO> data = couponRecordService.getRecordByShopUser(param, startTime, endTime);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户优惠券 失效
|
||||
*
|
||||
* @param id 优惠券记录Id
|
||||
*/
|
||||
@DeleteMapping("/deleteRecord")
|
||||
public CzgResult<Void> cancelRecord(Long id) {
|
||||
couponRecordService.deleteRecord(id);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
private void asyncToBranchShop(Long id, Integer type) {
|
||||
long shopId = StpKit.USER.getShopId(0L);
|
||||
log.info("优惠券同步,优惠券id:{},类型:{}", id, type);
|
||||
ThreadUtil.execAsync(() -> {
|
||||
shopSyncService.syncCouponBySourceShop(shopId, id, type);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 券发放
|
||||
*
|
||||
* @return 是否发放成功
|
||||
*/
|
||||
@PostMapping("/grant")
|
||||
public CzgResult<Boolean> rewardCoupon(@Validated @RequestBody MkRewardCouponDTO rewardCouponDTO) {
|
||||
return CzgResult.success(couponRecordService.grant(rewardCouponDTO.getShopId() != null ? rewardCouponDTO.getShopId() : StpKit.USER.getShopId(), rewardCouponDTO));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成订单后使用
|
||||
* 通过用户Id 查找优惠券
|
||||
*
|
||||
* @param shopUserId 店铺用户Id
|
||||
*/
|
||||
@GetMapping("/findCoupon")
|
||||
public CzgResult<List<UserCouponVo>> findCoupon(@RequestParam Long shopUserId, @RequestParam(required = false) Integer type, @RequestParam(required = false) Integer isFood) {
|
||||
return CzgResult.success(shopCouponService.findCoupon(StpKit.USER.getShopId(), shopUserId, type, isFood));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.TimeQueryParam;
|
||||
import com.czg.log.annotation.OperationLog;
|
||||
import com.czg.market.dto.MkDiscountActivityDTO;
|
||||
import com.czg.market.service.MkDiscountActivityService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.czg.validator.group.DefaultGroup;
|
||||
import com.czg.validator.group.InsertGroup;
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 满减活动
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/admin/discountActivity")
|
||||
public class ADiscountActivityController {
|
||||
@Resource
|
||||
private MkDiscountActivityService discountActivityService;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
@GetMapping("page")
|
||||
public CzgResult<Page<MkDiscountActivityDTO>> getActivityPage(TimeQueryParam param) {
|
||||
Page<MkDiscountActivityDTO> data = discountActivityService.getActivityPage(param, StpKit.USER.getShopId());
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PostMapping
|
||||
@OperationLog("满减活动-新增")
|
||||
public CzgResult<Void> addActivity(@RequestBody @Validated({InsertGroup.class, DefaultGroup.class}) MkDiscountActivityDTO dto) {
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
dto.setShopId(shopId);
|
||||
discountActivityService.addActivity(dto);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@PutMapping
|
||||
@OperationLog("满减活动-修改")
|
||||
public CzgResult<Void> updateCoupon(@RequestBody @Validated({UpdateGroup.class, DefaultGroup.class}) MkDiscountActivityDTO dto) {
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
dto.setShopId(shopId);
|
||||
discountActivityService.updateActivityById(dto);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@DeleteMapping
|
||||
@OperationLog("满减活动--删除")
|
||||
public CzgResult<String> deleteCoupon(@RequestParam Long id) {
|
||||
AssertUtil.isNull(id, "{}不能为空", "id");
|
||||
discountActivityService.deleteActivity(id);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<MkDiscountActivityDTO> getActivity(@RequestParam Long shopId) {
|
||||
MkDiscountActivityDTO data = discountActivityService.getActivityByShopId(shopId);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.TimeQueryParam;
|
||||
import com.czg.log.annotation.OperationLog;
|
||||
import com.czg.market.dto.MkLimitTimeDiscountDTO;
|
||||
import com.czg.market.entity.MkLimitTimeDiscount;
|
||||
import com.czg.market.service.MkLimitTimeDiscountService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.czg.validator.group.DefaultGroup;
|
||||
import com.czg.validator.group.InsertGroup;
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 限时折扣
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/limitTimeDiscount")
|
||||
public class ALimitTimeDiscountController {
|
||||
@Resource
|
||||
private MkLimitTimeDiscountService limitTimeDiscountService;
|
||||
|
||||
/**
|
||||
* 限时折扣-分页
|
||||
*/
|
||||
@GetMapping("page")
|
||||
public CzgResult<Page<MkLimitTimeDiscountDTO>> getLimitTimeDiscountPage(TimeQueryParam param) {
|
||||
Page<MkLimitTimeDiscountDTO> data = limitTimeDiscountService.getLimitTimeDiscountPage(param, StpKit.USER.getShopId());
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 限时折扣-新增
|
||||
*/
|
||||
@PostMapping
|
||||
@OperationLog("限时折扣-新增")
|
||||
public CzgResult<Void> addLimitTimeDiscount(@RequestBody @Validated({InsertGroup.class, DefaultGroup.class}) MkLimitTimeDiscountDTO dto) {
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
dto.setShopId(shopId);
|
||||
limitTimeDiscountService.addLimitTimeDiscount(dto);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 限时折扣-修改
|
||||
*/
|
||||
@PutMapping
|
||||
@OperationLog("限时折扣-修改")
|
||||
public CzgResult<Void> updateLimitTimeDiscount(@RequestBody @Validated({UpdateGroup.class, DefaultGroup.class}) MkLimitTimeDiscountDTO dto) {
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
dto.setShopId(shopId);
|
||||
limitTimeDiscountService.updateLimitTimeDiscountById(dto);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 限时折扣-删除
|
||||
*/
|
||||
@DeleteMapping
|
||||
@OperationLog("限时折扣-删除")
|
||||
public CzgResult<String> deleteLimitTimeDiscount(@RequestParam Long id) {
|
||||
AssertUtil.isNull(id, "{}不能为空", "id");
|
||||
limitTimeDiscountService.deleteLimitTimeDiscount(id);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取限时折扣
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<MkLimitTimeDiscount> getActivity(@RequestParam Long shopId) {
|
||||
MkLimitTimeDiscount data = limitTimeDiscountService.getLimitTimeDiscountByShopId(shopId);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.BaseQueryParam;
|
||||
import com.czg.log.annotation.OperationLog;
|
||||
import com.czg.market.dto.MkProductSmartSuggestDTO;
|
||||
import com.czg.market.service.MkProductSmartSuggestService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.czg.validator.group.DefaultGroup;
|
||||
import com.czg.validator.group.InsertGroup;
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 点单智能推荐
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/suggest")
|
||||
public class AProductSmartSuggestController {
|
||||
@Resource
|
||||
private MkProductSmartSuggestService suggestService;
|
||||
|
||||
/**
|
||||
* 点单智能推荐-分页
|
||||
*/
|
||||
@GetMapping("page")
|
||||
public CzgResult<Page<MkProductSmartSuggestDTO>> getProductSmartSuggestPage(BaseQueryParam param) {
|
||||
Page<MkProductSmartSuggestDTO> data = suggestService.getProductSmartSuggestPage(param, StpKit.USER.getShopId());
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 点单智能推荐-新增
|
||||
*/
|
||||
@PostMapping
|
||||
@OperationLog("点单智能推荐-新增")
|
||||
public CzgResult<Void> addProductSmartSuggest(@RequestBody @Validated({InsertGroup.class, DefaultGroup.class}) MkProductSmartSuggestDTO dto) {
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
dto.setShopId(shopId);
|
||||
suggestService.addProductSmartSuggest(dto);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 点单智能推荐-修改
|
||||
*/
|
||||
@PutMapping
|
||||
@OperationLog("点单智能推荐-修改")
|
||||
public CzgResult<Void> updateProductSmartSuggest(@RequestBody @Validated({UpdateGroup.class, DefaultGroup.class}) MkProductSmartSuggestDTO dto) {
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
dto.setShopId(shopId);
|
||||
suggestService.updateProductSmartSuggestById(dto);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 点单智能推荐-删除
|
||||
*/
|
||||
@DeleteMapping
|
||||
@OperationLog("点单智能推荐-删除")
|
||||
public CzgResult<String> deleteMkProductSmartSuggest(@RequestParam Long id) {
|
||||
AssertUtil.isNull(id, "{}不能为空", "id");
|
||||
suggestService.deleteProductSmartSuggest(id);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取点单智能推荐
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<Map<String, Object>> getActivity(@RequestParam Long shopId) {
|
||||
Map<String, Object> map = suggestService.getProductSmartSuggestByShopId(shopId);
|
||||
return CzgResult.success(map);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.market.dto.AcPushEventDTO;
|
||||
import com.czg.market.service.AcPushEventService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.validator.group.InsertGroup;
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 公众号推送
|
||||
*
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/acPushEvent")
|
||||
public class AcPushEventController {
|
||||
@Resource
|
||||
private AcPushEventService pushEventService;
|
||||
|
||||
/**
|
||||
* 公众号推送:列表
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<Page<AcPushEventDTO>> getPushEventPage(@RequestParam(required = false, defaultValue = "1") Integer page,
|
||||
@RequestParam(required = false, defaultValue = "10") Integer size,
|
||||
@RequestParam(required = false) Integer status,
|
||||
@RequestParam(required = false) Long id) {
|
||||
Page<AcPushEventDTO> data = pushEventService.getPushEventPage(page, size, StpKit.USER.getShopId(), status, id);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 公众号推送:新增
|
||||
*/
|
||||
@PostMapping
|
||||
public CzgResult<Void> addPushEvent(@RequestBody @Validated(InsertGroup.class) AcPushEventDTO param) {
|
||||
param.setShopId(StpKit.USER.getShopId());
|
||||
pushEventService.addPushEvent(param);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 公众号推送:更新
|
||||
*/
|
||||
@PutMapping
|
||||
public CzgResult<Void> upPushEvent(@RequestBody @Validated(UpdateGroup.class) AcPushEventDTO param) {
|
||||
param.setShopId(StpKit.USER.getShopId());
|
||||
pushEventService.upPushEvent(param);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 公众号推送:删除任务
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
public CzgResult<Void> deletePushEvent(@PathVariable Long id) {
|
||||
pushEventService.deletePushEvent(id);
|
||||
return CzgResult.success();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.market.dto.MkBirthdayGiftDTO;
|
||||
import com.czg.market.service.MkBirthdayGiftService;
|
||||
import com.czg.market.vo.MkBirthdayGiftRecordSummaryVO;
|
||||
import com.czg.market.vo.MkBirthdayGiftRecordVO;
|
||||
import com.czg.market.vo.MkBirthdayGiftVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 生日有礼配置
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/birthdayGift")
|
||||
public class BirthdayGiftController {
|
||||
@Resource
|
||||
private MkBirthdayGiftService service;
|
||||
|
||||
|
||||
@GetMapping("/test")
|
||||
public CzgResult<String> test() {
|
||||
service.deliver();
|
||||
return CzgResult.success();
|
||||
}
|
||||
/**
|
||||
* 配置信息获取
|
||||
* 权限标识: activate:list
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "birthdayGift:detail", name = "生日有礼详情")
|
||||
@GetMapping
|
||||
public CzgResult<MkBirthdayGiftVO> detail() {
|
||||
return CzgResult.success(service.detail(StpKit.USER.getMainShopId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息修改
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "birthdayGift:edit", name = "生日有礼修改")
|
||||
@PostMapping
|
||||
public CzgResult<Boolean> edit(@Validated @RequestBody MkBirthdayGiftDTO giftDTO) {
|
||||
return CzgResult.success(service.edit(StpKit.USER.getMainShopId(), giftDTO));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 记录获取
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "birthdayGift:record", name = "生日有礼记录")
|
||||
@GetMapping("/record")
|
||||
public CzgResult<Page<MkBirthdayGiftRecordVO>> record(@RequestParam(required = false) LocalDateTime dateTime, @RequestParam(required = false) String key) {
|
||||
return CzgResult.success(service.getRecord(StpKit.USER.getMainShopId(), key, dateTime));
|
||||
// return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 记录获取
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "birthdayGift:summary", name = "生日有礼概述")
|
||||
@GetMapping("/summary")
|
||||
public CzgResult<MkBirthdayGiftRecordSummaryVO> summary(@RequestParam(required = false) String dateTime, @RequestParam(required = false) String key) {
|
||||
return CzgResult.success(service.summary(StpKit.USER.getMainShopId(), key, StrUtil.isNotBlank(dateTime) ? DateUtil.parseLocalDateTime(dateTime) : null));
|
||||
// return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.market.dto.MkConsumeCashbackDTO;
|
||||
import com.czg.market.service.MkConsumeCashbackRecordService;
|
||||
import com.czg.market.service.MkConsumeCashbackService;
|
||||
import com.czg.market.vo.MkConsumeCashbackVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 消费返现
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/consumeCashback")
|
||||
public class ConsumeCashbackController {
|
||||
|
||||
@Resource
|
||||
private MkConsumeCashbackService service;
|
||||
@Resource
|
||||
private MkConsumeCashbackRecordService consumeCashbackRecordService;
|
||||
|
||||
/**
|
||||
* 配置信息获取
|
||||
* 权限标识: activate:list
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "consumeDiscount:detail", name = "消费返现详情")
|
||||
@GetMapping
|
||||
public CzgResult<MkConsumeCashbackVO> detail() {
|
||||
return CzgResult.success(service.detail(StpKit.USER.getMainShopId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息修改
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "consumeDiscount:edit", name = "消费返现修改")
|
||||
@PostMapping
|
||||
public CzgResult<Boolean> edit(@Validated @RequestBody MkConsumeCashbackDTO consumeDiscountDTO) {
|
||||
return CzgResult.success(service.edit(StpKit.USER.getShopId(), consumeDiscountDTO));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 记录获取
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "consumeDiscount:record", name = "消费返现记录")
|
||||
@GetMapping("/record")
|
||||
public CzgResult<Map<String, Object>> record(@RequestParam(required = false) Long shopId, @RequestParam(required = false) String key,
|
||||
@RequestParam(required = false)String startTime, @RequestParam(required = false) String endTime) {
|
||||
return CzgResult.success(consumeCashbackRecordService.getRecord(StpKit.USER.getMainShopId(), shopId, key,
|
||||
StrUtil.isNotBlank(startTime) ? DateUtil.parseLocalDateTime(startTime) : null, StrUtil.isNotBlank(endTime) ? DateUtil.parseLocalDateTime(endTime) : null));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.market.dto.MkConsumeDiscountDTO;
|
||||
import com.czg.market.service.MkConsumeDiscountService;
|
||||
import com.czg.market.vo.MkConsumeDiscountVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* 新客立减
|
||||
* @author Administrator
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/admin/consumeDiscount")
|
||||
public class ConsumeDiscountController {
|
||||
@Resource
|
||||
private MkConsumeDiscountService consumeDiscountService;
|
||||
|
||||
/**
|
||||
* 配置信息获取
|
||||
* 权限标识: activate:list
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "member:detail", name = "会员配置列表")
|
||||
@GetMapping
|
||||
public CzgResult<MkConsumeDiscountVO> detail() {
|
||||
return CzgResult.success(consumeDiscountService.detail(StpKit.USER.getShopId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息修改
|
||||
* @return 是否成功
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "member:edit", name = "会员配置列表")
|
||||
@PostMapping
|
||||
public CzgResult<Boolean> edit(@Validated @RequestBody MkConsumeDiscountDTO consumeDiscountDTO) {
|
||||
return CzgResult.success(consumeDiscountService.edit(StpKit.USER.getShopId(), consumeDiscountDTO));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.annotation.SaCheckMainShop;
|
||||
import com.czg.constant.TableValueConstant;
|
||||
import com.czg.market.dto.MkRedemptionConfigDTO;
|
||||
import com.czg.market.dto.MkEnableConfigDTO;
|
||||
import com.czg.market.service.MkRedemptionConfigService;
|
||||
import com.czg.market.service.MkEnableConfigService;
|
||||
import com.czg.market.vo.MkRedemptionCodeVO;
|
||||
import com.czg.market.vo.MkRedemptionConfigVO;
|
||||
import com.czg.market.vo.MkEnableConfigVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.groups.Default;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* 券兑换码相关
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/couponRedemption")
|
||||
public class CouponRedemptionController {
|
||||
@Resource
|
||||
private MkRedemptionConfigService configService;
|
||||
@Resource
|
||||
private MkEnableConfigService enableConfigService;
|
||||
|
||||
/**
|
||||
* 开关。可用门店修改
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "couponRedemption:enable", name = "券兑换码状态修改")
|
||||
@PutMapping("/enable")
|
||||
public CzgResult<Boolean> upEnable(@Validated @RequestBody MkEnableConfigDTO dto) {
|
||||
return CzgResult.success(enableConfigService.upEnable(StpKit.USER.getMainShopId(),StpKit.USER.getLoginIdAsLong(), dto, TableValueConstant.EnableConfig.Type.COUPON_REDEMPTION));
|
||||
}
|
||||
|
||||
/**
|
||||
* 开关状态,可用门店详情
|
||||
*/
|
||||
@GetMapping("/enable/status")
|
||||
public CzgResult<MkEnableConfigVO> upEnable() {
|
||||
return CzgResult.success(enableConfigService.detail(StpKit.USER.getMainShopId(), StpKit.USER.getLoginIdAsLong(), TableValueConstant.EnableConfig.Type.COUPON_REDEMPTION));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息详情
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "couponRedemption:detail", name = "券兑换码列表")
|
||||
@GetMapping
|
||||
public CzgResult<MkRedemptionConfigVO> detail(@RequestParam Long id) {
|
||||
return CzgResult.success(configService.detail(StpKit.USER.getMainShopId(), id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息获取 列表
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "couponRedemption:list", name = "券兑换码列表")
|
||||
@GetMapping("/list")
|
||||
public CzgResult<Page<MkRedemptionConfigVO>> list(@RequestParam(required = false, defaultValue = "-1") Integer status) {
|
||||
return CzgResult.success(configService.pageInfo(StpKit.USER.getMainShopId(), status, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息添加
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "couponRedemption:add", name = "券兑换码配置添加")
|
||||
@PostMapping
|
||||
@SaCheckMainShop
|
||||
public CzgResult<Boolean> add(@Validated @RequestBody MkRedemptionConfigDTO dto) {
|
||||
return CzgResult.success(configService.add(StpKit.USER.getMainShopId(), dto, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息修改
|
||||
*
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "couponRedemption:edit", name = "券兑换码修改")
|
||||
@SaCheckMainShop
|
||||
@PutMapping
|
||||
public CzgResult<Boolean> edit(@Validated({UpdateGroup.class, Default.class}) @RequestBody MkRedemptionConfigDTO dto) {
|
||||
return CzgResult.success(configService.edit(StpKit.USER.getShopId(), dto, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 券兑换码码列表
|
||||
*
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "couponRedemption:codeList", name = "券兑换码码列表")
|
||||
@GetMapping("/code/list")
|
||||
public CzgResult<Page<MkRedemptionCodeVO>> codeList(@RequestParam Long redemptionId, @RequestParam(required = false) String code, @RequestParam(required = false) Integer status) {
|
||||
return CzgResult.success(configService.codeList(StpKit.USER.getMainShopId(), redemptionId, code, status, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* 券兑换码码导出
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "couponRedemption:codeExport", name = "券兑换码码列表导出")
|
||||
@GetMapping("/code/export")
|
||||
public void exportCodeList(@RequestParam Long redemptionId, @RequestParam(required = false) String code, @RequestParam(required = false) Integer status,
|
||||
HttpServletResponse response, HttpServletRequest request) {
|
||||
configService.exportCodeList(StpKit.USER.getMainShopId(), redemptionId, code, status, response, request, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,148 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.annotation.SaCheckMainShop;
|
||||
import com.czg.market.dto.MkDistributionConfigDTO;
|
||||
import com.czg.market.service.*;
|
||||
import com.czg.market.vo.*;
|
||||
import com.czg.order.dto.MkDistributionPayDTO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.service.market.service.impl.AppWxServiceImpl;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
* 分销相关
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/distribution")
|
||||
public class DistributionController {
|
||||
@Resource
|
||||
private MkDistributionConfigService configService;
|
||||
@Resource
|
||||
private MkDistributionUserService distributionUserService;
|
||||
@Resource
|
||||
private MkDistributionAmountFlowService distributionAmountFlowService;
|
||||
@Resource
|
||||
private MkDistributionFlowService distributionFlowService;
|
||||
@Resource
|
||||
private MkDistributionWithdrawFlowService withdrawFlowService;
|
||||
@Resource
|
||||
private AppWxServiceImpl appWxService;
|
||||
|
||||
/**
|
||||
* 配置信息详情
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "distribution:detail", name = "分销配置")
|
||||
@GetMapping
|
||||
public CzgResult<MkDistributionConfigVO> detail() {
|
||||
return CzgResult.success(configService.detail(StpKit.USER.getShopId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息修改
|
||||
*
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "distribution:edit", name = "分销修改")
|
||||
@PutMapping
|
||||
public CzgResult<Boolean> edit( @RequestBody MkDistributionConfigDTO dto) {
|
||||
return CzgResult.success(configService.edit(StpKit.USER.getShopId(), dto));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 现金充值
|
||||
* @param payParam 充值信息
|
||||
* @return 是否成功
|
||||
*/
|
||||
@PostMapping("/cashPay")
|
||||
public CzgResult<Boolean> cashPayOrder(@Validated @RequestBody MkDistributionPayDTO payParam) {
|
||||
AssertUtil.isNull(payParam.getShopId(), "店铺id不能为空");
|
||||
AssertUtil.isNull(payParam.getAmount(), "充值金额不能为空");
|
||||
AssertUtil.isTrue(payParam.getAmount().compareTo(BigDecimal.ZERO) == 0, "金额不为0");
|
||||
return CzgResult.success(distributionUserService.cashPayOrder(StpKit.USER.getLoginIdAsLong(), payParam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 金额记录
|
||||
* @param type manual_recharge充值 self_recharge自助充值 refund退款 manual_sub手动扣减 sub统扣减
|
||||
* @param key 搜索
|
||||
*/
|
||||
@GetMapping("/flow")
|
||||
public CzgResult<Map<String, Object>> flow(@RequestParam(required = false) Long shopId, @RequestParam(required = false) String type,
|
||||
@RequestParam(required = false) String key,@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime) {
|
||||
return CzgResult.success(distributionAmountFlowService.pageInfo(StpKit.USER.isAdmin() ? shopId : StpKit.USER.getShopId(), type, key,
|
||||
StrUtil.isBlank(startTime) ? null : DateUtil.parseLocalDateTime(startTime), StrUtil.isBlank(endTime) ? null : DateUtil.parseLocalDateTime(endTime)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 开通记录
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param key 用户id昵称
|
||||
*/
|
||||
@GetMapping("openFlow")
|
||||
public CzgResult<Map<String, Object>> openFlow(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime, @RequestParam(required = false) String key) {
|
||||
return CzgResult.success(distributionAmountFlowService.openPageInfo(StpKit.USER.getShopId(),
|
||||
StrUtil.isNotBlank(startTime) ? DateUtil.parseLocalDateTime(startTime) : null, StrUtil.isNotBlank(endTime) ? DateUtil.parseLocalDateTime(endTime) : null, key));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分销明细
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param key 用户id昵称
|
||||
* @param status pending待入账 success已入账
|
||||
*/
|
||||
@GetMapping("distributionFlow")
|
||||
public CzgResult<Map<String, Object>> distributionFlow(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime,
|
||||
@RequestParam(required = false) String key, @RequestParam(required = false) String status,
|
||||
@RequestParam(required = false) Long id) {
|
||||
return CzgResult.success(distributionFlowService.pageInfo(StpKit.USER.getShopId(),
|
||||
StrUtil.isNotBlank(startTime) ? DateUtil.parseLocalDateTime(startTime) : null, StrUtil.isNotBlank(endTime) ? DateUtil.parseLocalDateTime(endTime) : null, key, status, id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用户提现列表
|
||||
* @param userId 用户id
|
||||
* @param key 搜索
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
*/
|
||||
@GetMapping("/withdrawFlow")
|
||||
public CzgResult<Map<String, Object>> withdrawPageInfo(@RequestParam(required = false) Long userId, @RequestParam(required = false) String key,
|
||||
@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime) {
|
||||
return CzgResult.success(withdrawFlowService.withdrawPageInfo(userId, StrUtil.isBlank(startTime) ? null : DateUtil.parseLocalDateTime(startTime),
|
||||
StrUtil.isBlank(endTime) ? null : DateUtil.parseLocalDateTime(endTime), key));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 充值二维码获取
|
||||
* @param amount 金额
|
||||
* @return base64
|
||||
*/
|
||||
@GetMapping("/rechargeQrCode")
|
||||
public CzgResult<String> rechargeQrCode(@RequestParam BigDecimal amount) {
|
||||
return CzgResult.success(configService.rechargeQrCode(StpKit.USER.getShopId(), amount));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.log.annotation.OperationLog;
|
||||
import com.czg.market.dto.MkDistributionUserDTO;
|
||||
import com.czg.market.entity.MkDistributionUser;
|
||||
import com.czg.market.service.MkDistributionUserService;
|
||||
import com.czg.market.vo.InviteUserVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.czg.validator.group.DefaultGroup;
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 分销员
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/distribution/user")
|
||||
public class DistributionUserController {
|
||||
@Resource
|
||||
private MkDistributionUserService distributionUserService;
|
||||
|
||||
/**
|
||||
* 分销员:获取分销员分页列表
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<Page<MkDistributionUserDTO>> getDistributionUser(MkDistributionUserDTO param) {
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
param.setShopId(shopId);
|
||||
return CzgResult.success(distributionUserService.getDistributionUser(param));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销员:获取邀请人分页列表
|
||||
*/
|
||||
@GetMapping("/inviteUser")
|
||||
public CzgResult<Page<InviteUserVO>> getInviteUser(
|
||||
@RequestParam Long id,
|
||||
@RequestParam(required = false) Long shopUserId,
|
||||
@RequestParam(required = false) Long distributionLevelId,
|
||||
@RequestParam(required = false, defaultValue = "1") Integer page,
|
||||
@RequestParam(required = false, defaultValue = "10") Integer size) {
|
||||
AssertUtil.isNull(id, "邀请人ID");
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
return CzgResult.success(distributionUserService.getInviteUser(id,shopId, shopUserId, distributionLevelId, page, size));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销员:添加分销员
|
||||
*
|
||||
* @return 是否成功
|
||||
*/
|
||||
@PostMapping
|
||||
@OperationLog("分销员-添加")
|
||||
@SaAdminCheckPermission(value = "distribution:user:add", name = "分销员添加")
|
||||
public CzgResult<Void> addDistributionUser(@RequestBody MkDistributionUser param) {
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
param.setShopId(shopId);
|
||||
distributionUserService.addDistributionUser(param);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分销员:修改
|
||||
*/
|
||||
@PutMapping
|
||||
@OperationLog("分销员-修改")
|
||||
@SaAdminCheckPermission(value = "distribution:user:update", name = "分销员修改")
|
||||
public CzgResult<Void> updateDistributionUser(@RequestBody @Validated({UpdateGroup.class, DefaultGroup.class}) MkDistributionUserDTO dto) {
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
dto.setShopId(shopId);
|
||||
distributionUserService.updateDistributionUserById(dto);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/resetLevel")
|
||||
@OperationLog("分销员-重置分销组")
|
||||
@SaAdminCheckPermission(value = "distribution:user:update", name = "重置分销组")
|
||||
public CzgResult<Void> resetDistributionUserLevel(@RequestBody MkDistributionUserDTO dto) {
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
dto.setShopId(shopId);
|
||||
distributionUserService.resetDistributionUserLevel(dto);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销员:删除
|
||||
*/
|
||||
@DeleteMapping
|
||||
@OperationLog("分销员-删除")
|
||||
@SaAdminCheckPermission(value = "distribution:user:delete", name = "分销员删除")
|
||||
public CzgResult<String> deleteDistributionUser(@RequestParam Long id) {
|
||||
AssertUtil.isNull(id, "{}不能为空", "id");
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
distributionUserService.deleteDistributionUser(id,shopId);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.market.dto.MkBirthdayGiftDTO;
|
||||
import com.czg.market.dto.MkDrainageConfigDTO;
|
||||
import com.czg.market.entity.MkDrainageConfig;
|
||||
import com.czg.market.service.MkBirthdayGiftService;
|
||||
import com.czg.market.service.MkDrainageConfigService;
|
||||
import com.czg.market.vo.MkBirthdayGiftRecordSummaryVO;
|
||||
import com.czg.market.vo.MkBirthdayGiftRecordVO;
|
||||
import com.czg.market.vo.MkBirthdayGiftVO;
|
||||
import com.czg.market.vo.MkDrainageConfigVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 私域引流配置
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/drainageConfig")
|
||||
public class DrainageConfigController {
|
||||
|
||||
@Resource
|
||||
private MkDrainageConfigService service;
|
||||
|
||||
/**
|
||||
* 配置信息获取
|
||||
* 权限标识: activate:list
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "drainageConfig:detail", name = "私域引流详情")
|
||||
@GetMapping
|
||||
public CzgResult<MkDrainageConfigVO> detail() {
|
||||
return CzgResult.success(service.detail(StpKit.USER.getShopId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息修改
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "drainageConfig:edit", name = "私域引流修改")
|
||||
@PostMapping
|
||||
public CzgResult<Boolean> edit(@Validated @RequestBody MkDrainageConfigDTO config) {
|
||||
return CzgResult.success(service.edit(StpKit.USER.getShopId(), config));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.exception.ApiNotPrintException;
|
||||
import com.czg.market.dto.MemberConfigDTO;
|
||||
import com.czg.market.dto.MemberLevelDTO;
|
||||
import com.czg.market.entity.MemberLevelConfig;
|
||||
import com.czg.market.service.MemberLevelConfigService;
|
||||
import com.czg.market.service.TbMemberConfigService;
|
||||
import com.czg.market.vo.MemberConfigVO;
|
||||
import com.czg.market.vo.MemberLevelVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.groups.Default;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* 会员配置管理
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/admin/member")
|
||||
public class MemberController {
|
||||
@Resource
|
||||
private TbMemberConfigService memberConfigService;
|
||||
@Resource
|
||||
private MemberLevelConfigService memberLevelConfigService;
|
||||
|
||||
/**
|
||||
* 配置信息获取
|
||||
* 权限标识: activate:list
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "member:detail", name = "会员配置列表")
|
||||
@GetMapping
|
||||
public CzgResult<MemberConfigVO> detail() {
|
||||
return CzgResult.success(memberConfigService.detail(StpKit.USER.getShopId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息修改
|
||||
* @return 是否成功
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "member:edit", name = "会员配置列表")
|
||||
@PostMapping
|
||||
public CzgResult<Boolean> edit(@Validated @RequestBody MemberConfigDTO memberDTO) {
|
||||
AssertUtil.isTrue(!StpKit.USER.isMainShop(), "无权限操作");
|
||||
return CzgResult.success(memberConfigService.edit(StpKit.USER.getShopId(), memberDTO));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 会员等级添加
|
||||
* @return 是否成功
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "member:edit", name = "会员配置列表")
|
||||
@PostMapping("/level")
|
||||
public CzgResult<Boolean> addLevel(@Validated @RequestBody MemberLevelDTO levelDTO) throws ApiNotPrintException {
|
||||
AssertUtil.isTrue(!StpKit.USER.isMainShop(), "无权限操作");
|
||||
return CzgResult.success(memberConfigService.addLevel(StpKit.USER.getShopId(), levelDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员等级修改
|
||||
* @return 是否成功
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "member:edit", name = "会员配置列表")
|
||||
@PutMapping("/level")
|
||||
public CzgResult<Boolean> editLevel(@Validated({UpdateGroup.class, Default.class}) @RequestBody MemberLevelDTO levelDTO) throws ApiNotPrintException {
|
||||
AssertUtil.isTrue(!StpKit.USER.isMainShop(), "无权限操作");
|
||||
return CzgResult.success(memberConfigService.editLevel(StpKit.USER.getShopId(), levelDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员等级删除
|
||||
* @return 是否成功
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "member:edit", name = "会员配置列表")
|
||||
@DeleteMapping("/level/{id}")
|
||||
public CzgResult<Boolean> deleteLevel(@PathVariable Long id) {
|
||||
AssertUtil.isTrue(!StpKit.USER.isMainShop(), "无权限操作");
|
||||
return CzgResult.success(memberLevelConfigService.remove(new QueryWrapper().eq(MemberLevelConfig::getId, id).eq(MemberLevelConfig::getShopId, StpKit.USER.getShopId())));
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员等级列表
|
||||
* @return 是否成功
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "member:edit", name = "会员配置列表")
|
||||
@GetMapping("/level/list")
|
||||
public CzgResult<ArrayList<MemberLevelVO>> levelList() {
|
||||
return CzgResult.success(memberConfigService.listLevel(StpKit.USER.getShopId()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 会员等级详情
|
||||
* @return 是否成功
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "member:edit", name = "会员配置列表")
|
||||
@PutMapping("/level/detail")
|
||||
public CzgResult<ArrayList<MemberLevelVO>> levelList(@RequestParam Integer id) {
|
||||
AssertUtil.isTrue(!StpKit.USER.isMainShop(), "无权限操作");
|
||||
return CzgResult.success(memberConfigService.listLevel(StpKit.USER.getShopId()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.annotation.SaCheckMainShop;
|
||||
import com.czg.constant.TableValueConstant;
|
||||
import com.czg.market.dto.MkRedemptionConfigDTO;
|
||||
import com.czg.market.dto.MkEnableConfigDTO;
|
||||
import com.czg.market.service.MkRedemptionConfigService;
|
||||
import com.czg.market.service.MkEnableConfigService;
|
||||
import com.czg.market.vo.MkRedemptionCodeVO;
|
||||
import com.czg.market.vo.MkRedemptionConfigVO;
|
||||
import com.czg.market.vo.MkEnableConfigVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.groups.Default;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* 充值兑换相关
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/rechargeRedemption")
|
||||
public class RechargeRedemptionController {
|
||||
@Resource
|
||||
private MkRedemptionConfigService configService;
|
||||
@Resource
|
||||
private MkEnableConfigService enableConfigService;
|
||||
|
||||
/**
|
||||
* 开关。可用门店修改
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "rechargeRedemption:enable", name = "充值兑换状态修改")
|
||||
@PutMapping("/enable")
|
||||
public CzgResult<Boolean> upEnable(@Validated @RequestBody MkEnableConfigDTO dto) {
|
||||
return CzgResult.success(enableConfigService.upEnable(StpKit.USER.getMainShopId(),StpKit.USER.getLoginIdAsLong(), dto, TableValueConstant.EnableConfig.Type.RECHARGE_REDEMPTION));
|
||||
}
|
||||
|
||||
/**
|
||||
* 开关状态,可用门店详情
|
||||
*/
|
||||
@GetMapping("/enable/status")
|
||||
public CzgResult<MkEnableConfigVO> upEnable() {
|
||||
return CzgResult.success(enableConfigService.detail(StpKit.USER.getMainShopId(), StpKit.USER.getLoginIdAsLong(), TableValueConstant.EnableConfig.Type.RECHARGE_REDEMPTION));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息详情
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "rechargeRedemption:detail", name = "充值兑换列表")
|
||||
@GetMapping
|
||||
public CzgResult<MkRedemptionConfigVO> detail(@RequestParam Long id) {
|
||||
return CzgResult.success(configService.detail(StpKit.USER.getMainShopId(), id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息获取 列表
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "rechargeRedemption:list", name = "充值兑换列表")
|
||||
@GetMapping("/list")
|
||||
public CzgResult<Page<MkRedemptionConfigVO>> list(@RequestParam(required = false, defaultValue = "-1") Integer status) {
|
||||
return CzgResult.success(configService.pageInfo(StpKit.USER.getMainShopId(), status, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息添加
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "rechargeRedemption:add", name = "充值兑换配置添加")
|
||||
@PostMapping
|
||||
@SaCheckMainShop
|
||||
public CzgResult<Boolean> add(@Validated @RequestBody MkRedemptionConfigDTO dto) {
|
||||
return CzgResult.success(configService.add(StpKit.USER.getMainShopId(), dto, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息修改
|
||||
*
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "rechargeRedemption:edit", name = "充值兑换修改")
|
||||
@SaCheckMainShop
|
||||
@PutMapping
|
||||
public CzgResult<Boolean> edit(@Validated({UpdateGroup.class, Default.class}) @RequestBody MkRedemptionConfigDTO dto) {
|
||||
return CzgResult.success(configService.edit(StpKit.USER.getShopId(), dto, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值兑换码列表
|
||||
*
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "rechargeRedemption:codeList", name = "充值兑换码列表")
|
||||
@GetMapping("/code/list")
|
||||
public CzgResult<Page<MkRedemptionCodeVO>> codeList(@RequestParam Long redemptionId, @RequestParam(required = false) String code, @RequestParam(required = false) Integer status) {
|
||||
return CzgResult.success(configService.codeList(StpKit.USER.getMainShopId(), redemptionId, code, status, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值兑换码导出
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "rechargeRedemption:codeExport", name = "充值兑换码列表导出")
|
||||
@GetMapping("/code/export")
|
||||
public void exportCodeList(@RequestParam Long redemptionId, @RequestParam(required = false) String code, @RequestParam(required = false) Integer status,
|
||||
HttpServletResponse response, HttpServletRequest request) {
|
||||
configService.exportCodeList(StpKit.USER.getMainShopId(), redemptionId, code, status, response, request, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.market.dto.MkShopRechargeDTO;
|
||||
import com.czg.market.entity.MkShopConsumeDiscountRecord;
|
||||
import com.czg.market.entity.MkShopRechargeFlow;
|
||||
import com.czg.market.service.MkRechargeFlowService;
|
||||
import com.czg.market.service.MkShopConsumeDiscountRecordService;
|
||||
import com.czg.market.service.MkShopRechargeService;
|
||||
import com.czg.market.vo.MkShopRechargeVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 智慧充值
|
||||
* @author Administrator
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/admin/shopRecharge")
|
||||
public class ShopRechargeController {
|
||||
@Resource
|
||||
private MkShopRechargeService shopRechargeService;
|
||||
@Resource
|
||||
private MkRechargeFlowService rechargeFlowService;
|
||||
|
||||
@Resource
|
||||
private MkShopConsumeDiscountRecordService shopConsumeDiscountRecordService;
|
||||
|
||||
@GetMapping("/test")
|
||||
public CzgResult<MkShopConsumeDiscountRecord> get(@RequestParam Long shopId) {
|
||||
// return CzgResult.success(shopConsumeDiscountRecordService.get(shopId));
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息获取
|
||||
* 权限标识: activate:list
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "member:detail", name = "会员配置列表")
|
||||
@GetMapping
|
||||
public CzgResult<MkShopRechargeVO> detail() {
|
||||
if (!StpKit.USER.isManager()) {
|
||||
return CzgResult.failure("无权限操作");
|
||||
}
|
||||
return CzgResult.success(shopRechargeService.detail(StpKit.USER.getShopId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息修改
|
||||
* @return 是否成功
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "member:edit", name = "会员配置列表")
|
||||
@PostMapping
|
||||
public CzgResult<Boolean> edit(@Validated @RequestBody MkShopRechargeDTO shopRechargeDTO) {
|
||||
if (!StpKit.USER.isManager()) {
|
||||
return CzgResult.failure("无权限操作");
|
||||
}
|
||||
return CzgResult.success(shopRechargeService.edit(StpKit.USER.getShopId(), shopRechargeDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取充值记录列表
|
||||
* @param startTime 开始时间 闭区间
|
||||
* @param endTime 结束时间 闭区间
|
||||
* @param type 类型
|
||||
*/
|
||||
@GetMapping("/record")
|
||||
public Page<MkShopRechargeFlow> getRecord(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime, @RequestParam(required = false) String type) {
|
||||
return rechargeFlowService.pageInfo(StpKit.USER.getShopId(), startTime, endTime, type);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.market.dto.SmsPushEventDTO;
|
||||
import com.czg.market.service.SmsPushEventService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.validator.group.InsertGroup;
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 短信推送任务
|
||||
*
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/pushEvent")
|
||||
public class SmsPushEventController {
|
||||
@Resource
|
||||
private SmsPushEventService pushEventService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<Page<SmsPushEventDTO>> getPushEventPage(@RequestParam(required = false, defaultValue = "1") Integer page,
|
||||
@RequestParam(required = false, defaultValue = "10") Integer size,
|
||||
@RequestParam(required = false) Integer status,
|
||||
@RequestParam(required = false) Long id) {
|
||||
Page<SmsPushEventDTO> data = pushEventService.getPushEventPage(page, size, StpKit.USER.getShopId(), status, id);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PostMapping
|
||||
public CzgResult<Void> addPushEvent(@RequestBody @Validated(InsertGroup.class) SmsPushEventDTO param) {
|
||||
param.setShopId(StpKit.USER.getShopId());
|
||||
pushEventService.addPushEvent(param);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
@PutMapping
|
||||
public CzgResult<Void> upPushEvent(@RequestBody @Validated(UpdateGroup.class) SmsPushEventDTO param) {
|
||||
param.setShopId(StpKit.USER.getShopId());
|
||||
pushEventService.upPushEvent(param);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除任务
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
public CzgResult<Void> deletePushEvent(@PathVariable Long id) {
|
||||
pushEventService.deletePushEvent(id);
|
||||
return CzgResult.success();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,169 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.czg.annotation.SaAdminCheckRole;
|
||||
import com.czg.market.dto.SmsMoneyDetailDto;
|
||||
import com.czg.market.dto.SmsShopMoneyDetailDTO;
|
||||
import com.czg.market.dto.SmsShopTemplateDTO;
|
||||
import com.czg.market.dto.SmsTemplateQueryDTO;
|
||||
import com.czg.market.entity.SmsShopMoney;
|
||||
import com.czg.market.entity.SmsShopMoneyDetail;
|
||||
import com.czg.market.service.SmsShopMoneyDetailService;
|
||||
import com.czg.market.service.SmsShopMoneyService;
|
||||
import com.czg.market.service.SmsShopTemplateService;
|
||||
import com.czg.market.vo.SmsShopMoneyVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.service.market.mapper.SmsShopMoneyMapper;
|
||||
import com.czg.validator.group.InsertGroup;
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 短信模板
|
||||
*
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin")
|
||||
public class SmsShopTemplateController {
|
||||
@Resource
|
||||
private SmsShopTemplateService templateService;
|
||||
@Resource
|
||||
private SmsShopMoneyDetailService smsMoneyDetailService;
|
||||
@Resource
|
||||
private SmsShopMoneyService shopMoneyService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@GetMapping("/smsTemplate")
|
||||
public CzgResult<List<SmsShopTemplateDTO>> getTemplateList(@RequestParam(required = false) String title,
|
||||
@RequestParam(required = false) Integer status) {
|
||||
List<SmsShopTemplateDTO> data = templateService.getTemplateList(title, StpKit.USER.getShopId(), status);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 平台 商家申请记录
|
||||
*/
|
||||
@SaAdminCheckRole("管理员")
|
||||
@PostMapping("/smsTemplate/query")
|
||||
public CzgResult<Page<SmsShopTemplateDTO>> getTemplateList2(@RequestBody SmsTemplateQueryDTO param) {
|
||||
Page<SmsShopTemplateDTO> data = templateService.getTemplateList2(param);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 平台 模板状态/删除
|
||||
*/
|
||||
@SaAdminCheckRole("管理员")
|
||||
@PostMapping("/smsTemplate/shopUse")
|
||||
public CzgResult<Void> shopUse(@RequestBody SmsShopTemplateDTO param) {
|
||||
templateService.shopUse(param);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 平台 获取店铺短信余额明细
|
||||
*/
|
||||
@SaAdminCheckRole("管理员")
|
||||
@PostMapping("/smsMoneyDetail/query")
|
||||
public CzgResult<Page<SmsShopMoneyDetailDTO>> getSmsMoneyDetail2(@RequestBody SmsMoneyDetailDto param) {
|
||||
Page<SmsShopMoneyDetailDTO> data = smsMoneyDetailService.getSmsMoneyDetail2(param);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PostMapping("/smsTemplate")
|
||||
public CzgResult<Void> addTemplate(@RequestBody @Validated(InsertGroup.class) SmsShopTemplateDTO param) {
|
||||
param.setShopId(StpKit.USER.getShopId());
|
||||
templateService.addTemplate(param);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新提交
|
||||
* 状态为 -1 失败的 可以修改模板重新提交
|
||||
*/
|
||||
@PostMapping("/smsTemplate/resubmit")
|
||||
public CzgResult<Void> resubmit(@RequestBody @Validated(UpdateGroup.class) SmsShopTemplateDTO param) {
|
||||
param.setShopId(StpKit.USER.getShopId());
|
||||
templateService.resubmit(param);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺短信余额
|
||||
*/
|
||||
@GetMapping("/smsMoney")
|
||||
public CzgResult<SmsShopMoney> getShopSmsMoney() {
|
||||
SmsShopMoney shopMoney = shopMoneyService.getShopMoney(StpKit.USER.getShopId());
|
||||
return CzgResult.success(shopMoney);
|
||||
}
|
||||
|
||||
/**
|
||||
* 平台:短信店铺配置
|
||||
*/
|
||||
@SaAdminCheckRole("管理员")
|
||||
@GetMapping("/smsMoney/page")
|
||||
public CzgResult<Page<SmsShopMoneyVO>> getShopSmsMoneyPage(@RequestParam(required = false) Integer page,
|
||||
@RequestParam(required = false) Integer size,
|
||||
@RequestParam(required = false) String name
|
||||
) {
|
||||
Page<SmsShopMoneyVO> data = shopMoneyService.getShopMoneyPage(page, size, name);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 变更店铺短信余额
|
||||
*/
|
||||
@PostMapping("/smsMoney/change")
|
||||
public CzgResult<Void> change(@RequestBody SmsShopMoneyDetailDTO money) {
|
||||
// Long shopId = StpKit.USER.getShopId();
|
||||
SmsShopMoney shopMoney = shopMoneyService.getShopMoney(money.getShopId());
|
||||
SmsShopMoneyDetail moneyDetail = BeanUtil.toBean(money, SmsShopMoneyDetail.class);
|
||||
moneyDetail.setShopId(money.getShopId());
|
||||
if (money.getType() == 1) {
|
||||
shopMoney.setMoney(shopMoney.getMoney().add(money.getExpense()));
|
||||
} else {
|
||||
shopMoney.setMoney(shopMoney.getMoney().subtract(money.getExpense()));
|
||||
}
|
||||
moneyDetail.setBalance(shopMoney.getMoney());
|
||||
moneyDetail.setSendRows(0L);
|
||||
smsMoneyDetailService.save(moneyDetail);
|
||||
shopMoneyService.updateById(shopMoney);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取店铺短信余额明细
|
||||
*/
|
||||
@GetMapping("/smsMoneyDetail")
|
||||
public CzgResult<JSONObject> getSmsMoneyDetailPage(@RequestParam(required = false) Integer page,
|
||||
@RequestParam(required = false) Integer size) {
|
||||
Page<SmsShopMoneyDetailDTO> data = smsMoneyDetailService.getSmsMoneyDetailPage(StpKit.USER.getShopId());
|
||||
JSONObject from = JSONObject.from(data);
|
||||
from.put("sendTotal", smsMoneyDetailService.countSendTotal(StpKit.USER.getShopId()));
|
||||
from.put("sendAmountTotal", smsMoneyDetailService.countSendAmountTotal(StpKit.USER.getShopId()));
|
||||
return CzgResult.success(from);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.czg.controller.user;
|
||||
|
||||
import com.czg.market.service.MkBirthdayGiftService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 生日有礼相关
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user/birthdayGift")
|
||||
public class UBirthdayGiftController {
|
||||
|
||||
@Resource
|
||||
private MkBirthdayGiftService service;
|
||||
|
||||
/**
|
||||
* 获取生日有礼 不为空则代表今日发放生日有礼的奖励
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<ArrayList<Map<String, Object>>> detail(@RequestParam Integer shopId) {
|
||||
return CzgResult.success(service.getInfo(StpKit.USER.getLoginIdAsLong(), shopId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.czg.controller.user;
|
||||
|
||||
import com.czg.market.dto.MkDiscountActivityDTO;
|
||||
import com.czg.market.service.MkDiscountActivityService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 满减活动
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/user/discountActivity")
|
||||
public class UDiscountActivityController {
|
||||
@Resource
|
||||
private MkDiscountActivityService discountActivityService;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
@GetMapping()
|
||||
public CzgResult<MkDiscountActivityDTO> getActivity(@RequestParam Long shopId) {
|
||||
MkDiscountActivityDTO data = discountActivityService.getActivityByShopId(shopId);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,172 @@
|
|||
package com.czg.controller.user;
|
||||
|
||||
import com.czg.account.entity.UserInfo;
|
||||
import com.czg.market.dto.MkDistributionUserDTO;
|
||||
import com.czg.market.dto.MkDistributionWithdrawFlowDTO;
|
||||
import com.czg.market.entity.MkDistributionWithdrawFlow;
|
||||
import com.czg.market.service.MkDistributionConfigService;
|
||||
import com.czg.market.service.MkDistributionFlowService;
|
||||
import com.czg.market.service.MkDistributionUserService;
|
||||
import com.czg.market.service.MkDistributionWithdrawFlowService;
|
||||
import com.czg.market.vo.DistributionCenterShopVO;
|
||||
import com.czg.market.vo.InviteUserVO;
|
||||
import com.czg.market.vo.MkDistributionConfigVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.service.market.service.impl.AppWxServiceImpl;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 分销相关
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user/distribution")
|
||||
public class UDistributionController {
|
||||
@Resource
|
||||
private MkDistributionConfigService distributionConfigService;
|
||||
@Resource
|
||||
private MkDistributionUserService distributionUserService;
|
||||
@Resource
|
||||
private AppWxServiceImpl appWxService;
|
||||
@Resource
|
||||
private MkDistributionWithdrawFlowService withdrawFlowService;
|
||||
@Resource
|
||||
private MkDistributionFlowService distributionFlowService;
|
||||
|
||||
/**
|
||||
* 分销员中心-获取配置
|
||||
*/
|
||||
@GetMapping("/getConfig")
|
||||
public CzgResult<MkDistributionConfigVO> getConfig(@RequestParam Long shopId) {
|
||||
return CzgResult.success(distributionConfigService.detail(shopId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销员中心-首页
|
||||
*/
|
||||
@PostMapping("/centerUser")
|
||||
public CzgResult<Map<String, Object>> centerUser() {
|
||||
return CzgResult.success(distributionUserService.centerUser(StpKit.USER.getLoginIdAsLong()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销员中心-已开通的店铺
|
||||
*/
|
||||
@GetMapping("/centerUser/activates")
|
||||
public CzgResult<Page<DistributionCenterShopVO>> activates(@RequestParam(required = false, defaultValue = "1") Integer page, @RequestParam(required = false, defaultValue = "10") Integer size) {
|
||||
return CzgResult.success(distributionUserService.activates(StpKit.USER.getLoginIdAsLong(), page, size));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销员中心-未开通的店铺
|
||||
*/
|
||||
@GetMapping("/centerUser/unActivates")
|
||||
public CzgResult<Page<DistributionCenterShopVO>> unActivates(@RequestParam(required = false, defaultValue = "1") Integer page, @RequestParam(required = false, defaultValue = "10") Integer size) {
|
||||
return CzgResult.success(distributionUserService.unActivates(StpKit.USER.getLoginIdAsLong(), page, size));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销员中心-配置信息
|
||||
*/
|
||||
@GetMapping("/centerConfig")
|
||||
public CzgResult<Map<String, Object>> centerConfig(@RequestParam Long shopId) {
|
||||
return CzgResult.success(distributionUserService.centerConfig(StpKit.USER.getLoginIdAsLong(), shopId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销员中心-获取邀请码
|
||||
*/
|
||||
@GetMapping("/getInviteCode")
|
||||
public CzgResult<String> getInviteCode(@RequestParam Long shopId, @RequestParam Long shopUserId) {
|
||||
return CzgResult.success(distributionUserService.getInviteCode(shopId, shopUserId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销员中心-实名认证
|
||||
*/
|
||||
@PostMapping("/realNameAuth")
|
||||
public CzgResult<Map<String, Object>> realNameAuth(@RequestBody UserInfo userInfo) {
|
||||
AssertUtil.isNull(userInfo.getId(), "用户Id不能为空");
|
||||
AssertUtil.isNull(userInfo.getRealName(), "用户实名不能为空");
|
||||
AssertUtil.isNull(userInfo.getIdCard(), "用户身份信息不能为空");
|
||||
distributionUserService.realNameAuth(userInfo);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销员中心-绑定邀请人
|
||||
*/
|
||||
@PostMapping("/bindInviteUser")
|
||||
public CzgResult<Map<String, Object>> bindInviteUser(@RequestBody MkDistributionUserDTO param) {
|
||||
AssertUtil.isNull(param.getId(), "店铺用户ID不能为空");
|
||||
AssertUtil.isNull(param.getShopId(), "店铺ID不能为空");
|
||||
AssertUtil.isNull(param.getInviteCode(), "邀请码不能为空");
|
||||
distributionUserService.bindInviteUser(param);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销员:获取邀请人分页列表
|
||||
*/
|
||||
@GetMapping("/inviteUser")
|
||||
public CzgResult<Page<InviteUserVO>> getInviteUser(
|
||||
@RequestParam Long id,
|
||||
@RequestParam Long shopId,
|
||||
@RequestParam(required = false, defaultValue = "1") Integer page,
|
||||
@RequestParam(required = false, defaultValue = "10") Integer size) {
|
||||
AssertUtil.isNull(id, "邀请人ID");
|
||||
return CzgResult.success(distributionUserService.getInviteUser(id, shopId, null, null, page, size));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户提现
|
||||
*
|
||||
* @param withdrawFlowDTO 提现信息
|
||||
* @return 是否成功
|
||||
*/
|
||||
@PostMapping("/withdraw")
|
||||
public CzgResult<Boolean> withdraw(@Validated @RequestBody MkDistributionWithdrawFlowDTO withdrawFlowDTO) {
|
||||
return CzgResult.success(distributionUserService.withdraw(StpKit.USER.getLoginIdAsLong(), withdrawFlowDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 提现详情
|
||||
*/
|
||||
@GetMapping("/withdraw/detail")
|
||||
public CzgResult<Map<String, Object>> withdraw(@RequestParam Long id) {
|
||||
return CzgResult.success(distributionUserService.withdrawDetail(StpKit.USER.getLoginIdAsLong(), id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 提现记录
|
||||
*/
|
||||
@GetMapping("/withdraw/flow")
|
||||
public CzgResult<Page<MkDistributionWithdrawFlow>> withArdwFlow() {
|
||||
return CzgResult.success(withdrawFlowService.pageInfo(StpKit.USER.getLoginIdAsLong()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 收益明细
|
||||
*
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @param shopId
|
||||
* @param status pending待入账 success已入账
|
||||
*/
|
||||
@GetMapping("/distributionFlow")
|
||||
public CzgResult<Map<String, Object>> distributionFlow(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime,
|
||||
@RequestParam(required = false) Long shopId, @RequestParam(required = false) String status) {
|
||||
return CzgResult.success(distributionFlowService.distributionFlow(StpKit.USER.getLoginIdAsLong(), startTime, endTime, shopId, status));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.czg.controller.user;
|
||||
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.market.dto.MkDrainageConfigDTO;
|
||||
import com.czg.market.service.MkDrainageConfigService;
|
||||
import com.czg.market.vo.MkDrainageConfigVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 私域引流配置
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user/drainageConfig")
|
||||
public class UDrainageConfigController {
|
||||
|
||||
@Resource
|
||||
private MkDrainageConfigService service;
|
||||
|
||||
/**
|
||||
* 配置信息获取
|
||||
* 权限标识: activate:list
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<MkDrainageConfigVO> detail(@RequestParam Long shopId) {
|
||||
return CzgResult.success(service.detail(shopId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.czg.controller.user;
|
||||
|
||||
import com.czg.market.entity.MkLimitTimeDiscount;
|
||||
import com.czg.market.service.MkLimitTimeDiscountService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 限时折扣
|
||||
*
|
||||
* @author ww
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/user/limitTimeDiscount")
|
||||
public class ULimitTimeDiscountController {
|
||||
@Resource
|
||||
private MkLimitTimeDiscountService limitTimeDiscountService;
|
||||
|
||||
/**
|
||||
* 获取限时折扣
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<MkLimitTimeDiscount> getActivity(@RequestParam Long shopId) {
|
||||
MkLimitTimeDiscount data = limitTimeDiscountService.getLimitTimeDiscountByShopId(shopId);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package com.czg.controller.user;
|
||||
|
||||
import com.czg.market.service.TbMemberConfigService;
|
||||
import com.czg.market.vo.MemberDetailVO;
|
||||
import com.czg.market.vo.MemberListVO;
|
||||
import com.czg.market.vo.UMemberConfigVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员相关
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user/member")
|
||||
public class UMemberController {
|
||||
@Resource
|
||||
private TbMemberConfigService memberConfigService;
|
||||
|
||||
/**
|
||||
* 获取当前店铺会员开通配置信息
|
||||
* @param shopId 店铺id
|
||||
*/
|
||||
@GetMapping("/config")
|
||||
public CzgResult<UMemberConfigVO> getConfig(@RequestParam Long shopId) {
|
||||
return CzgResult.success(memberConfigService.detail(shopId, StpKit.USER.getLoginIdAsLong()));
|
||||
}
|
||||
/**
|
||||
* 获取所有已开通的会员
|
||||
* @return 列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public CzgResult<List<MemberListVO>> getMemberList() {
|
||||
return CzgResult.success(memberConfigService.getMemberList(StpKit.USER.getLoginIdAsLong()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会员信息详情
|
||||
* @param shopId 店铺id
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
public CzgResult<MemberDetailVO> getDetail(@RequestParam Long shopId) {
|
||||
return CzgResult.success(memberConfigService.getUserDetail(StpKit.USER.getLoginIdAsLong(), shopId));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.czg.controller.user;
|
||||
|
||||
import com.czg.market.service.MkProductSmartSuggestService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 点单智能推荐
|
||||
*
|
||||
* @author ww
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/user/suggest")
|
||||
public class UProductSmartSuggestController {
|
||||
@Resource
|
||||
private MkProductSmartSuggestService suggestService;
|
||||
|
||||
/**
|
||||
* 获取点单智能推荐
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<Map<String, Object>> getActivity(@RequestParam Long shopId) {
|
||||
Map<String, Object> map = suggestService.getProductSmartSuggestByShopId(shopId);
|
||||
return CzgResult.success(map);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package com.czg.controller.user;
|
||||
|
||||
import com.czg.market.service.MkShopRechargeService;
|
||||
import com.czg.market.vo.MkShopRechargeShopListVO;
|
||||
import com.czg.market.vo.MkShopRechargeVO;
|
||||
import com.czg.market.vo.RechargeListVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 充值相关
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user/recharge")
|
||||
public class URechargeController {
|
||||
@Resource
|
||||
private MkShopRechargeService shopRechargeService;
|
||||
|
||||
/**
|
||||
* 获取充值配置
|
||||
* @param shopId 店铺id
|
||||
*/
|
||||
@GetMapping("/config")
|
||||
public CzgResult<MkShopRechargeVO> getConfig(@RequestParam Long shopId) {
|
||||
return CzgResult.success(shopRechargeService.detail(shopId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 可用店铺列表
|
||||
* @param shopId 店铺id
|
||||
*/
|
||||
@GetMapping("/config/shopList")
|
||||
public CzgResult<List<MkShopRechargeShopListVO>> shopList(@RequestParam Long shopId, @RequestParam(required = false) String shopName) {
|
||||
return CzgResult.success(shopRechargeService.shopList(shopId, shopName));
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public CzgResult<List<RechargeListVO>> getList() {
|
||||
return CzgResult.success(shopRechargeService.getList(StpKit.USER.getLoginIdAsLong()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package com.czg.controller.user;
|
||||
|
||||
import com.czg.market.dto.MkRedemptionDTO;
|
||||
import com.czg.market.service.MkRedemptionConfigService;
|
||||
import com.czg.market.vo.URedemptionVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* 兑换码相关
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user/redemption")
|
||||
public class URedemptionController {
|
||||
@Resource
|
||||
private MkRedemptionConfigService redemptionConfigService;
|
||||
|
||||
/**
|
||||
* 使用券码
|
||||
*/
|
||||
@PostMapping("/exchange")
|
||||
public CzgResult<Boolean> exchange(@Validated @RequestBody MkRedemptionDTO dto) {
|
||||
redemptionConfigService.exchange(StpKit.USER.getLoginIdAsLong(), dto);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 兑换码详细信息
|
||||
* @param code 兑换码
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<URedemptionVO> get(@RequestParam String code) {
|
||||
return CzgResult.success(redemptionConfigService.getInfo(code));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.czg.controller.user;
|
||||
|
||||
import com.czg.account.dto.shopuser.ShopUserAddDTO;
|
||||
import com.czg.account.dto.shopuser.ShopUserDetailDTO;
|
||||
import com.czg.account.dto.shopuser.ShopUserVipCardDTO;
|
||||
import com.czg.account.entity.MemberPointsLog;
|
||||
import com.czg.account.entity.ShopUser;
|
||||
import com.czg.account.entity.ShopUserFlow;
|
||||
import com.czg.account.service.MemberPointsLogService;
|
||||
import com.czg.account.service.PointsExchangeRecordService;
|
||||
import com.czg.account.service.ShopUserFlowService;
|
||||
import com.czg.account.service.ShopUserService;
|
||||
import com.czg.annotation.Debounce;
|
||||
import com.czg.market.entity.MkShopConsumeDiscountRecord;
|
||||
import com.czg.market.service.MkShopConsumeDiscountRecordService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.utils.PageUtil;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 新客立减相关
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user/consumeDiscount")
|
||||
public class UShopConsumeDiscountController {
|
||||
@Resource
|
||||
private MkShopConsumeDiscountRecordService shopConsumeDiscountRecordService;
|
||||
|
||||
/**
|
||||
* 获取新客立减金额
|
||||
* 返回新客立减当次减免金额
|
||||
* @param shopId 店铺id
|
||||
* @return 金额
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<MkShopConsumeDiscountRecord> get(@RequestParam Long shopId, @RequestParam(required = false) Long orderId) {
|
||||
// shopConsumeDiscountRecordService.useDiscount(null, null,null,null);
|
||||
return CzgResult.success(shopConsumeDiscountRecordService.getDiscount(shopId, StpKit.USER.getLoginIdAsLong(), orderId));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
package com.czg.controller.user;
|
||||
|
||||
import com.czg.account.vo.ShopInfoCouponVO;
|
||||
import com.czg.account.vo.UserCouponVo;
|
||||
import com.czg.market.entity.ShopCoupon;
|
||||
import com.czg.market.service.ShopCouponService;
|
||||
import com.czg.market.vo.ShopCouponPopUp;
|
||||
import com.czg.market.vo.UserCouponVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user/coupon")
|
||||
public class UShopCouponController {
|
||||
@Resource
|
||||
private ShopCouponService couponService;
|
||||
|
||||
/**
|
||||
* 优惠券弹窗
|
||||
*
|
||||
* @param getMode 首页home/用餐eat/订单order
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/popUp")
|
||||
public CzgResult<List<ShopCouponPopUp>> getPopUp(String getMode) {
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
return CzgResult.success(couponService.getPopUp(shopId, StpKit.USER.getLoginIdAsLong(), getMode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 优惠券弹窗领取
|
||||
*
|
||||
* @param getMode 首页home/用餐eat/订单order
|
||||
*/
|
||||
@GetMapping("/receivePopUp")
|
||||
public CzgResult<Void> receivePopUp(String getMode) {
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
couponService.receivePopUp(shopId, StpKit.USER.getLoginIdAsLong(), getMode);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前店铺会员信息
|
||||
* 请求头必须携带shopId, 不携带则会失败
|
||||
*
|
||||
* @return 店铺会员信息
|
||||
*/
|
||||
@GetMapping("/shops")
|
||||
public CzgResult<List<ShopInfoCouponVO>> shops() {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
return CzgResult.success(couponService.getShopByCouponRecord(shopId == 0L ? null : shopId, StpKit.USER.getLoginIdAsLong()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过用户Id 查找优惠券
|
||||
*
|
||||
* @param status 0 未使用 1已使用 2已过期
|
||||
*/
|
||||
@GetMapping("/findByUserId")
|
||||
public CzgResult<Page<UserCouponVO>> findByUserId(
|
||||
@RequestParam(required = false) Integer status,
|
||||
@RequestParam(required = false) String name,
|
||||
@RequestParam(required = false) Long shopId) {
|
||||
return CzgResult.success(couponService.find(StpKit.USER.getLoginIdAsLong(), name, shopId, status));
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成订单后使用
|
||||
* 通过用户Id 查找优惠券
|
||||
*
|
||||
* @param shopUserId 店铺用户Id
|
||||
*/
|
||||
@GetMapping("/findCoupon")
|
||||
public CzgResult<List<UserCouponVo>> findCoupon(@RequestHeader String shopId, @RequestParam Long shopUserId,
|
||||
@RequestParam(required = false) Integer type, @RequestParam(required = false) Integer isFood) {
|
||||
AssertUtil.isBlank(shopId, "店铺Id不能为空");
|
||||
return CzgResult.success(couponService.findCoupon(Long.parseLong(shopId), shopUserId, type, isFood));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
package com.czg.task;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* market服务 任务总调度
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
@Component
|
||||
public class AAMarketTasks {
|
||||
//生日有礼奖励发放
|
||||
@Resource
|
||||
private BirthdayGiftTask birthdayGiftTask;
|
||||
@Resource
|
||||
private DistributionTask distributionTask;
|
||||
|
||||
|
||||
// 分销延时发放
|
||||
@Scheduled(fixedRate = 30000)
|
||||
public void distributionTask() {
|
||||
distributionTask.deliver();
|
||||
}
|
||||
|
||||
|
||||
//每天0时0分0秒 执行
|
||||
@Scheduled(cron = "0 0 8 * * ?")
|
||||
public void birthdayGiftTask() {
|
||||
birthdayGiftTask.deliver();
|
||||
}
|
||||
//会员生日弹窗提醒重置 每年1月1日
|
||||
@Scheduled(cron = "0 0 0 1 1 ?")
|
||||
public void birthdayGiftRemindTask() {
|
||||
birthdayGiftTask.remind();
|
||||
}
|
||||
|
||||
|
||||
//优惠券 过期
|
||||
@Resource
|
||||
private CouponTask couponTask;
|
||||
//每天每小时的30分 0秒 执行
|
||||
@Scheduled(cron = "0 30 * * * ? ")
|
||||
public void couponTask() {
|
||||
couponTask.task();
|
||||
}
|
||||
|
||||
//会员奖励发放
|
||||
@Resource
|
||||
private MemberTask memberTask;
|
||||
//每天1点 0分 0秒 执行
|
||||
@Scheduled(cron = "0 0 1 * * ? ")
|
||||
public void memberTask() {
|
||||
memberTask.task();
|
||||
}
|
||||
|
||||
//满减活动/限时折扣 处理任务状态 定时任务
|
||||
@Resource
|
||||
private ActivityStatusTask activityStatusTask;
|
||||
//每天0点 0分 1秒 执行
|
||||
@Scheduled(cron = "1 0 0 * * ? ")
|
||||
public void activityStatusTask() {
|
||||
activityStatusTask.task();
|
||||
}
|
||||
|
||||
|
||||
//月累计 发送条数 累计金额
|
||||
@Resource
|
||||
private SmsShopMoneyTask smsShopMoneyTask;
|
||||
//每月1号 0点 0分 1秒 执行
|
||||
@Scheduled(cron = "1 0 0 1 * ?")
|
||||
public void smsShopMoneyTask() {
|
||||
smsShopMoneyTask.task();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.czg.task;
|
||||
|
||||
import com.czg.market.entity.MkDiscountActivity;
|
||||
import com.czg.market.entity.MkLimitTimeDiscount;
|
||||
import com.czg.market.service.MkDiscountActivityService;
|
||||
import com.czg.market.service.MkLimitTimeDiscountService;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 满减活动定时任务
|
||||
*
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ActivityStatusTask {
|
||||
@Resource
|
||||
private MkDiscountActivityService discountActivityService;
|
||||
@Resource
|
||||
private MkLimitTimeDiscountService limitTimeDiscountService;
|
||||
|
||||
/**
|
||||
* 满减活动/限时折扣 任务状态更新任务
|
||||
*/
|
||||
public void task() {
|
||||
//满减活动
|
||||
discountActivityService.update(new MkDiscountActivity().setStatus(2),
|
||||
new QueryWrapper()
|
||||
.eq(MkDiscountActivity::getStatus, 1)
|
||||
.le(MkDiscountActivity::getValidStartTime, LocalDateTime.now())
|
||||
.gt(MkDiscountActivity::getValidEndTime, LocalDateTime.now())
|
||||
);
|
||||
discountActivityService.update(new MkDiscountActivity().setStatus(3),
|
||||
new QueryWrapper().le(MkDiscountActivity::getValidEndTime, LocalDateTime.now())
|
||||
);
|
||||
|
||||
//限时折扣
|
||||
limitTimeDiscountService.update(new MkLimitTimeDiscount().setStatus(2),
|
||||
new QueryWrapper()
|
||||
.eq(MkLimitTimeDiscount::getStatus, 1)
|
||||
.le(MkLimitTimeDiscount::getValidStartTime, LocalDateTime.now())
|
||||
.gt(MkLimitTimeDiscount::getValidEndTime, LocalDateTime.now())
|
||||
);
|
||||
|
||||
limitTimeDiscountService.update(new MkLimitTimeDiscount().setStatus(3),
|
||||
new QueryWrapper().le(MkLimitTimeDiscount::getValidEndTime, LocalDateTime.now())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.czg.task;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.czg.account.entity.ShopUser;
|
||||
import com.czg.account.service.ShopUserService;
|
||||
import com.czg.constant.TableValueConstant;
|
||||
import com.czg.market.service.MkBirthdayGiftService;
|
||||
import com.czg.market.service.TbMemberConfigService;
|
||||
import com.czg.order.service.OrderInfoService;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生日有礼奖励发放
|
||||
*
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class BirthdayGiftTask {
|
||||
@Resource
|
||||
private MkBirthdayGiftService birthdayGiftService;
|
||||
@DubboReference
|
||||
private ShopUserService shopUserService;
|
||||
|
||||
/**
|
||||
* 生日有礼奖励发放
|
||||
* AAMarketTasks 统一调用位置
|
||||
*/
|
||||
// @Scheduled(cron = "0 0 0 * * ?")
|
||||
public void deliver() {
|
||||
birthdayGiftService.deliver();
|
||||
}
|
||||
|
||||
public void remind() {
|
||||
shopUserService.update(new ShopUser().setBirthDayRemind(0), new QueryWrapper()
|
||||
.isNotNull(ShopUser::getBirthDay).eq(ShopUser::getBirthDayRemind, 1));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.czg.task;
|
||||
|
||||
import com.czg.config.RedisCst;
|
||||
import com.czg.market.entity.MkShopCouponRecord;
|
||||
import com.czg.market.service.MkShopCouponRecordService;
|
||||
import com.czg.service.RedisService;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单定时任务
|
||||
*
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class CouponTask {
|
||||
@Resource
|
||||
private MkShopCouponRecordService mkShopCouponRecordService;
|
||||
@Resource
|
||||
private RedisService redisService;
|
||||
|
||||
/**
|
||||
* 优惠券 过期
|
||||
*/
|
||||
// @Scheduled(cron = "0 30 * * * ? ")
|
||||
public void task() {
|
||||
try {
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
mkShopCouponRecordService.update(new MkShopCouponRecord().setStatus(2), new QueryWrapper()
|
||||
.eq(MkShopCouponRecord::getStatus, 0)
|
||||
.le(MkShopCouponRecord::getUseEndTime, now)
|
||||
);
|
||||
// 计算当前时间加一小时
|
||||
LocalDateTime oneHourLater = now.plusHours(1);
|
||||
List<MkShopCouponRecord> list = mkShopCouponRecordService.list(new QueryWrapper()
|
||||
.eq(MkShopCouponRecord::getStatus, 0)
|
||||
.le(MkShopCouponRecord::getUseEndTime, oneHourLater)
|
||||
);
|
||||
for (MkShopCouponRecord mkShopCouponRecord : list) {
|
||||
LocalDateTime endTime = mkShopCouponRecord.getUseEndTime();
|
||||
if (endTime != null) {
|
||||
Duration duration = Duration.between(now, endTime);
|
||||
long seconds = duration.getSeconds();
|
||||
redisService.set(RedisCst.classKeyExpired.EXPIRED_COUPON + mkShopCouponRecord.getId(), mkShopCouponRecord.getId(), seconds);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("优惠券 过期 任务 异常", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
package com.czg.task;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import com.czg.account.entity.ShopInfo;
|
||||
import com.czg.account.entity.ShopUser;
|
||||
import com.czg.account.service.ShopInfoService;
|
||||
import com.czg.account.service.ShopUserService;
|
||||
import com.czg.constant.TableValueConstant;
|
||||
import com.czg.market.entity.MkDistributionDeliver;
|
||||
import com.czg.market.entity.MkDistributionFlow;
|
||||
import com.czg.market.service.MkBirthdayGiftService;
|
||||
import com.czg.market.service.MkDistributionDeliverService;
|
||||
import com.czg.market.service.MkDistributionFlowService;
|
||||
import com.czg.market.service.MkDistributionUserService;
|
||||
import com.czg.order.entity.OrderInfo;
|
||||
import com.czg.order.service.OrderInfoService;
|
||||
import com.czg.service.market.enums.OrderStatusEnums;
|
||||
import com.czg.utils.FunUtils;
|
||||
import com.itextpdf.styledxmlparser.jsoup.helper.DataUtil;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 分销定时任务
|
||||
*
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DistributionTask {
|
||||
@Resource
|
||||
private MkDistributionDeliverService distributionDeliverService;
|
||||
@Resource
|
||||
private MkDistributionUserService distributionUserService;
|
||||
@Resource
|
||||
private MkDistributionFlowService distributionFlowService;
|
||||
|
||||
@DubboReference
|
||||
private OrderInfoService orderInfoService;
|
||||
@DubboReference
|
||||
private ShopInfoService shopInfoService;
|
||||
@DubboReference
|
||||
private ShopUserService shopUserService;
|
||||
|
||||
/**
|
||||
* 生日有礼奖励发放
|
||||
* AAMarketTasks 统一调用位置
|
||||
*/
|
||||
// @Scheduled(cron = "0 0 0 * * ?")
|
||||
@Scheduled(fixedRate = 30000)
|
||||
public void deliver() {
|
||||
LocalDateTime localDateTime = DateUtil.date().toLocalDateTime();
|
||||
distributionFlowService.list(new QueryWrapper()
|
||||
.eq(MkDistributionFlow::getStatus, TableValueConstant.DistributionFlow.Status.PENDING.getCode())).forEach(item -> {
|
||||
if (item.getDeliverTime() != null && item.getDeliverTime().isAfter(localDateTime)) {
|
||||
return;
|
||||
}
|
||||
FunUtils.safeRunVoid(() -> {
|
||||
log.info("开始处理延时分账, id: {}, orderNo: {}, 类型: {}", item.getId(), item.getOrderNo(), item.getType());
|
||||
|
||||
OrderInfo orderInfo = orderInfoService.getOne(new QueryWrapper().eq(OrderInfo::getOrderNo, item.getOrderNo()));
|
||||
if (orderInfo == null) {
|
||||
log.warn("订单不存在, 订单号: {}", item.getOrderNo());
|
||||
return;
|
||||
}
|
||||
if (CollUtil.newArrayList(OrderStatusEnums.REFUND.getCode(), OrderStatusEnums.REFUNDING.getCode(), OrderStatusEnums.PART_REFUND.getCode()).contains(orderInfo.getStatus())) {
|
||||
log.warn("订单已退款, 订单号: {}", item.getOrderNo());
|
||||
item.setStatus(TableValueConstant.DistributionFlow.Status.REFUND.getCode());
|
||||
} else {
|
||||
item.setStatus(TableValueConstant.DistributionFlow.Status.SUCCESS.getCode());
|
||||
ShopUser shopUser = shopUserService.getById(item.getDistributionUserId());
|
||||
distributionUserService.updateShopInfoAmount(orderInfo.getShopId(), item.getRewardAmount().negate(), orderInfo.getId(), TableValueConstant.DistributionAmountFlow.Type.SUB, "分销扣减");
|
||||
distributionUserService.updateIncome(item.getRewardAmount().negate(), item.getRewardAmount(), BigDecimal.ZERO,
|
||||
item.getDistributionUserId(), shopUser.getUserId(), item.getShopUserId(), item.getShopId(), item.getLevel());
|
||||
}
|
||||
distributionFlowService.updateById(item);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.czg.task;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.czg.account.entity.ShopUser;
|
||||
import com.czg.account.service.ShopUserService;
|
||||
import com.czg.constant.TableValueConstant;
|
||||
import com.czg.market.service.TbMemberConfigService;
|
||||
import com.czg.order.entity.OrderInfo;
|
||||
import com.czg.order.service.OrderInfoService;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员奖励发放
|
||||
*
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class MemberTask {
|
||||
@Resource
|
||||
private OrderInfoService orderInfoService;
|
||||
@DubboReference
|
||||
private ShopUserService shopUserService;
|
||||
|
||||
@Resource
|
||||
private TbMemberConfigService memberConfigService;
|
||||
|
||||
/**
|
||||
* 奖励发放
|
||||
*/
|
||||
// @Scheduled(cron = "0 0 1 * * ? ")
|
||||
public void task() {
|
||||
shopUserService.list(new QueryWrapper().eq(ShopUser::getIsVip, 1).lt(ShopUser::getNextDeliverTime, DateUtil.date().toLocalDateTime())).forEach(item -> {
|
||||
memberConfigService.deliver(item.getSourceShopId(), item.getUserId(), TableValueConstant.MemberExpFlow.Type.MEMBER_TASK, null, null, null);
|
||||
});
|
||||
}
|
||||
|
||||
public void check() {
|
||||
List<ShopUser> shopUsers = shopUserService.list(new QueryWrapper().isNotNull(ShopUser::getEndTime).eq(ShopUser::getIsVip, 1).lt(ShopUser::getEndTime, DateUtil.date()));
|
||||
shopUsers.forEach(item -> {
|
||||
item.setIsVip(0);
|
||||
});
|
||||
|
||||
shopUserService.updateBatch(shopUsers);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.czg.task;
|
||||
|
||||
import com.czg.market.entity.SmsShopMoney;
|
||||
import com.czg.service.market.mapper.SmsShopMoneyMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class SmsShopMoneyTask {
|
||||
|
||||
@Resource
|
||||
private SmsShopMoneyMapper shopMoneyMapper;
|
||||
|
||||
public void task() {
|
||||
SmsShopMoney smsShopMoney = new SmsShopMoney();
|
||||
smsShopMoney.setMonthAmountTotal(BigDecimal.ZERO);
|
||||
smsShopMoney.setMonthSendTotal(0L);
|
||||
shopMoneyMapper.updateByMap(smsShopMoney, true, new HashMap<>());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
traceConsumerFilter=com.czg.config.TraceConsumerFilter
|
||||
traceProviderFilter=com.czg.config.TraceProviderFilter
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://192.168.1.42:3306/czg_cashier?useUnicode=true&characterEncoding=utf-8
|
||||
username: root
|
||||
password: Chaozg123.
|
||||
|
||||
data:
|
||||
redis:
|
||||
host: 192.168.1.42
|
||||
port: 6379
|
||||
password: Chaozg123.
|
||||
timeout: 1000
|
||||
database: 0
|
||||
lettuce:
|
||||
pool:
|
||||
min-idle: 0
|
||||
max-idle: 8
|
||||
max-wait: -1ms
|
||||
max-active: 16
|
||||
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 121.40.109.122:8848
|
||||
namespace: 237e1905-0a66-4375-9bb6-a51c3c034aca
|
||||
|
||||
rabbitmq:
|
||||
host: 121.40.109.122
|
||||
port: 5672
|
||||
username: chaozg
|
||||
password: chaozg123
|
||||
|
||||
dubbo:
|
||||
application:
|
||||
name: product-server
|
||||
qos-port: 22261
|
||||
qos-enable: true
|
||||
registry:
|
||||
address: nacos://121.40.109.122:8848 # Nacos 服务地址
|
||||
group: server-dev
|
||||
protocol:
|
||||
port: 10601
|
||||
threads: 20
|
||||
name: dubbo
|
||||
serialization: hessian2
|
||||
|
||||
seata:
|
||||
application-id: market-server
|
||||
tx-service-group: group_seata
|
||||
config:
|
||||
type: nacos
|
||||
nacos:
|
||||
server-addr: 121.40.109.122:8848
|
||||
namespace:
|
||||
group: group_seata
|
||||
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://rm-bp1b572nblln4jho2.mysql.rds.aliyuncs.com:3306/czg_cashier?useUnicode=true&characterEncoding=utf-8
|
||||
username: root
|
||||
password: Czg666888
|
||||
|
||||
data:
|
||||
redis:
|
||||
host: 121.40.109.122
|
||||
port: 6379
|
||||
password: chaozg123
|
||||
timeout: 1000
|
||||
database: 3
|
||||
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 121.40.109.122:8848
|
||||
namespace: 237e1905-0a66-4375-9bb6-a51c3c034aca
|
||||
rabbitmq:
|
||||
host: 121.40.109.122
|
||||
port: 5672
|
||||
username: chaozg
|
||||
password: chaozg123
|
||||
|
||||
dubbo:
|
||||
application:
|
||||
name: product-server
|
||||
qos-port: 22263
|
||||
qos-enable: true
|
||||
registry:
|
||||
address: nacos://121.40.109.122:8848 # Nacos 服务地址
|
||||
group: server-prod
|
||||
protocol:
|
||||
port: 10603
|
||||
threads: 20
|
||||
name: dubbo
|
||||
serialization: hessian2
|
||||
|
||||
seata:
|
||||
application-id: market-server
|
||||
tx-service-group: group_seata
|
||||
config:
|
||||
type: nacos
|
||||
nacos:
|
||||
server-addr: 121.40.109.122:8848
|
||||
namespace:
|
||||
group: group_seata
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://rm-bp1kn7h89nz62cno1ro.mysql.rds.aliyuncs.com:3306/czg_cashier?useUnicode=true&characterEncoding=utf-8
|
||||
username: cashier
|
||||
password: Cashier@1@
|
||||
|
||||
data:
|
||||
redis:
|
||||
host: 121.40.109.122
|
||||
port: 6379
|
||||
password: chaozg123
|
||||
timeout: 1000
|
||||
database: 2
|
||||
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 121.40.109.122:8848
|
||||
namespace: 237e1905-0a66-4375-9bb6-a51c3c034aca
|
||||
rabbitmq:
|
||||
host: 121.40.109.122
|
||||
port: 5672
|
||||
username: chaozg
|
||||
password: chaozg123
|
||||
|
||||
dubbo:
|
||||
application:
|
||||
name: product-server
|
||||
qos-port: 22262
|
||||
qos-enable: true
|
||||
registry:
|
||||
address: nacos://121.40.109.122:8848 # Nacos 服务地址
|
||||
group: server-test
|
||||
protocol:
|
||||
port: 10602
|
||||
threads: 20
|
||||
name: dubbo
|
||||
serialization: hessian2
|
||||
|
||||
seata:
|
||||
application-id: market-server
|
||||
tx-service-group: group_seata
|
||||
config:
|
||||
type: nacos
|
||||
nacos:
|
||||
server-addr: 121.40.109.122:8848
|
||||
namespace:
|
||||
group: group_seata
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
server:
|
||||
port: 9500
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: market
|
||||
profiles:
|
||||
active: dev
|
||||
include: tools
|
||||
wx:
|
||||
ysk:
|
||||
appId: wx212769170d2c6b2a
|
||||
secrete: 8492a7e8d55bbb1b57f5c8276ea1add0
|
||||
operationMsgTmpId: wFdoUG-dUT7bDRHq8bMJD9CF5TjyH9x_uJQgQByZqHg
|
||||
warnMsgTmpId: C08OUr80x6wGmUN1zpFhSQ3Sv7VF5vksdZigiEx2pD0
|
||||
|
||||
|
||||
|
||||
logging:
|
||||
config: classpath:logback.xml
|
||||
|
||||
# MyBatis-Flex
|
||||
mybatis-flex:
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
||||
cache-enabled: false
|
||||
call-setters-on-nulls: true
|
||||
jdbc-type-for-null: 'null'
|
||||
pagehelper:
|
||||
helper-dialect: mysql
|
||||
support-methods-arguments: true
|
||||
|
||||
dubbo:
|
||||
provider:
|
||||
filter: traceProviderFilter
|
||||
consumer:
|
||||
filter: traceConsumerFilter
|
||||
check: false
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="30 seconds" debug="false">
|
||||
<contextName>market-server</contextName>
|
||||
<property name="log.charset" value="utf-8" />
|
||||
<property name="log.pattern"
|
||||
value="%yellow(%d{yyyy-MM-dd HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) [traceId=%X{traceId:-}] - %msg%n" />
|
||||
<!--写入文件格式-->
|
||||
<property name="p_file" value="%d |[traceId=%X{traceId:-}] | [%thread] %-5level %c [%L] - %msg %n "/>
|
||||
<!--输出到控制台-->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>${log.charset}</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
<!--按天生成日志-->
|
||||
<appender name="logFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>logs/market/logback.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--生成日志文件名称-->
|
||||
<fileNamePattern>logs/product/history/%d{yyyy-MM-dd}/logback.%i.log.gz</fileNamePattern>
|
||||
<!--日志文件保留天数-->
|
||||
<MaxHistory>30</MaxHistory>
|
||||
<maxFileSize>20MB</maxFileSize>
|
||||
</rollingPolicy>
|
||||
<!-- 日志输出格式 -->
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<pattern>${p_file}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!--普通日志输出到控制台-->
|
||||
<root level="info">
|
||||
<appender-ref ref="console" />
|
||||
<appender-ref ref="logFile"/>
|
||||
</root>
|
||||
</configuration>
|
||||
|
|
@ -1,7 +1,12 @@
|
|||
package com.czg.config;
|
||||
|
||||
import com.czg.account.service.ShopTableService;
|
||||
import com.czg.market.entity.MkShopCouponRecord;
|
||||
import com.czg.market.service.AcPushEventService;
|
||||
import com.czg.market.service.MkShopCouponRecordService;
|
||||
import com.czg.market.service.SmsPushEventService;
|
||||
import com.czg.order.service.OrderInfoService;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
|
|
@ -26,9 +31,15 @@ public class RedisKeyExpirationListener implements MessageListener {
|
|||
@Value("${spring.data.redis.database}")
|
||||
private String database;
|
||||
@Resource
|
||||
private OrderInfoService tbOrderInfoService;
|
||||
private OrderInfoService orderInfoService;
|
||||
@DubboReference
|
||||
private ShopTableService tableService;
|
||||
@Resource
|
||||
private MkShopCouponRecordService mkShopCouponRecordService;
|
||||
@Resource
|
||||
private SmsPushEventService smsPushEventService;
|
||||
@Resource
|
||||
private AcPushEventService acPushEventService;
|
||||
|
||||
|
||||
//redis key失效监听
|
||||
|
|
@ -49,11 +60,26 @@ public class RedisKeyExpirationListener implements MessageListener {
|
|||
if (expiredKey.startsWith(RedisCst.classKeyExpired.EXPIRED_ORDER)) {
|
||||
log.info("监听到订单过期,订单Id: {}", expiredKey);
|
||||
String orderId = expiredKey.substring(RedisCst.classKeyExpired.EXPIRED_ORDER.length());
|
||||
tbOrderInfoService.expired(Long.parseLong(orderId));
|
||||
}else if (expiredKey.startsWith(RedisCst.classKeyExpired.EXPIRED_TABLE)) {
|
||||
orderInfoService.expired(Long.parseLong(orderId));
|
||||
} else if (expiredKey.startsWith(RedisCst.classKeyExpired.EXPIRED_TABLE)) {
|
||||
log.info("监听到台桌清台过期,台桌Id: {}", expiredKey);
|
||||
String tableId = expiredKey.substring(RedisCst.classKeyExpired.EXPIRED_TABLE.length());
|
||||
tableService.expiredTable(Long.parseLong(tableId));
|
||||
} else if (expiredKey.startsWith(RedisCst.classKeyExpired.EXPIRED_COUPON)) {
|
||||
log.info("监听到优惠券过期,优惠券Id: {}", expiredKey);
|
||||
String couponId = expiredKey.substring(RedisCst.classKeyExpired.EXPIRED_COUPON.length());
|
||||
mkShopCouponRecordService.update(MkShopCouponRecord.builder().status(2).build(), new QueryWrapper()
|
||||
.eq(MkShopCouponRecord::getStatus, 0)
|
||||
.eq(MkShopCouponRecord::getId, Long.parseLong(couponId))
|
||||
);
|
||||
} else if (expiredKey.startsWith(RedisCst.classKeyExpired.EXPIRED_SMS)) {
|
||||
log.info("监听到短信定时发放优惠券,sms_push_event任务Id: {}", expiredKey);
|
||||
String eventId = expiredKey.substring(RedisCst.classKeyExpired.EXPIRED_SMS.length());
|
||||
smsPushEventService.sendPushEventCoupon(eventId);
|
||||
} else if (expiredKey.startsWith(RedisCst.classKeyExpired.EXPIRED_WECHAT)) {
|
||||
log.info("监听到公众号推送优惠券,ac_push_event任务Id: {}", expiredKey);
|
||||
String eventId = expiredKey.substring(RedisCst.classKeyExpired.EXPIRED_WECHAT.length());
|
||||
acPushEventService.sendPushEventCoupon(eventId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,85 @@
|
|||
package com.czg.controller;
|
||||
|
||||
import com.czg.annotation.Debounce;
|
||||
import com.czg.order.dto.MkDistributionPayDTO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.service.order.service.DistributionPayService;
|
||||
import com.czg.system.service.SysParamsService;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.czg.utils.ServletUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 分销员开通
|
||||
*
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pay/distribution")
|
||||
public class DistributionPayController {
|
||||
@Resource
|
||||
private DistributionPayService payService;
|
||||
@DubboReference
|
||||
private SysParamsService paramsService;
|
||||
|
||||
|
||||
// @PostMapping("/cashPay")
|
||||
// @Debounce(value = "#payParam.checkOrderPay.orderId")
|
||||
// public CzgResult<Object> cashPayOrder(@RequestHeader Long shopId, @Validated @RequestBody MkDistributionPayDTO payParam) {
|
||||
// payParam.setShopId(shopId);
|
||||
// return payService.cashPayOrder(payParam);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 小程序支付
|
||||
* payType 必填 支付方式,aliPay 支付宝,wechatPay 微信
|
||||
* openId 必填
|
||||
*/
|
||||
@PostMapping("/ltPayOrder")
|
||||
@Debounce(value = "#payParam.userId")
|
||||
public CzgResult<Map<String, Object>> ltPayOrder( HttpServletRequest request, @Validated @RequestBody MkDistributionPayDTO payParam) {
|
||||
return payService.ltPayOrder(ServletUtil.getClientIP(request), payParam);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 运营端小程序余额充值
|
||||
* payType 必填 支付方式,aliPay 支付宝,wechatPay 微信
|
||||
*/
|
||||
@PostMapping("/mchRecharge")
|
||||
@Debounce(value = "#payParam.userId")
|
||||
public CzgResult<Map<String, String>> mchRecharge(HttpServletRequest request, @Validated @RequestBody MkDistributionPayDTO payParam) {
|
||||
AssertUtil.isBlank(payParam.getCode(), "微信code不为空");
|
||||
return CzgResult.success(payService.mchRecharge(ServletUtil.getClientIP(request), payParam));
|
||||
}
|
||||
//
|
||||
// /**
|
||||
// * 正扫
|
||||
// */
|
||||
// @PostMapping("/scanPay")
|
||||
// @Debounce(value = "#payParam.checkOrderPay.orderId")
|
||||
// public CzgResult<Map<String, Object>> scanPayOrder(@RequestHeader Long shopId, HttpServletRequest request, @Validated @RequestBody MkDistributionPayDTO payParam) {
|
||||
// payParam.setShopId(shopId);
|
||||
// return payService.scanPayOrder(ServletUtil.getClientIP(request), payParam);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 反扫
|
||||
// * authCode 必填 扫描码
|
||||
// */
|
||||
// @PostMapping("/microPay")
|
||||
// @Debounce(value = "#payParam.checkOrderPay.orderId")
|
||||
// public CzgResult<Map<String, Object>> microPayOrder(@RequestHeader Long shopId, @Validated @RequestBody MkDistributionPayDTO payParam) {
|
||||
// payParam.setShopId(shopId);
|
||||
// return payService.microPayOrder(payParam);
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
@ -1,21 +1,33 @@
|
|||
package com.czg.controller;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.czg.CzgPayUtils;
|
||||
import com.czg.entity.CzgBaseRespParams;
|
||||
import com.czg.market.service.MkDistributionUserService;
|
||||
import com.czg.mq.PrintMqListener;
|
||||
import com.czg.order.entity.OrderPayment;
|
||||
import com.czg.order.service.OrderInfoService;
|
||||
import com.czg.order.service.OrderPaymentService;
|
||||
import com.czg.order.service.ShopTableOrderStatisticService;
|
||||
import com.czg.service.market.service.impl.AppWxServiceImpl;
|
||||
import com.czg.service.market.service.impl.WxServiceImpl;
|
||||
import com.czg.task.StatisticTask;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 回调
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
|
|
@ -31,6 +43,24 @@ public class NotifyController {
|
|||
@Resource
|
||||
private StatisticTask statisticTask;
|
||||
|
||||
@Resource
|
||||
private ShopTableOrderStatisticService shopTableOrderStatisticService;
|
||||
@Resource
|
||||
private AppWxServiceImpl wxService;
|
||||
@Resource
|
||||
private WxServiceImpl wxService2;
|
||||
@Resource
|
||||
private MkDistributionUserService distributionUserService;
|
||||
@Resource
|
||||
private OrderPaymentService paymentService;
|
||||
|
||||
|
||||
@GetMapping("testOpen")
|
||||
public JSONObject test1(String code) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@RequestMapping("/payCallBack")
|
||||
public String notifyCallBack(@RequestBody CzgBaseRespParams respParams) {
|
||||
|
|
@ -41,6 +71,62 @@ public class NotifyController {
|
|||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("/native/wx/transfer")
|
||||
public String nativeTransferNotify(HttpServletRequest request) throws IOException {
|
||||
log.info("接收到微信转账回调");
|
||||
JSONObject jsonObject = wxService.verifySignature(request);
|
||||
log.info("参数信息: {}", jsonObject.toJSONString());
|
||||
String outBillNo = jsonObject.getString("out_bill_no");
|
||||
String state = jsonObject.getString("state");
|
||||
String failReason = jsonObject.getString("fail_reason");
|
||||
try {
|
||||
distributionUserService.withdrawNotify(outBillNo, state, failReason);
|
||||
}catch (Exception e) {
|
||||
log.warn("转账回调失败", e);
|
||||
}
|
||||
return "SUCCESS";
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("/native/wx/pay/distributionRecharge")
|
||||
public String nativeNotify(HttpServletRequest request) throws IOException {
|
||||
String timestamp = request.getHeader("Wechatpay-Timestamp");
|
||||
String nonce = request.getHeader("Wechatpay-Nonce");
|
||||
String serialNo = request.getHeader("Wechatpay-Serial");
|
||||
String signature = request.getHeader("Wechatpay-Signature");
|
||||
String result = IoUtil.readUtf8(request.getInputStream());
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
JSONObject resource = jsonObject.getJSONObject("resource");
|
||||
String associatedData = resource.getString("associated_data");
|
||||
String ciphertext = resource.getString("ciphertext");
|
||||
String nonceStr = resource.getString("nonce");
|
||||
|
||||
String plainText = wxService.decryptToString(associatedData, nonceStr, ciphertext);
|
||||
log.info("充值支付通知明文 {}", plainText);
|
||||
|
||||
JSONObject plainTextJson = JSONObject.parseObject(plainText);
|
||||
String outTradeNo = plainTextJson.getString("out_trade_no");
|
||||
String tradeState = plainTextJson.getString("trade_state");
|
||||
String transactionId = plainTextJson.getString("transaction_id");
|
||||
if ("SUCCESS".equals(tradeState)) {
|
||||
try {
|
||||
OrderPayment payment = paymentService.getOne(new QueryWrapper().eq(OrderPayment::getOrderNo, outTradeNo));
|
||||
payment.setTradeNumber(transactionId);
|
||||
payment.setPayTime(DateUtil.date().toLocalDateTime());
|
||||
payment.setRespJson(plainTextJson.toJSONString());
|
||||
paymentService.updateById(payment);
|
||||
distributionUserService.rechargeCallBack(payment.getShopId(), payment.getAmount(), payment.getId());
|
||||
}catch (Exception e) {
|
||||
log.error("充值回调失败", e);
|
||||
return "SUCCESS";
|
||||
}
|
||||
}
|
||||
|
||||
return "SUCCESS";
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("/refundCallBack")
|
||||
public String refundCallBack(@RequestBody CzgBaseRespParams respParams) {
|
||||
JSONObject czg = CzgPayUtils.getCzg(respParams);
|
||||
|
|
@ -55,7 +141,7 @@ public class NotifyController {
|
|||
|
||||
@RequestMapping("/test")
|
||||
public void test(@RequestParam String id) {
|
||||
printMqListener.orderPrint(id);
|
||||
shopTableOrderStatisticService.statistic(DateUtil.date());
|
||||
}
|
||||
|
||||
@GetMapping("/anew/statistic/history/data")
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import com.czg.utils.AssertUtil;
|
|||
import com.czg.utils.ServletUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.NonNull;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -35,7 +36,7 @@ public class OrderPayController {
|
|||
@Resource
|
||||
private PayService payService;
|
||||
@Resource
|
||||
private OrderInfoService orderService;
|
||||
private OrderInfoService orderInfoService;
|
||||
@DubboReference
|
||||
private SysParamsService paramsService;
|
||||
|
||||
|
|
@ -53,6 +54,18 @@ public class OrderPayController {
|
|||
return payService.cashPayOrder(payParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值并付款
|
||||
* payType 必填 支付方式,aliPay 支付宝,wechatPay 微信
|
||||
* openId 必填
|
||||
*/
|
||||
@PostMapping("/rechargePayOrder")
|
||||
@Debounce(value = "#payParam.checkOrderPay.orderId")
|
||||
public CzgResult<Map<String, Object>> rechargePayOrder(@RequestHeader Long shopId, HttpServletRequest request, @Validated @RequestBody OrderPayParamDTO payParam) {
|
||||
payParam.setShopId(shopId);
|
||||
return payService.rechargePayOrder(ServletUtil.getClientIP(request), payParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员支付
|
||||
* payType 必填
|
||||
|
|
@ -141,7 +154,7 @@ public class OrderPayController {
|
|||
map.put("payAmount", checkOrderPay.getOrderAmount());
|
||||
map.put("extend", StrUtil.isEmpty(extend) ? "" : extend);
|
||||
if (checkOrderPay.getOrderId() != null) {
|
||||
OrderInfo orderInfo = orderService.checkOrderPay(checkOrderPay);
|
||||
OrderInfo orderInfo = orderInfoService.checkOrderPay(checkOrderPay);
|
||||
map.put("payAmount", orderInfo.getOrderAmount());
|
||||
}
|
||||
String baseUrl = paramsService.getSysParamValue(SysParamCodeEnum.SHOP_ORDER_PAY_BASE_URL.getCode());
|
||||
|
|
@ -168,7 +181,7 @@ public class OrderPayController {
|
|||
@GetMapping("/queryOrderStatus")
|
||||
public CzgResult<String> queryOrderStatus(Long orderId) {
|
||||
CzgResult<String> result = CzgResult.success();
|
||||
String status = orderService.queryChain().select(OrderInfo::getStatus).eq(OrderInfo::getId, orderId).oneAs(String.class);
|
||||
String status = orderInfoService.queryChain().select(OrderInfo::getStatus).eq(OrderInfo::getId, orderId).oneAs(String.class);
|
||||
result.setData(status);
|
||||
switch (status) {
|
||||
case "unpaid" -> result.setMsg("等待用户付款");
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
package com.czg.controller;
|
||||
|
||||
import com.czg.annotation.Debounce;
|
||||
import com.czg.annotation.SaStaffCheckPermission;
|
||||
import com.czg.entity.resp.CzgBaseResp;
|
||||
import com.czg.order.entity.OrderInfo;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.service.order.dto.VipMemberPayParamDTO;
|
||||
import com.czg.service.order.dto.VipPayParamDTO;
|
||||
import com.czg.service.order.dto.VipRefundDTO;
|
||||
import com.czg.service.order.service.PayService;
|
||||
|
|
@ -69,6 +68,37 @@ public class VipPayController {
|
|||
return payService.ltPayVip(ServletUtil.getClientIP(request), payParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 智慧充值
|
||||
* @param request
|
||||
* @param rechargeDTO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/recharge")
|
||||
@Debounce(value = "#rechargeDTO.shopUserId")
|
||||
public CzgResult<Map<String, Object>> recharge(HttpServletRequest request, @Validated @RequestBody VipPayParamDTO rechargeDTO) {
|
||||
if (rechargeDTO.getRechargeDetailId() == null && rechargeDTO.getAmount() == null) {
|
||||
return CzgResult.failure("充值失败 未指定充值金额");
|
||||
}
|
||||
rechargeDTO.setPlatformType(ServletUtil.getHeaderIgnoreCase(ServletUtil.getRequest(), "platformType"));
|
||||
return payService.recharge(ServletUtil.getClientIP(request), rechargeDTO, rechargeDTO.getShopUserId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员购买支付
|
||||
* @param request
|
||||
* @param payParam
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/ltPayMember")
|
||||
@Debounce(value = "#payParam.shopUserId")
|
||||
public CzgResult<Map<String, Object>> ltPayMember(HttpServletRequest request, @Validated @RequestBody VipMemberPayParamDTO payParam) {
|
||||
AssertUtil.isNull(payParam.getShopUserId(), "购买失败 未指定店铺用户Id");
|
||||
payParam.setPlatformType(ServletUtil.getHeaderIgnoreCase(ServletUtil.getRequest(), "platformType"));
|
||||
return payService.ltPayMember(ServletUtil.getClientIP(request), payParam);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 正扫
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,10 +2,13 @@ package com.czg.controller.user;
|
|||
|
||||
import com.czg.annotation.Debounce;
|
||||
import com.czg.exception.CzgException;
|
||||
import com.czg.market.dto.MemberOrderDTO;
|
||||
import com.czg.order.dto.OrderCannelDTO;
|
||||
import com.czg.order.dto.OrderInfoAddDTO;
|
||||
import com.czg.order.dto.OrderInfoQueryDTO;
|
||||
import com.czg.market.entity.MemberOrder;
|
||||
import com.czg.order.entity.OrderInfo;
|
||||
import com.czg.market.service.MemberOrderService;
|
||||
import com.czg.order.service.OrderInfoService;
|
||||
import com.czg.order.vo.HistoryOrderVo;
|
||||
import com.czg.order.vo.OrderInfoVo;
|
||||
|
|
@ -35,6 +38,8 @@ public class UserOrderController {
|
|||
@Resource
|
||||
private OrderInfoService orderInfoService;
|
||||
|
||||
@Resource
|
||||
private MemberOrderService memberOrderService;
|
||||
/**
|
||||
* 订单列表
|
||||
*/
|
||||
|
|
@ -70,6 +75,20 @@ public class UserOrderController {
|
|||
return CzgResult.success(orderInfoService.createOrder(addDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员购买
|
||||
* @param orderDTO 充值信息
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/joinMember")
|
||||
public CzgResult<MemberOrder> joinMember(@Validated @RequestBody MemberOrderDTO orderDTO) {
|
||||
orderDTO.setPlatformType(ServletUtil.getHeaderIgnoreCase(ServletUtil.getRequest(), "platformType"));
|
||||
orderDTO.setUserId(StpKit.USER.getLoginIdAsLong());
|
||||
orderDTO.setOrderType("miniapp");
|
||||
return CzgResult.success(memberOrderService.createMemberOrder(orderDTO));
|
||||
}
|
||||
|
||||
|
||||
@PutMapping("/{id}")
|
||||
public CzgResult<Void> upOrderIsDel(@PathVariable("id") Long id) {
|
||||
//效验数据
|
||||
|
|
|
|||
|
|
@ -19,10 +19,13 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
|
|
@ -37,28 +40,33 @@ public class PrintMqListener {
|
|||
private MqLogService mqLogService;
|
||||
@Resource
|
||||
private FunUtil funUtil;
|
||||
|
||||
// 注入自定义线程池(建议单独配置,避免使用默认线程池)
|
||||
@Resource
|
||||
private ThreadPoolTaskExecutor asyncExecutor;
|
||||
@Lazy
|
||||
@Resource
|
||||
private PrinterHandler printerHandler;
|
||||
|
||||
private <T> void invokeFun(String type, String plat, T data, Consumer<T> consumer) {
|
||||
long startTime = DateUtil.date().getTime();
|
||||
log.info("接收到{}打印消息:{}", type, data);
|
||||
MqLog mqLog = new MqLog().setQueue(RabbitConstants.Queue.ORDER_MACHINE_PRINT_QUEUE).setMsg(data.toString())
|
||||
.setType(type).setPlat(plat).setCreateTime(DateUtil.date().toLocalDateTime());
|
||||
try {
|
||||
consumer.accept(data);
|
||||
} catch (Exception e) {
|
||||
log.error("订单打印失败", e);
|
||||
mqLog.setErrInfo(JSONObject.toJSONString(e));
|
||||
mqLog.setDuration(DateUtil.date().getTime() - startTime);
|
||||
mqLog.setFailTime(DateUtil.date().toLocalDateTime());
|
||||
mqLogService.save(mqLog);
|
||||
}
|
||||
private <T> void invokeFun(String type, String plat, T data, Consumer<T> consumer) {
|
||||
long startTime = DateUtil.date().getTime();
|
||||
log.info("接收到{}打印消息:{}", type, data);
|
||||
MqLog mqLog = new MqLog().setQueue(RabbitConstants.Queue.ORDER_MACHINE_PRINT_QUEUE).setMsg(data.toString())
|
||||
.setType(type).setPlat(plat).setCreateTime(DateUtil.date().toLocalDateTime());
|
||||
try {
|
||||
consumer.accept(data);
|
||||
} catch (Exception e) {
|
||||
log.error("订单打印失败", e);
|
||||
mqLog.setErrInfo(JSONObject.toJSONString(e));
|
||||
mqLog.setDuration(DateUtil.date().getTime() - startTime);
|
||||
mqLog.setFailTime(DateUtil.date().toLocalDateTime());
|
||||
mqLogService.save(mqLog);
|
||||
}
|
||||
}
|
||||
|
||||
@RabbitListener(queues = {"${spring.profiles.active}-" + RabbitConstants.Queue.ORDER_MACHINE_PRINT_QUEUE})
|
||||
public void orderPrint(String req) {
|
||||
// 执行核心打印逻辑
|
||||
invokeFun("orderPrint", "java.order", req, (data) -> {
|
||||
JSONObject jsonObject = JSONObject.parseObject(data);
|
||||
String orderId = jsonObject.getString("orderId");
|
||||
|
|
@ -71,6 +79,33 @@ public class PrintMqListener {
|
|||
return null;
|
||||
}, RedisCst.getLockKey("orderPrint", orderId));
|
||||
});
|
||||
// // 使用异步线程池执行延迟任务,不阻塞当前消费者线程
|
||||
// CompletableFuture.runAsync(() -> {
|
||||
// try {
|
||||
// // 延迟3秒处理
|
||||
// TimeUnit.SECONDS.sleep(3);
|
||||
// // 执行核心打印逻辑
|
||||
// invokeFun("orderPrint", "java.order", req, (data) -> {
|
||||
// JSONObject jsonObject = JSONObject.parseObject(data);
|
||||
// String orderId = jsonObject.getString("orderId");
|
||||
// if (orderId == null) {
|
||||
// throw new RuntimeException("订单打印失败,未传递orderId");
|
||||
// }
|
||||
// Boolean printOrder = jsonObject.getBoolean("printOrder");
|
||||
// funUtil.runFunAndCheckKey(() -> {
|
||||
// printerHandler.handler(orderId, printOrder != null && !printOrder ? PrinterHandler.PrintTypeEnum.ONE : PrinterHandler.PrintTypeEnum.ONE_AND_ORDER);
|
||||
// return null;
|
||||
// }, RedisCst.getLockKey("orderPrint", orderId));
|
||||
// });
|
||||
// } catch (InterruptedException e) {
|
||||
// Thread.currentThread().interrupt();
|
||||
// // 记录中断日志
|
||||
// log.warn("打印任务被中断,req:{}", req, e);
|
||||
// } catch (Exception e) {
|
||||
// // 记录业务异常日志
|
||||
// log.error("打印任务处理失败,req:{}", req, e);
|
||||
// }
|
||||
// }, asyncExecutor);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
traceConsumerFilter=com.czg.config.TraceConsumerFilter
|
||||
traceProviderFilter=com.czg.config.TraceProviderFilter
|
||||
|
|
@ -2,13 +2,13 @@
|
|||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://192.168.1.31:3306/czg_cashier?useUnicode=true&characterEncoding=utf-8
|
||||
url: jdbc:mysql://192.168.1.42:3306/czg_cashier?useUnicode=true&characterEncoding=utf-8
|
||||
username: root
|
||||
password: Chaozg123.
|
||||
|
||||
data:
|
||||
redis:
|
||||
host: 192.168.1.31
|
||||
host: 192.168.1.42
|
||||
port: 6379
|
||||
password: Chaozg123.
|
||||
timeout: 1000
|
||||
|
|
|
|||
|
|
@ -53,4 +53,3 @@ seata:
|
|||
server-addr: 121.40.109.122:8848
|
||||
namespace:
|
||||
group: group_seata
|
||||
|
||||
|
|
|
|||
|
|
@ -53,4 +53,3 @@ seata:
|
|||
server-addr: 121.40.109.122:8848
|
||||
namespace:
|
||||
group: group_seata
|
||||
|
||||
|
|
|
|||
|
|
@ -3,11 +3,12 @@ server:
|
|||
|
||||
spring:
|
||||
application:
|
||||
name: order-server
|
||||
name: order
|
||||
profiles:
|
||||
active: dev
|
||||
include: tools
|
||||
|
||||
|
||||
logging:
|
||||
config: classpath:logback.xml
|
||||
|
||||
|
|
@ -24,7 +25,10 @@ pagehelper:
|
|||
support-methods-arguments: true
|
||||
|
||||
dubbo:
|
||||
provider:
|
||||
filter: traceProviderFilter
|
||||
consumer:
|
||||
filter: traceConsumerFilter
|
||||
check: false
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,9 +2,10 @@
|
|||
<configuration scan="true" scanPeriod="30 seconds" debug="false">
|
||||
<contextName>order-server</contextName>
|
||||
<property name="log.charset" value="utf-8" />
|
||||
<property name="log.pattern" value="%yellow(%d{yyyy-MM-dd HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) - %msg%n" />
|
||||
<property name="log.pattern"
|
||||
value="%yellow(%d{yyyy-MM-dd HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) [traceId=%X{traceId:-}] - %msg%n" />
|
||||
<!--写入文件格式-->
|
||||
<property name="p_file" value="%d | [%thread] %-5level %c [%L] - %msg %n"/>
|
||||
<property name="p_file" value="%d |[traceId=%X{traceId:-}] | [%thread] %-5level %c [%L] - %msg %n "/>
|
||||
<!--输出到控制台-->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.czg.controller.admin;
|
|||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import com.czg.account.entity.ShopInfo;
|
||||
import com.czg.account.service.ShopInfoService;
|
||||
import com.czg.annotation.SaStaffCheckPermission;
|
||||
import com.czg.config.RabbitPublisher;
|
||||
import com.czg.exception.CzgException;
|
||||
|
|
@ -49,6 +51,8 @@ public class ProductController {
|
|||
private ShopSyncService shopSyncService;
|
||||
@Resource
|
||||
private UProductService uProductService;
|
||||
@Resource
|
||||
private ShopInfoService shopInfoService;
|
||||
|
||||
/**
|
||||
* 商品-分页
|
||||
|
|
@ -68,7 +72,7 @@ public class ProductController {
|
|||
@OperationLog("商品-列表")
|
||||
//@SaAdminCheckPermission("product:list")
|
||||
public CzgResult<List<ProductDTO>> getProductList(ProductDTO param) {
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
param.setShopId(shopId);
|
||||
List<ProductDTO> productList = productService.getProductCacheList(param);
|
||||
productService.refreshProductStock(param, productList);
|
||||
|
|
@ -104,7 +108,7 @@ public class ProductController {
|
|||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
dto.setShopId(shopId);
|
||||
productService.addProduct(dto);
|
||||
asyncToBranchShop(dto.getId());
|
||||
asyncProductToShop(dto.getId());
|
||||
ThreadUtil.execAsync(() -> {
|
||||
rabbitPublisher.sendProductInfoChangeMsg(Convert.toStr(shopId));
|
||||
});
|
||||
|
|
@ -133,7 +137,7 @@ public class ProductController {
|
|||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
dto.setShopId(shopId);
|
||||
productService.updateProduct(dto);
|
||||
asyncToBranchShop(dto.getId());
|
||||
asyncProductToShop(dto.getId());
|
||||
ThreadUtil.execAsync(() -> {
|
||||
rabbitPublisher.sendProductInfoChangeMsg(Convert.toStr(shopId));
|
||||
});
|
||||
|
|
@ -168,7 +172,7 @@ public class ProductController {
|
|||
AssertUtil.isNull(id, "{}不能为空", "id");
|
||||
Long shopId = StpKit.USER.getShopId(0L);
|
||||
productService.deleteProduct(shopId, id);
|
||||
asyncToBranchShop(id);
|
||||
asyncProductToShop(id);
|
||||
ThreadUtil.execAsync(() -> {
|
||||
rabbitPublisher.sendProductInfoChangeMsg(Convert.toStr(shopId));
|
||||
});
|
||||
|
|
@ -217,7 +221,7 @@ public class ProductController {
|
|||
//@SaAdminCheckPermission("product:bind")
|
||||
public CzgResult<Void> bindCons(@RequestBody @Validated({DefaultGroup.class}) ProdConsBindDTO param) {
|
||||
prodConsRelationService.saveProdConsRelation(param);
|
||||
asyncToBranchShop2(param.getId());
|
||||
asyncConsProToShop(param.getId());
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
|
|
@ -229,7 +233,7 @@ public class ProductController {
|
|||
//@SaAdminCheckPermission("product:update")
|
||||
public CzgResult<Void> refundToStock(@RequestBody @Validated({DefaultGroup.class}) ProdRefundToStockParam param) {
|
||||
productService.refundToStock(param);
|
||||
asyncToBranchShop(param.getId());
|
||||
asyncProductToShop(param.getId());
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
|
|
@ -293,36 +297,34 @@ public class ProductController {
|
|||
//@SaAdminCheckPermission("product:sync")
|
||||
public CzgResult<Void> sync() {
|
||||
long shopId = StpKit.USER.getShopId(0L);
|
||||
long sysUserId = StpKit.USER.getLoginIdAsLong();
|
||||
boolean isEnableSync = StpKit.USER.isEnableSync(shopId);
|
||||
long headShopId = StpKit.USER.getHeadShopId();
|
||||
if (!isEnableSync) {
|
||||
throw new CzgException("主店未开启商品资料同步功能");
|
||||
ShopInfo shopInfo = shopInfoService.getById(shopId);
|
||||
if (shopInfo == null) {
|
||||
throw new CzgException("店铺不存在");
|
||||
}
|
||||
if (shopId == headShopId) {
|
||||
AssertUtil.isNotEqual(shopInfo.getIsEnableProdSync(), 1, "主店未开启商品资料同步功能");
|
||||
|
||||
if (shopInfo.getMainId() == null || shopId == shopInfo.getMainId()) {
|
||||
throw new CzgException("不存在主子店铺关系,无需同步商品信息");
|
||||
}
|
||||
ThreadUtil.execAsync(() -> {
|
||||
shopSyncService.sync(headShopId, shopId, sysUserId);
|
||||
shopSyncService.sync(shopInfo.getMainId(), shopId, shopId);
|
||||
});
|
||||
CzgResult<Void> ret = CzgResult.success();
|
||||
ret.setMsg("操作成功,数据正在后台同步中...");
|
||||
return ret;
|
||||
}
|
||||
|
||||
private void asyncToBranchShop(Long id) {
|
||||
private void asyncProductToShop(Long id) {
|
||||
long shopId = StpKit.USER.getShopId(0L);
|
||||
long sysUserId = StpKit.USER.getLoginIdAsLong();
|
||||
ThreadUtil.execAsync(() -> {
|
||||
shopSyncService.syncProductBySourceShop(shopId, id, sysUserId);
|
||||
shopSyncService.syncProductBySourceShop(shopId, id, shopId);
|
||||
});
|
||||
}
|
||||
|
||||
private void asyncToBranchShop2(Long id) {
|
||||
private void asyncConsProToShop(Long id) {
|
||||
long shopId = StpKit.USER.getShopId(0L);
|
||||
long sysUserId = StpKit.USER.getLoginIdAsLong();
|
||||
ThreadUtil.execAsync(() -> {
|
||||
shopSyncService.syncConsProBySourceShop(shopId, id, sysUserId);
|
||||
shopSyncService.syncConsProBySourceShop(shopId, id, shopId);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
traceConsumerFilter=com.czg.config.TraceConsumerFilter
|
||||
traceProviderFilter=com.czg.config.TraceProviderFilter
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://192.168.1.31:3306/czg_cashier?useUnicode=true&characterEncoding=utf-8
|
||||
url: jdbc:mysql://192.168.1.42:3306/czg_cashier?useUnicode=true&characterEncoding=utf-8
|
||||
username: root
|
||||
password: Chaozg123.
|
||||
|
||||
data:
|
||||
redis:
|
||||
host: 192.168.1.31
|
||||
host: 192.168.1.42
|
||||
port: 6379
|
||||
password: Chaozg123.
|
||||
timeout: 1000
|
||||
|
|
@ -53,4 +53,4 @@ seata:
|
|||
nacos:
|
||||
server-addr: 121.40.109.122:8848
|
||||
namespace:
|
||||
group: group_seata
|
||||
group: group_seata
|
||||
|
|
@ -3,7 +3,7 @@ server:
|
|||
|
||||
spring:
|
||||
application:
|
||||
name: product-server
|
||||
name: product
|
||||
profiles:
|
||||
active: dev
|
||||
include: tools
|
||||
|
|
@ -13,6 +13,12 @@ wx:
|
|||
secrete: 8492a7e8d55bbb1b57f5c8276ea1add0
|
||||
operationMsgTmpId: wFdoUG-dUT7bDRHq8bMJD9CF5TjyH9x_uJQgQByZqHg
|
||||
warnMsgTmpId: C08OUr80x6wGmUN1zpFhSQ3Sv7VF5vksdZigiEx2pD0
|
||||
# 公众号
|
||||
ac:
|
||||
appId: wx1fb600d0f5ea6279
|
||||
secrete: b4c0534c9b5e6c84a7fe5c2078dff876
|
||||
|
||||
|
||||
|
||||
|
||||
logging:
|
||||
|
|
@ -30,5 +36,8 @@ pagehelper:
|
|||
support-methods-arguments: true
|
||||
|
||||
dubbo:
|
||||
provider:
|
||||
filter: traceProviderFilter
|
||||
consumer:
|
||||
filter: traceConsumerFilter
|
||||
check: false
|
||||
|
|
|
|||
|
|
@ -2,9 +2,10 @@
|
|||
<configuration scan="true" scanPeriod="30 seconds" debug="false">
|
||||
<contextName>product-server</contextName>
|
||||
<property name="log.charset" value="utf-8" />
|
||||
<property name="log.pattern" value="%yellow(%d{yyyy-MM-dd HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) - %msg%n" />
|
||||
<property name="log.pattern"
|
||||
value="%yellow(%d{yyyy-MM-dd HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) [traceId=%X{traceId:-}] - %msg%n" />
|
||||
<!--写入文件格式-->
|
||||
<property name="p_file" value="%d | [%thread] %-5level %c [%L] - %msg %n"/>
|
||||
<property name="p_file" value="%d |[traceId=%X{traceId:-}] | [%thread] %-5level %c [%L] - %msg %n "/>
|
||||
<!--输出到控制台-->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
traceConsumerFilter=com.czg.config.TraceConsumerFilter
|
||||
traceProviderFilter=com.czg.config.TraceProviderFilter
|
||||
|
|
@ -2,13 +2,13 @@
|
|||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://192.168.1.31:3306/czg_cashier?useUnicode=true&characterEncoding=utf-8
|
||||
url: jdbc:mysql://192.168.1.42:3306/czg_cashier?useUnicode=true&characterEncoding=utf-8
|
||||
username: root
|
||||
password: Chaozg123.
|
||||
|
||||
data:
|
||||
redis:
|
||||
host: 192.168.1.31
|
||||
host: 192.168.1.42
|
||||
port: 6379
|
||||
password: Chaozg123.
|
||||
timeout: 1000
|
||||
|
|
|
|||
|
|
@ -3,10 +3,11 @@ server:
|
|||
|
||||
spring:
|
||||
application:
|
||||
name: system-server
|
||||
name: system
|
||||
profiles:
|
||||
active: dev
|
||||
|
||||
|
||||
logging:
|
||||
config: classpath:logback.xml
|
||||
|
||||
|
|
@ -19,3 +20,10 @@ alipay:
|
|||
key: your-key
|
||||
secret: your-secret
|
||||
templateCode: c
|
||||
|
||||
dubbo:
|
||||
provider:
|
||||
filter: traceProviderFilter
|
||||
consumer:
|
||||
filter: traceConsumerFilter
|
||||
check: false
|
||||
|
|
@ -2,9 +2,10 @@
|
|||
<configuration scan="true" scanPeriod="30 seconds" debug="false">
|
||||
<contextName>system-server</contextName>
|
||||
<property name="log.charset" value="utf-8" />
|
||||
<property name="log.pattern" value="%yellow(%d{yyyy-MM-dd HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) - %msg%n" />
|
||||
<property name="log.pattern"
|
||||
value="%yellow(%d{yyyy-MM-dd HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) [traceId=%X{traceId:-}] - %msg%n" />
|
||||
<!--写入文件格式-->
|
||||
<property name="p_file" value="%d | [%thread] %-5level %c [%L] - %msg %n"/>
|
||||
<property name="p_file" value="%d |[traceId=%X{traceId:-}] | [%thread] %-5level %c [%L] - %msg %n "/>
|
||||
<!--输出到控制台-->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
|
|
|
|||
|
|
@ -62,10 +62,16 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo-common</artifactId>
|
||||
<artifactId>dubbo</artifactId>
|
||||
<version>3.3.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.apache.dubbo</groupId>-->
|
||||
<!-- <artifactId>dubbo-common</artifactId>-->
|
||||
<!-- <version>3.3.3</version>-->
|
||||
<!-- <scope>compile</scope>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.dubbo/dubbo-serialization-hessian2 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
|
|
|
|||
|
|
@ -11,10 +11,13 @@ import org.aspectj.lang.ProceedingJoinPoint;
|
|||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 方法调用统一切面处理
|
||||
|
|
@ -51,6 +54,7 @@ public class ControllerAspect {
|
|||
if(params.contains("jndi:rmi:")){
|
||||
throw new RuntimeException("gun");
|
||||
}
|
||||
Map<String, String> contextMap = MDC.getCopyOfContextMap();
|
||||
// 执行被拦截的方法
|
||||
Object result = pjp.proceed();
|
||||
long end = System.currentTimeMillis();
|
||||
|
|
@ -59,7 +63,12 @@ public class ControllerAspect {
|
|||
String requestUrl = request.getRequestURL().toString();
|
||||
String requestIp = ServletUtil.getClientIP(request);
|
||||
long useTime = end - start;
|
||||
|
||||
ThreadUtil.execAsync(() -> {
|
||||
if (contextMap != null) {
|
||||
MDC.setContextMap(contextMap);
|
||||
}
|
||||
|
||||
//请求的参数
|
||||
String resultJson = JSONObject.toJSONString(result);
|
||||
if (StrUtil.isNotBlank(resultJson) && resultJson.length() > 200) {
|
||||
|
|
@ -82,6 +91,8 @@ public class ControllerAspect {
|
|||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Request 为空" + e.getMessage());
|
||||
} finally {
|
||||
MDC.clear();
|
||||
}
|
||||
});
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -1,20 +1,35 @@
|
|||
package com.czg.config;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import jakarta.servlet.*;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author GYJoker
|
||||
*/
|
||||
@Configuration
|
||||
public class CorsFilter implements Filter {
|
||||
|
||||
@Value("${spring.application.name:unknown-service}")
|
||||
private String applicationName;
|
||||
@Override
|
||||
public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain)
|
||||
throws IOException, ServletException {
|
||||
// traceId
|
||||
Map<String, String> copyOfContextMap = MDC.getCopyOfContextMap();
|
||||
if(copyOfContextMap == null){
|
||||
copyOfContextMap = new HashMap<>();
|
||||
}
|
||||
copyOfContextMap.put("traceId",applicationName + IdUtil.fastSimpleUUID());
|
||||
MDC.setContextMap(copyOfContextMap);
|
||||
HttpServletResponse response = (HttpServletResponse) resp;
|
||||
HttpServletRequest reqs = (HttpServletRequest) req;
|
||||
String curOrigin = reqs.getHeader("Origin");
|
||||
|
|
@ -23,6 +38,12 @@ public class CorsFilter implements Filter {
|
|||
response.setHeader("Access-Control-Max-Age", "3600");
|
||||
response.setHeader("Access-Control-Allow-Headers", "token,Origin, X-Requested-With, Content-Type, Accept,shopId");
|
||||
response.setHeader("Access-Control-Allow-Credentials", "true");
|
||||
chain.doFilter(req, resp);
|
||||
try {
|
||||
// 原有 MDC 设置逻辑...
|
||||
chain.doFilter(req, resp);
|
||||
} finally {
|
||||
// 清理当前线程的 traceId
|
||||
MDC.remove("traceId");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
package com.czg.config;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.apache.dubbo.common.constants.CommonConstants;
|
||||
import org.apache.dubbo.common.extension.Activate;
|
||||
import org.apache.dubbo.rpc.*;
|
||||
import org.slf4j.MDC;
|
||||
|
||||
/**
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
@Activate(group = CommonConstants.CONSUMER)
|
||||
public class TraceConsumerFilter implements Filter {
|
||||
|
||||
@Override
|
||||
public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
|
||||
String traceId = MDC.get("traceId");
|
||||
if (StrUtil.isBlank(traceId)) {
|
||||
traceId = StrUtil.uuid();
|
||||
}
|
||||
invocation.setAttachment("traceId", traceId);
|
||||
return invoker.invoke(invocation);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.czg.config;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.apache.dubbo.common.constants.CommonConstants;
|
||||
import org.apache.dubbo.common.extension.Activate;
|
||||
import org.apache.dubbo.rpc.*;
|
||||
import org.slf4j.MDC;
|
||||
|
||||
/**
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
@Activate(group = CommonConstants.PROVIDER)
|
||||
public class TraceProviderFilter implements Filter {
|
||||
|
||||
@Override
|
||||
public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
|
||||
String traceId = invocation.getAttachment("traceId");
|
||||
if (StrUtil.isBlank(traceId)) {
|
||||
traceId = StrUtil.uuid();
|
||||
}
|
||||
|
||||
// 设置到 MDC
|
||||
MDC.put("traceId", traceId);
|
||||
return invoker.invoke(invocation);
|
||||
}
|
||||
}
|
||||
|
|
@ -34,6 +34,17 @@ public class CzgControllerAdvice {
|
|||
@ExceptionHandler(value = Exception.class)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public CzgResult<Object> errorHandler(Exception ex) {
|
||||
Throwable rootCause = ex;
|
||||
while (rootCause.getCause() != null) {
|
||||
rootCause = rootCause.getCause();
|
||||
if (rootCause instanceof CzgException) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 处理自定义异常
|
||||
if (rootCause instanceof CzgException czgException) {
|
||||
return CzgResult.failure(czgException.getCode(), czgException.getMessage());
|
||||
}
|
||||
setErrorLog(ex);
|
||||
return CzgResult.failure(CzgRespCode.SYSTEM_ERROR.getCode(), ex.getMessage());
|
||||
}
|
||||
|
|
@ -108,7 +119,7 @@ public class CzgControllerAdvice {
|
|||
*/
|
||||
@ExceptionHandler(PaySuccessException.class)
|
||||
public CzgResult<Object> handlePaySuccessException() {
|
||||
return CzgResult.success();
|
||||
return CzgResult.success("支付成功");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -143,7 +154,7 @@ public class CzgControllerAdvice {
|
|||
}
|
||||
|
||||
private void setErrorLog(Exception ex) {
|
||||
log.error("错误",ex);
|
||||
log.error(ex.getMessage());
|
||||
log.error("错误",ex);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,13 @@ public class RabbitConfig {
|
|||
|
||||
@Value("${spring.profiles.active}")
|
||||
private String activeProfile;
|
||||
@Bean
|
||||
@Primary
|
||||
public DirectExchange directExchange() {
|
||||
return new DirectExchange(activeProfile + "-" + RabbitConstants.Exchange.CASH_EXCHANGE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------订单打印队列
|
||||
@Bean
|
||||
public Queue orderPrintQueue() {
|
||||
// 创建一个用于存储队列参数的 Map
|
||||
|
|
@ -30,7 +36,13 @@ public class RabbitConfig {
|
|||
args.put("x-message-ttl", 180000);
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_PRINT_QUEUE, true, false, false, args);
|
||||
}
|
||||
@Bean
|
||||
public Binding bindingOrderPrintExchange(Queue orderPrintQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(orderPrintQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.ORDER_PRINT_QUEUE);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------订单厨房票
|
||||
@Bean
|
||||
public Queue orderMachinePrintQueue() {
|
||||
// 创建一个用于存储队列参数的 Map
|
||||
|
|
@ -39,82 +51,96 @@ public class RabbitConfig {
|
|||
// args.put("x-message-ttl", 180000);
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_MACHINE_PRINT_QUEUE, true, false, false);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Queue handoverPrintQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_HANDOVER_PRINT_QUEUE, true, false, false);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Queue callTablePrintQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.CALL_TABLE_PRINT_QUEUE, true, false, false);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Queue orderCancelQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_CANCEL_QUEUE, true);
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public Queue orderStockQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_STOCK_QUEUE, true);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Queue productInfoChangeQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.PRODUCT_INFO_CHANGE_QUEUE, true);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Queue orderRefundQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_REFUND_QUEUE, true);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
public DirectExchange directExchange() {
|
||||
return new DirectExchange(activeProfile + "-" + RabbitConstants.Exchange.CASH_EXCHANGE);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Binding bindingOrderPrintExchange(Queue orderPrintQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(orderPrintQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.ORDER_PRINT_QUEUE);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Binding bindingOrderCancelExchange(Queue orderPrintQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(orderPrintQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.ORDER_CANCEL_QUEUE);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Binding bindingCallTablePrintExchange(Queue callTablePrintQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(callTablePrintQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.CALL_TABLE_PRINT_QUEUE);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Binding bindingHandoverPrintExchange(Queue handoverPrintQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(handoverPrintQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.ORDER_HANDOVER_PRINT_QUEUE);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Binding bindingOrderMachinePrintExchange(Queue orderMachinePrintQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(orderMachinePrintQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.ORDER_MACHINE_PRINT_QUEUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------交班打票
|
||||
@Bean
|
||||
public Queue handoverPrintQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_HANDOVER_PRINT_QUEUE, true, false, false);
|
||||
}
|
||||
@Bean
|
||||
public Binding bindingHandoverPrintExchange(Queue handoverPrintQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(handoverPrintQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.ORDER_HANDOVER_PRINT_QUEUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------叫号 打票
|
||||
@Bean
|
||||
public Queue callTablePrintQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.CALL_TABLE_PRINT_QUEUE, true, false, false);
|
||||
}
|
||||
@Bean
|
||||
public Binding bindingCallTablePrintExchange(Queue callTablePrintQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(callTablePrintQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.CALL_TABLE_PRINT_QUEUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------订单取消
|
||||
@Bean
|
||||
public Queue orderCancelQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_CANCEL_QUEUE, true);
|
||||
}
|
||||
@Bean
|
||||
public Binding bindingOrderCancelExchange(Queue orderPrintQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(orderPrintQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.ORDER_CANCEL_QUEUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------ 订单库存更新
|
||||
@Bean
|
||||
public Queue orderStockQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_STOCK_QUEUE, true);
|
||||
}
|
||||
@Bean
|
||||
public Binding bindingOrderStockExchange(Queue orderStockQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(orderStockQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.ORDER_STOCK_QUEUE);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------ 商品信息更新
|
||||
@Bean
|
||||
public Queue productInfoChangeQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.PRODUCT_INFO_CHANGE_QUEUE, true);
|
||||
}
|
||||
@Bean
|
||||
public Binding bindingProductInfoChange(Queue productInfoChangeQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(productInfoChangeQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.PRODUCT_INFO_CHANGE_QUEUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------ 订单退款
|
||||
@Bean
|
||||
public Queue orderRefundQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_REFUND_QUEUE, true);
|
||||
}
|
||||
@Bean
|
||||
public Binding bindingOrderRefundExchange(Queue orderRefundQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(orderRefundQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.ORDER_REFUND_QUEUE);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------ 申请短信模板队列
|
||||
/**
|
||||
* 1,2,applySmsTemp 模版审核
|
||||
* 1,2,sendMarkSms 发送营销短信
|
||||
* 1,2,sendWechatTemp 发送微信模版消息
|
||||
*
|
||||
*/
|
||||
@Bean
|
||||
public Queue applySmsTemplateQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.APPLY_SMS_TEMPLATE_QUEUE, true);
|
||||
}
|
||||
@Bean
|
||||
public Binding bindingApplySmsTemplateExchange(Queue applySmsTemplateQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(applySmsTemplateQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.APPLY_SMS_TEMPLATE_QUEUE);
|
||||
}
|
||||
|
||||
//------------------------------------------------------ 生日礼品短信队列
|
||||
@Bean
|
||||
public Queue birthdayGiftSmsQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.BIRTHDAY_GIFT_SMS_QUEUE, true);
|
||||
}
|
||||
@Bean
|
||||
public Binding bindingBirthdayGiftSmsExchange(Queue birthdayGiftSmsQueue, DirectExchange exchange) {
|
||||
return BindingBuilder.bind(birthdayGiftSmsQueue).to(exchange).with(activeProfile + "-" + RabbitConstants.Queue.BIRTHDAY_GIFT_SMS_QUEUE);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,5 +18,17 @@ public interface RabbitConstants {
|
|||
public static final String ORDER_HANDOVER_PRINT_QUEUE = "order.handover.print.queue";
|
||||
public static final String CALL_TABLE_PRINT_QUEUE = "call.table.print.queue";
|
||||
public static final String PRODUCT_INFO_CHANGE_QUEUE = "product.info.change.queue";
|
||||
|
||||
/**
|
||||
* 1,2,applySmsTemp 模版审核
|
||||
* 1,2,sendMarkSms 发送营销短信
|
||||
* 1,2,sendWechatTemp 发送微信模版消息
|
||||
*
|
||||
*/
|
||||
public static final String APPLY_SMS_TEMPLATE_QUEUE = "apply.sms.temp";
|
||||
/**
|
||||
* 生日礼品短信队列
|
||||
*/
|
||||
public static final String BIRTHDAY_GIFT_SMS_QUEUE = "birthday.gift.sms";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,6 +101,25 @@ public class RabbitPublisher {
|
|||
sendMsg(RabbitConstants.Queue.ORDER_HANDOVER_PRINT_QUEUE, id.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 1,2,applySmsTemp 模版审核 shop_id,sms_shop_template.id,applySmsTemp
|
||||
* 1,2,sendMarkSms 发送营销短信 shop_id,sms_push_event.id,sendMarkSms
|
||||
* 1,2,sendWechatTemp 发送微信模版消息 ?
|
||||
* @param param 店铺Id,主键Id
|
||||
* @param type applySmsTemp,sendMarkSms,sendWechatTemp
|
||||
*/
|
||||
public void sendApplySmsMsg(String param, String type) {
|
||||
sendMsg(RabbitConstants.Queue.APPLY_SMS_TEMPLATE_QUEUE, param + "," + type);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送生日礼品短信队列
|
||||
*
|
||||
* @param param
|
||||
*/
|
||||
public void sendBirthdayGiftSmsMsg(String param) {
|
||||
sendMsg(RabbitConstants.Queue.BIRTHDAY_GIFT_SMS_QUEUE, param);
|
||||
}
|
||||
|
||||
private void sendMsg(String queue, String msg) {
|
||||
log.info("开始发送mq消息,exchange:{}, queue: {}, msg: {}", activeProfile + "-" + RabbitConstants.Exchange.CASH_EXCHANGE, activeProfile + "-" + queue, msg);
|
||||
|
|
|
|||
|
|
@ -21,6 +21,12 @@ public interface RedisCst {
|
|||
public static final String EXPIRED_ORDER = "expired:order:";
|
||||
//台桌清台key过期
|
||||
public static final String EXPIRED_TABLE = "expired:table:";
|
||||
//优惠券过期
|
||||
public static final String EXPIRED_COUPON = "expired:coupon:";
|
||||
//短信定时发放 倒计时KEY
|
||||
public static final String EXPIRED_SMS = "expired:sms:";
|
||||
//公众号推送 倒计时KEY
|
||||
public static final String EXPIRED_WECHAT = "expired:wechat:";
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
package com.czg.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 权限认证(User版):必须具有指定权限才能进入该方法
|
||||
* <p> 可标注在函数、类上(效果等同于标注在此类的所有方法上)
|
||||
* @author click33
|
||||
*
|
||||
*/
|
||||
//@SaCheckPermission(type = "user")
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ ElementType.METHOD, ElementType.TYPE})
|
||||
public @interface SaCheckMainShop {
|
||||
|
||||
/**
|
||||
* 需要校验的权限码
|
||||
* @return 需要校验的权限码
|
||||
*/
|
||||
String value() default "";
|
||||
|
||||
}
|
||||
|
|
@ -7,10 +7,13 @@ import cn.dev33.satoken.interceptor.SaInterceptor;
|
|||
import cn.dev33.satoken.router.SaRouter;
|
||||
import cn.dev33.satoken.strategy.SaAnnotationStrategy;
|
||||
import com.czg.sa.MyStpLogic;
|
||||
import com.czg.utils.ServletUtil;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.annotation.AnnotatedElementUtils;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
|
|
@ -70,7 +73,14 @@ public class SaTokenConfigure implements WebMvcConfigurer {
|
|||
.notMatch("/notify/**")
|
||||
.notMatch("/admin/auth/**")
|
||||
.notMatch("/admin/shopMsgPush/subscribe/**")
|
||||
.check(r -> MyStpLogic.ADMIN_LOGIC.checkLogin());
|
||||
.notMatch("/admin/coupon/grant")
|
||||
.check(r -> {
|
||||
ServletRequestAttributes attributes =
|
||||
(ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
if (attributes == null || !ServletUtil.getClientIP(attributes.getRequest()).contains("192.168")) {
|
||||
MyStpLogic.ADMIN_LOGIC.checkLogin();
|
||||
}
|
||||
});
|
||||
|
||||
})).addPathPatterns("/**");
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue