Compare commits
954 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 628e0ad034 | |||
| 2f3f639918 | |||
| 87caf24dd1 | |||
| 24bfb4920c | |||
| 5f0643d4d4 | |||
| c036aab9c4 | |||
| 2eb85b6b71 | |||
| 712f1ceb61 | |||
| adf873639c | |||
| 4e9460e7da | |||
| 5481eac988 | |||
| b7c9abca02 | |||
| 447d3fc36f | |||
| 71702b2abb | |||
| 2ffb24d630 | |||
| 81ecd9ff7f | |||
| ebe012ca67 | |||
| 805176c3ea | |||
| f99cab6983 | |||
| c94d800646 | |||
| 0cbc345f49 | |||
| d34f3f1576 | |||
| 73f5e67e3c | |||
| 5cf8c7a898 | |||
| 11c9cebf47 | |||
| bd9362fb25 | |||
| 3aa588f125 | |||
| 6d33a2c1b0 | |||
| 9e4cf1d1db | |||
| ae38c84ef7 | |||
| 6306c6752a | |||
| 5490630922 | |||
| d1ea886e76 | |||
| 7dc1205bb6 | |||
| 15b094a422 | |||
| 78c46572a2 | |||
| abeda7820d | |||
| 2dac67618c | |||
| bb9b1283bf | |||
| b9458ecb38 | |||
| b205757f8f | |||
| 0b937663ff | |||
| 7a75d107dc | |||
| 0f682dd184 | |||
| c2360dd519 | |||
| f9c2ac030a | |||
| 7ce2386aea | |||
| 67b226ee44 | |||
| 70c7f8a740 | |||
| e409aa3c05 | |||
| a3b5129ee2 | |||
| 57cd0281fa | |||
| ba9d3abc52 | |||
| b9bc1f6da0 | |||
| 08f1998e61 | |||
| bc19ead2f5 | |||
| f9327c56db | |||
| 17f3d821ea | |||
| 02f3e97654 | |||
| 94bba7837c | |||
| 626fcb9cf3 | |||
| bf92165432 | |||
| 92e99edbbd | |||
| 94507c7887 | |||
| 0cce75befa | |||
| 96469c28d3 | |||
| a12db2637e | |||
| 0a406da3a4 | |||
| 6271dd4144 | |||
| 4182809657 | |||
| ab6ec064fa | |||
| d921a48a09 | |||
| 0f03dbc75b | |||
| e5fa3a09b3 | |||
| 4cdfb60fdf | |||
| 200bdaccc4 | |||
| 17a35e0fdb | |||
| 28f2bf1629 | |||
| bec04ab795 | |||
| 54cefab633 | |||
| 2918c0e93f | |||
| 92c495ed07 | |||
| d9d807e3d1 | |||
| 959b49a2cc | |||
| 17f131cf63 | |||
| 4ef67beafc | |||
| 826a04ef31 | |||
| 104b1208ed | |||
| 8b3040c24d | |||
| 153dbd2016 | |||
| 91d5cbce16 | |||
| 7218427ec2 | |||
| 5d91ae8157 | |||
| 0f61d746e5 | |||
| e931e740e6 | |||
| 38917e05ab | |||
| dd33f7e086 | |||
| 43d4d679b5 | |||
| e02fa28cd0 | |||
| 055e085d2a | |||
| caf1fb6b32 | |||
| 6b049e68cd | |||
| 2a4360cc64 | |||
| 8efc254f3c | |||
| f89b3daf50 | |||
| 29f6196698 | |||
| 09ff2468e9 | |||
| 1867277e1b | |||
| 053a09a5b2 | |||
| fae86f0836 | |||
| 2e539dfa71 | |||
| a9efd85aec | |||
| 09e70b9f21 | |||
| 2d184e0f08 | |||
| 43d6c7d8db | |||
| 19487acc64 | |||
| 336e7768b8 | |||
| 9b49dc41c8 | |||
| 74f896cf00 | |||
| 10b0bde1d0 | |||
| 411b5d5f8f | |||
| b6da27ac07 | |||
| a6b81b038f | |||
| e2c80babfa | |||
| 01b9f28e7b | |||
| 2c9fad60fb | |||
| 398baea876 | |||
| aec94d0a46 | |||
| 4b69e45d44 | |||
| 12f2c2becb | |||
| 699f79278b | |||
| 88e07d28fd | |||
| 226ba06bf3 | |||
| c1667fc48b | |||
| f900e675da | |||
| ee51b9eade | |||
| bf62ee92dd | |||
| 78532803bc | |||
| 86ea3ebc32 | |||
| 01aba3f3e0 | |||
| 6dc1ef5728 | |||
| 02e5d770db | |||
| f8c3704c87 | |||
| 4c21459e00 | |||
| cdbbe460ab | |||
| 45da1645e0 | |||
| 9a1f4697c2 | |||
| 217b8713ff | |||
| 0998f047e4 | |||
| 47755bc2aa | |||
| 72efd36649 | |||
| 553a8d392f | |||
| f050416265 | |||
| a7d1a92a01 | |||
| bf9ce9b213 | |||
| a9c7c79fb5 | |||
| dc3a830909 | |||
| 171bfde031 | |||
| f471ce1535 | |||
| 56170b73ed | |||
| 2a9c1ec45c | |||
| 3ccb3ff4de | |||
| 6c078806cd | |||
| c2f768bef8 | |||
| 1b7bb5a4fe | |||
| dfe6d13182 | |||
| 4c04718db4 | |||
| 64d803cbc0 | |||
| 54ccae5762 | |||
| 8d6bf0c7b1 | |||
| 8496e6bcd7 | |||
| 7770fc264b | |||
| 51f21805be | |||
| 434e49ea85 | |||
| 468f7c7070 | |||
| 4577db7582 | |||
| cc17816dae | |||
| 172cecebe4 | |||
| 7913acdf70 | |||
| e9f57b5001 | |||
| b8c0bd7082 | |||
| 6200ec1ba7 | |||
| 73912fd875 | |||
| 812035686e | |||
| 1f8caa4616 | |||
| 4a1e0a87ba | |||
| 337bda45fd | |||
| c2412bfb4b | |||
| cff6b87daa | |||
| 2f93a490f0 | |||
| 1856ef9483 | |||
| b45602556c | |||
| b5326d4928 | |||
| 8bbc8c449f | |||
| dcd6375d7d | |||
| 8b53517f2c | |||
| 1c3ddcf1cd | |||
| fc4ef6b939 | |||
| 6d009c4f86 | |||
| f995187925 | |||
| 67a6a5f861 | |||
| 6bfa4da72d | |||
| 9797c94aa8 | |||
| 5dd2dfd17b | |||
| 5791aca9fd | |||
| f61ce70b82 | |||
| c8091d3215 | |||
| 7153d810aa | |||
| 68053d24b6 | |||
| a49b4c8ef7 | |||
| c6c036c152 | |||
| db0d087396 | |||
| 263f43b1a9 | |||
| 21626cda9d | |||
| 77d920a2ef | |||
| bbf7af8405 | |||
| d0bbc58b20 | |||
| fed2cbe043 | |||
| 4d4bb08423 | |||
| dd09c78cd2 | |||
| 771091a557 | |||
| 8ce1bdf21c | |||
| 679cc26225 | |||
| ff5be827d0 | |||
| 4555997957 | |||
| 3b43bee0f1 | |||
| 3677a30bab | |||
| 2e8b2a24ae | |||
| 26500aa1cf | |||
| adfd6b50c1 | |||
| b58bdc184e | |||
| 580eea7a61 | |||
| da27b65e56 | |||
| bb493fe827 | |||
| 655fe18138 | |||
| 9d70d61013 | |||
| 68452beba0 | |||
| 409e9e9bc0 | |||
| f241f2cd2b | |||
| 2ea90a66ae | |||
| c2c8f65aaa | |||
| a578be8336 | |||
| 45b469682a | |||
| 1e9f4d890f | |||
| 44f74fd9e6 | |||
| f1c8415899 | |||
| 823ada5673 | |||
| 55f146a44a | |||
| 5fe972bd99 | |||
| 0578263e10 | |||
| 9316c0814f | |||
| 8bdd9e29ab | |||
| ae14a8a530 | |||
| 2a170cc97e | |||
| c109e14a93 | |||
| 240d406a1a | |||
| b6cf988058 | |||
| c16153fa19 | |||
| a0797a99ff | |||
| 376cfa3167 | |||
| 14690dc3cc | |||
| 6dd0831a66 | |||
| a150156810 | |||
| d61fba9d95 | |||
| 7cb8d04ca9 | |||
| a2fc2c5075 | |||
| 1ed8788c83 | |||
| 14e95fd303 | |||
| 3dca5aa06f | |||
| faea3a4f86 | |||
| a5dcad1767 | |||
| 6754121b17 | |||
| 131425774a | |||
| 585e4cdc1b | |||
| 12ddeba2a3 | |||
| ab0c256e0b | |||
| 8a24b33757 | |||
| 8f6e2e342a | |||
| 4dfeb653b1 | |||
| 670a754eb2 | |||
| 3f46103dc3 | |||
| 6c2901daca | |||
| a73e5d4133 | |||
| b067cb66f3 | |||
| f1185758d6 | |||
| 0d4a0adf00 | |||
| 20f6f95b89 | |||
| 7e7c186784 | |||
| 70e0a1325a | |||
| 91471dee13 | |||
| a80dc14dcc | |||
| e1cd187f4b | |||
| 35fb7533db | |||
| bdd9b69dfd | |||
| 82a043a233 | |||
| 66819a1e89 | |||
| 9089376e5e | |||
| 8d3f654fe5 | |||
| c607af9736 | |||
| 0b45c30d0b | |||
| 1b7de79209 | |||
| 4ffedb4052 | |||
| d8eb7acf2e | |||
| 6f3a4d723c | |||
| 0b2305ae65 | |||
| e86c255186 | |||
| d8658dca2a | |||
| 4372202a5b | |||
| affdc3e229 | |||
| cfa384d02a | |||
| a33b7d606b | |||
| da9ea70e5e | |||
| 6f254ca958 | |||
| da3bd07607 | |||
| 1569010d69 | |||
| ea7b3f4f7a | |||
| fc041e810c | |||
| ebc00e3e6d | |||
| 612c0b127c | |||
| a67df04da6 | |||
| 43ae270eb7 | |||
| d41c88beeb | |||
| 92486d8320 | |||
| 0d2d3408b5 | |||
| f76b66c35d | |||
| 48a98de7cc | |||
| 23ba634a42 | |||
| 23d7598722 | |||
| 7885cd151a | |||
| fb478aa5f2 | |||
| 31f56a39a5 | |||
| 6860f9437b | |||
| a06e7a9a2c | |||
| ac8875acdf | |||
| f79c12165e | |||
| 91b358e674 | |||
| 7ec274fb72 | |||
| 7d419595ca | |||
| a6e260dce1 | |||
| 2e9a75279d | |||
| 68a57594ff | |||
| bd4d6c8c5f | |||
| a36a0513fe | |||
| 02e418f660 | |||
| 199f7060fa | |||
| 9bdb782b8d | |||
| 9b9bbfbd5d | |||
| a9a034923f | |||
| 07b63077d1 | |||
| 013b9720b3 | |||
| f924b4985a | |||
| 40b986e310 | |||
| 146b0635c8 | |||
| e76a5d189e | |||
| 6f81c39c62 | |||
| 036565ec81 | |||
| a2225d7cba | |||
| 3463b69b78 | |||
| bf61a05e45 | |||
| d930d51d0d | |||
| 629fbfb037 | |||
| 2255ee1b03 | |||
| 5d269b699c | |||
| 7b7723426b | |||
| 07f1511bb9 | |||
| 36f0e20340 | |||
| 63919c8f6b | |||
| 77798e929e | |||
| f407c5f514 | |||
| e66df9bbc9 | |||
| 38fe5aea25 | |||
| 2d792b4557 | |||
| 5222cdb8f1 | |||
| 453d3f7653 | |||
| dca0dfb003 | |||
| 2d1e2f53ee | |||
| 82167463e4 | |||
| e46f204204 | |||
| 9d6cdd5711 | |||
| fc70ec7ad0 | |||
| 68845ae44b | |||
| 5570c56b1e | |||
| 2fdd7bf464 | |||
| 24c259a38b | |||
| f4a97b940a | |||
| 0f74444b22 | |||
| cf9d42dc49 | |||
| f518b44007 | |||
| 95a203881e | |||
| b86361bf0e | |||
| 5c97f37a75 | |||
| 307d982fcb | |||
| 3d791d2e41 | |||
| 538cfa279a | |||
| 3f2315c96d | |||
| 293933ec7d | |||
| 97d3b986de | |||
| f8fea6561d | |||
| dfa8474a6e | |||
| e022eb058b | |||
| d04b425d62 | |||
| c1fdf67d39 | |||
| dd902c1355 | |||
| b21b122d24 | |||
| 7544bc81a3 | |||
| aab998d5c6 | |||
| 3dc5507b6b | |||
| 12fbc2643c | |||
| b14e712126 | |||
| c303f6677b | |||
| 1976cd8cdd | |||
| cc6d5d2b4f | |||
| b72edbf326 | |||
| b0b23593f6 | |||
| 941eee9857 | |||
| 8f8751103e | |||
| c575e15c55 | |||
| 56afa2bf8d | |||
| 2e993149a9 | |||
| 89421ee731 | |||
| 2509e26aae | |||
| db7e9b90ec | |||
| 9827b22b6f | |||
| 9636efcb56 | |||
| 06d8e4bea8 | |||
| 5111372972 | |||
| 4cdf94d29c | |||
| 5bacf2667f | |||
| 81cb833d57 | |||
| 53e96811ce | |||
| 7b52c0b785 | |||
| 9362d29fae | |||
| 212268cfa5 | |||
| 862da87a0c | |||
| 0dae3c000c | |||
| 55ea791387 | |||
| 3a62189503 | |||
| d3396d9683 | |||
| 7672c9ab85 | |||
| afbc43b83f | |||
| 4613f98154 | |||
| 52f34d70b7 | |||
| 02d378e0e6 | |||
| c29bb8e1a3 | |||
| 1eaa56bb2a | |||
| 54cdd14889 | |||
| 01c253952b | |||
| 060be72143 | |||
| f5032b95ce | |||
| 8fce9f4bf2 | |||
| 857e7c5523 | |||
| 67dbf7c701 | |||
| 17fd46c2dc | |||
| 75b3a60ca6 | |||
| f499a9b803 | |||
| c87c724685 | |||
| 36ea9f526e | |||
| e5bf8c4c8c | |||
| 60a5cc4602 | |||
| c376fe1d22 | |||
| 8111b60d4f | |||
| 86c871bc9f | |||
| a21cca53f8 | |||
| 4a03467968 | |||
| f6151b7ce1 | |||
| cbfc2f9538 | |||
| 35ca08ee04 | |||
| 0781496c69 | |||
| 0cca369eaa | |||
| 62fafeb7d2 | |||
| f513829c94 | |||
| bbb3a41293 | |||
| e966779cc8 | |||
| bcc576dfd1 | |||
| dac9453048 | |||
| faf5430248 | |||
| 561e1748d6 | |||
| 83749e15cb | |||
| 1a64c07c8e | |||
| 6ead8ffd53 | |||
| 1676516441 | |||
| c97186a557 | |||
| 59f88175b4 | |||
| 77b45e80fe | |||
| 2b9272c495 | |||
| 5dae08d9c0 | |||
| 653533020f | |||
| 5a12879182 | |||
| 8132f9a2ea | |||
| 293865fc3f | |||
| cfbe3d2589 | |||
| 69151bbddb | |||
| 5faf1a5442 | |||
| 25648a8a69 | |||
| 522d619ee8 | |||
| 4a901085d8 | |||
| 49d60f6f68 | |||
| 73b8cfe723 | |||
| 05a4de1464 | |||
| 9002d850a5 | |||
| 23cfe72d40 | |||
| 8303f9faae | |||
| 517c799e00 | |||
| 69f5b54919 | |||
| 5c0d30d2bc | |||
| c62086f8e8 | |||
| 2dfcedfe3c | |||
| 77180ea7ba | |||
| 8656ed09bb | |||
| 7cdfce354c | |||
| 2ac7af44b9 | |||
| a0b18bbf72 | |||
| 6713a9c8e2 | |||
| ecfc603dda | |||
| 55db1a2eab | |||
| f117fbb571 | |||
| 5a1687b45f | |||
| d31e560a6b | |||
| de4bf6951f | |||
| f034d9ca87 | |||
| f62e849f80 | |||
| 055537ddbb | |||
| 13efa0f1d3 | |||
| 901438a4a7 | |||
| 7b26af01b1 | |||
| de0534c3a1 | |||
| 1f490138a0 | |||
| ed3d0421db | |||
| b83e42d788 | |||
| 141fbc2e75 | |||
| 2e7cbbb8b0 | |||
| 461a59b678 | |||
| 774680ced0 | |||
| 8a26c42857 | |||
| 25a91904b8 | |||
| 1fa94b95f0 | |||
| 52efdc28e4 | |||
| 678599f218 | |||
| ba49164db6 | |||
| 6089fef0a8 | |||
| 8b3dd419b7 | |||
| 86236e865e | |||
| e696873025 | |||
| e4c602095f | |||
| be1f8dfad9 | |||
| 9571775343 | |||
| 518ed694fb | |||
| bf2b439ce1 | |||
| bfed24028a | |||
| da570f8c5a | |||
| 99fa476b80 | |||
| e0ee9abd61 | |||
| 4696951923 | |||
| ea0209f20d | |||
| 28a56ee298 | |||
| 2691da82ae | |||
| c5519976ee | |||
| bc079d3586 | |||
| a8ec762a7d | |||
| 2b6ae95160 | |||
| c9c38b5053 | |||
| f97df34b65 | |||
| aec6757748 | |||
| 33c27cccc2 | |||
| a449013c5d | |||
| b0b3744cb1 | |||
| b2ba48ea90 | |||
| 8a20051436 | |||
| eedfa4b84d | |||
| 4403a09e79 | |||
| 12fb19c47c | |||
| 14c62a8852 | |||
| 2c818b9caa | |||
| db8f587e93 | |||
| 260be98cef | |||
| b42bf4e201 | |||
| 2a42a921c4 | |||
| e84b8c25f1 | |||
| 8b44900931 | |||
| 918362e854 | |||
| ba2965e295 | |||
| ecdd0fda85 | |||
| dba356446e | |||
| 4e1ea21ba8 | |||
| 7853614d2d | |||
| 8cabb7440a | |||
| 4fc68e1f82 | |||
| c06681f379 | |||
| 57539b0471 | |||
| 8b7c429e9f | |||
| 9b94ad70ee | |||
| 9aa8bb99dc | |||
| b203c891a4 | |||
| 3833a1e696 | |||
| 6e83891139 | |||
| 39616448b8 | |||
| 6b9feca865 | |||
| e0779ab295 | |||
| 32e3153434 | |||
| b40bfe26c5 | |||
| b8d5ed2bb7 | |||
| 96e1f84c8c | |||
| 353e03c4fe | |||
| aa60cb4822 | |||
| 7eaa61678b | |||
| d74cf15138 | |||
| 6238361bd2 | |||
| cf9248b0cc | |||
| 8c884b3269 | |||
| 8710edf1bd | |||
| 5f9572a0ab | |||
| 21c10307b9 | |||
| 6e0dc64981 | |||
| 66922f8e7b | |||
| 2aa0382376 | |||
| 5cdc5400dc | |||
| 53bcdaa6ce | |||
| 473e218b2b | |||
| 99ae6c2a14 | |||
| bf3d3be6c9 | |||
| 6f775a3303 | |||
| 2eaf2d5c69 | |||
| 6de66c9a5e | |||
| 3ae311bd02 | |||
| 25116a9f0e | |||
| 2e9afc2ce8 | |||
| 7535d49844 | |||
| 340f5c580e | |||
| 1d4eedf5bb | |||
| 3ff0230fc1 | |||
| c2166556ea | |||
| 4b938e6643 | |||
| 4740e04ff1 | |||
| ccdad2f4fd | |||
| 54d17f2e24 | |||
| 0b3fe111b7 | |||
| a6080b76b1 | |||
| 7d00b51db2 | |||
| be0d1c5c65 | |||
| e1f19e9eae | |||
| 26cba15742 | |||
| 32c6d745b6 | |||
| 76649f264b | |||
| db360938fd | |||
| bd82470995 | |||
| 87560e0602 | |||
| 89cd31cd03 | |||
| 1badf2610e | |||
| 1129a2210a | |||
| a1199b44a3 | |||
| dc32df27ec | |||
| 7f874eaff0 | |||
| 21fdd4b0e4 | |||
| f7519b2095 | |||
| 686c7bac9b | |||
| 3cde829319 | |||
| 230852b2a9 | |||
| 613957d0ac | |||
| 4fe61ac51a | |||
| e9bafe9e38 | |||
| d1bf517aa7 | |||
| a2809dc15a | |||
| c1a58401eb | |||
| e22a015fcb | |||
| f45b0afc49 | |||
| f652c95d8c | |||
| bcfb91bc05 | |||
| d1f04d5c0c | |||
| e0cf5f804e | |||
| a0725e1318 | |||
| 70b7fe73ad | |||
| 5b616026ab | |||
| a001db2da5 | |||
| 2e7a0fe68d | |||
| 519eeb6df1 | |||
| 3e9221b39c | |||
| d165632cc8 | |||
| 65e50fec54 | |||
| 460575d959 | |||
| 6e34bc3c17 | |||
| 781a4a7b0b | |||
| 89d1f2f800 | |||
| 3cd3315964 | |||
| e73c775296 | |||
| 496396fa6b | |||
| 3b28e13fd8 | |||
| eedc9c5ab8 | |||
| 0578168db0 | |||
| b12877e39b | |||
| 5694addef6 | |||
| f037f0fac2 | |||
| 55132ff36f | |||
| 33e0470f5d | |||
| 90b8bd8812 | |||
| 9424de56c2 | |||
| 789e7ea2b0 | |||
| 3fecac40df | |||
| 80426f5ccd | |||
| 12a4b9151c | |||
| e3a781b950 | |||
| e16f32b5b9 | |||
| bba3a038af | |||
| b385dcfdc0 | |||
| 11dd4fa789 | |||
| 5576b54518 | |||
| 483c622fce | |||
| b13976d620 | |||
| 23cb3e1278 | |||
| 67c01da64b | |||
| e5592338d0 | |||
| 07df412118 | |||
| 4c672cd91c | |||
| a74b264f39 | |||
| 2a217c1a20 | |||
| 1f4aff2796 | |||
| d10c936003 | |||
| 4330afd683 | |||
| 06ac8f114a | |||
| 78bc09d71a | |||
| d2bca834ed | |||
| 34c50858c9 | |||
| a7441c8c78 | |||
| 125846e6b2 | |||
| d35b9a6f6f | |||
| 6b592cbda7 | |||
| f8e498b2e1 | |||
| 8ff23af18c | |||
| 828bd38eab | |||
| a9f22897e9 | |||
| b14f3fb251 | |||
| 91cde3f944 | |||
| fcffa32e06 | |||
| e2e03e30ef | |||
| bdb12a7df3 | |||
| e456f8684c | |||
| 81b56c03b7 | |||
| a92fa86809 | |||
| 745ab5cb25 | |||
| 8cee47a9f7 | |||
| b174a72709 | |||
| aebc9446ba | |||
| 6e7b77af00 | |||
| e147c2a370 | |||
| 30f41ba270 | |||
| 468a124841 | |||
| 33a15676b5 | |||
| a8b614e2a5 | |||
| 57d9a8665d | |||
| 2d03635ec4 | |||
| 5e34a41902 | |||
| 6b02c03f7f | |||
| 1c0547f3ff | |||
| 4b3e1ba5c0 | |||
| eb77fcfa2f | |||
| 86692d220a | |||
| 1417277cb1 | |||
| f40a48265c | |||
| 04e4b0ac34 | |||
| 6526e03d2c | |||
| 1fb09d05a3 | |||
| 6eefbb1745 | |||
| effd6fee41 | |||
| 84ba0bc4a9 | |||
| 7cf9bd4a81 | |||
| ba8a457688 | |||
| 848e33edb8 | |||
| 47eaed78ed | |||
| 137f77cdc5 | |||
| a2cfec6553 | |||
| da2209cf95 | |||
| ce8611e138 | |||
| 948c0d32ab | |||
| c2ed06061a | |||
| b610143e33 | |||
| fa0e4f7326 | |||
| 393bce5f5c | |||
| 004f73b24d | |||
| e53b56f0d4 | |||
| 7dbf99e1c8 | |||
| 2f77c0ecef | |||
| 2ce0306311 | |||
| 79ff873607 | |||
| 9827ffa0f2 | |||
| f81cf9c2f2 | |||
| 456e6f3035 | |||
| 25c3a6518d | |||
| 53a33c956f | |||
| c9daa09a0b | |||
| 156db9f6c5 | |||
| 1b9eeba5ba | |||
| a1588273e8 | |||
| 38b661da01 | |||
| 017babde86 | |||
| 74da92bc72 | |||
| 281b5d2177 | |||
| a9a435ee0f | |||
| 6f784a1054 | |||
| 90412c5817 | |||
| ecb0ab07d2 | |||
| 522e056f3c | |||
| 92ca6a9a34 | |||
| 93f660a2ca | |||
| 7997e8c408 | |||
| eb363fd564 | |||
| 04e4e786b0 | |||
| 12449325a9 | |||
| 3b48685a07 | |||
| 1adb7e6e2a | |||
| 46e1da667a | |||
| c5aaa08326 | |||
| e7193be3d7 | |||
| 56f27189f1 | |||
| 69bfecca9c | |||
| bc68271a2a | |||
| 27314a139d | |||
| 8ebaface32 | |||
| 408e03d02f | |||
| 8415d848c7 | |||
| 6ded64d830 | |||
| 00f6e3dc29 | |||
| 7fad0345cf | |||
| 4fa9dafdd8 | |||
| 819dfe9b68 | |||
| d0828ddf0e | |||
| c7d9e02b8d | |||
| 1bec318440 | |||
| cd6c57cec8 | |||
| f3942b507c | |||
| 888be6430a | |||
| c5e5ac4e45 | |||
| ece6832bb8 | |||
| 6c434e2ace | |||
| c08bad2fec | |||
| 5cafbdeaca | |||
| 70b99d56a4 | |||
| 66f91986bc | |||
| 8eff23a8f2 | |||
| 9bd0a23734 | |||
| e3622cb86f | |||
| eaf3d5e3e8 | |||
| d7bce4802a | |||
| 99c594acac | |||
| 5844b28983 | |||
| 26c2e917d9 | |||
| 07a2f19cf5 | |||
| 085213f920 | |||
| 985250e25c | |||
| 1c6acff8d7 | |||
| dd77dc43b6 | |||
| c7b86954fa | |||
| 13c55be759 | |||
| ce8e842823 | |||
| e5508e9b0c | |||
| 67e526893c | |||
| efcb3cf168 | |||
| ed8f24a3ad | |||
| 98947b0609 | |||
| 09d7a34c97 | |||
| 50667bddfb | |||
| 655ef79754 | |||
| 9d3e1edd61 | |||
| aba0101b01 | |||
| 7ca007b6fa | |||
| 3603656a1c | |||
| c372498251 | |||
| 05b5d0d264 | |||
| 45ab896bb9 | |||
| 2326d26c0b | |||
| 28587c8e91 | |||
| 78c707a018 | |||
| 5e889b1529 | |||
| ec945b4b39 | |||
| 4f72d97039 | |||
| 4d4af84716 | |||
| 47be1e52c9 | |||
| 4145421087 | |||
| f83bd75853 | |||
| 7e53c24919 | |||
| 341e4321b2 | |||
| c90258c49e | |||
| 5fdbdfec82 | |||
| 41a889f201 | |||
| 1f33a9fa4e | |||
| 760321f8fa | |||
| aae8afd0c5 | |||
| 33bf0d908d | |||
| 4f67de2898 | |||
| 79949b9bad | |||
| 1648cbef7b | |||
| 4abd7c8fe2 | |||
| bdf14d8641 | |||
| d2530de925 | |||
| f1a6ca24be | |||
| 8d1a6c8cec | |||
| 656b1cf252 | |||
| b89cfeb90c | |||
| 5b3beea8fa | |||
| b7d3a365b4 | |||
| bf0ab3411d | |||
| c5dacab771 | |||
| db363a7daa | |||
| 4c41a5a579 | |||
| c48803ca0c | |||
| b5e26da1ff | |||
| 501272a2a2 | |||
| e66475ab61 | |||
| 6a54a36719 | |||
| b2851352f2 | |||
| 756838e106 | |||
| b83ea13aed | |||
| 5202ee7bd6 | |||
| 424a05c211 | |||
| 702e20c834 | |||
| 506955ca7c | |||
| 9cbd1faf93 | |||
| 3354aa37f4 | |||
| f17001bace | |||
| 80d99d4862 | |||
| d19b5da008 | |||
| 31fdedb033 | |||
| c87e268165 | |||
| 93726ae28c | |||
| fed21316df | |||
| 205619071d | |||
| 16e985b37e | |||
| 590a7e7b05 | |||
| 239f87320b | |||
| d03c00d138 | |||
| 9778f5e943 | |||
| 3752bc0311 | |||
| 76bdbcbfcb | |||
| 70d321f778 | |||
| e666d93829 | |||
| a6a8f34734 | |||
| 317184ba7a | |||
| 68052766f8 | |||
| dc1cea6b5a | |||
| ebe597a575 | |||
| 4b4688538d | |||
| 0111136c95 | |||
| 8a0f1d0759 | |||
| 44c1ad740c | |||
| 664942a235 | |||
| 99e7079c14 | |||
| ec8e553304 | |||
| 93ed4013fe | |||
| 531e2f4a08 | |||
| 06059f15ac | |||
| 23e6811e89 | |||
| 6a1a7ba452 | |||
| a9c9486162 | |||
| 3d6cfccbdf | |||
| 007f8eddc9 | |||
| b94bc8eff1 |
+16
-8
@@ -126,16 +126,22 @@ builder.Services.Configure<ForwardedHeadersOptions>(options =>
|
|||||||
ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
builder.Services.AddFellowOakDicom().AddTranscoderManager<NativeTranscoderManager>()
|
||||||
|
//.AddTranscoderManager<FellowOakDicom.Imaging.NativeCodec.NativeTranscoderManager>()
|
||||||
|
.AddImageManager<ImageSharpImageManager>();
|
||||||
|
|
||||||
|
|
||||||
//Dicom影像渲染图片 跨平台
|
//Dicom影像渲染图片 跨平台
|
||||||
//builder.Services.AddDicomSetup();
|
//builder.Services.AddDicomSetup();
|
||||||
new DicomSetupBuilder()
|
//new DicomSetupBuilder()
|
||||||
.RegisterServices(s =>
|
// .RegisterServices(s =>
|
||||||
s.AddFellowOakDicom()
|
// s.AddFellowOakDicom()
|
||||||
.AddTranscoderManager<NativeTranscoderManager>()
|
// .AddTranscoderManager<NativeTranscoderManager>()
|
||||||
//.AddTranscoderManager<FellowOakDicom.Imaging.NativeCodec.NativeTranscoderManager>()
|
// //.AddTranscoderManager<FellowOakDicom.Imaging.NativeCodec.NativeTranscoderManager>()
|
||||||
.AddImageManager<ImageSharpImageManager>())
|
// .AddImageManager<ImageSharpImageManager>())
|
||||||
.SkipValidation()
|
// .SkipValidation()
|
||||||
.Build();
|
// .Build();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -211,6 +217,8 @@ else
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
DicomSetupBuilder.UseServiceProvider(app.Services);
|
||||||
|
|
||||||
var logger = app.Services.GetService<Microsoft.Extensions.Logging.ILogger<Program>>();
|
var logger = app.Services.GetService<Microsoft.Extensions.Logging.ILogger<Program>>();
|
||||||
|
|
||||||
var server = DicomServerFactory.Create<CStoreSCPService>(_configuration.GetSection("DicomSCPServiceConfig").GetValue<int>("ServerPort"), userState: app.Services,logger: logger);
|
var server = DicomServerFactory.Create<CStoreSCPService>(_configuration.GetSection("DicomSCPServiceConfig").GetValue<int>("ServerPort"), userState: app.Services,logger: logger);
|
||||||
|
|||||||
@@ -20,6 +20,16 @@
|
|||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Uat_IRC_SCP"
|
"ASPNETCORE_ENVIRONMENT": "Uat_IRC_SCP"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"US_Prod_IRC_SCP": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"launchBrowser": true,
|
||||||
|
"launchUrl": "swagger",
|
||||||
|
"applicationUrl": "http://localhost:6200",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "US_Prod_SCP"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,9 +76,10 @@ namespace IRaCIS.Core.SCP.Service
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
public CStoreSCPService(INetworkStream stream, Encoding fallbackEncoding, Microsoft.Extensions.Logging.ILogger log, DicomServiceDependencies dependencies)
|
public CStoreSCPService(INetworkStream stream, Encoding fallbackEncoding, Microsoft.Extensions.Logging.ILogger log, DicomServiceDependencies dependencies, IServiceProvider injectServiceProvider)
|
||||||
: base(stream, fallbackEncoding, log, dependencies)
|
: base(stream, fallbackEncoding, log, dependencies)
|
||||||
{
|
{
|
||||||
|
_serviceProvider = injectServiceProvider.CreateScope().ServiceProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -92,9 +93,7 @@ namespace IRaCIS.Core.SCP.Service
|
|||||||
|
|
||||||
Log.Logger.Warning($"接收到来自{association.CallingAE}的连接");
|
Log.Logger.Warning($"接收到来自{association.CallingAE}的连接");
|
||||||
|
|
||||||
_serviceProvider = (IServiceProvider)this.UserState;
|
//_serviceProvider = (IServiceProvider)this.UserState;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var _trialDicomAERepository = _serviceProvider.GetService<IRepository<TrialDicomAE>>();
|
var _trialDicomAERepository = _serviceProvider.GetService<IRepository<TrialDicomAE>>();
|
||||||
|
|
||||||
@@ -275,7 +274,7 @@ namespace IRaCIS.Core.SCP.Service
|
|||||||
var _distributedLockProvider = _serviceProvider.GetService<IDistributedLockProvider>();
|
var _distributedLockProvider = _serviceProvider.GetService<IDistributedLockProvider>();
|
||||||
|
|
||||||
var storeRelativePath = string.Empty;
|
var storeRelativePath = string.Empty;
|
||||||
var ossFolderPath = $"{_trialId}/Image/PACS/{_trialSiteId}{studyInstanceUid}";
|
var ossFolderPath = $"{_trialId}/Image/PACS/{_trialSiteId}/{studyInstanceUid}";
|
||||||
|
|
||||||
|
|
||||||
long fileSize = 0;
|
long fileSize = 0;
|
||||||
|
|||||||
@@ -21,8 +21,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"RemoteNew": "Server=us-prod-mssql-service,1433;Database=US_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
"RemoteNew": "Server=us-mssql-prod,1433;Database=US_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||||
"Hangfire": "Server=us-prod-mssql-service,1433;Database=US_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
"Hangfire": "Server=us-mssql-prod,1433;Database=US_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||||
},
|
},
|
||||||
"DicomSCPServiceConfig": {
|
"DicomSCPServiceConfig": {
|
||||||
"CalledAEList": [
|
"CalledAEList": [
|
||||||
|
|||||||
@@ -12,18 +12,18 @@
|
|||||||
"RegionId": "cn-shanghai",
|
"RegionId": "cn-shanghai",
|
||||||
"InternalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
"InternalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
||||||
"EndPoint": "https://oss-cn-shanghai.aliyuncs.com",
|
"EndPoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||||
"AccessKeyId": "LTAI5tRRZehUp2V9pyTPtAJm",
|
"AccessKeyId": "LTAI5tFUCCmz5TwghZHsj45Y",
|
||||||
"AccessKeySecret": "FLizxkHsMm4CGYHtkV8E3PNJJZU7oV",
|
"AccessKeySecret": "8evrBy1fVfzJG25i67Jm0xqn9Xcw2T",
|
||||||
"RoleArn": "acs:ram::1899121822495495:role/dev-oss-access",
|
"RoleArn": "acs:ram::1078130221702011:role/uat-oss-access",
|
||||||
"BucketName": "zy-irc-uat-store",
|
"BucketName": "tl-med-irc-uat-store",
|
||||||
"ViewEndpoint": "https://zy-irc-uat-store.oss-cn-shanghai.aliyuncs.com",
|
"ViewEndpoint": "https://tl-med-irc-uat-store.oss-cn-shanghai.aliyuncs.com",
|
||||||
"Region": "oss-cn-shanghai",
|
"Region": "oss-cn-shanghai",
|
||||||
"DurationSeconds": 7200
|
"DurationSeconds": 7200
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"RemoteNew": "Server=47.117.164.182,1434;Database=Uat_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
"RemoteNew": "Server=101.132.253.119,1435;Database=Uat_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||||
"Hangfire": "Server=47.117.164.182,1434;Database=Uat_IRC.Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
"Hangfire": "Server101.132.253.119,1435;Database=Uat_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||||
},
|
},
|
||||||
"DicomSCPServiceConfig": {
|
"DicomSCPServiceConfig": {
|
||||||
"CalledAEList": [
|
"CalledAEList": [
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
using Amazon.Auth.AccessControlPolicy;
|
using Amazon.Auth.AccessControlPolicy;
|
||||||
using Amazon.SecurityToken;
|
using Amazon.SecurityToken;
|
||||||
|
using AutoMapper;
|
||||||
using Azure.Core;
|
using Azure.Core;
|
||||||
|
using IdentityModel.Client;
|
||||||
|
using IdentityModel.OidcClient;
|
||||||
using IRaCIS.Application.Contracts;
|
using IRaCIS.Application.Contracts;
|
||||||
using IRaCIS.Application.Interfaces;
|
using IRaCIS.Application.Interfaces;
|
||||||
using IRaCIS.Core.API.OAuth;
|
|
||||||
using IRaCIS.Core.Application.Auth;
|
using IRaCIS.Core.Application.Auth;
|
||||||
using IRaCIS.Core.Application.Contracts;
|
using IRaCIS.Core.Application.Contracts;
|
||||||
using IRaCIS.Core.Application.Helper;
|
using IRaCIS.Core.Application.Helper;
|
||||||
@@ -23,9 +25,12 @@ using RestSharp;
|
|||||||
using RestSharp.Authenticators;
|
using RestSharp.Authenticators;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
using System.Net.Http;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Text.Json;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using ZiggyCreatures.Caching.Fusion;
|
using ZiggyCreatures.Caching.Fusion;
|
||||||
using AssumeRoleRequest = Amazon.SecurityToken.Model.AssumeRoleRequest;
|
using AssumeRoleRequest = Amazon.SecurityToken.Model.AssumeRoleRequest;
|
||||||
@@ -102,196 +107,6 @@ namespace IRaCIS.Api.Controllers
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary> 系统用户登录接口[New] </summary>
|
|
||||||
[HttpPost, Route("user/login")]
|
|
||||||
[AllowAnonymous]
|
|
||||||
public async Task<IResponseOutput> Login(UserLoginDTO loginUser,
|
|
||||||
[FromServices] IFusionCache _fusionCache,
|
|
||||||
[FromServices] IUserService _userService,
|
|
||||||
[FromServices] ITokenService _tokenService,
|
|
||||||
[FromServices] IReadingImageTaskService readingImageTaskService,
|
|
||||||
[FromServices] IOptionsMonitor<ServiceVerifyConfigOption> _verifyConfig,
|
|
||||||
[FromServices] IOptionsMonitor<SystemEmailSendConfig> _emailConfig,
|
|
||||||
|
|
||||||
[FromServices] IMailVerificationService _mailVerificationService)
|
|
||||||
{
|
|
||||||
var emailConfig = _emailConfig.CurrentValue;
|
|
||||||
var companyInfo = new SystemEmailSendConfigView() { CompanyName = emailConfig.CompanyName, CompanyNameCN = emailConfig.CompanyNameCN, CompanyShortName = emailConfig.CompanyShortName, CompanyShortNameCN = emailConfig.CompanyShortNameCN };
|
|
||||||
|
|
||||||
//MFA 邮箱验证 前端传递用户Id 和MFACode
|
|
||||||
if (loginUser.UserId != null && _verifyConfig.CurrentValue.OpenLoginMFA)
|
|
||||||
{
|
|
||||||
Guid userId = (Guid)loginUser.UserId;
|
|
||||||
|
|
||||||
//验证MFA 编码是否有问题 ,前端要拆开,自己调用验证的逻辑
|
|
||||||
//await _userService.VerifyMFACodeAsync(userId, loginUser.MFACode);
|
|
||||||
|
|
||||||
//var loginUser = await _userRepository.Where(u => u.UserName.Equals(userName) && u.Password == password).ProjectTo<UserBasicInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
|
||||||
|
|
||||||
var basicInfo = await _userService.GetUserBasicInfo(userId, loginUser.Password);
|
|
||||||
|
|
||||||
var loginReturn = new LoginReturnDTO() { BasicInfo = basicInfo };
|
|
||||||
|
|
||||||
loginReturn.JWTStr = _tokenService.GetToken(IRaCISClaims.Create(loginReturn.BasicInfo));
|
|
||||||
|
|
||||||
|
|
||||||
// 创建一个 CookieOptions 对象,用于设置 Cookie 的属性
|
|
||||||
var option = new CookieOptions
|
|
||||||
{
|
|
||||||
Expires = DateTime.Now.AddMonths(1), // 设置过期时间为 30 分钟之后
|
|
||||||
HttpOnly = false, // 确保 cookie 只能通过 HTTP 访问
|
|
||||||
SameSite = Microsoft.AspNetCore.Http.SameSiteMode.None, // 设置 SameSite 属性
|
|
||||||
Secure = false // 确保 cookie 只能通过 HTTPS 访问
|
|
||||||
};
|
|
||||||
|
|
||||||
HttpContext.Response.Cookies.Append("access_token", loginReturn.JWTStr, option);
|
|
||||||
|
|
||||||
// 验证阅片休息时间
|
|
||||||
await readingImageTaskService.ResetReadingRestTime(userId);
|
|
||||||
|
|
||||||
await _fusionCache.SetAsync(CacheKeys.UserToken(userId), loginReturn.JWTStr, TimeSpan.FromDays(7));
|
|
||||||
|
|
||||||
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(userId), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(_verifyConfig.CurrentValue.AutoLoginOutMinutes));
|
|
||||||
|
|
||||||
loginReturn.CompanyInfo = companyInfo;
|
|
||||||
return ResponseOutput.Ok(loginReturn);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var returnModel = await _userService.Login(loginUser.UserName, loginUser.Password);
|
|
||||||
|
|
||||||
if (returnModel.IsSuccess)
|
|
||||||
{
|
|
||||||
#region GRPC 调用鉴权中心,因为服务器IIS问题 http/2 故而没法使用
|
|
||||||
|
|
||||||
////重试策略
|
|
||||||
//var defaultMethodConfig = new MethodConfig
|
|
||||||
//{
|
|
||||||
// Names = { MethodName.Default },
|
|
||||||
// RetryPolicy = new RetryPolicy
|
|
||||||
// {
|
|
||||||
// MaxAttempts = 3,
|
|
||||||
// InitialBackoff = TimeSpan.FromSeconds(1),
|
|
||||||
// MaxBackoff = TimeSpan.FromSeconds(5),
|
|
||||||
// BackoffMultiplier = 1.5,
|
|
||||||
// RetryableStatusCodes = { Grpc.Core.StatusCode.Unavailable }
|
|
||||||
// }
|
|
||||||
//};
|
|
||||||
|
|
||||||
//#region unable to trust the certificate then the gRPC client can be configured to ignore the invalid certificate
|
|
||||||
|
|
||||||
//var httpHandler = new HttpClientHandler();
|
|
||||||
//// Return `true` to allow certificates that are untrusted/invalid
|
|
||||||
//httpHandler.ServerCertificateCustomValidationCallback =
|
|
||||||
// HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
|
|
||||||
|
|
||||||
|
|
||||||
//////这一句是让grpc支持本地 http 如果本地访问部署在服务器上,那么是访问不成功的
|
|
||||||
//AppContext.SetSwitch(
|
|
||||||
// "System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
|
|
||||||
|
|
||||||
//#endregion
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//var grpcAdress = configuration.GetValue<string>("GrpcAddress");
|
|
||||||
////var grpcAdress = "http://localhost:7200";
|
|
||||||
|
|
||||||
//var channel = GrpcChannel.ForAddress(grpcAdress, new GrpcChannelOptions
|
|
||||||
//{
|
|
||||||
// HttpHandler = httpHandler,
|
|
||||||
// ServiceConfig = new ServiceConfig { MethodConfigs = { defaultMethodConfig } }
|
|
||||||
|
|
||||||
//});
|
|
||||||
////var channel = GrpcChannel.ForAddress(grpcAdress);
|
|
||||||
//var grpcClient = new TokenGrpcService.TokenGrpcServiceClient(channel);
|
|
||||||
|
|
||||||
//var userInfo = returnModel.Data.BasicInfo;
|
|
||||||
|
|
||||||
//var tokenResponse = grpcClient.GetUserToken(new GetTokenReuqest()
|
|
||||||
//{
|
|
||||||
// Id = userInfo.Id.ToString(),
|
|
||||||
// ReviewerCode = userInfo.ReviewerCode,
|
|
||||||
// IsAdmin = userInfo.IsAdmin,
|
|
||||||
// RealName = userInfo.RealName,
|
|
||||||
// UserTypeEnumInt = (int)userInfo.UserTypeEnum,
|
|
||||||
// UserTypeShortName = userInfo.UserTypeShortName,
|
|
||||||
// UserName = userInfo.UserName
|
|
||||||
//});
|
|
||||||
|
|
||||||
//returnModel.Data.JWTStr = tokenResponse.Token;
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
var userId = returnModel.Data.BasicInfo.Id;
|
|
||||||
|
|
||||||
if (_verifyConfig.CurrentValue.OpenLoginMFA)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//MFA 发送邮件
|
|
||||||
|
|
||||||
returnModel.Data.IsMFA = true;
|
|
||||||
|
|
||||||
var email = returnModel.Data.BasicInfo.EMail;
|
|
||||||
|
|
||||||
var hiddenEmail = IRCEmailPasswordHelper.MaskEmail(email);
|
|
||||||
|
|
||||||
returnModel.Data.BasicInfo.EMail = hiddenEmail;
|
|
||||||
|
|
||||||
//修改密码
|
|
||||||
if (returnModel.Data.BasicInfo.IsFirstAdd || returnModel.Data.BasicInfo.LoginState == 1)
|
|
||||||
{
|
|
||||||
returnModel.Data.JWTStr = _tokenService.GetToken(IRaCISClaims.Create(returnModel.Data.BasicInfo));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//正常登录才发送邮件
|
|
||||||
await _userService.SendMFAEmail(userId);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
returnModel.Data.JWTStr = _tokenService.GetToken(IRaCISClaims.Create(returnModel.Data.BasicInfo));
|
|
||||||
|
|
||||||
// 创建一个 CookieOptions 对象,用于设置 Cookie 的属性
|
|
||||||
var option = new CookieOptions
|
|
||||||
{
|
|
||||||
Expires = DateTime.Now.AddMonths(1), // 设置过期时间为 30 分钟之后
|
|
||||||
HttpOnly = false, // 确保 cookie 只能通过 HTTP 访问
|
|
||||||
SameSite = Microsoft.AspNetCore.Http.SameSiteMode.None, // 设置 SameSite 属性
|
|
||||||
Secure = false // 确保 cookie 只能通过 HTTPS 访问
|
|
||||||
};
|
|
||||||
|
|
||||||
HttpContext.Response.Cookies.Append("access_token", returnModel.Data.JWTStr, option);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 验证阅片休息时间
|
|
||||||
await readingImageTaskService.ResetReadingRestTime(returnModel.Data.BasicInfo.Id);
|
|
||||||
|
|
||||||
await _fusionCache.SetAsync(CacheKeys.UserToken(userId), returnModel.Data.JWTStr, TimeSpan.FromDays(7));
|
|
||||||
|
|
||||||
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(userId), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(_verifyConfig.CurrentValue.AutoLoginOutMinutes));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
returnModel.Data.CompanyInfo = companyInfo;
|
|
||||||
return returnModel;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[HttpGet, Route("user/getPublicKey")]
|
[HttpGet, Route("user/getPublicKey")]
|
||||||
public IResponseOutput GetPublicKey([FromServices] IOptionsMonitor<IRCEncreptOption> _IRCEncreptOption)
|
public IResponseOutput GetPublicKey([FromServices] IOptionsMonitor<IRCEncreptOption> _IRCEncreptOption)
|
||||||
@@ -306,18 +121,13 @@ namespace IRaCIS.Api.Controllers
|
|||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public IResponseOutput ShareImage([FromServices] ITokenService _tokenService)
|
public IResponseOutput ShareImage([FromServices] ITokenService _tokenService)
|
||||||
{
|
{
|
||||||
var token = _tokenService.GetToken(IRaCISClaims.Create(new UserBasicInfo()
|
var token = _tokenService.GetToken(new UserTokenInfo()
|
||||||
{
|
{
|
||||||
Id = Guid.Empty,
|
IdentityUserId = Guid.NewGuid(),
|
||||||
IsReviewer = false,
|
|
||||||
IsAdmin = false,
|
|
||||||
RealName = "Share001",
|
|
||||||
UserName = "Share001",
|
UserName = "Share001",
|
||||||
Sex = 0,
|
|
||||||
//UserType = "ShareType",
|
|
||||||
UserTypeEnum = UserTypeEnum.ShareImage,
|
UserTypeEnum = UserTypeEnum.ShareImage,
|
||||||
Code = "ShareCode001",
|
|
||||||
}));
|
});
|
||||||
return ResponseOutput.Ok("/showdicom?studyId=f7b67793-8155-0223-2f15-118f2642efb8&type=Share&token=" + token);
|
return ResponseOutput.Ok("/showdicom?studyId=f7b67793-8155-0223-2f15-118f2642efb8&type=Share&token=" + token);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -376,7 +186,7 @@ namespace IRaCIS.Api.Controllers
|
|||||||
|
|
||||||
[HttpGet("User/UserRedirect")]
|
[HttpGet("User/UserRedirect")]
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public async Task<IActionResult> UserRedirect([FromServices] IRepository<User> _userRepository, string url, [FromServices] ILogger<ExtraController> _logger)
|
public async Task<IActionResult> UserRedirect([FromServices] IRepository<IdentityUser> _useRepository, string url, [FromServices] ILogger<ExtraController> _logger, [FromServices] ITokenService _tokenService)
|
||||||
{
|
{
|
||||||
|
|
||||||
var decodeUrl = System.Web.HttpUtility.UrlDecode(url);
|
var decodeUrl = System.Web.HttpUtility.UrlDecode(url);
|
||||||
@@ -391,10 +201,22 @@ namespace IRaCIS.Api.Controllers
|
|||||||
|
|
||||||
var errorUrl = domainStrList[0] + "//" + domainStrList[2] + "/error";
|
var errorUrl = domainStrList[0] + "//" + domainStrList[2] + "/error";
|
||||||
|
|
||||||
|
if (lang == "zh")
|
||||||
if (!await _userRepository.AnyAsync(t => t.Id == Guid.Parse(userId) && t.EmailToken == token && t.IsFirstAdd))
|
|
||||||
{
|
{
|
||||||
decodeUrl = errorUrl + $"?lang={lang}&ErrorMessage={System.Web.HttpUtility.UrlEncode(lang == "zh" ? "您的初始化链接已过期" : "Error!The initialization link has expired. Return")} ";
|
CultureInfo.CurrentCulture = new CultureInfo(StaticData.CultureInfo.zh_CN);
|
||||||
|
CultureInfo.CurrentUICulture = new CultureInfo(StaticData.CultureInfo.zh_CN);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CultureInfo.CurrentCulture = new CultureInfo(StaticData.CultureInfo.en_US);
|
||||||
|
CultureInfo.CurrentUICulture = new CultureInfo(StaticData.CultureInfo.en_US);
|
||||||
|
}
|
||||||
|
|
||||||
|
var isExpire = _tokenService.IsTokenExpired(token);
|
||||||
|
|
||||||
|
if (!await _useRepository.AnyAsync(t => t.Id == Guid.Parse(userId) && t.EmailToken == token && t.IsFirstAdd) || isExpire)
|
||||||
|
{
|
||||||
|
decodeUrl = errorUrl + $"?lang={lang}&ErrorMessage={System.Web.HttpUtility.UrlEncode(I18n.T("UserRedirect_InitializationLinkExpire"))} ";
|
||||||
}
|
}
|
||||||
|
|
||||||
return Redirect(decodeUrl);
|
return Redirect(decodeUrl);
|
||||||
@@ -433,63 +255,6 @@ namespace IRaCIS.Api.Controllers
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region 客户端方式获取logto 里面的信息
|
|
||||||
|
|
||||||
var baseUrl = "https://logto.test.extimaging.com";
|
|
||||||
var appId = "v2mr2ndxwkxz0xpsuc1th";
|
|
||||||
var appSecret = "yq9jUxl70QoOmwHxJ37h1rDoyJ5iz92Q";
|
|
||||||
var apiAddress = "https://default.logto.app/api"; //这里是个坑
|
|
||||||
var scope = "all";
|
|
||||||
|
|
||||||
var opts = new RestClientOptions(baseUrl);
|
|
||||||
using var client = new RestClient(opts);
|
|
||||||
|
|
||||||
//https://bump.sh/logto/doc/logto-management-api/authentication
|
|
||||||
var request = new RestRequest("oidc/token", Method.Post);
|
|
||||||
request
|
|
||||||
.AddHeader("Content-Type", "application/x-www-form-urlencoded")
|
|
||||||
.AddParameter("grant_type", "client_credentials")
|
|
||||||
.AddParameter("client_id", appId)
|
|
||||||
.AddParameter("client_secret", appSecret)
|
|
||||||
.AddParameter("resource", apiAddress) //注意这里默认值地址和api 地址有区别
|
|
||||||
.AddParameter("scope", scope);
|
|
||||||
|
|
||||||
|
|
||||||
var response = await client.ExecuteAsync<LogtoTokenResponse>(request);
|
|
||||||
|
|
||||||
if (response.StatusCode == HttpStatusCode.OK)
|
|
||||||
{
|
|
||||||
var tokenResponse = response.Data;
|
|
||||||
|
|
||||||
Console.WriteLine(tokenResponse.ToJsonStr());
|
|
||||||
|
|
||||||
#region 获取应用信息
|
|
||||||
|
|
||||||
var applicationRequest = new RestRequest($"/api/applications", Method.Get)
|
|
||||||
.AddHeader("Authorization", $"Bearer {tokenResponse.AccessToken}");
|
|
||||||
|
|
||||||
var applicationResponse = await client.ExecuteAsync(applicationRequest);
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 获取用户信息
|
|
||||||
//curl \
|
|
||||||
// -X GET https://[tenant_id].logto.app/api/users/{userId} \
|
|
||||||
// -H "Authorization: Bearer $ACCESS_TOKEN"
|
|
||||||
|
|
||||||
var userId = "4fqx4cb3438k";
|
|
||||||
var userInfoRequest = new RestRequest($"api/users/{userId}", Method.Get)
|
|
||||||
.AddHeader("Authorization", $"Bearer {tokenResponse.AccessToken}");
|
|
||||||
|
|
||||||
|
|
||||||
var userResponse = await client.ExecuteAsync<LogtoUser>(userInfoRequest);
|
|
||||||
|
|
||||||
Console.WriteLine(userResponse.Content);
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
|
|||||||
@@ -51,30 +51,30 @@ namespace IRaCIS.Core.API.Controllers.Special
|
|||||||
[TrialGlobalLimit( "AddOrUpdateTrial", "BeforeOngoingCantOpt", "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit( "AddOrUpdateTrial", "BeforeOngoingCantOpt", "AfterStopCannNotOpt" )]
|
||||||
public async Task<IResponseOutput<Trial>> AddOrUpdateTrial(TrialCommand param)
|
public async Task<IResponseOutput<Trial>> AddOrUpdateTrial(TrialCommand param)
|
||||||
{
|
{
|
||||||
var userId = Guid.Parse(User.FindFirst("id").Value);
|
//var userId = Guid.Parse(User.FindFirst("id").Value);
|
||||||
var result = await _trialService.AddOrUpdateTrial(param);
|
var result = await _trialService.AddOrUpdateTrial(param);
|
||||||
|
|
||||||
if (_trialService.TrialExpeditedChange)
|
//if (_trialService.TrialExpeditedChange)
|
||||||
{
|
//{
|
||||||
var needCalReviewerIds = await _trialService.GetTrialEnrollmentReviewerIds(param.Id.Value);
|
// var needCalReviewerIds = await _trialService.GetTrialEnrollmentReviewerIds(param.Id.Value);
|
||||||
var calcList = await _calculateService.GetNeedCalculateReviewerList(Guid.Empty, string.Empty);
|
// var calcList = await _calculateService.GetNeedCalculateReviewerList(Guid.Empty, string.Empty);
|
||||||
|
|
||||||
calcList.ForEach(t =>
|
// calcList.ForEach(t =>
|
||||||
{
|
// {
|
||||||
if (needCalReviewerIds.Contains(t.DoctorId))
|
// if (needCalReviewerIds.Contains(t.DoctorId))
|
||||||
{
|
// {
|
||||||
_calculateService.CalculateMonthlyPayment(new CalculateDoctorAndMonthDTO()
|
// _calculateService.CalculateMonthlyPayment(new CalculateDoctorAndMonthDTO()
|
||||||
{
|
// {
|
||||||
NeedCalculateReviewers = new List<Guid>()
|
// NeedCalculateReviewers = new List<Guid>()
|
||||||
{
|
// {
|
||||||
t.DoctorId
|
// t.DoctorId
|
||||||
},
|
// },
|
||||||
CalculateMonth = DateTime.Parse(t.YearMonth)
|
// CalculateMonth = DateTime.Parse(t.YearMonth)
|
||||||
}, User.FindFirst("id").Value);
|
// }, User.FindFirst("id").Value);
|
||||||
|
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
//}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -522,10 +522,10 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
|
|
||||||
public async Task<IResponseOutput> ConfirmReReading(DataInspectionDto<ConfirmReReadingCommand> opt, [FromServices] IVisitTaskHelpeService _visitTaskCommonService, [FromServices] IVisitTaskService _visitTaskService)
|
public async Task<IResponseOutput> ConfirmReReading(DataInspectionDto<ConfirmReReadingCommand> opt, [FromServices] IVisitTaskService _visitTaskService)
|
||||||
{
|
{
|
||||||
var singId = await _inspectionService.RecordSing(opt.SignInfo);
|
var singId = await _inspectionService.RecordSing(opt.SignInfo);
|
||||||
var result = await _visitTaskService.ConfirmReReading(opt.Data, _visitTaskCommonService);
|
var result = await _visitTaskService.ConfirmReReading(opt.Data);
|
||||||
await _inspectionService.CompletedSign(singId, result);
|
await _inspectionService.CompletedSign(singId, result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
[HttpPost, Route("Study/ArchiveStudy")]
|
[HttpPost, Route("Study/ArchiveStudy")]
|
||||||
[DisableFormValueModelBinding]
|
[DisableFormValueModelBinding]
|
||||||
[DisableRequestSizeLimit]
|
[DisableRequestSizeLimit]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
public async Task<IResponseOutput> ArchiveStudyNew(Guid trialId, Guid subjectVisitId, string studyInstanceUid, Guid? abandonStudyId, Guid studyMonitorId,
|
public async Task<IResponseOutput> ArchiveStudyNew(Guid trialId, Guid subjectVisitId, string studyInstanceUid, Guid? abandonStudyId, Guid studyMonitorId,
|
||||||
[FromServices] ILogger<UploadDownLoadController> _logger,
|
[FromServices] ILogger<UploadDownLoadController> _logger,
|
||||||
[FromServices] IStudyService _studyService,
|
[FromServices] IStudyService _studyService,
|
||||||
@@ -370,7 +370,7 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
//await _uploadHub.Clients.All.ReceivProgressAsync(archiveStudyCommand.StudyInstanceUid, receivedCount);
|
//await _uploadHub.Clients.All.ReceivProgressAsync(archiveStudyCommand.StudyInstanceUid, receivedCount);
|
||||||
|
|
||||||
|
|
||||||
await _uploadHub.Clients.User(_userInfo.Id.ToString()).ReceivProgressAsync(archiveStudyCommand.StudyInstanceUid, receivedCount);
|
await _uploadHub.Clients.User(_userInfo.UserRoleId.ToString()).ReceivProgressAsync(archiveStudyCommand.StudyInstanceUid, receivedCount);
|
||||||
|
|
||||||
archiveResult.ReceivedFileCount = receivedCount;
|
archiveResult.ReceivedFileCount = receivedCount;
|
||||||
|
|
||||||
@@ -452,7 +452,7 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
/// <param name="_studyMonitorRepository"></param>
|
/// <param name="_studyMonitorRepository"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Study/PreArchiveStudy")]
|
[HttpPost, Route("Study/PreArchiveStudy")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
public async Task<IResponseOutput> PreArchiveStudy(PreArchiveStudyCommand preArchiveStudyCommand,
|
public async Task<IResponseOutput> PreArchiveStudy(PreArchiveStudyCommand preArchiveStudyCommand,
|
||||||
[FromServices] IStudyService _studyService,
|
[FromServices] IStudyService _studyService,
|
||||||
[FromServices] IRepository<StudyMonitor> _studyMonitorRepository)
|
[FromServices] IRepository<StudyMonitor> _studyMonitorRepository)
|
||||||
@@ -488,7 +488,7 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
/// <param name="_noneDicomStudyFileRepository"></param>
|
/// <param name="_noneDicomStudyFileRepository"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost("NoneDicomStudy/UploadNoneDicomFile")]
|
[HttpPost("NoneDicomStudy/UploadNoneDicomFile")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
public async Task<IResponseOutput> UploadNoneDicomFile(UploadNoneDicomFileCommand incommand,
|
public async Task<IResponseOutput> UploadNoneDicomFile(UploadNoneDicomFileCommand incommand,
|
||||||
[FromServices] IRepository<NoneDicomStudy> _noneDicomStudyRepository,
|
[FromServices] IRepository<NoneDicomStudy> _noneDicomStudyRepository,
|
||||||
[FromServices] IRepository<StudyMonitor> _studyMonitorRepository,
|
[FromServices] IRepository<StudyMonitor> _studyMonitorRepository,
|
||||||
@@ -560,7 +560,7 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="BusinessValidationFailedException"></exception>
|
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||||
[HttpPost("QCOperation/UploadVisitCheckExcel/{trialId:guid}")]
|
[HttpPost("QCOperation/UploadVisitCheckExcel/{trialId:guid}")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
|
|
||||||
public async Task<IResponseOutput> UploadVisitCheckExcel(Guid trialId, [FromServices] IOSSService oSSService, [FromServices] IRepository<InspectionFile> _inspectionFileRepository)
|
public async Task<IResponseOutput> UploadVisitCheckExcel(Guid trialId, [FromServices] IOSSService oSSService, [FromServices] IRepository<InspectionFile> _inspectionFileRepository)
|
||||||
{
|
{
|
||||||
@@ -850,11 +850,18 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
throw new BusinessValidationFailedException(_localizer["UploadDownLoad_InvalidCenters"]);
|
throw new BusinessValidationFailedException(_localizer["UploadDownLoad_InvalidCenters"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (excelList.GroupBy(t => new { t.TrialSiteCode, t.UserTypeStr, t.Email }).Any(g => g.Count() > 1))
|
foreach (var item in excelList.GroupBy(t => t.Email.Trim()))
|
||||||
{
|
{
|
||||||
// 同一邮箱,同一用户类型,只能生成一个账户,请核查Excel数据
|
var itemList = item.ToList();
|
||||||
|
|
||||||
throw new BusinessValidationFailedException(_localizer["UploadDownLoad_CheckDuplicateAccounts"]);
|
var first = item.First();
|
||||||
|
|
||||||
|
if (itemList.Any(t => t.Email.Trim() != first.Email.Trim() || t.Phone.Trim() != first.Phone.Trim() || t.OrganizationName.Trim() != first.OrganizationName.Trim() || t.FirstName.Trim() != first.FirstName.Trim() || t.LastName.Trim() != first.LastName.Trim()))
|
||||||
|
{
|
||||||
|
//同一邮箱,用户信息应该保持一致!
|
||||||
|
|
||||||
|
throw new BusinessValidationFailedException(_localizer["UploadDownLoad_CheckDuplicateAccounts"]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (excelList.Any(t => !t.Email.Contains("@")))
|
if (excelList.Any(t => !t.Email.Contains("@")))
|
||||||
@@ -879,7 +886,7 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
|
|
||||||
foreach (var item in excelList)
|
foreach (var item in excelList)
|
||||||
{
|
{
|
||||||
switch (item.UserTypeStr.ToUpper())
|
switch (item.UserTypeStr.Trim().ToUpper())
|
||||||
{
|
{
|
||||||
case "CRC":
|
case "CRC":
|
||||||
|
|
||||||
@@ -896,7 +903,7 @@ namespace IRaCIS.Core.API.Controllers
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
item.TrialSiteId = siteList.FirstOrDefault(t => t.TrialSiteCode.ToUpper() == item.TrialSiteCode.ToUpper()).TrialSiteId;
|
item.TrialSiteId = siteList.FirstOrDefault(t => t.TrialSiteCode.Trim().ToUpper() == item.TrialSiteCode.Trim().ToUpper()).TrialSiteId;
|
||||||
}
|
}
|
||||||
|
|
||||||
var list = excelList.Where(t => t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator || t.UserTypeEnum == UserTypeEnum.CRA).ToList();
|
var list = excelList.Where(t => t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator || t.UserTypeEnum == UserTypeEnum.CRA).ToList();
|
||||||
|
|||||||
@@ -34,9 +34,6 @@
|
|||||||
<param name="doctorId"></param>
|
<param name="doctorId"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Api.Controllers.ExtraController.Login(IRaCIS.Application.Contracts.UserLoginDTO,ZiggyCreatures.Caching.Fusion.IFusionCache,IRaCIS.Core.Application.Service.IUserService,IRaCIS.Core.Application.Auth.ITokenService,IRaCIS.Core.Application.Contracts.IReadingImageTaskService,Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.ServiceVerifyConfigOption},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig},IRaCIS.Core.Application.Service.IMailVerificationService)">
|
|
||||||
<summary> 系统用户登录接口[New] </summary>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Api.Controllers.ExtraController.OAuthCallBack(System.String,System.String)">
|
<member name="M:IRaCIS.Api.Controllers.ExtraController.OAuthCallBack(System.String,System.String)">
|
||||||
<summary>
|
<summary>
|
||||||
回调到前端,前端调用后端的接口
|
回调到前端,前端调用后端的接口
|
||||||
@@ -284,7 +281,7 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.ConfirmReReading(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.ViewModel.ConfirmReReadingCommand},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Application.Service.IVisitTaskService)">
|
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.ConfirmReReading(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.ViewModel.ConfirmReReadingCommand},IRaCIS.Core.Application.Service.IVisitTaskService)">
|
||||||
<summary>
|
<summary>
|
||||||
重阅同意
|
重阅同意
|
||||||
</summary>
|
</summary>
|
||||||
@@ -346,147 +343,6 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="T:IRaCIS.Core.API.OAuth.LogtoParameters.Tokens">
|
|
||||||
<summary>
|
|
||||||
The token names used by Cookie and OpenID Connect middleware to store and retrieve tokens from
|
|
||||||
Logto OpenID Connect provider.
|
|
||||||
<br/>
|
|
||||||
See <see href="https://github.com/dotnet/aspnetcore/blob/4a9118c674a798aaf6379b4b7b2d8787bc688f96/src/Security/Authentication/OpenIdConnect/src/OpenIdConnectHandler.cs#L994-L1035">tokens that are stored by OpenID Connect middleware</see> for more details.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="T:IRaCIS.Core.API.OAuth.LogtoParameters.Scopes">
|
|
||||||
<summary>
|
|
||||||
The scope names used by Logto OpenID Connect provider to request for user information.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="F:IRaCIS.Core.API.OAuth.LogtoParameters.Scopes.Email">
|
|
||||||
<summary>
|
|
||||||
The scope name for requesting user's email.
|
|
||||||
Logto will issue two claims to the ID token: <c>email</c> and <c>email_verified</c>.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="F:IRaCIS.Core.API.OAuth.LogtoParameters.Scopes.Phone">
|
|
||||||
<summary>
|
|
||||||
The scope name for requesting user's phone number.
|
|
||||||
Logto will issue two claims to the ID token: <c>phone</c> and <c>phone_verified</c>.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="F:IRaCIS.Core.API.OAuth.LogtoParameters.Scopes.CustomData">
|
|
||||||
<summary>
|
|
||||||
The scope name for requesting user's custom data.
|
|
||||||
Logto will issue a claim to the response of the <c>userinfo</c> endpoint: <c>custom_data</c>.
|
|
||||||
<br/>
|
|
||||||
Note that when requesting this scope, you must set <see cref="!:LogtoOptions.GetClaimsFromUserInfoEndpoint"/> to <c>true</c>.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="F:IRaCIS.Core.API.OAuth.LogtoParameters.Scopes.Identities">
|
|
||||||
<summary>
|
|
||||||
The scope name for requesting user's identities.
|
|
||||||
Logto will issue a claim to the response of the <c>userinfo</c> endpoint: <c>identities</c>.
|
|
||||||
<br/>
|
|
||||||
Note that when requesting this scope, you must set <see cref="!:LogtoOptions.GetClaimsFromUserInfoEndpoint"/> to <c>true</c>.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="T:IRaCIS.Core.API.OAuth.LogtoParameters.Claims">
|
|
||||||
<summary>
|
|
||||||
The claim names used by Logto OpenID Connect provider for ID token and userinfo endpoint.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="F:IRaCIS.Core.API.OAuth.LogtoParameters.Claims.Issuer">
|
|
||||||
<summary>
|
|
||||||
The claim name for the issuer identifier for whom issued the token.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="F:IRaCIS.Core.API.OAuth.LogtoParameters.Claims.Subject">
|
|
||||||
<summary>
|
|
||||||
The claim name for the subject identifier for whom the token is intended (user ID).
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="F:IRaCIS.Core.API.OAuth.LogtoParameters.Claims.Audience">
|
|
||||||
<summary>
|
|
||||||
The claim name for the audience that the token is intended for, which is the client ID.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="F:IRaCIS.Core.API.OAuth.LogtoParameters.Claims.Expiration">
|
|
||||||
<summary>
|
|
||||||
The claim name for the expiration time of the token (in seconds).
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="F:IRaCIS.Core.API.OAuth.LogtoParameters.Claims.IssuedAt">
|
|
||||||
<summary>
|
|
||||||
The claim name for the time at which the token was issued (in seconds).
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="F:IRaCIS.Core.API.OAuth.LogtoParameters.Claims.Name">
|
|
||||||
<summary>
|
|
||||||
The claim name for the user's full name.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="F:IRaCIS.Core.API.OAuth.LogtoParameters.Claims.Username">
|
|
||||||
<summary>
|
|
||||||
The claim name for user's username.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="F:IRaCIS.Core.API.OAuth.LogtoParameters.Claims.Picture">
|
|
||||||
<summary>
|
|
||||||
The claim name for user's profile picture URL.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="F:IRaCIS.Core.API.OAuth.LogtoParameters.Claims.Email">
|
|
||||||
<summary>
|
|
||||||
The claim name for user's email.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="F:IRaCIS.Core.API.OAuth.LogtoParameters.Claims.EmailVerified">
|
|
||||||
<summary>
|
|
||||||
The claim name for user's email verification status.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="F:IRaCIS.Core.API.OAuth.LogtoParameters.Claims.PhoneNumber">
|
|
||||||
<summary>
|
|
||||||
The claim name for user's phone number.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="F:IRaCIS.Core.API.OAuth.LogtoParameters.Claims.PhoneNumberVerified">
|
|
||||||
<summary>
|
|
||||||
The claim name for user's phone number verification status.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="F:IRaCIS.Core.API.OAuth.LogtoParameters.Claims.CustomData">
|
|
||||||
<summary>
|
|
||||||
The claim name for user's custom data.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="F:IRaCIS.Core.API.OAuth.LogtoParameters.Claims.Identities">
|
|
||||||
<summary>
|
|
||||||
The claim name for user's identities.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.API.OAuth.LogtoTokenResponse.AccessToken">
|
|
||||||
<summary>
|
|
||||||
The access token issued by the Logto authorization server.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.API.OAuth.LogtoTokenResponse.TokenType">
|
|
||||||
<summary>
|
|
||||||
The type of the token issued by the Logto authorization server.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.API.OAuth.LogtoTokenResponse.ExpiresIn">
|
|
||||||
<summary>
|
|
||||||
The lifetime in seconds of the access token.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.API.OAuth.LogtoTokenResponse.RefreshToken">
|
|
||||||
<summary>
|
|
||||||
The refresh token, which can be used to obtain new access tokens using the same authorization grant.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.API.OAuth.LogtoTokenResponse.IdToken">
|
|
||||||
<summary>
|
|
||||||
The ID token, which can be used to verify the identity of the user.
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="T:IRaCIS.Core.API.IpPolicyRateLimitSetup">
|
<member name="T:IRaCIS.Core.API.IpPolicyRateLimitSetup">
|
||||||
<summary>
|
<summary>
|
||||||
IPLimit限流 启动服务
|
IPLimit限流 启动服务
|
||||||
|
|||||||
@@ -37,6 +37,11 @@ var config = new ConfigurationBuilder()
|
|||||||
|
|
||||||
var enviromentName = config["ASPNETCORE_ENVIRONMENT"];
|
var enviromentName = config["ASPNETCORE_ENVIRONMENT"];
|
||||||
|
|
||||||
|
var openSwaggerStr = config["ASPNETCORE_OpenSwagger"];
|
||||||
|
|
||||||
|
var isOpenSwagger= openSwaggerStr == null|| openSwaggerStr?.ToLower()=="true";
|
||||||
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(enviromentName))
|
if (string.IsNullOrWhiteSpace(enviromentName))
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -52,6 +57,7 @@ SerilogExtension.AddSerilogSetup(enviromentName);
|
|||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(new WebApplicationOptions
|
var builder = WebApplication.CreateBuilder(new WebApplicationOptions
|
||||||
{
|
{
|
||||||
|
|
||||||
EnvironmentName = enviromentName
|
EnvironmentName = enviromentName
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -110,8 +116,13 @@ builder.Services.AddAutoMapperSetup();
|
|||||||
builder.Services.AddEFSetup(_configuration, enviromentName);
|
builder.Services.AddEFSetup(_configuration, enviromentName);
|
||||||
//Http 响应压缩
|
//Http 响应压缩
|
||||||
builder.Services.AddResponseCompressionSetup();
|
builder.Services.AddResponseCompressionSetup();
|
||||||
//Swagger Api 文档
|
|
||||||
builder.Services.AddSwaggerSetup();
|
if (isOpenSwagger)
|
||||||
|
{
|
||||||
|
//Swagger Api 文档
|
||||||
|
builder.Services.AddSwaggerSetup();
|
||||||
|
}
|
||||||
|
|
||||||
//JWT Token 验证
|
//JWT Token 验证
|
||||||
builder.Services.AddJWTAuthSetup(_configuration);
|
builder.Services.AddJWTAuthSetup(_configuration);
|
||||||
|
|
||||||
@@ -216,7 +227,12 @@ app.UseLogDashboard("/LogDashboard");
|
|||||||
app.UseHangfireConfig(env);
|
app.UseHangfireConfig(env);
|
||||||
|
|
||||||
// Swagger
|
// Swagger
|
||||||
SwaggerSetup.Configure(app, env);
|
|
||||||
|
if (isOpenSwagger)
|
||||||
|
{
|
||||||
|
SwaggerSetup.Configure(app, env);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//serilog 记录请求的用户信息
|
//serilog 记录请求的用户信息
|
||||||
app.UseSerilogConfig(env);
|
app.UseSerilogConfig(env);
|
||||||
|
|||||||
@@ -20,7 +20,8 @@
|
|||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Test_IRC"
|
"ASPNETCORE_ENVIRONMENT": "Test_IRC",
|
||||||
|
"ASPNETCORE_OpenSwagger": "true"
|
||||||
},
|
},
|
||||||
"applicationUrl": "http://localhost:6100"
|
"applicationUrl": "http://localhost:6100"
|
||||||
},
|
},
|
||||||
@@ -69,6 +70,14 @@
|
|||||||
"ASPNETCORE_ENVIRONMENT": "US_Uat_IRC"
|
"ASPNETCORE_ENVIRONMENT": "US_Uat_IRC"
|
||||||
},
|
},
|
||||||
"applicationUrl": "http://localhost:6100"
|
"applicationUrl": "http://localhost:6100"
|
||||||
|
},
|
||||||
|
"IRaCIS.US_Prod_IRC": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"launchBrowser": true,
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "US_Prod_IRC"
|
||||||
|
},
|
||||||
|
"applicationUrl": "http://localhost:6100"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace IRaCIS.Core.API
|
|||||||
{
|
{
|
||||||
public virtual string GetUserId(HubConnectionContext connection)
|
public virtual string GetUserId(HubConnectionContext connection)
|
||||||
{
|
{
|
||||||
return connection.User?.FindFirst(JwtIRaCISClaimType.Id)?.Value!;
|
return connection.User?.FindFirst(JwtIRaCISClaimType.IdentityUserId)?.Value!;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace IRaCIS.Core.API
|
|||||||
diagnosticContext.Set("QueryString", request.QueryString.Value);
|
diagnosticContext.Set("QueryString", request.QueryString.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
diagnosticContext.Set("FullName", httpContext?.User?.FindFirst(JwtIRaCISClaimType.RealName)?.Value);
|
diagnosticContext.Set("FullName", httpContext?.User?.FindFirst(JwtIRaCISClaimType.FullName)?.Value);
|
||||||
|
|
||||||
diagnosticContext.Set("UserType", httpContext?.User?.FindFirst(JwtIRaCISClaimType.UserTypeShortName)?.Value);
|
diagnosticContext.Set("UserType", httpContext?.User?.FindFirst(JwtIRaCISClaimType.UserTypeShortName)?.Value);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using EntityFramework.Exceptions.SqlServer;
|
using EntityFramework.Exceptions.SqlServer;
|
||||||
using IRaCIS.Core.Application.Triggers;
|
using IRaCIS.Core.Application.Triggers;
|
||||||
|
using IRaCIS.Core.Application.Triggers.AfterSaveTrigger;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infra.EFCore;
|
using IRaCIS.Core.Infra.EFCore;
|
||||||
using IRaCIS.Core.Infra.EFCore.Interceptor;
|
using IRaCIS.Core.Infra.EFCore.Interceptor;
|
||||||
@@ -79,6 +80,14 @@ namespace IRaCIS.Core.API
|
|||||||
|
|
||||||
triggerOptions.AddTrigger<UserLogTrigger>();
|
triggerOptions.AddTrigger<UserLogTrigger>();
|
||||||
|
|
||||||
|
triggerOptions.AddTrigger<UserAddTrigger>();
|
||||||
|
|
||||||
|
triggerOptions.AddTrigger<UserLogAfterTrigger>();
|
||||||
|
|
||||||
|
triggerOptions.AddTrigger<IdenttiyUserRoleInfoTrigger>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ namespace IRaCIS.Core.API;
|
|||||||
|
|
||||||
public enum SwaggerVersion
|
public enum SwaggerVersion
|
||||||
{
|
{
|
||||||
|
[Description("文件记录")]
|
||||||
|
FileRecord = -1,
|
||||||
|
|
||||||
[Description("医生模块")]
|
[Description("医生模块")]
|
||||||
Reviewer = 1,
|
Reviewer = 1,
|
||||||
[Description("项目模块")]
|
[Description("项目模块")]
|
||||||
@@ -109,7 +112,6 @@ public static class SwaggerSetup
|
|||||||
//路径配置,设置为空,表示直接在根域名(localhost:8001)访问该文件,
|
//路径配置,设置为空,表示直接在根域名(localhost:8001)访问该文件,
|
||||||
//注意localhost:8001/swagger是访问不到的,去launchSettings.json把launchUrl去掉,如果你想换一个路径,直接写名字即可,比如直接写c.Route = "doc";
|
//注意localhost:8001/swagger是访问不到的,去launchSettings.json把launchUrl去掉,如果你想换一个路径,直接写名字即可,比如直接写c.Route = "doc";
|
||||||
options.RoutePrefix = string.Empty;
|
options.RoutePrefix = string.Empty;
|
||||||
options.RoutePrefix = string.Empty;
|
|
||||||
|
|
||||||
//DocExpansion设置为none可折叠所有方法
|
//DocExpansion设置为none可折叠所有方法
|
||||||
options.DocExpansion(DocExpansion.None);
|
options.DocExpansion(DocExpansion.None);
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"RemoteNew": "Server=47.117.164.182,1434;Database=Event_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
"RemoteNew": "Server=101.132.253.119,1435;Database=irc_Prpd_bak;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||||
"Hangfire": "Server=47.117.164.182,1434;Database=Event_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
"Hangfire": "Server=101.132.253.119,1435;Database=irc_Hangfire_bak;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||||
},
|
},
|
||||||
"ObjectStoreService": {
|
"ObjectStoreService": {
|
||||||
"ObjectStoreUse": "AliyunOSS",
|
"ObjectStoreUse": "AliyunOSS",
|
||||||
|
|||||||
@@ -43,27 +43,25 @@
|
|||||||
"OpenLoginLimit": true,
|
"OpenLoginLimit": true,
|
||||||
"LoginMaxFailCount": 5,
|
"LoginMaxFailCount": 5,
|
||||||
"LoginFailLockMinutes": 30,
|
"LoginFailLockMinutes": 30,
|
||||||
|
"AutoLoginOutMinutes": 120,
|
||||||
"AutoLoginOutMinutes": 360,
|
|
||||||
|
|
||||||
"OpenLoginMFA": false,
|
"OpenLoginMFA": false,
|
||||||
|
|
||||||
"ContinuousReadingTimeMin": 120,
|
"ContinuousReadingTimeMin": 120,
|
||||||
|
|
||||||
"ReadingRestTimeMin": 10,
|
"ReadingRestTimeMin": 10,
|
||||||
|
|
||||||
"IsNeedChangePassWord": true,
|
"IsNeedChangePassWord": true,
|
||||||
|
|
||||||
"ChangePassWordDays": 90
|
"ChangePassWordDays": 90
|
||||||
},
|
},
|
||||||
|
|
||||||
"SystemEmailSendConfig": {
|
"SystemEmailSendConfig": {
|
||||||
"Port": 465,
|
"Port": 465,
|
||||||
"Host": "smtp.qiye.aliyun.com",
|
"Host": "smtp.qiye.aliyun.com",
|
||||||
"FromEmail": "IRC@extimaging.com",
|
"FromEmail": "irc@extimaging.com",
|
||||||
"FromName": "IRC",
|
"FromName": "irc",
|
||||||
"AuthorizationCode": "ExtImg@2022",
|
"AuthorizationCode": "ExtImg@2022",
|
||||||
"SiteUrl": "http://irc.extimaging.com/login",
|
"SiteUrl": "http://irc.extimaging.com/login",
|
||||||
|
"SystemShortName": "IRC",
|
||||||
"OrganizationName": "Extlmaging",
|
"OrganizationName": "Extlmaging",
|
||||||
"OrganizationNameCN": "Extlmaging",
|
"OrganizationNameCN": "Extlmaging",
|
||||||
"CompanyName": "Extensive Imaging",
|
"CompanyName": "Extensive Imaging",
|
||||||
@@ -71,7 +69,7 @@
|
|||||||
"CompanyShortName": "Extensive Imaging",
|
"CompanyShortName": "Extensive Imaging",
|
||||||
"CompanyShortNameCN": "展影医疗",
|
"CompanyShortNameCN": "展影医疗",
|
||||||
"IsEnv_US": false,
|
"IsEnv_US": false,
|
||||||
"IsOpenErrorNoticeEmail": true,
|
"IsOpenErrorNoticeEmail": false,
|
||||||
"ErrorNoticeEmailList": [ "872297557@qq.com" ]
|
"ErrorNoticeEmailList": [ "872297557@qq.com" ]
|
||||||
},
|
},
|
||||||
"SystemPacsConfig": {
|
"SystemPacsConfig": {
|
||||||
|
|||||||
@@ -23,9 +23,11 @@
|
|||||||
"AccessKeySecret": "FLizxkHsMm4CGYHtkV8E3PNJJZU7oV",
|
"AccessKeySecret": "FLizxkHsMm4CGYHtkV8E3PNJJZU7oV",
|
||||||
"RoleArn": "acs:ram::1899121822495495:role/dev-oss-access",
|
"RoleArn": "acs:ram::1899121822495495:role/dev-oss-access",
|
||||||
"BucketName": "zy-irc-test-store",
|
"BucketName": "zy-irc-test-store",
|
||||||
"ViewEndpoint": "https://zy-irc-test-store.oss-cn-shanghai.aliyuncs.com",
|
//"ViewEndpoint": "https://zy-irc-test-store.oss-cn-shanghai.aliyuncs.com",
|
||||||
|
"ViewEndpoint": "https://zy-irc-test-dev-cache.oss-cn-shanghai.aliyuncs.com",
|
||||||
"Region": "oss-cn-shanghai",
|
"Region": "oss-cn-shanghai",
|
||||||
"DurationSeconds": 7200
|
"DurationSeconds": 7200,
|
||||||
|
"PreviewEndpoint": "https://test-oss.test.extimaging.com"
|
||||||
},
|
},
|
||||||
"MinIO": {
|
"MinIO": {
|
||||||
"EndPoint": "hir-oss.test.extimaging.com",
|
"EndPoint": "hir-oss.test.extimaging.com",
|
||||||
@@ -52,28 +54,24 @@
|
|||||||
"BasicSystemConfig": {
|
"BasicSystemConfig": {
|
||||||
|
|
||||||
"OpenUserComplexPassword": false,
|
"OpenUserComplexPassword": false,
|
||||||
|
|
||||||
"OpenSignDocumentBeforeWork": false,
|
"OpenSignDocumentBeforeWork": false,
|
||||||
|
|
||||||
"OpenTrialRelationDelete": true,
|
|
||||||
|
|
||||||
"OpenLoginLimit": false,
|
"OpenLoginLimit": false,
|
||||||
|
|
||||||
"LoginMaxFailCount": 5,
|
"LoginMaxFailCount": 5,
|
||||||
|
|
||||||
"LoginFailLockMinutes": 1,
|
"LoginFailLockMinutes": 1,
|
||||||
|
"AutoLoginOutMinutes": 10,
|
||||||
"AutoLoginOutMinutes": 1,
|
|
||||||
|
|
||||||
"OpenLoginMFA": false,
|
"OpenLoginMFA": false,
|
||||||
|
|
||||||
"ContinuousReadingTimeMin": 120,
|
"ContinuousReadingTimeMin": 120,
|
||||||
|
|
||||||
"ReadingRestTimeMin": 10,
|
"ReadingRestTimeMin": 10,
|
||||||
"IsNeedChangePassWord": true,
|
|
||||||
|
|
||||||
|
"IsNeedChangePassWord": true,
|
||||||
"ChangePassWordDays": 90,
|
"ChangePassWordDays": 90,
|
||||||
|
|
||||||
|
|
||||||
|
"OpenTrialRelationDelete": true,
|
||||||
|
|
||||||
"ThirdPdfUrl": "http://106.14.89.110:30088/api/v1/convert/file/pdf"
|
"ThirdPdfUrl": "http://106.14.89.110:30088/api/v1/convert/file/pdf"
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -85,6 +83,7 @@
|
|||||||
"AuthorizationCode": "SHzyyl2021",
|
"AuthorizationCode": "SHzyyl2021",
|
||||||
"SiteUrl": "http://irc.test.extimaging.com/login",
|
"SiteUrl": "http://irc.test.extimaging.com/login",
|
||||||
|
|
||||||
|
"SystemShortName": "IRC",
|
||||||
"OrganizationName": "Extlmaging",
|
"OrganizationName": "Extlmaging",
|
||||||
"OrganizationNameCN": "Extlmaging",
|
"OrganizationNameCN": "Extlmaging",
|
||||||
"CompanyName": "Extensive Imaging",
|
"CompanyName": "Extensive Imaging",
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"RemoteNew": "Server=us-prod-mssql-service,1433;Database=US_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
"RemoteNew": "Server=us-mssql-prod,1433;Database=US_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||||
"Hangfire": "Server=us-prod-mssql-service,1433;Database=US_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
"Hangfire": "Server=us-mssql-prod,1433;Database=US_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||||
//"RemoteNew": "Server=44.210.231.169,1435;Database=US_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
//"RemoteNew": "Server=44.210.231.169,1435;Database=US_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||||
//"Hangfire": "Server=44.210.231.169,1435;Database=US_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
//"Hangfire": "Server=44.210.231.169,1435;Database=US_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||||
},
|
},
|
||||||
@@ -39,25 +39,25 @@
|
|||||||
},
|
},
|
||||||
"BasicSystemConfig": {
|
"BasicSystemConfig": {
|
||||||
|
|
||||||
"OpenUserComplexPassword": false,
|
"OpenUserComplexPassword": true,
|
||||||
|
"OpenSignDocumentBeforeWork": true,
|
||||||
"OpenSignDocumentBeforeWork": false,
|
|
||||||
|
|
||||||
"OpenTrialRelationDelete": true,
|
|
||||||
|
|
||||||
"OpenLoginLimit": false,
|
|
||||||
|
|
||||||
|
"OpenLoginLimit": true,
|
||||||
"LoginMaxFailCount": 5,
|
"LoginMaxFailCount": 5,
|
||||||
|
|
||||||
"LoginFailLockMinutes": 30,
|
"LoginFailLockMinutes": 30,
|
||||||
"AutoLoginOutMinutes": 60,
|
"AutoLoginOutMinutes": 120,
|
||||||
|
|
||||||
|
"OpenLoginMFA": true,
|
||||||
|
|
||||||
"ContinuousReadingTimeMin": 120,
|
"ContinuousReadingTimeMin": 120,
|
||||||
|
|
||||||
"ReadingRestTimeMin": 10,
|
"ReadingRestTimeMin": 10,
|
||||||
"IsNeedChangePassWord": true,
|
|
||||||
|
|
||||||
"ChangePassWordDays": 90
|
"IsNeedChangePassWord": true,
|
||||||
|
"ChangePassWordDays": 90,
|
||||||
|
|
||||||
|
|
||||||
|
"OpenTrialRelationDelete": false
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
"SystemEmailSendConfig": {
|
"SystemEmailSendConfig": {
|
||||||
@@ -67,6 +67,7 @@
|
|||||||
"FromName": "LiLi",
|
"FromName": "LiLi",
|
||||||
"AuthorizationCode": "Q#669869497420ul",
|
"AuthorizationCode": "Q#669869497420ul",
|
||||||
|
|
||||||
|
"SystemShortName": "LiLi",
|
||||||
"OrganizationName": "Elevate Imaging",
|
"OrganizationName": "Elevate Imaging",
|
||||||
"OrganizationNameCN": "Elevate Imaging",
|
"OrganizationNameCN": "Elevate Imaging",
|
||||||
"CompanyName": "Elevate Imaging Inc.",
|
"CompanyName": "Elevate Imaging Inc.",
|
||||||
@@ -75,7 +76,7 @@
|
|||||||
"CompanyShortNameCN": "展影医疗",
|
"CompanyShortNameCN": "展影医疗",
|
||||||
"SiteUrl": "https://lili.elevateimaging.ai/login",
|
"SiteUrl": "https://lili.elevateimaging.ai/login",
|
||||||
"IsEnv_US": true,
|
"IsEnv_US": true,
|
||||||
"IsOpenErrorNoticeEmail": true,
|
"IsOpenErrorNoticeEmail": false,
|
||||||
"ErrorNoticeEmailList": [ "872297557@qq.com" ]
|
"ErrorNoticeEmailList": [ "872297557@qq.com" ]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,7 @@
|
|||||||
"FromName": "LiLi",
|
"FromName": "LiLi",
|
||||||
"AuthorizationCode": "Q#669869497420ul",
|
"AuthorizationCode": "Q#669869497420ul",
|
||||||
|
|
||||||
|
"SystemShortName": "LiLi",
|
||||||
"OrganizationName": "Elevate Imaging",
|
"OrganizationName": "Elevate Imaging",
|
||||||
"OrganizationNameCN": "Elevate Imaging",
|
"OrganizationNameCN": "Elevate Imaging",
|
||||||
"CompanyName": "Elevate Imaging Inc.",
|
"CompanyName": "Elevate Imaging Inc.",
|
||||||
|
|||||||
@@ -50,26 +50,20 @@
|
|||||||
"BasicSystemConfig": {
|
"BasicSystemConfig": {
|
||||||
|
|
||||||
"OpenUserComplexPassword": true,
|
"OpenUserComplexPassword": true,
|
||||||
|
|
||||||
"OpenSignDocumentBeforeWork": true,
|
"OpenSignDocumentBeforeWork": true,
|
||||||
|
|
||||||
"OpenTrialRelationDelete": true,
|
"OpenLoginLimit": true,
|
||||||
|
|
||||||
"OpenLoginLimit": false,
|
|
||||||
|
|
||||||
"LoginMaxFailCount": 5,
|
"LoginMaxFailCount": 5,
|
||||||
|
|
||||||
"LoginFailLockMinutes": 30,
|
"LoginFailLockMinutes": 30,
|
||||||
"AutoLoginOutMinutes": 60,
|
"AutoLoginOutMinutes": 120,
|
||||||
|
|
||||||
|
"OpenLoginMFA": true,
|
||||||
|
|
||||||
"ContinuousReadingTimeMin": 120,
|
"ContinuousReadingTimeMin": 120,
|
||||||
|
|
||||||
"ReadingRestTimeMin": 10,
|
"ReadingRestTimeMin": 10,
|
||||||
|
|
||||||
"IsNeedChangePassWord": true,
|
"IsNeedChangePassWord": true,
|
||||||
|
"ChangePassWordDays": 90
|
||||||
"ChangePassWordDays": 90,
|
|
||||||
|
|
||||||
"OpenLoginMFA": false
|
|
||||||
},
|
},
|
||||||
|
|
||||||
"SystemEmailSendConfig": {
|
"SystemEmailSendConfig": {
|
||||||
@@ -79,13 +73,14 @@
|
|||||||
"FromName": "LiLi",
|
"FromName": "LiLi",
|
||||||
"AuthorizationCode": "Q#669869497420ul",
|
"AuthorizationCode": "Q#669869497420ul",
|
||||||
|
|
||||||
|
"SystemShortName": "LiLi",
|
||||||
"OrganizationName": "Elevate Imaging",
|
"OrganizationName": "Elevate Imaging",
|
||||||
"OrganizationNameCN": "Elevate Imaging",
|
"OrganizationNameCN": "Elevate Imaging",
|
||||||
"CompanyName": "Elevate Imaging Inc.",
|
"CompanyName": "Elevate Imaging Inc.",
|
||||||
"CompanyNameCN": "上海展影医疗科技有限公司",
|
"CompanyNameCN": "上海展影医疗科技有限公司",
|
||||||
"CompanyShortName": "Elevate Imaging",
|
"CompanyShortName": "Elevate Imaging",
|
||||||
"CompanyShortNameCN": "展影医疗",
|
"CompanyShortNameCN": "展影医疗",
|
||||||
"SiteUrl": "https://lili.test.elevateimaging.ai/login",
|
"SiteUrl": "https://lili.uat.elevateimaging.ai/login",
|
||||||
"IsEnv_US": true,
|
"IsEnv_US": true,
|
||||||
"IsOpenErrorNoticeEmail": false,
|
"IsOpenErrorNoticeEmail": false,
|
||||||
"ErrorNoticeEmailList": [ "872297557@qq.com" ]
|
"ErrorNoticeEmailList": [ "872297557@qq.com" ]
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"RemoteNew": "Server=47.117.164.182,1434;Database=Uat_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
"RemoteNew": "Server=101.132.253.119,1435;Database=Uat_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||||
"Hangfire": "Server=47.117.164.182,1434;Database=Uat_IRC.Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
"Hangfire": "Server=101.132.253.119,1435;Database=Uat_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||||
},
|
},
|
||||||
"ObjectStoreService": {
|
"ObjectStoreService": {
|
||||||
|
|
||||||
@@ -18,11 +18,11 @@
|
|||||||
"RegionId": "cn-shanghai",
|
"RegionId": "cn-shanghai",
|
||||||
"InternalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
"InternalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com",
|
||||||
"EndPoint": "https://oss-cn-shanghai.aliyuncs.com",
|
"EndPoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||||
"AccessKeyId": "LTAI5tRRZehUp2V9pyTPtAJm",
|
"AccessKeyId": "LTAI5tFUCCmz5TwghZHsj45Y",
|
||||||
"AccessKeySecret": "FLizxkHsMm4CGYHtkV8E3PNJJZU7oV",
|
"AccessKeySecret": "8evrBy1fVfzJG25i67Jm0xqn9Xcw2T",
|
||||||
"RoleArn": "acs:ram::1899121822495495:role/dev-oss-access",
|
"RoleArn": "acs:ram::1078130221702011:role/uat-oss-access",
|
||||||
"BucketName": "zy-irc-uat-store",
|
"BucketName": "tl-med-irc-uat-store",
|
||||||
"ViewEndpoint": "https://zy-irc-uat-store.oss-cn-shanghai.aliyuncs.com",
|
"ViewEndpoint": "https://tl-med-irc-uat-store.oss-cn-shanghai.aliyuncs.com",
|
||||||
"Region": "oss-cn-shanghai",
|
"Region": "oss-cn-shanghai",
|
||||||
"DurationSeconds": 7200
|
"DurationSeconds": 7200
|
||||||
},
|
},
|
||||||
@@ -56,21 +56,20 @@
|
|||||||
"BasicSystemConfig": {
|
"BasicSystemConfig": {
|
||||||
|
|
||||||
"OpenUserComplexPassword": true,
|
"OpenUserComplexPassword": true,
|
||||||
|
|
||||||
"OpenSignDocumentBeforeWork": true,
|
"OpenSignDocumentBeforeWork": true,
|
||||||
|
|
||||||
"OpenLoginLimit": true,
|
"OpenLoginLimit": true,
|
||||||
"LoginMaxFailCount": 5,
|
"LoginMaxFailCount": 5,
|
||||||
|
|
||||||
"LoginFailLockMinutes": 30,
|
"LoginFailLockMinutes": 30,
|
||||||
"AutoLoginOutMinutes": 60,
|
"AutoLoginOutMinutes": 120,
|
||||||
|
|
||||||
"OpenLoginMFA": false,
|
"OpenLoginMFA": false,
|
||||||
|
|
||||||
"ContinuousReadingTimeMin": 120,
|
"ContinuousReadingTimeMin": 120,
|
||||||
|
|
||||||
"ReadingRestTimeMin": 10,
|
"ReadingRestTimeMin": 10,
|
||||||
"IsNeedChangePassWord": true,
|
|
||||||
|
|
||||||
|
"IsNeedChangePassWord": true,
|
||||||
"ChangePassWordDays": 90
|
"ChangePassWordDays": 90
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -81,6 +80,8 @@
|
|||||||
"FromName": "UAT_IRC",
|
"FromName": "UAT_IRC",
|
||||||
"AuthorizationCode": "SHzyyl2021",
|
"AuthorizationCode": "SHzyyl2021",
|
||||||
"SiteUrl": "http://irc.uat.extimaging.com/login",
|
"SiteUrl": "http://irc.uat.extimaging.com/login",
|
||||||
|
|
||||||
|
"SystemShortName": "IRC",
|
||||||
"OrganizationName": "Extlmaging",
|
"OrganizationName": "Extlmaging",
|
||||||
"OrganizationNameCN": "Extlmaging",
|
"OrganizationNameCN": "Extlmaging",
|
||||||
"CompanyName": "Extensive Imaging",
|
"CompanyName": "Extensive Imaging",
|
||||||
@@ -94,7 +95,7 @@
|
|||||||
|
|
||||||
"SystemPacsConfig": {
|
"SystemPacsConfig": {
|
||||||
"Port": "11113",
|
"Port": "11113",
|
||||||
"IP": "47.117.164.182"
|
"IP": "101.132.253.119"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"SecurityKey": "ShangHaiZhanYing_SecurityKey_SHzyyl@2021",
|
"SecurityKey": "ShangHaiZhanYing_SecurityKey_SHzyyl@2021",
|
||||||
"Issuer": "Extimaging",
|
"Issuer": "Extimaging",
|
||||||
"Audience": "EICS",
|
"Audience": "EICS",
|
||||||
"TokenExpireDays": "7"
|
"TokenExpireMinute": "10080"//7天
|
||||||
},
|
},
|
||||||
"IpRateLimiting": {
|
"IpRateLimiting": {
|
||||||
"EnableEndpointRateLimiting": true,
|
"EnableEndpointRateLimiting": true,
|
||||||
@@ -66,5 +66,13 @@
|
|||||||
"ApiPathList": [
|
"ApiPathList": [
|
||||||
"/test/get"
|
"/test/get"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"oauth": {
|
||||||
|
"github": {
|
||||||
|
"app_id": "github_app_id",
|
||||||
|
"app_key": "github_app_key",
|
||||||
|
"redirect_uri": "https://oauthlogin.net/oauth/githubcallback",
|
||||||
|
"scope": "repo"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -268,12 +268,12 @@ var abp = abp || {};
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loginUserInternal(tenantId, callback) {
|
function loginUserInternal(tenantId, callback) {
|
||||||
|
|
||||||
var usernameOrEmailAddress = document.getElementById('userName').value;
|
var usernameOrEmailAddress = document.getElementById('userName').value;
|
||||||
if (!usernameOrEmailAddress) {
|
// if (!usernameOrEmailAddress) {
|
||||||
alert('UserName Can Not Be Null');
|
// alert('UserName Can Not Be Null');
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
var password = document.getElementById('password').value;
|
var password = document.getElementById('password').value;
|
||||||
var pwdMd5 = document.getElementById('pwdMd5').value;
|
var pwdMd5 = document.getElementById('pwdMd5').value;
|
||||||
@@ -286,12 +286,12 @@ var abp = abp || {};
|
|||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
|
|
||||||
xhr.onreadystatechange = function () {
|
xhr.onreadystatechange = function () {
|
||||||
|
|
||||||
if (xhr.readyState === XMLHttpRequest.DONE) {
|
if (xhr.readyState === XMLHttpRequest.DONE) {
|
||||||
debugger;
|
// debugger;
|
||||||
if (xhr.status === 200) {
|
if (xhr.status === 200) {
|
||||||
debugger;
|
// debugger;
|
||||||
|
|
||||||
var resultdata = JSON.parse(xhr.responseText);
|
var resultdata = JSON.parse(xhr.responseText);
|
||||||
if (resultdata.ErrorMessage != '') {
|
if (resultdata.ErrorMessage != '') {
|
||||||
alert(resultdata.ErrorMessage);
|
alert(resultdata.ErrorMessage);
|
||||||
@@ -303,18 +303,23 @@ var abp = abp || {};
|
|||||||
else {
|
else {
|
||||||
var responseJSON = JSON.parse(xhr.responseText);
|
var responseJSON = JSON.parse(xhr.responseText);
|
||||||
var result = responseJSON;
|
var result = responseJSON;
|
||||||
var expireDate = new Date(Date.now() + (60*60*24 * 1000));
|
var expireDate = new Date(Date.now() + (60 * 60 * 24 * 1000));
|
||||||
abp.auth.setToken(result.Result.JWTStr, expireDate);
|
abp.auth.setToken(result.Result.JWTStr, expireDate);
|
||||||
callback();
|
let selectDom = document.getElementById("roleSelect")
|
||||||
|
selectDom.options.length = 0;
|
||||||
|
result.Result.BasicInfo.AccountList.forEach(item => {
|
||||||
|
selectDom.options.add(new Option(item.UserTypeShortName, item.Id));
|
||||||
|
})
|
||||||
|
// callback();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
alert('Login failed !');
|
alert('Login failed !');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
xhr.open('POST', '/user/login', true);
|
xhr.open('POST', '/User/getUserLoginRoleList', true);
|
||||||
xhr.setRequestHeader('Abp.TenantId', tenantId);
|
xhr.setRequestHeader('Abp.TenantId', tenantId);
|
||||||
xhr.setRequestHeader('Content-type', 'application/json');
|
xhr.setRequestHeader('Content-type', 'application/json');
|
||||||
var parm = {
|
var parm = {
|
||||||
@@ -330,7 +335,63 @@ var abp = abp || {};
|
|||||||
//xhr.send("{" + "userName:'" + usernameOrEmailAddress + "'," + "passWord:'" + password + "'}");
|
//xhr.send("{" + "userName:'" + usernameOrEmailAddress + "'," + "passWord:'" + password + "'}");
|
||||||
|
|
||||||
};
|
};
|
||||||
|
function loginUserInternalRole(tenantId, callback) {
|
||||||
|
|
||||||
|
var usernameOrEmailAddress = document.getElementById('roleSelect').value;
|
||||||
|
//if (!usernameOrEmailAddress) {
|
||||||
|
// alert('UserName Can Not Be Null');
|
||||||
|
// return false;
|
||||||
|
//}
|
||||||
|
|
||||||
|
var password = document.getElementById('password').value;
|
||||||
|
var pwdMd5 = document.getElementById('pwdMd5').value;
|
||||||
|
console.log(pwdMd5);
|
||||||
|
if (!password && !pwdMd5) {
|
||||||
|
alert('PassWord And Md5 Can Not Be Null');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
|
||||||
|
xhr.onreadystatechange = function () {
|
||||||
|
|
||||||
|
if (xhr.readyState === XMLHttpRequest.DONE) {
|
||||||
|
// debugger;
|
||||||
|
if (xhr.status === 200) {
|
||||||
|
// debugger;
|
||||||
|
|
||||||
|
var resultdata = JSON.parse(xhr.responseText);
|
||||||
|
if (resultdata.ErrorMessage != '') {
|
||||||
|
alert(resultdata.ErrorMessage);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (resultdata.code == 300) {
|
||||||
|
alert(resultdata.message);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var responseJSON = JSON.parse(xhr.responseText);
|
||||||
|
var result = responseJSON;
|
||||||
|
var expireDate = new Date(Date.now() + (60 * 60 * 24 * 1000));
|
||||||
|
abp.auth.setToken(result.Result, expireDate);
|
||||||
|
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
alert('Login failed !');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
xhr.open('get', `/User/loginSelectUserRole?userRoleId=${usernameOrEmailAddress}`, true);
|
||||||
|
xhr.setRequestHeader('Abp.TenantId', tenantId);
|
||||||
|
xhr.setRequestHeader('Content-type', 'application/json');
|
||||||
|
var authToken = abp.auth.getToken();
|
||||||
|
xhr.setRequestHeader('Authorization', `Bearer ${authToken}`);
|
||||||
|
xhr.send();
|
||||||
|
//xhr.send("{" + "userName:'" + usernameOrEmailAddress + "'," + "passWord:'" + password + "'}");
|
||||||
|
|
||||||
|
};
|
||||||
abp.swagger.login = function (callback) {
|
abp.swagger.login = function (callback) {
|
||||||
//Get TenantId first
|
//Get TenantId first
|
||||||
var tenancyName = document.getElementById('tenancyName').value;
|
var tenancyName = document.getElementById('tenancyName').value;
|
||||||
@@ -356,6 +417,31 @@ var abp = abp || {};
|
|||||||
loginUserInternal(null, callback); // Login for host
|
loginUserInternal(null, callback); // Login for host
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
abp.swagger.loginRole = function (callback) {
|
||||||
|
//Get TenantId first
|
||||||
|
var tenancyName = document.getElementById('tenancyName').value;
|
||||||
|
|
||||||
|
if (tenancyName) {
|
||||||
|
var xhrTenancyName = new XMLHttpRequest();
|
||||||
|
xhrTenancyName.onreadystatechange = function () {
|
||||||
|
if (xhrTenancyName.readyState === XMLHttpRequest.DONE && xhrTenancyName.status === 200) {
|
||||||
|
var responseJSON = JSON.parse(xhrTenancyName.responseText);
|
||||||
|
var result = responseJSON.result;
|
||||||
|
if (result.state === 1) { // Tenant exists and active.
|
||||||
|
loginUserInternalRole(result.tenantId, callback); // Login for tenant
|
||||||
|
} else {
|
||||||
|
alert('There is no such tenant or tenant is not active !');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
xhrTenancyName.open('POST', '/api/services/app/Account/IsTenantAvailable', true);
|
||||||
|
xhrTenancyName.setRequestHeader('Content-type', 'application/json');
|
||||||
|
xhrTenancyName.send("{" + "tenancyName:'" + tenancyName + "'}");
|
||||||
|
} else {
|
||||||
|
loginUserInternalRole(null, callback); // Login for host
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
abp.swagger.logout = function () {
|
abp.swagger.logout = function () {
|
||||||
abp.auth.clearToken();
|
abp.auth.clearToken();
|
||||||
@@ -419,9 +505,10 @@ var abp = abp || {};
|
|||||||
|
|
||||||
//Inputs
|
//Inputs
|
||||||
createInput(modalUxContent, 'tenancyName', 'Tenancy Name (Leave empty for Host)');
|
createInput(modalUxContent, 'tenancyName', 'Tenancy Name (Leave empty for Host)');
|
||||||
createInput(modalUxContent, 'userName', 'Username or email address','text','cyldev');
|
createInput(modalUxContent, 'userName', 'Username or email address', 'text', 'cyldev');
|
||||||
createInput(modalUxContent, 'password', 'Password', 'password', '123456');
|
createInput(modalUxContent, 'password', 'Password', 'password', '123456');
|
||||||
createInput(modalUxContent, 'pwdMd5', 'PwdMd5', 'text', '');
|
createInput(modalUxContent, 'pwdMd5', 'PwdMd5', 'text', '');
|
||||||
|
createSelect(modalUxContent, 'roleSelect', 'role', [])
|
||||||
|
|
||||||
//Buttons
|
//Buttons
|
||||||
var authBtnWrapper = document.createElement('div');
|
var authBtnWrapper = document.createElement('div');
|
||||||
@@ -444,9 +531,18 @@ var abp = abp || {};
|
|||||||
abp.swagger.login(loginCallback);
|
abp.swagger.login(loginCallback);
|
||||||
};
|
};
|
||||||
authBtnWrapper.appendChild(authorizeButton);
|
authBtnWrapper.appendChild(authorizeButton);
|
||||||
|
|
||||||
|
// login role
|
||||||
|
var authorizeButton = document.createElement('button');
|
||||||
|
authorizeButton.className = 'btn modal-btn auth authorize button';
|
||||||
|
authorizeButton.innerText = 'LoginRole';
|
||||||
|
authorizeButton.onclick = function () {
|
||||||
|
abp.swagger.loginRole(loginCallback);
|
||||||
|
};
|
||||||
|
authBtnWrapper.appendChild(authorizeButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
function createInput(container, id, title, type, value="") {
|
function createInput(container, id, title, type, value = "") {
|
||||||
var wrapper = document.createElement('div');
|
var wrapper = document.createElement('div');
|
||||||
wrapper.className = 'wrapper';
|
wrapper.className = 'wrapper';
|
||||||
if (id == "tenancyName") {
|
if (id == "tenancyName") {
|
||||||
@@ -470,6 +566,31 @@ var abp = abp || {};
|
|||||||
input.autocomplete = "off";
|
input.autocomplete = "off";
|
||||||
|
|
||||||
|
|
||||||
|
section.appendChild(input);
|
||||||
|
}
|
||||||
|
function createSelect(container, id, title, option = []) {
|
||||||
|
var wrapper = document.createElement('div');
|
||||||
|
wrapper.className = 'wrapper';
|
||||||
|
if (id == "tenancyName") {
|
||||||
|
wrapper.style.display = 'none';
|
||||||
|
}
|
||||||
|
container.appendChild(wrapper);
|
||||||
|
|
||||||
|
var label = document.createElement('label');
|
||||||
|
label.innerText = title;
|
||||||
|
wrapper.appendChild(label);
|
||||||
|
|
||||||
|
var section = document.createElement('section');
|
||||||
|
section.className = 'block-tablet col-10-tablet block-desktop col-10-desktop';
|
||||||
|
wrapper.appendChild(section);
|
||||||
|
|
||||||
|
var input = document.createElement('select');
|
||||||
|
input.id = id;
|
||||||
|
input.style.width = '100%';
|
||||||
|
option.forEach(item => {
|
||||||
|
input.options.add(new Option(item.UserTypeShortName, item.Id));
|
||||||
|
})
|
||||||
|
|
||||||
section.appendChild(input);
|
section.appendChild(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
using IRaCIS.Application.Contracts;
|
|
||||||
using IRaCIS.Core.Domain.Share;
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Auth
|
|
||||||
{
|
|
||||||
public class IRaCISClaims
|
|
||||||
{
|
|
||||||
public Guid Id { get; set; }
|
|
||||||
public string FullName { get; set; } = String.Empty;
|
|
||||||
public string Code { get; set; } = String.Empty;
|
|
||||||
public string RealName { get; set; } = String.Empty;
|
|
||||||
|
|
||||||
public string UserTypeShortName { get; set; } = String.Empty;
|
|
||||||
|
|
||||||
public UserTypeEnum UserTypeEnum { get; set; }
|
|
||||||
|
|
||||||
public string PermissionStr { get; set; } = String.Empty;
|
|
||||||
|
|
||||||
public Guid UserTypeId { get; set; }
|
|
||||||
|
|
||||||
public int IsAdmin { get; }
|
|
||||||
|
|
||||||
public bool IsTestUser { get; set; }
|
|
||||||
|
|
||||||
public bool IsZhiZhun { get; set; }
|
|
||||||
|
|
||||||
public string Phone { get; set; } = String.Empty;
|
|
||||||
|
|
||||||
public static IRaCISClaims Create(UserBasicInfo user)
|
|
||||||
{
|
|
||||||
return new IRaCISClaims
|
|
||||||
{
|
|
||||||
Id = user.Id,
|
|
||||||
FullName = user.UserName,
|
|
||||||
RealName = user.RealName,
|
|
||||||
UserTypeEnum = user.UserTypeEnum,
|
|
||||||
UserTypeId = user.UserTypeId,
|
|
||||||
IsTestUser = user.IsTestUser,
|
|
||||||
Code = user.Code,
|
|
||||||
PermissionStr = user.PermissionStr,
|
|
||||||
IsZhiZhun = user.IsZhiZhun,
|
|
||||||
UserTypeShortName = user.UserTypeShortName
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -23,7 +23,7 @@ namespace IRaCIS.Core.Application.Auth
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 过期时间
|
/// 过期时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int TokenExpireDays { get; set; }
|
public int TokenExpireMinute { get; set; }
|
||||||
|
|
||||||
//public Dictionary<string, object> Claims { get; set; }
|
//public Dictionary<string, object> Claims { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ namespace IRaCIS.Core.Application.Auth
|
|||||||
|
|
||||||
public interface ITokenService
|
public interface ITokenService
|
||||||
{
|
{
|
||||||
string GetToken(IRaCISClaims user);
|
string GetToken(UserTokenInfo user);
|
||||||
|
|
||||||
|
bool IsTokenExpired(string token);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -21,16 +23,16 @@ namespace IRaCIS.Core.Application.Auth
|
|||||||
_jwtSetting = option.Value;
|
_jwtSetting = option.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetToken(IRaCISClaims user)
|
public string GetToken(UserTokenInfo user)
|
||||||
{
|
{
|
||||||
//创建用户身份标识,可按需要添加更多信息
|
//创建用户身份标识,可按需要添加更多信息
|
||||||
var claims = new Claim[]
|
var claims = new Claim[]
|
||||||
{
|
{
|
||||||
new Claim(Microsoft.IdentityModel.JsonWebTokens.JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()),
|
new Claim(Microsoft.IdentityModel.JsonWebTokens.JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()),
|
||||||
new Claim(JwtIRaCISClaimType.Id, user.Id.ToString()),
|
new Claim(JwtIRaCISClaimType.IdentityUserId, user.IdentityUserId.ToString()),
|
||||||
new Claim(JwtIRaCISClaimType.Name, user.FullName),
|
new Claim(JwtIRaCISClaimType.UserRoleId, user.UserRoleId.ToString()),
|
||||||
new Claim(JwtIRaCISClaimType.RealName, user.RealName),
|
new Claim(JwtIRaCISClaimType.UserName, user.UserName),
|
||||||
new Claim(JwtIRaCISClaimType.Code,user.Code),
|
new Claim(JwtIRaCISClaimType.FullName, user.FullName),
|
||||||
new Claim(JwtIRaCISClaimType.UserTypeId,user.UserTypeId.ToString()),
|
new Claim(JwtIRaCISClaimType.UserTypeId,user.UserTypeId.ToString()),
|
||||||
new Claim(JwtIRaCISClaimType.UserTypeEnum,user.UserTypeEnum.ToString()),
|
new Claim(JwtIRaCISClaimType.UserTypeEnum,user.UserTypeEnum.ToString()),
|
||||||
new Claim(JwtIRaCISClaimType.UserTypeEnumInt,((int)user.UserTypeEnum).ToString()),
|
new Claim(JwtIRaCISClaimType.UserTypeEnumInt,((int)user.UserTypeEnum).ToString()),
|
||||||
@@ -47,13 +49,27 @@ namespace IRaCIS.Core.Application.Auth
|
|||||||
signingCredentials: _jwtSetting.Credentials,
|
signingCredentials: _jwtSetting.Credentials,
|
||||||
claims: claims,
|
claims: claims,
|
||||||
notBefore: DateTime.Now,
|
notBefore: DateTime.Now,
|
||||||
expires: DateTime.Now.AddDays(_jwtSetting.TokenExpireDays)
|
expires: DateTime.Now.AddMinutes(_jwtSetting.TokenExpireMinute)
|
||||||
);
|
);
|
||||||
|
|
||||||
string jwtToken = new JwtSecurityTokenHandler().WriteToken(token);
|
string jwtToken = new JwtSecurityTokenHandler().WriteToken(token);
|
||||||
return jwtToken;
|
return jwtToken;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsTokenExpired(string token)
|
||||||
|
{
|
||||||
|
var handler = new JwtSecurityTokenHandler();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var jwtToken = handler.ReadJwtToken(token);
|
||||||
|
return jwtToken.ValidTo < DateTime.UtcNow;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return true; // 无效 Token 也视为已过期
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
using IRaCIS.Application.Contracts;
|
||||||
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Application.Auth
|
||||||
|
{
|
||||||
|
public class UserTokenInfo
|
||||||
|
{
|
||||||
|
public Guid IdentityUserId { get; set; }
|
||||||
|
|
||||||
|
public Guid UserRoleId { get; set; }
|
||||||
|
|
||||||
|
public Guid UserTypeId { get; set; }
|
||||||
|
|
||||||
|
public UserTypeEnum UserTypeEnum { get; set; }
|
||||||
|
|
||||||
|
public string UserName { get; set; } = string.Empty;
|
||||||
|
public string FullName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string PermissionStr { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public bool IsTestUser { get; set; }
|
||||||
|
|
||||||
|
public bool IsZhiZhun { get; set; }
|
||||||
|
|
||||||
|
public string UserTypeShortName { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
+20
-5
@@ -48,7 +48,7 @@ public class LimitUserRequestAuthorization(
|
|||||||
|
|
||||||
|
|
||||||
//2、在这里取缓存 进行比较 看是否有其他人进行了登陆,如果其他人登陆了,就把之前用户挤掉
|
//2、在这里取缓存 进行比较 看是否有其他人进行了登陆,如果其他人登陆了,就把之前用户挤掉
|
||||||
var cacheUserToken = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.UserToken(_userInfo.Id));
|
var cacheUserToken = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.UserToken(_userInfo.IdentityUserId));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -58,17 +58,17 @@ public class LimitUserRequestAuthorization(
|
|||||||
cacheUserToken = _userInfo.UserToken;
|
cacheUserToken = _userInfo.UserToken;
|
||||||
|
|
||||||
//设置当前用户最新Token
|
//设置当前用户最新Token
|
||||||
await _fusionCache.SetAsync(CacheKeys.UserToken(_userInfo.Id), _userInfo.UserToken, TimeSpan.FromDays(7));
|
await _fusionCache.SetAsync(CacheKeys.UserToken(_userInfo.IdentityUserId), _userInfo.UserToken, TimeSpan.FromDays(7));
|
||||||
|
|
||||||
//重启应用程序,所有人续期,不一下子踢出所有人
|
//重启应用程序,所有人续期,不一下子踢出所有人
|
||||||
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(_userInfo.Id), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(minutes));
|
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(_userInfo.IdentityUserId), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(minutes));
|
||||||
|
|
||||||
}
|
}
|
||||||
//是同一个人
|
//是同一个人
|
||||||
else if (cacheUserToken == _userInfo.UserToken)
|
else if (cacheUserToken == _userInfo.UserToken)
|
||||||
{
|
{
|
||||||
|
|
||||||
var cacheTime = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.UserAutoLoginOut(_userInfo.Id));
|
var cacheTime = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.UserAutoLoginOut(_userInfo.IdentityUserId));
|
||||||
|
|
||||||
//过期了 需要自动退出
|
//过期了 需要自动退出
|
||||||
if (string.IsNullOrEmpty(cacheTime))
|
if (string.IsNullOrEmpty(cacheTime))
|
||||||
@@ -80,7 +80,7 @@ public class LimitUserRequestAuthorization(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(_userInfo.Id), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(minutes));
|
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(_userInfo.IdentityUserId), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(minutes));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -93,6 +93,21 @@ public class LimitUserRequestAuthorization(
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//用户或者角色禁用,那么操作的人退出
|
||||||
|
|
||||||
|
var isDisable = await _fusionCache.GetOrDefaultAsync<bool>(CacheKeys.UserDisable(_userInfo.IdentityUserId),false);
|
||||||
|
|
||||||
|
var isRoleDisable = await _fusionCache.GetOrDefaultAsync<bool>(CacheKeys.UserRoleDisable(_userInfo.UserRoleId),false);
|
||||||
|
|
||||||
|
if (isDisable == true || isRoleDisable == true)
|
||||||
|
{
|
||||||
|
context.HttpContext.Response.ContentType = "application/json";
|
||||||
|
context.HttpContext.Response.StatusCode = StatusCodes.Status403Forbidden;
|
||||||
|
// 用户或者角色被禁用。
|
||||||
|
|
||||||
|
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["LimitUser_AccountOrRoleDisable"], ApiResponseCodeEnum.AutoLoginOut));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,196 +0,0 @@
|
|||||||
using IRaCIS.Core.Application.Helper;
|
|
||||||
using IRaCIS.Core.Domain.Share;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Microsoft.AspNetCore.Mvc.Filters;
|
|
||||||
using Microsoft.Extensions.Localization;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using ZiggyCreatures.Caching.Fusion;
|
|
||||||
using static IRaCIS.Core.Domain.Share.StaticData;
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Filter;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 主要为了 处理项目结束 锁库,不允许操作
|
|
||||||
/// </summary>
|
|
||||||
public class TrialResourceFilter : Attribute, IAsyncResourceFilter
|
|
||||||
{
|
|
||||||
private readonly IUserInfo _userInfo;
|
|
||||||
private readonly IFusionCache _fusionCache;
|
|
||||||
public IStringLocalizer _localizer;
|
|
||||||
private readonly IRepository<Trial> _trialRepository;
|
|
||||||
private readonly List<string> _trialOptList = new List<string>();
|
|
||||||
|
|
||||||
|
|
||||||
public TrialResourceFilter(IFusionCache fusionCache, IRepository<Trial> trialRepository, IStringLocalizer localizer, IUserInfo userInfo, string trialOpt = null, string trialOpt2 = null, string trialOpt3 = null)
|
|
||||||
{
|
|
||||||
_fusionCache = fusionCache;
|
|
||||||
_userInfo = userInfo;
|
|
||||||
_localizer = localizer;
|
|
||||||
_trialRepository = trialRepository;
|
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(trialOpt)) _trialOptList.Add(trialOpt.Trim());
|
|
||||||
if (!string.IsNullOrWhiteSpace(trialOpt2)) _trialOptList.Add(trialOpt2.Trim());
|
|
||||||
if (!string.IsNullOrWhiteSpace(trialOpt3)) _trialOptList.Add(trialOpt3.Trim());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//优先选择异步的方法
|
|
||||||
public async Task OnResourceExecutionAsync(ResourceExecutingContext context, ResourceExecutionDelegate next)
|
|
||||||
{
|
|
||||||
// var typeFilter = context.ActionDescriptor.EndpointMetadata.Where(t => t.GetType() == typeof(TypeFilterAttribute)).Select(t => (TypeFilterAttribute)t).ToList().FirstOrDefault();
|
|
||||||
//var _trialOptList= typeFilter.Arguments.Select(t => t.ToString()).ToList();
|
|
||||||
|
|
||||||
// 获取当前请求的 Host 信息
|
|
||||||
var requestHost = context.HttpContext.Request.Host;
|
|
||||||
|
|
||||||
// 检查请求是否来自 localhost:6100
|
|
||||||
if (requestHost.Host == "localhost" && (requestHost.Port == 6100|| requestHost.Port==3305))
|
|
||||||
{
|
|
||||||
await next.Invoke();
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
#region 处理新的用户类型,不能操作项目相关接口
|
|
||||||
|
|
||||||
// 后期列举出具体的类型,其他任何用户类型,都不允许操作
|
|
||||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA && _userInfo.RequestUrl.ToLower() != "TrialDocument/userConfirm".ToLower())
|
|
||||||
{
|
|
||||||
//---对不起,您的账户没有操作权限。
|
|
||||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_NoAccessPermission"]));
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//TrialId 传递的途径多种,可能在path 可能在body 可能在数组中,也可能在对象中,可能就在url
|
|
||||||
var trialIdStr = string.Empty;
|
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(context.HttpContext.Request.Query["trialId"]))
|
|
||||||
{
|
|
||||||
trialIdStr = context.HttpContext.Request.Query["trialId"];
|
|
||||||
}
|
|
||||||
|
|
||||||
//先尝试从path中取TrialId
|
|
||||||
else if (context.RouteData.Values.Keys.Any(t => t.Contains("trialId")))
|
|
||||||
{
|
|
||||||
var index = context.RouteData.Values.Keys.ToList().IndexOf("trialId");
|
|
||||||
trialIdStr = context.RouteData.Values.Values.ToList()[index] as string;
|
|
||||||
}
|
|
||||||
else if (context.HttpContext.Request.Headers["Referer"].ToString().Contains("trialId"))
|
|
||||||
{
|
|
||||||
var headerStr = context.HttpContext.Request.Headers["Referer"].ToString();
|
|
||||||
|
|
||||||
var trialIdIndex = headerStr.IndexOf("trialId");
|
|
||||||
|
|
||||||
|
|
||||||
var matchResult = Regex.Match(headerStr.Substring(trialIdIndex), @"[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}");
|
|
||||||
|
|
||||||
if (matchResult.Success)
|
|
||||||
{
|
|
||||||
trialIdStr = matchResult.Value;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//---正则取请求Refer 中trialId 失败,请联系开发人员核查
|
|
||||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_ReferTrialIdFailed"]));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
#region body 中取数据
|
|
||||||
|
|
||||||
//设置可以多次读
|
|
||||||
context.HttpContext.Request.EnableBuffering();
|
|
||||||
var reader = new StreamReader(context.HttpContext.Request.Body);
|
|
||||||
var contentFromBody = await reader.ReadToEndAsync();
|
|
||||||
//读取后,流的位置还原
|
|
||||||
context.HttpContext.Request.Body.Seek(0, SeekOrigin.Begin);
|
|
||||||
//context.HttpContext.Request.Body.Position = 0;
|
|
||||||
|
|
||||||
//找到参数位置在字符串中的索引
|
|
||||||
var trialIdIndex = contentFromBody.IndexOf("\"TrialId\"", StringComparison.OrdinalIgnoreCase);
|
|
||||||
|
|
||||||
if (trialIdIndex > -1)
|
|
||||||
{
|
|
||||||
// (?<="trialId" *: *").*?(?=",)
|
|
||||||
|
|
||||||
//使用正则 [0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}
|
|
||||||
|
|
||||||
var matchResult = Regex.Match(contentFromBody.Substring(trialIdIndex), @"[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}");
|
|
||||||
|
|
||||||
if (matchResult.Success)
|
|
||||||
{
|
|
||||||
//有可能匹配错误 "trialId":"","documentId":"b8180000-3e2c-0016-9fe0-08da33f96236" 从缓存里面验证下
|
|
||||||
|
|
||||||
trialIdStr = matchResult.Value;
|
|
||||||
|
|
||||||
var trialStatusStr = await _fusionCache.GetOrSetAsync(CacheKeys.Trial(trialIdStr), _ => CacheHelper.GetTrialStatusAsync(Guid.Parse(trialIdStr), _trialRepository), TimeSpan.FromDays(7));
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(trialStatusStr))
|
|
||||||
{
|
|
||||||
|
|
||||||
//数据库 检查该项目Id不对
|
|
||||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_ReferTrialIdFailed"]));
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//---正则取请求Refer 中trialId 失败,请联系开发人员核查
|
|
||||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_ReferTrialIdFailed"]));
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//使用字符串取 如果是swagger 可能有时取的不对 因为空格的原因
|
|
||||||
//trialIdStr = contentFromBody.Substring(trialIdIndex + "TrialId".Length + 4, 3
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
|
|
||||||
//通过path 或者body 找到trialId 了
|
|
||||||
if (!string.IsNullOrWhiteSpace(trialIdStr))
|
|
||||||
{
|
|
||||||
var trialStatusStr = await _fusionCache.GetOrSetAsync(CacheKeys.Trial(trialIdStr), _ => CacheHelper.GetTrialStatusAsync(Guid.Parse(trialIdStr), _trialRepository), TimeSpan.FromDays(7));
|
|
||||||
|
|
||||||
// 这里是统一拦截 项目有关的操作允许情况(特殊的地方,比如项目配置(有的在多种状态(初始化,ongoing)都可以操作,有的仅仅在Initializing)还有 项目添加和更新,不走这里,特殊处理,不然在这里显得很乱,判断是哪个接口)
|
|
||||||
if (trialStatusStr == StaticData.TrialState.TrialOngoing || _trialOptList.Any(t => t == TrialOpt.BeforeOngoingCantOpt))
|
|
||||||
{
|
|
||||||
|
|
||||||
await next.Invoke();
|
|
||||||
|
|
||||||
}
|
|
||||||
// 项目停止、或者完成 不允许操作
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//---本次请求被配置规则拦截:项目状态处于进行中时,才允许操作,若此处逻辑有误,请联系开发人员修改
|
|
||||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_InterceptedProjectStatusRule"]));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
//添加项目 签名系统文档的时候 不做拦截 但是更新项目 签名项目文档的时候需要拦截
|
|
||||||
else if (_trialOptList.Any(t => t == TrialOpt.AddOrUpdateTrial || t == TrialOpt.SignSystemDocNoTrialId))
|
|
||||||
{
|
|
||||||
await next.Invoke();
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//如果项目相关接口没有传递trialId 会来到这里,提醒,以便修改
|
|
||||||
|
|
||||||
//---该接口参数中,没有传递项目编号,请核对。
|
|
||||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_MissingProjectNumber"]));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+5
-5
@@ -41,19 +41,19 @@ public class LimitUserRequestAuthorizationEndpointFilter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取缓存中的用户 token
|
// 获取缓存中的用户 token
|
||||||
var cacheUserToken = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.UserToken(_userInfo.Id));
|
var cacheUserToken = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.UserToken(_userInfo.IdentityUserId));
|
||||||
|
|
||||||
// 缓存中没有取到 token
|
// 缓存中没有取到 token
|
||||||
if (string.IsNullOrWhiteSpace(cacheUserToken))
|
if (string.IsNullOrWhiteSpace(cacheUserToken))
|
||||||
{
|
{
|
||||||
// 设置当前用户最新 token
|
// 设置当前用户最新 token
|
||||||
await _fusionCache.SetAsync(CacheKeys.UserToken(_userInfo.Id), _userInfo.UserToken, TimeSpan.FromDays(7));
|
await _fusionCache.SetAsync(CacheKeys.UserToken(_userInfo.IdentityUserId), _userInfo.UserToken, TimeSpan.FromDays(7));
|
||||||
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(_userInfo.Id), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(minutes));
|
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(_userInfo.IdentityUserId), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(minutes));
|
||||||
}
|
}
|
||||||
// 如果是同一个用户
|
// 如果是同一个用户
|
||||||
else if (cacheUserToken == _userInfo.UserToken)
|
else if (cacheUserToken == _userInfo.UserToken)
|
||||||
{
|
{
|
||||||
var cacheTime = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.UserAutoLoginOut(_userInfo.Id));
|
var cacheTime = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.UserAutoLoginOut(_userInfo.IdentityUserId));
|
||||||
|
|
||||||
// 如果过期,自动登出
|
// 如果过期,自动登出
|
||||||
if (string.IsNullOrEmpty(cacheTime))
|
if (string.IsNullOrEmpty(cacheTime))
|
||||||
@@ -63,7 +63,7 @@ public class LimitUserRequestAuthorizationEndpointFilter(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(_userInfo.Id), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(minutes));
|
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(_userInfo.IdentityUserId), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(minutes));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ public class SystemEmailSendConfig
|
|||||||
|
|
||||||
public string SiteUrl { get; set; } = string.Empty;
|
public string SiteUrl { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string SystemShortName { get; set; } = string.Empty;
|
||||||
|
|
||||||
public string OrganizationName { get; set; } = string.Empty;
|
public string OrganizationName { get; set; } = string.Empty;
|
||||||
public string OrganizationNameCN { get; set; } = string.Empty;
|
public string OrganizationNameCN { get; set; } = string.Empty;
|
||||||
|
|
||||||
@@ -140,7 +142,7 @@ public static class AppSettings
|
|||||||
case nameof(Doctor):
|
case nameof(Doctor):
|
||||||
return IRaCISBasicConfig.DoctorCodePrefix + codeInt.ToString("D4");
|
return IRaCISBasicConfig.DoctorCodePrefix + codeInt.ToString("D4");
|
||||||
|
|
||||||
case nameof(User):
|
case nameof(IdentityUser):
|
||||||
return IRaCISBasicConfig.UserCodePrefix + codeInt.ToString("D4");
|
return IRaCISBasicConfig.UserCodePrefix + codeInt.ToString("D4");
|
||||||
|
|
||||||
case nameof(QCChallenge):
|
case nameof(QCChallenge):
|
||||||
|
|||||||
@@ -10,5 +10,6 @@ global using Microsoft.Extensions.Localization;
|
|||||||
global using AutoMapper;
|
global using AutoMapper;
|
||||||
global using IRaCIS.Core.Domain.Share;
|
global using IRaCIS.Core.Domain.Share;
|
||||||
global using IRaCIS.Core.Application.BusinessFilter;
|
global using IRaCIS.Core.Application.BusinessFilter;
|
||||||
|
global using IdentityUser = IRaCIS.Core.Domain.Models.IdentityUser;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,18 @@ public static class CacheKeys
|
|||||||
//超时没请求接口自动退出
|
//超时没请求接口自动退出
|
||||||
public static string UserAutoLoginOut(Guid userId) => $"UserAutoLoginOut:{userId}";
|
public static string UserAutoLoginOut(Guid userId) => $"UserAutoLoginOut:{userId}";
|
||||||
|
|
||||||
|
|
||||||
|
public static string UserDisable(Guid userId) => $"UserDisable:{userId}";
|
||||||
|
|
||||||
|
public static string UserRoleDisable(Guid userRoleId) => $"UserRoleDisable:{userRoleId}";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 用户登录错误 限制登录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userName"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string UserLoginError(string userName) => $"login-failures:{userName}";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 跳过阅片
|
/// 跳过阅片
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ using NPOI.SS.UserModel;
|
|||||||
using NPOI.XSSF.UserModel;
|
using NPOI.XSSF.UserModel;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
using Xceed.Document.NET;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service;
|
namespace IRaCIS.Core.Application.Service;
|
||||||
|
|
||||||
@@ -63,7 +64,7 @@ public static class ExcelExportHelper
|
|||||||
foreach (var key in dic.Keys)
|
foreach (var key in dic.Keys)
|
||||||
{
|
{
|
||||||
//是数组 那么找到对应的属性 进行翻译
|
//是数组 那么找到对应的属性 进行翻译
|
||||||
if (dic[key].GetType().GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IList<>)))
|
if (dic[key] != null && dic[key].GetType().GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IList<>)))
|
||||||
{
|
{
|
||||||
|
|
||||||
var newObjList = new List<object>();
|
var newObjList = new List<object>();
|
||||||
@@ -73,39 +74,40 @@ public static class ExcelExportHelper
|
|||||||
{
|
{
|
||||||
var itemDic = item.ConvertToDictionary();
|
var itemDic = item.ConvertToDictionary();
|
||||||
|
|
||||||
//处理集合里面时间类型,根据当前语言将时间转变为字符串
|
////处理集合里面时间类型,根据当前语言将时间转变为字符串
|
||||||
foreach (var itemValuePair in itemDic)
|
//foreach (var itemValuePair in itemDic)
|
||||||
{
|
//{
|
||||||
if (DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result))
|
// // 临床数据 1,1 会变成2024-01-01
|
||||||
{
|
// if (itemValuePair.Value?.ToString().Length > 8 && DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result))
|
||||||
itemDic[itemValuePair.Key] = ExportExcelConverterDate.DateTimeInternationalToString(result);
|
// {
|
||||||
}
|
// itemDic[itemValuePair.Key] = ExportExcelConverterDate.DateTimeInternationalToString(result);
|
||||||
}
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
foreach (var needTranslateProperty in needTranslatePropertyList)
|
foreach (var needTranslateProperty in needTranslatePropertyList)
|
||||||
{
|
{
|
||||||
//翻译的属性依赖其他属性
|
if (itemDic.Keys.Any(t => t == needTranslateProperty.Name))
|
||||||
if (needTranslateProperty.IsTranslateDenpendOtherProperty)
|
|
||||||
{
|
{
|
||||||
if (itemDic[needTranslateProperty.DependPropertyName]?.ToString().ToLower() == needTranslateProperty.DependPropertyValueStr.ToLower())
|
//翻译的属性依赖其他属性
|
||||||
|
if (needTranslateProperty.IsTranslateDenpendOtherProperty)
|
||||||
|
{
|
||||||
|
if (itemDic[needTranslateProperty.DependPropertyName]?.ToString().ToLower() == needTranslateProperty.DependPropertyValueStr.ToLower())
|
||||||
|
{
|
||||||
|
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
|
||||||
|
|
||||||
|
itemDic[needTranslateProperty.Name] = translateDataList[needTranslateProperty.DicParentCode].Where(t => t.Code.ToLower() == beforeValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//普通翻译 或者某一标准翻译
|
||||||
|
else
|
||||||
{
|
{
|
||||||
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
|
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
|
||||||
|
|
||||||
|
|
||||||
itemDic[needTranslateProperty.Name] = translateDataList[needTranslateProperty.DicParentCode].Where(t => t.Code.ToLower() == beforeValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
itemDic[needTranslateProperty.Name] = translateDataList[needTranslateProperty.DicParentCode].Where(t => t.Code.ToLower() == beforeValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//普通翻译 或者某一标准翻译
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
|
|
||||||
|
|
||||||
|
|
||||||
itemDic[needTranslateProperty.Name] = translateDataList[needTranslateProperty.DicParentCode].Where(t => t.Code.ToLower() == beforeValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
itemDic.Add("No", no++);
|
itemDic.Add("No", no++);
|
||||||
@@ -125,6 +127,7 @@ public static class ExcelExportHelper
|
|||||||
|
|
||||||
translateData = dic;
|
translateData = dic;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -162,12 +165,55 @@ public static class ExcelExportHelper
|
|||||||
workbook.RemoveSheetAt(1);
|
workbook.RemoveSheetAt(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
var memoryStream2 = new MemoryStream();
|
//中文替换项目术语
|
||||||
workbook.Write(memoryStream2, true);
|
if (data.TrialObjectNameList?.Count > 0)
|
||||||
|
{
|
||||||
|
var replaceObjectList = data.TrialObjectNameList;
|
||||||
|
|
||||||
|
var sheet = workbook.GetSheetAt(0);
|
||||||
|
|
||||||
|
int rowCount = sheet.PhysicalNumberOfRows;
|
||||||
|
|
||||||
|
for (int rowIndex = 0; rowIndex < rowCount; rowIndex++)
|
||||||
|
{
|
||||||
|
var row = sheet.GetRow(rowIndex);
|
||||||
|
|
||||||
|
if (row != null)
|
||||||
|
{
|
||||||
|
|
||||||
|
var colums = row.LastCellNum;
|
||||||
|
|
||||||
|
for (int colIndex = 0; colIndex < colums; colIndex++)
|
||||||
|
{
|
||||||
|
var cell = row.GetCell(colIndex);
|
||||||
|
|
||||||
|
// 只处理字符串类型的单元格
|
||||||
|
if (cell != null)
|
||||||
|
{
|
||||||
|
var cellValue = cell.StringCellValue;
|
||||||
|
|
||||||
|
var find = replaceObjectList.FirstOrDefault(t => t.Name == cellValue);
|
||||||
|
if (find != null)
|
||||||
|
{
|
||||||
|
cell.SetCellValue(find.TrialName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
using (var memoryStream2 = new MemoryStream())
|
||||||
|
{
|
||||||
|
workbook.Write(memoryStream2, true);
|
||||||
|
|
||||||
|
memoryStream2.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
|
templateStream = memoryStream2;
|
||||||
|
}
|
||||||
|
|
||||||
memoryStream2.Seek(0, SeekOrigin.Begin);
|
|
||||||
|
|
||||||
templateStream = memoryStream2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 文件名称 从sheet里面取
|
// 文件名称 从sheet里面取
|
||||||
@@ -209,13 +255,17 @@ public static class ExcelExportHelper
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int AutoColumnTitleRowIndex { get; set; }
|
public int AutoColumnTitleRowIndex { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 模板列最后的索引
|
||||||
|
/// </summary>
|
||||||
public int TempalteLastColumnIndex { get; set; }
|
public int TempalteLastColumnIndex { get; set; }
|
||||||
|
|
||||||
|
public List<string> CDISCList { get; set; } = new List<string>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 动态的列名
|
/// 动态的列名 如果Id 重复,那么就按照名称填充,否则就按照Id 填充列数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string> ColumnNameList { get; set; } = new List<string>();
|
public List<ColumItem> ColumnIdNameList { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 动态翻译的字典名
|
/// 动态翻译的字典名
|
||||||
@@ -242,7 +292,29 @@ public static class ExcelExportHelper
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string DynamicItemTitleName { get; set; }
|
public string DynamicItemTitleName { get; set; }
|
||||||
|
|
||||||
|
public string DynamicItemTitleId { get; set; }
|
||||||
|
|
||||||
public List<int> RemoveColunmIndexList { get; set; } = new List<int>();
|
public List<int> RemoveColunmIndexList { get; set; } = new List<int>();
|
||||||
|
|
||||||
|
public class ColumItem
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public override bool Equals(object obj)
|
||||||
|
{
|
||||||
|
if (obj is not ColumItem other) return false;
|
||||||
|
return Id == other.Id && Name == other.Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
return HashCode.Combine(Id, Name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<string> ColumnIdList => ColumnIdNameList == null ? new List<string>() : ColumnIdNameList.Select(t => t.Id.ToString()).ToList();
|
||||||
|
public List<string> ColumnNameList => ColumnIdNameList == null ? new List<string>() : ColumnIdNameList.Select(t => t.Name).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -277,7 +349,7 @@ public static class ExcelExportHelper
|
|||||||
foreach (var key in dic.Keys)
|
foreach (var key in dic.Keys)
|
||||||
{
|
{
|
||||||
//是数组 那么找到对应的属性 进行翻译
|
//是数组 那么找到对应的属性 进行翻译
|
||||||
if (dic[key].GetType().GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IList<>)))
|
if (dic[key] != null && dic[key].GetType().GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IList<>)))
|
||||||
//if (dic[key].GetType().IsAssignableFrom(typeof(JArray)))
|
//if (dic[key].GetType().IsAssignableFrom(typeof(JArray)))
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -289,36 +361,40 @@ public static class ExcelExportHelper
|
|||||||
//var itemDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(item.ToJsonNotIgnoreNull());
|
//var itemDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(item.ToJsonNotIgnoreNull());
|
||||||
var itemDic = item.ConvertToDictionary();
|
var itemDic = item.ConvertToDictionary();
|
||||||
|
|
||||||
//处理集合里面时间类型,根据当前语言将时间转变为字符串
|
////处理集合里面时间类型,根据当前语言将时间转变为字符串
|
||||||
foreach (var itemValuePair in itemDic)
|
//foreach (var itemValuePair in itemDic)
|
||||||
{
|
//{
|
||||||
if (DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result))
|
// if (itemValuePair.Value?.ToString().Length > 8 && DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result))
|
||||||
{
|
// {
|
||||||
itemDic[itemValuePair.Key] = ExportExcelConverterDate.DateTimeInternationalToString(result);
|
// itemDic[itemValuePair.Key] = ExportExcelConverterDate.DateTimeInternationalToString(result);
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
foreach (var needTranslateProperty in needTranslatePropertyList)
|
foreach (var needTranslateProperty in needTranslatePropertyList)
|
||||||
{
|
{
|
||||||
//翻译的属性依赖其他属性
|
if (itemDic.Keys.Any(t => t == needTranslateProperty.Name))
|
||||||
if (needTranslateProperty.IsTranslateDenpendOtherProperty)
|
|
||||||
{
|
{
|
||||||
if (itemDic[needTranslateProperty.DependPropertyName]?.ToString().ToLower() == needTranslateProperty.DependPropertyValueStr.ToLower())
|
//翻译的属性依赖其他属性
|
||||||
|
if (needTranslateProperty.IsTranslateDenpendOtherProperty)
|
||||||
|
{
|
||||||
|
if (itemDic[needTranslateProperty.DependPropertyName]?.ToString().ToLower() == needTranslateProperty.DependPropertyValueStr.ToLower())
|
||||||
|
{
|
||||||
|
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
|
||||||
|
|
||||||
|
itemDic[needTranslateProperty.Name] = translateDataList[needTranslateProperty.DicParentCode].Where(t => t.Code.ToLower() == beforeValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//普通翻译 或者某一标准翻译
|
||||||
|
else
|
||||||
{
|
{
|
||||||
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
|
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
|
||||||
|
|
||||||
|
|
||||||
itemDic[needTranslateProperty.Name] = translateDataList[needTranslateProperty.DicParentCode].Where(t => t.Code.ToLower() == beforeValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
itemDic[needTranslateProperty.Name] = translateDataList[needTranslateProperty.DicParentCode].Where(t => t.Code.ToLower() == beforeValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//普通翻译 或者某一标准翻译
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
|
|
||||||
|
|
||||||
|
|
||||||
itemDic[needTranslateProperty.Name] = translateDataList[needTranslateProperty.DicParentCode].Where(t => t.Code.ToLower() == beforeValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -371,27 +447,70 @@ public static class ExcelExportHelper
|
|||||||
workbook.RemoveSheetAt(1);
|
workbook.RemoveSheetAt(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region 中文替换项目术语
|
||||||
|
if (data.TrialObjectNameList?.Count > 0)
|
||||||
|
{
|
||||||
|
var replaceObjectList = data.TrialObjectNameList;
|
||||||
|
|
||||||
|
var sheet = workbook.GetSheetAt(0);
|
||||||
|
|
||||||
|
int rowCount = sheet.PhysicalNumberOfRows;
|
||||||
|
|
||||||
|
for (int rowIndex = 0; rowIndex < rowCount; rowIndex++)
|
||||||
|
{
|
||||||
|
var row = sheet.GetRow(rowIndex);
|
||||||
|
if (row != null)
|
||||||
|
{
|
||||||
|
|
||||||
|
var colums = row.LastCellNum;
|
||||||
|
|
||||||
|
for (int colIndex = 0; colIndex < colums; colIndex++)
|
||||||
|
{
|
||||||
|
var cell = row.GetCell(colIndex);
|
||||||
|
|
||||||
|
// 只处理字符串类型的单元格
|
||||||
|
if (cell != null)
|
||||||
|
{
|
||||||
|
var cellValue = cell.StringCellValue;
|
||||||
|
|
||||||
|
var find = replaceObjectList.FirstOrDefault(t => t.Name == cellValue);
|
||||||
|
if (find != null)
|
||||||
|
{
|
||||||
|
cell.SetCellValue(find.TrialName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (dynamicColumnConfig != null)
|
if (dynamicColumnConfig != null)
|
||||||
{
|
{
|
||||||
|
var isCdics = dynamicColumnConfig.CDISCList.Count > 0;
|
||||||
|
|
||||||
var sheet = workbook.GetSheetAt(0);
|
var sheet = workbook.GetSheetAt(0);
|
||||||
|
|
||||||
|
var cdicsRow = sheet.GetRow(dynamicColumnConfig.AutoColumnTitleRowIndex - 1);
|
||||||
var titelRow = sheet.GetRow(dynamicColumnConfig.AutoColumnTitleRowIndex);
|
var titelRow = sheet.GetRow(dynamicColumnConfig.AutoColumnTitleRowIndex);
|
||||||
var templateRow = sheet.GetRow(dynamicColumnConfig.AutoColumnTitleRowIndex + 1);
|
var templateRow = sheet.GetRow(dynamicColumnConfig.AutoColumnTitleRowIndex + 1);
|
||||||
|
|
||||||
//动态移除列的数量
|
//动态移除列的数量
|
||||||
var dynamicRemoveColunmCount = dynamicColumnConfig.RemoveColunmIndexList.Count();
|
var dynamicRemoveColunmCount = dynamicColumnConfig.RemoveColunmIndexList.Count();
|
||||||
|
|
||||||
|
//在动态列开始前移除的数量
|
||||||
var beforeDynamicRemoveCount = dynamicColumnConfig.RemoveColunmIndexList.Where(t => t < dynamicColumnConfig.AutoColumnStartIndex).Count();
|
var beforeDynamicRemoveCount = dynamicColumnConfig.RemoveColunmIndexList.Where(t => t < dynamicColumnConfig.AutoColumnStartIndex).Count();
|
||||||
|
|
||||||
//动态添加列的数量
|
//动态添加列的数量
|
||||||
var needAddCount = dynamicColumnConfig.ColumnNameList.Count;
|
var needAddCount = dynamicColumnConfig.ColumnIdNameList.Count;
|
||||||
|
|
||||||
//原始表 最终索引
|
//原始表 最终索引
|
||||||
var originTotalEndIndex = dynamicColumnConfig.TempalteLastColumnIndex;
|
var originTotalEndIndex = dynamicColumnConfig.TempalteLastColumnIndex;
|
||||||
|
|
||||||
//减去动态移除后原始结束索引
|
//减去动态移除后原始结束索引
|
||||||
var originRemoveEndIndex= originTotalEndIndex- dynamicRemoveColunmCount;
|
var originRemoveEndIndex = originTotalEndIndex - dynamicRemoveColunmCount;
|
||||||
|
|
||||||
//最终表 动态列开始索引
|
//最终表 动态列开始索引
|
||||||
var dynamicColunmStartIndex = dynamicColumnConfig.AutoColumnStartIndex - beforeDynamicRemoveCount;
|
var dynamicColunmStartIndex = dynamicColumnConfig.AutoColumnStartIndex - beforeDynamicRemoveCount;
|
||||||
@@ -427,8 +546,14 @@ public static class ExcelExportHelper
|
|||||||
//创建新的列
|
//创建新的列
|
||||||
for (int i = originTotalEndIndex; i < originTotalEndIndex + needAddCount; i++)
|
for (int i = originTotalEndIndex; i < originTotalEndIndex + needAddCount; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
titelRow.CreateCell(i + 1);
|
titelRow.CreateCell(i + 1);
|
||||||
templateRow.CreateCell(i + 1);
|
templateRow.CreateCell(i + 1);
|
||||||
|
|
||||||
|
if (isCdics)
|
||||||
|
{
|
||||||
|
cdicsRow.CreateCell(i + 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//移动Title 和下面的模板标识
|
//移动Title 和下面的模板标识
|
||||||
|
|
||||||
@@ -448,9 +573,17 @@ public static class ExcelExportHelper
|
|||||||
|
|
||||||
for (int i = dynamicColunmStartIndex; i < dynamicColunmStartIndex + needAddCount; i++)
|
for (int i = dynamicColunmStartIndex; i < dynamicColunmStartIndex + needAddCount; i++)
|
||||||
{
|
{
|
||||||
var name = dynamicColumnConfig.ColumnNameList[i - dynamicColunmStartIndex];
|
var name = dynamicColumnConfig.ColumnIdNameList[i - dynamicColunmStartIndex].Name;
|
||||||
|
|
||||||
titelRow.GetCell(i).SetCellValue(name);
|
titelRow.GetCell(i).SetCellValue(name);
|
||||||
|
templateRow.GetCell(i).SetCellValue("");
|
||||||
|
|
||||||
|
if (isCdics)
|
||||||
|
{
|
||||||
|
var cdicsCode = dynamicColumnConfig.CDISCList[i - dynamicColunmStartIndex];
|
||||||
|
|
||||||
|
cdicsRow.GetCell(i).SetCellValue(cdicsCode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -463,7 +596,6 @@ public static class ExcelExportHelper
|
|||||||
templateStream = memoryStream2;
|
templateStream = memoryStream2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -483,6 +615,9 @@ public static class ExcelExportHelper
|
|||||||
|
|
||||||
if (dynamicColumnConfig != null)
|
if (dynamicColumnConfig != null)
|
||||||
{
|
{
|
||||||
|
//Excel 列是按照名称填充 还是Id 填充
|
||||||
|
var isExcelAddDataWithName = dynamicColumnConfig.ColumnIdNameList.Select(t => t.Id).Distinct().Count() == 1;
|
||||||
|
|
||||||
var dynamicTranslateDataList = await _dictionaryService.GetBasicDataSelect(dynamicColumnConfig.TranslateDicNameList.ToArray());
|
var dynamicTranslateDataList = await _dictionaryService.GetBasicDataSelect(dynamicColumnConfig.TranslateDicNameList.ToArray());
|
||||||
|
|
||||||
// 使用NPOI 进行二次处理
|
// 使用NPOI 进行二次处理
|
||||||
@@ -513,8 +648,18 @@ public static class ExcelExportHelper
|
|||||||
|
|
||||||
//var writeIndex = itemList.IndexOf(itemObj) + dynamicColumnConfig.AutoColumnStartIndex;
|
//var writeIndex = itemList.IndexOf(itemObj) + dynamicColumnConfig.AutoColumnStartIndex;
|
||||||
|
|
||||||
var writeIndex = dynamicColumnConfig.ColumnNameList.IndexOf(iteObjDic[dynamicColumnConfig.DynamicItemTitleName].ToString()) + dynamicColumnConfig.AutoColumnStartIndex;
|
var writeIndex = 0;
|
||||||
|
|
||||||
|
if (isExcelAddDataWithName)
|
||||||
|
{
|
||||||
|
writeIndex = dynamicColumnConfig.ColumnNameList.IndexOf(iteObjDic[dynamicColumnConfig.DynamicItemTitleName].ToString()) + dynamicColumnConfig.AutoColumnStartIndex;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
writeIndex = dynamicColumnConfig.ColumnIdList.IndexOf(iteObjDic[dynamicColumnConfig.DynamicItemTitleId].ToString()) + dynamicColumnConfig.AutoColumnStartIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (itemDicName.IsNotNullOrEmpty())
|
if (itemDicName.IsNotNullOrEmpty())
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -548,6 +693,332 @@ public static class ExcelExportHelper
|
|||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 暂时废弃--合并到上面
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="code"></param>
|
||||||
|
/// <param name="data"></param>
|
||||||
|
/// <param name="_commonDocumentRepository"></param>
|
||||||
|
/// <param name="_hostEnvironment"></param>
|
||||||
|
/// <param name="_dictionaryService"></param>
|
||||||
|
/// <param name="translateType"></param>
|
||||||
|
/// <param name="criterionType"></param>
|
||||||
|
/// <param name="dynamicColumnConfig"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<(MemoryStream, string)> CDISC_DataExport_Async(string code, ExcelExportInfo data, IRepository<CommonDocument> _commonDocumentRepository, IWebHostEnvironment _hostEnvironment, IDictionaryService? _dictionaryService = null, Type? translateType = null, CriterionType? criterionType = null, DynamicColumnConfig? dynamicColumnConfig = null)
|
||||||
|
{
|
||||||
|
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
||||||
|
//判断是否有字典翻译
|
||||||
|
|
||||||
|
object translateData = data;
|
||||||
|
|
||||||
|
Dictionary<string, object> translatedDic = default;
|
||||||
|
|
||||||
|
if (_dictionaryService != null && translateType != null)
|
||||||
|
{
|
||||||
|
|
||||||
|
//一个值 对应不同的字典翻译
|
||||||
|
var needTranslatePropertyList = translateType.GetProperties().Where(t => t.IsDefined(typeof(DictionaryTranslateAttribute), true))
|
||||||
|
.SelectMany(c =>
|
||||||
|
c.GetCustomAttributes(typeof(DictionaryTranslateAttribute), false).Select(f => (DictionaryTranslateAttribute?)f).Where(t => t.CriterionType == criterionType || t.CriterionType == null)
|
||||||
|
.Select(k => new { c.Name, k.DicParentCode, k.IsTranslateDenpendOtherProperty, k.DependPropertyName, k.DependPropertyValueStr })
|
||||||
|
).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//字典表查询出所有需要翻译的数据
|
||||||
|
|
||||||
|
var translateDataList = await _dictionaryService.GetBasicDataSelect(needTranslatePropertyList.Select(t => t.DicParentCode).Distinct().ToArray());
|
||||||
|
|
||||||
|
var dic = data.ConvertToDictionary();
|
||||||
|
//var dic = (JsonConvert.DeserializeObject<IDictionary<string, object>>(data.ToJsonNotIgnoreNull())).IfNullThrowException();
|
||||||
|
|
||||||
|
foreach (var key in dic.Keys)
|
||||||
|
{
|
||||||
|
//是数组 那么找到对应的属性 进行翻译
|
||||||
|
if (dic[key] != null && dic[key].GetType().GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IList<>)))
|
||||||
|
//if (dic[key].GetType().IsAssignableFrom(typeof(JArray)))
|
||||||
|
{
|
||||||
|
|
||||||
|
var newObjList = new List<object>();
|
||||||
|
var no = 1;
|
||||||
|
foreach (var item in dic[key] as IList)
|
||||||
|
//foreach (var item in dic[key] as JArray)
|
||||||
|
{
|
||||||
|
//var itemDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(item.ToJsonNotIgnoreNull());
|
||||||
|
var itemDic = item.ConvertToDictionary();
|
||||||
|
|
||||||
|
foreach (var needTranslateProperty in needTranslatePropertyList)
|
||||||
|
{
|
||||||
|
if (itemDic.Keys.Any(t => t == needTranslateProperty.Name))
|
||||||
|
{
|
||||||
|
//翻译的属性依赖其他属性
|
||||||
|
if (needTranslateProperty.IsTranslateDenpendOtherProperty)
|
||||||
|
{
|
||||||
|
if (itemDic[needTranslateProperty.DependPropertyName]?.ToString().ToLower() == needTranslateProperty.DependPropertyValueStr.ToLower())
|
||||||
|
{
|
||||||
|
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
|
||||||
|
|
||||||
|
itemDic[needTranslateProperty.Name] = translateDataList[needTranslateProperty.DicParentCode].Where(t => t.Code.ToLower() == beforeValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//普通翻译 或者某一标准翻译
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
|
||||||
|
|
||||||
|
|
||||||
|
itemDic[needTranslateProperty.Name] = translateDataList[needTranslateProperty.DicParentCode].Where(t => t.Code.ToLower() == beforeValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
itemDic.Add("No", no++);
|
||||||
|
newObjList.Add(itemDic);
|
||||||
|
}
|
||||||
|
|
||||||
|
dic[key] = newObjList;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//data = dic;
|
||||||
|
translateData = dic;
|
||||||
|
translatedDic = dic;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var (physicalPath, fileName) = await FileStoreHelper.GetCommonDocPhysicalFilePathAsync(_hostEnvironment, _commonDocumentRepository, code);
|
||||||
|
|
||||||
|
|
||||||
|
//模板路径
|
||||||
|
var tplPath = physicalPath;
|
||||||
|
|
||||||
|
#region 根据中英文 删除模板sheet
|
||||||
|
|
||||||
|
// 打开模板文件
|
||||||
|
var templateFile = new FileStream(tplPath, FileMode.Open, FileAccess.Read);
|
||||||
|
|
||||||
|
// 获取文件流
|
||||||
|
var templateStream = new MemoryStream();
|
||||||
|
templateFile.CopyTo(templateStream);
|
||||||
|
templateStream.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
|
var workbook = new XSSFWorkbook(templateStream);
|
||||||
|
|
||||||
|
int sheetCount = workbook.NumberOfSheets;
|
||||||
|
|
||||||
|
if (sheetCount == 2)
|
||||||
|
{
|
||||||
|
if (isEn_US)
|
||||||
|
{
|
||||||
|
workbook.RemoveSheetAt(0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
workbook.RemoveSheetAt(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dynamicColumnConfig != null)
|
||||||
|
{
|
||||||
|
var sheet = workbook.GetSheetAt(0);
|
||||||
|
|
||||||
|
|
||||||
|
var cdicsRow = sheet.GetRow(dynamicColumnConfig.AutoColumnTitleRowIndex - 1);
|
||||||
|
var titelRow = sheet.GetRow(dynamicColumnConfig.AutoColumnTitleRowIndex);
|
||||||
|
var templateRow = sheet.GetRow(dynamicColumnConfig.AutoColumnTitleRowIndex + 1);
|
||||||
|
|
||||||
|
//动态移除列的数量
|
||||||
|
var dynamicRemoveColunmCount = dynamicColumnConfig.RemoveColunmIndexList.Count();
|
||||||
|
|
||||||
|
//在动态列开始前移除的数量
|
||||||
|
var beforeDynamicRemoveCount = dynamicColumnConfig.RemoveColunmIndexList.Where(t => t < dynamicColumnConfig.AutoColumnStartIndex).Count();
|
||||||
|
|
||||||
|
//动态添加列的数量
|
||||||
|
var needAddCount = dynamicColumnConfig.ColumnIdNameList.Count;
|
||||||
|
|
||||||
|
//原始表 最终索引
|
||||||
|
var originTotalEndIndex = dynamicColumnConfig.TempalteLastColumnIndex;
|
||||||
|
|
||||||
|
//减去动态移除后原始结束索引
|
||||||
|
var originRemoveEndIndex = originTotalEndIndex - dynamicRemoveColunmCount;
|
||||||
|
|
||||||
|
//最终表 动态列开始索引
|
||||||
|
var dynamicColunmStartIndex = dynamicColumnConfig.AutoColumnStartIndex - beforeDynamicRemoveCount;
|
||||||
|
|
||||||
|
//最终表 动态列的终止索引
|
||||||
|
var dynamicColunmEndIndex = dynamicColunmStartIndex + needAddCount - 1;
|
||||||
|
|
||||||
|
//最终表 最终索引
|
||||||
|
var totalColunmEndIndex = originTotalEndIndex + needAddCount - dynamicRemoveColunmCount;
|
||||||
|
|
||||||
|
|
||||||
|
//动态列后需要移动的数量
|
||||||
|
var backMoveCount = totalColunmEndIndex - dynamicColunmEndIndex;
|
||||||
|
|
||||||
|
//删除需要动态删除的列 从大到小移除,否则索引会变
|
||||||
|
foreach (var removeIndex in dynamicColumnConfig.RemoveColunmIndexList.OrderByDescending(t => t))
|
||||||
|
{
|
||||||
|
//将后面的列向前移动
|
||||||
|
for (var i = 0; i < originTotalEndIndex - removeIndex; i++)
|
||||||
|
{
|
||||||
|
Console.WriteLine(titelRow.GetCell(removeIndex + i + 1).StringCellValue);
|
||||||
|
titelRow.GetCell(removeIndex + i).SetCellValue(titelRow.GetCell(removeIndex + i + 1).StringCellValue);
|
||||||
|
templateRow.GetCell(removeIndex + i).SetCellValue(templateRow.GetCell(removeIndex + i + 1).StringCellValue);
|
||||||
|
|
||||||
|
//后面的数据要清空
|
||||||
|
titelRow.GetCell(removeIndex + i + 1).SetCellValue("");
|
||||||
|
templateRow.GetCell(removeIndex + i + 1).SetCellValue("");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//创建新的列
|
||||||
|
for (int i = originTotalEndIndex; i < originTotalEndIndex + needAddCount; i++)
|
||||||
|
{
|
||||||
|
cdicsRow.CreateCell(i + 1);
|
||||||
|
titelRow.CreateCell(i + 1);
|
||||||
|
templateRow.CreateCell(i + 1);
|
||||||
|
}
|
||||||
|
//移动Title 和下面的模板标识
|
||||||
|
|
||||||
|
var gap = totalColunmEndIndex - originRemoveEndIndex;
|
||||||
|
|
||||||
|
for (int i = totalColunmEndIndex; i > dynamicColunmEndIndex; i--)
|
||||||
|
{
|
||||||
|
|
||||||
|
titelRow.GetCell(i).SetCellValue(titelRow.GetCell(i - gap).StringCellValue);
|
||||||
|
|
||||||
|
templateRow.GetCell(i).SetCellValue(templateRow.GetCell(i - gap).StringCellValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//设置动态Tilte
|
||||||
|
|
||||||
|
for (int i = dynamicColunmStartIndex; i < dynamicColunmStartIndex + needAddCount; i++)
|
||||||
|
{
|
||||||
|
var name = dynamicColumnConfig.ColumnIdNameList[i - dynamicColunmStartIndex].Name;
|
||||||
|
|
||||||
|
var cdicsCode = dynamicColumnConfig.CDISCList[i - dynamicColunmStartIndex];
|
||||||
|
|
||||||
|
cdicsRow.GetCell(i).SetCellValue(cdicsCode);
|
||||||
|
titelRow.GetCell(i).SetCellValue(name);
|
||||||
|
templateRow.GetCell(i).SetCellValue("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
using (var memoryStream2 = new MemoryStream())
|
||||||
|
{
|
||||||
|
workbook.Write(memoryStream2, true);
|
||||||
|
|
||||||
|
memoryStream2.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
|
templateStream = memoryStream2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region MiniExcel
|
||||||
|
|
||||||
|
var memoryStream = new MemoryStream();
|
||||||
|
|
||||||
|
var config = new OpenXmlConfiguration()
|
||||||
|
{
|
||||||
|
IgnoreTemplateParameterMissing = true,
|
||||||
|
};
|
||||||
|
|
||||||
|
await MiniExcel.SaveAsByTemplateAsync(memoryStream, templateStream.ToArray(), translateData, config);
|
||||||
|
|
||||||
|
memoryStream.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
|
if (dynamicColumnConfig != null)
|
||||||
|
{
|
||||||
|
var isExcelAddDataWithName = dynamicColumnConfig.ColumnIdNameList.Select(t => t.Id).Count() == 1;
|
||||||
|
|
||||||
|
var dynamicTranslateDataList = await _dictionaryService.GetBasicDataSelect(dynamicColumnConfig.TranslateDicNameList.ToArray());
|
||||||
|
|
||||||
|
// 使用NPOI 进行二次处理
|
||||||
|
var wb = new XSSFWorkbook(memoryStream);
|
||||||
|
var sheet = wb.GetSheetAt(0);
|
||||||
|
|
||||||
|
var list = translatedDic["List"] as IList;
|
||||||
|
|
||||||
|
foreach (var itemResult in list)
|
||||||
|
{
|
||||||
|
var index = list.IndexOf(itemResult);
|
||||||
|
|
||||||
|
//从第四行开始处理动态列
|
||||||
|
var row = sheet.GetRow(index + dynamicColumnConfig.AutoColumnTitleRowIndex + 1);
|
||||||
|
|
||||||
|
var itemDic = itemResult.ToDictionary();
|
||||||
|
|
||||||
|
var itemList = itemDic[dynamicColumnConfig.DynamicListName] as IList;
|
||||||
|
|
||||||
|
//这个数组是动态的,有的多,有的少,所以在此对比Title 一致才赋值
|
||||||
|
foreach (var itemObj in itemList)
|
||||||
|
{
|
||||||
|
|
||||||
|
var iteObjDic = itemObj.ToDictionary();
|
||||||
|
|
||||||
|
var itemDicName = iteObjDic[dynamicColumnConfig.DynamicItemDicName]?.ToString();
|
||||||
|
var itemValue = iteObjDic[dynamicColumnConfig.DynamicItemValueName]?.ToString();
|
||||||
|
|
||||||
|
//var writeIndex = itemList.IndexOf(itemObj) + dynamicColumnConfig.AutoColumnStartIndex;
|
||||||
|
|
||||||
|
var writeIndex = 0;
|
||||||
|
if (isExcelAddDataWithName)
|
||||||
|
{
|
||||||
|
writeIndex = dynamicColumnConfig.ColumnNameList.IndexOf(iteObjDic[dynamicColumnConfig.DynamicItemTitleName].ToString()) + dynamicColumnConfig.AutoColumnStartIndex;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
writeIndex = dynamicColumnConfig.ColumnIdList.IndexOf(iteObjDic[dynamicColumnConfig.DynamicItemTitleId].ToString()) + dynamicColumnConfig.AutoColumnStartIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemDicName.IsNotNullOrEmpty())
|
||||||
|
{
|
||||||
|
|
||||||
|
var translatedItemData = dynamicTranslateDataList[itemDicName].Where(t => t.Code.ToLower() == itemValue?.ToLower()).Select(t => isEn_US ? t.Value : t.ValueCN).FirstOrDefault() ?? String.Empty;
|
||||||
|
|
||||||
|
row.GetCell(writeIndex).SetCellValue(translatedItemData);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
row.GetCell(writeIndex).SetCellValue(itemValue);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var memoryStream2 = new MemoryStream();
|
||||||
|
wb.Write(memoryStream2, true);
|
||||||
|
memoryStream2.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
|
memoryStream = memoryStream2;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return (memoryStream, fileName);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 导出文件模板
|
/// 导出文件模板
|
||||||
|
|||||||
@@ -73,6 +73,12 @@ namespace IRaCIS.Core.Application.Helper
|
|||||||
case EmailBusinessScenario.QCToCRCImageQuestion:
|
case EmailBusinessScenario.QCToCRCImageQuestion:
|
||||||
HangfireJobHelper.AddOrUpdateCronJob<IMediator>(jobId, t => t.Send(new QCImageQuestionRecurringEvent() { TrialId = trialId }, default), emailCron);
|
HangfireJobHelper.AddOrUpdateCronJob<IMediator>(jobId, t => t.Send(new QCImageQuestionRecurringEvent() { TrialId = trialId }, default), emailCron);
|
||||||
break;
|
break;
|
||||||
|
//加急阅片 10分钟
|
||||||
|
case EmailBusinessScenario.ExpeditedReading:
|
||||||
|
HangfireJobHelper.AddOrUpdateCronJob<IMediator>(jobId, t => t.Send(new UrgentIRUnReadTaskRecurringEvent() { TrialId = trialId }, default), emailCron);
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using AlibabaCloud.SDK.Sts20150401;
|
using AlibabaCloud.SDK.Sts20150401;
|
||||||
using Aliyun.OSS;
|
using Aliyun.OSS;
|
||||||
|
using Aliyun.OSS.Common;
|
||||||
using Amazon;
|
using Amazon;
|
||||||
using Amazon.Runtime;
|
using Amazon.Runtime;
|
||||||
using Amazon.S3;
|
using Amazon.S3;
|
||||||
@@ -9,9 +10,12 @@ using Amazon.SecurityToken.Model;
|
|||||||
using IRaCIS.Core.Infrastructure;
|
using IRaCIS.Core.Infrastructure;
|
||||||
using IRaCIS.Core.Infrastructure.NewtonsoftJson;
|
using IRaCIS.Core.Infrastructure.NewtonsoftJson;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
|
using MassTransit.Caching.Internals;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using Minio;
|
using Minio;
|
||||||
|
using Minio.DataModel;
|
||||||
using Minio.DataModel.Args;
|
using Minio.DataModel.Args;
|
||||||
|
using Minio.Exceptions;
|
||||||
using System.Reactive.Linq;
|
using System.Reactive.Linq;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
@@ -59,7 +63,7 @@ public class AliyunOSSOptions
|
|||||||
|
|
||||||
public int DurationSeconds { get; set; }
|
public int DurationSeconds { get; set; }
|
||||||
|
|
||||||
|
public string PreviewEndpoint { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,6 +109,7 @@ public class AliyunOSSTempToken
|
|||||||
public string SecurityToken { get; set; }
|
public string SecurityToken { get; set; }
|
||||||
public DateTime Expiration { get; set; }
|
public DateTime Expiration { get; set; }
|
||||||
|
|
||||||
|
public string PreviewEndpoint { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,9 +148,17 @@ public interface IOSSService
|
|||||||
|
|
||||||
public Task<string> GetSignedUrl(string ossRelativePath);
|
public Task<string> GetSignedUrl(string ossRelativePath);
|
||||||
|
|
||||||
public Task DeleteFromPrefix(string prefix);
|
public Task DeleteFromPrefix(string prefix, bool isCache = false);
|
||||||
|
|
||||||
|
public Task DeleteObjects(List<string> objectKeys);
|
||||||
|
|
||||||
|
List<string> GetRootFolderNames();
|
||||||
|
|
||||||
public ObjectStoreDTO GetObjectStoreTempToken();
|
public ObjectStoreDTO GetObjectStoreTempToken();
|
||||||
|
|
||||||
|
public Task MoveObject(string sourcePath, string destPath, bool overwrite = true);
|
||||||
|
|
||||||
|
public Task<long> GetObjectSizeAsync(string sourcePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -526,12 +539,240 @@ public class OSSService : IOSSService
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 移动OSS文件到新路径
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sourcePath">原文件路径(格式:bucket/key)</param>
|
||||||
|
/// <param name="destPath">新文件路径(格式:bucket/key)</param>
|
||||||
|
/// <param name="overwrite">是否覆盖已存在的目标文件(默认true)</param>
|
||||||
|
public async Task MoveObject(string sourcePath, string destPath, bool overwrite = true)
|
||||||
|
{
|
||||||
|
GetObjectStoreTempToken();
|
||||||
|
|
||||||
|
switch (ObjectStoreServiceOptions.ObjectStoreUse)
|
||||||
|
{
|
||||||
|
case "AliyunOSS":
|
||||||
|
#region 阿里云
|
||||||
|
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
||||||
|
var client = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.EndPoint : aliConfig.InternalEndpoint, AliyunOSSTempToken.AccessKeyId, AliyunOSSTempToken.AccessKeySecret, AliyunOSSTempToken.SecurityToken);
|
||||||
|
if (sourcePath.StartsWith("/"))
|
||||||
|
{
|
||||||
|
sourcePath = sourcePath.Substring(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (destPath.StartsWith("/"))
|
||||||
|
{
|
||||||
|
destPath = destPath.Substring(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
var sourceBucket = aliConfig.BucketName;
|
||||||
|
var sourceKey = sourcePath;
|
||||||
|
|
||||||
|
var destBucket = aliConfig.BucketName;
|
||||||
|
|
||||||
|
var destKey = destPath;
|
||||||
|
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 检查目标是否存在(当不允许覆盖时)
|
||||||
|
if (!overwrite && client.DoesObjectExist(destBucket, destKey))
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("File Exist");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//var copyRequest = new Aliyun.OSS.CopyObjectRequest(sourceBucket, sourceKey, sourceBucket, destKey);
|
||||||
|
//var result = client.CopyObject(copyRequest);
|
||||||
|
|
||||||
|
//// 2. 删除原文件(可选,根据是否需要保留原文件)
|
||||||
|
//client.DeleteObject(sourceBucket, sourceKey);
|
||||||
|
|
||||||
|
// 执行复制
|
||||||
|
var copyRequestAli = new Aliyun.OSS.CopyObjectRequest(
|
||||||
|
sourceBucket, sourceKey,
|
||||||
|
destBucket, destKey);
|
||||||
|
|
||||||
|
// 保持原文件元数据
|
||||||
|
copyRequestAli.NewObjectMetadata = new ObjectMetadata
|
||||||
|
{
|
||||||
|
ContentType = client.GetObjectMetadata(sourceBucket, sourceKey).ContentType
|
||||||
|
};
|
||||||
|
|
||||||
|
var result = client.CopyObject(copyRequestAli);
|
||||||
|
|
||||||
|
// 删除原文件(仅在复制成功后)
|
||||||
|
client.DeleteObject(sourceBucket, sourceKey);
|
||||||
|
}
|
||||||
|
catch (OssException ex)
|
||||||
|
{
|
||||||
|
throw new Exception($"[{ex.ErrorCode}] {ex.Message}", ex);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "MinIO":
|
||||||
|
#region MinIO
|
||||||
|
var minIOConfig = ObjectStoreServiceOptions.MinIO;
|
||||||
|
var minioClient = new MinioClient()
|
||||||
|
.WithEndpoint($"{minIOConfig.EndPoint}:{minIOConfig.Port}")
|
||||||
|
.WithCredentials(minIOConfig.AccessKeyId, minIOConfig.SecretAccessKey)
|
||||||
|
.WithSSL(minIOConfig.UseSSL)
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
// 定义源路径和目标路径
|
||||||
|
string destinationKey = "b路径/文件名";
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 1. 复制文件到新路径[2,5](@ref)
|
||||||
|
using (var memoryStream = new MemoryStream())
|
||||||
|
{
|
||||||
|
// 下载源文件流
|
||||||
|
await minioClient.GetObjectAsync(new GetObjectArgs()
|
||||||
|
.WithBucket(minIOConfig.BucketName)
|
||||||
|
.WithObject(sourcePath)
|
||||||
|
.WithCallbackStream(stream => stream.CopyTo(memoryStream)));
|
||||||
|
|
||||||
|
memoryStream.Position = 0; // 重置流位置
|
||||||
|
|
||||||
|
// 上传到新路径
|
||||||
|
await minioClient.PutObjectAsync(new PutObjectArgs()
|
||||||
|
.WithBucket(minIOConfig.BucketName)
|
||||||
|
.WithObject(destinationKey)
|
||||||
|
.WithStreamData(memoryStream)
|
||||||
|
.WithObjectSize(memoryStream.Length));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 删除原文件[1,6](@ref)
|
||||||
|
await minioClient.RemoveObjectAsync(new RemoveObjectArgs()
|
||||||
|
.WithBucket(minIOConfig.BucketName)
|
||||||
|
.WithObject(sourcePath));
|
||||||
|
}
|
||||||
|
catch (MinioException ex)
|
||||||
|
{
|
||||||
|
// 处理异常(例如:记录日志或抛出)
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "AWS":
|
||||||
|
#region AWS
|
||||||
|
var awsConfig = ObjectStoreServiceOptions.AWS;
|
||||||
|
|
||||||
|
var credentials = new SessionAWSCredentials(
|
||||||
|
AWSTempToken.AccessKeyId,
|
||||||
|
AWSTempToken.SecretAccessKey,
|
||||||
|
AWSTempToken.SessionToken
|
||||||
|
);
|
||||||
|
|
||||||
|
var clientConfig = new AmazonS3Config
|
||||||
|
{
|
||||||
|
RegionEndpoint = RegionEndpoint.USEast1,
|
||||||
|
UseHttp = true,
|
||||||
|
};
|
||||||
|
|
||||||
|
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
||||||
|
|
||||||
|
// 定义原路径和目标路径
|
||||||
|
|
||||||
|
|
||||||
|
// 1. 复制对象到新路径
|
||||||
|
var copyRequest = new Amazon.S3.Model.CopyObjectRequest
|
||||||
|
{
|
||||||
|
SourceBucket = awsConfig.BucketName,
|
||||||
|
SourceKey = sourcePath,
|
||||||
|
DestinationBucket = awsConfig.BucketName,
|
||||||
|
DestinationKey = destPath
|
||||||
|
};
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 执行复制操作
|
||||||
|
await amazonS3Client.CopyObjectAsync(copyRequest);
|
||||||
|
|
||||||
|
// 2. 删除原对象
|
||||||
|
var deleteRequest = new Amazon.S3.Model.DeleteObjectRequest
|
||||||
|
{
|
||||||
|
BucketName = awsConfig.BucketName,
|
||||||
|
Key = sourcePath
|
||||||
|
};
|
||||||
|
await amazonS3Client.DeleteObjectAsync(deleteRequest);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (AmazonS3Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"ERROR: {ex.Message}");
|
||||||
|
// 可根据异常类型细化处理(如文件不存在、权限问题等)
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new BusinessValidationFailedException("ERROR");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取所有根目录名称
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<string> GetRootFolderNames()
|
||||||
|
{
|
||||||
|
GetObjectStoreTempToken();
|
||||||
|
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
||||||
|
var _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.EndPoint : aliConfig.InternalEndpoint,
|
||||||
|
AliyunOSSTempToken.AccessKeyId,
|
||||||
|
AliyunOSSTempToken.AccessKeySecret,
|
||||||
|
AliyunOSSTempToken.SecurityToken);
|
||||||
|
|
||||||
|
List<string> rootFolders = new List<string>();
|
||||||
|
string nextMarker = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ObjectListing objectListing = null;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
// 列出根目录下的对象和文件夹
|
||||||
|
objectListing = _ossClient.ListObjects(new Aliyun.OSS.ListObjectsRequest(aliConfig.BucketName)
|
||||||
|
{
|
||||||
|
|
||||||
|
MaxKeys = 1000,
|
||||||
|
Marker = nextMarker,
|
||||||
|
Delimiter = "/" // 使用分隔符来模拟文件夹
|
||||||
|
});
|
||||||
|
|
||||||
|
// 遍历 CommonPrefixes 获取根文件夹名称
|
||||||
|
foreach (var prefix in objectListing.CommonPrefixes)
|
||||||
|
{
|
||||||
|
rootFolders.Add(prefix.TrimEnd('/')); // 去掉末尾的斜杠
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置 NextMarker 以获取下一页的数据
|
||||||
|
nextMarker = objectListing.NextMarker;
|
||||||
|
|
||||||
|
} while (objectListing.IsTruncated);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Error: {ex.Message}");
|
||||||
|
}
|
||||||
|
|
||||||
|
return rootFolders;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 删除某个目录的文件
|
/// 删除某个目录的文件
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="prefix"></param>
|
/// <param name="prefix"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task DeleteFromPrefix(string prefix)
|
public async Task DeleteFromPrefix(string prefix, bool isCache = false)
|
||||||
{
|
{
|
||||||
GetObjectStoreTempToken();
|
GetObjectStoreTempToken();
|
||||||
|
|
||||||
@@ -541,6 +782,21 @@ public class OSSService : IOSSService
|
|||||||
|
|
||||||
var _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.EndPoint : aliConfig.InternalEndpoint, AliyunOSSTempToken.AccessKeyId, AliyunOSSTempToken.AccessKeySecret, AliyunOSSTempToken.SecurityToken);
|
var _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.EndPoint : aliConfig.InternalEndpoint, AliyunOSSTempToken.AccessKeyId, AliyunOSSTempToken.AccessKeySecret, AliyunOSSTempToken.SecurityToken);
|
||||||
|
|
||||||
|
var bucketName = string.Empty;
|
||||||
|
|
||||||
|
if (isCache)
|
||||||
|
{
|
||||||
|
Uri uri = new Uri(aliConfig.ViewEndpoint);
|
||||||
|
string host = uri.Host; // 获取 "zy-irc-test-dev-cache.oss-cn-shanghai.aliyuncs.com"
|
||||||
|
string[] parts = host.Split('.');
|
||||||
|
bucketName = parts[0];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bucketName = aliConfig.BucketName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -549,7 +805,7 @@ public class OSSService : IOSSService
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
// 使用 prefix 模拟目录结构,设置 MaxKeys 和 NextMarker
|
// 使用 prefix 模拟目录结构,设置 MaxKeys 和 NextMarker
|
||||||
objectListing = _ossClient.ListObjects(new Aliyun.OSS.ListObjectsRequest(aliConfig.BucketName)
|
objectListing = _ossClient.ListObjects(new Aliyun.OSS.ListObjectsRequest(bucketName)
|
||||||
{
|
{
|
||||||
Prefix = prefix,
|
Prefix = prefix,
|
||||||
MaxKeys = 1000,
|
MaxKeys = 1000,
|
||||||
@@ -561,7 +817,7 @@ public class OSSService : IOSSService
|
|||||||
// 删除获取到的文件
|
// 删除获取到的文件
|
||||||
if (keys.Count > 0)
|
if (keys.Count > 0)
|
||||||
{
|
{
|
||||||
_ossClient.DeleteObjects(new Aliyun.OSS.DeleteObjectsRequest(aliConfig.BucketName, keys, false));
|
_ossClient.DeleteObjects(new Aliyun.OSS.DeleteObjectsRequest(bucketName, keys, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置 NextMarker 以获取下一页的数据
|
// 设置 NextMarker 以获取下一页的数据
|
||||||
@@ -618,7 +874,6 @@ public class OSSService : IOSSService
|
|||||||
|
|
||||||
var awsConfig = ObjectStoreServiceOptions.AWS;
|
var awsConfig = ObjectStoreServiceOptions.AWS;
|
||||||
|
|
||||||
|
|
||||||
// 提供awsAccessKeyId和awsSecretAccessKey构造凭证
|
// 提供awsAccessKeyId和awsSecretAccessKey构造凭证
|
||||||
var credentials = new SessionAWSCredentials(AWSTempToken.AccessKeyId, AWSTempToken.SecretAccessKey, AWSTempToken.SessionToken);
|
var credentials = new SessionAWSCredentials(AWSTempToken.AccessKeyId, AWSTempToken.SecretAccessKey, AWSTempToken.SessionToken);
|
||||||
|
|
||||||
@@ -670,6 +925,159 @@ public class OSSService : IOSSService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task DeleteObjects(List<string> objectKeys)
|
||||||
|
{
|
||||||
|
GetObjectStoreTempToken();
|
||||||
|
|
||||||
|
if (ObjectStoreServiceOptions.ObjectStoreUse == "AliyunOSS")
|
||||||
|
{
|
||||||
|
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
||||||
|
|
||||||
|
var _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.EndPoint : aliConfig.InternalEndpoint, AliyunOSSTempToken.AccessKeyId, AliyunOSSTempToken.AccessKeySecret, AliyunOSSTempToken.SecurityToken);
|
||||||
|
|
||||||
|
if (objectKeys.Count > 0)
|
||||||
|
{
|
||||||
|
var result = _ossClient.DeleteObjects(new Aliyun.OSS.DeleteObjectsRequest(aliConfig.BucketName, objectKeys, false));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (ObjectStoreServiceOptions.ObjectStoreUse == "MinIO")
|
||||||
|
{
|
||||||
|
var minIOConfig = ObjectStoreServiceOptions.MinIO;
|
||||||
|
|
||||||
|
|
||||||
|
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.EndPoint}:{minIOConfig.Port}")
|
||||||
|
.WithCredentials(minIOConfig.AccessKeyId, minIOConfig.SecretAccessKey).WithSSL(minIOConfig.UseSSL)
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
|
||||||
|
if (objectKeys.Count > 0)
|
||||||
|
{
|
||||||
|
var objArgs = new RemoveObjectsArgs()
|
||||||
|
.WithBucket(minIOConfig.BucketName)
|
||||||
|
.WithObjects(objectKeys);
|
||||||
|
|
||||||
|
// 删除对象
|
||||||
|
await minioClient.RemoveObjectsAsync(objArgs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (ObjectStoreServiceOptions.ObjectStoreUse == "AWS")
|
||||||
|
{
|
||||||
|
|
||||||
|
var awsConfig = ObjectStoreServiceOptions.AWS;
|
||||||
|
|
||||||
|
|
||||||
|
// 提供awsAccessKeyId和awsSecretAccessKey构造凭证
|
||||||
|
var credentials = new SessionAWSCredentials(AWSTempToken.AccessKeyId, AWSTempToken.SecretAccessKey, AWSTempToken.SessionToken);
|
||||||
|
|
||||||
|
//提供awsEndPoint(域名)进行访问配置
|
||||||
|
var clientConfig = new AmazonS3Config
|
||||||
|
{
|
||||||
|
RegionEndpoint = RegionEndpoint.USEast1,
|
||||||
|
UseHttp = true,
|
||||||
|
};
|
||||||
|
|
||||||
|
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
||||||
|
|
||||||
|
if (objectKeys.Count > 0)
|
||||||
|
{
|
||||||
|
// 准备删除请求
|
||||||
|
var deleteObjectsRequest = new Amazon.S3.Model.DeleteObjectsRequest
|
||||||
|
{
|
||||||
|
BucketName = awsConfig.BucketName,
|
||||||
|
Objects = objectKeys.Select(t => new KeyVersion() { Key = t }).ToList()
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 批量删除对象
|
||||||
|
var deleteObjectsResponse = await amazonS3Client.DeleteObjectsAsync(deleteObjectsRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("未定义的存储介质类型");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool isFirstCall = true;
|
||||||
|
public async Task<long> GetObjectSizeAsync(string sourcePath)
|
||||||
|
{
|
||||||
|
if (isFirstCall)
|
||||||
|
{
|
||||||
|
GetObjectStoreTempToken();
|
||||||
|
isFirstCall = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var objectkey = sourcePath.Trim('/');
|
||||||
|
|
||||||
|
if (ObjectStoreServiceOptions.ObjectStoreUse == "AliyunOSS")
|
||||||
|
{
|
||||||
|
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
||||||
|
|
||||||
|
var _ossClient = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.EndPoint : aliConfig.InternalEndpoint, AliyunOSSTempToken.AccessKeyId, AliyunOSSTempToken.AccessKeySecret, AliyunOSSTempToken.SecurityToken);
|
||||||
|
|
||||||
|
var metadata = _ossClient.GetObjectMetadata(aliConfig.BucketName, objectkey);
|
||||||
|
|
||||||
|
long fileSize = metadata.ContentLength; // 文件大小(字节)
|
||||||
|
|
||||||
|
return fileSize;
|
||||||
|
}
|
||||||
|
else if (ObjectStoreServiceOptions.ObjectStoreUse == "MinIO")
|
||||||
|
{
|
||||||
|
var minIOConfig = ObjectStoreServiceOptions.MinIO;
|
||||||
|
|
||||||
|
|
||||||
|
var minioClient = new MinioClient().WithEndpoint($"{minIOConfig.EndPoint}:{minIOConfig.Port}")
|
||||||
|
.WithCredentials(minIOConfig.AccessKeyId, minIOConfig.SecretAccessKey).WithSSL(minIOConfig.UseSSL)
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
|
||||||
|
var stat = await minioClient.StatObjectAsync(new Minio.DataModel.Args.StatObjectArgs()
|
||||||
|
.WithBucket(minIOConfig.BucketName)
|
||||||
|
.WithObject(objectkey));
|
||||||
|
|
||||||
|
return stat.Size; // 文件大小(字节)
|
||||||
|
}
|
||||||
|
else if (ObjectStoreServiceOptions.ObjectStoreUse == "AWS")
|
||||||
|
{
|
||||||
|
|
||||||
|
var awsConfig = ObjectStoreServiceOptions.AWS;
|
||||||
|
|
||||||
|
|
||||||
|
// 提供awsAccessKeyId和awsSecretAccessKey构造凭证
|
||||||
|
var credentials = new SessionAWSCredentials(AWSTempToken.AccessKeyId, AWSTempToken.SecretAccessKey, AWSTempToken.SessionToken);
|
||||||
|
|
||||||
|
//提供awsEndPoint(域名)进行访问配置
|
||||||
|
var clientConfig = new AmazonS3Config
|
||||||
|
{
|
||||||
|
RegionEndpoint = RegionEndpoint.USEast1,
|
||||||
|
UseHttp = true,
|
||||||
|
};
|
||||||
|
|
||||||
|
var request = new Amazon.S3.Model.GetObjectMetadataRequest
|
||||||
|
{
|
||||||
|
BucketName = awsConfig.BucketName,
|
||||||
|
Key = objectkey
|
||||||
|
};
|
||||||
|
|
||||||
|
var amazonS3Client = new AmazonS3Client(credentials, clientConfig);
|
||||||
|
|
||||||
|
var response = await amazonS3Client.GetObjectMetadataAsync(request);
|
||||||
|
|
||||||
|
long fileSize = response.ContentLength; // 文件大小(字节)
|
||||||
|
|
||||||
|
return fileSize;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException("未定义的存储介质类型");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public ObjectStoreDTO GetObjectStoreTempToken()
|
public ObjectStoreDTO GetObjectStoreTempToken()
|
||||||
{
|
{
|
||||||
@@ -713,6 +1121,7 @@ public class OSSService : IOSSService
|
|||||||
BucketName = ossOptions.BucketName,
|
BucketName = ossOptions.BucketName,
|
||||||
EndPoint = ossOptions.EndPoint,
|
EndPoint = ossOptions.EndPoint,
|
||||||
ViewEndpoint = ossOptions.ViewEndpoint,
|
ViewEndpoint = ossOptions.ViewEndpoint,
|
||||||
|
PreviewEndpoint = ossOptions.PreviewEndpoint
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -15,14 +15,20 @@ public static class ImageHelper
|
|||||||
|
|
||||||
fileStorePath = fileStorePath ?? filePath + ".preview.jpeg";
|
fileStorePath = fileStorePath ?? filePath + ".preview.jpeg";
|
||||||
|
|
||||||
using (var image = SixLabors.ImageSharp.Image.Load(filePath))
|
// 读取 DICOM 文件
|
||||||
{
|
var dicomImage = new DicomImage(filePath);
|
||||||
|
|
||||||
|
// 渲染 DICOM 图像到 ImageSharp 格式
|
||||||
|
using (var image = dicomImage.RenderImage().AsSharpImage())
|
||||||
|
{
|
||||||
|
// 生成缩略图(调整大小)
|
||||||
image.Mutate(x => x.Resize(500, 500));
|
image.Mutate(x => x.Resize(500, 500));
|
||||||
|
|
||||||
image.Save(fileStorePath);
|
// 保存缩略图为 JPEG
|
||||||
|
image.Save(fileStorePath, new JpegEncoder());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="IdentityModel.OidcClient" Version="6.0.0" />
|
||||||
<PackageReference Include="AlibabaCloud.SDK.Sts20150401" Version="1.1.4" />
|
<PackageReference Include="AlibabaCloud.SDK.Sts20150401" Version="1.1.4" />
|
||||||
<PackageReference Include="AWSSDK.SecurityToken" Version="3.7.400.36" />
|
<PackageReference Include="AWSSDK.SecurityToken" Version="3.7.400.36" />
|
||||||
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.14.1" />
|
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.14.1" />
|
||||||
@@ -69,4 +70,8 @@
|
|||||||
<ProjectReference Include="..\IRaCIS.Core.Infra.EFCore\IRaCIS.Core.Infra.EFCore.csproj" />
|
<ProjectReference Include="..\IRaCIS.Core.Infra.EFCore\IRaCIS.Core.Infra.EFCore.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Service\MinimalApiService\CodeTemplate\FrontTemplate\" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -4,6 +4,7 @@ using IRaCIS.Core.Application.MassTransit.Command;
|
|||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
@@ -21,6 +22,8 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer
|
|||||||
private readonly IRepository<NoneDicomStudy> _noneDicomStudyRepository;
|
private readonly IRepository<NoneDicomStudy> _noneDicomStudyRepository;
|
||||||
public IStringLocalizer _localizer { get; set; }
|
public IStringLocalizer _localizer { get; set; }
|
||||||
|
|
||||||
|
private readonly SystemEmailSendConfig _systemEmailConfig;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 构造函数注入
|
/// 构造函数注入
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -28,7 +31,7 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer
|
|||||||
public ConsistencyCheckConsumer(IRepository<DicomStudy> studyRepository, IUserInfo userInfo,
|
public ConsistencyCheckConsumer(IRepository<DicomStudy> studyRepository, IUserInfo userInfo,
|
||||||
IRepository<Subject> subjectRepository, IRepository<SubjectVisit> subjectVisitRepository,
|
IRepository<Subject> subjectRepository, IRepository<SubjectVisit> subjectVisitRepository,
|
||||||
IRepository<TrialSite> trialSiteRepository, IRepository<NoneDicomStudy> noneDicomStudyRepository,
|
IRepository<TrialSite> trialSiteRepository, IRepository<NoneDicomStudy> noneDicomStudyRepository,
|
||||||
IMapper mapper, IStringLocalizer localizer)
|
IMapper mapper, IStringLocalizer localizer, IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig)
|
||||||
{
|
{
|
||||||
_noneDicomStudyRepository = noneDicomStudyRepository;
|
_noneDicomStudyRepository = noneDicomStudyRepository;
|
||||||
_studyRepository = studyRepository;
|
_studyRepository = studyRepository;
|
||||||
@@ -38,6 +41,8 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer
|
|||||||
_trialSiteRepository = trialSiteRepository;
|
_trialSiteRepository = trialSiteRepository;
|
||||||
_mapper = mapper;
|
_mapper = mapper;
|
||||||
_localizer = localizer;
|
_localizer = localizer;
|
||||||
|
|
||||||
|
_systemEmailConfig = systemEmailConfig.CurrentValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -186,17 +191,17 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer
|
|||||||
{
|
{
|
||||||
dialogMsg.AppendLine($"<br/>");
|
dialogMsg.AppendLine($"<br/>");
|
||||||
//---核对EDC数据,完全一致, 审核通过
|
//---核对EDC数据,完全一致, 审核通过
|
||||||
dialogMsg.AppendLine(_localizer["ConsistencyVerification_EDCA"]);
|
dialogMsg.AppendLine(_localizer["ConsistencyVerification_EDCA", _systemEmailConfig.SystemShortName]);
|
||||||
|
|
||||||
|
|
||||||
// dialogMsg.AppendLine(@$"<br>说明:为高效解决/处理以上全部质疑问题,麻烦您准确核实实际影像检查情况。请注意影像日期与实际检查的日期可能会不一致,部分检查(如PET -CT)可能同时存在多种模态影像。准确核实后,请回复该访视正确的影像检查情况。");
|
// dialogMsg.AppendLine(@$"<br>说明:为高效解决/处理以上全部质疑问题,麻烦您准确核实实际影像检查情况。请注意影像日期与实际检查的日期可能会不一致,部分检查(如PET -CT)可能同时存在多种模态影像。准确核实后,请回复该访视正确的影像检查情况。");
|
||||||
dbSV.CheckState = CheckStateEnum.CVPassed;
|
dbSV.CheckState = CheckStateEnum.CVPassed;
|
||||||
dbSV.CheckUserId = _userInfo.Id;
|
dbSV.CheckUserId = _userInfo.UserRoleId;
|
||||||
dbSV.CheckPassedTime = DateTime.Now;
|
dbSV.CheckPassedTime = DateTime.Now;
|
||||||
dbSV.CheckChallengeState = CheckChanllengeTypeEnum.Closed;
|
dbSV.CheckChallengeState = CheckChanllengeTypeEnum.Closed;
|
||||||
|
|
||||||
//---核对EDC数据,完全一致
|
//---核对EDC数据,完全一致
|
||||||
dbSV.CheckResult = _localizer["ConsistencyVerification_EDCB"];
|
dbSV.CheckResult = _localizer["ConsistencyVerification_EDCB", _systemEmailConfig.SystemShortName];
|
||||||
//---自动核查通过
|
//---自动核查通过
|
||||||
dbSV.ManualPassReason = _localizer["ConsistencyVerification_Auto"];
|
dbSV.ManualPassReason = _localizer["ConsistencyVerification_Auto"];
|
||||||
|
|
||||||
@@ -217,14 +222,14 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
//"Problems are as follows:
|
//"Problems are as follows:
|
||||||
dialogMsg.AppendLine($"<br/><div style='color: red'>{_localizer["ConsistencyVerification_Prob"]}</div>");
|
dialogMsg.AppendLine($"<br/><div>{_localizer["ConsistencyVerification_Prob"]}</div>");
|
||||||
|
|
||||||
num = 0;
|
num = 0;
|
||||||
foreach (var item in dbExceptExcel)
|
foreach (var item in dbExceptExcel)
|
||||||
{
|
{
|
||||||
num++;
|
num++;
|
||||||
//影像检查(EDC 缺少) ConsistencyVerification_EdcL
|
//影像检查(EDC 缺少) ConsistencyVerification_EdcL
|
||||||
dialogMsg.AppendLine($"<br/><div style='text-indent: 20px;'>{num}. {_localizer["ConsistencyVerification_EdcL", item.StudyDate, item.Modality]}</div>");
|
dialogMsg.AppendLine($"<br/><div style='text-indent: 20px;'>{num}. {_localizer["ConsistencyVerification_EdcL", item.StudyDate, item.Modality, _systemEmailConfig.SystemShortName]}</div>");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,15 +237,15 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer
|
|||||||
{
|
{
|
||||||
num++;
|
num++;
|
||||||
// 影像检查(IRC 缺少)
|
// 影像检查(IRC 缺少)
|
||||||
dialogMsg.AppendLine($"<br/><div style='text-indent: 20px;'>{num}. {_localizer["ConsistencyVerification_IrcLi", item.StudyDate, item.Modality]}</div>");
|
dialogMsg.AppendLine($"<br/><div style='text-indent: 20px;'>{num}. {_localizer["ConsistencyVerification_IrcLi", item.StudyDate, item.Modality, _systemEmailConfig.SystemShortName]}</div>");
|
||||||
}
|
}
|
||||||
|
|
||||||
dialogMsg.AppendLine($"<br/>");
|
dialogMsg.AppendLine($"<br/>");
|
||||||
dialogMsg.AppendLine(@$"<div>{_localizer["ConsistencyVerification_Desc"]}</div>");
|
dialogMsg.AppendLine(@$"<div>{_localizer["ConsistencyVerification_Desc"]}</div>");
|
||||||
|
|
||||||
dbSV.CheckResult = _localizer["ConsistencyVerification_Conf"] +
|
dbSV.CheckResult =
|
||||||
String.Join(" | ", dbExceptExcel.Select(t => $"{_localizer["ConsistencyVerification_EdcL", t.StudyDate, t.Modality]}")) + " | "
|
String.Join(" | ", dbExceptExcel.Select(t => $"{_localizer["ConsistencyVerification_EdcL", t.StudyDate, t.Modality, _systemEmailConfig.SystemShortName]}")) + " | "
|
||||||
+ String.Join(" | ", excelExceptDB.Select(t => $"{_localizer["ConsistencyVerification_IrcLi", t.StudyDate, t.Modality]}"));
|
+ String.Join(" | ", excelExceptDB.Select(t => $"{_localizer["ConsistencyVerification_IrcLi", t.StudyDate, t.Modality, _systemEmailConfig.SystemShortName]}"));
|
||||||
|
|
||||||
//新增一致性核查质疑记录
|
//新增一致性核查质疑记录
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer;
|
|||||||
/// 加急的医学反馈任务 通知MIM
|
/// 加急的医学反馈任务 通知MIM
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class UrgentMedicalReviewAddedEventConsumer(
|
public class UrgentMedicalReviewAddedEventConsumer(
|
||||||
IRepository<User> _userRepository,
|
IRepository<UserRole> _userRoleRepository,
|
||||||
IRepository<TaskMedicalReview> _taskMedicalReviewRepository,
|
IRepository<TaskMedicalReview> _taskMedicalReviewRepository,
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||||
@@ -58,7 +58,7 @@ public class UrgentMedicalReviewAddedEventConsumer(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var criterion = await _readingQuestionCriterionTrialRepository.FirstOrDefaultAsync(x => x.Id == medicalReview.VisitTask.TrialReadingCriterionId);
|
var criterion = await _readingQuestionCriterionTrialRepository.FirstOrDefaultAsync(x => x.Id == medicalReview.VisitTask.TrialReadingCriterionId);
|
||||||
var userinfo = await _userRepository.Where(x => x.Id == medicalReview.MedicalManagerUserId).FirstOrDefaultAsync();
|
var userinfo = await _userRoleRepository.Where(x => x.Id == medicalReview.MedicalManagerUserId).FirstOrDefaultAsync();
|
||||||
|
|
||||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == medicalReview.VisitTaskId).Include(x=>x.SourceSubjectVisit).Include(x => x.ReadModule).Include(x => x.Subject).FirstNotNullAsync();
|
var taskInfo = await _visitTaskRepository.Where(x => x.Id == medicalReview.VisitTaskId).Include(x=>x.SourceSubjectVisit).Include(x => x.ReadModule).Include(x => x.Subject).FirstNotNullAsync();
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ public class UrgentMedicalReviewAddedEventConsumer(
|
|||||||
new DictionaryDto (){DictionaryCode= "ReadingCategory",EnumValue=taskInfo.ReadingCategory.GetEnumInt(), },
|
new DictionaryDto (){DictionaryCode= "ReadingCategory",EnumValue=taskInfo.ReadingCategory.GetEnumInt(), },
|
||||||
new DictionaryDto (){DictionaryCode= "MedicalReviewDoctorUserIdea",EnumValue=medicalReview.DoctorUserIdeaEnum.GetEnumInt(), },
|
new DictionaryDto (){DictionaryCode= "MedicalReviewDoctorUserIdea",EnumValue=medicalReview.DoctorUserIdeaEnum.GetEnumInt(), },
|
||||||
new DictionaryDto (){DictionaryCode= "MedicalReviewAuditState",EnumValue=medicalReview.AuditState.GetEnumInt(), },
|
new DictionaryDto (){DictionaryCode= "MedicalReviewAuditState",EnumValue=medicalReview.AuditState.GetEnumInt(), },
|
||||||
new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue=taskInfo.IsUrgent.ToString(), }
|
new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue=taskInfo.IsUrgent.ToString().ToLower(), }
|
||||||
}
|
}
|
||||||
}) ;
|
}) ;
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ public class UrgentMedicalReviewAddedEventConsumer(
|
|||||||
|
|
||||||
//IR 回复医学反馈通知MIM
|
//IR 回复医学反馈通知MIM
|
||||||
public class UrgentIRRepliedMedicalReviewConsumer(
|
public class UrgentIRRepliedMedicalReviewConsumer(
|
||||||
IRepository<User> _userRepository,
|
IRepository<UserRole> _userRoleRepository,
|
||||||
IRepository<TaskMedicalReview> _taskMedicalReviewRepository,
|
IRepository<TaskMedicalReview> _taskMedicalReviewRepository,
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||||
@@ -159,7 +159,7 @@ public class UrgentIRRepliedMedicalReviewConsumer(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var criterion = await _readingQuestionCriterionTrialRepository.FirstOrDefaultAsync(x => x.Id == medicalReview.VisitTask.TrialReadingCriterionId);
|
var criterion = await _readingQuestionCriterionTrialRepository.FirstOrDefaultAsync(x => x.Id == medicalReview.VisitTask.TrialReadingCriterionId);
|
||||||
var userinfo = await _userRepository.Where(x => x.Id == medicalReview.MedicalManagerUserId).FirstOrDefaultAsync();
|
var userinfo = await _userRoleRepository.Where(x => x.Id == medicalReview.MedicalManagerUserId).FirstOrDefaultAsync();
|
||||||
|
|
||||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == medicalReview.VisitTaskId).Include(x => x.SourceSubjectVisit).Include(x => x.ReadModule).Include(x => x.Subject).FirstNotNullAsync();
|
var taskInfo = await _visitTaskRepository.Where(x => x.Id == medicalReview.VisitTaskId).Include(x => x.SourceSubjectVisit).Include(x => x.ReadModule).Include(x => x.Subject).FirstNotNullAsync();
|
||||||
|
|
||||||
@@ -192,7 +192,7 @@ public class UrgentIRRepliedMedicalReviewConsumer(
|
|||||||
new DictionaryDto (){DictionaryCode= "ReadingCategory",EnumValue=taskInfo.ReadingCategory.GetEnumInt(), },
|
new DictionaryDto (){DictionaryCode= "ReadingCategory",EnumValue=taskInfo.ReadingCategory.GetEnumInt(), },
|
||||||
new DictionaryDto (){DictionaryCode= "MedicalReviewDoctorUserIdea",EnumValue=medicalReview.DoctorUserIdeaEnum.GetEnumInt(), },
|
new DictionaryDto (){DictionaryCode= "MedicalReviewDoctorUserIdea",EnumValue=medicalReview.DoctorUserIdeaEnum.GetEnumInt(), },
|
||||||
new DictionaryDto (){DictionaryCode= "MedicalReviewAuditState",EnumValue=medicalReview.AuditState.GetEnumInt(), },
|
new DictionaryDto (){DictionaryCode= "MedicalReviewAuditState",EnumValue=medicalReview.AuditState.GetEnumInt(), },
|
||||||
new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue=taskInfo.IsUrgent.ToString(), }
|
new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue=taskInfo.IsUrgent.ToString().ToLower(), }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -231,7 +231,7 @@ public class UrgentIRRepliedMedicalReviewConsumer(
|
|||||||
/// MIM 回复医学返回通知IR
|
/// MIM 回复医学返回通知IR
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class UrgentMIMRepliedMedicalReviewConsumer(
|
public class UrgentMIMRepliedMedicalReviewConsumer(
|
||||||
IRepository<User> _userRepository,
|
IRepository<UserRole> _userRoleRepository,
|
||||||
IRepository<TaskMedicalReview> _taskMedicalReviewRepository,
|
IRepository<TaskMedicalReview> _taskMedicalReviewRepository,
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||||
@@ -268,7 +268,7 @@ public class UrgentMIMRepliedMedicalReviewConsumer(
|
|||||||
var criterion = await _readingQuestionCriterionTrialRepository.FirstOrDefaultAsync(x => x.Id == medicalReview.VisitTask.TrialReadingCriterionId);
|
var criterion = await _readingQuestionCriterionTrialRepository.FirstOrDefaultAsync(x => x.Id == medicalReview.VisitTask.TrialReadingCriterionId);
|
||||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == medicalReview.VisitTaskId).Include(x => x.SourceSubjectVisit).Include(x => x.ReadModule).Include(x => x.Subject).FirstNotNullAsync();
|
var taskInfo = await _visitTaskRepository.Where(x => x.Id == medicalReview.VisitTaskId).Include(x => x.SourceSubjectVisit).Include(x => x.ReadModule).Include(x => x.Subject).FirstNotNullAsync();
|
||||||
|
|
||||||
var userinfo = await _userRepository.Where(x => x.Id == taskInfo.DoctorUserId).FirstOrDefaultAsync();
|
var userinfo = await _userRoleRepository.Where(x => x.Id == taskInfo.DoctorUserId).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -299,9 +299,9 @@ public class UrgentMIMRepliedMedicalReviewConsumer(
|
|||||||
DictionaryList = new List<DictionaryDto>()
|
DictionaryList = new List<DictionaryDto>()
|
||||||
{
|
{
|
||||||
new DictionaryDto (){DictionaryCode= "ReadingCategory",EnumValue=taskInfo.ReadingCategory.GetEnumInt(), },
|
new DictionaryDto (){DictionaryCode= "ReadingCategory",EnumValue=taskInfo.ReadingCategory.GetEnumInt(), },
|
||||||
new DictionaryDto (){DictionaryCode= "IsPass",EnumValue=medicalReview.IsHaveQuestion.ToString(), },// 审核结论
|
new DictionaryDto (){DictionaryCode= "IsPass",EnumValue=medicalReview.IsHaveQuestion.ToString().ToLower(), },// 审核结论
|
||||||
new DictionaryDto (){DictionaryCode= "AuditAdvice",EnumValue=medicalReview.AuditAdviceEnum.GetEnumInt(), },// 审核建议
|
new DictionaryDto (){DictionaryCode= "AuditAdvice",EnumValue=medicalReview.AuditAdviceEnum.GetEnumInt(), },// 审核建议
|
||||||
new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue=taskInfo.IsUrgent.ToString(), }, //是否加急
|
new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue=taskInfo.IsUrgent.ToString().ToLower(), }, //是否加急
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -346,8 +346,8 @@ public class UrgentMIMRepliedMedicalReviewConsumer(
|
|||||||
/// 加急阅片 IR 申请重阅 或者PM 申请重阅
|
/// 加急阅片 IR 申请重阅 或者PM 申请重阅
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class UrgentIRApplyedReReadingConsumer(
|
public class UrgentIRApplyedReReadingConsumer(
|
||||||
IRepository<User> _userRepository,
|
IRepository<UserRole> _userRoleRepository,
|
||||||
IRepository<TrialUser> _trialUseRepository,
|
IRepository<TrialUserRole> _trialUseRoleRepository,
|
||||||
IRepository<TaskMedicalReview> _taskMedicalReviewRepository,
|
IRepository<TaskMedicalReview> _taskMedicalReviewRepository,
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||||
@@ -370,9 +370,9 @@ public class UrgentIRApplyedReReadingConsumer(
|
|||||||
var criterion = await _readingQuestionCriterionTrialRepository.FirstOrDefaultAsync(x => x.Id == taskInfo.TrialReadingCriterionId);
|
var criterion = await _readingQuestionCriterionTrialRepository.FirstOrDefaultAsync(x => x.Id == taskInfo.TrialReadingCriterionId);
|
||||||
|
|
||||||
|
|
||||||
var doctorInfo = await _userRepository.Where(x => x.Id == taskInfo.DoctorUserId).FirstOrDefaultAsync();
|
var doctorInfo = await _userRoleRepository.Where(x => x.Id == taskInfo.DoctorUserId).FirstOrDefaultAsync();
|
||||||
|
|
||||||
var trialUser = await _trialUseRepository.Where(x => x.TrialId == taskInfo.TrialId).Include(x => x.User).Select(x=>x.User).ToListAsync();
|
var trialUser = await _trialUseRoleRepository.Where(x => x.TrialId == taskInfo.TrialId).Include(x => x.UserRole).Select(x=>x.UserRole).ToListAsync();
|
||||||
|
|
||||||
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.ProjectManager||x.UserTypeEnum==UserTypeEnum.APM).ToList();
|
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.ProjectManager||x.UserTypeEnum==UserTypeEnum.APM).ToList();
|
||||||
if (context.Message.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed)
|
if (context.Message.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer;
|
|||||||
public class UserSiteSurveySubmitedEventConsumer(
|
public class UserSiteSurveySubmitedEventConsumer(
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
IRepository<TrialSite> _trialSiteRepository,
|
IRepository<TrialSite> _trialSiteRepository,
|
||||||
IRepository<TrialUser> _trialUserRepository,
|
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||||
IRepository<TrialSiteSurvey> _trialSiteSurveyRepository,
|
IRepository<TrialSiteSurvey> _trialSiteSurveyRepository,
|
||||||
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
|
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
|
||||||
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig
|
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig
|
||||||
@@ -47,9 +47,9 @@ public class UserSiteSurveySubmitedEventConsumer(
|
|||||||
|
|
||||||
var trialId = siteSurveyInfo.TrialId;
|
var trialId = siteSurveyInfo.TrialId;
|
||||||
|
|
||||||
var trialUserList = await _trialUserRepository.Where(t => t.TrialId == siteSurveyInfo.TrialId)
|
var trialUserList = await _trialUserRoleRepository.Where(t => t.TrialId == siteSurveyInfo.TrialId)
|
||||||
.Where(t => t.User.UserTypeEnum == UserTypeEnum.SPM || t.User.UserTypeEnum == UserTypeEnum.CPM || t.User.UserTypeEnum == UserTypeEnum.ProjectManager || t.User.UserTypeEnum == UserTypeEnum.APM)
|
.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM || t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM)
|
||||||
.Select(t => new { t.User.FullName, t.User.EMail, t.User.UserTypeEnum }).ToListAsync();
|
.Select(t => new { t.UserRole.FullName, t.UserRole.IdentityUser.EMail, t.UserRole.UserTypeEnum }).ToListAsync();
|
||||||
|
|
||||||
var sPMOrCPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.SPM || t.UserTypeEnum == UserTypeEnum.CPM).ToList();
|
var sPMOrCPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.SPM || t.UserTypeEnum == UserTypeEnum.CPM).ToList();
|
||||||
var pmAndAPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserTypeEnum == UserTypeEnum.APM).ToList();
|
var pmAndAPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserTypeEnum == UserTypeEnum.APM).ToList();
|
||||||
@@ -110,10 +110,10 @@ public class UserSiteSurveySubmitedEventConsumer(
|
|||||||
return (topicStr, htmlBodyStr);
|
return (topicStr, htmlBodyStr);
|
||||||
};
|
};
|
||||||
|
|
||||||
var scenario = _trialSiteSurveyRepository.Any(t => t.Id != trialSiteSurveyId && t.TrialId == siteSurveyInfo.TrialId && t.TrialSiteId == siteSurveyInfo.TrialSiteId) ?
|
var scenario = _trialSiteSurveyRepository.Where(t => t.Id != trialSiteSurveyId && t.TrialId == siteSurveyInfo.TrialId && t.TrialSiteId == siteSurveyInfo.TrialSiteId).IgnoreQueryFilters().Any() ?
|
||||||
EmailBusinessScenario.Approval_UpdateSiteSurvey : EmailBusinessScenario.Approval_SubmitSiteSurvey;
|
EmailBusinessScenario.Approval_UpdateSiteSurvey : EmailBusinessScenario.Approval_SubmitSiteSurvey;
|
||||||
|
|
||||||
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository, EmailBusinessScenario.Approval_SubmitSiteSurvey, messageToSend, emailConfigFunc);
|
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository, scenario, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ public class UserSiteSurveySubmitedEventConsumer(
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class SiteSurveySPMSubmitedEventConsumer(
|
public class SiteSurveySPMSubmitedEventConsumer(
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
IRepository<TrialUser> _trialUserRepository,
|
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||||
IRepository<TrialSite> _trialSiteRepository,
|
IRepository<TrialSite> _trialSiteRepository,
|
||||||
IRepository<TrialSiteSurvey> _trialSiteSurveyRepository,
|
IRepository<TrialSiteSurvey> _trialSiteSurveyRepository,
|
||||||
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
|
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
|
||||||
@@ -145,9 +145,9 @@ public class SiteSurveySPMSubmitedEventConsumer(
|
|||||||
|
|
||||||
var messageToSend = new MimeMessage();
|
var messageToSend = new MimeMessage();
|
||||||
|
|
||||||
var trialUserList = _trialUserRepository.Where(t => t.TrialId == trialId)
|
var trialUserList = _trialUserRoleRepository.Where(t => t.TrialId == trialId)
|
||||||
.Where(t => t.User.UserTypeEnum == UserTypeEnum.SPM || t.User.UserTypeEnum == UserTypeEnum.CPM || t.User.UserTypeEnum == UserTypeEnum.ProjectManager || t.User.UserTypeEnum == UserTypeEnum.APM)
|
.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM || t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM)
|
||||||
.Select(t => new { t.User.EMail, t.User.FullName, t.User.UserTypeEnum }).ToList();
|
.Select(t => new { t.UserRole.IdentityUser.EMail, t.UserRole.FullName, t.UserRole.UserTypeEnum }).ToList();
|
||||||
|
|
||||||
var sPMOrCPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.SPM || t.UserTypeEnum == UserTypeEnum.CPM).ToList();
|
var sPMOrCPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.SPM || t.UserTypeEnum == UserTypeEnum.CPM).ToList();
|
||||||
var pmAndAPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserTypeEnum == UserTypeEnum.APM).ToList();
|
var pmAndAPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserTypeEnum == UserTypeEnum.APM).ToList();
|
||||||
@@ -174,7 +174,7 @@ public class SiteSurveySPMSubmitedEventConsumer(
|
|||||||
|
|
||||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
||||||
{
|
{
|
||||||
var topicStr = string.Format(input.topicStr, companyName, trialInfo.ResearchProgramNo);
|
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo);
|
||||||
var htmlBodyStr = string.Format(CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
var htmlBodyStr = string.Format(CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
||||||
toUserName,
|
toUserName,
|
||||||
siteInfo.TrialSiteCode,
|
siteInfo.TrialSiteCode,
|
||||||
@@ -200,7 +200,7 @@ public class SiteSurveySPMSubmitedEventConsumer(
|
|||||||
/// 调研表驳回发送邮件 之前已有,需要迁移过来
|
/// 调研表驳回发送邮件 之前已有,需要迁移过来
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class SiteSurverRejectedEventConsumer(
|
public class SiteSurverRejectedEventConsumer(
|
||||||
IRepository<TrialUser> _trialUserRepository,
|
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
IRepository<TrialSite> _trialSiteRepository,
|
IRepository<TrialSite> _trialSiteRepository,
|
||||||
IRepository<TrialSiteSurvey> _trialSiteSurveyRepository,
|
IRepository<TrialSiteSurvey> _trialSiteSurveyRepository,
|
||||||
@@ -229,13 +229,13 @@ public class SiteSurverRejectedEventConsumer(
|
|||||||
//PM 驳回到SPM
|
//PM 驳回到SPM
|
||||||
if (siteSurveyInfo.State == TrialSiteSurveyEnum.CRCSubmitted)
|
if (siteSurveyInfo.State == TrialSiteSurveyEnum.CRCSubmitted)
|
||||||
{
|
{
|
||||||
//var user = await _userRepository.FirstOrDefaultAsync(t => t.Id == siteSurveyInfo.PreliminaryUserId);
|
//var user = await _userRoleRepository.FirstOrDefaultAsync(t => t.Id == siteSurveyInfo.PreliminaryUserId);
|
||||||
|
|
||||||
//name = user.FullName;
|
//name = user.FullName;
|
||||||
|
|
||||||
var sPMOrCPMList = _trialUserRepository.Where(t => t.TrialId == trialId)
|
var sPMOrCPMList = _trialUserRoleRepository.Where(t => t.TrialId == trialId)
|
||||||
.Where(t => t.User.UserTypeEnum == UserTypeEnum.SPM || t.User.UserTypeEnum == UserTypeEnum.CPM)
|
.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM)
|
||||||
.Select(t => new { t.User.EMail, t.User.FullName, t.User.UserTypeEnum }).ToList();
|
.Select(t => new { t.UserRole.IdentityUser.EMail, t.UserRole.FullName, t.UserRole.UserTypeEnum }).ToList();
|
||||||
|
|
||||||
|
|
||||||
foreach (var user in sPMOrCPMList)
|
foreach (var user in sPMOrCPMList)
|
||||||
@@ -274,7 +274,7 @@ public class SiteSurverRejectedEventConsumer(
|
|||||||
|
|
||||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
||||||
{
|
{
|
||||||
var topicStr = string.Format(input.topicStr, companyName, trialInfo.ResearchProgramNo);
|
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo);
|
||||||
var htmlBodyStr = string.Format(CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
var htmlBodyStr = string.Format(CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
||||||
toUserName,
|
toUserName,
|
||||||
trialInfo.TrialCode,
|
trialInfo.TrialCode,
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer;
|
|||||||
/// CRC 提交了 通知QC进行质控 Code005,006
|
/// CRC 提交了 通知QC进行质控 Code005,006
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CRCSubmitedAndQCToAuditEventConsumer(
|
public class CRCSubmitedAndQCToAuditEventConsumer(
|
||||||
IRepository<User> _userRepository,
|
IRepository<UserRole> _userRoleRepository,
|
||||||
IRepository<TrialUser> _trialUseRepository,
|
IRepository<TrialUserRole> _trialUseRoleRepository,
|
||||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||||
@@ -43,7 +43,7 @@ public class CRCSubmitedAndQCToAuditEventConsumer(
|
|||||||
|
|
||||||
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstOrDefaultAsync();
|
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstOrDefaultAsync();
|
||||||
|
|
||||||
var trialUser = await _trialUseRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.User).Select(x => x.User).ToListAsync();
|
var trialUser = await _trialUseRoleRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
|
||||||
|
|
||||||
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.IQC).ToList();
|
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.IQC).ToList();
|
||||||
|
|
||||||
@@ -73,12 +73,17 @@ public class CRCSubmitedAndQCToAuditEventConsumer(
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
foreach (var userinfo in userinfoList)
|
|
||||||
{
|
|
||||||
var messageToSend = new MimeMessage();
|
var messageToSend = new MimeMessage();
|
||||||
//发件地址
|
//发件地址
|
||||||
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
||||||
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
|
|
||||||
|
|
||||||
|
foreach (var userinfo in userinfoList)
|
||||||
|
{
|
||||||
|
messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
|
||||||
|
}
|
||||||
|
|
||||||
|
var userNames = userinfoList.Select(x => x.FullName).ToList();
|
||||||
|
|
||||||
foreach (var pm in pmandAPm)
|
foreach (var pm in pmandAPm)
|
||||||
{
|
{
|
||||||
@@ -95,7 +100,7 @@ public class CRCSubmitedAndQCToAuditEventConsumer(
|
|||||||
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
|
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
|
||||||
var htmlBodyStr = string.Format(
|
var htmlBodyStr = string.Format(
|
||||||
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
||||||
userinfo.FullName, // 用户名 {0}
|
string.Join(',', userNames), // 用户名 {0}
|
||||||
trialInfo.ExperimentName, // 项目 {1}
|
trialInfo.ExperimentName, // 项目 {1}
|
||||||
subjectCode, // 受试者 {2}
|
subjectCode, // 受试者 {2}
|
||||||
subjectVisit.VisitName, // 访视 {3}
|
subjectVisit.VisitName, // 访视 {3}
|
||||||
@@ -113,7 +118,7 @@ public class CRCSubmitedAndQCToAuditEventConsumer(
|
|||||||
messageToSend, emailConfigFunc);
|
messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,8 +127,8 @@ public class CRCSubmitedAndQCToAuditEventConsumer(
|
|||||||
/// CRC 回复质控质疑 通知QC Code012,013
|
/// CRC 回复质控质疑 通知QC Code012,013
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CRCRepliedQCChallengeEventConsumer(
|
public class CRCRepliedQCChallengeEventConsumer(
|
||||||
IRepository<User> _userRepository,
|
IRepository<UserRole> _userRoleRepository,
|
||||||
IRepository<TrialUser> _trialUseRepository,
|
IRepository<TrialUserRole> _trialUseRoleRepository,
|
||||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
IRepository<QCChallenge> _qCChallengeRepository,
|
IRepository<QCChallenge> _qCChallengeRepository,
|
||||||
@@ -148,7 +153,7 @@ public class CRCRepliedQCChallengeEventConsumer(
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
var trialUser = await _trialUseRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.User).Select(x => x.User).ToListAsync();
|
var trialUser = await _trialUseRoleRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -181,7 +186,7 @@ public class CRCRepliedQCChallengeEventConsumer(
|
|||||||
IsEn_US = isEn_US,
|
IsEn_US = isEn_US,
|
||||||
DictionaryList = new List<DictionaryDto>()
|
DictionaryList = new List<DictionaryDto>()
|
||||||
{
|
{
|
||||||
new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue=qCChallengeDialog.QCChallenge.IsClosed.ToString(), }, //是否关闭
|
new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue=qCChallengeDialog.QCChallenge.IsClosed.ToString().ToLower(), }, //是否关闭
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -219,8 +224,8 @@ public class CRCRepliedQCChallengeEventConsumer(
|
|||||||
/// QC回复 质控质疑,通知CRC (014,015)
|
/// QC回复 质控质疑,通知CRC (014,015)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class QCRepliedQCChallengeEventConsumer(
|
public class QCRepliedQCChallengeEventConsumer(
|
||||||
IRepository<User> _userRepository,
|
IRepository<UserRole> _userRoleRepository,
|
||||||
IRepository<TrialUser> _trialUseRepository,
|
IRepository<TrialUserRole> _trialUseRoleRepository,
|
||||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
IRepository<QCChallenge> _qCChallengeRepository,
|
IRepository<QCChallenge> _qCChallengeRepository,
|
||||||
@@ -234,12 +239,27 @@ public class QCRepliedQCChallengeEventConsumer(
|
|||||||
{
|
{
|
||||||
Console.WriteLine("发送(014,015) 【 QC回复 质控质疑,通知CRC】邮件!!!");
|
Console.WriteLine("发送(014,015) 【 QC回复 质控质疑,通知CRC】邮件!!!");
|
||||||
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
|
||||||
var qCChallengeDialog = await _qCChallengeDialogRepository.Where(x => x.Id == context.Message.QCChallengeDialogId).Include(x => x.QCChallenge).FirstNotNullAsync();
|
|
||||||
|
string talkContent = string.Empty;
|
||||||
|
var isclose = false;
|
||||||
|
if (context.Message.QCChallengeDialogId != null)
|
||||||
|
{
|
||||||
|
var qCChallengeDialog = await _qCChallengeDialogRepository.Where(x => x.Id == context.Message.QCChallengeDialogId.Value).Include(x => x.QCChallenge).FirstNotNullAsync();
|
||||||
|
talkContent = qCChallengeDialog.TalkContent;
|
||||||
|
isclose = qCChallengeDialog.QCChallenge.IsClosed;
|
||||||
|
}
|
||||||
|
else if(context.Message.QCChallengeId != null)
|
||||||
|
{
|
||||||
|
var qCChallenge = await _qCChallengeRepository.Where(x => x.Id == context.Message.QCChallengeId.Value).FirstNotNullAsync();
|
||||||
|
talkContent = qCChallenge.Content;
|
||||||
|
isclose = qCChallenge.IsClosed;
|
||||||
|
}
|
||||||
|
|
||||||
var subjectVisitId = context.Message.SubjectVisitId;
|
var subjectVisitId = context.Message.SubjectVisitId;
|
||||||
|
|
||||||
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstNotNullAsync();
|
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstNotNullAsync();
|
||||||
|
|
||||||
var trialUser = await _trialUseRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.User).Select(x => x.User).ToListAsync();
|
var trialUser = await _trialUseRoleRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
|
||||||
|
|
||||||
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).ToList();
|
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).ToList();
|
||||||
|
|
||||||
@@ -257,7 +277,7 @@ public class QCRepliedQCChallengeEventConsumer(
|
|||||||
IsEn_US = isEn_US,
|
IsEn_US = isEn_US,
|
||||||
DictionaryList = new List<DictionaryDto>()
|
DictionaryList = new List<DictionaryDto>()
|
||||||
{
|
{
|
||||||
new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue=qCChallengeDialog.QCChallenge.IsClosed.ToString(), }, //是否关闭
|
new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue=isclose.ToString().ToLower(), }, //是否关闭
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -285,12 +305,12 @@ public class QCRepliedQCChallengeEventConsumer(
|
|||||||
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
|
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
|
||||||
var htmlBodyStr = string.Format(
|
var htmlBodyStr = string.Format(
|
||||||
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
||||||
|
userinfo.FullName, // 用户名 {0}
|
||||||
trialInfo.ExperimentName, // 项目 {1}
|
trialInfo.ExperimentName, // 项目 {1}
|
||||||
userinfo.FullName, // 用户名 {1}
|
|
||||||
subjectCode, // 受试者 {2}
|
subjectCode, // 受试者 {2}
|
||||||
subjectVisit.VisitName, // 访视 {3}
|
subjectVisit.VisitName, // 访视 {3}
|
||||||
dictionValue[0], // 质疑是否关闭 {4}
|
dictionValue[0], // 质疑是否关闭 {4}
|
||||||
qCChallengeDialog.TalkContent, // 质疑内容 {5}
|
talkContent, // 质疑内容 {5}
|
||||||
_systemEmailConfig.SiteUrl // 链接 {65}
|
_systemEmailConfig.SiteUrl // 链接 {65}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -313,8 +333,8 @@ public class QCRepliedQCChallengeEventConsumer(
|
|||||||
/// CRC 回复一致性核查质疑 通知PM (019,020)
|
/// CRC 回复一致性核查质疑 通知PM (019,020)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CRCRepliedCheckChallengeEventConsumer(
|
public class CRCRepliedCheckChallengeEventConsumer(
|
||||||
IRepository<User> _userRepository,
|
IRepository<UserRole> _userRoleRepository,
|
||||||
IRepository<TrialUser> _trialUseRepository,
|
IRepository<TrialUserRole> _trialUseRoleRepository,
|
||||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
IRepository<QCChallenge> _qCChallengeRepository,
|
IRepository<QCChallenge> _qCChallengeRepository,
|
||||||
@@ -334,7 +354,7 @@ public class CRCRepliedCheckChallengeEventConsumer(
|
|||||||
|
|
||||||
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstNotNullAsync();
|
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstNotNullAsync();
|
||||||
|
|
||||||
var trialUser = await _trialUseRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.User).Select(x => x.User).ToListAsync();
|
var trialUser = await _trialUseRoleRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
|
||||||
|
|
||||||
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.APM || x.UserTypeEnum == UserTypeEnum.ProjectManager).ToList();
|
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.APM || x.UserTypeEnum == UserTypeEnum.ProjectManager).ToList();
|
||||||
|
|
||||||
@@ -376,8 +396,8 @@ public class CRCRepliedCheckChallengeEventConsumer(
|
|||||||
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
|
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
|
||||||
var htmlBodyStr = string.Format(
|
var htmlBodyStr = string.Format(
|
||||||
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
||||||
trialInfo.ExperimentName, // 项目 {1}
|
userinfo.FullName, // 用户名 {0}
|
||||||
userinfo.FullName, // 用户名 {1}
|
trialInfo.ExperimentName, // 项目 {1}
|
||||||
subjectCode, // 受试者 {2}
|
subjectCode, // 受试者 {2}
|
||||||
subjectVisit.VisitName, // 访视 {3}
|
subjectVisit.VisitName, // 访视 {3}
|
||||||
dictionValue[0], // 核查状态 {4}
|
dictionValue[0], // 核查状态 {4}
|
||||||
@@ -405,8 +425,8 @@ public class CRCRepliedCheckChallengeEventConsumer(
|
|||||||
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class PMRepliedCheckChallengeEventConsumer(
|
public class PMRepliedCheckChallengeEventConsumer(
|
||||||
IRepository<User> _userRepository,
|
IRepository<UserRole> _userRoleRepository,
|
||||||
IRepository<TrialUser> _trialUseRepository,
|
IRepository<TrialUserRole> _trialUseRoleRepository,
|
||||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
IRepository<CheckChallengeDialog> _checkChallengeDialogRepository,
|
IRepository<CheckChallengeDialog> _checkChallengeDialogRepository,
|
||||||
@@ -424,9 +444,9 @@ public class PMRepliedCheckChallengeEventConsumer(
|
|||||||
var checkChallengeDialog = await _checkChallengeDialogRepository.Where(x => x.Id == context.Message.CheckChallengeDialogId).FirstNotNullAsync();
|
var checkChallengeDialog = await _checkChallengeDialogRepository.Where(x => x.Id == context.Message.CheckChallengeDialogId).FirstNotNullAsync();
|
||||||
var subjectVisitId = context.Message.SubjectVisitId;
|
var subjectVisitId = context.Message.SubjectVisitId;
|
||||||
|
|
||||||
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstNotNullAsync();
|
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.NoneDicomStudyList).Include(x => x.StudyList).Include(x => x.Subject).FirstNotNullAsync();
|
||||||
|
|
||||||
var trialUser = await _trialUseRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.User).Select(x => x.User).ToListAsync();
|
var trialUser = await _trialUseRoleRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
|
||||||
|
|
||||||
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).ToList();
|
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).ToList();
|
||||||
|
|
||||||
@@ -434,24 +454,12 @@ public class PMRepliedCheckChallengeEventConsumer(
|
|||||||
|
|
||||||
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
|
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
|
||||||
|
|
||||||
string json = checkChallengeDialog.ParamInfo;
|
|
||||||
List<string> modalities = new List<string>();
|
List<string> modalities = new List<string>();
|
||||||
if (json.IsNotNullOrEmpty())
|
modalities =subjectVisit.NoneDicomStudyList.Select(t => t.Modality)
|
||||||
{
|
.Union(subjectVisit.StudyList.Select(k => k.ModalityForEdit)).ToList();
|
||||||
List<Dictionary<string, string>> studies = JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(json);
|
|
||||||
foreach (var study in studies)
|
|
||||||
{
|
|
||||||
if (study.ContainsKey("Modality"))
|
|
||||||
{
|
|
||||||
modalities.Add(study["Modality"]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
modalities = modalities.Distinct().ToList();
|
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
|
||||||
|
|
||||||
|
|
||||||
var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
|
|
||||||
{
|
{
|
||||||
|
|
||||||
DictionaryRepository = _dictionaryRepository,
|
DictionaryRepository = _dictionaryRepository,
|
||||||
@@ -516,8 +524,8 @@ public class PMRepliedCheckChallengeEventConsumer(
|
|||||||
/// 通知PM 进行一致性核查 (018,030)
|
/// 通知PM 进行一致性核查 (018,030)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CheckStateChangedToAuditEventConsumer(
|
public class CheckStateChangedToAuditEventConsumer(
|
||||||
IRepository<User> _userRepository,
|
IRepository<UserRole> _userRoleRepository,
|
||||||
IRepository<TrialUser> _trialUseRepository,
|
IRepository<TrialUserRole> _trialUseRoleRepository,
|
||||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
IRepository<QCChallenge> _qCChallengeRepository,
|
IRepository<QCChallenge> _qCChallengeRepository,
|
||||||
@@ -536,7 +544,7 @@ public class CheckStateChangedToAuditEventConsumer(
|
|||||||
|
|
||||||
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstNotNullAsync();
|
var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstNotNullAsync();
|
||||||
|
|
||||||
var trialUser = await _trialUseRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.User).Select(x => x.User).ToListAsync();
|
var trialUser = await _trialUseRoleRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
|
||||||
|
|
||||||
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.APM || x.UserTypeEnum == UserTypeEnum.ProjectManager).ToList();
|
var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.APM || x.UserTypeEnum == UserTypeEnum.ProjectManager).ToList();
|
||||||
|
|
||||||
@@ -578,8 +586,8 @@ public class CheckStateChangedToAuditEventConsumer(
|
|||||||
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
|
var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
|
||||||
var htmlBodyStr = string.Format(
|
var htmlBodyStr = string.Format(
|
||||||
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
||||||
trialInfo.ExperimentName, // 项目 {1}
|
userinfo.FullName, // 姓名 {0}
|
||||||
userinfo.FullName, // 用户名 {1}
|
trialInfo.ExperimentName, // 项目 {1}
|
||||||
subjectCode, // 受试者 {2}
|
subjectCode, // 受试者 {2}
|
||||||
subjectVisit.VisitName, // 访视 {3}
|
subjectVisit.VisitName, // 访视 {3}
|
||||||
dictionValue[0], // 核查状态 {4}
|
dictionValue[0], // 核查状态 {4}
|
||||||
@@ -604,8 +612,8 @@ public class CheckStateChangedToAuditEventConsumer(
|
|||||||
/// QC 领取了质控任务 (007,008)
|
/// QC 领取了质控任务 (007,008)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class QCClaimTaskEventConsumer(
|
public class QCClaimTaskEventConsumer(
|
||||||
IRepository<User> _userRepository,
|
IRepository<UserRole> _userRoleRepository,
|
||||||
IRepository<TrialUser> _trialUseRepository,
|
IRepository<TrialUserRole> _trialUseRoleRepository,
|
||||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
IRepository<QCChallenge> _qCChallengeRepository,
|
IRepository<QCChallenge> _qCChallengeRepository,
|
||||||
@@ -631,7 +639,7 @@ public class QCClaimTaskEventConsumer(
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
var trialUser = await _trialUseRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.User).Select(x => x.User).ToListAsync();
|
var trialUser = await _trialUseRoleRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.UserRole).Select(x => x.UserRole).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -697,7 +705,7 @@ public class QCClaimTaskEventConsumer(
|
|||||||
|
|
||||||
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
|
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
|
||||||
|
|
||||||
context.Message.IsPd ? EmailBusinessScenario.PDVerification_PendingImageQCClaim : EmailBusinessScenario.EligibilityVerification_PendingClaim,
|
context.Message.IsPd ? EmailBusinessScenario.PDVerification_PendingImageQC : EmailBusinessScenario.EligibilityVerification_PendingImageQC,
|
||||||
|
|
||||||
messageToSend, emailConfigFunc);
|
messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
|
|||||||
@@ -30,13 +30,13 @@ public class MasstransiTestCommand
|
|||||||
/// publish 请求流不会先到消费者,发布后,直接执行后续代码
|
/// publish 请求流不会先到消费者,发布后,直接执行后续代码
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="_userRepository"></param>
|
/// <param name="_userRoleRepository"></param>
|
||||||
public class MasstransitTestConsumer(IRepository<User> _userRepository) : IConsumer<MasstransiTestCommand>
|
public class MasstransitTestConsumer(IRepository<UserRole> _userRoleRepository) : IConsumer<MasstransiTestCommand>
|
||||||
{
|
{
|
||||||
public async Task Consume(ConsumeContext<MasstransiTestCommand> context)
|
public async Task Consume(ConsumeContext<MasstransiTestCommand> context)
|
||||||
{
|
{
|
||||||
|
|
||||||
Console.WriteLine(_userRepository._dbContext.GetHashCode());
|
Console.WriteLine(_userRoleRepository._dbContext.GetHashCode());
|
||||||
Console.WriteLine("Now is " + DateTime.Now.ToString());
|
Console.WriteLine("Now is " + DateTime.Now.ToString());
|
||||||
Console.WriteLine($"MassTransit.Consumer :{context.Message.value}");
|
Console.WriteLine($"MassTransit.Consumer :{context.Message.value}");
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using IRaCIS.Application.Contracts;
|
using DocumentFormat.OpenXml;
|
||||||
|
using IRaCIS.Application.Contracts;
|
||||||
using IRaCIS.Core.Application.Contracts;
|
using IRaCIS.Core.Application.Contracts;
|
||||||
using IRaCIS.Core.Application.Helper;
|
using IRaCIS.Core.Application.Helper;
|
||||||
using IRaCIS.Core.Application.MassTransit.Consumer;
|
using IRaCIS.Core.Application.MassTransit.Consumer;
|
||||||
@@ -25,7 +26,7 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
|
|||||||
IRepository<ReadingQuestionCriterionTrial> _trialReadingCriterionRepository,
|
IRepository<ReadingQuestionCriterionTrial> _trialReadingCriterionRepository,
|
||||||
IRepository<VisitTask> _visitTaskRepository,
|
IRepository<VisitTask> _visitTaskRepository,
|
||||||
IRepository<Dictionary> _dictionaryRepository,
|
IRepository<Dictionary> _dictionaryRepository,
|
||||||
IRepository<TrialUser> _trialUserRepository,
|
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||||
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
|
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
|
||||||
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig) : IConsumer<UrgentIRUnReadTaskRecurringEvent>
|
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig) : IConsumer<UrgentIRUnReadTaskRecurringEvent>
|
||||||
{
|
{
|
||||||
@@ -43,7 +44,7 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
|
|||||||
IsEn_US = isEn_US,
|
IsEn_US = isEn_US,
|
||||||
DictionaryList = new List<DictionaryDto>()
|
DictionaryList = new List<DictionaryDto>()
|
||||||
{
|
{
|
||||||
new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue="1" }
|
new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue="true" }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -51,31 +52,31 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
|
|||||||
|
|
||||||
Expression<Func<VisitTask, bool>> comonTaskFilter = t => t.TrialId == trialId && t.TaskState == TaskState.Effect && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskAllocationState == TaskAllocationState.Allocated;
|
Expression<Func<VisitTask, bool>> comonTaskFilter = t => t.TrialId == trialId && t.TaskState == TaskState.Effect && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskAllocationState == TaskAllocationState.Allocated;
|
||||||
|
|
||||||
var trialUserList = _trialUserRepository.Where(t => t.TrialId == trialId).Select(t => new
|
var trialUserList = _trialUserRoleRepository.Where(t => t.TrialId == trialId && t.TrialUser.JoinTime != null).Select(t => new
|
||||||
{
|
{
|
||||||
t.UserId,
|
t.UserId,
|
||||||
t.User.FullName,
|
t.UserRole.FullName,
|
||||||
t.User.EMail,
|
t.UserRole.IdentityUser.EMail,
|
||||||
t.User.UserName,
|
t.UserRole.IdentityUser.UserName,
|
||||||
t.Trial.TrialCode,
|
t.Trial.TrialCode,
|
||||||
t.Trial.ResearchProgramNo
|
t.Trial.ResearchProgramNo
|
||||||
//TrialReadingCriterionList = t.Trial.TrialReadingCriterionList.Select(t => new { t.CriterionName, TrialReadingCriterionId = t.Id }).ToList()
|
//TrialReadingCriterionList = t.Trial.TrialReadingCriterionList.Select(t => new { t.CriterionName, TrialReadingCriterionId = t.Id }).ToList()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
foreach (var trialUser in trialUserList)
|
foreach (var trialUser in trialUserList)
|
||||||
{
|
{
|
||||||
|
|
||||||
var userId=trialUser.UserId;
|
var userId = trialUser.UserId;
|
||||||
|
|
||||||
var doctorCriterionList = await _trialReadingCriterionRepository.Where(t => t.IsSigned && t.IsConfirm && t.Trial.TrialUserList.Any(t => t.UserId == userId))
|
var doctorCriterionList = await _trialReadingCriterionRepository.Where(t => t.IsSigned && t.IsConfirm && t.TrialId == trialId && t.Trial.TrialUserRoleList.Any(t => t.UserId == userId))
|
||||||
.Select(c => new
|
.Select(c => new
|
||||||
{
|
{
|
||||||
|
|
||||||
TrialReadingCriterionId = c.Id,
|
TrialReadingCriterionId = c.Id,
|
||||||
CriterionName=c.CriterionName,
|
CriterionName = c.CriterionName,
|
||||||
|
|
||||||
UnReadList = c.VisitTaskList
|
UnReadList = c.VisitTaskList.Where(t => t.ExpetidEmailNoticeTime == null) //没有被通知
|
||||||
.Where(t => t.DoctorUserId == userId && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect)
|
.Where(t => t.DoctorUserId == userId && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect)
|
||||||
// 前序 不存在 未一致性核查未通过的
|
// 前序 不存在 未一致性核查未通过的
|
||||||
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum))
|
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum))
|
||||||
@@ -84,69 +85,84 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
|
|||||||
|
|
||||||
.Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
|
.Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
|
||||||
|
|
||||||
.Where(t=> t.SourceSubjectVisit.PDState==PDStateEnum.PDProgress || t.SourceSubjectVisit.IsEnrollmentConfirm ||
|
.Where(t => t.SourceSubjectVisit.PDState == PDStateEnum.PDProgress || t.SourceSubjectVisit.IsEnrollmentConfirm ||
|
||||||
t.ReadModule.SubjectVisit.PDState == PDStateEnum.PDProgress || t.ReadModule.SubjectVisit.IsEnrollmentConfirm)
|
t.ReadModule.SubjectVisit.PDState == PDStateEnum.PDProgress || t.ReadModule.SubjectVisit.IsEnrollmentConfirm)
|
||||||
.Select(c=>new
|
.Select(c => new
|
||||||
{
|
{
|
||||||
SubejctCode= c.IsAnalysisCreate? c.BlindSubjectCode: c.Subject.Code,
|
SubejctCode = c.IsAnalysisCreate ? c.BlindSubjectCode : c.Subject.Code,
|
||||||
c.TaskBlindName,
|
c.TaskBlindName,
|
||||||
c.TaskName
|
c.TaskName,
|
||||||
|
VisitTaskId = c.Id
|
||||||
}).ToList()
|
}).ToList()
|
||||||
|
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
var toTalUnreadCount= doctorCriterionList.SelectMany(t=>t.UnReadList).Count();
|
var toTalUnreadCount = doctorCriterionList.SelectMany(t => t.UnReadList).Count();
|
||||||
|
|
||||||
|
if (toTalUnreadCount > 0)
|
||||||
var messageToSend = new MimeMessage();
|
|
||||||
|
|
||||||
//发件地址
|
|
||||||
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
|
||||||
messageToSend.To.Add(new MailboxAddress(trialUser.FullName, trialUser.EMail));
|
|
||||||
|
|
||||||
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
|
|
||||||
|
|
||||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
|
||||||
{
|
{
|
||||||
var topicStr = string.Format(input.topicStr, trialUser.ResearchProgramNo);
|
var messageToSend = new MimeMessage();
|
||||||
|
|
||||||
var template = input.htmlBodyStr;
|
//发件地址
|
||||||
|
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
||||||
|
messageToSend.To.Add(new MailboxAddress(trialUser.FullName, trialUser.EMail));
|
||||||
|
|
||||||
//正则提取循环的部分 {%for%}(.*?){%end for%}
|
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
|
||||||
string pattern = @"{%for%}(.*?){%end for%}";
|
|
||||||
var match = Regex.Match(template, pattern, RegexOptions.Singleline);
|
|
||||||
|
|
||||||
string criteriaTemplate = match.Groups[1].Value; // 提取循环模板
|
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
||||||
|
|
||||||
// 构建循环内容
|
|
||||||
string criteriaDetails = "";
|
|
||||||
foreach (var criteria in doctorCriterionList)
|
|
||||||
{
|
{
|
||||||
criteriaDetails += string.Format(criteriaTemplate, criteria.CriterionName, criteria.UnReadList.Select(t=>t.SubejctCode).Distinct().Count(), criteria.UnReadList.Count());
|
var topicStr = string.Format(input.topicStr, trialUser.ResearchProgramNo);
|
||||||
}
|
|
||||||
|
|
||||||
// 用循环内容替换原始模板中的循环部分
|
var template = input.htmlBodyStr;
|
||||||
string emailContent = Regex.Replace(template, pattern, criteriaDetails);
|
|
||||||
|
//正则提取循环的部分 {%for%}(.*?){%end for%}
|
||||||
|
string pattern = @"{%for%}(.*?){%end for%}";
|
||||||
|
var match = Regex.Match(template, pattern, RegexOptions.Singleline);
|
||||||
|
|
||||||
|
string criteriaTemplate = match.Groups[1].Value; // 提取循环模板
|
||||||
|
|
||||||
|
// 构建循环内容
|
||||||
|
string criteriaDetails = "";
|
||||||
|
foreach (var criteria in doctorCriterionList)
|
||||||
|
{
|
||||||
|
if (criteria.UnReadList.Count() > 0)
|
||||||
|
{
|
||||||
|
criteriaDetails += string.Format(criteriaTemplate, criteria.CriterionName, criteria.UnReadList.Select(t => t.SubejctCode).Distinct().Count(), criteria.UnReadList.Count());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 用循环内容替换原始模板中的循环部分
|
||||||
|
string emailContent = template.Replace(criteriaTemplate, criteriaDetails).Replace("{%for%}", "").Replace("{%end for%}", "");
|
||||||
|
|
||||||
|
|
||||||
var htmlBodyStr = string.Format(CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
|
|
||||||
trialUser.FullName,
|
|
||||||
|
|
||||||
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
|
var htmlBodyStr = string.Format(CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, emailContent),
|
||||||
toTalUnreadCount,
|
trialUser.FullName,
|
||||||
|
|
||||||
trialUser.ResearchProgramNo,
|
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||||
dictionValue[0],
|
toTalUnreadCount,
|
||||||
_systemEmailConfig.SiteUrl
|
|
||||||
);
|
|
||||||
|
|
||||||
return (topicStr, htmlBodyStr);
|
trialUser.ResearchProgramNo,
|
||||||
};
|
dictionValue[0],
|
||||||
|
_systemEmailConfig.SiteUrl
|
||||||
|
);
|
||||||
|
|
||||||
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository, EmailBusinessScenario.ExpeditedReading, messageToSend, emailConfigFunc);
|
return (topicStr, htmlBodyStr);
|
||||||
|
};
|
||||||
|
|
||||||
|
await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository, EmailBusinessScenario.ExpeditedReading, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
|
|
||||||
|
//处理标记已通知的任务
|
||||||
|
|
||||||
|
var visitTaskIdList = doctorCriterionList.Where(t => t.UnReadList.Count() > 0).SelectMany(t => t.UnReadList.Select(u => u.VisitTaskId)).ToList();
|
||||||
|
|
||||||
|
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => visitTaskIdList.Contains(t.Id), u => new VisitTask() { ExpetidEmailNoticeTime = DateTime.Now });
|
||||||
|
}
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ public static class OldRecurringEmailHelper
|
|||||||
public static async Task SendTrialEmailAsync(
|
public static async Task SendTrialEmailAsync(
|
||||||
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository,
|
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository,
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
IRepository<TrialUser> _trialUserRepository,
|
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||||
IRepository<VisitTask> _visitTaskRepository,
|
IRepository<VisitTask> _visitTaskRepository,
|
||||||
IRepository<TrialSiteUser> _trialSiteUserRepository,
|
IRepository<TrialSiteUserRole> _trialSiteUserRoleRepository,
|
||||||
|
|
||||||
Guid trialId, EmailBusinessScenario businessScenario,
|
Guid trialId, EmailBusinessScenario businessScenario,
|
||||||
Func<TrialEmailNoticeConfig, (string topicStr, string htmlBodyStr, bool isEn_us, Guid? onlyToUserId)> topicAndHtmlFunc,
|
Func<TrialEmailNoticeConfig, (string topicStr, string htmlBodyStr, bool isEn_us, Guid? onlyToUserId)> topicAndHtmlFunc,
|
||||||
@@ -59,7 +59,7 @@ public static class OldRecurringEmailHelper
|
|||||||
|
|
||||||
var allUserTypeEnumList = toUserTypeEnumList.Union(copyUserTypeEnumList).Distinct().ToList();
|
var allUserTypeEnumList = toUserTypeEnumList.Union(copyUserTypeEnumList).Distinct().ToList();
|
||||||
|
|
||||||
var allUserList = await _trialUserRepository.Where(t => t.TrialId == trialId && allUserTypeEnumList.Contains(t.User.UserTypeEnum)).Select(t => new { t.UserId, t.User.EMail, t.User.FullName, t.User.UserTypeEnum }).ToListAsync();
|
var allUserList = await _trialUserRoleRepository.Where(t => t.TrialId == trialId && allUserTypeEnumList.Contains(t.UserRole.UserTypeEnum)).Select(t => new { t.UserId, t.UserRole.IdentityUser.EMail, t.UserRole.FullName, t.UserRole.UserTypeEnum }).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
var toUserList = allUserList.Where(t => toUserTypeEnumList.Contains(t.UserTypeEnum))
|
var toUserList = allUserList.Where(t => toUserTypeEnumList.Contains(t.UserTypeEnum))
|
||||||
@@ -72,7 +72,7 @@ public static class OldRecurringEmailHelper
|
|||||||
}
|
}
|
||||||
if (trialSiteId != null && toUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA))
|
if (trialSiteId != null && toUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA))
|
||||||
{
|
{
|
||||||
var curentSiteUserIdList = _trialSiteUserRepository.Where(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId).Select(t => t.UserId).ToList();
|
var curentSiteUserIdList = _trialSiteUserRoleRepository.Where(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId).Select(t => t.UserId).ToList();
|
||||||
|
|
||||||
toUserList = toUserList.Where(t => (t.UserTypeEnum != UserTypeEnum.CRA && t.UserTypeEnum != UserTypeEnum.ClinicalResearchCoordinator) || curentSiteUserIdList.Contains(t.UserId)).ToList();
|
toUserList = toUserList.Where(t => (t.UserTypeEnum != UserTypeEnum.CRA && t.UserTypeEnum != UserTypeEnum.ClinicalResearchCoordinator) || curentSiteUserIdList.Contains(t.UserId)).ToList();
|
||||||
}
|
}
|
||||||
@@ -86,7 +86,7 @@ public static class OldRecurringEmailHelper
|
|||||||
|
|
||||||
if (trialSiteId != null && copyUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA))
|
if (trialSiteId != null && copyUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA))
|
||||||
{
|
{
|
||||||
var curentSiteUserIdList = _trialSiteUserRepository.Where(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId).Select(t => t.UserId).ToList();
|
var curentSiteUserIdList = _trialSiteUserRoleRepository.Where(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId).Select(t => t.UserId).ToList();
|
||||||
|
|
||||||
copyUserList = copyUserList.Where(t => (t.UserTypeEnum != UserTypeEnum.CRA && t.UserTypeEnum != UserTypeEnum.ClinicalResearchCoordinator) || curentSiteUserIdList.Contains(t.UserId)).ToList();
|
copyUserList = copyUserList.Where(t => (t.UserTypeEnum != UserTypeEnum.CRA && t.UserTypeEnum != UserTypeEnum.ClinicalResearchCoordinator) || curentSiteUserIdList.Contains(t.UserId)).ToList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer;
|
|||||||
|
|
||||||
public class QCImageQuestionRecurringEventConsumer(IRepository<Trial> _trialRepository,
|
public class QCImageQuestionRecurringEventConsumer(IRepository<Trial> _trialRepository,
|
||||||
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository,
|
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository,
|
||||||
IRepository<TrialUser> _trialUserRepository,
|
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||||
IRepository<VisitTask> _visitTaskRepository,
|
IRepository<VisitTask> _visitTaskRepository,
|
||||||
IRepository<TrialSiteUser> _trialSiteUserRepository,
|
IRepository<TrialSiteUserRole> _trialSiteUserRoleRepository,
|
||||||
IOptionsMonitor<SystemEmailSendConfig> _SystemEmailSendConfig) : IConsumer<QCImageQuestionRecurringEvent>
|
IOptionsMonitor<SystemEmailSendConfig> _SystemEmailSendConfig) : IConsumer<QCImageQuestionRecurringEvent>
|
||||||
{
|
{
|
||||||
public async Task Consume(ConsumeContext<QCImageQuestionRecurringEvent> context)
|
public async Task Consume(ConsumeContext<QCImageQuestionRecurringEvent> context)
|
||||||
@@ -37,7 +37,7 @@ public class QCImageQuestionRecurringEventConsumer(IRepository<Trial> _trialRepo
|
|||||||
var trialInfo = await _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr }).FirstNotNullAsync();
|
var trialInfo = await _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr }).FirstNotNullAsync();
|
||||||
|
|
||||||
//找到 该项目的CRC 用户Id
|
//找到 该项目的CRC 用户Id
|
||||||
var userList = await _trialUserRepository.Where(t => t.TrialId == trialId).Where(t => t.User.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Select(t => new { t.UserId, t.User.FullName }).ToListAsync();
|
var userList = await _trialUserRoleRepository.Where(t => t.TrialId == trialId).Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Select(t => new { t.UserId, t.UserRole.FullName }).ToListAsync();
|
||||||
|
|
||||||
//判断是否任务可以领取 ,可以的话 发送邮件
|
//判断是否任务可以领取 ,可以的话 发送邮件
|
||||||
|
|
||||||
@@ -73,9 +73,9 @@ public class QCImageQuestionRecurringEventConsumer(IRepository<Trial> _trialRepo
|
|||||||
await OldRecurringEmailHelper.SendTrialEmailAsync(
|
await OldRecurringEmailHelper.SendTrialEmailAsync(
|
||||||
_trialEmailNoticeConfigRepository,
|
_trialEmailNoticeConfigRepository,
|
||||||
_trialRepository,
|
_trialRepository,
|
||||||
_trialUserRepository,
|
_trialUserRoleRepository,
|
||||||
_visitTaskRepository,
|
_visitTaskRepository,
|
||||||
_trialSiteUserRepository,
|
_trialSiteUserRoleRepository,
|
||||||
trialId, EmailBusinessScenario.QCToCRCImageQuestion, topicAndHtmlFunc);
|
trialId, EmailBusinessScenario.QCToCRCImageQuestion, topicAndHtmlFunc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88,9 +88,9 @@ public class QCImageQuestionRecurringEventConsumer(IRepository<Trial> _trialRepo
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class CRCImageQuestionRecurringEventConsumer(IRepository<Trial> _trialRepository,
|
public class CRCImageQuestionRecurringEventConsumer(IRepository<Trial> _trialRepository,
|
||||||
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository,
|
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository,
|
||||||
IRepository<TrialUser> _trialUserRepository,
|
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||||
IRepository<VisitTask> _visitTaskRepository,
|
IRepository<VisitTask> _visitTaskRepository,
|
||||||
IRepository<TrialSiteUser> _trialSiteUserRepository,
|
IRepository<TrialSiteUserRole> _trialSiteUserRoleRepository,
|
||||||
IOptionsMonitor<SystemEmailSendConfig> _SystemEmailSendConfig) : IConsumer<CRCImageQuestionRecurringEvent>
|
IOptionsMonitor<SystemEmailSendConfig> _SystemEmailSendConfig) : IConsumer<CRCImageQuestionRecurringEvent>
|
||||||
{
|
{
|
||||||
public async Task Consume(ConsumeContext<CRCImageQuestionRecurringEvent> context)
|
public async Task Consume(ConsumeContext<CRCImageQuestionRecurringEvent> context)
|
||||||
@@ -101,7 +101,7 @@ public class CRCImageQuestionRecurringEventConsumer(IRepository<Trial> _trialRep
|
|||||||
var trialInfo = await _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr, t.DeclarationTypeEnumList }).FirstNotNullAsync();
|
var trialInfo = await _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr, t.DeclarationTypeEnumList }).FirstNotNullAsync();
|
||||||
|
|
||||||
//找到 该项目的IQC 用户Id
|
//找到 该项目的IQC 用户Id
|
||||||
var userList = await _trialUserRepository.Where(t => t.TrialId == trialId).Where(t => t.User.UserTypeEnum == UserTypeEnum.IQC).Select(t => new { t.UserId, t.User.FullName }).ToListAsync();
|
var userList = await _trialUserRoleRepository.Where(t => t.TrialId == trialId).Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.IQC).Select(t => new { t.UserId, t.UserRole.FullName }).ToListAsync();
|
||||||
|
|
||||||
//判断是否任务可以领取 ,可以的话 发送邮件
|
//判断是否任务可以领取 ,可以的话 发送邮件
|
||||||
|
|
||||||
@@ -141,9 +141,9 @@ public class CRCImageQuestionRecurringEventConsumer(IRepository<Trial> _trialRep
|
|||||||
|
|
||||||
await OldRecurringEmailHelper.SendTrialEmailAsync(_trialEmailNoticeConfigRepository,
|
await OldRecurringEmailHelper.SendTrialEmailAsync(_trialEmailNoticeConfigRepository,
|
||||||
_trialRepository,
|
_trialRepository,
|
||||||
_trialUserRepository,
|
_trialUserRoleRepository,
|
||||||
_visitTaskRepository,
|
_visitTaskRepository,
|
||||||
_trialSiteUserRepository,
|
_trialSiteUserRoleRepository,
|
||||||
trialId, EmailBusinessScenario.CRCToQCQuestion, topicAndHtmlFunc);
|
trialId, EmailBusinessScenario.CRCToQCQuestion, topicAndHtmlFunc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -155,9 +155,9 @@ public class CRCImageQuestionRecurringEventConsumer(IRepository<Trial> _trialRep
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class ImageQCRecurringEventConsumer(IRepository<Trial> _trialRepository,
|
public class ImageQCRecurringEventConsumer(IRepository<Trial> _trialRepository,
|
||||||
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository,
|
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository,
|
||||||
IRepository<TrialUser> _trialUserRepository,
|
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||||
IRepository<VisitTask> _visitTaskRepository,
|
IRepository<VisitTask> _visitTaskRepository,
|
||||||
IRepository<TrialSiteUser> _trialSiteUserRepository,
|
IRepository<TrialSiteUserRole> _trialSiteUserRoleRepository,
|
||||||
IOptionsMonitor<SystemEmailSendConfig> _SystemEmailSendConfig) : IConsumer<ImageQCRecurringEvent>
|
IOptionsMonitor<SystemEmailSendConfig> _SystemEmailSendConfig) : IConsumer<ImageQCRecurringEvent>
|
||||||
{
|
{
|
||||||
public async Task Consume(ConsumeContext<ImageQCRecurringEvent> context)
|
public async Task Consume(ConsumeContext<ImageQCRecurringEvent> context)
|
||||||
@@ -169,7 +169,7 @@ public class ImageQCRecurringEventConsumer(IRepository<Trial> _trialRepository,
|
|||||||
var trialInfo = await _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr }).FirstNotNullAsync();
|
var trialInfo = await _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr }).FirstNotNullAsync();
|
||||||
|
|
||||||
//找到 该项目的IQC 用户Id
|
//找到 该项目的IQC 用户Id
|
||||||
var userList = await _trialUserRepository.Where(t => t.TrialId == trialId).Where(t => t.User.UserTypeEnum == UserTypeEnum.IQC).Select(t => new { t.UserId, t.User.FullName }).ToListAsync();
|
var userList = await _trialUserRoleRepository.Where(t => t.TrialId == trialId).Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.IQC).Select(t => new { t.UserId, t.UserRole.FullName }).ToListAsync();
|
||||||
|
|
||||||
//判断是否任务可以领取 ,可以的话 发送邮件
|
//判断是否任务可以领取 ,可以的话 发送邮件
|
||||||
var userIdList = userList.Select(t => t.UserId).ToList();
|
var userIdList = userList.Select(t => t.UserId).ToList();
|
||||||
@@ -209,9 +209,9 @@ public class ImageQCRecurringEventConsumer(IRepository<Trial> _trialRepository,
|
|||||||
await OldRecurringEmailHelper.SendTrialEmailAsync(
|
await OldRecurringEmailHelper.SendTrialEmailAsync(
|
||||||
_trialEmailNoticeConfigRepository,
|
_trialEmailNoticeConfigRepository,
|
||||||
_trialRepository,
|
_trialRepository,
|
||||||
_trialUserRepository,
|
_trialUserRoleRepository,
|
||||||
_visitTaskRepository,
|
_visitTaskRepository,
|
||||||
_trialSiteUserRepository,
|
_trialSiteUserRoleRepository,
|
||||||
trialId, EmailBusinessScenario.QCTask, topicAndHtmlFunc);
|
trialId, EmailBusinessScenario.QCTask, topicAndHtmlFunc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -339,6 +339,16 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||||||
|
|
||||||
public int UrgentCount { get; set; }
|
public int UrgentCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否存在未处理的反馈
|
||||||
|
/// </summary>
|
||||||
|
public bool IsExistUnprocessedFeedback
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return UnReadCanReadTaskList.Any(t => t.IsExistUnprocessedFeedback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public List<IRUnreadTaskView> UnReadCanReadTaskList { get; set; } = new List<IRUnreadTaskView>();
|
public List<IRUnreadTaskView> UnReadCanReadTaskList { get; set; } = new List<IRUnreadTaskView>();
|
||||||
|
|
||||||
@@ -355,6 +365,11 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||||||
/// 是否是一致性分析产生
|
/// 是否是一致性分析产生
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsAnalysisCreate { get; set; }
|
public bool IsAnalysisCreate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否存在未处理的反馈
|
||||||
|
/// </summary>
|
||||||
|
public bool IsExistUnprocessedFeedback { get; set; }
|
||||||
|
|
||||||
public bool IsUrgent { get; set; }
|
public bool IsUrgent { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
{
|
{
|
||||||
Task<IResponseOutput> ApplyReReading(ApplyReReadingCommand applyReReadingCommand);
|
Task<IResponseOutput> ApplyReReading(ApplyReReadingCommand applyReReadingCommand);
|
||||||
|
|
||||||
Task<IResponseOutput> ConfirmReReading(ConfirmReReadingCommand agreeReReadingCommand, [FromServices] IVisitTaskHelpeService _visitTaskCommonService);
|
Task<IResponseOutput> ConfirmReReading(ConfirmReReadingCommand agreeReReadingCommand);
|
||||||
|
|
||||||
Task<PageOutput<IRUnReadSubjectView>> GetSubjectReadingIQueryable(GetReadingIQueryableInDto inDto);
|
Task<PageOutput<IRUnReadSubjectView>> GetSubjectReadingIQueryable(GetReadingIQueryableInDto inDto);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,12 @@
|
|||||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
|
using DocumentFormat.OpenXml.Spreadsheet;
|
||||||
using IRaCIS.Core.Application.Contracts;
|
using IRaCIS.Core.Application.Contracts;
|
||||||
using IRaCIS.Core.Application.Filter;
|
using IRaCIS.Core.Application.Filter;
|
||||||
using IRaCIS.Core.Application.Interfaces;
|
using IRaCIS.Core.Application.Interfaces;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
|
using IRaCIS.Core.Domain.Models;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
@@ -18,7 +20,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(GroupName = "Trial")]
|
[ApiExplorerSettings(GroupName = "Trial")]
|
||||||
public class TaskAllocationRuleService(IRepository<TaskAllocationRule> _taskAllocationRuleRepository,
|
public class TaskAllocationRuleService(IRepository<TaskAllocationRule> _taskAllocationRuleRepository,
|
||||||
IRepository<User> _userRepository,
|
IRepository<UserRole> _userRoleRepository,
|
||||||
IRepository<Enroll> _enrollRepository,
|
IRepository<Enroll> _enrollRepository,
|
||||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||||
IRepository<SubjectCanceDoctor> _subjectCanceDoctorRepository,
|
IRepository<SubjectCanceDoctor> _subjectCanceDoctorRepository,
|
||||||
@@ -124,15 +126,15 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
public async Task<List<TrialDoctorUserSelectView>> GetDoctorUserSelectList(Guid trialId, [FromServices] IRepository<Enroll> _enrollRepository)
|
public async Task<List<TrialDoctorUserSelectView>> GetDoctorUserSelectList(Guid trialId, [FromServices] IRepository<Enroll> _enrollRepository)
|
||||||
{
|
{
|
||||||
var query = from enroll in _enrollRepository.Where(t => t.TrialId == trialId && t.EnrollStatus >= EnrollStatus.ConfirmIntoGroup)
|
var query = from enroll in _enrollRepository.Where(t => t.TrialId == trialId && t.EnrollStatus >= EnrollStatus.ConfirmIntoGroup)
|
||||||
join user in _userRepository.AsQueryable() on enroll.DoctorId equals user.DoctorId
|
join user in _userRoleRepository.AsQueryable() on enroll.DoctorId equals user.DoctorId
|
||||||
select new TrialDoctorUserSelectView()
|
select new TrialDoctorUserSelectView()
|
||||||
{
|
{
|
||||||
TrialId = enroll.TrialId,
|
TrialId = enroll.TrialId,
|
||||||
//ReadingType = enroll.Trial.ReadingType,
|
//ReadingType = enroll.Trial.ReadingType,
|
||||||
DoctorUserId = user.Id,
|
DoctorUserId = user.Id,
|
||||||
FullName = user.FullName,
|
FullName = user.IdentityUser.FullName,
|
||||||
UserCode = user.UserCode,
|
UserCode = user.IdentityUser.UserCode,
|
||||||
UserName = user.UserName,
|
UserName = user.IdentityUser.UserName,
|
||||||
UserTypeEnum = user.UserTypeRole.UserTypeEnum,
|
UserTypeEnum = user.UserTypeRole.UserTypeEnum,
|
||||||
ReadingCategoryList = enroll.EnrollReadingCategoryList.Select(t => t.ReadingCategory).ToList()
|
ReadingCategoryList = enroll.EnrollReadingCategoryList.Select(t => t.ReadingCategory).ToList()
|
||||||
|
|
||||||
@@ -151,14 +153,14 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
.WhereIf(selectQuery.TrialReadingCriterionId != null && selectQuery.ReadingCategory == null, t => t.Enroll.EnrollReadingCategoryList.Any(t => t.TrialReadingCriterionId == selectQuery.TrialReadingCriterionId))
|
.WhereIf(selectQuery.TrialReadingCriterionId != null && selectQuery.ReadingCategory == null, t => t.Enroll.EnrollReadingCategoryList.Any(t => t.TrialReadingCriterionId == selectQuery.TrialReadingCriterionId))
|
||||||
.WhereIf(selectQuery.TrialReadingCriterionId != null && selectQuery.ReadingCategory != null,
|
.WhereIf(selectQuery.TrialReadingCriterionId != null && selectQuery.ReadingCategory != null,
|
||||||
t => t.Enroll.EnrollReadingCategoryList.Any(t => t.TrialReadingCriterionId == selectQuery.TrialReadingCriterionId && t.ReadingCategory == selectQuery.ReadingCategory))
|
t => t.Enroll.EnrollReadingCategoryList.Any(t => t.TrialReadingCriterionId == selectQuery.TrialReadingCriterionId && t.ReadingCategory == selectQuery.ReadingCategory))
|
||||||
join user in _userRepository.AsQueryable() on allocationRule.DoctorUserId equals user.Id
|
join user in _userRoleRepository.AsQueryable() on allocationRule.DoctorUserId equals user.Id
|
||||||
select new TrialDoctorUserSelectView()
|
select new TrialDoctorUserSelectView()
|
||||||
{
|
{
|
||||||
TrialId = allocationRule.TrialId,
|
TrialId = allocationRule.TrialId,
|
||||||
DoctorUserId = user.Id,
|
DoctorUserId = user.Id,
|
||||||
FullName = user.FullName,
|
FullName = user.IdentityUser.FullName,
|
||||||
UserCode = user.UserCode,
|
UserCode = user.IdentityUser.UserCode,
|
||||||
UserName = user.UserName,
|
UserName = user.IdentityUser.UserName,
|
||||||
UserTypeEnum = user.UserTypeRole.UserTypeEnum,
|
UserTypeEnum = user.UserTypeRole.UserTypeEnum,
|
||||||
|
|
||||||
ReadingCategoryList = selectQuery.TrialReadingCriterionId == null ?
|
ReadingCategoryList = selectQuery.TrialReadingCriterionId == null ?
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
IRepository<TrialSite> _trialSiteRepository,
|
IRepository<TrialSite> _trialSiteRepository,
|
||||||
IRepository<Enroll> _enrollRepository,
|
IRepository<Enroll> _enrollRepository,
|
||||||
IRepository<User> _userRepository,
|
IRepository<UserRole> _userRoleRepository,
|
||||||
IRepository<TrialVirtualSiteCodeUpdate> _trialVirtualSiteCodeUpdateRepository,
|
IRepository<TrialVirtualSiteCodeUpdate> _trialVirtualSiteCodeUpdateRepository,
|
||||||
IVisitTaskHelpeService _visitTaskCommonService, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITaskConsistentRuleService
|
IVisitTaskHelpeService _visitTaskCommonService, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITaskConsistentRuleService
|
||||||
{
|
{
|
||||||
@@ -227,7 +227,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
{
|
{
|
||||||
var lastTask = (subject.VisitTaskList.Take(filterObj.PlanVisitCount).Last()).Clone();
|
var lastTask = (subject.VisitTaskList.Take(filterObj.PlanVisitCount).Last()).Clone();
|
||||||
|
|
||||||
var existGlobal = _visitTaskRepository.Where(t => t.SubjectId == lastTask.SubjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.TaskState == TaskState.Effect && t.ReadingCategory == ReadingCategory.Global && t.VisitTaskNum == lastTask.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Global]).ProjectTo<VisitTaskSimpleDTO>(_mapper.ConfigurationProvider).FirstOrDefault();
|
var existGlobal = _visitTaskRepository.Where(t => t.SubjectId == lastTask.SubjectId && t.ArmEnum==lastTask.ArmEnum && t.TrialReadingCriterionId == trialReadingCriterionId && t.TaskState == TaskState.Effect && t.ReadingCategory == ReadingCategory.Global && t.VisitTaskNum == lastTask.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Global]).ProjectTo<VisitTaskSimpleDTO>(_mapper.ConfigurationProvider).FirstOrDefault();
|
||||||
|
|
||||||
|
|
||||||
if (existGlobal == null)
|
if (existGlobal == null)
|
||||||
@@ -369,7 +369,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
var doctorUserIdQuery = from enroll in _enrollRepository.Where(t => t.TrialId == trialId).Where(t => t.EnrollReadingCategoryList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(c => c.ReadingCategory == ReadingCategory.Global || c.ReadingCategory == ReadingCategory.Visit))
|
var doctorUserIdQuery = from enroll in _enrollRepository.Where(t => t.TrialId == trialId).Where(t => t.EnrollReadingCategoryList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(c => c.ReadingCategory == ReadingCategory.Global || c.ReadingCategory == ReadingCategory.Visit))
|
||||||
.Where(t => t.EnrollReadingCriteriaList.Any(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.IsJoinAnalysis == true))
|
.Where(t => t.EnrollReadingCriteriaList.Any(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.IsJoinAnalysis == true))
|
||||||
join user in _userRepository.Where() on enroll.DoctorId equals user.DoctorId
|
join user in _userRoleRepository.Where() on enroll.DoctorId equals user.DoctorId
|
||||||
select user.Id;
|
select user.Id;
|
||||||
|
|
||||||
var configDoctorUserIdList = await doctorUserIdQuery.ToListAsync();
|
var configDoctorUserIdList = await doctorUserIdQuery.ToListAsync();
|
||||||
@@ -469,7 +469,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
var lastTask = (subjectAddTaskList.Take(filterObj.PlanVisitCount).Last()).Clone();
|
var lastTask = (subjectAddTaskList.Take(filterObj.PlanVisitCount).Last()).Clone();
|
||||||
|
|
||||||
|
|
||||||
var existGlobal = _visitTaskRepository.Where(t => t.SubjectId == lastTask.SubjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.TaskState == TaskState.Effect && t.ReadingCategory == ReadingCategory.Global && t.VisitTaskNum == lastTask.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Global]).ProjectTo<VisitTaskGroupSimpleDTO>(_mapper.ConfigurationProvider).FirstOrDefault();
|
var existGlobal = _visitTaskRepository.Where(t => t.SubjectId == lastTask.SubjectId && t.ArmEnum == lastTask.ArmEnum && t.TrialReadingCriterionId == trialReadingCriterionId && t.TaskState == TaskState.Effect && t.ReadingCategory == ReadingCategory.Global && t.VisitTaskNum == lastTask.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Global]).ProjectTo<VisitTaskGroupSimpleDTO>(_mapper.ConfigurationProvider).FirstOrDefault();
|
||||||
|
|
||||||
|
|
||||||
if (existGlobal == null)
|
if (existGlobal == null)
|
||||||
@@ -707,9 +707,9 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
DoctorUserList = t.SubjectDoctorList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.IsConfirmed && t.ArmEnum <= Arm.DoubleReadingArm2).Select(t => new UserSimpleInfo()
|
DoctorUserList = t.SubjectDoctorList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.IsConfirmed && t.ArmEnum <= Arm.DoubleReadingArm2).Select(t => new UserSimpleInfo()
|
||||||
{
|
{
|
||||||
UserId = t.Id,
|
UserId = t.Id,
|
||||||
FullName = t.DoctorUser.FullName,
|
FullName = t.DoctorUser.IdentityUser.FullName,
|
||||||
UserCode = t.DoctorUser.UserCode,
|
UserCode = t.DoctorUser.IdentityUser.UserCode,
|
||||||
UserName = t.DoctorUser.UserName
|
UserName = t.DoctorUser.IdentityUser.UserName
|
||||||
}).ToList(),
|
}).ToList(),
|
||||||
|
|
||||||
ValidVisitCount = t.SubjectVisitTaskList.AsQueryable().Where(visitTaskFilter).GroupBy(t => new { t.SubjectId, t.VisitTaskNum }).Where(g => g.Count() == 2).Count(),
|
ValidVisitCount = t.SubjectVisitTaskList.AsQueryable().Where(visitTaskFilter).GroupBy(t => new { t.SubjectId, t.VisitTaskNum }).Where(g => g.Count() == 2).Count(),
|
||||||
@@ -784,7 +784,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
var taskConsistentRuleQueryable = from enroll in _enrollRepository.Where(t => t.TrialId == trialId && t.EnrollStatus == EnrollStatus.ConfirmIntoGroup
|
var taskConsistentRuleQueryable = from enroll in _enrollRepository.Where(t => t.TrialId == trialId && t.EnrollStatus == EnrollStatus.ConfirmIntoGroup
|
||||||
&& t.EnrollReadingCriteriaList.Any(c => c.TrialReadingCriterionId == inQuery.TrialReadingCriterionId && c.IsJoinAnalysis))
|
&& t.EnrollReadingCriteriaList.Any(c => c.TrialReadingCriterionId == inQuery.TrialReadingCriterionId && c.IsJoinAnalysis))
|
||||||
join user in _userRepository.Where() on enroll.DoctorUserId equals user.Id
|
join user in _userRoleRepository.Where() on enroll.DoctorUserId equals user.Id
|
||||||
join taskConsistentRule in _taskConsistentRuleRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId && t.IsSelfAnalysis) on enroll.TrialId equals taskConsistentRule.TrialId
|
join taskConsistentRule in _taskConsistentRuleRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId && t.IsSelfAnalysis) on enroll.TrialId equals taskConsistentRule.TrialId
|
||||||
select new TaskConsistentRuleView()
|
select new TaskConsistentRuleView()
|
||||||
{
|
{
|
||||||
@@ -830,9 +830,9 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
AnalysisDoctorUser = new UserSimpleInfo()
|
AnalysisDoctorUser = new UserSimpleInfo()
|
||||||
{
|
{
|
||||||
UserId = user.Id,
|
UserId = user.Id,
|
||||||
UserCode = user.UserCode,
|
UserCode = user.IdentityUser.UserCode,
|
||||||
FullName = user.FullName,
|
FullName = user.IdentityUser.FullName,
|
||||||
UserName = user.UserName
|
UserName = user.IdentityUser.UserName
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(GroupName = "Trial")]
|
[ApiExplorerSettings(GroupName = "Trial")]
|
||||||
public class TaskMedicalReviewRuleService(IRepository<TaskMedicalReviewRule> _taskMedicalReviewRuleRepository,
|
public class TaskMedicalReviewRuleService(IRepository<TaskMedicalReviewRule> _taskMedicalReviewRuleRepository,
|
||||||
IRepository<TrialUser> _trialUserRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITaskMedicalReviewRuleService
|
IRepository<TrialUserRole> _trialUserRoleRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITaskMedicalReviewRuleService
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
var taskTaskMedicalReviewRuleQueryable = _taskMedicalReviewRuleRepository.Where(t => t.TrialId == inQuery.TrialId)
|
var taskTaskMedicalReviewRuleQueryable = _taskMedicalReviewRuleRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||||
.ProjectTo<TaskMedicalReviewRuleView>(_mapper.ConfigurationProvider);
|
.ProjectTo<TaskMedicalReviewRuleView>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
var isHaveMIM = await _trialUserRepository.AnyAsync(t => t.User.UserTypeEnum == Domain.Share.UserTypeEnum.MIM && t.TrialId == inQuery.TrialId);
|
var isHaveMIM = await _trialUserRoleRepository.AnyAsync(t => t.UserRole.UserTypeEnum == Domain.Share.UserTypeEnum.MIM && t.TrialId == inQuery.TrialId);
|
||||||
|
|
||||||
return (await taskTaskMedicalReviewRuleQueryable.ToListAsync(), new { IsHaveMIM = isHaveMIM });
|
return (await taskTaskMedicalReviewRuleQueryable.ToListAsync(), new { IsHaveMIM = isHaveMIM });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(GroupName = "Trial")]
|
[ApiExplorerSettings(GroupName = "Trial")]
|
||||||
public class TaskMedicalReviewService(IRepository<TaskMedicalReview> _taskMedicalReviewRepository,
|
public class TaskMedicalReviewService(IRepository<TaskMedicalReview> _taskMedicalReviewRepository,
|
||||||
IRepository<TrialUser> _trialUserRepository,
|
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||||
IRepository<VisitTask> _visitTaskRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITaskMedicalReviewService
|
IRepository<VisitTask> _visitTaskRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITaskMedicalReviewService
|
||||||
{
|
{
|
||||||
@@ -196,7 +196,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
public async Task<IResponseOutput<PageOutput<TaskMedicalReviewView>>> GetMIMMedicalReviewTaskList(TaskMedicalReviewQuery inQuery)
|
public async Task<IResponseOutput<PageOutput<TaskMedicalReviewView>>> GetMIMMedicalReviewTaskList(TaskMedicalReviewQuery inQuery)
|
||||||
{
|
{
|
||||||
|
|
||||||
var taskMedicalReviewQueryable = _taskMedicalReviewRepository.Where(t => t.VisitTask.TrialId == inQuery.TrialId && t.MedicalManagerUserId == _userInfo.Id && t.VisitTask.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
var taskMedicalReviewQueryable = _taskMedicalReviewRepository.Where(t => t.VisitTask.TrialId == inQuery.TrialId && t.MedicalManagerUserId == _userInfo.UserRoleId && t.VisitTask.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
||||||
|
|
||||||
.WhereIf(inQuery.IsGetNextMedicalReviewTask,
|
.WhereIf(inQuery.IsGetNextMedicalReviewTask,
|
||||||
x => (
|
x => (
|
||||||
@@ -328,7 +328,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
[HttpGet("{trialId:guid}")]
|
[HttpGet("{trialId:guid}")]
|
||||||
public async Task<List<UserSimpleInfo>> GetMIMUserList(Guid trialId)
|
public async Task<List<UserSimpleInfo>> GetMIMUserList(Guid trialId)
|
||||||
{
|
{
|
||||||
var query = _trialUserRepository.Where(t => (t.User.UserTypeEnum == Domain.Share.UserTypeEnum.MIM || t.User.UserTypeEnum == Domain.Share.UserTypeEnum.MC) && t.TrialId == trialId).Select(t => t.User).ProjectTo<UserSimpleInfo>(_mapper.ConfigurationProvider);
|
var query = _trialUserRoleRepository.Where(t => (t.UserRole.UserTypeEnum == Domain.Share.UserTypeEnum.MIM || t.UserRole.UserTypeEnum == Domain.Share.UserTypeEnum.MC) && t.TrialId == trialId).Select(t => t.UserRole).ProjectTo<UserSimpleInfo>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
return await query.ToListAsync();
|
return await query.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -17,9 +17,9 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
|
|
||||||
CreateMap<TaskAllocationRule, TaskAllocationRuleView>()
|
CreateMap<TaskAllocationRule, TaskAllocationRuleView>()
|
||||||
.ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.UserCode))
|
.ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.IdentityUser.UserCode))
|
||||||
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
|
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.IdentityUser.UserName))
|
||||||
.ForMember(o => o.FullName, t => t.MapFrom(u => u.DoctorUser.FullName))
|
.ForMember(o => o.FullName, t => t.MapFrom(u => u.DoctorUser.IdentityUser.FullName))
|
||||||
.ForMember(o => o.UserTypeShortName, t => t.MapFrom(u => u.DoctorUser.UserTypeRole.UserTypeShortName));
|
.ForMember(o => o.UserTypeShortName, t => t.MapFrom(u => u.DoctorUser.UserTypeRole.UserTypeShortName));
|
||||||
|
|
||||||
List<Guid> subjectIdList = new List<Guid>();
|
List<Guid> subjectIdList = new List<Guid>();
|
||||||
@@ -27,9 +27,9 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
|
|
||||||
CreateMap<TaskAllocationRule, DoctorVisitTaskStatView>()
|
CreateMap<TaskAllocationRule, DoctorVisitTaskStatView>()
|
||||||
.ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.UserCode))
|
.ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.IdentityUser.UserCode))
|
||||||
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
|
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.IdentityUser.UserName))
|
||||||
.ForMember(o => o.FullName, t => t.MapFrom(u => u.DoctorUser.FullName))
|
.ForMember(o => o.FullName, t => t.MapFrom(u => u.DoctorUser.IdentityUser.FullName))
|
||||||
.ForMember(o => o.UserTypeShortName, t => t.MapFrom(u => u.DoctorUser.UserTypeRole.UserTypeShortName))
|
.ForMember(o => o.UserTypeShortName, t => t.MapFrom(u => u.DoctorUser.UserTypeRole.UserTypeShortName))
|
||||||
//.ForMember(o => o.ArmList, t => t.MapFrom(u => u.DoctorVisitTaskList.Where(c => c.TrialId == u.TrialId).Select(t => t.ArmEnum).Distinct()))
|
//.ForMember(o => o.ArmList, t => t.MapFrom(u => u.DoctorVisitTaskList.Where(c => c.TrialId == u.TrialId).Select(t => t.ArmEnum).Distinct()))
|
||||||
.ForMember(o => o.TotalTaskCount, t => t.MapFrom(u => u.Trial.VisitTaskList.Count()))
|
.ForMember(o => o.TotalTaskCount, t => t.MapFrom(u => u.Trial.VisitTaskList.Count()))
|
||||||
@@ -127,9 +127,9 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => /*u.IsAnalysisCreate == true ? u.BlindSubjectCode :*/ u.Subject.Code))
|
.ForMember(o => o.SubjectCode, t => t.MapFrom(u => /*u.IsAnalysisCreate == true ? u.BlindSubjectCode :*/ u.Subject.Code))
|
||||||
.ForMember(o => o.MedicalNo, t => t.MapFrom(u => u.Subject.MedicalNo))
|
.ForMember(o => o.MedicalNo, t => t.MapFrom(u => u.Subject.MedicalNo))
|
||||||
|
|
||||||
.ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.UserCode))
|
.ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.IdentityUser.UserCode))
|
||||||
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
|
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.IdentityUser.UserName))
|
||||||
.ForMember(o => o.FullName, t => t.MapFrom(u => u.DoctorUser.FullName))
|
.ForMember(o => o.FullName, t => t.MapFrom(u => u.DoctorUser.IdentityUser.FullName))
|
||||||
.ForMember(o => o.UserTypeShortName, t => t.MapFrom(u => u.DoctorUser.UserTypeRole.UserTypeShortName))
|
.ForMember(o => o.UserTypeShortName, t => t.MapFrom(u => u.DoctorUser.UserTypeRole.UserTypeShortName))
|
||||||
//.ForMember(o => o.IsClinicalDataSigned, t => t.MapFrom(u => u.Subject.ClinicalDataList.Any(c => c.IsSign && (c.ReadingId == u.SouceReadModuleId || c.ReadingId == u.SourceSubjectVisitId))))
|
//.ForMember(o => o.IsClinicalDataSigned, t => t.MapFrom(u => u.Subject.ClinicalDataList.Any(c => c.IsSign && (c.ReadingId == u.SouceReadModuleId || c.ReadingId == u.SourceSubjectVisitId))))
|
||||||
;
|
;
|
||||||
@@ -176,9 +176,9 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
|
|
||||||
CreateMap<VisitTask, HistoryReadingDoctorUser>()
|
CreateMap<VisitTask, HistoryReadingDoctorUser>()
|
||||||
.ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.UserCode))
|
.ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.IdentityUser.UserCode))
|
||||||
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
|
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.IdentityUser.UserName))
|
||||||
.ForMember(o => o.FullName, t => t.MapFrom(u => u.DoctorUser.FullName))
|
.ForMember(o => o.FullName, t => t.MapFrom(u => u.DoctorUser.IdentityUser.FullName))
|
||||||
.ForMember(o => o.JudgeTaskCode, t => t.MapFrom(u => u.TaskCode))
|
.ForMember(o => o.JudgeTaskCode, t => t.MapFrom(u => u.TaskCode))
|
||||||
.ForMember(o => o.DoctorUserId, t => t.MapFrom(u => u.DoctorUser.Id));
|
.ForMember(o => o.DoctorUserId, t => t.MapFrom(u => u.DoctorUser.Id));
|
||||||
|
|
||||||
@@ -195,9 +195,9 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
CreateMap<SubjectUser, AssignDoctorView>()
|
CreateMap<SubjectUser, AssignDoctorView>()
|
||||||
//.ForMember(o => o.AssignTime, t => t.MapFrom(u => u.AssignTime))
|
//.ForMember(o => o.AssignTime, t => t.MapFrom(u => u.AssignTime))
|
||||||
.ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.UserCode))
|
.ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.IdentityUser.UserCode))
|
||||||
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName))
|
.ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.IdentityUser.UserName))
|
||||||
.ForMember(o => o.FullName, t => t.MapFrom(u => u.DoctorUser.FullName))
|
.ForMember(o => o.FullName, t => t.MapFrom(u => u.DoctorUser.IdentityUser.FullName))
|
||||||
.ForMember(o => o.UserTypeShortName, t => t.MapFrom(u => u.DoctorUser.UserTypeRole.UserTypeShortName));
|
.ForMember(o => o.UserTypeShortName, t => t.MapFrom(u => u.DoctorUser.UserTypeRole.UserTypeShortName));
|
||||||
|
|
||||||
|
|
||||||
@@ -205,7 +205,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
CreateMap<TaskAllocationRuleAddOrEdit, TaskAllocationRule>();
|
CreateMap<TaskAllocationRuleAddOrEdit, TaskAllocationRule>();
|
||||||
|
|
||||||
|
|
||||||
CreateMap<User, TrialDoctorUserSelectView>()
|
CreateMap<UserRole, TrialDoctorUserSelectView>()
|
||||||
.ForMember(o => o.DoctorUserId, t => t.MapFrom(u => u.Id))
|
.ForMember(o => o.DoctorUserId, t => t.MapFrom(u => u.Id))
|
||||||
.ForMember(o => o.FullName, t => t.MapFrom(u => u.FullName));
|
.ForMember(o => o.FullName, t => t.MapFrom(u => u.FullName));
|
||||||
|
|
||||||
@@ -250,12 +250,12 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
CreateMap<User, UserSimpleInfo>()
|
CreateMap<UserRole, UserSimpleInfo>()
|
||||||
|
|
||||||
.ForMember(o => o.UserId, t => t.MapFrom(u => u.Id))
|
.ForMember(o => o.UserId, t => t.MapFrom(u => u.Id))
|
||||||
.ForMember(o => o.UserCode, t => t.MapFrom(u => u.UserCode))
|
.ForMember(o => o.UserCode, t => t.MapFrom(u => u.IdentityUser.UserCode))
|
||||||
.ForMember(o => o.UserName, t => t.MapFrom(u => u.UserName))
|
.ForMember(o => o.UserName, t => t.MapFrom(u => u.IdentityUser.UserName))
|
||||||
.ForMember(o => o.FullName, t => t.MapFrom(u => u.FullName));
|
.ForMember(o => o.FullName, t => t.MapFrom(u => u.IdentityUser.FullName));
|
||||||
//.ForMember(o => o.UserTypeShortName, t => t.MapFrom(u => u.UserTypeRole.UserTypeShortName));
|
//.ForMember(o => o.UserTypeShortName, t => t.MapFrom(u => u.UserTypeRole.UserTypeShortName));
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
.WhereIf(queryCommonDocument.CriterionTypeEnum != null, t => t.CriterionTypeEnum == queryCommonDocument.CriterionTypeEnum)
|
.WhereIf(queryCommonDocument.CriterionTypeEnum != null, t => t.CriterionTypeEnum == queryCommonDocument.CriterionTypeEnum)
|
||||||
.WhereIf(queryCommonDocument.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == queryCommonDocument.BusinessScenarioEnum)
|
.WhereIf(queryCommonDocument.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == queryCommonDocument.BusinessScenarioEnum)
|
||||||
.WhereIf(!string.IsNullOrEmpty(queryCommonDocument.Code), t => t.Code.Contains(queryCommonDocument.Code))
|
.WhereIf(!string.IsNullOrEmpty(queryCommonDocument.Code), t => t.Code.Contains(queryCommonDocument.Code))
|
||||||
.WhereIf(!string.IsNullOrEmpty(queryCommonDocument.Name), t => t.Name.Contains(queryCommonDocument.Name))
|
.WhereIf(!string.IsNullOrEmpty(queryCommonDocument.Name), t => t.Name.Contains(queryCommonDocument.Name) || t.NameCN.Contains(queryCommonDocument.Name))
|
||||||
.ProjectTo<CommonDocumentView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, userId = _userInfo.Id });
|
.ProjectTo<CommonDocumentView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, userId = _userInfo.UserRoleId });
|
||||||
|
|
||||||
return await commonDocumentQueryable.ToPagedListAsync(queryCommonDocument);
|
return await commonDocumentQueryable.ToPagedListAsync(queryCommonDocument);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,9 @@
|
|||||||
// 生成时间 2022-02-15 11:55:57
|
// 生成时间 2022-02-15 11:55:57
|
||||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
using IRaCIS.Core.Application.Helper;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
namespace IRaCIS.Core.Application.Contracts
|
namespace IRaCIS.Core.Application.Contracts
|
||||||
{
|
{
|
||||||
public class TrialSelectEmailNoticeConfigView : EmailNoticeConfigView
|
public class TrialSelectEmailNoticeConfigView : EmailNoticeConfigView
|
||||||
@@ -62,7 +64,15 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
public bool? IsDistinguishCriteria { get; set; }
|
public bool? IsDistinguishCriteria { get; set; }
|
||||||
|
|
||||||
public SysEmailLevel? SystemLevel { get; set; }
|
public SysEmailLevel? SystemLevel { get; set; }
|
||||||
public int? BusinessModuleEnum { get; set; }
|
public BusinessModule? BusinessModuleEnum { get; set; }
|
||||||
|
|
||||||
|
public int? EmailUrgentEnum { get; set; }
|
||||||
|
|
||||||
|
public UserTypeEnum? ToUserType { get; set; }
|
||||||
|
|
||||||
|
public UserTypeEnum? CopyUserType { get; set; }
|
||||||
|
|
||||||
|
public BusinessLevel? BusinessLevelEnum { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,8 +143,41 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class EmailNoticeConfigExportDto
|
||||||
|
{
|
||||||
|
public Guid? Id { get; set; }
|
||||||
|
public string Code { get; set; } = String.Empty;
|
||||||
|
|
||||||
|
|
||||||
|
[DictionaryTranslate("Email_BusinessScenario")]
|
||||||
|
public EmailBusinessScenario BusinessScenarioEnum { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
[DictionaryTranslate("YesOrNo")]
|
||||||
|
public bool IsDistinguishCriteria { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
[DictionaryTranslate("CriterionType")]
|
||||||
|
public CriterionType? CriterionTypeEnum { get; set; }
|
||||||
|
|
||||||
|
[DictionaryTranslate("BusinessModule")]
|
||||||
|
public int BusinessModuleEnum { get; set; }
|
||||||
|
|
||||||
|
[DictionaryTranslate("BusinessLevel")]
|
||||||
|
public int BusinessLevelEnum { get; set; }
|
||||||
|
|
||||||
|
[DictionaryTranslate("EmailUrgent")]
|
||||||
|
public int EmailUrgentEnum { get; set; }
|
||||||
|
|
||||||
|
public string Description { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
|
public string EmailTopic { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string EmailTopicCN { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -110,6 +110,10 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||||||
|
|
||||||
public string Module { get; set; } = string.Empty;
|
public string Module { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public int? State { get; set; }
|
||||||
|
|
||||||
|
public int InternationalizationType { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BatchAddInternationalizationDto : BatchInternationalizationDto
|
public class BatchAddInternationalizationDto : BatchInternationalizationDto
|
||||||
@@ -119,6 +123,9 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||||||
|
|
||||||
public class InternationalizationSimpleDto : BatchInternationalizationDto
|
public class InternationalizationSimpleDto : BatchInternationalizationDto
|
||||||
{
|
{
|
||||||
|
public string Version { get; set; }
|
||||||
|
|
||||||
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service.Common
|
|
||||||
{
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 开始时候一些帮助 比如根据配置的字典生成枚举
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="_dictionaryRepository"></param>
|
|
||||||
[ApiExplorerSettings(GroupName = "Common")]
|
|
||||||
public class DevelopService(IRepository<Dictionary> _dictionaryRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 根据配置的字典名生成后端枚举
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="dicName"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<IResponseOutput> BackDicGenerateEnum(string dicName)
|
|
||||||
{
|
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -26,37 +26,6 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrial, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IDictionaryService
|
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrial, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IDictionaryService
|
||||||
{
|
{
|
||||||
|
|
||||||
public async Task<IResponseOutput> GenerateEnumDefine(string code)
|
|
||||||
{
|
|
||||||
var searchList = await _dicRepository.Where(t => t.Parent.Code == code && t.ParentId != null && t.IsEnable).ProjectTo<BasicDicSelect>(_mapper.ConfigurationProvider).ToListAsync();
|
|
||||||
|
|
||||||
// StringBuilder 用于构建枚举代码字符串
|
|
||||||
var enumCode = new StringBuilder();
|
|
||||||
|
|
||||||
// 生成枚举定义
|
|
||||||
enumCode.AppendLine($"public enum {code}");
|
|
||||||
enumCode.AppendLine("{");
|
|
||||||
|
|
||||||
foreach (var item in searchList)
|
|
||||||
{
|
|
||||||
// 添加 XML 注释作为枚举描述
|
|
||||||
enumCode.AppendLine($" /// <summary>");
|
|
||||||
enumCode.AppendLine($" /// {item.ValueCN}"); // 假设你有一个描述字段
|
|
||||||
enumCode.AppendLine($" /// </summary>");
|
|
||||||
// 每个枚举值生成
|
|
||||||
enumCode.AppendLine($" {item.Value.Trim().Replace(" ", "")} = {item.Code},");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
enumCode.AppendLine("}");
|
|
||||||
|
|
||||||
// 返回生成的枚举代码
|
|
||||||
var enumStr = enumCode.ToString();
|
|
||||||
|
|
||||||
return ResponseOutput.Ok(enumStr);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 添加bool
|
/// 添加bool
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -25,10 +25,15 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
.WhereIf(inQuery.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys)
|
.WhereIf(inQuery.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys)
|
||||||
.WhereIf(inQuery.SystemLevel != null, t => t.SystemLevel == inQuery.SystemLevel)
|
.WhereIf(inQuery.SystemLevel != null, t => t.SystemLevel == inQuery.SystemLevel)
|
||||||
.WhereIf(inQuery.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == inQuery.IsDistinguishCriteria)
|
.WhereIf(inQuery.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == inQuery.IsDistinguishCriteria)
|
||||||
|
.WhereIf(inQuery.BusinessLevelEnum != null, t => t.BusinessLevelEnum == inQuery.BusinessLevelEnum)
|
||||||
.WhereIf(inQuery.CriterionTypeEnum != null, t => t.CriterionTypeEnum == inQuery.CriterionTypeEnum)
|
.WhereIf(inQuery.CriterionTypeEnum != null, t => t.CriterionTypeEnum == inQuery.CriterionTypeEnum)
|
||||||
|
.WhereIf(inQuery.BusinessModuleEnum != null, t => t.BusinessModuleEnum == inQuery.BusinessModuleEnum)
|
||||||
.WhereIf(inQuery.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == inQuery.BusinessScenarioEnum)
|
.WhereIf(inQuery.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == inQuery.BusinessScenarioEnum)
|
||||||
.WhereIf(inQuery.IsReturnRequired != null, t => t.IsReturnRequired == inQuery.IsReturnRequired)
|
.WhereIf(inQuery.IsReturnRequired != null, t => t.IsReturnRequired == inQuery.IsReturnRequired)
|
||||||
.WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable)
|
.WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable)
|
||||||
|
.WhereIf(inQuery.EmailUrgentEnum != null, t => t.EmailUrgentEnum == inQuery.EmailUrgentEnum)
|
||||||
|
.WhereIf(inQuery.ToUserType != null, t => t.EmailNoticeUserTypeList.Any(t => t.UserType == inQuery.ToUserType && t.EmailUserType == EmailUserType.To))
|
||||||
|
.WhereIf(inQuery.CopyUserType != null, t => t.EmailNoticeUserTypeList.Any(t => t.UserType == inQuery.CopyUserType && t.EmailUserType == EmailUserType.Copy))
|
||||||
.ProjectTo<EmailNoticeConfigView>(_mapper.ConfigurationProvider);
|
.ProjectTo<EmailNoticeConfigView>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
return await emailNoticeConfigQueryable.ToPagedListAsync(inQuery);
|
return await emailNoticeConfigQueryable.ToPagedListAsync(inQuery);
|
||||||
@@ -39,9 +44,10 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
{
|
{
|
||||||
var verifyExp1 = new EntityVerifyExp<EmailNoticeConfig>()
|
var verifyExp1 = new EntityVerifyExp<EmailNoticeConfig>()
|
||||||
{
|
{
|
||||||
VerifyExp = t => t.BusinessScenarioEnum == addOrEditEmailNoticeConfig.BusinessScenarioEnum,
|
VerifyExp = t => t.BusinessScenarioEnum == addOrEditEmailNoticeConfig.BusinessScenarioEnum && t.CriterionTypeEnum== addOrEditEmailNoticeConfig.CriterionTypeEnum,
|
||||||
|
|
||||||
VerifyMsg = _localizer["EmailNoticeConfig_RepeatEmailScenario"]
|
VerifyMsg = _localizer["EmailNoticeConfig_RepeatEmailScenario"]
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 匹配所有占位符的正则表达式,允许包含空格的占位符
|
// 匹配所有占位符的正则表达式,允许包含空格的占位符
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -25,10 +25,10 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
var exploreRecommendQueryable =
|
var exploreRecommendQueryable =
|
||||||
|
|
||||||
_exploreRecommendRepository.Where().IgnoreQueryFilters()
|
_exploreRecommendRepository.Where().IgnoreQueryFilters()
|
||||||
.WhereIf(string.IsNullOrEmpty(inQuery.Title), t => t.Title.Contains(inQuery.Title))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.Title), t => t.Title.Contains(inQuery.Title))
|
||||||
.WhereIf(string.IsNullOrEmpty(inQuery.FileName), t => t.Title.Contains(inQuery.FileName))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.FileName), t => t.Title.Contains(inQuery.FileName))
|
||||||
.WhereIf(string.IsNullOrEmpty(inQuery.DownloadUrl), t => t.Title.Contains(inQuery.DownloadUrl))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.DownloadUrl), t => t.Title.Contains(inQuery.DownloadUrl))
|
||||||
.WhereIf(string.IsNullOrEmpty(inQuery.Version), t => t.Title.Contains(inQuery.Version))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.Version), t => t.Title.Contains(inQuery.Version))
|
||||||
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == t.IsDeleted)
|
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == t.IsDeleted)
|
||||||
.ProjectTo<ExploreRecommendView>(_mapper.ConfigurationProvider);
|
.ProjectTo<ExploreRecommendView>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
#region DTO
|
#region DTO
|
||||||
public class DoctorDownloadInfo
|
public class DoctorDownloadInfo
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid? Id { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public string ReviewerCode { get; set; }
|
public string ReviewerCode { get; set; }
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
{
|
{
|
||||||
public int Language { get; set; }
|
public int Language { get; set; }
|
||||||
|
|
||||||
public List<Guid> DoctorIdList { get; set; }
|
public List<Guid?> DoctorIdList { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GetDoctoreAttachPathCommand
|
public class GetDoctoreAttachPathCommand
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(GroupName = "Common")]
|
[ApiExplorerSettings(GroupName = "Common")]
|
||||||
public class InternationalizationService(IRepository<Internationalization> _internationalizationRepository,
|
public class InternationalizationService(IRepository<Internationalization> _internationalizationRepository,
|
||||||
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IFusionCache _fusionCache) : BaseService, IInternationalizationService
|
IMapper _mapper, IRepository<PublishLog> _publishLogRepository, IStringLocalizer _localizer, IFusionCache _fusionCache) : BaseService, IInternationalizationService
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@@ -45,6 +45,11 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
ValueCN = t.ValueCN,
|
ValueCN = t.ValueCN,
|
||||||
FrontType = t.FrontType,
|
FrontType = t.FrontType,
|
||||||
Description = t.Description,
|
Description = t.Description,
|
||||||
|
Module = t.Module,
|
||||||
|
State = t.State,
|
||||||
|
Version = t.PublishLog.Version,
|
||||||
|
CreateTime = t.CreateTime,
|
||||||
|
InternationalizationType = t.InternationalizationType
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
await _fusionCache.SetAsync<List<InternationalizationSimpleDto>>(CacheKeys.FrontInternational, list, TimeSpan.FromDays(1));
|
await _fusionCache.SetAsync<List<InternationalizationSimpleDto>>(CacheKeys.FrontInternational, list, TimeSpan.FromDays(1));
|
||||||
@@ -55,15 +60,17 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 前端批量提交,后端判断不存在就添加,存在就更新
|
/// 前端批量提交,后端查询判断不存在就添加,存在就更新 (这里提交接口也能提交后端的标识,对后端标识进行更新)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public async Task<IResponseOutput> BatchAddOrUpdateFrontInternationalization(List<BatchInternationalizationDto> batchList)
|
public async Task<IResponseOutput> BatchAddOrUpdateFrontInternationalization(List<BatchInternationalizationDto> batchList)
|
||||||
{
|
{
|
||||||
|
var result = (await _publishLogRepository.Where(t => t.IsCurrentVersion == true).ProjectTo<PublishLogView>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
|
||||||
foreach (var item in batchList)
|
foreach (var item in batchList)
|
||||||
{
|
{
|
||||||
var find = await _internationalizationRepository.FirstOrDefaultAsync(t => t.Code == item.Code && t.Description == item.Description && t.InternationalizationType == 0);
|
var find = await _internationalizationRepository.FirstOrDefaultAsync(t => t.Code == item.Code && t.InternationalizationType == item.InternationalizationType);
|
||||||
|
|
||||||
if (find != null)
|
if (find != null)
|
||||||
{
|
{
|
||||||
@@ -71,13 +78,21 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
|
var frontState = item.State == null ? 0 : (int)item.State;
|
||||||
|
|
||||||
var mapItem = _mapper.Map<Internationalization>(item);
|
var mapItem = _mapper.Map<Internationalization>(item);
|
||||||
mapItem.InternationalizationType = 0;
|
//mapItem.InternationalizationType = 0;
|
||||||
|
|
||||||
// 0 是预翻译 1是已确认 2是后端废弃
|
// 0 是预翻译 1是已确认 2是后端废弃
|
||||||
mapItem.State = 0;
|
mapItem.State = frontState;
|
||||||
|
|
||||||
await _internationalizationRepository.AddAsync(mapItem);
|
find = await _internationalizationRepository.AddAsync(mapItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (find.PublishLogId == null || find.PublishLogId == Guid.Empty)
|
||||||
|
{
|
||||||
|
find.PublishLogId = result.Id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await _internationalizationRepository.SaveChangesAsync();
|
await _internationalizationRepository.SaveChangesAsync();
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
using IRaCIS.Application.Contracts;
|
using IRaCIS.Application.Contracts;
|
||||||
using IRaCIS.Core.Application.Auth;
|
using IRaCIS.Core.Application.Auth;
|
||||||
using IRaCIS.Core.Application.Helper;
|
using IRaCIS.Core.Application.Helper;
|
||||||
|
using IRaCIS.Core.Domain.Models;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infrastructure;
|
using IRaCIS.Core.Infrastructure;
|
||||||
using MailKit;
|
using MailKit;
|
||||||
using Medallion.Threading;
|
using Medallion.Threading;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.AspNetCore.Identity;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using MimeKit;
|
using MimeKit;
|
||||||
|
|
||||||
@@ -29,11 +31,11 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
Task AdminResetPwdSendEmailAsync(Guid userId, string pwdNotMd5 = "123456");
|
Task AdminResetPwdSendEmailAsync(Guid userId, string pwdNotMd5 = "123456");
|
||||||
|
|
||||||
Task SiteSurveyUserJoinEmail(Guid trialId, Guid userId, string baseUrl, string rootUrl);
|
Task SiteSurveyUserJoinEmail(Guid trialId, Guid userId, string userTypes, string baseUrl, string rootUrl);
|
||||||
|
|
||||||
Task ExternalUserJoinEmail(Guid trialId, Guid userId, string baseUrl, string rootUrl);
|
Task ExternalUserJoinEmail(Guid trialId, Guid userId, string userTypes, string baseUrl, string rootUrl);
|
||||||
|
|
||||||
Task<Guid> DoctorJoinTrialEmail(Guid trialId, Guid doctorId, string baseUrl, string rootUrl);
|
Task<(Guid identityUserId, Guid userRoleId)> DoctorJoinTrialEmail(Guid trialId, Guid doctorId, string baseUrl, string rootUrl);
|
||||||
|
|
||||||
Task UserFeedBackMail(Guid feedBackId);
|
Task UserFeedBackMail(Guid feedBackId);
|
||||||
}
|
}
|
||||||
@@ -42,7 +44,9 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
IRepository<SystemBasicData> _systemBasicDatarepository,
|
IRepository<SystemBasicData> _systemBasicDatarepository,
|
||||||
IRepository<VisitTask> _visitTaskRepository,
|
IRepository<VisitTask> _visitTaskRepository,
|
||||||
IRepository<TrialSite> _trialSiteRepository,
|
IRepository<TrialSite> _trialSiteRepository,
|
||||||
IRepository<User> _userRepository,
|
IRepository<UserRole> _userRoleRepository,
|
||||||
|
IRepository<UserLog> _userLogRepository,
|
||||||
|
IRepository<IdentityUser> _identityUserRepository,
|
||||||
IRepository<UserFeedBack> _userFeedBackRepository,
|
IRepository<UserFeedBack> _userFeedBackRepository,
|
||||||
ITokenService _tokenService,
|
ITokenService _tokenService,
|
||||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||||
@@ -169,83 +173,11 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig, sucessHandle);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig, sucessHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
//用户重置邮箱
|
|
||||||
public async Task SendMailEditEmail(Guid userId, string userName, string emailAddress, int verificationCode)
|
|
||||||
{
|
|
||||||
|
|
||||||
var messageToSend = new MimeMessage();
|
|
||||||
//发件地址
|
|
||||||
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
|
||||||
//收件地址
|
|
||||||
messageToSend.To.Add(new MailboxAddress(userName, emailAddress));
|
|
||||||
//主题
|
|
||||||
//---[来自展影IRC] 关于重置邮箱的提醒
|
|
||||||
|
|
||||||
var companyName = _userInfo.IsEn_Us ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
|
|
||||||
|
|
||||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
|
||||||
{
|
|
||||||
var topicStr = string.Format(input.topicStr, companyName);
|
|
||||||
|
|
||||||
var htmlBodyStr = string.Format(ReplaceCompanyName(input.htmlBodyStr),
|
|
||||||
|
|
||||||
userName,
|
|
||||||
//---您正在进行邮箱重置操作
|
|
||||||
verificationCode
|
|
||||||
);
|
|
||||||
|
|
||||||
return (topicStr, htmlBodyStr);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
await GetEmailSubejctAndHtmlInfoAndBuildAsync(EmailBusinessScenario.UserResetEmail, messageToSend, emailConfigFunc);
|
|
||||||
|
|
||||||
|
|
||||||
var sucessHandle = GetEmailSuccessHandle(userId, verificationCode, emailAddress);
|
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig, sucessHandle);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//不登录 通过邮箱重置密码
|
|
||||||
public async Task AnolymousSendEmailForResetAccount(string emailAddress, int verificationCode)
|
|
||||||
{
|
|
||||||
var messageToSend = new MimeMessage();
|
|
||||||
//发件地址
|
|
||||||
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
|
||||||
//收件地址
|
|
||||||
messageToSend.To.Add(new MailboxAddress(String.Empty, emailAddress));
|
|
||||||
|
|
||||||
|
|
||||||
var companyName = _userInfo.IsEn_Us ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
|
|
||||||
|
|
||||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
|
||||||
{
|
|
||||||
var topicStr = string.Format(input.topicStr, companyName);
|
|
||||||
|
|
||||||
var htmlBodyStr = string.Format(ReplaceCompanyName(input.htmlBodyStr),
|
|
||||||
|
|
||||||
"Sir/Madam",
|
|
||||||
//---您正在进行邮箱重置密码操作
|
|
||||||
verificationCode
|
|
||||||
);
|
|
||||||
|
|
||||||
return (topicStr, htmlBodyStr);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
await GetEmailSubejctAndHtmlInfoAndBuildAsync(EmailBusinessScenario.UnloginUseEmailResetPassword, messageToSend, emailConfigFunc);
|
|
||||||
|
|
||||||
////此时不知道用户
|
|
||||||
var sucessHandle = GetEmailSuccessHandle(Guid.Empty, verificationCode, emailAddress);
|
|
||||||
|
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig, sucessHandle);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reviewer简历录入 发送验证码
|
/// Reviewer简历录入 发送验证码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -333,12 +265,13 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region 邮件已修改
|
||||||
|
|
||||||
//添加用户发送邮件
|
//添加用户发送邮件
|
||||||
public async Task AddUserSendEmailAsync(Guid userId, string baseUrl, string routeUrl)
|
public async Task AddUserSendEmailAsync(Guid userId, string baseUrl, string routeUrl)
|
||||||
{
|
{
|
||||||
|
|
||||||
var sysUserInfo = (await _userRepository.Where(t => t.Id == userId).Include(t => t.UserTypeRole).FirstOrDefaultAsync()).IfNullThrowException();
|
var sysUserInfo = (await _identityUserRepository.Where(t => t.Id == userId).Include(t => t.UserRoleList).ThenInclude(c => c.UserTypeRole).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
|
||||||
|
|
||||||
var messageToSend = new MimeMessage();
|
var messageToSend = new MimeMessage();
|
||||||
@@ -350,11 +283,11 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
//---[来自展影IRC] 关于创建账户的提醒
|
//---[来自展影IRC] 关于创建账户的提醒
|
||||||
|
|
||||||
|
|
||||||
var token = _tokenService.GetToken(IRaCISClaims.Create(_mapper.Map<UserBasicInfo>(sysUserInfo)));
|
var token = _tokenService.GetToken(new UserTokenInfo() { IdentityUserId = sysUserInfo.Id });
|
||||||
|
|
||||||
await _userRepository.BatchUpdateNoTrackingAsync(t => t.Id == sysUserInfo.Id, u => new User() { EmailToken = token });
|
await _identityUserRepository.BatchUpdateNoTrackingAsync(t => t.Id == sysUserInfo.Id, u => new IdentityUser() { EmailToken = token });
|
||||||
|
|
||||||
routeUrl = routeUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&UserName=" + sysUserInfo.UserName + "&UserType=" + sysUserInfo.UserTypeRole.UserTypeShortName + "&lang=" + (_userInfo.IsEn_Us ? "en" : "zh") + "&access_token=" + token;
|
routeUrl = routeUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&UserName=" + sysUserInfo.UserName + "&lang=" + (_userInfo.IsEn_Us ? "en" : "zh") + "&access_token=" + token;
|
||||||
|
|
||||||
var domain = baseUrl.Substring(0, baseUrl.IndexOf("/login"));
|
var domain = baseUrl.Substring(0, baseUrl.IndexOf("/login"));
|
||||||
|
|
||||||
@@ -370,8 +303,8 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
var htmlBodyStr = string.Format(ReplaceCompanyName(input.htmlBodyStr),
|
var htmlBodyStr = string.Format(ReplaceCompanyName(input.htmlBodyStr),
|
||||||
|
|
||||||
sysUserInfo.FullName,
|
sysUserInfo.FullName,
|
||||||
sysUserInfo.UserName,
|
sysUserInfo.EMail,
|
||||||
sysUserInfo.UserTypeRole.UserTypeShortName,
|
//string.Join(',', sysUserInfo.UserRoleList.Select(t => t.UserTypeRole.UserTypeShortName)),
|
||||||
redirectUrl
|
redirectUrl
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -388,7 +321,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
//管理员重置密码发送邮件
|
//管理员重置密码发送邮件
|
||||||
public async Task AdminResetPwdSendEmailAsync(Guid userId, string pwdNotMd5 = "123456")
|
public async Task AdminResetPwdSendEmailAsync(Guid userId, string pwdNotMd5 = "123456")
|
||||||
{
|
{
|
||||||
var sysUserInfo = (await _userRepository.Where(t => t.Id == userId).Include(t => t.UserTypeRole).FirstOrDefaultAsync()).IfNullThrowException();
|
var sysUserInfo = (await _identityUserRepository.Where(t => t.Id == userId).Include(t => t.UserRoleList).ThenInclude(c => c.UserTypeRole).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
|
||||||
var messageToSend = new MimeMessage();
|
var messageToSend = new MimeMessage();
|
||||||
//发件地址
|
//发件地址
|
||||||
@@ -408,7 +341,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
sysUserInfo.FullName,
|
sysUserInfo.FullName,
|
||||||
sysUserInfo.UserName,
|
sysUserInfo.UserName,
|
||||||
sysUserInfo.UserTypeRole.UserTypeShortName,
|
//string.Join(',', sysUserInfo.UserRoleList.Select(t => t.UserTypeRole.UserTypeShortName)),
|
||||||
pwdNotMd5
|
pwdNotMd5
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -421,73 +354,88 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//用户重置邮箱
|
||||||
//Site调研 用户加入项目
|
public async Task SendMailEditEmail(Guid userId, string userName, string emailAddress, int verificationCode)
|
||||||
public async Task SiteSurveyUserJoinEmail(Guid trialId, Guid userId, string baseUrl, string rootUrl)
|
|
||||||
{
|
{
|
||||||
var sysUserInfo = (await _userRepository.Where(t => t.Id == userId).Include(t => t.UserTypeRole).FirstOrDefaultAsync()).IfNullThrowException();
|
|
||||||
|
|
||||||
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId);
|
|
||||||
|
|
||||||
var messageToSend = new MimeMessage();
|
var messageToSend = new MimeMessage();
|
||||||
//发件地址
|
//发件地址
|
||||||
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
||||||
//收件地址
|
//收件地址
|
||||||
messageToSend.To.Add(new MailboxAddress(sysUserInfo.FullName, sysUserInfo.EMail));
|
messageToSend.To.Add(new MailboxAddress(userName, emailAddress));
|
||||||
//主题
|
//主题
|
||||||
// $"[来自展影IRC] [{trialInfo.ResearchProgramNo}]邀请信";
|
//---[来自展影IRC] 关于重置邮箱的提醒
|
||||||
|
|
||||||
|
|
||||||
var token = _tokenService.GetToken(IRaCISClaims.Create(_mapper.Map<UserBasicInfo>(sysUserInfo)));
|
|
||||||
|
|
||||||
if (sysUserInfo.IsFirstAdd)
|
|
||||||
{
|
|
||||||
await _userRepository.BatchUpdateNoTrackingAsync(t => t.Id == sysUserInfo.Id, u => new User() { EmailToken = token });
|
|
||||||
}
|
|
||||||
|
|
||||||
var routeUrl = rootUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&UserName=" + sysUserInfo.UserName + "&UserType=" + sysUserInfo.UserTypeRole.UserTypeShortName + "&lang=" + (_userInfo.IsEn_Us ? "en" : "zh") + "&access_token=" + token;
|
|
||||||
|
|
||||||
var domain = baseUrl.Substring(0, baseUrl.IndexOf("/login"));
|
|
||||||
|
|
||||||
var redirectUrl = $"{domain}/api/User/UserRedirect?url={System.Web.HttpUtility.UrlEncode(routeUrl)}";
|
|
||||||
|
|
||||||
|
|
||||||
var companyName = _userInfo.IsEn_Us ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
|
var companyName = _userInfo.IsEn_Us ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
|
||||||
|
|
||||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
||||||
{
|
{
|
||||||
var topicStr = string.Format(input.topicStr, companyName, trialInfo.ResearchProgramNo);
|
var topicStr = string.Format(input.topicStr, companyName);
|
||||||
|
|
||||||
var htmlBodyStr = string.Format(ReplaceCompanyName(input.htmlBodyStr),
|
var htmlBodyStr = string.Format(ReplaceCompanyName(input.htmlBodyStr),
|
||||||
|
|
||||||
sysUserInfo.FullName,
|
userName,
|
||||||
trialInfo.ExperimentName,
|
//---您正在进行邮箱重置操作
|
||||||
trialInfo.ResearchProgramNo,
|
verificationCode
|
||||||
trialInfo.TrialCode,
|
|
||||||
sysUserInfo.UserName,
|
|
||||||
sysUserInfo.UserTypeRole.UserTypeShortName,
|
|
||||||
sysUserInfo.IsFirstAdd ? redirectUrl : baseUrl
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return (topicStr, htmlBodyStr);
|
return (topicStr, htmlBodyStr);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
await GetEmailSubejctAndHtmlInfoAndBuildAsync(sysUserInfo.IsFirstAdd ? EmailBusinessScenario.SiteUseOrExternalUserFirstrJoinTrial : EmailBusinessScenario.SiteUserOrExternalUserExistJoinTrial, messageToSend, emailConfigFunc);
|
await GetEmailSubejctAndHtmlInfoAndBuildAsync(EmailBusinessScenario.UserResetEmail, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
var sucessHandle = GetEmailSuccessHandle(userId, verificationCode, emailAddress);
|
||||||
|
|
||||||
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig, sucessHandle);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//不登录 通过邮箱重置密码
|
||||||
|
public async Task AnolymousSendEmailForResetAccount(string emailAddress, int verificationCode)
|
||||||
|
{
|
||||||
|
var messageToSend = new MimeMessage();
|
||||||
|
//发件地址
|
||||||
|
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
||||||
|
//收件地址
|
||||||
|
messageToSend.To.Add(new MailboxAddress(String.Empty, emailAddress));
|
||||||
|
|
||||||
|
|
||||||
|
var companyName = _userInfo.IsEn_Us ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
|
||||||
|
|
||||||
|
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
||||||
|
{
|
||||||
|
var topicStr = string.Format(input.topicStr, companyName);
|
||||||
|
|
||||||
|
var htmlBodyStr = string.Format(ReplaceCompanyName(input.htmlBodyStr),
|
||||||
|
|
||||||
|
"Sir/Madam",
|
||||||
|
//---您正在进行邮箱重置密码操作
|
||||||
|
verificationCode
|
||||||
|
);
|
||||||
|
|
||||||
|
return (topicStr, htmlBodyStr);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
await GetEmailSubejctAndHtmlInfoAndBuildAsync(EmailBusinessScenario.UnloginUseEmailResetPassword, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
|
////此时不知道用户
|
||||||
|
var sucessHandle = GetEmailSuccessHandle(Guid.Empty, verificationCode, emailAddress);
|
||||||
|
|
||||||
|
|
||||||
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig, sucessHandle);
|
||||||
|
}
|
||||||
|
|
||||||
//外部用户 加入项目
|
//外部用户 加入项目
|
||||||
public async Task ExternalUserJoinEmail(Guid trialId, Guid userId, string baseUrl, string rootUrl)
|
public async Task ExternalUserJoinEmail(Guid trialId, Guid userId, string userTypes, string baseUrl, string rootUrl)
|
||||||
{
|
{
|
||||||
var trialInfo = (await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId)).IfNullThrowException();
|
var trialInfo = (await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId)).IfNullThrowException();
|
||||||
|
|
||||||
var sysUserInfo = (await _userRepository.Where(t => t.Id == userId).Include(t => t.UserTypeRole).FirstOrDefaultAsync()).IfNullThrowException();
|
var sysUserInfo = (await _identityUserRepository.Where(t => t.Id == userId).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
|
||||||
|
|
||||||
var messageToSend = new MimeMessage();
|
var messageToSend = new MimeMessage();
|
||||||
//发件地址
|
//发件地址
|
||||||
@@ -499,15 +447,15 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
var token = _tokenService.GetToken(IRaCISClaims.Create(_mapper.Map<UserBasicInfo>(sysUserInfo)));
|
var token = _tokenService.GetToken(new UserTokenInfo() { IdentityUserId = sysUserInfo.Id });
|
||||||
if (sysUserInfo.IsFirstAdd)
|
if (sysUserInfo.IsFirstAdd)
|
||||||
{
|
{
|
||||||
await _userRepository.BatchUpdateNoTrackingAsync(t => t.Id == sysUserInfo.Id, u => new User() { EmailToken = token });
|
await _identityUserRepository.BatchUpdateNoTrackingAsync(t => t.Id == sysUserInfo.Id, u => new Domain.Models.IdentityUser() { EmailToken = token });
|
||||||
}
|
}
|
||||||
|
|
||||||
var domain = baseUrl.Substring(0, baseUrl.IndexOf("/login"));
|
var domain = baseUrl.Substring(0, baseUrl.IndexOf("/login"));
|
||||||
|
|
||||||
var routeUrl = rootUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&UserName=" + sysUserInfo.UserName + "&UserType=" + sysUserInfo.UserTypeRole.UserTypeShortName + "&lang=" + (_userInfo.IsEn_Us ? "en" : "zh") + "&access_token=" + token;
|
var routeUrl = rootUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&lang=" + (_userInfo.IsEn_Us ? "en" : "zh") + "&access_token=" + token;
|
||||||
|
|
||||||
var redirectUrl = $"{domain}/api/User/UserRedirect?url={System.Web.HttpUtility.UrlEncode(routeUrl)}";
|
var redirectUrl = $"{domain}/api/User/UserRedirect?url={System.Web.HttpUtility.UrlEncode(routeUrl)}";
|
||||||
|
|
||||||
@@ -524,9 +472,9 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
trialInfo.ExperimentName,
|
trialInfo.ExperimentName,
|
||||||
trialInfo.ResearchProgramNo,
|
trialInfo.ResearchProgramNo,
|
||||||
trialInfo.TrialCode,
|
trialInfo.TrialCode,
|
||||||
sysUserInfo.UserName,
|
sysUserInfo.IsFirstAdd ? sysUserInfo.EMail : sysUserInfo.UserName,
|
||||||
sysUserInfo.UserTypeRole.UserTypeShortName,
|
userTypes,
|
||||||
sysUserInfo.IsFirstAdd ? redirectUrl : baseUrl
|
sysUserInfo.IsFirstAdd ? redirectUrl : baseUrl
|
||||||
);
|
);
|
||||||
|
|
||||||
return (topicStr, htmlBodyStr);
|
return (topicStr, htmlBodyStr);
|
||||||
@@ -540,26 +488,93 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Site调研 用户加入项目
|
||||||
|
public async Task SiteSurveyUserJoinEmail(Guid trialId, Guid userId, string userTypes, string baseUrl, string rootUrl)
|
||||||
|
{
|
||||||
|
var sysUserInfo = (await _identityUserRepository.Where(t => t.Id == userId).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId);
|
||||||
|
|
||||||
|
var messageToSend = new MimeMessage();
|
||||||
|
//发件地址
|
||||||
|
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
||||||
|
//收件地址
|
||||||
|
messageToSend.To.Add(new MailboxAddress(sysUserInfo.FullName, sysUserInfo.EMail));
|
||||||
|
//主题
|
||||||
|
// $"[来自展影IRC] [{trialInfo.ResearchProgramNo}]邀请信";
|
||||||
|
|
||||||
|
|
||||||
|
var token = _tokenService.GetToken(new UserTokenInfo() { IdentityUserId = sysUserInfo.Id });
|
||||||
|
|
||||||
|
if (sysUserInfo.IsFirstAdd)
|
||||||
|
{
|
||||||
|
await _identityUserRepository.BatchUpdateNoTrackingAsync(t => t.Id == sysUserInfo.Id, u => new Domain.Models.IdentityUser() { EmailToken = token });
|
||||||
|
}
|
||||||
|
|
||||||
|
var routeUrl = rootUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&lang=" + (_userInfo.IsEn_Us ? "en" : "zh") + "&access_token=" + token;
|
||||||
|
|
||||||
|
var domain = baseUrl.Substring(0, baseUrl.IndexOf("/login"));
|
||||||
|
|
||||||
|
var redirectUrl = $"{domain}/api/User/UserRedirect?url={System.Web.HttpUtility.UrlEncode(routeUrl)}";
|
||||||
|
|
||||||
|
|
||||||
|
var companyName = _userInfo.IsEn_Us ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
|
||||||
|
|
||||||
|
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
||||||
|
{
|
||||||
|
var topicStr = string.Format(input.topicStr, companyName, trialInfo.ResearchProgramNo);
|
||||||
|
|
||||||
|
var htmlBodyStr = string.Format(ReplaceCompanyName(input.htmlBodyStr),
|
||||||
|
|
||||||
|
sysUserInfo.FullName,
|
||||||
|
trialInfo.ExperimentName,
|
||||||
|
trialInfo.ResearchProgramNo,
|
||||||
|
trialInfo.TrialCode,
|
||||||
|
sysUserInfo.IsFirstAdd ? sysUserInfo.EMail : sysUserInfo.UserName,
|
||||||
|
userTypes,
|
||||||
|
sysUserInfo.IsFirstAdd ? redirectUrl : baseUrl
|
||||||
|
);
|
||||||
|
|
||||||
|
return (topicStr, htmlBodyStr);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
await GetEmailSubejctAndHtmlInfoAndBuildAsync(sysUserInfo.IsFirstAdd ? EmailBusinessScenario.SiteUseOrExternalUserFirstrJoinTrial : EmailBusinessScenario.SiteUserOrExternalUserExistJoinTrial, messageToSend, emailConfigFunc);
|
||||||
|
|
||||||
|
|
||||||
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
//医生生成账号加入 或者已存在账号加入到项目中
|
//医生生成账号加入 或者已存在账号加入到项目中
|
||||||
public async Task<Guid> DoctorJoinTrialEmail(Guid trialId, Guid doctorId, string baseUrl, string rootUrl)
|
public async Task<(Guid identityUserId, Guid userRoleId)> DoctorJoinTrialEmail(Guid trialId, Guid doctorId, string baseUrl, string rootUrl)
|
||||||
{
|
{
|
||||||
var doctor = await _doctorTypeRepository.FindAsync(doctorId);
|
var doctor = await _doctorTypeRepository.FindAsync(doctorId);
|
||||||
User sysUserInfo = new User();
|
var sysUserInfo = new IdentityUser();
|
||||||
|
|
||||||
var userType = await _userTypeRepository.FirstAsync(t => t.UserTypeEnum == UserTypeEnum.IndependentReviewer);
|
var userType = await _userTypeRepository.FirstAsync(t => t.UserTypeEnum == UserTypeEnum.IndependentReviewer);
|
||||||
|
|
||||||
|
//需要创建新的账户
|
||||||
|
var isNeedCreateNewUser = false;
|
||||||
|
|
||||||
var @lock = _distributedLockProvider.CreateLock($"UserCode");
|
var @lock = _distributedLockProvider.CreateLock($"UserCode");
|
||||||
|
|
||||||
using (await @lock.AcquireAsync())
|
using (await @lock.AcquireAsync())
|
||||||
{
|
{
|
||||||
var isDoctorHaveAccount = await _userRepository.AnyAsync(t => t.DoctorId == doctorId);
|
var isDoctorHaveAccount = await _userRoleRepository.AnyAsync(t => t.DoctorId == doctorId || t.IdentityUser.EMail == doctor.EMail);
|
||||||
|
|
||||||
|
|
||||||
if (!isDoctorHaveAccount)
|
if (!isDoctorHaveAccount)
|
||||||
{
|
{
|
||||||
|
isNeedCreateNewUser = true;
|
||||||
|
|
||||||
var saveItem = new User() { FirstName = doctor.FirstName, LastName = doctor.LastName, EMail = doctor.EMail };
|
var saveItem = new IdentityUser() { FirstName = doctor.FirstName, LastName = doctor.LastName, EMail = doctor.EMail };
|
||||||
|
|
||||||
var trialType = await _trialRepository.Where(t => t.Id == trialId).Select(t => t.TrialType).FirstOrDefaultAsync();
|
var trialType = await _trialRepository.Where(t => t.Id == trialId).Select(t => t.TrialType).FirstOrDefaultAsync();
|
||||||
|
|
||||||
@@ -568,32 +583,43 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
saveItem.IsTestUser = true;
|
saveItem.IsTestUser = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
saveItem.UserCeateSource = UserCeateSource.ReviewerSelect;
|
||||||
|
saveItem.TrialId = trialId;
|
||||||
|
|
||||||
saveItem.Code = _userRepository.Select(t => t.Code).DefaultIfEmpty().Max() + 1;
|
saveItem.Code = _identityUserRepository.Select(t => t.Code).DefaultIfEmpty().Max() + 1;
|
||||||
|
|
||||||
saveItem.UserCode = AppSettings.GetCodeStr(saveItem.Code, nameof(User));
|
saveItem.UserCode = AppSettings.GetCodeStr(saveItem.Code, nameof(IdentityUser));
|
||||||
|
|
||||||
saveItem.UserName = saveItem.UserCode;
|
saveItem.UserRoleList = new List<UserRole>() { new UserRole() { DoctorId = doctorId, UserTypeEnum = UserTypeEnum.IndependentReviewer, UserTypeId = userType.Id } };
|
||||||
|
|
||||||
saveItem.UserTypeEnum = UserTypeEnum.IndependentReviewer;
|
var savedUser = await _identityUserRepository.AddAsync(saveItem);
|
||||||
|
|
||||||
saveItem.DoctorId = doctorId;
|
|
||||||
saveItem.UserTypeId = userType.Id;
|
|
||||||
|
|
||||||
var savedUser = await _userRepository.AddAsync(saveItem);
|
|
||||||
|
|
||||||
//下面获取Token 需要这部分信息
|
//下面获取Token 需要这部分信息
|
||||||
sysUserInfo = savedUser.Clone();
|
sysUserInfo = savedUser;
|
||||||
|
|
||||||
sysUserInfo.UserTypeRole = userType;
|
|
||||||
|
|
||||||
await _userRepository.SaveChangesAsync();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sysUserInfo = (await _userRepository.Where(t => t.DoctorId == doctorId).Include(t => t.UserTypeRole).FirstOrDefaultAsync()).IfNullThrowException();
|
sysUserInfo = (await _identityUserRepository.Where(t => t.UserRoleList.Any(t => t.DoctorId == doctorId || t.IdentityUser.EMail == doctor.EMail), true).Include(t => t.UserRoleList).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
|
||||||
|
|
||||||
|
var findRole = sysUserInfo.UserRoleList.FirstOrDefault(t => t.UserTypeId == userType.Id);
|
||||||
|
//不存在该角色,那么就加入该角色
|
||||||
|
if (findRole == null)
|
||||||
|
{
|
||||||
|
sysUserInfo.UserRoleList.Add(new UserRole() { DoctorId = doctorId, UserTypeEnum = UserTypeEnum.IndependentReviewer, UserTypeId = userType.Id });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
findRole.IsUserRoleDisabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
sysUserInfo.Status = UserStateEnum.Enable;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//保证能有userRoleId
|
||||||
|
await _userRoleRepository.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -607,20 +633,14 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
var basicInfo = IRaCISClaims.Create(_mapper.Map<UserBasicInfo>(sysUserInfo));
|
var token = _tokenService.GetToken(new UserTokenInfo() { IdentityUserId = sysUserInfo.Id });
|
||||||
|
|
||||||
////第一次添加的时候 注意赋值
|
|
||||||
//basicInfo.PermissionStr = userType.PermissionStr;
|
|
||||||
//basicInfo.UserTypeShortName = userType.UserTypeShortName;
|
|
||||||
|
|
||||||
var token = _tokenService.GetToken(basicInfo);
|
|
||||||
|
|
||||||
if (sysUserInfo.IsFirstAdd)
|
if (sysUserInfo.IsFirstAdd)
|
||||||
{
|
{
|
||||||
await _userRepository.BatchUpdateNoTrackingAsync(t => t.Id == sysUserInfo.Id, u => new User() { EmailToken = token });
|
await _identityUserRepository.BatchUpdateNoTrackingAsync(t => t.Id == sysUserInfo.Id, u => new Domain.Models.IdentityUser() { EmailToken = token });
|
||||||
}
|
}
|
||||||
|
|
||||||
var routeUrl = rootUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&UserName=" + sysUserInfo.UserName + "&UserType=" + userType.UserTypeShortName + "&lang=" + (_userInfo.IsEn_Us ? "en" : "zh") + "&access_token=" + token;
|
var routeUrl = rootUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&lang=" + (_userInfo.IsEn_Us ? "en" : "zh") + "&access_token=" + token;
|
||||||
|
|
||||||
var domain = baseUrl.Substring(0, baseUrl.IndexOf("/login"));
|
var domain = baseUrl.Substring(0, baseUrl.IndexOf("/login"));
|
||||||
|
|
||||||
@@ -642,8 +662,8 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
trialInfo.ExperimentName,
|
trialInfo.ExperimentName,
|
||||||
trialInfo.ResearchProgramNo,
|
trialInfo.ResearchProgramNo,
|
||||||
trialInfo.TrialCode,
|
trialInfo.TrialCode,
|
||||||
sysUserInfo.UserName,
|
sysUserInfo.IsFirstAdd ? sysUserInfo.EMail : sysUserInfo.UserName,
|
||||||
userType.UserTypeShortName,
|
userType.UserTypeName,
|
||||||
sysUserInfo.IsFirstAdd ? redirectUrl : baseUrl
|
sysUserInfo.IsFirstAdd ? redirectUrl : baseUrl
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -656,7 +676,15 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig, null);
|
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig, null);
|
||||||
|
|
||||||
return sysUserInfo.Id;
|
//创建账号 和创建角色 一条,更新的时候才记录更新角色
|
||||||
|
if (isNeedCreateNewUser == false)
|
||||||
|
{
|
||||||
|
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = _userInfo.IdentityUserId, ActionUserName = _userInfo.UserName, TargetIdentityUserId = sysUserInfo.Id, OptType = UserOptType.UpdateUserRole }, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return (sysUserInfo.Id, sysUserInfo.UserRoleList.First(t => t.UserTypeEnum == UserTypeEnum.IndependentReviewer).Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -664,7 +692,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
public async Task UserFeedBackMail(Guid feedBackId)
|
public async Task UserFeedBackMail(Guid feedBackId)
|
||||||
{
|
{
|
||||||
var feedBack = await _userFeedBackRepository.Where(t => t.Id == feedBackId).Include(t => t.CreateUser).ThenInclude(t => t.UserTypeRole).FirstNotNullAsync();
|
var feedBack = await _userFeedBackRepository.Where(t => t.Id == feedBackId).Include(t => t.CreateUserRole.UserTypeRole).Include(t => t.CreateUserRole.IdentityUser).FirstNotNullAsync();
|
||||||
|
|
||||||
var messageToSend = new MimeMessage();
|
var messageToSend = new MimeMessage();
|
||||||
//发件地址
|
//发件地址
|
||||||
@@ -680,8 +708,8 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
var userTypeEnumList = emailConfigInfo.EmailNoticeUserTypeList.Where(t => t.EmailUserType == EmailUserType.To).Select(t => t.UserType).ToList();
|
var userTypeEnumList = emailConfigInfo.EmailNoticeUserTypeList.Where(t => t.EmailUserType == EmailUserType.To).Select(t => t.UserType).ToList();
|
||||||
|
|
||||||
var emailList = await _userRepository.Where(t => userTypeEnumList.Contains(t.UserTypeEnum) &&
|
var emailList = await _userRoleRepository.Where(t => userTypeEnumList.Contains(t.UserTypeEnum) && t.IsUserRoleDisabled == false && t.IdentityUser.Status == UserStateEnum.Enable &&
|
||||||
(isHaveTrialId ? t.UserTrials.Any(t => t.TrialId == feedBack.TrialId) : true)).Select(t => new { t.EMail, t.UserTypeEnum, t.FullName }).ToListAsync();
|
(isHaveTrialId ? t.IdentityUser.UserTrialList.Any(t => t.TrialId == feedBack.TrialId && t.TrialUserRoleList.Any(c => userTypeEnumList.Contains(c.UserRole.UserTypeEnum))) : true)).Select(t => new { t.IdentityUser.EMail, t.UserTypeEnum, t.IdentityUser.FullName }).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
foreach (var email in emailList)
|
foreach (var email in emailList)
|
||||||
@@ -709,8 +737,8 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
info.TrialCode,
|
info.TrialCode,
|
||||||
info.SubejctCode,
|
info.SubejctCode,
|
||||||
info.VisitName,
|
info.VisitName,
|
||||||
feedBack.CreateUser.UserTypeRole.UserTypeShortName,
|
feedBack.CreateUserRole.UserTypeRole.UserTypeShortName,
|
||||||
feedBack.CreateUser.FullName,
|
feedBack.CreateUserRole.IdentityUser.FullName,
|
||||||
emailType,
|
emailType,
|
||||||
feedBack.QuestionDescription,
|
feedBack.QuestionDescription,
|
||||||
_systemEmailConfig.SiteUrl
|
_systemEmailConfig.SiteUrl
|
||||||
@@ -739,8 +767,8 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
info.TrialCode,
|
info.TrialCode,
|
||||||
info.SubejctCode,
|
info.SubejctCode,
|
||||||
info.VisitName,
|
info.VisitName,
|
||||||
feedBack.CreateUser.UserTypeRole.UserTypeShortName,
|
feedBack.CreateUserRole.UserTypeRole.UserTypeShortName,
|
||||||
feedBack.CreateUser.FullName,
|
feedBack.CreateUserRole.IdentityUser.FullName,
|
||||||
emailType,
|
emailType,
|
||||||
feedBack.QuestionDescription,
|
feedBack.QuestionDescription,
|
||||||
_systemEmailConfig.SiteUrl
|
_systemEmailConfig.SiteUrl
|
||||||
@@ -768,8 +796,8 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
var htmlBodyStr = string.Format(ReplaceCompanyName(input.htmlBodyStr),
|
var htmlBodyStr = string.Format(ReplaceCompanyName(input.htmlBodyStr),
|
||||||
userNames,
|
userNames,
|
||||||
info.TrialCode,
|
info.TrialCode,
|
||||||
feedBack.CreateUser.UserTypeRole.UserTypeShortName,
|
feedBack.CreateUserRole.UserTypeRole.UserTypeShortName,
|
||||||
feedBack.CreateUser.FullName,
|
feedBack.CreateUserRole.IdentityUser.FullName,
|
||||||
emailType,
|
emailType,
|
||||||
feedBack.QuestionDescription,
|
feedBack.QuestionDescription,
|
||||||
_systemEmailConfig.SiteUrl
|
_systemEmailConfig.SiteUrl
|
||||||
@@ -793,8 +821,8 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
var htmlBodyStr = string.Format(ReplaceCompanyName(input.htmlBodyStr),
|
var htmlBodyStr = string.Format(ReplaceCompanyName(input.htmlBodyStr),
|
||||||
userNames,
|
userNames,
|
||||||
feedBack.CreateUser.UserTypeRole.UserTypeShortName,
|
feedBack.CreateUserRole.UserTypeRole.UserTypeShortName,
|
||||||
feedBack.CreateUser.FullName,
|
feedBack.CreateUserRole.IdentityUser.FullName,
|
||||||
feedBack.QuestionDescription,
|
feedBack.QuestionDescription,
|
||||||
_systemEmailConfig.SiteUrl
|
_systemEmailConfig.SiteUrl
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
{
|
{
|
||||||
Version version;
|
Version version;
|
||||||
|
|
||||||
if (!Version.TryParse(addOrEditPublishLog.Version, out version)|| !Version.TryParse(addOrEditPublishLog.Version_US, out version))
|
if (!Version.TryParse(addOrEditPublishLog.Version, out version))
|
||||||
{
|
{
|
||||||
//"版本号不符合要求"
|
//"版本号不符合要求"
|
||||||
return ResponseOutput.NotOk(_localizer["PublishLog_NotValidVersion"]);
|
return ResponseOutput.NotOk(_localizer["PublishLog_NotValidVersion"]);
|
||||||
@@ -50,7 +50,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
var verifyExp1 = new EntityVerifyExp<PublishLog>()
|
var verifyExp1 = new EntityVerifyExp<PublishLog>()
|
||||||
{
|
{
|
||||||
VerifyExp = u => u.Version == addOrEditPublishLog.Version || u.Version_US == addOrEditPublishLog.Version_US,
|
VerifyExp = u => u.Version == addOrEditPublishLog.Version ,
|
||||||
|
|
||||||
//"发布编号不能重复"
|
//"发布编号不能重复"
|
||||||
VerifyMsg = _localizer["PublishLog_RepeatVersion"]
|
VerifyMsg = _localizer["PublishLog_RepeatVersion"]
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
using IRaCIS.Core.Application.Contracts;
|
using IRaCIS.Core.Application.Contracts;
|
||||||
|
using IRaCIS.Core.Infrastructure.Extention;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
namespace IRaCIS.Core.Application.Services
|
namespace IRaCIS.Core.Application.Services
|
||||||
{
|
{
|
||||||
@@ -25,7 +26,10 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<PageOutput<SystemBasicDataView>> GetSystemBasicDataList(SystemBasicDataQuery inQuery)
|
public async Task<PageOutput<SystemBasicDataView>> GetSystemBasicDataList(SystemBasicDataQuery inQuery)
|
||||||
{
|
{
|
||||||
var systemBasicDataQueryable = _systemBasicDataRepository.Where(t => t.ParentId == null)
|
var systemBasicDataQueryable = _systemBasicDataRepository
|
||||||
|
.Where(t => t.ParentId == null)
|
||||||
|
.WhereIf(inQuery.Code != null, t => t.Code.Contains(inQuery.Code))
|
||||||
|
.WhereIf(inQuery.Name != null, t => t.Name.Contains(inQuery.Name))
|
||||||
.ProjectTo<SystemBasicDataView>(_mapper.ConfigurationProvider);
|
.ProjectTo<SystemBasicDataView>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
return await systemBasicDataQueryable.ToPagedListAsync(inQuery, nameof(SystemBasicDataView.Code));
|
return await systemBasicDataQueryable.ToPagedListAsync(inQuery, nameof(SystemBasicDataView.Code));
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
CreateMap<EmailNoticeConfig, EmailNoticeConfigView>()
|
CreateMap<EmailNoticeConfig, EmailNoticeConfigView>()
|
||||||
.ForMember(t => t.EmailNoticeUserList, u => u.MapFrom(c => c.EmailNoticeUserTypeList));
|
.ForMember(t => t.EmailNoticeUserList, u => u.MapFrom(c => c.EmailNoticeUserTypeList));
|
||||||
|
|
||||||
|
CreateMap<EmailNoticeConfig, EmailNoticeConfigExportDto>();
|
||||||
|
|
||||||
|
|
||||||
CreateMap<Dictionary, DicView>()
|
CreateMap<Dictionary, DicView>()
|
||||||
.ForMember(t => t.ParentCode, u => u.MapFrom(c => c.Parent.Code));
|
.ForMember(t => t.ParentCode, u => u.MapFrom(c => c.Parent.Code));
|
||||||
CreateMap<SystemBasicData, SystemBasicDataView>();
|
CreateMap<SystemBasicData, SystemBasicDataView>();
|
||||||
@@ -73,6 +76,9 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
CreateMap<Internationalization, InternationalizationAddOrEdit>().ReverseMap();
|
CreateMap<Internationalization, InternationalizationAddOrEdit>().ReverseMap();
|
||||||
|
|
||||||
|
CreateMap<InternationalizationAddOrEdit, IRCGlobalInfoDTO>();
|
||||||
|
|
||||||
|
|
||||||
CreateMap<Internationalization, BatchInternationalizationDto>().ReverseMap();
|
CreateMap<Internationalization, BatchInternationalizationDto>().ReverseMap();
|
||||||
|
|
||||||
CreateMap<Internationalization, IRCGlobalInfoDTO>();
|
CreateMap<Internationalization, IRCGlobalInfoDTO>();
|
||||||
@@ -92,9 +98,9 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
|
|
||||||
CreateMap<TrialImageDownload, TrialImageDownloadExportDto>()
|
CreateMap<TrialImageDownload, TrialImageDownloadExportDto>()
|
||||||
.ForMember(d => d.UserFullName, u => u.MapFrom(s => s.CreateUser.FullName))
|
.ForMember(d => d.UserFullName, u => u.MapFrom(s => s.CreateUserRole.FullName))
|
||||||
.ForMember(d => d.UserTypeEnum, u => u.MapFrom(s => s.CreateUser.UserTypeEnum))
|
.ForMember(d => d.UserTypeEnum, u => u.MapFrom(s => s.CreateUserRole.UserTypeEnum))
|
||||||
.ForMember(d => d.UserName, u => u.MapFrom(s => s.CreateUser.UserName))
|
.ForMember(d => d.UserName, u => u.MapFrom(s => s.CreateUserRole.IdentityUser.UserName))
|
||||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteCode));
|
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteCode));
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
using IRaCIS.Application.Contracts;
|
using IRaCIS.Application.Contracts;
|
||||||
using IRaCIS.Application.Interfaces;
|
using IRaCIS.Application.Interfaces;
|
||||||
|
using IRaCIS.Core.Application.Helper;
|
||||||
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
|
using IRaCIS.Core.Infrastructure.Extention;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Panda.DynamicWebApi.Attributes;
|
using Panda.DynamicWebApi.Attributes;
|
||||||
|
|
||||||
@@ -9,7 +12,11 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
/// 医生文档关联关系维护
|
/// 医生文档关联关系维护
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(GroupName = "Reviewer")]
|
[ApiExplorerSettings(GroupName = "Reviewer")]
|
||||||
public class AttachmentService(IRepository<Attachment> _attachmentrepository, IRepository<Doctor> _doctorrepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IAttachmentService
|
public class AttachmentService(IRepository<Attachment> _attachmentrepository,
|
||||||
|
IRepository<Dictionary> _dictionaryRepository,
|
||||||
|
IRepository<Enroll> _enrollRepository,
|
||||||
|
IOSSService _oSSService,
|
||||||
|
IRepository<Doctor> _doctorrepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IAttachmentService
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@@ -89,6 +96,150 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
return attachmentList;
|
return attachmentList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取项目医生附件
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<PageOutput<AttachmentDTO>> GetTrialAttachments(GetTrialAttachmentsInDto inDto)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var dicList=await _dictionaryRepository.Where(x => x.Parent.Code == "CertificateFileType").Select(x=>x.Code).ToListAsync();
|
||||||
|
|
||||||
|
var attachmentList = await _attachmentrepository
|
||||||
|
.Where(a =>a.Doctor.EnrollList.Any(x=>x.TrialId == inDto.TrialId && x.EnrollStatus >= EnrollStatus.InviteIntoGroup)|| a.TrialId == inDto.TrialId)
|
||||||
|
.WhereIf(inDto.DoctorId!=null,x=>x.DoctorId==inDto.DoctorId)
|
||||||
|
.WhereIf(inDto.IsAuthorizedView != null, x => x.IsAuthorizedView == inDto.IsAuthorizedView)
|
||||||
|
.WhereIf(inDto.Type.IsNotNullOrEmpty(), x => x.Type == inDto.Type)
|
||||||
|
.WhereIf(inDto.FileName.IsNotNullOrEmpty(), x => inDto.FileName.Contains(x.FileName))
|
||||||
|
|
||||||
|
.Where(a => dicList.Contains(a.Type)||a.Type==string.Empty)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.ProjectTo<AttachmentDTO>(_mapper.ConfigurationProvider, new { TrialId = inDto.TrialId }).ToPagedListAsync(inDto);
|
||||||
|
|
||||||
|
|
||||||
|
return attachmentList;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取医生列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<List<GetTrialDoctorListOutDto>> GetTrialDoctorList(GetTrialDoctorSelectInDto inDto)
|
||||||
|
{
|
||||||
|
var result= await _enrollRepository.Where(x => x.TrialId == inDto.TrialId && x.EnrollStatus >= EnrollStatus.InviteIntoGroup).Select(x => x.Doctor)
|
||||||
|
|
||||||
|
.ProjectTo<GetTrialDoctorListOutDto>(_mapper.ConfigurationProvider).OrderBy(x=>x.BlindName).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改稽查状态
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<IResponseOutput> SetAuthorizedView(SetAttachmentAuthorizedView inDto)
|
||||||
|
{
|
||||||
|
await _attachmentrepository.UpdatePartialFromQueryAsync(x => inDto.Ids.Contains(x.Id), x => new Attachment() { IsAuthorizedView = inDto.IsAuthorizedView });
|
||||||
|
|
||||||
|
await _attachmentrepository.SaveChangesAsync();
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<IResponseOutput> DeleteAttachment(DeleteAttachment inDto)
|
||||||
|
{
|
||||||
|
var success = await _attachmentrepository.DeleteFromQueryAsync(t => inDto.Ids.Contains(t.Id));
|
||||||
|
await _attachmentrepository.SaveChangesAsync();
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 上传项目医生
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="attachmentList"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<IEnumerable<AttachmentDTO>> SaveTrialAttachments(IEnumerable<AttachmentDTO> attachmentList)
|
||||||
|
{
|
||||||
|
|
||||||
|
foreach (var item in attachmentList)
|
||||||
|
{
|
||||||
|
if (item.DoctorId != null)
|
||||||
|
{
|
||||||
|
await _attachmentrepository.BatchDeleteNoTrackingAsync(a => a.DoctorId == item.DoctorId && a.Type == item.Type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var attachments = _mapper.Map<IEnumerable<Attachment>>(attachmentList).ToList();
|
||||||
|
var newAttachment = attachments.Where(t => t.Id == Guid.Empty);
|
||||||
|
await _attachmentrepository.AddRangeAsync(newAttachment);
|
||||||
|
await _attachmentrepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
var list = _mapper.Map<IEnumerable<AttachmentDTO>>(attachments).ToList();
|
||||||
|
|
||||||
|
list.ForEach(t => t.FullPath = t.Path + "?access_token=" + _userInfo.UserToken);
|
||||||
|
|
||||||
|
return list;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新医生资质
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="attachment"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<IResponseOutput> UpdateTrialAttachments(AttachmentDTO attachment)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!attachment.Path.Contains(attachment.DoctorId.ToString()))
|
||||||
|
{
|
||||||
|
var attachmentData= await _attachmentrepository.Where(a => a.Id == attachment.Id).FirstNotNullAsync();
|
||||||
|
|
||||||
|
var fileName= attachmentData.Path.Split("/").Last();
|
||||||
|
|
||||||
|
|
||||||
|
attachment.Path = $"/systemData/reviewe/{attachment.Type}/{attachment.DoctorId}/{fileName}";
|
||||||
|
|
||||||
|
await _oSSService.MoveObject(attachmentData.Path, attachment.Path);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (attachment.DoctorId != null)
|
||||||
|
{
|
||||||
|
await _attachmentrepository.DeleteFromQueryAsync(a =>a.Id!=attachment.Id&& a.DoctorId == attachment.DoctorId && a.Type == attachment.Type);
|
||||||
|
}
|
||||||
|
|
||||||
|
attachment.UpdateTime = DateTime.Now;
|
||||||
|
await _attachmentrepository.UpdateFromDTOAsync(attachment);
|
||||||
|
|
||||||
|
await _attachmentrepository.SaveChangesAsync();
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[NonDynamicMethod]
|
[NonDynamicMethod]
|
||||||
public async Task<AttachmentDTO> GetDetailById(Guid attachmentId)
|
public async Task<AttachmentDTO> GetDetailById(Guid attachmentId)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,19 +2,80 @@
|
|||||||
{
|
{
|
||||||
public class AttachmentDTO
|
public class AttachmentDTO
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid? Id { get; set; }
|
||||||
public Guid DoctorId { get; set; }
|
public Guid? DoctorId { get; set; }
|
||||||
public bool IsOfficial { get; set; }
|
public bool IsOfficial { get; set; }
|
||||||
public string Type { get; set; } = string.Empty;
|
public string Type { get; set; } = string.Empty;
|
||||||
public string Path { get; set; } = string.Empty;
|
public string Path { get; set; } = string.Empty;
|
||||||
public string FullPath { get; set; } = string.Empty;
|
public string FullPath { get; set; } = string.Empty;
|
||||||
public string FileName { get; set; } = string.Empty;
|
public string FileName { get; set; } = string.Empty;
|
||||||
public DateTime? CreateTime { get; set; }
|
public DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
|
public DateTime? UpdateTime { get; set; }
|
||||||
public int Language { get; set; }
|
public int Language { get; set; }
|
||||||
|
|
||||||
public bool ReUpload { get; set; } = false;
|
public bool ReUpload { get; set; } = false;
|
||||||
|
|
||||||
|
public Guid? TrialId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否授权
|
||||||
|
/// </summary>
|
||||||
|
|
||||||
|
public bool IsAuthorizedView { get; set; } = false;
|
||||||
|
|
||||||
|
public string BlindName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string BlindNameCN { get; set; } = string.Empty;
|
||||||
|
public string ChineseName { get; set; } = string.Empty;
|
||||||
|
public string FirstName { get; set; } = string.Empty;
|
||||||
|
public string FullName => LastName + " / " + FirstName;
|
||||||
|
public string LastName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string UserName { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class SetAttachmentAuthorizedView
|
||||||
|
{
|
||||||
|
public List<Guid> Ids { get; set; }
|
||||||
|
|
||||||
|
public bool IsAuthorizedView { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DeleteAttachment
|
||||||
|
{
|
||||||
|
public List<Guid> Ids { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GetTrialDoctorSelectInDto
|
||||||
|
{
|
||||||
|
public Guid TrialId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GetTrialDoctorListOutDto
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
public string BlindName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string BlindNameCN { get; set; } = string.Empty;
|
||||||
|
public string ChineseName { get; set; } = string.Empty;
|
||||||
|
public string FirstName { get; set; } = string.Empty;
|
||||||
|
public string FullName => LastName + " / " + FirstName;
|
||||||
|
public string LastName { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GetTrialAttachmentsInDto:PageInput
|
||||||
|
{
|
||||||
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
public string? Type { get; set; }
|
||||||
|
|
||||||
|
public Guid? DoctorId { get; set; }
|
||||||
|
|
||||||
|
public string? FileName { get; set; }
|
||||||
|
|
||||||
|
public bool? IsAuthorizedView { get; set; }
|
||||||
|
}
|
||||||
public class ReviewerAckDTO
|
public class ReviewerAckDTO
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ namespace IRaCIS.Application.Contracts
|
|||||||
public string DepartmentOtherCN { get; set; } = String.Empty;
|
public string DepartmentOtherCN { get; set; } = String.Empty;
|
||||||
|
|
||||||
//增加的
|
//增加的
|
||||||
public Guid? SpecialityId { get; set; } = Guid.Empty;
|
public Guid? SpecialityId { get; set; }
|
||||||
public string SpecialityOther { get; set; } = string.Empty;
|
public string SpecialityOther { get; set; } = string.Empty;
|
||||||
public string SpecialityOtherCN { get; set; } = string.Empty;
|
public string SpecialityOtherCN { get; set; } = string.Empty;
|
||||||
public string Speciality { get; set; } = string.Empty;
|
public string Speciality { get; set; } = string.Empty;
|
||||||
@@ -169,11 +169,23 @@ namespace IRaCIS.Application.Contracts
|
|||||||
public class ReviewerConfirmationQueryDTO : PageInput
|
public class ReviewerConfirmationQueryDTO : PageInput
|
||||||
{
|
{
|
||||||
public Guid TrialId { get; set; } = Guid.Empty;
|
public Guid TrialId { get; set; } = Guid.Empty;
|
||||||
|
|
||||||
|
public DateTime? OptStartTime{ get; set; }
|
||||||
|
|
||||||
|
public DateTime? OptEndTime { get; set; }
|
||||||
|
|
||||||
|
public string? Code { get; set; }
|
||||||
|
|
||||||
|
public UserTypeEnum? UserTypeEnum { get; set; }
|
||||||
|
|
||||||
|
public string? OptUserName { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SelectionReviewerDTO : DoctorDTO
|
public class SelectionReviewerDTO : DoctorDTO
|
||||||
{
|
{
|
||||||
public int DoctorTrialState { get; set; }
|
public int DoctorTrialState { get; set; }
|
||||||
|
|
||||||
|
public bool IsEnroll { get; set; } = false;
|
||||||
public string OptUserName { get; set; } = string.Empty;
|
public string OptUserName { get; set; } = string.Empty;
|
||||||
public DateTime? OptTime { get; set; }
|
public DateTime? OptTime { get; set; }
|
||||||
public string? OptTimeStr => OptTime?.ToString("yyyy-MM-dd HH:mm:ss");
|
public string? OptTimeStr => OptTime?.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
@@ -192,14 +204,48 @@ namespace IRaCIS.Application.Contracts
|
|||||||
|
|
||||||
public string City { get; set; } = string.Empty;
|
public string City { get; set; } = string.Empty;
|
||||||
public string HospitalName { get; set; } = string.Empty;
|
public string HospitalName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string HospitalNameCN { get; set; } = string.Empty;
|
||||||
public string Country { get; set; } = string.Empty;
|
public string Country { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class GetTrialDoctorListInDto : PageInput
|
||||||
|
{
|
||||||
|
public Guid TrialId { get; set; } = Guid.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 亚专业
|
||||||
|
/// </summary>
|
||||||
|
public Guid? SubspecialityId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 专业
|
||||||
|
/// </summary>
|
||||||
|
public Guid? SpecialityId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 机构
|
||||||
|
/// </summary>
|
||||||
|
public Guid? HospitalId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TrialDoctorInfo : ConfirmationReviewerDTO
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public List<string> SubspecialityList => DictionaryList.Where(t => t.ParentCode == StaticData.Subspeciality).OrderBy(t => t.ShowOrder).Select(t => t.Value).ToList();
|
||||||
|
|
||||||
|
public List<string> SubspecialityCNList => DictionaryList.Where(t => t.ParentCode == StaticData.Subspeciality).OrderBy(t => t.ShowOrder).Select(t => t.ValueCN).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
public class ConfirmationReviewerDTO : DoctorOptDTO
|
public class ConfirmationReviewerDTO : DoctorOptDTO
|
||||||
{
|
{
|
||||||
public int DoctorTrialState { get; set; }
|
public int DoctorTrialState { get; set; }
|
||||||
public string OptUserName { get; set; } = string.Empty;
|
public string OptUserName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public UserTypeEnum? UserTypeEnum { get; set; }
|
||||||
public DateTime? OptTime { get; set; }
|
public DateTime? OptTime { get; set; }
|
||||||
public string? OptTimeStr => OptTime?.ToString("yyyy-MM-dd HH:mm:ss");
|
public string? OptTimeStr => OptTime?.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
@@ -209,7 +255,7 @@ namespace IRaCIS.Application.Contracts
|
|||||||
public string BlindName { get; set; }
|
public string BlindName { get; set; }
|
||||||
public string BlindNameCN { get; set; } = string.Empty;
|
public string BlindNameCN { get; set; } = string.Empty;
|
||||||
|
|
||||||
public Guid? SpecialityId { get; set; } = Guid.Empty;
|
public Guid? SpecialityId { get; set; }
|
||||||
|
|
||||||
public string SpecialityCN { get; set; } = string.Empty;
|
public string SpecialityCN { get; set; } = string.Empty;
|
||||||
public string Speciality { get; set; } = string.Empty;
|
public string Speciality { get; set; } = string.Empty;
|
||||||
@@ -221,6 +267,8 @@ namespace IRaCIS.Application.Contracts
|
|||||||
public List<Guid> SubspecialityIds => DictionaryList.Where(t => t.ParentCode == StaticData.Subspeciality).OrderBy(t => t.ShowOrder).Select(t => t.Id).ToList();
|
public List<Guid> SubspecialityIds => DictionaryList.Where(t => t.ParentCode == StaticData.Subspeciality).OrderBy(t => t.ShowOrder).Select(t => t.Id).ToList();
|
||||||
|
|
||||||
public Guid? HospitalId { get; set; }
|
public Guid? HospitalId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -233,6 +281,10 @@ namespace IRaCIS.Application.Contracts
|
|||||||
public string OptUserName { get; set; } = String.Empty;
|
public string OptUserName { get; set; } = String.Empty;
|
||||||
public DateTime? OptTime { get; set; }
|
public DateTime? OptTime { get; set; }
|
||||||
|
|
||||||
|
public int OptUserType { get; set; }
|
||||||
|
|
||||||
|
public UserTypeEnum UserTypeEnum { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -308,6 +360,8 @@ namespace IRaCIS.Application.Contracts
|
|||||||
public string WeChat { get; set; } = String.Empty;
|
public string WeChat { get; set; } = String.Empty;
|
||||||
public int Nation { get; set; }
|
public int Nation { get; set; }
|
||||||
|
|
||||||
|
public string? BlindPublications { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 工作兼职
|
/// 工作兼职
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -318,13 +372,42 @@ namespace IRaCIS.Application.Contracts
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string WorkPartTimeEn { get; set; } = string.Empty;
|
public string WorkPartTimeEn { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 大学
|
||||||
|
/// </summary>
|
||||||
|
public string UniversityAffiliated { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 大学
|
||||||
|
/// </summary>
|
||||||
|
public string UniversityAffiliatedCN { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 城市
|
||||||
|
/// </summary>
|
||||||
|
public string City { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 城市
|
||||||
|
/// </summary>
|
||||||
|
public string CityCN { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 医院
|
||||||
|
/// </summary>
|
||||||
|
public string HospitalName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 医院
|
||||||
|
/// </summary>
|
||||||
|
public string HospitalNameCN { get; set; } = string.Empty;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class SendEmailInDto
|
public class SendEmailInDto
|
||||||
{
|
{
|
||||||
public string Email { get; set; }
|
public List<string> Email { get; set; }
|
||||||
|
|
||||||
public string Url { get; set; }
|
public string Url { get; set; }
|
||||||
}
|
}
|
||||||
@@ -361,18 +444,26 @@ namespace IRaCIS.Application.Contracts
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class DeleteSummarizeInfoInDto
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
}
|
||||||
public class GetSummarizeInfoInDto
|
public class GetSummarizeInfoInDto
|
||||||
{
|
{
|
||||||
public Guid DoctorId { get; set; }
|
public Guid DoctorId { get; set; }
|
||||||
|
|
||||||
public Guid? TrialId { get; set; }
|
public Guid? TrialId { get; set; } = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UpdateGneralSituationDto
|
public class SummarizeInfoDto
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
|
||||||
|
|
||||||
public Guid? TrialId { get; set; }
|
public Guid? Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 医生Id
|
||||||
|
/// </summary>
|
||||||
|
public Guid DoctorId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 概述
|
/// 概述
|
||||||
@@ -383,24 +474,70 @@ namespace IRaCIS.Application.Contracts
|
|||||||
/// 概述
|
/// 概述
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string SummarizeEn { get; set; } = string.Empty;
|
public string SummarizeEn { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否是主模板
|
||||||
|
/// </summary>
|
||||||
|
public bool IsMain { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 适应症
|
||||||
|
/// </summary>
|
||||||
|
public string Indication { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 适应症
|
||||||
|
/// </summary>
|
||||||
|
public string IndicationEn { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目Id
|
||||||
|
/// </summary>
|
||||||
|
public Guid? TrialId { get; set; }
|
||||||
|
|
||||||
|
public SaveSummarizeInfo SaveSummarizeInfoType { get; set; } = SaveSummarizeInfo.SaveSelf;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum SaveSummarizeInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 保存自己
|
||||||
|
/// </summary>
|
||||||
|
SaveSelf = 0,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 保存并覆盖
|
||||||
|
/// </summary>
|
||||||
|
SaveAndCover = 1,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 保存并新增
|
||||||
|
/// </summary>
|
||||||
|
SaveAndAdd = 2,
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UpdateGneralSituationDto
|
||||||
|
{
|
||||||
|
public List<SummarizeInfoDto> SummarizeList { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BasicInfoAndEmploymentDto: DoctorBasicInfoCommand
|
public class BasicInfoAndEmploymentDto: DoctorBasicInfoCommand
|
||||||
{
|
{
|
||||||
//部门
|
//部门
|
||||||
public Guid? DepartmentId { get; set; } = Guid.Empty;
|
public Guid? DepartmentId { get; set; }
|
||||||
public string DepartmentOther { get; set; } = string.Empty;
|
public string DepartmentOther { get; set; } = string.Empty;
|
||||||
public string DepartmentOtherCN { get; set; } = string.Empty;
|
public string DepartmentOtherCN { get; set; } = string.Empty;
|
||||||
//职称
|
//职称
|
||||||
public Guid? RankId { get; set; } = Guid.Empty;
|
public Guid? RankId { get; set; }
|
||||||
public string RankOther { get; set; } = string.Empty;
|
public string RankOther { get; set; } = string.Empty;
|
||||||
public string RankOtherCN { get; set; } = string.Empty;
|
public string RankOtherCN { get; set; } = string.Empty;
|
||||||
//职位 主席 副主席
|
//职位 主席 副主席
|
||||||
public Guid? PositionId { get; set; } = Guid.Empty;
|
public Guid? PositionId { get; set; }
|
||||||
public string PositionOther { get; set; } = string.Empty;
|
public string PositionOther { get; set; } = string.Empty;
|
||||||
public string PositionOtherCN { get; set; } = string.Empty;
|
public string PositionOtherCN { get; set; } = string.Empty;
|
||||||
|
|
||||||
public Guid? HospitalId { get; set; } = Guid.Empty;
|
public Guid? HospitalId { get; set; }
|
||||||
|
|
||||||
public Guid? PhysicianId { get; set; }
|
public Guid? PhysicianId { get; set; }
|
||||||
public string Physician { get; set; } = string.Empty;
|
public string Physician { get; set; } = string.Empty;
|
||||||
@@ -436,6 +573,8 @@ namespace IRaCIS.Application.Contracts
|
|||||||
{
|
{
|
||||||
public string BlindName { get; set; }
|
public string BlindName { get; set; }
|
||||||
|
|
||||||
|
public bool IsHaveAccount { get; set; } = false;
|
||||||
|
|
||||||
public string BlindNameCN { get; set; } = string.Empty;
|
public string BlindNameCN { get; set; } = string.Empty;
|
||||||
|
|
||||||
public List<DicView> DoctorDicViewDtos = new List<DicView>();
|
public List<DicView> DoctorDicViewDtos = new List<DicView>();
|
||||||
@@ -580,19 +719,19 @@ namespace IRaCIS.Application.Contracts
|
|||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
//部门
|
//部门
|
||||||
public Guid? DepartmentId { get; set; } = Guid.Empty;
|
public Guid? DepartmentId { get; set; }
|
||||||
public string DepartmentOther { get; set; } = string.Empty;
|
public string DepartmentOther { get; set; } = string.Empty;
|
||||||
public string DepartmentOtherCN { get; set; } = string.Empty;
|
public string DepartmentOtherCN { get; set; } = string.Empty;
|
||||||
//职称
|
//职称
|
||||||
public Guid? RankId { get; set; } = Guid.Empty;
|
public Guid? RankId { get; set; } = null;
|
||||||
public string RankOther { get; set; } = string.Empty;
|
public string RankOther { get; set; } = string.Empty;
|
||||||
public string RankOtherCN { get; set; } = string.Empty;
|
public string RankOtherCN { get; set; } = string.Empty;
|
||||||
//职位 主席 副主席
|
//职位 主席 副主席
|
||||||
public Guid? PositionId { get; set; } = Guid.Empty;
|
public Guid? PositionId { get; set; }
|
||||||
public string PositionOther { get; set; } = string.Empty;
|
public string PositionOther { get; set; } = string.Empty;
|
||||||
public string PositionOtherCN { get; set; } = string.Empty;
|
public string PositionOtherCN { get; set; } = string.Empty;
|
||||||
|
|
||||||
public Guid? HospitalId { get; set; } = Guid.Empty;
|
public Guid? HospitalId { get; set; }
|
||||||
|
|
||||||
public Guid? PhysicianId { get; set; }
|
public Guid? PhysicianId { get; set; }
|
||||||
public string Physician { get; set; } = string.Empty;
|
public string Physician { get; set; } = string.Empty;
|
||||||
@@ -608,6 +747,55 @@ namespace IRaCIS.Application.Contracts
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string WorkPartTimeEn { get; set; } = string.Empty;
|
public string WorkPartTimeEn { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 大学
|
||||||
|
/// </summary>
|
||||||
|
public string University { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 大学
|
||||||
|
/// </summary>
|
||||||
|
public string UniversityCN { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 城市
|
||||||
|
/// </summary>
|
||||||
|
public string City { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 城市
|
||||||
|
/// </summary>
|
||||||
|
public string CityCN { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 医院
|
||||||
|
/// </summary>
|
||||||
|
public string HospitalEn { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 医院
|
||||||
|
/// </summary>
|
||||||
|
public string HospitalCN { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 大学
|
||||||
|
/// </summary>
|
||||||
|
public string UniversityAffiliated { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 大学
|
||||||
|
/// </summary>
|
||||||
|
public string UniversityAffiliatedCN { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 医院
|
||||||
|
/// </summary>
|
||||||
|
public string HospitalName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 医院
|
||||||
|
/// </summary>
|
||||||
|
public string HospitalNameCN { get; set; } = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -735,7 +923,7 @@ namespace IRaCIS.Application.Contracts
|
|||||||
public string SubspecialityOther { get; set; } = string.Empty;
|
public string SubspecialityOther { get; set; } = string.Empty;
|
||||||
public string SubspecialityOtherCN { get; set; } = string.Empty;
|
public string SubspecialityOtherCN { get; set; } = string.Empty;
|
||||||
|
|
||||||
public Guid? SpecialityId { get; set; } = Guid.Empty;
|
public Guid? SpecialityId { get; set; }
|
||||||
public string SpecialityCN { get; set; } = string.Empty;
|
public string SpecialityCN { get; set; } = string.Empty;
|
||||||
public string SpecialityOther { get; set; } = string.Empty;
|
public string SpecialityOther { get; set; } = string.Empty;
|
||||||
public string SpecialityOtherCN { get; set; } = string.Empty;
|
public string SpecialityOtherCN { get; set; } = string.Empty;
|
||||||
|
|||||||
@@ -31,12 +31,13 @@
|
|||||||
{
|
{
|
||||||
public DateTime? CreateTime { get; set; }
|
public DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
public string BeginDateStr => BeginDate?.ToString("yyyy-MM");
|
public string BeginDateStr => BeginDate?.ToString("yyyy/MM");
|
||||||
public string EndDateStr => EndDate?.ToString("yyyy-MM");
|
public string EndDateStr => EndDate?.ToString("yyyy/MM");
|
||||||
|
|
||||||
}
|
}
|
||||||
public class PostgraduateCommand
|
public class PostgraduateCommand
|
||||||
{
|
{
|
||||||
|
|
||||||
public Guid? Id { get; set; }
|
public Guid? Id { get; set; }
|
||||||
public Guid DoctorId { get; set; }
|
public Guid DoctorId { get; set; }
|
||||||
|
|
||||||
@@ -81,9 +82,9 @@
|
|||||||
{
|
{
|
||||||
public DateTime? CreateTime { get; set; }
|
public DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
public string BeginDateStr => BeginDate?.ToString("yyyy-MM");
|
public string BeginDateStr => BeginDate?.ToString("yyyy/MM");
|
||||||
|
|
||||||
public string EndDateStr => EndDate?.ToString("yyyy-MM");
|
public string EndDateStr => EndDate?.ToString("yyyy/MM");
|
||||||
}
|
}
|
||||||
public class DoctorEducationExperienceDTO
|
public class DoctorEducationExperienceDTO
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,4 +8,15 @@
|
|||||||
public DateTime EndDate { get; set; }
|
public DateTime EndDate { get; set; }
|
||||||
public int Status { get; set; } = 1;
|
public int Status { get; set; } = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class GetIsVacationInDto
|
||||||
|
{
|
||||||
|
public Guid DoctorId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class GetIsVacationOutDto
|
||||||
|
{
|
||||||
|
public bool IsVacation { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
|
|
||||||
var query = _doctorRepository.AsQueryable()
|
var query = _doctorRepository.AsQueryable()
|
||||||
|
.Where(x=>x.TrialId==null)
|
||||||
.WhereIf(inQuery.DepartmentId != null, t => t.DepartmentId == inQuery.DepartmentId)
|
.WhereIf(inQuery.DepartmentId != null, t => t.DepartmentId == inQuery.DepartmentId)
|
||||||
.WhereIf(inQuery.SpecialityId != null, t => t.SpecialityId == inQuery.SpecialityId)
|
.WhereIf(inQuery.SpecialityId != null, t => t.SpecialityId == inQuery.SpecialityId)
|
||||||
.WhereIf(inQuery.HospitalId != null, t => t.HospitalId == inQuery.HospitalId)
|
.WhereIf(inQuery.HospitalId != null, t => t.HospitalId == inQuery.HospitalId)
|
||||||
@@ -76,6 +77,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
var guidList = inQuery.ReadingTypeIdList.Concat(inQuery.SubspecialityIdList).Concat(inQuery.TitleIdList);
|
var guidList = inQuery.ReadingTypeIdList.Concat(inQuery.SubspecialityIdList).Concat(inQuery.TitleIdList);
|
||||||
|
|
||||||
var query = _doctorRepository/*.WhereIf(nation != AttendedReviewerType.USAndCN, t => t.Nation ==(int) nation)*/
|
var query = _doctorRepository/*.WhereIf(nation != AttendedReviewerType.USAndCN, t => t.Nation ==(int) nation)*/
|
||||||
|
.Where(x=>x.TrialId==null)
|
||||||
|
|
||||||
.WhereIf(inQuery.DepartmentId != null, t => t.DepartmentId == inQuery.DepartmentId)
|
.WhereIf(inQuery.DepartmentId != null, t => t.DepartmentId == inQuery.DepartmentId)
|
||||||
.WhereIf(inQuery.SpecialityId != null, t => t.SpecialityId == inQuery.SpecialityId)
|
.WhereIf(inQuery.SpecialityId != null, t => t.SpecialityId == inQuery.SpecialityId)
|
||||||
@@ -102,6 +104,8 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
var doctorStateList = await _enrollDetailRepository.Where(x => x.TrialId == inQuery.TrialId && x.EnrollStatus == EnrollStatus.HasApplyDownloadResume)
|
var doctorStateList = await _enrollDetailRepository.Where(x => x.TrialId == inQuery.TrialId && x.EnrollStatus == EnrollStatus.HasApplyDownloadResume)
|
||||||
.ProjectTo<DoctorStateModelDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
.ProjectTo<DoctorStateModelDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
|
var doctorEnrollList =await _enrollRepository.Where(x => x.TrialId == inQuery.TrialId && x.EnrollStatus >= EnrollStatus.InviteIntoGroup)
|
||||||
|
.ToListAsync();
|
||||||
result.CurrentPageData.ToList().ForEach(doctor =>
|
result.CurrentPageData.ToList().ForEach(doctor =>
|
||||||
{
|
{
|
||||||
//简历申请列表 --处理已经申请的
|
//简历申请列表 --处理已经申请的
|
||||||
@@ -109,6 +113,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
if (doctorState != null)
|
if (doctorState != null)
|
||||||
{
|
{
|
||||||
doctor.DoctorTrialState = (int)EnrollStatus.HasApplyDownloadResume;
|
doctor.DoctorTrialState = (int)EnrollStatus.HasApplyDownloadResume;
|
||||||
|
doctor.IsEnroll = doctorEnrollList.Any(x => x.DoctorId == doctor.Id);
|
||||||
doctor.OptTime = doctorState.OptTime;
|
doctor.OptTime = doctorState.OptTime;
|
||||||
doctor.OptUserName = doctorState.OptUserName;
|
doctor.OptUserName = doctorState.OptUserName;
|
||||||
}
|
}
|
||||||
@@ -238,11 +243,137 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
#region 连表查询
|
||||||
|
//var query = from enroll in _enrollRepository.Where(x => x.TrialId == inQuery.TrialId && x.EnrollStatus >= EnrollStatus.InviteIntoGroup)
|
||||||
|
// join enrollDetail in _enrollDetailRepository.Where(x => x.TrialId == inQuery.TrialId && x.EnrollStatus >= EnrollStatus.InviteIntoGroup) on new { enroll.DoctorId, enroll.EnrollStatus } equals new { enrollDetail.DoctorId, enrollDetail.EnrollStatus } into enrollDetailtemp
|
||||||
|
// from leftenrollDetail in enrollDetailtemp.DefaultIfEmpty()
|
||||||
|
// select new ConfirmationReviewerDTO()
|
||||||
|
// {
|
||||||
|
// DoctorTrialState = (int)leftenrollDetail.EnrollStatus,
|
||||||
|
// OptTime = leftenrollDetail.CreateTime,
|
||||||
|
// UserTypeEnum = leftenrollDetail.CreateUserRole.UserTypeEnum,
|
||||||
|
// OptUserName = leftenrollDetail.CreateUserRole.UserName,
|
||||||
|
// SubmmitTime = leftenrollDetail.CreateTime,
|
||||||
|
// SubmmitUserName = leftenrollDetail.CreateUserRole.UserName,
|
||||||
|
// //BlindName= enroll.BlindName,
|
||||||
|
// //BlindNameCN= enroll.BlindNameCN,
|
||||||
|
// SpecialityId = enroll.Doctor.SpecialityId,
|
||||||
|
// SpecialityCN = enroll.Doctor.Speciality.ValueCN,
|
||||||
|
// Speciality = enroll.Doctor.Speciality.Value,
|
||||||
|
// //SpecialityOther=enroll.Doctor.Speciality.SpecialityOther,
|
||||||
|
// //SpecialityOtherCN= enroll.Doctor.Speciality.SpecialityOtherCN,
|
||||||
|
// DictionaryList = enroll.Doctor.DoctorDicRelationList.Where(t => t.KeyName == StaticData.ReadingType || t.KeyName == StaticData.Subspeciality).Select(t => t.Dictionary).OrderBy(t => t.ShowOrder).Select(x => new DicView()
|
||||||
|
// {
|
||||||
|
// Id = x.Id,
|
||||||
|
// ParentCode = x.Parent.Code,
|
||||||
|
// ShowOrder = x.ShowOrder,
|
||||||
|
// Value = x.Value,
|
||||||
|
// ValueCN = x.ValueCN
|
||||||
|
// }).ToList(),
|
||||||
|
|
||||||
|
// //HospitalId= enroll.BlindName
|
||||||
|
|
||||||
|
// Id = enroll.Doctor.Id,
|
||||||
|
// Code = enroll.DoctorUser.UserName,
|
||||||
|
// //FirstName=enroll.FirstName,
|
||||||
|
// //LastName = enroll.LastName,
|
||||||
|
// //ChineseName = enroll.ChineseName,
|
||||||
|
// //City = enroll.City,
|
||||||
|
// //HospitalName = enroll.HospitalName,
|
||||||
|
// //Country = enroll.Country,
|
||||||
|
// };
|
||||||
|
|
||||||
|
|
||||||
|
//var result = await query
|
||||||
|
// .WhereIf(inQuery.OptStartTime != null, x => x.OptTime >= inQuery.OptStartTime)
|
||||||
|
// .WhereIf(inQuery.OptEndTime != null, x => x.OptTime <= inQuery.OptEndTime)
|
||||||
|
// .WhereIf(inQuery.UserTypeEnum != null, x => x.UserTypeEnum == inQuery.UserTypeEnum)
|
||||||
|
// .WhereIf(inQuery.Code.IsNotNullOrEmpty(), x => x.Code.Contains(inQuery.Code))
|
||||||
|
|
||||||
|
// .WhereIf(inQuery.OptUserName.IsNotNullOrEmpty(), x => x.OptUserName.Contains(inQuery.OptUserName))
|
||||||
|
// .ToPagedListAsync(inQuery);
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region 查询第一个
|
||||||
|
|
||||||
|
// 这里这样写的原因是因为 要取最新的入组详情 然后还要根据时间筛选 入组信息
|
||||||
|
var query = _enrollDetailRepository
|
||||||
|
.Where(x => x.TrialId == inQuery.TrialId && x.EnrollStatus >= EnrollStatus.InviteIntoGroup);
|
||||||
|
var enrollStateList = await query
|
||||||
|
.ProjectTo<DoctorStateModelDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
enrollStateList = enrollStateList.GroupBy(e => e.DoctorId)
|
||||||
|
.Select(g => g.OrderByDescending(e => e.OptTime).FirstOrDefault()).ToList();
|
||||||
|
|
||||||
|
enrollStateList = enrollStateList
|
||||||
|
.WhereIf(inQuery.OptStartTime != null, x => x.OptTime >= inQuery.OptStartTime)
|
||||||
|
.WhereIf(inQuery.OptEndTime != null, x => x.OptTime <= inQuery.OptEndTime)
|
||||||
|
.WhereIf(inQuery.UserTypeEnum != null, x => x.UserTypeEnum == inQuery.UserTypeEnum)
|
||||||
|
.ToList();
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var doctorids = enrollStateList.Select(x => x.DoctorId).ToList();
|
||||||
|
|
||||||
|
|
||||||
var doctorQuery = _enrollRepository.Where(x => x.TrialId == inQuery.TrialId && x.EnrollStatus >= EnrollStatus.InviteIntoGroup)
|
var doctorQuery = _enrollRepository.Where(x => x.TrialId == inQuery.TrialId && x.EnrollStatus >= EnrollStatus.InviteIntoGroup)
|
||||||
.ProjectTo<ConfirmationReviewerDTO>(_mapper.ConfigurationProvider);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.WhereIf(inQuery.OptStartTime != null || inQuery.OptEndTime != null || inQuery.UserTypeEnum != null, x => doctorids.Contains(x.DoctorId))
|
||||||
|
.ProjectTo<ConfirmationReviewerDTO>(_mapper.ConfigurationProvider)
|
||||||
|
.WhereIf(inQuery.Code.IsNotNullOrEmpty(), x => x.Code.Contains(inQuery.Code))
|
||||||
|
|
||||||
|
.WhereIf(inQuery.OptUserName.IsNotNullOrEmpty(), x => x.OptUserName.Contains(inQuery.OptUserName));
|
||||||
|
|
||||||
var doctorPageList = await doctorQuery.ToPagedListAsync(inQuery);
|
var doctorPageList = await doctorQuery.ToPagedListAsync(inQuery);
|
||||||
|
|
||||||
|
|
||||||
|
doctorPageList.CurrentPageData.ToList().ForEach(u =>
|
||||||
|
{
|
||||||
|
u.DoctorTrialState = (int)EnrollStatus.InviteIntoGroup;
|
||||||
|
var opt = enrollStateList.OrderByDescending(x=>x.OptTime).FirstOrDefault(t => t.DoctorId == u.Id);
|
||||||
|
if (opt != null)
|
||||||
|
{
|
||||||
|
u.DoctorTrialState = opt.IntoGroupState;
|
||||||
|
u.OptTime = opt.OptTime;
|
||||||
|
u.UserTypeEnum = opt.UserTypeEnum;
|
||||||
|
u.OptUserName = opt.OptUserName;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return doctorPageList;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取项目下医生列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inQuery"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<PageOutput<TrialDoctorInfo>> GetTrialDoctorList(
|
||||||
|
GetTrialDoctorListInDto inQuery)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
var doctorQuery = _enrollRepository.Where(x => x.TrialId == inQuery.TrialId && x.EnrollStatus == EnrollStatus.ConfirmIntoGroup)
|
||||||
|
|
||||||
|
.ProjectTo<TrialDoctorInfo>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
|
var doctorPageList = await doctorQuery
|
||||||
|
.WhereIf(inQuery.HospitalId!=null,x=>x.HospitalId==inQuery.HospitalId.Value)
|
||||||
|
.WhereIf(inQuery.SpecialityId != null, x => x.SpecialityId == inQuery.SpecialityId.Value)
|
||||||
|
.WhereIf(inQuery.SubspecialityId != null, x => x.DictionaryList.Any(x=>x.Id==inQuery.SubspecialityId.Value))
|
||||||
|
.ToPagedListAsync(inQuery);
|
||||||
|
|
||||||
var enrollStateList = await _enrollDetailRepository.Where(x => x.TrialId == inQuery.TrialId && x.EnrollStatus > EnrollStatus.InviteIntoGroup)
|
var enrollStateList = await _enrollDetailRepository.Where(x => x.TrialId == inQuery.TrialId && x.EnrollStatus > EnrollStatus.InviteIntoGroup)
|
||||||
.ProjectTo<DoctorStateModelDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
.ProjectTo<DoctorStateModelDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
using IRaCIS.Application.Contracts;
|
using DocumentFormat.OpenXml.Office2019.Excel.ThreadedComments;
|
||||||
|
using IRaCIS.Application.Contracts;
|
||||||
using IRaCIS.Application.Interfaces;
|
using IRaCIS.Application.Interfaces;
|
||||||
using IRaCIS.Core.Application.Helper;
|
using IRaCIS.Core.Application.Helper;
|
||||||
using IRaCIS.Core.Application.MassTransit.Consumer;
|
using IRaCIS.Core.Application.MassTransit.Consumer;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infrastructure;
|
using IRaCIS.Core.Infrastructure;
|
||||||
|
using MassTransit;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using MimeKit;
|
using MimeKit;
|
||||||
@@ -13,7 +15,11 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
[ApiExplorerSettings(GroupName = "Reviewer")]
|
[ApiExplorerSettings(GroupName = "Reviewer")]
|
||||||
public class DoctorService(IRepository<Doctor> _doctorRepository,
|
public class DoctorService(IRepository<Doctor> _doctorRepository,
|
||||||
IRepository<DoctorDictionary> _doctorDictionaryRepository,
|
IRepository<DoctorDictionary> _doctorDictionaryRepository,
|
||||||
|
IRepository<DoctorSummarize> _doctorSummarizeRepository,
|
||||||
IRepository<Enroll> _enrollRepository,
|
IRepository<Enroll> _enrollRepository,
|
||||||
|
IRepository<UserRole> _userRoleRepository,
|
||||||
|
IRepository<Hospital> _hospitalRepository,
|
||||||
|
IRepository<Dictionary> _dictionaryRepository,
|
||||||
IRepository<Attachment> _attachmentRepository,
|
IRepository<Attachment> _attachmentRepository,
|
||||||
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
|
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
|
||||||
IRepository<DoctorCriterionFile> _doctorCriterionFileRepository,
|
IRepository<DoctorCriterionFile> _doctorCriterionFileRepository,
|
||||||
@@ -69,6 +75,13 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
//插入中间表
|
//插入中间表
|
||||||
basicInfoModel.TitleIds.ForEach(titleId => doctor.DoctorDicRelationList.Add(new DoctorDictionary() { DoctorId = doctor.Id, KeyName = StaticData.Title, DictionaryId = titleId }));
|
basicInfoModel.TitleIds.ForEach(titleId => doctor.DoctorDicRelationList.Add(new DoctorDictionary() { DoctorId = doctor.Id, KeyName = StaticData.Title, DictionaryId = titleId }));
|
||||||
|
|
||||||
|
// 新增给默认值
|
||||||
|
doctor.CooperateStatus = ContractorStatusEnum.Noncooperation;
|
||||||
|
doctor.ReviewStatus = ReviewerInformationConfirmStatus.ConfirmRefuse;
|
||||||
|
doctor.AcceptingNewTrial = false;
|
||||||
|
doctor.ActivelyReading = false;
|
||||||
|
doctor.IsVirtual = false;
|
||||||
|
|
||||||
|
|
||||||
await _doctorRepository.AddAsync(doctor);
|
await _doctorRepository.AddAsync(doctor);
|
||||||
//_doctorRepository.Add(doctor);
|
//_doctorRepository.Add(doctor);
|
||||||
@@ -218,41 +231,121 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<bool> UpdateGneralSituation(UpdateGneralSituationDto inDto)
|
public async Task<(DoctorSummarize,bool)> AddOrUpdateGneralSituation(SummarizeInfoDto inDto)
|
||||||
{
|
{
|
||||||
if (inDto.TrialId != null)
|
if (inDto.TrialId != null&&inDto.Id==null)
|
||||||
{
|
{
|
||||||
await _doctorRepository.UpdatePartialFromQueryAsync(x => x.DoctorId == inDto.Id&&x.TrialId==inDto.TrialId.Value, x => new Doctor()
|
var systemCount = await _doctorSummarizeRepository.Where(x => x.DoctorId == inDto.DoctorId && x.TrialId == null).CountAsync();
|
||||||
|
if (systemCount == 0)
|
||||||
{
|
{
|
||||||
Summarize = inDto.Summarize,
|
var trialinfo = await _trialRepository.Where(x => x.Id == inDto.TrialId).FirstNotNullAsync();
|
||||||
SummarizeEn = inDto.SummarizeEn,
|
var dictionery = await _dictionaryRepository.Where(x => x.Parent.Code == "Indication" && x.Code == trialinfo.IndicationEnum.ToString()).FirstNotNullAsync();
|
||||||
});
|
inDto.IndicationEn = dictionery.Value;
|
||||||
|
inDto.Indication = dictionery.ValueCN;
|
||||||
}
|
var system= inDto.Clone();
|
||||||
else
|
system.TrialId = null;
|
||||||
{
|
system.IsMain = true;
|
||||||
await _doctorRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.Id, x => new Doctor()
|
await _doctorSummarizeRepository.InsertOrUpdateAsync(system, true);
|
||||||
{
|
}
|
||||||
Summarize = inDto.Summarize,
|
|
||||||
SummarizeEn = inDto.SummarizeEn,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (inDto.TrialId == null)
|
||||||
|
{
|
||||||
|
var systemCount = await _doctorSummarizeRepository.Where(x => x.DoctorId == inDto.DoctorId && x.TrialId == null).CountAsync();
|
||||||
|
if (systemCount == 0)
|
||||||
|
{
|
||||||
|
inDto.IsMain = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
if (inDto.Indication.IsNullOrEmpty() && inDto.IndicationEn.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
inDto.Indication = "默认";
|
||||||
|
inDto.IndicationEn = "Default";
|
||||||
|
}
|
||||||
|
var exists = await _doctorSummarizeRepository
|
||||||
|
.Where(x=> x.IndicationEn!=string.Empty && x.Indication!=string.Empty)
|
||||||
|
.Where( x => x.IndicationEn == inDto.IndicationEn|| x.Indication == inDto.Indication)
|
||||||
|
|
||||||
|
.AnyAsync(x => x.DoctorId == inDto.DoctorId && x.TrialId == null&&x.Id!=inDto.Id);
|
||||||
|
if (exists)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(_localizer["DoctorSummarize_repeat"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (inDto.TrialId != null && inDto.SaveSummarizeInfoType!= SaveSummarizeInfo.SaveSelf)
|
||||||
|
{
|
||||||
|
switch (inDto.SaveSummarizeInfoType)
|
||||||
|
{
|
||||||
|
case SaveSummarizeInfo.SaveAndCover:
|
||||||
|
await _doctorSummarizeRepository.BatchUpdateNoTrackingAsync(x =>
|
||||||
|
x.DoctorId == inDto.DoctorId && x.TrialId == null &&
|
||||||
|
x.IndicationEn == inDto.IndicationEn && x.Indication == inDto.Indication, x => new DoctorSummarize()
|
||||||
|
{
|
||||||
|
Summarize = inDto.Summarize,
|
||||||
|
SummarizeEn = inDto.SummarizeEn
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case SaveSummarizeInfo.SaveAndAdd:
|
||||||
|
|
||||||
|
|
||||||
|
var exists = await _doctorSummarizeRepository
|
||||||
|
.WhereIf(_userInfo.IsEn_Us, x => x.IndicationEn == inDto.IndicationEn)
|
||||||
|
.WhereIf(!_userInfo.IsEn_Us, x => x.Indication == inDto.Indication)
|
||||||
|
.AnyAsync(x => x.DoctorId == inDto.DoctorId && x.TrialId == null);
|
||||||
|
if (exists)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(_localizer["DoctorSummarize_repeat"]);
|
||||||
|
}
|
||||||
|
await _doctorSummarizeRepository.BatchDeleteNoTrackingAsync(x => x.DoctorId == inDto.DoctorId && x.TrialId == inDto.TrialId);
|
||||||
|
|
||||||
|
|
||||||
|
var needData = inDto.Clone();
|
||||||
|
needData.TrialId = null;
|
||||||
|
await _doctorSummarizeRepository.InsertOrUpdateAsync(needData, true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (inDto.TrialId == null && inDto.IsMain)
|
||||||
|
{
|
||||||
|
|
||||||
|
await _doctorSummarizeRepository.BatchUpdateNoTrackingAsync(x => x.DoctorId == inDto.DoctorId && x.TrialId == null,
|
||||||
|
x => new DoctorSummarize()
|
||||||
|
{
|
||||||
|
IsMain = false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
var success= await _doctorRepository.SaveChangesAsync();
|
|
||||||
return success;
|
var entity = await _doctorSummarizeRepository.InsertOrUpdateAsync(inDto, true);
|
||||||
|
return (entity,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除概述
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<bool> DeleteSummarizeInfo(DeleteSummarizeInfoInDto inDto)
|
||||||
|
{
|
||||||
|
var result = await _doctorSummarizeRepository.DeleteFromQueryAsync(x=>x.Id==inDto.Id);
|
||||||
|
return await _doctorSummarizeRepository.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取概述
|
/// 获取概述
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Id"></param>
|
/// <param name="Id"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<UpdateGneralSituationDto?> GetSummarizeInfo(GetSummarizeInfoInDto inDto)
|
[HttpPost]
|
||||||
|
public async Task<UpdateGneralSituationDto> GetSummarizeInfo(GetSummarizeInfoInDto inDto)
|
||||||
{
|
{
|
||||||
var doctorBasicInfo = (await _doctorRepository.Where(t => t.Id == inDto.DoctorId)
|
|
||||||
.ProjectTo<UpdateGneralSituationDto>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
|
||||||
if (inDto.TrialId != null)
|
if (inDto.TrialId != null)
|
||||||
{
|
{
|
||||||
var doctorInfo = await trialExperienceService.GetTrialDoctorInfo(new GetTrialDoctorInfoInDto()
|
var doctorInfo = await trialExperienceService.GetTrialDoctorInfo(new GetTrialDoctorInfoInDto()
|
||||||
@@ -261,15 +354,12 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
DoctorId = inDto.DoctorId,
|
DoctorId = inDto.DoctorId,
|
||||||
});
|
});
|
||||||
|
|
||||||
doctorBasicInfo = new UpdateGneralSituationDto()
|
|
||||||
{
|
|
||||||
Summarize = doctorInfo.Summarize,
|
|
||||||
SummarizeEn = doctorInfo.SummarizeEn,
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
var result = await _doctorSummarizeRepository.Where(t => t.DoctorId == inDto.DoctorId && t.TrialId == inDto.TrialId)
|
||||||
return doctorBasicInfo;
|
.ProjectTo<SummarizeInfoDto>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
return new UpdateGneralSituationDto() {
|
||||||
|
SummarizeList= result
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -283,7 +373,12 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
var messageToSend = new MimeMessage();
|
var messageToSend = new MimeMessage();
|
||||||
//发件地址
|
//发件地址
|
||||||
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
||||||
messageToSend.To.Add(new MailboxAddress(String.Empty, inDto.Email));
|
foreach (var item in inDto.Email)
|
||||||
|
{
|
||||||
|
messageToSend.To.Add(new MailboxAddress(String.Empty, item));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
||||||
@@ -396,7 +491,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
var doctorBasicInfo = (await _doctorRepository.Where(t => t.Id == doctorId)
|
var doctorBasicInfo = (await _doctorRepository.Where(t => t.Id == doctorId)
|
||||||
.ProjectTo<DoctorBasicInfoDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
.ProjectTo<DoctorBasicInfoDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
doctorBasicInfo.IsHaveAccount =await _userRoleRepository.AnyAsync(x => x.DoctorId == doctorId);
|
||||||
return doctorBasicInfo;
|
return doctorBasicInfo;
|
||||||
|
|
||||||
|
|
||||||
@@ -489,7 +584,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
|
|
||||||
public async Task<IResponseOutput> UpdateEmploymentInfo(EmploymentCommand doctorWorkInfoModel)
|
public async Task<IResponseOutput> UpdateEmploymentInfo(EmploymentCommand inDto)
|
||||||
{
|
{
|
||||||
#region 废弃
|
#region 废弃
|
||||||
//var success = _doctorRepository.Update(d => d.Id == doctorWorkInfoModel.Id, u => new Doctor()
|
//var success = _doctorRepository.Update(d => d.Id == doctorWorkInfoModel.Id, u => new Doctor()
|
||||||
@@ -519,8 +614,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
//var success = _doctorRepository.SaveChanges();
|
//var success = _doctorRepository.SaveChanges();
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
var entity = await _doctorRepository.InsertOrUpdateAsync(inDto, true);
|
||||||
var entity = await _doctorRepository.InsertOrUpdateAsync(doctorWorkInfoModel, true);
|
|
||||||
|
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
@@ -629,7 +723,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> UpdateAuditResume(ResumeConfirmCommand auditResumeParam)
|
public async Task<IResponseOutput> UpdateAuditResume(ResumeConfirmCommand auditResumeParam)
|
||||||
{
|
{
|
||||||
var userId = _userInfo.Id;
|
var userId = _userInfo.UserRoleId;
|
||||||
//判断 合作协议、正式简历 是否有。如果没有,显示提示信息,并且不能保存
|
//判断 合作协议、正式简历 是否有。如果没有,显示提示信息,并且不能保存
|
||||||
var attachmentList = await _attachmentRepository.Where(u => u.DoctorId == auditResumeParam.Id)
|
var attachmentList = await _attachmentRepository.Where(u => u.DoctorId == auditResumeParam.Id)
|
||||||
.Select(u => u.Type).ToListAsync();
|
.Select(u => u.Type).ToListAsync();
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
{
|
{
|
||||||
[ApiExplorerSettings(GroupName = "Reviewer")]
|
[ApiExplorerSettings(GroupName = "Reviewer")]
|
||||||
public class EducationService(IRepository<Postgraduate> _postgraduateRepository,
|
public class EducationService(IRepository<Postgraduate> _postgraduateRepository,
|
||||||
|
IRepository<Hospital> _hospitalRepository,
|
||||||
IRepository<Education> _educationRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IEducationService
|
IRepository<Education> _educationRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IEducationService
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -21,7 +22,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
.OrderBy(t => t.CreateTime).ProjectTo<EducationInfoViewModel>(_mapper.ConfigurationProvider).ToListAsync();
|
.OrderBy(t => t.CreateTime).ProjectTo<EducationInfoViewModel>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
var postgraduateList = await _postgraduateRepository.Where(o => o.DoctorId == doctorId)
|
var postgraduateList = await _postgraduateRepository.Where(o => o.DoctorId == doctorId)
|
||||||
.OrderBy(t => t.CreateTime).ProjectTo<PostgraduateViewModel>(_mapper.ConfigurationProvider).ToListAsync();
|
.OrderBy(t => t.CreateTime).ProjectTo<PostgraduateViewModel>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us }).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
return new DoctorEducationExperienceDTO()
|
return new DoctorEducationExperienceDTO()
|
||||||
@@ -88,7 +89,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
/// <summary> 添加/更新医生继续学习经历</summary>
|
/// <summary> 添加/更新医生继续学习经历</summary>
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> AddOrUpdatePostgraduateInfo(PostgraduateCommand postgraduateViewModel)
|
public async Task<IResponseOutput> AddOrUpdatePostgraduateInfo(PostgraduateCommand inDto)
|
||||||
{
|
{
|
||||||
#region 封装前
|
#region 封装前
|
||||||
|
|
||||||
@@ -109,8 +110,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
//}
|
//}
|
||||||
#endregion
|
#endregion
|
||||||
|
var entity = await _postgraduateRepository.InsertOrUpdateAsync(inDto, true);
|
||||||
var entity = await _postgraduateRepository.InsertOrUpdateAsync(postgraduateViewModel, true);
|
|
||||||
return ResponseOutput.Ok(entity.Id);
|
return ResponseOutput.Ok(entity.Id);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using IRaCIS.Application.Contracts;
|
using IRaCIS.Application.Contracts;
|
||||||
using IRaCIS.Application.Interfaces;
|
using IRaCIS.Application.Interfaces;
|
||||||
|
using MassTransit;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service
|
namespace IRaCIS.Core.Application.Service
|
||||||
@@ -7,6 +8,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
[ApiExplorerSettings(GroupName = "Reviewer")]
|
[ApiExplorerSettings(GroupName = "Reviewer")]
|
||||||
public class TrialExperienceService(IRepository<TrialExperience> _trialExperienceRepository,
|
public class TrialExperienceService(IRepository<TrialExperience> _trialExperienceRepository,
|
||||||
IRepository<Doctor> _doctorRepository,
|
IRepository<Doctor> _doctorRepository,
|
||||||
|
IRepository<DoctorSummarize> _doctorSummarizeRepository,
|
||||||
IRepository<TrialExperienceCriteria> _trialExperienceCriteriaRepository,
|
IRepository<TrialExperienceCriteria> _trialExperienceCriteriaRepository,
|
||||||
IRepository<Attachment> _attachmentRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITrialExperienceService
|
IRepository<Attachment> _attachmentRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITrialExperienceService
|
||||||
{
|
{
|
||||||
@@ -84,11 +86,59 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
TrialId = inDto.TrialId,
|
TrialId = inDto.TrialId,
|
||||||
OtherClinicalExperience = systemInfoDcotor.OtherClinicalExperience,
|
OtherClinicalExperience = systemInfoDcotor.OtherClinicalExperience,
|
||||||
OtherClinicalExperienceCN = systemInfoDcotor.OtherClinicalExperienceCN,
|
OtherClinicalExperienceCN = systemInfoDcotor.OtherClinicalExperienceCN,
|
||||||
Summarize = systemInfoDcotor.Summarize,
|
|
||||||
SummarizeEn = systemInfoDcotor.SummarizeEn,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#region 概述
|
||||||
|
///没有就加
|
||||||
|
var summarizeCount = await _doctorSummarizeRepository.Where(x => x.DoctorId == inDto.DoctorId && x.TrialId == inDto.TrialId).CountAsync();
|
||||||
|
if (summarizeCount == 0)
|
||||||
|
{
|
||||||
|
var main = await _doctorSummarizeRepository.Where(x => x.DoctorId == inDto.DoctorId && x.IsMain && x.TrialId == null).ProjectTo<SummarizeInfoDto>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
||||||
|
if (main != null)
|
||||||
|
{
|
||||||
|
main.Id = null;
|
||||||
|
main.TrialId = inDto.TrialId;
|
||||||
|
main.IsMain = false;
|
||||||
|
var entity = await _doctorSummarizeRepository.InsertOrUpdateAsync(main, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
doctorInfo = await _doctorRepository.AddAsync(doctor, true);
|
doctorInfo = await _doctorRepository.AddAsync(doctor, true);
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region 临床试验
|
||||||
|
|
||||||
|
var trialExperienceList = await _trialExperienceRepository.Where(o => o.DoctorId == inDto.DoctorId)
|
||||||
|
.Where(x=>x.TrialId==null||x.TrialId!=inDto.TrialId)
|
||||||
|
.Where(x => x.ExperienceDataType == ExperienceDataType.System || x.ExperienceDataType == ExperienceDataType.SystemAuto).Include(x => x.ExperienceCriteriaList).ToListAsync();
|
||||||
|
List<TrialExperienceCriteria> criteriaList = new List<TrialExperienceCriteria>();
|
||||||
|
foreach (var item in trialExperienceList)
|
||||||
|
{
|
||||||
|
item.Trial = null;
|
||||||
|
item.TrialId = inDto.TrialId;
|
||||||
|
item.ExperienceDataType = ExperienceDataType.Trial;
|
||||||
|
item.Id = NewId.NextGuid();
|
||||||
|
item.ExperienceCriteriaList.ForEach(x => {
|
||||||
|
|
||||||
|
criteriaList.Add(new TrialExperienceCriteria()
|
||||||
|
{
|
||||||
|
DoctorId = item.DoctorId,
|
||||||
|
EvaluationCriteriaId = x.EvaluationCriteriaId,
|
||||||
|
TrialExperienceId = item.Id
|
||||||
|
});
|
||||||
|
});
|
||||||
|
item.ExperienceCriteriaList = new List<TrialExperienceCriteria>();
|
||||||
|
}
|
||||||
|
await _trialExperienceCriteriaRepository.AddRangeAsync(criteriaList);
|
||||||
|
await _trialExperienceRepository.AddRangeAsync(trialExperienceList);
|
||||||
|
await _trialExperienceRepository.SaveChangesAsync();
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return doctorInfo;
|
return doctorInfo;
|
||||||
@@ -107,25 +157,20 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 当前项目没有则复制
|
// 先添加
|
||||||
if (!(await _trialExperienceRepository.AnyAsync(x => x.TrialId == inDto.TrialId)))
|
await GetTrialDoctorInfo(new GetTrialDoctorInfoInDto()
|
||||||
{
|
{
|
||||||
var trialExperienceList = await _trialExperienceRepository.Where(o => o.DoctorId == inDto.DoctorId)
|
DoctorId = inDto.DoctorId,
|
||||||
.Where(x => x.ExperienceDataType == ExperienceDataType.System || x.ExperienceDataType == ExperienceDataType.SystemAuto).ToListAsync();
|
TrialId = inDto.TrialId.Value,
|
||||||
foreach (var item in trialExperienceList)
|
});
|
||||||
{
|
|
||||||
item.Trial = null;
|
|
||||||
item.TrialId = inDto.TrialId;
|
|
||||||
item.ExperienceDataType = ExperienceDataType.Trial;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var doctorClinicalTrialExperienceList = await _trialExperienceRepository
|
var doctorClinicalTrialExperienceList = await _trialExperienceRepository
|
||||||
.Where(o => o.DoctorId == inDto.DoctorId)
|
.Where(o => o.DoctorId == inDto.DoctorId)
|
||||||
.Where(x => x.ExperienceDataType == ExperienceDataType.Trial|| x.ExperienceDataType == ExperienceDataType.TrialAuto)
|
.Where(x => x.ExperienceDataType == ExperienceDataType.Trial|| x.ExperienceDataType == ExperienceDataType.TrialAuto)
|
||||||
.Where(x => x.TrialId == inDto.TrialId.Value)
|
.Where(x => x.TrialId == inDto.TrialId.Value)
|
||||||
.OrderBy(t => t.CreateTime)
|
.OrderBy(t => t.CreateTime)
|
||||||
.ProjectTo<TrialExperienceListDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
.ProjectTo<TrialExperienceListDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
return doctorClinicalTrialExperienceList;
|
return doctorClinicalTrialExperienceList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,7 +287,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
if (inDto.TrialId != null)
|
if (inDto.TrialId != null)
|
||||||
{
|
{
|
||||||
var success = await _doctorRepository.BatchUpdateNoTrackingAsync(o => o.Id == inDto.DoctorId&&o.TrialId==inDto.TrialId.Value, u => new Doctor()
|
var success = await _doctorRepository.BatchUpdateNoTrackingAsync(o => o.DoctorId == inDto.DoctorId&&o.TrialId==inDto.TrialId.Value, u => new Doctor()
|
||||||
{
|
{
|
||||||
OtherClinicalExperience = inDto.OtherClinicalExperience ?? string.Empty,
|
OtherClinicalExperience = inDto.OtherClinicalExperience ?? string.Empty,
|
||||||
OtherClinicalExperienceCN = inDto.OtherClinicalExperienceCN ?? string.Empty
|
OtherClinicalExperienceCN = inDto.OtherClinicalExperienceCN ?? string.Empty
|
||||||
|
|||||||
@@ -70,6 +70,36 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取是否休假
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<GetIsVacationOutDto> GetIsVacation(GetIsVacationInDto inDto)
|
||||||
|
{
|
||||||
|
var query = await _vacationRepository.Where(u => u.DoctorId == inDto.DoctorId).ToListAsync();
|
||||||
|
|
||||||
|
bool isVacation = false;
|
||||||
|
|
||||||
|
var now = DateTime.Now;
|
||||||
|
foreach (var item in query)
|
||||||
|
{
|
||||||
|
if (item.StartDate <= now && now <= item.EndDate)
|
||||||
|
{
|
||||||
|
isVacation = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new GetIsVacationOutDto() {
|
||||||
|
|
||||||
|
IsVacation= isVacation
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
[NonDynamicMethod]
|
[NonDynamicMethod]
|
||||||
public async Task<IResponseOutput> OnVacation(Guid doctorId)
|
public async Task<IResponseOutput> OnVacation(Guid doctorId)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
{
|
{
|
||||||
public DoctorConfig()
|
public DoctorConfig()
|
||||||
{
|
{
|
||||||
|
var isEn_Us = false;
|
||||||
|
|
||||||
|
Guid TrialId = Guid.Empty;
|
||||||
|
|
||||||
// 从 DateTime 映射到 DateOnly
|
// 从 DateTime 映射到 DateOnly
|
||||||
CreateMap<DateTime, DateOnly>().ConvertUsing(dt => DateOnly.FromDateTime(dt));
|
CreateMap<DateTime, DateOnly>().ConvertUsing(dt => DateOnly.FromDateTime(dt));
|
||||||
@@ -57,12 +60,27 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
CreateMap<AddDoctorCriterionFileDto, DoctorCriterionFile>();
|
CreateMap<AddDoctorCriterionFileDto, DoctorCriterionFile>();
|
||||||
CreateMap<DoctorCriterionFile, GetDoctorCriterionFileOutDto>();
|
CreateMap<DoctorCriterionFile, GetDoctorCriterionFileOutDto>();
|
||||||
CreateMap<Doctor, DoctorBasicInfoCommand>();
|
CreateMap<Doctor, DoctorBasicInfoCommand>();
|
||||||
|
|
||||||
|
CreateMap<Doctor, BasicInfoAndEmploymentDto>();
|
||||||
|
|
||||||
|
CreateMap<BasicInfoAndEmploymentDto, Doctor>().ForAllMembers(opts => opts.Condition((src, dest, srcMember) => srcMember != null)); ;
|
||||||
|
|
||||||
CreateMap<Education, EducationInfoViewModel>();
|
CreateMap<Education, EducationInfoViewModel>();
|
||||||
|
|
||||||
CreateMap<Vacation, VacationCommand>();
|
CreateMap<Vacation, VacationCommand>();
|
||||||
CreateMap<ResearchPublication, ResearchPublicationDTO>();
|
CreateMap<ResearchPublication, ResearchPublicationDTO>();
|
||||||
CreateMap<Postgraduate, PostgraduateViewModel>();
|
CreateMap<Postgraduate, PostgraduateViewModel>();
|
||||||
CreateMap<Attachment, AttachmentDTO>();
|
// .ForMember(t => t.Hospital, c => c.MapFrom(d => d.HospitalEnt.HospitalName))
|
||||||
|
//.ForMember(t => t.HospitalCN, c => c.MapFrom(d => d.HospitalEnt.HospitalNameCN));
|
||||||
|
CreateMap<Attachment, AttachmentDTO>()
|
||||||
|
.ForMember(d => d.BlindName, u => u.MapFrom(t => t.Doctor.BlindName))
|
||||||
|
.ForMember(d => d.BlindNameCN, u => u.MapFrom(t => t.Doctor.BlindNameCN))
|
||||||
|
.ForMember(d => d.ChineseName, u => u.MapFrom(t => t.Doctor.ChineseName))
|
||||||
|
.ForMember(d => d.FirstName, u => u.MapFrom(t => t.Doctor.FirstName))
|
||||||
|
.ForMember(d => d.LastName, u => u.MapFrom(t => t.Doctor.LastName))
|
||||||
|
.ForMember(d => d.UserName, u => u.MapFrom(t => t.Doctor.EnrollList.Where(y=>y.TrialId== TrialId).Select(x=>x.DoctorUser.UserName).First()))
|
||||||
|
;
|
||||||
|
CreateMap<Doctor, GetTrialDoctorListOutDto>();
|
||||||
CreateMap<Doctor, ResumeConfirmDTO>();
|
CreateMap<Doctor, ResumeConfirmDTO>();
|
||||||
|
|
||||||
CreateMap<Doctor, DoctorSelectDTO>();
|
CreateMap<Doctor, DoctorSelectDTO>();
|
||||||
@@ -70,6 +88,9 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
CreateMap<Doctor, PaymentModeDto>();
|
CreateMap<Doctor, PaymentModeDto>();
|
||||||
|
|
||||||
|
CreateMap<DoctorSummarize, SummarizeInfoDto>();
|
||||||
|
CreateMap<SummarizeInfoDto, DoctorSummarize>();
|
||||||
|
|
||||||
CreateMap<PaymentModeDto, Doctor>();
|
CreateMap<PaymentModeDto, Doctor>();
|
||||||
|
|
||||||
CreateMap<Doctor, TrialExperienceModel>();
|
CreateMap<Doctor, TrialExperienceModel>();
|
||||||
@@ -88,11 +109,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
CreateMap<DoctorDTO, SelectionReviewerDTO>()
|
CreateMap<DoctorDTO, SelectionReviewerDTO>()
|
||||||
;
|
;
|
||||||
|
|
||||||
CreateMap<User, UserBasicInfo>()
|
CreateMap<UserRole, UserBasicInfo>();
|
||||||
.ForMember(d => d.UserTypeShortName, u => u.MapFrom(t => t.UserTypeRole.UserTypeShortName))
|
|
||||||
.ForMember(d => d.Code, u => u.MapFrom(t => t.UserCode))
|
|
||||||
.ForMember(d => d.PermissionStr, u => u.MapFrom(t => t.UserTypeRole.PermissionStr))
|
|
||||||
.ForMember(d => d.RealName, u => u.MapFrom(user => string.IsNullOrEmpty(user.FirstName) ? user.LastName : user.LastName + " / " + user.FirstName));
|
|
||||||
|
|
||||||
CreateMap<TrialExperience, TrialExperienceListDTO>()
|
CreateMap<TrialExperience, TrialExperienceListDTO>()
|
||||||
.ForMember(x=>x.VisitReadingCount, u => u.MapFrom(t => (t.ExperienceDataType==ExperienceDataType.TrialAuto||t.ExperienceDataType==ExperienceDataType.SystemAuto)?
|
.ForMember(x=>x.VisitReadingCount, u => u.MapFrom(t => (t.ExperienceDataType==ExperienceDataType.TrialAuto||t.ExperienceDataType==ExperienceDataType.SystemAuto)?
|
||||||
@@ -105,15 +122,17 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
.ForMember(d => d.EvaluationCriteriaList, u => u.MapFrom(t => t.ExperienceCriteriaList.Select(t => t.EvaluationCriteria.Value)))
|
.ForMember(d => d.EvaluationCriteriaList, u => u.MapFrom(t => t.ExperienceCriteriaList.Select(t => t.EvaluationCriteria.Value)))
|
||||||
.ForMember(d => d.EvaluationCriteriaIdList, u => u.MapFrom(t => t.ExperienceCriteriaList.Select(t => t.EvaluationCriteriaId)));
|
.ForMember(d => d.EvaluationCriteriaIdList, u => u.MapFrom(t => t.ExperienceCriteriaList.Select(t => t.EvaluationCriteriaId)));
|
||||||
|
|
||||||
CreateMap<Doctor, UserBasicInfo>()
|
//CreateMap<Doctor, UserBasicInfo>()
|
||||||
.ForMember(d => d.Code, u => u.MapFrom(t => t.ReviewerCode))
|
// .ForMember(d => d.Code, u => u.MapFrom(t => t.ReviewerCode))
|
||||||
.ForMember(d => d.RealName, u => u.MapFrom(t => t.ChineseName))
|
// .ForMember(d => d.RealName, u => u.MapFrom(t => t.ChineseName))
|
||||||
.ForMember(d => d.IsReviewer, u => u.MapFrom(t => true))
|
// .ForMember(d => d.IsReviewer, u => u.MapFrom(t => true))
|
||||||
.ForMember(d => d.UserName, u => u.MapFrom(doctor => doctor.LastName + " / " + doctor.FirstName));
|
// .ForMember(d => d.UserName, u => u.MapFrom(doctor => doctor.LastName + " / " + doctor.FirstName));
|
||||||
|
|
||||||
#region 医生基本信息
|
#region 医生基本信息
|
||||||
CreateMap<Doctor, SelectionReviewerDTO>()
|
CreateMap<Doctor, SelectionReviewerDTO>()
|
||||||
.ForMember(d => d.DoctorUserName, u => u.MapFrom(t => t.User.UserName));
|
.ForMember(d => d.DoctorUserName, u => u.MapFrom(t => t.UserRole.IdentityUser.UserName));
|
||||||
|
|
||||||
|
|
||||||
CreateMap<Doctor, DoctorDTO>().IncludeMembers(t => t.Hospital).Include<Doctor, SelectionReviewerDTO>()
|
CreateMap<Doctor, DoctorDTO>().IncludeMembers(t => t.Hospital).Include<Doctor, SelectionReviewerDTO>()
|
||||||
.ForMember(d => d.AccountUserName, u => u.MapFrom(s => s.EnrollList.Where(t => t.DoctorUserId != null).Select(c => c.DoctorUser.UserName).FirstOrDefault()))
|
.ForMember(d => d.AccountUserName, u => u.MapFrom(s => s.EnrollList.Where(t => t.DoctorUserId != null).Select(c => c.DoctorUser.UserName).FirstOrDefault()))
|
||||||
.ForMember(d => d.Department, u => u.MapFrom(s => s.Department.Value))
|
.ForMember(d => d.Department, u => u.MapFrom(s => s.Department.Value))
|
||||||
@@ -169,9 +188,21 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
CreateMap<Hospital, EmploymentDTO>();
|
CreateMap<Hospital, EmploymentDTO>();
|
||||||
|
|
||||||
CreateMap<EnrollDetail, DoctorStateModelDTO>()
|
CreateMap<EnrollDetail, DoctorStateModelDTO>()
|
||||||
|
.ForMember(d => d.UserTypeEnum, u => u.MapFrom(s => s.CreateUserRole.UserTypeEnum))
|
||||||
.ForMember(d => d.IntoGroupState, u => u.MapFrom(s => s.EnrollStatus))
|
.ForMember(d => d.IntoGroupState, u => u.MapFrom(s => s.EnrollStatus))
|
||||||
.ForMember(d => d.OptTime, u => u.MapFrom(s => s.CreateTime))
|
.ForMember(d => d.OptTime, u => u.MapFrom(s => s.CreateTime))
|
||||||
.ForMember(d => d.OptUserName, u => u.MapFrom(s => s.CreateUser.UserName));
|
.ForMember(d => d.OptUserName, u => u.MapFrom(s => s.CreateUserRole.IdentityUser.UserName));
|
||||||
|
|
||||||
|
|
||||||
|
CreateMap<Enroll, TrialDoctorInfo>().IncludeMembers(t => t.Doctor, t => t.Doctor.Hospital)
|
||||||
|
.ForMember(o => o.DictionaryList, t => t.MapFrom(u => u.Doctor.DoctorDicRelationList.Where(t => t.KeyName == StaticData.ReadingType || t.KeyName == StaticData.Subspeciality).Select(t => t.Dictionary).OrderBy(t => t.ShowOrder)))
|
||||||
|
.ForMember(d => d.Speciality, u => u.MapFrom(s => s.Doctor.Speciality.Value))
|
||||||
|
.ForMember(d => d.SpecialityCN, u => u.MapFrom(s => s.Doctor.Speciality.ValueCN))
|
||||||
|
.ForMember(d => d.Id, u => u.MapFrom(s => s.Doctor.Id))
|
||||||
|
.ForMember(d => d.Code, u => u.MapFrom(s => s.DoctorUser.UserName));
|
||||||
|
|
||||||
|
CreateMap<Doctor, TrialDoctorInfo>();
|
||||||
|
CreateMap<Hospital, TrialDoctorInfo>();
|
||||||
|
|
||||||
CreateMap<Enroll, ConfirmationReviewerDTO>().IncludeMembers(t => t.Doctor, t => t.Doctor.Hospital)
|
CreateMap<Enroll, ConfirmationReviewerDTO>().IncludeMembers(t => t.Doctor, t => t.Doctor.Hospital)
|
||||||
.ForMember(o => o.DictionaryList, t => t.MapFrom(u => u.Doctor.DoctorDicRelationList.Where(t => t.KeyName == StaticData.ReadingType || t.KeyName == StaticData.Subspeciality).Select(t => t.Dictionary).OrderBy(t => t.ShowOrder)))
|
.ForMember(o => o.DictionaryList, t => t.MapFrom(u => u.Doctor.DoctorDicRelationList.Where(t => t.KeyName == StaticData.ReadingType || t.KeyName == StaticData.Subspeciality).Select(t => t.Dictionary).OrderBy(t => t.ShowOrder)))
|
||||||
@@ -179,6 +210,8 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
.ForMember(d => d.SpecialityCN, u => u.MapFrom(s => s.Doctor.Speciality.ValueCN))
|
.ForMember(d => d.SpecialityCN, u => u.MapFrom(s => s.Doctor.Speciality.ValueCN))
|
||||||
.ForMember(d => d.Id, u => u.MapFrom(s => s.Doctor.Id))
|
.ForMember(d => d.Id, u => u.MapFrom(s => s.Doctor.Id))
|
||||||
.ForMember(d => d.Code, u => u.MapFrom(s => s.DoctorUser.UserName))
|
.ForMember(d => d.Code, u => u.MapFrom(s => s.DoctorUser.UserName))
|
||||||
|
.ForMember(d => d.HospitalName, u => u.MapFrom(s => s.Doctor.HospitalName))
|
||||||
|
.ForMember(d => d.HospitalNameCN, u => u.MapFrom(s => s.Doctor.HospitalNameCN))
|
||||||
;
|
;
|
||||||
CreateMap<Doctor, ConfirmationReviewerDTO>();
|
CreateMap<Doctor, ConfirmationReviewerDTO>();
|
||||||
CreateMap<Hospital, ConfirmationReviewerDTO>();
|
CreateMap<Hospital, ConfirmationReviewerDTO>();
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
||||||
|
// 生成时间 2025-02-21 07:47:30Z
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
using System;
|
||||||
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
namespace IRaCIS.Core.Application.ViewModel;
|
||||||
|
|
||||||
|
public class SysFileTypeView : SysFileTypeAddOrEdit
|
||||||
|
{
|
||||||
|
|
||||||
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
|
public DateTime UpdateTime { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class SysFileTypeAddOrEdit
|
||||||
|
{
|
||||||
|
public Guid? Id { get; set; }
|
||||||
|
|
||||||
|
public ArchiveType ArchiveTypeEnum { get; set; }
|
||||||
|
|
||||||
|
public bool IsConfirmRecord { get; set; }
|
||||||
|
|
||||||
|
public bool IsEnable { get; set; }
|
||||||
|
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public string NameCN { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 显示顺序
|
||||||
|
/// </summary>
|
||||||
|
public int ShowOrder { get; set; }
|
||||||
|
|
||||||
|
public SubIdentification SubIdentificationEnum { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SysFileTypeQuery : PageInput
|
||||||
|
{
|
||||||
|
public ArchiveType? ArchiveTypeEnum { get; set; }
|
||||||
|
|
||||||
|
public bool? IsConfirmRecord { get; set; }
|
||||||
|
|
||||||
|
public bool? IsEnable { get; set; }
|
||||||
|
|
||||||
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
public string? NameCN { get; set; }
|
||||||
|
|
||||||
|
public SubIdentification? SubIdentificationEnum { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
// 生成时间 2022-01-05 09:17:10
|
// 生成时间 2022-01-05 09:17:10
|
||||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
using Newtonsoft.Json;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Contracts
|
namespace IRaCIS.Core.Application.Contracts
|
||||||
@@ -38,6 +39,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
|
|
||||||
public string ExperimentName { get; set; }
|
public string ExperimentName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -56,8 +58,14 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
public string RealName { get; set; } = string.Empty;
|
public string RealName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
public Guid UserTypeId { get; set; }
|
public string DocTypeCode { get; set; }
|
||||||
public string UserTypeShortName { get; set; } = string.Empty;
|
|
||||||
|
public List<string> UserConfirmedUserTypeList => (DocNeedSignUserTypeList != null && IdentityUserTypeList != null) ? IdentityUserTypeList.Intersect(DocNeedSignUserTypeList).ToList() : new List<string>();
|
||||||
|
|
||||||
|
|
||||||
|
public IEnumerable<string> IdentityUserTypeList { get; set; }
|
||||||
|
public IEnumerable<string> DocNeedSignUserTypeList { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -170,7 +178,25 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
|
|
||||||
public bool? IsConfirmed { get; set; }
|
public bool? IsConfirmed { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 课时状态
|
||||||
|
/// </summary>
|
||||||
public bool? IsDeleted { get; set; }
|
public bool? IsDeleted { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 用户名
|
||||||
|
/// </summary>
|
||||||
|
public string? UserName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 开始时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? StartConfirmTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 结束时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? EndConfirmTime { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
///<summary> SystemDocumentAddOrEdit 列表查询参数模型</summary>
|
///<summary> SystemDocumentAddOrEdit 列表查询参数模型</summary>
|
||||||
|
|||||||
@@ -108,6 +108,16 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||||||
public string SortField { get; set; } = string.Empty;
|
public string SortField { get; set; } = string.Empty;
|
||||||
|
|
||||||
public bool Asc { get; set; }
|
public bool Asc { get; set; }
|
||||||
|
|
||||||
|
public bool? IsEnable { get; set; }
|
||||||
|
|
||||||
|
public int? EmailUrgentEnum { get; set; }
|
||||||
|
|
||||||
|
public UserTypeEnum? ToUserType { get; set; }
|
||||||
|
|
||||||
|
public UserTypeEnum? CopyUserType { get; set; }
|
||||||
|
|
||||||
|
public BusinessModule? BusinessModuleEnum { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,153 @@
|
|||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
||||||
|
// 生成时间 2025-02-21 07:47:30Z
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
using System;
|
||||||
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Reflection.Metadata;
|
||||||
|
namespace IRaCIS.Core.Application.ViewModel;
|
||||||
|
|
||||||
|
public class TrialFileTypeView : TrialFileTypeAddOrEdit
|
||||||
|
{
|
||||||
|
|
||||||
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
|
public DateTime UpdateTime { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GetTrialFileTypeDataOutDto
|
||||||
|
{
|
||||||
|
public List<TrialFileTypeData> TrialFileTypeDataList { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TrialFileTypeData
|
||||||
|
{
|
||||||
|
public ArchiveType ArchiveTypeEnum { get; set; }
|
||||||
|
|
||||||
|
public List<TrialFileTypeView> TrialFileTypeList { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class GetTrialFileTypeFileInDto
|
||||||
|
{
|
||||||
|
public Guid TrialFileTypeId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UploadTrialFileTypeFileInDto
|
||||||
|
{
|
||||||
|
public Guid TrialFileTypeId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 文件
|
||||||
|
/// </summary>
|
||||||
|
public TrialFileDto? FileRecord { get; set; }
|
||||||
|
}
|
||||||
|
public class SetAuthorizedViewInDto
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
|
public bool IsEnable { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GetTrialFileTypeDataInDto
|
||||||
|
{
|
||||||
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否启用
|
||||||
|
/// </summary>
|
||||||
|
public bool IsEnable { get; set; } = false;
|
||||||
|
}
|
||||||
|
public class CopySystemFileTypeToTrialInDto
|
||||||
|
{
|
||||||
|
public Guid TrialId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TrialFileTypeSelectView
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public bool IsEnable { get; set; }
|
||||||
|
|
||||||
|
public bool IsSelfDefine { get; set; }
|
||||||
|
|
||||||
|
public ArchiveType ArchiveTypeEnum { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class TrialFileTypeAddOrEdit
|
||||||
|
{
|
||||||
|
public Guid? Id { get; set; }
|
||||||
|
|
||||||
|
public ArchiveType ArchiveTypeEnum { get; set; }
|
||||||
|
|
||||||
|
public DateOnly? FirstFinalDate { get; set; }
|
||||||
|
|
||||||
|
public bool IsConfirmRecord { get; set; }
|
||||||
|
|
||||||
|
public bool IsEnable { get; set; }
|
||||||
|
|
||||||
|
public bool IsSelfDefine { get; set; }
|
||||||
|
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public string NameCN { get; set; }
|
||||||
|
|
||||||
|
public SubIdentification SubIdentificationEnum { get; set; }
|
||||||
|
|
||||||
|
public Guid? SysFileTypeId { get; set; }
|
||||||
|
|
||||||
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 显示顺序
|
||||||
|
/// </summary>
|
||||||
|
public int ShowOrder { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TrialFileTypeQuery : PageInput
|
||||||
|
{
|
||||||
|
public ArchiveType? ArchiveTypeEnum { get; set; }
|
||||||
|
|
||||||
|
public DateOnly? FirstFinalDate { get; set; }
|
||||||
|
|
||||||
|
public bool? IsConfirmRecord { get; set; }
|
||||||
|
|
||||||
|
public bool? IsEnable { get; set; }
|
||||||
|
|
||||||
|
public bool? IsSelfDefine { get; set; }
|
||||||
|
|
||||||
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
public string? NameCN { get; set; }
|
||||||
|
|
||||||
|
public SubIdentification? SubIdentificationEnum { get; set; }
|
||||||
|
|
||||||
|
[NotDefault]
|
||||||
|
public Guid TrialId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class TrialFileTypeSelectQuery
|
||||||
|
{
|
||||||
|
[NotDefault]
|
||||||
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
public bool? IsEnable { get; set; }
|
||||||
|
|
||||||
|
public bool? IsSelfDefine { get; set; }
|
||||||
|
|
||||||
|
public ArchiveType? ArchiveTypeEnum { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
||||||
|
// 生成时间 2025-02-21 07:47:30Z
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
using System;
|
||||||
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
namespace IRaCIS.Core.Application.ViewModel;
|
||||||
|
|
||||||
|
public class TrialFinalRecordView : TrialFinalRecordAddOrEdit
|
||||||
|
{
|
||||||
|
|
||||||
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
|
public DateTime UpdateTime { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DeleteTrialNormalRecordListInDto
|
||||||
|
{
|
||||||
|
public List<Guid> Ids { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AuthorizedTrialFinalRecordInDto
|
||||||
|
{
|
||||||
|
public List<Guid> Ids { get; set; }
|
||||||
|
|
||||||
|
public bool IsAuthorizedView { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TrialFinalRecordAddOrEdit
|
||||||
|
{
|
||||||
|
public Guid? Id { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public bool IsAuthorizedView { get; set; }
|
||||||
|
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public int State { get; set; }
|
||||||
|
|
||||||
|
public Guid TrialFileTypeId { get; set; }
|
||||||
|
|
||||||
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
public string Version { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 定稿PDF
|
||||||
|
/// </summary>
|
||||||
|
public TrialFileDto? PDFFileRecord { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 定稿Word
|
||||||
|
/// </summary>
|
||||||
|
|
||||||
|
public TrialFileDto? WordFileRecord { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 签名页
|
||||||
|
/// </summary>
|
||||||
|
|
||||||
|
public TrialFileDto? SignFileRecord { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 历史记录
|
||||||
|
/// </summary>
|
||||||
|
|
||||||
|
public TrialFileDto? HistoryFileRecord { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class TrialFileDto
|
||||||
|
{
|
||||||
|
public Guid TrialFileTypeId { get; set; }
|
||||||
|
|
||||||
|
public string FileName { get; set; }
|
||||||
|
|
||||||
|
public string FilePath { get; set; }
|
||||||
|
|
||||||
|
public string FileSize { get; set; }
|
||||||
|
|
||||||
|
public string FileFormat { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TrialFinalRecordQuery : PageInput
|
||||||
|
{
|
||||||
|
public Guid? HistoryFileRecordId { get; set; }
|
||||||
|
|
||||||
|
public bool? IsAuthorizedView { get; set; }
|
||||||
|
|
||||||
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
[NotDefault]
|
||||||
|
public Guid TrialFileTypeId { get; set; }
|
||||||
|
|
||||||
|
public Guid? TrialId { get; set; }
|
||||||
|
|
||||||
|
public string? Version { get; set; }
|
||||||
|
|
||||||
|
public Guid? WordFileRecordId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
||||||
|
// 生成时间 2025-02-21 07:47:30Z
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
using System;
|
||||||
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
namespace IRaCIS.Core.Application.ViewModel;
|
||||||
|
|
||||||
|
public class TrialNormalRecordView : TrialNormalRecordAddOrEdit
|
||||||
|
{
|
||||||
|
|
||||||
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
|
public DateTime UpdateTime { get; set; }
|
||||||
|
|
||||||
|
public string FileName { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class BatchAddTrialNormalRecordInDto
|
||||||
|
{
|
||||||
|
public List<TrialNormalRecordAddOrEdit> TrialNormalRecordList { get; set; }
|
||||||
|
}
|
||||||
|
public class TrialNormalRecordAddOrEdit
|
||||||
|
{
|
||||||
|
public Guid? Id { get; set; }
|
||||||
|
|
||||||
|
public bool IsAuthorizedView { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public int State { get; set; }
|
||||||
|
|
||||||
|
public TrialFileDto? TrialFileRecord { get; set; }
|
||||||
|
|
||||||
|
public TrialFileDto? HistoryFileRecord { get; set; }
|
||||||
|
|
||||||
|
public Guid TrialFileTypeId { get; set; }
|
||||||
|
|
||||||
|
public Guid TrialId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TrialNormalRecordQuery : PageInput
|
||||||
|
{
|
||||||
|
public bool? IsAuthorizedView { get; set; }
|
||||||
|
|
||||||
|
public int? State { get; set; }
|
||||||
|
|
||||||
|
public string? FileName { get; set; }
|
||||||
|
|
||||||
|
public Guid? TrialFileTypeId { get; set; }
|
||||||
|
|
||||||
|
public Guid? TrialId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
||||||
|
// 生成时间 2025-02-21 07:47:30Z
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
using System;
|
||||||
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
namespace IRaCIS.Core.Application.ViewModel;
|
||||||
|
|
||||||
|
public class TrialTrianingRecordView : TrialTrianingRecordAddOrEdit
|
||||||
|
{
|
||||||
|
|
||||||
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
|
public DateTime UpdateTime { get; set; }
|
||||||
|
|
||||||
|
public string FileName { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class BatchAddTTrianingRecordInDto
|
||||||
|
{
|
||||||
|
public List<TrialTrianingRecordAddOrEdit> TrianingRecordList { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TrialTrianingRecordAddOrEdit
|
||||||
|
{
|
||||||
|
public Guid? Id { get; set; }
|
||||||
|
|
||||||
|
public bool IsAuthorizedView { get; set; }
|
||||||
|
|
||||||
|
public string Note { get; set; }=string.Empty;
|
||||||
|
|
||||||
|
public int? State { get; set; }
|
||||||
|
|
||||||
|
public TrialFileDto? TrialFileRecord { get; set; }
|
||||||
|
|
||||||
|
public TrialFileDto? HistoryFileRecord { get; set; }
|
||||||
|
|
||||||
|
public Guid TrialFileTypeId { get; set; }
|
||||||
|
|
||||||
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
public int? TrianingCount { get; set; }
|
||||||
|
|
||||||
|
public DateOnly? TrianingDate { get; set; }
|
||||||
|
|
||||||
|
public string? TrianingState { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TrialTrianingRecordQuery : PageInput
|
||||||
|
{
|
||||||
|
public bool? IsAuthorizedView { get; set; }
|
||||||
|
|
||||||
|
public string? FileName { get; set; }
|
||||||
|
|
||||||
|
public Guid? TrialFileTypeId { get; set; }
|
||||||
|
|
||||||
|
public Guid? TrialId { get; set; }
|
||||||
|
|
||||||
|
public int? TrianingCount { get; set; }
|
||||||
|
|
||||||
|
public DateOnly? TrianingDateStartTime { get; set; }
|
||||||
|
|
||||||
|
public DateOnly? TrianingDateEndTime { get; set; }
|
||||||
|
|
||||||
|
public DateTime? UpdateStartTime { get; set; }
|
||||||
|
|
||||||
|
public DateTime? UpdateEndTime { get; set; }
|
||||||
|
|
||||||
|
public string? TrianingState { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using IRaCIS.Core.Application.Helper;
|
using IRaCIS.Core.Application.Helper;
|
||||||
|
using IRaCIS.Core.Application.MassTransit.Consumer;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infrastructure;
|
using IRaCIS.Core.Infrastructure;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
@@ -9,18 +10,18 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
public interface IEmailSendService
|
public interface IEmailSendService
|
||||||
{
|
{
|
||||||
Task SendEnrollOrPdEmail(Guid visitTaskId, bool? isEnrollment, bool? isPDConfirm);
|
Task SendEnrollOrPdEmail(Guid visitTaskId, bool? isEnrollment, bool? isPDConfirm);
|
||||||
|
|
||||||
Task<(TrialEmailNoticeConfig?, SMTPEmailConfig?)> BuildEmailConfig(Guid trialId, EmailBusinessScenario businessScenario, Func<TrialEmailNoticeConfig, (string topicStr, string htmlBodyStr, bool isEn_us, Guid? onlyToUserId)> topicAndHtmlFunc, Guid? siteId = null, Guid? trialReadingCriterionId = null);
|
Task<(TrialEmailNoticeConfig?, SMTPEmailConfig?)> BuildEmailConfig(Guid trialId, EmailBusinessScenario businessScenario, Func<TrialEmailNoticeConfig, (string topicStr, string htmlBodyStr, bool isEn_us, Guid? onlyToUserId)> topicAndHtmlFunc, Guid? siteId = null, Guid? trialReadingCriterionId = null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class EmailSendService(IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository,
|
public class EmailSendService(IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository,
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
IRepository<TrialUser> _trialUserRepository,
|
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||||
IRepository<VisitTask> _visitTaskRepository,
|
IRepository<VisitTask> _visitTaskRepository,
|
||||||
IRepository<TrialSiteUser> _trialSiteUserRepository,
|
IRepository<TrialSiteUserRole> _trialSiteUserRoleRepository,
|
||||||
IOptionsMonitor<SystemEmailSendConfig> _SystemEmailSendConfig, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IEmailSendService
|
IOptionsMonitor<SystemEmailSendConfig> _SystemEmailSendConfig, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IEmailSendService
|
||||||
{
|
{
|
||||||
|
private readonly SystemEmailSendConfig _systemEmailConfig = _SystemEmailSendConfig.CurrentValue;
|
||||||
|
|
||||||
public static string EmailNamePlaceholder => StaticData.EmailSend.EmailNamePlaceholder;
|
public static string EmailNamePlaceholder => StaticData.EmailSend.EmailNamePlaceholder;
|
||||||
|
|
||||||
@@ -130,6 +131,9 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
var (topicStr, htmlBodyStr, isEn_us, onlyToUserId) = topicAndHtmlFunc(trialEmailConfig);
|
var (topicStr, htmlBodyStr, isEn_us, onlyToUserId) = topicAndHtmlFunc(trialEmailConfig);
|
||||||
|
|
||||||
|
//处理替换公司名
|
||||||
|
htmlBodyStr = CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, htmlBodyStr);
|
||||||
|
|
||||||
|
|
||||||
sendEmailConfig.TopicDescription = topicStr;
|
sendEmailConfig.TopicDescription = topicStr;
|
||||||
sendEmailConfig.HtmlBodyStr = htmlBodyStr;
|
sendEmailConfig.HtmlBodyStr = htmlBodyStr;
|
||||||
@@ -144,7 +148,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
var allUserTypeEnumList = toUserTypeEnumList.Union(copyUserTypeEnumList).Distinct().ToList();
|
var allUserTypeEnumList = toUserTypeEnumList.Union(copyUserTypeEnumList).Distinct().ToList();
|
||||||
|
|
||||||
var allUserList = await _trialUserRepository.Where(t => t.TrialId == trialId && allUserTypeEnumList.Contains(t.User.UserTypeEnum)).Select(t => new { t.UserId, t.User.EMail, t.User.FullName, t.User.UserTypeEnum }).ToListAsync();
|
var allUserList = await _trialUserRoleRepository.Where(t => t.TrialId == trialId && allUserTypeEnumList.Contains(t.UserRole.UserTypeEnum)).Select(t => new { t.UserId, t.UserRole.IdentityUser.EMail, t.UserRole.FullName, t.UserRole.UserTypeEnum }).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
var toUserList = allUserList.Where(t => toUserTypeEnumList.Contains(t.UserTypeEnum))
|
var toUserList = allUserList.Where(t => toUserTypeEnumList.Contains(t.UserTypeEnum))
|
||||||
@@ -157,7 +161,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
}
|
}
|
||||||
if (trialSiteId != null && toUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA))
|
if (trialSiteId != null && toUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA))
|
||||||
{
|
{
|
||||||
var curentSiteUserIdList = _trialSiteUserRepository.Where(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId).Select(t => t.UserId).ToList();
|
var curentSiteUserIdList = _trialSiteUserRoleRepository.Where(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId).Select(t => t.UserId).ToList();
|
||||||
|
|
||||||
toUserList = toUserList.Where(t => (t.UserTypeEnum != UserTypeEnum.CRA && t.UserTypeEnum != UserTypeEnum.ClinicalResearchCoordinator) || curentSiteUserIdList.Contains(t.UserId)).ToList();
|
toUserList = toUserList.Where(t => (t.UserTypeEnum != UserTypeEnum.CRA && t.UserTypeEnum != UserTypeEnum.ClinicalResearchCoordinator) || curentSiteUserIdList.Contains(t.UserId)).ToList();
|
||||||
}
|
}
|
||||||
@@ -171,7 +175,7 @@ namespace IRaCIS.Core.Application.Service
|
|||||||
|
|
||||||
if (trialSiteId != null && copyUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA))
|
if (trialSiteId != null && copyUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA))
|
||||||
{
|
{
|
||||||
var curentSiteUserIdList = _trialSiteUserRepository.Where(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId).Select(t => t.UserId).ToList();
|
var curentSiteUserIdList = _trialSiteUserRoleRepository.Where(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId).Select(t => t.UserId).ToList();
|
||||||
|
|
||||||
copyUserList = copyUserList.Where(t => (t.UserTypeEnum != UserTypeEnum.CRA && t.UserTypeEnum != UserTypeEnum.ClinicalResearchCoordinator) || curentSiteUserIdList.Contains(t.UserId)).ToList();
|
copyUserList = copyUserList.Where(t => (t.UserTypeEnum != UserTypeEnum.CRA && t.UserTypeEnum != UserTypeEnum.ClinicalResearchCoordinator) || curentSiteUserIdList.Contains(t.UserId)).ToList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
||||||
|
// 生成时间 2025-02-21 07:47:30Z
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
using System;
|
||||||
|
using IRaCIS.Core.Infrastructure.Extention;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
|
namespace IRaCIS.Core.Application.Interfaces;
|
||||||
|
|
||||||
|
public interface ISysFileTypeService
|
||||||
|
{
|
||||||
|
|
||||||
|
Task<PageOutput<SysFileTypeView>> GetSysFileTypeList(SysFileTypeQuery inQuery);
|
||||||
|
|
||||||
|
Task<IResponseOutput> AddOrUpdateSysFileType(SysFileTypeAddOrEdit addOrEditSysFileType);
|
||||||
|
|
||||||
|
Task<IResponseOutput> DeleteSysFileType(Guid sysFileTypeId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||||||
Task<List<TrialUserDto>> GetTrialUserSelect(Guid trialId);
|
Task<List<TrialUserDto>> GetTrialUserSelect(Guid trialId);
|
||||||
|
|
||||||
|
|
||||||
Task<PageOutput<DocumentUnionWithUserStatView>> GetTrialSystemDocumentList(DocumentTrialUnionQuery querySystemDocument);
|
//Task<PageOutput<DocumentUnionWithUserStatView>> GetTrialSystemDocumentList(DocumentTrialUnionQuery querySystemDocument);
|
||||||
List<TrialUserUnionDocumentView> GetTrialUserDocumentList(Guid trialId);
|
//List<TrialUserUnionDocumentView> GetTrialUserDocumentList(Guid trialId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -16,7 +16,7 @@ namespace IRaCIS.Core.Application.Interfaces
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
Task<List<TrialEmailNoticeConfigView>> GetTrialEmailNoticeConfigList(TrialEmailNoticeConfigQuery inQuery);
|
Task<IResponseOutput<List<TrialEmailNoticeConfigView>>> GetTrialEmailNoticeConfigList(TrialEmailNoticeConfigQuery inQuery);
|
||||||
|
|
||||||
Task<IResponseOutput> AddOrUpdateTrialEmailNoticeConfig(TrialEmailNoticeConfigAddOrEdit addOrEditTrialEmailNoticeConfig);
|
Task<IResponseOutput> AddOrUpdateTrialEmailNoticeConfig(TrialEmailNoticeConfigAddOrEdit addOrEditTrialEmailNoticeConfig);
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
||||||
|
// 生成时间 2025-02-21 07:47:30Z
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
using System;
|
||||||
|
using IRaCIS.Core.Infrastructure.Extention;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
|
namespace IRaCIS.Core.Application.Interfaces;
|
||||||
|
|
||||||
|
public interface ITrialFileTypeService
|
||||||
|
{
|
||||||
|
|
||||||
|
Task<PageOutput<TrialFileTypeView>> GetTrialFileTypeList(TrialFileTypeQuery inQuery);
|
||||||
|
|
||||||
|
Task<IResponseOutput> AddOrUpdateTrialFileType(TrialFileTypeAddOrEdit addOrEditTrialFileType);
|
||||||
|
|
||||||
|
Task<IResponseOutput> DeleteTrialFileType(Guid trialFileTypeId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
||||||
|
// 生成时间 2025-02-21 07:47:30Z
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
using System;
|
||||||
|
using IRaCIS.Core.Infrastructure.Extention;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
|
namespace IRaCIS.Core.Application.Interfaces;
|
||||||
|
|
||||||
|
public interface ITrialFinalRecordService
|
||||||
|
{
|
||||||
|
|
||||||
|
Task<PageOutput<TrialFinalRecordView>> GetTrialFinalRecordList(TrialFinalRecordQuery inQuery);
|
||||||
|
|
||||||
|
Task<IResponseOutput> AddOrUpdateTrialFinalRecord(TrialFinalRecordAddOrEdit addOrEditTrialFinalRecord);
|
||||||
|
|
||||||
|
Task<IResponseOutput> DeleteTrialFinalRecord(Guid trialFinalRecordId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
||||||
|
// 生成时间 2025-02-21 07:47:30Z
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
using System;
|
||||||
|
using IRaCIS.Core.Infrastructure.Extention;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
|
namespace IRaCIS.Core.Application.Interfaces;
|
||||||
|
|
||||||
|
public interface ITrialNormalRecordService
|
||||||
|
{
|
||||||
|
|
||||||
|
Task<PageOutput<TrialNormalRecordView>> GetTrialNormalRecordList(TrialNormalRecordQuery inQuery);
|
||||||
|
|
||||||
|
Task<IResponseOutput> AddOrUpdateTrialNormalRecord(TrialNormalRecordAddOrEdit addOrEditTrialNormalRecord);
|
||||||
|
|
||||||
|
Task<IResponseOutput> DeleteTrialNormalRecord(Guid trialNormalRecordId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
||||||
|
// 生成时间 2025-02-21 07:47:30Z
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
using System;
|
||||||
|
using IRaCIS.Core.Infrastructure.Extention;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
|
namespace IRaCIS.Core.Application.Interfaces;
|
||||||
|
|
||||||
|
public interface ITrialTrianingRecordService
|
||||||
|
{
|
||||||
|
|
||||||
|
Task<PageOutput<TrialTrianingRecordView>> GetTrialTrianingRecordList(TrialTrianingRecordQuery inQuery);
|
||||||
|
|
||||||
|
Task<IResponseOutput> AddOrUpdateTrialTrianingRecord(TrialTrianingRecordAddOrEdit addOrEditTrialTrianingRecord);
|
||||||
|
|
||||||
|
Task<IResponseOutput> DeleteTrialTrianingRecord(Guid trialTrianingRecordId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
// 此代码由liquid模板自动生成 byzhouhang 20240909
|
||||||
|
// 生成时间 2025-02-21 07:47:24Z
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
using IRaCIS.Core.Domain.Models;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using IRaCIS.Core.Application.Interfaces;
|
||||||
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
|
using IRaCIS.Core.Infrastructure.Extention;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using IRaCIS.Core.Infra.EFCore;
|
||||||
|
namespace IRaCIS.Core.Application.Service;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 系统文件类型
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="_sysFileTypeRepository"></param>
|
||||||
|
/// <param name="_mapper"></param>
|
||||||
|
/// <param name="_userInfo"></param>
|
||||||
|
/// <param name="_localizer"></param>
|
||||||
|
[ApiExplorerSettings(GroupName = "FileRecord")]
|
||||||
|
|
||||||
|
public class SysFileTypeService(IRepository<SysFileType> _sysFileTypeRepository, IRepository<TrialFileType> _trialFileTypeRepository,
|
||||||
|
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ISysFileTypeService
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<PageOutput<SysFileTypeView>> GetSysFileTypeList(SysFileTypeQuery inQuery)
|
||||||
|
{
|
||||||
|
|
||||||
|
var sysFileTypeQueryable = _sysFileTypeRepository
|
||||||
|
.WhereIf(inQuery.ArchiveTypeEnum != null, t => t.ArchiveTypeEnum == inQuery.ArchiveTypeEnum)
|
||||||
|
.WhereIf(inQuery.IsConfirmRecord != null, t => t.IsConfirmRecord == inQuery.IsConfirmRecord)
|
||||||
|
.WhereIf(inQuery.SubIdentificationEnum != null, t => t.SubIdentificationEnum == inQuery.SubIdentificationEnum)
|
||||||
|
.WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable)
|
||||||
|
.WhereIf(inQuery.Name.IsNotNullOrEmpty(), t => t.Name.Contains(inQuery.Name))
|
||||||
|
.WhereIf(inQuery.NameCN.IsNotNullOrEmpty(), t => t.NameCN.Contains(inQuery.NameCN))
|
||||||
|
.ProjectTo<SysFileTypeView>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
|
var defalutSortArray = new string[] { nameof(SysFileTypeView.ArchiveTypeEnum), nameof(SysFileTypeView.ShowOrder)};
|
||||||
|
|
||||||
|
var pageList = await sysFileTypeQueryable.ToPagedListAsync(inQuery, defalutSortArray);
|
||||||
|
|
||||||
|
return pageList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<IResponseOutput> AddOrUpdateSysFileType(SysFileTypeAddOrEdit addOrEditSysFileType)
|
||||||
|
{
|
||||||
|
var verifyExp = new EntityVerifyExp<SysFileType>()
|
||||||
|
{
|
||||||
|
VerifyExp = u => u.IsEnable == addOrEditSysFileType.IsEnable && (u.Name == addOrEditSysFileType.Name || u.NameCN == addOrEditSysFileType.NameCN),
|
||||||
|
|
||||||
|
// "当前类型启用的文件类型名称重复"
|
||||||
|
VerifyMsg = _localizer["SysFileType_NameRepeat"],
|
||||||
|
|
||||||
|
IsVerify = addOrEditSysFileType.IsEnable == false
|
||||||
|
};
|
||||||
|
|
||||||
|
var entity = await _sysFileTypeRepository.InsertOrUpdateAsync(addOrEditSysFileType, true, verifyExp);
|
||||||
|
|
||||||
|
//启用的才进行更新
|
||||||
|
if (addOrEditSysFileType.Id != null && addOrEditSysFileType.IsEnable)
|
||||||
|
{
|
||||||
|
await _trialFileTypeRepository.BatchUpdateNoTrackingAsync(t => t.SysFileTypeId == addOrEditSysFileType.Id, u => new TrialFileType() { Name = addOrEditSysFileType.Name, NameCN = addOrEditSysFileType.NameCN,ShowOrder=addOrEditSysFileType.ShowOrder });
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseOutput.Ok(entity.Id.ToString());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[HttpDelete("{sysFileTypeId:guid}")]
|
||||||
|
public async Task<IResponseOutput> DeleteSysFileType(Guid sysFileTypeId)
|
||||||
|
{
|
||||||
|
var success = await _sysFileTypeRepository.DeleteFromQueryAsync(t => t.Id == sysFileTypeId, true);
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
using IRaCIS.Core.Application.Contracts;
|
using IRaCIS.Core.Application.Contracts;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using User = IRaCIS.Core.Domain.Models.User;
|
using UserRole = IRaCIS.Core.Domain.Models.UserRole;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Services
|
namespace IRaCIS.Core.Application.Services
|
||||||
{
|
{
|
||||||
@@ -15,8 +15,9 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(GroupName = "Trial")]
|
[ApiExplorerSettings(GroupName = "Trial")]
|
||||||
public class SystemDocumentService(IRepository<SystemDocument> _systemDocumentRepository,
|
public class SystemDocumentService(IRepository<SystemDocument> _systemDocumentRepository,
|
||||||
IRepository<User> _userRepository,
|
IRepository<UserRole> _userRoleRepository,
|
||||||
IRepository<SystemDocConfirmedUser> _systemDocConfirmedUserRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ISystemDocumentService
|
IRepository<IdentityUser> _identityUserRepository,
|
||||||
|
IRepository<SystemDocConfirmedIdentityUser> _systemDocConfirmedUserRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ISystemDocumentService
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@@ -35,7 +36,7 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||||
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
||||||
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
|
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
|
||||||
.ProjectTo<SystemDocumentView>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us, userId = _userInfo.Id });
|
.ProjectTo<SystemDocumentView>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us, userId = _userInfo.UserRoleId });
|
||||||
|
|
||||||
return await systemDocumentQueryable.ToPagedListAsync(inQuery);
|
return await systemDocumentQueryable.ToPagedListAsync(inQuery);
|
||||||
}
|
}
|
||||||
@@ -109,7 +110,7 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
|
|
||||||
await _systemDocumentRepository.UpdatePartialFromQueryAsync(systemDocumentId, u => new SystemDocument() { IsDeleted = true });
|
await _systemDocumentRepository.UpdatePartialFromQueryAsync(systemDocumentId, u => new SystemDocument() { IsDeleted = true });
|
||||||
|
|
||||||
await _systemDocConfirmedUserRepository.UpdatePartialFromQueryAsync(x => x.SystemDocumentId == systemDocumentId, x => new SystemDocConfirmedUser()
|
await _systemDocConfirmedUserRepository.UpdatePartialFromQueryAsync(x => x.SystemDocumentId == systemDocumentId, x => new SystemDocConfirmedIdentityUser()
|
||||||
{
|
{
|
||||||
IsDeleted = true
|
IsDeleted = true
|
||||||
});
|
});
|
||||||
@@ -146,15 +147,16 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
|
|
||||||
var isInternal = _userInfo.IsZhiZhun;
|
var isInternal = _userInfo.IsZhiZhun;
|
||||||
|
|
||||||
var query = from sysDoc in _systemDocumentRepository.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
var query = from sysDoc in _systemDocumentRepository.AsQueryable(true)
|
||||||
|
.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||||
//外部人员 只签署 文档类型枚举值有值的
|
//外部人员 只签署 外部需要签署的
|
||||||
.WhereIf(isInternal == false, t => t.DocUserSignType == DocUserSignType.InnerAndOuter)
|
.WhereIf(isInternal == false, t => t.DocUserSignType == DocUserSignType.InnerAndOuter)
|
||||||
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
||||||
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = _userInfo.Id, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = _userInfo.IdentityUserId, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||||
from confirm in cc.DefaultIfEmpty()
|
from confirm in cc.DefaultIfEmpty()
|
||||||
|
|
||||||
join user in _userRepository.Where() on _userInfo.Id equals user.Id
|
join user in _identityUserRepository.Where() on _userInfo.IdentityUserId equals user.Id
|
||||||
|
|
||||||
select new UnionDocumentWithConfirmInfoView()
|
select new UnionDocumentWithConfirmInfoView()
|
||||||
{
|
{
|
||||||
@@ -173,15 +175,24 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
|
|
||||||
ConfirmUserId = confirm.ConfirmUserId,
|
ConfirmUserId = confirm.ConfirmUserId,
|
||||||
ConfirmTime = confirm.ConfirmTime,
|
ConfirmTime = confirm.ConfirmTime,
|
||||||
RealName = user.LastName + " / " + user.FirstName,
|
RealName = user.FullName,
|
||||||
UserName = user.UserName,
|
UserName = user.UserName,
|
||||||
UserTypeId = user.UserTypeId,
|
|
||||||
UserTypeShortName = user.UserTypeRole.UserTypeShortName
|
DocTypeCode=sysDoc.FileType.Code
|
||||||
|
|
||||||
|
//UserTypeId = user.UserTypeId,
|
||||||
|
//UserTypeShortName = user.UserTypeRole.UserTypeShortName
|
||||||
};
|
};
|
||||||
|
|
||||||
return await query.WhereIf(inQuery.IsSigned == true, t => t.ConfirmTime != null)
|
var list = await query
|
||||||
|
//过滤掉删除的,并且没有签名的
|
||||||
|
.Where(t => !(t.IsDeleted == true && t.ConfirmTime == null))
|
||||||
|
.WhereIf(inQuery.IsSigned == true, t => t.ConfirmTime != null)
|
||||||
.WhereIf(inQuery.IsSigned == false, t => t.ConfirmTime == null)
|
.WhereIf(inQuery.IsSigned == false, t => t.ConfirmTime == null)
|
||||||
.ToPagedListAsync(inQuery);
|
.ToPagedListAsync(inQuery,nameof(UnionDocumentWithConfirmInfoView.DocTypeCode));
|
||||||
|
|
||||||
|
|
||||||
|
return list;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,13 @@
|
|||||||
|
|
||||||
using IRaCIS.Core.Application.Contracts;
|
using IRaCIS.Core.Application.Contracts;
|
||||||
using IRaCIS.Core.Application.Filter;
|
using IRaCIS.Core.Application.Filter;
|
||||||
|
using IRaCIS.Core.Domain.Models;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using NPOI.SS.Formula.Functions;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Linq.Dynamic.Core;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Services
|
namespace IRaCIS.Core.Application.Services
|
||||||
{
|
{
|
||||||
@@ -16,15 +21,15 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(GroupName = "Trial")]
|
[ApiExplorerSettings(GroupName = "Trial")]
|
||||||
public class TrialDocumentService(IRepository<TrialDocument> _trialDocumentRepository,
|
public class TrialDocumentService(IRepository<TrialDocument> _trialDocumentRepository,
|
||||||
IRepository<TrialDocConfirmedUser> _trialDocUserTypeConfirmedUserRepository,
|
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
ISystemDocumentService _systemDocumentService,
|
ISystemDocumentService _systemDocumentService,
|
||||||
IRepository<SystemDocConfirmedUser> _systemDocConfirmedUserRepository,
|
IRepository<SystemDocConfirmedIdentityUser> _systemDocConfirmedUserRepository,
|
||||||
IRepository<SystemDocNeedConfirmedUserType> _systemDocNeedConfirmedUserTypeRepository,
|
IRepository<SystemDocNeedConfirmedUserType> _systemDocNeedConfirmedUserTypeRepository,
|
||||||
IRepository<TrialDocNeedConfirmedUserType> _trialDocNeedConfirmedUserTypeRepository,
|
IRepository<TrialDocNeedConfirmedUserType> _trialDocNeedConfirmedUserTypeRepository,
|
||||||
IRepository<SystemDocument> _systemDocumentRepository,
|
IRepository<SystemDocument> _systemDocumentRepository,
|
||||||
IRepository<TrialUser> _trialUserRepository,
|
IRepository<TrialIdentityUser> _trialIdentityUserRepository,
|
||||||
IRepository<TrialDocConfirmedUser> _trialDocConfirmedUserRepository,
|
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||||
|
IRepository<TrialDocConfirmedIdentityUser> _trialDocConfirmedUserRepository,
|
||||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITrialDocumentService
|
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITrialDocumentService
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -57,9 +62,9 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
.WhereIf(inQuery.TrialId != null, t => t.TrialId == inQuery.TrialId)
|
.WhereIf(inQuery.TrialId != null, t => t.TrialId == inQuery.TrialId)
|
||||||
.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||||
|
|
||||||
join trialUser in _trialUserRepository.Where(t => t.UserId == _userInfo.Id) on trialDoc.TrialId equals trialUser.TrialId
|
join trialUser in _trialIdentityUserRepository.Where(t => t.IdentityUserId == _userInfo.IdentityUserId) on trialDoc.TrialId equals trialUser.TrialId
|
||||||
join confirm in _trialDocConfirmedUserRepository.Where() on
|
join confirm in _trialDocConfirmedUserRepository.Where() on
|
||||||
new { trialUser.UserId, TrialDocumentId = trialDoc.Id } equals new { UserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
new { trialUser.IdentityUserId, TrialDocumentId = trialDoc.Id } equals new { IdentityUserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
||||||
|
|
||||||
from confirm in cc.DefaultIfEmpty()
|
from confirm in cc.DefaultIfEmpty()
|
||||||
select new TrialSignDocView()
|
select new TrialSignDocView()
|
||||||
@@ -82,11 +87,12 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
//IsConfirmed = confirm.ConfirmTime != null,
|
//IsConfirmed = confirm.ConfirmTime != null,
|
||||||
ConfirmUserId = confirm.ConfirmUserId,
|
ConfirmUserId = confirm.ConfirmUserId,
|
||||||
ConfirmTime = confirm.ConfirmTime,
|
ConfirmTime = confirm.ConfirmTime,
|
||||||
RealName = trialUser.User.FullName,
|
RealName = trialUser.IdentityUser.FullName,
|
||||||
UserName = trialUser.User.UserName,
|
UserName = trialUser.IdentityUser.UserName,
|
||||||
UserTypeId = trialUser.User.UserTypeId,
|
|
||||||
UserTypeShortName = trialUser.User.UserTypeRole.UserTypeShortName
|
|
||||||
|
|
||||||
|
IdentityUserTypeList = trialUser.TrialUserRoleList.Select(t => t.UserRole.UserTypeRole.UserTypeShortName).ToList(),
|
||||||
|
|
||||||
|
DocNeedSignUserTypeList = trialDoc.NeedConfirmedUserTypeList.Select(t => t.UserTypeRole.UserTypeShortName).ToList(),
|
||||||
};
|
};
|
||||||
|
|
||||||
trialDocQueryable = trialDocQueryable.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
trialDocQueryable = trialDocQueryable.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||||
@@ -218,75 +224,183 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
|
|
||||||
var trialInfo = await (_trialRepository.Where(t => t.Id == inQuery.TrialId, ignoreQueryFilters: true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
|
var trialInfo = await (_trialRepository.Where(t => t.Id == inQuery.TrialId, ignoreQueryFilters: true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
|
||||||
|
|
||||||
//系统文档查询
|
var isInternal = _userInfo.IsZhiZhun;
|
||||||
var systemDocumentQueryable = from needConfirmedUserType in _systemDocNeedConfirmedUserTypeRepository.Where(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId, ignoreQueryFilters: true)
|
|
||||||
.WhereIf(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime)
|
|
||||||
.WhereIf(!_userInfo.IsAdmin, t => t.SystemDocument.IsDeleted == false || (t.SystemDocument.IsDeleted == true && t.SystemDocument.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
|
|
||||||
|
|
||||||
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId && t.UserId == _userInfo.Id)
|
#region 统一用户修改
|
||||||
on needConfirmedUserType.NeedConfirmUserTypeId equals trialUser.User.UserTypeId
|
|
||||||
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = trialUser.UserId, SystemDocumentId = needConfirmedUserType.SystemDocumentId } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
|
||||||
from confirm in cc.DefaultIfEmpty()
|
|
||||||
select new UnionDocumentWithConfirmInfoView()
|
|
||||||
{
|
|
||||||
IsSystemDoc = true,
|
|
||||||
|
|
||||||
Id = needConfirmedUserType.SystemDocument.Id,
|
var systemDocQuery =
|
||||||
CreateTime = needConfirmedUserType.SystemDocument.CreateTime,
|
from sysDoc in _systemDocumentRepository.AsQueryable(true).Where(t => t.NeedConfirmedUserTypeList.Any(c => c.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||||
IsDeleted = needConfirmedUserType.SystemDocument.IsDeleted,
|
//外部人员 只签署 外部需要签署的
|
||||||
SignViewMinimumMinutes = needConfirmedUserType.SystemDocument.SignViewMinimumMinutes,
|
.WhereIf(isInternal == false, t => t.DocUserSignType == DocUserSignType.InnerAndOuter)
|
||||||
Name = needConfirmedUserType.SystemDocument.Name,
|
from trialUser in _trialIdentityUserRepository.AsQueryable(false)
|
||||||
Path = needConfirmedUserType.SystemDocument.Path,
|
.Where(t => t.TrialId == inQuery.TrialId && t.IdentityUserId == _userInfo.IdentityUserId
|
||||||
FileTypeId = needConfirmedUserType.SystemDocument.FileTypeId,
|
&& t.TrialUserRoleList.Any(t => sysDoc.NeedConfirmedUserTypeList.Any(c => c.NeedConfirmUserTypeId == t.UserRole.UserTypeId)))
|
||||||
FileType = _userInfo.IsEn_Us ? needConfirmedUserType.SystemDocument.FileType.Value : needConfirmedUserType.SystemDocument.FileType.ValueCN,
|
|
||||||
UpdateTime = needConfirmedUserType.SystemDocument.UpdateTime,
|
|
||||||
|
|
||||||
FullFilePath = needConfirmedUserType.SystemDocument.Path,
|
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = trialUser.IdentityUserId, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||||
|
from confirm in cc.DefaultIfEmpty()
|
||||||
|
select new UnionDocumentWithConfirmInfoView()
|
||||||
|
{
|
||||||
|
IsSystemDoc = true,
|
||||||
|
|
||||||
|
Id = sysDoc.Id,
|
||||||
|
CreateTime = sysDoc.CreateTime,
|
||||||
|
IsDeleted = sysDoc.IsDeleted,
|
||||||
|
SignViewMinimumMinutes = sysDoc.SignViewMinimumMinutes,
|
||||||
|
Name = sysDoc.Name,
|
||||||
|
Path = sysDoc.Path,
|
||||||
|
FileType = _userInfo.IsEn_Us ? sysDoc.FileType.Value : sysDoc.FileType.ValueCN,
|
||||||
|
FileTypeId = sysDoc.FileTypeId,
|
||||||
|
UpdateTime = sysDoc.UpdateTime,
|
||||||
|
//IsConfirmed = confirm.ConfirmTime != null,
|
||||||
|
|
||||||
|
ConfirmUserId = confirm.ConfirmUserId,
|
||||||
|
ConfirmTime = confirm.ConfirmTime,
|
||||||
|
|
||||||
|
RealName = trialUser.IdentityUser.FullName,
|
||||||
|
UserName = trialUser.IdentityUser.UserName,
|
||||||
|
|
||||||
|
//UserTypeId = trialUser.UserRole.UserTypeId,
|
||||||
|
//UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
||||||
|
//DocNeedSignUserTypeList = sysDoc.NeedConfirmedUserTypeList.Select(t => t.UserTypeRole.UserTypeName),
|
||||||
|
|
||||||
|
FullFilePath = sysDoc.Path
|
||||||
|
};
|
||||||
|
|
||||||
//IsConfirmed = confirm.ConfirmTime != null,
|
|
||||||
ConfirmUserId = confirm.ConfirmUserId,
|
|
||||||
ConfirmTime = confirm.ConfirmTime,
|
|
||||||
RealName = trialUser.User.FullName,
|
|
||||||
UserName = trialUser.User.UserName,
|
|
||||||
UserTypeId = trialUser.User.UserTypeId,
|
|
||||||
UserTypeShortName = trialUser.User.UserTypeRole.UserTypeShortName
|
|
||||||
};
|
|
||||||
|
|
||||||
//项目文档查询
|
//项目文档查询
|
||||||
var trialDocQueryable = from trialDoc in _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == inQuery.TrialId)
|
var trialDocQuery =
|
||||||
.WhereIf(!_userInfo.IsAdmin, t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
from trialDoc in _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == inQuery.TrialId).Where(t => t.NeedConfirmedUserTypeList.Any(c => c.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||||
.WhereIf(!_userInfo.IsAdmin, t => t.IsDeleted == false || (t.IsDeleted == true && t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
|
from trialUser in _trialIdentityUserRepository.AsQueryable(false).Where(t => t.TrialId == inQuery.TrialId && t.IdentityUserId == _userInfo.IdentityUserId
|
||||||
|
&& t.TrialUserRoleList.Any(t => trialDoc.NeedConfirmedUserTypeList.Any(c => c.NeedConfirmUserTypeId == t.UserRole.UserTypeId)))
|
||||||
|
|
||||||
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId && t.UserId == _userInfo.Id) on trialDoc.TrialId equals trialUser.TrialId
|
join confirm in _trialDocConfirmedUserRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId) on
|
||||||
join confirm in _trialDocConfirmedUserRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId) on
|
new { trialUser.IdentityUserId, TrialDocumentId = trialDoc.Id } equals new { IdentityUserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
||||||
new { trialUser.UserId, TrialDocumentId = trialDoc.Id } equals new { UserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
from confirm in cc.DefaultIfEmpty()
|
||||||
from confirm in cc.DefaultIfEmpty()
|
select new UnionDocumentWithConfirmInfoView()
|
||||||
select new UnionDocumentWithConfirmInfoView()
|
{
|
||||||
{
|
IsSystemDoc = false,
|
||||||
Id = trialDoc.Id,
|
|
||||||
IsSystemDoc = false,
|
|
||||||
CreateTime = trialDoc.CreateTime,
|
|
||||||
FullFilePath = trialDoc.Path,
|
|
||||||
IsDeleted = trialDoc.IsDeleted,
|
|
||||||
Name = trialDoc.Name,
|
|
||||||
Path = trialDoc.Path,
|
|
||||||
FileTypeId = trialDoc.FileTypeId,
|
|
||||||
FileType = _userInfo.IsEn_Us ? trialDoc.FileType.Value : trialDoc.FileType.ValueCN,
|
|
||||||
UpdateTime = trialDoc.UpdateTime,
|
|
||||||
SignViewMinimumMinutes = trialDoc.SignViewMinimumMinutes,
|
|
||||||
|
|
||||||
//IsConfirmed = confirm.ConfirmTime != null,
|
Id = trialDoc.Id,
|
||||||
ConfirmUserId = confirm.ConfirmUserId,
|
CreateTime = trialDoc.CreateTime,
|
||||||
ConfirmTime = confirm.ConfirmTime,
|
IsDeleted = trialDoc.IsDeleted,
|
||||||
RealName = trialUser.User.FullName,
|
SignViewMinimumMinutes = trialDoc.SignViewMinimumMinutes,
|
||||||
UserName = trialUser.User.UserName,
|
Name = trialDoc.Name,
|
||||||
UserTypeId = trialUser.User.UserTypeId,
|
Path = trialDoc.Path,
|
||||||
UserTypeShortName = trialUser.User.UserTypeRole.UserTypeShortName
|
FileTypeId = trialDoc.FileTypeId,
|
||||||
|
FileType = _userInfo.IsEn_Us ? trialDoc.FileType.Value : trialDoc.FileType.ValueCN,
|
||||||
|
UpdateTime = trialDoc.UpdateTime,
|
||||||
|
//IsConfirmed= confirm.ConfirmTime!=null,
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
ConfirmUserId = confirm.ConfirmUserId,
|
||||||
|
ConfirmTime = confirm.ConfirmTime,
|
||||||
|
RealName = trialUser.IdentityUser.FullName,
|
||||||
|
UserName = trialUser.IdentityUser.UserName,
|
||||||
|
|
||||||
|
//DocNeedSignUserTypeList = trialDoc.NeedConfirmedUserTypeList.Select(t => t.UserTypeRole.UserTypeName),
|
||||||
|
|
||||||
|
//UserTypeId = trialUser.UserRole.UserTypeId,
|
||||||
|
//UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
||||||
|
|
||||||
|
FullFilePath = trialDoc.Path
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region 废弃
|
||||||
|
|
||||||
|
////系统文档查询
|
||||||
|
//var systemDocQuery = from needConfirmedUserType in _systemDocNeedConfirmedUserTypeRepository.Where(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId, ignoreQueryFilters: true)
|
||||||
|
// .WhereIf(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime)
|
||||||
|
// .WhereIf(!_userInfo.IsAdmin, t => t.SystemDocument.IsDeleted == false || (t.SystemDocument.IsDeleted == true && t.SystemDocument.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId)))
|
||||||
|
|
||||||
|
// join trialUser in _trialUserRoleRepository.Where(t => t.TrialId == inQuery.TrialId && t.UserRole.IdentityUserId == _userInfo.IdentityUserId)
|
||||||
|
// on needConfirmedUserType.NeedConfirmUserTypeId equals trialUser.UserRole.UserTypeId
|
||||||
|
// join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = trialUser.UserId, SystemDocumentId = needConfirmedUserType.SystemDocumentId } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||||
|
// from confirm in cc.DefaultIfEmpty()
|
||||||
|
// select new UnionDocumentWithConfirmInfoView()
|
||||||
|
// {
|
||||||
|
// IsSystemDoc = true,
|
||||||
|
|
||||||
|
// Id = needConfirmedUserType.SystemDocument.Id,
|
||||||
|
// CreateTime = needConfirmedUserType.SystemDocument.CreateTime,
|
||||||
|
// IsDeleted = needConfirmedUserType.SystemDocument.IsDeleted,
|
||||||
|
// SignViewMinimumMinutes = needConfirmedUserType.SystemDocument.SignViewMinimumMinutes,
|
||||||
|
// Name = needConfirmedUserType.SystemDocument.Name,
|
||||||
|
// Path = needConfirmedUserType.SystemDocument.Path,
|
||||||
|
// FileTypeId = needConfirmedUserType.SystemDocument.FileTypeId,
|
||||||
|
// FileType = _userInfo.IsEn_Us ? needConfirmedUserType.SystemDocument.FileType.Value : needConfirmedUserType.SystemDocument.FileType.ValueCN,
|
||||||
|
// UpdateTime = needConfirmedUserType.SystemDocument.UpdateTime,
|
||||||
|
|
||||||
|
// FullFilePath = needConfirmedUserType.SystemDocument.Path,
|
||||||
|
|
||||||
|
// //IsConfirmed = confirm.ConfirmTime != null,
|
||||||
|
// ConfirmUserId = confirm.ConfirmUserId,
|
||||||
|
// ConfirmTime = confirm.ConfirmTime,
|
||||||
|
// RealName = trialUser.UserRole.FullName,
|
||||||
|
// UserName = trialUser.UserRole.IdentityUser.UserName,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// //IdentityUserTypeList = trialUser.TrialUser.TrialUserRoleList.Select(t => t.UserRole.UserTypeRole.UserTypeShortName),
|
||||||
|
|
||||||
|
// //DocNeedSignUserTypeList = needConfirmedUserType.SystemDocument.NeedConfirmedUserTypeList.Select(t => t.UserTypeRole.UserTypeShortName).ToList(),
|
||||||
|
|
||||||
|
// //UserTypeId = trialUser.UserRole.UserTypeId,
|
||||||
|
// //UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName
|
||||||
|
// };
|
||||||
|
|
||||||
|
////项目文档查询
|
||||||
|
//var trialDocQuery = from trialDoc in _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == inQuery.TrialId)
|
||||||
|
// .WhereIf(!_userInfo.IsAdmin, t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||||
|
// .WhereIf(!_userInfo.IsAdmin, t => t.IsDeleted == false || (t.IsDeleted == true && t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId)))
|
||||||
|
|
||||||
|
// join trialUser in _trialUserRoleRepository.Where(t => t.TrialId == inQuery.TrialId && t.UserRole.IdentityUserId == _userInfo.IdentityUserId) on trialDoc.TrialId equals trialUser.TrialId
|
||||||
|
// join confirm in _trialDocConfirmedUserRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId) on
|
||||||
|
// new { trialUser.UserId, TrialDocumentId = trialDoc.Id } equals new { UserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
||||||
|
// from confirm in cc.DefaultIfEmpty()
|
||||||
|
// select new UnionDocumentWithConfirmInfoView()
|
||||||
|
// {
|
||||||
|
// Id = trialDoc.Id,
|
||||||
|
// IsSystemDoc = false,
|
||||||
|
// CreateTime = trialDoc.CreateTime,
|
||||||
|
// FullFilePath = trialDoc.Path,
|
||||||
|
// IsDeleted = trialDoc.IsDeleted,
|
||||||
|
// Name = trialDoc.Name,
|
||||||
|
// Path = trialDoc.Path,
|
||||||
|
// FileTypeId = trialDoc.FileTypeId,
|
||||||
|
// FileType = _userInfo.IsEn_Us ? trialDoc.FileType.Value : trialDoc.FileType.ValueCN,
|
||||||
|
// UpdateTime = trialDoc.UpdateTime,
|
||||||
|
// SignViewMinimumMinutes = trialDoc.SignViewMinimumMinutes,
|
||||||
|
|
||||||
|
// //IsConfirmed = confirm.ConfirmTime != null,
|
||||||
|
// ConfirmUserId = confirm.ConfirmUserId,
|
||||||
|
// ConfirmTime = confirm.ConfirmTime,
|
||||||
|
// RealName = trialUser.UserRole.FullName,
|
||||||
|
// UserName = trialUser.UserRole.IdentityUser.UserName,
|
||||||
|
|
||||||
|
// //UserTypeId = trialUser.UserRole.UserTypeId,
|
||||||
|
// //UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName
|
||||||
|
|
||||||
|
|
||||||
|
// //IdentityUserTypeList = trialUser.TrialUser.TrialUserRoleList.Select(t => t.UserRole.UserTypeRole.UserTypeShortName).ToList(),
|
||||||
|
|
||||||
|
// //DocNeedSignUserTypeList = trialDoc.NeedConfirmedUserTypeList.Select(t => t.UserTypeRole.UserTypeShortName).ToList(),
|
||||||
|
// };
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region 报错 奇怪的bug
|
#region 报错 奇怪的bug
|
||||||
var unionQuery = systemDocumentQueryable.Union(trialDocQueryable)
|
|
||||||
|
|
||||||
|
var unionQuery = systemDocQuery.Concat(trialDocQuery)
|
||||||
|
//过滤掉删除的,并且没有签名的
|
||||||
|
.Where(t => !(t.IsDeleted == true && t.ConfirmTime == null))
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||||
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
||||||
.WhereIf(inQuery.IsSign == true, t => t.ConfirmTime != null)
|
.WhereIf(inQuery.IsSign == true, t => t.ConfirmTime != null)
|
||||||
@@ -318,16 +432,15 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == inQuery.TrialId && t.Trial.TrialStatusStr != StaticData.TrialState.TrialStopped)
|
var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == inQuery.TrialId && t.Trial.TrialStatusStr != StaticData.TrialState.TrialStopped)
|
||||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||||
.Where(t => t.IsDeleted == false && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
.Where(t => t.IsDeleted == false && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId && t.ConfirmTime != null) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||||
.CountAsync();
|
.CountAsync();
|
||||||
|
|
||||||
|
|
||||||
var needSignSystemDocCount = await _systemDocumentRepository
|
var needSignSystemDocCount = await _systemDocumentRepository.AsQueryable(true)
|
||||||
.Where(t => t.IsDeleted == false && !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
.WhereIf(isInternal == false, t => t.DocUserSignType == DocUserSignType.InnerAndOuter)
|
||||||
|
.Where(t => t.IsDeleted == false && !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId && t.ConfirmTime != null) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||||
.CountAsync();
|
.CountAsync();
|
||||||
|
|
||||||
var trialTaskConfig = _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialProcessConfigDTO>(_mapper.ConfigurationProvider).FirstOrDefault();
|
var trialTaskConfig = _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialProcessConfigDTO>(_mapper.ConfigurationProvider).FirstOrDefault();
|
||||||
@@ -338,7 +451,7 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
var isAdditionalAssessment = _readingQuestionCriterionTrialRepository.Where(t => t.TrialId == trialId && t.IsSigned && t.IsAdditionalAssessment == true
|
var isAdditionalAssessment = _readingQuestionCriterionTrialRepository.Where(t => t.TrialId == trialId && t.IsSigned && t.IsAdditionalAssessment == true
|
||||||
&& t.TrialCriterionAdditionalAssessmentTypeList.Any(c =>/*c.AdditionalAssessmentType==Domain.Share.Reading.AdditionalAssessmentType.BrainMetastasis &&*/ c.IsSelected == true)).Any();
|
&& t.TrialCriterionAdditionalAssessmentTypeList.Any(c =>/*c.AdditionalAssessmentType==Domain.Share.Reading.AdditionalAssessmentType.BrainMetastasis &&*/ c.IsSelected == true)).Any();
|
||||||
|
|
||||||
return ResponseOutput.Ok<PageOutput<UnionDocumentWithConfirmInfoView>>(result, new { NeedSignCount = needSignTrialDocCount + needSignSystemDocCount, NeedSignTrialDocCount = needSignTrialDocCount, NeedSignSystemDocCount = needSignSystemDocCount, IsAdditionalAssessment = isAdditionalAssessment && isManualGenerateTask, TrialStatusStr = trialInfo.TrialStatusStr, TrialConfig = trialTaskConfig });
|
return ResponseOutput.Ok(result, new { NeedSignCount = needSignTrialDocCount + needSignSystemDocCount, NeedSignTrialDocCount = needSignTrialDocCount, NeedSignSystemDocCount = needSignSystemDocCount, IsAdditionalAssessment = isAdditionalAssessment && isManualGenerateTask, TrialStatusStr = trialInfo.TrialStatusStr, TrialConfig = trialTaskConfig });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -353,10 +466,157 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
public async Task<IResponseOutput<PageOutput<UnionDocumentWithConfirmInfoView>>> GetDocumentConfirmList(DocumentTrialUnionQuery inQuery)
|
public async Task<IResponseOutput<PageOutput<UnionDocumentWithConfirmInfoView>>> GetDocumentConfirmList(DocumentTrialUnionQuery inQuery)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#region 测试
|
||||||
|
|
||||||
|
var trialInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId, ignoreQueryFilters: true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
|
||||||
|
|
||||||
|
var trialDocQuery =
|
||||||
|
from trialDoc in _trialDocumentRepository.AsQueryable(false).Where(t => t.TrialId == inQuery.TrialId)
|
||||||
|
.Where(t => inQuery.UserTypeId != null ? t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == inQuery.UserTypeId) : true)
|
||||||
|
from trialUser in _trialIdentityUserRepository.AsQueryable(false).Where(t => t.TrialId == inQuery.TrialId
|
||||||
|
&& t.TrialUserRoleList.AsQueryable().Any(t => trialDoc.NeedConfirmedUserTypeList.Any(c => c.NeedConfirmUserTypeId == t.UserRole.UserTypeId))
|
||||||
|
)
|
||||||
|
.Where(t => inQuery.UserId != null ? t.IdentityUserId == inQuery.UserId : true)
|
||||||
|
.Where(t => inQuery.UserTypeId != null ? t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == inQuery.UserTypeId) : true)
|
||||||
|
|
||||||
|
|
||||||
|
join confirm in _trialDocConfirmedUserRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId) on
|
||||||
|
new { trialUser.IdentityUserId, TrialDocumentId = trialDoc.Id } equals new { IdentityUserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
||||||
|
from confirm in cc.DefaultIfEmpty()
|
||||||
|
select new UnionDocumentWithConfirmInfoView()
|
||||||
|
{
|
||||||
|
IsSystemDoc = false,
|
||||||
|
|
||||||
|
Id = trialDoc.Id,
|
||||||
|
CreateTime = trialDoc.CreateTime,
|
||||||
|
IsDeleted = trialDoc.IsDeleted,
|
||||||
|
SignViewMinimumMinutes = trialDoc.SignViewMinimumMinutes,
|
||||||
|
Name = trialDoc.Name,
|
||||||
|
Path = trialDoc.Path,
|
||||||
|
FileTypeId = trialDoc.FileTypeId,
|
||||||
|
FileType = _userInfo.IsEn_Us ? trialDoc.FileType.Value : trialDoc.FileType.ValueCN,
|
||||||
|
UpdateTime = trialDoc.UpdateTime,
|
||||||
|
//IsConfirmed= confirm.ConfirmTime!=null,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ConfirmUserId = trialUser.IdentityUserId,
|
||||||
|
ConfirmTime = confirm.ConfirmTime,
|
||||||
|
RealName = trialUser.IdentityUser.FullName,
|
||||||
|
UserName = trialUser.IdentityUser.UserName,
|
||||||
|
|
||||||
|
//UserTypeId = trialUser.UserRole.UserTypeId,
|
||||||
|
//UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
||||||
|
//DocNeedSignUserTypeList = trialDoc.NeedConfirmedUserTypeList.Select(t => t.UserTypeRole.UserTypeName),
|
||||||
|
|
||||||
|
FullFilePath = trialDoc.Path
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var systemDocQuery =
|
||||||
|
from sysDoc in _systemDocumentRepository.AsQueryable(false).Where(u => trialInfo.TrialFinishedTime != null ? u.CreateTime < trialInfo.TrialFinishedTime : true)
|
||||||
|
.Where(t => inQuery.UserTypeId != null ? t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == inQuery.UserTypeId) : true)
|
||||||
|
from trialUser in _trialIdentityUserRepository.AsQueryable(false).Where(t => t.TrialId == inQuery.TrialId
|
||||||
|
&& t.TrialUserRoleList.Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserRole.UserTypeId)))
|
||||||
|
.Where(t => inQuery.UserId != null ? t.IdentityUserId == inQuery.UserId : true)
|
||||||
|
.Where(t => inQuery.UserTypeId != null ? t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == inQuery.UserTypeId) : true)
|
||||||
|
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = trialUser.IdentityUserId, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||||
|
from confirm in cc.DefaultIfEmpty()
|
||||||
|
select new UnionDocumentWithConfirmInfoView()
|
||||||
|
{
|
||||||
|
IsSystemDoc = true,
|
||||||
|
|
||||||
|
Id = sysDoc.Id,
|
||||||
|
CreateTime = sysDoc.CreateTime,
|
||||||
|
IsDeleted = sysDoc.IsDeleted,
|
||||||
|
SignViewMinimumMinutes = sysDoc.SignViewMinimumMinutes,
|
||||||
|
Name = sysDoc.Name,
|
||||||
|
Path = sysDoc.Path,
|
||||||
|
FileType = _userInfo.IsEn_Us ? sysDoc.FileType.Value : sysDoc.FileType.ValueCN,
|
||||||
|
FileTypeId = sysDoc.FileTypeId,
|
||||||
|
UpdateTime = sysDoc.UpdateTime,
|
||||||
|
//IsConfirmed = confirm.ConfirmTime != null,
|
||||||
|
|
||||||
|
ConfirmUserId = trialUser.IdentityUserId,
|
||||||
|
ConfirmTime = confirm.ConfirmTime,
|
||||||
|
|
||||||
|
RealName = trialUser.IdentityUser.FullName,
|
||||||
|
UserName = trialUser.IdentityUser.UserName,
|
||||||
|
|
||||||
|
//UserTypeId = trialUser.UserRole.UserTypeId,
|
||||||
|
//UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
||||||
|
|
||||||
|
FullFilePath = sysDoc.Path
|
||||||
|
};
|
||||||
|
|
||||||
|
//var tt = await trialDocQuery.ToPagedListAsync(inQuery);
|
||||||
|
|
||||||
|
var unionQuery = trialDocQuery.Union(systemDocQuery).IgnoreQueryFilters().Where(t => !(t.IsDeleted == true && t.ConfirmTime == null))
|
||||||
|
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||||
|
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
||||||
|
.WhereIf(inQuery.IsConfirmed == true, t => t.ConfirmTime != null)
|
||||||
|
.WhereIf(inQuery.IsConfirmed == false, t => t.ConfirmTime == null)
|
||||||
|
.WhereIf(inQuery.StartConfirmTime != null, t => t.ConfirmTime >= inQuery.StartConfirmTime.Value)
|
||||||
|
.WhereIf(inQuery.EndConfirmTime != null, t => t.ConfirmTime <= inQuery.EndConfirmTime.Value)
|
||||||
|
.WhereIf(!string.IsNullOrEmpty(inQuery.UserName), t => t.UserName.Contains(inQuery.UserName))
|
||||||
|
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted);
|
||||||
|
|
||||||
|
var result = await unionQuery.ToPagedListAsync(inQuery);
|
||||||
|
|
||||||
|
#region 处理文档 需要签署的角色类型 和每个人的角色信息
|
||||||
|
|
||||||
|
var trialDocIdList = result.CurrentPageData.Where(t => t.IsSystemDoc == false).Select(t => t.Id).ToList();
|
||||||
|
|
||||||
|
var sysDocIdList = result.CurrentPageData.Where(t => t.IsSystemDoc == true).Select(t => t.Id).ToList();
|
||||||
|
|
||||||
|
var trialIdentityUserIdList = result.CurrentPageData.Select(t => t.ConfirmUserId).Distinct().ToList();
|
||||||
|
|
||||||
|
var trialDocUserTypeList = _trialDocNeedConfirmedUserTypeRepository.Where(t => trialDocIdList.Contains(t.TrialDocumentId)).Select(t => new { t.TrialDocumentId, t.UserTypeRole.UserTypeShortName }).ToList();
|
||||||
|
|
||||||
|
var sysDocUserTypeList = _systemDocNeedConfirmedUserTypeRepository.Where(t => sysDocIdList.Contains(t.SystemDocumentId)).Select(t => new { t.SystemDocumentId, t.UserTypeRole.UserTypeShortName }).ToList();
|
||||||
|
|
||||||
|
var trialUserUserTypeList = _trialIdentityUserRepository.Where(t => t.TrialId == inQuery.TrialId && trialIdentityUserIdList.Contains(t.IdentityUserId)).IgnoreQueryFilters().Select(t => new { t.IdentityUserId, UserTypeList = t.TrialUserRoleList.Select(c => c.UserRole.UserTypeRole.UserTypeShortName).ToList() });
|
||||||
|
|
||||||
|
|
||||||
|
foreach (var item in result.CurrentPageData)
|
||||||
|
{
|
||||||
|
if (item.IsSystemDoc)
|
||||||
|
{
|
||||||
|
item.DocNeedSignUserTypeList = sysDocUserTypeList.Where(t => t.SystemDocumentId == item.Id).Select(t => t.UserTypeShortName).ToList();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
item.DocNeedSignUserTypeList = trialDocUserTypeList.Where(t => t.TrialDocumentId == item.Id).Select(t => t.UserTypeShortName).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
item.IdentityUserTypeList = trialUserUserTypeList.Where(t => t.IdentityUserId == item.ConfirmUserId).SelectMany(c => c.UserTypeList).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true)
|
||||||
|
.Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId && t.TrialUserRoleList.Any(t => t.UserRole.UserTypeId == _userInfo.UserTypeId)))
|
||||||
|
.Where(t => t.IsDeleted == false && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||||
|
.CountAsync();
|
||||||
|
|
||||||
|
|
||||||
|
var needSignSystemDocCount = await _systemDocumentRepository
|
||||||
|
.Where(t => t.IsDeleted == false && !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||||
|
.CountAsync();
|
||||||
|
|
||||||
|
|
||||||
|
return ResponseOutput.Ok(result, new { NeedSignCount = needSignTrialDocCount + needSignSystemDocCount, NeedSignTrialDocCount = needSignTrialDocCount, NeedSignSystemDocCount = needSignSystemDocCount, TrialStatusStr = trialInfo.TrialStatusStr });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region linq join 方式
|
#region linq join 方式
|
||||||
//var trialDocQuery = from trialDocumentNeedConfirmedUserType in _trialDocumentNeedConfirmedUserTypeRepository.Where(t => t.TrialDocument.TrialId == querySystemDocument.TrialId)
|
//var trialDocQuery = from trialDocumentNeedConfirmedUserType in _trialDocumentNeedConfirmedUserTypeRepository.Where(t => t.TrialDocument.TrialId == querySystemDocument.TrialId)
|
||||||
// join trialUser in _trialUserRepository.Where(t => t.TrialId == querySystemDocument.TrialId)
|
// join trialUser in _trialUserRoleRepository.Where(t => t.TrialId == querySystemDocument.TrialId)
|
||||||
// .WhereIf(querySystemDocument.UserId != null, t => t.UserId == querySystemDocument.UserId)
|
// .WhereIf(querySystemDocument.UserId != null, t => t.UserId == querySystemDocument.UserId)
|
||||||
// on trialDocumentNeedConfirmedUserType.NeedConfirmUserTypeId equals trialUser.User.UserTypeId
|
// on trialDocumentNeedConfirmedUserType.NeedConfirmUserTypeId equals trialUser.User.UserTypeId
|
||||||
|
|
||||||
@@ -387,100 +647,106 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
var trialInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId, ignoreQueryFilters: true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
|
#region 废弃
|
||||||
|
//var trialInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId, ignoreQueryFilters: true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
|
||||||
|
|
||||||
var trialDocQuery = from trialDocumentNeedConfirmedUserType in _trialDocNeedConfirmedUserTypeRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId)
|
//var trialDocQuery = from trialDocumentNeedConfirmedUserType in _trialDocNeedConfirmedUserTypeRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId)
|
||||||
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId)
|
// join trialUser in _trialUserRoleRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||||
.WhereIf(inQuery.UserId != null, t => t.UserId == inQuery.UserId)
|
// .WhereIf(inQuery.UserId != null, t => t.UserRole.IdentityUserId == inQuery.UserId)
|
||||||
.WhereIf(inQuery.UserTypeId != null, t => t.User.UserTypeId == inQuery.UserTypeId)
|
// .WhereIf(inQuery.UserTypeId != null, t => t.UserRole.UserTypeId == inQuery.UserTypeId)
|
||||||
on trialDocumentNeedConfirmedUserType.NeedConfirmUserTypeId equals trialUser.User.UserTypeId
|
// on trialDocumentNeedConfirmedUserType.NeedConfirmUserTypeId equals trialUser.UserRole.UserTypeId
|
||||||
|
|
||||||
join confirm in _trialDocConfirmedUserRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId) on
|
// join confirm in _trialDocConfirmedUserRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId) on
|
||||||
new { trialUser.UserId, TrialDocumentId = trialDocumentNeedConfirmedUserType.TrialDocumentId } equals new { UserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
// new { trialUser.UserRole.IdentityUserId, TrialDocumentId = trialDocumentNeedConfirmedUserType.TrialDocumentId } equals new { IdentityUserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
||||||
from confirm in cc.DefaultIfEmpty()
|
// from confirm in cc.DefaultIfEmpty()
|
||||||
select new UnionDocumentWithConfirmInfoView()
|
// select new UnionDocumentWithConfirmInfoView()
|
||||||
{
|
// {
|
||||||
IsSystemDoc = false,
|
// IsSystemDoc = false,
|
||||||
|
|
||||||
Id = trialDocumentNeedConfirmedUserType.TrialDocument.Id,
|
// Id = trialDocumentNeedConfirmedUserType.TrialDocument.Id,
|
||||||
CreateTime = trialDocumentNeedConfirmedUserType.TrialDocument.CreateTime,
|
// CreateTime = trialDocumentNeedConfirmedUserType.TrialDocument.CreateTime,
|
||||||
IsDeleted = trialDocumentNeedConfirmedUserType.TrialDocument.IsDeleted,
|
// IsDeleted = trialDocumentNeedConfirmedUserType.TrialDocument.IsDeleted,
|
||||||
SignViewMinimumMinutes = trialDocumentNeedConfirmedUserType.TrialDocument.SignViewMinimumMinutes,
|
// SignViewMinimumMinutes = trialDocumentNeedConfirmedUserType.TrialDocument.SignViewMinimumMinutes,
|
||||||
Name = trialDocumentNeedConfirmedUserType.TrialDocument.Name,
|
// Name = trialDocumentNeedConfirmedUserType.TrialDocument.Name,
|
||||||
Path = trialDocumentNeedConfirmedUserType.TrialDocument.Path,
|
// Path = trialDocumentNeedConfirmedUserType.TrialDocument.Path,
|
||||||
FileTypeId = trialDocumentNeedConfirmedUserType.TrialDocument.FileTypeId,
|
// FileTypeId = trialDocumentNeedConfirmedUserType.TrialDocument.FileTypeId,
|
||||||
FileType = _userInfo.IsEn_Us ? trialDocumentNeedConfirmedUserType.TrialDocument.FileType.Value : trialDocumentNeedConfirmedUserType.TrialDocument.FileType.ValueCN,
|
// FileType = _userInfo.IsEn_Us ? trialDocumentNeedConfirmedUserType.TrialDocument.FileType.Value : trialDocumentNeedConfirmedUserType.TrialDocument.FileType.ValueCN,
|
||||||
UpdateTime = trialDocumentNeedConfirmedUserType.TrialDocument.UpdateTime,
|
// UpdateTime = trialDocumentNeedConfirmedUserType.TrialDocument.UpdateTime,
|
||||||
//IsConfirmed= confirm.ConfirmTime!=null,
|
// //IsConfirmed= confirm.ConfirmTime!=null,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ConfirmUserId = confirm.ConfirmUserId,
|
// ConfirmUserId = confirm.ConfirmUserId,
|
||||||
ConfirmTime = confirm.ConfirmTime,
|
// ConfirmTime = confirm.ConfirmTime,
|
||||||
RealName = trialUser.User.FullName,
|
// RealName = trialUser.UserRole.FullName,
|
||||||
UserName = trialUser.User.UserName,
|
// UserName = trialUser.UserRole.IdentityUser.UserName,
|
||||||
UserTypeId = trialUser.User.UserTypeId,
|
|
||||||
UserTypeShortName = trialUser.User.UserTypeRole.UserTypeShortName,
|
|
||||||
|
|
||||||
FullFilePath = trialDocumentNeedConfirmedUserType.TrialDocument.Path
|
// //UserTypeId = trialUser.UserRole.UserTypeId,
|
||||||
};
|
// //UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
||||||
|
|
||||||
|
// FullFilePath = trialDocumentNeedConfirmedUserType.TrialDocument.Path
|
||||||
|
// };
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var systemDocQuery = from needConfirmEdUserType in _systemDocNeedConfirmedUserTypeRepository.WhereIf(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime)
|
//var systemDocQuery = from needConfirmEdUserType in _systemDocNeedConfirmedUserTypeRepository.WhereIf(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime)
|
||||||
|
|
||||||
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId)
|
// join trialUser in _trialUserRoleRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||||
.WhereIf(inQuery.UserId != null, t => t.UserId == inQuery.UserId)
|
// .WhereIf(inQuery.UserId != null, t => t.UserRole.IdentityUserId == inQuery.UserId)
|
||||||
on needConfirmEdUserType.NeedConfirmUserTypeId equals trialUser.User.UserTypeId
|
// on needConfirmEdUserType.NeedConfirmUserTypeId equals trialUser.UserRole.UserTypeId
|
||||||
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = trialUser.UserId, SystemDocumentId = needConfirmEdUserType.SystemDocumentId } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
// join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = trialUser.UserId, SystemDocumentId = needConfirmEdUserType.SystemDocumentId } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||||
from confirm in cc.DefaultIfEmpty()
|
// from confirm in cc.DefaultIfEmpty()
|
||||||
select new UnionDocumentWithConfirmInfoView()
|
// select new UnionDocumentWithConfirmInfoView()
|
||||||
{
|
// {
|
||||||
IsSystemDoc = true,
|
// IsSystemDoc = true,
|
||||||
|
|
||||||
Id = needConfirmEdUserType.SystemDocument.Id,
|
// Id = needConfirmEdUserType.SystemDocument.Id,
|
||||||
CreateTime = needConfirmEdUserType.SystemDocument.CreateTime,
|
// CreateTime = needConfirmEdUserType.SystemDocument.CreateTime,
|
||||||
IsDeleted = needConfirmEdUserType.SystemDocument.IsDeleted,
|
// IsDeleted = needConfirmEdUserType.SystemDocument.IsDeleted,
|
||||||
SignViewMinimumMinutes = needConfirmEdUserType.SystemDocument.SignViewMinimumMinutes,
|
// SignViewMinimumMinutes = needConfirmEdUserType.SystemDocument.SignViewMinimumMinutes,
|
||||||
Name = needConfirmEdUserType.SystemDocument.Name,
|
// Name = needConfirmEdUserType.SystemDocument.Name,
|
||||||
Path = needConfirmEdUserType.SystemDocument.Path,
|
// Path = needConfirmEdUserType.SystemDocument.Path,
|
||||||
FileType = _userInfo.IsEn_Us ? needConfirmEdUserType.SystemDocument.FileType.Value : needConfirmEdUserType.SystemDocument.FileType.ValueCN,
|
// FileType = _userInfo.IsEn_Us ? needConfirmEdUserType.SystemDocument.FileType.Value : needConfirmEdUserType.SystemDocument.FileType.ValueCN,
|
||||||
FileTypeId = needConfirmEdUserType.SystemDocument.FileTypeId,
|
// FileTypeId = needConfirmEdUserType.SystemDocument.FileTypeId,
|
||||||
UpdateTime = needConfirmEdUserType.SystemDocument.UpdateTime,
|
// UpdateTime = needConfirmEdUserType.SystemDocument.UpdateTime,
|
||||||
//IsConfirmed = confirm.ConfirmTime != null,
|
// //IsConfirmed = confirm.ConfirmTime != null,
|
||||||
|
|
||||||
ConfirmUserId = confirm.ConfirmUserId,
|
// ConfirmUserId = confirm.ConfirmUserId,
|
||||||
ConfirmTime = confirm.ConfirmTime,
|
// ConfirmTime = confirm.ConfirmTime,
|
||||||
RealName = trialUser.User.FullName,
|
// RealName = trialUser.UserRole.FullName,
|
||||||
UserName = trialUser.User.UserName,
|
// UserName = trialUser.UserRole.IdentityUser.UserName,
|
||||||
UserTypeId = trialUser.User.UserTypeId,
|
|
||||||
UserTypeShortName = trialUser.User.UserTypeRole.UserTypeShortName,
|
|
||||||
|
|
||||||
FullFilePath = needConfirmEdUserType.SystemDocument.Path
|
// //UserTypeId = trialUser.UserRole.UserTypeId,
|
||||||
};
|
// //UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
||||||
|
|
||||||
var unionQuery = trialDocQuery.Union(systemDocQuery).IgnoreQueryFilters().Where(t => !(t.IsDeleted == true && t.ConfirmUserId == null))
|
// FullFilePath = needConfirmEdUserType.SystemDocument.Path
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
// };
|
||||||
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
|
||||||
.WhereIf(inQuery.IsConfirmed == true, t => t.ConfirmTime != null)
|
|
||||||
.WhereIf(inQuery.IsConfirmed == false, t => t.ConfirmTime == null)
|
|
||||||
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
|
|
||||||
.WhereIf(inQuery.UserTypeId != null, t => t.UserTypeId == inQuery.UserTypeId);
|
|
||||||
|
|
||||||
var result = await unionQuery.ToPagedListAsync(inQuery);
|
//var unionQuery = trialDocQuery.Union(systemDocQuery).IgnoreQueryFilters().Where(t => !(t.IsDeleted == true && t.ConfirmUserId == null))
|
||||||
|
// .WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||||
|
// .WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
||||||
|
// .WhereIf(inQuery.IsConfirmed == true, t => t.ConfirmTime != null)
|
||||||
|
// .WhereIf(inQuery.IsConfirmed == false, t => t.ConfirmTime == null)
|
||||||
|
// .WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
|
||||||
|
// /*.Distinct()*/;
|
||||||
|
|
||||||
var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true)
|
//var result = await unionQuery.ToPagedListAsync(inQuery);
|
||||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
|
||||||
.Where(t => t.IsDeleted == false && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
//var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true)
|
||||||
.CountAsync();
|
// .Where(t => t.Trial.TrialIdentityUserList.Any(t => t.IdentityUserId == _userInfo.IdentityUserId))
|
||||||
|
// .Where(t => t.IsDeleted == false && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||||
|
// .CountAsync();
|
||||||
|
|
||||||
|
|
||||||
var needSignSystemDocCount = await _systemDocumentRepository
|
//var needSignSystemDocCount = await _systemDocumentRepository
|
||||||
.Where(t => t.IsDeleted == false && !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
// .Where(t => t.IsDeleted == false && !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.IdentityUserId) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||||
.CountAsync();
|
// .CountAsync();
|
||||||
|
|
||||||
|
|
||||||
return ResponseOutput.Ok(result, new { NeedSignCount = needSignTrialDocCount + needSignSystemDocCount, NeedSignTrialDocCount = needSignTrialDocCount, NeedSignSystemDocCount = needSignSystemDocCount, TrialStatusStr = trialInfo.TrialStatusStr });
|
//return ResponseOutput.Ok(result, new { NeedSignCount = needSignTrialDocCount + needSignSystemDocCount, NeedSignTrialDocCount = needSignTrialDocCount, NeedSignSystemDocCount = needSignSystemDocCount, TrialStatusStr = trialInfo.TrialStatusStr });
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -492,8 +758,8 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
[HttpGet("{trialId:guid}")]
|
[HttpGet("{trialId:guid}")]
|
||||||
public async Task<List<TrialUserDto>> GetTrialUserSelect(Guid trialId)
|
public async Task<List<TrialUserDto>> GetTrialUserSelect(Guid trialId)
|
||||||
{
|
{
|
||||||
return await _trialUserRepository.Where(t => t.TrialId == trialId)
|
return await _trialIdentityUserRepository.Where(t => t.TrialId == trialId)
|
||||||
.Select(t => new TrialUserDto() { UserId = t.UserId, RealName = t.User.FullName, UserName = t.User.UserName })
|
.Select(t => new TrialUserDto() { UserId = t.IdentityUserId, RealName = t.IdentityUser.FullName, UserName = t.IdentityUser.UserName })
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -513,7 +779,7 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
return ResponseOutput.Ok(result);
|
return ResponseOutput.Ok(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
[TrialGlobalLimit( "BeforeOngoingCantOpt", "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("BeforeOngoingCantOpt", "AfterStopCannNotOpt")]
|
||||||
//[Authorize(Policy = IRaCISPolicy.PM)]
|
//[Authorize(Policy = IRaCISPolicy.PM)]
|
||||||
public async Task<IResponseOutput> AddOrUpdateTrialDocument(AddOrEditTrialDocument addOrEditTrialDocument)
|
public async Task<IResponseOutput> AddOrUpdateTrialDocument(AddOrEditTrialDocument addOrEditTrialDocument)
|
||||||
{
|
{
|
||||||
@@ -585,7 +851,7 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpDelete("{trialId:guid}/{trialDocumentId:guid}")]
|
[HttpDelete("{trialId:guid}/{trialDocumentId:guid}")]
|
||||||
//[Authorize(Policy = IRaCISPolicy.PM)]
|
//[Authorize(Policy = IRaCISPolicy.PM)]
|
||||||
[TrialGlobalLimit( "BeforeOngoingCantOpt", "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("BeforeOngoingCantOpt", "AfterStopCannNotOpt")]
|
||||||
public async Task<IResponseOutput> DeleteTrialDocument(Guid trialDocumentId, Guid trialId)
|
public async Task<IResponseOutput> DeleteTrialDocument(Guid trialDocumentId, Guid trialId)
|
||||||
{
|
{
|
||||||
if (await _trialDocumentRepository.AsQueryable(true).Where(t => t.Id == trialDocumentId).AnyAsync(t => t.TrialDocConfirmedUserList.Any()))
|
if (await _trialDocumentRepository.AsQueryable(true).Where(t => t.Id == trialDocumentId).AnyAsync(t => t.TrialDocConfirmedUserList.Any()))
|
||||||
@@ -614,9 +880,9 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
var success = false;
|
var success = false;
|
||||||
if (isSystemDoc)
|
if (isSystemDoc)
|
||||||
{
|
{
|
||||||
if (!await _systemDocConfirmedUserRepository.AnyAsync(t => t.SystemDocumentId == documentId && t.ConfirmUserId == _userInfo.Id))
|
if (!await _systemDocConfirmedUserRepository.AnyAsync(t => t.SystemDocumentId == documentId && t.ConfirmUserId == _userInfo.IdentityUserId))
|
||||||
{
|
{
|
||||||
await _systemDocConfirmedUserRepository.AddAsync(new SystemDocConfirmedUser() { SystemDocumentId = documentId, ConfirmUserId = _userInfo.Id, SignFirstViewTime = DateTime.Now });
|
await _systemDocConfirmedUserRepository.AddAsync(new SystemDocConfirmedIdentityUser() { SystemDocumentId = documentId, ConfirmUserId = _userInfo.IdentityUserId, SignFirstViewTime = DateTime.Now });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -624,10 +890,10 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!await _trialDocUserTypeConfirmedUserRepository.AnyAsync(t => t.TrialDocumentId == documentId && t.ConfirmUserId == _userInfo.Id))
|
if (!await _trialDocConfirmedUserRepository.AnyAsync(t => t.TrialDocumentId == documentId && t.ConfirmUserId == _userInfo.IdentityUserId))
|
||||||
{
|
{
|
||||||
|
|
||||||
await _trialDocConfirmedUserRepository.AddAsync(new TrialDocConfirmedUser() { TrialDocumentId = documentId, ConfirmUserId = _userInfo.Id, SignFirstViewTime = DateTime.Now });
|
await _trialDocConfirmedUserRepository.AddAsync(new TrialDocConfirmedIdentityUser() { TrialDocumentId = documentId, ConfirmUserId = _userInfo.IdentityUserId, SignFirstViewTime = DateTime.Now });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -642,9 +908,9 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
[HttpPut("{documentId:guid}")]
|
[HttpPut("{documentId:guid}")]
|
||||||
public async Task<IResponseOutput> SetSystemDocFirstViewTime(Guid documentId)
|
public async Task<IResponseOutput> SetSystemDocFirstViewTime(Guid documentId)
|
||||||
{
|
{
|
||||||
if (!await _systemDocConfirmedUserRepository.AnyAsync(t => t.SystemDocumentId == documentId && t.ConfirmUserId == _userInfo.Id))
|
if (!await _systemDocConfirmedUserRepository.AnyAsync(t => t.SystemDocumentId == documentId && t.ConfirmUserId == _userInfo.IdentityUserId))
|
||||||
{
|
{
|
||||||
await _systemDocConfirmedUserRepository.AddAsync(new SystemDocConfirmedUser() { SystemDocumentId = documentId, ConfirmUserId = _userInfo.Id, SignFirstViewTime = DateTime.Now });
|
await _systemDocConfirmedUserRepository.AddAsync(new SystemDocConfirmedIdentityUser() { SystemDocumentId = documentId, ConfirmUserId = _userInfo.IdentityUserId, SignFirstViewTime = DateTime.Now });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -656,10 +922,10 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
[HttpPut("{trialId:guid}/{documentId:guid}")]
|
[HttpPut("{trialId:guid}/{documentId:guid}")]
|
||||||
public async Task<IResponseOutput> SetTrialDocFirstViewTime(Guid documentId)
|
public async Task<IResponseOutput> SetTrialDocFirstViewTime(Guid documentId)
|
||||||
{
|
{
|
||||||
if (!await _trialDocUserTypeConfirmedUserRepository.AnyAsync(t => t.TrialDocumentId == documentId && t.ConfirmUserId == _userInfo.Id))
|
if (!await _trialDocConfirmedUserRepository.AnyAsync(t => t.TrialDocumentId == documentId && t.ConfirmUserId == _userInfo.IdentityUserId))
|
||||||
{
|
{
|
||||||
|
|
||||||
await _trialDocConfirmedUserRepository.AddAsync(new TrialDocConfirmedUser() { TrialDocumentId = documentId, ConfirmUserId = _userInfo.Id, SignFirstViewTime = DateTime.Now });
|
await _trialDocConfirmedUserRepository.AddAsync(new TrialDocConfirmedIdentityUser() { TrialDocumentId = documentId, ConfirmUserId = _userInfo.IdentityUserId, SignFirstViewTime = DateTime.Now });
|
||||||
|
|
||||||
}
|
}
|
||||||
var success = await _trialDocConfirmedUserRepository.SaveChangesAsync();
|
var success = await _trialDocConfirmedUserRepository.SaveChangesAsync();
|
||||||
@@ -671,14 +937,14 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
/// 用户 签名某个文档 可能是系统的,也可能是项目的
|
/// 用户 签名某个文档 可能是系统的,也可能是项目的
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[TrialGlobalLimit( "BeforeOngoingCantOpt", "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("BeforeOngoingCantOpt", "AfterStopCannNotOpt")]
|
||||||
public async Task<IResponseOutput> UserConfirm(UserConfirmCommand userConfirmCommand)
|
public async Task<IResponseOutput> UserConfirm(UserConfirmCommand userConfirmCommand)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (userConfirmCommand.isSystemDoc)
|
if (userConfirmCommand.isSystemDoc)
|
||||||
{
|
{
|
||||||
|
|
||||||
var sysDocConfirm = await _systemDocConfirmedUserRepository.FirstOrDefaultAsync(t => t.SystemDocumentId == userConfirmCommand.DocumentId && t.ConfirmUserId == _userInfo.Id, true);
|
var sysDocConfirm = await _systemDocConfirmedUserRepository.FirstOrDefaultAsync(t => t.SystemDocumentId == userConfirmCommand.DocumentId && t.ConfirmUserId == _userInfo.IdentityUserId, true);
|
||||||
|
|
||||||
if (sysDocConfirm.ConfirmTime != null)
|
if (sysDocConfirm.ConfirmTime != null)
|
||||||
{
|
{
|
||||||
@@ -705,7 +971,7 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
var trialDocConfirm = await _trialDocUserTypeConfirmedUserRepository.FirstOrDefaultAsync(t => t.TrialDocumentId == userConfirmCommand.DocumentId && t.ConfirmUserId == _userInfo.Id, true);
|
var trialDocConfirm = await _trialDocConfirmedUserRepository.FirstOrDefaultAsync(t => t.TrialDocumentId == userConfirmCommand.DocumentId && t.ConfirmUserId == _userInfo.IdentityUserId, true);
|
||||||
|
|
||||||
if (trialDocConfirm.ConfirmTime != null)
|
if (trialDocConfirm.ConfirmTime != null)
|
||||||
{
|
{
|
||||||
@@ -722,7 +988,7 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
trialDocConfirm.ConfirmTime = DateTime.Now;
|
trialDocConfirm.ConfirmTime = DateTime.Now;
|
||||||
trialDocConfirm.SignText = userConfirmCommand.SignText;
|
trialDocConfirm.SignText = userConfirmCommand.SignText;
|
||||||
|
|
||||||
await _trialDocUserTypeConfirmedUserRepository.SaveChangesAsync();
|
await _trialDocConfirmedUserRepository.SaveChangesAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -738,13 +1004,13 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
/// <param name="isSystemDoc"></param>
|
/// <param name="isSystemDoc"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPut("{documentId:guid}/{isSystemDoc:bool}")]
|
[HttpPut("{documentId:guid}/{isSystemDoc:bool}")]
|
||||||
[TrialGlobalLimit( "BeforeOngoingCantOpt", "AfterStopCannNotOpt", "SignSystemDocNoTrialId" )]
|
[TrialGlobalLimit("BeforeOngoingCantOpt", "AfterStopCannNotOpt", "SignSystemDocNoTrialId")]
|
||||||
public async Task<IResponseOutput> UserAbandonDoc(Guid documentId, bool isSystemDoc)
|
public async Task<IResponseOutput> UserAbandonDoc(Guid documentId, bool isSystemDoc)
|
||||||
{
|
{
|
||||||
if (isSystemDoc)
|
if (isSystemDoc)
|
||||||
{
|
{
|
||||||
await _systemDocumentRepository.UpdatePartialFromQueryAsync(documentId, u => new SystemDocument() { IsDeleted = true });
|
await _systemDocumentRepository.UpdatePartialFromQueryAsync(documentId, u => new SystemDocument() { IsDeleted = true });
|
||||||
await _systemDocConfirmedUserRepository.UpdatePartialFromQueryAsync(x => x.SystemDocumentId == documentId, x => new SystemDocConfirmedUser()
|
await _systemDocConfirmedUserRepository.UpdatePartialFromQueryAsync(x => x.SystemDocumentId == documentId, x => new SystemDocConfirmedIdentityUser()
|
||||||
{
|
{
|
||||||
IsDeleted = true
|
IsDeleted = true
|
||||||
});
|
});
|
||||||
@@ -752,7 +1018,7 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
await _trialDocumentRepository.UpdatePartialFromQueryAsync(documentId, u => new TrialDocument() { IsDeleted = true });
|
await _trialDocumentRepository.UpdatePartialFromQueryAsync(documentId, u => new TrialDocument() { IsDeleted = true });
|
||||||
await _trialDocUserTypeConfirmedUserRepository.UpdatePartialFromQueryAsync(x => x.TrialDocumentId == documentId, x => new TrialDocConfirmedUser()
|
await _trialDocConfirmedUserRepository.UpdatePartialFromQueryAsync(x => x.TrialDocumentId == documentId, x => new TrialDocConfirmedIdentityUser()
|
||||||
{
|
{
|
||||||
IsDeleted = true
|
IsDeleted = true
|
||||||
});
|
});
|
||||||
@@ -762,93 +1028,8 @@ namespace IRaCIS.Core.Application.Services
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#region 废弃
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 从项目下参与者的维度 先看人员列表(展示统计数字) 点击数字 再看人员具体签署的 系统文档+项目文档(共用上面与人相关的具体文档列表)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="trialId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpGet("{trialId:guid}")]
|
|
||||||
[Obsolete]
|
|
||||||
public List<TrialUserUnionDocumentView> GetTrialUserDocumentList(Guid trialId)
|
|
||||||
{
|
|
||||||
var query = _trialUserRepository.Where(t => t.TrialId == trialId)
|
|
||||||
.Select(t => new TrialUserUnionDocumentView()
|
|
||||||
{
|
|
||||||
UserId = t.UserId,
|
|
||||||
UserName = t.User.UserName,
|
|
||||||
RealName = t.User.FullName,
|
|
||||||
UserTypeShortName = t.User.UserTypeRole.UserTypeShortName,
|
|
||||||
TrialDocumentCount = t.Trial.TrialDocumentList.Count(u => u.NeedConfirmedUserTypeList.Any(k => k.NeedConfirmUserTypeId == t.User.UserTypeId)),
|
|
||||||
TrialDocumentConfirmedCount = t.Trial.TrialDocumentList.SelectMany(u => u.TrialDocConfirmedUserList).Count(k => k.ConfirmUserId == t.UserId),
|
|
||||||
SystemDocumentConfirmedCount = t.User.SystemDocConfirmedList.Count(),
|
|
||||||
//这样写不行
|
|
||||||
//SystemDocumentCount = _systemDocumentRepository.Where(s => s.NeedConfirmedUserTypeList.Any(kk => kk.NeedConfirmUserTypeId == t.User.UserTypeId))
|
|
||||||
// .WhereIf(!_userInfo.IsAdmin, s => s.IsAbandon == false || (s.IsAbandon == true && s.SystemDocConfirmedUserList.Any(uu => uu.ConfirmUserId == t.UserId))).Count()
|
|
||||||
SystemDocumentCount = t.User.UserTypeRole.SystemDocNeedConfirmedUserTypeList.Where(cc => cc.NeedConfirmUserTypeId == t.User.UserTypeId).Select(y => y.SystemDocument).Count()
|
|
||||||
});
|
|
||||||
|
|
||||||
return query.ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 从 文档的维度 先看到文档列表(系统文档+项目文档 以及需要确认的人数 和已经确认人数) 点击数字查看某文档下面人确认情况
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inQuery"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost]
|
|
||||||
[Obsolete]
|
|
||||||
public async Task<PageOutput<DocumentUnionWithUserStatView>> GetTrialSystemDocumentList(DocumentTrialUnionQuery inQuery)
|
|
||||||
{
|
|
||||||
var systemDocumentQueryable = _systemDocumentRepository
|
|
||||||
.WhereIf(!_userInfo.IsAdmin, t => t.IsDeleted == false)
|
|
||||||
.Select(t => new DocumentUnionWithUserStatView()
|
|
||||||
{
|
|
||||||
Id = t.Id,
|
|
||||||
IsSystemDoc = true,
|
|
||||||
CreateTime = t.CreateTime,
|
|
||||||
FullFilePath = t.Path,
|
|
||||||
IsDeleted = t.IsDeleted,
|
|
||||||
Name = t.Name,
|
|
||||||
Path = t.Path,
|
|
||||||
FileType = t.FileType.Value,
|
|
||||||
UpdateTime = t.UpdateTime,
|
|
||||||
SignViewMinimumMinutes = t.SignViewMinimumMinutes,
|
|
||||||
DocumentConfirmedUserCount = t.SystemDocConfirmedUserList.Count(),
|
|
||||||
|
|
||||||
//DocumentUserCount= _trialUserRepository.Where(tu=>tu.TrialId== querySystemDocument.TrialId).Count(u=>t.NeedConfirmedUserTypeList.Any(cc=>cc.NeedConfirmUserTypeId== u.User.UserTypeId ))
|
|
||||||
DocumentUserCount = t.NeedConfirmedUserTypeList.SelectMany(u => u.UserTypeRole.UserList.SelectMany(b => b.UserTrials.Where(r => r.TrialId == inQuery.TrialId))).Count()
|
|
||||||
});
|
|
||||||
|
|
||||||
var trialDocQueryable = _trialDocumentRepository.Where(t => t.TrialId == inQuery.TrialId).Select(t => new DocumentUnionWithUserStatView()
|
|
||||||
{
|
|
||||||
Id = t.Id,
|
|
||||||
IsSystemDoc = false,
|
|
||||||
CreateTime = t.CreateTime,
|
|
||||||
FullFilePath = t.Path,
|
|
||||||
IsDeleted = t.IsDeleted,
|
|
||||||
Name = t.Name,
|
|
||||||
Path = t.Path,
|
|
||||||
FileType = t.FileType.Value,
|
|
||||||
UpdateTime = t.UpdateTime,
|
|
||||||
SignViewMinimumMinutes = t.SignViewMinimumMinutes,
|
|
||||||
|
|
||||||
DocumentConfirmedUserCount = t.TrialDocConfirmedUserList.Count(),
|
|
||||||
DocumentUserCount = t.Trial.TrialUserList.Count(cc => t.NeedConfirmedUserTypeList.Any(k => k.NeedConfirmUserTypeId == cc.User.UserTypeId))
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
var unionQuery = systemDocumentQueryable.Union(trialDocQueryable)
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
|
||||||
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId);
|
|
||||||
|
|
||||||
return await unionQuery.ToPagedListAsync(inQuery);
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user