forked from Gitlink/microservices
Compare commits
585 Commits
optimal_pe
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
89cf31f69a | |
|
|
14fc5ffe82 | |
|
|
33546ec525 | |
|
|
57826cc52a | |
|
|
2c5a1c3e43 | |
|
|
4b81b296da | |
|
|
5899277c28 | |
|
|
457c93d821 | |
|
|
a54f6fc8a4 | |
|
|
5527e4ba6a | |
|
|
b69d1f16e9 | |
|
|
43a3245ec0 | |
|
|
16e941df45 | |
|
|
bfdbe31287 | |
|
|
a5dbcad720 | |
|
|
2f8f7b8574 | |
|
|
c979c6fc1f | |
|
|
6299d2fa54 | |
|
|
6d9d66d1bc | |
|
|
4d64411baa | |
|
|
381b87b3d3 | |
|
|
d67d9900d2 | |
|
|
de2ad06ce1 | |
|
|
b426441d19 | |
|
|
ab1370b4da | |
|
|
c65e2ddfd9 | |
|
|
c82bfb5283 | |
|
|
82addd88a1 | |
|
|
70efa77f0c | |
|
|
123451d519 | |
|
|
16787a5987 | |
|
|
6db7476d01 | |
|
|
53189ec3c9 | |
|
|
cf3bcc19ef | |
|
|
50241ed650 | |
|
|
e3f55d4675 | |
|
|
f3887a51e0 | |
|
|
574c82ff92 | |
|
|
7c41d02d73 | |
|
|
1ec0c254c9 | |
|
|
f04be58d75 | |
|
|
88fc3d7301 | |
|
|
05f0185316 | |
|
|
9606278a08 | |
|
|
6d951d8996 | |
|
|
35ffdc51c3 | |
|
|
ff5d8abc7b | |
|
|
137120b32b | |
|
|
0d642c17b3 | |
|
|
cf5e83b661 | |
|
|
97116cd70a | |
|
|
266f1a7420 | |
|
|
6c0e3c4dd0 | |
|
|
e3050f974d | |
|
|
574ca0d845 | |
|
|
c6ac0f4a98 | |
|
|
30463e9113 | |
|
|
113a84b023 | |
|
|
428af3495a | |
|
|
5122204fe8 | |
|
|
bbb4e50f80 | |
|
|
987af70ec3 | |
|
|
9936c21594 | |
|
|
d56f171922 | |
|
|
4c00fadd0c | |
|
|
d42947ad9d | |
|
|
ca80c905d5 | |
|
|
225b2f3a24 | |
|
|
9d0a36f804 | |
|
|
1ed8d87c80 | |
|
|
a1fdb1ed31 | |
|
|
ef61378cc4 | |
|
|
7388abeee8 | |
|
|
7bf6b6bde0 | |
|
|
4ce61b09bf | |
|
|
a2801fc599 | |
|
|
2ce483f737 | |
|
|
8e6f27e158 | |
|
|
83447dc34a | |
|
|
4f306a4b19 | |
|
|
9b12911095 | |
|
|
30daa7b00c | |
|
|
6dc2dda918 | |
|
|
3982b5dd9a | |
|
|
c750f1b26e | |
|
|
986ac5bc96 | |
|
|
851cfd5599 | |
|
|
d67058a2d7 | |
|
|
63da653833 | |
|
|
ae700d51d0 | |
|
|
12c3f0be2a | |
|
|
c3dec7fec2 | |
|
|
d4feb0614c | |
|
|
cc97f13a1f | |
|
|
1e200bf8f2 | |
|
|
8045096c02 | |
|
|
b4dd83c0ec | |
|
|
84118693f7 | |
|
|
3b17e0c729 | |
|
|
e5698ae5c8 | |
|
|
0d206b0050 | |
|
|
7691eed48d | |
|
|
9a032cb840 | |
|
|
93c3a48b35 | |
|
|
d8531a429a | |
|
|
322f986170 | |
|
|
5bdf65a200 | |
|
|
7b3023c56e | |
|
|
aa593e1583 | |
|
|
987150e01d | |
|
|
8673006247 | |
|
|
ce5a07c755 | |
|
|
6ae585bb5b | |
|
|
7a7e5350fb | |
|
|
f53c9b74f4 | |
|
|
47cb86ad7c | |
|
|
4a07c4b8d3 | |
|
|
26f6534bc1 | |
|
|
f3ce9cb56f | |
|
|
f51dbdccef | |
|
|
e3037b03a0 | |
|
|
54c2216c1a | |
|
|
15bab4fe0a | |
|
|
57d4171442 | |
|
|
bb9a5ec58b | |
|
|
506c54ef5f | |
|
|
80ac027567 | |
|
|
b93b249ae6 | |
|
|
6dfe866c93 | |
|
|
6f7612780f | |
|
|
c41974784b | |
|
|
e8b3de286d | |
|
|
357b4be19d | |
|
|
cf4c55877c | |
|
|
2f11e78844 | |
|
|
e78ae3c29c | |
|
|
60eeb05560 | |
|
|
c0270f3f74 | |
|
|
7cad1a7005 | |
|
|
ac132e8256 | |
|
|
c001df36d8 | |
|
|
d216d3d0b8 | |
|
|
743cb69663 | |
|
|
77381ea173 | |
|
|
99073851b4 | |
|
|
6cf191de76 | |
|
|
49bdd12ff3 | |
|
|
b079d42fcd | |
|
|
1ab2d600de | |
|
|
4ca5dd0c51 | |
|
|
cdeb638f78 | |
|
|
1f55b9878e | |
|
|
34867e4580 | |
|
|
06825e82c1 | |
|
|
2f06bf137d | |
|
|
d887c6cf1b | |
|
|
51fe5866e3 | |
|
|
03abc0cf28 | |
|
|
5d1752e890 | |
|
|
2218278c58 | |
|
|
bd9382cf1c | |
|
|
618b62d22d | |
|
|
e8a6db6ac8 | |
|
|
70d8a56eaa | |
|
|
9c78405699 | |
|
|
2724d66a09 | |
|
|
35f94f3ac5 | |
|
|
fb850bad71 | |
|
|
2fef3cbc24 | |
|
|
4044add373 | |
|
|
1c21b04b52 | |
|
|
9786975fe1 | |
|
|
2a21d804f8 | |
|
|
dbcdb468ab | |
|
|
7d16bccea8 | |
|
|
85913c605a | |
|
|
79136717ef | |
|
|
64b4c36635 | |
|
|
8b70cf3815 | |
|
|
a41c0192f2 | |
|
|
bfa4e01372 | |
|
|
72cb98c592 | |
|
|
db6b1cfe10 | |
|
|
af7cd7d006 | |
|
|
fa41454534 | |
|
|
f459e84521 | |
|
|
6f63a0de72 | |
|
|
e6322835db | |
|
|
0e83fa62ce | |
|
|
5232236167 | |
|
|
ce1692ac66 | |
|
|
65e66013cf | |
|
|
bd0b24eb1a | |
|
|
154e139f59 | |
|
|
e7fb87c759 | |
|
|
879133b8c7 | |
|
|
93185be706 | |
|
|
d5d4fa4805 | |
|
|
ea2d703a5e | |
|
|
1b8f1ea253 | |
|
|
8acecc5f13 | |
|
|
143fa631ce | |
|
|
f4dd5ce278 | |
|
|
b24412a1b3 | |
|
|
e48ce7f4b0 | |
|
|
7a1306929b | |
|
|
6e2b1f348f | |
|
|
f61b11bc93 | |
|
|
83f86f623d | |
|
|
a3fc3246fc | |
|
|
6e7ae41dac | |
|
|
311383d2a3 | |
|
|
5dd17b1142 | |
|
|
7c6617626a | |
|
|
d815c57f12 | |
|
|
b266bb82d6 | |
|
|
e77576f085 | |
|
|
e9137d30ba | |
|
|
7b1c5fe622 | |
|
|
5ae151e360 | |
|
|
b7b21b1f35 | |
|
|
0b69e3bafa | |
|
|
ee3d983c49 | |
|
|
dcea028be3 | |
|
|
5199a829f5 | |
|
|
1354a2b7a0 | |
|
|
e6413d1efe | |
|
|
fe7c642a08 | |
|
|
3c2b288068 | |
|
|
71e5c84a1a | |
|
|
d49f0621c8 | |
|
|
f05d5cf548 | |
|
|
6faba9a9c5 | |
|
|
d6141fe73d | |
|
|
fd54700340 | |
|
|
b429ce6563 | |
|
|
618e3a7731 | |
|
|
73ba9c53e7 | |
|
|
611b59a533 | |
|
|
de64d3c4c6 | |
|
|
070a404685 | |
|
|
7f54998e61 | |
|
|
79e05c109c | |
|
|
562469eccb | |
|
|
5dc02cdd33 | |
|
|
99952b884f | |
|
|
890d0d9f50 | |
|
|
911aae3355 | |
|
|
9455497795 | |
|
|
743f799e86 | |
|
|
31ca5d313e | |
|
|
43946c05f1 | |
|
|
5838b0db3f | |
|
|
f96ae2ce8f | |
|
|
b2d3d413be | |
|
|
a78c9c2b5d | |
|
|
900122d258 | |
|
|
f6e0b6083a | |
|
|
8f3331c079 | |
|
|
0297b476eb | |
|
|
10e80dbf49 | |
|
|
f1da2939c6 | |
|
|
a3542daa9f | |
|
|
405cc2da3e | |
|
|
4cef9d6a44 | |
|
|
c28381b7bc | |
|
|
ee97b24e51 | |
|
|
fad993e486 | |
|
|
11e8f2efb9 | |
|
|
a708082d1e | |
|
|
4d7bb9184a | |
|
|
aaf956a352 | |
|
|
1bf0146cc5 | |
|
|
4a8f9b971f | |
|
|
4b97dd9521 | |
|
|
855c2e9e53 | |
|
|
f2d1fc350d | |
|
|
5e3ccaf4e7 | |
|
|
e69a54033e | |
|
|
0429fe5ab7 | |
|
|
876cdd9eed | |
|
|
1d8b646876 | |
|
|
3ea6352091 | |
|
|
bd89d8bbc9 | |
|
|
06b334e782 | |
|
|
99c4842442 | |
|
|
31da182157 | |
|
|
0f689986f2 | |
|
|
7707757ac4 | |
|
|
cd6a2275b8 | |
|
|
4d08c973fe | |
|
|
cca9296f5b | |
|
|
f6eb2f9901 | |
|
|
6f7d969ce9 | |
|
|
9d6bbe5785 | |
|
|
5dae889f13 | |
|
|
a992476be6 | |
|
|
677fb671bb | |
|
|
1213aeae77 | |
|
|
3270ae7cdd | |
|
|
10a520bf98 | |
|
|
93dd90fc47 | |
|
|
c699bc9121 | |
|
|
25803e31e0 | |
|
|
a679a68465 | |
|
|
779b92dee2 | |
|
|
06944e2357 | |
|
|
15bbfc6d2d | |
|
|
b74154e56c | |
|
|
efa8bdef79 | |
|
|
c54be832a1 | |
|
|
67f88ffe33 | |
|
|
12573eaece | |
|
|
f8c3d42a32 | |
|
|
30f049427f | |
|
|
e6a724627d | |
|
|
09a284bb10 | |
|
|
848fa33136 | |
|
|
e26876b85c | |
|
|
764f43284d | |
|
|
b756996639 | |
|
|
e18efaaacb | |
|
|
475756bd0d | |
|
|
de341e0aec | |
|
|
3c557a8dc9 | |
|
|
04f43e8f99 | |
|
|
ae195dee38 | |
|
|
4c89db1a9e | |
|
|
43c2fcffba | |
|
|
476dbff76c | |
|
|
492de55aa0 | |
|
|
d2deba6f90 | |
|
|
a5f53b2a83 | |
|
|
f62e49ac0a | |
|
|
f573afac22 | |
|
|
8117cd862e | |
|
|
fd2044696e | |
|
|
447f744647 | |
|
|
7d266a41cd | |
|
|
cb286fa3f0 | |
|
|
a36e4b7256 | |
|
|
ad1b5ca8c4 | |
|
|
de02ce787a | |
|
|
d22795991f | |
|
|
144d5f9e29 | |
|
|
d82b01f514 | |
|
|
430590814c | |
|
|
58dfa24f9c | |
|
|
553198b554 | |
|
|
24ecd3953c | |
|
|
992a07f154 | |
|
|
7c8c717699 | |
|
|
c3c262caa5 | |
|
|
3650c914be | |
|
|
94061dc01c | |
|
|
de54dfff7a | |
|
|
e866c11d46 | |
|
|
09d4401583 | |
|
|
ec3db48214 | |
|
|
75c8d48860 | |
|
|
6ebf4b4693 | |
|
|
346461a63c | |
|
|
125c068e69 | |
|
|
3c29e65c46 | |
|
|
caeeb6b924 | |
|
|
97a016361d | |
|
|
b2d98dabc9 | |
|
|
99d58df966 | |
|
|
83fd822d0e | |
|
|
759922b3db | |
|
|
7e37ef0a36 | |
|
|
e40d9bf5c0 | |
|
|
e791a3f02a | |
|
|
ceca31cb5c | |
|
|
105ce14327 | |
|
|
6a46e8dfdf | |
|
|
e1f73ed177 | |
|
|
1eacfa7e9e | |
|
|
67318f6d0f | |
|
|
f460559674 | |
|
|
5c67195157 | |
|
|
24b98366ab | |
|
|
c0a5ff23fe | |
|
|
40a1374c40 | |
|
|
8da6005d9f | |
|
|
b5b228a3da | |
|
|
40b6256204 | |
|
|
7b8c8694ff | |
|
|
f798cae717 | |
|
|
08096df571 | |
|
|
f0e01ecaf6 | |
|
|
cf9c1b5ade | |
|
|
03a11ab7df | |
|
|
123d967254 | |
|
|
729cdb8017 | |
|
|
689229801c | |
|
|
1498f93a06 | |
|
|
904a1b551c | |
|
|
06bf1c2910 | |
|
|
509de16d62 | |
|
|
17c3882691 | |
|
|
5ae14817fd | |
|
|
99c029c593 | |
|
|
e51799addd | |
|
|
b8fbf94be6 | |
|
|
a86763af9d | |
|
|
7a4abfa7e9 | |
|
|
82722dec2c | |
|
|
e40d58ae9d | |
|
|
4c8be09a72 | |
|
|
686df768bf | |
|
|
597b3e3c14 | |
|
|
c179173b74 | |
|
|
713104e353 | |
|
|
5dbed2684c | |
|
|
d81093a51a | |
|
|
05533c9475 | |
|
|
209c96bc48 | |
|
|
a7da00e34c | |
|
|
8dec06e520 | |
|
|
63e9d65b60 | |
|
|
e4264c87a0 | |
|
|
5b43d5c33b | |
|
|
d8645f34e4 | |
|
|
b5d2376beb | |
|
|
3b8e443296 | |
|
|
2e44e2b24e | |
|
|
d759a5d913 | |
|
|
1140566a51 | |
|
|
103beae4d8 | |
|
|
61db706e02 | |
|
|
edb5e65035 | |
|
|
9178cda289 | |
|
|
e21c8b451e | |
|
|
2a7ab04e08 | |
|
|
6d547cd0df | |
|
|
601f87273f | |
|
|
65ea36f889 | |
|
|
9ed4ce2cc2 | |
|
|
48ddc9ccdb | |
|
|
2b7bbdf512 | |
|
|
44d78caca1 | |
|
|
de1bb39187 | |
|
|
8e51a872ba | |
|
|
133d821023 | |
|
|
f2238aec52 | |
|
|
041ca0c542 | |
|
|
efa45f7d79 | |
|
|
ac5f3d9821 | |
|
|
4058e652a0 | |
|
|
b8e13f2b97 | |
|
|
a55a4985d9 | |
|
|
dcdc523474 | |
|
|
ee558dd5be | |
|
|
ca9d80e111 | |
|
|
03edc8ac49 | |
|
|
c50f157682 | |
|
|
bda485b970 | |
|
|
bc183b6c25 | |
|
|
3dea48610d | |
|
|
e5c3e2d999 | |
|
|
ed33e52aaa | |
|
|
2d4392bfb2 | |
|
|
294e60a961 | |
|
|
8ad3f51ce8 | |
|
|
911205db54 | |
|
|
74112e2f35 | |
|
|
abd7ef7e82 | |
|
|
20ecc7157f | |
|
|
68fdfdcd5c | |
|
|
ba1e16337d | |
|
|
7a0ca0bef4 | |
|
|
d58e359798 | |
|
|
f72c3684fe | |
|
|
9870f0f376 | |
|
|
1000c7fed5 | |
|
|
5d05da7d03 | |
|
|
c271179b43 | |
|
|
9e898e64c8 | |
|
|
ef8590c387 | |
|
|
8c97e600a1 | |
|
|
4ae505ae40 | |
|
|
9cdc4622ad | |
|
|
ef9c77e842 | |
|
|
573c97f4d9 | |
|
|
79fe1c2515 | |
|
|
6fc19138bb | |
|
|
b197668782 | |
|
|
adba40d1b5 | |
|
|
cc679fed0a | |
|
|
782e2e7e5a | |
|
|
e3e6d37fd4 | |
|
|
3268dc9fb8 | |
|
|
b6e5742188 | |
|
|
a528956dd5 | |
|
|
366118bca0 | |
|
|
f484b14bcd | |
|
|
8e6620ad2e | |
|
|
0d63456fb9 | |
|
|
9a1b5e0125 | |
|
|
5b8524936a | |
|
|
a56a63ca78 | |
|
|
bf5e152432 | |
|
|
2b915c52a2 | |
|
|
bdb9b6ea6d | |
|
|
a0a1ec3d3d | |
|
|
67dae46b22 | |
|
|
83f65cfd3d | |
|
|
40bc06fc11 | |
|
|
1d99323465 | |
|
|
de1832bdd8 | |
|
|
8d4c00c9a0 | |
|
|
ef476d06a8 | |
|
|
730b8b30ed | |
|
|
9cb2ca13cb | |
|
|
01bf425689 | |
|
|
e488744927 | |
|
|
c28437cdd0 | |
|
|
9a43dd80fe | |
|
|
9c89e97287 | |
|
|
4ea5406c48 | |
|
|
6235bb6fe0 | |
|
|
433e7d90b2 | |
|
|
41e3817454 | |
|
|
c8827c7c56 | |
|
|
f4844589c2 | |
|
|
85905bb92d | |
|
|
8707f0ee89 | |
|
|
182db3e872 | |
|
|
a9a75dc100 | |
|
|
cc455e7d9f | |
|
|
a71d14b570 | |
|
|
96dfb1d856 | |
|
|
6bb968ec5e | |
|
|
33ffe1bfb4 | |
|
|
feb40410f8 | |
|
|
24c1bfedba | |
|
|
beac1b54bb | |
|
|
456b0acd48 | |
|
|
0d3c77ef80 | |
|
|
20e6750448 | |
|
|
16137b91f0 | |
|
|
b1a6100d4f | |
|
|
f695700777 | |
|
|
7956e028a9 | |
|
|
ac7e9208cb | |
|
|
54923e2b96 | |
|
|
cb7c77df74 | |
|
|
21f91261ba | |
|
|
fbc1a5cfc2 | |
|
|
ca1ee3bef1 | |
|
|
fa4d727623 | |
|
|
5813592695 | |
|
|
15e656fb4d | |
|
|
2165e73c88 | |
|
|
2fb09332c6 | |
|
|
8a3777e0f2 | |
|
|
f3d772feb6 | |
|
|
7c4a6f1eea | |
|
|
d4ba19f707 | |
|
|
da1ec52f91 | |
|
|
57c4e62daa | |
|
|
c0b4ddb86e | |
|
|
1e6a7d7823 | |
|
|
c6fa72d11c | |
|
|
9c7436d127 | |
|
|
6163e97da7 | |
|
|
3de1f1b742 | |
|
|
e63d3f6907 | |
|
|
871080276f | |
|
|
0bbf810b12 | |
|
|
edfb37b467 | |
|
|
01ad7413e6 | |
|
|
279bfc6ac0 | |
|
|
16e28f9a37 | |
|
|
5ade6cc0bd | |
|
|
5d15dc0fae | |
|
|
5c6ecb3615 | |
|
|
c900fed456 | |
|
|
a44127858e | |
|
|
e2138020be | |
|
|
62495f0f33 | |
|
|
57a10a1a98 | |
|
|
de9f31a103 | |
|
|
0029075542 |
|
|
@ -43,6 +43,7 @@ nbdist/
|
|||
*.log
|
||||
*.xml.versionsBackup
|
||||
*.swp
|
||||
logs
|
||||
|
||||
!*/build/*.java
|
||||
!*/build/*.html
|
||||
|
|
|
|||
36
README.md
36
README.md
|
|
@ -0,0 +1,36 @@
|
|||
## 系统模块
|
||||
|
||||
~~~
|
||||
com.microservices
|
||||
├── microservices-ui // 前端框架
|
||||
├── microservices-gateway // 网关模块
|
||||
├── microservices-auth // 认证中心
|
||||
├── microservices-api // 接口模块
|
||||
│ └── microservices-api-system // 系统接口
|
||||
├── microservices-common // 通用模块
|
||||
│ └── microservices-common-async // 异步线程池配置
|
||||
│ └── microservices-common-core // 核心模块
|
||||
│ └── microservices-common-datascope // 权限范围
|
||||
│ └── microservices-common-datasource // 多数据源
|
||||
│ └── microservices-common-httpClient // http调用
|
||||
│ └── microservices-common-log // 日志记录
|
||||
│ └── microservices-common-redis // 缓存服务
|
||||
│ └── microservices-common-seata // seata分布式事务
|
||||
│ └── microservices-common-security // 安全模块
|
||||
│ └── microservices-common-swagger // 系统接口
|
||||
├── microservices-modules // 业务模块
|
||||
│ └── microservices-cms // 内容管理模块
|
||||
│ └── microservices-dms // 数据管理体系模块
|
||||
│ └── microservices-dss // 数据统计系统模块
|
||||
│ └── microservices-file // 文件服务
|
||||
│ └── microservices-gen // 代码生成
|
||||
│ └── microservices-job // 定时任务
|
||||
│ └── microservices-pms // 项目管理系统模块
|
||||
│ └── microservices-system // 系统模块
|
||||
│ └── microservices-wiki // Wiki模块
|
||||
│ └── microservices-zone // 特色专区系统模块
|
||||
├── microservices-visual // 图形化管理模块
|
||||
│ └── microservices-visual-monitor // 监控中心
|
||||
├──pom.xml // 公共依赖
|
||||
~~~
|
||||
|
||||
|
|
@ -14,6 +14,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 文件服务
|
||||
|
|
@ -34,6 +35,17 @@ public interface RemoteFileService {
|
|||
@RequestParam("hierarchy") String hierarchy,
|
||||
@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
/**
|
||||
* Base64 图片上传(HashMap 版本)
|
||||
*/
|
||||
@PostMapping(value = "/upload/base64")
|
||||
R<SysFileInfo> uploadBase64(
|
||||
@RequestBody Map<String, Object> params,
|
||||
@RequestParam("type") String type,
|
||||
@RequestParam("hierarchy") String hierarchy,
|
||||
@RequestHeader(SecurityConstants.FROM_SOURCE) String source
|
||||
);
|
||||
|
||||
/**
|
||||
* 根据文件Id列表获取文件列表
|
||||
*
|
||||
|
|
@ -108,6 +120,16 @@ public interface RemoteFileService {
|
|||
@RequestParam("hierarchy") String hierarchy,
|
||||
@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
/**
|
||||
* 通过Url下载文件到本地
|
||||
*/
|
||||
@PostMapping(value = "/common/downloadFileByUrl")
|
||||
R<String> downloadFileByUrl(
|
||||
@RequestParam("fileUrl") String fileUrl
|
||||
, @RequestParam("type") String type
|
||||
, @RequestParam("hierarchy") String hierarchy,
|
||||
@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
/**
|
||||
* 上传本地文件到Forge
|
||||
*
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
package com.microservices.system.api;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.common.core.constant.ServiceNameConstants;
|
||||
import com.microservices.system.api.factory.RemoteGatewayFallbackFactory;
|
||||
import feign.Response;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 网关
|
||||
*
|
||||
* @author microservices
|
||||
*/
|
||||
@Component
|
||||
@FeignClient(contextId = "remoteGatewayService", value = ServiceNameConstants.GATEWAY_SERVICE, fallbackFactory = RemoteGatewayFallbackFactory.class)
|
||||
public interface RemoteGatewayService {
|
||||
/**
|
||||
* 登录Sentinel
|
||||
*
|
||||
* @return 响应
|
||||
*/
|
||||
@PostMapping("/sentinel/auth/login")
|
||||
Response loginSentinel(@RequestParam("username") String username, @RequestParam("password") String password);
|
||||
|
||||
/**
|
||||
* 登录Nacos
|
||||
*
|
||||
* @return 响应
|
||||
*/
|
||||
@PostMapping(value = "/nacos/v1/auth/users/login", consumes = {"application/x-www-form-urlencoded"})
|
||||
Response loginNacos(Map<String, ?> formParams);
|
||||
|
||||
/**
|
||||
* 登录Portainer
|
||||
*
|
||||
* @return 响应
|
||||
*/
|
||||
@PostMapping("/portainer/api/auth")
|
||||
Response loginPortainer(@RequestBody JSONObject loginBody);
|
||||
}
|
||||
|
|
@ -7,9 +7,9 @@ import com.microservices.system.api.domain.SysLogininfor;
|
|||
import com.microservices.system.api.domain.SysOperLog;
|
||||
import com.microservices.system.api.factory.RemoteLogFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 日志服务
|
||||
|
|
@ -38,4 +38,20 @@ public interface RemoteLogService
|
|||
*/
|
||||
@PostMapping("/logininfor")
|
||||
public R<Boolean> saveLogininfor(@RequestBody SysLogininfor sysLogininfor, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
/**
|
||||
* 获取操作日志列表
|
||||
*
|
||||
* @param title 日志标题
|
||||
* @param operUrl 操作地址
|
||||
* @param status 操作状态
|
||||
* @param topN 获取最新N条
|
||||
* @return 操作日志列表
|
||||
*/
|
||||
@GetMapping("/operlog/latest")
|
||||
R<List<SysOperLog>> getLatestOperLogList(@RequestParam(value = "title", required = false) String title,
|
||||
@RequestParam(value = "operUrl", required = false) String operUrl,
|
||||
@RequestParam(value = "status", required = false) Integer status,
|
||||
@RequestParam(value = "topN") Integer topN,
|
||||
@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import com.microservices.common.core.constant.SecurityConstants;
|
|||
import com.microservices.common.core.constant.ServiceNameConstants;
|
||||
import com.microservices.common.core.domain.R;
|
||||
import com.microservices.system.api.domain.SysDept;
|
||||
import com.microservices.system.api.factory.RemoteCmsFallbackFactory;
|
||||
import com.microservices.system.api.factory.RemoteZoneFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
|
@ -15,7 +15,7 @@ import java.util.List;
|
|||
*
|
||||
* @author microservices
|
||||
*/
|
||||
@FeignClient(contextId = "remoteZoneService", value = ServiceNameConstants.ZONE_SERVICE, fallbackFactory = RemoteCmsFallbackFactory.class)
|
||||
@FeignClient(contextId = "remoteZoneService", value = ServiceNameConstants.ZONE_SERVICE, fallbackFactory = RemoteZoneFallbackFactory.class)
|
||||
public interface RemoteZoneService {
|
||||
/**
|
||||
* 新增组织时自动创建特色专区
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 文件服务降级处理
|
||||
|
|
@ -36,6 +37,11 @@ public class RemoteFileFallbackFactory implements FallbackFactory<RemoteFileServ
|
|||
return R.fail("上传文件失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<SysFileInfo> uploadBase64(Map<String, Object> params, String type, String hierarchy, String source) {
|
||||
return R.fail("上传base64文件失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<List<SysFileInfo>> getFileList(String fileIds) {
|
||||
return R.fail("获取文件列表失败:" + throwable.getMessage());
|
||||
|
|
@ -71,6 +77,11 @@ public class RemoteFileFallbackFactory implements FallbackFactory<RemoteFileServ
|
|||
return R.fail("打包文件失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<String> downloadFileByUrl(String fileUrl, String type, String hierarchy, String source) {
|
||||
return R.fail("通过Url下载文件到本地失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<List<String>> uploadFileToForge(String fileIdentifiers, String source) {
|
||||
return R.fail("上传本地文件到Forge失败:" + throwable.getMessage());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
package com.microservices.system.api.factory;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.system.api.RemoteGatewayService;
|
||||
import feign.Response;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 用户服务降级处理
|
||||
*
|
||||
* @author microservices
|
||||
*/
|
||||
@Component
|
||||
public class RemoteGatewayFallbackFactory implements FallbackFactory<RemoteGatewayService> {
|
||||
private static final Logger log = LoggerFactory.getLogger(RemoteGatewayFallbackFactory.class);
|
||||
|
||||
@Override
|
||||
public RemoteGatewayService create(Throwable throwable) {
|
||||
log.error("网关服务调用失败:{}", throwable.getMessage());
|
||||
return new RemoteGatewayService() {
|
||||
|
||||
@Override
|
||||
public Response loginSentinel(String password, String username) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response loginNacos(Map<String, ?> formParams) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Response loginPortainer(JSONObject loginBody) {
|
||||
System.out.println(throwable.getMessage());
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -9,6 +9,8 @@ import org.slf4j.LoggerFactory;
|
|||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 日志服务降级处理
|
||||
*
|
||||
|
|
@ -36,6 +38,12 @@ public class RemoteLogFallbackFactory implements FallbackFactory<RemoteLogServic
|
|||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<List<SysOperLog>> getLatestOperLogList(String title, String operUrl, Integer status, Integer topN, String source)
|
||||
{
|
||||
return R.fail("获取最新操作日志失败:" + throwable.getMessage());
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,62 @@
|
|||
package com.microservices.system.api.utils;
|
||||
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
public class StandardMultipartFile implements MultipartFile {
|
||||
|
||||
private final byte[] content;
|
||||
private final String name;
|
||||
private final String originalFilename;
|
||||
private final String contentType;
|
||||
|
||||
public StandardMultipartFile(byte[] content, String name, String originalFilename, String contentType) {
|
||||
this.content = content != null ? content : new byte[0];
|
||||
this.name = name;
|
||||
this.originalFilename = originalFilename;
|
||||
this.contentType = contentType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOriginalFilename() {
|
||||
return originalFilename;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getContentType() {
|
||||
return contentType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return content.length == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSize() {
|
||||
return content.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getBytes() throws IOException {
|
||||
return content;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream getInputStream() throws IOException {
|
||||
return new ByteArrayInputStream(content);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transferTo(File dest) throws IOException, IllegalStateException {
|
||||
try (FileOutputStream fos = new FileOutputStream(dest)) {
|
||||
fos.write(content);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5,3 +5,4 @@ com.microservices.system.api.factory.RemoteFileFallbackFactory
|
|||
com.microservices.system.api.factory.RemoteCmsFallbackFactory
|
||||
com.microservices.system.api.factory.RemoteZoneFallbackFactory
|
||||
com.microservices.system.api.factory.RemotePmsFallbackFactory
|
||||
com.microservices.system.api.factory.RemoteGatewayFallbackFactory
|
||||
|
|
|
|||
|
|
@ -202,20 +202,36 @@ public class CacheConstants {
|
|||
/**
|
||||
* Gitlink组织开通企业是否完成 Key前缀
|
||||
*/
|
||||
public final static String GITLINK_ORG_ID_OPEN_ENTERPRISE_KEY = "gitlink_org_id_open_enterprise_key:";
|
||||
private final static String GITLINK_ORG_ID_OPEN_ENTERPRISE_KEY = "gitlink_org_id_open_enterprise_key:";
|
||||
|
||||
public static String getGitlinkOrgIdOpenEnterpriseKey(Long gitlinkOrgId) {
|
||||
return GITLINK_ORG_ID_OPEN_ENTERPRISE_KEY + gitlinkOrgId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sentinel Token缓存Key
|
||||
*/
|
||||
public final static String SENTINEL_TOKEN = "sentinel_token";
|
||||
|
||||
|
||||
/**
|
||||
* Nacos Token缓存Key
|
||||
*/
|
||||
public static final String NACOS_TOKEN = "nacos_token";
|
||||
|
||||
/**
|
||||
* Portainer Token缓存Key
|
||||
*/
|
||||
public static final String PORTAINER_TOKEN = "portainer_token";
|
||||
|
||||
/**
|
||||
* 专区项目Gitlink信息 Key前缀
|
||||
*/
|
||||
public final static String ZONE_PROJECT_GITLINK_INFO = "zone_project_gitlink_info:";
|
||||
private final static String ZONE_PROJECT_GITLINK_INFO = "zone_project_gitlink_info:";
|
||||
/**
|
||||
* 专区下项目分数排序 Key前缀
|
||||
*/
|
||||
public final static String ZONE_PROJECT_SORT_BY_SCORE = "zone_project_sort_by_score:";
|
||||
private final static String ZONE_PROJECT_SORT_BY_SCORE = "zone_project_sort_by_score:";
|
||||
|
||||
public static String getZoneProjectGitlinkInfo(Long gitlinkProjectId) {
|
||||
return ZONE_PROJECT_GITLINK_INFO + gitlinkProjectId;
|
||||
|
|
@ -228,4 +244,20 @@ public class CacheConstants {
|
|||
public static String getAllZoneProjectSortByScore(Long zoneId) {
|
||||
return ZONE_PROJECT_SORT_BY_SCORE + "*:" + zoneId + ":*";
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件打包是否完成(0:代表未完成;1:代表已完成;-1:代表打包失败,需要重新打包)
|
||||
*/
|
||||
private final static String PACKAGE_FILE_IS_FINISH = "packageFileIsFinish:";
|
||||
|
||||
public static String getPackageFileIsFinish(String fileIdentifier) {
|
||||
return PACKAGE_FILE_IS_FINISH + fileIdentifier;
|
||||
}
|
||||
|
||||
// 全局资源数据缓存,最近一年统计数据
|
||||
public final static String GLOBAL_RESOURCES_DATA_KEY = "GLOBAL_RESOURCES_DATA:";
|
||||
|
||||
public static String getGlobalResourcesDataKey(String startDate, String endDate) {
|
||||
return GLOBAL_RESOURCES_DATA_KEY + startDate + "_TO_" + endDate;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
package com.microservices.common.core.constant;
|
||||
|
||||
/**
|
||||
* 异常信息常量
|
||||
*
|
||||
* @author otto
|
||||
*/
|
||||
public class ExceptionMsgConstants {
|
||||
/**
|
||||
* 平台通用异常
|
||||
*/
|
||||
public static final String SYSTEM_EXEC_ERROR = "请求处理异常,请联系管理员处理";
|
||||
/**
|
||||
* 重试异常
|
||||
*/
|
||||
public static final String RETRY_ERROR = "请求发生异常,请重新请求";
|
||||
}
|
||||
|
|
@ -32,4 +32,8 @@ public class ServiceNameConstants {
|
|||
* 项目管理模块的serviceid
|
||||
*/
|
||||
public static final String PMS_SERVICE = "microservices-pms";
|
||||
/**
|
||||
* 网关模块的serviceid
|
||||
*/
|
||||
public static final String GATEWAY_SERVICE = "microservices-gateway";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,15 @@ public class TokenConstants {
|
|||
* GitLink令牌标识
|
||||
*/
|
||||
public static final String GitLink_Token_Key = "autologin_trustie=";
|
||||
/**
|
||||
* Sentinel令牌标识
|
||||
*/
|
||||
public static final String Sentinel_Token_Key = "sentinel_dashboard_cookie";
|
||||
public static final String Portainer_Token_Key = "portainer_api_key";
|
||||
/**
|
||||
* Sentinel令牌标识
|
||||
*/
|
||||
public static final String Nacos_Token_Key = "Accesstoken";
|
||||
/**
|
||||
* Cookie中令牌标识
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
package com.microservices.common.core.utils;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class CookieUtil {
|
||||
|
||||
|
||||
public static HashMap<String, String> getCookieMap(String cookie) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
if (cookie != null) {
|
||||
String[] cookies = cookie.split(";");
|
||||
for (String cookieStr : cookies) {
|
||||
String[] cookieArr = cookieStr.split("=");
|
||||
String key = cookieArr[0].trim();
|
||||
String value = cookieArr[1].trim();
|
||||
map.put(key, value);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static String getCookieValue(String cookie, String key) {
|
||||
HashMap<String, String> map = getCookieMap(cookie);
|
||||
return map.get(key);
|
||||
}
|
||||
|
||||
public static String removeCookieKey(String cookie, String key) {
|
||||
HashMap<String, String> map = getCookieMap(cookie);
|
||||
map.remove(key);
|
||||
return genCookieStr(map);
|
||||
}
|
||||
|
||||
private static String genCookieStr(HashMap<String, String> cookieMap) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (String key : cookieMap.keySet()) {
|
||||
stringBuilder.append(key).append("=").append(cookieMap.get(key)).append(";");
|
||||
}
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -26,6 +26,8 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
|||
|
||||
public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
public static String YYYY_MM_DD_HH_MM = "yyyy-MM-dd HH:mm";
|
||||
|
||||
private static String[] parsePatterns = {
|
||||
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
|
||||
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
|
||||
|
|
@ -265,4 +267,9 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
|||
cal.add(Calendar.DATE, -7 * times);
|
||||
return DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, cal.getTime());
|
||||
}
|
||||
|
||||
public static long dateTimeToUnix(Date date) {
|
||||
// date.getTime() 返回当前 Date 对象表示的毫秒数,除以 1000 后得到以秒为单位的时间戳,即 10 位时间戳
|
||||
return date.getTime() / 1000;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -218,17 +218,18 @@ public class ServletUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* 内容编码(排除斜杠)
|
||||
* 内容编码(排除斜杠并且支持重复编码)
|
||||
*
|
||||
* @param str 内容
|
||||
* @return 编码后的内容
|
||||
*/
|
||||
public static String urlEncodeExcludeSlashes(String str) {
|
||||
public static String urlEncodeExcludeSlashesApplyDuplicate(String str) {
|
||||
try {
|
||||
StringBuilder stringBuffer = new StringBuilder();
|
||||
String[] strings = str.split("/");
|
||||
for (String string : strings) {
|
||||
stringBuffer.append("/").append(URLEncoder.encode(string, Constants.UTF8));
|
||||
string = URLEncoder.encode(string, Constants.UTF8);
|
||||
stringBuffer.append("/").append(string);
|
||||
}
|
||||
return stringBuffer.toString().replaceAll("\\+", "%20");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
|
|
@ -236,6 +237,22 @@ public class ServletUtils {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断字符串是否经过URLEncode
|
||||
* 1. 使用URLDecoder.decode对字符串进行解码。
|
||||
* 2. 再使用URLEncoder.encode对解码后的字符串重新编码。
|
||||
* 3. 如果重新编码后的字符串与原始字符串相同,则说明原始字符串是经过URL编码的
|
||||
*
|
||||
* @param encodedString 需encode的字符串
|
||||
* @return 是否经过URLEncode
|
||||
* @throws UnsupportedEncodingException 编码异常
|
||||
*/
|
||||
public static boolean isUrlEncoded(String encodedString) throws UnsupportedEncodingException {
|
||||
String decodedString = URLDecoder.decode(encodedString, "UTF-8");
|
||||
String reencodedString = URLEncoder.encode(decodedString, "UTF-8");
|
||||
return encodedString.equalsIgnoreCase(reencodedString);
|
||||
}
|
||||
|
||||
/**
|
||||
* 内容解码
|
||||
*
|
||||
|
|
|
|||
|
|
@ -13,17 +13,19 @@ import com.microservices.common.core.utils.reflect.ReflectUtils;
|
|||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.RegExUtils;
|
||||
import org.apache.commons.lang3.reflect.FieldUtils;
|
||||
import org.apache.poi.hssf.usermodel.*;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.ss.util.CellRangeAddressList;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
|
||||
import org.apache.poi.xssf.usermodel.XSSFDataValidation;
|
||||
import org.apache.poi.xssf.usermodel.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Field;
|
||||
|
|
@ -1458,4 +1460,288 @@ public class ExcelUtil<T>
|
|||
}
|
||||
return method;
|
||||
}
|
||||
|
||||
// 存储Excel中的图片(key: 行号_列号,value: MultipartFile)
|
||||
private final Map<String, MultipartFile> excelImageMap = new HashMap<>();
|
||||
|
||||
/**
|
||||
* 获取解析后的Excel图片映射表(行号_列号 -> MultipartFile)
|
||||
* <p>对外返回不可修改的Map,避免外部篡改,同时让静态检查识别到该集合被查询</p>
|
||||
* @return 图片映射表
|
||||
*/
|
||||
public Map<String, MultipartFile> getExcelImageMap() {
|
||||
// 返回不可修改的Map,提升代码安全性,同时让静态检查识别到集合被读取
|
||||
return Collections.unmodifiableMap(excelImageMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析Excel中的图片并转换为MultipartFile,存入{@link #excelImageMap}
|
||||
* @param sheet Excel工作表
|
||||
* @throws IOException 解析图片失败时抛出
|
||||
*/
|
||||
private void parseExcelImages(Sheet sheet) throws IOException {
|
||||
if (wb instanceof XSSFWorkbook) {
|
||||
parseXSSFImages((XSSFSheet) sheet);
|
||||
} else if (wb instanceof HSSFWorkbook) {
|
||||
parseHSSFImages((HSSFWorkbook) wb, sheet);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析XSSF格式(xlsx)图片
|
||||
*/
|
||||
private void parseXSSFImages(XSSFSheet sheet) {
|
||||
XSSFDrawing drawing = sheet.createDrawingPatriarch();
|
||||
List<XSSFShape> shapes = drawing.getShapes();
|
||||
|
||||
for (XSSFShape shape : shapes) {
|
||||
if (shape instanceof XSSFPicture) {
|
||||
XSSFPicture picture = (XSSFPicture) shape;
|
||||
XSSFPictureData pictureData = picture.getPictureData();
|
||||
XSSFClientAnchor anchor = picture.getPreferredSize();
|
||||
|
||||
// 获取图片所在单元格位置
|
||||
int row = anchor.getRow1();
|
||||
int col = anchor.getCol1();
|
||||
String cellKey = row + "_" + col;
|
||||
|
||||
// 转换为MultipartFile并存储
|
||||
MultipartFile multipartFile = bytesToMultipartFile(pictureData.getData(), "xlsx_image.png");
|
||||
excelImageMap.put(cellKey, multipartFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析HSSF格式(xls)图片
|
||||
*/
|
||||
private void parseHSSFImages(HSSFWorkbook workbook, Sheet sheet) {
|
||||
List<HSSFPictureData> pictureDataList = workbook.getAllPictures();
|
||||
|
||||
for (int i = 0; i < pictureDataList.size(); i++) {
|
||||
HSSFPictureData pictureData = pictureDataList.get(i);
|
||||
HSSFPatriarch patriarch = (HSSFPatriarch) sheet.createDrawingPatriarch();
|
||||
List<HSSFShape> shapes = patriarch.getChildren();
|
||||
|
||||
for (HSSFShape shape : shapes) {
|
||||
if (shape instanceof HSSFPicture) {
|
||||
HSSFPicture picture = (HSSFPicture) shape;
|
||||
if (picture.getPictureIndex() == i) {
|
||||
HSSFClientAnchor anchor = picture.getClientAnchor();
|
||||
int row = anchor.getRow1();
|
||||
int col = anchor.getCol1();
|
||||
String cellKey = row + "_" + col;
|
||||
|
||||
// 转换为MultipartFile并存储
|
||||
MultipartFile multipartFile = bytesToMultipartFile(pictureData.getData(), "xls_image.png");
|
||||
excelImageMap.put(cellKey, multipartFile);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义MultipartFile实现(通用版,无外部依赖)
|
||||
*/
|
||||
public static class CustomMultipartFile implements MultipartFile {
|
||||
private final byte[] content;
|
||||
private final String filename;
|
||||
private final String contentType;
|
||||
|
||||
public CustomMultipartFile(byte[] content, String filename, String contentType) {
|
||||
this.content = content;
|
||||
this.filename = filename;
|
||||
this.contentType = contentType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "file";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOriginalFilename() {
|
||||
return filename;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getContentType() {
|
||||
return contentType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return content == null || content.length == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSize() {
|
||||
return content.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getBytes() throws IOException {
|
||||
return content;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream getInputStream() throws IOException {
|
||||
return new ByteArrayInputStream(content);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void transferTo(java.io.File dest) throws IOException, IllegalStateException {
|
||||
try (java.io.OutputStream os = new java.io.FileOutputStream(dest)) {
|
||||
os.write(content);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将字节数组转换为MultipartFile(核心工具方法)
|
||||
*/
|
||||
public MultipartFile bytesToMultipartFile(byte[] bytes, String fileName) {
|
||||
try {
|
||||
String suffix = "png";
|
||||
if (fileName != null && fileName.contains(".")) {
|
||||
suffix = fileName.substring(fileName.lastIndexOf(".") + 1);
|
||||
}
|
||||
String finalFileName = UUID.randomUUID().toString() + "." + suffix;
|
||||
String contentType = "image/" + suffix;
|
||||
|
||||
return new CustomMultipartFile(bytes, finalFileName, contentType);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("转换图片为MultipartFile失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
// 导入包含图片的excel
|
||||
public List<T> importExcelWithImages(String sheetName, InputStream is, int titleNum) throws Exception {
|
||||
this.type = Type.IMPORT;
|
||||
this.wb = WorkbookFactory.create(is);
|
||||
List<T> list = new ArrayList<T>();
|
||||
|
||||
Sheet sheet = StringUtils.isNotEmpty(sheetName) ? wb.getSheet(sheetName) : wb.getSheetAt(0);
|
||||
if (sheet == null) {
|
||||
throw new IOException("文件sheet不存在");
|
||||
}
|
||||
|
||||
// 1. 解析Excel中的图片,生成imageMap(行号_列号 -> MultipartFile)
|
||||
parseExcelImages(sheet);
|
||||
|
||||
int rows = sheet.getLastRowNum();
|
||||
if (rows > 0) {
|
||||
// ========== 参考原有逻辑:构建表头列名和下标映射 ==========
|
||||
Map<String, Integer> cellMap = new HashMap<>();
|
||||
Row heard = sheet.getRow(titleNum);
|
||||
for (int i = 0; i < heard.getPhysicalNumberOfCells(); i++) {
|
||||
Cell cell = heard.getCell(i);
|
||||
if (StringUtils.isNotNull(cell)) {
|
||||
String columnName = this.getCellValue(heard, i).toString().trim();
|
||||
cellMap.put(columnName, i);
|
||||
} else {
|
||||
cellMap.put(null, i);
|
||||
}
|
||||
}
|
||||
|
||||
// ========== 参考原有逻辑:构建字段映射(通过Excel注解匹配列名) ==========
|
||||
List<Object[]> fields = this.getFields();
|
||||
Map<Integer, Object[]> fieldsMap = new HashMap<Integer, Object[]>();
|
||||
for (Object[] objects : fields) {
|
||||
Excel attr = (Excel) objects[1];
|
||||
Integer column = cellMap.get(attr.name());
|
||||
if (column != null) {
|
||||
fieldsMap.put(column, objects);
|
||||
}
|
||||
}
|
||||
|
||||
// 找到「图片」列的下标(关键:和Excel模板的列名对应)
|
||||
Integer imageColumnIndex = cellMap.get("图片");
|
||||
|
||||
// ========== 遍历数据行(参考原有逻辑) ==========
|
||||
for (int i = titleNum + 1; i <= rows; i++) {
|
||||
Row row = sheet.getRow(i);
|
||||
if (isRowEmpty(row)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
T entity = null;
|
||||
// 生成当前行的图片key:行号_图片列下标(i是数据行号,对应Excel的行)
|
||||
String imageCellKey = i + "_" + imageColumnIndex;
|
||||
|
||||
// ========== 参考原有逻辑:遍历字段映射赋值 ==========
|
||||
for (Map.Entry<Integer, Object[]> entry : fieldsMap.entrySet()) {
|
||||
Integer columnIndex = entry.getKey();
|
||||
Object val = this.getCellValue(row, columnIndex);
|
||||
|
||||
// 如果不存在实例则新建
|
||||
entity = (entity == null ? clazz.newInstance() : entity);
|
||||
|
||||
// 从map中得到对应列的field和Excel注解
|
||||
Field field = (Field) entry.getValue()[0];
|
||||
Excel attr = (Excel) entry.getValue()[1];
|
||||
|
||||
// ========== 关键修改:如果是「图片」列,替换值为图片key ==========
|
||||
if (imageColumnIndex != null && columnIndex.equals(imageColumnIndex)) {
|
||||
val = imageCellKey; // 将单元格原始值替换为图片key(如1_12)
|
||||
}
|
||||
|
||||
// ========== 原有类型转换逻辑(完全复用) ==========
|
||||
Class<?> fieldType = field.getType();
|
||||
if (String.class == fieldType) {
|
||||
String s = Convert.toStr(val);
|
||||
if (StringUtils.endsWith(s, ".0")) {
|
||||
val = StringUtils.substringBefore(s, ".0");
|
||||
} else {
|
||||
String dateFormat = field.getAnnotation(Excel.class).dateFormat();
|
||||
if (StringUtils.isNotEmpty(dateFormat)) {
|
||||
val = parseDateToStr(dateFormat, val);
|
||||
} else {
|
||||
val = Convert.toStr(val);
|
||||
}
|
||||
}
|
||||
} else if ((Integer.TYPE == fieldType || Integer.class == fieldType) && StringUtils.isNumeric(Convert.toStr(val))) {
|
||||
val = Convert.toInt(val);
|
||||
} else if ((Long.TYPE == fieldType || Long.class == fieldType) && StringUtils.isNumeric(Convert.toStr(val))) {
|
||||
val = Convert.toLong(val);
|
||||
} else if (Double.TYPE == fieldType || Double.class == fieldType) {
|
||||
val = Convert.toDouble(val);
|
||||
} else if (Float.TYPE == fieldType || Float.class == fieldType) {
|
||||
val = Convert.toFloat(val);
|
||||
} else if (BigDecimal.class == fieldType) {
|
||||
val = Convert.toBigDecimal(val);
|
||||
} else if (Date.class == fieldType) {
|
||||
if (val instanceof String) {
|
||||
val = DateUtils.parseDate(val);
|
||||
} else if (val instanceof Double) {
|
||||
val = DateUtil.getJavaDate((Double) val);
|
||||
}
|
||||
} else if (Boolean.TYPE == fieldType || Boolean.class == fieldType) {
|
||||
val = Convert.toBool(val, false);
|
||||
}
|
||||
|
||||
// ========== 原有反射赋值逻辑(完全复用) ==========
|
||||
if (StringUtils.isNotNull(fieldType)) {
|
||||
String propertyName = field.getName();
|
||||
if (StringUtils.isNotEmpty(attr.targetAttr())) {
|
||||
propertyName = field.getName() + "." + attr.targetAttr();
|
||||
} else if (StringUtils.isNotEmpty(attr.readConverterExp())) {
|
||||
val = reverseByExp(Convert.toStr(val), attr.readConverterExp(), attr.separator());
|
||||
} else if (!attr.handler().equals(ExcelHandlerAdapter.class)) {
|
||||
val = dataFormatHandlerAdapter(val, attr);
|
||||
}
|
||||
// 使用原有工具类反射赋值(核心:替换自定义setEntityFieldValue)
|
||||
ReflectUtils.invokeSetter(entity, propertyName, val);
|
||||
}
|
||||
}
|
||||
|
||||
if (entity != null) {
|
||||
list.add(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -283,6 +283,7 @@ public class HttpAPIService {
|
|||
if (length != 0L) {
|
||||
String result = EntityUtils.toString(httpEntity);
|
||||
if (!JSON.isValid(result)) {
|
||||
logger.error("平台接口响应格式异常,状态码:{},响应内容:{}", httpStatusCode, result);
|
||||
throw new ServiceException("平台接口响应格式异常");
|
||||
}
|
||||
Object resultObj = JSON.parse(result);
|
||||
|
|
|
|||
|
|
@ -1,9 +1,16 @@
|
|||
package com.microservices.common.security.feign;
|
||||
|
||||
import feign.RequestInterceptor;
|
||||
import feign.codec.Encoder;
|
||||
import feign.form.FormEncoder;
|
||||
import org.springframework.beans.factory.ObjectFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
|
||||
import org.springframework.cloud.openfeign.support.SpringEncoder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
|
||||
/**
|
||||
* Feign 配置注册
|
||||
*
|
||||
|
|
@ -12,9 +19,20 @@ import org.springframework.context.annotation.Configuration;
|
|||
@Configuration
|
||||
public class FeignAutoConfiguration
|
||||
{
|
||||
// 这里会由容器自动注入HttpMessageConverters的对象工厂
|
||||
@Autowired
|
||||
private ObjectFactory<HttpMessageConverters> messageConverters;
|
||||
@Bean
|
||||
public RequestInterceptor requestInterceptor()
|
||||
{
|
||||
return new FeignRequestInterceptor();
|
||||
}
|
||||
|
||||
// new一个form编码器,实现支持form表单提交
|
||||
// 注意这里方法名称,也就是bean的名称是什么不重要,
|
||||
// 重要的是返回类型要是 Encoder 并且实现类必须是 FormEncoder 或者其子类
|
||||
@Bean
|
||||
public Encoder feignFormEncoder() {
|
||||
return new FormEncoder(new SpringEncoder(messageConverters));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,13 +2,18 @@ package com.microservices.gateway.config;
|
|||
|
||||
import feign.codec.Decoder;
|
||||
import org.springframework.beans.factory.ObjectFactory;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
|
||||
import org.springframework.cloud.openfeign.support.ResponseEntityDecoder;
|
||||
import org.springframework.cloud.openfeign.support.SpringDecoder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author otto
|
||||
*/
|
||||
|
|
@ -25,4 +30,10 @@ public class FeignConfig {
|
|||
(new MappingJackson2HttpMessageConverter());
|
||||
return () -> httpMessageConverters;
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public HttpMessageConverters messageConverters(ObjectProvider<HttpMessageConverter<?>> converters) {
|
||||
return new HttpMessageConverters(converters.orderedStream().collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
|
|
@ -11,6 +11,8 @@ import com.microservices.common.core.utils.ServletUtils;
|
|||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.common.redis.service.RedisService;
|
||||
import com.microservices.gateway.config.properties.IgnoreWhiteProperties;
|
||||
import com.microservices.gateway.service.ThirdPartyToolService;
|
||||
import com.microservices.gateway.utils.CustomExecutorFactory;
|
||||
import com.microservices.system.api.RemoteUserService;
|
||||
import com.microservices.system.api.domain.SysUserDeptRole;
|
||||
import com.microservices.system.api.utils.FeignUtils;
|
||||
|
|
@ -28,9 +30,8 @@ import org.springframework.web.server.ServerWebExchange;
|
|||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
/**
|
||||
* 网关鉴权
|
||||
|
|
@ -51,7 +52,12 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
|||
@Autowired
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
ExecutorService executorService = Executors.newFixedThreadPool(1);
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ThirdPartyToolService thirdPartyToolService;
|
||||
|
||||
ThreadPoolExecutor threadPoolExecutor = CustomExecutorFactory.threadPoolExecutor;
|
||||
|
||||
|
||||
@Override
|
||||
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
|
||||
|
|
@ -75,12 +81,16 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
|||
}
|
||||
|
||||
if (StringUtils.isEmpty(token)) {
|
||||
if (StringUtils.isNotEmpty(gitLinkCookie)) {
|
||||
return unauthorizedResponse(exchange, "令牌已过期或验证不正确!");
|
||||
}
|
||||
return unauthorizedResponse(exchange, "令牌不能为空");
|
||||
}
|
||||
Claims claims;
|
||||
try {
|
||||
claims = JwtUtils.parseToken(token);
|
||||
} catch (Exception e) {
|
||||
log.error("令牌解析失败:{}", e.getMessage());
|
||||
return unauthorizedResponse(exchange, "令牌格式不正确!");
|
||||
}
|
||||
if (claims == null) {
|
||||
|
|
@ -105,6 +115,11 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
|||
ServletUtils.addHeader(mutate, SecurityConstants.DETAILS_USERNAME, username);
|
||||
// 内部请求来源参数清除
|
||||
ServletUtils.removeHeader(mutate, SecurityConstants.FROM_SOURCE);
|
||||
|
||||
Mono<Void> thirdPartyRes = thirdPartyToolService.handleRequestForThirdPartyTools(exchange, request, mutate);
|
||||
if (thirdPartyRes != null) {
|
||||
return thirdPartyRes;
|
||||
}
|
||||
return chain.filter(exchange.mutate().request(mutate.build()).build());
|
||||
}
|
||||
|
||||
|
|
@ -116,7 +131,7 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
|||
boolean hasUserIdentifyList = redisService.hasKey(redisKey);
|
||||
if (!hasUserIdentifyList) {
|
||||
// 网关采用异步架构,所以此处需要通过异步请求获取本系统Token
|
||||
Future<R<List<SysUserDeptRole>>> future = executorService.submit(
|
||||
Future<R<List<SysUserDeptRole>>> future = threadPoolExecutor.submit(
|
||||
() -> remoteUserService.getSysUserDeptRoleListByUserName(username, SecurityConstants.INNER));
|
||||
try {
|
||||
List<SysUserDeptRole> feignResult = FeignUtils.getReturnData(
|
||||
|
|
@ -130,7 +145,7 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
|||
}
|
||||
|
||||
private String genCookieByToken(String token) {
|
||||
return String.format("%s%s;",TokenConstants.GitLink_Token_Key, token);
|
||||
return String.format("%s%s;", TokenConstants.GitLink_Token_Key, token);
|
||||
}
|
||||
|
||||
private String getGitLinkRequestCookie(ServerHttpRequest request) {
|
||||
|
|
@ -141,7 +156,7 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
|||
String token = request.getHeaders().getFirst(TokenConstants.AUTHENTICATION);
|
||||
if (token != null) {
|
||||
// 网关采用异步架构,所以此处需要通过异步请求获取本系统Token
|
||||
Future<R<Boolean>> future = executorService.submit(
|
||||
Future<R<Boolean>> future = threadPoolExecutor.submit(
|
||||
() -> remoteUserService.checkGitLinkUserLogin(token, SecurityConstants.INNER));
|
||||
try {
|
||||
Boolean feignResult = FeignUtils.getReturnData(
|
||||
|
|
@ -194,7 +209,7 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
|||
private String getGitLinkToken(String cookie) {
|
||||
if (StringUtils.isNotEmpty(cookie)) {
|
||||
// 网关采用异步架构,所以此处需要通过异步请求获取本系统Token
|
||||
Future<R<String>> future = executorService.submit(() -> remoteUserService
|
||||
Future<R<String>> future = threadPoolExecutor.submit(() -> remoteUserService
|
||||
.getSysUserTokenByGitLinkCookie(cookie, SecurityConstants.INNER));
|
||||
R<String> feignResult;
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,218 @@
|
|||
package com.microservices.gateway.filter;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.common.core.constant.CacheConstants;
|
||||
import com.microservices.common.core.constant.ExceptionMsgConstants;
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.redis.service.RedisService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.reactivestreams.Publisher;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
|
||||
import org.springframework.cloud.gateway.filter.GlobalFilter;
|
||||
import org.springframework.cloud.gateway.filter.NettyWriteResponseFilter;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.io.buffer.DataBuffer;
|
||||
import org.springframework.core.io.buffer.DataBufferFactory;
|
||||
import org.springframework.core.io.buffer.DataBufferUtils;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest;
|
||||
import org.springframework.http.server.reactive.ServerHttpResponse;
|
||||
import org.springframework.http.server.reactive.ServerHttpResponseDecorator;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class GlobalResponseFilter implements GlobalFilter, Ordered {
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Override
|
||||
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
|
||||
ServerHttpRequest request = exchange.getRequest();
|
||||
|
||||
String lowerUrl = request.getURI().getPath().toLowerCase();
|
||||
ServerHttpResponse originalResponse = exchange.getResponse();
|
||||
DataBufferFactory bufferFactory = originalResponse.bufferFactory();
|
||||
// 当请求为Nacos时,Nacos返回的所有非JSON响应都会被自动转换为结构化的错误信息,同时将HTTP状态码设置为200,适合用于规范化微服务架构的响应格式。
|
||||
if (lowerUrl.startsWith("/nacos")) {
|
||||
|
||||
ServerHttpResponseDecorator decoratedResponse = new ServerHttpResponseDecorator(originalResponse) {
|
||||
@Override
|
||||
public Mono<Void> writeWith(Publisher<? extends DataBuffer> body) {
|
||||
HttpStatus status = getStatusCode() != null ? getStatusCode() : HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
if (!status.isError()) {
|
||||
return super.writeWith(body);
|
||||
}
|
||||
if (status == HttpStatus.FORBIDDEN) {
|
||||
log.error("nacos鉴权异常,已清理redis中nacos token");
|
||||
// 设置新的状态码为 200
|
||||
setStatusCode(HttpStatus.OK);
|
||||
// 设置响应内容类型为 JSON
|
||||
getHeaders().setContentType(MediaType.APPLICATION_JSON);
|
||||
// 清理Sentinel失效token
|
||||
redisService.deleteObject(CacheConstants.NACOS_TOKEN);
|
||||
// 创建自定义的 JSON 响应内容
|
||||
String jsonBody = JSON.toJSONString(AjaxResult.error(ExceptionMsgConstants.RETRY_ERROR));
|
||||
byte[] bytes = jsonBody.getBytes(StandardCharsets.UTF_8);
|
||||
getHeaders().setContentLength(bytes.length);
|
||||
DataBuffer dataBuffer = bufferFactory.wrap(bytes);
|
||||
// 返回新的响应内容
|
||||
return super.writeWith(Mono.just(dataBuffer));
|
||||
}
|
||||
|
||||
return Flux.from(body).<String>handle((dataBuffer, synchronousSink) -> {
|
||||
if (status.isError()) {
|
||||
byte[] bytes = new byte[dataBuffer.readableByteCount()];
|
||||
dataBuffer.read(bytes);
|
||||
//释放掉内存
|
||||
DataBufferUtils.release(dataBuffer);
|
||||
String result = new String(bytes, StandardCharsets.UTF_8);
|
||||
synchronousSink.next(result);
|
||||
return;
|
||||
}
|
||||
synchronousSink.complete();
|
||||
|
||||
}).flatMap(resStr -> {
|
||||
// 保留原始状态码
|
||||
originalResponse.setStatusCode(HttpStatus.OK);
|
||||
String errMsg;
|
||||
if (!JSON.isValid(resStr)) {
|
||||
errMsg = resStr;
|
||||
} else {
|
||||
JSONObject resJson = JSONObject.parseObject(resStr);
|
||||
if (resJson.containsKey("message")) {
|
||||
errMsg = resJson.getString("message");
|
||||
} else {
|
||||
errMsg = ExceptionMsgConstants.SYSTEM_EXEC_ERROR;
|
||||
}
|
||||
}
|
||||
byte[] bytes = JSON.toJSONBytes(AjaxResult.error(errMsg));
|
||||
getHeaders().setContentLength(bytes.length);
|
||||
DataBuffer buffer = bufferFactory.wrap(bytes);
|
||||
return super.writeWith(Mono.just(buffer));
|
||||
}).then();
|
||||
}
|
||||
};
|
||||
|
||||
return chain.filter(exchange.mutate().response(decoratedResponse).build());
|
||||
}
|
||||
if (lowerUrl.startsWith("/portainer")) {
|
||||
ServerHttpResponseDecorator decoratedResponse = new ServerHttpResponseDecorator(originalResponse) {
|
||||
@Override
|
||||
public Mono<Void> writeWith(Publisher<? extends DataBuffer> body) {
|
||||
HttpStatus status = getStatusCode() != null ? getStatusCode() : HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
if (!status.isError()) {
|
||||
return super.writeWith(body);
|
||||
}
|
||||
|
||||
return Flux.from(body).<String>handle((dataBuffer, synchronousSink) -> {
|
||||
if (status.isError()) {
|
||||
byte[] bytes = new byte[dataBuffer.readableByteCount()];
|
||||
dataBuffer.read(bytes);
|
||||
//释放掉内存
|
||||
DataBufferUtils.release(dataBuffer);
|
||||
String result = new String(bytes, StandardCharsets.UTF_8);
|
||||
synchronousSink.next(result);
|
||||
}
|
||||
synchronousSink.complete();
|
||||
}).flatMap(resStr -> {
|
||||
log.error("Portainer响应处理异常,异常信息:{}", resStr);
|
||||
originalResponse.setStatusCode(HttpStatus.OK);
|
||||
byte[] bytes;
|
||||
if (JSON.isValid(resStr)) {
|
||||
JSONObject resJson = JSONObject.parseObject(resStr);
|
||||
if (resJson.containsKey("message")) {
|
||||
String message = resJson.getString("message");
|
||||
if (StringUtils.isNotBlank(message) && message.contains("A valid authorisation token is missing")) {
|
||||
log.error("Portainer鉴权异常,已清理redis中Portainer token");
|
||||
//token失效清除redis缓存
|
||||
redisService.deleteObject(CacheConstants.PORTAINER_TOKEN);
|
||||
bytes = JSON.toJSONBytes(AjaxResult.error(ExceptionMsgConstants.RETRY_ERROR));
|
||||
} else {
|
||||
bytes = JSON.toJSONBytes(AjaxResult.error(message));
|
||||
}
|
||||
} else {
|
||||
bytes = JSON.toJSONBytes(AjaxResult.error(ExceptionMsgConstants.SYSTEM_EXEC_ERROR));
|
||||
}
|
||||
} else {
|
||||
bytes = JSON.toJSONBytes(AjaxResult.error(ExceptionMsgConstants.SYSTEM_EXEC_ERROR));
|
||||
}
|
||||
getHeaders().setContentLength(bytes.length);
|
||||
DataBuffer buffer = bufferFactory.wrap(bytes);
|
||||
return super.writeWith(Mono.just(buffer));
|
||||
}).then();
|
||||
}
|
||||
};
|
||||
|
||||
return chain.filter(exchange.mutate().response(decoratedResponse).build());
|
||||
}
|
||||
if (lowerUrl.startsWith("/sentinel")) {
|
||||
|
||||
ServerHttpResponseDecorator decoratedResponse = new ServerHttpResponseDecorator(originalResponse) {
|
||||
@Override
|
||||
public Mono<Void> writeWith(Publisher<? extends DataBuffer> body) {
|
||||
HttpStatus status = getStatusCode() != null ? getStatusCode() : HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
if (!status.isError()) {
|
||||
return super.writeWith(body);
|
||||
}
|
||||
if (status == HttpStatus.UNAUTHORIZED) {
|
||||
log.error("sentinel鉴权异常,已清理redis中sentinel token");
|
||||
// 设置新的状态码为 200
|
||||
setStatusCode(HttpStatus.OK);
|
||||
// 设置响应内容类型为 JSON
|
||||
getHeaders().setContentType(MediaType.APPLICATION_JSON);
|
||||
// 清理Sentinel失效token
|
||||
redisService.deleteObject(CacheConstants.SENTINEL_TOKEN);
|
||||
// 创建自定义的 JSON 响应内容
|
||||
String jsonBody = JSON.toJSONString(AjaxResult.error(ExceptionMsgConstants.RETRY_ERROR));
|
||||
byte[] bytes = jsonBody.getBytes(StandardCharsets.UTF_8);
|
||||
getHeaders().setContentLength(bytes.length);
|
||||
DataBuffer dataBuffer = bufferFactory.wrap(bytes);
|
||||
// 返回新的响应内容
|
||||
return super.writeWith(Mono.just(dataBuffer));
|
||||
}
|
||||
|
||||
return Flux.from(body).<String>handle((dataBuffer, synchronousSink) -> {
|
||||
if (status.isError()) {
|
||||
byte[] bytes = new byte[dataBuffer.readableByteCount()];
|
||||
dataBuffer.read(bytes);
|
||||
//释放掉内存
|
||||
DataBufferUtils.release(dataBuffer);
|
||||
String result = new String(bytes, StandardCharsets.UTF_8);
|
||||
synchronousSink.next(result);
|
||||
}
|
||||
synchronousSink.complete();
|
||||
}).flatMap(resStr -> {
|
||||
log.error("Sentinel响应处理异常,异常信息:{}", resStr);
|
||||
byte[] bytes;
|
||||
bytes = JSON.toJSONBytes(AjaxResult.error(ExceptionMsgConstants.SYSTEM_EXEC_ERROR));
|
||||
setStatusCode(HttpStatus.OK);
|
||||
|
||||
getHeaders().setContentLength(bytes.length);
|
||||
DataBuffer buffer = bufferFactory.wrap(bytes);
|
||||
return super.writeWith(Mono.just(buffer));
|
||||
}).then();
|
||||
}
|
||||
};
|
||||
|
||||
return chain.filter(exchange.mutate().response(decoratedResponse).build());
|
||||
}
|
||||
return chain.filter(exchange);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
//WRITE_RESPONSE_FILTER 之前执行
|
||||
return NettyWriteResponseFilter.WRITE_RESPONSE_FILTER_ORDER - 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.microservices.gateway.handler;
|
||||
|
||||
import com.microservices.common.core.exception.ServiceException;
|
||||
import com.microservices.common.core.utils.ServletUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
@ -19,33 +20,27 @@ import reactor.core.publisher.Mono;
|
|||
*/
|
||||
@Order(-1)
|
||||
@Configuration
|
||||
public class GatewayExceptionHandler implements ErrorWebExceptionHandler
|
||||
{
|
||||
public class GatewayExceptionHandler implements ErrorWebExceptionHandler {
|
||||
private static final Logger log = LoggerFactory.getLogger(GatewayExceptionHandler.class);
|
||||
|
||||
@Override
|
||||
public Mono<Void> handle(ServerWebExchange exchange, Throwable ex)
|
||||
{
|
||||
public Mono<Void> handle(ServerWebExchange exchange, Throwable ex) {
|
||||
ServerHttpResponse response = exchange.getResponse();
|
||||
|
||||
if (exchange.getResponse().isCommitted())
|
||||
{
|
||||
if (exchange.getResponse().isCommitted()) {
|
||||
return Mono.error(ex);
|
||||
}
|
||||
|
||||
String msg;
|
||||
|
||||
if (ex instanceof NotFoundException)
|
||||
{
|
||||
if (ex instanceof NotFoundException) {
|
||||
msg = "服务未找到";
|
||||
}
|
||||
else if (ex instanceof ResponseStatusException)
|
||||
{
|
||||
} else if (ex instanceof ServiceException) {
|
||||
msg = ex.getMessage();
|
||||
} else if (ex instanceof ResponseStatusException) {
|
||||
ResponseStatusException responseStatusException = (ResponseStatusException) ex;
|
||||
msg = responseStatusException.getMessage();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
msg = "内部服务器错误";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
package com.microservices.gateway.service;
|
||||
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
/**
|
||||
* 第三方工具服务类
|
||||
*
|
||||
* @author OTTO
|
||||
*/
|
||||
public interface ThirdPartyToolService {
|
||||
|
||||
/**
|
||||
* 处理第三方工具请求
|
||||
*
|
||||
* @param exchange
|
||||
* @param request 请求
|
||||
* @param mutate 请求头获取器
|
||||
*/
|
||||
Mono<Void> handleRequestForThirdPartyTools(ServerWebExchange exchange, ServerHttpRequest request, ServerHttpRequest.Builder mutate);
|
||||
}
|
||||
|
|
@ -0,0 +1,232 @@
|
|||
package com.microservices.gateway.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.common.core.constant.CacheConstants;
|
||||
import com.microservices.common.core.constant.ExceptionMsgConstants;
|
||||
import com.microservices.common.core.constant.TokenConstants;
|
||||
import com.microservices.common.core.exception.ServiceException;
|
||||
import com.microservices.common.core.utils.CookieUtil;
|
||||
import com.microservices.common.core.utils.ServletUtils;
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.common.redis.service.RedisService;
|
||||
import com.microservices.gateway.service.ThirdPartyToolService;
|
||||
import com.microservices.gateway.utils.CustomExecutorFactory;
|
||||
import com.microservices.system.api.RemoteGatewayService;
|
||||
import feign.Response;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @author OTTO
|
||||
*/
|
||||
@Service
|
||||
public class ThirdPartyToolServiceImpl implements ThirdPartyToolService {
|
||||
private static final Logger log = LoggerFactory.getLogger(ThirdPartyToolServiceImpl.class);
|
||||
@Value("${thirdPartyTools.nacos.auth.username:}")
|
||||
public String nacosUsername;
|
||||
@Value("${thirdPartyTools.nacos.auth.password:}")
|
||||
public String nacosPassword;
|
||||
@Value("${thirdPartyTools.sentinel.auth.username:}")
|
||||
public String sentinelUsername;
|
||||
@Value("${thirdPartyTools.sentinel.auth.password:}")
|
||||
public String sentinelPassword;
|
||||
@Value("${thirdPartyTools.portainer.auth.username:}")
|
||||
public String portainerUsername;
|
||||
@Value("${thirdPartyTools.portainer.auth.password:}")
|
||||
public String portainerPassword;
|
||||
@Value("${thirdPartyTools.portainer.endpoints:}")
|
||||
public Integer portainerEndpoints;
|
||||
ThreadPoolExecutor threadPoolExecutor = CustomExecutorFactory.threadPoolExecutor;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private RemoteGatewayService remoteGatewayService;
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
/**
|
||||
* 处理第三方工具请求
|
||||
*/
|
||||
@Override
|
||||
public Mono<Void> handleRequestForThirdPartyTools(ServerWebExchange exchange, ServerHttpRequest request, ServerHttpRequest.Builder mutate) {
|
||||
String url = request.getURI().getPath();
|
||||
String lowerUrl = url.toLowerCase();
|
||||
if (StringUtils.isEmpty(lowerUrl)) {
|
||||
return null;
|
||||
}
|
||||
// 处理Sentinel请求
|
||||
if (lowerUrl.startsWith("/sentinel")) {
|
||||
// 检查Cookie中是否携带sentinel cookie
|
||||
String cookie = request.getHeaders().getFirst(TokenConstants.Cookie);
|
||||
if (StringUtils.isNotEmpty(CookieUtil.getCookieValue(cookie, TokenConstants.Sentinel_Token_Key))) {
|
||||
cookie = CookieUtil.removeCookieKey(cookie, TokenConstants.Sentinel_Token_Key);
|
||||
}
|
||||
String sentinelCookie = null;
|
||||
if (redisService.hasKey(CacheConstants.SENTINEL_TOKEN)) {
|
||||
sentinelCookie = redisService.getCacheObject(CacheConstants.SENTINEL_TOKEN);
|
||||
} else {
|
||||
// 网关采用异步架构,所以此处需要通过异步请求获取Sentinel Token
|
||||
Future<Response> future = threadPoolExecutor.submit(() -> remoteGatewayService.loginSentinel(sentinelUsername, sentinelPassword));
|
||||
try {
|
||||
Response response = future.get(1, TimeUnit.SECONDS);
|
||||
Map<String, Collection<String>> header = response.headers();
|
||||
if (header != null && header.containsKey("set-cookie")) {
|
||||
sentinelCookie = header.get("set-cookie").iterator().next();
|
||||
//Sentinel登录状态默认30分钟失效,将Sentinel Token缓存过期时间调整为28分钟
|
||||
redisService.setCacheObject(CacheConstants.SENTINEL_TOKEN, sentinelCookie, 28L, TimeUnit.MINUTES);
|
||||
}
|
||||
} catch (TimeoutException e) {
|
||||
log.error("获取Sentinel Token超时");
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
log.error("获取Sentinel Token失败:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sentinelCookie)) {
|
||||
ServletUtils.removeHeader(mutate, TokenConstants.Cookie);
|
||||
mutate.header(TokenConstants.Cookie, String.format("%s;%s;", cookie, sentinelCookie));
|
||||
} else {
|
||||
throw new ServiceException("Sentinel服务获取Token失败");
|
||||
}
|
||||
}
|
||||
// 处理Nacos请求
|
||||
if (lowerUrl.startsWith("/nacos")) {
|
||||
String nacosToken = null;
|
||||
if (redisService.hasKey(CacheConstants.NACOS_TOKEN)) {
|
||||
nacosToken = redisService.getCacheObject(CacheConstants.NACOS_TOKEN);
|
||||
} else {
|
||||
Map<String, String> nacosMap = new HashMap<>();
|
||||
nacosMap.put("username", nacosUsername);
|
||||
nacosMap.put("password", nacosPassword);
|
||||
// 网关采用异步架构,所以此处需要通过异步请求获取Nacos Token
|
||||
Future<Response> future = threadPoolExecutor.submit(() -> remoteGatewayService.loginNacos(nacosMap));
|
||||
try {
|
||||
Response res = future.get(1, TimeUnit.SECONDS);
|
||||
StringWriter writer = new StringWriter();
|
||||
IOUtils.copy(res.body().asInputStream(), writer, StandardCharsets.UTF_8.name());
|
||||
String str = writer.toString();
|
||||
if (!JSON.isValid(str)) {
|
||||
return exceptionResponse(exchange, str, res.status());
|
||||
}
|
||||
JSONObject resJsonObject = JSONObject.parseObject(str);
|
||||
if (resJsonObject == null) {
|
||||
return exceptionResponse(exchange, str, res.status());
|
||||
}
|
||||
nacosToken = resJsonObject.getString("accessToken");
|
||||
Long tokenTtl = resJsonObject.getLong("tokenTtl");
|
||||
if (nacosToken != null && tokenTtl != null) {
|
||||
redisService.setCacheObject(CacheConstants.NACOS_TOKEN, nacosToken, tokenTtl - 10, TimeUnit.SECONDS);
|
||||
}
|
||||
} catch (TimeoutException e) {
|
||||
log.error("获取Nacos Token超时");
|
||||
} catch (InterruptedException | ExecutionException | IOException | NullPointerException e) {
|
||||
log.error("获取Nacos Token失败:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(nacosToken)) {
|
||||
mutate.header(TokenConstants.Nacos_Token_Key, nacosToken);
|
||||
} else {
|
||||
throw new ServiceException("Nacos服务获取Token失败");
|
||||
}
|
||||
}
|
||||
|
||||
// 处理portainer请求
|
||||
if (lowerUrl.startsWith("/portainer")) {
|
||||
// 处理portainer指定endpoints的问题
|
||||
if (lowerUrl.startsWith("/portainer/api/endpoints/")) {
|
||||
String regex = "^/portainer/api/endpoints/\\d+(/?.*)";
|
||||
if (Pattern.matches(regex, lowerUrl)) {
|
||||
// 替换掉endpoints
|
||||
regex = "(^/portainer/api/endpoints/)(\\d+)(/?.*)";
|
||||
Pattern pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
|
||||
Matcher matcher = pattern.matcher(url);
|
||||
if (matcher.find()) {
|
||||
// 替换数字部分
|
||||
url = matcher.replaceAll(matcher.group(1) + portainerEndpoints + matcher.group(3));
|
||||
try {
|
||||
mutate.uri(new URI(url));
|
||||
} catch (URISyntaxException e) {
|
||||
log.error("替换Portainer请求中Endpoints时发生异常:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String portainerToken = null;
|
||||
String cookie = request.getHeaders().getFirst(TokenConstants.Cookie);
|
||||
if (StringUtils.isNotEmpty(CookieUtil.getCookieValue(cookie, TokenConstants.Portainer_Token_Key))) {
|
||||
cookie = CookieUtil.removeCookieKey(cookie, TokenConstants.Portainer_Token_Key);
|
||||
}
|
||||
|
||||
if (redisService.hasKey(CacheConstants.PORTAINER_TOKEN)) {
|
||||
portainerToken = redisService.getCacheObject(CacheConstants.PORTAINER_TOKEN);
|
||||
} else {
|
||||
// 网关采用异步架构,所以此处需要通过异步请求获取Portainer Token
|
||||
JSONObject loginPortainerBody = new JSONObject();
|
||||
loginPortainerBody.put("username", portainerUsername);
|
||||
loginPortainerBody.put("password", portainerPassword);
|
||||
Future<Response> future = threadPoolExecutor.submit(() -> remoteGatewayService.loginPortainer(loginPortainerBody));
|
||||
try {
|
||||
Response res = future.get(1, TimeUnit.SECONDS);
|
||||
StringWriter writer = new StringWriter();
|
||||
IOUtils.copy(res.body().asInputStream(), writer, StandardCharsets.UTF_8.name());
|
||||
String str = writer.toString();
|
||||
if (!JSON.isValid(str)) {
|
||||
return exceptionResponse(exchange, str, res.status());
|
||||
}
|
||||
JSONObject resJsonObject = JSONObject.parseObject(str);
|
||||
portainerToken = resJsonObject.getString("jwt");
|
||||
if (portainerToken == null) {
|
||||
return exceptionResponse(exchange, str, res.status());
|
||||
}
|
||||
String[] tokenSplit = portainerToken.split("\\.");
|
||||
String tokenBodyStr = new String(Base64.getDecoder().decode(tokenSplit[1]), StandardCharsets.UTF_8);
|
||||
JSONObject tokenBody = JSONObject.parseObject(tokenBodyStr);
|
||||
Long expiration = tokenBody.getLong("exp");
|
||||
Long now = new Date().getTime() / 1000;
|
||||
|
||||
long portainerTokenTtl = expiration - now;
|
||||
if (portainerTokenTtl > 20) {
|
||||
redisService.setCacheObject(CacheConstants.PORTAINER_TOKEN, portainerToken, portainerTokenTtl - 10, TimeUnit.SECONDS);
|
||||
}
|
||||
} catch (TimeoutException e) {
|
||||
log.error("获取Portainer Token超时");
|
||||
} catch (InterruptedException | ExecutionException | IOException | NullPointerException e) {
|
||||
log.error("获取Portainer Token失败:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(portainerToken)) {
|
||||
ServletUtils.removeHeader(mutate, TokenConstants.Cookie);
|
||||
ServletUtils.removeHeader(mutate, TokenConstants.AUTHENTICATION);
|
||||
mutate.header(TokenConstants.AUTHENTICATION, TokenConstants.PREFIX + portainerToken);
|
||||
mutate.header(TokenConstants.Cookie, String.format("%s;%s;", cookie, portainerToken));
|
||||
} else {
|
||||
throw new ServiceException("Portainer服务获取Token失败");
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private Mono<Void> exceptionResponse(ServerWebExchange exchange, String msg, int code) {
|
||||
log.error("[第三方工具请求处理异常]请求路径:{},异常信息:{}", exchange.getRequest().getPath(), msg);
|
||||
return ServletUtils.webFluxResponseWriter(exchange.getResponse(), ExceptionMsgConstants.SYSTEM_EXEC_ERROR, code);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.microservices.gateway.utils;
|
||||
|
||||
import com.microservices.common.core.exception.ServiceException;
|
||||
import com.microservices.common.core.threadPool.ThreadPoolExecutorWrap;
|
||||
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @author OTTO
|
||||
*/
|
||||
public class CustomExecutorFactory {
|
||||
/**
|
||||
* 创建线程池
|
||||
* 存在并发处理的情况,设置核心线程为2,设置有界队列长度为100,最大线程数为10
|
||||
* 当超出队列已满且达到最大线程数时抛出异常
|
||||
* Ncpu=CPU数量
|
||||
* Ucpu=目标CPU的使用率,0<=Ucpu<=1
|
||||
* W/C=任务等待时间与任务计算时间的比率
|
||||
* Nthreads =Ncpu*Ucpu*(1+W/C)
|
||||
*/
|
||||
public static ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutorWrap(
|
||||
4
|
||||
, 10
|
||||
, 10
|
||||
, TimeUnit.SECONDS
|
||||
, new ArrayBlockingQueue<>(100)
|
||||
, Executors.defaultThreadFactory()
|
||||
, (r, executor) -> {
|
||||
throw new ServiceException("目前处理的人太多了,请稍后再试");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
@ -186,6 +186,8 @@ public class CmsDoc extends BaseSortEntity {
|
|||
HotCmsDocDto hotCmsDocDto = new HotCmsDocDto();
|
||||
hotCmsDocDto.setId(id);
|
||||
hotCmsDocDto.setName(name);
|
||||
hotCmsDocDto.setSummary(summary);
|
||||
hotCmsDocDto.setPublishTime(publishTime);
|
||||
return hotCmsDocDto;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,13 @@
|
|||
package com.microservices.cms.doc.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.microservices.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author otto
|
||||
*/
|
||||
|
|
@ -23,4 +26,11 @@ public class HotCmsDocDto {
|
|||
@Excel(name = "文章名称")
|
||||
@ApiModelProperty("文章名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("文章概要")
|
||||
private String summary;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty("发布时间")
|
||||
private Date publishTime;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,156 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-modules</artifactId>
|
||||
<version>3.6.2</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>microservices-modules-dms</artifactId>
|
||||
|
||||
<description>
|
||||
microservices-modules-dms数据管理体系模块
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Microservices Common Async -->
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-async</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Microservices Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Microservices Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Microservices Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Microservices Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-swagger</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<!-- 处理访问Gitlink相关接口 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.14</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.microservices</groupId>
|
||||
<artifactId>microservices-common-httpClient</artifactId>
|
||||
<version>3.6.2</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.coobird</groupId>
|
||||
<artifactId>thumbnailator</artifactId>
|
||||
<version>0.4.8</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.shibing624</groupId>
|
||||
<artifactId>similarity</artifactId>
|
||||
<version>1.1.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.hankcs</groupId>
|
||||
<artifactId>hanlp</artifactId>
|
||||
<version>portable-1.8.4</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.microservices.dms;
|
||||
|
||||
import com.microservices.common.security.annotation.EnableCustomConfig;
|
||||
import com.microservices.common.security.annotation.EnableRyFeignClients;
|
||||
import com.microservices.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* 项目管理模块
|
||||
*
|
||||
* @author otto
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableRyFeignClients
|
||||
@SpringBootApplication
|
||||
@EnableScheduling
|
||||
public class MicroservicesDmsApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(MicroservicesDmsApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 数据管理体系模块启动成功 ლ(´ڡ`ლ)゙ \n");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,125 @@
|
|||
package com.microservices.dms.achievementLibrary.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.system.api.domain.SysDictData;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.common.security.annotation.RequiresPermissions;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchievementDictData;
|
||||
import com.microservices.dms.achievementLibrary.service.IAchievementDictDataService;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.utils.poi.ExcelUtil;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 成果相关字典Controller
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-05-23
|
||||
*/
|
||||
@Api(tags = "数据管理体系-成果字典管理")
|
||||
@RestController
|
||||
@RequestMapping("/achDict")
|
||||
public class AchievementDictDataController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IAchievementDictDataService achievementDictDataService;
|
||||
|
||||
/**
|
||||
* 查询成果相关字典列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AchievementDictData achievementDictData)
|
||||
{
|
||||
startPage();
|
||||
List<AchievementDictData> list = achievementDictDataService.selectAchievementDictDataList(achievementDictData);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出成果相关字典列表
|
||||
*/
|
||||
@Log(title = "成果相关字典", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AchievementDictData achievementDictData)
|
||||
{
|
||||
List<AchievementDictData> list = achievementDictDataService.selectAchievementDictDataList(achievementDictData);
|
||||
ExcelUtil<AchievementDictData> util = new ExcelUtil<AchievementDictData>(AchievementDictData.class);
|
||||
util.exportExcel(response, list, "成果相关字典数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取成果相关字典详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{dictCode}")
|
||||
public AjaxResult getInfo(@PathVariable("dictCode") Long dictCode)
|
||||
{
|
||||
return success(achievementDictDataService.selectAchievementDictDataByDictCode(dictCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成果相关字典
|
||||
*/
|
||||
@Log(title = "成果相关字典", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AchievementDictData achievementDictData)
|
||||
{
|
||||
return toAjax(achievementDictDataService.insertAchievementDictData(achievementDictData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成果相关字典
|
||||
*/
|
||||
@Log(title = "成果相关字典", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AchievementDictData achievementDictData)
|
||||
{
|
||||
return toAjax(achievementDictDataService.updateAchievementDictData(achievementDictData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成果相关字典
|
||||
*/
|
||||
@Log(title = "成果相关字典", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{dictCodes}")
|
||||
public AjaxResult remove(@PathVariable Long[] dictCodes)
|
||||
{
|
||||
return toAjax(achievementDictDataService.deleteAchievementDictDataByDictCodes(dictCodes));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型查询字典数据信息
|
||||
*/
|
||||
@ApiOperation("根据成果字典分类查询成果值")
|
||||
@GetMapping(value = "/getDictDateByType")
|
||||
public AjaxResult getDictDateByType(String dictType)
|
||||
{
|
||||
List<KeyValueVo> data = achievementDictDataService.selectDictDataByType(dictType);
|
||||
return success(data);
|
||||
}
|
||||
|
||||
@ApiOperation("根据成果字典分类")
|
||||
@GetMapping(value = "/getDictTypes")
|
||||
public AjaxResult getDictTypes()
|
||||
{
|
||||
List<String> data = achievementDictDataService.getDictTypes();
|
||||
return success(data);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
package com.microservices.dms.achievementLibrary.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.common.security.annotation.RequiresPermissions;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchievementTeam;
|
||||
import com.microservices.dms.achievementLibrary.service.IAchievementTeamService;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.utils.poi.ExcelUtil;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 成果团队Controller
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-23
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "数据管理体系-成果团队接口")
|
||||
@RequestMapping("/achievementsTeam")
|
||||
public class AchievementTeamController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IAchievementTeamService achievementTeamService;
|
||||
|
||||
/**
|
||||
* 查询成果团队列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AchievementTeam achievementTeam)
|
||||
{
|
||||
startPage();
|
||||
List<AchievementTeam> list = achievementTeamService.selectAchievementTeamList(achievementTeam);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出成果团队列表
|
||||
*/
|
||||
@Log(title = "成果团队", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AchievementTeam achievementTeam)
|
||||
{
|
||||
List<AchievementTeam> list = achievementTeamService.selectAchievementTeamList(achievementTeam);
|
||||
ExcelUtil<AchievementTeam> util = new ExcelUtil<AchievementTeam>(AchievementTeam.class);
|
||||
util.exportExcel(response, list, "成果团队数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取成果团队详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(achievementTeamService.selectAchievementTeamById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成果团队
|
||||
*/
|
||||
@Log(title = "成果团队", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AchievementTeam achievementTeam)
|
||||
{
|
||||
return toAjax(achievementTeamService.insertAchievementTeam(achievementTeam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成果团队
|
||||
*/
|
||||
@Log(title = "成果团队", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AchievementTeam achievementTeam)
|
||||
{
|
||||
return toAjax(achievementTeamService.updateAchievementTeam(achievementTeam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成果团队
|
||||
*/
|
||||
@Log(title = "成果团队", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(achievementTeamService.deleteAchievementTeamByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,310 @@
|
|||
package com.microservices.dms.achievementLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.utils.poi.ExcelUtil;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchQueryVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.Achievements;
|
||||
import com.microservices.dms.achievementLibrary.service.IAchievementsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 成果Controller
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-02
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/achievements")
|
||||
@Api(tags = "数据管理体系-成果库接口")
|
||||
public class AchievementsController extends BaseController {
|
||||
@Autowired
|
||||
private IAchievementsService achievementsService;
|
||||
|
||||
/**
|
||||
* 查询成果列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Achievements achievements) {
|
||||
startPage();
|
||||
List<Achievements> list = achievementsService.selectAchievementsList(achievements);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出成果列表
|
||||
*/
|
||||
@Log(title = "成果", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, Achievements achievements) {
|
||||
List<Achievements> list = achievementsService.selectAchievementsList(achievements);
|
||||
ExcelUtil<Achievements> util = new ExcelUtil<Achievements>(Achievements.class);
|
||||
util.exportExcel(response, list, "成果数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取成果详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(achievementsService.selectAchievementsById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成果
|
||||
*/
|
||||
@Log(title = "成果", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Achievements achievements) {
|
||||
return toAjax(achievementsService.insertAchievements(achievements));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成果
|
||||
*/
|
||||
@Log(title = "成果", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Achievements achievements) {
|
||||
return toAjax(achievementsService.updateAchievements(achievements));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成果
|
||||
*/
|
||||
@Log(title = "成果", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(achievementsService.deleteAchievementsByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("删除成果数据")
|
||||
@DeleteMapping("/deleteById")
|
||||
public AjaxResult deleteById(Long id) {
|
||||
return toAjax(achievementsService.deleteAchievementsById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取精选成果
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("获取精选成果")
|
||||
@GetMapping("/getChoiceImport")
|
||||
public AjaxResult getChoiceImport() {
|
||||
return success(achievementsService.getChoiceImport());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据成果来源对成果数据进行分类统计
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("根据成果来源对成果数据进行分类统计")
|
||||
@GetMapping("/getTjBySources")
|
||||
public AjaxResult getTjBySources() {
|
||||
return success(achievementsService.getTjBySources());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据成果领域对成功数据进行汇总
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("根据成果领域对成果数据进行汇总")
|
||||
@GetMapping("/getTjByAreas")
|
||||
public AjaxResult getTjByAreas() {
|
||||
return success(achievementsService.getTjByAreas());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据领域分类名称,获取领域相关数据(创客任务、开放竞赛、校企成果)
|
||||
*/
|
||||
@ApiOperation("根据领域分类名称,获取领域相关数据")
|
||||
@GetMapping("/getAreasByName")
|
||||
public AjaxResult getAreasByName(String areaName) {
|
||||
return success(achievementsService.getAreasByName(areaName));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据领域分类名称,获取项目领域")
|
||||
@GetMapping("/getProjectAreasByName")
|
||||
public AjaxResult getProjectAreasByName(String areaName) {
|
||||
return success(achievementsService.getProjectAreasByName(areaName));
|
||||
}
|
||||
|
||||
@ApiOperation("根据领域分类名称,获取专家领域")
|
||||
@GetMapping("/getExpertAreasByName")
|
||||
public AjaxResult getExpertAreasByName(String areaName) {
|
||||
return success(achievementsService.getExpertAreasByName(areaName));
|
||||
}
|
||||
|
||||
|
||||
/* 获取全部成果,根据成果名称、成果领域、成果来源进行查询
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("获取全部成果,根据成果名称、成果领域、成果来源进行查询")
|
||||
@GetMapping("/getAllResult")
|
||||
public TableDataInfo getAllResult(AchQueryVo achQueryVo) {
|
||||
startPage();
|
||||
return getDataTable(achievementsService.getAllResult(achQueryVo));
|
||||
}
|
||||
|
||||
@ApiOperation("近七日用户行为数据")
|
||||
@GetMapping("/getUerActionData")
|
||||
public AjaxResult getUerActionData() {
|
||||
return success(achievementsService.getUerActionData());
|
||||
}
|
||||
|
||||
@ApiOperation("热门成果")
|
||||
@GetMapping("/getHotAchievement")
|
||||
public AjaxResult getHotAchievement() {
|
||||
return success(achievementsService.getHotAchievement());
|
||||
}
|
||||
|
||||
@ApiOperation("七日新增")
|
||||
@GetMapping("/get7DayAdd")
|
||||
public AjaxResult get7DayAdd(AchQueryVo achQueryVo) {
|
||||
return success(achievementsService.get7DayAdd(achQueryVo));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("首页项目统计")
|
||||
@GetMapping("/indexProjectStatistic")
|
||||
public AjaxResult indexProjectStatistic() {
|
||||
return success(achievementsService.indexProjectStatistic());
|
||||
}
|
||||
|
||||
@ApiOperation("首页task统计")
|
||||
@GetMapping("/indexTaskStatistic")
|
||||
public AjaxResult indexTaskStatistic() {
|
||||
return success(achievementsService.indexTaskStatistic());
|
||||
}
|
||||
|
||||
@ApiOperation("首页Competition统计")
|
||||
@GetMapping("/indexCompetitionStatistic")
|
||||
public AjaxResult indexCompetitionStatistic() {
|
||||
return success(achievementsService.indexCompetitionStatistic());
|
||||
}
|
||||
|
||||
@ApiOperation("首页SchoolEnterprise统计")
|
||||
@GetMapping("/indexSchoolEnterpriseStatistic")
|
||||
public AjaxResult indexSchoolEnterpriseStatistic() {
|
||||
return success(achievementsService.indexSchoolEnterpriseStatistic());
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("首页专家统计")
|
||||
@GetMapping("/indexExpertStatistic")
|
||||
public AjaxResult indexExpertStatistic() {
|
||||
return success(achievementsService.indexExpertStatistic());
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据当前用户以及成果ID,获取当前成果的 是否收藏与关注状态")
|
||||
@GetMapping("/getWatchFavoriteStatusById")
|
||||
public AjaxResult getWatchFavoriteStatusById(Long id, Long userId) {
|
||||
return success(achievementsService.getWatchFavoriteStatusById(id, userId));
|
||||
}
|
||||
@ApiOperation("根据成果ID,获取近7日成果点击数量(折线图)")
|
||||
@GetMapping("/get7AddClickById")
|
||||
public AjaxResult get7AddClickById(String id,@RequestParam(value = "clickType",required = false, defaultValue = "Achievements")
|
||||
String clickType) {
|
||||
return success(achievementsService.get7AddClickById(id,clickType));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据专家id,获取近7日成果点击数量(折线图)")
|
||||
@GetMapping("/getExpert7AddClickById")
|
||||
public AjaxResult getExpert7AddClickById(String id,@RequestParam(value = "clickType",required = false, defaultValue = "Experts")
|
||||
String clickType) {
|
||||
return success(achievementsService.get7AddClickById(id,clickType));
|
||||
}
|
||||
|
||||
@ApiOperation("根据成果ID,获取成果的相关行为数据统计(点击量、搜索量、附件下载量、收藏、关注)")
|
||||
@GetMapping("/getActDataStatisticById")
|
||||
public AjaxResult getActDataStatisticById(Long id) {
|
||||
return success(achievementsService.getActDataStatisticById(id));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据领域来源、领域分类名称,获取领域相关数据")
|
||||
@GetMapping("/getAllAreas")
|
||||
public AjaxResult getAllAreas(String areaName) {
|
||||
return success(achievementsService.getAllAreas(areaName));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation("根据领域,将成果数据进行分类")
|
||||
@GetMapping("/getAreaStatistic")
|
||||
public AjaxResult getAreaStatistic(String areaKey)
|
||||
{
|
||||
return success(achievementsService.getAreaStatistic(areaKey));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据领域获取领域详情")
|
||||
@GetMapping("/getAreaDetail")
|
||||
public AjaxResult getAreaDetail(String areaKey,String kyxmSum,String source)
|
||||
{
|
||||
return success(achievementsService.getAreaDetail(areaKey,kyxmSum,source));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取开源项目的相关成果
|
||||
*/
|
||||
@ApiOperation(value = "获取开源项目的相关成果")
|
||||
@GetMapping("/getRelatedAch")
|
||||
public AjaxResult getRelatedAch(Long id,Long sourceId)
|
||||
{
|
||||
return success(achievementsService.getRelatedAch(id,sourceId));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "获取开源竞赛的相关成果")
|
||||
@GetMapping("/getRelatedAchCompetition")
|
||||
public AjaxResult getRelatedAchCompetition(Long id,Long sourceId)
|
||||
{
|
||||
return success(achievementsService.getRelatedAchCompetition(id,sourceId));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "获取创客任务的相关成果")
|
||||
@GetMapping("/getRelatedAchTask")
|
||||
public AjaxResult getRelatedAchTask(Long id,Long sourceId)
|
||||
{
|
||||
return success(achievementsService.getRelatedAchTask(id,sourceId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取专家-创客任务的相关成果")
|
||||
@GetMapping("/getRelatedAchTaskOfExpert")
|
||||
public AjaxResult getRelatedAchTaskOfExpert(Long expertId)
|
||||
{
|
||||
return success(achievementsService.getRelatedAchTaskOfExpert(expertId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取专家-开源竞赛的相关成果")
|
||||
@GetMapping("/getRelatedAchCompetitionOfExpert")
|
||||
public AjaxResult getRelatedAchCompetitionOfExpert(Long expertId)
|
||||
{
|
||||
return success(achievementsService.getRelatedAchCompetitionOfExpert(expertId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "搜索行为数据记录")
|
||||
@GetMapping("/getSearchResult")
|
||||
public AjaxResult getSearchResult(String achName,Long userId)
|
||||
{
|
||||
return success(achievementsService.getSearchResult(achName,userId));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
package com.microservices.dms.achievementLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.dms.achievementLibrary.service.BigScreenStatisticService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "数据管理体系-大屏统计接口")
|
||||
@RequestMapping("/bigScreenStatistic")
|
||||
public class BigScreenStatisticController {
|
||||
|
||||
private final BigScreenStatisticService bigScreenStatisticService;
|
||||
|
||||
|
||||
@GetMapping(value = "/achievement/getAchievementTopStatistic")
|
||||
@ApiOperation(value = "成果任务统计顶部折线图")
|
||||
public AjaxResult getAchievementTopStatistic(String source) {
|
||||
return AjaxResult.success(bigScreenStatisticService.getAchievementTopStatistic(source));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/achievement/getAchievementDataYearly")
|
||||
@ApiOperation(value = "年度成果数据")
|
||||
public AjaxResult getAchievementDataYearly() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getAchievementDataYearly());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/achievement/getAchievementType")
|
||||
@ApiOperation(value = "成果类型")
|
||||
public AjaxResult getAchievementType() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getAchievementType());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/achievement/getAchievementDomain")
|
||||
@ApiOperation(value = "成果领域分布")
|
||||
public AjaxResult getAchievementDomain() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getAchievementDomain());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/achievement/getAchievementAddYearly")
|
||||
@ApiOperation(value = "近1年新增成果数")
|
||||
public AjaxResult getAchievementAddYearly() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getAchievementAddYearly());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/achievement/getAchievementActData")
|
||||
@ApiOperation(value = "成果行为数据展示")
|
||||
public AjaxResult getAchievementActData() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getAchievementActData());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/achievement/getAchievementHotRank")
|
||||
@ApiOperation(value = "成果热度排行")
|
||||
public AjaxResult getAchievementHotRank() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getAchievementHotRank());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/competition/getCompetitionTopStatistic")
|
||||
@ApiOperation(value = "competition统计顶部")
|
||||
public AjaxResult getAchievementTopStatistic() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getCompetitionTopStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/competition/getCompetitionStatisticYearly")
|
||||
@ApiOperation(value = "竞赛数据统计")
|
||||
public AjaxResult getCompetitionStatisticYearly() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getCompetitionStatisticYearly());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/competition/getCompetitionHot")
|
||||
@ApiOperation(value = "热门竞赛统计")
|
||||
public AjaxResult getCompetitionHot() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getCompetitionHot());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/competition/getCompetitionYearlyPaperAdd")
|
||||
@ApiOperation(value = "年度竞赛作品新增数")
|
||||
public AjaxResult getCompetitionYearlyPaperAdd() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getCompetitionYearlyPaperAdd());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/competition/getCompetitionYearlyFinish")
|
||||
@ApiOperation(value = "近1年竞赛完成情况")
|
||||
public AjaxResult getCompetitionYearlyFinish() {
|
||||
return AjaxResult.success(bigScreenStatisticService.getCompetitionYearlyFinish());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
package com.microservices.dms.achievementLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
import com.microservices.dms.achievementLibrary.domain.BlockchainListQueryVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.TokenListVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.blockchain.InBlockchainData;
|
||||
import com.microservices.dms.achievementLibrary.domain.blockchain.InLinkProjectVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.blockchain.UserVo;
|
||||
import com.microservices.dms.achievementLibrary.service.BlockChainService;
|
||||
import com.microservices.dms.achievementLibrary.service.InBlockchainDataServiceImpl;
|
||||
import com.microservices.dms.common.vo.UserCreateVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/blockChain")
|
||||
@Api(tags = "数据管理体系-数据产权子系统")
|
||||
public class BlockChainController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private BlockChainService blockChainService;
|
||||
|
||||
@Autowired
|
||||
private InBlockchainDataServiceImpl inBlockchainDataService;
|
||||
|
||||
@GetMapping("/projectTokenList")
|
||||
@ApiOperation(value = "项目token列表")
|
||||
public TableDataInfo projectTokenList(String projectName) {
|
||||
startPage();
|
||||
List<TokenListVo> list = blockChainService.projectTokenList(projectName);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/projectTokenDistribute")
|
||||
@ApiOperation(value = "项目token分配、点击token分配按钮,弹出框展示相关数据(项目名称、分配token、被分配人)")
|
||||
public AjaxResult projectTokenDistribute(InLinkProjectVo projectVo) {
|
||||
return blockChainService.projectTokenDistribute(projectVo);
|
||||
}
|
||||
|
||||
@GetMapping("/issueDataList")
|
||||
@ApiOperation(value = "入链issue列表")
|
||||
public TableDataInfo issueDataList(BlockchainListQueryVo queryVo) {
|
||||
startPage();
|
||||
List<Map<String, Object>> list = blockChainService.issueDataList(queryVo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/commitDataList")
|
||||
@ApiOperation(value = "入链commit列表")
|
||||
public TableDataInfo commitDataList(BlockchainListQueryVo queryVo) {
|
||||
startPage();
|
||||
List<Map<String, Object>> list = blockChainService.commitDataList(queryVo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/prDataList")
|
||||
@ApiOperation(value = "入链PR列表")
|
||||
public TableDataInfo prDataList(BlockchainListQueryVo queryVo) {
|
||||
startPage();
|
||||
List<Map<String, Object>> list = blockChainService.prDataList(queryVo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/userDataList")
|
||||
@ApiOperation(value = "入链user列表")
|
||||
public TableDataInfo userDataList(BlockchainListQueryVo queryVo) {
|
||||
List<Map> list = blockChainService.userDataList(queryVo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/userList")
|
||||
@ApiOperation(value = "用户列表列表")
|
||||
public TableDataInfo userList(UserVo userVo) {
|
||||
startPage();
|
||||
List<UserVo> list = blockChainService.userList(userVo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/InBlockchainDataList")
|
||||
@ApiOperation(value = "查询区块链数据入链列表")
|
||||
public TableDataInfo list(InBlockchainData inBlockchainData) {
|
||||
startPage();
|
||||
List<InBlockchainData> list = inBlockchainDataService.selectInBlockchainDataList(inBlockchainData);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("提供入链项目信息查询")
|
||||
@GetMapping("/queryBlockInfo")
|
||||
public AjaxResult queryBlockInfo (String type,String typeId) {
|
||||
return blockChainService.queryBlockInfo(type,typeId);
|
||||
}
|
||||
|
||||
@ApiOperation("根据项目id获取用户对应的token")
|
||||
@GetMapping("/getUserTokenByProjectId")
|
||||
public AjaxResult getUserTokenByProjectId (String type,String userName,String tokenName) {
|
||||
return blockChainService.getUserTokenByProjectId(type,userName,tokenName);
|
||||
}
|
||||
|
||||
@ApiOperation("获取用户对应的所有项目token")
|
||||
@GetMapping("/getUserAllProjectToken")
|
||||
public AjaxResult getUserAllProjectToken (String userName) {
|
||||
return blockChainService.getUserAllProjectToken(userName);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package com.microservices.dms.achievementLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.dms.achievementLibrary.service.BlockChainService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/blockFisco")
|
||||
@Api(tags = "数据管理体系-数据产权入链交易")
|
||||
public class BlockFiscoController {
|
||||
|
||||
@Autowired
|
||||
private BlockChainService blockChainService;
|
||||
|
||||
|
||||
@GetMapping("/getTransactionByHash")
|
||||
@ApiOperation(value = "通过交易哈希获取交易详情")
|
||||
public AjaxResult getTransactionByHash(String txHash) {
|
||||
return AjaxResult.success(blockChainService.getTransactionByHash(txHash));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "交易哈希获取交易回执")
|
||||
@GetMapping("/getTransactionReceipt")
|
||||
public AjaxResult getTransactionReceipt(String txHash) {
|
||||
return AjaxResult.success(blockChainService.getTransactionReceipt(txHash));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "获取最新区块号")
|
||||
@GetMapping("/blockNumber")
|
||||
public AjaxResult getBlockNumber() {
|
||||
return AjaxResult.success(blockChainService.getBlockNumber());
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "获取区块链总交易数")
|
||||
@GetMapping("/getTotalTransactionCount")
|
||||
public AjaxResult getTotalTransactionCount() {
|
||||
return AjaxResult.success(blockChainService.getTotalTransactionCount());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package com.microservices.dms.achievementLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.dms.achievementLibrary.service.ExpertDashboardService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "数据管理体系-专家可视化接口")
|
||||
@RequestMapping("/expertDashboard")
|
||||
public class ExpertDashboardController {
|
||||
@Autowired
|
||||
private ExpertDashboardService expertDashboardService;
|
||||
|
||||
@GetMapping(value = "getExpertTotal")
|
||||
@ApiOperation(value = "获取专家总数")
|
||||
public AjaxResult getExpertTotal() {
|
||||
return AjaxResult.success(expertDashboardService.getExpertTotal());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getAuthenticationStatistic")
|
||||
@ApiOperation(value = "专家实名完成度")
|
||||
public AjaxResult getAuthenticationStatistic() {
|
||||
return AjaxResult.success(expertDashboardService.getAuthenticationStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getTitleRankStatistic")
|
||||
@ApiOperation(value = "专家职称级分布")
|
||||
public AjaxResult getTitleRankStatistic() {
|
||||
return AjaxResult.success(expertDashboardService.getTitleRankStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getExpertAduit")
|
||||
@ApiOperation(value = "专家评审作品数排序")
|
||||
public AjaxResult getExpertAduit() {
|
||||
return AjaxResult.success(expertDashboardService.getExpertAduit());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getExpertTypeStatistic")
|
||||
@ApiOperation(value = "专家专业类别")
|
||||
public AjaxResult getExpertTypeStatistic() {
|
||||
return AjaxResult.success(expertDashboardService.getExpertTypeStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getWorkplaceTypeStatistic")
|
||||
@ApiOperation(value = "专家单位类别分布")
|
||||
public AjaxResult getWorkplaceTypeStatistic() {
|
||||
return AjaxResult.success(expertDashboardService.getWorkplaceTypeStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getHighestDegreeStatistic")
|
||||
@ApiOperation(value = "专家学历分布")
|
||||
public AjaxResult getHighestDegreeStatistic() {
|
||||
return AjaxResult.success(expertDashboardService.getHighestDegreeStatistic());
|
||||
}
|
||||
|
||||
//7、年度专家数据统计 cretate_on
|
||||
@GetMapping(value = "getExpertTotalByYear")
|
||||
@ApiOperation(value = "年度专家数据统计")
|
||||
public AjaxResult getExpertTotalByYear() {
|
||||
return AjaxResult.success(expertDashboardService.getExpertTotalByYear());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getReviewAreasStatistic")
|
||||
@ApiOperation(value = "热门专家领域")
|
||||
public AjaxResult getReviewAreasStatistic() {
|
||||
return AjaxResult.success(expertDashboardService.getReviewAreasStatistic());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.microservices.dms.achievementLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.dms.achievementLibrary.service.MemoDashboardService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "数据管理体系-社区动态可视化接口")
|
||||
@RequestMapping("/memoDashboard")
|
||||
public class MemoDashboardController {
|
||||
@Autowired
|
||||
private MemoDashboardService memoDashboardService;
|
||||
|
||||
@GetMapping(value = "getMemoAduit")
|
||||
@ApiOperation(value = "帖子审核通过率、帖子总数")
|
||||
public AjaxResult getMemoAduit() {
|
||||
return AjaxResult.success(memoDashboardService.getMemoAduit());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getIsOriginalStatistic")
|
||||
@ApiOperation(value = "帖子原创、非原创")
|
||||
public AjaxResult getIsOriginalStatistic() {
|
||||
return AjaxResult.success(memoDashboardService.getIsOriginalStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getMemoTotalByYear")
|
||||
@ApiOperation(value = "年度论坛帖子总数")
|
||||
public AjaxResult getMemoTotalByYear() {
|
||||
return AjaxResult.success(memoDashboardService.getMemoTotalByYear());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getForumSectionStatistic")
|
||||
@ApiOperation(value = "帖子分类")
|
||||
public AjaxResult getForumSectionStatistic() {
|
||||
return AjaxResult.success(memoDashboardService.getForumSectionStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getAddMemoStatistic")
|
||||
@ApiOperation(value = "近一年新增帖子数")
|
||||
public AjaxResult getAddMemoStatistic() {
|
||||
return AjaxResult.success(memoDashboardService.getAddMemoStatistic());
|
||||
}
|
||||
|
||||
@GetMapping(value = "getTop5Memos")
|
||||
@ApiOperation(value = "年度帖子热度top5")
|
||||
public AjaxResult getTop5Memos() {
|
||||
return AjaxResult.success(memoDashboardService.getTop5Memos());
|
||||
}
|
||||
|
||||
@GetMapping(value = "get7DayPaise")
|
||||
@ApiOperation(value = "近7日帖子点赞数")
|
||||
public AjaxResult get7DayPaise() {
|
||||
return AjaxResult.success(memoDashboardService.get7DayPaise());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,149 @@
|
|||
package com.microservices.dms.achievementLibrary.controller;
|
||||
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.common.core.utils.poi.ExcelUtil;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.common.security.utils.SecurityUtils;
|
||||
import com.microservices.dms.achievementLibrary.domain.SchoolEnterpriseAchievements;
|
||||
import com.microservices.dms.achievementLibrary.service.ISchoolEnterpriseAchievementsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 校企成果Controller
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
@Api(tags = "数据管理体系-校企成果接口")
|
||||
@RestController
|
||||
@RequestMapping("/schoolEnterpriseAchievements")
|
||||
public class SchoolEnterpriseAchievementsController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISchoolEnterpriseAchievementsService schoolEnterpriseAchievementsService;
|
||||
|
||||
/**
|
||||
* 查询校企成果列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
startPage();
|
||||
List<SchoolEnterpriseAchievements> list = schoolEnterpriseAchievementsService.selectSchoolEnterpriseAchievementsList(schoolEnterpriseAchievements);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询校企成果列表
|
||||
*/
|
||||
@GetMapping("/listFront")
|
||||
public TableDataInfo listFront(SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
startPage();
|
||||
List<SchoolEnterpriseAchievements> list = schoolEnterpriseAchievementsService.listFront(schoolEnterpriseAchievements);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出校企成果列表
|
||||
*/
|
||||
@Log(title = "校企成果", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
List<SchoolEnterpriseAchievements> list = schoolEnterpriseAchievementsService.selectSchoolEnterpriseAchievementsList(schoolEnterpriseAchievements);
|
||||
ExcelUtil<SchoolEnterpriseAchievements> util = new ExcelUtil<SchoolEnterpriseAchievements>(SchoolEnterpriseAchievements.class);
|
||||
util.exportExcel(response, list, "校企成果数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取校企成果详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(schoolEnterpriseAchievementsService.selectSchoolEnterpriseAchievementsById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增校企成果
|
||||
*/
|
||||
@Log(title = "校企成果", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
|
||||
if (!schoolEnterpriseAchievementsService.getCheckSchoolAchName(schoolEnterpriseAchievements)) {
|
||||
return error("新增校企成果'" + schoolEnterpriseAchievements.getAchievementName() + "'失败,成果名称已存在");
|
||||
}
|
||||
return AjaxResult.success(schoolEnterpriseAchievementsService.insertSchoolEnterpriseAchievements(schoolEnterpriseAchievements));
|
||||
}
|
||||
|
||||
@PostMapping("/importData")
|
||||
@Log(title = "校企成果", businessType = BusinessType.INSERT)
|
||||
public AjaxResult importData(@RequestPart("file") MultipartFile file,
|
||||
@RequestParam(value = "updateSupport", defaultValue = "false") boolean updateSupport) throws Exception {
|
||||
ExcelUtil<SchoolEnterpriseAchievements> util = new ExcelUtil<>(SchoolEnterpriseAchievements.class);
|
||||
// 1. 解析Excel,获取实体列表和图片Map
|
||||
List<SchoolEnterpriseAchievements> list = util.importExcelWithImages(StringUtils.EMPTY, file.getInputStream(), 0);
|
||||
Map<String, MultipartFile> imageMap = util.getExcelImageMap();
|
||||
// 2. 调用业务层处理(传入实体列表和图片Map)
|
||||
String operName = SecurityUtils.getUsername();
|
||||
String message = schoolEnterpriseAchievementsService.batchInsertSchoolEnterpriseAchievements(list, imageMap, updateSupport, operName);
|
||||
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改校企成果
|
||||
*/
|
||||
@Log(title = "校企成果", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
// if (!schoolEnterpriseAchievementsService.getCheckSchoolAchName(schoolEnterpriseAchievements)) {
|
||||
// return error("修改校企成果'" + schoolEnterpriseAchievements.getAchievementName() + "'失败,成果名称已存在");
|
||||
// }
|
||||
return AjaxResult.success(schoolEnterpriseAchievementsService.updateSchoolEnterpriseAchievements(schoolEnterpriseAchievements));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除校企成果
|
||||
*/
|
||||
@Log(title = "校企成果", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return AjaxResult.success(schoolEnterpriseAchievementsService.deleteSchoolEnterpriseAchievementsByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 顶部统计
|
||||
*/
|
||||
@GetMapping("/topStatistic")
|
||||
@ApiOperation(value = "顶部统计数据")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "tags", value = "成果标签", paramType = "query", dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "status", value = "成果状态", paramType = "query", dataTypeClass = Integer.class),
|
||||
})
|
||||
public AjaxResult topStatistic(SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
|
||||
Long value = schoolEnterpriseAchievementsService.topStatistic(schoolEnterpriseAchievements);
|
||||
return AjaxResult.success(value);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AchDetailVo {
|
||||
private List<Achievements> achievementsList;
|
||||
private long clickSum;
|
||||
private long dockSum;
|
||||
private long favoriteSum;
|
||||
private long watcherSum;
|
||||
private String remark;
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
public class AchQueryVo {
|
||||
|
||||
private String areaQuery;//领域
|
||||
private String source;//来源
|
||||
private String achievementName;//名称
|
||||
private Long userId;
|
||||
private String showAchievementName;
|
||||
public String getAreaQuery() {
|
||||
return areaQuery;
|
||||
}
|
||||
|
||||
public void setAreaQuery(String areaQuery) {
|
||||
this.areaQuery = areaQuery;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getAchievementName() {
|
||||
return achievementName;
|
||||
}
|
||||
|
||||
public void setAchievementName(String achievementName) {
|
||||
this.achievementName = achievementName;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getShowAchievementName() {
|
||||
return showAchievementName;
|
||||
}
|
||||
|
||||
public void setShowAchievementName(String showAchievementName) {
|
||||
this.showAchievementName = showAchievementName;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class AchRelatedResult {
|
||||
private String year;
|
||||
private List<AchRelatedVo> achRelatedVoList;
|
||||
|
||||
public String getYear() {
|
||||
return year;
|
||||
}
|
||||
|
||||
public void setYear(String year) {
|
||||
this.year = year;
|
||||
}
|
||||
|
||||
public List<AchRelatedVo> getAchRelatedVoList() {
|
||||
return achRelatedVoList;
|
||||
}
|
||||
|
||||
public void setAchRelatedVoList(List<AchRelatedVo> achRelatedVoList) {
|
||||
this.achRelatedVoList = achRelatedVoList;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
public class AchRelatedVo {
|
||||
private Long id;
|
||||
private String attachments;
|
||||
private String summary;
|
||||
private String achievementType;
|
||||
private String achMonthDay;
|
||||
private String source;
|
||||
private Long sourceId;
|
||||
private String achRelateName;
|
||||
private String showAchievementName;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAttachments() {
|
||||
return attachments;
|
||||
}
|
||||
|
||||
public void setAttachments(String attachments) {
|
||||
this.attachments = attachments;
|
||||
}
|
||||
|
||||
public String getSummary() {
|
||||
return summary;
|
||||
}
|
||||
|
||||
public void setSummary(String summary) {
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
public String getAchievementType() {
|
||||
return achievementType;
|
||||
}
|
||||
|
||||
public void setAchievementType(String achievementType) {
|
||||
this.achievementType = achievementType;
|
||||
}
|
||||
|
||||
public String getAchMonthDay() {
|
||||
return achMonthDay;
|
||||
}
|
||||
|
||||
public void setAchMonthDay(String achMonthDay) {
|
||||
this.achMonthDay = achMonthDay;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public Long getSourceId() {
|
||||
return sourceId;
|
||||
}
|
||||
|
||||
public void setSourceId(Long sourceId) {
|
||||
this.sourceId = sourceId;
|
||||
}
|
||||
|
||||
public String getAchRelateName() {
|
||||
return achRelateName;
|
||||
}
|
||||
|
||||
public void setAchRelateName(String achRelateName) {
|
||||
this.achRelateName = achRelateName;
|
||||
}
|
||||
|
||||
public String getShowAchievementName() {
|
||||
return showAchievementName;
|
||||
}
|
||||
|
||||
public void setShowAchievementName(String showAchievementName) {
|
||||
this.showAchievementName = showAchievementName;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.microservices.common.core.annotation.Excel;
|
||||
import com.microservices.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 成果相关字典对象 achievement_dict_data
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-05-23
|
||||
*/
|
||||
public class AchievementDictData extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 字典编码 */
|
||||
private Long dictCode;
|
||||
|
||||
/** 字典排序 */
|
||||
@Excel(name = "字典排序")
|
||||
private Integer dictSort;
|
||||
|
||||
/** 字典标签 */
|
||||
@Excel(name = "字典标签")
|
||||
private String dictLabel;
|
||||
|
||||
/** 字典键值 */
|
||||
@Excel(name = "字典键值")
|
||||
private String dictValue;
|
||||
|
||||
/** 字典类型 */
|
||||
@Excel(name = "字典类型")
|
||||
private String dictType;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
public void setDictCode(Long dictCode)
|
||||
{
|
||||
this.dictCode = dictCode;
|
||||
}
|
||||
|
||||
public Long getDictCode()
|
||||
{
|
||||
return dictCode;
|
||||
}
|
||||
public void setDictSort(Integer dictSort)
|
||||
{
|
||||
this.dictSort = dictSort;
|
||||
}
|
||||
|
||||
public Integer getDictSort()
|
||||
{
|
||||
return dictSort;
|
||||
}
|
||||
public void setDictLabel(String dictLabel)
|
||||
{
|
||||
this.dictLabel = dictLabel;
|
||||
}
|
||||
|
||||
public String getDictLabel()
|
||||
{
|
||||
return dictLabel;
|
||||
}
|
||||
public void setDictValue(String dictValue)
|
||||
{
|
||||
this.dictValue = dictValue;
|
||||
}
|
||||
|
||||
public String getDictValue()
|
||||
{
|
||||
return dictValue;
|
||||
}
|
||||
public void setDictType(String dictType)
|
||||
{
|
||||
this.dictType = dictType;
|
||||
}
|
||||
|
||||
public String getDictType()
|
||||
{
|
||||
return dictType;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("dictCode", getDictCode())
|
||||
.append("dictSort", getDictSort())
|
||||
.append("dictLabel", getDictLabel())
|
||||
.append("dictValue", getDictValue())
|
||||
.append("dictType", getDictType())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,195 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.microservices.common.core.annotation.Excel;
|
||||
import com.microservices.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 成果团队对象 achievement_team
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-23
|
||||
*/
|
||||
public class AchievementTeam extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 成果ld */
|
||||
@Excel(name = "成果ld")
|
||||
private Long achievementId;
|
||||
|
||||
/** 姓名 */
|
||||
@Excel(name = "姓名")
|
||||
private String username;
|
||||
|
||||
/** 所属单位 */
|
||||
@Excel(name = "所属单位")
|
||||
private String company;
|
||||
|
||||
/** 职称 */
|
||||
@Excel(name = "职称")
|
||||
private String technicalTitle;
|
||||
|
||||
/** 专业 */
|
||||
@Excel(name = "专业")
|
||||
private String professionalTitle;
|
||||
|
||||
/** 研究方向 */
|
||||
@Excel(name = "研究方向")
|
||||
private String researchDirection;
|
||||
|
||||
/** 联系方式 */
|
||||
@Excel(name = "联系方式")
|
||||
private String phone;
|
||||
|
||||
/** 个人简介 */
|
||||
@Excel(name = "个人简介")
|
||||
private String summary;
|
||||
|
||||
/** 本项成果中主要承担工作 */
|
||||
@Excel(name = "本项成果中主要承担工作")
|
||||
private String workContent;
|
||||
|
||||
/** 是否是负责人 */
|
||||
@Excel(name = "是否是负责人")
|
||||
private String isLeader;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long status;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setAchievementId(Long achievementId)
|
||||
{
|
||||
this.achievementId = achievementId;
|
||||
}
|
||||
|
||||
public Long getAchievementId()
|
||||
{
|
||||
return achievementId;
|
||||
}
|
||||
public void setUsername(String username)
|
||||
{
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getUsername()
|
||||
{
|
||||
return username;
|
||||
}
|
||||
public void setCompany(String company)
|
||||
{
|
||||
this.company = company;
|
||||
}
|
||||
|
||||
public String getCompany()
|
||||
{
|
||||
return company;
|
||||
}
|
||||
public void setTechnicalTitle(String technicalTitle)
|
||||
{
|
||||
this.technicalTitle = technicalTitle;
|
||||
}
|
||||
|
||||
public String getTechnicalTitle()
|
||||
{
|
||||
return technicalTitle;
|
||||
}
|
||||
public void setProfessionalTitle(String professionalTitle)
|
||||
{
|
||||
this.professionalTitle = professionalTitle;
|
||||
}
|
||||
|
||||
public String getProfessionalTitle()
|
||||
{
|
||||
return professionalTitle;
|
||||
}
|
||||
public void setResearchDirection(String researchDirection)
|
||||
{
|
||||
this.researchDirection = researchDirection;
|
||||
}
|
||||
|
||||
public String getResearchDirection()
|
||||
{
|
||||
return researchDirection;
|
||||
}
|
||||
public void setPhone(String phone)
|
||||
{
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getPhone()
|
||||
{
|
||||
return phone;
|
||||
}
|
||||
public void setSummary(String summary)
|
||||
{
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
public String getSummary()
|
||||
{
|
||||
return summary;
|
||||
}
|
||||
public void setWorkContent(String workContent)
|
||||
{
|
||||
this.workContent = workContent;
|
||||
}
|
||||
|
||||
public String getWorkContent()
|
||||
{
|
||||
return workContent;
|
||||
}
|
||||
public void setIsLeader(String isLeader)
|
||||
{
|
||||
this.isLeader = isLeader;
|
||||
}
|
||||
|
||||
public String getIsLeader()
|
||||
{
|
||||
return isLeader;
|
||||
}
|
||||
public void setStatus(Long status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Long getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("achievementId", getAchievementId())
|
||||
.append("username", getUsername())
|
||||
.append("company", getCompany())
|
||||
.append("technicalTitle", getTechnicalTitle())
|
||||
.append("professionalTitle", getProfessionalTitle())
|
||||
.append("researchDirection", getResearchDirection())
|
||||
.append("phone", getPhone())
|
||||
.append("summary", getSummary())
|
||||
.append("workContent", getWorkContent())
|
||||
.append("isLeader", getIsLeader())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,554 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.microservices.common.core.annotation.Excel;
|
||||
import com.microservices.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 成果对象 achievementsll
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-02
|
||||
*/
|
||||
public class Achievements extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 成果唯一标识
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 成果名称
|
||||
*/
|
||||
@Excel(name = "成果名称")
|
||||
private String achievementName;
|
||||
/**
|
||||
* 成果展示名称
|
||||
*/
|
||||
private String showAchievementName;
|
||||
|
||||
/**
|
||||
* 成果领域1
|
||||
*/
|
||||
@Excel(name = "成果领域1")
|
||||
private String field1;
|
||||
//成果领域名称
|
||||
private String field1Name;
|
||||
|
||||
/**
|
||||
* 成果领域2
|
||||
*/
|
||||
@Excel(name = "成果领域2")
|
||||
private String field2;
|
||||
|
||||
/**
|
||||
* 成果领域3
|
||||
*/
|
||||
@Excel(name = "成果领域3")
|
||||
private String field3;
|
||||
|
||||
/**
|
||||
* 成果类型
|
||||
*/
|
||||
@Excel(name = "成果类型")
|
||||
private String achievementType;
|
||||
|
||||
/**
|
||||
* 成果来源
|
||||
*/
|
||||
@Excel(name = "成果来源")
|
||||
private String source;
|
||||
|
||||
/**
|
||||
* 成果来源ID
|
||||
*/
|
||||
@Excel(name = "成果来源ID")
|
||||
private Long sourceId;
|
||||
|
||||
/**
|
||||
* 成果来源跳转链接
|
||||
*/
|
||||
@Excel(name = "成果来源跳转链接")
|
||||
private String sourceLink;
|
||||
|
||||
/**
|
||||
* 成果标签
|
||||
*/
|
||||
@Excel(name = "成果标签")
|
||||
private String tags;
|
||||
|
||||
/**
|
||||
* 成果摘要
|
||||
*/
|
||||
@Excel(name = "成果摘要")
|
||||
private String summary;
|
||||
|
||||
/**
|
||||
* 发布单位
|
||||
*/
|
||||
@Excel(name = "发布单位")
|
||||
private String publishingUnit;
|
||||
|
||||
/**
|
||||
* 成果地址
|
||||
*/
|
||||
@Excel(name = "成果地址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 是否精选成果
|
||||
*/
|
||||
@Excel(name = "是否精选成果")
|
||||
private Integer isFeatured;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@Excel(name = "联系人")
|
||||
private String contactPerson;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@Excel(name = "联系电话")
|
||||
private String contactNumber;
|
||||
|
||||
/**
|
||||
* 成果所属人ID
|
||||
*/
|
||||
@Excel(name = "成果所属人ID")
|
||||
private String ownerId;
|
||||
|
||||
/**
|
||||
* 成果所属人名称
|
||||
*/
|
||||
@Excel(name = "成果所属人名称")
|
||||
private String ownerName;
|
||||
|
||||
/**
|
||||
* 成果状态
|
||||
*/
|
||||
@Excel(name = "成果状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 成果详情
|
||||
*/
|
||||
@Excel(name = "成果详情")
|
||||
private String details;
|
||||
|
||||
/**
|
||||
* 成果审核人
|
||||
*/
|
||||
@Excel(name = "成果审核人")
|
||||
private String reviewer;
|
||||
|
||||
/**
|
||||
* 成果审核时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "成果审核时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date reviewDate;
|
||||
|
||||
/**
|
||||
* 成果审核意见
|
||||
*/
|
||||
@Excel(name = "成果审核意见")
|
||||
private String reviewComments;
|
||||
|
||||
/**
|
||||
* 成果图片
|
||||
*/
|
||||
@Excel(name = "图片")
|
||||
private String images;
|
||||
|
||||
/**
|
||||
* 成果附件
|
||||
*/
|
||||
@Excel(name = "成果附件")
|
||||
private String attachments;
|
||||
|
||||
//成果小类
|
||||
private String ext1;
|
||||
//成果状态
|
||||
private String ext2;
|
||||
//成果团队名称
|
||||
private String ext3;
|
||||
|
||||
private Long clickSum;
|
||||
private Long watcherSum;
|
||||
private Long favoriteSum;
|
||||
private Long dockSum;
|
||||
private String filedDesc;
|
||||
private Float hotRank;
|
||||
private Long attachmentCount;
|
||||
private Integer isExpertAudit;
|
||||
private String userImg;
|
||||
private String userNickName;
|
||||
public String gender;
|
||||
private String userLogin;
|
||||
private List<Map<String,Object>> dockingUserInfo;
|
||||
|
||||
public String getExt1() {
|
||||
return ext1;
|
||||
}
|
||||
|
||||
public void setExt1(String ext1) {
|
||||
this.ext1 = ext1;
|
||||
}
|
||||
|
||||
public String getExt2() {
|
||||
return ext2;
|
||||
}
|
||||
|
||||
public void setExt2(String ext2) {
|
||||
this.ext2 = ext2;
|
||||
}
|
||||
|
||||
public String getExt3() {
|
||||
return ext3;
|
||||
}
|
||||
|
||||
public void setExt3(String ext3) {
|
||||
this.ext3 = ext3;
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getDockingUserInfo() {
|
||||
return dockingUserInfo;
|
||||
}
|
||||
|
||||
public void setDockingUserInfo(List<Map<String, Object>> dockingUserInfo) {
|
||||
this.dockingUserInfo = dockingUserInfo;
|
||||
}
|
||||
|
||||
public String getFiledDesc() {
|
||||
return filedDesc;
|
||||
}
|
||||
|
||||
public void setFiledDesc(String filedDesc) {
|
||||
this.filedDesc = filedDesc;
|
||||
}
|
||||
|
||||
public Long getDockSum() {
|
||||
return dockSum;
|
||||
}
|
||||
|
||||
public void setDockSum(Long dockSum) {
|
||||
this.dockSum = dockSum;
|
||||
}
|
||||
|
||||
public String getShowAchievementName() {
|
||||
return showAchievementName;
|
||||
}
|
||||
|
||||
public void setShowAchievementName(String showAchievementName) {
|
||||
this.showAchievementName = showAchievementName;
|
||||
}
|
||||
|
||||
public String getUserImg() {
|
||||
return userImg;
|
||||
}
|
||||
|
||||
public void setUserImg(String userImg) {
|
||||
this.userImg = userImg;
|
||||
}
|
||||
|
||||
public String getUserNickName() {
|
||||
return userNickName;
|
||||
}
|
||||
|
||||
public void setUserNickName(String userNickName) {
|
||||
this.userNickName = userNickName;
|
||||
}
|
||||
|
||||
public String getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(String gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public String getUserLogin() {
|
||||
return userLogin;
|
||||
}
|
||||
|
||||
public void setUserLogin(String userLogin) {
|
||||
this.userLogin = userLogin;
|
||||
}
|
||||
|
||||
public String getField1Name() {
|
||||
return field1Name;
|
||||
}
|
||||
|
||||
public void setField1Name(String field1Name) {
|
||||
this.field1Name = field1Name;
|
||||
}
|
||||
|
||||
public Long getWatcherSum() {
|
||||
return watcherSum;
|
||||
}
|
||||
|
||||
public void setWatcherSum(Long watcherSum) {
|
||||
this.watcherSum = watcherSum;
|
||||
}
|
||||
|
||||
public Long getFavoriteSum() {
|
||||
return favoriteSum;
|
||||
}
|
||||
|
||||
public void setFavoriteSum(Long favoriteSum) {
|
||||
this.favoriteSum = favoriteSum;
|
||||
}
|
||||
|
||||
public Float getHotRank() {
|
||||
return hotRank;
|
||||
}
|
||||
|
||||
public void setHotRank(Float hotRank) {
|
||||
this.hotRank = hotRank;
|
||||
}
|
||||
|
||||
public Integer getIsExpertAudit() {
|
||||
return isExpertAudit;
|
||||
}
|
||||
|
||||
public void setIsExpertAudit(Integer isExpertAudit) {
|
||||
this.isExpertAudit = isExpertAudit;
|
||||
}
|
||||
|
||||
public Long getAttachmentCount() {
|
||||
return attachmentCount;
|
||||
}
|
||||
|
||||
public void setAttachmentCount(Long attachmentCount) {
|
||||
this.attachmentCount = attachmentCount;
|
||||
}
|
||||
|
||||
public Long getClickSum() {
|
||||
return clickSum;
|
||||
}
|
||||
|
||||
public void setClickSum(Long clickSum) {
|
||||
this.clickSum = clickSum;
|
||||
}
|
||||
|
||||
private List<KeyValVo> attachmentList;
|
||||
|
||||
public List<KeyValVo> getAttachmentList() {
|
||||
return attachmentList;
|
||||
}
|
||||
|
||||
public void setAttachmentList(List<KeyValVo> attachmentList) {
|
||||
this.attachmentList = attachmentList;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setAchievementName(String achievementName) {
|
||||
this.achievementName = achievementName;
|
||||
}
|
||||
|
||||
public String getAchievementName() {
|
||||
return achievementName;
|
||||
}
|
||||
|
||||
public void setField1(String field1) {
|
||||
this.field1 = field1;
|
||||
}
|
||||
|
||||
public String getField1() {
|
||||
return field1;
|
||||
}
|
||||
|
||||
public void setField2(String field2) {
|
||||
this.field2 = field2;
|
||||
}
|
||||
|
||||
public String getField2() {
|
||||
return field2;
|
||||
}
|
||||
|
||||
public void setField3(String field3) {
|
||||
this.field3 = field3;
|
||||
}
|
||||
|
||||
public String getField3() {
|
||||
return field3;
|
||||
}
|
||||
|
||||
public void setAchievementType(String achievementType) {
|
||||
this.achievementType = achievementType;
|
||||
}
|
||||
|
||||
public String getAchievementType() {
|
||||
return achievementType;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSourceId(Long sourceId) {
|
||||
this.sourceId = sourceId;
|
||||
}
|
||||
|
||||
public Long getSourceId() {
|
||||
return sourceId;
|
||||
}
|
||||
|
||||
public void setSourceLink(String sourceLink) {
|
||||
this.sourceLink = sourceLink;
|
||||
}
|
||||
|
||||
public String getSourceLink() {
|
||||
return sourceLink;
|
||||
}
|
||||
|
||||
public void setTags(String tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public String getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public void setSummary(String summary) {
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
public String getSummary() {
|
||||
return summary;
|
||||
}
|
||||
|
||||
public void setPublishingUnit(String publishingUnit) {
|
||||
this.publishingUnit = publishingUnit;
|
||||
}
|
||||
|
||||
public String getPublishingUnit() {
|
||||
return publishingUnit;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setIsFeatured(Integer isFeatured) {
|
||||
this.isFeatured = isFeatured;
|
||||
}
|
||||
|
||||
public Integer getIsFeatured() {
|
||||
return isFeatured;
|
||||
}
|
||||
|
||||
public void setContactPerson(String contactPerson) {
|
||||
this.contactPerson = contactPerson;
|
||||
}
|
||||
|
||||
public String getContactPerson() {
|
||||
return contactPerson;
|
||||
}
|
||||
|
||||
public void setContactNumber(String contactNumber) {
|
||||
this.contactNumber = contactNumber;
|
||||
}
|
||||
|
||||
public String getContactNumber() {
|
||||
return contactNumber;
|
||||
}
|
||||
|
||||
public void setOwnerId(String ownerId) {
|
||||
this.ownerId = ownerId;
|
||||
}
|
||||
|
||||
public String getOwnerId() {
|
||||
return ownerId;
|
||||
}
|
||||
|
||||
public void setOwnerName(String ownerName) {
|
||||
this.ownerName = ownerName;
|
||||
}
|
||||
|
||||
public String getOwnerName() {
|
||||
return ownerName;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setDetails(String details) {
|
||||
this.details = details;
|
||||
}
|
||||
|
||||
public String getDetails() {
|
||||
return details;
|
||||
}
|
||||
|
||||
public void setReviewer(String reviewer) {
|
||||
this.reviewer = reviewer;
|
||||
}
|
||||
|
||||
public String getReviewer() {
|
||||
return reviewer;
|
||||
}
|
||||
|
||||
public void setReviewDate(Date reviewDate) {
|
||||
this.reviewDate = reviewDate;
|
||||
}
|
||||
|
||||
public Date getReviewDate() {
|
||||
return reviewDate;
|
||||
}
|
||||
|
||||
public void setReviewComments(String reviewComments) {
|
||||
this.reviewComments = reviewComments;
|
||||
}
|
||||
|
||||
public String getReviewComments() {
|
||||
return reviewComments;
|
||||
}
|
||||
|
||||
public void setImages(String images) {
|
||||
this.images = images;
|
||||
}
|
||||
|
||||
public String getImages() {
|
||||
return images;
|
||||
}
|
||||
|
||||
public void setAttachments(String attachments) {
|
||||
this.attachments = attachments;
|
||||
}
|
||||
|
||||
public String getAttachments() {
|
||||
return attachments;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
public class AreaStatisticVo {
|
||||
//领域名称
|
||||
private String areaName;
|
||||
//领域key
|
||||
private String areaKey;
|
||||
//领域说明
|
||||
private String remark;
|
||||
//开源项目汇总
|
||||
private Long kyxmSum;
|
||||
//创客任务汇总
|
||||
private Long ckrwSum;
|
||||
//开放竞赛汇总
|
||||
private Long kfjsSum;
|
||||
//校企成果汇总
|
||||
private Long xqcgSum;
|
||||
private String source;
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getAreaName() {
|
||||
return areaName;
|
||||
}
|
||||
|
||||
public void setAreaName(String areaName) {
|
||||
this.areaName = areaName;
|
||||
}
|
||||
|
||||
public String getAreaKey() {
|
||||
return areaKey;
|
||||
}
|
||||
|
||||
public void setAreaKey(String areaKey) {
|
||||
this.areaKey = areaKey;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public Long getKyxmSum() {
|
||||
return kyxmSum;
|
||||
}
|
||||
|
||||
public void setKyxmSum(Long kyxmSum) {
|
||||
this.kyxmSum = kyxmSum;
|
||||
}
|
||||
|
||||
public Long getCkrwSum() {
|
||||
return ckrwSum;
|
||||
}
|
||||
|
||||
public void setCkrwSum(Long ckrwSum) {
|
||||
this.ckrwSum = ckrwSum;
|
||||
}
|
||||
|
||||
public Long getKfjsSum() {
|
||||
return kfjsSum;
|
||||
}
|
||||
|
||||
public void setKfjsSum(Long kfjsSum) {
|
||||
this.kfjsSum = kfjsSum;
|
||||
}
|
||||
|
||||
public Long getXqcgSum() {
|
||||
return xqcgSum;
|
||||
}
|
||||
|
||||
public void setXqcgSum(Long xqcgSum) {
|
||||
this.xqcgSum = xqcgSum;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class AreasTjVo {
|
||||
private Long areaSum;
|
||||
private List<KeyValueVo> areaDetails;
|
||||
|
||||
public Long getAreaSum() {
|
||||
return areaSum;
|
||||
}
|
||||
|
||||
public void setAreaSum(Long areaSum) {
|
||||
this.areaSum = areaSum;
|
||||
}
|
||||
|
||||
public List<KeyValueVo> getAreaDetails() {
|
||||
return areaDetails;
|
||||
}
|
||||
|
||||
public void setAreaDetails(List<KeyValueVo> areaDetails) {
|
||||
this.areaDetails = areaDetails;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BlockchainListQueryVo {
|
||||
private String projectName;
|
||||
private String issueName;
|
||||
private String prName;
|
||||
private String userName;
|
||||
private Long userId;
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
public class ExpertTotallVo {
|
||||
//专家名称
|
||||
private String name;
|
||||
//任务审核数
|
||||
private Long taskAuditSum;
|
||||
//竞赛审核数
|
||||
private Long competitionAuditSum;
|
||||
//总数
|
||||
private Long total;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Long getTaskAuditSum() {
|
||||
return taskAuditSum;
|
||||
}
|
||||
|
||||
public void setTaskAuditSum(Long taskAuditSum) {
|
||||
this.taskAuditSum = taskAuditSum;
|
||||
}
|
||||
|
||||
public Long getCompetitionAuditSum() {
|
||||
return competitionAuditSum;
|
||||
}
|
||||
|
||||
public void setCompetitionAuditSum(Long competitionAuditSum) {
|
||||
this.competitionAuditSum = competitionAuditSum;
|
||||
}
|
||||
|
||||
public Long getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(Long total) {
|
||||
this.total = total;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
public class HotAchVo {
|
||||
|
||||
private int watcher;
|
||||
private int faviter;
|
||||
private int total;
|
||||
private String gender;
|
||||
private String name;
|
||||
private String showAchievementName;
|
||||
private Long id;
|
||||
private String userNickName;
|
||||
private String userName;
|
||||
private String userImg;
|
||||
|
||||
public String getUserImg() {
|
||||
return userImg;
|
||||
}
|
||||
|
||||
public void setUserImg(String userImg) {
|
||||
this.userImg = userImg;
|
||||
}
|
||||
|
||||
public int getWatcher() {
|
||||
return watcher;
|
||||
}
|
||||
|
||||
public void setWatcher(int watcher) {
|
||||
this.watcher = watcher;
|
||||
}
|
||||
|
||||
public int getFaviter() {
|
||||
return faviter;
|
||||
}
|
||||
|
||||
public void setFaviter(int faviter) {
|
||||
this.faviter = faviter;
|
||||
}
|
||||
|
||||
public int getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(int total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public String getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(String gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUserNickName() {
|
||||
return userNickName;
|
||||
}
|
||||
|
||||
public void setUserNickName(String userNickName) {
|
||||
this.userNickName = userNickName;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getShowAchievementName() {
|
||||
return showAchievementName;
|
||||
}
|
||||
|
||||
public void setShowAchievementName(String showAchievementName) {
|
||||
this.showAchievementName = showAchievementName;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
public class KeyValueVo {
|
||||
private String key;
|
||||
private String name;
|
||||
private String result;
|
||||
private Long value;
|
||||
private Long value2;
|
||||
private Long total;
|
||||
|
||||
public Long getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(Long total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public Long getValue2() {
|
||||
return value2;
|
||||
}
|
||||
|
||||
public void setValue2(Long value2) {
|
||||
this.value2 = value2;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(String result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public Long getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(Long value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class MemoTotalVo {
|
||||
private Long id;
|
||||
private String subject;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "发布时间", hidden = true)
|
||||
private Date publishedAt;
|
||||
private Long viewedCount;
|
||||
private Long praisesCount;
|
||||
private Long repliesCount;
|
||||
private Long behavioreSum;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSubject() {
|
||||
return subject;
|
||||
}
|
||||
|
||||
public void setSubject(String subject) {
|
||||
this.subject = subject;
|
||||
}
|
||||
|
||||
public Date getPublishedAt() {
|
||||
return publishedAt;
|
||||
}
|
||||
|
||||
public void setPublishedAt(Date publishedAt) {
|
||||
this.publishedAt = publishedAt;
|
||||
}
|
||||
|
||||
public Long getViewedCount() {
|
||||
return viewedCount;
|
||||
}
|
||||
|
||||
public void setViewedCount(Long viewedCount) {
|
||||
this.viewedCount = viewedCount;
|
||||
}
|
||||
|
||||
public Long getPraisesCount() {
|
||||
return praisesCount;
|
||||
}
|
||||
|
||||
public void setPraisesCount(Long praisesCount) {
|
||||
this.praisesCount = praisesCount;
|
||||
}
|
||||
|
||||
public Long getRepliesCount() {
|
||||
return repliesCount;
|
||||
}
|
||||
|
||||
public void setRepliesCount(Long repliesCount) {
|
||||
this.repliesCount = repliesCount;
|
||||
}
|
||||
|
||||
public Long getBehavioreSum() {
|
||||
return behavioreSum;
|
||||
}
|
||||
|
||||
public void setBehavioreSum(Long behavioreSum) {
|
||||
this.behavioreSum = behavioreSum;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,467 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.microservices.common.core.annotation.Excel;
|
||||
import com.microservices.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 校企成果对象 school_enterprise_achievements
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
public class SchoolEnterpriseAchievements extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 成果唯一标识
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 成果名称
|
||||
*/
|
||||
@Excel(name = "成果名称")
|
||||
private String achievementName;
|
||||
|
||||
/**
|
||||
* 成果领域1
|
||||
*/
|
||||
@Excel(
|
||||
name = "成果领域",
|
||||
readConverterExp = "1=理论研究,2=政策法规,3=医学,4=电子信息,5=通信工程,6=计算机科学,7=软件工程,9=人工智能,10=知识图谱,12=大数据,23=机器人,24=无人系统,25=创意征集,26=文献翻译,27=成果转化,28=科技协同,29=科研组织模式,30=新兴领域,31=其他,32=电子元器件,33=测试仪器,34=军事历史,35=计算机网络"
|
||||
)
|
||||
private String field1;
|
||||
|
||||
/**
|
||||
* 成果领域2
|
||||
*/
|
||||
@Excel(name = "成果领域2")
|
||||
private String field2;
|
||||
|
||||
/**
|
||||
* 成果领域3
|
||||
*/
|
||||
@Excel(name = "成果领域3")
|
||||
private String field3;
|
||||
|
||||
/**
|
||||
* 成果类型
|
||||
*/
|
||||
@Excel(name = "成果类型", readConverterExp = "1=理论成果,2=技术成果,3=应用成果,4=软科学成果,5=文化艺术成果,6=社会服务成果,7=交叉领域成果")
|
||||
private String achievementType;
|
||||
|
||||
/**
|
||||
* 成果来源
|
||||
*/
|
||||
@Excel(name = "成果来源")
|
||||
private String source;
|
||||
|
||||
/**
|
||||
* 成果来源ID
|
||||
*/
|
||||
@Excel(name = "成果来源ID")
|
||||
private String sourceId;
|
||||
|
||||
/**
|
||||
* 成果来源跳转链接
|
||||
*/
|
||||
@Excel(name = "成果来源跳转链接")
|
||||
private String sourceLink;
|
||||
|
||||
/**
|
||||
* 成果标签
|
||||
*/
|
||||
@Excel(
|
||||
name = "成果标签",
|
||||
readConverterExp = "1=高校,2=企业,3=其他"
|
||||
)
|
||||
private String tags;
|
||||
|
||||
/**
|
||||
* 成果摘要
|
||||
*/
|
||||
@Excel(name = "成果摘要")
|
||||
private String summary;
|
||||
|
||||
/**
|
||||
* 发布单位
|
||||
*/
|
||||
@Excel(name = "发布单位")
|
||||
private String publishingUnit;
|
||||
|
||||
/**
|
||||
* 成果地址
|
||||
*/
|
||||
@Excel(name = "成果地址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 是否精选成果
|
||||
*/
|
||||
@Excel(name = "是否精选成果")
|
||||
private Integer isFeatured;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@Excel(name = "联系人")
|
||||
private String contactPerson;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@Excel(name = "联系电话")
|
||||
private String contactNumber;
|
||||
|
||||
/**
|
||||
* 成果所属人ID
|
||||
*/
|
||||
@Excel(name = "成果所属人ID")
|
||||
private String ownerId;
|
||||
|
||||
/**
|
||||
* 成果所属人名称
|
||||
*/
|
||||
@Excel(name = "成果所属人名称")
|
||||
private String ownerName;
|
||||
|
||||
/**
|
||||
* 成果状态
|
||||
*/
|
||||
@Excel(name = "校企成果的状态 1是通过,3是不通过")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 成果详情
|
||||
*/
|
||||
@Excel(name = "成果详情")
|
||||
private String details;
|
||||
|
||||
/**
|
||||
* 成果审核人
|
||||
*/
|
||||
@Excel(name = "成果审核人")
|
||||
private String reviewer;
|
||||
|
||||
/**
|
||||
* 成果审核时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "成果审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date reviewDate;
|
||||
|
||||
/**
|
||||
* 成果审核意见
|
||||
*/
|
||||
@Excel(name = "成果审核意见")
|
||||
private String reviewComments;
|
||||
|
||||
/**
|
||||
* 成果图片
|
||||
*/
|
||||
@Excel(name = "图片")
|
||||
private String images;
|
||||
|
||||
/**
|
||||
* 成果附件
|
||||
*/
|
||||
@Excel(name = "成果附件")
|
||||
private String attachments;
|
||||
private Integer achievementStatus;
|
||||
//成果小类型
|
||||
@Excel(
|
||||
name = "成果小类型",
|
||||
readConverterExp = "7=学术论文,8=学术专著,9=理论模型,10=发明专利,11=技术标准,12=软件系统,13=技术原型,14=产品设备,15=解决方案,16=示范工程,17=政策建议,18=咨询报告,19=行业标准,20=管理办法,21=文学作品,22=艺术作品,23=公益项目,24=社会调查报告,25=教育培训成果,26=理论模型+产品设备,27=学术论文+技术原型"
|
||||
)
|
||||
private String achievementLittleType;
|
||||
@Excel(
|
||||
name = "成果状态",
|
||||
readConverterExp = "1=已有阶段性成果,2=已有成熟成果,3=已公开发表,4=已对外发布,5=已开展应用,6=已形成商业化产品"
|
||||
)
|
||||
private String achievementCurStatus;
|
||||
//团队名称
|
||||
private String teamName;
|
||||
|
||||
private List<AchievementTeam> teamList;
|
||||
|
||||
public List<AchievementTeam> getTeamList() {
|
||||
return teamList;
|
||||
}
|
||||
|
||||
public void setTeamList(List<AchievementTeam> teamList) {
|
||||
this.teamList = teamList;
|
||||
}
|
||||
|
||||
public String getTeamName() {
|
||||
return teamName;
|
||||
}
|
||||
|
||||
public void setTeamName(String teamName) {
|
||||
this.teamName = teamName;
|
||||
}
|
||||
|
||||
public String getAchievementLittleType() {
|
||||
return achievementLittleType;
|
||||
}
|
||||
|
||||
public void setAchievementLittleType(String achievementLittleType) {
|
||||
this.achievementLittleType = achievementLittleType;
|
||||
}
|
||||
|
||||
public String getAchievementCurStatus() {
|
||||
return achievementCurStatus;
|
||||
}
|
||||
|
||||
public void setAchievementCurStatus(String achievementCurStatus) {
|
||||
this.achievementCurStatus = achievementCurStatus;
|
||||
}
|
||||
|
||||
public Integer getAchievementStatus() {
|
||||
return achievementStatus;
|
||||
}
|
||||
|
||||
public void setAchievementStatus(Integer achievementStatus) {
|
||||
this.achievementStatus = achievementStatus;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setAchievementName(String achievementName) {
|
||||
this.achievementName = achievementName;
|
||||
}
|
||||
|
||||
public String getAchievementName() {
|
||||
return achievementName;
|
||||
}
|
||||
|
||||
public void setField1(String field1) {
|
||||
this.field1 = field1;
|
||||
}
|
||||
|
||||
public String getField1() {
|
||||
return field1;
|
||||
}
|
||||
|
||||
public void setField2(String field2) {
|
||||
this.field2 = field2;
|
||||
}
|
||||
|
||||
public String getField2() {
|
||||
return field2;
|
||||
}
|
||||
|
||||
public void setField3(String field3) {
|
||||
this.field3 = field3;
|
||||
}
|
||||
|
||||
public String getField3() {
|
||||
return field3;
|
||||
}
|
||||
|
||||
public void setAchievementType(String achievementType) {
|
||||
this.achievementType = achievementType;
|
||||
}
|
||||
|
||||
public String getAchievementType() {
|
||||
return achievementType;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSourceId(String sourceId) {
|
||||
this.sourceId = sourceId;
|
||||
}
|
||||
|
||||
public String getSourceId() {
|
||||
return sourceId;
|
||||
}
|
||||
|
||||
public void setSourceLink(String sourceLink) {
|
||||
this.sourceLink = sourceLink;
|
||||
}
|
||||
|
||||
public String getSourceLink() {
|
||||
return sourceLink;
|
||||
}
|
||||
|
||||
public void setTags(String tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public String getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public void setSummary(String summary) {
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
public String getSummary() {
|
||||
return summary;
|
||||
}
|
||||
|
||||
public void setPublishingUnit(String publishingUnit) {
|
||||
this.publishingUnit = publishingUnit;
|
||||
}
|
||||
|
||||
public String getPublishingUnit() {
|
||||
return publishingUnit;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setIsFeatured(Integer isFeatured) {
|
||||
this.isFeatured = isFeatured;
|
||||
}
|
||||
|
||||
public Integer getIsFeatured() {
|
||||
return isFeatured;
|
||||
}
|
||||
|
||||
public void setContactPerson(String contactPerson) {
|
||||
this.contactPerson = contactPerson;
|
||||
}
|
||||
|
||||
public String getContactPerson() {
|
||||
return contactPerson;
|
||||
}
|
||||
|
||||
public void setContactNumber(String contactNumber) {
|
||||
this.contactNumber = contactNumber;
|
||||
}
|
||||
|
||||
public String getContactNumber() {
|
||||
return contactNumber;
|
||||
}
|
||||
|
||||
public void setOwnerId(String ownerId) {
|
||||
this.ownerId = ownerId;
|
||||
}
|
||||
|
||||
public String getOwnerId() {
|
||||
return ownerId;
|
||||
}
|
||||
|
||||
public void setOwnerName(String ownerName) {
|
||||
this.ownerName = ownerName;
|
||||
}
|
||||
|
||||
public String getOwnerName() {
|
||||
return ownerName;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setDetails(String details) {
|
||||
this.details = details;
|
||||
}
|
||||
|
||||
public String getDetails() {
|
||||
return details;
|
||||
}
|
||||
|
||||
public void setReviewer(String reviewer) {
|
||||
this.reviewer = reviewer;
|
||||
}
|
||||
|
||||
public String getReviewer() {
|
||||
return reviewer;
|
||||
}
|
||||
|
||||
public void setReviewDate(Date reviewDate) {
|
||||
this.reviewDate = reviewDate;
|
||||
}
|
||||
|
||||
public Date getReviewDate() {
|
||||
return reviewDate;
|
||||
}
|
||||
|
||||
public void setReviewComments(String reviewComments) {
|
||||
this.reviewComments = reviewComments;
|
||||
}
|
||||
|
||||
public String getReviewComments() {
|
||||
return reviewComments;
|
||||
}
|
||||
|
||||
public void setImages(String images) {
|
||||
this.images = images;
|
||||
}
|
||||
|
||||
public String getImages() {
|
||||
return images;
|
||||
}
|
||||
|
||||
public void setAttachments(String attachments) {
|
||||
this.attachments = attachments;
|
||||
}
|
||||
|
||||
public String getAttachments() {
|
||||
return attachments;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("achievementName", getAchievementName())
|
||||
.append("field1", getField1())
|
||||
.append("field2", getField2())
|
||||
.append("field3", getField3())
|
||||
.append("achievementType", getAchievementType())
|
||||
.append("source", getSource())
|
||||
.append("sourceId", getSourceId())
|
||||
.append("sourceLink", getSourceLink())
|
||||
.append("tags", getTags())
|
||||
.append("summary", getSummary())
|
||||
.append("publishingUnit", getPublishingUnit())
|
||||
.append("address", getAddress())
|
||||
.append("isFeatured", getIsFeatured())
|
||||
.append("contactPerson", getContactPerson())
|
||||
.append("contactNumber", getContactNumber())
|
||||
.append("ownerId", getOwnerId())
|
||||
.append("ownerName", getOwnerName())
|
||||
.append("status", getStatus())
|
||||
.append("details", getDetails())
|
||||
.append("reviewer", getReviewer())
|
||||
.append("reviewDate", getReviewDate())
|
||||
.append("reviewComments", getReviewComments())
|
||||
.append("images", getImages())
|
||||
.append("attachments", getAttachments())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.microservices.dms.achievementLibrary.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class TokenListVo {
|
||||
|
||||
private Long id; // 项目ID
|
||||
private String name; // 项目名称
|
||||
private String userId;//用户id
|
||||
private Long totalToken; // 项目总Token
|
||||
private String createBy; // 创建人
|
||||
private Long issueToken;//issueToken
|
||||
private Long currentToken; // 当前Token
|
||||
private String repositoryName; // 仓库名称
|
||||
private Long repositoryId; // 仓库名称
|
||||
private Long applyToken;//已分配token
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createdOn; // 项目创建时间
|
||||
private Long ableApplyToken;//责任人可分配token
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
package com.microservices.dms.achievementLibrary.domain.blockchain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.microservices.common.core.annotation.Excel;
|
||||
import com.microservices.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 区块链数据入链对象 in_blockchain_data
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-05-27
|
||||
*/
|
||||
public class InBlockchainData extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 数据类型pr、issue、commit */
|
||||
@Excel(name = "数据类型pr、issue、commit")
|
||||
private String type;
|
||||
|
||||
/** 关联类型的唯一标识符 */
|
||||
@Excel(name = "关联类型的唯一标识符")
|
||||
private String typeId;
|
||||
|
||||
/** 交易哈希值 */
|
||||
@Excel(name = "交易哈希值")
|
||||
private String txHash;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
public void setTypeId(String typeId)
|
||||
{
|
||||
this.typeId = typeId;
|
||||
}
|
||||
|
||||
public String getTypeId()
|
||||
{
|
||||
return typeId;
|
||||
}
|
||||
public void setTxHash(String txHash)
|
||||
{
|
||||
this.txHash = txHash;
|
||||
}
|
||||
|
||||
public String getTxHash()
|
||||
{
|
||||
return txHash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("type", getType())
|
||||
.append("typeId", getTypeId())
|
||||
.append("txHash", getTxHash())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.microservices.dms.achievementLibrary.domain.blockchain;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class InLinkProjectVo implements Serializable {
|
||||
private Long amount;
|
||||
|
||||
private String projectId;
|
||||
|
||||
private String userId;
|
||||
|
||||
public Long getAmount() {
|
||||
return this.amount;
|
||||
}
|
||||
|
||||
public void setAmount(Long amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public String getProjectId() {
|
||||
return this.projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(String projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return this.userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,152 @@
|
|||
package com.microservices.dms.achievementLibrary.domain.blockchain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.microservices.common.core.annotation.Excel;
|
||||
import com.microservices.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 用户/项目转账信息记录对象 user_project_transfer_records
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-05-27
|
||||
*/
|
||||
public class UserProjectTransferRecords extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 唯一标识每条记录 */
|
||||
private Long id;
|
||||
|
||||
/** 付款方ID */
|
||||
@Excel(name = "付款方ID")
|
||||
private String payerId;
|
||||
|
||||
/** 项目ID */
|
||||
@Excel(name = "项目ID")
|
||||
private String projectId;
|
||||
|
||||
/** 转账金额,支持高精度数值 */
|
||||
@Excel(name = "转账金额,支持高精度数值")
|
||||
private BigDecimal token;
|
||||
|
||||
/** 收款方ID */
|
||||
@Excel(name = "收款方ID")
|
||||
private String payeeId;
|
||||
|
||||
/** 交易哈希值,确保每一笔交易唯一 */
|
||||
@Excel(name = "交易哈希值,确保每一笔交易唯一")
|
||||
private String txHash;
|
||||
|
||||
/** 转账类型:project、user */
|
||||
@Excel(name = "转账类型:project、user")
|
||||
private String type;
|
||||
|
||||
/** 备用字段1 */
|
||||
@Excel(name = "备用字段1")
|
||||
private String reserve1;
|
||||
|
||||
/** 备用字段2 */
|
||||
@Excel(name = "备用字段2")
|
||||
private String reserve2;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setPayerId(String payerId)
|
||||
{
|
||||
this.payerId = payerId;
|
||||
}
|
||||
|
||||
public String getPayerId()
|
||||
{
|
||||
return payerId;
|
||||
}
|
||||
public void setProjectId(String projectId)
|
||||
{
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public String getProjectId()
|
||||
{
|
||||
return projectId;
|
||||
}
|
||||
public void setToken(BigDecimal token)
|
||||
{
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public BigDecimal getToken()
|
||||
{
|
||||
return token;
|
||||
}
|
||||
public void setPayeeId(String payeeId)
|
||||
{
|
||||
this.payeeId = payeeId;
|
||||
}
|
||||
|
||||
public String getPayeeId()
|
||||
{
|
||||
return payeeId;
|
||||
}
|
||||
public void setTxHash(String txHash)
|
||||
{
|
||||
this.txHash = txHash;
|
||||
}
|
||||
|
||||
public String getTxHash()
|
||||
{
|
||||
return txHash;
|
||||
}
|
||||
public void setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
public void setReserve1(String reserve1)
|
||||
{
|
||||
this.reserve1 = reserve1;
|
||||
}
|
||||
|
||||
public String getReserve1()
|
||||
{
|
||||
return reserve1;
|
||||
}
|
||||
public void setReserve2(String reserve2)
|
||||
{
|
||||
this.reserve2 = reserve2;
|
||||
}
|
||||
|
||||
public String getReserve2()
|
||||
{
|
||||
return reserve2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("payerId", getPayerId())
|
||||
.append("projectId", getProjectId())
|
||||
.append("token", getToken())
|
||||
.append("payeeId", getPayeeId())
|
||||
.append("txHash", getTxHash())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("type", getType())
|
||||
.append("reserve1", getReserve1())
|
||||
.append("reserve2", getReserve2())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.microservices.dms.achievementLibrary.domain.blockchain;
|
||||
|
||||
public class UserVo {
|
||||
private Long id;
|
||||
private String nickname;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getNickname() {
|
||||
return nickname;
|
||||
}
|
||||
|
||||
public void setNickname(String nickname) {
|
||||
this.nickname = nickname;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.microservices.dms.achievementLibrary.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchievementDictData;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 成果相关字典Mapper接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-05-23
|
||||
*/
|
||||
@Mapper
|
||||
@Slave
|
||||
public interface AchievementDictDataMapper
|
||||
{
|
||||
/**
|
||||
* 查询成果相关字典
|
||||
*
|
||||
* @param dictCode 成果相关字典主键
|
||||
* @return 成果相关字典
|
||||
*/
|
||||
public AchievementDictData selectAchievementDictDataByDictCode(Long dictCode);
|
||||
|
||||
/**
|
||||
* 查询成果相关字典列表
|
||||
*
|
||||
* @param achievementDictData 成果相关字典
|
||||
* @return 成果相关字典集合
|
||||
*/
|
||||
public List<AchievementDictData> selectAchievementDictDataList(AchievementDictData achievementDictData);
|
||||
|
||||
/**
|
||||
* 新增成果相关字典
|
||||
*
|
||||
* @param achievementDictData 成果相关字典
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAchievementDictData(AchievementDictData achievementDictData);
|
||||
|
||||
/**
|
||||
* 修改成果相关字典
|
||||
*
|
||||
* @param achievementDictData 成果相关字典
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAchievementDictData(AchievementDictData achievementDictData);
|
||||
|
||||
/**
|
||||
* 删除成果相关字典
|
||||
*
|
||||
* @param dictCode 成果相关字典主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementDictDataByDictCode(Long dictCode);
|
||||
|
||||
/**
|
||||
* 批量删除成果相关字典
|
||||
*
|
||||
* @param dictCodes 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementDictDataByDictCodes(Long[] dictCodes);
|
||||
|
||||
List<KeyValueVo> selectDictDataByType(@Param("dictType") String dictType);
|
||||
|
||||
int selectDictDataByLabel(@Param("label") String label,@Param("type") String type);
|
||||
|
||||
List<String> getDictTypes();
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.microservices.dms.achievementLibrary.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchievementTeam;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 成果团队Mapper接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-23
|
||||
*/
|
||||
@Mapper
|
||||
@Slave
|
||||
public interface AchievementTeamMapper
|
||||
{
|
||||
/**
|
||||
* 查询成果团队
|
||||
*
|
||||
* @param id 成果团队主键
|
||||
* @return 成果团队
|
||||
*/
|
||||
public AchievementTeam selectAchievementTeamById(Long id);
|
||||
|
||||
/**
|
||||
* 查询成果团队列表
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 成果团队集合
|
||||
*/
|
||||
public List<AchievementTeam> selectAchievementTeamList(AchievementTeam achievementTeam);
|
||||
|
||||
/**
|
||||
* 新增成果团队
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAchievementTeam(AchievementTeam achievementTeam);
|
||||
|
||||
/**
|
||||
* 修改成果团队
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAchievementTeam(AchievementTeam achievementTeam);
|
||||
|
||||
/**
|
||||
* 删除成果团队
|
||||
*
|
||||
* @param id 成果团队主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementTeamById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除成果团队
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementTeamByIds(Long[] ids);
|
||||
|
||||
void deleteAchievementTeamByAId(@Param("aid") Long aid);
|
||||
|
||||
List<AchievementTeam> selectAchievementTeamByAchId(@Param("achId") Long achId);
|
||||
}
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
package com.microservices.dms.achievementLibrary.mapper;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.microservices.common.datasource.annotation.Master;
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.achievementLibrary.domain.*;
|
||||
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.CompetitionResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.domain.TaskResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.PropertyValues;
|
||||
|
||||
/**
|
||||
* 成果Mapper接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-02
|
||||
*/
|
||||
@Mapper
|
||||
@Slave
|
||||
public interface AchievementsMapper {
|
||||
/**
|
||||
* 查询成果
|
||||
*
|
||||
* @param id 成果主键
|
||||
* @return 成果
|
||||
*/
|
||||
public Achievements selectAchievementsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询成果列表
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 成果集合
|
||||
*/
|
||||
public List<Achievements> selectAchievementsList(Achievements achievements);
|
||||
|
||||
/**
|
||||
* 新增成果
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAchievements(Achievements achievements);
|
||||
|
||||
/**
|
||||
* 修改成果
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAchievements(Achievements achievements);
|
||||
|
||||
/**
|
||||
* 删除成果
|
||||
*
|
||||
* @param id 成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementsById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除成果
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementsByIds(Long[] ids);
|
||||
|
||||
@MapKey("k")
|
||||
@Master
|
||||
List<Map<String, String>> getFileInfoByIdents(@Param("idents") Set<String> idents);
|
||||
|
||||
List<Achievements> getChoiceImport();
|
||||
|
||||
List<KeyValueVo> getTjBySources();
|
||||
|
||||
List<KeyValueVo> getTjByAreas();
|
||||
|
||||
List<Achievements> selectAchievementsByParam(AchQueryVo achQueryVo);
|
||||
|
||||
Long getAchievementClickSum(@Param("id") Long id);
|
||||
|
||||
List<KeyValVo<String, Long>> getaWatcher(@Param("s") Date s, @Param("e") Date e, @Param("t") String achievements);
|
||||
|
||||
List<KeyValVo<String, Long>> getFavorite(@Param("s") Date s, @Param("e") Date e, @Param("t") String achievements);
|
||||
|
||||
List<KeyValVo<String, Long>> getAchievement(@Param("s") Date s, @Param("e") Date e, @Param("t") String source);
|
||||
|
||||
List<HotAchVo> getHotAchievement();
|
||||
|
||||
Map<String, Long> indexProjectStatistic();
|
||||
|
||||
Map<String, Object> indexTaskStatistic();
|
||||
|
||||
Map<String, Long> indexCompetitionStatistic();
|
||||
|
||||
Long indexSchoolEnterpriseStatistic(@Param("s") String s, @Param("t") String tags);
|
||||
|
||||
List<KeyValueVo> getAreasByName(@Param("areaName") String areaName);
|
||||
|
||||
AchievementBehaviorSumVo getActDataStatisticById(@Param("id") Long id);
|
||||
|
||||
List<KeyValVo<String, Long>> get7AddClickById(@Param("s") Date s, @Param("e") Date e, @Param("t") String achievements, @Param("id") String id);
|
||||
|
||||
AchievementBehaviorSumVo getWatchFavoriteStatusById(@Param("id") Long id, @Param("userId")Long userId);
|
||||
|
||||
Long countAchievementBySource(@Param("s") Date s, @Param("e") Date e, @Param("t") String achievements);
|
||||
|
||||
List<Map<String, Object>> getAchievementDataYearly();
|
||||
|
||||
List<Map<String, Object>> getAchievementType();
|
||||
|
||||
List<KeyValueVo> getAchievementActData(@Param("s") Date s, @Param("e") Date e);
|
||||
|
||||
List<Map<String, Object>> getAchievementDomain();
|
||||
|
||||
List<Map<String, Object>> getAchievementAddYearly();
|
||||
|
||||
List<Map<String, Object>> getAchievementHotRank();
|
||||
|
||||
List<Long> getAllId();
|
||||
|
||||
List<AreaStatisticVo> getAreaStatistic(@Param("source")String source,@Param("areaKey") String areaKey);
|
||||
|
||||
List<AchRelatedVo> getRelatedAch(@Param("id")Long id, @Param("sourceId") List<Long> sourceId, @Param("paramYear")String paramYear);
|
||||
|
||||
List<String> getDistinctYear(@Param("id")Long id, @Param("sourceId")List<Long> sourceId);
|
||||
|
||||
List<Long> selectAchievementsByName(@Param("achName") String achName);
|
||||
|
||||
String getField1NameByParam(@Param("source")String source, @Param("id") Long id);
|
||||
|
||||
List<KeyValueVo> getProjectAreasByName(@Param("areaName") String areaName);
|
||||
|
||||
List<String> getExpertAreasByName(@Param("areaName") String areaName);
|
||||
|
||||
List<Long> getAllSourceId(@Param("id")Long id, @Param("sourceId")Long sourceId);
|
||||
|
||||
List<Long> getAllSourceIdCompetition(@Param("id")Long id, @Param("sourceId")Long sourceId);
|
||||
|
||||
List<Long> getAllSourceIdTask(@Param("id")Long id, @Param("sourceId")Long sourceId);
|
||||
|
||||
List<TaskResourceLibrary> getRelatedAchTaskOfExpert(@Param("id")Long id);
|
||||
|
||||
List<CompetitionResourceLibrary> getRelatedAchCompetitionOfExpert(@Param("id")Long id);
|
||||
|
||||
List<KeyValVo<String,Long>> getAchievementAddYearlyData(@Param("s") Date s, @Param("e") Date e);
|
||||
|
||||
List<KeyValueVo> getAchievementActDataW(@Param("s") Date s, @Param("e") Date e);
|
||||
|
||||
List<KeyValueVo> getAchievementActDataC(@Param("s") Date s, @Param("e") Date e);
|
||||
|
||||
List<KeyValueVo> getAchievementActDataD(@Param("s") Date s, @Param("e") Date e);
|
||||
List<KeyValueVo> getAchievementActDataF(@Param("s") Date s, @Param("e") Date e);
|
||||
|
||||
List<Map<String, Object>> getDockingUserInfo(@Param("id") Long id);
|
||||
|
||||
List<Achievements> selectAchievementsByArea(AchQueryVo achQueryVo);
|
||||
|
||||
List<KeyValVo<String, Long>> getExperts(@Param("s") Date s, @Param("e") Date e);
|
||||
|
||||
List<KeyValueVo> getAllAreas(@Param("areaName") String areaName);
|
||||
|
||||
void updateRelationAchievements(@Param("source") String source,@Param("sourceId") Long sourceId);
|
||||
|
||||
List<Map<String, Object>> getDockingUserInfoList(@Param("id") Long id);
|
||||
|
||||
String getField1RemarkByParam(@Param("source")String source,@Param("areaKey") String areaKey);
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
package com.microservices.dms.achievementLibrary.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.achievementLibrary.domain.BlockchainListQueryVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.blockchain.InBlockchainData;
|
||||
import com.microservices.dms.common.vo.CommitCreateVo;
|
||||
import com.microservices.dms.common.vo.CommitResultVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 区块链数据入链Mapper接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-05-27
|
||||
*/
|
||||
@Mapper
|
||||
@Slave
|
||||
public interface InBlockchainDataMapper
|
||||
{
|
||||
/**
|
||||
* 查询区块链数据入链
|
||||
*
|
||||
* @param id 区块链数据入链主键
|
||||
* @return 区块链数据入链
|
||||
*/
|
||||
public InBlockchainData selectInBlockchainDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询区块链数据入链列表
|
||||
*
|
||||
* @param inBlockchainData 区块链数据入链
|
||||
* @return 区块链数据入链集合
|
||||
*/
|
||||
public List<InBlockchainData> selectInBlockchainDataList(InBlockchainData inBlockchainData);
|
||||
|
||||
/**
|
||||
* 新增区块链数据入链
|
||||
*
|
||||
* @param inBlockchainData 区块链数据入链
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertInBlockchainData(InBlockchainData inBlockchainData);
|
||||
|
||||
/**
|
||||
* 修改区块链数据入链
|
||||
*
|
||||
* @param inBlockchainData 区块链数据入链
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateInBlockchainData(InBlockchainData inBlockchainData);
|
||||
|
||||
/**
|
||||
* 删除区块链数据入链
|
||||
*
|
||||
* @param id 区块链数据入链主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInBlockchainDataById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除区块链数据入链
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInBlockchainDataByIds(Long[] ids);
|
||||
|
||||
List<Map<String, Object>> issueDataList(BlockchainListQueryVo queryVo);
|
||||
|
||||
List<Map<String, Object>> commitDataList(BlockchainListQueryVo queryVo);
|
||||
|
||||
List<Map<String, Object>> prDataList(BlockchainListQueryVo queryVo);
|
||||
|
||||
List<String> getNeedToBlockCommitList();
|
||||
|
||||
List<CommitResultVo> getCommitListById(@Param("projectId") String projectId);
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.microservices.dms.achievementLibrary.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.achievementLibrary.domain.SchoolEnterpriseAchievements;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 校企成果Mapper接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
@Mapper
|
||||
@Slave
|
||||
public interface SchoolEnterpriseAchievementsMapper
|
||||
{
|
||||
/**
|
||||
* 查询校企成果
|
||||
*
|
||||
* @param id 校企成果主键
|
||||
* @return 校企成果
|
||||
*/
|
||||
public SchoolEnterpriseAchievements selectSchoolEnterpriseAchievementsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询校企成果列表
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 校企成果集合
|
||||
*/
|
||||
public List<SchoolEnterpriseAchievements> selectSchoolEnterpriseAchievementsList(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
|
||||
/**
|
||||
* 新增校企成果
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSchoolEnterpriseAchievements(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
|
||||
/**
|
||||
* 修改校企成果
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSchoolEnterpriseAchievements(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
|
||||
/**
|
||||
* 删除校企成果
|
||||
*
|
||||
* @param id 校企成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSchoolEnterpriseAchievementsById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除校企成果
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSchoolEnterpriseAchievementsByIds(Long[] ids);
|
||||
|
||||
Long topStatistic(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
|
||||
SchoolEnterpriseAchievements selectSchoolEnterpriseAchievementsByName(@Param("achievementName") String achievementName);
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package com.microservices.dms.achievementLibrary.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.achievementLibrary.domain.BlockchainListQueryVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.blockchain.UserProjectTransferRecords;
|
||||
import com.microservices.dms.achievementLibrary.domain.blockchain.UserVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 用户/项目转账信息记录Mapper接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-05-27
|
||||
*/
|
||||
@Mapper
|
||||
@Slave
|
||||
public interface UserProjectTransferRecordsMapper
|
||||
{
|
||||
/**
|
||||
* 查询用户/项目转账信息记录
|
||||
*
|
||||
* @param id 用户/项目转账信息记录主键
|
||||
* @return 用户/项目转账信息记录
|
||||
*/
|
||||
public UserProjectTransferRecords selectUserProjectTransferRecordsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询用户/项目转账信息记录列表
|
||||
*
|
||||
* @param userProjectTransferRecords 用户/项目转账信息记录
|
||||
* @return 用户/项目转账信息记录集合
|
||||
*/
|
||||
public List<UserProjectTransferRecords> selectUserProjectTransferRecordsList(UserProjectTransferRecords userProjectTransferRecords);
|
||||
|
||||
/**
|
||||
* 新增用户/项目转账信息记录
|
||||
*
|
||||
* @param userProjectTransferRecords 用户/项目转账信息记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertUserProjectTransferRecords(UserProjectTransferRecords userProjectTransferRecords);
|
||||
|
||||
/**
|
||||
* 修改用户/项目转账信息记录
|
||||
*
|
||||
* @param userProjectTransferRecords 用户/项目转账信息记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUserProjectTransferRecords(UserProjectTransferRecords userProjectTransferRecords);
|
||||
|
||||
/**
|
||||
* 删除用户/项目转账信息记录
|
||||
*
|
||||
* @param id 用户/项目转账信息记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUserProjectTransferRecordsById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除用户/项目转账信息记录
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUserProjectTransferRecordsByIds(Long[] ids);
|
||||
|
||||
List<Map> userDataList(BlockchainListQueryVo queryVo);
|
||||
|
||||
List<UserVo> userList(UserVo userVo);
|
||||
}
|
||||
|
|
@ -0,0 +1,223 @@
|
|||
package com.microservices.dms.achievementLibrary.service;
|
||||
|
||||
import com.alibaba.nacos.shaded.com.google.common.collect.Maps;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import com.microservices.dms.resourceLibrary.mapper.CompetitionResourceLibraryMapper;
|
||||
import com.microservices.dms.utils.DateUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class BigScreenStatisticService {
|
||||
|
||||
private final AchievementsMapper achievementsMapper;
|
||||
private final CompetitionResourceLibraryMapper competitionResourceLibraryMapper;
|
||||
|
||||
public Map<String, Object> getAchievementTopStatistic(String source) {
|
||||
//获取本周(近7天)的数据
|
||||
Date[] days = DateUtil.getDays(0, 6);
|
||||
Map<String, Long> m = achievementsMapper.getAchievement(days[0], days[1], source)
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
|
||||
//获取上周(7-14天前)的数据
|
||||
Date[] lastDays = DateUtil.getDays(7, 13);
|
||||
long lastSum = Optional.ofNullable(achievementsMapper.countAchievementBySource(lastDays[0], lastDays[1], source)).orElse(0L);
|
||||
long sum = Optional.ofNullable(achievementsMapper.countAchievementBySource(null, null, source)).orElse(0L);
|
||||
long cSum = m.values().stream().mapToLong(Long::longValue).sum();
|
||||
//计算本周/上周增长%
|
||||
double rate;
|
||||
if (lastSum == 0) rate = 100D;
|
||||
else {
|
||||
rate = (double) (cSum - lastSum) / lastSum;
|
||||
}
|
||||
|
||||
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
||||
for (String s : dateStr) {
|
||||
Long a = m.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
res.add(k1);
|
||||
}
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("list", res);
|
||||
map.put("sum", sum);
|
||||
map.put("rate", rate);
|
||||
return map;
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getAchievementDataYearly() {
|
||||
return achievementsMapper.getAchievementDataYearly();
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getAchievementType() {
|
||||
return achievementsMapper.getAchievementType();
|
||||
}
|
||||
|
||||
public List<Map<String,Object>> getAchievementActData() {
|
||||
Date[] days = DateUtil.getDays(0, 6);
|
||||
Map<String, Long> wlist = achievementsMapper.getAchievementActDataW(days[0], days[1]).stream().collect(Collectors.toMap(KeyValueVo::getName, KeyValueVo::getValue));
|
||||
Map<String, Long> clist = achievementsMapper.getAchievementActDataC(days[0], days[1]).stream().collect(Collectors.toMap(KeyValueVo::getName, KeyValueVo::getValue));
|
||||
Map<String, Long> dlist = achievementsMapper.getAchievementActDataD(days[0], days[1]).stream().collect(Collectors.toMap(KeyValueVo::getName, KeyValueVo::getValue));
|
||||
Map<String, Long> flist = achievementsMapper.getAchievementActDataF(days[0], days[1]).stream().collect(Collectors.toMap(KeyValueVo::getName, KeyValueVo::getValue));
|
||||
|
||||
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
|
||||
List<KeyValueVo> wres = new ArrayList<>();
|
||||
List<KeyValueVo> cres = new ArrayList<>();
|
||||
List<KeyValueVo> dres = new ArrayList<>();
|
||||
List<KeyValueVo> fres = new ArrayList<>();
|
||||
|
||||
for (String s : dateStr) {
|
||||
Long a = wlist.getOrDefault(s, 0L);
|
||||
KeyValueVo k1 = new KeyValueVo();
|
||||
k1.setKey(s);
|
||||
k1.setValue(a);
|
||||
k1.setName("关注");
|
||||
wres.add(k1);
|
||||
}
|
||||
|
||||
for (String s : dateStr) {
|
||||
Long a = clist.getOrDefault(s, 0L);
|
||||
KeyValueVo k1 = new KeyValueVo();
|
||||
k1.setKey(s);
|
||||
k1.setValue(a);
|
||||
k1.setName("浏览");
|
||||
cres.add(k1);
|
||||
}
|
||||
|
||||
|
||||
for (String s : dateStr) {
|
||||
Long a = dlist.getOrDefault(s, 0L);
|
||||
KeyValueVo k1 = new KeyValueVo();
|
||||
k1.setKey(s);
|
||||
k1.setValue(a);
|
||||
k1.setName("下载");
|
||||
dres.add(k1);
|
||||
}
|
||||
|
||||
for (String s : dateStr) {
|
||||
Long a = flist.getOrDefault(s, 0L);
|
||||
KeyValueVo k1 = new KeyValueVo();
|
||||
k1.setKey(s);
|
||||
k1.setValue(a);
|
||||
k1.setName("收藏");
|
||||
fres.add(k1);
|
||||
}
|
||||
|
||||
List<Map<String, Object>> r = new ArrayList<>();
|
||||
Map<String, Object> w = new HashMap<>();
|
||||
w.put("key", "关注");
|
||||
w.put("value", wres);
|
||||
Map<String, Object> c = new HashMap<>();
|
||||
c.put("key","浏览");
|
||||
c.put("value", cres);
|
||||
Map<String, Object> d = new HashMap<>();
|
||||
d.put("key","下载");
|
||||
d.put("value", dres);
|
||||
Map<String, Object> f = new HashMap<>();
|
||||
f.put("key", "收藏");
|
||||
f.put("value", fres);
|
||||
|
||||
|
||||
r.add(w);
|
||||
r.add(c);
|
||||
r.add(d);
|
||||
r.add(f);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getAchievementDomain() {
|
||||
return achievementsMapper.getAchievementDomain();
|
||||
}
|
||||
|
||||
public Object getAchievementAddYearly() {
|
||||
|
||||
Date[] currentYear = DateUtil.getLast12Months();
|
||||
|
||||
Map<String, Long> m = achievementsMapper.getAchievementAddYearlyData(currentYear[0],currentYear[1])
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
List<String> dateStr = DateUtil.getDateStrYYYYMM(currentYear[0], currentYear[1]);
|
||||
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
||||
for (String s : dateStr) {
|
||||
Long a = m.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
res.add(k1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getAchievementHotRank() {
|
||||
return achievementsMapper.getAchievementHotRank();
|
||||
}
|
||||
|
||||
public Map<String, Object> getCompetitionTopStatistic() {
|
||||
Map<String, Object> res = new HashMap<>();
|
||||
Long finish = competitionResourceLibraryMapper.getCompetitionFinish();
|
||||
res.put("finish", finish);
|
||||
Long enroll = competitionResourceLibraryMapper.getCompetitionEnroll();
|
||||
res.put("enroll", enroll);
|
||||
Long underway = competitionResourceLibraryMapper.getCompetitionUnderway();
|
||||
res.put("underway", underway);
|
||||
Long submitCount = competitionResourceLibraryMapper.getCompetitionSubmitCount();
|
||||
res.put("submitCount", submitCount);
|
||||
Long transfer = competitionResourceLibraryMapper.getCompetitionTransferCount();
|
||||
res.put("transfer", transfer);
|
||||
Long needAudit = competitionResourceLibraryMapper.getCompetitionNeedAuditCount();
|
||||
res.put("needAudit", needAudit);
|
||||
return res;
|
||||
}
|
||||
|
||||
public List<KeyValueVo> getCompetitionStatisticYearly() {
|
||||
return competitionResourceLibraryMapper.getCompetitionStatisticYearly();
|
||||
}
|
||||
|
||||
public Object getCompetitionHot() {
|
||||
return competitionResourceLibraryMapper.getCompetitionHot();
|
||||
}
|
||||
|
||||
|
||||
public List<KeyValVo<String, Long>> getCompetitionYearlyPaperAdd() {
|
||||
Date[] currentYear = DateUtil.getLast12Months();
|
||||
|
||||
Map<String, Long> m = competitionResourceLibraryMapper.getCompetitionYearlyPaperAdd(currentYear[0],currentYear[1])
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
List<String> dateStr = DateUtil.getDateStrYYYYMM(currentYear[0], currentYear[1]);
|
||||
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
||||
for (String s : dateStr) {
|
||||
Long a = m.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
res.add(k1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public List<KeyValVo<String, Long>> getCompetitionYearlyFinish() {
|
||||
Date[] currentYear = DateUtil.getLast12Months();
|
||||
|
||||
Map<String, Long> m = competitionResourceLibraryMapper.getCompetitionYearlyFinish(currentYear[0],currentYear[1])
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
List<String> dateStr = DateUtil.getDateStrYYYYMM(currentYear[0], currentYear[1]);
|
||||
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
||||
for (String s : dateStr) {
|
||||
Long a = m.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
res.add(k1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,614 @@
|
|||
package com.microservices.dms.achievementLibrary.service;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.common.core.exception.ServiceException;
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.httpClient.service.HttpAPIService;
|
||||
import com.microservices.common.security.utils.SecurityUtils;
|
||||
import com.microservices.dms.achievementLibrary.domain.Achievements;
|
||||
import com.microservices.dms.achievementLibrary.domain.BlockchainListQueryVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.TokenListVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.blockchain.InBlockchainData;
|
||||
import com.microservices.dms.achievementLibrary.domain.blockchain.InLinkProjectVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.blockchain.UserProjectTransferRecords;
|
||||
import com.microservices.dms.achievementLibrary.domain.blockchain.UserVo;
|
||||
import com.microservices.dms.achievementLibrary.mapper.InBlockchainDataMapper;
|
||||
import com.microservices.dms.achievementLibrary.mapper.UserProjectTransferRecordsMapper;
|
||||
import com.microservices.dms.behaviorImage.domain.AchievementImageVo;
|
||||
import com.microservices.dms.common.vo.*;
|
||||
import com.microservices.dms.referral.mapper.TalentReferralMapper;
|
||||
import com.microservices.dms.resourceLibrary.mapper.ProjectResourceLibraryMapper;
|
||||
import com.microservices.dms.utils.DateUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
//import org.fisco.bcos.sdk.client.Client;
|
||||
//import org.fisco.bcos.sdk.client.protocol.request.Transaction;
|
||||
//import org.fisco.bcos.sdk.client.protocol.response.BcosTransaction;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
|
||||
import static com.microservices.common.core.utils.DateUtils.YYYY_MM_DD_HH_MM_SS;
|
||||
import static com.microservices.common.core.utils.PageUtils.startPage;
|
||||
import static com.microservices.dms.constant.BlockChainFunConstants.*;
|
||||
import static com.microservices.dms.utils.DateUtil.formatLocalDateTimePlusH;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BlockChainService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ProjectResourceLibraryMapper projectResourceLibraryMapper;
|
||||
|
||||
@Value("${gitlink.fiscobcosUrl:localhost}")
|
||||
public String fiscobcosUrl;
|
||||
|
||||
@Autowired
|
||||
private HttpAPIService httpAPIService;
|
||||
|
||||
@Autowired
|
||||
private InBlockchainDataMapper inBlockchainDataMapper;
|
||||
|
||||
@Autowired
|
||||
private UserProjectTransferRecordsMapper userProjectTransferRecordsMapper;
|
||||
|
||||
@Autowired
|
||||
private TalentReferralMapper talentReferralMapper;
|
||||
|
||||
public List<TokenListVo> projectTokenList(String projectName) {
|
||||
List<TokenListVo> list = projectResourceLibraryMapper.selectProjectInfos(projectName);
|
||||
for (TokenListVo v : list) {
|
||||
JSONObject param = queryProjectInfo(v);
|
||||
if(param != null) {
|
||||
Long issueTokenSum = projectResourceLibraryMapper.sumProjectIssueToken(v.getId());
|
||||
v.setIssueToken(issueTokenSum);
|
||||
long totalToken = Long.parseLong(param.getString("total_supply"));//总token
|
||||
v.setTotalToken(totalToken);
|
||||
//根据创建人login,获取对应的用户id
|
||||
String userName = v.getUserId();
|
||||
//根据创建人、项目Id,获取创建人拥有token
|
||||
String tokenName = param.getString("token_name");
|
||||
Long applyToken= getUserBlanaceProjectId("userSingleInfo",userName,tokenName);
|
||||
v.setApplyToken(applyToken);
|
||||
v.setCurrentToken(totalToken - applyToken);
|
||||
}
|
||||
v.setCreatedOn(DateUtil.plusHours(v.getCreatedOn(), 8));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public Long getUserBlanaceProjectId(String type,String userName,String tokenName) {
|
||||
JSONObject params = new JSONObject();
|
||||
if(type.equals(USER_SINGLE_INFO)){
|
||||
params.put(REQUEST_TYPE, USER_SINGLE_REPO);
|
||||
params.put("token_name", tokenName);
|
||||
params.put("username", userName);
|
||||
}else if(type.equals(USER_ALL_INFO)){
|
||||
params.put(REQUEST_TYPE, USER_ALL_REPOS);
|
||||
params.put("username", userName);
|
||||
}
|
||||
Map<String, String> p = convertParams(params);
|
||||
params = JSONObject.from(p);
|
||||
JSONObject rsp = queryFiscobcos(params);
|
||||
if (rsp != null) {
|
||||
return Long.parseLong(rsp.getString("balance"));
|
||||
}
|
||||
return -1L;
|
||||
}
|
||||
|
||||
private JSONObject queryProjectInfo(TokenListVo v) {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put(REQUEST_TYPE, QUERY_REPO);
|
||||
param.put("token_name", String.valueOf(v.getId()));
|
||||
|
||||
JSONObject jsonObject = queryFiscobcos(param);
|
||||
if (jsonObject != null) {
|
||||
return jsonObject;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private JSONObject queryFiscobcos(JSONObject param) {
|
||||
try {
|
||||
// Map<String,String> p = convertParams(param);
|
||||
// JSONObject from = JSONObject.from(p);
|
||||
JSONObject reps = httpAPIService.doPost(fiscobcosUrl, param);
|
||||
// if (result.getCode() != 200) {
|
||||
// return null;
|
||||
// }
|
||||
// JSONObject reps = JSONObject.parseObject(result.getContent());
|
||||
if (reps.containsKey(RESP_STATUS) && reps.getString(RESP_STATUS).equals("0")) {
|
||||
return reps;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("区块链接口请求失败", e);
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Map<String, String> convertParams(JSONObject param) {
|
||||
Set<String> keys = param.keySet();
|
||||
Map<String, String> r = new HashMap<>();
|
||||
// 遍历 key 集合并获取对应的 value
|
||||
for (String key : keys) {
|
||||
Object o = param.get(key);
|
||||
if (o != null) {
|
||||
if (o instanceof String || o instanceof Integer || o instanceof Long || o instanceof BigDecimal || o instanceof Double) {
|
||||
r.put(key, param.getString(key));
|
||||
} else if (o instanceof LocalDateTime) {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
String format = formatter.format(LocalDateTime.parse(o.toString(), formatter));
|
||||
r.put(key, format);
|
||||
} else if (o instanceof Date) {
|
||||
String s = DateUtils.parseDateToStr(YYYY_MM_DD_HH_MM_SS, (Date) o);
|
||||
r.put(key, s);
|
||||
} else if (o instanceof List || o instanceof Map) {
|
||||
String jsonString = JSONObject.toJSONString(o);
|
||||
r.put(key, jsonString);
|
||||
}else {
|
||||
r.put(key, o.toString());
|
||||
}
|
||||
}else {
|
||||
r.put(key, null);
|
||||
}
|
||||
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
public AjaxResult projectTokenDistribute(InLinkProjectVo vo) {
|
||||
//根据项目ID,获取用户ID
|
||||
//根据项目id获取项目创建人
|
||||
String userId = projectResourceLibraryMapper.getProjectUserIdById(vo.getProjectId());
|
||||
validTokenCount(vo.getProjectId(), vo.getAmount(),userId);
|
||||
JSONObject params = new JSONObject();
|
||||
params.put(REQUEST_TYPE, TRANSFER_AMOUNT);
|
||||
params.put("token_name", vo.getProjectId());
|
||||
params.put("amount", vo.getAmount());
|
||||
params.put("payee", vo.getUserId());
|
||||
params.put("payer", userId);
|
||||
JSONObject rsp = queryFiscobcos(params);
|
||||
if (rsp != null) {
|
||||
String txHash = rsp.getString(TX_HASH);
|
||||
// insert to db 4、将3入链成功的数据存入表 :用户/项目转账信息记录表 (type:project、 payer_id:username)
|
||||
if (StringUtils.isNotEmpty(txHash)) {
|
||||
UserProjectTransferRecords records = new UserProjectTransferRecords();
|
||||
records.setPayerId(params.getString("payer"));//转账人
|
||||
records.setPayeeId(params.getString("payee"));//收款人
|
||||
records.setProjectId(vo.getProjectId());
|
||||
records.setToken(BigDecimal.valueOf(vo.getAmount()));
|
||||
records.setType("projectApply");//项目分配
|
||||
records.setCreateTime(DateUtils.getNowDate());
|
||||
records.setTxHash(txHash);
|
||||
records.setCreateBy(SecurityUtils.getUsername());
|
||||
userProjectTransferRecordsMapper.insertUserProjectTransferRecords(records);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
public AjaxResult userCreate(UserCreateVo userCreateVo) {
|
||||
//根据项目id获取项目创建人
|
||||
String userId = projectResourceLibraryMapper.getUserIdBYLogin(userCreateVo.getPayee());//收款人ID
|
||||
userCreateVo.setPayee(userId);
|
||||
String payerId = projectResourceLibraryMapper.getUserIdBYLogin(userCreateVo.getPayer());//转账人ID
|
||||
userCreateVo.setPayer(payerId);
|
||||
//转账人token充足
|
||||
validUserTokenCount(userCreateVo);
|
||||
//进行转账
|
||||
JSONObject params = JSONObject.from(userCreateVo);
|
||||
params.put(REQUEST_TYPE, TRANSFER_AMOUNT);
|
||||
JSONObject rsp = queryFiscobcos(params);
|
||||
if (rsp != null) {
|
||||
String txHash = rsp.getString(TX_HASH);
|
||||
// insert to db 将2入链成功的数据新增到用户/项目转账信息记录表 (type:user payer_id:payer)
|
||||
if (StringUtils.isNotEmpty(txHash)) {
|
||||
UserProjectTransferRecords records = new UserProjectTransferRecords();
|
||||
records.setPayerId(params.getString("payer"));
|
||||
records.setPayeeId(params.getString("payee"));
|
||||
records.setProjectId(params.getString("token_name"));
|
||||
records.setToken(params.getBigDecimal("amount"));
|
||||
records.setType("userTransfer");//用户转账
|
||||
records.setTxHash(txHash);
|
||||
records.setCreateTime(DateUtils.getNowDate());
|
||||
records.setCreateBy(SecurityUtils.getUsername());
|
||||
userProjectTransferRecordsMapper.insertUserProjectTransferRecords(records);
|
||||
return AjaxResult.success(rsp);
|
||||
}
|
||||
}
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
//判断用户当前项目剩余token是否还支持分配
|
||||
private void validUserTokenCount(UserCreateVo userCreateVo) {
|
||||
//现根据用户id,以及项目名称查询对应用户拥有的token
|
||||
JSONObject params = new JSONObject();
|
||||
params.put(REQUEST_TYPE, USER_SINGLE_REPO);
|
||||
params.put("token_name", userCreateVo.getToken_name());
|
||||
params.put("username", userCreateVo.getPayer());
|
||||
Map<String, String> p = convertParams(params);
|
||||
params = JSONObject.from(p);
|
||||
JSONObject rsp = queryFiscobcos(params);
|
||||
if(rsp != null) {
|
||||
long curToken = Long.parseLong(rsp.getString("balance"));
|
||||
Long amount = userCreateVo.getAmount();
|
||||
if (curToken <amount) {
|
||||
throw new ServiceException("token数量不足");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//判断项目剩余token是否还支持分配
|
||||
private void validTokenCount(String tokenName, Long amount,String userName) {
|
||||
TokenListVo v = new TokenListVo();
|
||||
if(StringUtils.isEmpty(tokenName)) {
|
||||
throw new ServiceException("项目ID不能为空");
|
||||
}
|
||||
v.setId(Long.parseLong(Optional.ofNullable(tokenName).orElse("-1")));
|
||||
Long issueTokenSum = projectResourceLibraryMapper.sumProjectIssueToken(v.getId());
|
||||
v.setIssueToken(issueTokenSum);
|
||||
//根据创建人、项目Id,获取创建人拥有token
|
||||
Long applyToken= getUserBlanaceProjectId("userSingleInfo",userName,tokenName);
|
||||
v.setApplyToken(applyToken);
|
||||
long curToken = applyToken - issueTokenSum;
|
||||
if (curToken < amount) {
|
||||
throw new ServiceException("token数量不足");
|
||||
}
|
||||
}
|
||||
|
||||
private Long queryTotalToken(TokenListVo v) {
|
||||
if(v.getName().equals("区块链测试")){
|
||||
System.out.println("zzz");
|
||||
}
|
||||
JSONObject param = new JSONObject();
|
||||
param.put(REQUEST_TYPE, QUERY_REPO);
|
||||
param.put("token_name", String.valueOf(v.getId()));
|
||||
|
||||
JSONObject jsonObject = queryFiscobcos(param);
|
||||
if (jsonObject != null) {
|
||||
return jsonObject.getLong("total_supply");
|
||||
}
|
||||
return -1L;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public AjaxResult prCreate(PrCreateVo prCreateVo) {
|
||||
Map<String, Object> res = projectResourceLibraryMapper.selectPrInfo(prCreateVo.getPr_id());
|
||||
if (res != null) {
|
||||
JSONObject params = JSONObject.from(res);
|
||||
Map<String, String> p = convertParams(params);
|
||||
params = JSONObject.from(p);
|
||||
params.put("updated_at", DataUtilsStr());
|
||||
params.put("pull_request_number", params.getLong("pull_request_number"));
|
||||
params.put(REQUEST_TYPE, CREATE_PR);
|
||||
JSONObject rsp = queryFiscobcos(params);
|
||||
if (rsp != null) {
|
||||
String txHash = rsp.getString(TX_HASH);
|
||||
//将对应的token todo
|
||||
// insert to db 新增表:pr入链关联(id,type,type_id,tx_hash,create_time) (type:pr,type_id:"pull_request_id)
|
||||
if (StringUtils.isNotEmpty(txHash)) {
|
||||
InBlockchainData inBlockchainData = new InBlockchainData();
|
||||
inBlockchainData.setType("pr");
|
||||
inBlockchainData.setTxHash(txHash);
|
||||
inBlockchainData.setTypeId(prCreateVo.getPr_id());
|
||||
inBlockchainData.setCreateTime(DateUtils.getNowDate());
|
||||
inBlockchainData.setCreateBy(SecurityUtils.getUsername());
|
||||
inBlockchainDataMapper.insertInBlockchainData(inBlockchainData);
|
||||
return AjaxResult.success(rsp);
|
||||
}
|
||||
}
|
||||
}
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
private String DataUtilsStr() {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
return sdf.format(DateUtils.getNowDate());
|
||||
}
|
||||
|
||||
|
||||
public AjaxResult issueCreateUpdate(IssueCreateVo issueCreateVo) {
|
||||
Map<String, Object> res = projectResourceLibraryMapper.selectIssueInfo(issueCreateVo.getIssue_id());
|
||||
if (res != null) {
|
||||
JSONObject params = JSONObject.from(res);
|
||||
params.put(REQUEST_TYPE, CREATE_UPDATE_ISSUE);
|
||||
params.put("updated_at", DataUtilsStr());
|
||||
Map<String, String> p = convertParams(params);
|
||||
params = JSONObject.from(p);
|
||||
JSONObject rsp = queryFiscobcos(params);
|
||||
if (rsp != null) {
|
||||
String txHash = rsp.getString(TX_HASH);
|
||||
// insert to db 4、 :数据入链表(id,type,type_id,tx_hash,create_time) (type:issue,type_id:issue_id)
|
||||
if (StringUtils.isNotEmpty(txHash)) {
|
||||
InBlockchainData inBlockchainData = new InBlockchainData();
|
||||
inBlockchainData.setType("issue");
|
||||
inBlockchainData.setTxHash(txHash);
|
||||
inBlockchainData.setTypeId(issueCreateVo.getIssue_id());
|
||||
inBlockchainData.setCreateTime(DateUtils.getNowDate());
|
||||
inBlockchainData.setCreateBy(SecurityUtils.getUsername());
|
||||
inBlockchainDataMapper.insertInBlockchainData(inBlockchainData);
|
||||
return AjaxResult.success(rsp);
|
||||
}
|
||||
}
|
||||
}
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> issueDataList(BlockchainListQueryVo queryVo) {
|
||||
List<Map<String, Object>> maps = inBlockchainDataMapper.issueDataList(queryVo);
|
||||
handleForgeDate(maps);
|
||||
return maps;
|
||||
}
|
||||
|
||||
private void handleForgeDate(List<Map<String, Object>> maps){
|
||||
for (Map<String, Object> m : maps) {
|
||||
LocalDateTime updatedAt = (LocalDateTime) m.get("updated_at");
|
||||
LocalDateTime createdAt = (LocalDateTime) m.get("created_at");
|
||||
m.put("updated_at",formatLocalDateTimePlusH(updatedAt,8));
|
||||
m.put("created_at",formatLocalDateTimePlusH(createdAt,8));
|
||||
|
||||
if (m.containsKey("committer_time")) {
|
||||
LocalDateTime committer_time = (LocalDateTime) m.get("committer_time");
|
||||
m.put("committer_time",formatLocalDateTimePlusH(committer_time,8));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//定时任务,将commit数据入链
|
||||
// @Scheduled(cron = "${cron.commitPushBlock}")
|
||||
public void commitPushBlock() {
|
||||
//先查询需要入链的数据
|
||||
List<String> commitIdList = inBlockchainDataMapper.getNeedToBlockCommitList();
|
||||
if(commitIdList!=null && commitIdList.size()>0) {
|
||||
//遍历数据入区块链
|
||||
for(String commitId : commitIdList) {
|
||||
CommitCreateVo commitCreateVo = new CommitCreateVo();
|
||||
commitCreateVo.setCommit_id(commitId);
|
||||
commitCreate(commitCreateVo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public AjaxResult commitCreate(CommitCreateVo commitCreateVo) {
|
||||
List<CommitResultVo> CommitCreateVoList = new ArrayList<>();
|
||||
if(StringUtils.isEmpty(commitCreateVo.getCommit_id())) {
|
||||
String projectId = commitCreateVo.getProject_id();
|
||||
if (StringUtils.isNotEmpty(projectId)) {
|
||||
CommitCreateVoList = inBlockchainDataMapper.getCommitListById(projectId);
|
||||
}
|
||||
}else{
|
||||
CommitResultVo resultVo = new CommitResultVo();
|
||||
resultVo.setCommitId(commitCreateVo.getCommit_id());
|
||||
resultVo.setCommitDiff(commitCreateVo.getCommit_diff());
|
||||
CommitCreateVoList.add(resultVo);
|
||||
}
|
||||
if(CommitCreateVoList!=null && CommitCreateVoList.size()>0) {
|
||||
for(CommitResultVo commit : CommitCreateVoList) {
|
||||
commitDataTnBlock(commit);
|
||||
|
||||
//判断代码合并的时候issue
|
||||
String issue_id = commitCreateVo.getIssue_id();
|
||||
if(StringUtils.isNotEmpty(issue_id)) {
|
||||
//根据issue_id获取,判断是否要进行token转让
|
||||
UserProjectTransferRecords records = projectResourceLibraryMapper.selectIssueEndInfo(issue_id);
|
||||
if (Objects.nonNull(records)) {
|
||||
records.setType("issuePr");//pr合并关闭issue
|
||||
records.setTxHash("txHash");
|
||||
records.setCreateTime(DateUtils.getNowDate());
|
||||
records.setCreateBy(SecurityUtils.getUsername());
|
||||
userProjectTransferRecordsMapper.insertUserProjectTransferRecords(records);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
private AjaxResult commitDataTnBlock(CommitResultVo commitCreateVo) {
|
||||
String commitId = commitCreateVo.getCommitId();
|
||||
//根据项目id,查询对应的需要入链的commit
|
||||
Map<String, Object> res = projectResourceLibraryMapper.selectCommitInfo(commitId,commitCreateVo.getCommitDiff());
|
||||
JSONObject params = JSONObject.from(res);
|
||||
params.put(REQUEST_TYPE, CREATE_COMMIT);
|
||||
Map<String, String> p = convertParams(params);
|
||||
params = JSONObject.from(p);
|
||||
JSONObject rsp = queryFiscobcos(params);
|
||||
if (rsp != null) {
|
||||
String txHash = rsp.getString(TX_HASH);
|
||||
// insert to db 4、 :数据入链表(id,type,type_id,tx_hash,create_time) (type:issue,type_id:issue_id)
|
||||
if (StringUtils.isNotEmpty(txHash)) {
|
||||
InBlockchainData inBlockchainData = new InBlockchainData();
|
||||
inBlockchainData.setType("commit");
|
||||
inBlockchainData.setTxHash(txHash);
|
||||
inBlockchainData.setTypeId(commitId);
|
||||
inBlockchainData.setCreateTime(DateUtils.getNowDate());
|
||||
inBlockchainData.setCreateBy(SecurityUtils.getUsername());
|
||||
inBlockchainDataMapper.insertInBlockchainData(inBlockchainData);
|
||||
return AjaxResult.success(rsp);
|
||||
}
|
||||
}
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> commitDataList(BlockchainListQueryVo queryVo) {
|
||||
List<Map<String, Object>> maps = inBlockchainDataMapper.commitDataList(queryVo);
|
||||
handleForgeDate(maps);
|
||||
return maps;
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> prDataList(BlockchainListQueryVo queryVo) {
|
||||
List<Map<String, Object>> maps = inBlockchainDataMapper.prDataList(queryVo);
|
||||
handleForgeDate(maps);
|
||||
return maps;
|
||||
}
|
||||
//产权转让
|
||||
public List<Map> userDataList(BlockchainListQueryVo queryVo) {
|
||||
Long gitlinkUserId = SecurityUtils.getGitlinkUserId();
|
||||
Map<String, Object> stringObjectMap = Optional.ofNullable(talentReferralMapper.selectUsersById(gitlinkUserId)).orElse(new HashMap<>());
|
||||
if (!Objects.equals(stringObjectMap.get("admin"), "1")) {
|
||||
queryVo.setUserId(gitlinkUserId);
|
||||
}
|
||||
|
||||
startPage();
|
||||
return userProjectTransferRecordsMapper.userDataList(queryVo);
|
||||
}
|
||||
|
||||
public List<UserVo> userList(UserVo userVo) {
|
||||
return userProjectTransferRecordsMapper.userList(userVo);
|
||||
}
|
||||
|
||||
public AjaxResult projectCreate(ProjectCreateVo projectCreateVo) {
|
||||
//先根据项目id(token_name)判断项目是否存在,存在才入链
|
||||
String tokenName = projectCreateVo.getToken_name();
|
||||
int num = talentReferralMapper.selectProjectById(tokenName);
|
||||
if(num>0) {
|
||||
JSONObject params = new JSONObject();
|
||||
params.put(REQUEST_TYPE, CREATE_REPO);
|
||||
params.put("owner", projectCreateVo.getOwner());
|
||||
params.put("token_name", projectCreateVo.getToken_name());
|
||||
// params.put("cur_supply", projectCreateVo.getCur_supply());
|
||||
Map<String, String> p = convertParams(params);
|
||||
params = JSONObject.from(p);
|
||||
params.put("total_supply", projectCreateVo.getTotal_supply());
|
||||
JSONObject rsp = queryFiscobcos(params);
|
||||
if (rsp != null) {
|
||||
String txHash = rsp.getString(TX_HASH);
|
||||
// insert to db 4、 :数据入链表(id,type,type_id,tx_hash,create_time) (type:issue,type_id:issue_id)
|
||||
if (StringUtils.isNotEmpty(txHash)) {
|
||||
InBlockchainData inBlockchainData = new InBlockchainData();
|
||||
inBlockchainData.setType("project");
|
||||
inBlockchainData.setTxHash(txHash);
|
||||
inBlockchainData.setTypeId(projectCreateVo.getToken_name());
|
||||
inBlockchainData.setCreateTime(DateUtils.getNowDate());
|
||||
inBlockchainData.setCreateBy(SecurityUtils.getUsername());
|
||||
inBlockchainDataMapper.insertInBlockchainData(inBlockchainData);
|
||||
return AjaxResult.success(rsp);
|
||||
}
|
||||
}
|
||||
}
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
public AjaxResult queryBlockInfo(String type,String typeId) {
|
||||
JSONObject params = paramsQuery(type,typeId);
|
||||
Map<String, String> p = convertParams(params);
|
||||
params = JSONObject.from(p);
|
||||
JSONObject rsp = queryFiscobcos(params);
|
||||
return AjaxResult.success(rsp);
|
||||
}
|
||||
|
||||
private JSONObject paramsQuery(String type, String typeId) {
|
||||
JSONObject params = new JSONObject();
|
||||
if(type.equals(PROJECT_INFO)){
|
||||
params.put(REQUEST_TYPE, QUERY_REPO);
|
||||
params.put("token_name", typeId);
|
||||
}else if(type.equals(COMMIT_INTO)){
|
||||
params.put(REQUEST_TYPE, QUERY_COMMIT);
|
||||
params.put("commit_hash", typeId);
|
||||
}else if(type.equals(PR_LATEST_INFO)){
|
||||
params.put(REQUEST_TYPE, QUERY_PR_LATEST);
|
||||
params.put("pull_request_id", typeId);
|
||||
}else if(type.equals(PR_ALL_INFO)){
|
||||
params.put(REQUEST_TYPE, QUERY_PR_ALL);
|
||||
params.put("pull_request_id", typeId);
|
||||
}else if(type.equals(ISSUE_LATEST_INFO)){
|
||||
params.put(REQUEST_TYPE, QUERY_ISSUE_LATEST);
|
||||
params.put("issue_id", typeId);
|
||||
}else if(type.equals(ISSUE_ALL_INFO)){
|
||||
params.put(REQUEST_TYPE, QUERY_ISSUE_ALL);
|
||||
params.put("issue_id", typeId);
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
|
||||
public AjaxResult getTransactionByHash(String txHash) {
|
||||
JSONObject params = new JSONObject();
|
||||
params.put(REQUEST_TYPE, GET_TRANSACTION_BYHASH);
|
||||
params.put("tx_hash", txHash);
|
||||
Map<String, String> p = convertParams(params);
|
||||
params = JSONObject.from(p);
|
||||
JSONObject rsp = queryFiscobcos(params);
|
||||
return AjaxResult.success(rsp);
|
||||
}
|
||||
|
||||
public AjaxResult getTransactionReceipt(String txHash) {
|
||||
JSONObject params = new JSONObject();
|
||||
params.put(REQUEST_TYPE, GET_TRANSACTION_RECEIPT);
|
||||
params.put("tx_hash", txHash);
|
||||
Map<String, String> p = convertParams(params);
|
||||
params = JSONObject.from(p);
|
||||
JSONObject rsp = queryFiscobcos(params);
|
||||
return AjaxResult.success(rsp);
|
||||
}
|
||||
|
||||
public AjaxResult getTotalTransactionCount() {
|
||||
JSONObject params = new JSONObject();
|
||||
params.put(REQUEST_TYPE, GET_TOTAL_TRANSACTION_COUNTT);
|
||||
Map<String, String> p = convertParams(params);
|
||||
params = JSONObject.from(p);
|
||||
JSONObject rsp = queryFiscobcos(params);
|
||||
return AjaxResult.success(rsp);
|
||||
}
|
||||
|
||||
public AjaxResult getBlockNumber() {
|
||||
JSONObject params = new JSONObject();
|
||||
params.put(REQUEST_TYPE, GET_BLOCK_NUM);
|
||||
Map<String, String> p = convertParams(params);
|
||||
params = JSONObject.from(p);
|
||||
JSONObject rsp = queryFiscobcos(params);
|
||||
if (rsp != null) {
|
||||
return AjaxResult.success(rsp);
|
||||
}
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
public AjaxResult getUserTokenByProjectId(String type,String userName,String tokenName) {
|
||||
JSONObject params = new JSONObject();
|
||||
if(type.equals(USER_SINGLE_INFO)){
|
||||
params.put(REQUEST_TYPE, USER_SINGLE_REPO);
|
||||
params.put("token_name", tokenName);
|
||||
params.put("username", userName);
|
||||
}else if(type.equals(USER_ALL_INFO)){
|
||||
params.put(REQUEST_TYPE, USER_ALL_REPOS);
|
||||
params.put("username", userName);
|
||||
}
|
||||
Map<String, String> p = convertParams(params);
|
||||
params = JSONObject.from(p);
|
||||
JSONObject rsp = queryFiscobcos(params);
|
||||
if (rsp != null) {
|
||||
return AjaxResult.success(rsp);
|
||||
}
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
//
|
||||
public AjaxResult getUserAllProjectToken(String userName) {
|
||||
JSONObject params = new JSONObject();
|
||||
params.put(REQUEST_TYPE, USER_ALL_REPOS);
|
||||
params.put("username", userName);
|
||||
Map<String, String> p = convertParams(params);
|
||||
params = JSONObject.from(p);
|
||||
JSONObject rsp = queryFiscobcos(params);
|
||||
if (rsp != null) {
|
||||
return AjaxResult.success(rsp);
|
||||
}
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
package com.microservices.dms.achievementLibrary.service;
|
||||
|
||||
|
||||
import com.microservices.dms.achievementLibrary.domain.ExpertTotallVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.resourceLibrary.mapper.ExpertResourceLibraryMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ExpertDashboardService {
|
||||
@Autowired
|
||||
private ExpertResourceLibraryMapper expertResourceLibraryMapper;
|
||||
/**
|
||||
* 专家职称级分布
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getTitleRankStatistic() {
|
||||
return expertResourceLibraryMapper.getTitleRankStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 专家专业类别
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getExpertTypeStatistic() {
|
||||
return expertResourceLibraryMapper.getExpertTypeStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 专家学历分布
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getHighestDegreeStatistic() {
|
||||
return expertResourceLibraryMapper.getHighestDegreeStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 专家单位类别分布
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getWorkplaceTypeStatistic() {
|
||||
return expertResourceLibraryMapper.getWorkplaceTypeStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取专家总数
|
||||
* @return
|
||||
*/
|
||||
public Long getExpertTotal() {
|
||||
return expertResourceLibraryMapper.getExpertTotal();
|
||||
}
|
||||
/**
|
||||
* 专家实名完成度 userId users.authentication
|
||||
* @return
|
||||
*/
|
||||
public KeyValueVo getAuthenticationStatistic() {
|
||||
return expertResourceLibraryMapper.getAuthenticationStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 年度专家数据统计 cretate_on
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getExpertTotalByYear() {
|
||||
return expertResourceLibraryMapper.getExpertTotalByYear();
|
||||
}
|
||||
|
||||
/**
|
||||
* 热门专家领域
|
||||
* reviewAreaOne、reviewAreaTwo、reviewAreaThree
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getReviewAreasStatistic() {
|
||||
return expertResourceLibraryMapper.getReviewAreasStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 近一年专家评审数
|
||||
* @return
|
||||
*/
|
||||
public List<ExpertTotallVo> getExpertAduit() {
|
||||
return expertResourceLibraryMapper.getExpertAduit();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.microservices.dms.achievementLibrary.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchievementDictData;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 成果相关字典Service接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-05-23
|
||||
*/
|
||||
public interface IAchievementDictDataService
|
||||
{
|
||||
/**
|
||||
* 查询成果相关字典
|
||||
*
|
||||
* @param dictCode 成果相关字典主键
|
||||
* @return 成果相关字典
|
||||
*/
|
||||
public AchievementDictData selectAchievementDictDataByDictCode(Long dictCode);
|
||||
|
||||
/**
|
||||
* 查询成果相关字典列表
|
||||
*
|
||||
* @param achievementDictData 成果相关字典
|
||||
* @return 成果相关字典集合
|
||||
*/
|
||||
public List<AchievementDictData> selectAchievementDictDataList(AchievementDictData achievementDictData);
|
||||
|
||||
/**
|
||||
* 新增成果相关字典
|
||||
*
|
||||
* @param achievementDictData 成果相关字典
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAchievementDictData(AchievementDictData achievementDictData);
|
||||
|
||||
/**
|
||||
* 修改成果相关字典
|
||||
*
|
||||
* @param achievementDictData 成果相关字典
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAchievementDictData(AchievementDictData achievementDictData);
|
||||
|
||||
/**
|
||||
* 批量删除成果相关字典
|
||||
*
|
||||
* @param dictCodes 需要删除的成果相关字典主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementDictDataByDictCodes(Long[] dictCodes);
|
||||
|
||||
/**
|
||||
* 删除成果相关字典信息
|
||||
*
|
||||
* @param dictCode 成果相关字典主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementDictDataByDictCode(Long dictCode);
|
||||
|
||||
List<KeyValueVo> selectDictDataByType(String dictType);
|
||||
|
||||
List<String> getDictTypes();
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.microservices.dms.achievementLibrary.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchievementTeam;
|
||||
|
||||
/**
|
||||
* 成果团队Service接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-23
|
||||
*/
|
||||
public interface IAchievementTeamService
|
||||
{
|
||||
/**
|
||||
* 查询成果团队
|
||||
*
|
||||
* @param id 成果团队主键
|
||||
* @return 成果团队
|
||||
*/
|
||||
public AchievementTeam selectAchievementTeamById(Long id);
|
||||
|
||||
/**
|
||||
* 查询成果团队列表
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 成果团队集合
|
||||
*/
|
||||
public List<AchievementTeam> selectAchievementTeamList(AchievementTeam achievementTeam);
|
||||
|
||||
/**
|
||||
* 新增成果团队
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAchievementTeam(AchievementTeam achievementTeam);
|
||||
|
||||
/**
|
||||
* 修改成果团队
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAchievementTeam(AchievementTeam achievementTeam);
|
||||
|
||||
/**
|
||||
* 批量删除成果团队
|
||||
*
|
||||
* @param ids 需要删除的成果团队主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementTeamByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除成果团队信息
|
||||
*
|
||||
* @param id 成果团队主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementTeamById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
package com.microservices.dms.achievementLibrary.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.microservices.dms.achievementLibrary.domain.*;
|
||||
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.CompetitionResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.domain.TaskResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
|
||||
/**
|
||||
* 成果Service接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-02
|
||||
*/
|
||||
public interface IAchievementsService {
|
||||
/**
|
||||
* 查询成果
|
||||
*
|
||||
* @param id 成果主键
|
||||
* @return 成果
|
||||
*/
|
||||
public Achievements selectAchievementsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询成果列表
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 成果集合
|
||||
*/
|
||||
public List<Achievements> selectAchievementsList(Achievements achievements);
|
||||
|
||||
/**
|
||||
* 新增成果
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAchievements(Achievements achievements);
|
||||
|
||||
/**
|
||||
* 修改成果
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAchievements(Achievements achievements);
|
||||
|
||||
/**
|
||||
* 批量删除成果
|
||||
*
|
||||
* @param ids 需要删除的成果主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementsByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除成果信息
|
||||
*
|
||||
* @param id 成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAchievementsById(Long id);
|
||||
|
||||
String buildFileInfoByIdents(String aStr, String source);
|
||||
|
||||
List<Achievements> selectAchievementsFrontList(Achievements achievements);
|
||||
|
||||
List<Achievements> getChoiceImport();
|
||||
|
||||
List<KeyValueVo> getTjBySources();
|
||||
|
||||
List<KeyValueVo> getTjByAreas();
|
||||
|
||||
List<Achievements> getAllResult(AchQueryVo achQueryVo);
|
||||
|
||||
Map<String, Object> getUerActionData();
|
||||
|
||||
List<HotAchVo> getHotAchievement();
|
||||
|
||||
List<KeyValVo<String, Long>> get7DayAdd(AchQueryVo achQueryVo);
|
||||
|
||||
Map<String,Long> indexProjectStatistic();
|
||||
|
||||
Map<String,Object> indexTaskStatistic();
|
||||
|
||||
Map<String,Long> indexCompetitionStatistic();
|
||||
|
||||
Map<String,Long> indexSchoolEnterpriseStatistic();
|
||||
|
||||
Map<String,Long> indexExpertStatistic();
|
||||
|
||||
List<KeyValueVo> getAreasByName(String areaName);
|
||||
|
||||
AchievementBehaviorSumVo getActDataStatisticById(Long id);
|
||||
|
||||
List<KeyValVo<String, Long>> get7AddClickById(String id, String clickType);
|
||||
|
||||
AchievementBehaviorSumVo getWatchFavoriteStatusById(Long id, Long userId);
|
||||
|
||||
List<AreaStatisticVo> getAreaStatistic(String areaKey);
|
||||
|
||||
List<AchRelatedResult> getRelatedAch(Long id, Long sourceId);
|
||||
|
||||
int getSearchResult(String achName, Long userId);
|
||||
|
||||
List<KeyValueVo> getProjectAreasByName(String areaName);
|
||||
|
||||
List<String> getExpertAreasByName(String areaName);
|
||||
|
||||
List<AchRelatedResult> getRelatedAchCompetition(Long id, Long sourceId);
|
||||
|
||||
List<AchRelatedResult> getRelatedAchTask(Long id, Long sourceId);
|
||||
|
||||
List<TaskResourceLibrary> getRelatedAchTaskOfExpert(Long id);
|
||||
|
||||
List<CompetitionResourceLibrary> getRelatedAchCompetitionOfExpert(Long id);
|
||||
|
||||
AchDetailVo getAreaDetail(String areaKey,String kyxmSum, String source);
|
||||
|
||||
List<KeyValVo<String, Long>> get7DayAddExport(AchQueryVo achQueryVo);
|
||||
|
||||
List<KeyValueVo> getAllAreas(String areaName);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package com.microservices.dms.achievementLibrary.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.microservices.dms.achievementLibrary.domain.SchoolEnterpriseAchievements;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 校企成果Service接口
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
public interface ISchoolEnterpriseAchievementsService
|
||||
{
|
||||
/**
|
||||
* 查询校企成果
|
||||
*
|
||||
* @param id 校企成果主键
|
||||
* @return 校企成果
|
||||
*/
|
||||
public SchoolEnterpriseAchievements selectSchoolEnterpriseAchievementsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询校企成果列表
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 校企成果集合
|
||||
*/
|
||||
public List<SchoolEnterpriseAchievements> selectSchoolEnterpriseAchievementsList(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
|
||||
/**
|
||||
* 新增校企成果
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 结果
|
||||
*/
|
||||
public Long insertSchoolEnterpriseAchievements(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
|
||||
/**
|
||||
* 修改校企成果
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSchoolEnterpriseAchievements(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
|
||||
/**
|
||||
* 批量删除校企成果
|
||||
*
|
||||
* @param ids 需要删除的校企成果主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSchoolEnterpriseAchievementsByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除校企成果信息
|
||||
*
|
||||
* @param id 校企成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSchoolEnterpriseAchievementsById(Long id);
|
||||
|
||||
Long topStatistic(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
|
||||
List<SchoolEnterpriseAchievements> listFront(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
|
||||
boolean getCheckSchoolAchName(SchoolEnterpriseAchievements schoolEnterpriseAchievements);
|
||||
|
||||
String batchInsertSchoolEnterpriseAchievements(List<SchoolEnterpriseAchievements> list, Map<String, MultipartFile> imageMap, boolean updateSupport, String operName);
|
||||
}
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
package com.microservices.dms.achievementLibrary.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import com.microservices.dms.achievementLibrary.domain.blockchain.InBlockchainData;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.microservices.dms.achievementLibrary.mapper.InBlockchainDataMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 区块链数据入链Service业务层处理
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-05-27
|
||||
*/
|
||||
@Service
|
||||
public class InBlockchainDataServiceImpl
|
||||
{
|
||||
@Autowired
|
||||
private InBlockchainDataMapper inBlockchainDataMapper;
|
||||
|
||||
/**
|
||||
* 查询区块链数据入链
|
||||
*
|
||||
* @param id 区块链数据入链主键
|
||||
* @return 区块链数据入链
|
||||
*/
|
||||
|
||||
public InBlockchainData selectInBlockchainDataById(Long id)
|
||||
{
|
||||
return inBlockchainDataMapper.selectInBlockchainDataById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询区块链数据入链列表
|
||||
*
|
||||
* @param inBlockchainData 区块链数据入链
|
||||
* @return 区块链数据入链
|
||||
*/
|
||||
|
||||
public List<InBlockchainData> selectInBlockchainDataList(InBlockchainData inBlockchainData)
|
||||
{
|
||||
return inBlockchainDataMapper.selectInBlockchainDataList(inBlockchainData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增区块链数据入链
|
||||
*
|
||||
* @param inBlockchainData 区块链数据入链
|
||||
* @return 结果
|
||||
*/
|
||||
|
||||
public int insertInBlockchainData(InBlockchainData inBlockchainData)
|
||||
{
|
||||
inBlockchainData.setCreateTime(DateUtils.getNowDate());
|
||||
return inBlockchainDataMapper.insertInBlockchainData(inBlockchainData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改区块链数据入链
|
||||
*
|
||||
* @param inBlockchainData 区块链数据入链
|
||||
* @return 结果
|
||||
*/
|
||||
|
||||
public int updateInBlockchainData(InBlockchainData inBlockchainData)
|
||||
{
|
||||
return inBlockchainDataMapper.updateInBlockchainData(inBlockchainData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除区块链数据入链
|
||||
*
|
||||
* @param ids 需要删除的区块链数据入链主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
||||
public int deleteInBlockchainDataByIds(Long[] ids)
|
||||
{
|
||||
return inBlockchainDataMapper.deleteInBlockchainDataByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除区块链数据入链信息
|
||||
*
|
||||
* @param id 区块链数据入链主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
||||
public int deleteInBlockchainDataById(Long id)
|
||||
{
|
||||
return inBlockchainDataMapper.deleteInBlockchainDataById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
package com.microservices.dms.achievementLibrary.service;
|
||||
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchQueryVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.achievementLibrary.domain.MemoTotalVo;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import com.microservices.dms.resourceLibrary.mapper.ExpertResourceLibraryMapper;
|
||||
import com.microservices.dms.utils.DateUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class MemoDashboardService {
|
||||
@Autowired
|
||||
private ExpertResourceLibraryMapper memoResourceLibraryMapper;
|
||||
/**
|
||||
* 审核通过率
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getMemoAduit() {
|
||||
return memoResourceLibraryMapper.getMemoAduit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 原创、非原创
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getIsOriginalStatistic() {
|
||||
return memoResourceLibraryMapper.getIsOriginalStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 年度动态数据统计
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getMemoTotalByYear() {
|
||||
return memoResourceLibraryMapper.getMemoTotalByYear();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据帖子类型汇总
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getForumSectionStatistic() {
|
||||
return memoResourceLibraryMapper.getForumSectionStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 近一年新增帖子数
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValueVo> getAddMemoStatistic() {
|
||||
Date[] currentYear = DateUtil.getLast12Months();
|
||||
return memoResourceLibraryMapper.getAddMemoStatistic(currentYear[0],currentYear[1]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 本年帖子热度top5(论坛评论、点击、点赞)
|
||||
* @return
|
||||
*/
|
||||
public List<MemoTotalVo> getTop5Memos() {
|
||||
return memoResourceLibraryMapper.getTop5Memos();
|
||||
}
|
||||
|
||||
/**
|
||||
* 近7日帖子点赞数
|
||||
* @return
|
||||
*/
|
||||
public List<KeyValVo<String, Long>> get7DayPaise() {
|
||||
Date[] days = DateUtil.getDays(0, 6);
|
||||
Map<String, Long> w = memoResourceLibraryMapper.get7DayPaise(days[0], days[1])
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
|
||||
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
|
||||
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
||||
|
||||
for (String s : dateStr) {
|
||||
Long a = w.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
res.add(k1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
package com.microservices.dms.achievementLibrary.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import com.microservices.dms.achievementLibrary.domain.blockchain.UserProjectTransferRecords;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.microservices.dms.achievementLibrary.mapper.UserProjectTransferRecordsMapper;
|
||||
|
||||
/**
|
||||
* 用户/项目转账信息记录Service业务层处理
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-05-27
|
||||
*/
|
||||
@Service
|
||||
public class UserProjectTransferRecordsServiceImpl
|
||||
{
|
||||
@Autowired
|
||||
private UserProjectTransferRecordsMapper userProjectTransferRecordsMapper;
|
||||
|
||||
/**
|
||||
* 查询用户/项目转账信息记录
|
||||
*
|
||||
* @param id 用户/项目转账信息记录主键
|
||||
* @return 用户/项目转账信息记录
|
||||
*/
|
||||
public UserProjectTransferRecords selectUserProjectTransferRecordsById(Long id)
|
||||
{
|
||||
return userProjectTransferRecordsMapper.selectUserProjectTransferRecordsById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户/项目转账信息记录列表
|
||||
*
|
||||
* @param userProjectTransferRecords 用户/项目转账信息记录
|
||||
* @return 用户/项目转账信息记录
|
||||
*/
|
||||
public List<UserProjectTransferRecords> selectUserProjectTransferRecordsList(UserProjectTransferRecords userProjectTransferRecords)
|
||||
{
|
||||
return userProjectTransferRecordsMapper.selectUserProjectTransferRecordsList(userProjectTransferRecords);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户/项目转账信息记录
|
||||
*
|
||||
* @param userProjectTransferRecords 用户/项目转账信息记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertUserProjectTransferRecords(UserProjectTransferRecords userProjectTransferRecords)
|
||||
{
|
||||
userProjectTransferRecords.setCreateTime(DateUtils.getNowDate());
|
||||
return userProjectTransferRecordsMapper.insertUserProjectTransferRecords(userProjectTransferRecords);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户/项目转账信息记录
|
||||
*
|
||||
* @param userProjectTransferRecords 用户/项目转账信息记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUserProjectTransferRecords(UserProjectTransferRecords userProjectTransferRecords)
|
||||
{
|
||||
return userProjectTransferRecordsMapper.updateUserProjectTransferRecords(userProjectTransferRecords);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户/项目转账信息记录
|
||||
*
|
||||
* @param ids 需要删除的用户/项目转账信息记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUserProjectTransferRecordsByIds(Long[] ids)
|
||||
{
|
||||
return userProjectTransferRecordsMapper.deleteUserProjectTransferRecordsByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户/项目转账信息记录信息
|
||||
*
|
||||
* @param id 用户/项目转账信息记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUserProjectTransferRecordsById(Long id)
|
||||
{
|
||||
return userProjectTransferRecordsMapper.deleteUserProjectTransferRecordsById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
package com.microservices.dms.achievementLibrary.service.impl;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.microservices.dms.achievementLibrary.mapper.AchievementDictDataMapper;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchievementDictData;
|
||||
import com.microservices.dms.achievementLibrary.service.IAchievementDictDataService;
|
||||
|
||||
/**
|
||||
* 成果相关字典Service业务层处理
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-05-23
|
||||
*/
|
||||
@Service
|
||||
public class AchievementDictDataServiceImpl implements IAchievementDictDataService
|
||||
{
|
||||
@Autowired
|
||||
private AchievementDictDataMapper achievementDictDataMapper;
|
||||
|
||||
/**
|
||||
* 查询成果相关字典
|
||||
*
|
||||
* @param dictCode 成果相关字典主键
|
||||
* @return 成果相关字典
|
||||
*/
|
||||
@Override
|
||||
public AchievementDictData selectAchievementDictDataByDictCode(Long dictCode)
|
||||
{
|
||||
return achievementDictDataMapper.selectAchievementDictDataByDictCode(dictCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询成果相关字典列表
|
||||
*
|
||||
* @param achievementDictData 成果相关字典
|
||||
* @return 成果相关字典
|
||||
*/
|
||||
@Override
|
||||
public List<AchievementDictData> selectAchievementDictDataList(AchievementDictData achievementDictData)
|
||||
{
|
||||
return achievementDictDataMapper.selectAchievementDictDataList(achievementDictData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成果相关字典
|
||||
*
|
||||
* @param achievementDictData 成果相关字典
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAchievementDictData(AchievementDictData achievementDictData)
|
||||
{
|
||||
//判断字典是否存在,存在则不管,不存在则新增
|
||||
String label = achievementDictData.getDictLabel();
|
||||
String type = achievementDictData.getDictType();
|
||||
int num = achievementDictDataMapper.selectDictDataByLabel(label,type);
|
||||
if (num > 0){
|
||||
return 0;
|
||||
}else{
|
||||
achievementDictData.setCreateTime(DateUtils.getNowDate());
|
||||
return achievementDictDataMapper.insertAchievementDictData(achievementDictData);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成果相关字典
|
||||
*
|
||||
* @param achievementDictData 成果相关字典
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAchievementDictData(AchievementDictData achievementDictData)
|
||||
{
|
||||
achievementDictData.setUpdateTime(DateUtils.getNowDate());
|
||||
return achievementDictDataMapper.updateAchievementDictData(achievementDictData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除成果相关字典
|
||||
*
|
||||
* @param dictCodes 需要删除的成果相关字典主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAchievementDictDataByDictCodes(Long[] dictCodes)
|
||||
{
|
||||
return achievementDictDataMapper.deleteAchievementDictDataByDictCodes(dictCodes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成果相关字典信息
|
||||
*
|
||||
* @param dictCode 成果相关字典主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAchievementDictDataByDictCode(Long dictCode)
|
||||
{
|
||||
return achievementDictDataMapper.deleteAchievementDictDataByDictCode(dictCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValueVo> selectDictDataByType(String dictType) {
|
||||
return achievementDictDataMapper.selectDictDataByType(dictType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getDictTypes() {
|
||||
return achievementDictDataMapper.getDictTypes();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
package com.microservices.dms.achievementLibrary.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.microservices.dms.achievementLibrary.mapper.AchievementTeamMapper;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchievementTeam;
|
||||
import com.microservices.dms.achievementLibrary.service.IAchievementTeamService;
|
||||
|
||||
/**
|
||||
* 成果团队Service业务层处理
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-23
|
||||
*/
|
||||
@Service
|
||||
public class AchievementTeamServiceImpl implements IAchievementTeamService
|
||||
{
|
||||
@Autowired
|
||||
private AchievementTeamMapper achievementTeamMapper;
|
||||
|
||||
/**
|
||||
* 查询成果团队
|
||||
*
|
||||
* @param id 成果团队主键
|
||||
* @return 成果团队
|
||||
*/
|
||||
@Override
|
||||
public AchievementTeam selectAchievementTeamById(Long id)
|
||||
{
|
||||
return achievementTeamMapper.selectAchievementTeamById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询成果团队列表
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 成果团队
|
||||
*/
|
||||
@Override
|
||||
public List<AchievementTeam> selectAchievementTeamList(AchievementTeam achievementTeam)
|
||||
{
|
||||
return achievementTeamMapper.selectAchievementTeamList(achievementTeam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成果团队
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAchievementTeam(AchievementTeam achievementTeam)
|
||||
{
|
||||
achievementTeam.setCreateTime(DateUtils.getNowDate());
|
||||
return achievementTeamMapper.insertAchievementTeam(achievementTeam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成果团队
|
||||
*
|
||||
* @param achievementTeam 成果团队
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAchievementTeam(AchievementTeam achievementTeam)
|
||||
{
|
||||
achievementTeam.setUpdateTime(DateUtils.getNowDate());
|
||||
return achievementTeamMapper.updateAchievementTeam(achievementTeam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除成果团队
|
||||
*
|
||||
* @param ids 需要删除的成果团队主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAchievementTeamByIds(Long[] ids)
|
||||
{
|
||||
return achievementTeamMapper.deleteAchievementTeamByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成果团队信息
|
||||
*
|
||||
* @param id 成果团队主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAchievementTeamById(Long id)
|
||||
{
|
||||
return achievementTeamMapper.deleteAchievementTeamById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,632 @@
|
|||
package com.microservices.dms.achievementLibrary.service.impl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.common.httpClient.service.HttpAPIService;
|
||||
import com.microservices.common.security.utils.SecurityUtils;
|
||||
import com.microservices.dms.achievementLibrary.domain.*;
|
||||
import com.microservices.dms.achievementLibrary.mapper.SchoolEnterpriseAchievementsMapper;
|
||||
import com.microservices.dms.behaviorImage.domain.AchievementBehaviorSumVo;
|
||||
import com.microservices.dms.behaviorImage.domain.AchievementImageVo;
|
||||
import com.microservices.dms.behaviorImage.service.IBehaviorImageService;
|
||||
import com.microservices.dms.resourceLibrary.domain.Clicker;
|
||||
import com.microservices.dms.resourceLibrary.domain.CompetitionResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.domain.Searcher;
|
||||
import com.microservices.dms.resourceLibrary.domain.TaskResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
|
||||
import com.microservices.dms.resourceLibrary.mapper.CompetitionResourceLibraryMapper;
|
||||
import com.microservices.dms.resourceLibrary.mapper.ExpertResourceLibraryMapper;
|
||||
import com.microservices.dms.resourceLibrary.mapper.ProjectResourceLibraryMapper;
|
||||
import com.microservices.dms.resourceLibrary.mapper.TaskResourceLibraryMapper;
|
||||
import com.microservices.dms.utils.DateUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.checkerframework.checker.units.qual.K;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
|
||||
import com.microservices.dms.achievementLibrary.service.IAchievementsService;
|
||||
|
||||
import static com.microservices.dms.constant.BlockChainFunConstants.QUERY_REPO;
|
||||
import static com.microservices.dms.utils.UrlUtil.getUrlPath;
|
||||
|
||||
/**
|
||||
* 成果Service业务层处理
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-02
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class AchievementsServiceImpl implements IAchievementsService {
|
||||
@Autowired
|
||||
private AchievementsMapper achievementsMapper;
|
||||
|
||||
@Autowired
|
||||
private TaskResourceLibraryMapper taskResourceLibraryMapper;
|
||||
|
||||
@Autowired
|
||||
private ExpertResourceLibraryMapper expertResourceLibraryMapper;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IBehaviorImageService behaviorImageService;
|
||||
|
||||
@Value("${makerSpaceUrl}")
|
||||
public String makerSpaceUrl;
|
||||
|
||||
@Value("${http.gitLinkUrl}")
|
||||
public String gitLinkUrl;
|
||||
|
||||
@Value("${http.gatewayUrl}")
|
||||
public String gatewayUrl;
|
||||
|
||||
/**
|
||||
* 查询成果
|
||||
*
|
||||
* @param id 成果主键
|
||||
* @return 成果
|
||||
*/
|
||||
@Override
|
||||
public Achievements selectAchievementsById(Long id) {
|
||||
Achievements a = achievementsMapper.selectAchievementsById(id);
|
||||
if (StringUtils.isNotNull(a)) {
|
||||
String gender = a.getGender();
|
||||
String img = "";
|
||||
if (StringUtils.isNotEmpty(gender) && gender.equals("1")) {
|
||||
img = "images/avatars/User/girl.jpg";
|
||||
} else if (StringUtils.isNotEmpty(gender) && gender.equals("0")) {
|
||||
img = "images/avatars/User/boy.jpg";
|
||||
}
|
||||
a.setUserImg(img);
|
||||
if (StringUtils.isNotEmpty(a.getField1())) {
|
||||
String field1Name = achievementsMapper.getField1NameByParam(a.getSource(), a.getId());
|
||||
if (StringUtils.isNotNull(field1Name)) {
|
||||
a.setField1Name(field1Name);
|
||||
}
|
||||
}
|
||||
a.setUserImg(img);
|
||||
|
||||
a.setImages(buildFileInfoByIdents(a.getImages(), a.getSource()));
|
||||
a.setAttachments(buildFileInfoByIdents(a.getAttachments(), a.getSource()));
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询成果列表
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 成果
|
||||
*/
|
||||
@Override
|
||||
public List<Achievements> selectAchievementsList(Achievements achievements) {
|
||||
List<Achievements> list = achievementsMapper.selectAchievementsList(achievements);
|
||||
for (Achievements a : list) {
|
||||
String gender = a.getGender();
|
||||
String img = "";
|
||||
if (StringUtils.isNotEmpty(gender) && gender.equals("1")) {
|
||||
img = "images/avatars/User/girl.jpg";
|
||||
} else if (StringUtils.isNotEmpty(gender) && gender.equals("0")) {
|
||||
img = "images/avatars/User/boy.jpg";
|
||||
}
|
||||
a.setUserImg(img);
|
||||
//根据id获取领域名称
|
||||
if (StringUtils.isNotEmpty(a.getField1())) {
|
||||
String field1Name = achievementsMapper.getField1NameByParam(a.getSource(), a.getId());
|
||||
if (StringUtils.isNotNull(field1Name)) {
|
||||
a.setField1Name(field1Name);
|
||||
}
|
||||
}
|
||||
a.setImages(buildFileInfoByIdents(a.getImages(), a.getSource()));
|
||||
a.setAttachments(buildFileInfoByIdents(a.getAttachments(), a.getSource()));
|
||||
|
||||
//拼接对接的用户信息
|
||||
List<Map<String,Object>> dockingUserInfo = achievementsMapper.getDockingUserInfoList(a.getId());
|
||||
a.setDockingUserInfo(dockingUserInfo);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Achievements> selectAchievementsFrontList(Achievements achievements) {
|
||||
List<Achievements> list = achievementsMapper.selectAchievementsList(achievements);
|
||||
for (Achievements a : list) {
|
||||
a.setDetails(null);
|
||||
a.setImages(buildFileInfoByIdents(a.getImages(), a.getSource()));
|
||||
a.setAttachments(buildFileInfoByIdents(a.getAttachments(), a.getSource()));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增成果
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAchievements(Achievements achievements) {
|
||||
achievements.setCreateTime(DateUtils.getNowDate());
|
||||
achievements.setCreateBy(SecurityUtils.getUsername());
|
||||
return achievementsMapper.insertAchievements(achievements);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成果
|
||||
*
|
||||
* @param achievements 成果
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAchievements(Achievements achievements) {
|
||||
achievements.setUpdateTime(DateUtils.getNowDate());
|
||||
achievements.setUpdateBy(SecurityUtils.getUsername());
|
||||
return achievementsMapper.updateAchievements(achievements);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除成果
|
||||
*
|
||||
* @param ids 需要删除的成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAchievementsByIds(Long[] ids) {
|
||||
return achievementsMapper.deleteAchievementsByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除成果信息
|
||||
*
|
||||
* @param id 成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAchievementsById(Long id) {
|
||||
//根据id,获取数据仓库该数据信息
|
||||
Achievements achievements = achievementsMapper.selectAchievementsById(id);
|
||||
if(achievements != null){
|
||||
String source = achievements.getSource();
|
||||
if(StringUtils.isNotEmpty(source)) {
|
||||
achievementsMapper.updateRelationAchievements(source,achievements.getSourceId());
|
||||
}
|
||||
}
|
||||
return achievementsMapper.deleteAchievementsById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String buildFileInfoByIdents(String aStr, String source) {
|
||||
if (StringUtils.isEmpty(aStr) || StringUtils.isEmpty(source)) {
|
||||
return aStr;
|
||||
}
|
||||
|
||||
List<Map<String, String>> list = JSON.parseObject(aStr, new TypeReference<List<Map<String, String>>>() {
|
||||
});
|
||||
|
||||
if (Objects.equals(source, "1") || Objects.equals(source, "3")) {
|
||||
concatUrl(list, gitLinkUrl);
|
||||
}
|
||||
|
||||
if (Objects.equals(source, "2")) {
|
||||
concatUrl(list, makerSpaceUrl);
|
||||
}
|
||||
|
||||
if (Objects.equals(source, "4")) {
|
||||
concatUrl(list, gatewayUrl);
|
||||
}
|
||||
|
||||
return JSON.toJSONString(list);
|
||||
}
|
||||
|
||||
private void concatUrl(List<Map<String, String>> list, String url) {
|
||||
for (Map<String, String> map : list) {
|
||||
String v = map.getOrDefault("v", "");
|
||||
String urlPath = getUrlPath(v);
|
||||
map.put("v", url + urlPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Achievements> getChoiceImport() {
|
||||
return achievementsMapper.getChoiceImport();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValueVo> getTjBySources() {
|
||||
return achievementsMapper.getTjBySources();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValueVo> getTjByAreas() {
|
||||
return achievementsMapper.getTjByAreas();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Achievements> getAllResult(AchQueryVo achQueryVo) {
|
||||
//根据查询条件获取所有的成果数据
|
||||
List<Achievements> list = achievementsMapper.selectAchievementsByParam(achQueryVo);
|
||||
//遍历成果数据,获取对应成果的点击数
|
||||
for (Achievements a : list) {
|
||||
String gender = a.getGender();
|
||||
String img = "";
|
||||
if (StringUtils.isNotEmpty(gender) && gender.equals("1")) {
|
||||
img = "images/avatars/User/girl.jpg";
|
||||
} else if (StringUtils.isNotEmpty(gender) && gender.equals("0")) {
|
||||
img = "images/avatars/User/boy.jpg";
|
||||
}
|
||||
a.setUserImg(img);
|
||||
//根据id获取领域名称
|
||||
if (StringUtils.isEmpty(achQueryVo.getSource()) && StringUtils.isNotEmpty(a.getField1())) {
|
||||
String field1Name = achievementsMapper.getField1NameByParam(a.getSource(), a.getId());
|
||||
if (StringUtils.isNotNull(field1Name)) {
|
||||
a.setField1Name(field1Name);
|
||||
}
|
||||
}
|
||||
Long clickSum = achievementsMapper.getAchievementClickSum(a.getId());
|
||||
a.setClickSum(clickSum);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getUerActionData() {
|
||||
Date[] days = DateUtil.getDays(0, 6);
|
||||
Map<String, Long> w = achievementsMapper.getaWatcher(days[0], days[1], "Achievements")
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
|
||||
Map<String, Long> g = achievementsMapper.getFavorite(days[0], days[1], "Achievements")
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
|
||||
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
|
||||
List<KeyValVo<String, Long>> wRes = new ArrayList<>();
|
||||
List<KeyValVo<String, Long>> gRes = new ArrayList<>();
|
||||
for (String s : dateStr) {
|
||||
Long a = w.getOrDefault(s, 0L);
|
||||
Long b = g.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
KeyValVo<String, Long> k2 = new KeyValVo<>();
|
||||
k2.setK(s);
|
||||
k2.setV(b);
|
||||
|
||||
wRes.add(k1);
|
||||
gRes.add(k2);
|
||||
}
|
||||
Map<String, Object> res = new HashMap<>();
|
||||
res.put("watcher", wRes);
|
||||
res.put("favorite", gRes);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HotAchVo> getHotAchievement() {
|
||||
//根据查询条件获取所有的成果数据
|
||||
List<HotAchVo> resultList = achievementsMapper.getHotAchievement();
|
||||
//遍历成果数据,获取对应成果的点击数
|
||||
for (HotAchVo a : resultList) {
|
||||
String gender = a.getGender();
|
||||
String img = "";
|
||||
if (StringUtils.isNotEmpty(gender) && gender.equals("1")) {
|
||||
img = "images/avatars/User/girl.jpg";
|
||||
} else if (StringUtils.isNotEmpty(gender) && gender.equals("0")) {
|
||||
img = "images/avatars/User/boy.jpg";
|
||||
}
|
||||
a.setUserImg(img);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValVo<String, Long>> get7DayAdd(AchQueryVo achQueryVo) {
|
||||
Date[] days = DateUtil.getDays(0, 6);
|
||||
Map<String, Long> w = achievementsMapper.getAchievement(days[0], days[1], achQueryVo.getSource())
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
|
||||
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
|
||||
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
||||
|
||||
for (String s : dateStr) {
|
||||
Long a = w.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
res.add(k1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValVo<String, Long>> get7DayAddExport(AchQueryVo achQueryVo) {
|
||||
Date[] days = DateUtil.getDays(0, 6);
|
||||
Map<String, Long> w = achievementsMapper.getExperts(days[0], days[1])
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
|
||||
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
|
||||
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
||||
|
||||
for (String s : dateStr) {
|
||||
Long a = w.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
res.add(k1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@Override
|
||||
public Map<String, Long> indexProjectStatistic() {
|
||||
Map<String, Long> res = achievementsMapper.indexProjectStatistic();
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> indexTaskStatistic() {
|
||||
Map<String, Object> res = achievementsMapper.indexTaskStatistic();
|
||||
double convertedTaskAmount = taskResourceLibraryMapper.getConvertedTaskAmount2();
|
||||
res.put("convertedTaskAmount", convertedTaskAmount);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Long> indexCompetitionStatistic() {
|
||||
Map<String, Long> res = achievementsMapper.indexCompetitionStatistic();
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Long> indexSchoolEnterpriseStatistic() {
|
||||
Map<String, Long> res = new HashMap<>();
|
||||
Long schoolEnterpriseCount = achievementsMapper.indexSchoolEnterpriseStatistic("4", "");
|
||||
res.put("schoolEnterpriseCount", schoolEnterpriseCount);
|
||||
Long schoolCount = achievementsMapper.indexSchoolEnterpriseStatistic("4", "1");
|
||||
res.put("schoolCount", schoolCount);
|
||||
Long enterpriseCount = achievementsMapper.indexSchoolEnterpriseStatistic("4", "2");
|
||||
res.put("enterpriseCount", enterpriseCount);
|
||||
Clicker clicker = new Clicker();
|
||||
clicker.setClickType("Achievements");
|
||||
long clickCount = taskResourceLibraryMapper.countClicker(clicker);
|
||||
res.put("clickCount", clickCount);
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页专家数据统计
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Long> indexExpertStatistic() {
|
||||
Map<String, Long> res = new HashMap<>();
|
||||
Long expertResourceCount = expertResourceLibraryMapper.expertResourceCount();
|
||||
res.put("expertResourceCount", expertResourceCount);
|
||||
Long auditTaskAuditExpertCount = expertResourceLibraryMapper.auditTaskAuditExpertCount();
|
||||
res.put("auditTaskAuditExpertCount", auditTaskAuditExpertCount);
|
||||
Long auditCompetitionAuditExpertCount = expertResourceLibraryMapper.auditCompetitionAuditExpertCount();
|
||||
res.put("auditCompetitionAuditExpertCount", auditCompetitionAuditExpertCount);
|
||||
Clicker clicker = new Clicker();
|
||||
clicker.setClickType("Experts");
|
||||
long clickCount = taskResourceLibraryMapper.countClickerSimple(clicker);
|
||||
res.put("clickCount", clickCount);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValueVo> getAreasByName(String areaName) {
|
||||
return achievementsMapper.getAreasByName(areaName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AchievementBehaviorSumVo getActDataStatisticById(Long id) {
|
||||
return achievementsMapper.getActDataStatisticById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValVo<String, Long>> get7AddClickById(String id, String clickType) {
|
||||
|
||||
if (StringUtils.isEmpty(clickType)) {
|
||||
clickType = "Achievements";
|
||||
}
|
||||
Date[] days = DateUtil.getDays(0, 6);
|
||||
Map<String, Long> w = achievementsMapper.get7AddClickById(days[0], days[1], clickType, id)
|
||||
.stream().collect(Collectors.toMap(KeyValVo::getK, KeyValVo::getV));
|
||||
|
||||
List<String> dateStr = DateUtil.getDateStrMMDD(days[0], days[1]);
|
||||
List<KeyValVo<String, Long>> res = new ArrayList<>();
|
||||
|
||||
for (String s : dateStr) {
|
||||
Long a = w.getOrDefault(s, 0L);
|
||||
KeyValVo<String, Long> k1 = new KeyValVo<>();
|
||||
k1.setK(s);
|
||||
k1.setV(a);
|
||||
res.add(k1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AchievementBehaviorSumVo getWatchFavoriteStatusById(Long id, Long userId) {
|
||||
return achievementsMapper.getWatchFavoriteStatusById(id, userId);
|
||||
}
|
||||
|
||||
|
||||
@Scheduled(cron = "${cron.calculateHotRank}")
|
||||
public void timingCalcHotRank() {
|
||||
List<Long> ids = achievementsMapper.getAllId();
|
||||
for (Long id : ids) {
|
||||
AchievementImageVo image = behaviorImageService.getAchievementImageById(id);
|
||||
float score = image.getScore();
|
||||
Achievements u = new Achievements();
|
||||
u.setId(id);
|
||||
u.setHotRank(score);
|
||||
achievementsMapper.updateAchievements(u);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AreaStatisticVo> getAreaStatistic(String areaKey) {
|
||||
List<AreaStatisticVo> areaStatisticVoList = new ArrayList<>();
|
||||
if(StringUtils.isNotEmpty(areaKey)) {
|
||||
//根据逗号进行分割
|
||||
String[] res =areaKey.split(",");
|
||||
for (String s : res) {
|
||||
String[] ss = s.split("_");
|
||||
List<AreaStatisticVo> tmpList = achievementsMapper.getAreaStatistic(ss[1],ss[0]);
|
||||
areaStatisticVoList.addAll(tmpList);
|
||||
}
|
||||
return areaStatisticVoList;
|
||||
}else{
|
||||
return achievementsMapper.getAreaStatistic(null,areaKey);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AchRelatedResult> getRelatedAch(Long id, Long sourceId) {
|
||||
List<AchRelatedResult> relatedResultList = new ArrayList<>();
|
||||
//想根据开源项目id,获取对应的年度信息
|
||||
List<Long> allSourceId = achievementsMapper.getAllSourceId(id, sourceId);
|
||||
if(allSourceId != null && allSourceId.size() > 0) {
|
||||
List<String> allYear = achievementsMapper.getDistinctYear(id, allSourceId);
|
||||
if (StringUtils.isNotNull(allYear)) {
|
||||
//遍历年度信息,获取年度成果数据
|
||||
for (String paramYear : allYear) {
|
||||
AchRelatedResult relatedResult = new AchRelatedResult();
|
||||
relatedResult.setYear(paramYear);
|
||||
List<AchRelatedVo> tmpList = achievementsMapper.getRelatedAch(id, allSourceId, paramYear);
|
||||
relatedResult.setAchRelatedVoList(tmpList);
|
||||
relatedResultList.add(relatedResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
return relatedResultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AchRelatedResult> getRelatedAchCompetition(Long id, Long sourceId) {
|
||||
List<AchRelatedResult> relatedResultList = new ArrayList<>();
|
||||
//想根据开源项目id,获取对应的年度信息
|
||||
List<Long> allSourceId = achievementsMapper.getAllSourceIdCompetition(id, sourceId);
|
||||
List<String> allYear = achievementsMapper.getDistinctYear(id, allSourceId);
|
||||
if (StringUtils.isNotNull(allYear)) {
|
||||
//遍历年度信息,获取年度成果数据
|
||||
for (String paramYear : allYear) {
|
||||
AchRelatedResult relatedResult = new AchRelatedResult();
|
||||
relatedResult.setYear(paramYear);
|
||||
List<AchRelatedVo> tmpList = achievementsMapper.getRelatedAch(id, allSourceId, paramYear);
|
||||
relatedResult.setAchRelatedVoList(tmpList);
|
||||
relatedResultList.add(relatedResult);
|
||||
}
|
||||
}
|
||||
return relatedResultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AchRelatedResult> getRelatedAchTask(Long id, Long sourceId) {
|
||||
List<AchRelatedResult> relatedResultList = new ArrayList<>();
|
||||
//想根据开源项目id,获取对应的年度信息
|
||||
List<Long> allSourceId = achievementsMapper.getAllSourceIdTask(id, sourceId);
|
||||
List<String> allYear = achievementsMapper.getDistinctYear(id, allSourceId);
|
||||
if (StringUtils.isNotNull(allYear)) {
|
||||
//遍历年度信息,获取年度成果数据
|
||||
for (String paramYear : allYear) {
|
||||
AchRelatedResult relatedResult = new AchRelatedResult();
|
||||
relatedResult.setYear(paramYear);
|
||||
List<AchRelatedVo> tmpList = achievementsMapper.getRelatedAch(id, allSourceId, paramYear);
|
||||
relatedResult.setAchRelatedVoList(tmpList);
|
||||
relatedResultList.add(relatedResult);
|
||||
}
|
||||
}
|
||||
return relatedResultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaskResourceLibrary> getRelatedAchTaskOfExpert(Long id) {
|
||||
return achievementsMapper.getRelatedAchTaskOfExpert(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CompetitionResourceLibrary> getRelatedAchCompetitionOfExpert(Long id) {
|
||||
return achievementsMapper.getRelatedAchCompetitionOfExpert(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据查询内容,调用搜索行为接口
|
||||
*
|
||||
* @param achName
|
||||
* @param userId
|
||||
*/
|
||||
@Override
|
||||
public int getSearchResult(String achName, Long userId) {
|
||||
int num = 0;
|
||||
if (StringUtils.isEmpty(achName)) {
|
||||
return num;
|
||||
}
|
||||
List<Long> idList = achievementsMapper.selectAchievementsByName(achName);
|
||||
if (StringUtils.isNotNull(idList)) {
|
||||
for (Long searchId : idList) {
|
||||
Searcher e = new Searcher();
|
||||
e.setCreatedAt(DateUtils.getNowDate());
|
||||
e.setUserId(userId);
|
||||
e.setSearchId(searchId);
|
||||
e.setExtInfo(achName);
|
||||
e.setSearchType("Achievements");
|
||||
num = taskResourceLibraryMapper.insertSearcher(e);
|
||||
num++;
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<KeyValueVo> getProjectAreasByName(String areaName) {
|
||||
return achievementsMapper.getProjectAreasByName(areaName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getExpertAreasByName(String areaName) {
|
||||
return achievementsMapper.getExpertAreasByName(areaName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AchDetailVo getAreaDetail(String areaKey,String kyxmSum, String source) {
|
||||
AchDetailVo achDetailVo = new AchDetailVo();
|
||||
AchQueryVo achQueryVo = new AchQueryVo();
|
||||
achQueryVo.setAreaQuery(areaKey);
|
||||
achQueryVo.setSource(source);
|
||||
//根据kye,和source,查询领域描述
|
||||
String remark = achievementsMapper.getField1RemarkByParam(source,areaKey);
|
||||
achDetailVo.setRemark(remark);
|
||||
List<Achievements> achievementsList = achievementsMapper.selectAchievementsByArea(achQueryVo);
|
||||
if(achievementsList!=null && achievementsList.size()>0) {
|
||||
achDetailVo.setAchievementsList(achievementsList);
|
||||
long clickSum = achievementsList.stream().mapToLong(Achievements::getClickSum).sum();
|
||||
achDetailVo.setClickSum(clickSum);
|
||||
long dockSum = achievementsList.stream().mapToLong(Achievements::getDockSum).sum();
|
||||
achDetailVo.setDockSum(dockSum);
|
||||
long favoriteSum = achievementsList.stream().mapToLong(Achievements::getFavoriteSum).sum();
|
||||
achDetailVo.setFavoriteSum(favoriteSum);
|
||||
long watcherSum = achievementsList.stream().mapToLong(Achievements::getWatcherSum).sum();
|
||||
achDetailVo.setWatcherSum(watcherSum);
|
||||
}
|
||||
return achDetailVo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<KeyValueVo> getAllAreas(String areaName) {
|
||||
List<KeyValueVo> resultVal = achievementsMapper.getAllAreas(areaName);
|
||||
return resultVal;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,337 @@
|
|||
package com.microservices.dms.achievementLibrary.service.impl;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.microservices.common.core.constant.SecurityConstants;
|
||||
import com.microservices.common.core.constant.UserConstants;
|
||||
import com.microservices.common.core.domain.R;
|
||||
import com.microservices.common.core.exception.ServiceException;
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.common.security.utils.SecurityUtils;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchievementTeam;
|
||||
import com.microservices.dms.achievementLibrary.domain.Achievements;
|
||||
import com.microservices.dms.achievementLibrary.mapper.AchievementTeamMapper;
|
||||
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
|
||||
import com.microservices.dms.achievementLibrary.service.IAchievementsService;
|
||||
import com.microservices.system.api.RemoteFileService;
|
||||
import com.microservices.system.api.model.LoginUser;
|
||||
import org.apache.commons.fileupload.FileItem;
|
||||
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.microservices.dms.achievementLibrary.mapper.SchoolEnterpriseAchievementsMapper;
|
||||
import com.microservices.dms.achievementLibrary.domain.SchoolEnterpriseAchievements;
|
||||
import com.microservices.dms.achievementLibrary.service.ISchoolEnterpriseAchievementsService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
||||
|
||||
/**
|
||||
* 校企成果Service业务层处理
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
@Service
|
||||
public class SchoolEnterpriseAchievementsServiceImpl implements ISchoolEnterpriseAchievementsService
|
||||
{
|
||||
@Autowired
|
||||
private SchoolEnterpriseAchievementsMapper schoolEnterpriseAchievementsMapper;
|
||||
|
||||
@Autowired
|
||||
private AchievementTeamMapper achievementTeamMapper;
|
||||
|
||||
@Autowired
|
||||
private IAchievementsService achievementsService;
|
||||
@Autowired
|
||||
private AchievementsMapper achievementsMapper;
|
||||
|
||||
@Autowired
|
||||
private RemoteFileService remoteFileService;
|
||||
|
||||
/**
|
||||
* 查询校企成果
|
||||
*
|
||||
* @param id 校企成果主键
|
||||
* @return 校企成果
|
||||
*/
|
||||
@Override
|
||||
public SchoolEnterpriseAchievements selectSchoolEnterpriseAchievementsById(Long id)
|
||||
{
|
||||
SchoolEnterpriseAchievements sAchievements = schoolEnterpriseAchievementsMapper.selectSchoolEnterpriseAchievementsById(id);
|
||||
if(StringUtils.isNotNull(sAchievements)){
|
||||
Long achId = sAchievements.getId();
|
||||
List<AchievementTeam> teamList = achievementTeamMapper.selectAchievementTeamByAchId(achId);
|
||||
if(StringUtils.isNotNull(teamList) && teamList.size() > 0){
|
||||
sAchievements.setTeamList(teamList);
|
||||
}
|
||||
}
|
||||
return sAchievements;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询校企成果列表
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 校企成果
|
||||
*/
|
||||
@Override
|
||||
public List<SchoolEnterpriseAchievements> selectSchoolEnterpriseAchievementsList(SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
// LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
// if (loginUser != null){
|
||||
// String username = loginUser.getUsername();
|
||||
// schoolEnterpriseAchievements.setCreateBy(username);
|
||||
// }
|
||||
List<SchoolEnterpriseAchievements> list = schoolEnterpriseAchievementsMapper.selectSchoolEnterpriseAchievementsList(schoolEnterpriseAchievements);
|
||||
for (SchoolEnterpriseAchievements a : list) {
|
||||
a.setImages(achievementsService.buildFileInfoByIdents(a.getImages(), "4"));
|
||||
a.setAttachments(achievementsService.buildFileInfoByIdents(a.getAttachments(), "4"));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SchoolEnterpriseAchievements> listFront(SchoolEnterpriseAchievements schoolEnterpriseAchievements) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null) {
|
||||
String username = loginUser.getUsername();
|
||||
schoolEnterpriseAchievements.setCreateBy(username);
|
||||
}
|
||||
return selectSchoolEnterpriseAchievementsList(schoolEnterpriseAchievements);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增校企成果
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public Long insertSchoolEnterpriseAchievements(SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null){
|
||||
String username = loginUser.getUsername();
|
||||
schoolEnterpriseAchievements.setCreateBy(username);
|
||||
}
|
||||
schoolEnterpriseAchievements.setCreateTime(DateUtils.getNowDate());
|
||||
schoolEnterpriseAchievementsMapper.insertSchoolEnterpriseAchievements(schoolEnterpriseAchievements);
|
||||
return schoolEnterpriseAchievements.getId();
|
||||
}
|
||||
|
||||
//先判断是否存在名称一致的成果,存在则抛异常,已存在名称一样的成果
|
||||
@Override
|
||||
public boolean getCheckSchoolAchName(SchoolEnterpriseAchievements schoolEnterpriseAchievements) {
|
||||
Long achId = StringUtils.isNull(schoolEnterpriseAchievements.getId()) ? -1L : schoolEnterpriseAchievements.getId();
|
||||
SchoolEnterpriseAchievements info =schoolEnterpriseAchievementsMapper.selectSchoolEnterpriseAchievementsByName(schoolEnterpriseAchievements.getAchievementName());
|
||||
if (StringUtils.isNotNull(info) && info.getId().longValue() != achId.longValue())
|
||||
{
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入成果数据(包含图片处理)
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
@Slave
|
||||
public String batchInsertSchoolEnterpriseAchievements(List<SchoolEnterpriseAchievements> list,
|
||||
Map<String, MultipartFile> imageMap,
|
||||
boolean updateSupport,
|
||||
String operName) {
|
||||
if (list == null || list.isEmpty()) {
|
||||
throw new RuntimeException("导入成果数据不能为空!");
|
||||
}
|
||||
int successNum = 0;
|
||||
int failureNum = 0;
|
||||
int imageErrorNum = 0; // 新增:图片处理失败数
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
StringBuilder imageErrorMsg = new StringBuilder(); // 新增:图片错误信息
|
||||
|
||||
for (SchoolEnterpriseAchievements schoolEnterpriseAchievement : list) {
|
||||
try {
|
||||
// 处理图片字段(优化后:返回处理结果,不抛出异常)
|
||||
String imageHandleResult = handleAchievementImage(schoolEnterpriseAchievement, imageMap);
|
||||
if (imageHandleResult.contains("失败") || imageHandleResult.contains("异常")) {
|
||||
imageErrorNum++;
|
||||
imageErrorMsg.append("<br/>").append(imageErrorNum).append("、成果 ").append(schoolEnterpriseAchievement.getAchievementName()).append(" 图片处理失败:").append(imageHandleResult);
|
||||
}
|
||||
|
||||
// 原有查重和入库逻辑(不受图片处理影响)
|
||||
SchoolEnterpriseAchievements exist = schoolEnterpriseAchievementsMapper.selectSchoolEnterpriseAchievementsByName(schoolEnterpriseAchievement.getAchievementName());
|
||||
if (exist == null) {
|
||||
schoolEnterpriseAchievement.setCreateBy(operName);
|
||||
schoolEnterpriseAchievement.setCreateTime(new Date());
|
||||
schoolEnterpriseAchievement.setUpdateBy(operName);
|
||||
schoolEnterpriseAchievement.setUpdateTime(new Date());
|
||||
schoolEnterpriseAchievement.setStatus("0");
|
||||
schoolEnterpriseAchievement.setAchievementStatus(0);
|
||||
schoolEnterpriseAchievementsMapper.insertSchoolEnterpriseAchievements(schoolEnterpriseAchievement);
|
||||
successNum++;
|
||||
successMsg.append("<br/>").append(successNum).append("、成果 ").append(schoolEnterpriseAchievement.getAchievementName()).append(" 导入成功");
|
||||
} else {
|
||||
if (updateSupport) {
|
||||
schoolEnterpriseAchievement.setId(exist.getId());
|
||||
schoolEnterpriseAchievement.setCreateBy(exist.getCreateBy());
|
||||
schoolEnterpriseAchievement.setCreateTime(exist.getCreateTime());
|
||||
schoolEnterpriseAchievement.setUpdateBy(operName);
|
||||
schoolEnterpriseAchievement.setUpdateTime(new Date());
|
||||
schoolEnterpriseAchievementsMapper.updateSchoolEnterpriseAchievements(schoolEnterpriseAchievement);
|
||||
successNum++;
|
||||
successMsg.append("<br/>").append(successNum).append("、成果 ").append(schoolEnterpriseAchievement.getAchievementName()).append(" 更新成功");
|
||||
} else {
|
||||
failureNum++;
|
||||
failureMsg.append("<br/>").append(failureNum).append("、成果 ").append(schoolEnterpriseAchievement.getAchievementName()).append(" 已存在(未开启更新)");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
failureNum++;
|
||||
String msg = "<br/>" + failureNum + "、成果 " + schoolEnterpriseAchievement.getAchievementName() + " 导入失败:";
|
||||
failureMsg.append(msg).append(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// 组装最终提示信息(包含图片处理错误)
|
||||
StringBuilder finalMsg = new StringBuilder();
|
||||
if (successNum > 0) {
|
||||
finalMsg.append("共 ").append(successNum).append(" 条数据导入/更新成功:").append(successMsg);
|
||||
}
|
||||
if (failureNum > 0) {
|
||||
finalMsg.append("<br/>共 ").append(failureNum).append(" 条数据导入失败:").append(failureMsg);
|
||||
}
|
||||
if (imageErrorNum > 0) {
|
||||
finalMsg.append("<br/>共 ").append(imageErrorNum).append(" 条数据图片处理失败:").append(imageErrorMsg);
|
||||
}
|
||||
|
||||
return finalMsg.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理成果图片:上传并格式化存储(FastJSON解析版)
|
||||
* @param achievement 成果实体
|
||||
* @param imageMap Excel解析出的图片映射表
|
||||
* @return 图片处理结果提示(成功/失败信息)
|
||||
*/
|
||||
private String handleAchievementImage(SchoolEnterpriseAchievements achievement, Map<String, MultipartFile> imageMap) {
|
||||
String imageCellKey = achievement.getImages();
|
||||
if (StringUtils.isEmpty(imageCellKey) || !imageMap.containsKey(imageCellKey)) {
|
||||
return "无图片,跳过处理";
|
||||
}
|
||||
|
||||
try {
|
||||
MultipartFile file = imageMap.get(imageCellKey);
|
||||
byte[] fileBytes = file.getBytes();
|
||||
|
||||
if (fileBytes == null || fileBytes.length == 0) {
|
||||
return "图片文件为空,跳过处理";
|
||||
}
|
||||
|
||||
// 构建 HashMap 参数
|
||||
String originalFilename = StringUtils.isEmpty(file.getOriginalFilename())
|
||||
? "excel_import_image_" + System.currentTimeMillis() + ".png"
|
||||
: file.getOriginalFilename();
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("base64Data", Base64.getEncoder().encodeToString(fileBytes));
|
||||
params.put("fileName", originalFilename);
|
||||
params.put("contentType", file.getContentType());
|
||||
params.put("size", fileBytes.length);
|
||||
|
||||
// 调用 Base64 上传接口
|
||||
R<?> fileResult = remoteFileService.uploadBase64(params, "dms", "import", SecurityConstants.INNER);
|
||||
|
||||
// 解析结果(与原逻辑相同)
|
||||
if (StringUtils.isNull(fileResult) || StringUtils.isNull(fileResult.getData())) {
|
||||
String errorMsg = !StringUtils.isNull(fileResult) ? fileResult.getMsg() : "接口返回异常";
|
||||
return "图片上传失败:" + errorMsg;
|
||||
}
|
||||
|
||||
JSONObject resultJson = JSONObject.parseObject(JSONObject.toJSONString(fileResult.getData()));
|
||||
String fileOriginName = resultJson.getString("fileOriginName");
|
||||
String url = resultJson.getString("downloadUrl");
|
||||
Integer fileId = resultJson.getInteger("fileId");
|
||||
|
||||
if (StringUtils.isEmpty(fileOriginName) || StringUtils.isEmpty(url) || fileId == null) {
|
||||
return "图片上传成功,但返回数据不完整";
|
||||
}
|
||||
|
||||
String imageJson = String.format("[{\"k\":\"%s\",\"v\":\"%s\",\"id\":%d}]",
|
||||
fileOriginName, url, fileId);
|
||||
achievement.setImages(imageJson);
|
||||
|
||||
return "图片处理成功";
|
||||
|
||||
} catch (Exception e) {
|
||||
return "图片处理异常:" + e.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改校企成果
|
||||
*
|
||||
* @param schoolEnterpriseAchievements 校企成果
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSchoolEnterpriseAchievements(SchoolEnterpriseAchievements schoolEnterpriseAchievements)
|
||||
{
|
||||
schoolEnterpriseAchievements.setUpdateTime(DateUtils.getNowDate());
|
||||
String status = schoolEnterpriseAchievements.getStatus();
|
||||
if(StringUtils.isNotEmpty(status)){
|
||||
schoolEnterpriseAchievements.setReviewDate(DateUtils.getNowDate());
|
||||
if (SecurityUtils.getLoginUser() != null) {
|
||||
schoolEnterpriseAchievements.setReviewer(SecurityUtils.getLoginUser().getUsername());
|
||||
}
|
||||
}
|
||||
return schoolEnterpriseAchievementsMapper.updateSchoolEnterpriseAchievements(schoolEnterpriseAchievements);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除校企成果
|
||||
*
|
||||
* @param ids 需要删除的校企成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSchoolEnterpriseAchievementsByIds(Long[] ids)
|
||||
{
|
||||
return schoolEnterpriseAchievementsMapper.deleteSchoolEnterpriseAchievementsByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除校企成果信息
|
||||
*
|
||||
* @param id 校企成果主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSchoolEnterpriseAchievementsById(Long id)
|
||||
{
|
||||
// 校企成果删除前判断数据仓库是否存在数据,存在则不允许删除该数据
|
||||
Achievements achievements = new Achievements();
|
||||
achievements.setSource("4");
|
||||
achievements.setSourceId(id);
|
||||
List<Achievements> ss = achievementsMapper.selectAchievementsList(achievements);
|
||||
if (ss != null && !ss.isEmpty()) {
|
||||
throw new ServiceException("数据仓库是否存在数据,不允许删除");
|
||||
}
|
||||
|
||||
// 校企成果被删除,对应的成员也应该一并删除
|
||||
achievementTeamMapper.deleteAchievementTeamByAId(id);
|
||||
return schoolEnterpriseAchievementsMapper.deleteSchoolEnterpriseAchievementsById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long topStatistic(SchoolEnterpriseAchievements schoolEnterpriseAchievements) {
|
||||
return schoolEnterpriseAchievementsMapper.topStatistic(schoolEnterpriseAchievements);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,181 @@
|
|||
package com.microservices.dms.behaviorImage.controller;
|
||||
|
||||
import com.microservices.common.core.utils.poi.ExcelUtil;
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
import com.microservices.common.log.annotation.Log;
|
||||
import com.microservices.common.log.enums.BusinessType;
|
||||
import com.microservices.dms.behaviorImage.domain.ActivityUserLibrary;
|
||||
import com.microservices.dms.behaviorImage.domain.BehaviorImageWeight;
|
||||
import com.microservices.dms.behaviorImage.service.IBehaviorImageService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
import static com.microservices.common.core.utils.PageUtils.startPage;
|
||||
|
||||
/**
|
||||
* 成果画像Controller
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-17
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/behaviorImage")
|
||||
@Api(tags = "数据管理体系-画像接口")
|
||||
public class BehaviorImageController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IBehaviorImageService behaviorImageService;
|
||||
/**
|
||||
* 根据成果ID,获取对应的成果画像
|
||||
*/
|
||||
//@RequiresPermissions("dms:achievements:query")
|
||||
@ApiOperation(value = "根据成果ID,获取对应的成果画像")
|
||||
@GetMapping(value = "/achievementImage")
|
||||
public AjaxResult getAchievementImageById(Long id)
|
||||
{
|
||||
return AjaxResult.success(behaviorImageService.getAchievementImageById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询画像行为权重列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BehaviorImageWeight behaviorImageWeight)
|
||||
{
|
||||
startPage();
|
||||
List<BehaviorImageWeight> list = behaviorImageService.selectBehaviorImageWeightList(behaviorImageWeight);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出画像行为权重列表
|
||||
*/
|
||||
@Log(title = "画像行为权重", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BehaviorImageWeight behaviorImageWeight)
|
||||
{
|
||||
List<BehaviorImageWeight> list = behaviorImageService.selectBehaviorImageWeightList(behaviorImageWeight);
|
||||
ExcelUtil<BehaviorImageWeight> util = new ExcelUtil<BehaviorImageWeight>(BehaviorImageWeight.class);
|
||||
util.exportExcel(response, list, "画像行为权重数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取画像行为权重详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(behaviorImageService.selectBehaviorImageWeightById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增画像行为权重
|
||||
*/
|
||||
@Log(title = "画像行为权重", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BehaviorImageWeight behaviorImageWeight)
|
||||
{
|
||||
return toAjax(behaviorImageService.insertBehaviorImageWeight(behaviorImageWeight));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改画像行为权重
|
||||
*/
|
||||
@Log(title = "画像行为权重", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BehaviorImageWeight behaviorImageWeight)
|
||||
{
|
||||
return toAjax(behaviorImageService.updateBehaviorImageWeight(behaviorImageWeight));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除画像行为权重
|
||||
*/
|
||||
@Log(title = "画像行为权重", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(behaviorImageService.deleteBehaviorImageWeightByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取活跃用户数据
|
||||
*/
|
||||
@GetMapping(value = "/activityList")
|
||||
@ApiOperation("获取用户资源库数据")
|
||||
public TableDataInfo activityList(ActivityUserLibrary activityUserLibrary)
|
||||
{
|
||||
startPage();
|
||||
List<ActivityUserLibrary> list = behaviorImageService.selectActivityUserLibraryList(activityUserLibrary);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("/根据用户ID,获取用户对应的成果汇总")
|
||||
@GetMapping(value = "/getUserTypeStatistic")
|
||||
public AjaxResult getUserTypeStatistic(@PathVariable("userId") Long userId)
|
||||
{
|
||||
return AjaxResult.success(behaviorImageService.getUserTypeStatistic(userId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping(value = "/getUserProjectStatistic")
|
||||
@ApiOperation("/获取用户开源项目相关数据")
|
||||
public AjaxResult getUserProjectStatistic(@PathVariable("userId") Long userId)
|
||||
{
|
||||
return AjaxResult.success(behaviorImageService.getUserProjectStatistic(userId));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getUserTaskStatistic")
|
||||
@ApiOperation("/获取用户创客任务相关数据")
|
||||
public AjaxResult getUserTaskStatistic(@PathVariable("userId") Long userId)
|
||||
{
|
||||
return AjaxResult.success(behaviorImageService.getUserTaskStatistic(userId));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getUserCompStatistic")
|
||||
@ApiOperation("/获取用户开放竞赛相关数据")
|
||||
public AjaxResult getUserCompStatistic(@PathVariable("userId") Long userId)
|
||||
{
|
||||
return AjaxResult.success(behaviorImageService.getUserCompStatistic(userId));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getUserMemoStatistic")
|
||||
@ApiOperation("/获取用户论坛交流相关数据")
|
||||
public AjaxResult getUserMemoStatistic(@PathVariable("userId") Long userId)
|
||||
{
|
||||
return AjaxResult.success(behaviorImageService.getUserMemoStatistic(userId));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getUserExpertStatistic")
|
||||
@ApiOperation("/获取用户专家资源相关数据")
|
||||
public AjaxResult getUserExpertStatistic(@PathVariable("userId") Long userId)
|
||||
{
|
||||
return AjaxResult.success(behaviorImageService.getUserExpertStatistic(userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取活跃用户相关统计数据
|
||||
*/
|
||||
@GetMapping(value = "/getActivityStatistic")
|
||||
@ApiOperation("获取用户资源库相关统计数据")
|
||||
public AjaxResult getActivityStatistic()
|
||||
{
|
||||
return AjaxResult.success(behaviorImageService.getActivityStatistic());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/getUserBehaviorSum")
|
||||
@ApiOperation("获取用户的所有关注、点赞数")
|
||||
public AjaxResult getUserBehaviorSum(Long userId)
|
||||
{
|
||||
return AjaxResult.success(behaviorImageService.getUserBehaviorSum(userId));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
public class AchievementBehaviorSumVo {
|
||||
//点击量(浏览量)
|
||||
private Long clickSum;
|
||||
//关注量
|
||||
private Long watchSum;
|
||||
//查询量
|
||||
private Long searchSum;
|
||||
//收藏量
|
||||
private Long favoriteSum;
|
||||
//下载量
|
||||
private Long downloadSum;
|
||||
//成果用户对接
|
||||
private Long userDockingSum;
|
||||
|
||||
public Long getUserDockingSum() {
|
||||
return userDockingSum;
|
||||
}
|
||||
|
||||
public void setUserDockingSum(Long userDockingSum) {
|
||||
this.userDockingSum = userDockingSum;
|
||||
}
|
||||
|
||||
public Long getClickSum() {
|
||||
return clickSum;
|
||||
}
|
||||
|
||||
public void setClickSum(Long clickSum) {
|
||||
this.clickSum = clickSum;
|
||||
}
|
||||
|
||||
public Long getWatchSum() {
|
||||
return watchSum;
|
||||
}
|
||||
|
||||
public void setWatchSum(Long watchSum) {
|
||||
this.watchSum = watchSum;
|
||||
}
|
||||
|
||||
public Long getSearchSum() {
|
||||
return searchSum;
|
||||
}
|
||||
|
||||
public void setSearchSum(Long searchSum) {
|
||||
this.searchSum = searchSum;
|
||||
}
|
||||
|
||||
public Long getFavoriteSum() {
|
||||
return favoriteSum;
|
||||
}
|
||||
|
||||
public void setFavoriteSum(Long favoriteSum) {
|
||||
this.favoriteSum = favoriteSum;
|
||||
}
|
||||
|
||||
public Long getDownloadSum() {
|
||||
return downloadSum;
|
||||
}
|
||||
|
||||
public void setDownloadSum(Long downloadSum) {
|
||||
this.downloadSum = downloadSum;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
/**
|
||||
* 成果画像结果
|
||||
*/
|
||||
public class AchievementImageVo {
|
||||
private Long id;
|
||||
private float score;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public float getScore() {
|
||||
return score;
|
||||
}
|
||||
|
||||
public void setScore(float score) {
|
||||
this.score = score;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,128 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
import com.microservices.common.core.web.domain.BaseEntity;
|
||||
|
||||
public class ActivityUserLibrary extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
//用户id
|
||||
private Long userId;
|
||||
//登录名称
|
||||
private String loginName;
|
||||
//用户名称
|
||||
private String userName;
|
||||
//是否是专家
|
||||
private String isExpert;
|
||||
//是否已实名
|
||||
private String isAuth;
|
||||
//关注领域
|
||||
private String areasStr;
|
||||
//相关项目数
|
||||
private Long relatedProject;
|
||||
//相关任务数
|
||||
private Long relatedTask;
|
||||
//相关竞赛数
|
||||
private Long relatedCompetition;
|
||||
//相关成果数
|
||||
private Long relatedAch;
|
||||
//相关专家
|
||||
private Long relatedExpert;
|
||||
//相关论坛
|
||||
private Long relatedMemo;
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getLoginName() {
|
||||
return loginName;
|
||||
}
|
||||
|
||||
public void setLoginName(String loginName) {
|
||||
this.loginName = loginName;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getIsExpert() {
|
||||
return isExpert;
|
||||
}
|
||||
|
||||
public void setIsExpert(String isExpert) {
|
||||
this.isExpert = isExpert;
|
||||
}
|
||||
|
||||
public String getIsAuth() {
|
||||
return isAuth;
|
||||
}
|
||||
|
||||
public void setIsAuth(String isAuth) {
|
||||
this.isAuth = isAuth;
|
||||
}
|
||||
|
||||
public String getAreasStr() {
|
||||
return areasStr;
|
||||
}
|
||||
|
||||
public void setAreasStr(String areasStr) {
|
||||
this.areasStr = areasStr;
|
||||
}
|
||||
|
||||
public Long getRelatedProject() {
|
||||
return relatedProject;
|
||||
}
|
||||
|
||||
public void setRelatedProject(Long relatedProject) {
|
||||
this.relatedProject = relatedProject;
|
||||
}
|
||||
|
||||
public Long getRelatedTask() {
|
||||
return relatedTask;
|
||||
}
|
||||
|
||||
public void setRelatedTask(Long relatedTask) {
|
||||
this.relatedTask = relatedTask;
|
||||
}
|
||||
|
||||
public Long getRelatedCompetition() {
|
||||
return relatedCompetition;
|
||||
}
|
||||
|
||||
public void setRelatedCompetition(Long relatedCompetition) {
|
||||
this.relatedCompetition = relatedCompetition;
|
||||
}
|
||||
|
||||
public Long getRelatedAch() {
|
||||
return relatedAch;
|
||||
}
|
||||
|
||||
public void setRelatedAch(Long relatedAch) {
|
||||
this.relatedAch = relatedAch;
|
||||
}
|
||||
|
||||
public Long getRelatedExpert() {
|
||||
return relatedExpert;
|
||||
}
|
||||
|
||||
public void setRelatedExpert(Long relatedExpert) {
|
||||
this.relatedExpert = relatedExpert;
|
||||
}
|
||||
|
||||
public Long getRelatedMemo() {
|
||||
return relatedMemo;
|
||||
}
|
||||
|
||||
public void setRelatedMemo(Long relatedMemo) {
|
||||
this.relatedMemo = relatedMemo;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
public class ActivityUserTotal {
|
||||
//活跃用户
|
||||
private Long totalUser;
|
||||
//活跃用户专家数
|
||||
private Long totalExpert;
|
||||
//活跃用户实名认证
|
||||
private Long authTotal;
|
||||
|
||||
public Long getTotalUser() {
|
||||
return totalUser;
|
||||
}
|
||||
|
||||
public void setTotalUser(Long totalUser) {
|
||||
this.totalUser = totalUser;
|
||||
}
|
||||
|
||||
public Long getTotalExpert() {
|
||||
return totalExpert;
|
||||
}
|
||||
|
||||
public void setTotalExpert(Long totalExpert) {
|
||||
this.totalExpert = totalExpert;
|
||||
}
|
||||
|
||||
public Long getAuthTotal() {
|
||||
return authTotal;
|
||||
}
|
||||
|
||||
public void setAuthTotal(Long authTotal) {
|
||||
this.authTotal = authTotal;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
public class BehaviorContant {
|
||||
/**
|
||||
* 成果画像
|
||||
*/
|
||||
public final static String ACHIEVEMENTS_IMAGE = "Achievements";
|
||||
|
||||
/**
|
||||
* 点击行为
|
||||
*/
|
||||
public final static String CLICK_BEHAVIOR = "click";
|
||||
/**
|
||||
* 收藏行为
|
||||
*/
|
||||
public final static String FAVORITE_BEHAVIOR = "favorite";
|
||||
/**
|
||||
* 搜索行为
|
||||
*/
|
||||
public final static String SEARCH_BEHAVIOR = "search";
|
||||
/**
|
||||
* 关注行为
|
||||
*/
|
||||
public final static String WATCH_BEHAVIOR = "watch";
|
||||
/**
|
||||
* 附件下载行为
|
||||
*/
|
||||
public final static String FILE_DOWNLOAD_BEHAVIOR = "file_download";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
import com.microservices.common.core.annotation.Excel;
|
||||
import com.microservices.common.core.web.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 画像行为权重对象 behavior_image_weight
|
||||
*
|
||||
* @author microservices
|
||||
* @date 2025-04-23
|
||||
*/
|
||||
public class BehaviorImageWeight extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 行为编码 */
|
||||
@Excel(name = "行为编码")
|
||||
private String behaviorCode;
|
||||
|
||||
/** 画像分类 */
|
||||
@Excel(name = "画像分类")
|
||||
private String imageType;
|
||||
|
||||
/** 行为名称 */
|
||||
@Excel(name = "行为名称")
|
||||
private String behaviorName;
|
||||
|
||||
/** 行为权重 */
|
||||
@Excel(name = "行为权重")
|
||||
private String behaviorWeight;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setBehaviorCode(String behaviorCode)
|
||||
{
|
||||
this.behaviorCode = behaviorCode;
|
||||
}
|
||||
|
||||
public String getBehaviorCode()
|
||||
{
|
||||
return behaviorCode;
|
||||
}
|
||||
public void setImageType(String imageType)
|
||||
{
|
||||
this.imageType = imageType;
|
||||
}
|
||||
|
||||
public String getImageType()
|
||||
{
|
||||
return imageType;
|
||||
}
|
||||
public void setBehaviorName(String behaviorName)
|
||||
{
|
||||
this.behaviorName = behaviorName;
|
||||
}
|
||||
|
||||
public String getBehaviorName()
|
||||
{
|
||||
return behaviorName;
|
||||
}
|
||||
public void setBehaviorWeight(String behaviorWeight)
|
||||
{
|
||||
this.behaviorWeight = behaviorWeight;
|
||||
}
|
||||
|
||||
public String getBehaviorWeight()
|
||||
{
|
||||
return behaviorWeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("behaviorCode", getBehaviorCode())
|
||||
.append("imageType", getImageType())
|
||||
.append("behaviorName", getBehaviorName())
|
||||
.append("behaviorWeight", getBehaviorWeight())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
public class UserCompetitionTotalVo {
|
||||
//创建竞赛数
|
||||
private Long joinCompetitionCount;
|
||||
//关注竞赛数
|
||||
private Long watchCompetitionCount;
|
||||
//报名数
|
||||
private Long signUpCount;
|
||||
//提交作品数
|
||||
private Long submitWorkCount;
|
||||
|
||||
|
||||
public Long getJoinCompetitionCount() {
|
||||
return joinCompetitionCount;
|
||||
}
|
||||
|
||||
public void setJoinCompetitionCount(Long joinCompetitionCount) {
|
||||
this.joinCompetitionCount = joinCompetitionCount;
|
||||
}
|
||||
|
||||
public Long getWatchCompetitionCount() {
|
||||
return watchCompetitionCount;
|
||||
}
|
||||
|
||||
public void setWatchCompetitionCount(Long watchCompetitionCount) {
|
||||
this.watchCompetitionCount = watchCompetitionCount;
|
||||
}
|
||||
|
||||
public Long getSignUpCount() {
|
||||
return signUpCount;
|
||||
}
|
||||
|
||||
public void setSignUpCount(Long signUpCount) {
|
||||
this.signUpCount = signUpCount;
|
||||
}
|
||||
|
||||
public Long getSubmitWorkCount() {
|
||||
return submitWorkCount;
|
||||
}
|
||||
|
||||
public void setSubmitWorkCount(Long submitWorkCount) {
|
||||
this.submitWorkCount = submitWorkCount;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
public class UserExpertTotalVo {
|
||||
//关注专家数
|
||||
private Long watchExpertCount;
|
||||
//收藏专家数
|
||||
private Long favoriteExpertCount;
|
||||
//评审竞赛数
|
||||
private Long aduitCompetitionCount;
|
||||
//评审任务数
|
||||
private Long aduitTaskCount;
|
||||
|
||||
public Long getWatchExpertCount() {
|
||||
return watchExpertCount;
|
||||
}
|
||||
|
||||
public void setWatchExpertCount(Long watchExpertCount) {
|
||||
this.watchExpertCount = watchExpertCount;
|
||||
}
|
||||
|
||||
public Long getFavoriteExpertCount() {
|
||||
return favoriteExpertCount;
|
||||
}
|
||||
|
||||
public void setFavoriteExpertCount(Long favoriteExpertCount) {
|
||||
this.favoriteExpertCount = favoriteExpertCount;
|
||||
}
|
||||
|
||||
public Long getAduitCompetitionCount() {
|
||||
return aduitCompetitionCount;
|
||||
}
|
||||
|
||||
public void setAduitCompetitionCount(Long aduitCompetitionCount) {
|
||||
this.aduitCompetitionCount = aduitCompetitionCount;
|
||||
}
|
||||
|
||||
public Long getAduitTaskCount() {
|
||||
return aduitTaskCount;
|
||||
}
|
||||
|
||||
public void setAduitTaskCount(Long aduitTaskCount) {
|
||||
this.aduitTaskCount = aduitTaskCount;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
public class UserMemoTotalVo {
|
||||
// private Long managerMemoCount;
|
||||
//参与帖子
|
||||
private Long joinMemoCount;
|
||||
//创建帖子
|
||||
private Long createMemoCount;
|
||||
//回复帖子
|
||||
private Long replayMemoCount;
|
||||
//关注帖子
|
||||
private Long watchMemoCount;
|
||||
|
||||
public Long getJoinMemoCount() {
|
||||
return joinMemoCount;
|
||||
}
|
||||
|
||||
public void setJoinMemoCount(Long joinMemoCount) {
|
||||
this.joinMemoCount = joinMemoCount;
|
||||
}
|
||||
|
||||
public Long getCreateMemoCount() {
|
||||
return createMemoCount;
|
||||
}
|
||||
|
||||
public void setCreateMemoCount(Long createMemoCount) {
|
||||
this.createMemoCount = createMemoCount;
|
||||
}
|
||||
|
||||
public Long getReplayMemoCount() {
|
||||
return replayMemoCount;
|
||||
}
|
||||
|
||||
public void setReplayMemoCount(Long replayMemoCount) {
|
||||
this.replayMemoCount = replayMemoCount;
|
||||
}
|
||||
|
||||
public Long getWatchMemoCount() {
|
||||
return watchMemoCount;
|
||||
}
|
||||
|
||||
public void setWatchMemoCount(Long watchMemoCount) {
|
||||
this.watchMemoCount = watchMemoCount;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
public class UserProjectTotalVo {
|
||||
//创建项目数
|
||||
private Long createProjectCount;
|
||||
//参与项目数
|
||||
private Long joinProjectCount;
|
||||
//fork项目数
|
||||
private Long forkProjectCount;
|
||||
//点赞项目数
|
||||
private Long praiseProjectCount;
|
||||
//关注项目数
|
||||
private Long watchProjectCount;
|
||||
//提交代码数
|
||||
private Long commitSum;
|
||||
//issue相关数
|
||||
private Long issueSum;
|
||||
//合并代码数
|
||||
private Long prSum;
|
||||
|
||||
public Long getCreateProjectCount() {
|
||||
return createProjectCount;
|
||||
}
|
||||
|
||||
public void setCreateProjectCount(Long createProjectCount) {
|
||||
this.createProjectCount = createProjectCount;
|
||||
}
|
||||
|
||||
public Long getJoinProjectCount() {
|
||||
return joinProjectCount;
|
||||
}
|
||||
|
||||
public void setJoinProjectCount(Long joinProjectCount) {
|
||||
this.joinProjectCount = joinProjectCount;
|
||||
}
|
||||
|
||||
public Long getForkProjectCount() {
|
||||
return forkProjectCount;
|
||||
}
|
||||
|
||||
public void setForkProjectCount(Long forkProjectCount) {
|
||||
this.forkProjectCount = forkProjectCount;
|
||||
}
|
||||
|
||||
public Long getPraiseProjectCount() {
|
||||
return praiseProjectCount;
|
||||
}
|
||||
|
||||
public void setPraiseProjectCount(Long praiseProjectCount) {
|
||||
this.praiseProjectCount = praiseProjectCount;
|
||||
}
|
||||
|
||||
public Long getWatchProjectCount() {
|
||||
return watchProjectCount;
|
||||
}
|
||||
|
||||
public void setWatchProjectCount(Long watchProjectCount) {
|
||||
this.watchProjectCount = watchProjectCount;
|
||||
}
|
||||
|
||||
public Long getCommitSum() {
|
||||
return commitSum;
|
||||
}
|
||||
|
||||
public void setCommitSum(Long commitSum) {
|
||||
this.commitSum = commitSum;
|
||||
}
|
||||
|
||||
public Long getIssueSum() {
|
||||
return issueSum;
|
||||
}
|
||||
|
||||
public void setIssueSum(Long issueSum) {
|
||||
this.issueSum = issueSum;
|
||||
}
|
||||
|
||||
public Long getPrSum() {
|
||||
return prSum;
|
||||
}
|
||||
|
||||
public void setPrSum(Long prSum) {
|
||||
this.prSum = prSum;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
public class UserTaskTotalVo {
|
||||
//创建任务数
|
||||
private Long createTaskCount;
|
||||
//任务交稿数
|
||||
private Long submitPapersCount;
|
||||
//关注任务数
|
||||
private Long watchTaskCount;
|
||||
//参加任务数
|
||||
private Long joinTaskCount;
|
||||
|
||||
|
||||
public Long getCreateTaskCount() {
|
||||
return createTaskCount;
|
||||
}
|
||||
|
||||
public void setCreateTaskCount(Long createTaskCount) {
|
||||
this.createTaskCount = createTaskCount;
|
||||
}
|
||||
|
||||
public Long getSubmitPapersCount() {
|
||||
return submitPapersCount;
|
||||
}
|
||||
|
||||
public void setSubmitPapersCount(Long submitPapersCount) {
|
||||
this.submitPapersCount = submitPapersCount;
|
||||
}
|
||||
|
||||
public Long getWatchTaskCount() {
|
||||
return watchTaskCount;
|
||||
}
|
||||
|
||||
public void setWatchTaskCount(Long watchTaskCount) {
|
||||
this.watchTaskCount = watchTaskCount;
|
||||
}
|
||||
|
||||
public Long getJoinTaskCount() {
|
||||
return joinTaskCount;
|
||||
}
|
||||
|
||||
public void setJoinTaskCount(Long joinTaskCount) {
|
||||
this.joinTaskCount = joinTaskCount;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.microservices.dms.behaviorImage.domain;
|
||||
|
||||
public class UserTypeTotalVo {
|
||||
private String resultType;
|
||||
private Long watchSum;
|
||||
private Long favoriteSum;
|
||||
private Long downloadSum;
|
||||
private Long clickSum;
|
||||
private Long searchSum;
|
||||
private Long praiseSum;
|
||||
|
||||
public String getResultType() {
|
||||
return resultType;
|
||||
}
|
||||
|
||||
public void setResultType(String resultType) {
|
||||
this.resultType = resultType;
|
||||
}
|
||||
|
||||
public Long getWatchSum() {
|
||||
return watchSum;
|
||||
}
|
||||
|
||||
public void setWatchSum(Long watchSum) {
|
||||
this.watchSum = watchSum;
|
||||
}
|
||||
|
||||
public Long getFavoriteSum() {
|
||||
return favoriteSum;
|
||||
}
|
||||
|
||||
public void setFavoriteSum(Long favoriteSum) {
|
||||
this.favoriteSum = favoriteSum;
|
||||
}
|
||||
|
||||
public Long getDownloadSum() {
|
||||
return downloadSum;
|
||||
}
|
||||
|
||||
public void setDownloadSum(Long downloadSum) {
|
||||
this.downloadSum = downloadSum;
|
||||
}
|
||||
|
||||
public Long getClickSum() {
|
||||
return clickSum;
|
||||
}
|
||||
|
||||
public void setClickSum(Long clickSum) {
|
||||
this.clickSum = clickSum;
|
||||
}
|
||||
|
||||
public Long getSearchSum() {
|
||||
return searchSum;
|
||||
}
|
||||
|
||||
public void setSearchSum(Long searchSum) {
|
||||
this.searchSum = searchSum;
|
||||
}
|
||||
|
||||
public Long getPraiseSum() {
|
||||
return praiseSum;
|
||||
}
|
||||
|
||||
public void setPraiseSum(Long praiseSum) {
|
||||
this.praiseSum = praiseSum;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
package com.microservices.dms.behaviorImage.mapper;
|
||||
|
||||
import com.microservices.common.datasource.annotation.Slave;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.behaviorImage.domain.*;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
@Slave
|
||||
public interface BehaviorImageMapper {
|
||||
AchievementBehaviorSumVo getBehaviorSumListByType();
|
||||
|
||||
List<KeyValueVo> getWeightListByType(@Param("achievementsImage") String achievementsImage);
|
||||
|
||||
Long getFavoriteSumByAchievementId(@Param("id") Long id,@Param("achievementsImage") String achievementsImage);
|
||||
|
||||
Long getSearchSumByAchievementId(@Param("id") Long id,@Param("achievementsImage") String achievementsImage);
|
||||
|
||||
Long getWatchSumByAchievementId(@Param("id") Long id,@Param("achievementsImage") String achievementsImage);
|
||||
|
||||
Long getFileDownloadSumByAchievementId(@Param("id") Long id,@Param("achievementsImage") String achievementsImage);
|
||||
|
||||
Long getClickSumByAchievementId(@Param("id") Long id, @Param("achievementsImage") String achievementsImage);
|
||||
|
||||
/**
|
||||
* 查询画像行为权重
|
||||
*
|
||||
* @param id 画像行为权重主键
|
||||
* @return 画像行为权重
|
||||
*/
|
||||
public BehaviorImageWeight selectBehaviorImageWeightById(Long id);
|
||||
|
||||
/**
|
||||
* 查询画像行为权重列表
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 画像行为权重集合
|
||||
*/
|
||||
public List<BehaviorImageWeight> selectBehaviorImageWeightList(BehaviorImageWeight behaviorImageWeight);
|
||||
|
||||
/**
|
||||
* 新增画像行为权重
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBehaviorImageWeight(BehaviorImageWeight behaviorImageWeight);
|
||||
|
||||
/**
|
||||
* 修改画像行为权重
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBehaviorImageWeight(BehaviorImageWeight behaviorImageWeight);
|
||||
|
||||
/**
|
||||
* 删除画像行为权重
|
||||
*
|
||||
* @param id 画像行为权重主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBehaviorImageWeightById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除画像行为权重
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBehaviorImageWeightByIds(Long[] ids);
|
||||
|
||||
List<KeyValueVo> getUserProjecttatistic(@Param("userId")Long userId);
|
||||
|
||||
List<KeyValueVo> getUserTaskStatistic(@Param("userId")Long userId);
|
||||
|
||||
List<ActivityUserLibrary> selectActivityUserLibraryList(ActivityUserLibrary activityUserLibrary);
|
||||
|
||||
Long getrelatedProjectCount(@Param("userId")Long userId);
|
||||
|
||||
Long getrelatedTaskCount(@Param("userId")Long userId);
|
||||
|
||||
List<KeyValueVo> getUserCompStatistic(@Param("userId")Long userId);
|
||||
|
||||
Long getrelatedCompetitionCount(@Param("userId")Long userId);
|
||||
|
||||
List<KeyValueVo> getUserMemoStatistic(@Param("userId")Long userId);
|
||||
|
||||
Long getrelatedMemoCount(@Param("userId")Long userId);
|
||||
|
||||
List<KeyValueVo> getUserExperttatistic(@Param("userId")Long userId);
|
||||
|
||||
List<UserTypeTotalVo> getUserTypeStatistic(@Param("userId")Long userId);
|
||||
|
||||
ActivityUserTotal getActivityStatistic();
|
||||
|
||||
List<ActivityUserLibrary> selectActivityUserLibraryListAll(ActivityUserLibrary activityUserLibrary);
|
||||
|
||||
UserTypeTotalVo getUserBehaviorSum(@Param("userId")Long userId);
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
package com.microservices.dms.behaviorImage.service;
|
||||
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.behaviorImage.domain.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IBehaviorImageService {
|
||||
AchievementImageVo getAchievementImageById(Long id);
|
||||
/**
|
||||
* 查询画像行为权重
|
||||
*
|
||||
* @param id 画像行为权重主键
|
||||
* @return 画像行为权重
|
||||
*/
|
||||
public BehaviorImageWeight selectBehaviorImageWeightById(Long id);
|
||||
|
||||
/**
|
||||
* 查询画像行为权重列表
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 画像行为权重集合
|
||||
*/
|
||||
public List<BehaviorImageWeight> selectBehaviorImageWeightList(BehaviorImageWeight behaviorImageWeight);
|
||||
|
||||
/**
|
||||
* 新增画像行为权重
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBehaviorImageWeight(BehaviorImageWeight behaviorImageWeight);
|
||||
|
||||
/**
|
||||
* 修改画像行为权重
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBehaviorImageWeight(BehaviorImageWeight behaviorImageWeight);
|
||||
|
||||
/**
|
||||
* 批量删除画像行为权重
|
||||
*
|
||||
* @param ids 需要删除的画像行为权重主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBehaviorImageWeightByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除画像行为权重信息
|
||||
*
|
||||
* @param id 画像行为权重主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBehaviorImageWeightById(Long id);
|
||||
|
||||
/**
|
||||
* 查询活跃用户资源库列表
|
||||
*
|
||||
* @param activityUserLibrary 活跃用户资源库
|
||||
* @return 活跃用户资源库集合
|
||||
*/
|
||||
List<ActivityUserLibrary> selectActivityUserLibraryList(ActivityUserLibrary activityUserLibrary);
|
||||
|
||||
List<UserTypeTotalVo> getUserTypeStatistic(Long userId);
|
||||
|
||||
UserProjectTotalVo getUserProjectStatistic(Long userId);
|
||||
|
||||
UserTaskTotalVo getUserTaskStatistic(Long userId);
|
||||
|
||||
UserCompetitionTotalVo getUserCompStatistic(Long userId);
|
||||
|
||||
UserMemoTotalVo getUserMemoStatistic(Long userId);
|
||||
|
||||
UserExpertTotalVo getUserExpertStatistic(Long userId);
|
||||
|
||||
ActivityUserTotal getActivityStatistic();
|
||||
|
||||
UserTypeTotalVo getUserBehaviorSum(Long userId);
|
||||
}
|
||||
|
|
@ -0,0 +1,352 @@
|
|||
package com.microservices.dms.behaviorImage.service.impl;
|
||||
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
import com.microservices.common.core.utils.StringUtils;
|
||||
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
|
||||
import com.microservices.dms.behaviorImage.domain.*;
|
||||
import com.microservices.dms.behaviorImage.mapper.BehaviorImageMapper;
|
||||
import com.microservices.dms.behaviorImage.service.IBehaviorImageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class BehaviorImageServiceImpl implements IBehaviorImageService {
|
||||
@Autowired
|
||||
private BehaviorImageMapper behaviorImageMapper;
|
||||
@Override
|
||||
public AchievementImageVo getAchievementImageById(Long id) {
|
||||
AchievementImageVo achievementImageVo = new AchievementImageVo();
|
||||
//获取所有行为汇总数据
|
||||
AchievementBehaviorSumVo achievementBehaviorSumVo = behaviorImageMapper.getBehaviorSumListByType();
|
||||
if(StringUtils.isNotNull(achievementBehaviorSumVo)) {
|
||||
float score = 0f;
|
||||
//从行为表中获取成果行为数据权限
|
||||
List<KeyValueVo> behaviorImageWeightList = behaviorImageMapper.getWeightListByType(BehaviorContant.ACHIEVEMENTS_IMAGE);
|
||||
float clickResult = 0L;
|
||||
float watchResult = 0L;
|
||||
float searchResult = 0L;
|
||||
float favoriteResult = 0L;
|
||||
float fileDownloadResult = 0L;
|
||||
//简单算法
|
||||
for (KeyValueVo keyValueVo : behaviorImageWeightList) {
|
||||
String bhavior = keyValueVo.getKey();
|
||||
Long weight = keyValueVo.getValue();
|
||||
if (bhavior.equals(BehaviorContant.CLICK_BEHAVIOR)) {//点击
|
||||
//根据当前成果ID,获取成果点击行为数量
|
||||
Long clickSum = achievementBehaviorSumVo.getClickSum();
|
||||
if(StringUtils.isNotNull(clickSum) && clickSum > 0) {
|
||||
Long click = behaviorImageMapper.getClickSumByAchievementId(id, BehaviorContant.ACHIEVEMENTS_IMAGE);
|
||||
if (StringUtils.isNotNull(click)) {
|
||||
// clickResult = click * weight / clickSum ;
|
||||
clickResult = click * weight / 100 ;
|
||||
}
|
||||
}
|
||||
} else if (bhavior.equals(BehaviorContant.FAVORITE_BEHAVIOR)) {//收藏
|
||||
//根据当前成果ID,获取成果收藏行为数量
|
||||
Long favoriteSum = achievementBehaviorSumVo.getFavoriteSum();
|
||||
if(StringUtils.isNotNull(favoriteSum) && favoriteSum > 0) {
|
||||
Long favorite = behaviorImageMapper.getFavoriteSumByAchievementId(id,BehaviorContant.ACHIEVEMENTS_IMAGE);
|
||||
if (StringUtils.isNotNull(favorite)) {
|
||||
// favoriteResult = favorite *weight / favoriteSum ;
|
||||
favoriteResult = favorite *weight / 100 ;
|
||||
}
|
||||
}
|
||||
} else if (bhavior.equals(BehaviorContant.SEARCH_BEHAVIOR)) {//搜索
|
||||
//根据当前成果ID,获取成果搜索行为数量
|
||||
Long searchSum = achievementBehaviorSumVo.getSearchSum();
|
||||
if(StringUtils.isNotNull(searchSum) && searchSum > 0) {
|
||||
Long search = behaviorImageMapper.getSearchSumByAchievementId(id, BehaviorContant.ACHIEVEMENTS_IMAGE);
|
||||
if (StringUtils.isNotNull(search)) {
|
||||
// searchResult = search *weight / searchSum;
|
||||
searchResult = search *weight / 100;
|
||||
}
|
||||
}
|
||||
} else if (bhavior.equals(BehaviorContant.WATCH_BEHAVIOR)) {//关注
|
||||
//根据当前成果ID,获取成果关注行为数量
|
||||
Long watchSum = achievementBehaviorSumVo.getFavoriteSum();
|
||||
if(StringUtils.isNotNull( watchSum) && watchSum > 0) {
|
||||
Long watch = behaviorImageMapper.getWatchSumByAchievementId(id,BehaviorContant.ACHIEVEMENTS_IMAGE);
|
||||
if (StringUtils.isNotNull( watch) ) {
|
||||
// watchResult = watch *weight / watchSum;
|
||||
watchResult = watch *weight / 100;
|
||||
}
|
||||
}
|
||||
} else if (bhavior.equals(BehaviorContant.FILE_DOWNLOAD_BEHAVIOR)) {//文件下载
|
||||
//根据当前成果ID,获取成果文件下载行为数量
|
||||
Long fileDownloadSum = achievementBehaviorSumVo.getFavoriteSum();
|
||||
if(StringUtils.isNotNull(fileDownloadSum) && fileDownloadSum > 0) {
|
||||
Long fileDownload = behaviorImageMapper.getFileDownloadSumByAchievementId(id, BehaviorContant.ACHIEVEMENTS_IMAGE);
|
||||
if (StringUtils.isNotNull(fileDownload)) {
|
||||
// fileDownloadResult = fileDownload *weight / fileDownloadSum ;
|
||||
fileDownloadResult = fileDownload *weight / 100 ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
score = clickResult+watchResult+searchResult+favoriteResult+fileDownloadResult;
|
||||
achievementImageVo.setScore(score);
|
||||
}
|
||||
return achievementImageVo;
|
||||
}
|
||||
/**
|
||||
* 查询画像行为权重
|
||||
*
|
||||
* @param id 画像行为权重主键
|
||||
* @return 画像行为权重
|
||||
*/
|
||||
@Override
|
||||
public BehaviorImageWeight selectBehaviorImageWeightById(Long id)
|
||||
{
|
||||
return behaviorImageMapper.selectBehaviorImageWeightById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询画像行为权重列表
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 画像行为权重
|
||||
*/
|
||||
@Override
|
||||
public List<BehaviorImageWeight> selectBehaviorImageWeightList(BehaviorImageWeight behaviorImageWeight)
|
||||
{
|
||||
return behaviorImageMapper.selectBehaviorImageWeightList(behaviorImageWeight);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增画像行为权重
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBehaviorImageWeight(BehaviorImageWeight behaviorImageWeight)
|
||||
{
|
||||
behaviorImageWeight.setCreateTime(DateUtils.getNowDate());
|
||||
return behaviorImageMapper.insertBehaviorImageWeight(behaviorImageWeight);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改画像行为权重
|
||||
*
|
||||
* @param behaviorImageWeight 画像行为权重
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBehaviorImageWeight(BehaviorImageWeight behaviorImageWeight)
|
||||
{
|
||||
behaviorImageWeight.setUpdateTime(DateUtils.getNowDate());
|
||||
return behaviorImageMapper.updateBehaviorImageWeight(behaviorImageWeight);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除画像行为权重
|
||||
*
|
||||
* @param ids 需要删除的画像行为权重主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBehaviorImageWeightByIds(Long[] ids)
|
||||
{
|
||||
return behaviorImageMapper.deleteBehaviorImageWeightByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除画像行为权重信息
|
||||
*
|
||||
* @param id 画像行为权重主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBehaviorImageWeightById(Long id)
|
||||
{
|
||||
return behaviorImageMapper.deleteBehaviorImageWeightById(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用户新增分类数据统计
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public List<UserTypeTotalVo> getUserTypeStatistic(Long userId) {
|
||||
return behaviorImageMapper.getUserTypeStatistic(userId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户ID,获取开源项目相关汇总
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserProjectTotalVo getUserProjectStatistic(Long userId) {
|
||||
UserProjectTotalVo userProjectTotalVo = new UserProjectTotalVo();
|
||||
List<KeyValueVo> resultVo = behaviorImageMapper.getUserProjecttatistic(userId);
|
||||
if(StringUtils.isNotNull(resultVo)) {
|
||||
for(KeyValueVo temResult : resultVo) {
|
||||
Long result = temResult.getValue();
|
||||
if(temResult.getKey().equals("createProjectCount")) {
|
||||
userProjectTotalVo.setCreateProjectCount(result);
|
||||
}else if(temResult.getKey().equals("joinProjectCount")){
|
||||
userProjectTotalVo.setJoinProjectCount(result);
|
||||
}else if(temResult.getKey().equals("forkProjectCount")){
|
||||
userProjectTotalVo.setForkProjectCount(result);
|
||||
}else if(temResult.getKey().equals("issueSum")){
|
||||
userProjectTotalVo.setIssueSum(result);
|
||||
}else if(temResult.getKey().equals("prSum")){
|
||||
userProjectTotalVo.setPrSum(result);
|
||||
}else if(temResult.getKey().equals("commitSum")){
|
||||
userProjectTotalVo.setCommitSum(result);
|
||||
}else if(temResult.getKey().equals("watchProjectCount")){
|
||||
userProjectTotalVo.setWatchProjectCount(result);
|
||||
}else if(temResult.getKey().equals("praiseProjectCount")){
|
||||
userProjectTotalVo.setPraiseProjectCount(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
return userProjectTotalVo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户ID,获取创客任务相关汇总
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserTaskTotalVo getUserTaskStatistic(Long userId) {
|
||||
UserTaskTotalVo userTaskTotalVo = new UserTaskTotalVo();
|
||||
List<KeyValueVo> resultVo = behaviorImageMapper.getUserTaskStatistic(userId);
|
||||
if(StringUtils.isNotNull(resultVo)) {
|
||||
for(KeyValueVo temResult : resultVo) {
|
||||
Long result = temResult.getValue();
|
||||
if(temResult.getKey().equals("createTaskCount")) {
|
||||
userTaskTotalVo.setCreateTaskCount(result);
|
||||
}else if(temResult.getKey().equals("submitPapersCount")){
|
||||
userTaskTotalVo.setSubmitPapersCount(result);
|
||||
}else if(temResult.getKey().equals("watchTaskCount")){
|
||||
userTaskTotalVo.setWatchTaskCount(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
return userTaskTotalVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户ID,获取开放竞赛相关汇总
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserCompetitionTotalVo getUserCompStatistic(Long userId) {
|
||||
UserCompetitionTotalVo userCompetitionTotalVo = new UserCompetitionTotalVo();
|
||||
List<KeyValueVo> resultVo = behaviorImageMapper.getUserCompStatistic(userId);
|
||||
if(StringUtils.isNotNull(resultVo)) {
|
||||
for(KeyValueVo temResult : resultVo) {
|
||||
Long result = temResult.getValue();
|
||||
if(temResult.getKey().equals("joinCompetitionCount")) {
|
||||
userCompetitionTotalVo.setJoinCompetitionCount(result);
|
||||
}else if(temResult.getKey().equals("watchCompetitionCount")){
|
||||
userCompetitionTotalVo.setWatchCompetitionCount(result);
|
||||
}else if(temResult.getKey().equals("signUpCount")){
|
||||
userCompetitionTotalVo.setSignUpCount(result);
|
||||
}else if(temResult.getKey().equals("submitWorkCount")){
|
||||
userCompetitionTotalVo.setSubmitWorkCount(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
return userCompetitionTotalVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户ID, 获取用户论坛交流相关数据
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserMemoTotalVo getUserMemoStatistic(Long userId) {
|
||||
UserMemoTotalVo userMemoTotalVo = new UserMemoTotalVo();
|
||||
List<KeyValueVo> resultVo = behaviorImageMapper.getUserMemoStatistic(userId);
|
||||
if(StringUtils.isNotNull(resultVo)) {
|
||||
for(KeyValueVo temResult : resultVo) {
|
||||
Long result = temResult.getValue();
|
||||
if(temResult.getKey().equals("createMemoCount")) {
|
||||
userMemoTotalVo.setCreateMemoCount(result);
|
||||
}else if(temResult.getKey().equals("replayMemoCount")){
|
||||
userMemoTotalVo.setReplayMemoCount(result);
|
||||
}else if(temResult.getKey().equals("watchMemoCount")){
|
||||
userMemoTotalVo.setWatchMemoCount(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
return userMemoTotalVo;
|
||||
}
|
||||
/**
|
||||
* 根据用户ID, 获取用户专家资源相关数据
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public UserExpertTotalVo getUserExpertStatistic(Long userId) {
|
||||
UserExpertTotalVo userExpertTotalVo = new UserExpertTotalVo();
|
||||
List<KeyValueVo> resultVo = behaviorImageMapper.getUserExperttatistic(userId);
|
||||
if(StringUtils.isNotNull(resultVo)) {
|
||||
for(KeyValueVo temResult : resultVo) {
|
||||
Long result = temResult.getValue();
|
||||
if(temResult.getKey().equals("watchExpertCount")) {
|
||||
userExpertTotalVo.setWatchExpertCount(result);
|
||||
}else if(temResult.getKey().equals("favoriteExpertCount")){
|
||||
userExpertTotalVo.setFavoriteExpertCount(result);
|
||||
}else if(temResult.getKey().equals("aduitCompetitionCount")){
|
||||
userExpertTotalVo.setAduitCompetitionCount(result);
|
||||
}else if(temResult.getKey().equals("aduitTaskCount")){
|
||||
userExpertTotalVo.setAduitTaskCount(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
return userExpertTotalVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActivityUserTotal getActivityStatistic() {
|
||||
return behaviorImageMapper.getActivityStatistic();
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户资源库
|
||||
* @param activityUserLibrary 活跃用户资源库
|
||||
* @return
|
||||
*/
|
||||
// @Override
|
||||
// public List<ActivityUserLibrary> selectActivityUserLibraryList(ActivityUserLibrary activityUserLibrary) {
|
||||
// List<ActivityUserLibrary> list = behaviorImageMapper.selectActivityUserLibraryList(activityUserLibrary);
|
||||
// for (ActivityUserLibrary a : list) {
|
||||
// Long relatedProject= behaviorImageMapper.getrelatedProjectCount(a.getUserId());
|
||||
// a.setRelatedProject(relatedProject);
|
||||
// Long relatedTask= behaviorImageMapper.getrelatedTaskCount(a.getUserId());
|
||||
// a.setRelatedTask(relatedTask);
|
||||
// Long relatedCompetition= behaviorImageMapper.getrelatedCompetitionCount(a.getUserId());
|
||||
// a.setRelatedCompetition(relatedCompetition);
|
||||
// Long relatedMemo= behaviorImageMapper.getrelatedMemoCount(a.getUserId());
|
||||
// a.setRelatedMemo(relatedMemo);
|
||||
// }
|
||||
// return list;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public List<ActivityUserLibrary> selectActivityUserLibraryList(ActivityUserLibrary activityUserLibrary) {
|
||||
List<ActivityUserLibrary> list = behaviorImageMapper.selectActivityUserLibraryListAll(activityUserLibrary);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserTypeTotalVo getUserBehaviorSum(Long userId) {
|
||||
return behaviorImageMapper.getUserBehaviorSum(userId);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,223 @@
|
|||
package com.microservices.dms.common.controller;
|
||||
|
||||
import com.microservices.common.core.web.controller.BaseController;
|
||||
import com.microservices.common.core.web.domain.AjaxResult;
|
||||
import com.microservices.common.core.web.page.TableDataInfo;
|
||||
import com.microservices.dms.achievementLibrary.domain.AchQueryVo;
|
||||
import com.microservices.dms.achievementLibrary.service.BlockChainService;
|
||||
import com.microservices.dms.achievementLibrary.service.IAchievementsService;
|
||||
import com.microservices.dms.common.vo.*;
|
||||
import com.microservices.dms.resourceLibrary.domain.ExpertResourceLibrary;
|
||||
import com.microservices.dms.resourceLibrary.service.IExpertResourceLibraryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author otto
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "数据管理体系-公开接口")
|
||||
@RequestMapping("/open")
|
||||
@RefreshScope
|
||||
public class OpenController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IAchievementsService achievementsService;
|
||||
|
||||
@Autowired
|
||||
private IExpertResourceLibraryService expertResourceLibraryService;
|
||||
|
||||
@Autowired
|
||||
private BlockChainService blockChainService;
|
||||
|
||||
/**
|
||||
* 获取精选成果
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("获取精选成果")
|
||||
@GetMapping("/achievements/getChoiceImport")
|
||||
public AjaxResult getChoiceImport() {
|
||||
return success(achievementsService.getChoiceImport());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据成果来源对成果数据进行分类统计
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("根据成果来源对成果数据进行分类统计")
|
||||
@GetMapping("/achievements/getTjBySources")
|
||||
public AjaxResult getTjBySources() {
|
||||
return success(achievementsService.getTjBySources());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据成果领域对成功数据进行汇总
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("根据成果领域对成果数据进行汇总")
|
||||
@GetMapping("/achievements/getTjByAreas")
|
||||
public AjaxResult getTjByAreas() {
|
||||
return success(achievementsService.getTjByAreas());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据领域分类名称,获取领域相关数据
|
||||
*/
|
||||
@ApiOperation("根据领域分类名称,获取领域相关数据")
|
||||
@GetMapping("/achievements/getAreasByName")
|
||||
public AjaxResult getAreasByName(String areaName) {
|
||||
return success(achievementsService.getAreasByName(areaName));
|
||||
}
|
||||
|
||||
@ApiOperation("根据领域分类名称,获取项目领域")
|
||||
@GetMapping("/achievements/getProjectAreasByName")
|
||||
public AjaxResult getProjectAreasByName(String areaName) {
|
||||
return success(achievementsService.getProjectAreasByName(areaName));
|
||||
}
|
||||
|
||||
@ApiOperation("根据领域分类名称,获取专家领域")
|
||||
@GetMapping("/achievements/getExpertAreasByName")
|
||||
public AjaxResult getExpertAreasByName(String areaName) {
|
||||
return success(achievementsService.getExpertAreasByName(areaName));
|
||||
}
|
||||
|
||||
/* 获取全部成果,根据成果名称、成果领域、成果来源进行查询
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("获取全部成果,根据成果名称、成果领域、成果来源进行查询")
|
||||
@GetMapping("/achievements/getAllResult")
|
||||
public TableDataInfo getAllResult(AchQueryVo achQueryVo) {
|
||||
startPage();
|
||||
return getDataTable(achievementsService.getAllResult(achQueryVo));
|
||||
}
|
||||
|
||||
@ApiOperation("近七日用户行为数据")
|
||||
@GetMapping("/achievements/getUerActionData")
|
||||
public AjaxResult getUerActionData() {
|
||||
return success(achievementsService.getUerActionData());
|
||||
}
|
||||
|
||||
@ApiOperation("热门成果")
|
||||
@GetMapping("/achievements/getHotAchievement")
|
||||
public AjaxResult getHotAchievement() {
|
||||
return success(achievementsService.getHotAchievement());
|
||||
}
|
||||
|
||||
@ApiOperation("七日新增")
|
||||
@GetMapping("/achievements/get7DayAdd")
|
||||
public AjaxResult get7DayAdd(AchQueryVo achQueryVo) {
|
||||
return success(achievementsService.get7DayAdd(achQueryVo));
|
||||
}
|
||||
|
||||
@ApiOperation("七日新增专家")
|
||||
@GetMapping("/achievements/get7DayAddExpert")
|
||||
public AjaxResult get7DayAddExport(AchQueryVo achQueryVo) {
|
||||
return success(achievementsService.get7DayAddExport(achQueryVo));
|
||||
}
|
||||
|
||||
@ApiOperation("首页项目统计")
|
||||
@GetMapping("/achievements/indexProjectStatistic")
|
||||
public AjaxResult indexProjectStatistic() {
|
||||
return success(achievementsService.indexProjectStatistic());
|
||||
}
|
||||
|
||||
@ApiOperation("首页task统计")
|
||||
@GetMapping("/achievements/indexTaskStatistic")
|
||||
public AjaxResult indexTaskStatistic() {
|
||||
return success(achievementsService.indexTaskStatistic());
|
||||
}
|
||||
|
||||
@ApiOperation("首页Competition统计")
|
||||
@GetMapping("/achievements/indexCompetitionStatistic")
|
||||
public AjaxResult indexCompetitionStatistic() {
|
||||
return success(achievementsService.indexCompetitionStatistic());
|
||||
}
|
||||
|
||||
@ApiOperation("首页SchoolEnterprise统计")
|
||||
@GetMapping("/achievements/indexSchoolEnterpriseStatistic")
|
||||
public AjaxResult indexSchoolEnterpriseStatistic() {
|
||||
return success(achievementsService.indexSchoolEnterpriseStatistic());
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("首页专家统计")
|
||||
@GetMapping("/achievements/indexExpertStatistic")
|
||||
public AjaxResult indexExpertStatistic() {
|
||||
return success(achievementsService.indexExpertStatistic());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询专家资源库列表
|
||||
*/
|
||||
@GetMapping("/expertResourceLibrary/listFront")
|
||||
public TableDataInfo listFront(ExpertResourceLibrary expertResourceLibrary)
|
||||
{
|
||||
startPage();
|
||||
List<ExpertResourceLibrary> list = expertResourceLibraryService.selectExpertResourceLibraryList2(expertResourceLibrary);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/downloadAch")
|
||||
@ApiOperation("成果征集信息下载")
|
||||
public ResponseEntity<Resource> downloadAch() throws IOException {
|
||||
String fileName = "红山开源优秀科研成果信息征集.zip";
|
||||
Resource resource = new ClassPathResource(fileName);
|
||||
if (!resource.exists()) {
|
||||
throw new RuntimeException("文件不存在: " + fileName);
|
||||
}
|
||||
String encodedFileName = URLEncoder.encode(fileName, String.valueOf(StandardCharsets.UTF_8))
|
||||
.replace("+", "%20");
|
||||
|
||||
return ResponseEntity.ok()
|
||||
.header(HttpHeaders.CONTENT_DISPOSITION,
|
||||
"attachment; filename*=UTF-8''" + encodedFileName)
|
||||
.contentType(MediaType.APPLICATION_OCTET_STREAM)
|
||||
.body(resource);
|
||||
}
|
||||
|
||||
// @ApiOperation("提供给开源项目那边新建项目,并且use_blockchain='1'的项目数据")
|
||||
// @PostMapping("/blockChain/projectCreate")
|
||||
// public AjaxResult projectCreate (@RequestBody ProjectCreateVo projectCreateVo) {
|
||||
// return blockChainService.projectCreate(projectCreateVo);
|
||||
// }
|
||||
|
||||
@ApiOperation("提供给开源项目那边新建issue、更新issue时调用,调用方法时传入相关数据(项目入链,并且悬赏金额不为空的issue数据才调用封装方法)")
|
||||
@PostMapping("/blockChain/issueCreateUpdate")
|
||||
public AjaxResult issueCreateUpdate (@RequestBody IssueCreateVo issueCreateVo) {
|
||||
return blockChainService.issueCreateUpdate(issueCreateVo);
|
||||
}
|
||||
|
||||
@ApiOperation("提供给开源项目那边提交commit调用,调用方法时传入相关数据(入链项目提交commit才调用)")
|
||||
@PostMapping("/blockChain/commitCreate")
|
||||
public AjaxResult commitCreate(@RequestBody CommitCreateVo commitCreateVo) {
|
||||
return blockChainService.commitCreate(commitCreateVo);
|
||||
}
|
||||
|
||||
@ApiOperation("提供给开源项目那边新建pr时调用,调用方法时传入相关数据(入链项目pr_合并代码才调用))")
|
||||
@PostMapping("/blockChain/prCreate")
|
||||
public AjaxResult prCreate(@RequestBody PrCreateVo prCreateVo) {
|
||||
return blockChainService.prCreate(prCreateVo);
|
||||
}
|
||||
|
||||
@ApiOperation("封装方法userCreate(入链项目2519,用户1向用户2转帐10个金币)")
|
||||
@PostMapping("/blockChain/userCreate")
|
||||
public AjaxResult userCreate(@RequestBody UserCreateVo userCreateVo) {
|
||||
return blockChainService.userCreate(userCreateVo);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.microservices.dms.common.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CommitCreateVo {
|
||||
private String commit_id;
|
||||
|
||||
private String project_id;
|
||||
|
||||
private String commit_diff;
|
||||
|
||||
private String issue_id;
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.microservices.dms.common.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CommitResultVo {
|
||||
private String commitId;
|
||||
|
||||
private String commitDiff;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue