Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f0e98d9ef0 | ||
|
|
81168bbb69 | ||
|
|
b2e0e7465d | ||
|
|
a78d2bd6c7 | ||
|
|
b5cdcbad4a | ||
|
|
a54280c347 | ||
|
|
22ccd19725 | ||
|
|
8261c52673 | ||
|
|
44babb09b1 | ||
|
|
084c22a00f | ||
|
|
34524284d4 | ||
|
|
0f8ee6e6fe | ||
|
|
06ef88126b | ||
|
|
e9c7346843 | ||
|
|
7e2c288beb | ||
|
|
b3f445fdd4 | ||
|
|
e1484a5889 | ||
|
|
48752c2712 | ||
|
|
e637b7c511 | ||
|
|
bf43517b5c | ||
|
|
9df0b9e290 | ||
|
|
42c9a82363 | ||
|
|
198b29dcb0 | ||
|
|
44129c7cd0 | ||
|
|
50a9e7242c | ||
|
|
5b24d0f522 | ||
|
|
fbcf91a592 | ||
|
|
8c22728855 | ||
|
|
9840cae11d | ||
|
|
25f4ac62c7 | ||
|
|
f7e4f7df3f | ||
|
|
d705802c6a | ||
|
|
30e0be1493 | ||
|
|
d9a2454fe8 | ||
|
|
f6bf5abc9f | ||
|
|
77f84afdd6 | ||
|
|
0e215afa39 | ||
|
|
189433a164 | ||
|
|
c19c61affd | ||
|
|
4a807869aa | ||
|
|
064b88a86a | ||
|
|
7d8529e7d8 | ||
|
|
374841e417 | ||
|
|
c22b16e7ac | ||
|
|
2f3b5645aa | ||
|
|
d05a943e66 | ||
|
|
b7f1e265f9 | ||
|
|
03bc65284d | ||
|
|
e3fe728c6c | ||
|
|
86e209494f | ||
|
|
6c5e16386c | ||
|
|
74112dc93b | ||
|
|
08717e84be | ||
|
|
8d732fb8fb | ||
|
|
5240926cd7 | ||
|
|
16d6d1c29d | ||
|
|
b0e0123c4a | ||
|
|
abb96916e3 | ||
|
|
e3bdb44192 | ||
|
|
ff175c98df | ||
|
|
5c434e576f | ||
|
|
6b5e91c4d7 | ||
|
|
5f622b0641 | ||
|
|
9bfcc02a48 | ||
|
|
a3a3fa17f1 | ||
|
|
f38d6997bc | ||
|
|
13e3503af4 | ||
|
|
70af2e822b | ||
|
|
71a228c625 | ||
|
|
9f79c901ca | ||
|
|
fa782834e7 | ||
|
|
088bd41d0b | ||
|
|
f6b1403e3c | ||
|
|
da105d20e4 | ||
|
|
293dd52e8c | ||
|
|
eeb6757ec8 | ||
|
|
6960564dde | ||
|
|
fb8366fa78 | ||
|
|
31dc8e4032 | ||
|
|
6caf44a9ec | ||
|
|
95cacd287b | ||
|
|
fdf48d2f14 | ||
|
|
b24fc351ea | ||
|
|
11e6c91cc6 | ||
|
|
fd04248c4b | ||
|
|
1f9cea5d3e | ||
|
|
4be8bcab6d | ||
|
|
cf6b0e7d70 | ||
|
|
ff2a7dd781 | ||
|
|
f99cf25adf | ||
|
|
1ea9767674 | ||
|
|
2253984352 | ||
|
|
b14d46803c | ||
|
|
82b6431be9 | ||
|
|
6cb1ecab7b | ||
|
|
061bdc6312 | ||
|
|
f980592507 | ||
|
|
1d0e12ee18 | ||
|
|
d5b6cddd8f | ||
|
|
e4931d1499 | ||
|
|
7748d4e558 | ||
|
|
7d5ee5cffd | ||
|
|
48da135874 | ||
|
|
8be09de49c | ||
|
|
2aff2e8d7d | ||
|
|
06320d99ca | ||
|
|
7cd6c52db5 | ||
|
|
455f3265ec | ||
|
|
33774c51fb | ||
|
|
c68c91e0b3 | ||
|
|
53c64c36da | ||
|
|
7a38c4e8a5 | ||
|
|
66d66e5156 | ||
|
|
20517eaaaa | ||
|
|
deea55b1e9 | ||
|
|
31a9287a8f | ||
|
|
4cd04ef10e | ||
|
|
afb6b2a4b5 | ||
|
|
a12083d93c | ||
|
|
f66af56144 | ||
|
|
0d71663935 | ||
|
|
753039d5e9 | ||
|
|
743040d813 | ||
|
|
9f8e21383d | ||
|
|
4e85bf306b | ||
|
|
1da61f526d | ||
|
|
c7970e884f | ||
|
|
20c95700ab | ||
|
|
547394f8d6 | ||
|
|
a671da2f11 | ||
|
|
60561da44d | ||
|
|
e5138339a8 | ||
|
|
45f30d2dbc | ||
|
|
8aa82b28be | ||
|
|
23847cf918 | ||
|
|
c6d0cb9579 | ||
|
|
e590293b33 | ||
|
|
e1fa902c59 | ||
|
|
5eb7b070fd | ||
|
|
fbf10a1ed9 | ||
|
|
0e96b4d8f4 | ||
|
|
61f8638635 | ||
|
|
6c9a09f29a | ||
|
|
2787aa38c6 | ||
|
|
d69b959534 | ||
|
|
60c1db6e2a | ||
|
|
d4db9785b3 | ||
|
|
7ace643452 | ||
|
|
c4276aac48 | ||
|
|
02386824af | ||
|
|
209de376e3 | ||
|
|
4c4dfcd9d5 | ||
|
|
a78e3e23d6 | ||
|
|
5730bb12a7 | ||
|
|
2e1ceaa393 | ||
|
|
b1f0fb8f6f | ||
|
|
2e1c5eae8a | ||
|
|
23d53688e4 | ||
|
|
5558debc20 | ||
|
|
1c9e92b60e | ||
|
|
4be7832789 | ||
|
|
0c968937af | ||
|
|
c8aa73fc21 | ||
|
|
b2d42ccfba | ||
|
|
a832a8281a | ||
|
|
27fa06ab04 | ||
|
|
397950e033 | ||
|
|
aa36758066 | ||
|
|
69b5b0d072 | ||
|
|
6f80764866 | ||
|
|
a10be7303f | ||
|
|
65dbeb9bdc | ||
|
|
4286d35243 | ||
|
|
4ea958e91d | ||
|
|
23f4c31338 | ||
|
|
67b3566eb8 | ||
|
|
965a5912c0 | ||
|
|
f62248e93e | ||
|
|
2b6deb09b9 | ||
|
|
9604bc938a | ||
|
|
9d3b296a27 | ||
|
|
9a1f6a107e | ||
|
|
db0cea67be | ||
|
|
992817300c | ||
|
|
9fdd40ee4e | ||
|
|
5d4929f36b | ||
|
|
a7826fbc16 | ||
|
|
dc498364ae | ||
|
|
0755325701 | ||
|
|
3eeb1a0882 | ||
|
|
f989831de2 | ||
|
|
078c214202 | ||
|
|
4bc2940f9e | ||
|
|
923d1e0483 | ||
|
|
a87fdca103 | ||
|
|
0ec450d85c | ||
|
|
c7988344d3 | ||
|
|
3cc3be3ee0 | ||
|
|
3a831e31ad | ||
|
|
a525fd6a16 | ||
|
|
6d720c5757 | ||
|
|
023037e2ca | ||
|
|
b3355ff79f | ||
|
|
feb30e9fe5 | ||
|
|
f9c3609b8b | ||
|
|
79bf8423e0 | ||
|
|
45bea53a70 | ||
|
|
a24b78473f | ||
|
|
f9dbd8a010 | ||
|
|
31b4f482dd | ||
|
|
08758c78ab | ||
|
|
4a23dfbc2a | ||
|
|
086cfca5dc | ||
|
|
120b30c4ea | ||
|
|
df93d06ae2 | ||
|
|
a683b38e8d | ||
|
|
33d44eed4d | ||
|
|
8615b98be2 | ||
|
|
57b5325154 | ||
|
|
1ccbc8c895 | ||
|
|
0be2808800 | ||
|
|
93b3c29ac3 | ||
|
|
ffb0a9f6da | ||
|
|
93d9e11688 | ||
|
|
20e6986ec9 | ||
|
|
ba6237853e | ||
|
|
cc5c4ab49a | ||
|
|
738afdce5c | ||
|
|
78b8aa6487 | ||
|
|
98200d775c | ||
|
|
fde91ebba5 | ||
|
|
320398289d | ||
|
|
eb7a8fd736 | ||
|
|
0393b11712 | ||
|
|
f231e09e8a | ||
|
|
434b93b61c | ||
|
|
c083e3711c | ||
|
|
62e5467e5f | ||
|
|
f71c07ab6a | ||
|
|
ec87e603ee | ||
|
|
630b455790 | ||
|
|
cee39d271a | ||
|
|
1b7f380867 | ||
|
|
8acb479047 | ||
|
|
de1644db2c | ||
|
|
45d23fbab6 | ||
|
|
0e6470fd59 | ||
|
|
002ea67fe7 | ||
|
|
e75aa0f7f1 | ||
|
|
397f74daad | ||
|
|
9146059eea | ||
|
|
135b7b6964 | ||
|
|
0f258a43f3 | ||
|
|
d53d328437 | ||
|
|
ba0a91e0c8 | ||
|
|
1dcdf68814 | ||
|
|
ce72dae1ad | ||
|
|
07a93038a5 | ||
|
|
7f26242ea8 | ||
|
|
8816a64040 | ||
|
|
0db3c4814d | ||
|
|
ba86324276 | ||
|
|
1a0de0e483 | ||
|
|
1ca8a32d10 | ||
|
|
07d80398ae | ||
|
|
04db4a633b | ||
|
|
7c665da605 | ||
|
|
0996ce4008 | ||
|
|
7bcb28cdac | ||
|
|
cbc1a23715 | ||
|
|
8a48dbbab0 | ||
|
|
59497d26f7 | ||
|
|
9962fef53a | ||
|
|
609a3725d6 | ||
|
|
ffa7ace73b | ||
|
|
cc7cf6d2c0 | ||
|
|
532baf1682 | ||
|
|
9f9da3a0dc | ||
|
|
9c6a5fc390 | ||
|
|
0b8c566f1d | ||
|
|
9807b13101 | ||
|
|
5ca8535f02 | ||
|
|
fa02011bd7 | ||
|
|
45336e3a96 | ||
|
|
6bcb7ac3e8 | ||
|
|
6d79065b92 | ||
|
|
6b73802bf7 | ||
|
|
c46f81c628 | ||
|
|
69fbcd4b4b | ||
|
|
1ddaf829fc | ||
|
|
12d94a38ca | ||
|
|
6a0009a3ad | ||
|
|
f4e47e3348 | ||
|
|
dbefa0b24e | ||
|
|
aef4ae747e | ||
|
|
1a1f87c998 | ||
|
|
17b35f7095 | ||
|
|
2eb70a7808 | ||
|
|
b34aa2092e | ||
|
|
f9d77c264a | ||
|
|
c39cd5babd | ||
|
|
e3cd2495cf | ||
|
|
05121a5569 | ||
|
|
080e77a79d | ||
|
|
3c424b60a4 | ||
|
|
c7988cbc00 | ||
|
|
183b0ecd2c | ||
|
|
0cef2791d6 | ||
|
|
cb8df46151 | ||
|
|
3a393be18d | ||
|
|
4d93997f53 | ||
|
|
20d8d2e045 | ||
|
|
74305b5728 | ||
|
|
d52cb55443 | ||
|
|
217dda4225 | ||
|
|
d282515d64 | ||
|
|
80f6e726f8 | ||
|
|
7029decfe8 | ||
|
|
6798d64993 | ||
|
|
de7fe6fee0 | ||
|
|
365409ab6d | ||
|
|
607da65dc4 | ||
|
|
5621318bae | ||
|
|
80cabfbf5e | ||
|
|
b4797984dd | ||
|
|
213e27e4e7 | ||
|
|
d6bb72d5eb | ||
|
|
9ee2e83c7a | ||
|
|
940244f829 | ||
|
|
7182106bab | ||
|
|
f5817926ca | ||
|
|
c9f194f8b8 | ||
|
|
11aab5bc31 | ||
|
|
f85edb62f4 | ||
|
|
80523e71d1 | ||
|
|
765c444a16 | ||
|
|
06b0822a15 | ||
|
|
0b94672e58 | ||
|
|
b979d8a4eb | ||
|
|
2438e89252 | ||
|
|
93899d881c | ||
|
|
36e7342d85 | ||
|
|
b3a2a2af3e | ||
|
|
440e895c51 | ||
|
|
004c736aa1 | ||
|
|
a99e281f8a | ||
|
|
09d814566f | ||
|
|
35a9faeb6a | ||
|
|
e92aabb0e4 | ||
|
|
736b189473 | ||
|
|
2557d57508 | ||
|
|
63de4daf2a | ||
|
|
f53f519d84 | ||
|
|
8bb2a6f327 | ||
|
|
7fe72980ac | ||
|
|
c644fb3142 | ||
|
|
25f0df5899 | ||
|
|
8906d10451 | ||
|
|
e18e47f31f | ||
|
|
43d6c55579 | ||
|
|
bbb2776610 | ||
|
|
f5aa2d9d06 | ||
|
|
0d197b2aa9 | ||
|
|
e06c159759 | ||
|
|
5287c031bc | ||
|
|
d8c09d6dff | ||
|
|
091d9e4af9 | ||
|
|
a4e8347835 | ||
|
|
8b0eae8dca | ||
|
|
1a1d64c827 | ||
|
|
114a963447 | ||
|
|
431b05c72b | ||
|
|
eb09ba6ae9 | ||
|
|
cd22f387f4 | ||
|
|
044cffeb7f | ||
|
|
4088cf7357 | ||
|
|
02a93bbd3f | ||
|
|
dac20a4a04 | ||
|
|
0a7bf5b54d | ||
|
|
a6731e8595 | ||
|
|
8a7dfec1d6 | ||
|
|
de3fc04a05 | ||
|
|
b3361914bd | ||
|
|
9a9cacbdd5 | ||
|
|
8123e78e93 | ||
|
|
1a51edfa8a | ||
|
|
dd856a7619 | ||
|
|
f6b4d5aceb | ||
|
|
9282d639b9 | ||
|
|
ad7a8125db | ||
|
|
ffc559543c | ||
|
|
4cf4fa6f5c | ||
|
|
5aaeb7dced | ||
|
|
9bb23badc0 | ||
|
|
e671ed8e2a | ||
|
|
3316e61824 | ||
|
|
7cfc39190a | ||
|
|
94d3f1cb1e | ||
|
|
a9ddcaecf9 | ||
|
|
1242497d6f | ||
|
|
1f41b4903b | ||
|
|
4e729103d6 | ||
|
|
ae2c8fe59f | ||
|
|
1cdf3abc30 | ||
|
|
f04905b721 | ||
|
|
6662a05a6c | ||
|
|
8c890c415a | ||
|
|
b18075b0c4 | ||
|
|
b090ddd41b | ||
|
|
8947d5fd10 | ||
|
|
331d98f33a | ||
|
|
9402f26857 | ||
|
|
8ca9b43b3b | ||
|
|
8ebf8ab2ea | ||
|
|
4c5713300c | ||
|
|
f15e73438e | ||
|
|
f0e9261c22 | ||
|
|
d3701b7299 | ||
|
|
4eb62becc5 | ||
|
|
2bbc030c40 | ||
|
|
37717366ab | ||
|
|
e85fb44ef2 | ||
|
|
15426c5b7b | ||
|
|
e6edadb07c | ||
|
|
32480b58b3 | ||
|
|
e410edbe1e | ||
|
|
45ab470c52 | ||
|
|
84621de905 | ||
|
|
4ab85a5d23 | ||
|
|
3473d8721e | ||
|
|
d91294a3fe | ||
|
|
a0d2ce44d0 | ||
|
|
43ba159489 | ||
|
|
f0f8a2ea00 | ||
|
|
533ce8d465 | ||
|
|
2092e5d64d | ||
|
|
5b7b839395 | ||
|
|
876d0807c7 | ||
|
|
664aa6b3f0 | ||
|
|
07a3dea9cc | ||
|
|
9c8bb4b00d | ||
|
|
b2c3e64333 | ||
|
|
aea374e9e8 | ||
|
|
7de2bdddf7 | ||
|
|
6b1ee10b33 | ||
|
|
2002ba071b | ||
|
|
121ea7c7ae | ||
|
|
aae315a059 | ||
|
|
d41b82a47f | ||
|
|
5120c7c2d2 | ||
|
|
9fdbc8712a | ||
|
|
ed7c4c4e2a | ||
|
|
7a47907ac7 | ||
|
|
7649cf9326 | ||
|
|
85e9240eee | ||
|
|
5373f1fb42 | ||
|
|
eba2773a9d | ||
|
|
178ff2a675 | ||
|
|
d1d1b70d9b | ||
|
|
fdbfcafb81 | ||
|
|
53e8ea4137 | ||
|
|
69da111d75 | ||
|
|
2c20dec85e | ||
|
|
2db715840f | ||
|
|
55a78b3658 | ||
|
|
51b6f6e782 | ||
|
|
a7073733a6 | ||
|
|
4391566b55 | ||
|
|
f4f7153278 | ||
|
|
790419b95d | ||
|
|
7c40d648b6 | ||
|
|
674c5ca914 | ||
|
|
96113abc00 | ||
|
|
b959e3b909 | ||
|
|
05d3a1da2e | ||
|
|
74a09ac92c | ||
|
|
82691055e6 | ||
|
|
b5fb2f1243 | ||
|
|
ea94880fff | ||
|
|
6a49e0199f | ||
|
|
428d69383a | ||
|
|
314a687943 | ||
|
|
4052fdf03a | ||
|
|
a3a7d39da3 | ||
|
|
341be38f87 | ||
|
|
8e82f8eaa2 | ||
|
|
106ccce871 | ||
|
|
2238224e83 | ||
|
|
32d15e0d48 | ||
|
|
daf7621503 | ||
|
|
5c13015bde | ||
|
|
7b6c459070 | ||
|
|
a21acab67d | ||
|
|
5851ec7b70 | ||
|
|
9dab3261d6 | ||
|
|
7c1f59d651 | ||
|
|
cc35c03cee | ||
|
|
8089efb9b7 | ||
|
|
0c8910512a | ||
|
|
c980aac78c | ||
|
|
580901e91c | ||
|
|
1467549b05 | ||
|
|
d453471fca | ||
|
|
3a7687b31c | ||
|
|
0cda870fbd | ||
|
|
5d91ed144f | ||
|
|
1110f5edcd | ||
|
|
d31d363c44 | ||
|
|
ac68c446fc | ||
|
|
8d1190ce28 | ||
|
|
d993b57a09 | ||
|
|
6865b437a5 | ||
|
|
2515d5dbfd | ||
|
|
99b7649364 | ||
|
|
9e16fc1b1a | ||
|
|
8c950a2fd1 | ||
|
|
0d96ba00b8 | ||
|
|
1e7019cba9 | ||
|
|
84a19396bf | ||
|
|
ce64d7f203 | ||
|
|
2ae2155808 | ||
|
|
1bed0a2259 | ||
|
|
b5c2bb391c | ||
|
|
1090aa0dbd | ||
|
|
d3c1778bc3 | ||
|
|
c0c35306ef | ||
|
|
524fdd2675 | ||
|
|
ec20f9d7d5 | ||
|
|
833a24354e | ||
|
|
e8c3f5a6d6 | ||
|
|
56831390b1 | ||
|
|
353b78d5cf | ||
|
|
da39527ffb | ||
|
|
c5c7b7ba9f | ||
|
|
49197586a4 | ||
|
|
d739a44862 | ||
|
|
be624b638d | ||
|
|
729cb9120d | ||
|
|
e0fe19ebcb | ||
|
|
f682811fdb | ||
|
|
16cbd67b01 | ||
|
|
6285269078 | ||
|
|
6f5e8e23aa | ||
|
|
fff2eaabaa | ||
|
|
d1f7a12fca | ||
|
|
f7738d4515 | ||
|
|
f776276eb5 | ||
|
|
c6e667bb0f | ||
|
|
befa62e69f | ||
|
|
5012cedd7b | ||
|
|
437b672446 | ||
|
|
1199f2fef0 | ||
|
|
0482a516ac | ||
|
|
cd252fddd9 | ||
|
|
f1a1ba8bab | ||
|
|
7a37d11f4f | ||
|
|
2261a549f8 | ||
|
|
0c6e6b1231 | ||
|
|
beb9e212f4 | ||
|
|
ca768ad0d6 | ||
|
|
5d2a97cac6 | ||
|
|
723440a37e | ||
|
|
8fd1eef2d1 | ||
|
|
d4871f4a2f | ||
|
|
6d9074feb5 | ||
|
|
91da9b96b8 | ||
|
|
d3da2fabe8 | ||
|
|
39bce7bd62 | ||
|
|
65c641403c | ||
|
|
190273ba21 | ||
|
|
9e46b3068f | ||
|
|
d660edc670 | ||
|
|
32fb164ef9 | ||
|
|
3d36f05cf9 | ||
|
|
c2c4d71d37 | ||
|
|
e30c10941d | ||
|
|
05e70343a8 | ||
|
|
8ba2c50a6d | ||
|
|
9fe0b621c2 | ||
|
|
e54f4f0b70 | ||
|
|
73797bb610 | ||
|
|
2d658af62e | ||
|
|
e1d866292c | ||
|
|
3cc72198d9 | ||
|
|
29cc4e7af1 | ||
|
|
3f17c3a7ee | ||
|
|
728d6267df | ||
|
|
699a69f1e9 | ||
|
|
b7ba367b70 | ||
|
|
54ee01cb77 | ||
|
|
e8a02fbe2f | ||
|
|
ff637782cb | ||
|
|
ac27737aa5 | ||
|
|
7980d2880d | ||
|
|
0e8580143b | ||
|
|
1c6544fea7 | ||
|
|
23e29a282e | ||
|
|
10f7fffe10 | ||
|
|
50e9b5fb9d | ||
|
|
4a2dc3a2ec | ||
|
|
732d426d72 | ||
|
|
61f24aeefc | ||
|
|
2d3b08d027 | ||
|
|
e39b2ce087 | ||
|
|
3c5d45f4cf | ||
|
|
953410c5df | ||
|
|
ad4f1aecb2 | ||
|
|
163b99c7b1 | ||
|
|
6d748b8920 | ||
|
|
3530aacf64 | ||
|
|
5b46ee97b1 | ||
|
|
96a0983441 | ||
|
|
305529fefc | ||
|
|
5d2fdedfcf | ||
|
|
1cd7aa9ea4 | ||
|
|
1a8403423e | ||
|
|
eff4c740aa | ||
|
|
b31a7c93da | ||
|
|
7f5ea8ad2c | ||
|
|
ba0caceb04 | ||
|
|
fe536eb7b5 | ||
|
|
a3c3c6608f | ||
|
|
48e502b1a1 | ||
|
|
5612aa2f84 | ||
|
|
d026e0f7ea | ||
|
|
41387c58d4 | ||
|
|
6ace1d3102 | ||
|
|
89c428ee4b | ||
|
|
6dd8762dc1 | ||
|
|
bc1579ef95 | ||
|
|
a262b3cc4b | ||
|
|
371284d360 | ||
|
|
4ee0dda38c | ||
|
|
b5555698e8 | ||
|
|
b71228a24a | ||
|
|
b54af26e42 | ||
|
|
2104c70e25 | ||
|
|
7778d2b721 | ||
|
|
9cd49c8109 | ||
|
|
01a08d670a | ||
|
|
c8e5e745ce | ||
|
|
e56942ee54 | ||
|
|
d7d9bb51b2 | ||
|
|
06e008e306 | ||
|
|
2e91e53da7 | ||
|
|
c80c801239 | ||
|
|
d4b560313c | ||
|
|
8a9eb6198d | ||
|
|
cf5852e27b | ||
|
|
7b940dc7b8 | ||
|
|
0b280496b5 | ||
|
|
e9f7ed8480 | ||
|
|
588bf5678b | ||
|
|
2fd71bfd6a | ||
|
|
5fa3e4b735 | ||
|
|
94294ffd71 | ||
|
|
df8ed662e8 | ||
|
|
41660a5056 | ||
|
|
969a4f09f8 | ||
|
|
4a6e28b629 | ||
|
|
8eddc035c5 | ||
|
|
26c90d4c32 | ||
|
|
c91bbf834a | ||
|
|
913ca3547a | ||
|
|
5906bbc9ec | ||
|
|
b3b6d25d91 | ||
|
|
b323e88504 | ||
|
|
775d7c0d56 | ||
|
|
3def3b69dc | ||
|
|
9132518de4 | ||
|
|
c52adbde4b | ||
|
|
870c514a15 | ||
|
|
2300df715c | ||
|
|
94b304d417 | ||
|
|
c64b709e33 | ||
|
|
6b56829d92 | ||
|
|
2a40d552e3 | ||
|
|
032c7bfca1 | ||
|
|
01d86180a9 | ||
|
|
edfd847318 | ||
|
|
36ad2c9ecd | ||
|
|
ce01c9366a | ||
|
|
a74345ea5f | ||
|
|
b7b46f1350 | ||
|
|
c21e092c89 | ||
|
|
867ce2d4ba | ||
|
|
0a16acb362 | ||
|
|
9a59fac610 | ||
|
|
f20736282b | ||
|
|
08a6e72cc2 | ||
|
|
16bfd769aa | ||
|
|
3c22cec221 | ||
|
|
a583b2b195 | ||
|
|
bf92e05cbe | ||
|
|
7a2a662c5f | ||
|
|
e4fa622b71 | ||
|
|
d6da8ddd2f | ||
|
|
8306ae0f39 | ||
|
|
616be649b5 | ||
|
|
a0ecc6bd69 | ||
|
|
3dcf07881a | ||
|
|
4d4276847b | ||
|
|
c7fad71ae2 | ||
|
|
dbc73da777 | ||
|
|
b28a16dcea | ||
|
|
cf73d6e338 | ||
|
|
dcb1139a6a | ||
|
|
52e0baa614 | ||
|
|
ede7c4452d | ||
|
|
0ee4c53252 | ||
|
|
a9c86dc6dc | ||
|
|
12ed3200a2 | ||
|
|
23614f7e9c | ||
|
|
40b623024c | ||
|
|
be6ec797c7 | ||
|
|
35556e2acd | ||
|
|
72d02890b0 | ||
|
|
bcc07b181d | ||
|
|
00f6ad1417 | ||
|
|
3398f0db3d | ||
|
|
3262548b25 | ||
|
|
08bb2af98e | ||
|
|
8b3c5a3741 | ||
|
|
bb642be13b | ||
|
|
b2621ace43 | ||
|
|
2a6a1b50af | ||
|
|
5a17ed48ae | ||
|
|
c4fa3466a7 | ||
|
|
f9230eacc8 | ||
|
|
2101dddcc6 | ||
|
|
9c6303addb | ||
|
|
8ec8971f2a | ||
|
|
2158a9ee48 | ||
|
|
26bdf8f577 | ||
|
|
e8785fd5b2 | ||
|
|
d5fed7fdce | ||
|
|
8ceaf7478c | ||
|
|
80b4d6c91b | ||
|
|
b741879d5a | ||
|
|
5e0a84ae10 | ||
|
|
b89a6ea218 | ||
|
|
69e6b062d7 | ||
|
|
d40fbccf24 | ||
|
|
5cddef6000 | ||
|
|
382615570f | ||
|
|
324c7234f8 | ||
|
|
24f15d8236 | ||
|
|
13ac2ef8ba | ||
|
|
3994ca3e77 | ||
|
|
87eb8c6cdf | ||
|
|
9aa2ff00eb | ||
|
|
fdc27a38e2 | ||
|
|
f745fdd0aa | ||
|
|
4c93945eaf | ||
|
|
ec864b2b8e | ||
|
|
f7fcfb3193 | ||
|
|
adf87c8ec2 | ||
|
|
aa2e6af52c | ||
|
|
e09da313e0 | ||
|
|
4b8a127cd2 | ||
|
|
90578ca29e | ||
|
|
f7fe71a2d5 | ||
|
|
fd4a156e25 | ||
|
|
5bacc37dd7 | ||
|
|
a7b7ea826f | ||
|
|
0c6b0a2bae | ||
|
|
01fd6157e1 | ||
|
|
e382c59b6b | ||
|
|
373486d54a | ||
|
|
d802c83135 | ||
|
|
b0d77ea3e4 | ||
|
|
e1422ce1c8 | ||
|
|
e296be59b9 | ||
|
|
d1093d9717 | ||
|
|
2b3a0d30c7 | ||
|
|
f7b599e200 | ||
|
|
af901190b9 | ||
|
|
db5a2e44e6 | ||
|
|
9d166377cb | ||
|
|
f0f65d0cf0 | ||
|
|
2eed2bd0a9 | ||
|
|
a43ded3a85 | ||
|
|
0fe872e42f | ||
|
|
4d4ab28c40 | ||
|
|
35ca824390 | ||
|
|
62f1e3111d | ||
|
|
7b6bca31ba | ||
|
|
07704327ab | ||
|
|
db885dfcc8 | ||
|
|
2d86bbb5e8 | ||
|
|
6db0bbc341 | ||
|
|
5ec64621fe | ||
|
|
8b60af90ab | ||
|
|
a4c1cad581 | ||
|
|
d323fa69af | ||
|
|
56b4d3fcfc | ||
|
|
a9af3ebdbb | ||
|
|
4618bfbc4e | ||
|
|
4c190bd9a7 | ||
|
|
7bc9b1d4cb | ||
|
|
df98af33ba | ||
|
|
464bf5c428 | ||
|
|
62878cb969 | ||
|
|
0f7b9842bb | ||
|
|
1cce787e62 | ||
|
|
3dc4ad7433 | ||
|
|
9644ae737d | ||
|
|
7eb500d071 | ||
|
|
848581e155 | ||
|
|
80e9814cd6 | ||
|
|
2374e69b06 | ||
|
|
6f892e90b9 | ||
|
|
fb4fefb697 | ||
|
|
056d3e103d | ||
|
|
ef6973ff50 | ||
|
|
bb1f5f61ab | ||
|
|
f291935cc3 | ||
|
|
05ece42912 | ||
|
|
8e18e5d16c | ||
|
|
69ffd18af6 | ||
|
|
ba49e0e018 | ||
|
|
061afe4cf4 | ||
|
|
7afc024819 | ||
|
|
66ac29f692 | ||
|
|
f5d460eb80 | ||
|
|
3a8b23f482 | ||
|
|
9b78889f25 | ||
|
|
3ac8143589 | ||
|
|
7e8d1f3d06 | ||
|
|
1e5dc3670f | ||
|
|
42d28ea80f | ||
|
|
2a147f119e | ||
|
|
5e07c8010f | ||
|
|
c484a45822 | ||
|
|
724d723cdc | ||
|
|
626ec17b45 | ||
|
|
c60ad9f3fc | ||
|
|
9367e66432 | ||
|
|
657ddb761a | ||
|
|
9622060ac6 | ||
|
|
f0bab6a368 | ||
|
|
3fc79deee0 | ||
|
|
32a0937e84 | ||
|
|
e97418f979 | ||
|
|
3be770a718 | ||
|
|
d52ecca5dc | ||
|
|
3132a52f2a | ||
|
|
b4549fa2cc | ||
|
|
672e85fe22 | ||
|
|
da742f7dc7 | ||
|
|
1f6c743356 | ||
|
|
5a0d1dbe0b | ||
|
|
12a40e76d9 | ||
|
|
b4e37d6c8b | ||
|
|
441dc6f8db | ||
|
|
76847fafb1 | ||
|
|
be7004adc8 | ||
|
|
538d8eaede | ||
|
|
cf93e86a0c | ||
|
|
411d0e9ad9 | ||
|
|
a23b662332 | ||
|
|
b8290279fc | ||
|
|
23b9caa8f2 | ||
|
|
361f283a15 | ||
|
|
34867898b9 | ||
|
|
42459eca60 | ||
|
|
66d4c9ef0e | ||
|
|
ada0e3740a | ||
|
|
c8d1054640 | ||
|
|
0d6a9dd348 | ||
|
|
17e58da34d | ||
|
|
f515f18ac5 | ||
|
|
cc0004bab9 | ||
|
|
347ab0cb5d | ||
|
|
8004470a07 | ||
|
|
b36eec08aa | ||
|
|
5e9a002cd1 | ||
|
|
bee394b8c2 | ||
|
|
dbd0715c69 | ||
|
|
f5d55707a9 | ||
|
|
a5fd491e6c | ||
|
|
8766ec4639 | ||
|
|
273f40bb86 | ||
|
|
71a6f04ce0 | ||
|
|
b6663dc604 | ||
|
|
35991eed9f | ||
|
|
4431065e8f | ||
|
|
e33e3c5569 | ||
|
|
9eae44bc89 | ||
|
|
6485807346 | ||
|
|
236358c237 | ||
|
|
704a35f473 | ||
|
|
b47e4899a1 | ||
|
|
dd48e1f458 | ||
|
|
3fb9bf8f90 | ||
|
|
88696a2d0e | ||
|
|
0611cac92f | ||
|
|
4135d1096c | ||
|
|
6945dfd7b1 | ||
|
|
c74f16a418 | ||
|
|
6917827348 | ||
|
|
cf251ebd28 | ||
|
|
c5054948f1 | ||
|
|
32856e223a | ||
|
|
9c95738251 | ||
|
|
08b6413634 | ||
|
|
f62373675d | ||
|
|
695aff6bce | ||
|
|
1a4ffa5bee | ||
|
|
14075b3f3f | ||
|
|
49d611b971 | ||
|
|
5311b1dc3d | ||
|
|
6548f00ab0 | ||
|
|
1e362973a5 | ||
|
|
7959deea83 | ||
|
|
8c4094706d | ||
|
|
25c201b472 | ||
|
|
04d9172cce | ||
|
|
113d5b99bb | ||
|
|
857ae6a0a1 | ||
|
|
3028291cce | ||
|
|
891c67f39f | ||
|
|
30d6828707 | ||
|
|
60d2b490c2 | ||
|
|
aa351abd15 | ||
|
|
67ccbbd4f7 | ||
|
|
b4fb054a7f | ||
|
|
d38737f642 | ||
|
|
b43f38c9dd | ||
|
|
5662d2f2f5 | ||
|
|
4d2d8b0976 | ||
|
|
362d433bb3 |
+59
@@ -0,0 +1,59 @@
|
|||||||
|
<?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">
|
||||||
|
<parent>
|
||||||
|
<artifactId>ruoyi</artifactId>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<version>3.8.6</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>pay</artifactId>
|
||||||
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
|
<maven.compiler.target>8</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-autoconfigure</artifactId>
|
||||||
|
<version>2.7.10</version>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>1.18.22</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>fastjson</artifactId>
|
||||||
|
<version>1.2.72</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-all</artifactId>
|
||||||
|
<version>5.7.12</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.wechatpay-apiv3</groupId>
|
||||||
|
<artifactId>wechatpay-apache-httpclient</artifactId>
|
||||||
|
<version>0.4.7</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alipay.sdk</groupId>
|
||||||
|
<artifactId>alipay-sdk-java</artifactId>
|
||||||
|
<version>4.34.8.ALL</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.ruoyi;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务回调处理接口
|
||||||
|
*/
|
||||||
|
public interface CallBackService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成功支付--处理业务逻辑
|
||||||
|
* @param orderSn 订单号
|
||||||
|
*/
|
||||||
|
void successPay(String orderSn);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 失败支付-处理业务逻辑
|
||||||
|
* @param orderSn 订单号
|
||||||
|
*/
|
||||||
|
void failPay(String orderSn);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款成功-处理业务逻辑
|
||||||
|
* @param orderSn 订单号
|
||||||
|
*/
|
||||||
|
void successRefund(String orderSn);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款失败-处理业务逻辑
|
||||||
|
* @param orderSn 订单号
|
||||||
|
*/
|
||||||
|
void failRefund(String orderSn);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.ruoyi;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.dto.*;
|
||||||
|
import com.ruoyi.exceptions.TradeException;
|
||||||
|
|
||||||
|
public interface ElegentPay {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统一下单接口
|
||||||
|
* @param payRequest 支付请求
|
||||||
|
* @param tradeType 交易类型
|
||||||
|
* @param platform 平台
|
||||||
|
* @return 支付响应
|
||||||
|
* @throws TradeException
|
||||||
|
*/
|
||||||
|
PayResponse requestPay(PayRequest payRequest, String tradeType, String platform) throws TradeException;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭订单
|
||||||
|
* @param orderSn 订单号
|
||||||
|
* @param platform 平台
|
||||||
|
* @return 是否成功关闭订单
|
||||||
|
* @throws TradeException
|
||||||
|
*/
|
||||||
|
Boolean closePay(String orderSn, String platform) throws TradeException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款
|
||||||
|
* @param refundRequest 退款请求封装对象
|
||||||
|
* @param platform 平台
|
||||||
|
* @return 是否成功退款
|
||||||
|
* @throws TradeException
|
||||||
|
*/
|
||||||
|
Boolean refund(RefundRequest refundRequest, String platform) throws TradeException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单号查询订单
|
||||||
|
* @param orderSn 订单号
|
||||||
|
* @param platform 平台
|
||||||
|
* @return 查询响应对象
|
||||||
|
* @throws TradeException
|
||||||
|
*/
|
||||||
|
QueryResponse queryTradingOrderNo(String orderSn , String platform) throws TradeException;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询单笔退款API
|
||||||
|
* @param orderSn 订单号
|
||||||
|
* @param platform 平台
|
||||||
|
* @return 查询退款响应对象
|
||||||
|
* @throws TradeException
|
||||||
|
*/
|
||||||
|
QueryRefundResponse queryRefundTrading(String orderSn , String platform) throws TradeException;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得openID
|
||||||
|
* @param code
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getOpenid(String code, String platform);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.ruoyi.ali;
|
||||||
|
|
||||||
|
import com.ruoyi.key.KeyManager;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付宝权限对接类
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@ConfigurationProperties("elegent.pay.alipay")
|
||||||
|
@Data
|
||||||
|
public class AlipayConfig {
|
||||||
|
/**
|
||||||
|
* 应用识别码
|
||||||
|
*/
|
||||||
|
private String appId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 密钥加密方式 RSA2
|
||||||
|
*/
|
||||||
|
@Value("${elegent.pay.alipay.charset:RSA2}")
|
||||||
|
private String signType;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private KeyManager keyManager;
|
||||||
|
|
||||||
|
public String getPrivateKey(){
|
||||||
|
return keyManager.getKey("alipay_private.key");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPublicKey(){
|
||||||
|
return keyManager.getKey("alipay_public.key");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.ruoyi.ali;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ZFBConstant
|
||||||
|
* @description 支付宝相关的常量
|
||||||
|
*/
|
||||||
|
public class AlipayConstant {
|
||||||
|
|
||||||
|
public static final String SUCCESS = "SUCCESS";
|
||||||
|
|
||||||
|
public static final String FAIL = "FAIL";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易状态(用于转换)
|
||||||
|
*/
|
||||||
|
public static final Map<String,String> TRADE_STATE = new HashMap<String,String>(){
|
||||||
|
{
|
||||||
|
put("TRADE_SUCCESS", "SUCCESS");
|
||||||
|
put("WAIT_BUYER_PAY", "NOTPAY");
|
||||||
|
put("TRADE_CLOSED", "CLOSED");
|
||||||
|
put("TRADE_FINISHED", "FINISHED");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public static final String domain="https://openapi.alipay.com/gateway.do";
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,461 @@
|
|||||||
|
package com.ruoyi.ali;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.alipay.api.AlipayApiException;
|
||||||
|
import com.alipay.api.AlipayClient;
|
||||||
|
import com.alipay.api.DefaultAlipayClient;
|
||||||
|
import com.alipay.api.request.*;
|
||||||
|
import com.alipay.api.response.*;
|
||||||
|
import com.ruoyi.CallBackService;
|
||||||
|
import com.ruoyi.annotation.TradePlatform;
|
||||||
|
import com.ruoyi.config.CallbackConfig;
|
||||||
|
import com.ruoyi.constant.PayConstant;
|
||||||
|
import com.ruoyi.constant.Platform;
|
||||||
|
import com.ruoyi.constant.TradeType;
|
||||||
|
import com.ruoyi.core.ElegentTrade;
|
||||||
|
import com.ruoyi.dto.*;
|
||||||
|
import com.ruoyi.exceptions.TradeException;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付宝支付的策略类
|
||||||
|
* @author wgl
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@TradePlatform(Platform.ALI)
|
||||||
|
@Slf4j
|
||||||
|
public class AlipayElegentTrade implements ElegentTrade {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AlipayConfig alipayConfig;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CallbackConfig callbackConfig;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CallBackService callBackService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取回调地址
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private String getPayNotifyUrl(){
|
||||||
|
return callbackConfig.getDomain()+ PayConstant.CALLBACK_PATH+ PayConstant.NOTIFY +"/"+ Platform.ALI;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取退款回调
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private String getRefundNotifyUrl(){
|
||||||
|
return callbackConfig.getDomain()+ PayConstant.CALLBACK_PATH+ PayConstant.REFUND_NOTIFY +"/"+ Platform.ALI;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建支付订单
|
||||||
|
* @param payRequest
|
||||||
|
* @return
|
||||||
|
* @throws TradeException
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PayResponse requestPay(PayRequest payRequest, String tradeType) throws TradeException {
|
||||||
|
if(TradeType.NATIVE.equals( tradeType )){
|
||||||
|
return createNativeOrder(payRequest);
|
||||||
|
}
|
||||||
|
if(TradeType.JSAPI.equals( tradeType )){
|
||||||
|
return createJsApiOrder(payRequest);
|
||||||
|
}
|
||||||
|
if(TradeType.H5.equals( tradeType )){
|
||||||
|
return createH5Order(payRequest);
|
||||||
|
}
|
||||||
|
if(TradeType.APP.equals( tradeType )){
|
||||||
|
return createAPPOrder(payRequest);
|
||||||
|
}
|
||||||
|
return createNativeOrder(payRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本地支付(扫码)
|
||||||
|
* https://opendocs.alipay.com/open/194/106078?ref=api#预下单
|
||||||
|
* @param payRequest
|
||||||
|
* @return
|
||||||
|
* @throws TradeException
|
||||||
|
*/
|
||||||
|
private PayResponse createNativeOrder(PayRequest payRequest) throws TradeException {
|
||||||
|
try {
|
||||||
|
AlipayClient alipayClient = getAliHttpClient();
|
||||||
|
AlipayTradePrecreateRequest request = new AlipayTradePrecreateRequest();
|
||||||
|
|
||||||
|
request.setNotifyUrl(getPayNotifyUrl());
|
||||||
|
|
||||||
|
JSONObject bizContent = new JSONObject();
|
||||||
|
bizContent.put("out_trade_no", payRequest.getOrderSn());
|
||||||
|
//转换
|
||||||
|
//String totalFee= BigDecimal.valueOf(payRequest.getTotalFee()).divide(new BigDecimal(100) ).toString();
|
||||||
|
bizContent.put("total_amount", fenToYuan(payRequest.getTotalFee()));
|
||||||
|
bizContent.put("subject", payRequest.getBody());
|
||||||
|
request.setBizContent(bizContent.toString());
|
||||||
|
AlipayTradePrecreateResponse response = alipayClient.execute(request);
|
||||||
|
|
||||||
|
if (response.isSuccess()) {
|
||||||
|
PayResponse payResponse =new PayResponse();
|
||||||
|
payResponse.setSuccess(true);
|
||||||
|
payResponse.setCode_url(response.getQrCode()); //本地支付二维码
|
||||||
|
payResponse.setOrder_sn(payRequest.getOrderSn());
|
||||||
|
return payResponse;
|
||||||
|
} else {
|
||||||
|
log.error("调用失败");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new TradeException("订单创建失败,订单号:"+ payRequest.getOrderSn());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序
|
||||||
|
* https://opendocs.alipay.com/mini/03l5wn
|
||||||
|
* @param payRequest
|
||||||
|
* @return
|
||||||
|
* @throws TradeException
|
||||||
|
*/
|
||||||
|
private PayResponse createJsApiOrder(PayRequest payRequest) throws TradeException {
|
||||||
|
AlipayClient alipayClient = getAliHttpClient();
|
||||||
|
try {
|
||||||
|
AlipayTradeCreateRequest request = new AlipayTradeCreateRequest();
|
||||||
|
request.setNotifyUrl(getPayNotifyUrl());
|
||||||
|
JSONObject bizContent = new JSONObject();
|
||||||
|
bizContent.put("out_trade_no", payRequest.getOrderSn());
|
||||||
|
bizContent.put("total_amount", fenToYuan( payRequest.getTotalFee() ));
|
||||||
|
bizContent.put("subject", payRequest.getBody());
|
||||||
|
bizContent.put("buyer_id", payRequest.getOpenid());
|
||||||
|
bizContent.put("timeout_express", "10m");
|
||||||
|
request.setBizContent(bizContent.toString());
|
||||||
|
AlipayTradeCreateResponse response = alipayClient.sdkExecute(request);
|
||||||
|
if (response.isSuccess()) {
|
||||||
|
PayResponse payResponse =new PayResponse();
|
||||||
|
payResponse.setSuccess(true);
|
||||||
|
payResponse.setPrepay_id(response.getTradeNo());
|
||||||
|
payResponse.setOrder_sn(response.getOutTradeNo());
|
||||||
|
return payResponse;
|
||||||
|
} else {
|
||||||
|
log.error("调用失败");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
throw new TradeException("订单创建失败,订单号:"+ payRequest.getOrderSn());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* H5
|
||||||
|
* https://opendocs.alipay.com/mini/03l5wn
|
||||||
|
* @param payRequest
|
||||||
|
* @return
|
||||||
|
* @throws TradeException
|
||||||
|
*/
|
||||||
|
private PayResponse createH5Order(PayRequest payRequest) throws TradeException {
|
||||||
|
AlipayClient alipayClient = getAliHttpClient();
|
||||||
|
try {
|
||||||
|
AlipayTradeWapPayRequest request = new AlipayTradeWapPayRequest();
|
||||||
|
request.setNotifyUrl(getPayNotifyUrl());
|
||||||
|
request.setReturnUrl("");
|
||||||
|
JSONObject bizContent = new JSONObject();
|
||||||
|
bizContent.put("out_trade_no", payRequest.getOrderSn());
|
||||||
|
bizContent.put("total_amount", fenToYuan( payRequest.getTotalFee() ));
|
||||||
|
bizContent.put("subject", payRequest.getBody());
|
||||||
|
bizContent.put("product_code", "QUICK_WAP_WAY");
|
||||||
|
|
||||||
|
request.setBizContent(bizContent.toString());
|
||||||
|
AlipayTradeWapPayResponse response = alipayClient.pageExecute(request);
|
||||||
|
if (response.isSuccess()) {
|
||||||
|
PayResponse payResponse =new PayResponse();
|
||||||
|
payResponse.setSuccess(true);
|
||||||
|
payResponse.setPrepay_id(response.getTradeNo());
|
||||||
|
payResponse.setOrder_sn(response.getOutTradeNo());
|
||||||
|
return payResponse;
|
||||||
|
} else {
|
||||||
|
log.error("调用失败");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
throw new TradeException("订单创建失败,订单号:"+ payRequest.getOrderSn());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APP
|
||||||
|
* https://opendocs.alipay.com/open/02e7gq?ref=api&scene=20
|
||||||
|
* @param payRequest
|
||||||
|
* @return
|
||||||
|
* @throws TradeException
|
||||||
|
*/
|
||||||
|
private PayResponse createAPPOrder(PayRequest payRequest) throws TradeException {
|
||||||
|
AlipayClient alipayClient = getAliHttpClient();
|
||||||
|
try {
|
||||||
|
AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest();
|
||||||
|
request.setNotifyUrl(getPayNotifyUrl());
|
||||||
|
JSONObject bizContent = new JSONObject();
|
||||||
|
bizContent.put("out_trade_no", payRequest.getOrderSn());
|
||||||
|
bizContent.put("total_amount", fenToYuan( payRequest.getTotalFee() ));
|
||||||
|
bizContent.put("subject", payRequest.getBody());
|
||||||
|
bizContent.put("product_code", "QUICK_MSECURITY_PAY");
|
||||||
|
|
||||||
|
request.setBizContent(bizContent.toString());
|
||||||
|
AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request);
|
||||||
|
if (response.isSuccess()) {
|
||||||
|
PayResponse payResponse =new PayResponse();
|
||||||
|
payResponse.setSuccess(true);
|
||||||
|
payResponse.setPrepay_id(response.getTradeNo());
|
||||||
|
payResponse.setOrder_sn(response.getOutTradeNo());
|
||||||
|
return payResponse;
|
||||||
|
} else {
|
||||||
|
log.error("调用失败");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
throw new TradeException("订单创建失败,订单号:"+ payRequest.getOrderSn());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭订单
|
||||||
|
* @param orderSn
|
||||||
|
* @return
|
||||||
|
* @throws TradeException
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean closePay(String orderSn) throws TradeException {
|
||||||
|
try {
|
||||||
|
AlipayClient alipayClient = getAliHttpClient();
|
||||||
|
AlipayTradeCloseRequest request = new AlipayTradeCloseRequest();
|
||||||
|
JSONObject bizContent = new JSONObject();
|
||||||
|
bizContent.put("trade_no", orderSn);
|
||||||
|
request.setBizContent(bizContent.toString());
|
||||||
|
AlipayTradeCloseResponse response = alipayClient.execute(request);
|
||||||
|
if (response.isSuccess()) {
|
||||||
|
log.info("调用成功");
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
log.error("调用失败");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
throw new TradeException("订单关闭失败,订单号:"+orderSn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款接口
|
||||||
|
* alipay.trade.refund(统一收单交易退款接口)
|
||||||
|
* https://opendocs.alipay.com/open/02ekfk
|
||||||
|
* @param refundRequest
|
||||||
|
* @return
|
||||||
|
* @throws TradeException
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean refund(RefundRequest refundRequest) throws TradeException {
|
||||||
|
try {
|
||||||
|
AlipayClient alipayClient = getAliHttpClient();
|
||||||
|
AlipayTradeRefundRequest request = new AlipayTradeRefundRequest();
|
||||||
|
request.setNotifyUrl(getRefundNotifyUrl()); //退款回调
|
||||||
|
JSONObject bizContent = new JSONObject();
|
||||||
|
bizContent.put("refund_amount", fenToYuan(refundRequest.getRefundAmount() ));
|
||||||
|
bizContent.put("out_trade_no", refundRequest.getOrderSn());
|
||||||
|
//退款请求号,做幂等性校验
|
||||||
|
if(refundRequest.getRequestNo()!=null){
|
||||||
|
bizContent.put("out_request_no", refundRequest.getRequestNo());
|
||||||
|
}else{
|
||||||
|
bizContent.put("out_request_no", refundRequest.getOrderSn());
|
||||||
|
}
|
||||||
|
request.setBizContent(bizContent.toString());
|
||||||
|
AlipayTradeRefundResponse response = alipayClient.execute(request);
|
||||||
|
if (response.isSuccess()) {
|
||||||
|
if("Y".equals(response.getFundChange())) {
|
||||||
|
log.info("退款成功{}",refundRequest.getOrderSn());
|
||||||
|
callBackService.successRefund(refundRequest.getOrderSn());
|
||||||
|
return true;
|
||||||
|
}else{
|
||||||
|
//退款失败
|
||||||
|
log.error("退款失败{}",refundRequest.getOrderSn());
|
||||||
|
callBackService.failRefund(refundRequest.getOrderSn());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.error("退款调用失败{}",refundRequest.getOrderSn());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new TradeException("订单退款失败,订单号:"+ refundRequest.getOrderSn());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询单笔交易订单
|
||||||
|
* 参考官网: https://opendocs.alipay.com/open/02e7gm?ref=api#请求示例
|
||||||
|
*
|
||||||
|
* @param orderSn
|
||||||
|
* @return
|
||||||
|
* @throws TradeException
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public QueryResponse queryTradingOrderNo(String orderSn) throws TradeException {
|
||||||
|
AlipayClient alipayClient = getAliHttpClient();
|
||||||
|
try {
|
||||||
|
AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
|
||||||
|
JSONObject bizContent = new JSONObject();
|
||||||
|
bizContent.put("out_trade_no", orderSn);
|
||||||
|
request.setBizContent(bizContent.toString());
|
||||||
|
AlipayTradeQueryResponse response = alipayClient.execute(request);
|
||||||
|
QueryResponse queryResponse=new QueryResponse();
|
||||||
|
queryResponse.setOrder_sn(orderSn );
|
||||||
|
if (response.isSuccess()) {
|
||||||
|
queryResponse.setTransaction_id( response.getTradeNo() );
|
||||||
|
queryResponse.setTrade_state(AlipayConstant.TRADE_STATE.get( response.getTradeStatus()) );//交易状态
|
||||||
|
|
||||||
|
//int total = BigDecimal.valueOf(Double.valueOf(response.getTotalAmount())).multiply(new BigDecimal(100)).intValue();
|
||||||
|
queryResponse.setTotal( yuanToFen(response.getTotalAmount()) ); //总金额
|
||||||
|
|
||||||
|
//int buyer_pay_amount = BigDecimal.valueOf(Double.valueOf(response.getBuyerPayAmount())).multiply(new BigDecimal(100)).intValue();
|
||||||
|
//queryResponse.setPayer_total( yuanToFen(response.getBuyerPayAmount()) );//支付金额
|
||||||
|
|
||||||
|
queryResponse.setOpenid( response.getBuyerUserId());
|
||||||
|
Map map = JSON.parseObject(response.getBody(), Map.class ) ;
|
||||||
|
queryResponse.setExpand(map);//全部数据
|
||||||
|
return queryResponse;
|
||||||
|
} else {
|
||||||
|
queryResponse.setTrade_state("NOTPAY");
|
||||||
|
return queryResponse;
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
//throw new TradeException("订单查询失败,订单号:"+orderSn);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询退款订单
|
||||||
|
* @param orderSn
|
||||||
|
* @return
|
||||||
|
* @throws TradeException
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public QueryRefundResponse queryRefundTrading(String orderSn) throws TradeException {
|
||||||
|
try {
|
||||||
|
AlipayClient alipayClient = getAliHttpClient();
|
||||||
|
AlipayTradeFastpayRefundQueryRequest request = new AlipayTradeFastpayRefundQueryRequest();
|
||||||
|
JSONObject bizContent = new JSONObject();
|
||||||
|
bizContent.put("out_request_no", orderSn);
|
||||||
|
request.setBizContent(bizContent.toString());
|
||||||
|
AlipayTradeFastpayRefundQueryResponse response = alipayClient.execute(request);
|
||||||
|
if (response.isSuccess()) {
|
||||||
|
log.info("调用成功");
|
||||||
|
Map map = JSON.parseObject(response.getBody(), Map.class );
|
||||||
|
|
||||||
|
QueryRefundResponse queryRefundResponse=new QueryRefundResponse();
|
||||||
|
|
||||||
|
queryRefundResponse.setOrder_sn( (String) map.get("out_trade_no") );
|
||||||
|
queryRefundResponse.setTransaction_id( (String) map.get("trade_no") );
|
||||||
|
queryRefundResponse.setTotal( (Integer) map.get("total_amount") ); //总金额
|
||||||
|
//queryRefundResponse.setPayer_total( (Integer) map.get("total_amount") );//支付金额
|
||||||
|
queryRefundResponse.setRefund((Integer) map.get("refund_amount") ); //退款金额
|
||||||
|
queryRefundResponse.setRefund_id((String) map.get("trade_no") ); //退款单号
|
||||||
|
queryRefundResponse.setOut_refund_no( (String) map.get("out_request_no") );//退款订单号
|
||||||
|
//queryRefundResponse.setChannel( (String) map.get("channel") ); //通道
|
||||||
|
//queryRefundResponse.setUser_received_account( (String) map.get("user_received_account") ); //账号
|
||||||
|
queryRefundResponse.setStatus( (String) map.get("refund_status") ); //状态
|
||||||
|
queryRefundResponse.setSuccess_time( (String) map.get("gmt_refund_pay") );
|
||||||
|
//queryRefundResponse.setCreate_time( (String) map.get("gmt_refund_pay") );
|
||||||
|
|
||||||
|
queryRefundResponse.setExpand(map);
|
||||||
|
return queryRefundResponse;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
log.error("调用失败");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
//throw new TradeException("退款订单查询失败,订单号:"+ orderSn);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOpenid(String code) {
|
||||||
|
AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do",
|
||||||
|
alipayConfig.getAppId(), alipayConfig.getPrivateKey(), "json", "utf-8", alipayConfig.getPublicKey(), alipayConfig.getSignType());
|
||||||
|
AlipaySystemOauthTokenRequest request = new AlipaySystemOauthTokenRequest();
|
||||||
|
request.setCode(code);
|
||||||
|
request.setGrantType("authorization_code");
|
||||||
|
try {
|
||||||
|
AlipaySystemOauthTokenResponse oauthTokenResponse = alipayClient.execute(request);
|
||||||
|
return oauthTokenResponse.getUserId();
|
||||||
|
} catch (AlipayApiException e) {
|
||||||
|
//处理异常
|
||||||
|
e.printStackTrace();
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取支付宝连接
|
||||||
|
* 参考官网:https://opendocs.alipay.com/open/01csp3?ref=api#公钥模式加签
|
||||||
|
* 公钥模式加签
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private AlipayClient getAliHttpClient(){
|
||||||
|
try {
|
||||||
|
com.alipay.api.AlipayConfig alipayConfig = new com.alipay.api.AlipayConfig();
|
||||||
|
alipayConfig.setServerUrl(AlipayConstant.domain);
|
||||||
|
alipayConfig.setAppId(this.alipayConfig.getAppId());
|
||||||
|
alipayConfig.setPrivateKey(this.alipayConfig.getPrivateKey());
|
||||||
|
alipayConfig.setFormat("json");
|
||||||
|
alipayConfig.setCharset("utf-8");
|
||||||
|
alipayConfig.setAlipayPublicKey(this.alipayConfig.getPublicKey());
|
||||||
|
alipayConfig.setSignType(this.alipayConfig.getSignType());
|
||||||
|
//构造client
|
||||||
|
AlipayClient alipayClient = new DefaultAlipayClient(alipayConfig);
|
||||||
|
return alipayClient;
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new TradeException("支付宝支付--初始化,校验系统参数失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分转换为元
|
||||||
|
* @param fen
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private String fenToYuan(int fen){
|
||||||
|
//转换为元
|
||||||
|
return BigDecimal.valueOf(fen).divide(new BigDecimal(100) ).toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private int yuanToFen(String yuan){
|
||||||
|
return BigDecimal.valueOf(Double.valueOf(yuan)).multiply(new BigDecimal(100)).intValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
package com.ruoyi.ali;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alipay.api.internal.util.AlipaySignature;
|
||||||
|
import com.ruoyi.annotation.TradePlatform;
|
||||||
|
import com.ruoyi.constant.Platform;
|
||||||
|
import com.ruoyi.core.ElegentValid;
|
||||||
|
import com.ruoyi.dto.ValidResponse;
|
||||||
|
import com.ruoyi.exceptions.TradeException;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpEntity;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@TradePlatform(Platform.ALI)
|
||||||
|
@Slf4j
|
||||||
|
public class AlipayElegentValid implements ElegentValid {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AlipayConfig alipayConfig;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单回调结果通知验签
|
||||||
|
* 参考代码: https://opendocs.alipay.com/open/194/103296?ref=api 异步返回结果的验签
|
||||||
|
* @param httpEntity
|
||||||
|
* @param httpRequest
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ValidResponse validPay(HttpEntity<String> httpEntity, HttpServletRequest httpRequest) throws TradeException {
|
||||||
|
ValidResponse validResponse=new ValidResponse();
|
||||||
|
try {
|
||||||
|
Map<String, String> params = getParams(httpRequest);
|
||||||
|
//获取支付宝POST过来反馈信息,将异步通知中收到的待验证所有参数都存放到map中
|
||||||
|
//String body = httpEntity.getBody();
|
||||||
|
//调用SDK验证签名
|
||||||
|
//公钥验签示例代码
|
||||||
|
boolean signVerified = AlipaySignature.rsaCheckV1(params, alipayConfig.getPublicKey(), "utf-8", alipayConfig.getSignType());
|
||||||
|
if (signVerified) {
|
||||||
|
validResponse.setValid(true);
|
||||||
|
validResponse.setOrderSn((String) params.get("out_trade_no"));
|
||||||
|
return validResponse;
|
||||||
|
} else {
|
||||||
|
validResponse.setValid(false);
|
||||||
|
validResponse.setOrderSn( (String) params.get("out_trade_no") );
|
||||||
|
return validResponse;
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new TradeException("验签异常");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款结果通知验签
|
||||||
|
* 参考官网 https://opendocs.alipay.com/support/01ravh
|
||||||
|
* @param httpEntity
|
||||||
|
* @param httpRequest
|
||||||
|
* @return
|
||||||
|
* @throws TradeException
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ValidResponse validRefund(HttpEntity<String> httpEntity, HttpServletRequest httpRequest) throws TradeException {
|
||||||
|
ValidResponse validResponse=new ValidResponse();
|
||||||
|
|
||||||
|
try {
|
||||||
|
//获取支付宝POST过来反馈信息,将异步通知中收到的待验证所有参数都存放到map中
|
||||||
|
Map<String, String> params = getParams(httpRequest);
|
||||||
|
//调用SDK验证签名
|
||||||
|
//公钥验签示例代码
|
||||||
|
boolean signVerified = AlipaySignature.rsaCheckV1(params, alipayConfig.getPublicKey(), "utf-8", alipayConfig.getSignType());
|
||||||
|
if (signVerified) {
|
||||||
|
validResponse.setValid(true);
|
||||||
|
validResponse.setOrderSn( (String) params.get("out_trade_no") );
|
||||||
|
return validResponse;
|
||||||
|
} else {
|
||||||
|
validResponse.setValid(false);
|
||||||
|
validResponse.setOrderSn( (String) params.get("out_trade_no") );
|
||||||
|
return validResponse;
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
validResponse.setValid(false);
|
||||||
|
return validResponse;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<String,String> getParams(HttpServletRequest httpServletRequest){
|
||||||
|
Map<String,String> params = new HashMap< String , String >();
|
||||||
|
Map requestParams = httpServletRequest.getParameterMap();
|
||||||
|
|
||||||
|
for(Iterator iter = requestParams.keySet().iterator(); iter.hasNext();){
|
||||||
|
String name = (String)iter.next();
|
||||||
|
String[] values = (String [])requestParams.get(name);
|
||||||
|
String valueStr = "";
|
||||||
|
for(int i = 0;i < values.length;i ++ ){
|
||||||
|
valueStr = (i==values.length-1)?valueStr + values [i]:valueStr + values[i] + ",";
|
||||||
|
}
|
||||||
|
//乱码解决,这段代码在出现乱码时使用。
|
||||||
|
//valueStr = new String(valueStr.getBytes("ISO-8859-1"), "utf-8");
|
||||||
|
params.put (name,valueStr);
|
||||||
|
}
|
||||||
|
log.info("params:{}",params);
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String successResult() {
|
||||||
|
return AlipayConstant.SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String failResult() {
|
||||||
|
return AlipayConstant.FAIL;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.ruoyi.annotation;
|
||||||
|
|
||||||
|
import java.lang.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create by: wgl
|
||||||
|
* desc: 自定义支付平台注解,支付平台 微信:wx 支付宝:zfb
|
||||||
|
*/
|
||||||
|
@Documented
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target({ElementType.TYPE})
|
||||||
|
public @interface TradePlatform {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台的id
|
||||||
|
* Platform.WX
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String value();
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.ruoyi.config;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信权限对接类
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@ConfigurationProperties("elegent.pay.callback")
|
||||||
|
@Data
|
||||||
|
public class CallbackConfig {
|
||||||
|
|
||||||
|
private String domain; //回调域名
|
||||||
|
|
||||||
|
@Value("${elegent.pay.callback.watch:false}")
|
||||||
|
private boolean watch; //是否开启监听
|
||||||
|
|
||||||
|
@Value("${elegent.pay.callback.cycle:10}")
|
||||||
|
private int cycle;//检查周期
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.ruoyi.constant;
|
||||||
|
|
||||||
|
public class PayConstant {
|
||||||
|
|
||||||
|
public final static String CALLBACK_PATH = "/payCallBack";
|
||||||
|
|
||||||
|
public final static String NOTIFY = "/notify";
|
||||||
|
|
||||||
|
public final static String REFUND_NOTIFY = "/refund_notify";
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.ruoyi.constant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Platform
|
||||||
|
* 支付方式
|
||||||
|
*/
|
||||||
|
public class Platform {
|
||||||
|
/**
|
||||||
|
* 微信
|
||||||
|
*/
|
||||||
|
public final static String WX = "wxpay";
|
||||||
|
/**
|
||||||
|
* 支付宝
|
||||||
|
*/
|
||||||
|
public final static String ALI = "alipay";
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.ruoyi.constant;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易类型
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TradeType {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* native(扫码)
|
||||||
|
*/
|
||||||
|
public final static String NATIVE = "native";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* jsapi(小程序)
|
||||||
|
*/
|
||||||
|
public final static String JSAPI = "jsapi";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app
|
||||||
|
*/
|
||||||
|
public final static String APP = "app";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* h5
|
||||||
|
*/
|
||||||
|
public final static String H5 = "h5";
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.ruoyi.core;
|
||||||
|
|
||||||
|
import com.ruoyi.CallBackService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回调类
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class CallBackServiceImpl implements CallBackService {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void successPay(String orderSn) {
|
||||||
|
log.info("支付成功回调!"+orderSn);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void failPay(String orderSn) {
|
||||||
|
log.info("支付失败回调!"+orderSn);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void successRefund(String orderSn) {
|
||||||
|
log.info("退款成功回调!"+orderSn);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void failRefund(String orderSn) {
|
||||||
|
log.info("退款失败回调!"+orderSn);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
package com.ruoyi.core;
|
||||||
|
|
||||||
|
import com.ruoyi.CallBackService;
|
||||||
|
import com.ruoyi.constant.PayConstant;
|
||||||
|
import com.ruoyi.dto.ValidResponse;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpEntity;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CallbackController
|
||||||
|
* @description 系统默认提供的微信回调的Controller
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@Slf4j
|
||||||
|
@RequestMapping(PayConstant.CALLBACK_PATH)
|
||||||
|
public class CallbackController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CallBackService callBackService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统提供的默认的微信回调的接口(支付回调)
|
||||||
|
* @param httpEntity
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping( PayConstant.NOTIFY + "/{platform}")
|
||||||
|
public String notify(HttpEntity<String> httpEntity, HttpServletRequest request, HttpServletResponse response, @PathVariable("platform") String platform){
|
||||||
|
|
||||||
|
ElegentValid elegentValid = ElegentLoader.getElegentValid(platform); //获取验证器
|
||||||
|
try {
|
||||||
|
ValidResponse validResponse = elegentValid.validPay(httpEntity, request);//验证支付通知
|
||||||
|
String orderSn =validResponse.getOrderSn(); //订单号
|
||||||
|
if(validResponse.isValid()){ //返回码成功
|
||||||
|
callBackService.successPay(orderSn);
|
||||||
|
//返回成功消费
|
||||||
|
return elegentValid.successResult();
|
||||||
|
}else{
|
||||||
|
callBackService.failPay(orderSn);
|
||||||
|
return elegentValid.failResult();
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("支付回调处理失败",e);
|
||||||
|
//微信返回的状态非正常
|
||||||
|
return elegentValid.failResult();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统提供的默认的微信回调的接口(退款通知)
|
||||||
|
*
|
||||||
|
* @param httpEntity
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping( PayConstant.REFUND_NOTIFY + "/{platform}")
|
||||||
|
public String refundNotify(HttpEntity<String> httpEntity, HttpServletRequest request, HttpServletResponse response,@PathVariable("platform") String platform) {
|
||||||
|
|
||||||
|
ElegentValid elegentValid = ElegentLoader.getElegentValid(platform); //获取验证器
|
||||||
|
|
||||||
|
try {
|
||||||
|
ValidResponse validResponse = elegentValid.validRefund(httpEntity, request);
|
||||||
|
String orderSn = validResponse.getOrderSn();
|
||||||
|
//订单号
|
||||||
|
if (validResponse.isValid()) { //返回码成功
|
||||||
|
callBackService.successRefund(orderSn);
|
||||||
|
//返回成功消费
|
||||||
|
return elegentValid.successResult();
|
||||||
|
} else {
|
||||||
|
callBackService.failRefund(orderSn);
|
||||||
|
return elegentValid.failResult();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("退款回调处理失败", e);
|
||||||
|
//微信返回的状态非正常
|
||||||
|
return elegentValid.failResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
package com.ruoyi.core;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.CallBackService;
|
||||||
|
import com.ruoyi.ElegentPay;
|
||||||
|
import com.ruoyi.config.CallbackConfig;
|
||||||
|
import com.ruoyi.dto.QueryRefundResponse;
|
||||||
|
import com.ruoyi.dto.QueryResponse;
|
||||||
|
import com.ruoyi.dto.WatchDTO;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
import java.util.Timer;
|
||||||
|
import java.util.TimerTask;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@ConditionalOnProperty(prefix = "elegent.pay.callback",name = "watch",havingValue = "true")
|
||||||
|
@Slf4j
|
||||||
|
public class CallbackWatch {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CallBackService callBackService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CallbackConfig callbackConfig;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ElegentPay elegentPay;
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void queryWatch(){
|
||||||
|
if(callbackConfig.getCycle()<=0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//log.info("开启支付结果定期巡检");
|
||||||
|
Timer timer = new Timer();
|
||||||
|
// 2、创建 TimerTask 任务线程
|
||||||
|
TimerTask task=new TimerTask() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try{
|
||||||
|
//查询支付状态
|
||||||
|
//log.info("支付状态定期巡检,{}",WatchList.payList);
|
||||||
|
for( WatchDTO watchDTO: WatchList.payList ){
|
||||||
|
//查询订单是否支付成功
|
||||||
|
QueryResponse queryResponse = elegentPay.queryTradingOrderNo(watchDTO.getOrderSn(),watchDTO.getPlatform());
|
||||||
|
if("SUCCESS".equals(queryResponse.getTrade_state())){
|
||||||
|
callBackService.successPay(queryResponse.getOrder_sn());
|
||||||
|
WatchList.payList.remove(watchDTO );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//log.info("退款状态定期巡检,{}",WatchList.refundList);
|
||||||
|
//查询退款状态
|
||||||
|
for( WatchDTO watchDTO: WatchList.refundList ){
|
||||||
|
//查询退款中订单
|
||||||
|
QueryRefundResponse queryResponse = elegentPay.queryRefundTrading( watchDTO.getOrderSn(),watchDTO.getPlatform());
|
||||||
|
if("SUCCESS".equals(queryResponse.getStatus())){
|
||||||
|
callBackService.successRefund(queryResponse.getOrder_sn());
|
||||||
|
WatchList.refundList.remove(watchDTO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception ex){
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// 4、启动定时任务
|
||||||
|
timer.schedule(task, callbackConfig.getCycle()*1000, callbackConfig.getCycle()*1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.ruoyi.core;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.CallBackService;
|
||||||
|
import com.ruoyi.key.KeyManager;
|
||||||
|
import com.ruoyi.key.impl.DefaultKeyManager;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class ElegentConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@ConditionalOnMissingBean
|
||||||
|
public CallBackService callBackService(){
|
||||||
|
return new CallBackServiceImpl();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@ConditionalOnMissingBean
|
||||||
|
public KeyManager keyManager(){
|
||||||
|
return new DefaultKeyManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package com.ruoyi.core;
|
||||||
|
|
||||||
|
import com.ruoyi.annotation.TradePlatform;
|
||||||
|
import com.ruoyi.exceptions.TradeException;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.BeansException;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
import org.springframework.context.ApplicationContextAware;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PlatformLoader
|
||||||
|
* @description 第三方支付平台类加载器
|
||||||
|
* 服务启动的时候自动加载第三方支付组件
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class ElegentLoader implements ApplicationContextAware {
|
||||||
|
|
||||||
|
private static Map<String, ElegentTrade> elegentTradeMap = new HashMap<>();
|
||||||
|
|
||||||
|
private static Map<String, ElegentValid> elegentValidMap = new HashMap<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||||
|
|
||||||
|
//加载所有的交易实现类
|
||||||
|
Collection<ElegentTrade> elegentTrades = applicationContext.getBeansOfType(ElegentTrade.class).values();
|
||||||
|
elegentTrades.stream().forEach(e->{
|
||||||
|
//通过反射拿到类上的平台注解
|
||||||
|
TradePlatform annotation = e.getClass().getAnnotation(TradePlatform.class);
|
||||||
|
if (annotation != null) {
|
||||||
|
elegentTradeMap.put(annotation.value(), e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//加载所有的验证实现类
|
||||||
|
Collection<ElegentValid> elegentValids = applicationContext.getBeansOfType(ElegentValid.class).values();
|
||||||
|
elegentValids.stream().forEach(e->{
|
||||||
|
//通过反射拿到类上的平台注解
|
||||||
|
TradePlatform annotation = e.getClass().getAnnotation(TradePlatform.class);
|
||||||
|
if (annotation != null) {
|
||||||
|
elegentValidMap.put(annotation.value(), e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据平台id获取具体的第三方平台
|
||||||
|
* @param platform 平台id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static ElegentTrade getElegentTrade(String platform){
|
||||||
|
ElegentTrade elegentPayTemplate = elegentTradeMap.get(platform);
|
||||||
|
if(elegentPayTemplate!=null){
|
||||||
|
return elegentPayTemplate;
|
||||||
|
}else{
|
||||||
|
throw new TradeException("未找到适配的交易类型,交易平台id:"+platform);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据平台id获取具体的验证类
|
||||||
|
* @param platform 平台id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static ElegentValid getElegentValid(String platform){
|
||||||
|
ElegentValid elegentValidTemplate = elegentValidMap.get(platform);
|
||||||
|
if(elegentValidTemplate!=null){
|
||||||
|
return elegentValidTemplate;
|
||||||
|
}else{
|
||||||
|
throw new TradeException("未找到适配的交易类型,交易平台id:"+platform);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,136 @@
|
|||||||
|
package com.ruoyi.core;
|
||||||
|
import com.ruoyi.ElegentPay;
|
||||||
|
import com.ruoyi.config.CallbackConfig;
|
||||||
|
import com.ruoyi.dto.*;
|
||||||
|
import com.ruoyi.exceptions.TradeException;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ElegentPayTemplate
|
||||||
|
* @description 统一模板 在模板层进行第三方平台的选择
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class ElegentPayImpl implements ElegentPay {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CallbackConfig callbackConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统一下单接口
|
||||||
|
* @param payRequest
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PayResponse requestPay(PayRequest payRequest, String tradeType, String platform) throws TradeException {
|
||||||
|
//获取交易策略
|
||||||
|
PayResponse payResponse = getPlatFormService(platform).requestPay(payRequest, tradeType);
|
||||||
|
|
||||||
|
//加入监听列表
|
||||||
|
if(callbackConfig.isWatch()){
|
||||||
|
WatchDTO watchDTO=new WatchDTO();
|
||||||
|
watchDTO.setOrderSn(payRequest.getOrderSn());
|
||||||
|
watchDTO.setPlatform(platform);
|
||||||
|
WatchList.payList.add( watchDTO );
|
||||||
|
}
|
||||||
|
return payResponse;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭订单
|
||||||
|
* @param orderSn
|
||||||
|
* @param platform
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean closePay(String orderSn, String platform) throws TradeException {
|
||||||
|
//调用对应第三方的创建订单接口
|
||||||
|
Boolean aBoolean = getPlatFormService(platform).closePay(orderSn);
|
||||||
|
//加入监听列表
|
||||||
|
if(callbackConfig.isWatch()){
|
||||||
|
WatchDTO watchDTO=new WatchDTO();
|
||||||
|
watchDTO.setOrderSn(orderSn);
|
||||||
|
watchDTO.setPlatform(platform);
|
||||||
|
WatchList.payList.remove( watchDTO );
|
||||||
|
}
|
||||||
|
|
||||||
|
return aBoolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款方法
|
||||||
|
* @param refundRequest
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean refund(RefundRequest refundRequest, String platform) throws TradeException {
|
||||||
|
Boolean refund = getPlatFormService(platform).refund(refundRequest);
|
||||||
|
//加入监听列表
|
||||||
|
if(callbackConfig.isWatch() && refund){
|
||||||
|
WatchDTO watchDTO=new WatchDTO();
|
||||||
|
watchDTO.setOrderSn(refundRequest.getRequestNo());
|
||||||
|
watchDTO.setPlatform(platform);
|
||||||
|
WatchList.refundList.add( watchDTO );
|
||||||
|
}
|
||||||
|
return refund;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手动查询订单的方法
|
||||||
|
* 商户订单号查询 根据订单号查询订单
|
||||||
|
* 该接口基于生成的订单号来进行订单的查询
|
||||||
|
* 可以基于查询的结果判断用户订单是否支付成功
|
||||||
|
* @param orderSn
|
||||||
|
* @param Platform
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public QueryResponse queryTradingOrderNo(String orderSn , String Platform) throws TradeException {
|
||||||
|
//调用具体第三方的退款接口
|
||||||
|
return getPlatFormService(Platform).queryTradingOrderNo(orderSn);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询退款单号
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public QueryRefundResponse queryRefundTrading(String orderSn , String platform) throws TradeException {
|
||||||
|
//获取请求参数
|
||||||
|
return getPlatFormService(platform).queryRefundTrading(orderSn);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得openId
|
||||||
|
* @param code
|
||||||
|
* @param platform
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getOpenid(String code, String platform) {
|
||||||
|
return getPlatFormService(platform).getOpenid(code);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ====================================提供的模板类需要使用的方法=====================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 跟进具体内容获取实现类的方法
|
||||||
|
* @param platForm
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private ElegentTrade getPlatFormService(String platForm) {
|
||||||
|
return ElegentLoader.getElegentTrade(platForm);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.ruoyi.core;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.dto.*;
|
||||||
|
import com.ruoyi.exceptions.TradeException;
|
||||||
|
|
||||||
|
public interface ElegentTrade {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单独的创建本地支付订单接口
|
||||||
|
* 该接口基于设计模式实现,对接了微信V3版支付代码和支付宝支付sdk
|
||||||
|
* 业务编写人员仅仅只需要准备好请求参数调用该方法即可完成下单请求
|
||||||
|
* @return 交易数据对象 包含有native支付的二维码+jsApi支付的支付组件
|
||||||
|
*/
|
||||||
|
PayResponse requestPay(PayRequest payRequest, String tradeType) throws TradeException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭订单
|
||||||
|
* 该结构基于设计模式实现,对接了微信V3版支付代码和支付宝支付sdk
|
||||||
|
* 业务编写人员在处理超时订单的时候需要 通知微信 由于是超时订单需要进行远程关闭
|
||||||
|
*/
|
||||||
|
Boolean closePay(String orderSn) throws TradeException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款s申请
|
||||||
|
* 该接口基于设计模式实现,对接了微信V3版支付代码和支付宝支付sdk
|
||||||
|
* 业务编写人员在处理业务执行失败时需要进行退款
|
||||||
|
*/
|
||||||
|
Boolean refund(RefundRequest refundRequest) throws TradeException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户订单号查询 根据订单号查询订单
|
||||||
|
* 该接口基于生成的订单号来进行订单的查询
|
||||||
|
* 可以基于查询的结果判断用户订单是否支付成功
|
||||||
|
*/
|
||||||
|
QueryResponse queryTradingOrderNo(String orderSn) throws TradeException;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询单笔退款API
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
QueryRefundResponse queryRefundTrading(String orderSn) throws TradeException;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得openId
|
||||||
|
* @param code
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String getOpenid(String code);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.ruoyi.core;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.dto.ValidResponse;
|
||||||
|
import com.ruoyi.exceptions.TradeException;
|
||||||
|
import org.springframework.http.HttpEntity;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证器接口
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface ElegentValid {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付结果通知校验
|
||||||
|
* 该接口基于设计模式实现,对接了微信V3版支付代码和支付宝支付sdk
|
||||||
|
* 业务编写人员在接收到微信或支付宝回调的时候可以使用该方法验证回调是否成功,是否是伪回调
|
||||||
|
* @return 交易数据对象
|
||||||
|
*/
|
||||||
|
ValidResponse validPay(HttpEntity<String> httpEntity, HttpServletRequest request) throws TradeException;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款结果通知校验
|
||||||
|
* 该接口基于设计模式实现,对接了微信V3版支付代码和支付宝支付sdk
|
||||||
|
* 业务编写人员在接收到微信或支付宝回调的时候可以使用该方法验证回调是否成功,是否是伪回调
|
||||||
|
*/
|
||||||
|
ValidResponse validRefund(HttpEntity<String> httpEntity, HttpServletRequest request) throws TradeException;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成功返回结构
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String successResult();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 失败返回内容
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String failResult();
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.ruoyi.core;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.dto.WatchDTO;
|
||||||
|
|
||||||
|
import java.util.concurrent.CopyOnWriteArraySet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监听列表
|
||||||
|
*/
|
||||||
|
public class WatchList {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static CopyOnWriteArraySet<WatchDTO> payList=new CopyOnWriteArraySet<>(); //支付中列表
|
||||||
|
|
||||||
|
public static CopyOnWriteArraySet<WatchDTO> refundList=new CopyOnWriteArraySet<>(); //退款中列表
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.ruoyi.dto;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PayRequest
|
||||||
|
* 支付请求外观类
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PayRequest {
|
||||||
|
|
||||||
|
private String body;//商品描述
|
||||||
|
|
||||||
|
private String orderSn; //订单号
|
||||||
|
|
||||||
|
private int totalFee; //订单金额
|
||||||
|
|
||||||
|
private String openid;//openId
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.ruoyi.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结果统一封装类
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PayResponse {
|
||||||
|
|
||||||
|
private boolean success; //是否成功
|
||||||
|
|
||||||
|
private String message;//信息
|
||||||
|
|
||||||
|
private String order_sn;//订单编号
|
||||||
|
|
||||||
|
private Map<String,String> expand;//扩展属性
|
||||||
|
|
||||||
|
private String code_url;//二维码连接(native返回)
|
||||||
|
|
||||||
|
private String prepay_id;//预支付Id(小程序返回)
|
||||||
|
|
||||||
|
private String h5_url;//支付跳转链接
|
||||||
|
|
||||||
|
private Map<String,String> jsapiData;//小程序返回
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.ruoyi.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class QueryRefundResponse extends QueryResponse{
|
||||||
|
|
||||||
|
|
||||||
|
private String refund_id; //微信支付退款单号
|
||||||
|
|
||||||
|
private String out_refund_no;//商户退款单号
|
||||||
|
|
||||||
|
private String channel;//退款渠道
|
||||||
|
|
||||||
|
private String user_received_account;//退款账号
|
||||||
|
|
||||||
|
private String success_time;//退款成功时间
|
||||||
|
|
||||||
|
private String status;//退款状态
|
||||||
|
|
||||||
|
private int refund;//退款金额
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.ruoyi.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询响应对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class QueryResponse {
|
||||||
|
|
||||||
|
private String openid;//用户id
|
||||||
|
|
||||||
|
private String trade_state;//交易状态
|
||||||
|
|
||||||
|
private String order_sn;//订单号
|
||||||
|
|
||||||
|
private String transaction_id;//交易单号
|
||||||
|
|
||||||
|
private int total;//金额
|
||||||
|
|
||||||
|
private Map expand;//扩展(全部的返回数据)
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.ruoyi.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class RefundRequest {
|
||||||
|
|
||||||
|
private int totalFee; //订单金额
|
||||||
|
|
||||||
|
private int refundAmount; //退款金额
|
||||||
|
|
||||||
|
private String orderSn; //订单号
|
||||||
|
|
||||||
|
private String requestNo; //退款请求号,做退款幂等性校验,当部分退款时必须给出
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.ruoyi.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证签名
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ValidResponse {
|
||||||
|
|
||||||
|
private boolean isValid;// 是否通过验签
|
||||||
|
|
||||||
|
private String orderSn;// 订单号
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.ruoyi.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class WatchDTO {
|
||||||
|
|
||||||
|
private String orderSn; //订单号
|
||||||
|
|
||||||
|
private String platform;//平台
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.ruoyi.exceptions;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易SDK提供的总的异常
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class TradeException extends RuntimeException{
|
||||||
|
private String code;
|
||||||
|
private String msg;
|
||||||
|
|
||||||
|
public TradeException(String code, String msg) {
|
||||||
|
super(msg);
|
||||||
|
this.code = code;
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TradeException(String msg) {
|
||||||
|
super(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.ruoyi.key;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 密钥管理器接口
|
||||||
|
*/
|
||||||
|
public interface KeyManager {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据名字获取key字符串
|
||||||
|
* @param name
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String getKey(String name);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.ruoyi.key.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.key.KeyManager;
|
||||||
|
import com.ruoyi.util.FileUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认的key管理器-文件管理器
|
||||||
|
*/
|
||||||
|
public class DefaultKeyManager implements KeyManager {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getKey(String name) {
|
||||||
|
return FileUtil.readToStr(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.ruoyi.util;
|
||||||
|
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件读取类
|
||||||
|
*/
|
||||||
|
public class FileUtil {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取文件内容
|
||||||
|
* @param fileName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String readToStr(String fileName){
|
||||||
|
InputStream is = FileUtil.class.getClassLoader().getResourceAsStream(fileName);
|
||||||
|
ByteArrayOutputStream os = new ByteArrayOutputStream(2048);
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
|
||||||
|
String str;
|
||||||
|
try {
|
||||||
|
int length;
|
||||||
|
while((length = is.read(buffer)) != -1) {
|
||||||
|
os.write(buffer, 0, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
str = os.toString("UTF-8");
|
||||||
|
} catch (IOException var5) {
|
||||||
|
throw new IllegalArgumentException("无效的密钥", var5);
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,459 @@
|
|||||||
|
package com.ruoyi.wx;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.CharsetUtil;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.ruoyi.annotation.TradePlatform;
|
||||||
|
import com.ruoyi.config.CallbackConfig;
|
||||||
|
import com.ruoyi.constant.PayConstant;
|
||||||
|
import com.ruoyi.constant.Platform;
|
||||||
|
import com.ruoyi.core.ElegentTrade;
|
||||||
|
import com.ruoyi.dto.*;
|
||||||
|
import com.ruoyi.exceptions.TradeException;
|
||||||
|
import com.ruoyi.util.FileUtil;
|
||||||
|
import com.wechat.pay.contrib.apache.httpclient.WechatPayHttpClientBuilder;
|
||||||
|
import com.wechat.pay.contrib.apache.httpclient.auth.PrivateKeySigner;
|
||||||
|
import com.wechat.pay.contrib.apache.httpclient.auth.WechatPay2Credentials;
|
||||||
|
import com.wechat.pay.contrib.apache.httpclient.auth.WechatPay2Validator;
|
||||||
|
import com.wechat.pay.contrib.apache.httpclient.cert.CertificatesManager;
|
||||||
|
import com.wechat.pay.contrib.apache.httpclient.util.PemUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||||
|
import org.apache.http.client.methods.HttpGet;
|
||||||
|
import org.apache.http.client.methods.HttpPost;
|
||||||
|
import org.apache.http.client.utils.URIBuilder;
|
||||||
|
import org.apache.http.entity.StringEntity;
|
||||||
|
import org.apache.http.impl.client.CloseableHttpClient;
|
||||||
|
import org.apache.http.util.EntityUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
|
import java.security.PrivateKey;
|
||||||
|
import java.security.Signature;
|
||||||
|
import java.util.Base64;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
@TradePlatform(Platform.WX)
|
||||||
|
public class WxPayElegentTrade implements ElegentTrade {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private WxpayConfig wxpayConfig;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CallbackConfig callbackConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建微信支付订单方法
|
||||||
|
* 这里参考官网代码:
|
||||||
|
* https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_4_1.shtml Native下单
|
||||||
|
* https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_1.shtml JSAPI 下单
|
||||||
|
* https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_3_1.shtml H5下单
|
||||||
|
* https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_2_1.shtml APP下单
|
||||||
|
* @param payRequest 支付请求
|
||||||
|
* @return 支付响应
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PayResponse requestPay(PayRequest payRequest, String tradeType)throws TradeException {
|
||||||
|
PayResponse payResponse = new PayResponse(); //返回结果
|
||||||
|
try {
|
||||||
|
// 请求body参数构建
|
||||||
|
Map<String, Object> params = new HashMap<String, Object>() {
|
||||||
|
{
|
||||||
|
put("mchid", wxpayConfig.getMchId());
|
||||||
|
put("appid", wxpayConfig.getAppId());
|
||||||
|
put("notify_url", callbackConfig.getDomain()+ PayConstant.CALLBACK_PATH + PayConstant.NOTIFY +"/"+ Platform.WX );
|
||||||
|
put("out_trade_no", payRequest.getOrderSn());
|
||||||
|
put("amount", new HashMap<String, Object>() {
|
||||||
|
{
|
||||||
|
put("total", payRequest.getTotalFee());//金额,单位:分
|
||||||
|
put("currency", "CNY");//人民币
|
||||||
|
}
|
||||||
|
});
|
||||||
|
put("description", payRequest.getBody());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if("h5".equals(tradeType)){ //h5
|
||||||
|
params.put("scene_info", new HashMap<String, Object>() {
|
||||||
|
{
|
||||||
|
put("payer_client_ip", "127.0.0.1");
|
||||||
|
put("h5_info", new HashMap<String, Object>() {
|
||||||
|
{
|
||||||
|
put("type", "Wap");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if ("jsapi".equals(tradeType)) { //如果是小程序支付
|
||||||
|
params.put("payer", new HashMap<String, Object>() {
|
||||||
|
{
|
||||||
|
put("openid", payRequest.getOpenid());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
String url = WxpayConstant.createOrder + tradeType; //创建订单
|
||||||
|
log.info("elegent-pay 请求参数{}",params);
|
||||||
|
Map<String, String> map = postApiTemplate(url, params);
|
||||||
|
|
||||||
|
if("SUCCESS".equals( map.get("code") )){
|
||||||
|
payResponse.setOrder_sn(payRequest.getOrderSn());
|
||||||
|
payResponse.setSuccess(true);
|
||||||
|
payResponse.setCode_url(map.get("code_url"));
|
||||||
|
payResponse.setMessage(map.get("message"));
|
||||||
|
|
||||||
|
payResponse.setPrepay_id(map.get("prepay_id"));
|
||||||
|
payResponse.setH5_url( map.get("h5_url") );
|
||||||
|
|
||||||
|
payResponse.setExpand(map); //全部数据
|
||||||
|
|
||||||
|
if("jsapi".equals(tradeType)){//如果是小程序,需要封装到Expand
|
||||||
|
Map<String, String> data=new HashMap<>();
|
||||||
|
String timeStamp = String.valueOf(System.currentTimeMillis() / 1000);
|
||||||
|
String nonceStr = IdUtil.simpleUUID();
|
||||||
|
String packages = "prepay_id=" + payResponse.getPrepay_id();
|
||||||
|
String privateKey = FileUtil.readToStr("wxpay_private.key");
|
||||||
|
String paySign = this.createPaySign(wxpayConfig.getAppId(), timeStamp, nonceStr, packages, privateKey);
|
||||||
|
data.put("appId", wxpayConfig.getAppId());// appid
|
||||||
|
data.put("timeStamp", timeStamp);// 时间戳
|
||||||
|
data.put("nonceStr", nonceStr);// 随机字符串
|
||||||
|
data.put("package","prepay_id="+payResponse.getPrepay_id());
|
||||||
|
data.put("signType", "RSA");// 签名类型,默认为RSA,仅支持RSA
|
||||||
|
data.put("paySign", paySign);// 签名
|
||||||
|
data.put("orderNo",payRequest.getOrderSn());
|
||||||
|
payResponse.setJsapiData(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
log.info("createOrder: {}", payResponse);
|
||||||
|
|
||||||
|
}else{
|
||||||
|
payResponse.setSuccess(false);
|
||||||
|
payResponse.setMessage( map.get("message") );
|
||||||
|
}
|
||||||
|
return payResponse;
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
payResponse.setSuccess(false);
|
||||||
|
}
|
||||||
|
return payResponse;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭订单
|
||||||
|
* 参考官网代码
|
||||||
|
* https://pay.weixin.qq.com/wiki/doc/apiv3/open/pay/chapter2_7_2.shtml 3.2.5. 【服务端】关闭订单
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean closePay(String orderSn) throws TradeException {
|
||||||
|
// 请求body参数构建
|
||||||
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("mchid", wxpayConfig.getMchId());
|
||||||
|
String url = WxpayConstant.closeOrder.replaceAll("\\{out_trade_no\\}",orderSn);
|
||||||
|
Map map = postApiTemplate(url, params);
|
||||||
|
if("SUCCESS".equals( map.get("code"))){
|
||||||
|
return true;
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款
|
||||||
|
* 参考官网代码 https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_3_9.shtml
|
||||||
|
* @param refundRequest
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean refund(RefundRequest refundRequest) {
|
||||||
|
// 请求body参数构建
|
||||||
|
// 请求body参数构建
|
||||||
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("notify_url", callbackConfig.getDomain()+ PayConstant.CALLBACK_PATH +PayConstant.REFUND_NOTIFY +"/"+ Platform.WX ); //回调地址
|
||||||
|
params.put("out_trade_no", refundRequest.getOrderSn());//订单编号
|
||||||
|
//out_refund_no
|
||||||
|
params.put("out_refund_no", refundRequest.getRequestNo());//退款申请单编号 (多次退款需要不一样才行)
|
||||||
|
params.put("amount", new HashMap<String, Object>() {
|
||||||
|
{
|
||||||
|
put("refund",refundRequest.getRefundAmount());//退款金额
|
||||||
|
put("total", refundRequest.getTotalFee());//原金额,单位:分
|
||||||
|
put("currency", "CNY");//人民币
|
||||||
|
}
|
||||||
|
});
|
||||||
|
String url = WxpayConstant.refund; //创建订单
|
||||||
|
Map map = postApiTemplate(url, params);
|
||||||
|
if("SUCCESS".equals( map.get("code"))){
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手动查询订单
|
||||||
|
* 参考官网代码: https://pay.weixin.qq.com/wiki/doc/apiv3/open/pay/chapter2_6_2.shtml 3.2.4. 【服务端】查询订单
|
||||||
|
* @param orderSn
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public QueryResponse queryTradingOrderNo(String orderSn) throws TradeException {
|
||||||
|
// 请求body参数构建
|
||||||
|
Map<String, String> params = new HashMap<String, String>();
|
||||||
|
params.put("mchid", wxpayConfig.getMchId());
|
||||||
|
String url = WxpayConstant.queryOrderNo+orderSn;;
|
||||||
|
try {
|
||||||
|
Map map = getApiTemplate(url, params);
|
||||||
|
QueryResponse queryResponse=new QueryResponse();
|
||||||
|
queryResponse.setOrder_sn((String)map.get("out_trade_no") ); //订单号
|
||||||
|
queryResponse.setTransaction_id((String)map.get("transaction_id") ); //交易单类型
|
||||||
|
queryResponse.setTrade_state( (String) map.get("trade_state") );//交易状态
|
||||||
|
Map amount = (Map)map.get("amount");
|
||||||
|
if(amount!=null){
|
||||||
|
queryResponse.setTotal( (Integer) amount.get("total") ); //总金额
|
||||||
|
}
|
||||||
|
Map payer= (Map)map.get("payer");
|
||||||
|
if(payer!=null){
|
||||||
|
queryResponse.setOpenid( (String)payer.get("openid") );
|
||||||
|
}
|
||||||
|
queryResponse.setExpand(map);//全部数据
|
||||||
|
return queryResponse;
|
||||||
|
|
||||||
|
} catch (URISyntaxException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询退款订单
|
||||||
|
* https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_4_10.shtml
|
||||||
|
* @param out_refund_no
|
||||||
|
* @return
|
||||||
|
* @throws TradeException
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public QueryRefundResponse queryRefundTrading(String out_refund_no) throws TradeException {
|
||||||
|
|
||||||
|
// 请求body参数构建
|
||||||
|
Map<String, String> params = new HashMap<String, String>();
|
||||||
|
String url = WxpayConstant.queryRufundOrderNo + out_refund_no;
|
||||||
|
try {
|
||||||
|
Map map = getApiTemplate(url, params);
|
||||||
|
QueryRefundResponse queryRefundResponse=new QueryRefundResponse();
|
||||||
|
queryRefundResponse.setOrder_sn( (String) map.get("out_trade_no") );
|
||||||
|
queryRefundResponse.setTransaction_id( (String) map.get("transaction_id") );
|
||||||
|
Map amount = (Map)map.get("amount");
|
||||||
|
queryRefundResponse.setTotal( (Integer) amount.get("total") ); //总金额
|
||||||
|
queryRefundResponse.setRefund((Integer) amount.get("payer_refund") ); //退款金额
|
||||||
|
queryRefundResponse.setRefund_id((String) map.get("refund_id") ); //退款单号
|
||||||
|
queryRefundResponse.setOut_refund_no( (String) map.get("out_refund_no") );//退款订单号
|
||||||
|
|
||||||
|
queryRefundResponse.setChannel( (String) map.get("channel") ); //通道
|
||||||
|
queryRefundResponse.setUser_received_account( (String) map.get("user_received_account") ); //账号
|
||||||
|
queryRefundResponse.setStatus( (String) map.get("status") ); //状态
|
||||||
|
queryRefundResponse.setSuccess_time( (String) map.get("success_time") );
|
||||||
|
queryRefundResponse.setExpand(map);
|
||||||
|
return queryRefundResponse;
|
||||||
|
} catch (URISyntaxException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getOpenid(String code) {
|
||||||
|
String getOpenIdUrl = "https://api.weixin.qq.com/sns/jscode2session?" +
|
||||||
|
"appid="+wxpayConfig.getAppId()
|
||||||
|
+"&secret="+wxpayConfig.getAppSecret()
|
||||||
|
+"&js_code="+code+"&grant_type=authorization_code";
|
||||||
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
|
String respResult = restTemplate.getForObject(getOpenIdUrl,String.class);
|
||||||
|
log.info("获取openid的url:{},respResult:{}",getOpenIdUrl,respResult);
|
||||||
|
if( respResult==null || "".equals(respResult) ) return "";
|
||||||
|
try{
|
||||||
|
|
||||||
|
Map<String,String> map = JSON.parseObject(respResult, Map.class);
|
||||||
|
String errorCode = map.get("errcode") ;
|
||||||
|
if(errorCode!=null && !"".equals(errorCode)){
|
||||||
|
int errorCodeInt = Integer.valueOf(errorCode).intValue();
|
||||||
|
|
||||||
|
log.info("获取openid的errorCode,{}",errorCodeInt);
|
||||||
|
if(errorCodeInt != 0) return "";
|
||||||
|
}
|
||||||
|
return map.get("openid");
|
||||||
|
}catch (Exception ex){
|
||||||
|
ex.printStackTrace();
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private Map getApiTemplate(String url, Map<String, String> params) throws URISyntaxException, IOException {
|
||||||
|
URIBuilder uriBuilder = new URIBuilder(url);
|
||||||
|
//添加参数
|
||||||
|
for (String key : params.keySet()) {
|
||||||
|
uriBuilder.addParameter(key, params.get(key));
|
||||||
|
}
|
||||||
|
//完成签名并执行请求
|
||||||
|
HttpGet httpGet = new HttpGet(uriBuilder.build());
|
||||||
|
httpGet.addHeader("Accept", "application/json");
|
||||||
|
CloseableHttpClient httpClient = getWxHttpClient();
|
||||||
|
CloseableHttpResponse response = httpClient.execute(httpGet);
|
||||||
|
return responseTemplate(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private Map responseTemplate(CloseableHttpResponse response) {
|
||||||
|
Map result = null;
|
||||||
|
try {
|
||||||
|
int statusCode = response.getStatusLine().getStatusCode();
|
||||||
|
if (statusCode == 200) { //处理成功
|
||||||
|
// log.info("success,return body = " + EntityUtils.toString(response.getEntity()));
|
||||||
|
result = JSON.parseObject(EntityUtils.toString(response.getEntity()), Map.class);
|
||||||
|
result.put("code", "SUCCESS");
|
||||||
|
} else if (statusCode == 204) { //处理成功,无返回Body
|
||||||
|
log.info("success");
|
||||||
|
result = new HashMap<String, Object>() {
|
||||||
|
{
|
||||||
|
put("code", "SUCCESS");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
String returnBody = EntityUtils.toString(response.getEntity());
|
||||||
|
log.error("failed,resp code = " + statusCode + ",return body = " + returnBody);
|
||||||
|
//throw new TradeException("创建本地支付订单失败!"+payDTO.getOrderSn());
|
||||||
|
Map<String, String> map = JSON.parseObject(returnBody, Map.class);
|
||||||
|
result = new HashMap<String, Object>() {
|
||||||
|
{
|
||||||
|
put("code", "FAIL");
|
||||||
|
put("message", map.get("message"));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
result = new HashMap<String, Object>() {
|
||||||
|
{
|
||||||
|
put("code", "FAIL");
|
||||||
|
put("message", e.getMessage());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
} finally {
|
||||||
|
closeConnect(response);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map postApiTemplate(String url, Map<String, Object> params) {
|
||||||
|
try {
|
||||||
|
HttpPost httpPost = new HttpPost(url);
|
||||||
|
StringEntity entity = new StringEntity(JSON.toJSONString(params));
|
||||||
|
entity.setContentType("application/json");
|
||||||
|
httpPost.setEntity(entity);
|
||||||
|
httpPost.setHeader("Accept", "application/json");
|
||||||
|
//完成签名并执行请求
|
||||||
|
CloseableHttpClient httpClient = getWxHttpClient();
|
||||||
|
CloseableHttpResponse response = httpClient.execute(httpPost);
|
||||||
|
return responseTemplate( response );
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取微信HTTP连接
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private CloseableHttpClient getWxHttpClient() {
|
||||||
|
try {
|
||||||
|
//这里对秘钥进行加密使用的完全是官网上的代码
|
||||||
|
//TODO 参考官网代码 https://pay.weixin.qq.com/wiki/doc/apiv3/open/pay/chapter2_6_2.shtml
|
||||||
|
// 加载商户私钥(privateKey:私钥字符串)
|
||||||
|
String key = FileUtil.readToStr("wxpay_private.key");
|
||||||
|
|
||||||
|
PrivateKey merchantPrivateKey = PemUtil
|
||||||
|
.loadPrivateKey(new ByteArrayInputStream(key.getBytes("utf-8")));
|
||||||
|
// 加载平台证书(mchId:商户号,mchSerialNo:商户证书序列号,apiV3Key:V3密钥)
|
||||||
|
//PrivateKey merchantPrivateKey = keyManager.getPrivateKey("wxpay_private.key");//读取私钥
|
||||||
|
PrivateKeySigner privateKeySigner = new PrivateKeySigner(wxpayConfig.getMchSerialNo(), merchantPrivateKey);
|
||||||
|
WechatPay2Credentials wechatPay2Credentials = new WechatPay2Credentials(
|
||||||
|
wxpayConfig.getMchId(), privateKeySigner);
|
||||||
|
// 向证书管理器增加需要自动更新平台证书的商户信息
|
||||||
|
CertificatesManager certificatesManager = CertificatesManager.getInstance();
|
||||||
|
certificatesManager.putMerchant(wxpayConfig.getMchId(), wechatPay2Credentials, wxpayConfig.getApiV3Key().getBytes("utf-8"));
|
||||||
|
// 初始化httpClient
|
||||||
|
return WechatPayHttpClientBuilder.create()
|
||||||
|
.withMerchant(wxpayConfig.getMchId(), wxpayConfig.getMchSerialNo(), merchantPrivateKey)
|
||||||
|
.withValidator(new WechatPay2Validator(certificatesManager.getVerifier(wxpayConfig.getMchId()))).build();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new RuntimeException("微信支付--初始化,校验系统参数失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭资源
|
||||||
|
*/
|
||||||
|
private void closeConnect(CloseableHttpResponse response) {
|
||||||
|
try {
|
||||||
|
response.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new RuntimeException("资源回收出错");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建支付签名
|
||||||
|
* @param appid
|
||||||
|
* @param timeStamp
|
||||||
|
* @param nonceStr
|
||||||
|
* @param packages
|
||||||
|
* @param privateKey
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
private String createPaySign(String appid, String timeStamp, String nonceStr, String packages,String privateKey) throws Exception {
|
||||||
|
Signature sign = Signature.getInstance("SHA256withRSA");
|
||||||
|
// 加载商户私钥
|
||||||
|
PrivateKey key = PemUtil
|
||||||
|
.loadPrivateKey(new ByteArrayInputStream(privateKey.getBytes(CharsetUtil.CHARSET_UTF_8)));
|
||||||
|
sign.initSign(key);
|
||||||
|
String message = StrUtil.format("{}\n{}\n{}\n{}\n",
|
||||||
|
appid,
|
||||||
|
timeStamp,
|
||||||
|
nonceStr,
|
||||||
|
packages);
|
||||||
|
sign.update(message.getBytes());
|
||||||
|
return Base64.getEncoder().encodeToString(sign.sign());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,153 @@
|
|||||||
|
package com.ruoyi.wx;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.ruoyi.annotation.TradePlatform;
|
||||||
|
import com.ruoyi.constant.Platform;
|
||||||
|
import com.ruoyi.core.ElegentValid;
|
||||||
|
import com.ruoyi.dto.ValidResponse;
|
||||||
|
import com.ruoyi.exceptions.TradeException;
|
||||||
|
import com.wechat.pay.contrib.apache.httpclient.auth.Verifier;
|
||||||
|
import com.wechat.pay.contrib.apache.httpclient.cert.CertificatesManager;
|
||||||
|
import com.wechat.pay.contrib.apache.httpclient.notification.Notification;
|
||||||
|
import com.wechat.pay.contrib.apache.httpclient.notification.NotificationHandler;
|
||||||
|
import com.wechat.pay.contrib.apache.httpclient.notification.NotificationRequest;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpEntity;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
@TradePlatform(Platform.WX)
|
||||||
|
public class WxPayElegentValid implements ElegentValid {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private WxpayConfig wxpayConfig;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ValidResponse validPay(HttpEntity<String> httpEntity, HttpServletRequest httpServletRequest) throws TradeException {
|
||||||
|
ValidResponse validResponse=new ValidResponse();
|
||||||
|
|
||||||
|
try {
|
||||||
|
//获取请求头
|
||||||
|
HttpHeaders headers = httpEntity.getHeaders();
|
||||||
|
//构建微信请求数据对象
|
||||||
|
NotificationRequest request = new NotificationRequest.Builder()
|
||||||
|
.withSerialNumber(headers.getFirst("Wechatpay-Serial")) //证书序列号(微信平台)
|
||||||
|
.withNonce(headers.getFirst("Wechatpay-Nonce")) //随机串
|
||||||
|
.withTimestamp(headers.getFirst("Wechatpay-Timestamp")) //时间戳
|
||||||
|
.withSignature(headers.getFirst("Wechatpay-Signature")) //签名字符串
|
||||||
|
.withBody(httpEntity.getBody())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
|
||||||
|
//微信通知的业务处理
|
||||||
|
//验证签名,确保请求来自微信
|
||||||
|
Map jsonData = null;
|
||||||
|
try {
|
||||||
|
//确保在管理器中存在自动更新的商户证书
|
||||||
|
CertificatesManager certificatesManager = CertificatesManager.getInstance();
|
||||||
|
Verifier verifier = certificatesManager.getVerifier(wxpayConfig.getMchId());
|
||||||
|
|
||||||
|
//验签和解析请求数据
|
||||||
|
NotificationHandler notificationHandler = new NotificationHandler(verifier, wxpayConfig.getApiV3Key().getBytes(StandardCharsets.UTF_8));
|
||||||
|
Notification notification = notificationHandler.parse(request);
|
||||||
|
|
||||||
|
if (!"TRANSACTION.SUCCESS".equals(notification.getEventType())) {
|
||||||
|
validResponse.setValid(false);
|
||||||
|
return validResponse;
|
||||||
|
}
|
||||||
|
//获取解密后的数据
|
||||||
|
jsonData = JSON.parseObject(notification.getDecryptData(),Map.class );
|
||||||
|
log.info("解密后的数据为:"+jsonData);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new TradeException("验签失败");
|
||||||
|
}
|
||||||
|
if (!"SUCCESS".equals(jsonData.get("trade_state"))) {
|
||||||
|
validResponse.setValid(false);
|
||||||
|
return validResponse;
|
||||||
|
}
|
||||||
|
validResponse.setValid(true);
|
||||||
|
validResponse.setOrderSn( (String) jsonData.get("out_trade_no") ); //订单号
|
||||||
|
return validResponse;
|
||||||
|
} catch (Exception e) {
|
||||||
|
validResponse.setValid(false);
|
||||||
|
return validResponse;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ValidResponse validRefund(HttpEntity<String> httpEntity, HttpServletRequest httpServletRequest) throws TradeException {
|
||||||
|
|
||||||
|
ValidResponse validResponse=new ValidResponse();
|
||||||
|
try {
|
||||||
|
//获取请求头
|
||||||
|
HttpHeaders headers = httpEntity.getHeaders();
|
||||||
|
|
||||||
|
//构建微信请求数据对象
|
||||||
|
NotificationRequest request = new NotificationRequest.Builder()
|
||||||
|
.withSerialNumber(headers.getFirst("Wechatpay-Serial")) //证书序列号(微信平台)
|
||||||
|
.withNonce(headers.getFirst("Wechatpay-Nonce")) //随机串
|
||||||
|
.withTimestamp(headers.getFirst("Wechatpay-Timestamp")) //时间戳
|
||||||
|
.withSignature(headers.getFirst("Wechatpay-Signature")) //签名字符串
|
||||||
|
.withBody(httpEntity.getBody())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
//微信通知的业务处理
|
||||||
|
Map jsonData = null;
|
||||||
|
//验证签名,确保请求来自微信
|
||||||
|
try {
|
||||||
|
//确保在管理器中存在自动更新的商户证书
|
||||||
|
CertificatesManager certificatesManager = CertificatesManager.getInstance();
|
||||||
|
Verifier verifier = certificatesManager.getVerifier(wxpayConfig.getMchId());
|
||||||
|
|
||||||
|
//验签和解析请求数据
|
||||||
|
NotificationHandler notificationHandler = new NotificationHandler(verifier, wxpayConfig.getApiV3Key().getBytes(StandardCharsets.UTF_8));
|
||||||
|
Notification notification = notificationHandler.parse(request);
|
||||||
|
|
||||||
|
if (!"REFUND.SUCCESS".equals(notification.getEventType())) {
|
||||||
|
//非成功请求直接返回,理论上都是成功的请求
|
||||||
|
validResponse.setValid(false);
|
||||||
|
return validResponse;
|
||||||
|
}
|
||||||
|
//获取解密后的数据
|
||||||
|
jsonData = JSON.parseObject( notification.getDecryptData(),Map.class );
|
||||||
|
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new TradeException("验签失败");
|
||||||
|
}
|
||||||
|
if (!"SUCCESS".equals(jsonData.get("refund_status"))) {
|
||||||
|
//非成功请求直接返回,理论上都是成功的请求
|
||||||
|
validResponse.setValid(false);
|
||||||
|
return validResponse;
|
||||||
|
}
|
||||||
|
|
||||||
|
//交易单号
|
||||||
|
validResponse.setValid(true);
|
||||||
|
validResponse.setOrderSn( (String) jsonData.get("out_trade_no") ); //订单号
|
||||||
|
return validResponse;
|
||||||
|
} catch (Exception e) {
|
||||||
|
//非成功请求直接返回,理论上都是成功的请求
|
||||||
|
validResponse.setValid(false);
|
||||||
|
return validResponse;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String successResult() {
|
||||||
|
return JSON.toJSONString(WxpayConstant.SUCCESS ) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String failResult() {
|
||||||
|
return JSON.toJSONString( WxpayConstant.FAIL);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.ruoyi.wx;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信权限对接类
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@ConfigurationProperties("elegent.pay.wxpay")
|
||||||
|
@Data
|
||||||
|
public class WxpayConfig {
|
||||||
|
|
||||||
|
private String mchId; //商户号
|
||||||
|
private String appId; //APPID
|
||||||
|
private String appSecret;//app密钥
|
||||||
|
private String mchSerialNo; //商户证书序列号
|
||||||
|
private String apiV3Key; //V3密钥
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.ruoyi.wx;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class WxpayConstant {
|
||||||
|
|
||||||
|
public static final Map SUCCESS = new HashMap<String,Object>(){
|
||||||
|
{
|
||||||
|
put("code", "SUCCESS");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public static final Map FAIL = new HashMap<String,Object>(){
|
||||||
|
{
|
||||||
|
put("code", "FAIL");
|
||||||
|
put("message","微信回调错误结果");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
public final static String domain ="https://api.mch.weixin.qq.com/v3";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建订单
|
||||||
|
*/
|
||||||
|
public final static String createOrder = domain +"/pay/transactions/";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭订单
|
||||||
|
*/
|
||||||
|
public final static String closeOrder = domain+"/pay/transactions/out-trade-no/{out_trade_no}/close";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单编号
|
||||||
|
*/
|
||||||
|
public static String queryOrderNo = domain+"/pay/transactions/out-trade-no/";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询退款订单
|
||||||
|
*/
|
||||||
|
public static String queryRufundOrderNo =domain+ "/refund/domestic/refunds/";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款接口
|
||||||
|
*/
|
||||||
|
public static String refund = domain+"/refund/domestic/refunds";
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||||
|
com.ruoyi.config.CallbackConfig,\
|
||||||
|
com.ruoyi.core.CallbackWatch,\
|
||||||
|
com.ruoyi.core.ElegentPayImpl,\
|
||||||
|
com.ruoyi.core.ElegentLoader,\
|
||||||
|
com.ruoyi.core.ElegentConfig,\
|
||||||
|
com.ruoyi.key.impl.DefaultKeyManager,\
|
||||||
|
com.ruoyi.core.CallbackController,\
|
||||||
|
com.ruoyi.wx.WxpayConfig,\
|
||||||
|
com.ruoyi.wx.WxPayElegentTrade,\
|
||||||
|
com.ruoyi.wx.WxPayElegentValid,\
|
||||||
|
com.ruoyi.ali.AlipayConfig,\
|
||||||
|
com.ruoyi.ali.AlipayElegentTrade,\
|
||||||
|
com.ruoyi.ali.AlipayElegentValid
|
||||||
@@ -180,6 +180,7 @@
|
|||||||
<module>ruoyi-quartz</module>
|
<module>ruoyi-quartz</module>
|
||||||
<module>ruoyi-generator</module>
|
<module>ruoyi-generator</module>
|
||||||
<module>ruoyi-common</module>
|
<module>ruoyi-common</module>
|
||||||
|
<module>pay</module>
|
||||||
</modules>
|
</modules>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
@@ -193,6 +194,10 @@
|
|||||||
<source>${java.version}</source>
|
<source>${java.version}</source>
|
||||||
<target>${java.version}</target>
|
<target>${java.version}</target>
|
||||||
<encoding>${project.build.sourceEncoding}</encoding>
|
<encoding>${project.build.sourceEncoding}</encoding>
|
||||||
|
<excludes>
|
||||||
|
<exclude>ruoyi-system/**</exclude>
|
||||||
|
<exclude>ruoyi-common/**</exclude>
|
||||||
|
</excludes>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|||||||
+8
-3
@@ -9,7 +9,8 @@
|
|||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<artifactId>ruoyi-admin</artifactId>
|
<artifactId>SmartArbitrate</artifactId>
|
||||||
|
<version>1.1.0</version>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
web服务入口
|
web服务入口
|
||||||
@@ -60,7 +61,11 @@
|
|||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-generator</artifactId>
|
<artifactId>ruoyi-generator</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>pay</artifactId>
|
||||||
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
@@ -90,7 +95,7 @@
|
|||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
<finalName>${project.artifactId}</finalName>
|
<finalName>${project.artifactId}-${project.version}</finalName>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
@@ -1,8 +1,19 @@
|
|||||||
package com.ruoyi;
|
package com.ruoyi;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import com.ruoyi.common.constant.CacheConstants;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
|
import com.ruoyi.common.core.redis.RedisCache;
|
||||||
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||||
|
import com.ruoyi.system.mapper.SysRoleMapper;
|
||||||
|
import com.ruoyi.system.mapper.SysUserMapper;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启动程序
|
* 启动程序
|
||||||
@@ -10,21 +21,35 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
|||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||||
|
@EnableScheduling
|
||||||
public class RuoYiApplication
|
public class RuoYiApplication
|
||||||
{
|
{
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
{
|
{
|
||||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||||
SpringApplication.run(RuoYiApplication.class, args);
|
SpringApplication.run(RuoYiApplication.class, args);
|
||||||
System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" +
|
System.out.println(" __ _ \n" +
|
||||||
" .-------. ____ __ \n" +
|
" ____ / /_ ____ ____ ____ _ _________ _(_)\n" +
|
||||||
" | _ _ \\ \\ \\ / / \n" +
|
"/_ / / __ \\/ __ \\/ __ \\/ __ `/ / ___/ __ `/ / \n" +
|
||||||
" | ( ' ) | \\ _. / ' \n" +
|
" / /_/ / / / /_/ / / / / /_/ / / /__/ /_/ / / \n" +
|
||||||
" |(_ o _) / _( )_ .' \n" +
|
"/___/_/ /_/\\____/_/ /_/\\__, / \\___/\\__,_/_/ \n" +
|
||||||
" | (_,_).' __ ___(_ o _)' \n" +
|
" /____/ ");
|
||||||
" | |\\ \\ | || |(_,_)' \n" +
|
// 启动成功后,查询用户表,将用户信息存到redis
|
||||||
" | | \\ `' /| `-' / \n" +
|
RedisCache redisCache = SpringUtils.getBean(RedisCache.class);
|
||||||
" | | \\ / \\ / \n" +
|
SysUserMapper userMapper = SpringUtils.getBean(SysUserMapper.class);
|
||||||
" ''-' `'-' `-..-' ");
|
List<SysUser> sysUsers = userMapper.selectUserListByIds(null);
|
||||||
|
if(CollectionUtil.isNotEmpty(sysUsers)){
|
||||||
|
for (SysUser sysUser : sysUsers) {
|
||||||
|
redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 初始化角色redis
|
||||||
|
SysRoleMapper roleMapper = SpringUtils.getBean(SysRoleMapper.class);
|
||||||
|
List<SysRole> roles = roleMapper.selectRoleList(new SysRole());
|
||||||
|
if(CollectionUtil.isNotEmpty(roles)){
|
||||||
|
for (SysRole role : roles) {
|
||||||
|
redisCache.setCacheObject(CacheConstants.ROLE_KEY+role.getRoleName(),role.getRoleId());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+33
@@ -0,0 +1,33 @@
|
|||||||
|
package com.ruoyi.web.controller.bestsign;
|
||||||
|
|
||||||
|
import com.ruoyi.bestsign.domain.ArbitrSignatuVO;
|
||||||
|
import com.ruoyi.bestsign.domain.PersonRegisterVO;
|
||||||
|
import com.ruoyi.bestsign.service.ArbitrSignatuService;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/arbitrSignatu")
|
||||||
|
public class ArbitrSignatuController {
|
||||||
|
@Autowired
|
||||||
|
ArbitrSignatuService arbitrSignatuService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请状态查询
|
||||||
|
*
|
||||||
|
* @param arbitrSignatuVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/selectApplyStatus")
|
||||||
|
public AjaxResult selectApplyStatus (@Validated @RequestBody ArbitrSignatuVO arbitrSignatuVO) {
|
||||||
|
return arbitrSignatuService.selectApplyStatus(arbitrSignatuVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.ruoyi.web.controller.bestsign;
|
||||||
|
|
||||||
|
import com.ruoyi.bestsign.domain.PersonRegisterVO;
|
||||||
|
import com.ruoyi.bestsign.service.SignRegisterService;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/register")
|
||||||
|
public class RegisterController {
|
||||||
|
@Autowired
|
||||||
|
SignRegisterService signRegisterService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册上上签个人用户
|
||||||
|
*
|
||||||
|
* @param personRegisterVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/registerPerson")
|
||||||
|
public AjaxResult createDocument(@Validated @RequestBody PersonRegisterVO personRegisterVO) {
|
||||||
|
return signRegisterService.registerPerson(personRegisterVO);
|
||||||
|
}
|
||||||
|
// @PostMapping("/registerEnterprise")
|
||||||
|
// public AjaxResult
|
||||||
|
}
|
||||||
@@ -4,14 +4,15 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
||||||
|
import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import com.ruoyi.common.config.RuoYiConfig;
|
import com.ruoyi.common.config.RuoYiConfig;
|
||||||
import com.ruoyi.common.constant.Constants;
|
import com.ruoyi.common.constant.Constants;
|
||||||
@@ -36,6 +37,8 @@ public class CommonController
|
|||||||
private ServerConfig serverConfig;
|
private ServerConfig serverConfig;
|
||||||
|
|
||||||
private static final String FILE_DELIMETER = ",";
|
private static final String FILE_DELIMETER = ",";
|
||||||
|
@Autowired
|
||||||
|
CaseAttachMapper caseAttachMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用下载请求
|
* 通用下载请求
|
||||||
@@ -160,4 +163,22 @@ public class CommonController
|
|||||||
log.error("下载文件失败", e);
|
log.error("下载文件失败", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 根据案件id获取附件
|
||||||
|
* @param caseAppliId
|
||||||
|
* @param annexTypeList
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/fileList")
|
||||||
|
public AjaxResult fileList(@RequestParam("caseAppliId")Long caseAppliId, @RequestParam(value = "annexTypeList",required = false) List<Integer> annexTypeList){
|
||||||
|
if(caseAppliId==null){
|
||||||
|
return AjaxResult.error("案件id不能为空");
|
||||||
|
}
|
||||||
|
CaseApplication msCaseApplicationVO = new CaseApplication();
|
||||||
|
msCaseApplicationVO.setId(caseAppliId);
|
||||||
|
msCaseApplicationVO.setAnnexTypeList(annexTypeList);
|
||||||
|
List<CaseAttach> caseAttachList = caseAttachMapper.queryCaseAttachList(msCaseApplicationVO);
|
||||||
|
return AjaxResult.success(caseAttachList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class SysDeptController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 获取部门列表
|
* 获取部门列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('system:dept:list')")
|
// @PreAuthorize("@ss.hasPermi('system:dept:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public AjaxResult list(SysDept dept)
|
public AjaxResult list(SysDept dept)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ package com.ruoyi.web.controller.system;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import com.ruoyi.system.service.ISysUserService;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.IdentityAuthenticationService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -23,8 +27,7 @@ import com.ruoyi.system.service.ISysMenuService;
|
|||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
public class SysLoginController
|
public class SysLoginController {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysLoginService loginService;
|
private SysLoginService loginService;
|
||||||
|
|
||||||
@@ -33,6 +36,10 @@ public class SysLoginController
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysPermissionService permissionService;
|
private SysPermissionService permissionService;
|
||||||
|
@Autowired
|
||||||
|
IdentityAuthenticationService identityAuthenticationService;
|
||||||
|
@Autowired
|
||||||
|
private ISysUserService sysUserService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录方法
|
* 登录方法
|
||||||
@@ -41,13 +48,22 @@ public class SysLoginController
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@PostMapping("/login")
|
@PostMapping("/login")
|
||||||
public AjaxResult login(@RequestBody LoginBody loginBody)
|
public AjaxResult login(@RequestBody LoginBody loginBody) {
|
||||||
{
|
|
||||||
AjaxResult ajax = AjaxResult.success();
|
AjaxResult ajax = AjaxResult.success();
|
||||||
// 生成令牌
|
// 生成令牌
|
||||||
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
|
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
|
||||||
loginBody.getUuid());
|
loginBody.getUuid());
|
||||||
ajax.put(Constants.TOKEN, token);
|
ajax.put(Constants.TOKEN, token);
|
||||||
|
//判断该用户是否已经实名认证(certificationStatus1已认证0未认证)
|
||||||
|
IdentityAuthentication identityAuthentication=new IdentityAuthentication();
|
||||||
|
identityAuthentication.setUserName(loginBody.getUsername());
|
||||||
|
String status = identityAuthenticationService.checkIsAuthentication(identityAuthentication);
|
||||||
|
|
||||||
|
ajax.put("certificationStatus", status);
|
||||||
|
// 获取用户信息
|
||||||
|
SysUser sysUser = sysUserService.selectUserByUserName(loginBody.getUsername());
|
||||||
|
ajax.put("userId", sysUser!=null?sysUser.getUserId():"");
|
||||||
|
ajax.put("userName", sysUser!=null?sysUser.getUserName():"");
|
||||||
return ajax;
|
return ajax;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,8 +73,7 @@ public class SysLoginController
|
|||||||
* @return 用户信息
|
* @return 用户信息
|
||||||
*/
|
*/
|
||||||
@GetMapping("getInfo")
|
@GetMapping("getInfo")
|
||||||
public AjaxResult getInfo()
|
public AjaxResult getInfo() {
|
||||||
{
|
|
||||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||||
// 角色集合
|
// 角色集合
|
||||||
Set<String> roles = permissionService.getRolePermission(user);
|
Set<String> roles = permissionService.getRolePermission(user);
|
||||||
@@ -77,8 +92,7 @@ public class SysLoginController
|
|||||||
* @return 路由信息
|
* @return 路由信息
|
||||||
*/
|
*/
|
||||||
@GetMapping("getRouters")
|
@GetMapping("getRouters")
|
||||||
public AjaxResult getRouters()
|
public AjaxResult getRouters() {
|
||||||
{
|
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
|
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
|
||||||
return AjaxResult.success(menuService.buildMenus(menus));
|
return AjaxResult.success(menuService.buildMenus(menus));
|
||||||
|
|||||||
@@ -139,4 +139,13 @@ public class SysMenuController extends BaseController
|
|||||||
}
|
}
|
||||||
return toAjax(menuService.deleteMenuById(menuId));
|
return toAjax(menuService.deleteMenuById(menuId));
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 根据用户查询菜单权限字符
|
||||||
|
*/
|
||||||
|
@GetMapping("/getMenuPermsByUser")
|
||||||
|
public AjaxResult getMenuPermsByUser()
|
||||||
|
{
|
||||||
|
|
||||||
|
return menuService.getMenuPermsByUser();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -3,18 +3,14 @@ package com.ruoyi.web.controller.system;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.ruoyi.common.annotation.Anonymous;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
@@ -138,7 +134,7 @@ public class SysUserController extends BaseController
|
|||||||
}
|
}
|
||||||
user.setCreateBy(getUsername());
|
user.setCreateBy(getUsername());
|
||||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||||
return toAjax(userService.insertUser(user));
|
return userService.insertUser(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -164,7 +160,7 @@ public class SysUserController extends BaseController
|
|||||||
return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||||
}
|
}
|
||||||
user.setUpdateBy(getUsername());
|
user.setUpdateBy(getUsername());
|
||||||
return toAjax(userService.updateUser(user));
|
return userService.updateUser(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -248,4 +244,15 @@ public class SysUserController extends BaseController
|
|||||||
{
|
{
|
||||||
return success(deptService.selectDeptTreeList(dept));
|
return success(deptService.selectDeptTreeList(dept));
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 根据userId获取用户信息
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@GetMapping("/selectUserById")
|
||||||
|
public AjaxResult selectUserById(@RequestParam(required = true) Long userId){
|
||||||
|
return AjaxResult.success(userService.selectUserById(userId));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+243
@@ -0,0 +1,243 @@
|
|||||||
|
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.ruoyi.common.constant.CaseApplicationConstants;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.redis.RedisCache;
|
||||||
|
import com.ruoyi.common.exception.EsignDemoException;
|
||||||
|
import com.ruoyi.wisdomarbitrate.StringIdsReq;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.SealSignRecord;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/adjudication")
|
||||||
|
public class AdjudicationController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private IAdjudicationService adjudicationService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据签署流程id查询批量签名链接
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSignUrl')")
|
||||||
|
@PostMapping("/selectBatchSignUrl")
|
||||||
|
public AjaxResult selectBatchSignUrl(@RequestBody StringIdsReq idsReq) {
|
||||||
|
if(CollectionUtil.isEmpty(idsReq.getIds())|| StrUtil.isEmpty(idsReq.getPsnAccount())){
|
||||||
|
return error("参数校验失败");
|
||||||
|
}
|
||||||
|
SealSignRecord sealSignRecordselect = adjudicationService.selectBatchSignUrl(idsReq);
|
||||||
|
return success(sealSignRecordselect);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据批号查询批量签名链接
|
||||||
|
*/
|
||||||
|
// @PostMapping("/getSignUrlBatch")
|
||||||
|
// public AjaxResult getSignUrlBatch(@RequestBody StringIdsReq idsReq) {
|
||||||
|
// if(StrUtil.isEmpty(idsReq.getBatchNumber().toString())|| StrUtil.isEmpty(idsReq.getPsnAccount())){
|
||||||
|
// return error("参数校验失败");
|
||||||
|
// }
|
||||||
|
// SealSignRecord sealSignRecordselect = adjudicationService.getSignUrlBatch(idsReq);
|
||||||
|
// return success(sealSignRecordselect);
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据签署流程id查询批量用印链接
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSignUrl')")
|
||||||
|
@PostMapping("/selectBatchSealUrl")
|
||||||
|
public AjaxResult selectBatchSealUrl(@RequestBody StringIdsReq idsReq) {
|
||||||
|
if(CollectionUtil.isEmpty(idsReq.getIds())|| StrUtil.isEmpty(idsReq.getPsnAccount())){
|
||||||
|
return error("参数校验失败");
|
||||||
|
}
|
||||||
|
SealSignRecord sealSignRecordselect = adjudicationService.selectBatchSealUrl(idsReq);
|
||||||
|
return success(sealSignRecordselect);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 根据仲裁员手机号分页查询待签名/待用印的案件
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSignUrl')")
|
||||||
|
@GetMapping("/pageSignAdjudicate")
|
||||||
|
public TableDataInfo pageSignAdjudicate(@RequestParam(value = "personAccount",required = false) String personAccount, @RequestParam("caseStatus") Integer caseStatus) {
|
||||||
|
startPage();
|
||||||
|
List<CaseApplication> list = adjudicationService.selectSealSigning(personAccount,caseStatus);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据批号查询批量用印链接
|
||||||
|
*/
|
||||||
|
@PostMapping("/getSealUrlBatch")
|
||||||
|
public AjaxResult getSealUrlBatch(@RequestBody StringIdsReq idsReq) {
|
||||||
|
if(StrUtil.isEmpty(idsReq.getBatchNumber().toString())|| StrUtil.isEmpty(idsReq.getPsnAccount())){
|
||||||
|
return error("参数校验失败");
|
||||||
|
}
|
||||||
|
SealSignRecord sealSignRecordselect = adjudicationService.getSealUrlBatch(idsReq);
|
||||||
|
return success(sealSignRecordselect);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成裁决书
|
||||||
|
* @param caseApplication
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/document")
|
||||||
|
public AjaxResult createDocument(@Validated @RequestBody CaseApplication caseApplication){
|
||||||
|
if (caseApplication.getId() == null) {
|
||||||
|
return AjaxResult.error("案件id不能为空");
|
||||||
|
}
|
||||||
|
return adjudicationService.createDocument(caseApplication);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 开庭审理,确定审理结果,生成裁决书
|
||||||
|
* @param caseApplication
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/caseJudgment")
|
||||||
|
public AjaxResult caseJudgment(@Validated @RequestBody CaseApplication caseApplication){
|
||||||
|
if (caseApplication.getId() == null) {
|
||||||
|
return AjaxResult.error("案件id不能为空");
|
||||||
|
}
|
||||||
|
return adjudicationService.caseJudgment(caseApplication);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 批量生成裁决书
|
||||||
|
* @param caseApplication
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/batchDocument")
|
||||||
|
public AjaxResult batchDocument(@Validated @RequestBody BatchCaseApplication caseApplication){
|
||||||
|
if (CollectionUtil.isEmpty(caseApplication.getIds())) {
|
||||||
|
return AjaxResult.error("参数校验失败");
|
||||||
|
}
|
||||||
|
return adjudicationService.batchDocument(caseApplication.getIds());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 裁决书送达(电子邮件)
|
||||||
|
* @param bookSendVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/delivery")
|
||||||
|
public AjaxResult sendDocumentByEmail(@RequestBody BookSendVO bookSendVO){
|
||||||
|
return adjudicationService.sendDocumentByEmail(bookSendVO.getId(),bookSendVO.getAppEmail(),bookSendVO.getResEmail(),bookSendVO.getApptrackingNum(),bookSendVO.getRestrackingNum());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据快递单号查询物流信息
|
||||||
|
* @param caseApplication
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
// @GetMapping("/logistics")
|
||||||
|
//// @PreAuthorize("@ss.hasPermi('delivery:detail')")
|
||||||
|
// public AjaxResult getLogisticsInfo(CaseApplication caseApplication){
|
||||||
|
// List<LogisticsInfoVO> logisticsInfo = adjudicationService.getLogisticsInfo(caseApplication);
|
||||||
|
// return AjaxResult.success(logisticsInfo);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 归档(暂时只改案件状态)
|
||||||
|
* @param batchCaseApplication
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/caseFile")
|
||||||
|
// @PreAuthorize("@ss.hasPermi('awardManagement:list:file')")
|
||||||
|
public AjaxResult caseFile(@RequestBody BatchCaseApplication batchCaseApplication){
|
||||||
|
if(CollectionUtil.isEmpty(batchCaseApplication.getIds())){
|
||||||
|
return error("参数校验失败");
|
||||||
|
}
|
||||||
|
return adjudicationService.caseFile(batchCaseApplication.getIds());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量归档(暂时只改案件状态)
|
||||||
|
* @param caseApplication
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/caseFileBatch")
|
||||||
|
public AjaxResult caseFileBatch(@RequestBody CaseApplication caseApplication){
|
||||||
|
if(StrUtil.isEmpty(caseApplication.getBatchNumber().toString())){
|
||||||
|
return error("参数校验失败");
|
||||||
|
}
|
||||||
|
return adjudicationService.caseFileBatch(caseApplication.getBatchNumber());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 送达(不包含发送电子邮件)
|
||||||
|
* @param bookSendVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/service")
|
||||||
|
// @PreAuthorize("@ss.hasPermi('awardManagement:list:sendaward')")
|
||||||
|
public AjaxResult service(@RequestBody BookSendVO bookSendVO){
|
||||||
|
return adjudicationService.service(bookSendVO.getId(),bookSendVO.getAppEmail(),bookSendVO.getResEmail(),bookSendVO.getApptrackingNum(),bookSendVO.getRestrackingNum());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量送达仲裁书
|
||||||
|
* @param caseApplication
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/serviceBatch")
|
||||||
|
public AjaxResult serviceBatch(@Validated @RequestBody CaseApplication caseApplication) throws EsignDemoException, IOException {
|
||||||
|
if(StrUtil.isEmpty(caseApplication.getBatchNumber().toString())){
|
||||||
|
return error("参数校验失败");
|
||||||
|
}
|
||||||
|
return adjudicationService.serviceBatch(caseApplication.getBatchNumber());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 档案详情查询
|
||||||
|
* @param id 案件id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
// @GetMapping("/archives")
|
||||||
|
// public AjaxResult getArchivesDetail(Long id){
|
||||||
|
//
|
||||||
|
// return adjudicationService.getArchivesDetail(id);
|
||||||
|
// }
|
||||||
|
/**
|
||||||
|
* 根据案件id获取邮箱
|
||||||
|
* @param id 案件id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/emailByCaseId")
|
||||||
|
public AjaxResult emailByCaseId(@RequestParam("id") Long id){
|
||||||
|
|
||||||
|
return adjudicationService.emailByCaseId(id);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 开庭审理提交,只改变案件状态为CaseApplicationConstants.VERPRIF_ARBITRATION
|
||||||
|
* @param caseApplication 案件
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/changeCaseStatus")
|
||||||
|
public AjaxResult changeCaseStatus(@RequestBody CaseApplication caseApplication){
|
||||||
|
if(caseApplication.getId()==null){
|
||||||
|
return error("参数校验失败");
|
||||||
|
}
|
||||||
|
return adjudicationService.changeCaseStatus(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+55
@@ -0,0 +1,55 @@
|
|||||||
|
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.ruoyi.common.annotation.Anonymous;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.utils.CheckSignatuerUtils;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.dto.CaseApplicationDTO;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.vo.CaseApplicationVO;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/callArbitrateCaseApplication")
|
||||||
|
public class ArbitrateApplicationController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private ICaseApplicationService caseApplicationService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增立案数据
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("/generateCaseApplication")
|
||||||
|
public AjaxResult generateCaseApplication(@Validated @RequestBody CaseApplicationVO caseApplicationVO) throws Exception {
|
||||||
|
String paramsbody = JSONUtil.toJsonStr(caseApplicationVO);
|
||||||
|
boolean checkResult= CheckSignatuerUtils.checkSignuter(paramsbody);
|
||||||
|
if(checkResult){
|
||||||
|
CaseApplicationDTO caseApplication = new CaseApplicationDTO();
|
||||||
|
BeanUtils.copyProperties(caseApplicationVO,caseApplication);
|
||||||
|
caseApplication.setCreateBy(getUsername());
|
||||||
|
return caseApplicationService.insertOrUpdate(caseApplication);
|
||||||
|
}else {
|
||||||
|
return AjaxResult.error("签名验证失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+47
@@ -0,0 +1,47 @@
|
|||||||
|
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.system.mapper.SysUserMapper;
|
||||||
|
import com.ruoyi.system.service.ISysUserService;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.Arbitrator;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.IArbitratorService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/arbitrator")
|
||||||
|
public class ArbitratorController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private ISysUserService sysUserService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询仲裁员信息
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('arbitrator:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public AjaxResult list(Arbitrator arbitrator)
|
||||||
|
{
|
||||||
|
if(arbitrator.getCaseId()==null){
|
||||||
|
return AjaxResult.error("案件id不能为空");
|
||||||
|
}
|
||||||
|
List<SysUser> list = sysUserService.selectUserListByAdRole(arbitrator);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+594
@@ -0,0 +1,594 @@
|
|||||||
|
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.ruoyi.common.annotation.Anonymous;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.exception.EsignDemoException;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.utils.WxAppletNotifyUtils;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.*;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.dto.CaseApplicationDTO;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.*;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/caseApplication")
|
||||||
|
public class CaseApplicationController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private ICaseApplicationService caseApplicationService;
|
||||||
|
@Autowired
|
||||||
|
private IAdjudicationService adjudicationService;
|
||||||
|
/**
|
||||||
|
* 根据登录人返回用户信息
|
||||||
|
*/
|
||||||
|
@GetMapping("/getUserInfo")
|
||||||
|
public AjaxResult getUserInfo()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
return success(caseApplicationService.getUserInfo());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询立案数据
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(CaseApplication caseApplication) {
|
||||||
|
if(StrUtil.isEmpty(caseApplication.getSelectCaseStatus())){
|
||||||
|
caseApplication.setSelectCaseStatus("0");
|
||||||
|
}
|
||||||
|
// List<CaseApplication> list = caseApplicationService.selectCaseApplicationListByRole(caseApplication);
|
||||||
|
List<CaseApplication> list = caseApplicationService.page(caseApplication);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 查询批量管理案件列表
|
||||||
|
// */
|
||||||
|
// @GetMapping("/listBatch")
|
||||||
|
// public TableDataInfo listBatch(CaseApplication caseApplication) {
|
||||||
|
// startPage();
|
||||||
|
// List<CaseApplication> list = caseApplicationService.selectCaseApplicationListBatchByRole(caseApplication);
|
||||||
|
// return getDataTable(list);
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据角色查询待办数量
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
@GetMapping("/toDoCount")
|
||||||
|
public AjaxResult toDoCount() {
|
||||||
|
ToDoCount toDoCount = caseApplicationService.selectToDoCount();
|
||||||
|
// List<CaseApplication> list = caseApplicationService.selectCaseApplicationList(caseApplication);
|
||||||
|
return success(toDoCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增立案数据
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list:add')")
|
||||||
|
@Log(title = "新增立案数据", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/addCaseApplication")
|
||||||
|
public AjaxResult addCaseApplication(@Validated @RequestBody CaseApplicationDTO caseApplication)
|
||||||
|
{
|
||||||
|
|
||||||
|
caseApplication.setCreateBy(getUsername());
|
||||||
|
return caseApplicationService.insertOrUpdate(caseApplication);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改立案数据
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list:update')")
|
||||||
|
// @Log(title = "修改立案数据", businessType = BusinessType.UPDATE)
|
||||||
|
// @PostMapping("/editCaseApplication")
|
||||||
|
// public AjaxResult editCaseApplication(@Validated @RequestBody CaseApplicationDTO caseApplication) {
|
||||||
|
//
|
||||||
|
// caseApplication.setUpdateBy(getUsername());
|
||||||
|
// return caseApplicationService.editCaseApplication(caseApplication);
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改立案数据自定义字段
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list:update')")
|
||||||
|
@Log(title = "修改立案数据自定义字段", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/editCaseApplicationDefineval")
|
||||||
|
public AjaxResult editCaseApplicationDefineval(@Validated @RequestBody CaseApplication caseApplication) {
|
||||||
|
return caseApplicationService.editCaseApplicationDefineval(caseApplication);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交立案申请
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list:submit')")
|
||||||
|
@Log(title = "提交立案申请", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/submitCaseApplication")
|
||||||
|
public AjaxResult submitCaseApplication(@RequestBody BatchCaseApplication batchCaseApplication) {
|
||||||
|
if(CollectionUtil.isEmpty(batchCaseApplication.getIds())){
|
||||||
|
return error("参数校验失败");
|
||||||
|
}
|
||||||
|
return toAjax(caseApplicationService.submitCaseApplication(batchCaseApplication.getIds()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量提交立案申请
|
||||||
|
*/
|
||||||
|
@Log(title = "批量提交立案申请", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/submitCaseApplicationBatch")
|
||||||
|
public AjaxResult submitCaseApplicationBatch(@RequestBody BatchCaseApplication batchCaseApplication) {
|
||||||
|
if(StringUtils.isEmpty(batchCaseApplication.getBatchNumber())){
|
||||||
|
return error("参数校验失败");
|
||||||
|
}
|
||||||
|
return caseApplicationService.submitCaseApplicationBatch(batchCaseApplication.getBatchNumber());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除立案数据
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list:delete')")
|
||||||
|
@Log(title = "删除立案数据", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping("/removeCaseApplication")
|
||||||
|
public AjaxResult removeCaseApplication(@RequestBody BatchCaseApplication batchCaseApplication) {
|
||||||
|
if(CollectionUtil.isEmpty(batchCaseApplication.getIds())){
|
||||||
|
return error("参数校验失败");
|
||||||
|
}
|
||||||
|
return success(caseApplicationService.deletecaseApplicationByIds(batchCaseApplication.getIds()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询立案详情
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list:detail')")
|
||||||
|
@PostMapping("/selectCaseApplication")
|
||||||
|
public AjaxResult selectCaseApplication(@Validated @RequestBody CaseApplication caseApplication) {
|
||||||
|
|
||||||
|
CaseApplication caseApplicationselect = caseApplicationService.selectCaseApplication(caseApplication);
|
||||||
|
return success(caseApplicationselect);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 视频会议中查询立案详情
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list:detail')")
|
||||||
|
@GetMapping("/selectById")
|
||||||
|
public AjaxResult selectById(@RequestParam(required = false) Long id ,@RequestParam(required = false) String caseNum) {
|
||||||
|
CaseApplication caseApplication = new CaseApplication();
|
||||||
|
caseApplication.setId(id);
|
||||||
|
caseApplication.setCaseNum(caseNum);
|
||||||
|
CaseApplication caseApplicationselect = caseApplicationService.selectCaseApplication(caseApplication);
|
||||||
|
return success(caseApplicationselect);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询已签署裁决书URL
|
||||||
|
*/
|
||||||
|
@PostMapping("/selectSignSealUrl")
|
||||||
|
public AjaxResult selectSignSealUrl(@Validated @RequestBody CaseApplication caseApplication) throws EsignDemoException {
|
||||||
|
CaseApplication caseApplicationselect = caseApplicationService.selectSignSealUrl(caseApplication);
|
||||||
|
return success(caseApplicationselect);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询案件进度
|
||||||
|
*/
|
||||||
|
@PostMapping("/selectCaseProgress")
|
||||||
|
public AjaxResult selectCaseProgress(@Validated @RequestBody CaseApplication caseApplication) {
|
||||||
|
AjaxResult caseApplicationselect = caseApplicationService.selectCaseProgress(caseApplication);
|
||||||
|
return success(caseApplicationselect);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询签名链接
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSignUrl')")
|
||||||
|
@PostMapping("/selectSignUrl")
|
||||||
|
public AjaxResult selectSignUrl(@Validated @RequestBody CaseApplication caseApplication) throws EsignDemoException {
|
||||||
|
SealSignRecord sealSignRecordselect = caseApplicationService.selectSignUrl(caseApplication);
|
||||||
|
return success(sealSignRecordselect);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用印链接
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSealUrl')")
|
||||||
|
@PostMapping("/selectSealUrl")
|
||||||
|
public AjaxResult selectSealUrl(@Validated @RequestBody CaseApplication caseApplication) throws EsignDemoException {
|
||||||
|
SealSignRecord sealUrlRecordselect = caseApplicationService.selectSealUrl(caseApplication);
|
||||||
|
return success(sealUrlRecordselect);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件证据材料压缩包上传
|
||||||
|
*
|
||||||
|
* @param file 附件
|
||||||
|
* @param id 案件申请id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/uploadZipFile")
|
||||||
|
public AjaxResult uploadZipFile(@RequestParam("file") MultipartFile file, Long id) {
|
||||||
|
String username = this.getUsername();
|
||||||
|
Long userId = this.getUserId();
|
||||||
|
return caseApplicationService.uploadZipFile(file, id, username, userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 立案申请导入模板下载
|
||||||
|
*/
|
||||||
|
@PostMapping("/importTemplate")
|
||||||
|
public void importTemplate(HttpServletResponse response) {
|
||||||
|
// 读取文件
|
||||||
|
try {
|
||||||
|
InputStream fileInputStream = new URL("http://121.40.189.20:8000/API/uploadPath/template/案件导入模板.xlsx").openStream();
|
||||||
|
response.setHeader("content-type", "application/octet-stream");
|
||||||
|
response.setContentType("application/octet-stream");
|
||||||
|
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("案件导入模板.xlsx","UTF-8"));
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
int length;
|
||||||
|
while ((length = fileInputStream.read(buffer)) > 0) {
|
||||||
|
response.getOutputStream().write(buffer, 0, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "立案信息导入", businessType = BusinessType.IMPORT)
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list:import')")
|
||||||
|
@PostMapping("/importData")
|
||||||
|
public AjaxResult importData(MultipartFile file) throws Exception {
|
||||||
|
if(file==null){
|
||||||
|
return warn("请上传文件");
|
||||||
|
}
|
||||||
|
ExcelUtil<CaseApplication> util = new ExcelUtil<CaseApplication>(CaseApplication.class);
|
||||||
|
List<CaseApplication> caseApplicationList = util.importExcel(file.getInputStream());
|
||||||
|
String operName = getUsername();
|
||||||
|
String message = caseApplicationService.importCaseApplication(caseApplicationList, operName);
|
||||||
|
return success(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组庭
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseApplication:pendTral')")
|
||||||
|
@Log(title = "组庭", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/pendTral")
|
||||||
|
public AjaxResult pendTral(@Validated @RequestBody CaseApplication caseApplication) {
|
||||||
|
return toAjax(caseApplicationService.pendTral(caseApplication));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组庭审核
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list:checkgroup')")
|
||||||
|
@Log(title = "组庭审核", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/pendTralCheck")
|
||||||
|
public AjaxResult pendTralCheck(@Validated @RequestBody CaseApplication caseApplication) {
|
||||||
|
if(CollectionUtil.isEmpty(caseApplication.getArbitrators())){
|
||||||
|
return error("请选择仲裁员");
|
||||||
|
}
|
||||||
|
return caseApplicationService.pendTralCheck(caseApplication);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组庭确认
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list:confirmgroup')")
|
||||||
|
@Log(title = "组庭确认", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/pendTralSure")
|
||||||
|
public AjaxResult pendTralSure(@Validated @RequestBody CaseApplication caseApplication) {
|
||||||
|
return toAjax(caseApplicationService.pendTralSure(caseApplication));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量组庭审核
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list:checkgroup')")
|
||||||
|
@Log(title = "批量组庭审核", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/pendTralCheckBatch")
|
||||||
|
public AjaxResult pendTralCheckBatch(@Validated @RequestBody CaseApplication caseApplication) {
|
||||||
|
return toAjax(caseApplicationService.pendTralCheckBatch(caseApplication));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量组庭确认
|
||||||
|
*/
|
||||||
|
@Log(title = "批量组庭确认", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/pendTralSureBatch")
|
||||||
|
public AjaxResult pendTralSureBatch(@Validated @RequestBody CaseApplication caseApplication) {
|
||||||
|
return toAjax(caseApplicationService.pendTralSureBatch(caseApplication));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改开庭时间
|
||||||
|
*/
|
||||||
|
@Log(title = "修改开庭时间", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/updateHeardate")
|
||||||
|
public AjaxResult updateHeardate(@Validated @RequestBody CaseApplication caseApplication) {
|
||||||
|
return toAjax(caseApplicationService.updateHeardate(caseApplication));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 核验裁决书
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseApplication:verificationArbitrateRecord')")
|
||||||
|
@Log(title = "核验裁决书", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/verificationArbitrateRecord")
|
||||||
|
public AjaxResult verificationArbitrateRecord(@Validated @RequestBody CaseApplication caseApplication) {
|
||||||
|
return toAjax(caseApplicationService.verificationArbitrateRecord(caseApplication));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门长审核裁决书
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseApplication:checkArbitrateRecord')")
|
||||||
|
@Log(title = "部门长审核裁决书", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/checkArbitrateRecord")
|
||||||
|
public AjaxResult checkArbitrateRecord(@Validated @RequestBody CaseApplication caseApplication) {
|
||||||
|
|
||||||
|
return caseApplicationService.checkArbitrateRecord(caseApplication);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 仲裁员审核裁决书
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseApplication:checkArbitrateRecord')")
|
||||||
|
@Log(title = "仲裁员审核裁决书", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/arbitrator/checkArbitrateRecord")
|
||||||
|
public AjaxResult arbitratorCheckArbitrateRecord(@Validated @RequestBody CaseApplication caseApplication) {
|
||||||
|
|
||||||
|
return caseApplicationService.arbitratorCheckArbitrateRecord(caseApplication);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量操作仲裁员审核裁决书
|
||||||
|
*/
|
||||||
|
@Log(title = "批量操作仲裁员审核裁决书", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/arbitrator/checkArbitrateRecordBatch")
|
||||||
|
public AjaxResult arbitratorCheckArbitrateRecordBatch(@Validated @RequestBody CaseApplication caseApplication) {
|
||||||
|
|
||||||
|
return caseApplicationService.arbitratorCheckArbitrateRecordBatch(caseApplication);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量部门长审核裁决书
|
||||||
|
*/
|
||||||
|
@Log(title = "批量部门长审核裁决书", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/checkArbitrateRecordBatch")
|
||||||
|
public AjaxResult checkArbitrateRecordBatch(@Validated @RequestBody CaseApplication caseApplication) {
|
||||||
|
|
||||||
|
return caseApplicationService.checkArbitrateRecordBatch(caseApplication);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量核验裁决书
|
||||||
|
*/
|
||||||
|
@Log(title = "批量核验裁决书", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/verificationArbitrateRecordBatch")
|
||||||
|
public AjaxResult verificationArbitrateRecordBatch(@Validated @RequestBody CaseApplication caseApplication) {
|
||||||
|
return toAjax(caseApplicationService.verificationArbitrateRecordBatch(caseApplication));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否指派仲裁员
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseApplication:pendingAppointArbotrar')")
|
||||||
|
@Log(title = "是否指派仲裁员", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/pendingAppointArbotrar")
|
||||||
|
public AjaxResult pendingAppointArbotrar(@Validated @RequestBody CaseApplication caseApplication) {
|
||||||
|
return toAjax(caseApplicationService.pendingAppointArbotrar(caseApplication));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交立案审查
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list:check')")
|
||||||
|
@Log(title = "提交立案审查", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/submitCaseApplicationCheck")
|
||||||
|
public AjaxResult submitCaseApplicationCheck(@RequestBody BatchCaseApplication batchCaseApplication) {
|
||||||
|
if(CollectionUtil.isEmpty(batchCaseApplication.getIds())|| batchCaseApplication.getAgreeOrNotCheck()==null){
|
||||||
|
return error("参数校验失败");
|
||||||
|
}
|
||||||
|
return success(caseApplicationService.submitCaseApplicationCheck(batchCaseApplication.getIds(),batchCaseApplication.getAgreeOrNotCheck(),batchCaseApplication.getCaseCheckReject()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量提交立案审查
|
||||||
|
*/
|
||||||
|
@Log(title = "批量提交立案审查", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/submitCaseApplicationCheckBatch")
|
||||||
|
public AjaxResult submitCaseApplicationCheckBatch(@RequestBody BatchCaseApplication batchCaseApplication) {
|
||||||
|
if(StringUtils.isEmpty(batchCaseApplication.getBatchNumber()) || batchCaseApplication.getAgreeOrNotCheck()==null){
|
||||||
|
return error("参数校验失败");
|
||||||
|
}
|
||||||
|
return caseApplicationService.submitCaseApplicationCheckBatch(batchCaseApplication.getBatchNumber(),batchCaseApplication.getAgreeOrNotCheck(),batchCaseApplication.getCaseCheckReject());
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 下载案件压缩包
|
||||||
|
// */
|
||||||
|
// @PostMapping("/downloadCaseZipFile")
|
||||||
|
// public AjaxResult downloadCaseZipFile(@Validated @RequestBody CaseApplication caseApplication) {
|
||||||
|
//
|
||||||
|
// CaseAttach caseAttach = caseApplicationService.downloadCaseZipFile(caseApplication);
|
||||||
|
// return success(caseAttach);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送房间号短信
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("/sendRoomNoMessage")
|
||||||
|
public AjaxResult sendRoomNoMessage(@Validated @RequestBody SendRoomNoMessageVO messageVO) {
|
||||||
|
String result = caseApplicationService.sendRoomNoMessage(messageVO);
|
||||||
|
return success(result);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取UrlScheme
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@GetMapping("/getUrlScheme")
|
||||||
|
public AjaxResult getUrlScheme() {
|
||||||
|
String schemeUrl = WxAppletNotifyUtils.jumpAppletSchemeUrl();
|
||||||
|
return success(schemeUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认会议结果
|
||||||
|
* @param arbitrateRecord
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/confirmMeetingResult")
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list:creatTrialRecord')")
|
||||||
|
public AjaxResult creatTrialRecordnew( @RequestBody ArbitrateRecord arbitrateRecord){
|
||||||
|
if(arbitrateRecord.getCaseAppliId()==null || arbitrateRecord.getAppliIsAbsen()==null || arbitrateRecord.getIsAbsence()==null){
|
||||||
|
return error("参数校验失败");
|
||||||
|
}
|
||||||
|
return caseApplicationService.creatTrialRecordnew(arbitrateRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件锁定或者解锁
|
||||||
|
* @param caseApplication
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/updateCaseLockStatus")
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list:creatTrialRecord')")
|
||||||
|
public AjaxResult updateCaseLockStatus(@Validated @RequestBody CaseApplication caseApplication){
|
||||||
|
if(caseApplication.getId()==null || caseApplication.getLockStatus()==null){
|
||||||
|
return error("参数校验失败");
|
||||||
|
}
|
||||||
|
return AjaxResult.success(caseApplicationService.updateCaseLockStatus(caseApplication));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取userSign
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@GetMapping("/generateUserSign")
|
||||||
|
public AjaxResult generateUserSign(@RequestParam(required = true) String userId){
|
||||||
|
if(StrUtil.isEmpty(userId)){
|
||||||
|
error("参数校验失败");
|
||||||
|
}
|
||||||
|
return AjaxResult.success(caseApplicationService.generateUserSign(userId));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 预约会议
|
||||||
|
* @param reservedConferenceVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/reservedConference")
|
||||||
|
public AjaxResult reservedConference(@Validated @RequestBody ReservedConferenceVO reservedConferenceVO) throws Exception {
|
||||||
|
|
||||||
|
return caseApplicationService.reservedConference(reservedConferenceVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成房间号
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@GetMapping("/createRoomId")
|
||||||
|
public AjaxResult createRoomId(@RequestParam("caseId") Long caseId) {
|
||||||
|
|
||||||
|
return success(caseApplicationService.createRoomId(caseId));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 删除房间号
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("/deleteRoom")
|
||||||
|
public AjaxResult deleteRoom(@RequestParam("roomId") String roomId) {
|
||||||
|
|
||||||
|
return caseApplicationService.deleteRoom(roomId);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 根据案件id查询已预约的会议
|
||||||
|
* @param caseId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@GetMapping("/reserveConferenceList")
|
||||||
|
public AjaxResult reserveConferenceList( @RequestParam("caseId") Long caseId) {
|
||||||
|
|
||||||
|
return success(caseApplicationService.reserveConferenceList(caseId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件压缩包导入
|
||||||
|
* @param file
|
||||||
|
* @param applicantType 申请人类型,自然人-1,机构-2
|
||||||
|
* @param resType 被申请人类型,自然人-1,机构-2
|
||||||
|
* @return
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
@PostMapping("/uploadCaseZipFile")
|
||||||
|
public AjaxResult uploadCaseZipFile(@RequestParam("file") MultipartFile file,@RequestParam("templateId") Long templateId,Integer applicantType,Integer resType) throws IOException {
|
||||||
|
return caseApplicationService.uploadCaseZipFile(file,templateId,applicantType,resType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据附件id修改案件id
|
||||||
|
* @param caseAttach
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/updateCaseIdByAnnexId")
|
||||||
|
public AjaxResult updateCaseIdByAnnexId(@RequestBody CaseAttach caseAttach) {
|
||||||
|
if(caseAttach.getAnnexId()==null || caseAttach.getCaseAppliId()==null){
|
||||||
|
return error("参数校验失败");
|
||||||
|
}
|
||||||
|
return caseApplicationService.updateCaseIdByAnnexId(caseAttach);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 保存onlyOffice在线编辑的文件
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/saveOnlyOfficeFile")
|
||||||
|
public AjaxResult saveOnlyOfficeFile( @RequestBody CaseAttach caseAttach) {
|
||||||
|
if(caseAttach.getCaseAppliId()==null||StrUtil.isEmpty(caseAttach.getOnlyOfficeFileId())||StrUtil.isEmpty(caseAttach.getAnnexPath())){
|
||||||
|
return error("参数校验失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
return caseApplicationService.saveOnlyOfficeFile(caseAttach);
|
||||||
|
}
|
||||||
|
}
|
||||||
+107
@@ -0,0 +1,107 @@
|
|||||||
|
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Anonymous;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.CaseApplicationLogService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
|
||||||
|
import static com.ruoyi.common.core.domain.AjaxResult.success;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangqiong
|
||||||
|
* @description 案件日志
|
||||||
|
* @date 2023-11-17 13:58
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping (value = "/caseApplicationLog")
|
||||||
|
public class CaseApplicationLogController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CaseApplicationLogService caseApplicationLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
* @author wangqiong
|
||||||
|
* @date 2023/11/17
|
||||||
|
**/
|
||||||
|
@PostMapping("/insert")
|
||||||
|
public AjaxResult insert(@RequestBody CaseApplication caseApplicationLog){
|
||||||
|
return success(caseApplicationLogService.insert(caseApplicationLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 刪除
|
||||||
|
* @author wangqiong
|
||||||
|
* @date 2023/11/17
|
||||||
|
**/
|
||||||
|
@PostMapping("/delete")
|
||||||
|
public AjaxResult delete(Long id){
|
||||||
|
return success(caseApplicationLogService.delete(id));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 修改的案件提交到秘书
|
||||||
|
* @author wangqiong
|
||||||
|
* @date 2023/11/17
|
||||||
|
**/
|
||||||
|
@PostMapping("/submit")
|
||||||
|
public AjaxResult submit(@RequestBody UpdateSubmitVO vo){
|
||||||
|
if(vo.getCaseId()==null || vo.getVersion()==null){
|
||||||
|
return AjaxResult.error("参数校验错误");
|
||||||
|
}
|
||||||
|
return caseApplicationLogService.submit(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改撤销申请
|
||||||
|
* @author wangqiong
|
||||||
|
* @date 2023/11/17
|
||||||
|
**/
|
||||||
|
@PostMapping("/revoke")
|
||||||
|
public AjaxResult revoke(@RequestBody UpdateSubmitVO vo){
|
||||||
|
if(vo.getCaseId()==null || vo.getVersion()==null){
|
||||||
|
return AjaxResult.error("参数校验错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
return caseApplicationLogService.revoke(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询 根据主键 id 查询
|
||||||
|
* @author wangqiong
|
||||||
|
* @date 2023/11/17
|
||||||
|
**/
|
||||||
|
@GetMapping("/selectByCaseIdAndVersion")
|
||||||
|
public AjaxResult selectByCaseIdAndVersion(@RequestParam(value = "caseId") Long caseId,@RequestParam(value = "version")Integer version ){
|
||||||
|
return success(caseApplicationLogService.selectByCaseIdAndVersion(caseId,version));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 秘书审核修改的案件
|
||||||
|
* @author wangqiong
|
||||||
|
* @date 2023/11/17
|
||||||
|
**/
|
||||||
|
@PostMapping("/updateAudit")
|
||||||
|
public AjaxResult updateAudit(@RequestBody UpdateSubmitVO vo){
|
||||||
|
if(vo.getCaseId()==null || vo.getVersion()==null || vo.getIsAgree()==null || vo.getUpdateSubmitStatus()==null){
|
||||||
|
return AjaxResult.error("参数校验错误");
|
||||||
|
}
|
||||||
|
return caseApplicationLogService.updateAudit(vo);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 查询该版本及之前版本案件进行对比
|
||||||
|
* @author wangqiong
|
||||||
|
* @date 2023/11/17
|
||||||
|
**/
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("/selectCompareCase")
|
||||||
|
public AjaxResult selectCompareCase(@RequestBody UpdateSubmitVO vo){
|
||||||
|
if(vo.getCaseId()==null || vo.getVersion()==null ){
|
||||||
|
return AjaxResult.error("参数校验错误");
|
||||||
|
}
|
||||||
|
return caseApplicationLogService.selectCompareCase(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+67
@@ -0,0 +1,67 @@
|
|||||||
|
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseIds;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.ICaseArbitrateService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/arbitrate")
|
||||||
|
public class CaseArbitrateController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private ICaseArbitrateService caseArbitrateService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核仲裁方式
|
||||||
|
* @param caseApplication
|
||||||
|
* @param opinion 1同意,0拒绝
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PutMapping("/method")
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list:checkarbitrationway')")
|
||||||
|
public AjaxResult examineArbitrateMethod(@Validated @RequestBody CaseApplication caseApplication
|
||||||
|
, Integer opinion, Integer arbitratMethod){
|
||||||
|
return caseArbitrateService.examineArbitrateMethod(caseApplication,opinion,arbitratMethod);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量审核仲裁方式
|
||||||
|
* @param caseApplication
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/methodBatch")
|
||||||
|
public AjaxResult examineArbitrateMethodBatch(@Validated @RequestBody CaseApplication caseApplication){
|
||||||
|
return caseArbitrateService.examineArbitrateMethodBatch(caseApplication);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 书面审理
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/writtenHear")
|
||||||
|
public AjaxResult writtenHear(@RequestBody CaseIds caseIds){
|
||||||
|
return caseArbitrateService.writtenHear(caseIds);
|
||||||
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 批量书面审理
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/writtenHearBatch")
|
||||||
|
public AjaxResult writtenHearBatch(@Validated @RequestBody CaseApplication caseApplication){
|
||||||
|
return caseArbitrateService.writtenHearBatch(caseApplication);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
+161
@@ -0,0 +1,161 @@
|
|||||||
|
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseEvidenceDirectory;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.dto.CaseEvidenceDTO;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.ICaseEvidenceService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件证据
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/evidence")
|
||||||
|
public class CaseEvidenceController extends BaseController {
|
||||||
|
private final ICaseEvidenceService caseEvidenceService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public CaseEvidenceController(ICaseEvidenceService caseEvidenceService) {
|
||||||
|
this.caseEvidenceService = caseEvidenceService;
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 根据案件id查询案件详情
|
||||||
|
// *
|
||||||
|
// * @param id
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// @GetMapping("/{id}")
|
||||||
|
// public AjaxResult getCaseDetailsById(@PathVariable Long id) {
|
||||||
|
// String username = this.getUsername();
|
||||||
|
// return caseEvidenceService.getCaseDetailsById(id, username);
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件证据上传
|
||||||
|
*
|
||||||
|
* @param file 附件
|
||||||
|
* @param annexType 附件类型,立案申请书(1)、证据材料(2)、裁决书(3)、案件视频(4)、身份证件(5)
|
||||||
|
* @param id 案件申请id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/upload")
|
||||||
|
public AjaxResult uploadEvidence(@RequestParam("file") MultipartFile file, Integer annexType, Long id) {
|
||||||
|
String username = this.getUsername();
|
||||||
|
Long userId = this.getUserId();
|
||||||
|
return caseEvidenceService.uploadEvidence(file, annexType, id, username, userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传庭审笔录
|
||||||
|
*
|
||||||
|
* @param file 附件
|
||||||
|
* @param annexType 附件类型,庭审笔录(7)
|
||||||
|
* @param id 案件申请id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/uploadRecord")
|
||||||
|
public AjaxResult uploadRecord(@RequestParam("file") MultipartFile file, Integer annexType, Long id) {
|
||||||
|
String username = this.getUsername();
|
||||||
|
Long userId = this.getUserId();
|
||||||
|
return caseEvidenceService.uploadRecord(file, annexType, id, username, userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/batchUpload")
|
||||||
|
public AjaxResult batchUpload(@RequestParam("file") MultipartFile[] file, Integer annexType, Long id) {
|
||||||
|
if(file==null){
|
||||||
|
return error("请选择要上传的文件");
|
||||||
|
}
|
||||||
|
String username = this.getUsername();
|
||||||
|
Long userId = this.getUserId();
|
||||||
|
return caseEvidenceService.batchUpload(file, annexType, id, username, userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取附件
|
||||||
|
* @param caseAppliId
|
||||||
|
* @param annexTypeList
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/fileList")
|
||||||
|
public AjaxResult fileList(Long caseAppliId, @RequestParam("annexTypeList") List<Integer> annexTypeList){
|
||||||
|
if(caseAppliId==null){
|
||||||
|
return error("案件id不能为空");
|
||||||
|
}
|
||||||
|
return caseEvidenceService.fileList(caseAppliId, annexTypeList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除附件
|
||||||
|
* @param caseAttach
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/deleteFile")
|
||||||
|
public AjaxResult deleteFile(@RequestBody CaseAttach caseAttach){
|
||||||
|
|
||||||
|
if(CollectionUtil.isEmpty(caseAttach.getFileIds())){
|
||||||
|
return error("附件id不能为空");
|
||||||
|
}
|
||||||
|
return success(caseEvidenceService.deleteFile( caseAttach.getFileIds()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询当前用户案件列表
|
||||||
|
*
|
||||||
|
* @param caseStatus
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
// @GetMapping("/all")
|
||||||
|
// public AjaxResult getCaseListAll(@RequestParam("caseStatus") Integer caseStatus) {
|
||||||
|
//
|
||||||
|
// return success(caseEvidenceService.getCaseListAll(caseStatus));
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 证据确认
|
||||||
|
*
|
||||||
|
* @param caseApplication 案件对象
|
||||||
|
* @return 统一返回结果
|
||||||
|
*/
|
||||||
|
@PutMapping("/confirm")
|
||||||
|
public AjaxResult evidenceConfirmation(@Validated @RequestBody CaseApplication caseApplication) {
|
||||||
|
return caseEvidenceService.evidenceConfirmation(caseApplication);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件质证
|
||||||
|
*
|
||||||
|
* @param caseEvidenceDTO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/crossexami")
|
||||||
|
public AjaxResult caseCrossexamination(@Validated @RequestBody CaseEvidenceDTO caseEvidenceDTO) {
|
||||||
|
return caseEvidenceService.caseCrossexamination(caseEvidenceDTO);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取证据目录树列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/evidenceTree")
|
||||||
|
public AjaxResult evidenceTree(CaseEvidenceDirectory caseEvidenceDirectory)
|
||||||
|
{
|
||||||
|
return success(caseEvidenceService.selectEvidenceTreeList(caseEvidenceDirectory)) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+40
@@ -0,0 +1,40 @@
|
|||||||
|
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/caseLogRecord")
|
||||||
|
public class CaseLogRecordController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private ICaseLogRecordService caseLogRecordService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询案件日志列表
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseLog:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public AjaxResult list(CaseLogRecord caseLogRecord)
|
||||||
|
{
|
||||||
|
List<CaseLogRecord> list = caseLogRecordService.selectCaseLogRecordList(caseLogRecord);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+74
@@ -0,0 +1,74 @@
|
|||||||
|
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseNumRule;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.TemplateManual;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.ICaseNumRuleService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/caseNumRule")
|
||||||
|
public class CaseNumRuleController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private ICaseNumRuleService caseNumRuleService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增案件编号规则
|
||||||
|
* @param caseNumRule
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/insertCaseNumRule")
|
||||||
|
public AjaxResult insertCaseNumRule(@RequestBody CaseNumRule caseNumRule){
|
||||||
|
caseNumRule.setCreateBy(getUsername());
|
||||||
|
return caseNumRuleService.insertCaseNumRule(caseNumRule);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改案件编号规则
|
||||||
|
* @param caseNumRule
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/updateCaseNumRule")
|
||||||
|
public AjaxResult updateCaseNumRule(@RequestBody CaseNumRule caseNumRule){
|
||||||
|
return caseNumRuleService.updateCaseNumRule(caseNumRule);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除案件编号规则
|
||||||
|
* @param caseNumRule
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/deleteCaseNumRule")
|
||||||
|
public AjaxResult deleteCaseNumRule(@RequestBody CaseNumRule caseNumRule){
|
||||||
|
return caseNumRuleService.deleteCaseNumRule(caseNumRule);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询案件编号规则
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(CaseNumRule caseNumRule) {
|
||||||
|
startPage();
|
||||||
|
List<CaseNumRule> list = caseNumRuleService.selectCaseNumRule(caseNumRule);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+110
@@ -0,0 +1,110 @@
|
|||||||
|
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.ICasePaymentService;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 缴费支付
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pay")
|
||||||
|
public class CasePaymentController {
|
||||||
|
private final ICasePaymentService paymentService;
|
||||||
|
@Autowired
|
||||||
|
public CasePaymentController(ICasePaymentService paymentService){
|
||||||
|
this.paymentService=paymentService;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 案件缴费
|
||||||
|
* @param casePayDTO 缴费传入参数
|
||||||
|
* @return 统一响应结果
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list:pay')")
|
||||||
|
@PostMapping("/casePay")
|
||||||
|
public AjaxResult casePay(@Validated @RequestBody CasePayDTO casePayDTO) {
|
||||||
|
return paymentService.casePay(casePayDTO);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 确认缴费
|
||||||
|
* @param payDTO 缴费传入参数
|
||||||
|
* @return 统一响应结果
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('caseManagement:list:pay')")
|
||||||
|
@PostMapping("/confirmPay")
|
||||||
|
public AjaxResult confirmPay(@Validated @RequestBody CaseConfirmPayDTO payDTO) {
|
||||||
|
return paymentService.confirmPay(payDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量缴费
|
||||||
|
* @param casePayDTO 缴费传入参数
|
||||||
|
* @return 统一响应结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/casePayBatch")
|
||||||
|
public AjaxResult casePayBatch(@Validated @RequestBody CasePayDTO casePayDTO) {
|
||||||
|
return paymentService.casePayBatch(casePayDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量缴费
|
||||||
|
* @param payDTO 缴费传入参数
|
||||||
|
* @return 统一响应结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/confirmPayBatch")
|
||||||
|
public AjaxResult confirmPayBatch(@Validated @RequestBody CasePayDTO payDTO) {
|
||||||
|
return paymentService.confirmPayBatch(payDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 缴费确认
|
||||||
|
* @param batchCaseApplication
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('paymentManagement:list:payconfirm')")
|
||||||
|
@PutMapping("/confirm")
|
||||||
|
public AjaxResult confirmPayment(@Validated @RequestBody BatchCaseApplication batchCaseApplication) {
|
||||||
|
if(CollectionUtil.isEmpty(batchCaseApplication.getIds()) || batchCaseApplication.getAgreeOrNotCheck()==null){
|
||||||
|
return AjaxResult.error("参数校验失败");
|
||||||
|
}
|
||||||
|
return paymentService.confirmPayment(batchCaseApplication);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 缴费列表查询
|
||||||
|
* @param casePayDTO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public AjaxResult casePayList(CasePayDTO casePayDTO) {
|
||||||
|
return paymentService.casePayList(casePayDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/listBatch")
|
||||||
|
public AjaxResult casePayListBatch(@Validated @RequestBody CasePayDTO casePayDTO) {
|
||||||
|
return paymentService.casePayListBatch(casePayDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量缴费确认
|
||||||
|
* @param batchCaseApplication
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/confirmBatch")
|
||||||
|
public AjaxResult confirmPaymentBatch(@Validated @RequestBody BatchCaseApplication batchCaseApplication) {
|
||||||
|
if(StringUtils.isEmpty(batchCaseApplication.getBatchNumber())){
|
||||||
|
return AjaxResult.error("参数校验失败");
|
||||||
|
}
|
||||||
|
return paymentService.confirmPaymentBatch(batchCaseApplication.getBatchNumber());
|
||||||
|
}
|
||||||
|
}
|
||||||
+237
@@ -0,0 +1,237 @@
|
|||||||
|
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.exception.EsignDemoException;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.*;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.vo.SealListVO;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.IDeptIdentifyService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/deptIdentify")
|
||||||
|
public class DeptIdentifyController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private IDeptIdentifyService deptIdentifyService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增机构
|
||||||
|
* @param deptIdentify
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/insert")
|
||||||
|
public AjaxResult insertDeptIdentify(@RequestBody DeptIdentify deptIdentify){
|
||||||
|
return deptIdentifyService.insertDeptIdentify(deptIdentify);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除机构
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
public AjaxResult deleteDeptIdentify(Long id){
|
||||||
|
return deptIdentifyService.deleteDeptIdentify(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改机构信息
|
||||||
|
* @param deptIdentify
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PutMapping("/update")
|
||||||
|
public AjaxResult updateDeptIdentify(@RequestBody DeptIdentify deptIdentify){
|
||||||
|
return deptIdentifyService.updateDeptIdentify(deptIdentify);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询机构信息
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(DeptIdentify deptIdentify) {
|
||||||
|
startPage();
|
||||||
|
List<DeptIdentify> list = deptIdentifyService.selectDeptIdentify(deptIdentify);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询机构认证链接
|
||||||
|
*/
|
||||||
|
@PostMapping("/selectDeptIndefiUrl")
|
||||||
|
public AjaxResult selectDeptIndefiUrl(@Validated @RequestBody DeptIdentify deptIdentify) throws EsignDemoException {
|
||||||
|
DeptIdentify deptIdentifyselect = deptIdentifyService.selectDeptIndefiUrl(deptIdentify);
|
||||||
|
return success(deptIdentifyselect);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机构启用/禁用
|
||||||
|
*/
|
||||||
|
@PostMapping("/enableDept")
|
||||||
|
public AjaxResult enableDept(@Validated @RequestBody DeptIdentify deptIdentify) {
|
||||||
|
return deptIdentifyService.enableDept(deptIdentify);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传自定义公章
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
* @param file
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/sealUpload")
|
||||||
|
public AjaxResult sealUpload(Long id, String sealName , @RequestParam("file") MultipartFile file) {
|
||||||
|
return deptIdentifyService.sealUpload(id, sealName ,file);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接收E签宝回调通知
|
||||||
|
* @param body
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/notify")
|
||||||
|
public AjaxResult receiveNotify(String body) {
|
||||||
|
return deptIdentifyService.receiveNotify(body);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公章列表查询
|
||||||
|
* @param deptIdentify
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/sealList")
|
||||||
|
public TableDataInfo getSealList( DeptIdentify deptIdentify ){
|
||||||
|
startPage();
|
||||||
|
List<SealManage> sealList = deptIdentifyService.getSealList(deptIdentify);
|
||||||
|
return getDataTable(sealList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 印章启用或者禁用
|
||||||
|
* @param sealManage
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/updateSealLockStatus")
|
||||||
|
public AjaxResult updateSealLockStatus(@Validated @RequestBody SealManage sealManage){
|
||||||
|
if(sealManage.getId()==null ||sealManage.getIsUse()==null){
|
||||||
|
return error("参数校验失败");
|
||||||
|
}
|
||||||
|
return deptIdentifyService.updateSealLockStatus(sealManage);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增模板
|
||||||
|
* @param templateManage
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/insertTemplate")
|
||||||
|
public AjaxResult insertTemplate(TemplateManage templateManage,@RequestParam("file") MultipartFile file){
|
||||||
|
return deptIdentifyService.insertTemplate(templateManage,file);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 修改模板
|
||||||
|
* @param templateManage
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/updateTemplate")
|
||||||
|
public AjaxResult updateTemplate(TemplateManage templateManage,@RequestParam(value = "file", required = false) MultipartFile file){
|
||||||
|
return deptIdentifyService.updateTemplate(templateManage,file);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除模板
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/deleteTemplate")
|
||||||
|
public AjaxResult deleteTemplate(Long id){
|
||||||
|
return deptIdentifyService.deleteTemplate(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据机构id查询模板
|
||||||
|
* @param deptIdentify
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getTemplate")
|
||||||
|
public TableDataInfo getTemplateList( DeptIdentify deptIdentify){
|
||||||
|
startPage();
|
||||||
|
List<TemplateManage> sealList = deptIdentifyService.getTemplateList(deptIdentify);
|
||||||
|
return getDataTable(sealList);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 根据部门id查询岗位用户信息
|
||||||
|
*/
|
||||||
|
@GetMapping("selectPostUserByDeptId")
|
||||||
|
public AjaxResult selectPostUserByDeptId(DeptIdentify deptIdentify){
|
||||||
|
return AjaxResult.success(deptIdentifyService.selectPostUserByDeptId(deptIdentify));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 给机构绑定经办人
|
||||||
|
*/
|
||||||
|
@GetMapping("bindHandler")
|
||||||
|
public AjaxResult bindHandler(DeptIdentify deptIdentify){
|
||||||
|
return deptIdentifyService.bindHandler(deptIdentify);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据模板id查询抓取规则
|
||||||
|
* @param templateManage
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/getFatchRuleByTemplateid")
|
||||||
|
public AjaxResult getFatchRuleByTemplateid(@RequestBody TemplateManage templateManage){
|
||||||
|
List<FatchRule> fatchRuleList = deptIdentifyService.getFatchRuleByTemplateid(templateManage);
|
||||||
|
return AjaxResult.success(fatchRuleList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存抓取规则
|
||||||
|
* @param templateManage
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/saveFatchRules")
|
||||||
|
public AjaxResult saveFatchRules(@RequestBody TemplateManage templateManage){
|
||||||
|
return deptIdentifyService.saveFatchRules(templateManage);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询column和注释
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/selectColumnandComment")
|
||||||
|
public AjaxResult selectColumnandComment(){
|
||||||
|
List<FatchRule> fatchRuleList = deptIdentifyService.selectColumnandComment();
|
||||||
|
return AjaxResult.success(fatchRuleList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询column
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/selectColumnbycomment")
|
||||||
|
public AjaxResult selectColumnbycomment(@RequestBody FatchRule fatchRule){
|
||||||
|
FatchRule fatchRulesel = deptIdentifyService.selectColumnbycomment(fatchRule);
|
||||||
|
return AjaxResult.success(fatchRulesel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据模板id查询模板字段列表
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getTemplateInfoById")
|
||||||
|
public AjaxResult getTemplateInfoById(@RequestParam("id") Long id){
|
||||||
|
TemplateManage templateManage = new TemplateManage();
|
||||||
|
templateManage.setId(id);
|
||||||
|
List<FatchRule> fatchRuleList = deptIdentifyService.getTemplateInfoById(templateManage);
|
||||||
|
return AjaxResult.success(fatchRuleList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+43
@@ -0,0 +1,43 @@
|
|||||||
|
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.ruoyi.common.annotation.Anonymous;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.IdentityAuthenticationService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/identityAuthentication")
|
||||||
|
public class IdentityAuthenticationController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private IdentityAuthenticationService identityAuthenticationService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取EIDtoken
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("/selectIdentityAuthenticaEIDtoken")
|
||||||
|
public AjaxResult selectIdentityAuthenticaEIDtoken() {
|
||||||
|
JSONObject tokenResult = identityAuthenticationService.selectIdentityAuthenticaEIDtoken();
|
||||||
|
return success(tokenResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序人脸核身后查询身份认证结果
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("/selectIdentityAuthenticaRespon")
|
||||||
|
public AjaxResult selectIdentityAuthenticaRespon(@Validated @RequestBody IdentityAuthentication ientityAuthentication) {
|
||||||
|
AjaxResult checkResult = identityAuthenticationService.selectIdentityAuthenticaRespon(ientityAuthentication);
|
||||||
|
return checkResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+57
@@ -0,0 +1,57 @@
|
|||||||
|
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Anonymous;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.MsSignSealService;
|
||||||
|
import com.ruoyi.wisdomarbitrate.utils.SignVerifyUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Classname MsSignSealController
|
||||||
|
* @Description TODO
|
||||||
|
* @Version 1.0.0
|
||||||
|
* @Date 2024/5/10 15:07
|
||||||
|
* @Created wangqiong
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/mssignSeal")
|
||||||
|
public class MsSignSealController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private MsSignSealService msSignSealService;
|
||||||
|
/**
|
||||||
|
* 签名用印回调
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("/signSeaalCaseApplicaCallback")
|
||||||
|
public AjaxResult signSeaalCaseApplicaCallback() throws Exception {
|
||||||
|
boolean checkResult= SignVerifyUtils.checkSignuter();
|
||||||
|
if(checkResult){
|
||||||
|
String reqbodystr =SignVerifyUtils.getRequestBody();
|
||||||
|
return msSignSealService.signSeaalCaseApplicaCallback(reqbodystr);
|
||||||
|
}else {
|
||||||
|
return AjaxResult.error("error");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 印章审核回调
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("/sealCheckCallback")
|
||||||
|
public AjaxResult sealCheckCallback() throws Exception {
|
||||||
|
boolean checkResult= SignVerifyUtils.checkSignuter();
|
||||||
|
if(checkResult){
|
||||||
|
String reqbodystr =SignVerifyUtils.getRequestBody();
|
||||||
|
return msSignSealService.sealCheckCallback(reqbodystr);
|
||||||
|
}else {
|
||||||
|
return AjaxResult.error("error");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
+59
@@ -0,0 +1,59 @@
|
|||||||
|
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.TemplateManual;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.ITemplateService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/template")
|
||||||
|
public class TemplateController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private ITemplateService templateService;
|
||||||
|
/**
|
||||||
|
* 新增模板
|
||||||
|
* @param templateManual
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/insert")
|
||||||
|
public AjaxResult insertTemplate(@RequestBody TemplateManual templateManual){
|
||||||
|
return templateService.insertTemplate(templateManual);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除模板
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
public AjaxResult deleteTemplate(Long id){
|
||||||
|
return templateService.deleteTemplate(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改模板
|
||||||
|
* @param templateManual
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PutMapping("/update")
|
||||||
|
public AjaxResult updateTemplate(@RequestBody TemplateManual templateManual){
|
||||||
|
return templateService.updateTemplate(templateManual);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询模板
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list( TemplateManual templateManual) {
|
||||||
|
startPage();
|
||||||
|
List<TemplateManual> list = templateService.selectTemplate(templateManual);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+282
@@ -0,0 +1,282 @@
|
|||||||
|
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.ruoyi.common.annotation.Anonymous;
|
||||||
|
import com.ruoyi.common.config.RuoYiConfig;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||||
|
import com.ruoyi.common.utils.file.FileUtils;
|
||||||
|
import com.ruoyi.framework.config.ServerConfig;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.vo.WeChatUserVO;
|
||||||
|
import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.VideoService;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.WeChatUserService;
|
||||||
|
import com.tencentcloudapi.common.Credential;
|
||||||
|
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
|
||||||
|
import com.tencentcloudapi.common.profile.ClientProfile;
|
||||||
|
import com.tencentcloudapi.common.profile.HttpProfile;
|
||||||
|
import com.tencentcloudapi.trtc.v20190722.TrtcClient;
|
||||||
|
import com.tencentcloudapi.trtc.v20190722.models.*;
|
||||||
|
import com.tencentyun.TLSSigAPIv2;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import static com.google.common.io.Files.getFileExtension;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangqiong
|
||||||
|
* @description trtc实时音视频
|
||||||
|
* @date 2023-10-26 11:25
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/video")
|
||||||
|
public class VideoController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private VideoService videoService;
|
||||||
|
@Autowired
|
||||||
|
private ServerConfig serverConfig;
|
||||||
|
@Autowired
|
||||||
|
private CaseAttachMapper caseAttachMapper;
|
||||||
|
@Autowired
|
||||||
|
private ICaseApplicationService caseApplicationService;
|
||||||
|
/**
|
||||||
|
* 从腾讯云下载文件到本地
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("/videoRollBack")
|
||||||
|
public AjaxResult videoRollBack( @RequestBody String body, HttpServletRequest request) {
|
||||||
|
videoService.videoRollBack(body,request);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 根据房间号绑定案件ID
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("/bindCaseId")
|
||||||
|
public AjaxResult bindCaseId(@Valid @RequestBody SendRoomNoMessageVO vo) {
|
||||||
|
|
||||||
|
return videoService.bindCaseId(vo.getId(),vo.getRoomNo());
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 根据案件ID查询视频
|
||||||
|
* @param caseId 案件id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/videoList")
|
||||||
|
public AjaxResult videoList( @RequestParam Long caseId) {
|
||||||
|
|
||||||
|
return videoService.videoList(caseId);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 开启腾讯云录制
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("/openCloudRecording")
|
||||||
|
private AjaxResult openCloudRecording( @RequestBody ReservedConferenceVO vo) {
|
||||||
|
if(vo.getCaseId()==null || vo.getRoomId()==null){
|
||||||
|
return AjaxResult.error("参数错误");
|
||||||
|
}
|
||||||
|
return videoService.openCloudRecording(vo.getCaseId(),vo.getRoomId());
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 关闭腾讯云录制
|
||||||
|
* @param taskId 任务ID
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("/closeDeleteCloudRecording")
|
||||||
|
public AjaxResult closeDeleteCloudRecording(@RequestParam("taskId") String taskId){
|
||||||
|
return videoService.closeDeleteCloudRecording(taskId);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 解散房间
|
||||||
|
* @param reservedConferenceVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("/dissolveRoom")
|
||||||
|
public AjaxResult dissolveRoom( @RequestBody ReservedConferenceVO reservedConferenceVO) {
|
||||||
|
if( reservedConferenceVO.getRoomId()==null){
|
||||||
|
return error("参数校验失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
return videoService.dissolveRoom(reservedConferenceVO.getRoomId());
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 根据userId查询该用户是否是秘书
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@GetMapping("secretaryRoleByUserId")
|
||||||
|
public AjaxResult secretaryRoleByUserId( @RequestParam(value = "userId",required = true) Long userId,@RequestParam(value = "caseId",required = true) Long caseId) {
|
||||||
|
return videoService.secretaryRoleByUserId(userId,caseId);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 根据html字符串转pdf并和案件关联
|
||||||
|
* @param reservedConferenceVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("htmlToPDF")
|
||||||
|
public AjaxResult secretaryRoleByUserId( @RequestBody ReservedConferenceVO reservedConferenceVO) {
|
||||||
|
if( reservedConferenceVO.getCaseId()==null || StrUtil.isEmpty(reservedConferenceVO.getHtmlContent())){
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
return videoService.htmlToPDF(reservedConferenceVO);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 根据案件id和类型查询附件
|
||||||
|
* @param caseAppliId
|
||||||
|
* @param annexType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
@GetMapping("attachListByCaseId")
|
||||||
|
public AjaxResult attachListByCaseId( @RequestParam("caseAppliId") Long caseAppliId,@RequestParam("annexType") Integer annexType) {
|
||||||
|
|
||||||
|
return videoService.attachListByCaseId(caseAppliId,annexType);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 根据案件id查询申请人/被申请人会议上传附件按钮权限
|
||||||
|
* @param caseId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@GetMapping("selectRoleMenuByCaseId")
|
||||||
|
public AjaxResult selectRoleMenuByCaseId( @RequestParam(value = "caseId",required = true) Long caseId) {
|
||||||
|
|
||||||
|
return videoService.selectRoleMenuByCaseId(caseId);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 通用上传请求(单个)
|
||||||
|
* param officeFlag: 是否上传到onlyoffice,0-否,1-是
|
||||||
|
* param isMediaBook: 是否上仲裁书,1-是,其余为否
|
||||||
|
*/
|
||||||
|
@PostMapping("/upload")
|
||||||
|
public AjaxResult uploadFile(@RequestParam("file") MultipartFile file, @RequestParam(value = "isMediaBook",required = false) Integer isMediaBook, @RequestParam("annexType") Integer annexType, @RequestParam(value = "officeFlag", required = false) Integer officeFlag,@RequestParam(value = "caseId",required = false) Long caseId) throws Exception
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
// 上传文件路径
|
||||||
|
String filePath = RuoYiConfig.getUploadPath();
|
||||||
|
String name=file.getOriginalFilename();
|
||||||
|
// 上传并返回新文件名称
|
||||||
|
String fileName = FileUploadUtils.upload(filePath, file);
|
||||||
|
String suffix = getFileExtension(fileName);
|
||||||
|
if(StrUtil.isNotEmpty(suffix)&& suffix.contains("doc")){
|
||||||
|
// 上传到onlyoffice
|
||||||
|
officeFlag=1;
|
||||||
|
}
|
||||||
|
String url = serverConfig.getUrl() + fileName;
|
||||||
|
if(officeFlag != null && officeFlag == 1){
|
||||||
|
// officeFlag,fileName为annexPath
|
||||||
|
JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(fileName,caseId);
|
||||||
|
if(jsonArray!=null && jsonArray.size() > 0) {
|
||||||
|
// 先删除之前的裁决书附件
|
||||||
|
if(Objects.equals(annexType,3) && caseId!=null) {
|
||||||
|
caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType);
|
||||||
|
}
|
||||||
|
CaseAttach caseAttach=null;
|
||||||
|
for (Object obj : jsonArray) {
|
||||||
|
JSONObject jsonObject = (JSONObject) obj;
|
||||||
|
String path = jsonObject.get("filePath")!=null?jsonObject.getString("filePath"):"";
|
||||||
|
path=path.replace("/home/ruoyi/uploadPath/","profile/");
|
||||||
|
caseAttach = CaseAttach.builder()
|
||||||
|
.caseAppliId(caseId)
|
||||||
|
// .annexName(jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):"")
|
||||||
|
.annexName(name)
|
||||||
|
.annexType(annexType)
|
||||||
|
.onlyOfficeFileId(jsonObject.getString("fileId"))
|
||||||
|
.annexPath(path)
|
||||||
|
.build();
|
||||||
|
// if(jsonObject.get("filePath")!=null){
|
||||||
|
// String officePath = jsonObject.getString("filePath");
|
||||||
|
// String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/");
|
||||||
|
// caseAttach.setAnnexPath(replace);
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
caseAttachMapper.save(caseAttach);
|
||||||
|
}
|
||||||
|
if(caseAttach==null){
|
||||||
|
return AjaxResult.error("上传失败");
|
||||||
|
}
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
ajax.put("annexId", caseAttach.getAnnexId());
|
||||||
|
ajax.put("annexType", annexType);
|
||||||
|
// ajax.put("url", url);
|
||||||
|
ajax.put("fileName", name);
|
||||||
|
ajax.put("newFileName", FileUtils.getName(fileName));
|
||||||
|
ajax.put("originalFilename", file.getOriginalFilename());
|
||||||
|
return ajax;
|
||||||
|
}else {
|
||||||
|
return AjaxResult.error("上传失败");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
// 如果是调解书并且是pdf,则删除之前的在新增
|
||||||
|
if(annexType!=null && annexType.equals(3) ){
|
||||||
|
// if(StrUtil.isNotEmpty(suffix)&&!suffix.equals("pdf")){
|
||||||
|
// return AjaxResult.error("请上传pdf格式文件");
|
||||||
|
// }
|
||||||
|
// annexType=AnnexTypeEnum.MEDIATE_BOOK_PDF.getCode();
|
||||||
|
// 先删除之前的附件
|
||||||
|
if(caseId!=null) {
|
||||||
|
caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Long annexId = saveCaseAttach(annexType, name, file.getOriginalFilename(), caseId);
|
||||||
|
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
ajax.put("annexId", annexId);
|
||||||
|
ajax.put("annexType", annexType);
|
||||||
|
ajax.put("url", url);
|
||||||
|
ajax.put("fileName", name);
|
||||||
|
ajax.put("newFileName", FileUtils.getName(fileName));
|
||||||
|
ajax.put("originalFilename", file.getOriginalFilename());
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return AjaxResult.error(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private Long saveCaseAttach(Integer annexType, String path, String originalFilename,Long caseId) {
|
||||||
|
CaseAttach caseAttach = CaseAttach.builder()
|
||||||
|
.annexName(originalFilename)
|
||||||
|
.caseAppliId(caseId)
|
||||||
|
.annexPath(path)
|
||||||
|
.annexType(annexType)
|
||||||
|
.userId(SecurityUtils.getUserId())
|
||||||
|
.userName(SecurityUtils.getUsername())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
caseAttachMapper.save(caseAttach);
|
||||||
|
return caseAttach.getAnnexId();
|
||||||
|
}
|
||||||
|
}
|
||||||
+62
@@ -0,0 +1,62 @@
|
|||||||
|
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.ruoyi.common.annotation.Anonymous;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
|
import com.ruoyi.common.utils.http.HttpUtils;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.vo.WeChatUserVO;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.WeChatUserService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangqiong
|
||||||
|
* @description 微信小程序用户注册登录
|
||||||
|
* @date 2023-10-16 11:25
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/weChatUser")
|
||||||
|
public class WeChatUserController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private WeChatUserService weChatUserService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序端获取手机验证码
|
||||||
|
* @param userVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@GetMapping("/sendCode")
|
||||||
|
public AjaxResult sendCode( WeChatUserVO userVO)
|
||||||
|
{
|
||||||
|
if(StrUtil.isEmpty(userVO.getPhone())){
|
||||||
|
return warn("手机号不能为空");
|
||||||
|
}
|
||||||
|
return weChatUserService.sendCode(userVO);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 小程序注册
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("/registerUser")
|
||||||
|
public AjaxResult registerUser( @RequestBody IdentityAuthentication ientityAuthentication) {
|
||||||
|
if(ientityAuthentication.getId()==null
|
||||||
|
|| StrUtil.isEmpty(ientityAuthentication.getName())
|
||||||
|
|| StrUtil.isEmpty(ientityAuthentication.getIdentityNo())
|
||||||
|
|| StrUtil.isEmpty(ientityAuthentication.getPhone())
|
||||||
|
|| StrUtil.isEmpty(ientityAuthentication.getUserName())
|
||||||
|
|| StrUtil.isEmpty(ientityAuthentication.getEmail())
|
||||||
|
|| StrUtil.isEmpty(ientityAuthentication.getVerifyCode())
|
||||||
|
){
|
||||||
|
return warn("参数校验失败");
|
||||||
|
}
|
||||||
|
logger.info("调用小程序注册==="+ientityAuthentication.toString());
|
||||||
|
return weChatUserService.registerUser(ientityAuthentication);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+49
@@ -0,0 +1,49 @@
|
|||||||
|
package com.ruoyi.web.controller.wisdomarbitrate.sendrecord;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SendMailRecord;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.sendrecord.ISendMailRecordService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/sendMailRecord")
|
||||||
|
public class SendMailRecordController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private ISendMailRecordService sendMailRecordService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询发送邮件记录列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SendMailRecord sendMailRecord) {
|
||||||
|
startPage();
|
||||||
|
List<SendMailRecord> list = sendMailRecordService.selectSendMailRecordList(sendMailRecord);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑邮件记录
|
||||||
|
*/
|
||||||
|
@PostMapping("/update")
|
||||||
|
public AjaxResult update(@RequestBody SendMailRecord sendMailRecord) {
|
||||||
|
return sendMailRecordService.updateSendMailRecord(sendMailRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重新发送邮件记录
|
||||||
|
*/
|
||||||
|
@PostMapping("/reSendMailRecord")
|
||||||
|
public AjaxResult reSendMailRecord(@RequestBody SendMailRecord sendMailRecord) {
|
||||||
|
Boolean aBoolean = sendMailRecordService.reSendMailRecord(sendMailRecord);
|
||||||
|
if (aBoolean) {
|
||||||
|
return AjaxResult.success("发送成功");
|
||||||
|
} else {
|
||||||
|
return AjaxResult.error("发送失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+143
@@ -0,0 +1,143 @@
|
|||||||
|
package com.ruoyi.web.controller.wisdomarbitrate.sendrecord;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import com.ruoyi.common.annotation.Anonymous;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.framework.web.service.TokenService;
|
||||||
|
|
||||||
|
import com.ruoyi.system.mapper.SysUserMapper;
|
||||||
|
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsSendRecordParam;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplateParam;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.shortmessage.MeetingInfo;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.MeetingInfoVO;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.ReSendMessageVO;
|
||||||
|
import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
|
||||||
|
import com.ruoyi.wisdomarbitrate.mapper.shortmessage.MeetingInfoMapper;
|
||||||
|
import com.ruoyi.wisdomarbitrate.mapper.sms.MsSmsSendHistoryRecordParamMapper;
|
||||||
|
import com.ruoyi.wisdomarbitrate.mapper.sms.MsSmsSendRecordParamMapper;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.shortmessage.ShortMessageService;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import tk.mybatis.mapper.entity.Example;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/shortMessage")
|
||||||
|
public class ShortMessageController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private SmsRecordMapper smsRecordMapper;
|
||||||
|
@Autowired
|
||||||
|
private ShortMessageService shortMessageService;
|
||||||
|
@Autowired
|
||||||
|
MsSmsSendRecordParamMapper recordParamMapper;
|
||||||
|
@Autowired
|
||||||
|
MsSmsSendHistoryRecordParamMapper historyRecordParamMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询短信发送记录
|
||||||
|
*
|
||||||
|
* @param smsSendRecord
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/recordList")
|
||||||
|
public TableDataInfo smsSendRecordList(SmsSendRecord smsSendRecord) {
|
||||||
|
startPage();
|
||||||
|
List<SmsSendRecord> list = shortMessageService.smsSendRecordList(smsSendRecord);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("/updateSendContent")
|
||||||
|
public AjaxResult update(@RequestBody SmsSendRecord smsSendRecord) {
|
||||||
|
if (smsSendRecord == null || smsSendRecord.getId() == null || CollectionUtil.isEmpty(smsSendRecord.getTemplateParams())) {
|
||||||
|
return AjaxResult.error("参数校验失败");
|
||||||
|
}
|
||||||
|
// 查询当前版本记录
|
||||||
|
SmsSendRecord oldSendRecord = smsRecordMapper.selectById(smsSendRecord.getId());
|
||||||
|
smsSendRecord.setUpdateTime(new Date());
|
||||||
|
// 更新短信内容,先删除短信记录参数表
|
||||||
|
Example recordParamExam = new Example(MsSmsSendRecordParam.class);
|
||||||
|
recordParamExam.createCriteria().andEqualTo("smsRecordId", smsSendRecord.getId());
|
||||||
|
recordParamMapper.deleteByExample(recordParamExam);
|
||||||
|
// 新增短信记录参数表
|
||||||
|
List<MsSmsSendRecordParam> recordParams = new ArrayList<>();
|
||||||
|
for (MsSmsTemplateParam templateParam : smsSendRecord.getTemplateParams()) {
|
||||||
|
MsSmsSendRecordParam recordParam = new MsSmsSendRecordParam();
|
||||||
|
recordParam.setSmsRecordId(smsSendRecord.getId());
|
||||||
|
recordParam.setParamValue(templateParam.getParamValue());
|
||||||
|
recordParams.add(recordParam);
|
||||||
|
}
|
||||||
|
recordParamMapper.batchInsert(recordParams);
|
||||||
|
shortMessageService.insertShortMessageHistoryRecord(oldSendRecord, recordParams);
|
||||||
|
return AjaxResult.success();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重新发送短信
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("/reSendShortMessage")
|
||||||
|
public AjaxResult reSendShortMessage(@RequestBody ReSendMessageVO reSendMessageVO) {
|
||||||
|
if (reSendMessageVO != null) {
|
||||||
|
AjaxResult result = shortMessageService.reSendShortMessage(reSendMessageVO);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return AjaxResult.error("参数缺失");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 短信回调
|
||||||
|
* @param body
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("/smsCallBack")
|
||||||
|
public AjaxResult smsCallBack(@RequestBody String body) {
|
||||||
|
if(body != null){
|
||||||
|
return shortMessageService.smsCallBack(body);
|
||||||
|
}
|
||||||
|
return AjaxResult.error("参数缺失");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
MeetingInfoMapper meetingInfoMapper;
|
||||||
|
@Autowired
|
||||||
|
SysUserMapper sysUserMapper;
|
||||||
|
@Autowired
|
||||||
|
private TokenService tokenService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询UID好的密钥
|
||||||
|
*/
|
||||||
|
// @Anonymous
|
||||||
|
// @GetMapping("/getMeetingInfo")
|
||||||
|
// public Object getEncryptInfoByUid(@RequestParam(name = "authId", required = true) String authId) {
|
||||||
|
// MeetingInfoVO result = new MeetingInfoVO();
|
||||||
|
// if (authId != null) {
|
||||||
|
// MeetingInfo meetingInfo = meetingInfoMapper.selectByPrimaryKey(authId);
|
||||||
|
// if (meetingInfo != null && meetingInfo.getUserId() != null) {
|
||||||
|
// BeanUtils.copyProperties(meetingInfo, result);
|
||||||
|
// SysUser sysUser = sysUserMapper.selectUserById(meetingInfo.getUserId());
|
||||||
|
// LoginUser loginUser = new LoginUser();
|
||||||
|
// loginUser.setUserId(sysUser.getUserId());
|
||||||
|
// loginUser.setUser(sysUser);
|
||||||
|
// String token = tokenService.createVideoToken(loginUser, 120);
|
||||||
|
//// String createToken = createToken(claims);
|
||||||
|
// result.setToken(token);
|
||||||
|
// }
|
||||||
|
// return result;
|
||||||
|
// }
|
||||||
|
// return AjaxResult.error("查询失败");
|
||||||
|
// }
|
||||||
|
}
|
||||||
+55
@@ -0,0 +1,55 @@
|
|||||||
|
package com.ruoyi.web.controller.wisdomarbitrate.sms;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.entity.sms.MsSmsTemplate;
|
||||||
|
import com.ruoyi.wisdomarbitrate.service.sms.SMSTemplateService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 短信模板控制器
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/smsTemplate")
|
||||||
|
public class SMSTemplateController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private SMSTemplateService templateService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
public TableDataInfo page( ){
|
||||||
|
startPage();
|
||||||
|
List<MsSmsTemplate> list = templateService.page();
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 新增或者修改
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/insert")
|
||||||
|
public AjaxResult insert(@RequestBody MsSmsTemplate template){
|
||||||
|
return templateService.insert(template);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/delete")
|
||||||
|
public AjaxResult delete(@RequestBody MsSmsTemplate template){
|
||||||
|
if(template.getId()==null){
|
||||||
|
return AjaxResult.warn("id不能为空");
|
||||||
|
}
|
||||||
|
return templateService.delete(template.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
MIIEuwIBADANBgkqhkiG9w0BAQEFAASCBKUwggShAgEAAoIBAQC12YM9mR+HFQYTx/fHKHZbgszVtDHDB0B/ysWl3MbcPpGtjcZlDr5aynRMRLaoduRHT++A98IaNVIVGj9RHdXrX2j9I/Uz6fYDH63cdu6FZ6Pk82yPwNZW7pebprbVHInR/7gzsKQWSWEST70BgjCRqlbfAE6xzUZFTeYxciCjptm0rUQ2MC24xRdkvZByIDIYFnQ/AdmSFqNtKDR2WpEV/M8aBjyuPPomRJZ1X8oudWuJIU4ySdas04fCbDxD10TY/wyQcDHXuG1IrQpXme4DOGQeJZ0/aOFphBkDFUyPGfYMmLshOPNdBKi2IqWHPPs4XsV4Rv6+tvTSnMF2uGqHAgMBAAECggEAPa1sifPpcZN74DGupGng2uDeQI1BY3iOM8m+h6b9+61tE4RGifgaMAkCsOuNWE4a1uURwphFyUXUdTvVxdlsuMw/e7w6akUsH5sbCO99rtmcCQdXBtrM1+dMnIpK8LUhOYyWGVIMFVMGDYPmAyD5AC7aEAC2sC+DafYl4RdoYpidq1YxeE7DVw1aQHCI2mKhYjZG+3RDDGDfNFvdyH61MgdYjoGkeXNvARzEXgfWvfiTrHZ3H1SYgvOEHofzKDTrWsQL2dvaEsc55Jiw0AgNUVcgby7al8PUekTJoK3ZvrE3pSWaUirBcqsqWISHjeR7Xx501CHIha8EnZwlnDoM4QKBgQDtnYzwQ5mHg7cRHD8Z6QdTpvBvYSEPesiUT/HeI+AKQKDCVJxKiLvJagc6zZkOzV9bZDS/WLgzXWMyxUb+OTjht0jLWAMcf7NfFp3tPKq9wkmQQ/vQSBQ1lFmO6A4Zq1eoGKeUCB4pKBG6cSM+t8+ruhm7s1ZUt+6EBwCVN/izrQKBgQDD62jIm+6NFErdidUaIrGiFUrzqdR13w6JOexfk+O6Aau3wRqsr7Wz4nqQvVVxGMRpXbOH06zpeiS+vMmjwgO973VoLAmH+hJ0GZz8qj3zA2GEOFWjD2V7tqeRvGkQvz0v46pl+8sBJkrRHLN7DWNYY5NDI+b7exwqcTc/LL19gwJ/a6r4MeZvqvgD+7zQ2uy8ZSs/xzg7wsfgG1QeRIn8+qhOL8AnEZ7jeGCS5hJDSHHGw6KkRA/vZ1bpnBfIE2naXGywj3NR9Zfnry6QYO8cbt+adcRYVghTH/QYoKiFuxvonEKPrIQBJqUBY3ngforLjwTEpEie1cSCT1Dc8sBp8QKBgQCaz8fqzRyBKknGKQXVMxj+JKknRUl3IpzP3o9jLu9BqdRQzSwQzH9d91Y2TQXY6mM5hys35xG5JCUo+vCyj7p5OWCiwjl90yMFzr93/+YXwtIpsoIo6R+d1EUxKZoz+4mT7+hT0dUlwWZZOr6wO3IHBBf3c8UvbqZg+zlWmDnblQKBgEs6jwMkb5zaG2fyBJ7PJUN/8nIz8V+X0SxQfcEqIX0J+EC+7MAgFjcdZFp+lca3Vd9z+8Ksd4rMzMa5y856ositL2NZ+K0fs8i8EBaQPny61OgCFUuXEuv5keB2YuGMSns5FYRWuByrtDXl4PxzKXvq05iKWLKCaCq9v4momvKZ
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhUnjdAKwZApwZEcfq+5L0pa77Vg3mqcoXv+th8RR0SYotkPsH1f2JkbS48ySaSCM6YNWSMNfqp5qdOla2zUJOBnJ/yaBg7s7fVD6V3M2mEog8kCDYGKt/3P4VII3xYl8lFYMQ3IcFRELkxCBBCA8JDKmf5z2R4F/Z/jFFEuOwxaJvp+7Ke9OzZHYdWGNnU6QP8YYLYUeX7VNZLHEuly34ExAw6A+yJkNDsYEho2Lu31QjT2pLh9g+88MlRfiI92iN25O9NVdeM4f5RcpvBPrBQZQs9tlFmALYSFS3prIf3FAobWM+W7iwxT6J25nFIhst1DdJQfIBpaeRUJVTkn99QIDAQAB
|
||||||
@@ -6,9 +6,10 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
# 主库数据源
|
# 主库数据源
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://localhost:3306/ruyivue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
url: jdbc:mysql://121.40.189.20:3306/test_smart_arbitration?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
|
||||||
username: ruyivue
|
# url: jdbc:mysql://121.40.189.20:3306/smart_arbitration?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
|
||||||
password: rybackproje13689
|
username: root
|
||||||
|
password: YMzc157#
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
slave:
|
slave:
|
||||||
# 从数据源开关/默认关闭
|
# 从数据源开关/默认关闭
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ ruoyi:
|
|||||||
# 实例演示开关
|
# 实例演示开关
|
||||||
demoEnabled: true
|
demoEnabled: true
|
||||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||||
profile: D:/ruoyi/uploadPath
|
profile: /home/ruoyi/uploadPath
|
||||||
# 获取ip地址开关
|
# 获取ip地址开关
|
||||||
addressEnabled: false
|
addressEnabled: false
|
||||||
# 验证码类型 math 数字计算 char 字符验证
|
# 验证码类型 math 数字计算 char 字符验证
|
||||||
@@ -17,8 +17,8 @@ ruoyi:
|
|||||||
|
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
server:
|
server:
|
||||||
# 服务器的HTTP端口,默认为8080
|
# 服务器的HTTP端口,默认为8001,正式9001
|
||||||
port: 8080
|
port: 8001
|
||||||
servlet:
|
servlet:
|
||||||
# 应用的访问路径
|
# 应用的访问路径
|
||||||
context-path: /
|
context-path: /
|
||||||
@@ -32,7 +32,6 @@ server:
|
|||||||
max: 800
|
max: 800
|
||||||
# Tomcat启动初始化的线程数,默认值10
|
# Tomcat启动初始化的线程数,默认值10
|
||||||
min-spare: 100
|
min-spare: 100
|
||||||
|
|
||||||
# 日志配置
|
# 日志配置
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
@@ -59,9 +58,9 @@ spring:
|
|||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
# 单个文件大小
|
# 单个文件大小
|
||||||
max-file-size: 10MB
|
max-file-size: 1000MB
|
||||||
# 设置总上传的文件大小
|
# 设置总上传的文件大小
|
||||||
max-request-size: 20MB
|
max-request-size: 10000MB
|
||||||
# 服务模块
|
# 服务模块
|
||||||
devtools:
|
devtools:
|
||||||
restart:
|
restart:
|
||||||
@@ -70,13 +69,13 @@ spring:
|
|||||||
# redis 配置
|
# redis 配置
|
||||||
redis:
|
redis:
|
||||||
# 地址
|
# 地址
|
||||||
host: localhost
|
host: 121.40.189.20
|
||||||
# 端口,默认为6379
|
# 端口,默认为6379
|
||||||
port: 6379
|
port: 6389
|
||||||
# 数据库索引
|
# 数据库索引,2-正式,3-测试
|
||||||
database: 0
|
database: 3
|
||||||
# 密码
|
# 密码
|
||||||
password:
|
password: YMtj126!#%
|
||||||
# 连接超时时间
|
# 连接超时时间
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
lettuce:
|
lettuce:
|
||||||
@@ -89,6 +88,31 @@ spring:
|
|||||||
max-active: 8
|
max-active: 8
|
||||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||||
max-wait: -1ms
|
max-wait: -1ms
|
||||||
|
web:
|
||||||
|
resources:
|
||||||
|
static-locations: file:/home/ruoyi/
|
||||||
|
mail:
|
||||||
|
host: smtp.163.com
|
||||||
|
port: 25
|
||||||
|
username: lmj1549843951@163.com
|
||||||
|
password: JGIOQVFCLAZKXRKO
|
||||||
|
default-encoding: UTF-8
|
||||||
|
properties:
|
||||||
|
mail:
|
||||||
|
smtp:
|
||||||
|
connectiontimeout: 5000
|
||||||
|
timeout: 5000
|
||||||
|
writetimeout: 5000
|
||||||
|
socketFactoryClass: javax.net.ssl.SSLSocketFactory
|
||||||
|
socketFactoryFallback: false
|
||||||
|
socketFactoryPort: 465
|
||||||
|
debug: false
|
||||||
|
protocol: smtp
|
||||||
|
#上上签配置参数
|
||||||
|
ssq:
|
||||||
|
developerId: 1695872832013855470
|
||||||
|
privateKey: MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCiDRuz+dxqkWqHdov0hK+KEWLw/e8MQSqkZZ4c01Yr6cSmQiWyV8Xin0u5S/EA02FWxpjLi1nLriVtOBhZGsoryFmcJrwzSnQ5PORP/HhfcAWFE/Y+3qSQS1OiU7e5wbReCgEUvx4GHZuhdu8cOvq5DG9l33YFZrIEMBTmnf8eKT54STx0tjcKl7U6B6nsiThy3zVtpWXVv6H1HGmxC0KT4EQ388s/PFjrwmk+GFb3EpKCns/GQHf7QrtNz1ZOgCXfgQiQ+91/tcngzUH+zMCIxn5lS+ENAxVI6Ev3W9Y0QHtKwmO4ORVuAskJYzBB2xKI/gw8+PUXNziMAKXuoUAjAgMBAAECggEAd7yHw6vTGUrpE76cGsgPjEzcdoSqpLth7qbG9TWSblAEZXRqtiP0q0ZYhUl/gcSuH5gOPhdw+fZq4RCZrP0GdONMkvxsAtn4lnJPoGpD5wC2k2X0hO+tWJDP8xk4n6BozTNHKTUt0gb+f4eJlapep2xwwy0h30vKLR3504zafEV9j/2D8l5TFSv6rd3UVxUvrDKQ9mhfATEUlrTpjs0SfWupMkr4j7TuJJ8qSUSiEADe4hyUB6+LouDZCt8jV4aLojQBJKrQ6VPVdDFkHGsePu4tHtvcKsaOZJ0pjpJ7MT6D5ElD/sJjo0g/3qK5/FToVFVbrxtykVreK6mE5oSTQQKBgQDpEFSgH1d4N7NsZhviaCIUkB97hO0jpRbD7UZirzZ9ok96Fk+SmfhdmypDMoiaRHCNhQuu5dI9mg5RbUhz9mCZnAhzJRL+DmE4bhNvQmbtJA7KT6n/AdH2zy0mYulrcG17dQspvTr/5421PTEE2+FRoCbG6hBsSSUit9HLvAU13QKBgQCx/7ql+hbx+t0Yb02XckBHiA+MWrFLO4dMX9cKf3LldC0nhn0K9HOSoZmM0KcmXRnMo+/4t89xOJRl7JRXwcLoy/64OaUBVv+8FFV1yY4THka3nEnQE40vVWy+vuNJtt+eKlEhJ35N1GIHXo7/4j0POtEuNU7KSqMnLUD+Oy/t/wKBgEiajcJUASuyLnLWXFlrlzJQs34HKtiv1Se0Avk7G/6HUbr2uFMzI+wFKmVEmMl2CJoNmFYjwhruowc6xBdb6TvxH7C/G+uJD0BFCkjeprG5SeI8bvjB2GbKo4YRyiVuIK0VCSU3jemqeLq9FUguN0L2YR4WTIdvQeJO4UxWhkkBAoGBAJk7TxDHZK1XirIYTzGK928c4FWxVWMwkd7buqGc6epBwwV9r3OY0U1vtGIW1W4fQ7B5iIISqpALZyT/Lw0FDqedxWAOr8+hd3IQBynpI1et/q7d6mUoD6ip332tkrjIp2TfhQwHlaGmreUuL+h0eJ/9wEoJNhTLf/yf5o11omM9AoGBAOLVlXR9FbU2Ubpp3HwTumSzKDWzq3T5eQcqC1zE3BPOo29uAf9BQTumPxe51U64egttW/nif5FH4v4Gentmxb2B2ckdOs/u9zIWz3JPfHU7RqMyMokuWrQ6lMoiSYpH3MSHoavLyAEhAnpceX3oktXgpYHO9d8MfON3XKJl23ip
|
||||||
|
serverHost: https://openapi.bestsign.info/openapi/v2/
|
||||||
|
|
||||||
# token配置
|
# token配置
|
||||||
token:
|
token:
|
||||||
@@ -97,7 +121,7 @@ token:
|
|||||||
# 令牌密钥
|
# 令牌密钥
|
||||||
secret: abcdefghijklmnopqrstuvwxyz
|
secret: abcdefghijklmnopqrstuvwxyz
|
||||||
# 令牌有效期(默认30分钟)
|
# 令牌有效期(默认30分钟)
|
||||||
expireTime: 30
|
expireTime: 1200
|
||||||
|
|
||||||
# MyBatis配置
|
# MyBatis配置
|
||||||
mybatis:
|
mybatis:
|
||||||
@@ -129,3 +153,53 @@ xss:
|
|||||||
excludes: /system/notice
|
excludes: /system/notice
|
||||||
# 匹配链接
|
# 匹配链接
|
||||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||||
|
#支付相关配置
|
||||||
|
elegent:
|
||||||
|
pay:
|
||||||
|
wxpay:
|
||||||
|
mchId: 1561414331
|
||||||
|
appId: wx6592a2db3f85ed25
|
||||||
|
appSecret: d9a9ff00a633cd7353a8925119063b01
|
||||||
|
mchSerialNo: 25FBDE3EFD31B03A4377EB9A4A47C517969E6620
|
||||||
|
apiV3Key: CZBK51236435wxpay435434323FFDuv3
|
||||||
|
alipay:
|
||||||
|
appId: 2021003141676135
|
||||||
|
callback:
|
||||||
|
domain: http://121.40.189.20:9001/
|
||||||
|
watch: true
|
||||||
|
cycle: 10
|
||||||
|
identityAuthentication:
|
||||||
|
credentialSecretId: AKID3xfHgroY4MQHvLXUXMwIQL1UjmbBX1Tv
|
||||||
|
credentialSecretKey: INDrIXcT8YmomZBcsy0oNirnU0LTN4X7
|
||||||
|
merchantId: 0NSJ2309281116194321
|
||||||
|
privateKeyHexDecodeinfo: 4c3b311bf7b98969994e85928e069574a1e95777f24d1c510679cc3c2f460faf
|
||||||
|
# 腾讯云即时通信相关配置
|
||||||
|
imConfig:
|
||||||
|
# sdkAppId
|
||||||
|
sdkAppId: 1600011167
|
||||||
|
# 密钥
|
||||||
|
sdkSecretKey: 17d136d9327576a247f991bdfed3a6d14cebc7d540a52245086829c3a1421a86
|
||||||
|
# 腾讯云账户 SecretId
|
||||||
|
secretId: AKID3xfHgroY4MQHvLXUXMwIQL1UjmbBX1Tv
|
||||||
|
# 腾讯云密钥
|
||||||
|
secretKey: INDrIXcT8YmomZBcsy0oNirnU0LTN4X7
|
||||||
|
# onlyOffice系统url配置
|
||||||
|
onlyOfficeConfig:
|
||||||
|
# url: http://172.16.0.254:9090/files/upload
|
||||||
|
url: http://121.40.189.20:9090/files/upload
|
||||||
|
# 调解机构代码配置
|
||||||
|
organizeConfig:
|
||||||
|
# creditCode
|
||||||
|
creditCode: 910000058386410044
|
||||||
|
#jodconverter:
|
||||||
|
# local:
|
||||||
|
# host: 121.40.189.20
|
||||||
|
#暂时关闭预览,启动时会有点慢
|
||||||
|
# enabled: true
|
||||||
|
#设置libreoffice主目录 linux地址如:/usr/lib64/libreoffice
|
||||||
|
# office-home: /usr/lib64/libreoffice/
|
||||||
|
# office-home: D:\app\libreOffice\
|
||||||
|
#开启多个libreoffice进程,每个端口对应一个进程
|
||||||
|
# port-numbers: 8100
|
||||||
|
#libreoffice进程重启前的最大进程数
|
||||||
|
# max-tasks-per-process: 100
|
||||||
|
|||||||
@@ -1,24 +1,2 @@
|
|||||||
Application Version: ${ruoyi.version}
|
Application Version: ${ruoyi.version}
|
||||||
Spring Boot Version: ${spring-boot.version}
|
Spring Boot Version: ${spring-boot.version}
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
// _ooOoo_ //
|
|
||||||
// o8888888o //
|
|
||||||
// 88" . "88 //
|
|
||||||
// (| ^_^ |) //
|
|
||||||
// O\ = /O //
|
|
||||||
// ____/`---'\____ //
|
|
||||||
// .' \\| |// `. //
|
|
||||||
// / \\||| : |||// \ //
|
|
||||||
// / _||||| -:- |||||- \ //
|
|
||||||
// | | \\\ - /// | | //
|
|
||||||
// | \_| ''\---/'' | | //
|
|
||||||
// \ .-\__ `-` ___/-. / //
|
|
||||||
// ___`. .' /--.--\ `. . ___ //
|
|
||||||
// ."" '< `.___\_<|>_/___.' >'"". //
|
|
||||||
// | | : `- \`.;`\ _ /`;.`/ - ` : | | //
|
|
||||||
// \ \ `-. \_ __\ /__ _/ .-` / / //
|
|
||||||
// ========`-.____`-.___\_____/___.-`____.-'======== //
|
|
||||||
// `=---=' //
|
|
||||||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
|
|
||||||
// 佛祖保佑 永不宕机 永无BUG //
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDBHGgIh80193GhdpD1LtMZfTRpcWI0fImyuBCyrd3gYb3rrsARebGcHdJsQA3mVjVqVp5ybhEZDPa4ecoK4Ye1hTppNpI/lmLt4/uUV/zhF5ahli7hi+116Ty6svHSbuMQBuUZeTFOwGrxjvofU/4pGIwh8ZvkcSnyOp9uX2177UVxDBkhgbZbJp9XF2b83vUa5eHo93CziPzn3hFdAlBCdTXB7DH+m0nN3Jou0szGukvq7cIgGpHku4ycKSTkIhhl9WRhN6OoSEJxq88MXzjkzTruc85PHN52aUTUifwg3T8Y4XqFQ61dTnEmgxeD2O6/pLdB9gLsp6yCGqN5Lqk7AgMBAAECggEBAL4X+WzUSbSjFS9NKNrCMjm4H1zgqTxjj6TnPkC1mGEltjAHwLgzJBw62wWGdGhWWpSIGccpBBm1wjTMZpAZfF66fEpP1t1Ta6UjtGZNyvfFIZmE3jdWZ/WXGBnsxtFQKKKBNwrBW0Fbdqq9BQjLxLitmlxbmwrgPttcy855j6vZqq4MBT1v8CtUT/gz4UWW2xWovVnmWOrRSScv7Nh0pMbRpPLkNHXrBwSSNz/keORzXB9JSm85wlkafa7n5/IJbdTml3A/uAgW3q3JZZQotHxQsYvD4Zb5Cnc9CPAXE5L2Yk877kVXZMGt5QPIVcPMj/72AMtaJT67Y0fN0RYHEGkCgYEA38BIGDY6pePgPbxB7N/l6Df0/OKPP0u8mqR4Q0aQD3VxeGiZUN1uWXEFKsKwlOxLfIFIFk1/6zQeC0xetNTKk0gTL8hpMUTNkE7vI9gFWws2LY6DE86Lm0bdFEIwh6d7Fr7zZtyQKPzMsesC3XV9sdSUExEi5o/VwAyf+xZlOXcCgYEA3PGZYlILjg3esPNkhDz2wxFw432i8l/BCPD8ZtqIV9eguu4fVtFYcUVfawBb0T11RamJkc4eiSOqayC+2ehgb+GyRLJNK4FqbFcsIT+CK0HlscZw51jrMR0MxTc4RzuOIMoYDeZqeGB6/YnNyG4pw2sD8bIwHm8406gtJsX/v10CgYAo8g3/aEUZQHcztPS3fU2cTkkl0ev24Ew2XGypmwsX2R0XtMSBuNPNyFHyvkgEKK2zrhDcC/ihuRraZHJcUyhzBViFgP5HBtk7VEaM36YzP/z9Hzw7bqu7kZ85atdoq6xpwC3Yn/o9le17jY8rqamD1mv2hUdGvAGYsHbCQxnpBwKBgHTkeaMUBzr7yZLS4p435tHje1dQVBJpaKaDYPZFrhbTZR0g+IGlNmaPLmFdCjbUjiPyA2+Znnwt227cHz0IfWUUAo3ny3419QkmwZlBkWuzbIO2mms7lwsf9G6uvV6qepKMeVd5TWEsokVbT/03k27pQmfwPxcK/wS0GFdIL/udAoGAOYdDqY5/aadWCyhzTGI6qXPLvC+fsJBPhK2RXyc+jYV0KmrEv4ewxlK5NksuFsNkyB7wlI1oMCa/xB3T/2vTBALgGFPi8BJqceUjtnTYtI4R2JIVEl08RtEJwyU5JZ2rvWcilsotVZYwfuLZ9KfdhkTrgNxlp/KKkr+UuKce4Vs=
|
||||||
+164
-5
@@ -11,12 +11,76 @@
|
|||||||
|
|
||||||
<artifactId>ruoyi-common</artifactId>
|
<artifactId>ruoyi-common</artifactId>
|
||||||
|
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
common通用工具
|
common通用工具
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
|
<!--docx文件下载问题-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.poi</groupId>
|
||||||
|
<artifactId>poi-ooxml</artifactId>
|
||||||
|
<version>4.1.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- POI依赖,读取.doc型文档-->
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-scratchpad -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.poi</groupId>
|
||||||
|
<artifactId>poi-scratchpad</artifactId>
|
||||||
|
<version>4.1.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-io</groupId>
|
||||||
|
<artifactId>commons-io</artifactId>
|
||||||
|
<version>2.6</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jodconverter</groupId>
|
||||||
|
<artifactId>jodconverter-core</artifactId>
|
||||||
|
<version>4.2.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jodconverter</groupId>
|
||||||
|
<artifactId>jodconverter-local</artifactId>
|
||||||
|
<version>4.2.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jodconverter</groupId>
|
||||||
|
<artifactId>jodconverter-spring-boot-starter</artifactId>
|
||||||
|
<version>4.2.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.artofsolving</groupId>
|
||||||
|
<artifactId>jodconverter</artifactId>
|
||||||
|
<version>2.2.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.openoffice</groupId>
|
||||||
|
<artifactId>jurt</artifactId>
|
||||||
|
<version>3.0.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.openoffice</groupId>
|
||||||
|
<artifactId>ridl</artifactId>
|
||||||
|
<version>3.0.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.openoffice</groupId>
|
||||||
|
<artifactId>juh</artifactId>
|
||||||
|
<version>3.0.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.openoffice</groupId>
|
||||||
|
<artifactId>unoil</artifactId>
|
||||||
|
<version>3.0.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Spring框架基本的核心工具 -->
|
<!-- Spring框架基本的核心工具 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
@@ -60,11 +124,11 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 动态数据源 -->
|
<!-- 动态数据源 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.baomidou</groupId>
|
<groupId>com.baomidou</groupId>
|
||||||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
||||||
<version>3.5.2</version>
|
<version>3.5.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 阿里JSON解析器 -->
|
<!-- 阿里JSON解析器 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -126,6 +190,101 @@
|
|||||||
<artifactId>javax.servlet-api</artifactId>
|
<artifactId>javax.servlet-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>1.18.22</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 腾讯短信sdk -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tencentcloudapi</groupId>
|
||||||
|
<artifactId>tencentcloud-sdk-java</artifactId>
|
||||||
|
<version>3.1.876</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tencentcloudapi</groupId>
|
||||||
|
<artifactId>tencentcloud-sdk-java-faceid</artifactId>
|
||||||
|
<version>3.1.875</version>
|
||||||
|
</dependency>
|
||||||
|
<!--用户信息解密-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-all</artifactId>
|
||||||
|
<version>5.7.15</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.bouncycastle</groupId>
|
||||||
|
<artifactId>bcprov-jdk15to18</artifactId>
|
||||||
|
<version>1.69</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- poi-tl-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.deepoove</groupId>
|
||||||
|
<artifactId>poi-tl</artifactId>
|
||||||
|
<version>1.9.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.documents4j</groupId>
|
||||||
|
<artifactId>documents4j-local</artifactId>
|
||||||
|
<version>1.0.3</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.documents4j</groupId>
|
||||||
|
<artifactId>documents4j-transformer-msoffice-word</artifactId>
|
||||||
|
<version>1.0.3</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.pdfbox</groupId>
|
||||||
|
<artifactId>pdfbox</artifactId>
|
||||||
|
<version>2.0.27</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.itextpdf</groupId>
|
||||||
|
<artifactId>itextpdf</artifactId>
|
||||||
|
<version>5.5.13</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.itextpdf.tool</groupId>
|
||||||
|
<artifactId>xmlworker</artifactId>
|
||||||
|
<version>5.5.13</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 发送邮件-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-mail</artifactId>
|
||||||
|
<version>3.1.4</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.activation</groupId>
|
||||||
|
<artifactId>activation</artifactId>
|
||||||
|
<version>1.1.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/javax.mail/mail -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.mail</groupId>
|
||||||
|
<artifactId>mail</artifactId>
|
||||||
|
<version>1.4.7</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpclient</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.ruoyi.common.annotation;
|
||||||
|
/**
|
||||||
|
* 一个参数、没有返回
|
||||||
|
* @author wangqiong
|
||||||
|
*/
|
||||||
|
@FunctionalInterface
|
||||||
|
public interface VoidFunction<T> {
|
||||||
|
/**
|
||||||
|
* 有一个参数
|
||||||
|
* @param param
|
||||||
|
*/
|
||||||
|
void apply(T param);
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.ruoyi.common.config;
|
||||||
|
|
||||||
|
public class EsignDemoConfig {
|
||||||
|
|
||||||
|
// 应用ID
|
||||||
|
public static final String EsignAppId = "7438987614";
|
||||||
|
// 应用密钥
|
||||||
|
public static final String EsignAppSecret = "9d7844f13830931037772b9d20cf1529";
|
||||||
|
// e签宝接口调用域名(模拟环境)
|
||||||
|
public static final String EsignHost = "https://smlopenapi.esign.cn";
|
||||||
|
// e签宝接口调用域名(正式环境)
|
||||||
|
// public static final String EsignHost = "https://openapi.esign.cn";
|
||||||
|
}
|
||||||
@@ -132,4 +132,17 @@ public class RuoYiConfig
|
|||||||
{
|
{
|
||||||
return getProfile() + "/upload";
|
return getProfile() + "/upload";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取上传路径
|
||||||
|
*/
|
||||||
|
public static String getVideoUploadPath()
|
||||||
|
{
|
||||||
|
return getProfile() + "/video";
|
||||||
|
}
|
||||||
|
public static String getHtml2PDFPath()
|
||||||
|
{
|
||||||
|
return getProfile() + "/upload/html2PDF";
|
||||||
|
}
|
||||||
|
// https://1304001529.vod-qcloud.com/b78823bbvodcq1304001529/3ce565bf3270835011486046286/f0.mp4
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,4 +41,17 @@ public class CacheConstants
|
|||||||
* 登录账户密码错误次数 redis key
|
* 登录账户密码错误次数 redis key
|
||||||
*/
|
*/
|
||||||
public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
|
public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
|
||||||
|
public static final String WE_CHAT_SMS_VERIFY_CODE_KEY="we_chat_sms_verify_code:";
|
||||||
|
/**
|
||||||
|
* 所有用户 redis key
|
||||||
|
*/
|
||||||
|
public static final String USER_KEY = "user_key:";
|
||||||
|
/**
|
||||||
|
* 用户邮箱 redis key
|
||||||
|
*/
|
||||||
|
// public static final String USER_EMAIL_KEY = "user_email_key:";
|
||||||
|
/**
|
||||||
|
* 角色 redis key
|
||||||
|
*/
|
||||||
|
public static final String ROLE_KEY = "role_key:";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.ruoyi.common.constant;
|
||||||
|
/**
|
||||||
|
* 立案申请案件状态
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class CaseApplicationConstants {
|
||||||
|
/** 申请人/代理人,立案申请 */
|
||||||
|
public static final int CASE_APPLICATION = 0;
|
||||||
|
/**
|
||||||
|
* 案件新增
|
||||||
|
*/
|
||||||
|
public static final int CASE_INSERT = -2;
|
||||||
|
/** 申请人/代理人,案件修改 */
|
||||||
|
public static final int CASE_EDIT = -1;
|
||||||
|
/** 顾问,待立案审查 */
|
||||||
|
public static final int CASE_CHECK = 1;
|
||||||
|
/** 申请人、代理人,待缴费 */
|
||||||
|
public static final int PENDING_PAYMENT = 2;
|
||||||
|
/** 财务,待缴费确认 */
|
||||||
|
public static final int PENDING_PAYMENT_CONFIRM = 3;
|
||||||
|
/** 被申,待案件质证 */
|
||||||
|
public static final int CASE_CROSSEXAMI = 4;
|
||||||
|
|
||||||
|
/** 待定,待组庭 */
|
||||||
|
public static final int PENDING_TRIAL = 26;
|
||||||
|
/** 顾问,待组庭审核 */
|
||||||
|
public static final int CONFIRMDED_PENDING_TRIAL_SUBMMIT = 5;
|
||||||
|
/** 部门长,待组庭确定 */
|
||||||
|
public static final int CONFIRMDED_PENDING_TRIAL = 6;
|
||||||
|
|
||||||
|
/** 仲裁员,待审核仲裁方式 */
|
||||||
|
public static final int CHECK_ARBITRATION_METHOD = 7;
|
||||||
|
/** 申请人,被申,顾问,仲裁员,待开庭审理 */
|
||||||
|
public static final int PENDING_OPENCOURT_HEAR = 8;
|
||||||
|
/** 申请人,被申,顾问,仲裁员,待书面审理 */
|
||||||
|
public static final int PENDING_WRIITEN_HEAR = 9;
|
||||||
|
/** 待生成裁决书 */
|
||||||
|
public static final int GENERATED_ARBITRATION = 10;
|
||||||
|
/**顾问,待秘书核验裁决书*/
|
||||||
|
public static final int VERPRIF_ARBITRATION = 11;
|
||||||
|
/**部门长,待部门长审核裁决书*/
|
||||||
|
public static final int CHECK_ARBITRATION = 12;
|
||||||
|
/**仲裁员,待裁决书签名*/
|
||||||
|
public static final int SIGN_ARBITRATION = 13;
|
||||||
|
/** 顾问,待裁决书用印 */
|
||||||
|
public static final int ARBITRATED_SEAL = 14;
|
||||||
|
/** 顾问,待裁决书送达 */
|
||||||
|
public static final int ARBITRATION_DELIVERY = 15;
|
||||||
|
/** 顾问,待案件归档*/
|
||||||
|
public static final int CASE_FILING = 16;
|
||||||
|
/** 已归档*/
|
||||||
|
public static final int CASE_ARCHIVED = 17;
|
||||||
|
|
||||||
|
/** 顾问,待修改开庭时间*/
|
||||||
|
public static final int MODIFY_HEARDATE = 31;
|
||||||
|
/**仲裁员,待仲裁员审核裁决书*/
|
||||||
|
public static final int HEAD_CHECK_ARBITRATION = 18;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -28,6 +28,14 @@ public class Constants
|
|||||||
* http请求
|
* http请求
|
||||||
*/
|
*/
|
||||||
public static final String HTTP = "http://";
|
public static final String HTTP = "http://";
|
||||||
|
/**
|
||||||
|
* br标签
|
||||||
|
*/
|
||||||
|
public static final String BR = "</br>";
|
||||||
|
/**
|
||||||
|
* pdf拼接符
|
||||||
|
*/
|
||||||
|
public static final String PDFSTR = "∰";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* https请求
|
* https请求
|
||||||
@@ -128,6 +136,8 @@ public class Constants
|
|||||||
* LDAPS 远程方法调用
|
* LDAPS 远程方法调用
|
||||||
*/
|
*/
|
||||||
public static final String LOOKUP_LDAPS = "ldaps:";
|
public static final String LOOKUP_LDAPS = "ldaps:";
|
||||||
|
public static final String DEFAULT_PASSWORD = "123456";
|
||||||
|
public static final String SPLIT_COMMA =",";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自动识别json对象白名单配置(仅允许解析的包名,范围越小越安全)
|
* 自动识别json对象白名单配置(仅允许解析的包名,范围越小越安全)
|
||||||
@@ -144,4 +154,11 @@ public class Constants
|
|||||||
*/
|
*/
|
||||||
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
|
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
|
||||||
"org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config" };
|
"org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config" };
|
||||||
|
// 中文逗号分隔符
|
||||||
|
public static final String CN_SPLIT_COMMA = ",";
|
||||||
|
/**
|
||||||
|
* 会议主键Id
|
||||||
|
*/
|
||||||
|
public static final String MEETING_KEY = "meeting_key";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,371 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
||||||
|
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations under the License.
|
||||||
|
*/
|
||||||
|
package com.ruoyi.common.constant;
|
||||||
|
import com.ruoyi.common.exception.EsignDemoException;
|
||||||
|
import org.apache.commons.codec.binary.Base64;
|
||||||
|
import org.apache.http.message.BasicNameValuePair;
|
||||||
|
|
||||||
|
import javax.crypto.Mac;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.security.InvalidKeyException;
|
||||||
|
import java.security.MessageDigest;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.text.Collator;
|
||||||
|
import java.text.MessageFormat;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 请求数据通用处理类
|
||||||
|
* @author 澄泓
|
||||||
|
* @date 2020年10月22日 下午14:25:31
|
||||||
|
* @since JDK1.7
|
||||||
|
*/
|
||||||
|
public class EsignEncryption {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 不允许外部创建实例
|
||||||
|
*/
|
||||||
|
private EsignEncryption(){}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼接待签名字符串
|
||||||
|
* @param httpMethod
|
||||||
|
* @param url
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String appendSignDataString(String httpMethod, String contentMd5,String accept,String contentType,String headers,String date, String url) throws EsignDemoException {
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
sb.append(httpMethod).append("\n").append(accept).append("\n").append(contentMd5).append("\n")
|
||||||
|
.append(contentType).append("\n");
|
||||||
|
|
||||||
|
if ("".equals(date) || date == null) {
|
||||||
|
sb.append("\n");
|
||||||
|
} else {
|
||||||
|
sb.append(date).append("\n");
|
||||||
|
}
|
||||||
|
if ("".equals(headers) || headers == null) {
|
||||||
|
sb.append(url);
|
||||||
|
} else {
|
||||||
|
sb.append(headers).append("\n").append(url);
|
||||||
|
}
|
||||||
|
return new String(sb);
|
||||||
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* Content-MD5的计算方法
|
||||||
|
* @param str 待计算的消息
|
||||||
|
* @return MD5计算后摘要值的Base64编码(ContentMD5)
|
||||||
|
* @throws EsignDemoException 加密过程中的异常信息
|
||||||
|
*/
|
||||||
|
public static String doContentMD5(String str) throws EsignDemoException {
|
||||||
|
byte[] md5Bytes = null;
|
||||||
|
MessageDigest md5 = null;
|
||||||
|
String contentMD5 = null;
|
||||||
|
try {
|
||||||
|
md5 = MessageDigest.getInstance("MD5");
|
||||||
|
// 计算md5函数
|
||||||
|
md5.update(str.getBytes("UTF-8"));
|
||||||
|
// 获取文件MD5的二进制数组(128位)
|
||||||
|
md5Bytes = md5.digest();
|
||||||
|
// 把MD5摘要后的二进制数组md5Bytes使用Base64进行编码(而不是对32位的16进制字符串进行编码)
|
||||||
|
contentMD5 = Base64.encodeBase64String(md5Bytes);
|
||||||
|
|
||||||
|
} catch (NoSuchAlgorithmException e) {
|
||||||
|
EsignDemoException ex = new EsignDemoException("不支持此算法",e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return contentMD5;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 计算请求签名值-HmacSHA256摘要
|
||||||
|
* @param message 待签名字符串
|
||||||
|
* @param secret 密钥APP KEY
|
||||||
|
* @return reqSignature HmacSHA256计算后摘要值的Base64编码
|
||||||
|
* @throws EsignDemoException 加密过程中的异常信息
|
||||||
|
*/
|
||||||
|
public static String doSignatureBase64(String message, String secret) throws EsignDemoException {
|
||||||
|
String algorithm = "HmacSHA256";
|
||||||
|
Mac hmacSha256;
|
||||||
|
String digestBase64 = null;
|
||||||
|
try {
|
||||||
|
hmacSha256 = Mac.getInstance(algorithm);
|
||||||
|
byte[] keyBytes = secret.getBytes("UTF-8");
|
||||||
|
byte[] messageBytes = message.getBytes("UTF-8");
|
||||||
|
hmacSha256.init(new SecretKeySpec(keyBytes, 0, keyBytes.length, algorithm));
|
||||||
|
// 使用HmacSHA256对二进制数据消息Bytes计算摘要
|
||||||
|
byte[] digestBytes = hmacSha256.doFinal(messageBytes);
|
||||||
|
// 把摘要后的结果digestBytes使用Base64进行编码
|
||||||
|
digestBase64 = Base64.encodeBase64String(digestBytes);
|
||||||
|
} catch (NoSuchAlgorithmException e) {
|
||||||
|
EsignDemoException ex = new EsignDemoException("不支持此算法",e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
} catch (InvalidKeyException e) {
|
||||||
|
EsignDemoException ex = new EsignDemoException("无效的密钥规范",e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return digestBase64;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取时间戳
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String timeStamp() {
|
||||||
|
long timeStamp = System.currentTimeMillis();
|
||||||
|
return String.valueOf(timeStamp);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* byte字节数组转换成字符串
|
||||||
|
* @param b
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String byteArrayToHexString(byte[] b) {
|
||||||
|
StringBuilder hs = new StringBuilder();
|
||||||
|
String stmp;
|
||||||
|
for (int n = 0; b != null && n < b.length; n++) {
|
||||||
|
stmp = Integer.toHexString(b[n] & 0XFF);
|
||||||
|
if (stmp.length() == 1)
|
||||||
|
hs.append('0');
|
||||||
|
hs.append(stmp);
|
||||||
|
}
|
||||||
|
return hs.toString().toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hash散列加密算法
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String Hmac_SHA256(String message,String key) throws EsignDemoException {
|
||||||
|
byte[] rawHmac=null;
|
||||||
|
try {
|
||||||
|
SecretKeySpec sk = new SecretKeySpec(key.getBytes(), "HmacSHA256");
|
||||||
|
Mac mac = Mac.getInstance("HmacSHA256");
|
||||||
|
mac.init(sk);
|
||||||
|
rawHmac = mac.doFinal(message.getBytes());
|
||||||
|
}catch (InvalidKeyException e){
|
||||||
|
EsignDemoException ex = new EsignDemoException("无效的密钥规范",e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
} catch (NoSuchAlgorithmException e) {
|
||||||
|
EsignDemoException ex = new EsignDemoException("不支持此算法",e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
}catch (Exception e){
|
||||||
|
EsignDemoException ex = new EsignDemoException("hash散列加密算法报错",e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
}finally {
|
||||||
|
return byteArrayToHexString(rawHmac);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MD5加密32位
|
||||||
|
*/
|
||||||
|
public static String MD5Digest(String text) throws EsignDemoException {
|
||||||
|
byte[] digest=null;
|
||||||
|
try {
|
||||||
|
MessageDigest md5 = MessageDigest.getInstance("MD5");
|
||||||
|
md5.update(text.getBytes());
|
||||||
|
digest = md5.digest();
|
||||||
|
}catch (NoSuchAlgorithmException e){
|
||||||
|
EsignDemoException ex = new EsignDemoException("不支持此算法",e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
}finally {
|
||||||
|
return byteArrayToHexString(digest);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void formDataSort(List<BasicNameValuePair> param) {
|
||||||
|
Collections.sort(param, new Comparator<BasicNameValuePair>() {
|
||||||
|
@Override
|
||||||
|
public int compare(BasicNameValuePair o1, BasicNameValuePair o2) {
|
||||||
|
Comparator<Object> com = Collator.getInstance(Locale.CHINA);
|
||||||
|
return com.compare(o1.getName(), o2.getName());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 字符串是否为空(含空格校验)
|
||||||
|
* @param str
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean isBlank(String str) {
|
||||||
|
if (null == str || 0 == str.length()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int strLen = str.length();
|
||||||
|
|
||||||
|
for (int i = 0; i < strLen; i++) {
|
||||||
|
if (!Character.isWhitespace(str.charAt(i))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 对请求URL中的Query参数按照字段名的 ASCII 码从小到大排序(字典排序)
|
||||||
|
*
|
||||||
|
* @param apiUrl
|
||||||
|
* @return 排序后的API接口地址
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static String sortApiUrl(String apiUrl) throws EsignDemoException {
|
||||||
|
|
||||||
|
if (!apiUrl.contains("?")) {
|
||||||
|
return apiUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
int queryIndex = apiUrl.indexOf("?");
|
||||||
|
String apiUrlPath =apiUrl.substring(0,queryIndex+1);
|
||||||
|
String apiUrlQuery = apiUrl.substring(queryIndex+1);
|
||||||
|
//apiUrlQuery为空时返回
|
||||||
|
if(isBlank(apiUrlQuery)){
|
||||||
|
return apiUrl.substring(0,apiUrl.length()-1);
|
||||||
|
}
|
||||||
|
// 请求URL中Query参数转成Map
|
||||||
|
Map<Object, Object> queryParamsMap = new HashMap<Object, Object>();
|
||||||
|
String[] params = apiUrlQuery.split("&");
|
||||||
|
for (String str : params) {
|
||||||
|
int index = str.indexOf("=");
|
||||||
|
String key = str.substring(0, index);
|
||||||
|
String value = str.substring(index + 1);
|
||||||
|
if (queryParamsMap.containsKey(key)) {
|
||||||
|
String msg = MessageFormat.format("请求URL中的Query参数的{0}重复", key);
|
||||||
|
throw new EsignDemoException(msg);
|
||||||
|
}
|
||||||
|
queryParamsMap.put(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
ArrayList<String> queryMapKeys = new ArrayList<String>();
|
||||||
|
for (Map.Entry<Object, Object> entry : queryParamsMap.entrySet()) {
|
||||||
|
queryMapKeys.add((String) entry.getKey());
|
||||||
|
}
|
||||||
|
// 按照字段名的 ASCII 码从小到大排序(字典排序)
|
||||||
|
Collections.sort(queryMapKeys, new Comparator<String>() {
|
||||||
|
@Override
|
||||||
|
public int compare(String o1, String o2) {
|
||||||
|
return (o1.compareToIgnoreCase(o2) == 0 ? -o1.compareTo(o2) : o1.compareToIgnoreCase(o2));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
StringBuffer queryString = new StringBuffer();
|
||||||
|
// 构造Query参数键值对值对的格式
|
||||||
|
for (int i = 0; i < queryMapKeys.size(); i++) {
|
||||||
|
String key = queryMapKeys.get(i);
|
||||||
|
String value = (String) queryParamsMap.get(key);
|
||||||
|
queryString.append(key);
|
||||||
|
queryString.append("=");
|
||||||
|
queryString.append(value);
|
||||||
|
queryString.append("&");
|
||||||
|
}
|
||||||
|
if (queryString.length() > 0) {
|
||||||
|
queryString = queryString.deleteCharAt(queryString.length() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Query参数排序后的接口请求地址
|
||||||
|
StringBuffer sortApiUrl = new StringBuffer();
|
||||||
|
sortApiUrl.append(apiUrlPath);
|
||||||
|
sortApiUrl.append(queryString.toString());
|
||||||
|
return sortApiUrl.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*获取query
|
||||||
|
* @param apiUrl
|
||||||
|
* @return
|
||||||
|
* @throws EsignDemoException
|
||||||
|
*/
|
||||||
|
public static ArrayList<BasicNameValuePair> getQuery(String apiUrl) throws EsignDemoException {
|
||||||
|
ArrayList<BasicNameValuePair> BasicNameValuePairList = new ArrayList<>();
|
||||||
|
|
||||||
|
if (!apiUrl.contains("?")) {
|
||||||
|
return BasicNameValuePairList;
|
||||||
|
}
|
||||||
|
|
||||||
|
int queryIndex = apiUrl.indexOf("\\?");
|
||||||
|
String apiUrlQuery = apiUrl.substring(queryIndex,apiUrl.length());
|
||||||
|
|
||||||
|
// 请求URL中Query参数转成Map
|
||||||
|
Map<Object, Object> queryParamsMap = new HashMap<Object, Object>();
|
||||||
|
String[] params = apiUrlQuery.split("&");
|
||||||
|
for (String str : params) {
|
||||||
|
int index = str.indexOf("=");
|
||||||
|
String key = str.substring(0, index);
|
||||||
|
String value = str.substring(index + 1);
|
||||||
|
if (queryParamsMap.containsKey(key)) {
|
||||||
|
String msg = MessageFormat.format("请求URL中的Query参数的{0}重复", key);
|
||||||
|
throw new EsignDemoException(msg);
|
||||||
|
}
|
||||||
|
BasicNameValuePairList.add(new BasicNameValuePair(key,value));
|
||||||
|
queryParamsMap.put(key, value);
|
||||||
|
}
|
||||||
|
return BasicNameValuePairList;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public static boolean callBackCheck(String timestamp,String requestQuery,String body,String key,String signature){
|
||||||
|
String algorithm="HmacSHA256";
|
||||||
|
String encoding="UTF-8";
|
||||||
|
Mac mac = null;
|
||||||
|
try {
|
||||||
|
String data = timestamp + requestQuery + body;
|
||||||
|
mac = Mac.getInstance(algorithm);
|
||||||
|
SecretKeySpec secretKey = new SecretKeySpec(key.getBytes(encoding), algorithm);
|
||||||
|
mac.init(secretKey);
|
||||||
|
mac.update(data.getBytes(encoding));
|
||||||
|
} catch (NoSuchAlgorithmException | InvalidKeyException | UnsupportedEncodingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
System.out.println("获取Signature签名信息异常:" + e.getMessage());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return byte2hex(mac.doFinal()).equalsIgnoreCase(signature);
|
||||||
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 将byte[]转成16进制字符串
|
||||||
|
*
|
||||||
|
* @param data
|
||||||
|
*
|
||||||
|
* @return 16进制字符串
|
||||||
|
*/
|
||||||
|
public static String byte2hex(byte[] data) {
|
||||||
|
StringBuilder hash = new StringBuilder();
|
||||||
|
String stmp;
|
||||||
|
for (int n = 0; data != null && n < data.length; n++) {
|
||||||
|
stmp = Integer.toHexString(data[n] & 0XFF);
|
||||||
|
if (stmp.length() == 1)
|
||||||
|
hash.append('0');
|
||||||
|
hash.append(stmp);
|
||||||
|
}
|
||||||
|
return hash.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.ruoyi.common.constant;
|
||||||
|
/**
|
||||||
|
* @description 头部信息常量
|
||||||
|
* @author 澄泓
|
||||||
|
* @date 2020/10/22 15:05
|
||||||
|
* @version JDK1.7
|
||||||
|
*/
|
||||||
|
public enum EsignHeaderConstant {
|
||||||
|
ACCEPT("*/*"),
|
||||||
|
DATE(""),
|
||||||
|
HEADERS( ""),
|
||||||
|
CONTENTTYPE_FORMDATA("application/x-www-form-urlencoded"),
|
||||||
|
CONTENTTYPE_JSON("application/json; charset=UTF-8"),
|
||||||
|
CONTENTTYPE_PDF("application/pdf"),
|
||||||
|
CONTENTTYPE_STREAM("application/octet-stream"),
|
||||||
|
AUTHMODE("Signature");
|
||||||
|
|
||||||
|
private String value;
|
||||||
|
private EsignHeaderConstant(String value) {
|
||||||
|
this.value=value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String VALUE(){
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,486 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
||||||
|
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations under the License.
|
||||||
|
*/
|
||||||
|
package com.ruoyi.common.constant;
|
||||||
|
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
||||||
|
import com.ruoyi.common.enums.EsignRequestType;
|
||||||
|
import com.ruoyi.common.exception.EsignDemoException;
|
||||||
|
import org.apache.http.*;
|
||||||
|
import org.apache.http.auth.AuthScope;
|
||||||
|
import org.apache.http.auth.UsernamePasswordCredentials;
|
||||||
|
import org.apache.http.client.ClientProtocolException;
|
||||||
|
import org.apache.http.client.CredentialsProvider;
|
||||||
|
import org.apache.http.client.HttpRequestRetryHandler;
|
||||||
|
import org.apache.http.client.config.RequestConfig;
|
||||||
|
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||||
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||||
|
import org.apache.http.client.methods.HttpRequestBase;
|
||||||
|
import org.apache.http.client.protocol.HttpClientContext;
|
||||||
|
import org.apache.http.client.utils.URIBuilder;
|
||||||
|
import org.apache.http.config.Registry;
|
||||||
|
import org.apache.http.config.RegistryBuilder;
|
||||||
|
import org.apache.http.conn.ConnectTimeoutException;
|
||||||
|
import org.apache.http.conn.socket.ConnectionSocketFactory;
|
||||||
|
import org.apache.http.conn.socket.LayeredConnectionSocketFactory;
|
||||||
|
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
|
||||||
|
import org.apache.http.conn.ssl.NoopHostnameVerifier;
|
||||||
|
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
|
||||||
|
import org.apache.http.entity.ByteArrayEntity;
|
||||||
|
import org.apache.http.entity.ContentType;
|
||||||
|
import org.apache.http.entity.StringEntity;
|
||||||
|
import org.apache.http.impl.client.BasicCredentialsProvider;
|
||||||
|
import org.apache.http.impl.client.CloseableHttpClient;
|
||||||
|
import org.apache.http.impl.client.HttpClientBuilder;
|
||||||
|
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
|
||||||
|
import org.apache.http.message.BasicNameValuePair;
|
||||||
|
import org.apache.http.protocol.HttpContext;
|
||||||
|
import org.apache.http.util.EntityUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.net.ssl.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InterruptedIOException;
|
||||||
|
import java.net.UnknownHostException;
|
||||||
|
import java.security.cert.CertificateException;
|
||||||
|
import java.security.cert.X509Certificate;
|
||||||
|
import java.text.MessageFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description Http请求 辅助类
|
||||||
|
* @author 澄泓
|
||||||
|
* @since JDK1.7
|
||||||
|
*/
|
||||||
|
public class EsignHttpCfgHelper {
|
||||||
|
|
||||||
|
private static Logger LOGGER = LoggerFactory.getLogger(EsignHttpCfgHelper.class);
|
||||||
|
/**
|
||||||
|
* 超时时间,默认15000毫秒
|
||||||
|
*/
|
||||||
|
private static int MAX_TIMEOUT = 15000;
|
||||||
|
/**
|
||||||
|
* 请求池最大连接数,默认100个
|
||||||
|
*/
|
||||||
|
private static int MAX_TOTAL=100;
|
||||||
|
/**
|
||||||
|
* 单域名最大的连接数,默认50个
|
||||||
|
*/
|
||||||
|
private static int ROUTE_MAX_TOTAL=50;
|
||||||
|
/**
|
||||||
|
* 请求失败重试次数,默认3次
|
||||||
|
*/
|
||||||
|
private static int MAX_RETRY = 3;
|
||||||
|
/**
|
||||||
|
* 是否需要域名校验,默认不需要校验
|
||||||
|
*/
|
||||||
|
private static boolean SSL_VERIFY=false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 正向代理IP
|
||||||
|
*/
|
||||||
|
private static String PROXY_IP;
|
||||||
|
/**
|
||||||
|
* 正向代理端口,默认8888
|
||||||
|
*/
|
||||||
|
private static int PROXY_PORT=8888;
|
||||||
|
/**
|
||||||
|
* 代理协议,默认http
|
||||||
|
*/
|
||||||
|
private static String PROXY_AGREEMENT="http";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否开启代理,默认false
|
||||||
|
*/
|
||||||
|
private static boolean OPEN_PROXY=false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理服务器用户名
|
||||||
|
*/
|
||||||
|
private static String PROXY_USERNAME="";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理服务器密码
|
||||||
|
*/
|
||||||
|
private static String PROXY_PASSWORD="";
|
||||||
|
|
||||||
|
|
||||||
|
private static PoolingHttpClientConnectionManager connMgr; //连接池
|
||||||
|
private static HttpRequestRetryHandler retryHandler; //重试机制
|
||||||
|
|
||||||
|
private static CloseableHttpClient httpClient=null;
|
||||||
|
|
||||||
|
public static int getMaxTimeout() {
|
||||||
|
return MAX_TIMEOUT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setMaxTimeout(int maxTimeout) {
|
||||||
|
MAX_TIMEOUT = maxTimeout;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getMaxTotal() {
|
||||||
|
return MAX_TOTAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setMaxTotal(int maxTotal) {
|
||||||
|
MAX_TOTAL = maxTotal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getRouteMaxTotal() {
|
||||||
|
return ROUTE_MAX_TOTAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setRouteMaxTotal(int routeMaxTotal) {
|
||||||
|
ROUTE_MAX_TOTAL = routeMaxTotal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getMaxRetry() {
|
||||||
|
return MAX_RETRY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setMaxRetry(int maxRetry) {
|
||||||
|
MAX_RETRY = maxRetry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isSslVerify() {
|
||||||
|
return SSL_VERIFY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setSslVerify(boolean sslVerify) {
|
||||||
|
SSL_VERIFY = sslVerify;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getProxyIp() {
|
||||||
|
return PROXY_IP;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setProxyIp(String proxyIp) {
|
||||||
|
PROXY_IP = proxyIp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getProxyPort() {
|
||||||
|
return PROXY_PORT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setProxyPort(int proxyPort) {
|
||||||
|
PROXY_PORT = proxyPort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getProxyAgreement() {
|
||||||
|
return PROXY_AGREEMENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setProxyAgreement(String proxyAgreement) {
|
||||||
|
PROXY_AGREEMENT = proxyAgreement;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean getOpenProxy() {
|
||||||
|
return OPEN_PROXY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setOpenProxy(boolean openProxy) {
|
||||||
|
OPEN_PROXY = openProxy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getProxyUsername() {
|
||||||
|
return PROXY_USERNAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setProxyUserame(String proxyUsername) {
|
||||||
|
PROXY_USERNAME = proxyUsername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getProxyPassword() {
|
||||||
|
return PROXY_PASSWORD;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setProxyPassword(String proxyPassword) {
|
||||||
|
PROXY_PASSWORD = proxyPassword;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 不允许外部创建实例
|
||||||
|
*/
|
||||||
|
private EsignHttpCfgHelper() {
|
||||||
|
}
|
||||||
|
|
||||||
|
//------------------------------公有方法start--------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 发起HTTP / HTTPS 请求
|
||||||
|
*
|
||||||
|
* @param reqType
|
||||||
|
* {@link EsignRequestType} 请求类型 GET、 POST 、 DELETE 、 PUT
|
||||||
|
* @param httpUrl
|
||||||
|
* {@link String} 请求目标地址
|
||||||
|
* @param headers
|
||||||
|
* {@link Map} 请求头
|
||||||
|
* @param param
|
||||||
|
* {@link Object} 参数
|
||||||
|
* @return
|
||||||
|
* @throws EsignDemoException
|
||||||
|
* @author 澄泓
|
||||||
|
*/
|
||||||
|
public static EsignHttpResponse sendHttp(EsignRequestType reqType, String httpUrl, Map<String, String> headers, Object param, boolean debug)
|
||||||
|
throws EsignDemoException {
|
||||||
|
HttpRequestBase reqBase=null;
|
||||||
|
if(httpUrl.startsWith("http")){
|
||||||
|
reqBase=reqType.getHttpType(httpUrl);
|
||||||
|
}else{
|
||||||
|
throw new EsignDemoException("请求url地址格式错误");
|
||||||
|
}
|
||||||
|
if(debug){
|
||||||
|
LOGGER.info("请求头:{}",headers+"\n");
|
||||||
|
LOGGER.info("请求参数\n{}", param+"\n");
|
||||||
|
LOGGER.info("请求地址\n:{}\n请求方式\n:{}",reqBase.getURI(),reqType+"\n");
|
||||||
|
}
|
||||||
|
//请求方法不是GET或者DELETE时传入body体,否则不传入。
|
||||||
|
String[] methods = {"DELETE", "GET"};
|
||||||
|
if(param instanceof String&&Arrays.binarySearch(methods, reqType.name())<0){//POST或者PUT请求
|
||||||
|
((HttpEntityEnclosingRequest) reqBase).setEntity(
|
||||||
|
new StringEntity(String.valueOf(param), ContentType.create("application/json", "UTF-8")));
|
||||||
|
}
|
||||||
|
//参数时字节流数组
|
||||||
|
else if(param instanceof byte[]) {
|
||||||
|
reqBase=reqType.getHttpType(httpUrl);
|
||||||
|
byte[] paramBytes = (byte[])param;
|
||||||
|
((HttpEntityEnclosingRequest) reqBase).setEntity(new ByteArrayEntity(paramBytes));
|
||||||
|
}
|
||||||
|
//参数是form表单时
|
||||||
|
else if(param instanceof List){
|
||||||
|
((HttpEntityEnclosingRequest) reqBase).setEntity(new UrlEncodedFormEntity((Iterable<? extends NameValuePair>) param));
|
||||||
|
}
|
||||||
|
httpClient = getHttpClient();
|
||||||
|
config(reqBase);
|
||||||
|
|
||||||
|
//设置请求头
|
||||||
|
if(headers != null &&headers.size()>0) {
|
||||||
|
for(Map.Entry<String, String> entry :headers.entrySet()) {
|
||||||
|
reqBase.setHeader(entry.getKey(), entry.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//响应对象
|
||||||
|
CloseableHttpResponse res = null;
|
||||||
|
//响应内容
|
||||||
|
String resCtx = null;
|
||||||
|
int status;
|
||||||
|
EsignHttpResponse esignHttpResponse = new EsignHttpResponse();
|
||||||
|
try {
|
||||||
|
//执行请求
|
||||||
|
res = httpClient.execute(reqBase);
|
||||||
|
status=res.getStatusLine().getStatusCode();
|
||||||
|
|
||||||
|
//获取请求响应对象和响应entity
|
||||||
|
HttpEntity httpEntity = res.getEntity();
|
||||||
|
if(httpEntity != null) {
|
||||||
|
resCtx = EntityUtils.toString(httpEntity,"utf-8");
|
||||||
|
}
|
||||||
|
if(debug) {
|
||||||
|
LOGGER.info("响应\n{}", resCtx + "\n");
|
||||||
|
LOGGER.info("----------------------------end------------------------");
|
||||||
|
}
|
||||||
|
} catch (NoHttpResponseException e) {
|
||||||
|
throw new EsignDemoException("服务器丢失了",e);
|
||||||
|
} catch (SSLHandshakeException e){
|
||||||
|
String msg = MessageFormat.format("SSL握手异常", e);
|
||||||
|
EsignDemoException ex = new EsignDemoException(msg, e);
|
||||||
|
throw ex;
|
||||||
|
} catch (UnknownHostException e){
|
||||||
|
EsignDemoException ex = new EsignDemoException("服务器找不到", e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
} catch(ConnectTimeoutException e){
|
||||||
|
EsignDemoException ex = new EsignDemoException("连接超时", e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
} catch(SSLException e){
|
||||||
|
EsignDemoException ex = new EsignDemoException("SSL异常",e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
} catch (ClientProtocolException e) {
|
||||||
|
EsignDemoException ex = new EsignDemoException("请求头异常",e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
} catch (IOException e) {
|
||||||
|
EsignDemoException ex = new EsignDemoException("网络请求失败",e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
} finally {
|
||||||
|
if(res != null) {
|
||||||
|
try {
|
||||||
|
res.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
EsignDemoException ex = new EsignDemoException("--->>关闭请求响应失败",e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
esignHttpResponse.setStatus(status);
|
||||||
|
esignHttpResponse.setBody(resCtx);
|
||||||
|
return esignHttpResponse;
|
||||||
|
}
|
||||||
|
//------------------------------公有方法end----------------------------------------------
|
||||||
|
|
||||||
|
//------------------------------私有方法start--------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 请求头和超时时间配置
|
||||||
|
*
|
||||||
|
* @param httpReqBase
|
||||||
|
* @author 澄泓
|
||||||
|
*/
|
||||||
|
private static void config(HttpRequestBase httpReqBase) {
|
||||||
|
// 配置请求的超时设置
|
||||||
|
RequestConfig.Builder builder = RequestConfig.custom()
|
||||||
|
.setConnectionRequestTimeout(MAX_TIMEOUT)
|
||||||
|
.setConnectTimeout(MAX_TIMEOUT)
|
||||||
|
.setSocketTimeout(MAX_TIMEOUT);
|
||||||
|
if(OPEN_PROXY){
|
||||||
|
HttpHost proxy=new HttpHost(PROXY_IP,PROXY_PORT,PROXY_AGREEMENT);
|
||||||
|
builder.setProxy(proxy);
|
||||||
|
}
|
||||||
|
RequestConfig requestConfig = builder.build();
|
||||||
|
httpReqBase.setConfig(requestConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 连接池配置
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* @author 澄泓
|
||||||
|
*/
|
||||||
|
private static void cfgPoolMgr() throws EsignDemoException {
|
||||||
|
ConnectionSocketFactory plainsf = PlainConnectionSocketFactory.getSocketFactory();
|
||||||
|
LayeredConnectionSocketFactory sslsf = SSLConnectionSocketFactory.getSocketFactory();
|
||||||
|
if(!SSL_VERIFY){
|
||||||
|
sslsf=sslConnectionSocketFactory();
|
||||||
|
}
|
||||||
|
|
||||||
|
Registry<ConnectionSocketFactory> registry = RegistryBuilder.<ConnectionSocketFactory>create()
|
||||||
|
.register("http", plainsf)
|
||||||
|
.register("https", sslsf)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
//连接池管理器
|
||||||
|
connMgr = new PoolingHttpClientConnectionManager(registry);
|
||||||
|
//请求池最大连接数
|
||||||
|
connMgr.setMaxTotal(MAX_TOTAL);
|
||||||
|
//但域名最大的连接数
|
||||||
|
connMgr.setDefaultMaxPerRoute(ROUTE_MAX_TOTAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 设置重试机制
|
||||||
|
*
|
||||||
|
* @author 澄泓
|
||||||
|
*/
|
||||||
|
private static void cfgRetryHandler() {
|
||||||
|
retryHandler = new HttpRequestRetryHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean retryRequest(IOException e, int excCount, HttpContext ctx) {
|
||||||
|
//超过最大重试次数,就放弃
|
||||||
|
if(excCount > MAX_RETRY) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
//服务器丢掉了链接,就重试
|
||||||
|
if(e instanceof NoHttpResponseException) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
//不重试SSL握手异常
|
||||||
|
if(e instanceof SSLHandshakeException) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
//中断
|
||||||
|
if(e instanceof InterruptedIOException) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
//目标服务器不可达
|
||||||
|
if(e instanceof UnknownHostException) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
//连接超时
|
||||||
|
//SSL异常
|
||||||
|
if(e instanceof SSLException) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
HttpClientContext clientCtx = HttpClientContext.adapt(ctx);
|
||||||
|
HttpRequest req = clientCtx.getRequest();
|
||||||
|
//如果是幂等请求,就再次尝试
|
||||||
|
if(!(req instanceof HttpEntityEnclosingRequest)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 忽略域名校验
|
||||||
|
*/
|
||||||
|
private static SSLConnectionSocketFactory sslConnectionSocketFactory() throws EsignDemoException {
|
||||||
|
try {
|
||||||
|
SSLContext ctx = SSLContext.getInstance("TLS"); // 创建一个上下文(此处指定的协议类型似乎不是重点)
|
||||||
|
X509TrustManager tm = new X509TrustManager() { // 创建一个跳过SSL证书的策略
|
||||||
|
public X509Certificate[] getAcceptedIssuers() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void checkClientTrusted(X509Certificate[] arg0, String arg1) throws CertificateException {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void checkServerTrusted(X509Certificate[] arg0, String arg1) throws CertificateException {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
ctx.init(null, new TrustManager[] { tm }, null); // 使用上面的策略初始化上下文
|
||||||
|
return new SSLConnectionSocketFactory(ctx, new String[] { "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2" }, null, NoopHostnameVerifier.INSTANCE);
|
||||||
|
}catch (Exception e){
|
||||||
|
EsignDemoException ex = new EsignDemoException("忽略域名校验失败",e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 获取单例HttpClient
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* @author 澄泓
|
||||||
|
*/
|
||||||
|
private static synchronized CloseableHttpClient getHttpClient() throws EsignDemoException {
|
||||||
|
if(httpClient==null) {
|
||||||
|
CredentialsProvider credsProvider = new BasicCredentialsProvider();
|
||||||
|
credsProvider.setCredentials(new AuthScope(PROXY_IP,PROXY_PORT),new UsernamePasswordCredentials(PROXY_USERNAME, PROXY_PASSWORD));
|
||||||
|
cfgPoolMgr();
|
||||||
|
cfgRetryHandler();
|
||||||
|
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
|
||||||
|
httpClient = httpClientBuilder.setDefaultCredentialsProvider(credsProvider).setConnectionManager(connMgr).setRetryHandler(retryHandler).build();
|
||||||
|
}
|
||||||
|
return httpClient;
|
||||||
|
|
||||||
|
}
|
||||||
|
//------------------------------私有方法end----------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,286 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
||||||
|
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||||
|
* specific language governing permissions and limitations under the License.
|
||||||
|
*/
|
||||||
|
package com.ruoyi.common.constant;
|
||||||
|
|
||||||
|
import com.ruoyi.common.exception.EsignDemoException;
|
||||||
|
import org.apache.commons.codec.binary.Base64;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.security.MessageDigest;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 澄泓
|
||||||
|
* @version JDK1.7
|
||||||
|
* @description 文件转换类
|
||||||
|
* @date 2020/10/26 10:47
|
||||||
|
*/
|
||||||
|
public class FileTransformation {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 传入本地文件路径转二进制byte
|
||||||
|
*
|
||||||
|
* @param srcFilePath 本地文件路径
|
||||||
|
* @return
|
||||||
|
* @throws EsignDemoException
|
||||||
|
*/
|
||||||
|
public static byte[] fileToBytes(String srcFilePath) throws EsignDemoException {
|
||||||
|
return getBytes(srcFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片转base64
|
||||||
|
*
|
||||||
|
* @param filePath 本地文件路径
|
||||||
|
* @return
|
||||||
|
* @throws EsignDemoException
|
||||||
|
*/
|
||||||
|
public static String fileToBase64(String filePath) throws EsignDemoException {
|
||||||
|
byte[] bytes;
|
||||||
|
String base64 = null;
|
||||||
|
bytes = fileToBytes(filePath);
|
||||||
|
base64 = Base64.encodeBase64String(bytes);
|
||||||
|
base64 = base64.replaceAll("\r\n", "");
|
||||||
|
return base64;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) throws EsignDemoException {
|
||||||
|
System.out.println(getFileContentMD5("D:\\文档\\PLT2022-02124CT.pdf"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 计算文件内容的Content-MD5
|
||||||
|
* @param filePath 文件路径
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getFileContentMD5(String filePath) throws EsignDemoException {
|
||||||
|
// 获取文件MD5的二进制数组(128位)
|
||||||
|
byte[] bytes = getFileMD5Bytes128(filePath);
|
||||||
|
// 对文件MD5的二进制数组进行base64编码
|
||||||
|
return new String(Base64.encodeBase64String(bytes));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载文件
|
||||||
|
*
|
||||||
|
* @param httpUrl 网络文件地址url
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean downLoadFileByUrl(String httpUrl, String dir) throws EsignDemoException {
|
||||||
|
boolean downLoadFileFlag = false;
|
||||||
|
InputStream fis = null;
|
||||||
|
FileOutputStream fileOutputStream = null;
|
||||||
|
try {
|
||||||
|
URL url = new URL(httpUrl);
|
||||||
|
HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
|
||||||
|
httpConn.connect();
|
||||||
|
fis = httpConn.getInputStream();
|
||||||
|
fileOutputStream = new FileOutputStream(new File(dir));
|
||||||
|
byte[] md5Bytes = null;
|
||||||
|
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
int length = -1;
|
||||||
|
while ((length = fis.read(buffer, 0, 1024)) != -1) {
|
||||||
|
fileOutputStream.write(buffer, 0, length);
|
||||||
|
}
|
||||||
|
downLoadFileFlag = true;
|
||||||
|
} catch (IOException e) {
|
||||||
|
EsignDemoException ex = new EsignDemoException("获取文件流异常", e);
|
||||||
|
ex.initCause(e);
|
||||||
|
return downLoadFileFlag;
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if (fis != null) {
|
||||||
|
fis.close();
|
||||||
|
}
|
||||||
|
if (fileOutputStream != null) {
|
||||||
|
fileOutputStream.close();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
EsignDemoException ex = new EsignDemoException("关闭文件流异常", e);
|
||||||
|
ex.initCause(e);
|
||||||
|
return downLoadFileFlag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return downLoadFileFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网络文件转二进制MD5数组并获取文件大小
|
||||||
|
*
|
||||||
|
* @param fileUrl 网络文件地址url
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static Map fileUrlToBytes(String fileUrl) throws EsignDemoException {
|
||||||
|
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||||
|
try {
|
||||||
|
URL url = new URL(fileUrl);
|
||||||
|
HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
|
||||||
|
httpConn.connect();
|
||||||
|
InputStream fis = httpConn.getInputStream();
|
||||||
|
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
|
||||||
|
outStream.close();
|
||||||
|
map.put("fileSize", fis.available());
|
||||||
|
byte[] md5Bytes = null;
|
||||||
|
MessageDigest md5 = MessageDigest.getInstance("MD5");
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
int length = -1;
|
||||||
|
while ((length = fis.read(buffer, 0, 1024)) != -1) {
|
||||||
|
md5.update(buffer, 0, length);
|
||||||
|
outStream.write(buffer, 0, length);
|
||||||
|
}
|
||||||
|
md5Bytes = md5.digest();
|
||||||
|
byte[] fileData = outStream.toByteArray();
|
||||||
|
map.put("fileData", fileData);
|
||||||
|
outStream.close();
|
||||||
|
fis.close();
|
||||||
|
map.put("md5Bytes", md5Bytes);
|
||||||
|
} catch (IOException e) {
|
||||||
|
EsignDemoException ex = new EsignDemoException("获取文件流异常", e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
} catch (NoSuchAlgorithmException e) {
|
||||||
|
EsignDemoException ex = new EsignDemoException("文件计算异常", e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 获取文件MD5的二进制数组(128位)
|
||||||
|
* @param filePath
|
||||||
|
* @return
|
||||||
|
* @throws EsignDemoException
|
||||||
|
*/
|
||||||
|
public static byte[] getFileMD5Bytes128(String filePath) throws EsignDemoException {
|
||||||
|
FileInputStream fis = null;
|
||||||
|
byte[] md5Bytes = null;
|
||||||
|
try {
|
||||||
|
File file = new File(filePath);
|
||||||
|
fis = new FileInputStream(file);
|
||||||
|
MessageDigest md5 = MessageDigest.getInstance("MD5");
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
int length = -1;
|
||||||
|
while ((length = fis.read(buffer, 0, 1024)) != -1) {
|
||||||
|
md5.update(buffer, 0, length);
|
||||||
|
}
|
||||||
|
md5Bytes = md5.digest();
|
||||||
|
fis.close();
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
EsignDemoException ex = new EsignDemoException("文件找不到", e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
} catch (NoSuchAlgorithmException e) {
|
||||||
|
EsignDemoException ex = new EsignDemoException("不支持此算法", e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
} catch (IOException e) {
|
||||||
|
EsignDemoException ex = new EsignDemoException("输入流或输出流异常", e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
} finally {
|
||||||
|
if (fis != null) {
|
||||||
|
try {
|
||||||
|
fis.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
EsignDemoException ex = new EsignDemoException("关闭文件输入流失败", e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return md5Bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param path
|
||||||
|
* @return
|
||||||
|
* @throws EsignDemoException
|
||||||
|
* @description 根据文件路径,获取文件base64
|
||||||
|
* @author 宫清
|
||||||
|
* @date 2019年7月21日 下午4:22:08
|
||||||
|
*/
|
||||||
|
public static String getBase64Str(String path) throws EsignDemoException {
|
||||||
|
InputStream is = null;
|
||||||
|
try {
|
||||||
|
is = new FileInputStream(new File(path));
|
||||||
|
byte[] bytes = new byte[is.available()];
|
||||||
|
is.read(bytes);
|
||||||
|
return Base64.encodeBase64String(bytes);
|
||||||
|
} catch (Exception e) {
|
||||||
|
EsignDemoException ex = new EsignDemoException("获取文件输入流失败", e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
} finally {
|
||||||
|
if (is != null) {
|
||||||
|
try {
|
||||||
|
is.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
EsignDemoException ex = new EsignDemoException("关闭文件输入流失败", e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param path 文件路径
|
||||||
|
* @return
|
||||||
|
* @description 获取文件名称
|
||||||
|
* @author 宫清
|
||||||
|
* @date 2019年7月21日 下午8:21:16
|
||||||
|
*/
|
||||||
|
public static String getFileName(String path) {
|
||||||
|
return new File(path).getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param filePath {@link String} 文件地址
|
||||||
|
* @return
|
||||||
|
* @throws EsignDemoException
|
||||||
|
* @description 获取文件字节流
|
||||||
|
* @date 2019年7月10日 上午9:17:00
|
||||||
|
* @author 宫清
|
||||||
|
*/
|
||||||
|
public static byte[] getBytes(String filePath) throws EsignDemoException {
|
||||||
|
File file = new File(filePath);
|
||||||
|
FileInputStream fis = null;
|
||||||
|
byte[] buffer = null;
|
||||||
|
try {
|
||||||
|
fis = new FileInputStream(file);
|
||||||
|
buffer = new byte[(int) file.length()];
|
||||||
|
fis.read(buffer);
|
||||||
|
} catch (Exception e) {
|
||||||
|
EsignDemoException ex = new EsignDemoException("获取文件字节流失败", e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
} finally {
|
||||||
|
if (fis != null) {
|
||||||
|
try {
|
||||||
|
fis.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
EsignDemoException ex = new EsignDemoException("关闭文件字节流失败", e);
|
||||||
|
ex.initCause(e);
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.ruoyi.common.core.controller;
|
package com.ruoyi.common.core.controller;
|
||||||
|
|
||||||
import java.beans.PropertyEditorSupport;
|
import java.beans.PropertyEditorSupport;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -82,6 +83,9 @@ public class BaseController
|
|||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
protected TableDataInfo getDataTable(List<?> list)
|
protected TableDataInfo getDataTable(List<?> list)
|
||||||
{
|
{
|
||||||
|
if(list == null){
|
||||||
|
list=new ArrayList<>();
|
||||||
|
}
|
||||||
TableDataInfo rspData = new TableDataInfo();
|
TableDataInfo rspData = new TableDataInfo();
|
||||||
rspData.setCode(HttpStatus.SUCCESS);
|
rspData.setCode(HttpStatus.SUCCESS);
|
||||||
rspData.setMsg("查询成功");
|
rspData.setMsg("查询成功");
|
||||||
|
|||||||
@@ -1,118 +1,117 @@
|
|||||||
package com.ruoyi.common.core.domain;
|
package com.ruoyi.common.core.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Entity基类
|
* Entity基类
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class BaseEntity implements Serializable
|
public class BaseEntity implements Serializable {
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 搜索值 */
|
/**
|
||||||
|
* 搜索值
|
||||||
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
private String searchValue;
|
private String searchValue;
|
||||||
|
|
||||||
/** 创建者 */
|
/**
|
||||||
|
* 创建者
|
||||||
|
*/
|
||||||
private String createBy;
|
private String createBy;
|
||||||
|
|
||||||
/** 创建时间 */
|
/**
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
/** 更新者 */
|
/**
|
||||||
|
* 更新者
|
||||||
|
*/
|
||||||
private String updateBy;
|
private String updateBy;
|
||||||
|
|
||||||
/** 更新时间 */
|
/**
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
/** 备注 */
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/** 请求参数 */
|
/**
|
||||||
|
* 请求参数
|
||||||
|
*/
|
||||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||||
private Map<String, Object> params;
|
private Map<String, Object> params;
|
||||||
|
|
||||||
public String getSearchValue()
|
public String getSearchValue() {
|
||||||
{
|
|
||||||
return searchValue;
|
return searchValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSearchValue(String searchValue)
|
public void setSearchValue(String searchValue) {
|
||||||
{
|
|
||||||
this.searchValue = searchValue;
|
this.searchValue = searchValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCreateBy()
|
public String getCreateBy() {
|
||||||
{
|
|
||||||
return createBy;
|
return createBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreateBy(String createBy)
|
public void setCreateBy(String createBy) {
|
||||||
{
|
|
||||||
this.createBy = createBy;
|
this.createBy = createBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getCreateTime()
|
public Date getCreateTime() {
|
||||||
{
|
|
||||||
return createTime;
|
return createTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreateTime(Date createTime)
|
public void setCreateTime(Date createTime) {
|
||||||
{
|
|
||||||
this.createTime = createTime;
|
this.createTime = createTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUpdateBy()
|
public String getUpdateBy() {
|
||||||
{
|
|
||||||
return updateBy;
|
return updateBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUpdateBy(String updateBy)
|
public void setUpdateBy(String updateBy) {
|
||||||
{
|
|
||||||
this.updateBy = updateBy;
|
this.updateBy = updateBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getUpdateTime()
|
public Date getUpdateTime() {
|
||||||
{
|
|
||||||
return updateTime;
|
return updateTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUpdateTime(Date updateTime)
|
public void setUpdateTime(Date updateTime) {
|
||||||
{
|
|
||||||
this.updateTime = updateTime;
|
this.updateTime = updateTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRemark()
|
public String getRemark() {
|
||||||
{
|
|
||||||
return remark;
|
return remark;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRemark(String remark)
|
public void setRemark(String remark) {
|
||||||
{
|
|
||||||
this.remark = remark;
|
this.remark = remark;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getParams()
|
public Map<String, Object> getParams() {
|
||||||
{
|
if (params == null) {
|
||||||
if (params == null)
|
|
||||||
{
|
|
||||||
params = new HashMap<>();
|
params = new HashMap<>();
|
||||||
}
|
}
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setParams(Map<String, Object> params)
|
public void setParams(Map<String, Object> params) {
|
||||||
{
|
|
||||||
this.params = params;
|
this.params = params;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
|
|||||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||||
import com.ruoyi.common.core.domain.entity.SysMenu;
|
import com.ruoyi.common.core.domain.entity.SysMenu;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Treeselect树结构实体类
|
* Treeselect树结构实体类
|
||||||
*
|
*
|
||||||
@@ -38,6 +39,7 @@ public class TreeSelect implements Serializable
|
|||||||
this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
|
this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public TreeSelect(SysMenu menu)
|
public TreeSelect(SysMenu menu)
|
||||||
{
|
{
|
||||||
this.id = menu.getMenuId();
|
this.id = menu.getMenuId();
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.ruoyi.common.core.domain.entity;
|
||||||
|
/**
|
||||||
|
* esignSDK-core信息类
|
||||||
|
* @author 澄泓
|
||||||
|
* @date 2022/2/22 13:59
|
||||||
|
* @version
|
||||||
|
*/
|
||||||
|
public class EsignCoreSdkInfo {
|
||||||
|
private static final String SdkVersion="Esign-Sdk-Core1.0";
|
||||||
|
private static final String SupportedVersion="JDK1.7 MORE THAN";
|
||||||
|
|
||||||
|
private static final String Info="sdk-esign-api核心工具包,主要处理e签宝公有云产品接口调用时的签名计算以及网络请求,通过EsignHttpHelper.signAndBuildSignAndJsonHeader构造签名鉴权+json数据格式的请求头,通过HttpHelper.doCommHttp方法入参发起网络请求。让开发者无需关注具体的请求签名算法,专注于接口业务的json参数构造";
|
||||||
|
public static String getSdkVersion() {
|
||||||
|
return SdkVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getInfo() {
|
||||||
|
return Info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getSupportedVersion() {
|
||||||
|
return SupportedVersion;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.ruoyi.common.core.domain.entity;
|
||||||
|
/**
|
||||||
|
* 网络请求的response类
|
||||||
|
*/
|
||||||
|
public class EsignHttpResponse {
|
||||||
|
private int status;
|
||||||
|
private String body;
|
||||||
|
|
||||||
|
public int getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBody() {
|
||||||
|
return body;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBody(String body) {
|
||||||
|
this.body = body;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -31,6 +31,9 @@ public class SysDept extends BaseEntity
|
|||||||
/** 部门名称 */
|
/** 部门名称 */
|
||||||
private String deptName;
|
private String deptName;
|
||||||
|
|
||||||
|
/** 部门类型 */
|
||||||
|
private Integer deptType;
|
||||||
|
|
||||||
/** 显示顺序 */
|
/** 显示顺序 */
|
||||||
private Integer orderNum;
|
private Integer orderNum;
|
||||||
|
|
||||||
@@ -51,6 +54,76 @@ public class SysDept extends BaseEntity
|
|||||||
|
|
||||||
/** 父部门名称 */
|
/** 父部门名称 */
|
||||||
private String parentName;
|
private String parentName;
|
||||||
|
/**
|
||||||
|
* 代码(统一社会信用代码或者身份证号)
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法定代表人
|
||||||
|
*/
|
||||||
|
private String compLegalPerson;
|
||||||
|
/**
|
||||||
|
* 住所
|
||||||
|
*/
|
||||||
|
private String home;
|
||||||
|
/**
|
||||||
|
* 联系地址
|
||||||
|
*/
|
||||||
|
private String address;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 国籍,0-国内,1-国外
|
||||||
|
*/
|
||||||
|
private Integer nationality;
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCompLegalPerson() {
|
||||||
|
return compLegalPerson;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCompLegalPerson(String compLegalPerson) {
|
||||||
|
this.compLegalPerson = compLegalPerson;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHome() {
|
||||||
|
return home;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHome(String home) {
|
||||||
|
this.home = home;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddress(String address) {
|
||||||
|
this.address = address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNationality() {
|
||||||
|
return nationality;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNationality(Integer nationality) {
|
||||||
|
this.nationality = nationality;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getDeptType() {
|
||||||
|
return deptType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeptType(Integer deptType) {
|
||||||
|
this.deptType = deptType;
|
||||||
|
}
|
||||||
|
|
||||||
/** 子部门 */
|
/** 子部门 */
|
||||||
private List<SysDept> children = new ArrayList<SysDept>();
|
private List<SysDept> children = new ArrayList<SysDept>();
|
||||||
|
|||||||
@@ -33,10 +33,44 @@ public class SysUser extends BaseEntity
|
|||||||
@Excel(name = "登录名称")
|
@Excel(name = "登录名称")
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** 用户昵称 */
|
/** 用户昵称 */
|
||||||
@Excel(name = "用户名称")
|
@Excel(name = "用户名称")
|
||||||
private String nickName;
|
private String nickName;
|
||||||
|
|
||||||
|
/** 用户昵称和待办数量 */
|
||||||
|
private String nickNameAndNum;
|
||||||
|
|
||||||
|
public String getNickNameAndNum() {
|
||||||
|
return nickNameAndNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNickNameAndNum(String nickNameAndNum) {
|
||||||
|
this.nickNameAndNum = nickNameAndNum;
|
||||||
|
}
|
||||||
|
/** 身份类别,0-身份证,1-护照,默认0 */
|
||||||
|
private Integer idType;
|
||||||
|
/** 国籍,0-国内,1-国外,默认0 */
|
||||||
|
|
||||||
|
private Integer nationality;
|
||||||
|
/**
|
||||||
|
* 生日
|
||||||
|
*/
|
||||||
|
private Date birth;
|
||||||
|
/**
|
||||||
|
* 住所
|
||||||
|
*/
|
||||||
|
private String home;
|
||||||
|
/**
|
||||||
|
* 联系地址
|
||||||
|
*/
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
/** 用户身份证号 */
|
||||||
|
@Excel(name = "身份证号")
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
/** 用户邮箱 */
|
/** 用户邮箱 */
|
||||||
@Excel(name = "用户邮箱")
|
@Excel(name = "用户邮箱")
|
||||||
private String email;
|
private String email;
|
||||||
@@ -88,12 +122,64 @@ public class SysUser extends BaseEntity
|
|||||||
|
|
||||||
/** 角色ID */
|
/** 角色ID */
|
||||||
private Long roleId;
|
private Long roleId;
|
||||||
|
/**
|
||||||
|
* 职位
|
||||||
|
*/
|
||||||
|
private String position;
|
||||||
|
|
||||||
|
public String getPosition() {
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPosition(String position) {
|
||||||
|
this.position = position;
|
||||||
|
}
|
||||||
|
|
||||||
public SysUser()
|
public SysUser()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getIdType() {
|
||||||
|
return idType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdType(Integer idType) {
|
||||||
|
this.idType = idType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNationality() {
|
||||||
|
return nationality;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNationality(Integer nationality) {
|
||||||
|
this.nationality = nationality;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getBirth() {
|
||||||
|
return birth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBirth(Date birth) {
|
||||||
|
this.birth = birth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHome() {
|
||||||
|
return home;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHome(String home) {
|
||||||
|
this.home = home;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddress(String address) {
|
||||||
|
this.address = address;
|
||||||
|
}
|
||||||
|
|
||||||
public SysUser(Long userId)
|
public SysUser(Long userId)
|
||||||
{
|
{
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
@@ -297,12 +383,21 @@ public class SysUser extends BaseEntity
|
|||||||
this.roleId = roleId;
|
this.roleId = roleId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getIdCard() {
|
||||||
|
return idCard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdCard(String idCard) {
|
||||||
|
this.idCard = idCard;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
.append("userId", getUserId())
|
.append("userId", getUserId())
|
||||||
.append("deptId", getDeptId())
|
.append("deptId", getDeptId())
|
||||||
.append("userName", getUserName())
|
.append("userName", getUserName())
|
||||||
|
.append("idCard", getIdCard())
|
||||||
.append("nickName", getNickName())
|
.append("nickName", getNickName())
|
||||||
.append("email", getEmail())
|
.append("email", getEmail())
|
||||||
.append("phonenumber", getPhonenumber())
|
.append("phonenumber", getPhonenumber())
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.ruoyi.common.enums;
|
||||||
|
|
||||||
|
import org.apache.http.client.methods.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 请求类型
|
||||||
|
* @author 澄泓
|
||||||
|
* @since JDK1.7
|
||||||
|
*/
|
||||||
|
public enum EsignRequestType {
|
||||||
|
|
||||||
|
POST{
|
||||||
|
@Override
|
||||||
|
public HttpRequestBase getHttpType(String url) {
|
||||||
|
return new HttpPost(url);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
GET{
|
||||||
|
@Override
|
||||||
|
public HttpRequestBase getHttpType(String url) {
|
||||||
|
return new HttpGet(url);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
DELETE{
|
||||||
|
@Override
|
||||||
|
public HttpRequestBase getHttpType(String url) {
|
||||||
|
return new HttpDelete(url);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
PUT{
|
||||||
|
@Override
|
||||||
|
public HttpRequestBase getHttpType(String url) {
|
||||||
|
return new HttpPut(url);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
;
|
||||||
|
|
||||||
|
public abstract HttpRequestBase getHttpType(String url);
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ package com.ruoyi.common.enums;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.springframework.lang.Nullable;
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -9,28 +10,23 @@ import org.springframework.lang.Nullable;
|
|||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public enum HttpMethod
|
public enum HttpMethod {
|
||||||
{
|
|
||||||
GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE;
|
GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE;
|
||||||
|
|
||||||
private static final Map<String, HttpMethod> mappings = new HashMap<>(16);
|
private static final Map<String, HttpMethod> mappings = new HashMap<>(16);
|
||||||
|
|
||||||
static
|
static {
|
||||||
{
|
for (HttpMethod httpMethod : values()) {
|
||||||
for (HttpMethod httpMethod : values())
|
|
||||||
{
|
|
||||||
mappings.put(httpMethod.name(), httpMethod);
|
mappings.put(httpMethod.name(), httpMethod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public static HttpMethod resolve(@Nullable String method)
|
public static HttpMethod resolve(@Nullable String method) {
|
||||||
{
|
|
||||||
return (method != null ? mappings.get(method) : null);
|
return (method != null ? mappings.get(method) : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean matches(String method)
|
public boolean matches(String method) {
|
||||||
{
|
|
||||||
return (this == resolve(method));
|
return (this == resolve(method));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.ruoyi.common.enums;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangqiong
|
||||||
|
* @description 短信状态枚举
|
||||||
|
* @date 2023-11-17 14:05
|
||||||
|
*/
|
||||||
|
public enum SMSStatusEnum
|
||||||
|
{
|
||||||
|
SUCCESS(1, "成功"),
|
||||||
|
SENDING(2, "发送中"),
|
||||||
|
FAIL(3, "失败"),
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
private final Integer code;
|
||||||
|
private final String text;
|
||||||
|
|
||||||
|
SMSStatusEnum(Integer code, String text)
|
||||||
|
{
|
||||||
|
this.code = code;
|
||||||
|
this.text = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCode()
|
||||||
|
{
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getText()
|
||||||
|
{
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据code获取text
|
||||||
|
* @param codeNo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getTextByCode(Integer codeNo){
|
||||||
|
for (SMSStatusEnum value : SMSStatusEnum.values()) {
|
||||||
|
if (value.getCode().equals(codeNo)){
|
||||||
|
return value.getText();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return codeNo.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据text获取code
|
||||||
|
* @param textStr
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getCodeByText(String textStr){
|
||||||
|
for (SMSStatusEnum value : SMSStatusEnum.values()) {
|
||||||
|
if (value.getText().equals(textStr)){
|
||||||
|
return value.getText();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return textStr;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.ruoyi.common.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangqiong
|
||||||
|
* @description 修改案件的提交状态
|
||||||
|
* @date 2023-11-17 14:05
|
||||||
|
*/
|
||||||
|
public enum UpdateSubmitStatus
|
||||||
|
{
|
||||||
|
UNCOMMITTED(0, "未提交"),
|
||||||
|
COMMITTED(1, "已提交"),
|
||||||
|
REVOKE(2, "撤销"),
|
||||||
|
AGREE(3, "同意已修改的案件"),
|
||||||
|
REFUSE(4, "拒绝已修改的案件"),
|
||||||
|
|
||||||
|
AGREE_REVOKE(5, "同意撤销修改"),
|
||||||
|
REFUSE_REVOKE(6, "拒绝撤销修改"),
|
||||||
|
;
|
||||||
|
|
||||||
|
private final Integer code;
|
||||||
|
private final String text;
|
||||||
|
|
||||||
|
UpdateSubmitStatus(Integer code, String text)
|
||||||
|
{
|
||||||
|
this.code = code;
|
||||||
|
this.text = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCode()
|
||||||
|
{
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getText()
|
||||||
|
{
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.ruoyi.common.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangqiong
|
||||||
|
* @description 是否枚举
|
||||||
|
* @date 2023-11-17 14:05
|
||||||
|
*/
|
||||||
|
public enum YesOrNoEnum
|
||||||
|
{
|
||||||
|
NO(0, "否"),
|
||||||
|
YES(1, "是"),
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
|
private final Integer code;
|
||||||
|
private final String text;
|
||||||
|
|
||||||
|
YesOrNoEnum(Integer code, String text)
|
||||||
|
{
|
||||||
|
this.code = code;
|
||||||
|
this.text = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCode()
|
||||||
|
{
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getText()
|
||||||
|
{
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.ruoyi.common.exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* description 自定义全局异常
|
||||||
|
* @author 澄泓
|
||||||
|
* datetime 2019年7月1日上午10:43:24
|
||||||
|
*/
|
||||||
|
public class EsignDemoException extends Exception {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 4359180081622082792L;
|
||||||
|
private Exception e;
|
||||||
|
|
||||||
|
public EsignDemoException(String msg) {
|
||||||
|
super(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public EsignDemoException(String msg, Throwable cause) {
|
||||||
|
super(msg,cause);
|
||||||
|
}
|
||||||
|
|
||||||
|
public EsignDemoException(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Exception getE() {
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setE(Exception e) {
|
||||||
|
this.e = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package com.ruoyi.common.utils;
|
||||||
|
|
||||||
|
import cn.hutool.core.io.IoUtil;
|
||||||
|
import cn.hutool.crypto.digest.HMac;
|
||||||
|
import cn.hutool.crypto.digest.HmacAlgorithm;
|
||||||
|
import org.springframework.web.context.request.RequestContextHolder;
|
||||||
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
|
public class CheckSignatuerUtils {
|
||||||
|
|
||||||
|
public static String getSign(String paramsbody, String accessSec, long timestamp) {
|
||||||
|
String paramsStr = getParamsStr(paramsbody, timestamp);
|
||||||
|
return generateSign(paramsStr, accessSec);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getParamsStr(String paramsbody,long timestamp) {
|
||||||
|
StringBuilder strbuild = new StringBuilder();
|
||||||
|
if (StringUtils.isNotBlank(paramsbody)) {
|
||||||
|
strbuild.append(paramsbody).append('#');
|
||||||
|
}
|
||||||
|
strbuild.append("#timestamp=").append(timestamp);
|
||||||
|
return strbuild.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String generateSign(String paramsStr, String accessSec) {
|
||||||
|
HMac hMac = new HMac(HmacAlgorithm.HmacSHA256, accessSec.getBytes(StandardCharsets.UTF_8));
|
||||||
|
return hMac.digestHex(paramsStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean checkSignuter(String paramsbody) throws Exception {
|
||||||
|
HttpServletRequest reqParam = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
|
||||||
|
String timestampstr = reqParam.getHeader("timestampstr");
|
||||||
|
String signstr = reqParam.getHeader("signstr");
|
||||||
|
String accessSec = "mCFMA6ffe938v79m";
|
||||||
|
String newSignuter = getSign(paramsbody, accessSec,Long.parseLong(timestampstr));
|
||||||
|
if (StringUtils.equals(signstr, newSignuter)) {
|
||||||
|
return true;
|
||||||
|
}else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,452 @@
|
|||||||
|
package com.ruoyi.common.utils;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.ruoyi.common.utils.uuid.UUID;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.mail.MailException;
|
||||||
|
import org.springframework.mail.SimpleMailMessage;
|
||||||
|
|
||||||
|
import org.springframework.mail.javamail.JavaMailSender;
|
||||||
|
import org.springframework.mail.javamail.JavaMailSenderImpl;
|
||||||
|
import org.springframework.mail.javamail.MimeMessageHelper;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.activation.DataHandler;
|
||||||
|
import javax.mail.*;
|
||||||
|
import javax.mail.internet.*;
|
||||||
|
import javax.mail.search.*;
|
||||||
|
import javax.mail.util.ByteArrayDataSource;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.io.*;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.security.Security;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName EmailInUtil
|
||||||
|
* @Description 邮件发送工具
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Data
|
||||||
|
@Slf4j
|
||||||
|
public class EmailOutUtil {
|
||||||
|
private static Pattern emailPattern = Pattern.compile("^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$");
|
||||||
|
// private static Pattern phonePattern = Pattern.compile("0?(13|14|15|18)[0-9]{9}");
|
||||||
|
private static Pattern phonePattern = Pattern.compile("^1\\d{10}$");
|
||||||
|
|
||||||
|
|
||||||
|
// @Autowired
|
||||||
|
// private JavaMailSender mailSender;
|
||||||
|
|
||||||
|
// 发送发邮箱地址(外网地址)
|
||||||
|
// @Value("${spring.mail-out-network.from}")
|
||||||
|
// private static String fromOut;
|
||||||
|
@Value("${spring.mail.host}")
|
||||||
|
private String hostOut;
|
||||||
|
@Value("${spring.mail.username}")
|
||||||
|
private String usernameOut;
|
||||||
|
|
||||||
|
@Value("${spring.mail.password}")
|
||||||
|
private String passwordOut;
|
||||||
|
|
||||||
|
@Value("${spring.mail.port}")
|
||||||
|
private Integer portOut;
|
||||||
|
|
||||||
|
public JavaMailSender rebuildMailSender() {
|
||||||
|
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
|
||||||
|
mailSender.setHost(hostOut);
|
||||||
|
mailSender.setUsername(usernameOut);
|
||||||
|
mailSender.setPassword(passwordOut);
|
||||||
|
mailSender.setPort(portOut);
|
||||||
|
mailSender.setProtocol("smtp");
|
||||||
|
mailSender.setDefaultEncoding("UTF-8");
|
||||||
|
return mailSender;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送纯文本邮件信息
|
||||||
|
*
|
||||||
|
* @param to 接收方
|
||||||
|
* @param subject 邮件主题
|
||||||
|
* @param content 邮件内容(发送内容)
|
||||||
|
*/
|
||||||
|
public Boolean sendMessage(String to, String subject, String content, String from, JavaMailSender mailSender) {
|
||||||
|
try {
|
||||||
|
if(mailSender==null){
|
||||||
|
mailSender= rebuildMailSender();
|
||||||
|
}
|
||||||
|
// 创建一个邮件对象
|
||||||
|
SimpleMailMessage msg = new SimpleMailMessage();
|
||||||
|
if(StrUtil.isEmpty(from)){
|
||||||
|
msg.setFrom(usernameOut);
|
||||||
|
}else {
|
||||||
|
msg.setFrom(from);
|
||||||
|
}
|
||||||
|
msg.setTo(to);
|
||||||
|
// 设置邮件主题
|
||||||
|
msg.setSubject(subject);
|
||||||
|
// 设置邮件内容
|
||||||
|
msg.setText(content);
|
||||||
|
// 发送邮件
|
||||||
|
mailSender.send(msg);
|
||||||
|
} catch (MailException e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param to 收件人
|
||||||
|
* @param message 邮件内容
|
||||||
|
* @param subject 邮件主题
|
||||||
|
* @param fileList 邮件附件
|
||||||
|
* @param fileNameMap 附件名称map,附件路径-附件名称
|
||||||
|
*/
|
||||||
|
public Boolean sendEmil(String to, String message, String subject, List<File> fileList, File file,Map<String,String> fileNameMap) {
|
||||||
|
try {
|
||||||
|
String messageContent = "<html><body><p style=\"font-family: Arial, sans-serif; font-size: 18px;\">"+message+"。</p></body></html>";
|
||||||
|
MimeBodyPart messageBodyPart = new MimeBodyPart();
|
||||||
|
messageBodyPart.setContent(messageContent, "text/html;charset=utf-8");
|
||||||
|
messageBodyPart.setContentID(UUID.randomUUID().toString());
|
||||||
|
final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
|
||||||
|
//设置邮件会话参数
|
||||||
|
Properties props = new Properties();
|
||||||
|
//邮箱的发送服务器地址
|
||||||
|
props.setProperty("mail.smtp.host", "smtp.163.com");
|
||||||
|
props.setProperty("mail.smtp.socketFactory.class", SSL_FACTORY);
|
||||||
|
props.setProperty("mail.smtp.socketFactory.fallback", "false");
|
||||||
|
//邮箱发送服务器端口,这里设置为465端口
|
||||||
|
props.setProperty("mail.smtp.port", "465");
|
||||||
|
props.setProperty("mail.smtp.socketFactory.port", "465");
|
||||||
|
props.put("mail.smtp.auth", "true");
|
||||||
|
//获取到邮箱会话,利用匿名内部类的方式,将发送者邮箱用户名和密码授权给jvm
|
||||||
|
Session session = Session.getDefaultInstance(props, new Authenticator() {
|
||||||
|
@Override
|
||||||
|
protected PasswordAuthentication getPasswordAuthentication() {
|
||||||
|
return new PasswordAuthentication(usernameOut, passwordOut);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//通过会话,得到一个邮件,用于发送
|
||||||
|
Message msg = new MimeMessage(session);
|
||||||
|
//设置发件人
|
||||||
|
msg.setFrom(new InternetAddress(usernameOut));
|
||||||
|
//设置收件人,to为收件人,cc为抄送,bcc为密送
|
||||||
|
msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to, false));
|
||||||
|
msg.setRecipients(Message.RecipientType.CC, InternetAddress.parse(to, false));
|
||||||
|
msg.setRecipients(Message.RecipientType.BCC, InternetAddress.parse(to, false));
|
||||||
|
//设置邮件消息
|
||||||
|
msg.setSubject(subject);
|
||||||
|
msg.setText(message);
|
||||||
|
msg.setDescription("messageutf-8html");
|
||||||
|
//设置发送的日期
|
||||||
|
msg.setSentDate(new Date());
|
||||||
|
// 创建邮件正文
|
||||||
|
MimeMultipart multipart = new MimeMultipart();
|
||||||
|
// MimeBodyPart bodyPart = new MimeBodyPart();
|
||||||
|
// bodyPart.setContent("This is the body of the email", "text/html");
|
||||||
|
multipart.addBodyPart(messageBodyPart);
|
||||||
|
// 添加附件
|
||||||
|
if (file != null) {
|
||||||
|
MimeBodyPart attachmentPart = new MimeBodyPart();
|
||||||
|
attachmentPart.attachFile(file);
|
||||||
|
attachmentPart.setFileName(MimeUtility.encodeText(file.getName()));
|
||||||
|
multipart.addBodyPart(attachmentPart);
|
||||||
|
//将multipart对象放入邮件
|
||||||
|
msg.setContent(multipart);
|
||||||
|
} else if (fileList != null && fileList.size() > 0) {
|
||||||
|
// 添加附件(多个)
|
||||||
|
if (fileList != null && fileList.size() > 0) {
|
||||||
|
for (File tempfile : fileList) {
|
||||||
|
MimeBodyPart attachmentPart = new MimeBodyPart();
|
||||||
|
attachmentPart.attachFile(tempfile);
|
||||||
|
// 设置附件名称
|
||||||
|
if(fileNameMap!=null && fileNameMap.containsKey(tempfile.getPath())) {
|
||||||
|
attachmentPart.setFileName(MimeUtility.encodeText(fileNameMap.get(tempfile.getPath())));
|
||||||
|
}
|
||||||
|
multipart.addBodyPart(attachmentPart);
|
||||||
|
}
|
||||||
|
msg.setContent(multipart);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//调用Transport的send方法去发送邮件
|
||||||
|
Transport.send(msg);
|
||||||
|
}catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return Boolean.FALSE;
|
||||||
|
}
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送带附件的邮件信息
|
||||||
|
*
|
||||||
|
* @param to 接收方
|
||||||
|
* @param subject 邮件主题
|
||||||
|
* @param content 邮件内容(发送内容)
|
||||||
|
* @param fileList 文件集合 // 可发送多个附件
|
||||||
|
*/
|
||||||
|
public void sendMessageCarryFiles(String to, String subject, String content, List<File> fileList, String from, @NotNull JavaMailSender mailSender) {
|
||||||
|
MimeMessage mimeMessage = mailSender.createMimeMessage();
|
||||||
|
try {
|
||||||
|
MimeMessageHelper helper = new MimeMessageHelper(mimeMessage, true);
|
||||||
|
helper.setFrom(from);
|
||||||
|
helper.setTo(to);
|
||||||
|
// 设置邮件主题
|
||||||
|
helper.setSubject(subject);
|
||||||
|
// 设置邮件内容
|
||||||
|
helper.setText(content);
|
||||||
|
// 添加附件(多个)
|
||||||
|
if (fileList != null && fileList.size() > 0) {
|
||||||
|
for (File file : fileList) {
|
||||||
|
helper.addAttachment(file.getName(), file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (MessagingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
// 发送邮件
|
||||||
|
mailSender.send(mimeMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送带附件的邮件信息
|
||||||
|
*
|
||||||
|
* @param to 接收方
|
||||||
|
* @param subject 邮件主题
|
||||||
|
* @param content 邮件内容(发送内容)
|
||||||
|
* @param file 单个文件
|
||||||
|
*/
|
||||||
|
public void sendMessageCarryFile(String to, String subject, String content, File file, String from, JavaMailSender mailSender) {
|
||||||
|
MimeMessage mimeMessage = mailSender.createMimeMessage();
|
||||||
|
try {
|
||||||
|
MimeMessageHelper helper = new MimeMessageHelper(mimeMessage, true);
|
||||||
|
helper.setFrom(from);
|
||||||
|
helper.setTo(to);
|
||||||
|
// 设置邮件主题
|
||||||
|
helper.setSubject(subject);
|
||||||
|
// 设置邮件内容
|
||||||
|
helper.setText(content);
|
||||||
|
// 单个附件
|
||||||
|
helper.addAttachment(file.getName(), file);
|
||||||
|
} catch (MessagingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
// 发送邮件
|
||||||
|
mailSender.send(mimeMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化内外网邮件发送对象
|
||||||
|
*
|
||||||
|
* @param num
|
||||||
|
*/
|
||||||
|
// public static JavaMailSender initJavaMailSender(Integer num) {
|
||||||
|
// if (num != null && num == 1) {
|
||||||
|
// //内网
|
||||||
|
// return rebuildMailSender(hostIn, usernameIn, passwordIn, Integer.parseInt(portIn), "smtps");
|
||||||
|
// } else {
|
||||||
|
// //外网
|
||||||
|
// return rebuildMailSender(hostOut, usernameOut, passwordOut, Integer.parseInt(portOut), "smtps");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public static String getInnerFrom() {
|
||||||
|
// return EmailInUtil;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public static String getOutterFrom() {
|
||||||
|
// return fromOut;
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证邮箱格式
|
||||||
|
*
|
||||||
|
* @param str
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean isEmail(String str) {
|
||||||
|
boolean flag = false;
|
||||||
|
Matcher matcher = emailPattern.matcher(str);
|
||||||
|
if (matcher.matches()) {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isPhoneNumber(String str) {
|
||||||
|
boolean flag = false;
|
||||||
|
Matcher matcher = phonePattern.matcher(str);
|
||||||
|
if (matcher.matches()) {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
public void buildReceiveConnect() throws Exception {
|
||||||
|
|
||||||
|
//POP3主机名
|
||||||
|
String host = "pop3.163.com";
|
||||||
|
//设置传输协议
|
||||||
|
String protocol = "pop3";
|
||||||
|
//用户账号
|
||||||
|
String username = "wq18792927508@163.com";
|
||||||
|
//密码或者授权码
|
||||||
|
String password = "WDFHKSEMCKVRELEA";
|
||||||
|
/*
|
||||||
|
* 获取Session
|
||||||
|
*/
|
||||||
|
Properties props = new Properties();
|
||||||
|
//协议
|
||||||
|
props.setProperty("mail.store.protocol", protocol);
|
||||||
|
//POP3主机名
|
||||||
|
props.setProperty("mail.pop3.host", host);
|
||||||
|
props.setProperty("mail.smtp.auth", "true");
|
||||||
|
props.setProperty("mail.pop3.default-encoding", "UTF-8");
|
||||||
|
Session session = Session.getDefaultInstance(props, new Authenticator() {
|
||||||
|
@Override
|
||||||
|
protected PasswordAuthentication getPasswordAuthentication() {
|
||||||
|
return new PasswordAuthentication(usernameOut, passwordOut);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
URLName urlName = new URLName(protocol, host, 110, null, username, password);
|
||||||
|
Store store = session.getStore(urlName);
|
||||||
|
store.connect(username, password);
|
||||||
|
|
||||||
|
|
||||||
|
Folder folder = store.getFolder("INBOX");
|
||||||
|
|
||||||
|
folder.open(Folder.READ_ONLY);
|
||||||
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 接收邮件
|
||||||
|
*/
|
||||||
|
public List<String> receiverMail() {
|
||||||
|
List<String> messageIds=new ArrayList<>();
|
||||||
|
|
||||||
|
// session.setDebug(true);
|
||||||
|
|
||||||
|
try {
|
||||||
|
//POP3主机名
|
||||||
|
String host = "pop3.163.com";
|
||||||
|
//设置传输协议
|
||||||
|
String protocol = "pop3";
|
||||||
|
//用户账号
|
||||||
|
String username = "wq18792927508@163.com";
|
||||||
|
//密码或者授权码
|
||||||
|
String password = "WDFHKSEMCKVRELEA";
|
||||||
|
/*
|
||||||
|
* 获取Session
|
||||||
|
*/
|
||||||
|
Properties props = new Properties();
|
||||||
|
//协议
|
||||||
|
props.setProperty("mail.store.protocol", protocol);
|
||||||
|
//POP3主机名
|
||||||
|
props.setProperty("mail.pop3.host", host);
|
||||||
|
props.setProperty("mail.smtp.auth", "true");
|
||||||
|
props.setProperty("mail.pop3.default-encoding", "UTF-8");
|
||||||
|
Session session = Session.getDefaultInstance(props, new Authenticator() {
|
||||||
|
@Override
|
||||||
|
protected PasswordAuthentication getPasswordAuthentication() {
|
||||||
|
return new PasswordAuthentication(usernameOut, passwordOut);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
URLName urlName = new URLName(protocol, host, 110, null, username, password);
|
||||||
|
Store store = session.getStore(urlName);
|
||||||
|
store.connect(username, password);
|
||||||
|
|
||||||
|
|
||||||
|
Folder folder = store.getFolder("INBOX");
|
||||||
|
folder.open(Folder.READ_ONLY);
|
||||||
|
SearchTerm orTerm = new SubjectTerm("退信");
|
||||||
|
// Message[] messages = folder.search(orTerm);
|
||||||
|
Date endTime= new Date();
|
||||||
|
long oneDayMillis=24*60*60*1000L;
|
||||||
|
Date startTime=new Date(endTime.getTime()-oneDayMillis);
|
||||||
|
// SearchTerm comparisonTermGe = new SentDateTerm(ComparisonTerm.GE, startTime);
|
||||||
|
// SearchTerm comparisonTermLe = new SentDateTerm(ComparisonTerm.LE, endTime);
|
||||||
|
// SearchTerm comparisonAndTerm = new AndTerm(comparisonTermGe, comparisonTermLe);
|
||||||
|
// SearchTerm searchTerm = new AndTerm(comparisonAndTerm, orTerm);
|
||||||
|
Message[] messages = folder.search(orTerm);
|
||||||
|
if (messages != null) {
|
||||||
|
|
||||||
|
Arrays.stream(messages).forEach(message -> {
|
||||||
|
String messageId="";
|
||||||
|
try {
|
||||||
|
messageId = EmailUtil.getMessageId(message,session);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
messageIds.add(messageId);
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
folder.close(false);
|
||||||
|
store.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
return messageIds;
|
||||||
|
}
|
||||||
|
return messageIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void analyseMail(Session session, Object content) throws Exception {
|
||||||
|
|
||||||
|
if (content instanceof Multipart) {
|
||||||
|
Multipart multipart = (Multipart) content;
|
||||||
|
for (int i = 0; i < multipart.getCount(); i++) {
|
||||||
|
BodyPart bodyPart = multipart.getBodyPart(i);
|
||||||
|
// if (bodyPart.isMimeType("message/rfc822")) { if(bodyPart.getContentType().startsWith("Message/Rfc822"));
|
||||||
|
// MimeMessage mimeMessage = new MimeMessage(session, bodyPart.getInputStream());
|
||||||
|
// }
|
||||||
|
if(bodyPart.isMimeType("Message/Rfc822")){
|
||||||
|
MimeMessage mimeMessage = new MimeMessage(session, bodyPart.getInputStream());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static String getMessageId(Part part) throws Exception {
|
||||||
|
if (!part.isMimeType("multipart/*")) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
Multipart multipart = (Multipart) part.getContent();
|
||||||
|
for (int i = 0; i < multipart.getCount(); i++) {
|
||||||
|
BodyPart bodyPart = multipart.getBodyPart(i);
|
||||||
|
|
||||||
|
if (part.isMimeType("message/rfc822")) {
|
||||||
|
return getMessageId((Part) part.getContent());
|
||||||
|
}
|
||||||
|
InputStream inputStream = bodyPart.getInputStream();
|
||||||
|
|
||||||
|
try (BufferedReader br = new BufferedReader(new InputStreamReader(inputStream))) {
|
||||||
|
String strLine;
|
||||||
|
while ((strLine = br.readLine()) != null) {
|
||||||
|
if (strLine.startsWith("Message_Id:")) {
|
||||||
|
String[] split = strLine.split("Message_Id:");
|
||||||
|
return split.length > 1 ? split[1].trim() : null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//检查退信邮件
|
||||||
|
// Folder folder = ...; //打开收件箱
|
||||||
|
// Message[] messages = folder.getMessages();
|
||||||
|
// for (Message message : messages) {
|
||||||
|
// if (message.getSubject().contains("Delivery Status Notification")) {
|
||||||
|
// System.out.println("Delivery failed for recipient: " + message.getRecipients()[0]);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package com.ruoyi.common.utils;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import javax.mail.*;
|
||||||
|
import javax.mail.internet.MimeMessage;
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public final class EmailUtil {
|
||||||
|
|
||||||
|
private static final String multipart = "multipart/*";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static String getMessageId(Part part, Session session) throws Exception {
|
||||||
|
if (!part.isMimeType(multipart)) {
|
||||||
|
return "";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Multipart multipart = (Multipart) part.getContent();
|
||||||
|
for (int i = 0; i < multipart.getCount(); i++) {
|
||||||
|
BodyPart bodyPart = multipart.getBodyPart(i);
|
||||||
|
if(bodyPart.getContentType().contains("Message/Rfc822")){
|
||||||
|
MimeMessage mimeMessage = new MimeMessage(session, bodyPart.getInputStream());
|
||||||
|
if(mimeMessage.getSubject()!=null&&mimeMessage.getSubject().contains("裁决书")){
|
||||||
|
String[] split = mimeMessage.getSubject().split("裁决书");
|
||||||
|
if(split.length>0){
|
||||||
|
return split[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isContainAttachment(Part part) {
|
||||||
|
boolean attachFlag = false;
|
||||||
|
try {
|
||||||
|
if (part.isMimeType(multipart)) {
|
||||||
|
Multipart mp = (Multipart) part.getContent();
|
||||||
|
for (int i = 0; i < mp.getCount(); i++) {
|
||||||
|
BodyPart mpart = mp.getBodyPart(i);
|
||||||
|
String disposition = mpart.getDisposition();
|
||||||
|
if ((disposition != null) && ((disposition.equals(Part.ATTACHMENT)) || (disposition.equals(Part.INLINE))))
|
||||||
|
attachFlag = true;
|
||||||
|
else if (mpart.isMimeType(multipart)) {
|
||||||
|
attachFlag = isContainAttachment((Part) mpart);
|
||||||
|
} else {
|
||||||
|
String contype = mpart.getContentType();
|
||||||
|
if (contype.toLowerCase().contains("application"))
|
||||||
|
attachFlag = true;
|
||||||
|
if (contype.toLowerCase().contains("name"))
|
||||||
|
attachFlag = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (part.isMimeType("message/rfc822")) {
|
||||||
|
attachFlag = isContainAttachment((Part) part.getContent());
|
||||||
|
}
|
||||||
|
} catch (MessagingException | IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return attachFlag;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.ruoyi.common.utils;
|
||||||
|
|
||||||
|
public class EsignApplicaConfig {
|
||||||
|
|
||||||
|
// 应用ID
|
||||||
|
public static final String EsignAppId = "7438987614";
|
||||||
|
// 应用密钥
|
||||||
|
public static final String EsignAppSecret = "9d7844f13830931037772b9d20cf1529";
|
||||||
|
// e签宝接口调用域名(模拟环境)
|
||||||
|
public static final String EsignHost = "https://smlopenapi.esign.cn";
|
||||||
|
// e签宝接口调用域名(正式环境)
|
||||||
|
// public static final String EsignHost = "https://openapi.esign.cn";
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user