Compare commits
857 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 84d8d33349 | |||
| 132f90b28e | |||
| 7caabad651 | |||
| c4f3b0d653 | |||
| ddb9410c60 | |||
| f8ca73c164 | |||
| 9512846bb0 | |||
| 224097311c | |||
| 903718019e | |||
| a79ae2d6b5 | |||
| 71cc352982 | |||
| 94381dc5c0 | |||
| ac90d678c1 | |||
| c3959bbe63 | |||
| b88b92d884 | |||
| b05356b8e2 | |||
| 37a9315066 | |||
| 7324ec72ed | |||
| 90e8aa234d | |||
| 40669a14fe | |||
| f55c52d99e | |||
| a47b94e1a6 | |||
| 505af40b7b | |||
| 1fef1aa500 | |||
| 3aa63675c1 | |||
| 5825a5cd63 | |||
| 01d5b031a9 | |||
| 30b6aae25b | |||
| 54ebf14f02 | |||
| 2654f85c32 | |||
| fa9573cf54 | |||
| 98ea3d1a92 | |||
| e4b20908dc | |||
| 9b51ca3753 | |||
| 6d4ce03c10 | |||
| 1316dae035 | |||
| 79a6e43e02 | |||
| 625a4819e9 | |||
| 2838b3756f | |||
| 4f9dcfd584 | |||
| 37200b4ced | |||
| 4afbbcde99 | |||
| a05c3725e7 | |||
| 7110844c7c | |||
| 2a205a9634 | |||
| 1fad2c513c | |||
| 1ad4c16d23 | |||
| affc336f7d | |||
| e7f21db79a | |||
| 523dd52567 | |||
| 3191df85e4 | |||
| 2c37915ef7 | |||
| 1a8bd17f01 | |||
| a42907e7c8 | |||
| 1fc5bc8f3b | |||
| afebbc294b | |||
| dd50d9cd12 | |||
| 70f682edd6 | |||
| 48f7cee0c4 | |||
| 91fddff077 | |||
| c09144690e | |||
| 5cd4fde48a | |||
| fe90438f52 | |||
| a227bfe826 | |||
| a5f2e3f2e1 | |||
| 0dead1c4fe | |||
| 2db751bae4 | |||
| 5d6cd6ab9d | |||
| c93655d199 | |||
| 53cb22c474 | |||
| b58ab5e692 | |||
| f98dfb7c52 | |||
| f7c8178a45 | |||
| 336462bc02 | |||
| 7af0b6e6a5 | |||
| d1d22660c8 | |||
| 8afeeefc51 | |||
| 7f49a437ad | |||
| 6f1651dfc5 | |||
| 5372023651 | |||
| 659e92f95b | |||
| fd79df810c | |||
| 3f714dd030 | |||
| f39e013eca | |||
| d0367ddc36 | |||
| 1ce519673a | |||
| 03a96d4fff | |||
| 768eeeba1f | |||
| b068d20dd3 | |||
| 97a61ddfc0 | |||
| 4ed45c8616 | |||
| f4fc3dfab9 | |||
| 4673034737 | |||
| da155bfca3 | |||
| b6676b92bf | |||
| 363e0e11b3 | |||
| 7af5249e9c | |||
| ff663a1a9a | |||
| 860a09f6e8 | |||
| 59262a5c72 | |||
| e10e1f990f | |||
| ce8fe53d4d | |||
| bfad36af3d | |||
| c909dee4aa | |||
| 6775cfe170 | |||
| 995b612537 | |||
| e61b8e9777 | |||
| db0d90c0f0 | |||
| 6edacd4fd4 | |||
| 0df5e56dee | |||
| 16e0bebc29 | |||
| 5be959f4b8 | |||
| ea9a5fa3a0 | |||
| 2e15cfaed5 | |||
| 57d8673bb2 | |||
| bd8a8f744c | |||
| edc0734f9f | |||
| 0ad9da1076 | |||
| 6a8a005951 | |||
| fc8aaea395 | |||
| f469ce0227 | |||
| 1fb1b3d563 | |||
| 1baa31db04 | |||
| 0e4c972b19 | |||
| 8f438ff314 | |||
| 9bb5266d61 | |||
| edbcabace6 | |||
| bcc9e1c761 | |||
| c390997f79 | |||
| adff45de00 | |||
| a9cf555513 | |||
| 7885e4f80c | |||
| 8cccb5da36 | |||
| 1dc6c60de6 | |||
| 8cc9cb8caf | |||
| b718fcf185 | |||
| 495418cac2 | |||
| 3c031a9065 | |||
| 5109e84fcb | |||
| 7616813537 | |||
| 06230bb14b | |||
| a8e0c1691d | |||
| 8e9e2670fd | |||
| 95665f0274 | |||
| 26dbbd8dc9 | |||
| 2c991043ae | |||
| e739925da2 | |||
| 65ca6be4cd | |||
| bddb4eee6d | |||
| 8470a5f2ac | |||
| 2509d9cd9b | |||
| 633c2e5b8b | |||
| 9f5ae6f897 | |||
| 06231fe321 | |||
| 76a9a99762 | |||
| e2f1036ff1 | |||
| acd8e1765b | |||
| 79b97f089c | |||
| 6a6a314718 | |||
| 6be556dad2 | |||
| cee45b87ee | |||
| 9e47c34449 | |||
| ba96432757 | |||
| 7acd7ec8fb | |||
| 333763b3e1 | |||
| 7137064ead | |||
| 9813ab55a7 | |||
| a656b0c7dd | |||
| 9cf8ef47bb | |||
| ae6a0faa03 | |||
| 88a000d1d6 | |||
| 158c3608a0 | |||
| d529d5c52f | |||
| 2e549869af | |||
| 5346a12641 | |||
| c872f46257 | |||
| 56389be6a0 | |||
| 169b76161f | |||
| 2a56a8490b | |||
| 25844c5870 | |||
| 8b68fb319f | |||
| 3dfae86b00 | |||
| d26da8a4a8 | |||
| 0cbb375a49 | |||
| de1d971e44 | |||
| a031752d33 | |||
| b3b3cfff57 | |||
| a730b4485e | |||
| 897ad8c3eb | |||
| 6266146ecb | |||
| 7ed13b2b12 | |||
| 13e8ed7b6e | |||
| d2e2355673 | |||
| 951b4fde90 | |||
| 0b5cf19078 | |||
| 1274eaaec3 | |||
| 638fb12e16 | |||
| aacfbf7178 | |||
| 0f5a1a6335 | |||
| 73cbf96a65 | |||
| bee4a4b22b | |||
| 332e39b0fd | |||
| 7827fa2846 | |||
| 9d7c8f9786 | |||
| fbe02cd287 | |||
| 570fd0a27f | |||
| 7164c183ea | |||
| 094b43e748 | |||
| d16009272d | |||
| 3a3212f96c | |||
| 63b02936b1 | |||
| 2eced17ca9 | |||
| c4f0b0d60d | |||
| ec64533b4b | |||
| 670cee5923 | |||
| 67091fd72f | |||
| a5dee142bf | |||
| ade516d188 | |||
| da746c0e66 | |||
| 14826ee44b | |||
| 767c24dd56 | |||
| 22487c1893 | |||
| e6e2e8a91d | |||
| 4ebe354caa | |||
| 3b9c87c172 | |||
| c36aac0cdf | |||
| ab04db17f3 | |||
| 624cbee901 | |||
| a7891ee323 | |||
| 404c414f76 | |||
| bc55b870cb | |||
| ed282e444d | |||
| 8d3cf31941 | |||
| bec8720a4d | |||
| b9121e1468 | |||
| 55b72a9156 | |||
| 2ce78f333b | |||
| 5834ac7f37 | |||
| 1aaf5e10f4 | |||
| 82212aac16 | |||
| a118cbeb1e | |||
| c7b956344f | |||
| 2fe19dbf0e | |||
| 50e0e3bf98 | |||
| 5be941663b | |||
| 7a7acfa15c | |||
| 15ee30bcdf | |||
| 70362b8f96 | |||
| b217967d9c | |||
| eadf2d2cfa | |||
| ba441a826a | |||
| 7f063cf626 | |||
| bb2de4cca0 | |||
| fae51b4444 | |||
| 45438e09e5 | |||
| 1492d5acbb | |||
| 8f0dae936b | |||
| cd1222d27f | |||
| 71cfaaad63 | |||
| 66682260a0 | |||
| a1fdd5de05 | |||
| 5bcba84acb | |||
| 2cc362edfc | |||
| 8e5e638914 | |||
| 1c689ccfbd | |||
| 7b300a97c6 | |||
| 3199bea647 | |||
| bd31a3a598 | |||
| b3d58c5fa5 | |||
| 3457283220 | |||
| 33fc733f6d | |||
| 07a600c05f | |||
| cf30c49b0e | |||
| e2fd05db81 | |||
| 9d49ed9e61 | |||
| 5d6a44912e | |||
| ad3b0f84c2 | |||
| ceb111eccd | |||
| 53c56f5c0a | |||
| 15834921a8 | |||
| 8a1970bb3d | |||
| 50ce20071a | |||
| a8771052f3 | |||
| c53390beb3 | |||
| 0ec468becb | |||
| 2c45d4f1a5 | |||
| 2036c63a59 | |||
| e56d3dc632 | |||
| 8dedf719e0 | |||
| c04dfb4b77 | |||
| 281d10f3b4 | |||
| e28665fd05 | |||
| cc3b6d7e55 | |||
| 37d1c48f2e | |||
| 28187aea37 | |||
| 963d0d582f | |||
| ce279dda60 | |||
| ba92a90832 | |||
| 624bec0c88 | |||
| 85934de439 | |||
| 6a56132de9 | |||
| 8075684d1d | |||
| 3d3ac28848 | |||
| 5ec879833e | |||
| e8d2b494bf | |||
| c271537878 | |||
| ae2a3ba8a3 | |||
| 72215ad898 | |||
| d36e3c0d91 | |||
| 086ca46218 | |||
| 6c1288823d | |||
| 11c83759d2 | |||
| 9e2268ce72 | |||
| ce2f8ad003 | |||
| af661212b0 | |||
| f26db2b523 | |||
| 0451ef4190 | |||
| 84c5cdeca7 | |||
| ee8014385a | |||
| 27c63202cd | |||
| 9d446a6e29 | |||
| df27d6492f | |||
| 1d12d8e2ff | |||
| 551eb3851b | |||
| cb683b6674 | |||
| 4e5b96b8ea | |||
| 1db7b86f89 | |||
| 7198962847 | |||
| c7b32fd29a | |||
| 4b9ca6ca25 | |||
| f4a502024d | |||
| a9fd1978e1 | |||
| a73f6a4aeb | |||
| e34f13bd6a | |||
| f39ef0d799 | |||
| 66b9f2dd5c | |||
| b9d50179c0 | |||
| 35cac0d7e9 | |||
| 46980e6b50 | |||
| 7fc93a667d | |||
| e8e9105f5c | |||
| e6cd24065c | |||
| 65ae0e06f5 | |||
| 04a702fb0e | |||
| 5934178a5f | |||
| e43b28969e | |||
| a1bd7b4815 | |||
| baaf5af664 | |||
| 1f1500c661 | |||
| 3d92fac1d6 | |||
| 682a5d1c44 | |||
| e5f10d052a | |||
| 91bd2ac69f | |||
| e7ec55eb61 | |||
| c469b5e506 | |||
| e384470705 | |||
| 7c1e91b945 | |||
| 78e9623598 | |||
| a0f756a4cb | |||
| 108be0bc23 | |||
| e772407e38 | |||
| e789c32564 | |||
| 03f7173855 | |||
| 61b5a8295c | |||
| 665c88a681 | |||
| 53402bdda5 | |||
| 56295b3c98 | |||
| 0cbd0f67a1 | |||
| 7cf23668af | |||
| 7465b8b5b9 | |||
| 6019fdbe36 | |||
| 532eb15e3b | |||
| 064abbf8dd | |||
| d88a0412a0 | |||
| 296b510c41 | |||
| 473bb64b42 | |||
| 6df9099707 | |||
| b8c7441c92 | |||
| 79c21b24cd | |||
| b72e90f0b9 | |||
| 658ce479eb | |||
| 2e316c35fe | |||
| 3e9546aa10 | |||
| 21bd781468 | |||
| 2ea9c49b2e | |||
| b926519424 | |||
| 9e82fd124a | |||
| d859def7d6 | |||
| 2d5926913e | |||
| 8bde83bb7b | |||
| 08f592a9cb | |||
| a088071914 | |||
| a313f97736 | |||
| 367a096b8a | |||
| 363411f57c | |||
| 3bedd60b72 | |||
| bed277f899 | |||
| 6131101520 | |||
| b8f5709e65 | |||
| 689e8cf259 | |||
| 4acbe5b560 | |||
| 2c80ca7812 | |||
| 75b5458c02 | |||
| 1f446ac60f | |||
| 0b59b0a2cb | |||
| a13b1d08c4 | |||
| 39f5110464 | |||
| e67bf63bc5 | |||
| 2fffaca696 | |||
| be3dde7657 | |||
| 4d94784e88 | |||
| 7ea39def40 | |||
| 5b202121df | |||
| 1e0278fe72 | |||
| fd70a01803 | |||
| e6a909bba0 | |||
| 7ceb4b264b | |||
| fbaf78d18e | |||
| 7b8189dae2 | |||
| f29bdcab3f | |||
| 45de42fc71 | |||
| b62a1e5d88 | |||
| fbf86ab7e3 | |||
| 5dec67aa32 | |||
| 6e4d038b38 | |||
| 9b25cea893 | |||
| 4a2fd0166e | |||
| dfeab8793f | |||
| a867291b51 | |||
| 0fdf9a3419 | |||
| 796b3cf710 | |||
| 27e9cadf91 | |||
| 89d852f4ed | |||
| 9ad4c96572 | |||
| ed89bc652e | |||
| 746f2ba7e0 | |||
| 09acd12586 | |||
| a1d8e2237c | |||
| 86a486b060 | |||
| 173f899881 | |||
| 8436a319f8 | |||
| a565282a94 | |||
| 5d7beb71e6 | |||
| 3218be613d | |||
| 9ade3a7c39 | |||
| 3de5142a5b | |||
| ba3319d0cd | |||
| 2c82cf525a | |||
| c4e53d5654 | |||
| 7591f19707 | |||
| 7739652e21 | |||
| 40806ffda4 | |||
| 29783e2f3f | |||
| a888ed25ec | |||
| c402878262 | |||
| b8cbec9462 | |||
| 3d60c3af49 | |||
| 551198b6ec | |||
| 11395d8e5f | |||
| 5c89478ecb | |||
| f0a8133b94 | |||
| 83bdcdad1f | |||
| f1b5a457df | |||
| 8d00a6b2a3 | |||
| 8823392846 | |||
| 70f1faa312 | |||
| 61f95bf59b | |||
| 992dfe39fb | |||
| 964a95d934 | |||
| 2f1df92dc3 | |||
| 71d128a325 | |||
| 1c5aa8ce28 | |||
| 5dab6ef30b | |||
| 473dafbb58 | |||
| 6020248afc | |||
| 2c119e900c | |||
| 9f08024514 | |||
| 6e1c6fbc49 | |||
| a8212404ba | |||
| 5399c89d8e | |||
| 52e8e68cfc | |||
| b3e5d2924a | |||
| 2161a5d36d | |||
| 4a482adefe | |||
| 3c23dfd792 | |||
| d644e150ec | |||
| ceda3f8427 | |||
| 6ae2e60b33 | |||
| 56f86b1303 | |||
| e62774bf9a | |||
| c97253cb5f | |||
| 285992d137 | |||
| 67f137927d | |||
| f96025ae38 | |||
| 166b46f6a3 | |||
| 304ad35f29 | |||
| 8d8b41253e | |||
| 46ad5920de | |||
| 03c824a1c9 | |||
| 7f3fae5da7 | |||
| a9a51a76c7 | |||
| d887e9fe6a | |||
| 1a14eeb39e | |||
| c68e1494ac | |||
| ad0b3d4c28 | |||
| 785641cc47 | |||
| ae40f36853 | |||
| 2cada0fcbe | |||
| 1f45a3aa9f | |||
| 2a917ec091 | |||
| bad5f32ffc | |||
| b006fff6ed | |||
| 35f5a362e3 | |||
| 8924b2ca7a | |||
| 46de4000a1 | |||
| aea09998f9 | |||
| 80c001ba9c | |||
| eebf08217c | |||
| 44ca1ebc9a | |||
| 6854f5c8d3 | |||
| a362d5a977 | |||
| d2aef5df04 | |||
| 87992a36e1 | |||
| 2c6ef0dffe | |||
| a94670d6ca | |||
| 9d876b44cf | |||
| 32af01c8f4 | |||
| 803f7f43b4 | |||
| 2260303876 | |||
| 943058b84a | |||
| 4f8f4fe9b8 | |||
| 92aa223f3f | |||
| 4dafe15386 | |||
| 5e70d2ec36 | |||
| f7f84ef28a | |||
| 1f7ce33643 | |||
| 22a03ff3df | |||
| a256aec1cc | |||
| 8da1ab2413 | |||
| 6b6ab9e406 | |||
| a2c35ba83d | |||
| dfb8757719 | |||
| 65d68a3116 | |||
| 13d709c88d | |||
| 31bbd5295e | |||
| 270bccc432 | |||
| 4915b3c62c | |||
| 8d8f9c166e | |||
| 6be7f3e81b | |||
| a635360c95 | |||
| 2d32a5e0de | |||
| 3cd37c2be6 | |||
| dc63f1c735 | |||
| 94462015f2 | |||
| 689cce246a | |||
| 5d3ed34a31 | |||
| 8099ff0fa9 | |||
| c0fd38b03b | |||
| ab1fd89026 | |||
| b1d357956c | |||
| 045269d88f | |||
| c456045381 | |||
| 54a44991fd | |||
| 975adba203 | |||
| 0d8091b41a | |||
| 41db19ec01 | |||
| 00be8908ef | |||
| 7c5263415f | |||
| d93da5abd9 | |||
| 08a7dd9e85 | |||
| 7476f8a8e9 | |||
| 0c04c845b4 | |||
| b4448df047 | |||
| 74502510db | |||
| c5d94eff03 | |||
| 01501b36b5 | |||
| 5e5913255c | |||
| b1cf4dc592 | |||
| ec53815bb0 | |||
| 01c91a6398 | |||
| 6d1c72718b | |||
| 768d936ba9 | |||
| ef8220c236 | |||
| 47a4403cbe | |||
| 09e0187a7d | |||
| 9d4fea4407 | |||
| df508335a0 | |||
| 6900433496 | |||
| fc5f68bd7c | |||
| e9ee41e1a1 | |||
| e1a63b6da5 | |||
| 45a84a65ec | |||
| 8550612a8b | |||
| cc02e89e1b | |||
| ec808c68f5 | |||
| 644d94ed22 | |||
| b7d50de7d1 | |||
| 6a53aaf010 | |||
| edaab02d0b | |||
| 7a03474d07 | |||
| c810f6165f | |||
| 23673ba60c | |||
| 065be00d43 | |||
| da29b194a7 | |||
| 010a69f7ad | |||
| 242bae10d1 | |||
| b44f79ab60 | |||
| 4f5d817789 | |||
| fd13769010 | |||
| fb94e1cf6c | |||
| b03d539578 | |||
| 9f4582bf27 | |||
| 3a79251b91 | |||
| b4bc39f0d9 | |||
| 2526ac32fa | |||
| fc71dea8e9 | |||
| 27b51e7ede | |||
| 5511d6339e | |||
| 79a4ad8cfd | |||
| a23325584b | |||
| 61cdb2fada | |||
| 8b96163e37 | |||
| d84e246b23 | |||
| 3dd7da5a39 | |||
| 260e29989c | |||
| a08cc44cd0 | |||
| 98cc35e614 | |||
| b5e4b7db86 | |||
| a10a9a2255 | |||
| 18f5bcd62f | |||
| c2cbbba637 | |||
| 8e9b9c54fd | |||
| f0a7af4af1 | |||
| 2c262f27ad | |||
| a4819c4016 | |||
| 52e7166177 | |||
| 581f7fcbf3 | |||
| 65da0b877b | |||
| 06e8dc21fa | |||
| 03c07cf969 | |||
| a52aac876a | |||
| 32d8f8b648 | |||
| bfeb41fea9 | |||
| fb118d88f1 | |||
| aacce0b453 | |||
| cee382651b | |||
| 64633a1d63 | |||
| 63e5880154 | |||
| 5e383cb7b5 | |||
| 163af3b269 | |||
| c1bfa55ea6 | |||
| 5ffcc21917 | |||
| 790b69d0a6 | |||
| 313e07de43 | |||
| 7b27009d31 | |||
| 6b318f94fd | |||
| 7da1b40a5c | |||
| d90a98c1ef | |||
| 8a174711f4 | |||
| 48f386546e | |||
| 24d7912f1f | |||
| 090868b299 | |||
| 6dbfda36ee | |||
| 4c6315f2a5 | |||
| e2cdbb7580 | |||
| 13abd86be0 | |||
| 8364b00d3f | |||
| 274e4fdcce | |||
| 5354d3b9dc | |||
| 560f58a7b3 | |||
| b3697c1e21 | |||
| 051b61b2e8 | |||
| fc229fb645 | |||
| 93517d90ec | |||
| 0611e373b8 | |||
| cadaf368ef | |||
| ddcd9cb0c1 | |||
| d00158fa38 | |||
| 4a6dfc9a2a | |||
| e0829ffecf | |||
| 02ce0c993d | |||
| ac3eaea3f6 | |||
| 891af745bb | |||
| 3e49e78dfe | |||
| c67dcb1d5c | |||
| 0208edb9ed | |||
| 7f966b0a24 | |||
| b6f398bd2b | |||
| cb096a1d9b | |||
| 9913ff67ca | |||
| 9f4b274985 | |||
| 6903ccb3a6 | |||
| 020fbf33e5 | |||
| a7b8cc6307 | |||
| 1e5edd1c4c | |||
| faafc8fdfc | |||
| 75543f9bcf | |||
| 5f158137dd | |||
| e7f281a03d | |||
| 6813b42ae1 | |||
| b20d78c102 | |||
| ec3087efc4 | |||
| bf04562180 | |||
| 2faec8513f | |||
| a8b732abb9 | |||
| fbf90b4efc | |||
| 34aa515344 | |||
| 35f8379d65 | |||
| 9d752286f4 | |||
| 6b854cc9ad | |||
| 58e11f12e1 | |||
| 850c44b12a | |||
| d6a37cbd6b | |||
| f2dee26cdb | |||
| 2ee115a47d | |||
| 849c0be13d | |||
| 9a51c7a3b6 | |||
| e9e083d9ee | |||
| bb871a32fd | |||
| 04811681a3 | |||
| ec3f4cf121 | |||
| e2060a1460 | |||
| 4a70ba0134 | |||
| 630fda3c45 | |||
| 04762b3f7e | |||
| 00b48695f6 | |||
| e996557b51 | |||
| e5faf00df9 | |||
| 4beca9497b | |||
| 049c3918a4 | |||
| d71286b265 | |||
| 80eb9aa036 | |||
| 70813984be | |||
| f904ca8f11 | |||
| 068c347178 | |||
| c9f5b2a330 | |||
| 529dc52823 | |||
| b4b4c82e59 | |||
| 276e7ee729 | |||
| 808dfe7d31 | |||
| 88b800415c | |||
| 1679b6b406 | |||
| 748cc495be | |||
| c3ad6ae8cb | |||
| da44e67d65 | |||
| 70be5ae184 | |||
| fe260a6a06 | |||
| 631afde7b6 | |||
| 7a6e4d5f2c | |||
| 8683273022 | |||
| 2c9f691d8e | |||
| 398a804b41 | |||
| 79ffa3e29a | |||
| db0319bfba | |||
| 747ad313e6 | |||
| 4f5b7be7b8 | |||
| e3b9576a2d | |||
| 0dcd74388f | |||
| 302f99172f | |||
| 05adb5ee84 | |||
| 013f63b52f | |||
| 640c28a260 | |||
| 2c06dfb553 | |||
| 63ae52d99c | |||
| 03026a84c7 | |||
| fd33e4c3d4 | |||
| 4606b3980c | |||
| be6affb2c6 | |||
| b75fc89011 | |||
| 5849309dad | |||
| 02dd9aca32 | |||
| 4c4905e60b | |||
| c63251b832 | |||
| 808ade6e8d | |||
| 73fb523b3d | |||
| 0c56b55c2a | |||
| e66b56af58 | |||
| a718aa9c69 | |||
| 49749b3f59 | |||
| 045c6bfc9f | |||
| 91a6f20dba | |||
| 4eb5c97725 | |||
| 978b230f00 | |||
| 9d2632106c | |||
| dd73415c00 | |||
| f0635ba323 | |||
| 38205b3b97 | |||
| ae7306a3ef | |||
| 5448216e7a | |||
| 4f111a710d | |||
| f5df39a971 | |||
| 1866257ff5 | |||
| 8d9fbbf7e9 | |||
| bcd87dfa6d | |||
| 653aca500f | |||
| ca36fd35a6 | |||
| 260b2ad5c9 | |||
| 230413a5cc | |||
| d9618472cb | |||
| 9d96789302 | |||
| 0a69979417 | |||
| ce21c72f37 | |||
| b4ade5e956 | |||
| c79f387af2 | |||
| 9171a62979 | |||
| 793704c111 | |||
| 0cb5c8ca94 | |||
| ca5f50586b | |||
| 6f09c10bd7 | |||
| 8205f33ec6 | |||
| 5360c577af | |||
| ea48fcac64 | |||
| fbc639030a | |||
| eef042b469 | |||
| d34bf1ee7d | |||
| 6987f4be83 | |||
| 1b443af123 | |||
| aa100c2383 | |||
| e3541d78ce | |||
| c0b973370c | |||
| 129419df9d | |||
| ac635c4b38 | |||
| f05f7168ac | |||
| 21a5c25760 | |||
| 756b44db5e | |||
| 38538ca358 | |||
| e22b019147 | |||
| 39fab36541 | |||
| b96a1dcefc | |||
| 4ab56202f0 | |||
| 9baa6e3c85 | |||
| 300b4582ec | |||
| 3cdd9b6af2 | |||
| 355d71769a | |||
| 851f785f50 | |||
| c462dbb745 | |||
| 5706fea2eb | |||
| c403951050 | |||
| 214e425796 | |||
| 2ea2c037e8 | |||
| a20ed9c876 | |||
| d995cc01bc | |||
| 3643693bde | |||
| 928c3ea3c2 | |||
| 779b07b1b5 | |||
| 2aea40d26f | |||
| 7a2a05063b | |||
| fa58ac7419 | |||
| 44ad83790d | |||
| 48ede05926 | |||
| 50ef2e83ce | |||
| 1be72c87f2 | |||
| 961b76fd1e | |||
| bc6a82a7fe | |||
| 1ac81b8f17 | |||
| 79e556ac80 | |||
| 50fdea4095 |
@@ -126,6 +126,15 @@ csharp_style_deconstructed_variable_declaration = true:suggestion
|
||||
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
|
||||
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
|
||||
|
||||
|
||||
dotnet_diagnostic.CS1570.severity = none
|
||||
dotnet_diagnostic.CS1587.severity = none
|
||||
dotnet_diagnostic.CS8619.severity = none
|
||||
dotnet_diagnostic.CS8620.severity = none
|
||||
dotnet_diagnostic.CS8632.severity = none
|
||||
dotnet_diagnostic.CS8604.severity = none
|
||||
dotnet_diagnostic.CS1998.severity = none
|
||||
|
||||
[*.vb]
|
||||
#### 命名样式 ####
|
||||
|
||||
|
||||
@@ -11,25 +11,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IRaCIS.Core.Application", "
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IRaCIS.Core.Domain.Share", "IRaCIS.Core.Domain.Share\IRaCIS.Core.Domain.Share.csproj", "{7CBC76F5-3817-46B7-8D9D-79253A89B578}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IRaCIS.JWT.RS256", "ZhiZhunAuthenticationCenter\IRaCIS.JWT.RS256.csproj", "{3EF210EE-D5D1-4C93-A8FA-E0DB1852BD39}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IRaCIS.Core.Test", "IRaCIS.Core.Test\IRaCIS.Core.Test.csproj", "{3292B2B4-6E8A-43AA-84C0-AB4A391E8A2A}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IRaCIS.Core.Infra.EFCore", "IRaCIS.Core.Infra.EFCore\IRaCIS.Core.Infra.EFCore.csproj", "{6D8115E5-84D6-424B-8F8D-0C2D40347A8C}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IRaCIS.Core.Infrastructure", "IRaCIS.Core.Infrastructure\IRaCIS.Core.Infrastructure.csproj", "{07EED0F8-08E6-46F3-ACBE-17BC1391BD4C}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IRaCIS.AuthenticationCenter", "IRaCIS.AuthenticationCenter", "{481329D6-B8A0-491F-A398-1DF66A0FBB62}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IRaCIS.Core.IdentityServer4", "IRaCIS.Core.IdentityServer4\IRaCIS.Core.IdentityServer4.csproj", "{C3DD48CF-B8B3-40F6-9BDB-B7C7F0851674}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IRaCIS.Core.IdentityServer4.MVC", "IRaCIS.Core.IdentityServer4.MVC\IRaCIS.Core.IdentityServer4.MVC.csproj", "{F621ADD6-94E8-4A4B-998E-25B8EF15D39C}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F852ABFB-88AC-48BE-B876-2228BE2373D6}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.editorconfig = .editorconfig
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -52,10 +39,6 @@ Global
|
||||
{7CBC76F5-3817-46B7-8D9D-79253A89B578}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7CBC76F5-3817-46B7-8D9D-79253A89B578}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7CBC76F5-3817-46B7-8D9D-79253A89B578}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{3EF210EE-D5D1-4C93-A8FA-E0DB1852BD39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3EF210EE-D5D1-4C93-A8FA-E0DB1852BD39}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3EF210EE-D5D1-4C93-A8FA-E0DB1852BD39}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3EF210EE-D5D1-4C93-A8FA-E0DB1852BD39}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{3292B2B4-6E8A-43AA-84C0-AB4A391E8A2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3292B2B4-6E8A-43AA-84C0-AB4A391E8A2A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3292B2B4-6E8A-43AA-84C0-AB4A391E8A2A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
@@ -68,23 +51,10 @@ Global
|
||||
{07EED0F8-08E6-46F3-ACBE-17BC1391BD4C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{07EED0F8-08E6-46F3-ACBE-17BC1391BD4C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{07EED0F8-08E6-46F3-ACBE-17BC1391BD4C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C3DD48CF-B8B3-40F6-9BDB-B7C7F0851674}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C3DD48CF-B8B3-40F6-9BDB-B7C7F0851674}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C3DD48CF-B8B3-40F6-9BDB-B7C7F0851674}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C3DD48CF-B8B3-40F6-9BDB-B7C7F0851674}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F621ADD6-94E8-4A4B-998E-25B8EF15D39C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F621ADD6-94E8-4A4B-998E-25B8EF15D39C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F621ADD6-94E8-4A4B-998E-25B8EF15D39C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F621ADD6-94E8-4A4B-998E-25B8EF15D39C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{3EF210EE-D5D1-4C93-A8FA-E0DB1852BD39} = {481329D6-B8A0-491F-A398-1DF66A0FBB62}
|
||||
{C3DD48CF-B8B3-40F6-9BDB-B7C7F0851674} = {481329D6-B8A0-491F-A398-1DF66A0FBB62}
|
||||
{F621ADD6-94E8-4A4B-998E-25B8EF15D39C} = {481329D6-B8A0-491F-A398-1DF66A0FBB62}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {BCC2EB19-3914-489B-B1D7-B7303E0218A3}
|
||||
EndGlobalSection
|
||||
|
||||
@@ -11,10 +11,13 @@ using MassTransit;
|
||||
using MassTransit.NewIdProviders;
|
||||
using System.IO;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace IRaCIS.Core.API
|
||||
{
|
||||
public class Program
|
||||
public class Program1
|
||||
{
|
||||
public readonly string environment;
|
||||
public static async Task Main(string[] args)
|
||||
@@ -51,29 +54,32 @@ namespace IRaCIS.Core.API
|
||||
})
|
||||
.Build();
|
||||
|
||||
|
||||
//// Serilog
|
||||
SerilogExtension.AddSerilogSetup(enviromentName, host.Services);
|
||||
|
||||
Log.Logger.Warning($"µ±Ç°»·¾³£º{enviromentName}");
|
||||
|
||||
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
Log.Logger.Warning($"当前部署平台环境:windows");
|
||||
}
|
||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||
{
|
||||
Log.Logger.Warning($"当前部署平台环境:linux");
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Logger.Warning($"当前部署平台环境:OSX or FreeBSD");
|
||||
}
|
||||
|
||||
NewId.SetProcessIdProvider(new CurrentProcessIdProvider());
|
||||
|
||||
|
||||
//缓存项目的状态 匿名化数据
|
||||
await InitCache(host);
|
||||
|
||||
WatchJsonFile(Path.Combine(AppContext.BaseDirectory, StaticData.Folder.Resources, StaticData.En_US_Json) );
|
||||
|
||||
WatchJsonFile(Path.Combine(AppContext.BaseDirectory, StaticData.Folder.Resources, StaticData.Zh_CN_Json));
|
||||
|
||||
|
||||
|
||||
|
||||
host.Run();
|
||||
|
||||
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -100,58 +106,7 @@ namespace IRaCIS.Core.API
|
||||
webBuilder.UseStartup<Startup>();
|
||||
}).UseSerilog()
|
||||
.UseServiceProviderFactory(new AutofacServiceProviderFactory());
|
||||
|
||||
|
||||
private static async Task InitCache(IHost host)
|
||||
{
|
||||
var _mediator = host.Services.GetService(typeof(IMediator)) as IMediator;
|
||||
|
||||
await _mediator.Send(new AnonymizeCacheRequest());
|
||||
|
||||
await _mediator.Send(new TrialStateCacheRequest());
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static void LoadJsonFile(string filePath)
|
||||
{
|
||||
|
||||
IConfigurationBuilder builder = new ConfigurationBuilder()
|
||||
.AddJsonFile(filePath);
|
||||
|
||||
IConfigurationRoot enConfiguration = builder.Build();
|
||||
|
||||
|
||||
|
||||
foreach (IConfigurationSection section in enConfiguration.GetChildren())
|
||||
{
|
||||
if (filePath.Contains(StaticData.En_US_Json) )
|
||||
{
|
||||
StaticData.En_US_Dic[section.Key] = section.Value;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
StaticData.Zh_CN_Dic[section.Key] = section.Value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
public static void WatchJsonFile(string filePath)
|
||||
{
|
||||
LoadJsonFile(filePath);
|
||||
|
||||
|
||||
FileSystemWatcher watcher = new FileSystemWatcher(Path.GetDirectoryName(filePath), Path.GetFileName(filePath));
|
||||
watcher.Changed += (sender, e) => LoadJsonFile(filePath);
|
||||
watcher.EnableRaisingEvents = true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,8 @@ using Invio.Extensions.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.AspNetCore.StaticFiles;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Application.Services.BackGroundJob;
|
||||
|
||||
namespace IRaCIS.Core.API
|
||||
{
|
||||
@@ -69,6 +71,8 @@ namespace IRaCIS.Core.API
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
//½¡¿µ¼ì²é
|
||||
services.AddHealthChecks();
|
||||
//本地化
|
||||
services.AddJsonLocalization(options => options.ResourcesPath = "Resources");
|
||||
|
||||
@@ -91,7 +95,8 @@ namespace IRaCIS.Core.API
|
||||
|
||||
services.AddOptions().Configure<SystemEmailSendConfig>( _configuration.GetSection("SystemEmailSendConfig"));
|
||||
services.AddOptions().Configure<ServiceVerifyConfigOption>(_configuration.GetSection("BasicSystemConfig"));
|
||||
|
||||
services.AddOptions().Configure<AliyunOSSOptions>(_configuration.GetSection("AliyunOSS"));
|
||||
services.AddOptions().Configure<ObjectStoreServiceOptions>(_configuration.GetSection("ObjectStoreService"));
|
||||
|
||||
|
||||
//动态WebApi + UnifiedApiResultFilter 省掉控制器代码
|
||||
@@ -106,17 +111,18 @@ namespace IRaCIS.Core.API
|
||||
services.AddSwaggerSetup();
|
||||
//JWT Token 验证
|
||||
services.AddJWTAuthSetup(_configuration);
|
||||
|
||||
|
||||
// MediatR 进程内消息 事件解耦 从程序集中 注册命令和handler对应关系
|
||||
services.AddMediatR(typeof(ConsistencyVerificationHandler).Assembly);
|
||||
services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining<ConsistencyVerificationHandler>());
|
||||
// EasyCaching 缓存
|
||||
services.AddEasyCachingSetup();
|
||||
services.AddEasyCachingSetup(_configuration);
|
||||
|
||||
//services.AddDistributedMemoryCache();
|
||||
|
||||
// hangfire 定时任务框架 有界面,更友好~
|
||||
services.AddhangfireSetup(_configuration);
|
||||
// QuartZ 定时任务框架 使用了hangfire 暂时不用,后续需要可以打开,已经配好
|
||||
services.AddQuartZSetup(_configuration);
|
||||
|
||||
|
||||
// 保护上传文件
|
||||
//services.AddStaticFileAuthorizationSetup();
|
||||
@@ -136,7 +142,7 @@ namespace IRaCIS.Core.API
|
||||
//IP 限流 可设置白名单 或者黑名单
|
||||
//services.AddIpPolicyRateLimitSetup(_configuration);
|
||||
// 用户类型 策略授权
|
||||
services.AddAuthorizationPolicySetup(_configuration);
|
||||
//services.AddAuthorizationPolicySetup(_configuration);
|
||||
|
||||
services.AddJsonConfigSetup(_configuration);
|
||||
//转发头设置 获取真实IP
|
||||
@@ -161,8 +167,10 @@ namespace IRaCIS.Core.API
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
public async void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
|
||||
|
||||
//本地化
|
||||
app.UseLocalization();
|
||||
|
||||
@@ -176,6 +184,7 @@ namespace IRaCIS.Core.API
|
||||
//不需要 token 访问的静态文件 wwwroot css, JavaScript, and images don't require authentication.
|
||||
app.UseStaticFiles();
|
||||
|
||||
app.UseMiddleware<MultiDiskStaticFilesMiddleware>();
|
||||
|
||||
//LogDashboard
|
||||
app.UseLogDashboard("/LogDashboard");
|
||||
@@ -183,8 +192,7 @@ namespace IRaCIS.Core.API
|
||||
//hangfire
|
||||
app.UseHangfireConfig(env);
|
||||
|
||||
////暂时废弃
|
||||
//app.UseHttpReports();
|
||||
|
||||
|
||||
////限流 中间件
|
||||
//app.UseIpRateLimiting();
|
||||
@@ -201,7 +209,6 @@ namespace IRaCIS.Core.API
|
||||
}
|
||||
Console.WriteLine("当前环境: " + env.EnvironmentName);
|
||||
|
||||
//app.UseMiddleware<AuthMiddleware>();
|
||||
|
||||
// 特殊异常处理 比如 404
|
||||
app.UseStatusCodePagesWithReExecute("/Error/{0}");
|
||||
@@ -218,23 +225,27 @@ namespace IRaCIS.Core.API
|
||||
app.UseCors(t => t.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
|
||||
|
||||
//app.UseIRacisHostStaticFileStore(env);
|
||||
app.UseMiddleware<MultiDiskStaticFilesMiddleware>();
|
||||
|
||||
|
||||
|
||||
|
||||
app.UseAuthentication();
|
||||
//app.UseJwtBearerQueryString();
|
||||
app.UseAuthorization();
|
||||
|
||||
////文件伺服 必须带Token 访问
|
||||
////app.UseIRacisHostStaticFileStore(env);
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
|
||||
endpoints.MapHub<UploadHub>("/UploadHub");
|
||||
|
||||
endpoints.MapHealthChecks("/health");
|
||||
});
|
||||
|
||||
var hangfireJobService = app.ApplicationServices.GetRequiredService<IIRaCISHangfireJob>();
|
||||
|
||||
await hangfireJobService.InitHangfireJobTaskAsync();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,231 +0,0 @@
|
||||
//using Autofac;
|
||||
//using Autofac.Extensions.DependencyInjection;
|
||||
//using IRaCIS.Core.API;
|
||||
//using IRaCIS.Core.Application.Filter;
|
||||
//using IRaCIS.Core.Application.MediatR.Handlers;
|
||||
//using LogDashboard;
|
||||
//using MassTransit;
|
||||
//using MassTransit.NewIdProviders;
|
||||
//using MediatR;
|
||||
//using Microsoft.AspNetCore.Builder;
|
||||
//using Microsoft.AspNetCore.Http.Features;
|
||||
//using Microsoft.AspNetCore.HttpOverrides;
|
||||
//using Microsoft.AspNetCore.SignalR;
|
||||
//using Microsoft.Extensions.Configuration;
|
||||
//using Microsoft.Extensions.DependencyInjection;
|
||||
//using Microsoft.Extensions.Hosting;
|
||||
//using Serilog;
|
||||
//using System;
|
||||
|
||||
//var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
|
||||
// //以配置文件为准,否则 从url中取环境值(服务以命令行传递参数启动,配置文件配置了就不需要传递环境参数)
|
||||
// var config = new ConfigurationBuilder()
|
||||
// .AddEnvironmentVariables()
|
||||
// .Build();
|
||||
|
||||
// var enviromentName = config["ASPNETCORE_ENVIRONMENT"];
|
||||
|
||||
// if (string.IsNullOrWhiteSpace(enviromentName))
|
||||
// {
|
||||
|
||||
// var index = Array.IndexOf(args, "--env");
|
||||
// enviromentName = index > -1
|
||||
// ? args[index + 1]
|
||||
// : "Development";
|
||||
// }
|
||||
|
||||
|
||||
// NewId.SetProcessIdProvider(new CurrentProcessIdProvider());
|
||||
|
||||
|
||||
|
||||
|
||||
//builder.Host.UseServiceProviderFactory(new AutofacServiceProviderFactory())
|
||||
// .ConfigureContainer<ContainerBuilder>(containerBuilder =>
|
||||
// {
|
||||
// containerBuilder.RegisterModule<AutofacModuleSetup>();
|
||||
// })
|
||||
// .UseWindowsService().UseSerilog();
|
||||
|
||||
|
||||
|
||||
//// Add services to the container.
|
||||
|
||||
////本地化
|
||||
//builder.Services.AddJsonLocalization(options => options.ResourcesPath = "Resources");
|
||||
|
||||
//// 异常、参数统一验证过滤器、Json序列化配置、字符串参数绑型统一Trim()
|
||||
//builder.Services.AddControllers(options =>
|
||||
//{
|
||||
// //options.Filters.Add<LogActionFilter>();
|
||||
// options.Filters.Add<ModelActionFilter>();
|
||||
// options.Filters.Add<ProjectExceptionFilter>();
|
||||
// //options.Filters.Add<UnitOfWorkFilter>();
|
||||
|
||||
// //if (_configuration.GetSection("BasicSystemConfig").GetValue<bool>("OpenLoginLimit"))
|
||||
// //{
|
||||
// // options.Filters.Add<LimitUserRequestAuthorization>();
|
||||
|
||||
// //}
|
||||
|
||||
|
||||
//}).AddNewtonsoftJsonSetup(); // NewtonsoftJson 序列化 处理
|
||||
|
||||
////动态WebApi + UnifiedApiResultFilter 省掉控制器代码
|
||||
//builder.Services.AddDynamicWebApiSetup();
|
||||
////AutoMapper
|
||||
//builder.Services.AddAutoMapperSetup();
|
||||
////EF ORM QueryWithNoLock
|
||||
//builder.Services.AddEFSetup(builder.Configuration);
|
||||
////Http 响应压缩
|
||||
//builder.Services.AddResponseCompressionSetup();
|
||||
////Swagger Api 文档
|
||||
//builder.Services.AddSwaggerSetup();
|
||||
////JWT Token 验证
|
||||
//builder.Services.AddJWTAuthSetup(builder.Configuration);
|
||||
//// MediatR 进程内消息 事件解耦 从程序集中 注册命令和handler对应关系
|
||||
//builder.Services.AddMediatR(typeof(ConsistencyVerificationHandler).Assembly);
|
||||
//// EasyCaching 缓存
|
||||
//builder.Services.AddEasyCachingSetup();
|
||||
|
||||
////services.AddDistributedMemoryCache();
|
||||
|
||||
////// hangfire 定时任务框架 有界面,更友好~
|
||||
//builder.Services.AddhangfireSetup(builder.Configuration);
|
||||
////// QuartZ 定时任务框架 使用了hangfire 暂时不用,后续需要可以打开,已经配好
|
||||
////builder.Services.AddQuartZSetup(_configuration);
|
||||
|
||||
//// 保护上传文件
|
||||
////services.AddStaticFileAuthorizationSetup();
|
||||
|
||||
|
||||
//////HttpReports 暂时废弃
|
||||
////services.AddHttpReports().AddHttpTransport();
|
||||
////Serilog 日志可视化 LogDashboard日志
|
||||
//builder.Services.AddLogDashboardSetup();
|
||||
////上传限制 配置
|
||||
//builder.Services.Configure<FormOptions>(options =>
|
||||
//{
|
||||
// options.MultipartBodyLengthLimit = int.MaxValue;
|
||||
// options.ValueCountLimit = int.MaxValue;
|
||||
// options.ValueLengthLimit = int.MaxValue;
|
||||
//});
|
||||
////IP 限流 可设置白名单 或者黑名单
|
||||
////services.AddIpPolicyRateLimitSetup(_configuration);
|
||||
////用户类型 策略授权
|
||||
//builder.Services.AddAuthorizationPolicySetup(builder.Configuration);
|
||||
|
||||
//builder.Services.AddJsonConfigSetup(builder.Configuration);
|
||||
|
||||
////转发头设置 获取真实IP
|
||||
//builder.Services.Configure<ForwardedHeadersOptions>(options =>
|
||||
//{
|
||||
// options.ForwardedHeaders =
|
||||
// ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
||||
//});
|
||||
////Dicom影像渲染图片 跨平台
|
||||
//builder.Services.AddDicomSetup();
|
||||
|
||||
//// 实时应用
|
||||
//builder.Services.AddSignalR();
|
||||
|
||||
|
||||
//builder.Services.AddSingleton<IUserIdProvider, IRaCISUserIdProvider>();
|
||||
|
||||
//builder.Services.AddControllers();
|
||||
//// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
////builder.Services.AddEndpointsApiExplorer();
|
||||
////builder.Services.AddSwaggerGen();
|
||||
|
||||
////SerilogExtension.AddSerilogSetup(enviromentName, builder.Host.confi);
|
||||
|
||||
|
||||
//var app = builder.Build();
|
||||
|
||||
//// Configure the HTTP request pipeline.
|
||||
|
||||
////本地化
|
||||
//app.UseLocalization();
|
||||
|
||||
//app.UseForwardedHeaders();
|
||||
|
||||
|
||||
////不需要 token 访问的静态文件 wwwroot css, JavaScript, and images don't require authentication.
|
||||
//app.UseStaticFiles();
|
||||
|
||||
//app.UseIRacisHostStaticFileStore(app.Environment);
|
||||
|
||||
////LogDashboard
|
||||
//app.UseLogDashboard("/LogDashboard");
|
||||
|
||||
////hangfire
|
||||
////app.UseHangfireConfig(app.Environment);
|
||||
|
||||
//////暂时废弃
|
||||
////app.UseHttpReports();
|
||||
|
||||
//////限流 中间件
|
||||
////app.UseIpRateLimiting();
|
||||
|
||||
////响应压缩
|
||||
//app.UseResponseCompression();
|
||||
|
||||
//if (app.Environment.IsDevelopment())
|
||||
//{
|
||||
// app.UseDeveloperExceptionPage();
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
|
||||
// //app.UseHsts();
|
||||
//}
|
||||
|
||||
//SwaggerSetup.Configure(app, app.Environment);
|
||||
|
||||
//Console.WriteLine("当前环境: " + builder.Environment.EnvironmentName);
|
||||
|
||||
////app.UseMiddleware<AuthMiddleware>();
|
||||
|
||||
//// 特殊异常处理 比如 404
|
||||
//app.UseStatusCodePagesWithReExecute("/Error/{0}");
|
||||
|
||||
|
||||
|
||||
|
||||
//////serilog 记录请求的用户信息
|
||||
//app.UseSerilogConfig(app.Environment);
|
||||
|
||||
//app.UseRouting();
|
||||
|
||||
//app.UseCors(t => t.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
|
||||
|
||||
|
||||
//app.UseAuthentication();
|
||||
////app.UseJwtBearerQueryString();
|
||||
//app.UseAuthorization();
|
||||
|
||||
//////文件伺服 必须带Token 访问
|
||||
//////app.UseIRacisHostStaticFileStore(env);
|
||||
|
||||
|
||||
|
||||
////app.UseEndpoints(endpoints =>
|
||||
////{
|
||||
|
||||
|
||||
//// endpoints.MapControllers();
|
||||
|
||||
//// endpoints.MapHub<UploadHub>("/UploadHub")/*.RequireCors(t=>t.WithOrigins(new string[] {"null"}).AllowAnyMethod().AllowAnyHeader().AllowCredentials())*/;
|
||||
////});
|
||||
|
||||
|
||||
|
||||
//app.MapControllers();
|
||||
//app.MapHub<UploadHub>("/UploadHub")/*.RequireCors(t=>t.WithOrigins(new string[] {"null"}).AllowAnyMethod().AllowAnyHeader().AllowCredentials())*/;
|
||||
|
||||
|
||||
//app.Run();
|
||||
|
||||
//测试同步
|
||||
@@ -1,106 +0,0 @@
|
||||
{
|
||||
"needAnonymizeTag": [
|
||||
{ //PatientsName
|
||||
"Group": "0010",
|
||||
"Element": "0010",
|
||||
"ReplaceValue": "",
|
||||
"Enable": true
|
||||
},
|
||||
{ // PatientID
|
||||
"Group": "0010",
|
||||
"Element": "0020",
|
||||
"ReplaceValue": "",
|
||||
"Enable": true
|
||||
},
|
||||
{ // IssuerOfPatientID
|
||||
"Group": "0010",
|
||||
"Element": "0021",
|
||||
"ReplaceValue": "",
|
||||
"Enable": true
|
||||
},
|
||||
{ // PatientsBirthDate
|
||||
"Group": "0010",
|
||||
"Element": "0030",
|
||||
"ReplaceValue": "",
|
||||
"Enable": true
|
||||
},
|
||||
{ // PatientsBirthTime
|
||||
"Group": "0010",
|
||||
"Element": "0032",
|
||||
"ReplaceValue": "",
|
||||
"Enable": false
|
||||
},
|
||||
{ // PatientsSex
|
||||
"Group": "0010",
|
||||
"Element": "0040",
|
||||
"ReplaceValue": "",
|
||||
"Enable": false
|
||||
},
|
||||
{ // OtherPatientIDs
|
||||
"Group": "0010",
|
||||
"Element": "1000",
|
||||
"ReplaceValue": "",
|
||||
"Enable": false
|
||||
},
|
||||
{ // OtherPatientNames
|
||||
"Group": "0010",
|
||||
"Element": "1001",
|
||||
"ReplaceValue": "",
|
||||
"Enable": false
|
||||
},
|
||||
{ // OtherPatientNames
|
||||
"Group": "0010",
|
||||
"Element": "1005",
|
||||
"ReplaceValue": "",
|
||||
"Enable": true
|
||||
},
|
||||
{ // PatientBirthName
|
||||
"Group": "0010",
|
||||
"Element": "1005",
|
||||
"ReplaceValue": "",
|
||||
"Enable": true
|
||||
},
|
||||
{ // PatientsAge
|
||||
"Group": "0010",
|
||||
"Element": "1010",
|
||||
"ReplaceValue": "",
|
||||
"Enable": true
|
||||
},
|
||||
{ // PatientsAddress
|
||||
"Group": "0010",
|
||||
"Element": "1040",
|
||||
"ReplaceValue": "",
|
||||
"Enable": true
|
||||
},
|
||||
{ // PatientsMothersBirthName
|
||||
"Group": "0010",
|
||||
"Element": "1060",
|
||||
"ReplaceValue": "",
|
||||
"Enable": true
|
||||
},
|
||||
{
|
||||
"Group": "0010",
|
||||
"Element": "2150",
|
||||
"ReplaceValue": "",
|
||||
"Enable": true
|
||||
},
|
||||
{
|
||||
"Group": "0010",
|
||||
"Element": "2152",
|
||||
"ReplaceValue": "",
|
||||
"Enable": true
|
||||
},
|
||||
{
|
||||
"Group": "0010",
|
||||
"Element": "2154",
|
||||
"ReplaceValue": "",
|
||||
"Enable": true
|
||||
},
|
||||
{
|
||||
"Group": "0012",
|
||||
"Element": "0040",
|
||||
"ReplaceValue": "XXX",
|
||||
"Enable": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,9 +1,6 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using EasyCaching.Core;
|
||||
using gRPC.ZHiZHUN.AuthServer.protos;
|
||||
using Grpc.Net.Client;
|
||||
using Grpc.Net.Client.Configuration;
|
||||
using IRaCIS.Application.Interfaces;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Auth;
|
||||
@@ -24,6 +21,13 @@ using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using System.Linq;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MassTransit;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Aliyun.Acs.Core.Profile;
|
||||
using Aliyun.Acs.Core.Auth.Sts;
|
||||
using Aliyun.Acs.Core;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace IRaCIS.Api.Controllers
|
||||
{
|
||||
@@ -93,6 +97,7 @@ namespace IRaCIS.Api.Controllers
|
||||
[FromServices] ITokenService _tokenService, [FromServices] IConfiguration configuration)
|
||||
{
|
||||
|
||||
|
||||
var returnModel = await _userService.Login(loginUser.UserName, loginUser.Password);
|
||||
|
||||
if (returnModel.IsSuccess)
|
||||
@@ -160,6 +165,17 @@ namespace IRaCIS.Api.Controllers
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
var userId = returnModel.Data.BasicInfo.Id.ToString();
|
||||
@@ -190,7 +206,106 @@ namespace IRaCIS.Api.Controllers
|
||||
return ResponseOutput.Ok("/showdicom?studyId=f7b67793-8155-0223-2f15-118f2642efb8&type=Share&token=" + token);
|
||||
}
|
||||
|
||||
[HttpGet("user/GetObjectStoreToken")]
|
||||
public IResponseOutput GetObjectStoreToken([FromServices] IOptionsMonitor<ObjectStoreServiceOptions> options)
|
||||
{
|
||||
var serviceOption = options.CurrentValue;
|
||||
|
||||
if (Enum.TryParse<ObjectStoreUse>(serviceOption.ObjectStoreUse, out var parsedEnum) && parsedEnum == ObjectStoreUse.AliyunOSS)
|
||||
{
|
||||
|
||||
var ossOptions = serviceOption.AliyunOSS;
|
||||
|
||||
return ResponseOutput.Ok(new ObjectStoreDTO() { ObjectStoreUse = serviceOption.ObjectStoreUse, MinIO = serviceOption.MinIO ,AliyunOSS= serviceOption.AliyunOSS });
|
||||
|
||||
#region 临时token 屏蔽
|
||||
//IClientProfile profile = DefaultProfile.GetProfile(ossOptions.RegionId, ossOptions.AccessKeyId, ossOptions.AccessKeySecret);
|
||||
//DefaultAcsClient client = new DefaultAcsClient(profile);
|
||||
|
||||
|
||||
//// 创建一个STS请求
|
||||
//AssumeRoleRequest request = new AssumeRoleRequest
|
||||
//{
|
||||
// RoleArn = ossOptions.RoleArn, // 角色ARN,需要替换为你的角色ARN
|
||||
// RoleSessionName = $"session-name-{NewId.NextGuid()}", // 角色会话名称,可自定义
|
||||
// DurationSeconds = 900, // 令牌有效期(单位:秒),这里设置为1小时
|
||||
//};
|
||||
|
||||
|
||||
//AssumeRoleResponse response = client.GetAcsResponse(request);
|
||||
|
||||
//// 返回STS令牌信息给前端
|
||||
//var stsToken = new ObjectStoreDTO()
|
||||
//{
|
||||
// ObjectStoreUse = serviceOption.ObjectStoreUse,
|
||||
// AliyunOSS = new AliyunOSSTempToken()
|
||||
// {
|
||||
// AccessKeyId = response.Credentials.AccessKeyId,
|
||||
// AccessKeySecret = response.Credentials.AccessKeySecret,
|
||||
// SecurityToken = response.Credentials.SecurityToken,
|
||||
// Expiration = response.Credentials.Expiration,
|
||||
|
||||
// Region = ossOptions.Region,
|
||||
// BucketName = ossOptions.BucketName,
|
||||
// ViewEndpoint = ossOptions.ViewEndpoint,
|
||||
|
||||
// },
|
||||
// MinIO = serviceOption.MinIO
|
||||
//};
|
||||
//return ResponseOutput.Ok(stsToken);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
else if(Enum.TryParse<ObjectStoreUse>(serviceOption.ObjectStoreUse, out var parsedValue) && parsedValue == ObjectStoreUse.MinIO)
|
||||
{
|
||||
return ResponseOutput.Ok(new ObjectStoreDTO() { ObjectStoreUse=serviceOption.ObjectStoreUse,MinIO=serviceOption.MinIO});
|
||||
}
|
||||
else
|
||||
{
|
||||
return ResponseOutput.Ok(new ObjectStoreDTO() { ObjectStoreUse = serviceOption.ObjectStoreUse, MinIO = serviceOption.MinIO });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[HttpGet("user/GenerateSTS")]
|
||||
public IResponseOutput GenerateSTS([FromServices]IOptionsMonitor<AliyunOSSOptions> options )
|
||||
{
|
||||
var ossOptions = options.CurrentValue;
|
||||
|
||||
|
||||
IClientProfile profile = DefaultProfile.GetProfile(ossOptions.regionId, ossOptions.accessKeyId, ossOptions.accessKeySecret);
|
||||
DefaultAcsClient client = new DefaultAcsClient(profile);
|
||||
|
||||
|
||||
// 创建一个STS请求
|
||||
AssumeRoleRequest request = new AssumeRoleRequest
|
||||
{
|
||||
RoleArn = ossOptions.roleArn, // 角色ARN,需要替换为你的角色ARN
|
||||
RoleSessionName = $"session-name-{NewId.NextGuid()}", // 角色会话名称,可自定义
|
||||
DurationSeconds = 900, // 令牌有效期(单位:秒),这里设置为1小时
|
||||
};
|
||||
|
||||
|
||||
AssumeRoleResponse response = client.GetAcsResponse(request);
|
||||
|
||||
// 返回STS令牌信息给前端
|
||||
var stsToken = new
|
||||
{
|
||||
AccessKeyId = response.Credentials.AccessKeyId,
|
||||
AccessKeySecret = response.Credentials.AccessKeySecret,
|
||||
SecurityToken = response.Credentials.SecurityToken,
|
||||
Expiration = response.Credentials.Expiration,
|
||||
|
||||
Region = ossOptions.region ,
|
||||
BucketName = ossOptions.bucketName ,
|
||||
ViewEndpoint = ossOptions.viewEndpoint ,
|
||||
|
||||
};
|
||||
|
||||
return ResponseOutput.Ok(stsToken);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -205,6 +320,8 @@ namespace IRaCIS.Api.Controllers
|
||||
|
||||
var token = decodeUrl.Substring(decodeUrl.IndexOf("access_token=") + "access_token=".Length);
|
||||
|
||||
var lang = decodeUrl.Substring(decodeUrl.IndexOf("lang=") + "lang=".Length, 2);
|
||||
|
||||
var domainStrList = decodeUrl.Split("/").ToList().Take(3).ToList();
|
||||
|
||||
var errorUrl = domainStrList[0]+"//"+ domainStrList[2]+ "/error";
|
||||
@@ -212,7 +329,7 @@ namespace IRaCIS.Api.Controllers
|
||||
|
||||
if (!await _userRepository.AnyAsync(t => t.Id == Guid.Parse(userId) && t.EmailToken == token && t.IsFirstAdd))
|
||||
{
|
||||
decodeUrl = errorUrl+ $"?ErrorMessage={System.Web.HttpUtility.UrlEncode("您的初始化链接已过期")} ";
|
||||
decodeUrl = errorUrl+ $"?lang={lang}&ErrorMessage={System.Web.HttpUtility.UrlEncode(lang=="zh"? "您的初始化链接已过期": "Error!The initialization link has expired. Return")} ";
|
||||
}
|
||||
|
||||
return Redirect(decodeUrl);
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace IRaCIS.Core.API.Controllers.Special
|
||||
/// <param name="param"></param>
|
||||
/// <returns>新记录Id</returns>
|
||||
[HttpPost, Route("trial/addOrUpdateTrial")]
|
||||
[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
||||
//[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
||||
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AddOrUpdateTrial", "BeforeOngoingCantOpt", "AfterStopCannNotOpt" })]
|
||||
public async Task<IResponseOutput<Trial>> AddOrUpdateTrial(TrialCommand param)
|
||||
|
||||
@@ -11,6 +11,7 @@ using IRaCIS.Core.Application.Service;
|
||||
using IRaCIS.Core.Application.Service.Inspection.DTO;
|
||||
using IRaCIS.Core.Application.Service.Inspection.Interface;
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using IRaCIS.Core.Application.Service.Reading.Interface;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
@@ -36,6 +37,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||
private readonly IHttpContextAccessor _httpContext;
|
||||
private readonly ITrialConfigService _trialConfigService;
|
||||
private readonly INoneDicomStudyService _noneDicomStudyService;
|
||||
private readonly IClinicalAnswerService _clinicalAnswerService;
|
||||
private readonly ISubjectService _subjectService;
|
||||
private readonly IReadingClinicalDataService _readingClinicalDataService;
|
||||
private readonly ISubjectVisitService _subjectVisitService;
|
||||
@@ -62,6 +64,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||
IReadingMedicineQuestionService readingMedicineQuestionService,
|
||||
ITrialConfigService _trialConfigService,
|
||||
INoneDicomStudyService noneDicomStudyService,
|
||||
IClinicalAnswerService clinicalAnswerService,
|
||||
ISubjectService _subjectService,
|
||||
IReadingClinicalDataService _readingClinicalDataService,
|
||||
ISubjectVisitService subjectVisitService,
|
||||
@@ -82,6 +85,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||
this._httpContext = httpContext;
|
||||
this._trialConfigService = _trialConfigService;
|
||||
this._noneDicomStudyService = noneDicomStudyService;
|
||||
this._clinicalAnswerService = clinicalAnswerService;
|
||||
this._subjectService = _subjectService;
|
||||
this._readingClinicalDataService = _readingClinicalDataService;
|
||||
this._subjectVisitService = subjectVisitService;
|
||||
@@ -233,6 +237,94 @@ namespace IRaCIS.Core.API.Controllers
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// CRC签名临床数据
|
||||
/// </summary>
|
||||
/// <param name="opt"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Inspection/ClinicalAnswer/CRCSignClinicalData")]
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> CRCSignClinicalData(DataInspectionDto<CRCSignClinicalDataInDto> opt)
|
||||
{
|
||||
var singid = await _inspectionService.RecordSing(opt.SignInfo);
|
||||
var result = await _clinicalAnswerService.CRCSignClinicalData(opt.Data);
|
||||
await _inspectionService.CompletedSign(singid, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// CRC确认临床数据
|
||||
/// </summary>
|
||||
/// <param name="opt"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Inspection/ClinicalAnswer/CRCConfirmClinical")]
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> CRCConfirmClinical(DataInspectionDto<CRCConfirmClinicalInDto> opt)
|
||||
{
|
||||
var singid = await _inspectionService.RecordSing(opt.SignInfo);
|
||||
var result = await _clinicalAnswerService.CRCConfirmClinical(opt.Data);
|
||||
await _inspectionService.CompletedSign(singid, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// CRC撤销临床数据
|
||||
/// </summary>
|
||||
/// <param name="opt"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Inspection/ClinicalAnswer/CRCCancelConfirmClinical")]
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> CRCCancelConfirmClinical(DataInspectionDto<CRCCancelConfirmClinicalInDto> opt)
|
||||
{
|
||||
var singid = await _inspectionService.RecordSing(opt.SignInfo);
|
||||
var result = await _clinicalAnswerService.CRCCancelConfirmClinical(opt.Data);
|
||||
await _inspectionService.CompletedSign(singid, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// PM确认临床数据
|
||||
/// </summary>
|
||||
/// <param name="opt"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Inspection/ClinicalAnswer/PMConfirmClinical")]
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> PMConfirmClinical(DataInspectionDto<CRCConfirmClinicalInDto> opt)
|
||||
{
|
||||
var singid = await _inspectionService.RecordSing(opt.SignInfo);
|
||||
var result = await _clinicalAnswerService.PMConfirmClinical(opt.Data);
|
||||
await _inspectionService.CompletedSign(singid, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 提交结构化录入并签名
|
||||
/// </summary>
|
||||
/// <param name="opt"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Inspection/ClinicalAnswer/SubmitClinicalFormAndSign")]
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> SubmitClinicalFormAndSign(DataInspectionDto<SubmitClinicalFormInDto> opt)
|
||||
{
|
||||
var singid = await _inspectionService.RecordSing(opt.SignInfo);
|
||||
var result = await _clinicalAnswerService.SubmitClinicalForm(opt.Data);
|
||||
await _inspectionService.CompletedSign(singid, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 提交阅片裁判问题
|
||||
/// </summary>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,16 +1,16 @@
|
||||
// 使用的是proto3版本
|
||||
// 使用的是proto3版本
|
||||
syntax = "proto3";
|
||||
// 定义命名空间,后续生成代码时就会生成对应的命名空间
|
||||
// 定义命名空间,后续生成代码时就会生成对应的命名空间
|
||||
option csharp_namespace = "gRPC.ZHiZHUN.AuthServer.protos";
|
||||
|
||||
/*
|
||||
每一句需要用分号结尾
|
||||
message 用来定义请求和返回数据格式
|
||||
tag message后面的值数字代表是字段的标识(tag),不是赋值,
|
||||
每一句需要用分号结尾
|
||||
message 用来定义请求和返回数据格式
|
||||
tag message后面的值数字代表是字段的标识(tag),不是赋值,
|
||||
*/
|
||||
|
||||
|
||||
// 新增用户时需要传递数据消息, 可理解为一个类
|
||||
// 新增用户时需要传递数据消息, 可理解为一个类
|
||||
message GetTokenReuqest{
|
||||
string id=1;
|
||||
string userName=2;
|
||||
@@ -22,48 +22,48 @@ message GetTokenReuqest{
|
||||
|
||||
}
|
||||
|
||||
// 新增时返回的消息格式
|
||||
// 新增时返回的消息格式
|
||||
message GetTokenResponse {
|
||||
int32 code=1;
|
||||
string token =2;
|
||||
}
|
||||
|
||||
|
||||
// service 用标识定义服务的,里面写对应的方法
|
||||
// service 用标识定义服务的,里面写对应的方法
|
||||
service TokenGrpcService{
|
||||
// 获取token
|
||||
// 获取token
|
||||
rpc GetUserToken(GetTokenReuqest) returns (GetTokenResponse);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
// 新增用户时需要传递数据消息, 可理解为一个类
|
||||
// 新增用户时需要传递数据消息, 可理解为一个类
|
||||
message AddUserReuqest{
|
||||
string name=1;
|
||||
int32 age=2;
|
||||
bool isBoy=3;
|
||||
}
|
||||
// 新增时返回的消息格式
|
||||
// 新增时返回的消息格式
|
||||
message ResultResponse {
|
||||
int32 code=1;
|
||||
string msg =2;
|
||||
}
|
||||
//传递的查询条件信息格式,可理解为平时传入的查询条件对象
|
||||
//传递的查询条件信息格式,可理解为平时传入的查询条件对象
|
||||
message QueryUserReuqest{
|
||||
string name=1;
|
||||
}
|
||||
//查询返回的用户信息格式,可理解为返回的类
|
||||
//查询返回的用户信息格式,可理解为返回的类
|
||||
message UserInfoResponse {
|
||||
string name=1;
|
||||
int32 age=2;
|
||||
string gender=3;
|
||||
}
|
||||
|
||||
// service 用标识定义服务的,里面写对应的方法
|
||||
// service 用标识定义服务的,里面写对应的方法
|
||||
service UserService{
|
||||
// 新增用户
|
||||
// 新增用户
|
||||
rpc AddUser(AddUserReuqest) returns (ResultResponse);
|
||||
// 查询用户
|
||||
// 查询用户
|
||||
rpc GetAllUser(QueryUserReuqest) returns (UserInfoResponse);
|
||||
}
|
||||
*/
|
||||
|
||||
Binary file not shown.
@@ -14,7 +14,7 @@
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DocumentationFile>.\IRaCIS.Core.API.xml</DocumentationFile>
|
||||
<NoWarn>1701;1702;1591;</NoWarn>
|
||||
<NoWarn>1701;1702;1591;1570;</NoWarn>
|
||||
<OutputPath>..\bin\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -24,12 +24,7 @@
|
||||
<NoWarn>1701;1702;1591</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="wwwroot\**" />
|
||||
<EmbeddedResource Remove="UploadFile\**" />
|
||||
<EmbeddedResource Remove="wwwroot\**" />
|
||||
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<Content Remove="web.config" />
|
||||
@@ -66,31 +61,27 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AspNetCoreRateLimit" Version="4.0.2" />
|
||||
<PackageReference Include="aliyun-net-sdk-sts" Version="3.1.2" />
|
||||
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
|
||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
|
||||
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.0" />
|
||||
<PackageReference Include="EasyCaching.InMemory" Version="1.7.0" />
|
||||
<PackageReference Include="EasyCaching.Interceptor.Castle" Version="1.7.0" />
|
||||
<PackageReference Include="EntityFrameworkCore.Triggered.Extensions" Version="3.2.1" />
|
||||
<PackageReference Include="Google.Protobuf" Version="3.21.8" />
|
||||
<PackageReference Include="Grpc.Net.Client" Version="2.49.0" />
|
||||
<PackageReference Include="Grpc.Tools" Version="2.50.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Hangfire.Tags.SqlServer" Version="1.8.1" />
|
||||
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
|
||||
<PackageReference Include="EasyCaching.Interceptor.Castle" Version="1.9.2" />
|
||||
<PackageReference Include="EasyCaching.Serialization.MessagePack" Version="1.9.2">
|
||||
<TreatAsUsed>true</TreatAsUsed>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.6" />
|
||||
<PackageReference Include="Hangfire.Dashboard.BasicAuthorization" Version="1.0.2" />
|
||||
<PackageReference Include="Hangfire.SqlServer" Version="1.8.6" />
|
||||
<PackageReference Include="Invio.Extensions.Authentication.JwtBearer" Version="2.0.1" />
|
||||
<PackageReference Include="LogDashboard" Version="1.4.8" />
|
||||
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="11.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.10" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.10" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="6.0.1" />
|
||||
<PackageReference Include="Serilog.Enrichers.ClientInfo" Version="1.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="8.0.0" />
|
||||
<PackageReference Include="Serilog.Enrichers.ClientInfo" Version="2.0.3" />
|
||||
<PackageReference Include="Serilog.Sinks.Email" Version="2.4.0" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.4.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -103,9 +94,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Update="NLog.config">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\EmailTemplate\AdminAddUser_US.html">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
@@ -115,12 +103,6 @@
|
||||
<Content Update="wwwroot\EmailTemplate\AdminResetUser.html">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\EmailTemplate\EmailConfigTest_US.html">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\EmailTemplate\EmailConfigTest.html">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\EmailTemplate\SubjectEnrollConfirmOrPDProgress_US.html">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
@@ -172,7 +154,7 @@
|
||||
<Folder Include="Properties\PublishProfiles\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ProjectExtensions><VisualStudio><UserProperties anonymizetagsetting_1json__JsonSchema="http://json.schemastore.org/jovo-language-model" properties_4launchsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>
|
||||
<ProjectExtensions><VisualStudio><UserProperties properties_4launchsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>
|
||||
|
||||
|
||||
</Project>
|
||||
|
||||
+104
-246
@@ -4,34 +4,6 @@
|
||||
<name>IRaCIS.Core.API</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="M:EasyCaching.Demo.Interceptors.Controllers.ErrorController.Error(System.Int32)">
|
||||
<summary>
|
||||
主要处理 前端404等错误 全局业务异常已统一处理了,非业务错误会来到这里
|
||||
</summary>
|
||||
<param name="code"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Api.Controllers.ExtraController">
|
||||
<summary>
|
||||
医生基本信息 、工作信息 专业信息、审核状态
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Api.Controllers.ExtraController.GetDoctorDetail(IRaCIS.Application.Interfaces.IAttachmentService,IRaCIS.Application.Interfaces.IDoctorService,IRaCIS.Application.Interfaces.IEducationService,IRaCIS.Application.Interfaces.ITrialExperienceService,IRaCIS.Application.Interfaces.IResearchPublicationService,IRaCIS.Application.Interfaces.IVacationService,System.Guid)">
|
||||
<summary>
|
||||
获取医生详情
|
||||
</summary>
|
||||
<param name="attachmentService"></param>
|
||||
<param name="_doctorService"></param>
|
||||
<param name="_educationService"></param>
|
||||
<param name="_trialExperienceService"></param>
|
||||
<param name="_researchPublicationService"></param>
|
||||
<param name="_vacationService"></param>
|
||||
<param name="doctorId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Api.Controllers.ExtraController.Login(IRaCIS.Application.Contracts.UserLoginDTO,EasyCaching.Core.IEasyCachingProvider,IRaCIS.Application.Services.IUserService,IRaCIS.Core.Application.Auth.ITokenService,Microsoft.Extensions.Configuration.IConfiguration)">
|
||||
<summary> 系统用户登录接口[New] </summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.Special.FinancialChangeController.AddOrUpdateTrialInspection(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Application.Contracts.TrialCommand})">
|
||||
<summary> 添加实验项目-返回新增Id[AUTH]</summary>
|
||||
<returns>新记录Id</returns>
|
||||
@@ -139,6 +111,41 @@
|
||||
<param name="opt"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.CRCSignClinicalData(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Service.Reading.Dto.CRCSignClinicalDataInDto})">
|
||||
<summary>
|
||||
CRC签名临床数据
|
||||
</summary>
|
||||
<param name="opt"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.CRCConfirmClinical(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Service.Reading.Dto.CRCConfirmClinicalInDto})">
|
||||
<summary>
|
||||
CRC确认临床数据
|
||||
</summary>
|
||||
<param name="opt"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.CRCCancelConfirmClinical(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Service.Reading.Dto.CRCCancelConfirmClinicalInDto})">
|
||||
<summary>
|
||||
CRC撤销临床数据
|
||||
</summary>
|
||||
<param name="opt"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.PMConfirmClinical(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Service.Reading.Dto.CRCConfirmClinicalInDto})">
|
||||
<summary>
|
||||
PM确认临床数据
|
||||
</summary>
|
||||
<param name="opt"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.SubmitClinicalFormAndSign(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Service.Reading.Dto.SubmitClinicalFormInDto})">
|
||||
<summary>
|
||||
提交结构化录入并签名
|
||||
</summary>
|
||||
<param name="opt"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.SubmitJudgeVisitTaskResult(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Service.Reading.Dto.SaveJudgeVisitTaskResult})">
|
||||
<summary>
|
||||
提交阅片裁判问题
|
||||
@@ -233,95 +240,49 @@
|
||||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.ArchiveStudyNew(System.Guid,System.Guid,System.String,System.Nullable{System.Guid},System.Guid,Microsoft.Extensions.Logging.ILogger{IRaCIS.Core.API.Controllers.UploadDownLoadController},EasyCaching.Core.IEasyCachingProvider,IRaCIS.Core.Application.Contracts.IStudyService,Microsoft.AspNetCore.SignalR.IHubContext{IRaCIS.Core.API.UploadHub,IRaCIS.Core.API.IUploadClient},IRaCIS.Core.Application.Contracts.Dicom.IDicomArchiveService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.StudyMonitor})">
|
||||
<summary>Dicom 归档</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadVisitClinicalData(System.Guid)">
|
||||
<summary>
|
||||
上传临床数据 多文件
|
||||
</summary>
|
||||
<param name="subjectVisitId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadClinicalTemplate(System.Nullable{System.Guid})">
|
||||
<summary>
|
||||
上传临床数据模板
|
||||
</summary>
|
||||
<param name="trialId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadReadClinicalData(System.Guid,System.Guid,System.Guid)">
|
||||
<summary>
|
||||
上传阅片临床数据
|
||||
</summary>
|
||||
<param name="trialId"></param>
|
||||
<param name="subjectId"></param>
|
||||
<param name="readingId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadPrintscreen(System.Guid)">
|
||||
<summary>
|
||||
上传截图
|
||||
</summary>
|
||||
<param name="subjectId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadReadingAnswerImage(System.Guid,System.Guid)">
|
||||
<summary>
|
||||
上传Reading问题的图像
|
||||
</summary>
|
||||
<param name="trialId"></param>
|
||||
<param name="visitTaskId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadJudgeTaskImage(System.Guid,System.Guid)">
|
||||
<summary>
|
||||
上传裁判任务的图像
|
||||
</summary>
|
||||
<param name="trialId"></param>
|
||||
<param name="visitTaskId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadMedicalReviewImage(System.Guid,System.Guid)">
|
||||
<summary>
|
||||
上传医学审核图片
|
||||
</summary>
|
||||
<param name="trialId"></param>
|
||||
<param name="taskMedicalReviewId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadNoneDicomFile(Microsoft.AspNetCore.Http.IFormCollection,System.Guid,System.Guid,System.Guid,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudy},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.StudyMonitor})">
|
||||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadNoneDicomFile(IRaCIS.Core.API.Controllers.StudyController.UploadNoneDicomFileCommand,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudy},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.StudyMonitor})">
|
||||
<summary>
|
||||
上传非Dicom 文件 支持压缩包 多文件上传
|
||||
</summary>
|
||||
<param name="formCollection"></param>
|
||||
<param name="subjectVisitId"></param>
|
||||
<param name="noneDicomStudyId"></param>
|
||||
<param name="studyMonitorId"></param>
|
||||
<param name="incommand"></param>
|
||||
<param name="_noneDicomStudyRepository"></param>
|
||||
<param name="_studyMonitorRepository"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadVisitCheckExcel(System.Guid)">
|
||||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadVisitCheckExcel(System.Guid,IRaCIS.Core.Application.Helper.IOSSService)">
|
||||
<summary>
|
||||
一致性核查 excel上传 支持三种格式
|
||||
</summary>
|
||||
<param name="trialId"></param>
|
||||
<param name="oSSService"></param>
|
||||
<returns></returns>
|
||||
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.API.Controllers.FileController">
|
||||
<summary>医生文件上传下载</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.FileController.UploadOrdinaryFile(System.String,System.Guid)">
|
||||
<member name="M:IRaCIS.Core.API.Controllers.FileController.GetOfficialResume(IRaCIS.Core.API.Controllers.GetDoctorPathCommand,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Attachment})">
|
||||
<summary>
|
||||
上传文件[FileUpload]
|
||||
New 医生首页 多选 获取多个医生信息+文件路径列表 医生压缩包名称 doctorCode + "_" + doctorName _(时间戳或者随机的Guid)
|
||||
</summary>
|
||||
<param name="attachmentType">附件类型</param>
|
||||
<param name="doctorId">医生Id</param>
|
||||
<returns>返回文件信息</returns>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.FileController.UploadNonDoctorFile(System.String)">
|
||||
<member name="M:IRaCIS.Core.API.Controllers.FileController.GetTrialDoctorOfficialResume(IRaCIS.Core.API.Controllers.GetDoctorPathCommand,IRaCIS.Application.Interfaces.IDoctorService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Attachment})">
|
||||
<summary>
|
||||
上传文件( 不是医生个人的文件)[FileUpload]
|
||||
例如:阅片章程等
|
||||
New 项目入组 勾选获取简历路径
|
||||
</summary>
|
||||
<param name="type">文件类型</param>
|
||||
<param name="command"></param>
|
||||
<param name="_doctorService"></param>
|
||||
<param name="_attachmentrepository"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.FileController.GetDoctorAttachment(IRaCIS.Core.API.Controllers.GetDoctoreAttachPathCommand,IRaCIS.Application.Interfaces.IDoctorService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Attachment})">
|
||||
<summary>
|
||||
new 医生详情 勾选或者下载文件路径
|
||||
</summary>
|
||||
<param name="command"></param>
|
||||
<param name="_doctorService"></param>
|
||||
<param name="_attachmentrepository"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.FileController.DownloadAttachment(System.Guid[])">
|
||||
@@ -331,14 +292,6 @@
|
||||
<param name="doctorIds"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.FileController.DownloadOfficialResume(System.Int32,System.Guid[])">
|
||||
<summary>
|
||||
下载医生官方简历
|
||||
</summary>
|
||||
<param name="language"></param>
|
||||
<param name="doctorIds"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.FileController.DownloadAttachmentById(System.Guid,System.Guid[])">
|
||||
<summary>
|
||||
下载指定医生的指定附件
|
||||
@@ -347,50 +300,35 @@
|
||||
<param name="attachmentIds">要下载的附件Id</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.UploadDownLoadController.LocalFilePreview(System.String)">
|
||||
<summary> 缩略图 </summary>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.FileController.DownloadOfficialResume(System.Int32,System.Guid[])">
|
||||
<summary>
|
||||
下载医生官方简历 首页 区分 中文和英文
|
||||
</summary>
|
||||
<param name="language"></param>
|
||||
<param name="doctorIds"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.FileController.DownloadResume(System.Int32,System.Guid,System.Guid[])">
|
||||
<summary>
|
||||
入组 项目下载简历
|
||||
</summary>
|
||||
<param name="language"></param>
|
||||
<param name="trialId"></param>
|
||||
<param name="doctorIdArray"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.UploadDownLoadController.DownloadCommonFile(System.String,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument})">
|
||||
<summary> 通用文件下载 </summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.UploadDownLoadController.DownloadTrialClinicalFile(System.Guid,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalDataTrialSet})">
|
||||
<summary>
|
||||
下载项目临床数据文件
|
||||
</summary>
|
||||
<param name="clinicalDataTrialSetId"></param>
|
||||
<param name="_clinicalDataTrialSetRepository"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.UploadDownLoadController.DownloadSystemClinicalFile(System.Guid,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalDataSystemSet})">
|
||||
<summary>
|
||||
下载系统临床数据文件
|
||||
</summary>
|
||||
<param name="clinicalDataSystemSetId"></param>
|
||||
<param name="_clinicalDataSystemSetRepository"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.UploadDownLoadController.UploadTrialDoc(System.Guid)">
|
||||
<summary>
|
||||
上传项目签名文档
|
||||
</summary>
|
||||
<param name="trialId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.UploadDownLoadController.UploadSysTemDoc">
|
||||
<summary>
|
||||
上传系统签名文档
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.UploadDownLoadController.UploadCommonDoc">
|
||||
<summary>
|
||||
上传通用文档 比如一致性核查的 比如导出的excel 模板
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.UploadDownLoadController.UploadSystemNoticeDoc">
|
||||
<member name="M:IRaCIS.Core.API.Controllers.UploadDownLoadController.Upload(IRaCIS.Core.API.Controllers.UploadDownLoadController.UploadFileType)">
|
||||
<summary>
|
||||
上传系统通知文档
|
||||
1:数据上传 2:导出、 3:邮件附件 4:邮件Html 通过 ----new
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
@@ -407,6 +345,27 @@
|
||||
<param name="memberSerialization">序列化成员</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Api.Controllers.ExtraController">
|
||||
<summary>
|
||||
医生基本信息 、工作信息 专业信息、审核状态
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Api.Controllers.ExtraController.GetDoctorDetail(IRaCIS.Application.Interfaces.IAttachmentService,IRaCIS.Application.Interfaces.IDoctorService,IRaCIS.Application.Interfaces.IEducationService,IRaCIS.Application.Interfaces.ITrialExperienceService,IRaCIS.Application.Interfaces.IResearchPublicationService,IRaCIS.Application.Interfaces.IVacationService,System.Guid)">
|
||||
<summary>
|
||||
获取医生详情
|
||||
</summary>
|
||||
<param name="attachmentService"></param>
|
||||
<param name="_doctorService"></param>
|
||||
<param name="_educationService"></param>
|
||||
<param name="_trialExperienceService"></param>
|
||||
<param name="_researchPublicationService"></param>
|
||||
<param name="_vacationService"></param>
|
||||
<param name="doctorId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Api.Controllers.ExtraController.Login(IRaCIS.Application.Contracts.UserLoginDTO,EasyCaching.Core.IEasyCachingProvider,IRaCIS.Application.Services.IUserService,IRaCIS.Core.Application.Auth.ITokenService,Microsoft.Extensions.Configuration.IConfiguration)">
|
||||
<summary> 系统用户登录接口[New] </summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.WX.CoreApi.Auth.AuthMiddleware.Invoke(Microsoft.AspNetCore.Http.HttpContext)">
|
||||
<summary>
|
||||
为了前端 一段时间无操作,需要重新登陆
|
||||
@@ -414,6 +373,13 @@
|
||||
<param name="httpContext"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:EasyCaching.Demo.Interceptors.Controllers.ErrorController.Error(System.Int32)">
|
||||
<summary>
|
||||
主要处理 前端404等错误 全局业务异常已统一处理了,非业务错误会来到这里
|
||||
</summary>
|
||||
<param name="code"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:ZhaoXi._001.NET5Demo.Practice.WebApi.Utility.Jwt.CustomHSJWTService">
|
||||
<summary>
|
||||
对称可逆加密
|
||||
@@ -449,113 +415,5 @@
|
||||
<param name="withPrivate"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:gRPC.ZHiZHUN.AuthServer.protos.GrpcTokenReflection">
|
||||
<summary>Holder for reflection information generated from Protos/GrpcToken.proto</summary>
|
||||
</member>
|
||||
<member name="P:gRPC.ZHiZHUN.AuthServer.protos.GrpcTokenReflection.Descriptor">
|
||||
<summary>File descriptor for Protos/GrpcToken.proto</summary>
|
||||
</member>
|
||||
<member name="T:gRPC.ZHiZHUN.AuthServer.protos.GetTokenReuqest">
|
||||
<summary>
|
||||
新增用户时需要传递数据消息, 可理解为一个类
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:gRPC.ZHiZHUN.AuthServer.protos.GetTokenReuqest.IdFieldNumber">
|
||||
<summary>Field number for the "id" field.</summary>
|
||||
</member>
|
||||
<member name="F:gRPC.ZHiZHUN.AuthServer.protos.GetTokenReuqest.UserNameFieldNumber">
|
||||
<summary>Field number for the "userName" field.</summary>
|
||||
</member>
|
||||
<member name="F:gRPC.ZHiZHUN.AuthServer.protos.GetTokenReuqest.RealNameFieldNumber">
|
||||
<summary>Field number for the "realName" field.</summary>
|
||||
</member>
|
||||
<member name="F:gRPC.ZHiZHUN.AuthServer.protos.GetTokenReuqest.ReviewerCodeFieldNumber">
|
||||
<summary>Field number for the "reviewerCode" field.</summary>
|
||||
</member>
|
||||
<member name="F:gRPC.ZHiZHUN.AuthServer.protos.GetTokenReuqest.UserTypeEnumIntFieldNumber">
|
||||
<summary>Field number for the "userTypeEnumInt" field.</summary>
|
||||
</member>
|
||||
<member name="F:gRPC.ZHiZHUN.AuthServer.protos.GetTokenReuqest.UserTypeShortNameFieldNumber">
|
||||
<summary>Field number for the "userTypeShortName" field.</summary>
|
||||
</member>
|
||||
<member name="F:gRPC.ZHiZHUN.AuthServer.protos.GetTokenReuqest.IsAdminFieldNumber">
|
||||
<summary>Field number for the "isAdmin" field.</summary>
|
||||
</member>
|
||||
<member name="T:gRPC.ZHiZHUN.AuthServer.protos.GetTokenResponse">
|
||||
<summary>
|
||||
新增时返回的消息格式
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:gRPC.ZHiZHUN.AuthServer.protos.GetTokenResponse.CodeFieldNumber">
|
||||
<summary>Field number for the "code" field.</summary>
|
||||
</member>
|
||||
<member name="F:gRPC.ZHiZHUN.AuthServer.protos.GetTokenResponse.TokenFieldNumber">
|
||||
<summary>Field number for the "token" field.</summary>
|
||||
</member>
|
||||
<member name="T:gRPC.ZHiZHUN.AuthServer.protos.TokenGrpcService">
|
||||
<summary>
|
||||
service 用标识定义服务的,里面写对应的方法
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:gRPC.ZHiZHUN.AuthServer.protos.TokenGrpcService.Descriptor">
|
||||
<summary>Service descriptor</summary>
|
||||
</member>
|
||||
<member name="T:gRPC.ZHiZHUN.AuthServer.protos.TokenGrpcService.TokenGrpcServiceClient">
|
||||
<summary>Client for TokenGrpcService</summary>
|
||||
</member>
|
||||
<member name="M:gRPC.ZHiZHUN.AuthServer.protos.TokenGrpcService.TokenGrpcServiceClient.#ctor(Grpc.Core.ChannelBase)">
|
||||
<summary>Creates a new client for TokenGrpcService</summary>
|
||||
<param name="channel">The channel to use to make remote calls.</param>
|
||||
</member>
|
||||
<member name="M:gRPC.ZHiZHUN.AuthServer.protos.TokenGrpcService.TokenGrpcServiceClient.#ctor(Grpc.Core.CallInvoker)">
|
||||
<summary>Creates a new client for TokenGrpcService that uses a custom <c>CallInvoker</c>.</summary>
|
||||
<param name="callInvoker">The callInvoker to use to make remote calls.</param>
|
||||
</member>
|
||||
<member name="M:gRPC.ZHiZHUN.AuthServer.protos.TokenGrpcService.TokenGrpcServiceClient.#ctor">
|
||||
<summary>Protected parameterless constructor to allow creation of test doubles.</summary>
|
||||
</member>
|
||||
<member name="M:gRPC.ZHiZHUN.AuthServer.protos.TokenGrpcService.TokenGrpcServiceClient.#ctor(Grpc.Core.ClientBase.ClientBaseConfiguration)">
|
||||
<summary>Protected constructor to allow creation of configured clients.</summary>
|
||||
<param name="configuration">The client configuration.</param>
|
||||
</member>
|
||||
<member name="M:gRPC.ZHiZHUN.AuthServer.protos.TokenGrpcService.TokenGrpcServiceClient.GetUserToken(gRPC.ZHiZHUN.AuthServer.protos.GetTokenReuqest,Grpc.Core.Metadata,System.Nullable{System.DateTime},System.Threading.CancellationToken)">
|
||||
<summary>
|
||||
获取token
|
||||
</summary>
|
||||
<param name="request">The request to send to the server.</param>
|
||||
<param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
|
||||
<param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
|
||||
<param name="cancellationToken">An optional token for canceling the call.</param>
|
||||
<returns>The response received from the server.</returns>
|
||||
</member>
|
||||
<member name="M:gRPC.ZHiZHUN.AuthServer.protos.TokenGrpcService.TokenGrpcServiceClient.GetUserToken(gRPC.ZHiZHUN.AuthServer.protos.GetTokenReuqest,Grpc.Core.CallOptions)">
|
||||
<summary>
|
||||
获取token
|
||||
</summary>
|
||||
<param name="request">The request to send to the server.</param>
|
||||
<param name="options">The options for the call.</param>
|
||||
<returns>The response received from the server.</returns>
|
||||
</member>
|
||||
<member name="M:gRPC.ZHiZHUN.AuthServer.protos.TokenGrpcService.TokenGrpcServiceClient.GetUserTokenAsync(gRPC.ZHiZHUN.AuthServer.protos.GetTokenReuqest,Grpc.Core.Metadata,System.Nullable{System.DateTime},System.Threading.CancellationToken)">
|
||||
<summary>
|
||||
获取token
|
||||
</summary>
|
||||
<param name="request">The request to send to the server.</param>
|
||||
<param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
|
||||
<param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
|
||||
<param name="cancellationToken">An optional token for canceling the call.</param>
|
||||
<returns>The call object.</returns>
|
||||
</member>
|
||||
<member name="M:gRPC.ZHiZHUN.AuthServer.protos.TokenGrpcService.TokenGrpcServiceClient.GetUserTokenAsync(gRPC.ZHiZHUN.AuthServer.protos.GetTokenReuqest,Grpc.Core.CallOptions)">
|
||||
<summary>
|
||||
获取token
|
||||
</summary>
|
||||
<param name="request">The request to send to the server.</param>
|
||||
<param name="options">The options for the call.</param>
|
||||
<returns>The call object.</returns>
|
||||
</member>
|
||||
<member name="M:gRPC.ZHiZHUN.AuthServer.protos.TokenGrpcService.TokenGrpcServiceClient.NewInstance(Grpc.Core.ClientBase.ClientBaseConfiguration)">
|
||||
<summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
autoReload="true"
|
||||
throwExceptions="false"
|
||||
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log">
|
||||
<variable name="myvar" value="myvalue"/>
|
||||
|
||||
<targets>
|
||||
|
||||
<target xsi:type="file" name="File" fileName="${basedir}/logs/${shortdate}/${level}.log"
|
||||
layout="${longdate}||${level}||${logger}||${message}||${exception:format=ToString:innerFormat=ToString:maxInnerExceptionLevel=10:separator=\r\n}||end" />
|
||||
</targets>
|
||||
|
||||
<rules>
|
||||
<logger name="*" minlevel="Debug" writeTo="file" />
|
||||
</rules>
|
||||
</nlog>
|
||||
@@ -0,0 +1,314 @@
|
||||
using System;
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Serilog;
|
||||
using MediatR;
|
||||
using IRaCIS.Core.Application.MediatR.Handlers;
|
||||
using System.Threading.Tasks;
|
||||
using MassTransit;
|
||||
using MassTransit.NewIdProviders;
|
||||
using System.IO;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using System.Runtime.InteropServices;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using IRaCIS.Core.API;
|
||||
using Autofac;
|
||||
using Microsoft.AspNetCore.Http.Features;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
using IRaCIS.Application.Services.BackGroundJob;
|
||||
using LogDashboard;
|
||||
using OfficeOpenXml.Utils;
|
||||
|
||||
|
||||
|
||||
#region 获取环境变量
|
||||
//以配置文件为准,否则 从url中取环境值(服务以命令行传递参数启动,配置文件配置了就不需要传递环境参数)
|
||||
var config = new ConfigurationBuilder()
|
||||
.AddEnvironmentVariables()
|
||||
.Build();
|
||||
|
||||
var enviromentName = config["ASPNETCORE_ENVIRONMENT"];
|
||||
|
||||
if (string.IsNullOrWhiteSpace(enviromentName))
|
||||
{
|
||||
|
||||
var index = Array.IndexOf(args, "--env");
|
||||
enviromentName = index > -1
|
||||
? args[index + 1]
|
||||
: "Development";
|
||||
}
|
||||
#endregion
|
||||
|
||||
var builder = WebApplication.CreateBuilder(new WebApplicationOptions
|
||||
{
|
||||
EnvironmentName = enviromentName
|
||||
});
|
||||
|
||||
#region 兼容windows 服务命令行的方式
|
||||
|
||||
//foreach (var arg in args)
|
||||
//{
|
||||
// Console.WriteLine(arg);
|
||||
//}
|
||||
|
||||
int urlsIndex = Array.FindIndex(args, arg => arg != null && arg.StartsWith("--urls"));
|
||||
|
||||
if (urlsIndex > -1)
|
||||
{
|
||||
var url = args[urlsIndex].Substring("--urls=".Length);
|
||||
Console.WriteLine(url);
|
||||
builder.WebHost.UseUrls(url);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 主机配置
|
||||
|
||||
|
||||
NewId.SetProcessIdProvider(new CurrentProcessIdProvider());
|
||||
|
||||
|
||||
|
||||
builder.Host
|
||||
.ConfigureAppConfiguration((hostContext, config) =>
|
||||
{
|
||||
|
||||
//Console.WriteLine(hostContext.HostingEnvironment.EnvironmentName);
|
||||
config.AddJsonFile("appsettings.json", false, true)
|
||||
.AddJsonFile($"appsettings.{enviromentName}.json", false, true);
|
||||
})
|
||||
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
|
||||
.ConfigureContainer<ContainerBuilder>(containerBuilder =>
|
||||
{
|
||||
containerBuilder.RegisterModule<AutofacModuleSetup>();
|
||||
})
|
||||
.UseWindowsService().UseSerilog();
|
||||
#endregion
|
||||
|
||||
|
||||
#region 配置服务
|
||||
var _configuration = builder.Configuration;
|
||||
|
||||
//健康检查
|
||||
builder.Services.AddHealthChecks();
|
||||
//本地化
|
||||
builder.Services.AddJsonLocalization(options => options.ResourcesPath = "Resources");
|
||||
|
||||
// 异常、参数统一验证过滤器、Json序列化配置、字符串参数绑型统一Trim()
|
||||
builder.Services.AddControllers(options =>
|
||||
{
|
||||
//options.Filters.Add<LogActionFilter>();
|
||||
options.Filters.Add<ModelActionFilter>();
|
||||
options.Filters.Add<ProjectExceptionFilter>();
|
||||
options.Filters.Add<UnitOfWorkFilter>();
|
||||
|
||||
if (_configuration.GetSection("BasicSystemConfig").GetValue<bool>("OpenLoginLimit"))
|
||||
{
|
||||
options.Filters.Add<LimitUserRequestAuthorization>();
|
||||
}
|
||||
|
||||
})
|
||||
.AddNewtonsoftJsonSetup(); // NewtonsoftJson 序列化 处理
|
||||
|
||||
builder.Services.AddOptions().Configure<SystemEmailSendConfig>(_configuration.GetSection("SystemEmailSendConfig"));
|
||||
builder.Services.AddOptions().Configure<ServiceVerifyConfigOption>(_configuration.GetSection("BasicSystemConfig"));
|
||||
builder.Services.AddOptions().Configure<AliyunOSSOptions>(_configuration.GetSection("AliyunOSS"));
|
||||
builder.Services.AddOptions().Configure<ObjectStoreServiceOptions>(_configuration.GetSection("ObjectStoreService"));
|
||||
|
||||
|
||||
//动态WebApi + UnifiedApiResultFilter 省掉控制器代码
|
||||
builder.Services.AddDynamicWebApiSetup();
|
||||
//AutoMapper
|
||||
builder.Services.AddAutoMapperSetup();
|
||||
//EF ORM QueryWithNoLock
|
||||
builder.Services.AddEFSetup(_configuration);
|
||||
//Http 响应压缩
|
||||
builder.Services.AddResponseCompressionSetup();
|
||||
//Swagger Api 文档
|
||||
builder.Services.AddSwaggerSetup();
|
||||
//JWT Token 验证
|
||||
builder.Services.AddJWTAuthSetup(_configuration);
|
||||
|
||||
// MediatR 进程内消息 事件解耦 从程序集中 注册命令和handler对应关系
|
||||
builder.Services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblyContaining<ConsistencyVerificationHandler>());
|
||||
// EasyCaching 缓存
|
||||
builder.Services.AddEasyCachingSetup(_configuration);
|
||||
|
||||
// hangfire 定时任务框架 有界面,更友好~
|
||||
builder.Services.AddhangfireSetup(_configuration);
|
||||
|
||||
|
||||
//Serilog 日志可视化 LogDashboard日志
|
||||
builder.Services.AddLogDashboardSetup();
|
||||
|
||||
|
||||
builder.Services.AddJsonConfigSetup(_configuration);
|
||||
//转发头设置 获取真实IP
|
||||
builder.Services.Configure<ForwardedHeadersOptions>(options =>
|
||||
{
|
||||
options.ForwardedHeaders =
|
||||
ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
||||
});
|
||||
//Dicom影像渲染图片 跨平台
|
||||
builder.Services.AddDicomSetup();
|
||||
|
||||
// 实时应用
|
||||
builder.Services.AddSignalR();
|
||||
|
||||
builder.Services.AddSingleton<IUserIdProvider, IRaCISUserIdProvider>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#region 历史废弃配置
|
||||
//builder.Services.AddMemoryCache();
|
||||
////上传限制 配置
|
||||
//builder.Services.Configure<FormOptions>(options =>
|
||||
//{
|
||||
// options.MultipartBodyLengthLimit = int.MaxValue;
|
||||
// options.ValueCountLimit = int.MaxValue;
|
||||
// options.ValueLengthLimit = int.MaxValue;
|
||||
//});
|
||||
//IP 限流 可设置白名单 或者黑名单
|
||||
//services.AddIpPolicyRateLimitSetup(_configuration);
|
||||
// 用户类型 策略授权
|
||||
//services.AddAuthorizationPolicySetup(_configuration);
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
var app = builder.Build();
|
||||
var env = app.Environment;
|
||||
|
||||
#region 配置中间件
|
||||
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
|
||||
//本地化
|
||||
app.UseLocalization();
|
||||
|
||||
app.UseForwardedHeaders();
|
||||
|
||||
//响应压缩
|
||||
app.UseResponseCompression();
|
||||
|
||||
//app.UseCors(t => t.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
|
||||
|
||||
//不需要 token 访问的静态文件 wwwroot css, JavaScript, and images don't require authentication.
|
||||
app.UseStaticFiles();
|
||||
|
||||
app.UseMiddleware<MultiDiskStaticFilesMiddleware>();
|
||||
|
||||
//LogDashboard
|
||||
app.UseLogDashboard("/LogDashboard");
|
||||
|
||||
//hangfire
|
||||
app.UseHangfireConfig(env);
|
||||
|
||||
|
||||
////限流 中间件
|
||||
//app.UseIpRateLimiting();
|
||||
|
||||
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
else
|
||||
{
|
||||
//app.UseHsts();
|
||||
}
|
||||
|
||||
// 特殊异常处理 比如 404
|
||||
app.UseStatusCodePagesWithReExecute("/Error/{0}");
|
||||
|
||||
SwaggerSetup.Configure(app, env);
|
||||
|
||||
|
||||
////serilog 记录请求的用户信息
|
||||
app.UseSerilogConfig(env);
|
||||
|
||||
app.UseRouting();
|
||||
|
||||
app.UseCors(t => t.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
|
||||
|
||||
//app.UseIRacisHostStaticFileStore(env);
|
||||
|
||||
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
|
||||
endpoints.MapHub<UploadHub>("/UploadHub");
|
||||
|
||||
endpoints.MapHealthChecks("/health");
|
||||
});
|
||||
|
||||
// Serilog
|
||||
SerilogExtension.AddSerilogSetup(enviromentName, app.Services);
|
||||
|
||||
|
||||
var hangfireJobService = app.Services.GetRequiredService<IIRaCISHangfireJob>();
|
||||
|
||||
await hangfireJobService.InitHangfireJobTaskAsync();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
try
|
||||
{
|
||||
#region 运行环境 部署平台
|
||||
|
||||
Log.Logger.Warning($"当前环境:{enviromentName}");
|
||||
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
Log.Logger.Warning($"当前部署平台环境:windows");
|
||||
}
|
||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||
{
|
||||
Log.Logger.Warning($"当前部署平台环境:linux");
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Logger.Warning($"当前部署平台环境:OSX or FreeBSD");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Log.Logger.Warning($"ContentRootPath:{env.ContentRootPath}");
|
||||
|
||||
|
||||
string parentDirectory = Path.GetFullPath(Path.Combine(env.ContentRootPath, ".."));
|
||||
|
||||
|
||||
Log.Logger.Warning($"ContentRootPath——parentDirectory:{parentDirectory}");
|
||||
|
||||
//Log.Logger.Warning($"ContentRootPath——GetParent:{Directory.GetParent(env.ContentRootPath).Parent.FullName}");
|
||||
//Log.Logger.Warning($"ContentRootPath——xx:{Path.GetDirectoryName(Path.GetDirectoryName(env.ContentRootPath))}");
|
||||
|
||||
app.Run();
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
Log.Logger.Error(e.InnerException is null ? e.Message + e.StackTrace : e.InnerException?.Message + e.InnerException?.StackTrace);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -13,46 +13,47 @@
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
"ASPNETCORE_ENVIRONMENT": "Test_IRC"
|
||||
}
|
||||
},
|
||||
"IRaCIS.Development": {
|
||||
"IRaCIS.Test_IRC": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
"ASPNETCORE_ENVIRONMENT": "Test_IRC"
|
||||
},
|
||||
"applicationUrl": "http://localhost:6100"
|
||||
},
|
||||
"IRaCIS.Event_IRC": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Event_IRC"
|
||||
},
|
||||
"applicationUrl": "http://localhost:6101"
|
||||
},
|
||||
"Docker": {
|
||||
"commandName": "Docker",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
|
||||
"publishAllPorts": true
|
||||
},
|
||||
"IRaCIS.Staging": {
|
||||
"IRaCIS.Uat_IRC": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Staging"
|
||||
"ASPNETCORE_ENVIRONMENT": "Uat_IRC"
|
||||
},
|
||||
"applicationUrl": "http://localhost:6200"
|
||||
"applicationUrl": "http://localhost:6100"
|
||||
},
|
||||
"IRaCIS.Production": {
|
||||
"IRaCIS.Prod_IRC": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Production"
|
||||
"ASPNETCORE_ENVIRONMENT": "Prod_IRC"
|
||||
},
|
||||
"applicationUrl": "http://localhost:6300"
|
||||
},
|
||||
"IRaCIS.CertificateApply": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "CertificateApply"
|
||||
},
|
||||
"applicationUrl": "http://localhost:6400"
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,16 @@
|
||||
// 使用的是proto3版本
|
||||
// 使用的是proto3版本
|
||||
syntax = "proto3";
|
||||
// 定义命名空间,后续生成代码时就会生成对应的命名空间
|
||||
// 定义命名空间,后续生成代码时就会生成对应的命名空间
|
||||
option csharp_namespace = "gRPC.ZHiZHUN.AuthServer.protos";
|
||||
|
||||
/*
|
||||
每一句需要用分号结尾
|
||||
message 用来定义请求和返回数据格式
|
||||
tag message后面的值数字代表是字段的标识(tag),不是赋值,
|
||||
每一句需要用分号结尾
|
||||
message 用来定义请求和返回数据格式
|
||||
tag message后面的值数字代表是字段的标识(tag),不是赋值,
|
||||
*/
|
||||
|
||||
|
||||
// 新增用户时需要传递数据消息, 可理解为一个类
|
||||
// 新增用户时需要传递数据消息, 可理解为一个类
|
||||
message GetTokenReuqest{
|
||||
string id=1;
|
||||
string userName=2;
|
||||
@@ -22,48 +22,48 @@ message GetTokenReuqest{
|
||||
|
||||
}
|
||||
|
||||
// 新增时返回的消息格式
|
||||
// 新增时返回的消息格式
|
||||
message GetTokenResponse {
|
||||
int32 code=1;
|
||||
string token =2;
|
||||
}
|
||||
|
||||
|
||||
// service 用标识定义服务的,里面写对应的方法
|
||||
// service 用标识定义服务的,里面写对应的方法
|
||||
service TokenGrpcService{
|
||||
// 获取token
|
||||
// 获取token
|
||||
rpc GetUserToken(GetTokenReuqest) returns (GetTokenResponse);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
// 新增用户时需要传递数据消息, 可理解为一个类
|
||||
// 新增用户时需要传递数据消息, 可理解为一个类
|
||||
message AddUserReuqest{
|
||||
string name=1;
|
||||
int32 age=2;
|
||||
bool isBoy=3;
|
||||
}
|
||||
// 新增时返回的消息格式
|
||||
// 新增时返回的消息格式
|
||||
message ResultResponse {
|
||||
int32 code=1;
|
||||
string msg =2;
|
||||
}
|
||||
//传递的查询条件信息格式,可理解为平时传入的查询条件对象
|
||||
//传递的查询条件信息格式,可理解为平时传入的查询条件对象
|
||||
message QueryUserReuqest{
|
||||
string name=1;
|
||||
}
|
||||
//查询返回的用户信息格式,可理解为返回的类
|
||||
//查询返回的用户信息格式,可理解为返回的类
|
||||
message UserInfoResponse {
|
||||
string name=1;
|
||||
int32 age=2;
|
||||
string gender=3;
|
||||
}
|
||||
|
||||
// service 用标识定义服务的,里面写对应的方法
|
||||
// service 用标识定义服务的,里面写对应的方法
|
||||
service UserService{
|
||||
// 新增用户
|
||||
// 新增用户
|
||||
rpc AddUser(AddUserReuqest) returns (ResultResponse);
|
||||
// 查询用户
|
||||
// 查询用户
|
||||
rpc GetAllUser(QueryUserReuqest) returns (UserInfoResponse);
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
using Hangfire;
|
||||
using Hangfire.Dashboard;
|
||||
using IRaCIS.Application.Services.BackGroundJob;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
|
||||
namespace IRaCIS.Core.API
|
||||
{
|
||||
|
||||
|
||||
public static class HangfireConfig
|
||||
{
|
||||
|
||||
public static void UseHangfireConfig(this IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
app.UseHangfireDashboard("/api/hangfire", new DashboardOptions()
|
||||
{
|
||||
//直接访问,没有带token 获取不到用户身份信息,所以这种自定义授权暂时没法使用
|
||||
//Authorization = new[] { new hangfireAuthorizationFilter() }
|
||||
|
||||
//本地请求 才能看
|
||||
Authorization = new[] { new LocalRequestsOnlyAuthorizationFilter() }
|
||||
|
||||
});
|
||||
|
||||
#region hangfire
|
||||
//// 延迟任务执行 1秒之后执行 有时启动没运行 换成添加到队列中
|
||||
//BackgroundJob.Schedule<ICacheTrialStatusJob>(t => t.MemoryCacheTrialStatus(), TimeSpan.FromSeconds(1));
|
||||
////添加到后台任务队列,
|
||||
//BackgroundJob.Enqueue<ICacheTrialStatusJob>(t => t.MemoryCacheTrialStatus());
|
||||
|
||||
//周期性任务,1天执行一次
|
||||
|
||||
RecurringJob.AddOrUpdate<IIRaCISCacheHangfireJob>(t => t.ProjectStartCache(), Cron.Daily);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
using Hangfire;
|
||||
using Hangfire.Dashboard;
|
||||
using Hangfire.Dashboard.BasicAuthorization;
|
||||
using IRaCIS.Application.Services.BackGroundJob;
|
||||
using IRaCIS.Core.API.Filter;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
|
||||
namespace IRaCIS.Core.API
|
||||
{
|
||||
|
||||
|
||||
public static class HangfireConfig
|
||||
{
|
||||
|
||||
public static void UseHangfireConfig(this IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
|
||||
|
||||
app.UseHangfireDashboard("/back/hangfire", new DashboardOptions()
|
||||
{
|
||||
|
||||
|
||||
|
||||
Authorization = new IDashboardAuthorizationFilter[] { /*new hangfireAuthorizationFilter(),*/
|
||||
|
||||
new BasicAuthAuthorizationFilter(new BasicAuthAuthorizationFilterOptions(){
|
||||
SslRedirect=false,
|
||||
RequireSsl=false,
|
||||
Users=new BasicAuthAuthorizationUser[]{
|
||||
new BasicAuthAuthorizationUser(){
|
||||
Login="admin",
|
||||
PasswordClear="admin",
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
DashboardTitle ="后台任务管理",
|
||||
|
||||
|
||||
//Authorization = new BasicAuthAuthorizationFilter[] {
|
||||
// new BasicAuthAuthorizationFilter(new BasicAuthAuthorizationFilterOptions(){
|
||||
// SslRedirect=false,
|
||||
// RequireSsl=false,
|
||||
// Users=new BasicAuthAuthorizationUser[]{
|
||||
// new BasicAuthAuthorizationUser(){
|
||||
// Login="admin",
|
||||
// PasswordClear="test",
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
// })
|
||||
//}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
-2
@@ -1,8 +1,11 @@
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using Azure;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.StaticFiles;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using Microsoft.Extensions.FileProviders.Physical;
|
||||
@@ -11,6 +14,7 @@ using Microsoft.Extensions.Hosting.Internal;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.VisualBasic;
|
||||
using Newtonsoft.Json;
|
||||
using SharpCompress.Common;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -47,7 +51,7 @@ namespace IRaCIS.Core.API
|
||||
var path = context.Request.Path.Value;
|
||||
var isIRacisFile = path.StartsWith($"/{StaticData.Folder.IRaCISDataFolder}");
|
||||
|
||||
var isDicomFile = path.Contains($"{StaticData.Folder.DicomFolder}");
|
||||
var isDicomFile = isIRacisFile && path.Contains($"{StaticData.Folder.DicomFolder}");
|
||||
|
||||
|
||||
|
||||
@@ -147,6 +151,12 @@ namespace IRaCIS.Core.API
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 如果没有找到文件,返回404
|
||||
context.Response.StatusCode = 404;
|
||||
context.Response.ContentType = "application/json";
|
||||
|
||||
await context.Response.WriteAsync(JsonConvert.SerializeObject(ResponseOutput.NotOk("File not found")));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Autofac;
|
||||
using Autofac.Extras.DynamicProxy;
|
||||
using IRaCIS.Core.Application;
|
||||
using IRaCIS.Core.Application.AOP;
|
||||
using IRaCIS.Core.Application.BackGroundJob;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
@@ -31,10 +30,6 @@ namespace IRaCIS.Core.API
|
||||
|
||||
containerBuilder.RegisterType<Repository>().As<IRepository>().InstancePerLifetimeScope();
|
||||
|
||||
//containerBuilder.RegisterType<Mapper>().As<IMapper>().InstancePerLifetimeScope();
|
||||
|
||||
//containerBuilder.RegisterGeneric(typeof(EFUnitOfWork<>))
|
||||
// .As(typeof(IEFUnitOfWork<>)).InstancePerLifetimeScope();//注册仓储
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -50,8 +45,7 @@ namespace IRaCIS.Core.API
|
||||
#endregion
|
||||
|
||||
|
||||
//containerBuilder.RegisterType<BaseService>().As<IBaseService>().PropertiesAutowired().InstancePerLifetimeScope();
|
||||
//containerBuilder.RegisterType<DictionaryService>().As<IDictionaryService>().InstancePerLifetimeScope();
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -59,22 +53,13 @@ namespace IRaCIS.Core.API
|
||||
containerBuilder.RegisterAssemblyTypes(application).Where(t => t.FullName.Contains("Service"))
|
||||
.PropertiesAutowired().AsImplementedInterfaces().EnableClassInterceptors();
|
||||
|
||||
//Assembly infrastructure = Assembly.Load("IRaCIS.Core.Infra.EFCore");
|
||||
//containerBuilder.RegisterAssemblyTypes(infrastructure).AsImplementedInterfaces();
|
||||
|
||||
|
||||
containerBuilder.RegisterType<HttpContextAccessor>().As<IHttpContextAccessor>().SingleInstance();
|
||||
containerBuilder.RegisterType<UserInfo>().As<IUserInfo>().InstancePerLifetimeScope();
|
||||
|
||||
|
||||
//containerBuilder.RegisterType<Dictionary>().InstancePerLifetimeScope();
|
||||
//Autofac 注册拦截器 需要注意的是生成api上服务上的动态代理AOP失效 间接掉用不影响
|
||||
//containerBuilder.RegisterType<TrialStatusAutofacAOP>();
|
||||
//containerBuilder.RegisterType<UserAddAOP>();
|
||||
//containerBuilder.RegisterType<QANoticeAOP>();
|
||||
//containerBuilder.RegisterType<LogService>().As<ILogService>().SingleInstance();
|
||||
|
||||
|
||||
//注册hangfire任务 依赖注入
|
||||
//注册hangfire任务 依赖注入
|
||||
containerBuilder.RegisterType<ObtainTaskAutoCancelJob>().As<IObtainTaskAutoCancelJob>().InstancePerDependency();
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
using IRaCIS.Core.Application.Triggers;
|
||||
using Hangfire.SqlServer;
|
||||
using IRaCIS.Core.Application.Triggers;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using Medallion.Threading;
|
||||
using Medallion.Threading.SqlServer;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using StackExchange.Redis;
|
||||
|
||||
namespace IRaCIS.Core.API
|
||||
{
|
||||
@@ -37,6 +41,7 @@ namespace IRaCIS.Core.API
|
||||
triggerOptions.AddTrigger<AddSubjectTrigger>();
|
||||
triggerOptions.AddTrigger<ChallengeStateTrigger>();
|
||||
triggerOptions.AddTrigger<SubjectStateTrigger>();
|
||||
triggerOptions.AddTrigger<AddCRCCliniaclDataTrigger>();
|
||||
triggerOptions.AddTrigger<SubjectVisitCheckPassedTrigger>();
|
||||
triggerOptions.AddTrigger<SubjectVisitFinalVisitTrigger>();
|
||||
triggerOptions.AddTrigger<SubjectVisitTrigger>();
|
||||
@@ -54,6 +59,13 @@ namespace IRaCIS.Core.API
|
||||
|
||||
});
|
||||
|
||||
//注意区分 easy caching 也有 IDistributedLockProvider
|
||||
services.AddSingleton<IDistributedLockProvider>(sp =>
|
||||
{
|
||||
//var connection = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!);
|
||||
|
||||
return new SqlDistributedSynchronizationProvider(configuration.GetSection("ConnectionStrings:RemoteNew").Value);
|
||||
});
|
||||
|
||||
//services.AddAssemblyTriggers(typeof(SubjectVisitImageDateTrigger).Assembly);
|
||||
}
|
||||
|
||||
@@ -1,17 +1,26 @@
|
||||
using EasyCaching.Core;
|
||||
using EasyCaching.Core.Configurations;
|
||||
using EasyCaching.Interceptor.Castle;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace IRaCIS.Core.API
|
||||
{
|
||||
public static class EasyCachingSetup
|
||||
public static class EasyCachingSetup
|
||||
{
|
||||
public static void AddEasyCachingSetup(this IServiceCollection services)
|
||||
public static void AddEasyCachingSetup(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services.AddEasyCaching(options =>
|
||||
{
|
||||
options.UseInMemory();
|
||||
|
||||
//options.UseRedis(configuration, EasyCachingConstValue.DefaultRedisName).WithMessagePack(EasyCachingConstValue.DefaultRedisName);
|
||||
|
||||
|
||||
});
|
||||
|
||||
//services.ConfigureCastleInterceptor(options => options.CacheProviderName = EasyCachingConstValue.DefaultRedisName);
|
||||
|
||||
services.ConfigureCastleInterceptor(options => options.CacheProviderName = EasyCachingConstValue.DefaultInMemoryName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
//using System;
|
||||
//using Microsoft.Extensions.DependencyInjection;
|
||||
//using StackExchange.Profiling.Storage;
|
||||
|
||||
//namespace IRaCIS.Core.API
|
||||
//{
|
||||
// public class MiniProfilerConfigure
|
||||
// {
|
||||
// public static void ConfigureMiniProfiler(IServiceCollection services)
|
||||
// {
|
||||
|
||||
// services.AddMiniProfiler(options =>
|
||||
// {
|
||||
// // All of this is optional. You can simply call .AddMiniProfiler() for all defaults
|
||||
|
||||
// // (Optional) Path to use for profiler URLs, default is /mini-profiler-resources
|
||||
// options.RouteBasePath = "/profiler";
|
||||
|
||||
// //// (Optional) Control storage
|
||||
// //// (default is 30 minutes in MemoryCacheStorage)
|
||||
// (options.Storage as MemoryCacheStorage).CacheDuration = TimeSpan.FromMinutes(10);
|
||||
|
||||
// //// (Optional) Control which SQL formatter to use, InlineFormatter is the default
|
||||
// //options.SqlFormatter = new StackExchange.Profiling.SqlFormatters.InlineFormatter();
|
||||
|
||||
// //// (Optional) To control authorization, you can use the Func<HttpRequest, bool> options:
|
||||
// //// (default is everyone can access profilers)
|
||||
// //options.ResultsAuthorize = request => MyGetUserFunction(request).CanSeeMiniProfiler;
|
||||
// //options.ResultsListAuthorize = request => MyGetUserFunction(request).CanSeeMiniProfiler;
|
||||
// //// Or, there are async versions available:
|
||||
// //options.ResultsAuthorizeAsync = async request => (await MyGetUserFunctionAsync(request)).CanSeeMiniProfiler;
|
||||
// //options.ResultsAuthorizeListAsync = async request => (await MyGetUserFunctionAsync(request)).CanSeeMiniProfilerLists;
|
||||
|
||||
// //// (Optional) To control which requests are profiled, use the Func<HttpRequest, bool> option:
|
||||
// //// (default is everything should be profiled)
|
||||
// //options.ShouldProfile = request => MyShouldThisBeProfiledFunction(request);
|
||||
|
||||
// //// (Optional) Profiles are stored under a user ID, function to get it:
|
||||
// //// (default is null, since above methods don't use it by default)
|
||||
// //options.UserIdProvider = request => MyGetUserIdFunction(request);
|
||||
|
||||
// //// (Optional) Swap out the entire profiler provider, if you want
|
||||
// //// (default handles async and works fine for almost all applications)
|
||||
// //options.ProfilerProvider = new MyProfilerProvider();
|
||||
|
||||
// //// (Optional) You can disable "Connection Open()", "Connection Close()" (and async variant) tracking.
|
||||
// //// (defaults to true, and connection opening/closing is tracked)
|
||||
// //options.TrackConnectionOpenClose = true;
|
||||
|
||||
// //// (Optional) Use something other than the "light" color scheme.
|
||||
// //// (defaults to "light")
|
||||
// //options.ColorScheme = StackExchange.Profiling.ColorScheme.Auto;
|
||||
|
||||
// //// The below are newer options, available in .NET Core 3.0 and above:
|
||||
|
||||
// //// (Optional) You can disable MVC filter profiling
|
||||
// //// (defaults to true, and filters are profiled)
|
||||
// //options.EnableMvcFilterProfiling = true;
|
||||
// //// ...or only save filters that take over a certain millisecond duration (including their children)
|
||||
// //// (defaults to null, and all filters are profiled)
|
||||
// //// options.MvcFilterMinimumSaveMs = 1.0m;
|
||||
|
||||
// //// (Optional) You can disable MVC view profiling
|
||||
// //// (defaults to true, and views are profiled)
|
||||
// //options.EnableMvcViewProfiling = true;
|
||||
// //// ...or only save views that take over a certain millisecond duration (including their children)
|
||||
// //// (defaults to null, and all views are profiled)
|
||||
// //// options.MvcViewMinimumSaveMs = 1.0m;
|
||||
|
||||
// //// (Optional) listen to any errors that occur within MiniProfiler itself
|
||||
// //// options.OnInternalError = e => MyExceptionLogger(e);
|
||||
|
||||
// //// (Optional - not recommended) You can enable a heavy debug mode with stacks and tooltips when using memory storage
|
||||
// //// It has a lot of overhead vs. normal profiling and should only be used with that in mind
|
||||
// //// (defaults to false, debug/heavy mode is off)
|
||||
// ////options.EnableDebugMode = true;
|
||||
// });
|
||||
// //.AddEntityFramework();
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -28,7 +28,7 @@ namespace IRaCIS.Core.API
|
||||
if(_MemberInfo.PropertyType == typeof(string))
|
||||
{
|
||||
//去掉前后空格
|
||||
_MemberInfo.SetValue(target, value==null?string.Empty: value.ToString()==string.Empty? value:value.ToString().Trim());
|
||||
_MemberInfo.SetValue(target, value==null?string.Empty: value.ToString()==string.Empty? value:value/*.ToString().Trim()*/);
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace IRaCIS.Core.API
|
||||
{
|
||||
public static class QuartZSetup
|
||||
{
|
||||
public static void AddQuartZSetup(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
//services.AddTransient<CacheTrialStatusQuartZJob>();
|
||||
|
||||
//services.AddQuartz(q =>
|
||||
//{
|
||||
// // base quartz scheduler, job and trigger configuration
|
||||
|
||||
// // as of 3.3.2 this also injects scoped services (like EF DbContext) without problems
|
||||
// q.UseMicrosoftDependencyInjectionJobFactory();
|
||||
|
||||
// // 基本Quartz调度器、作业和触发器配置
|
||||
// var jobKey = new JobKey("RegularTrialWork", "regularWorkGroup");
|
||||
// q.AddJob<CacheTrialStatusQuartZJob>(jobKey, j => j
|
||||
// .WithDescription("Trial regular work")
|
||||
// );
|
||||
// q.AddTrigger(t => t
|
||||
// .WithIdentity("TrialStatusTrigger")
|
||||
// .ForJob(jobKey)
|
||||
// //.StartNow()
|
||||
// //.WithSimpleSchedule(x => x.WithInterval(TimeSpan.FromSeconds(15))//开始秒数 15s
|
||||
// // .RepeatForever())//持续工作
|
||||
// .WithCronSchedule("0 0 0/2 * * ?")//每小时执行一次
|
||||
// .WithDescription("My regular trial work trigger")
|
||||
// );
|
||||
//});
|
||||
|
||||
//// ASP.NET Core hosting
|
||||
//services.AddQuartzServer(options =>
|
||||
//{
|
||||
// // when shutting down we want jobs to complete gracefully
|
||||
// options.WaitForJobsToComplete = true;
|
||||
//});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ namespace IRaCIS.Core.API
|
||||
.MinimumLevel.Override("Hangfire", LogEventLevel.Warning)
|
||||
.MinimumLevel.Override("System.Net.Http.HttpClient.HttpReports", LogEventLevel.Warning)
|
||||
.Enrich.WithClientIp()
|
||||
.Enrich.WithClientAgent()
|
||||
|
||||
.Enrich.FromLogContext()
|
||||
|
||||
//控制台 方便调试 问题 我们显示记录日志 时 获取上下文的ip 和用户名 用户类型
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
using Microsoft.OpenApi.Models;
|
||||
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace IRaCIS.Core.API
|
||||
{
|
||||
public class JsonPatchDocumentFilter : IDocumentFilter
|
||||
{
|
||||
public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
|
||||
{
|
||||
var schemas = swaggerDoc.Components.Schemas.ToList();
|
||||
foreach (var item in schemas)
|
||||
{
|
||||
if (item.Key.StartsWith("Operation") || item.Key.StartsWith("JsonPatchDocument"))
|
||||
swaggerDoc.Components.Schemas.Remove(item.Key);
|
||||
}
|
||||
|
||||
swaggerDoc.Components.Schemas.Add("Operation", new OpenApiSchema
|
||||
{
|
||||
Type = "object",
|
||||
Properties = new Dictionary<string, OpenApiSchema>
|
||||
{
|
||||
{ "op", new OpenApiSchema { Type = "string" } },
|
||||
{"value", new OpenApiSchema{ Type = "object", Nullable = true } },
|
||||
{ "path", new OpenApiSchema { Type = "string" } }
|
||||
}
|
||||
});
|
||||
|
||||
swaggerDoc.Components.Schemas.Add("JsonPatchDocument", new OpenApiSchema
|
||||
{
|
||||
Type = "array",
|
||||
Items = new OpenApiSchema
|
||||
{
|
||||
Reference = new OpenApiReference { Type = ReferenceType.Schema, Id = "Operation" }
|
||||
},
|
||||
Description = "Array of operations to perform"
|
||||
});
|
||||
|
||||
foreach (var path in swaggerDoc.Paths.SelectMany(p => p.Value.Operations)
|
||||
.Where(p => p.Key == Microsoft.OpenApi.Models.OperationType.Patch))
|
||||
{
|
||||
foreach (var item in path.Value.RequestBody.Content.Where(c => c.Key != "application/json-patch+json"))
|
||||
path.Value.RequestBody.Content.Remove(item.Key);
|
||||
|
||||
var response = path.Value.RequestBody.Content.SingleOrDefault(c => c.Key == "application/json-patch+json");
|
||||
|
||||
response.Value.Schema = new OpenApiSchema
|
||||
{
|
||||
Reference = new OpenApiReference { Type = ReferenceType.Schema, Id = "JsonPatchDocument" }
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,6 @@ namespace IRaCIS.Core.API
|
||||
{
|
||||
public static void AddSwaggerSetup(this IServiceCollection services)
|
||||
{
|
||||
services.AddSwaggerExamplesFromAssemblyOf<JsonPatchUserRequestExample>();
|
||||
|
||||
services.AddSwaggerGen(options =>
|
||||
{
|
||||
@@ -63,7 +62,6 @@ namespace IRaCIS.Core.API
|
||||
// 在header中添加token,传递到后台
|
||||
options.OperationFilter<SecurityRequirementsOperationFilter>();
|
||||
|
||||
options.DocumentFilter<JsonPatchDocumentFilter>();
|
||||
|
||||
// 添加登录按钮
|
||||
options.AddSecurityDefinition("bearerAuth", new OpenApiSecurityScheme()
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
using Hangfire;
|
||||
using Hangfire.SqlServer;
|
||||
using Hangfire.Tags.SqlServer;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
|
||||
namespace IRaCIS.Core.API
|
||||
{
|
||||
public static class hangfireSetup
|
||||
public static class hangfireSetup
|
||||
{
|
||||
public static void AddhangfireSetup(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
@@ -15,24 +14,29 @@ namespace IRaCIS.Core.API
|
||||
|
||||
services.AddHangfire(hangFireConfig =>
|
||||
{
|
||||
|
||||
//hangFireConfig.UseInMemoryStorage();
|
||||
|
||||
//指定存储介质
|
||||
hangFireConfig.UseSqlServerStorage(hangFireConnStr, new SqlServerStorageOptions()
|
||||
{
|
||||
SchemaName = "hangfire",
|
||||
SchemaName = "dbo",
|
||||
CommandBatchMaxTimeout = TimeSpan.FromMinutes(5),
|
||||
SlidingInvisibilityTimeout = TimeSpan.FromMinutes(5),
|
||||
QueuePollInterval = TimeSpan.Zero,
|
||||
UseRecommendedIsolationLevel = true,
|
||||
UsePageLocksOnDequeue = true,
|
||||
DisableGlobalLocks = true
|
||||
});
|
||||
|
||||
hangFireConfig.UseTagsWithSql(); //nuget引入Hangfire.Tags.SqlServer
|
||||
//hangFireConfig.UseTagsWithSql(); //nuget引入Hangfire.Tags.SqlServer
|
||||
//.UseHangfireHttpJob();
|
||||
|
||||
});
|
||||
|
||||
services.AddHangfireServer();
|
||||
services.AddHangfireServer(option =>
|
||||
{
|
||||
option.Queues = new[] { "immediately_once", "default", "sys_init", "not_immediately_once" };
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"RemoteNew": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_Certificate;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true",
|
||||
"Hangfire": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=Hangfire_IRaCIS;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true"
|
||||
|
||||
},
|
||||
"BasicSystemConfig": {
|
||||
|
||||
"OpenUserComplexPassword": false,
|
||||
|
||||
"OpenSignDocumentBeforeWork": false,
|
||||
|
||||
"OpenTrialRelationDelete": true,
|
||||
|
||||
"OpenLoginLimit": false
|
||||
},
|
||||
|
||||
"SystemEmailSendConfig": {
|
||||
"Port": 465,
|
||||
"Host": "smtp.qiye.aliyun.com",
|
||||
"FromEmail": "test@extimaging.com",
|
||||
"FromName": "Test_IRC",
|
||||
"AuthorizationCode": "SHzyyl2021"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"RemoteNew": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_New_Tet;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true",
|
||||
"Hangfire": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=Hangfire_IRaCIS;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true"
|
||||
|
||||
},
|
||||
"BasicSystemConfig": {
|
||||
|
||||
"OpenUserComplexPassword": false,
|
||||
|
||||
"OpenSignDocumentBeforeWork": false,
|
||||
|
||||
"OpenTrialRelationDelete": true,
|
||||
|
||||
"OpenLoginLimit": false
|
||||
},
|
||||
|
||||
"SystemEmailSendConfig": {
|
||||
"Port": 465,
|
||||
"Host": "smtp.qiye.aliyun.com",
|
||||
"FromEmail": "test@extimaging.com",
|
||||
"FromName": "Test_IRC",
|
||||
"AuthorizationCode": "SHzyyl2021"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"RemoteNew": "Server=47.117.164.182,1434;Database=Event_IRC;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"
|
||||
},
|
||||
"ObjectStoreService": {
|
||||
"ObjectStoreUse": "AliyunOSS",
|
||||
"AliyunOSS": {
|
||||
"regionId": "cn-shanghai",
|
||||
"endpoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
||||
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
||||
"bucketName": "zy-irc-store",
|
||||
"roleArn": "acs:ram::1899121822495495:role/oss-upload",
|
||||
"viewEndpoint": "https://zy-irc-cache.oss-cn-shanghai.aliyuncs.com",
|
||||
"region": "oss-cn-shanghai"
|
||||
},
|
||||
"MinIO": {
|
||||
"endpoint": "http://192.168.3.68",
|
||||
"port": "8001",
|
||||
"useSSL": false,
|
||||
"accessKey": "IDFkwEpWej0b4DtiuThL",
|
||||
"secretKey": "Lhuu83yMhVwu7c1SnjvGY6lq74jzpYqifK6Qtj4h",
|
||||
"bucketName": "test"
|
||||
}
|
||||
},
|
||||
|
||||
"BasicSystemConfig": {
|
||||
|
||||
"OpenUserComplexPassword": true,
|
||||
|
||||
"OpenSignDocumentBeforeWork": true,
|
||||
|
||||
"OpenLoginLimit": true,
|
||||
"LoginMaxFailCount": 5,
|
||||
|
||||
"LoginFailLockMinutes": 30
|
||||
|
||||
},
|
||||
"SystemEmailSendConfig": {
|
||||
"Port": 465,
|
||||
"Host": "smtp.qiye.aliyun.com",
|
||||
"FromEmail": "uat@extimaging.com",
|
||||
"FromName": "UAT_IRC",
|
||||
"AuthorizationCode": "SHzyyl2021",
|
||||
"SiteUrl": "http://irc.event.extimaging.com/login"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"RemoteNew": "Server=101.132.193.237,1434;Database=Prod_IRC;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true",
|
||||
"Hangfire": "Server=101.132.193.237,1434;Database=Prod_IRC_Hangfire;User ID=sa;Password=zhanying@2021;TrustServerCertificate=true"
|
||||
},
|
||||
"ObjectStoreService": {
|
||||
"ObjectStoreUse": "AliyunOSS",
|
||||
"AliyunOSS": {
|
||||
"regionId": "cn-shanghai",
|
||||
"endpoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
||||
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
||||
"bucketName": "zy-irc-store",
|
||||
"roleArn": "acs:ram::1899121822495495:role/oss-upload",
|
||||
"viewEndpoint": "https://zy-irc-cache.oss-cn-shanghai.aliyuncs.com",
|
||||
"region": "oss-cn-shanghai"
|
||||
},
|
||||
"MinIO": {
|
||||
"endpoint": "http://192.168.3.68",
|
||||
"port": "8001",
|
||||
"useSSL": false,
|
||||
"accessKey": "IDFkwEpWej0b4DtiuThL",
|
||||
"secretKey": "Lhuu83yMhVwu7c1SnjvGY6lq74jzpYqifK6Qtj4h",
|
||||
"bucketName": "test"
|
||||
}
|
||||
},
|
||||
"BasicSystemConfig": {
|
||||
|
||||
"OpenUserComplexPassword": true,
|
||||
|
||||
"OpenSignDocumentBeforeWork": true,
|
||||
|
||||
"OpenLoginLimit": true,
|
||||
"LoginMaxFailCount": 5,
|
||||
|
||||
"LoginFailLockMinutes": 30
|
||||
},
|
||||
|
||||
"SystemEmailSendConfig": {
|
||||
"Port": 465,
|
||||
"Host": "smtp.qiye.aliyun.com",
|
||||
"FromEmail": "IRC@extimaging.com",
|
||||
"FromName": "IRC",
|
||||
"AuthorizationCode": "ExtImg@2022",
|
||||
"SiteUrl": "http://irc.extimaging.com/login"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
//"RootUrl": "http://123.56.181.144:8060/",
|
||||
"ConnectionStrings": {
|
||||
"RemoteNew": "Server=101.132.193.237,1433;Database=IRaCIS.Production;User ID=sa;Password=zhanying2021;TrustServerCertificate=true",
|
||||
"Hangfire": "Server=101.132.193.237,1433;Database=Hangfire.IRaCIS.Production;User ID=sa;Password=zhanying2021;TrustServerCertificate=true"
|
||||
},
|
||||
"BasicSystemConfig": {
|
||||
|
||||
"OpenUserComplexPassword": true,
|
||||
|
||||
"OpenSignDocumentBeforeWork": true,
|
||||
|
||||
"OpenLoginLimit": true
|
||||
},
|
||||
//"SystemEmailSendConfig": {
|
||||
// "Port": 465,
|
||||
// "Host": "smtp.163.com",
|
||||
// "FromEmail": "zhou941003@qq.com",
|
||||
// "FromName": "hangZhou",
|
||||
// "AuthorizationCode": "sqfhlpfdvnexbcab"
|
||||
//}
|
||||
|
||||
"SystemEmailSendConfig": {
|
||||
"Port": 465,
|
||||
"Host": "smtp.qiye.aliyun.com",
|
||||
"FromEmail": "IRC@extimaging.com",
|
||||
"FromName": "IRC",
|
||||
"AuthorizationCode": "ExtImg@2022"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"RemoteNew": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_Verify;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true",
|
||||
"Hangfire": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=Hangfire_IRaCIS;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true"
|
||||
},
|
||||
"BasicSystemConfig": {
|
||||
|
||||
"OpenUserComplexPassword": true,
|
||||
|
||||
"OpenSignDocumentBeforeWork": true,
|
||||
|
||||
"OpenLoginLimit": true
|
||||
|
||||
},
|
||||
"SystemEmailSendConfig": {
|
||||
"Port": 465,
|
||||
"Host": "smtp.qiye.aliyun.com",
|
||||
"FromEmail": "uat@extimaging.com",
|
||||
"FromName": "UAT_IRC",
|
||||
"AuthorizationCode": "SHzyyl2021"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"RemoteNew": "Server=123.56.94.154,1435;Database=Test_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true",
|
||||
"Hangfire": "Server=123.56.94.154,1435;Database=Test_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
|
||||
|
||||
},
|
||||
|
||||
"ObjectStoreService": {
|
||||
|
||||
"ObjectStoreUse": "AliyunOSS",
|
||||
|
||||
"AliyunOSS": {
|
||||
"regionId": "cn-shanghai",
|
||||
"endpoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
||||
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
||||
"bucketName": "zy-irc-test-store",
|
||||
"roleArn": "acs:ram::1899121822495495:role/oss-upload",
|
||||
"viewEndpoint": "https://zy-irc-test-store.oss-cn-shanghai.aliyuncs.com",
|
||||
"region": "oss-cn-shanghai"
|
||||
},
|
||||
|
||||
"MinIO": {
|
||||
"endpoint": "http://192.168.3.68",
|
||||
"port": "8001",
|
||||
"useSSL": false,
|
||||
"accessKey": "IDFkwEpWej0b4DtiuThL",
|
||||
"secretKey": "Lhuu83yMhVwu7c1SnjvGY6lq74jzpYqifK6Qtj4h",
|
||||
"bucketName": "test"
|
||||
}
|
||||
},
|
||||
|
||||
"BasicSystemConfig": {
|
||||
|
||||
"OpenUserComplexPassword": false,
|
||||
|
||||
"OpenSignDocumentBeforeWork": false,
|
||||
|
||||
"OpenTrialRelationDelete": true,
|
||||
|
||||
"OpenLoginLimit": false,
|
||||
|
||||
"LoginMaxFailCount": 5,
|
||||
|
||||
"LoginFailLockMinutes": 1
|
||||
},
|
||||
|
||||
"SystemEmailSendConfig": {
|
||||
"Port": 465,
|
||||
"Host": "smtp.qiye.aliyun.com",
|
||||
"FromEmail": "test@extimaging.com",
|
||||
"FromName": "Test_IRC",
|
||||
"AuthorizationCode": "SHzyyl2021",
|
||||
|
||||
"SiteUrl": "http://irc.test.extimaging.com/login"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,7 +19,11 @@
|
||||
|
||||
"OpenTrialRelationDelete": true,
|
||||
|
||||
"OpenLoginLimit": false
|
||||
"OpenLoginLimit": false,
|
||||
|
||||
"LoginMaxFailCount": 5,
|
||||
|
||||
"LoginFailLockMinutes": 30
|
||||
},
|
||||
|
||||
"SystemEmailSendConfig": {
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"RemoteNew": "Server=47.117.164.182,1434;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"
|
||||
},
|
||||
"ObjectStoreService": {
|
||||
|
||||
"ObjectStoreUse": "AliyunOSS",
|
||||
|
||||
"AliyunOSS": {
|
||||
"regionId": "cn-shanghai",
|
||||
"endpoint": "https://oss-cn-shanghai.aliyuncs.com",
|
||||
"accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ",
|
||||
"accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio",
|
||||
"bucketName": "zy-irc-uat-store",
|
||||
"roleArn": "acs:ram::1899121822495495:role/oss-upload",
|
||||
"viewEndpoint": "https://zy-irc-uat-store.oss-cn-shanghai.aliyuncs.com",
|
||||
"region": "oss-cn-shanghai"
|
||||
},
|
||||
|
||||
"MinIO": {
|
||||
"endpoint": "http://192.168.3.68",
|
||||
"port": "8001",
|
||||
"useSSL": false,
|
||||
"accessKey": "IDFkwEpWej0b4DtiuThL",
|
||||
"secretKey": "Lhuu83yMhVwu7c1SnjvGY6lq74jzpYqifK6Qtj4h",
|
||||
"bucketName": "test"
|
||||
}
|
||||
},
|
||||
|
||||
"BasicSystemConfig": {
|
||||
|
||||
"OpenUserComplexPassword": true,
|
||||
|
||||
"OpenSignDocumentBeforeWork": true,
|
||||
|
||||
"OpenLoginLimit": true,
|
||||
"LoginMaxFailCount": 5,
|
||||
|
||||
"LoginFailLockMinutes": 30
|
||||
|
||||
},
|
||||
"SystemEmailSendConfig": {
|
||||
"Port": 465,
|
||||
"Host": "smtp.qiye.aliyun.com",
|
||||
"FromEmail": "uat@extimaging.com",
|
||||
"FromName": "UAT_IRC",
|
||||
"AuthorizationCode": "SHzyyl2021",
|
||||
"SiteUrl": "http://irc.uat.extimaging.com/login"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"JwtSetting": {
|
||||
"SecurityKey": "3e6dbfa227234a03977a2f421bdb7f4f",
|
||||
"Issuer": "IRaCIS",
|
||||
"Audience": "ZhiZhun",
|
||||
"SecurityKey": "SecurityKey_SHzyyl@2021",
|
||||
"Issuer": "Extimaging",
|
||||
"Audience": "EICS",
|
||||
"TokenExpireDays": "7"
|
||||
},
|
||||
"IpRateLimiting": {
|
||||
@@ -55,6 +55,26 @@
|
||||
"EnableReadDeepClone": true,
|
||||
"EnableWriteDeepClone": false
|
||||
}
|
||||
},
|
||||
"redis": {
|
||||
"MaxRdSecond": 120,
|
||||
"EnableLogging": false,
|
||||
"LockMs": 5000,
|
||||
"SleepMs": 300,
|
||||
"dbconfig": {
|
||||
"Password": "xc@123456",
|
||||
"IsSsl": false,
|
||||
"SslHost": null,
|
||||
"ConnectionTimeout": 5000,
|
||||
"AllowAdmin": true,
|
||||
"Endpoints": [
|
||||
{
|
||||
"Host": "47.117.164.182",
|
||||
"Port": 6379
|
||||
}
|
||||
],
|
||||
"Database": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"IRaCISImageStore": {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -32,7 +32,7 @@
|
||||
|
||||
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||
<div>Best Regards</div>
|
||||
<div style="font-size: 14px;">Shanghai Extensive Imaging Medical Technology Co., LTD</div>
|
||||
<div style="font-size: 14px;">Extensive Imaging</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||
<div>Best Regards</div>
|
||||
<div style="font-size: 14px;">Shanghai Extensive Imaging Medical Technology Co., LTD</div>
|
||||
<div style="font-size: 14px;">Extensive Imaging</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang='en'>
|
||||
<head>
|
||||
<meta charset='UTF-8'>
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body style='font-family: 微软雅黑;padding: 0;margin: 0;'>
|
||||
<div style='padding-left: 40px;background: #f6f6f6'>
|
||||
<div style='padding-top: 20px;'>
|
||||
<div style='line-height: 40px;font-size: 18px'>
|
||||
您好:
|
||||
</div>
|
||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||
感谢您使用展影云平台。
|
||||
</div>
|
||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||
{0}。
|
||||
</div>
|
||||
|
||||
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||
<div>祝您顺利!/Best Regards</div>
|
||||
<div style="font-size: 14px;">上海展影医疗科技有限公司</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,27 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang='en'>
|
||||
<head>
|
||||
<meta charset='UTF-8'>
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body style='font-family: 微软雅黑;padding: 0;margin: 0;'>
|
||||
<div style='padding-left: 40px;background: #f6f6f6'>
|
||||
<div style='padding-top: 20px;'>
|
||||
<div style='line-height: 40px;font-size: 18px'>
|
||||
Dear:
|
||||
</div>
|
||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||
Thank you for using Extensive Imaging Cloud System.
|
||||
</div>
|
||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||
{0}。
|
||||
</div>
|
||||
|
||||
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||
<div>Best Regards</div>
|
||||
<div style="font-size: 14px;">Shanghai Extensive Imaging Medical Technology Co., LTD</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||
<div>Best Regards</div>
|
||||
<div style="font-size: 14px;">Shanghai Extensive Imaging Medical Technology Co., LTD</div>
|
||||
<div style="font-size: 14px;">Extensive Imaging</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
尊敬的 {0} ,您好:
|
||||
</div>
|
||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||
展影医疗作为 [{1} (试验方案号:{2 })] 项目的IRC供应商,诚邀您参加该项目IRC阅片相关工作,欢迎您提供指导和建议,非常感谢!
|
||||
展影医疗作为 [{1} (试验方案号:{2 })] 项目的供应商,诚邀您参加该项目阅片相关工作。
|
||||
</div>
|
||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||
该项目采用电子化工作流,系统及您的账号信息如下:
|
||||
@@ -34,11 +34,13 @@
|
||||
角色: {5}
|
||||
</div>
|
||||
<div>
|
||||
系统登录地址:{6}
|
||||
系统登录地址:
|
||||
<a href='{6}' style='margin-left:30px;font-size:14px;text-decoration: none;display: inline-block;color:#00D1B2;border-radius: 5px;line-height: 40px;text-align: center;'>
|
||||
点击跳转
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||
<div>祝您顺利!/Best Regards</div>
|
||||
<div style="font-size: 14px;">上海展影医疗科技有限公司</div>
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
<div style='line-height: 40px;font-size: 18px'>
|
||||
Dear {0},
|
||||
</div>
|
||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||
Hello, as the IRC supplier of [ {1} (Protocol ID is {2}) ] project,Extiming sincerely invites you to participate in the IRC related work of this project. Your guidance and suggestions are welcome.
|
||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
|
||||
As the service provider of {1} trial(Protocol ID is {2}), Extensive Imaging invites you to participate in the independent assessment work of this trial.
|
||||
</div>
|
||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||
This project adopts electronic workflow. The system and your account information are as follows:
|
||||
@@ -34,14 +34,14 @@
|
||||
Role: {5}
|
||||
</div>
|
||||
<div>
|
||||
System login address:{6}
|
||||
Login URL: {6}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||
<div>Best Regards</div>
|
||||
<div style="font-size: 14px;">Shanghai Extensive Imaging Medical Technology Co., LTD</div>
|
||||
<div style="font-size: 14px;">Extensive Imaging</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||
<div>Best Regards</div>
|
||||
<div style="font-size: 14px;">Shanghai Extensive Imaging Medical Technology Co., LTD</div>
|
||||
<div style="font-size: 14px;">Extensive Imaging</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||
<div>Best Regards</div>
|
||||
<div style="font-size: 14px;">Shanghai Extensive Imaging Medical Technology Co., LTD</div>
|
||||
<div style="font-size: 14px;">Extensive Imaging</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
尊敬的 {0} ,您好:
|
||||
</div>
|
||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||
展影医疗作为 [{1} (试验方案号:{2 })] 项目的IRC供应商,诚邀您参加该项目IRC相关工作,欢迎您提供指导和建议,非常感谢!
|
||||
展影医疗作为 [{1} (试验方案号:{2 })] 项目的供应商,诚邀您参加该项目相关工作,欢迎您提供指导和建议,非常感谢!
|
||||
</div>
|
||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||
该项目采用电子化工作流,系统及您的账号信息如下:
|
||||
@@ -34,7 +34,10 @@
|
||||
角色: {5}
|
||||
</div>
|
||||
<div>
|
||||
系统登录地址:{6}
|
||||
系统登录地址:
|
||||
<a href='{6}' style='margin-left:30px;font-size:14px;text-decoration: none;display: inline-block;color:#00D1B2;border-radius: 5px;line-height: 40px;text-align: center;'>
|
||||
点击跳转
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
<div style='line-height: 40px;font-size: 18px'>
|
||||
Dear {0},
|
||||
</div>
|
||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||
Hello, as the IRC supplier of [ {1} (Protocol ID is {2}) ] project,Extiming sincerely invites you to participate in the IRC related work of this project. Your guidance and suggestions are welcome.
|
||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;font-size: 16px'>
|
||||
As the service provider of {1} trial (Protocol ID is {2}), Extensive Imaging invites you to participate in related work of this trial.
|
||||
</div>
|
||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||
This project adopts electronic workflow. The system and your account information are as follows:
|
||||
@@ -34,14 +34,14 @@
|
||||
Role: {5}
|
||||
</div>
|
||||
<div>
|
||||
System login address:{6}
|
||||
Login URL: {6}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||
<div>Best Regards</div>
|
||||
<div style="font-size: 14px;">Shanghai Extensive Imaging Medical Technology Co., LTD</div>
|
||||
<div style="font-size: 14px;">Extensive Imaging</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||
<div>Best Regards</div>
|
||||
<div style="font-size: 14px;">Shanghai Extensive Imaging Medical Technology Co., LTD</div>
|
||||
<div style="font-size: 14px;">Extensive Imaging</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,17 +8,19 @@
|
||||
<div style='padding-left: 40px;background: #f6f6f6'>
|
||||
<div style='padding-top: 20px;'>
|
||||
<div style='line-height: 40px;font-size: 18px'>
|
||||
Dear {0},
|
||||
Hello {0},
|
||||
</div>
|
||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||
感谢您使用展影云平台。
|
||||
</div>
|
||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||
{1},验证码是: {2},请在3分钟内输入该验证码,进行后续操作。如非本人操作,请忽略该邮件。
|
||||
{1},验证码是: <span style="font-weight:bold">{2}</span>。
|
||||
</div>
|
||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||
请在3分钟内输入该验证码,进行后续操作
|
||||
</div>
|
||||
|
||||
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||
<div>祝您顺利!/Best Regards</div>
|
||||
<div>祝您顺利!</div>
|
||||
<div style="font-size: 14px;">上海展影医疗科技有限公司</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,19 +8,21 @@
|
||||
<div style='padding-left: 40px;background: #f6f6f6'>
|
||||
<div style='padding-top: 20px;'>
|
||||
<div style='line-height: 40px;font-size: 18px'>
|
||||
Dear {0},
|
||||
Hello {0},
|
||||
</div>
|
||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||
Thank you for using Extensive Imaging Cloud System.
|
||||
Thank you for using Extensive Imaging’s cloud system!
|
||||
</div>
|
||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||
{1}, the verification code is {2}. Enter the verification code within 3 minutes for subsequent operations. Please ignore this email if not by yourself.
|
||||
{1}, and the verification code is <span style="font-weight:bold">{2}</span>.
|
||||
</div>
|
||||
<div style='line-height: 40px;padding-left: 40px;margin-bottom: 10px;'>
|
||||
Please enter this verification code within 3 minutes for subsequent operations.
|
||||
</div>
|
||||
|
||||
|
||||
<div style='line-height: 24px;font-size: 14px;color:#333;margin-top: 20px;padding-bottom: 40px;'>
|
||||
<div>Best Regards</div>
|
||||
<div style="font-size: 14px;">Shanghai Extensive Imaging Medical Technology Co., LTD</div>
|
||||
<div style="font-size: 14px;">Extensive Imaging</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -276,8 +276,10 @@ var abp = abp || {};
|
||||
}
|
||||
|
||||
var password = document.getElementById('password').value;
|
||||
if (!password) {
|
||||
alert('PassWord Can Not Be Null');
|
||||
var pwdMd5 = document.getElementById('pwdMd5').value;
|
||||
console.log(pwdMd5);
|
||||
if (!password && !pwdMd5) {
|
||||
alert('PassWord And Md5 Can Not Be Null');
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -321,6 +323,9 @@ var abp = abp || {};
|
||||
UserName: usernameOrEmailAddress,
|
||||
Password: hex_md5(password),
|
||||
}
|
||||
if (pwdMd5 != '') {
|
||||
parm.Password = pwdMd5;
|
||||
}
|
||||
xhr.send(JSON.stringify(parm));
|
||||
//xhr.send("{" + "userName:'" + usernameOrEmailAddress + "'," + "passWord:'" + password + "'}");
|
||||
|
||||
@@ -414,8 +419,9 @@ var abp = abp || {};
|
||||
|
||||
//Inputs
|
||||
createInput(modalUxContent, 'tenancyName', 'Tenancy Name (Leave empty for Host)');
|
||||
createInput(modalUxContent, 'userName', 'Username or email address','text','admin');
|
||||
createInput(modalUxContent, 'password', 'Password','password');
|
||||
createInput(modalUxContent, 'userName', 'Username or email address','text','cyldev');
|
||||
createInput(modalUxContent, 'password', 'Password', 'password', '123456');
|
||||
createInput(modalUxContent, 'pwdMd5', 'PwdMd5', 'text', '');
|
||||
|
||||
//Buttons
|
||||
var authBtnWrapper = document.createElement('div');
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
using Castle.DynamicProxy;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.AOP
|
||||
{
|
||||
public abstract class AsyncInterceptorBase : IInterceptor
|
||||
{
|
||||
public AsyncInterceptorBase()
|
||||
{
|
||||
}
|
||||
|
||||
public void Intercept(IInvocation invocation)
|
||||
{
|
||||
BeforeProceed(invocation);
|
||||
invocation.Proceed();
|
||||
if (IsAsyncMethod(invocation.MethodInvocationTarget))
|
||||
{
|
||||
invocation.ReturnValue = InterceptAsync((dynamic)invocation.ReturnValue, invocation);
|
||||
}
|
||||
else
|
||||
{
|
||||
AfterProceedSync(invocation);
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckMethodReturnTypeIsTaskType(MethodInfo method)
|
||||
{
|
||||
var methodReturnType = method.ReturnType;
|
||||
if (methodReturnType.IsGenericType)
|
||||
{
|
||||
if (methodReturnType.GetGenericTypeDefinition() == typeof(Task<>) ||
|
||||
methodReturnType.GetGenericTypeDefinition() == typeof(ValueTask<>))
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (methodReturnType == typeof(Task) ||
|
||||
methodReturnType == typeof(ValueTask))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool IsAsyncMethod(MethodInfo method)
|
||||
{
|
||||
bool isDefAsync = Attribute.IsDefined(method, typeof(AsyncStateMachineAttribute), false);
|
||||
bool isTaskType = CheckMethodReturnTypeIsTaskType(method);
|
||||
bool isAsync = isDefAsync && isTaskType;
|
||||
|
||||
return isAsync;
|
||||
}
|
||||
|
||||
protected object ProceedAsyncResult { get; set; }
|
||||
|
||||
|
||||
private async Task InterceptAsync(Task task, IInvocation invocation)
|
||||
{
|
||||
await task.ConfigureAwait(false);
|
||||
await AfterProceedAsync(invocation, false);
|
||||
}
|
||||
|
||||
private async Task<TResult> InterceptAsync<TResult>(Task<TResult> task, IInvocation invocation)
|
||||
{
|
||||
ProceedAsyncResult = await task.ConfigureAwait(false);
|
||||
await AfterProceedAsync(invocation, true);
|
||||
return (TResult)ProceedAsyncResult;
|
||||
}
|
||||
|
||||
private async ValueTask InterceptAsync(ValueTask task, IInvocation invocation)
|
||||
{
|
||||
await task.ConfigureAwait(false);
|
||||
await AfterProceedAsync(invocation, false);
|
||||
}
|
||||
|
||||
private async ValueTask<TResult> InterceptAsync<TResult>(ValueTask<TResult> task, IInvocation invocation)
|
||||
{
|
||||
ProceedAsyncResult = await task.ConfigureAwait(false);
|
||||
await AfterProceedAsync(invocation, true);
|
||||
return (TResult)ProceedAsyncResult;
|
||||
}
|
||||
|
||||
protected virtual void BeforeProceed(IInvocation invocation) { }
|
||||
|
||||
protected virtual void AfterProceedSync(IInvocation invocation) { }
|
||||
|
||||
protected virtual Task AfterProceedAsync(IInvocation invocation, bool hasAsynResult)
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,499 +0,0 @@
|
||||
//using System;
|
||||
//using Castle.DynamicProxy;
|
||||
//using IRaCIS.Core.Application.Contracts.Dicom.DTO;
|
||||
//using IRaCIS.Core.Infra.EFCore;
|
||||
|
||||
//using System.Linq;
|
||||
//using IRaCIS.Core.Domain.Models;
|
||||
//using IRaCIS.Core.Domain.Share;
|
||||
|
||||
//namespace IRaCIS.Core.API.Utility.AOP
|
||||
//{
|
||||
//#pragma warning disable
|
||||
// public class QANoticeAOP : IInterceptor
|
||||
// {
|
||||
// private readonly IRepository<QANotice> _qaNoticeRepository;
|
||||
|
||||
// private readonly IRepository<DicomStudy> _studyRepository;
|
||||
// private readonly IRepository<TrialUser> _userTrialRepository;
|
||||
// private readonly IRepository<TrialSiteUser> _userTrialSiteRepository;
|
||||
// private readonly IUserInfo _userInfo;
|
||||
|
||||
// public QANoticeAOP(IRepository<QANotice> qaNoticeRepository,
|
||||
// IUserInfo userInfo, IRepository<DicomStudy> studyRepository, IRepository<TrialUser> userTrialRepository, IRepository<TrialSiteUser> userTrialSiteRepository)
|
||||
// {
|
||||
// _qaNoticeRepository = qaNoticeRepository;
|
||||
|
||||
// _studyRepository = studyRepository;
|
||||
// _userTrialRepository = userTrialRepository;
|
||||
// _userTrialSiteRepository = userTrialSiteRepository;
|
||||
// _userInfo = userInfo;
|
||||
// }
|
||||
|
||||
// public void Intercept(IInvocation invocation)
|
||||
// {
|
||||
// //处理拦截的方法
|
||||
// invocation.Proceed();
|
||||
|
||||
// if (invocation.Method.Name == "UpdateStudyStatus")
|
||||
// {
|
||||
// var studyStatus = invocation.Arguments[0] as StudyStatusDetailCommand;
|
||||
|
||||
// var study = _studyRepository.FirstOrDefault(t=>t.Id==studyStatus.StudyId);
|
||||
|
||||
|
||||
// if (study.Status == (int)StudyStatus.Uploaded)
|
||||
// {
|
||||
// _qaNoticeRepository.Add(new QANotice()
|
||||
// {
|
||||
// TrialId = study.TrialId,
|
||||
// SubjectVisitId = study.Id,
|
||||
// FromUser = _userInfo.RealName,
|
||||
// FromUserId = _userInfo.Id,
|
||||
// FromUserType = _userInfo.UserTypeShortName,
|
||||
|
||||
// NoticeTypeEnum = NoticeType.NotNeedNotice,
|
||||
// NeedDeal = false,
|
||||
// StudyStatusStr = "Uploaded",
|
||||
// Message = $"CRC : {_userInfo.RealName} has uploaded {study.StudyCode} ",
|
||||
// SendTime = DateTime.Now,
|
||||
// });
|
||||
// }
|
||||
|
||||
// #region 处理QA通知模块
|
||||
|
||||
// //查询项目的参与者 和 负责site下CRC用户
|
||||
// var trialUserList = _userTrialRepository.Where(t => t.TrialId == study.TrialId).ToList();
|
||||
|
||||
// // 找到该study 关联Site 下的CRC
|
||||
|
||||
// var crcList = _userTrialSiteRepository.Where(t =>
|
||||
// t.SiteId == study.SiteId && t.User.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator && t.TrialId == study.TrialId).ToList();
|
||||
|
||||
|
||||
// var qaList = trialUserList.Where(t => t.User.UserTypeEnum == UserTypeEnum.IQC).ToList();
|
||||
|
||||
// var pm = trialUserList.FirstOrDefault(t => t.User.UserTypeEnum == UserTypeEnum.ProjectManager);
|
||||
|
||||
|
||||
|
||||
|
||||
// // CRC =>QA
|
||||
// if (studyStatus.Status == (int)StudyStatus.QARequested)
|
||||
// {
|
||||
// //找出当前操作的CRC
|
||||
// //PM 或者admin可以代替CRC角色 不能从CRC列表中查询用户
|
||||
// //var currentCRC = trialUserList.First(t => t.UserId == _userInfo.Id);
|
||||
|
||||
// var notice = new QANotice()
|
||||
// {
|
||||
// TrialId = study.TrialId,
|
||||
// SubjectVisitId = study.Id,
|
||||
// FromUser = _userInfo.RealName,
|
||||
// FromUserId = _userInfo.Id,
|
||||
// FromUserType = _userInfo.UserTypeShortName,
|
||||
|
||||
// //FromUser = currentCRC.UserRealName,
|
||||
// //FromUserId = _userInfo.Id,
|
||||
// //FromUserType = currentCRC.UserType,
|
||||
// NoticeTypeEnum = NoticeType.CRC_RequestToQA_NoticeQA,
|
||||
// NeedDeal = true,
|
||||
// StudyStatusStr = "QA Requested",
|
||||
// Message =
|
||||
// $"CRC -> QA : {_userInfo.RealName} request QA {study.StudyCode} , Inquiry can be performed! ",
|
||||
// SendTime = DateTime.Now,
|
||||
// };
|
||||
|
||||
// qaList.ForEach(t => notice.QANoticeUserList.Add(new QANoticeUser()
|
||||
// {
|
||||
// QANoticeId = notice.Id,
|
||||
// SubjectVisitId = study.Id,
|
||||
// ToUser = t.User.LastName + " / " + t.User.FirstName,
|
||||
// ToUserId = t.UserId,
|
||||
// ToUserType = t.User.UserTypeRole.UserTypeShortName
|
||||
// }));
|
||||
|
||||
// _qaNoticeRepository.Add(notice);
|
||||
|
||||
// //DealRequestToQA(study.Id);
|
||||
|
||||
// var needDealNoticeList = _qaNoticeRepository.AsQueryable()
|
||||
// .Where(t => t.SubjectVisitId == study.Id && t.NeedDeal && t.NoticeTypeEnum == NoticeType.CRC_RequestToQA_NoticeQA).ToList();
|
||||
|
||||
// needDealNoticeList.ForEach(t =>
|
||||
// {
|
||||
// t.NeedDeal = false;
|
||||
// t.DealTime = DateTime.Now;
|
||||
// _qaNoticeRepository.Update(t);
|
||||
// });
|
||||
// }
|
||||
|
||||
// // QA =>CRC 向CRC推送消息影像有问题 同时作为 requestToQA 的边界
|
||||
// else if (studyStatus.Status == (int)StudyStatus.QAing)
|
||||
// {
|
||||
// //找出当前操作的QA 如果是pm 或者admin 代替操作 此时会有问题 所以 谁代替,就以谁的名义执行
|
||||
// //var currentQA = qaList.First(t => t.UserId == _userInfo.Id);
|
||||
// //var currentQA = trialUserList.First(t => t.UserId == _userInfo.Id);
|
||||
|
||||
// //在项目CRC列表中筛选出 负责该study关联 site的CRC
|
||||
// var siteCRCList = _userTrialSiteRepository.Where(t =>
|
||||
// t.SiteId == study.SiteId && t.User.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator && t.TrialId == study.TrialId).ToList();
|
||||
|
||||
// //查询项目的参与者 和 负责site下CRC用户
|
||||
|
||||
|
||||
|
||||
// var notice = new QANotice()
|
||||
// {
|
||||
// TrialId = study.TrialId,
|
||||
// SubjectVisitId = study.Id,
|
||||
// //FromUser = currentQA.UserRealName,
|
||||
// //FromUserId = _userInfo.Id,
|
||||
// //FromUserType = currentQA.UserType,
|
||||
// FromUser = _userInfo.RealName,
|
||||
// FromUserId = _userInfo.Id,
|
||||
// FromUserType = _userInfo.UserTypeShortName,
|
||||
// NoticeTypeEnum = NoticeType.QA_InQA_NoticeCRC,
|
||||
// NeedDeal = true,
|
||||
// StudyStatusStr = "In QA",
|
||||
// Message = $"QA -> CRC : {_userInfo.RealName} inquiry {study.StudyCode} ",
|
||||
// SendTime = DateTime.Now,
|
||||
// };
|
||||
|
||||
// siteCRCList.ForEach(t => notice.QANoticeUserList.Add(new QANoticeUser()
|
||||
// {
|
||||
// QANoticeId = notice.Id,
|
||||
// SubjectVisitId = study.Id,
|
||||
// ToUser = t.User.LastName + " / " + t.User.FirstName,
|
||||
// ToUserId = t.UserId,
|
||||
// ToUserType = t.UserTypeRole.UserTypeShortName
|
||||
// }));
|
||||
|
||||
// //添加 发送给CRC的消息 消息和CRC是 一对多
|
||||
// _qaNoticeRepository.Add(notice);
|
||||
|
||||
|
||||
// //处理 消息 标记已处理
|
||||
// var needDealNoticeList = _qaNoticeRepository.AsQueryable()
|
||||
// .Where(t => t.SubjectVisitId == study.Id && t.NeedDeal &&
|
||||
// (t.NoticeTypeEnum == NoticeType.CRC_RequestToQA_NoticeQA ||
|
||||
// t.NoticeTypeEnum == NoticeType.CRC_ReUpload_NoticeQA ||
|
||||
// t.NoticeTypeEnum == NoticeType.CRC_QARecordDialogPost_NoticeQA)).ToList();
|
||||
|
||||
// needDealNoticeList.ForEach(t =>
|
||||
// {
|
||||
// t.NeedDeal = false;
|
||||
// t.DealTime = DateTime.Now;
|
||||
// _qaNoticeRepository.Update(t);
|
||||
// });
|
||||
|
||||
|
||||
// }
|
||||
// // QA =>QA 给自己的消息 通知需要匿名化 同时作为 requestToQA 的边界
|
||||
// else if (studyStatus.Status == (int)StudyStatus.QAFinish)
|
||||
// {
|
||||
|
||||
// //找出当前操作的QA 如果是pm 或者admin 代替操作 此时会有问题 所以 谁代替,就以谁的名义执行
|
||||
// //var currentQA = qaList.First(t => t.UserId == _userInfo.Id);
|
||||
// //var currentQA = trialUserList.First(t => t.UserId == _userInfo.Id);
|
||||
|
||||
// //发送给当前项目QA列表
|
||||
|
||||
// var notice = new QANotice()
|
||||
// {
|
||||
// TrialId = study.TrialId,
|
||||
// SubjectVisitId = study.Id,
|
||||
// //FromUser = currentQA.UserRealName,
|
||||
// //FromUserId = _userInfo.Id,
|
||||
// //FromUserType = currentQA.UserType,
|
||||
// FromUser = _userInfo.RealName,
|
||||
// FromUserId = _userInfo.Id,
|
||||
// FromUserType = _userInfo.UserTypeShortName,
|
||||
// NoticeTypeEnum = NoticeType.QA_QAPass_NoticeQA,
|
||||
// NeedDeal = true,
|
||||
// StudyStatusStr = "QA-Passed",
|
||||
// Message =
|
||||
// $"QA -> QA : {_userInfo.RealName} inquiry {study.StudyCode} finished,Anonymization can be performed!",
|
||||
// SendTime = DateTime.Now,
|
||||
// };
|
||||
|
||||
// qaList.ForEach(t => notice.QANoticeUserList.Add(new QANoticeUser()
|
||||
// {
|
||||
// QANoticeId = notice.Id,
|
||||
// SubjectVisitId = study.Id,
|
||||
// ToUser = t.User.LastName+" / "+t.User.FirstName,
|
||||
// ToUserId = t.UserId,
|
||||
// ToUserType = t.User.UserTypeRole.UserTypeShortName
|
||||
// }));
|
||||
|
||||
// _qaNoticeRepository.Add(notice);
|
||||
|
||||
// //处理 消息 标记已处理 存在意外情况 qa发给CRC的 但是qa里面设置了 通过或者不通过 此时qa发送的消息也设置为已处理
|
||||
// var needDealNoticeList = _qaNoticeRepository.AsQueryable()
|
||||
// .Where(t => t.SubjectVisitId == study.Id && t.NeedDeal &&
|
||||
// (t.NoticeTypeEnum == NoticeType.CRC_RequestToQA_NoticeQA ||
|
||||
// t.NoticeTypeEnum == NoticeType.CRC_ReUpload_NoticeQA ||
|
||||
// t.NoticeTypeEnum == NoticeType.CRC_QARecordDialogPost_NoticeQA ||
|
||||
|
||||
// t.NoticeTypeEnum == NoticeType.QA_QARecordDialogPost_NoticeCRC ||
|
||||
// t.NoticeTypeEnum == NoticeType.QA_InQA_NoticeCRC ||
|
||||
// t.NoticeTypeEnum == NoticeType.QA_AddQARecord_NoticeCRC)).ToList();
|
||||
|
||||
// needDealNoticeList.ForEach(t =>
|
||||
// {
|
||||
// t.NeedDeal = false;
|
||||
// t.DealTime = DateTime.Now;
|
||||
// _qaNoticeRepository.Update(t);
|
||||
// });
|
||||
|
||||
|
||||
// }
|
||||
// // QA =>CRC 暂时不用发送消息给CRC 因为CRC 暂时没有入口回复 同时作为 requestToQA 的边界
|
||||
// else if (studyStatus.Status == (int)StudyStatus.QAFInishNotPass)
|
||||
// {
|
||||
|
||||
// _qaNoticeRepository.Add(new QANotice()
|
||||
// {
|
||||
// TrialId = study.TrialId,
|
||||
// SubjectVisitId = study.Id,
|
||||
// FromUser = _userInfo.RealName,
|
||||
// FromUserId = _userInfo.Id,
|
||||
// FromUserType = _userInfo.UserTypeShortName,
|
||||
// NoticeTypeEnum = NoticeType.NotNeedNotice,
|
||||
// NeedDeal = false,
|
||||
// StudyStatusStr = "QA-Failed",
|
||||
// Message = $"QA : {_userInfo.RealName} set {study.StudyCode} QA-Failed !",
|
||||
// SendTime = DateTime.Now,
|
||||
// });
|
||||
|
||||
// //处理 消息 标记已处理
|
||||
// var needDealNoticeList = _qaNoticeRepository.AsQueryable()
|
||||
// .Where(t => t.SubjectVisitId == study.Id && t.NeedDeal &&
|
||||
// (t.NoticeTypeEnum == NoticeType.CRC_RequestToQA_NoticeQA ||
|
||||
// t.NoticeTypeEnum == NoticeType.CRC_ReUpload_NoticeQA ||
|
||||
// t.NoticeTypeEnum == NoticeType.CRC_QARecordDialogPost_NoticeQA ||
|
||||
|
||||
|
||||
// t.NoticeTypeEnum == NoticeType.QA_QARecordDialogPost_NoticeCRC ||
|
||||
// t.NoticeTypeEnum == NoticeType.QA_InQA_NoticeCRC ||
|
||||
// t.NoticeTypeEnum == NoticeType.QA_AddQARecord_NoticeCRC)).ToList();
|
||||
|
||||
// needDealNoticeList.ForEach(t =>
|
||||
// {
|
||||
// t.NeedDeal = false;
|
||||
// t.DealTime = DateTime.Now;
|
||||
// _qaNoticeRepository.Update(t);
|
||||
// });
|
||||
// }
|
||||
|
||||
// #endregion
|
||||
|
||||
|
||||
// }
|
||||
|
||||
// else if (invocation.Method.Name == "ReUploadSameStudy")
|
||||
// {
|
||||
// var studyId = Guid.Parse(invocation.Arguments[0].ToString());
|
||||
|
||||
// var study = _studyRepository.FirstOrDefault(t => t.Id == studyId);
|
||||
// var status = study.Status;
|
||||
|
||||
// //处理CRC 重传时 QA消息
|
||||
|
||||
// if (status == (int)StudyStatus.QAing)
|
||||
// {
|
||||
// //查询项目的参与者 和 负责site下CRC用户
|
||||
// var trialUserList = _userTrialRepository.Where(t => t.TrialId == study.TrialId).ToList();
|
||||
|
||||
// // 找到该study 关联Site 下的CRC
|
||||
|
||||
// var crcList = _userTrialSiteRepository.Where(t =>
|
||||
// t.SiteId == study.SiteId && t.User.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator && t.TrialId == study.TrialId).ToList();
|
||||
|
||||
// var qaList = trialUserList.Where(t => t.User.UserTypeEnum == UserTypeEnum.IQC).ToList();
|
||||
|
||||
// //CRC =>QA CRC的职能被PM 或者admin代替
|
||||
// //if (_userInfo.UserTypeEnumInt == (int)UserType.ClinicalResearchCoordinator)
|
||||
// {
|
||||
// //PM 或者admin可以代替CRC角色 不能从CRC列表中查询用户
|
||||
// //var currentCRC = trialUserList.First(t => t.UserId == _userInfo.Id);
|
||||
|
||||
// var notice = new QANotice()
|
||||
// {
|
||||
// TrialId = study.TrialId,
|
||||
// SubjectVisitId = study.Id,
|
||||
// //FromUser = currentCRC.UserRealName,
|
||||
// //FromUserId = _userInfo.Id,
|
||||
// //FromUserType = currentCRC.UserType,
|
||||
// FromUser = _userInfo.RealName,
|
||||
// FromUserId = _userInfo.Id,
|
||||
// FromUserType = _userInfo.UserTypeShortName,
|
||||
// NoticeTypeEnum = NoticeType.CRC_ReUpload_NoticeQA,
|
||||
// NeedDeal = true,
|
||||
// Message = $"CRC -> QA :{_userInfo.RealName} has reuploaded {study.StudyCode} , Need to be inquiry again",
|
||||
// SendTime = DateTime.Now
|
||||
// };
|
||||
|
||||
// qaList.ForEach(t => notice.QANoticeUserList.Add(new QANoticeUser()
|
||||
// {
|
||||
// QANoticeId = notice.Id,
|
||||
// SubjectVisitId = study.Id,
|
||||
// ToUser = t.User.LastName+" / "+t.User.FirstName,
|
||||
// ToUserId = t.UserId,
|
||||
// ToUserType = t.User.UserTypeRole.UserTypeShortName
|
||||
// }));
|
||||
|
||||
// _qaNoticeRepository.Add(notice);
|
||||
|
||||
// //这里作为 QA 设置 Inqa 状态的回复 或者QA和CRC对话的
|
||||
// var needDealNoticeList = _qaNoticeRepository.Where(t => t.SubjectVisitId == study.Id && t.NeedDeal
|
||||
// && (t.NoticeTypeEnum == NoticeType.QA_InQA_NoticeCRC || t.NoticeTypeEnum == NoticeType.QA_QARecordDialogPost_NoticeCRC))
|
||||
// .ToList();
|
||||
|
||||
// needDealNoticeList.ForEach(t =>
|
||||
// {
|
||||
// t.NeedDeal = false;
|
||||
// t.DealTime = DateTime.Now;
|
||||
// _qaNoticeRepository.Update(t);
|
||||
// });
|
||||
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //不是QAing 的重传 不发送qa消息
|
||||
// return;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// }
|
||||
|
||||
// else if (invocation.Method.Name == "DicomAnonymize")
|
||||
// {
|
||||
// var studyId = Guid.Parse(invocation.Arguments[0].ToString());
|
||||
|
||||
// var study = _studyRepository.FirstOrDefault(t => t.Id == studyId);
|
||||
|
||||
// #region 处理QA通知 匿名化完毕 通知PM
|
||||
|
||||
// //查询项目的参与者 和 负责site下CRC用户
|
||||
// var trialUserList = _userTrialRepository.Where(t => t.TrialId == study.TrialId).ToList();
|
||||
|
||||
// // 找到该study 关联Site 下的CRC
|
||||
|
||||
// var crcList = _userTrialSiteRepository.Where(t =>
|
||||
// t.SiteId == study.SiteId && t.User.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator && t.TrialId == study.TrialId).ToList();
|
||||
|
||||
// var qaList = trialUserList.Where(t => t.User.UserTypeEnum == UserTypeEnum.IQC).ToList();
|
||||
|
||||
// //
|
||||
// var pm = trialUserList.FirstOrDefault(t => t.User.UserTypeEnum == UserTypeEnum.ProjectManager);
|
||||
|
||||
|
||||
// //找出当前操作的QA 如果是pm 或者admin 代替操作 此时会有问题 所以 谁代替,就以谁的名义执行
|
||||
// //var currentQA = trialUserList.First(t =>
|
||||
// // t.UserTypeEnum == UserType.IQC && t.UserId == _userInfo.Id);
|
||||
// //var currentQA = trialUserList.First(t => t.UserId == _userInfo.Id);
|
||||
|
||||
// var notice = new QANotice()
|
||||
// {
|
||||
// TrialId = study.TrialId,
|
||||
// SubjectVisitId = study.Id,
|
||||
// //FromUser = currentQA.UserRealName,
|
||||
// //FromUserId = _userInfo.Id,
|
||||
// //FromUserType = currentQA.UserType,
|
||||
// FromUser = _userInfo.RealName,
|
||||
// FromUserId = _userInfo.Id,
|
||||
// FromUserType = _userInfo.UserTypeShortName,
|
||||
// NoticeTypeEnum = NoticeType.QA_Anonymized_NoticeQA,
|
||||
// NeedDeal = true,
|
||||
// StudyStatusStr = "Anonymized",
|
||||
// //Message = $"QA -> PM :{_userInfo.RealName} has anonymized {study.StudyCode} ,Forward can be performed!!",
|
||||
// Message = $"QA -> QA :{_userInfo.RealName} has anonymized {study.StudyCode} ,Forward can be performed!!",
|
||||
|
||||
// SendTime = DateTime.Now,
|
||||
|
||||
// };
|
||||
|
||||
// //notice.QANoticeUserList.Add(new QANoticeUser()
|
||||
// //{
|
||||
// // QANoticeId = notice.Id,
|
||||
// // StudyId = study.Id,
|
||||
// // ToUser = pm.UserRealName,
|
||||
// // ToUserId = pm.UserId,
|
||||
// // ToUserType = pm.UserType
|
||||
// //});
|
||||
|
||||
// qaList.ForEach(t => notice.QANoticeUserList.Add(new QANoticeUser()
|
||||
// {
|
||||
// QANoticeId = notice.Id,
|
||||
// SubjectVisitId = study.Id,
|
||||
// ToUser = t.User.LastName+" / "+t.User.FirstName,
|
||||
// ToUserId = t.UserId,
|
||||
// ToUserType = t.User.UserTypeRole.UserTypeShortName
|
||||
// }));
|
||||
|
||||
// _qaNoticeRepository.Add(notice);
|
||||
|
||||
// var needDealNoticeList = _qaNoticeRepository.AsQueryable()
|
||||
// .Where(t => t.SubjectVisitId == study.Id && t.NeedDeal && (t.NoticeTypeEnum == NoticeType.QA_QAPass_NoticeQA)).ToList();
|
||||
|
||||
// needDealNoticeList.ForEach(t =>
|
||||
// {
|
||||
// t.NeedDeal = false;
|
||||
// t.DealTime = DateTime.Now;
|
||||
// _qaNoticeRepository.Update(t);
|
||||
// });
|
||||
|
||||
|
||||
// #endregion
|
||||
// }
|
||||
|
||||
// else if (invocation.Method.Name == "ForwardStudy")
|
||||
// {
|
||||
// var studyId = Guid.Parse(invocation.Arguments[0].ToString());
|
||||
|
||||
// var study = _studyRepository.FirstOrDefault(t => t.Id == studyId);
|
||||
|
||||
// //匿名化操作产生的消息 设置为已经处理
|
||||
// _qaNoticeRepository.Add(new QANotice()
|
||||
// {
|
||||
// TrialId = study.TrialId,
|
||||
// SubjectVisitId = study.Id,
|
||||
// //FromUser = currentQA.UserRealName,
|
||||
// //FromUserId = _userInfo.Id,
|
||||
// //FromUserType = currentQA.UserType,
|
||||
// FromUser = _userInfo.RealName,
|
||||
// FromUserId = _userInfo.Id,
|
||||
// FromUserType = _userInfo.UserTypeShortName,
|
||||
// NoticeTypeEnum = NoticeType.NotNeedNotice,
|
||||
// NeedDeal = false,
|
||||
// StudyStatusStr = "Forwarded",
|
||||
// //Message = $"PM :{_userInfo.RealName} has forwarded {study.StudyCode} !",
|
||||
// Message = $"QA :{_userInfo.RealName} has forwarded {study.StudyCode} !",
|
||||
// SendTime = DateTime.Now,
|
||||
// });
|
||||
|
||||
// var needDealList = _qaNoticeRepository.Where(t =>
|
||||
// t.SubjectVisitId == study.Id && t.NeedDeal && t.NoticeTypeEnum == NoticeType.QA_Anonymized_NoticeQA).ToList();
|
||||
|
||||
// needDealList.ForEach(t =>
|
||||
// {
|
||||
// t.NeedDeal = false;
|
||||
// t.DealTime = DateTime.Now;
|
||||
// _qaNoticeRepository.Update(t);
|
||||
// });
|
||||
// }
|
||||
|
||||
// var success = _qaNoticeRepository.SaveChanges();
|
||||
|
||||
// if (!success)
|
||||
// {
|
||||
// throw new Exception("Send QA message failed");
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// }
|
||||
//}
|
||||
@@ -1,89 +0,0 @@
|
||||
using Castle.DynamicProxy;
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
|
||||
namespace IRaCIS.Core.Application.AOP
|
||||
{
|
||||
public class TrialStatusAutofacAOP : IAsyncInterceptor
|
||||
{
|
||||
private readonly IEasyCachingProvider _provider;
|
||||
|
||||
public TrialStatusAutofacAOP(IEasyCachingProvider provider)
|
||||
{
|
||||
_provider = provider;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void InterceptAsynchronous(IInvocation invocation)
|
||||
{
|
||||
invocation.Proceed();
|
||||
}
|
||||
|
||||
//这里AOP 处理两个方法 分别是 项目的添加和更新、项目状态的变更
|
||||
|
||||
public void InterceptAsynchronous<TResult>(IInvocation invocation)
|
||||
{
|
||||
|
||||
|
||||
//处理拦截的方法
|
||||
invocation.Proceed();
|
||||
|
||||
|
||||
|
||||
dynamic result = invocation.ReturnValue;
|
||||
|
||||
//接口成功了,才修改缓存
|
||||
if (!result.IsSuccess)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#region 处理项目列表的查询 在前端界面已经在某个界面,但是服务器重置了,此时没有缓存项目信息,接口不能正确返回,因故采用,启动时查询,每天查询一次,缓存一天,然后项目添加、更改状态时,及时更新
|
||||
|
||||
//if (invocation.Method.Name == "GetTrialList")
|
||||
//{
|
||||
// //在此 将当前查询的项目Id 和对应的项目状态进行缓存
|
||||
// dynamic result = invocation.ReturnValue;
|
||||
// foreach (var item in result.CurrentPageData)
|
||||
// {
|
||||
// _provider.Remove(item.Id.ToString());
|
||||
// _provider.Set(item.Id.ToString(), item.TrialStatusStr.ToString(), TimeSpan.FromDays(1));
|
||||
// }
|
||||
//}
|
||||
|
||||
#endregion
|
||||
|
||||
if (invocation.Method.Name == "AddOrUpdateTrial")
|
||||
{
|
||||
//如果是添加 那么将对应的初始状态加进去 更新状态是单独操作的
|
||||
|
||||
var trialModel = (invocation.Arguments[0] as TrialCommand).IfNullThrowConvertException();
|
||||
if (trialModel.Id == null || trialModel.Id == Guid.Empty)
|
||||
{
|
||||
_provider.Set(result.Data.Id.ToString(), StaticData.TrialState.TrialOngoing, TimeSpan.FromDays(1));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// 更新缓存
|
||||
else if (invocation.Method.Name == "UpdateTrialStatus")
|
||||
{
|
||||
//项目状态更新,也需要及时更新
|
||||
_provider.Set(invocation.Arguments[0].ToString(), invocation.Arguments[1].ToString(), TimeSpan.FromDays(1));
|
||||
|
||||
////Test参数是否符合要求
|
||||
//var tt = invocation.Arguments[0].ToString();
|
||||
//var cc = _provider.Get<string>(invocation.Arguments[0].ToString());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void InterceptSynchronous(IInvocation invocation)
|
||||
{
|
||||
invocation.Proceed();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Core.Domain;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Quartz;
|
||||
|
||||
namespace IRaCIS.Application.Services.BackGroundJob
|
||||
{
|
||||
|
||||
public class CacheTrialStatusQuartZJob: IJob
|
||||
{
|
||||
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly IEasyCachingProvider _provider;
|
||||
private readonly ILogger<CacheTrialStatusQuartZJob> _logger;
|
||||
|
||||
public CacheTrialStatusQuartZJob(IRepository<Trial> trialRepository, IEasyCachingProvider provider,ILogger<CacheTrialStatusQuartZJob> logger)
|
||||
{
|
||||
_trialRepository = trialRepository;
|
||||
_provider = provider;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public Task Execute(IJobExecutionContext context)
|
||||
|
||||
{
|
||||
_logger.LogInformation($"开始执行QuartZ定时任务作业");
|
||||
try
|
||||
{
|
||||
var list = _trialRepository.Select(t => new { TrialId = t.Id, TrialStatusStr = t.TrialStatusStr })
|
||||
.ToList();
|
||||
|
||||
list.ForEach(t => _provider.Set(t.TrialId.ToString(), t.TrialStatusStr, TimeSpan.FromDays(1)));
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.LogError($" 查询和缓存过程出现异常"+e.Message);
|
||||
}
|
||||
_logger.LogInformation("QuartZ定时任务作业结束");
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
using EasyCaching.Core;
|
||||
using Hangfire;
|
||||
using Hangfire.Storage;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Application.Service;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace IRaCIS.Application.Services.BackGroundJob
|
||||
{
|
||||
|
||||
public interface IIRaCISHangfireJob
|
||||
{
|
||||
|
||||
Task MemoryCacheTrialStatusAsync();
|
||||
|
||||
Task InitHangfireJobTaskAsync();
|
||||
|
||||
}
|
||||
public class IRaCISCHangfireJob : IIRaCISHangfireJob
|
||||
{
|
||||
public static string JsonFileFolder = Path.Combine(AppContext.BaseDirectory, StaticData.Folder.Resources);
|
||||
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly IEasyCachingProvider _provider;
|
||||
private readonly ILogger<IRaCISCHangfireJob> _logger;
|
||||
private readonly IRepository<SystemAnonymization> _systemAnonymizationRepository;
|
||||
private readonly IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository;
|
||||
private readonly IRepository<Internationalization> _internationalizationRepository;
|
||||
|
||||
|
||||
|
||||
public IRaCISCHangfireJob(IRepository<Trial> trialRepository, ILogger<IRaCISCHangfireJob> logger, IEasyCachingProvider provider, IRepository<TrialEmailNoticeConfig> trialEmailNoticeConfigRepository, IRepository<Internationalization> internationalizationRepository, IRepository<SystemAnonymization> systemAnonymizationRepository)
|
||||
{
|
||||
_trialRepository = trialRepository;
|
||||
_provider = provider;
|
||||
_logger = logger;
|
||||
_trialEmailNoticeConfigRepository = trialEmailNoticeConfigRepository;
|
||||
_internationalizationRepository = internationalizationRepository;
|
||||
_systemAnonymizationRepository = systemAnonymizationRepository;
|
||||
}
|
||||
|
||||
public async Task InitHangfireJobTaskAsync()
|
||||
{
|
||||
_logger.LogInformation("项目启动 hangfire 任务初始化 执行开始~");
|
||||
|
||||
|
||||
//项目状态 立即加载到缓存中
|
||||
await MemoryCacheTrialStatusAsync();
|
||||
|
||||
await MemoryCacheAnonymizeData();
|
||||
|
||||
|
||||
//创建项目缓存 定时任务
|
||||
HangfireJobHelper.AddOrUpdateInitCronJob<IIRaCISHangfireJob>("RecurringJob_Cache_TrialState", t => t.MemoryCacheTrialStatusAsync(), Cron.Daily());
|
||||
|
||||
//初始化
|
||||
|
||||
await InitInternationlizationDataAndWatchJsonFileAsync();
|
||||
|
||||
//创建邮件定时任务
|
||||
await InitSysAndTrialCronJobAsync();
|
||||
|
||||
|
||||
_logger.LogInformation("项目启动 hangfire 任务初始化 执行结束");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 缓存项目状态
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task MemoryCacheTrialStatusAsync()
|
||||
{
|
||||
|
||||
var list = await _trialRepository.Select(t => new { TrialId = t.Id, TrialStatusStr = t.TrialStatusStr })
|
||||
.ToListAsync();
|
||||
|
||||
list.ForEach(t => _provider.Set(t.TrialId.ToString(), t.TrialStatusStr, TimeSpan.FromDays(7)));
|
||||
|
||||
}
|
||||
|
||||
public async Task MemoryCacheAnonymizeData()
|
||||
{
|
||||
var systemAnonymizationList = await _systemAnonymizationRepository.Where(t => t.IsEnable).ToListAsync();
|
||||
|
||||
_provider.Set(StaticData.Anonymize.Anonymize_AddFixedFiled, systemAnonymizationList.Where(t => t.IsAdd && t.IsFixed).ToList(), TimeSpan.FromDays(7));
|
||||
_provider.Set(StaticData.Anonymize.Anonymize_AddIRCInfoFiled, systemAnonymizationList.Where(t => t.IsAdd && t.IsFixed == false).ToList(), TimeSpan.FromDays(7));
|
||||
_provider.Set(StaticData.Anonymize.Anonymize_FixedField, systemAnonymizationList.Where(t => t.IsAdd == false && t.IsFixed).ToList(), TimeSpan.FromDays(7));
|
||||
_provider.Set(StaticData.Anonymize.Anonymize_IRCInfoField, systemAnonymizationList.Where(t => t.IsAdd == false && t.IsFixed == false).ToList(), TimeSpan.FromDays(7));
|
||||
}
|
||||
|
||||
|
||||
#region 国际化 初始化
|
||||
|
||||
|
||||
public async Task InitInternationlizationDataAndWatchJsonFileAsync()
|
||||
{
|
||||
//查询数据库的数据
|
||||
var toJsonList = await _internationalizationRepository.Where(t => t.InternationalizationType == 1).Select(t => new
|
||||
{
|
||||
t.Code,
|
||||
t.Value,
|
||||
t.ValueCN
|
||||
}).ToListAsync();
|
||||
|
||||
//组织成json 文件
|
||||
|
||||
var usJsonPath = Path.Combine(JsonFileFolder, StaticData.En_US_Json);
|
||||
var cnJsonPath = Path.Combine(JsonFileFolder, StaticData.Zh_CN_Json);
|
||||
|
||||
|
||||
//本地静态文件国际化需要
|
||||
foreach (var tojsonItem in toJsonList)
|
||||
{
|
||||
StaticData.En_US_Dic[tojsonItem.Code] = tojsonItem.Value;
|
||||
StaticData.Zh_CN_Dic[tojsonItem.Code] = tojsonItem.ValueCN;
|
||||
}
|
||||
|
||||
File.WriteAllText(usJsonPath, JsonConvert.SerializeObject(StaticData.En_US_Dic));
|
||||
File.WriteAllText(cnJsonPath, JsonConvert.SerializeObject(StaticData.Zh_CN_Dic));
|
||||
|
||||
|
||||
//监测Json文件变更 实时刷新数据
|
||||
WatchJsonFile(usJsonPath);
|
||||
WatchJsonFile(cnJsonPath);
|
||||
|
||||
}
|
||||
|
||||
public void WatchJsonFile(string filePath)
|
||||
{
|
||||
if (!File.Exists(filePath))
|
||||
{
|
||||
throw new BusinessValidationFailedException(StaticData.International("IRaCISCHangfireJob_FileNotFound"));
|
||||
}
|
||||
|
||||
FileSystemWatcher watcher = new FileSystemWatcher(Path.GetDirectoryName(filePath), Path.GetFileName(filePath));
|
||||
watcher.Changed += (sender, e) => LoadJsonFile(filePath);
|
||||
watcher.EnableRaisingEvents = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void LoadJsonFile(string filePath)
|
||||
{
|
||||
|
||||
IConfigurationBuilder builder = new ConfigurationBuilder().AddJsonFile(filePath);
|
||||
|
||||
IConfigurationRoot enConfiguration = builder.Build();
|
||||
|
||||
foreach (IConfigurationSection section in enConfiguration.GetChildren())
|
||||
{
|
||||
if (filePath.Contains(StaticData.En_US_Json))
|
||||
{
|
||||
StaticData.En_US_Dic[section.Key] = section.Value;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
StaticData.Zh_CN_Dic[section.Key] = section.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public async Task InitSysAndTrialCronJobAsync()
|
||||
{
|
||||
//var deleteJobIdList = await _trialEmailNoticeConfigRepository.Where(t => t.Trial.TrialStatusStr != StaticData.TrialState.TrialOngoing && t.EmailCron != string.Empty && t.IsAutoSend)
|
||||
// .Select(t => t.TrialId + "_" + t.Id)
|
||||
// .ToListAsync();
|
||||
|
||||
//foreach (var jobId in deleteJobIdList)
|
||||
//{
|
||||
// HangfireJobHelper.RemoveCronJob(jobId);
|
||||
//}
|
||||
|
||||
|
||||
var taskInfoList = await _trialEmailNoticeConfigRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing && t.EmailCron != string.Empty && t.IsAutoSend)
|
||||
.Select(t => new { t.Id, t.Code, t.EmailCron, t.BusinessScenarioEnum, t.TrialId })
|
||||
.ToListAsync();
|
||||
|
||||
foreach (var task in taskInfoList)
|
||||
{
|
||||
//利用主键作为任务Id
|
||||
var jobId = $"{task.TrialId}_{task.Id}";
|
||||
|
||||
HangfireJobHelper.AddOrUpdateTrialCronJob(jobId, task.TrialId, task.BusinessScenarioEnum, task.EmailCron);
|
||||
}
|
||||
|
||||
var addOrUpdateJobIdList = taskInfoList.Select(t => $"{t.TrialId}_{t.Id}").ToList();
|
||||
|
||||
var list = JobStorage.Current.GetConnection().GetRecurringJobs().ToList();
|
||||
|
||||
//项目定时任务都在default 队列
|
||||
//var dbJobIdList = JobStorage.Current.GetConnection().GetRecurringJobs().Where(t => t.Queue == "default").Select(t => t.Id).ToList();
|
||||
|
||||
//var deleteList= dbJobIdList.Except(addOrUpdateJobIdList).ToList();
|
||||
|
||||
// foreach (var jobId in deleteList)
|
||||
// {
|
||||
// HangfireJobHelper.RemoveCronJob(jobId);
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.EntityFrameworkCore.SqlServer.Query.Internal;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace IRaCIS.Application.Services.BackGroundJob
|
||||
{
|
||||
|
||||
public interface IIRaCISCacheHangfireJob
|
||||
{
|
||||
|
||||
Task ProjectStartCache();
|
||||
Task MemoryCacheTrialStatus();
|
||||
|
||||
Task MemoryCacheAnonymizeData();
|
||||
|
||||
Task CacheUserTypePermission(Guid? cacheUserTypeId);
|
||||
}
|
||||
public class IRaCISCacheHangfireJob: IIRaCISCacheHangfireJob
|
||||
{
|
||||
private readonly IRepository<Trial> _trialRepository;
|
||||
private readonly IEasyCachingProvider _provider;
|
||||
private readonly ILogger<IRaCISCacheHangfireJob> _logger;
|
||||
private readonly IRepository<SystemAnonymization> _systemAnonymizationRepository;
|
||||
|
||||
private readonly IRepository<UserTypeMenu> _userTypeMenuRepository;
|
||||
|
||||
public IRaCISCacheHangfireJob(IRepository<Trial> trialRepository,
|
||||
IRepository<SystemAnonymization> systemAnonymizationRepository, IRepository<UserTypeMenu> userTypeMenuRepository,
|
||||
IEasyCachingProvider provider,ILogger<IRaCISCacheHangfireJob> logger)
|
||||
{
|
||||
_trialRepository = trialRepository;
|
||||
_provider = provider;
|
||||
_logger = logger;
|
||||
_systemAnonymizationRepository = systemAnonymizationRepository;
|
||||
_userTypeMenuRepository = userTypeMenuRepository;
|
||||
}
|
||||
|
||||
|
||||
public async Task ProjectStartCache()
|
||||
{
|
||||
_logger.LogInformation("hangfire 定时缓存项目状态任务开始~");
|
||||
try
|
||||
{
|
||||
await MemoryCacheTrialStatus();
|
||||
|
||||
await MemoryCacheAnonymizeData();
|
||||
|
||||
await CacheUserTypePermission();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.LogError("hangfire 定时任务执行失败" + e.Message);
|
||||
|
||||
}
|
||||
|
||||
_logger.LogInformation("hangfire 定时任务执行结束");
|
||||
}
|
||||
|
||||
public async Task MemoryCacheTrialStatus()
|
||||
{
|
||||
var list = await _trialRepository.Select(t => new { TrialId = t.Id, TrialStatusStr = t.TrialStatusStr })
|
||||
.ToListAsync();
|
||||
|
||||
list.ForEach(t => _provider.Set(t.TrialId.ToString(), t.TrialStatusStr, TimeSpan.FromDays(7)));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public async Task MemoryCacheAnonymizeData()
|
||||
{
|
||||
var systemAnonymizationList = await _systemAnonymizationRepository.Where(t => t.IsEnable).ToListAsync();
|
||||
|
||||
_provider.Set(StaticData.Anonymize.Anonymize_AddFixedFiled, systemAnonymizationList.Where(t => t.IsAdd && t.IsFixed).ToList(), TimeSpan.FromDays(7));
|
||||
_provider.Set(StaticData.Anonymize.Anonymize_AddIRCInfoFiled, systemAnonymizationList.Where(t => t.IsAdd && t.IsFixed == false).ToList(), TimeSpan.FromDays(7));
|
||||
_provider.Set(StaticData.Anonymize.Anonymize_FixedField, systemAnonymizationList.Where(t => t.IsAdd == false && t.IsFixed).ToList(), TimeSpan.FromDays(7));
|
||||
_provider.Set(StaticData.Anonymize.Anonymize_IRCInfoField, systemAnonymizationList.Where(t => t.IsAdd == false && t.IsFixed == false).ToList(), TimeSpan.FromDays(7));
|
||||
}
|
||||
|
||||
public async Task CacheUserTypePermission(Guid? cacheUserTypeId=null)
|
||||
{
|
||||
|
||||
var permissionList = await _userTypeMenuRepository.Where(t => t.Menu.MenuType == "F")
|
||||
.WhereIf(cacheUserTypeId != null, t => t.UserTypeId == cacheUserTypeId.Value).Select(t => new { t.UserTypeId, t.Menu.PermissionStr }).ToListAsync();
|
||||
|
||||
foreach (var userTypeGroup in permissionList.GroupBy(t => t.UserTypeId))
|
||||
{
|
||||
_provider.Set($"{StaticData.CacheKey.UserTypeId}_{userTypeGroup.Key}", userTypeGroup.Select(t => t.PermissionStr).ToList(), TimeSpan.FromDays(7));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
using EasyCaching.Core;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
@@ -11,9 +14,9 @@ namespace IRaCIS.Core.Application.Filter;
|
||||
|
||||
|
||||
|
||||
public class LimitUserRequestAuthorization :BaseService, IAsyncAuthorizationFilter
|
||||
public class LimitUserRequestAuthorization : IAsyncAuthorizationFilter
|
||||
{
|
||||
|
||||
public IStringLocalizer _localizer { get; set; }
|
||||
|
||||
private readonly IEasyCachingProvider _provider;
|
||||
|
||||
@@ -21,11 +24,12 @@ public class LimitUserRequestAuthorization :BaseService, IAsyncAuthorizationFilt
|
||||
|
||||
private readonly IOptionsMonitor<ServiceVerifyConfigOption> _verifyConfig;
|
||||
|
||||
public LimitUserRequestAuthorization(IEasyCachingProvider provider, IUserInfo userInfo, IOptionsMonitor<ServiceVerifyConfigOption> verifyConfig)
|
||||
public LimitUserRequestAuthorization(IEasyCachingProvider provider, IUserInfo userInfo, IStringLocalizer localizer ,IOptionsMonitor<ServiceVerifyConfigOption> verifyConfig)
|
||||
{
|
||||
_provider = provider;
|
||||
_userInfo = userInfo;
|
||||
_verifyConfig = verifyConfig;
|
||||
_localizer = localizer;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +53,9 @@ public class LimitUserRequestAuthorization :BaseService, IAsyncAuthorizationFilt
|
||||
context.HttpContext.Response.ContentType = "application/json";
|
||||
context.HttpContext.Response.StatusCode = StatusCodes.Status200OK;
|
||||
//---当前请求未从Header/Url取到用户Token,请联系开发者
|
||||
await context.HttpContext.Response.WriteAsync(JsonConvert.SerializeObject(ResponseOutput.NotOk(_localizer["LimitUser_AuthTokenMissing"])));
|
||||
//await context.HttpContext.Response.WriteAsync(JsonConvert.SerializeObject(ResponseOutput.NotOk(_localizer["LimitUser_AuthTokenMissing"])));
|
||||
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["LimitUser_AuthTokenMissing"]));
|
||||
}
|
||||
|
||||
//2、在这里取缓存 进行比较 看是否有其他人进行了登陆,如果其他人登陆了,就把之前用户挤掉
|
||||
@@ -75,8 +81,13 @@ public class LimitUserRequestAuthorization :BaseService, IAsyncAuthorizationFilt
|
||||
|
||||
context.HttpContext.Response.ContentType = "application/json";
|
||||
context.HttpContext.Response.StatusCode = StatusCodes.Status403Forbidden;
|
||||
//---您的账户在其他地方已登陆,您被迫下线。
|
||||
await context.HttpContext.Response.WriteAsync(JsonConvert.SerializeObject(ResponseOutput.NotOk(_localizer["LimitUser_AccountLoggedInElsewhere"], ApiResponseCodeEnum.LoginInOtherPlace)));
|
||||
//---您的账户在其他地方已登陆,您被迫下线。
|
||||
|
||||
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["LimitUser_AccountLoggedInElsewhere"], ApiResponseCodeEnum.LoginInOtherPlace));
|
||||
|
||||
|
||||
//await context.HttpContext.Response.WriteAsync(JsonConvert.SerializeObject(ResponseOutput.NotOk(_localizer["LimitUser_AccountLoggedInElsewhere"], ApiResponseCodeEnum.LoginInOtherPlace)));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
//using System.Diagnostics;
|
||||
//using IRaCIS.Application.Interfaces;
|
||||
//using IRaCIS.Application.Contracts;
|
||||
//using IRaCIS.Core.Infra.EFCore;
|
||||
//using IRaCIS.Core.Infrastructure.Extention;
|
||||
//using Microsoft.AspNetCore.Mvc;
|
||||
//using Microsoft.AspNetCore.Mvc.Filters;
|
||||
//using Microsoft.Extensions.Logging;
|
||||
//using Newtonsoft.Json;
|
||||
|
||||
//namespace IRaCIS.Core.Application.Filter
|
||||
//{
|
||||
|
||||
// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
|
||||
// public class LogFilter : Attribute
|
||||
// {
|
||||
// }
|
||||
// public class LogActionFilter : IAsyncActionFilter
|
||||
// {
|
||||
// private readonly ILogService _logService;
|
||||
// private readonly IUserInfo _userInfo;
|
||||
// private readonly ILogger<LogActionFilter> _logger;
|
||||
|
||||
// public LogActionFilter(ILogService logService, IUserInfo userInfo , ILogger<LogActionFilter> logger)
|
||||
// {
|
||||
// _logService = logService;
|
||||
// _userInfo = userInfo;
|
||||
// _logger = logger;
|
||||
// }
|
||||
|
||||
// public Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
|
||||
// {
|
||||
|
||||
// if (context.ActionDescriptor.EndpointMetadata!=null&& context.ActionDescriptor.EndpointMetadata.Any(m => m.GetType() == typeof(LogFilter)))
|
||||
// {
|
||||
// return LogAsync(context, next);
|
||||
// }
|
||||
// return next();
|
||||
// }
|
||||
|
||||
// public async Task LogAsync(ActionExecutingContext context, ActionExecutionDelegate next)
|
||||
// {
|
||||
// var sw = new Stopwatch();
|
||||
// sw.Start();
|
||||
|
||||
// dynamic actionResult = (await next()).Result;
|
||||
// sw.Stop();
|
||||
// var args = JsonConvert.SerializeObject(context.ActionArguments);
|
||||
// var result = JsonConvert.SerializeObject(actionResult?.Value);
|
||||
|
||||
// var attr = (ApiExplorerSettingsAttribute)context.ActionDescriptor.EndpointMetadata.FirstOrDefault(m => m.GetType() == typeof(ApiExplorerSettingsAttribute));
|
||||
// var groupName = attr?.GroupName;
|
||||
// var res = actionResult?.Value as IResponseOutput;
|
||||
// var input = new SystemLogDTO
|
||||
// {
|
||||
// ClientIP = string.Empty,
|
||||
// OptUserId = _userInfo.Id,
|
||||
// OptUserName = _userInfo.UserName,
|
||||
// ApiPath = context.ActionDescriptor.AttributeRouteInfo.Template.ToLower(),
|
||||
// Params = args,
|
||||
// Result = result,
|
||||
// RequestTime = DateTime.Now,
|
||||
// ElapsedMilliseconds = sw.ElapsedMilliseconds,
|
||||
// Status =res?.IsSuccess?? false,
|
||||
// Message = res?.ErrorMessage,
|
||||
// LogCategory = groupName
|
||||
// };
|
||||
|
||||
// try
|
||||
// {
|
||||
// _logService.SaveLog2Db(input);
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
|
||||
// _logger.LogError(ex.Message);
|
||||
// }
|
||||
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -56,7 +56,7 @@ namespace IRaCIS.Core.Application.Filter
|
||||
#region 处理新的用户类型,不能操作项目相关接口
|
||||
|
||||
// 后期列举出具体的类型,其他任何用户类型,都不允许操作
|
||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA)
|
||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA && _userInfo.RequestUrl.ToLower()!= "TrialDocument/userConfirm".ToLower())
|
||||
{
|
||||
//---对不起,您的账户没有操作权限。
|
||||
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_NoAccessPermission"]));
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace IRaCIS.Application.Services.BusinessFilter
|
||||
|
||||
//OK
|
||||
var tuple = (dynamic)objectResult.Value;
|
||||
var apiResponse = ResponseOutput.Ok(tuple.Item1, tuple.Item2);
|
||||
var apiResponse = ResponseOutput.Ok(tuple!.Item1, tuple!.Item2);
|
||||
|
||||
|
||||
objectResult.Value = apiResponse;
|
||||
|
||||
@@ -15,6 +15,7 @@ using Newtonsoft.Json.Linq;
|
||||
using NPOI.HSSF.UserModel;
|
||||
using NPOI.XSSF.UserModel;
|
||||
using SkiaSharp;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service;
|
||||
@@ -51,20 +52,24 @@ public static class ExcelExportHelper
|
||||
var translateDataList = await _dictionaryService.GetBasicDataSelect(needTranslatePropertyList.Select(t => t.DicParentCode).Distinct().ToArray());
|
||||
|
||||
|
||||
var dic = JsonConvert.DeserializeObject<IDictionary<string, object>>(data.ToJsonNotIgnoreNull());
|
||||
var dic = data.ConvertToDictionary();
|
||||
|
||||
|
||||
foreach (var key in dic.Keys)
|
||||
{
|
||||
//是数组 那么找到对应的属性 进行翻译
|
||||
if (dic[key].GetType().IsAssignableFrom(typeof(JArray)))
|
||||
if (dic[key].GetType().GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IList<>)))
|
||||
{
|
||||
|
||||
var newObjList = new List<object>();
|
||||
var no = 1;
|
||||
|
||||
foreach (var item in dic[key] as JArray)
|
||||
foreach (var item in dic[key] as IList )
|
||||
{
|
||||
var itemDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(item.ToJsonNotIgnoreNull());
|
||||
//var itemDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(item.ToJsonNotIgnoreNull());
|
||||
|
||||
var itemDic = item.ConvertToDictionary();
|
||||
|
||||
|
||||
|
||||
foreach (var needTranslateProperty in needTranslatePropertyList)
|
||||
@@ -72,7 +77,7 @@ public static class ExcelExportHelper
|
||||
//翻译的属性依赖其他属性
|
||||
if (needTranslateProperty.IsTranslateDenpendOtherProperty)
|
||||
{
|
||||
if (item[needTranslateProperty.DependPropertyName]?.ToString().ToLower() == needTranslateProperty.DependPropertyValueStr.ToLower())
|
||||
if (itemDic[needTranslateProperty.DependPropertyName]?.ToString().ToLower() == needTranslateProperty.DependPropertyValueStr.ToLower())
|
||||
{
|
||||
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
|
||||
|
||||
@@ -146,7 +151,7 @@ public static class ExcelExportHelper
|
||||
}
|
||||
|
||||
var memoryStream2 = new MemoryStream();
|
||||
workbook.Write(memoryStream2);
|
||||
workbook.Write(memoryStream2,true);
|
||||
|
||||
memoryStream2.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
@@ -226,29 +231,30 @@ public static class ExcelExportHelper
|
||||
|
||||
var translateDataList = await _dictionaryService.GetBasicDataSelect(needTranslatePropertyList.Select(t => t.DicParentCode).Distinct().ToArray());
|
||||
|
||||
|
||||
var dic = JsonConvert.DeserializeObject<IDictionary<string, object>>(data.ToJsonNotIgnoreNull());
|
||||
var dic = data.ConvertToDictionary();
|
||||
//var dic = (JsonConvert.DeserializeObject<IDictionary<string, object>>(data.ToJsonNotIgnoreNull())).IfNullThrowException();
|
||||
|
||||
foreach (var key in dic.Keys)
|
||||
{
|
||||
//是数组 那么找到对应的属性 进行翻译
|
||||
if (dic[key].GetType().IsAssignableFrom(typeof(JArray)))
|
||||
if (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 JArray)
|
||||
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 = JsonConvert.DeserializeObject<IDictionary<string, object>>(item.ToJsonNotIgnoreNull());
|
||||
var itemDic = item.ConvertToDictionary();
|
||||
|
||||
foreach (var needTranslateProperty in needTranslatePropertyList)
|
||||
{
|
||||
//翻译的属性依赖其他属性
|
||||
if (needTranslateProperty.IsTranslateDenpendOtherProperty)
|
||||
{
|
||||
if (item[needTranslateProperty.DependPropertyName]?.ToString().ToLower() == needTranslateProperty.DependPropertyValueStr.ToLower())
|
||||
if (itemDic[needTranslateProperty.DependPropertyName]?.ToString().ToLower() == needTranslateProperty.DependPropertyValueStr.ToLower())
|
||||
{
|
||||
var beforeValue = itemDic[needTranslateProperty.Name]?.ToString();
|
||||
|
||||
@@ -316,7 +322,7 @@ public static class ExcelExportHelper
|
||||
}
|
||||
|
||||
var memoryStream2 = new MemoryStream();
|
||||
workbook.Write(memoryStream2);
|
||||
workbook.Write(memoryStream2,true);
|
||||
|
||||
memoryStream2.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.Helper
|
||||
{
|
||||
public class FileConvertHelper
|
||||
{
|
||||
|
||||
|
||||
static public void ConvertWordToPdf(string inputWordFilePath, string outputPdfDir)
|
||||
{
|
||||
// 设置 libreoffice 命令行参数
|
||||
string arguments = $"--headless --invisible --convert-to pdf \"{inputWordFilePath}\" --outdir \"{outputPdfDir}\"";
|
||||
|
||||
// 启动 libreoffice 进程
|
||||
using (Process process = new Process())
|
||||
{
|
||||
process.StartInfo.FileName = "libreoffice";
|
||||
process.StartInfo.Arguments = arguments;
|
||||
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
process.StartInfo.RedirectStandardOutput = true;
|
||||
process.StartInfo.RedirectStandardError = true;
|
||||
process.StartInfo.UseShellExecute = false;
|
||||
process.StartInfo.CreateNoWindow = true;
|
||||
|
||||
process.Start();
|
||||
|
||||
// 等待进程结束
|
||||
process.WaitForExit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using DocumentFormat.OpenXml.Bibliography;
|
||||
using NPOI.XWPF.UserModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.Helper
|
||||
{
|
||||
public class FileFormatConvertHelper
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
|
||||
|
||||
using Aliyun.OSS;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Configuration;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace IRaCIS.Core.Application.Helper;
|
||||
@@ -12,7 +14,6 @@ namespace IRaCIS.Core.Application.Helper;
|
||||
public static class FileStoreHelper
|
||||
{
|
||||
|
||||
|
||||
//处理文件名 压缩包,或者目录类的 会带上相对路径
|
||||
public static (string TrustedFileNameForFileStorage, string RealName) GetStoreFileName(string fileName,bool isChangeToPdfFormat=false)
|
||||
{
|
||||
@@ -55,8 +56,9 @@ public static class FileStoreHelper
|
||||
//API vue 部署目录
|
||||
public static string GetIRaCISRootPath(IWebHostEnvironment _hostEnvironment)
|
||||
{
|
||||
var rootPath = (Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\'))).IfNullThrowException().FullName;
|
||||
return rootPath;
|
||||
string parentDirectory = Path.GetFullPath(Path.Combine(_hostEnvironment.ContentRootPath, ".."));
|
||||
|
||||
return parentDirectory;
|
||||
|
||||
}
|
||||
|
||||
@@ -76,11 +78,56 @@ public static class FileStoreHelper
|
||||
{
|
||||
var rootPath = GetIRaCISRootPath(_hostEnvironment);
|
||||
|
||||
var physicalFilePath = Path.Combine(rootPath, relativePath.Trim('/'));
|
||||
var physicalFilePath = Path.Combine(rootPath, relativePath.TrimStart('/'));
|
||||
|
||||
return physicalFilePath;
|
||||
}
|
||||
|
||||
|
||||
#region 修改后留存
|
||||
|
||||
|
||||
public static (string PhysicalPath, string RelativePath) GetSystemFileUploadPath(IWebHostEnvironment _hostEnvironment, string templateFolderName, string fileName)
|
||||
{
|
||||
var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
|
||||
|
||||
//文件类型路径处理
|
||||
var uploadFolderPath = Path.Combine(rootPath, StaticData.Folder.SystemDataFolder, templateFolderName);
|
||||
if (!Directory.Exists(uploadFolderPath)) Directory.CreateDirectory(uploadFolderPath);
|
||||
|
||||
|
||||
var (trustedFileNameForFileStorage, fileRealName) = FileStoreHelper.GetStoreFileName(fileName);
|
||||
|
||||
|
||||
var relativePath = $"/{StaticData.Folder.IRaCISDataFolder}/{StaticData.Folder.SystemDataFolder}/{templateFolderName}/{trustedFileNameForFileStorage}";
|
||||
|
||||
var serverFilePath = Path.Combine(uploadFolderPath, trustedFileNameForFileStorage);
|
||||
|
||||
return (serverFilePath, relativePath);
|
||||
}
|
||||
|
||||
public static (string PhysicalPath, string RelativePath) GetOtherFileUploadPath(IWebHostEnvironment _hostEnvironment, string templateFolderName, string fileName)
|
||||
{
|
||||
var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
|
||||
|
||||
//文件类型路径处理
|
||||
var uploadFolderPath = Path.Combine(rootPath, StaticData.Folder.OtherDataFolder, templateFolderName);
|
||||
if (!Directory.Exists(uploadFolderPath)) Directory.CreateDirectory(uploadFolderPath);
|
||||
|
||||
|
||||
var (trustedFileNameForFileStorage, fileRealName) = FileStoreHelper.GetStoreFileName(fileName);
|
||||
|
||||
|
||||
var relativePath = $"/{StaticData.Folder.IRaCISDataFolder}/{StaticData.Folder.OtherDataFolder}/{templateFolderName}/{trustedFileNameForFileStorage}";
|
||||
|
||||
var serverFilePath = Path.Combine(uploadFolderPath, trustedFileNameForFileStorage);
|
||||
|
||||
return (serverFilePath, relativePath);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -382,7 +429,6 @@ public static class FileStoreHelper
|
||||
/// <param name="trialId"></param>
|
||||
/// <param name="siteid"></param>
|
||||
/// <param name="subjectId"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
public static (string PhysicalPath, string RelativePath, string FileRealName) GetUploadPrintscreenFilePath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId, Guid siteid, Guid subjectId)
|
||||
{
|
||||
@@ -529,7 +575,7 @@ public static class FileStoreHelper
|
||||
|
||||
var json = File.ReadAllText( Path.Combine(_hostEnvironment.ContentRootPath, "appsettings.json"));
|
||||
|
||||
JObject jsonObject = JObject.Parse(json, new JsonLoadSettings() { CommentHandling = CommentHandling.Load });
|
||||
JObject jsonObject = (JObject.Parse(json, new JsonLoadSettings() { CommentHandling = CommentHandling.Load })).IfNullThrowException();
|
||||
|
||||
int switchingRatio = 80;
|
||||
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
using Hangfire;
|
||||
using IRaCIS.Core.Application.Service;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.Helper
|
||||
{
|
||||
public static class HangfireJobHelper
|
||||
{
|
||||
|
||||
|
||||
|
||||
//public static void AddOrUpdateCronJob(string jobId, string queueName, Expression<Action> methodCall, string cron)
|
||||
//{
|
||||
// RecurringJob.AddOrUpdate(jobId, queueName, methodCall, cron);
|
||||
//}
|
||||
|
||||
|
||||
|
||||
//添加 或者更新定时任务 Id 要唯一标识一个定义任务
|
||||
public static void AddOrUpdateCronJob<T>(string jobId, Expression<Action<T>> methodCall, string cron, string queueName = "default")
|
||||
{
|
||||
RecurringJob.AddOrUpdate<T>(jobId, queueName, methodCall, cron);
|
||||
}
|
||||
|
||||
public static void AddOrUpdateInitCronJob<T>(string jobId, Expression<Action<T>> methodCall, string cron)
|
||||
{
|
||||
RecurringJob.AddOrUpdate<T>(jobId, "sys_init", methodCall, cron);
|
||||
}
|
||||
|
||||
public static void RemoveCronJob(string jobId)
|
||||
{
|
||||
RecurringJob.RemoveIfExists(jobId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void ImmediatelyOnceOnlyJob(Expression<Action> methodCall)
|
||||
{
|
||||
BackgroundJob.Enqueue("immediately_once", methodCall);
|
||||
}
|
||||
|
||||
public static void ImmediatelyOnceOnlyJob<T>(Expression<Action<T>> methodCall)
|
||||
{
|
||||
BackgroundJob.Enqueue<T>("immediately_once", methodCall);
|
||||
}
|
||||
|
||||
public static void NotImmediatelyOnceOnlyJob(Expression<Action> methodCall, TimeSpan timeSpan)
|
||||
{
|
||||
BackgroundJob.Schedule("not_immediately_once", methodCall, timeSpan);
|
||||
}
|
||||
|
||||
public static void NotImmediatelyOnceOnlyJob<T>(Expression<Action<T>> methodCall, TimeSpan timeSpan)
|
||||
{
|
||||
BackgroundJob.Schedule<T>("not_immediately_once", methodCall, timeSpan);
|
||||
}
|
||||
|
||||
|
||||
public static void AddOrUpdateTrialCronJob (string jobId, Guid trialId, EmailBusinessScenario businessScenario, string emailCron)
|
||||
{
|
||||
|
||||
switch (businessScenario)
|
||||
{
|
||||
|
||||
case EmailBusinessScenario.QCTask:
|
||||
HangfireJobHelper.AddOrUpdateCronJob<IEmailSendService>(jobId, t => t.SendTrialImageQCTaskEmailAsync(trialId), emailCron);
|
||||
break;
|
||||
case EmailBusinessScenario.QCQuestion:
|
||||
HangfireJobHelper.AddOrUpdateCronJob<IEmailSendService>(jobId, t => t.SendTrialQCQuestionEmailAsync(trialId), emailCron);
|
||||
break;
|
||||
case EmailBusinessScenario.ImageQuestion:
|
||||
HangfireJobHelper.AddOrUpdateCronJob<IEmailSendService>(jobId, t => t.SendTrialImageQuestionAsync(trialId), emailCron);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static BeetleX.Redis.Commands.HSCAN;
|
||||
using static IRaCIS.Core.Application.Service.Common.SystemMonitor;
|
||||
|
||||
namespace IRaCIS.Core.Application.Helper
|
||||
{
|
||||
public static class InternationalizationHelper
|
||||
{
|
||||
public static string JsonFileFolder = Path.Combine(AppContext.BaseDirectory, StaticData.Folder.Resources);
|
||||
|
||||
private static void VerifyFolder()
|
||||
{
|
||||
if (!Directory.Exists(JsonFileFolder) ||
|
||||
!Directory.GetFiles(JsonFileFolder).Any(filePath => Path.GetExtension(filePath).Equals(".json", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
throw new BusinessValidationFailedException("国际化Json文件目录有误");
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task BatchAddJsonKeyValueAsync(List<BatchAddInternationalizationDto> batchAddDtos)
|
||||
{
|
||||
VerifyFolder();
|
||||
|
||||
var usJsonPath = Path.Combine(JsonFileFolder, StaticData.En_US_Json);
|
||||
var cnJsonPath = Path.Combine(JsonFileFolder, StaticData.Zh_CN_Json);
|
||||
|
||||
|
||||
//更新json 文件 同时更新内存缓存的数据
|
||||
foreach (var filePath in new string[] { usJsonPath, cnJsonPath })
|
||||
{
|
||||
var json = await File.ReadAllTextAsync(filePath);
|
||||
|
||||
JObject jsonObject = JObject.Parse(json, new JsonLoadSettings() { CommentHandling = CommentHandling.Load });
|
||||
|
||||
// 添加或更新指定的键值对
|
||||
|
||||
if (filePath.Contains(StaticData.En_US_Json))
|
||||
{
|
||||
foreach (var item in batchAddDtos)
|
||||
{
|
||||
jsonObject[item.Code] = item.Value;
|
||||
|
||||
StaticData.En_US_Dic[item.Code] = item.Value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var item in batchAddDtos)
|
||||
{
|
||||
jsonObject[item.Code] = item.Value;
|
||||
|
||||
StaticData.Zh_CN_Dic[item.Code] = item.Value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
await File.WriteAllTextAsync(filePath, jsonObject.ToString());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task AddOrUpdateJsonKeyValueAsync(string key, string value, string valueCN)
|
||||
{
|
||||
|
||||
VerifyFolder();
|
||||
|
||||
var usJsonPath = Path.Combine(JsonFileFolder, StaticData.En_US_Json);
|
||||
var cnJsonPath = Path.Combine(JsonFileFolder, StaticData.Zh_CN_Json);
|
||||
|
||||
|
||||
//更新json 文件 同时更新内存缓存的数据
|
||||
foreach (var filePath in new string[] { usJsonPath, cnJsonPath })
|
||||
{
|
||||
var json = await File.ReadAllTextAsync(filePath);
|
||||
|
||||
JObject jsonObject = JObject.Parse(json, new JsonLoadSettings() { CommentHandling = CommentHandling.Load });
|
||||
|
||||
// 添加或更新指定的键值对
|
||||
|
||||
if (filePath.Contains(StaticData.En_US_Json))
|
||||
{
|
||||
jsonObject[key] = value;
|
||||
|
||||
StaticData.En_US_Dic[key] = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
jsonObject[key] = valueCN;
|
||||
|
||||
StaticData.Zh_CN_Dic[key] = valueCN;
|
||||
}
|
||||
|
||||
|
||||
await File.WriteAllTextAsync(filePath, jsonObject.ToString());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static async Task InitInternationlizationDataAndWatchJsonFileAsync(IRepository _repository)
|
||||
{
|
||||
//查询数据库的数据
|
||||
var toJsonList = await _repository.Where<Internationalization>(t => t.InternationalizationType == 1).Select(t => new
|
||||
{
|
||||
t.Code,
|
||||
t.Value,
|
||||
t.ValueCN
|
||||
}).ToListAsync();
|
||||
|
||||
//组织成json 文件
|
||||
|
||||
var usJsonPath = Path.Combine(JsonFileFolder, StaticData.En_US_Json);
|
||||
var cnJsonPath = Path.Combine(JsonFileFolder, StaticData.Zh_CN_Json);
|
||||
|
||||
|
||||
//本地静态文件国际化需要
|
||||
foreach (var tojsonItem in toJsonList)
|
||||
{
|
||||
StaticData.En_US_Dic[tojsonItem.Code] = tojsonItem.Value;
|
||||
StaticData.Zh_CN_Dic[tojsonItem.Code] = tojsonItem.ValueCN;
|
||||
}
|
||||
|
||||
File.WriteAllText(usJsonPath, JsonConvert.SerializeObject(StaticData.En_US_Dic));
|
||||
File.WriteAllText(cnJsonPath, JsonConvert.SerializeObject(StaticData.Zh_CN_Dic));
|
||||
|
||||
|
||||
//监测Json文件变更 实时刷新数据
|
||||
|
||||
WatchJsonFile(usJsonPath);
|
||||
WatchJsonFile(cnJsonPath);
|
||||
|
||||
}
|
||||
|
||||
public static void WatchJsonFile(string filePath)
|
||||
{
|
||||
if (!File.Exists(filePath))
|
||||
{
|
||||
throw new BusinessValidationFailedException("国际化Json文件不存在");
|
||||
}
|
||||
|
||||
FileSystemWatcher watcher = new FileSystemWatcher(Path.GetDirectoryName(filePath), Path.GetFileName(filePath));
|
||||
watcher.Changed += (sender, e) => LoadJsonFile(filePath);
|
||||
watcher.EnableRaisingEvents = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static void LoadJsonFile(string filePath)
|
||||
{
|
||||
|
||||
IConfigurationBuilder builder = new ConfigurationBuilder().AddJsonFile(filePath);
|
||||
|
||||
IConfigurationRoot enConfiguration = builder.Build();
|
||||
|
||||
foreach (IConfigurationSection section in enConfiguration.GetChildren())
|
||||
{
|
||||
if (filePath.Contains(StaticData.En_US_Json))
|
||||
{
|
||||
StaticData.En_US_Dic[section.Key] = section.Value;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
StaticData.Zh_CN_Dic[section.Key] = section.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,171 +0,0 @@
|
||||
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.OpenXmlFormats.Wordprocessing;
|
||||
using NPOI.XWPF.UserModel;
|
||||
using System.Collections;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service;
|
||||
|
||||
public static class NpoiWordHelper
|
||||
{
|
||||
public static async Task<IActionResult> TemplateExportWordAsync(string code, object data, IRepository<CommonDocument>? _commonDocumentRepository, IWebHostEnvironment _hostEnvironment)
|
||||
{
|
||||
//var (physicalPath, fileNmae) = await FileStoreHelper.GetCommonDocPhysicalFilePathAsync(_hostEnvironment, _commonDocumentRepository, code);
|
||||
|
||||
var physicalPath = code;
|
||||
|
||||
|
||||
using (FileStream stream = File.OpenRead(physicalPath))
|
||||
{
|
||||
XWPFDocument doc = new XWPFDocument(stream);
|
||||
//遍历段落
|
||||
foreach (var para in doc.Paragraphs)
|
||||
{
|
||||
ReplaceKey(para, data);
|
||||
}
|
||||
//遍历表格
|
||||
var tables = doc.Tables;
|
||||
foreach (var table in tables)
|
||||
{
|
||||
//ReplaceTableKey(table, data, "Data");
|
||||
}
|
||||
|
||||
foreach (var table in tables)
|
||||
{
|
||||
foreach (var row in table.Rows)
|
||||
{
|
||||
foreach (var cell in row.GetTableCells())
|
||||
{
|
||||
foreach (var para in cell.Paragraphs)
|
||||
{
|
||||
ReplaceKey(para, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FileStream out1 = new FileStream("table.docx", FileMode.Create);
|
||||
doc.Write(out1);
|
||||
out1.Close();
|
||||
return new FileStreamResult(stream, "application/msword")
|
||||
{
|
||||
FileDownloadName = $"replaced_{DateTime.Now.ToString("yyyyMMddHHmmss")}.docx"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private static void ReplaceKey(XWPFParagraph para, object model)
|
||||
{
|
||||
string text = para.ParagraphText;
|
||||
|
||||
Type t = model.GetType();
|
||||
PropertyInfo[] pi = t.GetProperties();
|
||||
foreach (PropertyInfo p in pi)
|
||||
{
|
||||
//$$与模板中$$对应,也可以改成其它符号,比如{$name},务必做到唯一
|
||||
if (text.Contains("$" + p.Name + "$"))
|
||||
{
|
||||
text = text.Replace("$" + p.Name + "$", p.GetValue(model)?.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
//var runs = para.Runs;
|
||||
//string styleid = para.Style;
|
||||
//for (int i = 0; i < runs.Count; i++)
|
||||
//{
|
||||
// var run = runs[i];
|
||||
// text = run.ToString();
|
||||
// Type t = model.GetType();
|
||||
// PropertyInfo[] pi = t.GetProperties();
|
||||
// foreach (PropertyInfo p in pi)
|
||||
// {
|
||||
// //$$与模板中$$对应,也可以改成其它符号,比如{$name},务必做到唯一
|
||||
// if (text.Contains("$" + p.Name + "$"))
|
||||
// {
|
||||
// text = text.Replace("$" + p.Name + "$", p.GetValue(model)?.ToString());
|
||||
// }
|
||||
// }
|
||||
// runs[i].SetText(text, 0);
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 替换表格Key
|
||||
/// </summary>
|
||||
/// <param name="table"></param>
|
||||
/// <param name="list"></param>
|
||||
/// <param name="field"></param>
|
||||
|
||||
private static void ReplaceTableKey(XWPFTable table, IList list, String field)
|
||||
{
|
||||
List<XWPFParagraph> paras = new List<XWPFParagraph>();
|
||||
// 获取最后一行数据,最后一行设置值
|
||||
Int32 iLastRowIndex = 0;
|
||||
for (int iIndex = 0; iIndex < table.Rows.Count; iIndex++)
|
||||
{
|
||||
if (iIndex == table.Rows.Count - 1)
|
||||
{
|
||||
iLastRowIndex = iIndex;
|
||||
foreach (var cell in table.Rows[iIndex].GetTableCells())
|
||||
{
|
||||
foreach (var para in cell.Paragraphs)
|
||||
{
|
||||
paras.Add(para);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 删除最后一行
|
||||
table.RemoveRow(iLastRowIndex);
|
||||
|
||||
for (int iIndex = 0; iIndex < list.Count; iIndex++)
|
||||
{
|
||||
object data = list[iIndex];
|
||||
Type t = data.GetType();
|
||||
PropertyInfo[] pi = t.GetProperties();
|
||||
// 表增加行
|
||||
XWPFTableRow m_row = table.CreateRow();
|
||||
CT_Row m_NewRow = new CT_Row();
|
||||
String text = String.Empty;
|
||||
Int32 jIndex = 0;
|
||||
paras.ForEach(para =>
|
||||
{
|
||||
text = para.ParagraphText;
|
||||
foreach (PropertyInfo p in pi)
|
||||
{
|
||||
if (text.Contains("$" + field + "." + p.Name + "$"))
|
||||
{
|
||||
m_row.GetCell(jIndex).SetText(p.GetValue(data, null).ToString());
|
||||
}
|
||||
}
|
||||
jIndex++;
|
||||
});
|
||||
m_row = new XWPFTableRow(m_NewRow, table);
|
||||
table.AddRow(m_row);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
using Aliyun.OSS;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Options;
|
||||
using NPOI.HPSF;
|
||||
using SharpCompress.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.AccessControl;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.Helper
|
||||
{
|
||||
public class MinIOOptions
|
||||
{
|
||||
public string endpoint { get; set; }
|
||||
public string port { get; set; }
|
||||
public bool useSSL { get; set; }
|
||||
public string accessKey { get; set; }
|
||||
public string secretKey { get; set; }
|
||||
public string bucketName { get; set; }
|
||||
}
|
||||
|
||||
public class AliyunOSSOptions
|
||||
{
|
||||
public string regionId { get; set; }
|
||||
public string accessKeyId { get; set; }
|
||||
public string accessKeySecret { get; set; }
|
||||
public string endPoint { get; set; }
|
||||
public string bucketName { get; set; }
|
||||
|
||||
public string roleArn { get; set; }
|
||||
|
||||
public string region { get; set; }
|
||||
|
||||
public string viewEndpoint { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class ObjectStoreServiceOptions
|
||||
{
|
||||
public string ObjectStoreUse { get; set; }
|
||||
public AliyunOSSOptions AliyunOSS { get; set; }
|
||||
public MinIOOptions MinIO { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class ObjectStoreDTO
|
||||
{
|
||||
public string ObjectStoreUse { get; set; }
|
||||
|
||||
public AliyunOSSOptions AliyunOSS { get; set; }
|
||||
|
||||
public MinIOOptions MinIO { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class AliyunOSSTempToken
|
||||
{
|
||||
public string AccessKeyId { get; set; }
|
||||
public string AccessKeySecret { get; set; }
|
||||
public string SecurityToken { get; set; }
|
||||
public string Expiration { get; set; }
|
||||
|
||||
public string Region { get; set; }
|
||||
public string BucketName { get; set; }
|
||||
public string ViewEndpoint { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
public enum ObjectStoreUse
|
||||
{
|
||||
AliyunOSS = 0,
|
||||
MinIO = 1,
|
||||
AWS = 2,
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public interface IOSSService
|
||||
{
|
||||
public string UploadToOSS(Stream fileStream, string oosFolderPath, string fileRealName);
|
||||
public string UploadToOSS(string localFilePath, string oosFolderPath);
|
||||
|
||||
public void DownLoadFromOSS(string ossRelativePath, string localFilePath);
|
||||
|
||||
public AliyunOSSOptions _OSSConfig { get; set; }
|
||||
|
||||
public OssClient _ossClient { get; set; }
|
||||
}
|
||||
public class OSSService : IOSSService
|
||||
{
|
||||
|
||||
public AliyunOSSOptions _OSSConfig { get; set; }
|
||||
|
||||
public OssClient _ossClient { get; set; }
|
||||
|
||||
|
||||
|
||||
public OSSService(IOptionsMonitor<ObjectStoreServiceOptions> options)
|
||||
{
|
||||
var ossOptions = options.CurrentValue;
|
||||
|
||||
_OSSConfig = ossOptions.AliyunOSS;
|
||||
|
||||
_ossClient = new OssClient(_OSSConfig.endPoint, _OSSConfig.accessKeyId, _OSSConfig.accessKeySecret);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder
|
||||
/// </summary>
|
||||
/// <param name="fileStream"></param>
|
||||
/// <param name="oosFolderPath"></param>
|
||||
/// <param name="fileRealName"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||
public string UploadToOSS(Stream fileStream, string oosFolderPath,string fileRealName)
|
||||
{
|
||||
|
||||
var ossRelativePath = oosFolderPath + "/" + fileRealName;
|
||||
|
||||
try
|
||||
{
|
||||
using (var memoryStream = new MemoryStream())
|
||||
{
|
||||
fileStream.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
fileStream.CopyTo(memoryStream);
|
||||
|
||||
memoryStream.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
// 上传文件
|
||||
var result = _ossClient.PutObject(_OSSConfig.bucketName, ossRelativePath, memoryStream);
|
||||
}
|
||||
|
||||
|
||||
return "/" + ossRelativePath;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new BusinessValidationFailedException("oss上传失败" + ex.Message);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder
|
||||
/// </summary>
|
||||
/// <param name="localFilePath"></param>
|
||||
/// <param name="oosFolderPath"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||
public string UploadToOSS(string localFilePath, string oosFolderPath)
|
||||
{
|
||||
var localFileName = Path.GetFileName(localFilePath);
|
||||
|
||||
var ossRelativePath = oosFolderPath + "/" + localFileName;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
// 上传文件
|
||||
var result = _ossClient.PutObject(_OSSConfig.bucketName, ossRelativePath, localFilePath);
|
||||
|
||||
return ossRelativePath;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new BusinessValidationFailedException("oss上传失败" + ex.Message);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void DownLoadFromOSS(string ossRelativePath, string localFilePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = _ossClient.GetObject(_OSSConfig.bucketName, ossRelativePath);
|
||||
|
||||
// 将下载的文件流保存到本地文件
|
||||
using (var fs = File.OpenWrite(localFilePath))
|
||||
{
|
||||
result.Content.CopyTo(fs);
|
||||
fs.Close();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
throw new BusinessValidationFailedException("oss下载失败!" + ex.Message);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public static class SendEmailHelper
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception )
|
||||
{
|
||||
|
||||
//---邮件发送失败,您进行的操作未能成功,请检查邮箱或联系维护人员
|
||||
|
||||
@@ -63,48 +63,42 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoMapper.Collection.EntityFrameworkCore" Version="9.0.0" />
|
||||
<PackageReference Include="Aliyun.OSS.SDK.NetCore" Version="2.13.0" />
|
||||
<PackageReference Include="FreeSpire.Doc" Version="11.6.0" />
|
||||
<PackageReference Include="Hangfire.Core" Version="1.8.6" />
|
||||
<PackageReference Include="BeetleX.BNR" Version="1.0.1" />
|
||||
<PackageReference Include="Castle.Core.AsyncInterceptor" Version="2.1.0" />
|
||||
<PackageReference Include="EasyCaching.Interceptor.AspectCore" Version="1.7.0" />
|
||||
<PackageReference Include="EasyCaching.Redis" Version="1.9.2" />
|
||||
<PackageReference Include="EasyCaching.InMemory" Version="1.9.2" />
|
||||
<PackageReference Include="ExcelDataReader" Version="3.6.0" />
|
||||
<PackageReference Include="ExcelDataReader.DataSet" Version="3.6.0" />
|
||||
<PackageReference Include="fo-dicom.Codecs" Version="5.1.0">
|
||||
<PackageReference Include="DistributedLock.Redis" Version="1.0.2" />
|
||||
<PackageReference Include="DistributedLock.SqlServer" Version="1.0.3" />
|
||||
<PackageReference Include="fo-dicom" Version="5.1.1" />
|
||||
<PackageReference Include="fo-dicom.Imaging.ImageSharp" Version="5.1.0" />
|
||||
<PackageReference Include="fo-dicom.Codecs" Version="5.11.0" />
|
||||
<PackageReference Include="Magicodes.IE.Core" Version="2.7.4.5" />
|
||||
<PackageReference Include="Magicodes.IE.Csv" Version="2.7.4.5">
|
||||
<TreatAsUsed>true</TreatAsUsed>
|
||||
</PackageReference>
|
||||
<PackageReference Include="fo-dicom.Drawing" Version="4.0.8" />
|
||||
<PackageReference Include="fo-dicom.Imaging.ImageSharp" Version="5.0.3" />
|
||||
<PackageReference Include="FreeSpire.Doc" Version="10.8.0" />
|
||||
<PackageReference Include="Hangfire" Version="1.7.31">
|
||||
<PackageReference Include="Magicodes.IE.Excel" Version="2.7.4.5">
|
||||
<TreatAsUsed>true</TreatAsUsed>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Magicodes.IE.Core" Version="2.7.4.2" />
|
||||
<PackageReference Include="Magicodes.IE.Csv" Version="2.7.4.2">
|
||||
<TreatAsUsed>true</TreatAsUsed>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Magicodes.IE.Excel" Version="2.7.4.2">
|
||||
<TreatAsUsed>true</TreatAsUsed>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Magicodes.IE.Excel.AspNetCore" Version="2.7.4.2" />
|
||||
<PackageReference Include="MailKit" Version="3.4.2" />
|
||||
<PackageReference Include="MediatR" Version="11.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.JsonPatch" Version="6.0.10" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.10">
|
||||
<TreatAsUsed>true</TreatAsUsed>
|
||||
</PackageReference>
|
||||
<PackageReference Include="MimeKit" Version="3.4.2" />
|
||||
<PackageReference Include="MiniExcel" Version="1.30.1" />
|
||||
<PackageReference Include="MiniWord" Version="0.6.1" />
|
||||
<PackageReference Include="Magicodes.IE.Excel.AspNetCore" Version="2.7.4.5" />
|
||||
<PackageReference Include="MailKit" Version="4.3.0" />
|
||||
<PackageReference Include="MediatR" Version="12.2.0" />
|
||||
<PackageReference Include="MimeKit" Version="4.3.0" />
|
||||
<PackageReference Include="MiniExcel" Version="1.31.2" />
|
||||
<PackageReference Include="Minio" Version="6.0.1" />
|
||||
<PackageReference Include="MiniWord" Version="0.7.0" />
|
||||
<PackageReference Include="My.Extensions.Localization.Json" Version="3.0.0">
|
||||
<TreatAsUsed>true</TreatAsUsed>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Nito.AsyncEx" Version="5.1.2" />
|
||||
<PackageReference Include="NPOI" Version="2.6.0" />
|
||||
<PackageReference Include="Panda.DynamicWebApi" Version="1.2.0" />
|
||||
<PackageReference Include="Quartz" Version="3.5.0" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="7.0.5" />
|
||||
<PackageReference Include="WinSCP" Version="5.21.5" />
|
||||
<PackageReference Include="NPOI" Version="2.6.2" />
|
||||
<PackageReference Include="Panda.DynamicWebApi" Version="1.2.1" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="7.0.12" />
|
||||
<PackageReference Include="WinSCP" Version="6.1.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -39,7 +39,10 @@
|
||||
|
||||
//-------------------------------------------------------------------------------------Reading-----------------------------------------------------------------
|
||||
//ClinicalDataSetService
|
||||
"ClinicalDataSet_Apply": "",
|
||||
"ClinicalDataSet_DupTypeFail": "The same type of clinical data exists. The operation failed.",
|
||||
//ClinicalQuestionService
|
||||
"ClinicalQuestion_Repeat": "",
|
||||
//ReadingClinicalDataService
|
||||
"ReadingClinicalData_DupTypeFail": "The same type of clinical data exists. The operation failed.",
|
||||
"ReadingClinicalData_Unchecked": "The current clinical data status is not verified and signing is not allowed!",
|
||||
@@ -371,7 +374,7 @@
|
||||
"QCOperation_NoRecipient": "You are not the current recipient of the quality control task, no operation authority!",
|
||||
"QCOperation_QCImageTaskAlreadyReleased": "The image QC of the current visit has been released by the original recipient. You can get it by 'claime'.",
|
||||
"QCOperation_QCTaskNoAccess": "The image quality control task of the current visit has been claimed by other QC, so it is not allowed to claim.",
|
||||
"QCOperation_QCConfigFirst": "Please configure the image QC question before claiming the image QC task.",
|
||||
"QCOperation_QCConfigFirst": "Please configure the image QC questions before claiming any image QC work.",
|
||||
"QCOperation_NoQC": "The trial configuration of image QC was not check, and the QC Task was not be claimed.",
|
||||
"QCOperation_InitialAuditPassed": "The first review has passed, continue to receive can not be allowed.",
|
||||
"QCOperation_NoSingleAudit": "The trial is configured with single image QC , does not meet Submmit State: Submitted or Audit State: pending QC/ in QC, not allowed to collect.Please refresh the page.",
|
||||
@@ -381,8 +384,8 @@
|
||||
"QCOperation_NoQCFunction": "The project configuration of image QC process was not check, so there is no need to cancel the task function.",
|
||||
"QCOperation_NoTaskOwner": "The current visiting image QC has not been claimed by anyone, and cannot been released.",
|
||||
"QCOperation_DiseaseProgressConfirmation": "Current visit required PD Confirmation. Please process the unsubmitted prior visit before submitting the current visit: {0}.",
|
||||
"QCOperation_UnsubmittedVisits": " After submitting the current visit, please as soon as possible process any prior visits that have not been submitted: {0}.",
|
||||
"QCOperation_NoBaselineData": "No clinical data at baseline, confirm to submit?",
|
||||
"QCOperation_UnsubmittedVisits": "After submitting the current visit, please submit any prior visits which have not been submitted as soon as possible. ({0})",
|
||||
"QCOperation_NoBaselineData": "No clinical data at baseline. Confirm to submit?",
|
||||
"QCOperation_NoImageData": "Dicom/ Non-dicom image data has not been uploaded. Submission is not allowed.",
|
||||
"QCOperation_ImagesSubmitted": "The image data of the current visit has been submitted by another CRC.",
|
||||
"QCOperation_BatchImagesSubmitted": "The visit image data is currently submitted in batches, part of which has been submitted by other CRCs.",
|
||||
|
||||
@@ -39,7 +39,10 @@
|
||||
|
||||
// ------------------------------------------------------------Reading--------------------------------------------------------------------
|
||||
//ClinicalDataSetService
|
||||
"ClinicalDataSet_Apply": "当前临床数据需要配置一个检查日期才能应用",
|
||||
"ClinicalDataSet_DupTypeFail": "存在同类型的临床数据,操作失败",
|
||||
//ClinicalQuestionService
|
||||
"ClinicalQuestion_Repeat": "存在相同的问题名称!",
|
||||
//ReadingClinicalDataService
|
||||
"ReadingClinicalData_DupTypeFail": "存在同类型的临床数据,操作失败",
|
||||
"ReadingClinicalData_Unchecked": "当前临床数据状态不是已核查状态,不允许签名!",
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
public bool? IsUrgent { get; set; }
|
||||
public Guid? DoctorUserId { get; set; }
|
||||
|
||||
|
||||
public bool? IsInvalid { get; set; }
|
||||
public TaskState? TaskState { get; set; }
|
||||
|
||||
public MedicalReviewAuditState? AuditState { get; set; }
|
||||
|
||||
@@ -257,7 +257,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
public Guid SubjectId { get; set; }
|
||||
public string SubjectCode { get; set; } = String.Empty;
|
||||
|
||||
public bool IsUrgent => UnReadTaskList.Any(t => t.IsUrgent);
|
||||
public bool IsUrgent => UnReadCanReadTaskList.Any(t => t.IsUrgent);
|
||||
|
||||
public int UnReadTaskCount { get; set; }
|
||||
|
||||
@@ -271,6 +271,38 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
|
||||
public DateTime? SuggesteFinishedTime { get; set; }
|
||||
|
||||
public int? UrgentColor
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.SuggesteFinishedTime != null)
|
||||
{
|
||||
var date = DateTime.Now;
|
||||
var timeSpan = SuggesteFinishedTime.Value- date;
|
||||
if (timeSpan.TotalDays <= 2)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if (timeSpan.TotalDays <= 5)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int UrgentCount => UnReadCanReadTaskList.Count(t => t.IsUrgent);
|
||||
|
||||
public List<IRUnreadTaskView> UnReadCanReadTaskList => UnReadTaskList.Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)).ToList();
|
||||
|
||||
public List<IRUnreadTaskView> UnReadTaskList { get; set; } = new List<IRUnreadTaskView>();
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace IRaCIS.Core.Application.Interfaces
|
||||
|
||||
//Task<PageOutput<TaskMedicalReviewView>> GetTaskMedicalReviewList(TaskMedicalReviewQuery queryTaskMedicalReview);
|
||||
|
||||
|
||||
|
||||
Task<TaskMedicalReviewView> GetNextMedicalReviewTask(GetNextMedicalReviewTaskInDto inDto);
|
||||
Task<IResponseOutput<PageOutput<TaskMedicalReviewView>>> GetMIMMedicalReviewTaskList(TaskMedicalReviewQuery inQuery);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
var list = await _taskAllocationRuleRepository.Where(t => t.TrialId == trialId).ProjectTo<TaskAllocationRuleDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
//所有标准都是一样 后台只返回任意一个标准的就好了
|
||||
var trialTaskConfig = _repository.Where<ReadingQuestionCriterionTrial>(t => t.TrialId == trialId && t.IsConfirm).ProjectTo<TrialTaskConfigView>(_mapper.ConfigurationProvider).FirstOrDefault();
|
||||
var trialTaskConfig = await _repository.Where<ReadingQuestionCriterionTrial>(t => t.TrialId == trialId && t.IsConfirm).ProjectTo<TrialTaskConfigView>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
||||
|
||||
return (list, trialTaskConfig);
|
||||
}
|
||||
|
||||
@@ -13,9 +13,9 @@ using IRaCIS.Core.Domain.Share;
|
||||
using System.Linq.Expressions;
|
||||
using IRaCIS.Core.Infra.EFCore.Common;
|
||||
using System.Linq;
|
||||
using Nito.AsyncEx;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using Medallion.Threading;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
@@ -31,16 +31,17 @@ namespace IRaCIS.Core.Application.Service
|
||||
private readonly IRepository<SubjectUser> _subjectUserRepository;
|
||||
private readonly IRepository<Subject> _subjectRepository;
|
||||
private readonly IRepository<Enroll> _enrollRepository;
|
||||
private readonly IDistributedLockProvider _distributedLockProvider;
|
||||
|
||||
private readonly AsyncLock _mutex = new AsyncLock();
|
||||
|
||||
public TaskConsistentRuleService(IRepository<VisitTask> visitTaskRepository, IRepository<Enroll> enrollRepository, IRepository<TaskConsistentRule> taskConsistentRuleRepository, IRepository<SubjectUser> subjectUserRepository, IRepository<Subject> subjectRepository)
|
||||
public TaskConsistentRuleService(IRepository<VisitTask> visitTaskRepository, IRepository<Enroll> enrollRepository, IRepository<TaskConsistentRule> taskConsistentRuleRepository, IRepository<SubjectUser> subjectUserRepository, IRepository<Subject> subjectRepository, IDistributedLockProvider distributedLockProvider)
|
||||
{
|
||||
_taskConsistentRuleRepository = taskConsistentRuleRepository;
|
||||
_visitTaskRepository = visitTaskRepository;
|
||||
_subjectUserRepository = subjectUserRepository;
|
||||
_subjectRepository = subjectRepository;
|
||||
_enrollRepository = enrollRepository;
|
||||
_distributedLockProvider = distributedLockProvider;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -142,7 +143,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
//var list = query.OrderByDescending(t => t.IsHaveGeneratedTask).ToList();
|
||||
|
||||
using (await _mutex.LockAsync())
|
||||
var @lock = _distributedLockProvider.CreateLock($"VisitTaskCode");
|
||||
|
||||
using (await @lock.AcquireAsync())
|
||||
{
|
||||
int maxCodeInt = 0;
|
||||
|
||||
@@ -293,7 +296,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
var configDoctorUserIdList = await doctorUserIdQuery.ToListAsync();
|
||||
|
||||
using (await _mutex.LockAsync())
|
||||
var @lock = _distributedLockProvider.CreateLock($"VisitTaskCode");
|
||||
|
||||
using (await @lock.AcquireAsync())
|
||||
{
|
||||
int maxCodeInt = 0;
|
||||
|
||||
@@ -333,7 +338,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
//需要处理的医生
|
||||
|
||||
var needAddDoctorUserIdList = configDoctorUserIdList.Except(subject.VisitTaskList.Select(t => (Guid)t.DoctorUserId)).ToList();
|
||||
var needAddDoctorUserIdList = configDoctorUserIdList.Except(subject.VisitTaskList.Select(t => t.DoctorUserId!.Value)).ToList();
|
||||
|
||||
if (needAddDoctorUserIdList.Count == 0)
|
||||
{
|
||||
|
||||
@@ -78,120 +78,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 产生医学审核
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Obsolete]
|
||||
public async Task<IResponseOutput> GenerateMedicalReviewTask(GenerateMedicalReviewTaskCommand generateCommand)
|
||||
{
|
||||
var trialId = generateCommand.TrialId;
|
||||
|
||||
//var mimUserList = await _trialUserRepository.Where(t => t.User.UserTypeEnum == Domain.Share.UserTypeEnum.MIM && t.TrialId == trialId).Select(t => t.User).ProjectTo<UserSimpleInfo>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
|
||||
|
||||
Guid? defalutMIMUserId = null /*mimUserList.FirstOrDefault()?.UserId*/;
|
||||
|
||||
//获取当前医生数据 已经生成的,和配置的数量
|
||||
var taskTaskMedicalReviewRuleList = await _taskMedicalReviewRuleRepository.Where(t => t.TrialId == trialId).ProjectTo<TaskMedicalReviewRuleView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
foreach (var item in taskTaskMedicalReviewRuleList)
|
||||
{
|
||||
|
||||
if (item.IsEnable)
|
||||
{
|
||||
|
||||
if (item.PlanGlobalCount > item.GeneratedGlobalCount)
|
||||
{
|
||||
var needGenerateCount = item.PlanGlobalCount - item.GeneratedGlobalCount;
|
||||
|
||||
var canGenerateCount = item.ActualGlobalCount - item.GeneratedGlobalCount;
|
||||
|
||||
var toGenerateCount = canGenerateCount > needGenerateCount ? needGenerateCount : canGenerateCount;
|
||||
|
||||
//分配给MIM
|
||||
|
||||
if (toGenerateCount > 0)
|
||||
{
|
||||
var toGenerateTaskList = item.ActualGlobalTaskList.ExceptBy(item.GeneratedGlobalTaskList.Select(t => t.TaskId), t => t.TaskId).Take(toGenerateCount).ToList();
|
||||
|
||||
foreach (var toGenerateTask in toGenerateTaskList)
|
||||
{
|
||||
await _taskMedicalReviewRepository.AddAsync(new TaskMedicalReview() { DoctorUserId = toGenerateTask.DoctorUserId!.Value, TrialId = toGenerateTask.TrialId, VisitTaskId = toGenerateTask.TaskId, MedicalManagerUserId = defalutMIMUserId });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (item.PlanJudgeCount > item.GeneratedJudgeCount)
|
||||
{
|
||||
var needGenerateCount = item.PlanJudgeCount - item.GeneratedJudgeCount;
|
||||
|
||||
var canGenerateCount = item.ActualJudgeCount - item.GeneratedGlobalCount;
|
||||
|
||||
var toGenerateCount = canGenerateCount > needGenerateCount ? needGenerateCount : canGenerateCount;
|
||||
|
||||
if (toGenerateCount > 0)
|
||||
{
|
||||
var toGenerateTaskList = item.ActualJudgeTaskList.ExceptBy(item.GeneratedJudgeTaskList.Select(t => t.TaskId), t => t.TaskId).Take(toGenerateCount).ToList();
|
||||
|
||||
foreach (var toGenerateTask in toGenerateTaskList)
|
||||
{
|
||||
await _taskMedicalReviewRepository.AddAsync(new TaskMedicalReview() { DoctorUserId = toGenerateTask.DoctorUserId!.Value, TrialId = toGenerateTask.TrialId, VisitTaskId = toGenerateTask.TaskId, MedicalManagerUserId = defalutMIMUserId });
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (item.PlanTumorCount > item.GeneratedTumorCount)
|
||||
{
|
||||
var needGenerateCount = item.PlanTumorCount - item.GeneratedTumorCount;
|
||||
|
||||
var canGenerateCount = item.ActualTumorCount - item.GeneratedGlobalCount;
|
||||
|
||||
var toGenerateCount = canGenerateCount > needGenerateCount ? needGenerateCount : canGenerateCount;
|
||||
|
||||
if (toGenerateCount > 0)
|
||||
{
|
||||
var toGenerateTaskList = item.ActualTumorTaskList.ExceptBy(item.GeneratedTumorTaskList.Select(t => t.TaskId), t => t.TaskId).Take(toGenerateCount).ToList();
|
||||
|
||||
foreach (var toGenerateTask in toGenerateTaskList)
|
||||
{
|
||||
await _taskMedicalReviewRepository.AddAsync(new TaskMedicalReview() { DoctorUserId = toGenerateTask.DoctorUserId!.Value, TrialId = toGenerateTask.TrialId, VisitTaskId = toGenerateTask.TaskId, MedicalManagerUserId = defalutMIMUserId });
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (item.PlanVisitCount > item.GeneratedVisitCount)
|
||||
{
|
||||
var needGenerateCount = item.PlanVisitCount - item.GeneratedVisitCount;
|
||||
|
||||
var canGenerateCount = item.ActualVisitCount - item.GeneratedGlobalCount;
|
||||
|
||||
var toGenerateCount = canGenerateCount > needGenerateCount ? needGenerateCount : canGenerateCount;
|
||||
|
||||
if (toGenerateCount > 0)
|
||||
{
|
||||
|
||||
var toGenerateTaskList = item.ActualVisitTaskList.ExceptBy(item.GeneratedVisitTaskList.Select(t => t.TaskId), t => t.TaskId).Take(toGenerateCount).ToList();
|
||||
|
||||
foreach (var toGenerateTask in toGenerateTaskList)
|
||||
{
|
||||
await _taskMedicalReviewRepository.AddAsync(new TaskMedicalReview() { DoctorUserId = toGenerateTask.DoctorUserId!.Value, TrialId = toGenerateTask.TrialId, VisitTaskId = toGenerateTask.TaskId, MedicalManagerUserId = defalutMIMUserId });
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
await _taskMedicalReviewRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Ok();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
var medicalReview = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.MedicalReviewId).Include(x=>x.VisitTask).FirstNotNullAsync();
|
||||
|
||||
var subjectReview = await GetMIMMedicalReviewTaskList(new TaskMedicalReviewQuery()
|
||||
var subjectReview = (await GetMIMMedicalReviewTaskList(new TaskMedicalReviewQuery()
|
||||
{
|
||||
|
||||
TrialId = medicalReview.TrialId,
|
||||
@@ -148,14 +148,14 @@ namespace IRaCIS.Core.Application.Service
|
||||
TrialReadingCriterionId = medicalReview.VisitTask.TrialReadingCriterionId,
|
||||
PageIndex=1,
|
||||
PageSize=1,
|
||||
});
|
||||
})).Data;
|
||||
|
||||
if (subjectReview.Item1.CurrentPageData.Count == 1)
|
||||
if (subjectReview.CurrentPageData.Count == 1)
|
||||
{
|
||||
return subjectReview.Item1.CurrentPageData[0];
|
||||
return subjectReview.CurrentPageData[0];
|
||||
}
|
||||
|
||||
var data = await GetMIMMedicalReviewTaskList(new TaskMedicalReviewQuery()
|
||||
var data = (await GetMIMMedicalReviewTaskList(new TaskMedicalReviewQuery()
|
||||
{
|
||||
|
||||
TrialId = medicalReview.TrialId,
|
||||
@@ -164,11 +164,11 @@ namespace IRaCIS.Core.Application.Service
|
||||
TrialReadingCriterionId = medicalReview.VisitTask.TrialReadingCriterionId,
|
||||
PageIndex = 1,
|
||||
PageSize = 1,
|
||||
});
|
||||
})).Data;
|
||||
|
||||
if (data.Item1.CurrentPageData.Count == 1)
|
||||
if (data.CurrentPageData.Count == 1)
|
||||
{
|
||||
return data.Item1.CurrentPageData[0];
|
||||
return data.CurrentPageData[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -186,7 +186,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<(PageOutput<TaskMedicalReviewView>, object)> 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)
|
||||
@@ -200,13 +200,14 @@ namespace IRaCIS.Core.Application.Service
|
||||
.WhereIf(inQuery.DoctorUserId != null, t => t.VisitTask.DoctorUserId == inQuery.DoctorUserId)
|
||||
.WhereIf(inQuery.ReadingCategory != null, t => t.VisitTask.ReadingCategory == inQuery.ReadingCategory)
|
||||
.WhereIf(inQuery.ReadingTaskState != null, t => t.VisitTask.ReadingTaskState == inQuery.ReadingTaskState)
|
||||
.WhereIf(inQuery.IsInvalid != null, t => t.IsInvalid == inQuery.IsInvalid)
|
||||
.WhereIf(inQuery.IsGetBeRead,x=>!x.IsInvalid&&x.AuditState!= MedicalReviewAuditState.HaveSigned)
|
||||
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.VisitTask.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
||||
.ProjectTo<TaskMedicalReviewView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(TaskMedicalReviewView.Id) : inQuery.SortField, inQuery.Asc);
|
||||
|
||||
return (pageList, new
|
||||
return ResponseOutput.Ok(pageList, new
|
||||
{
|
||||
|
||||
IsConfirmMedicineQuestion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inQuery.TrialReadingCriterionId).Select(x => x.IsConfirmMedicineQuestion).FirstOrDefaultAsync()
|
||||
@@ -295,7 +296,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
[HttpGet("{trialId:guid}")]
|
||||
public async Task<List<UserSimpleInfo>> GetMIMUserList(Guid trialId)
|
||||
{
|
||||
var query = _trialUserRepository.Where(t => t.User.UserTypeEnum == Domain.Share.UserTypeEnum.MIM && t.TrialId == trialId).Select(t => t.User).ProjectTo<UserSimpleInfo>(_mapper.ConfigurationProvider);
|
||||
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);
|
||||
|
||||
return await query.ToListAsync();
|
||||
}
|
||||
|
||||
@@ -165,16 +165,16 @@ namespace IRaCIS.Core.Application.Service
|
||||
}
|
||||
else
|
||||
{
|
||||
needGenerateVisit = await _subjectVisitRepository.Where(t => subjectVisitIdList.Contains(t.Id)).ToListAsync();
|
||||
needGenerateVisit = await _subjectVisitRepository.Where(t => subjectVisitIdList!.Contains(t.Id)).ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
var trialReadingCriterionConfig = await _trialReadingCriterionRepository.Where(t => t.Id == confirmedTrialReadingCriterionId).Select(t => new { TrialReadingCriterionId = t.Id, t.ReadingTool, t.ReadingType, t.IsReadingTaskViewInOrder, t.IsFollowVisitAutoAssign, t.IsFollowGlobalVisitAutoAssign, t.FollowGlobalVisitAutoAssignDefaultState, t.FollowVisitAutoAssignDefaultState, t.TaskAllocateObjEnum, t.CriterionType }).FirstOrDefaultAsync();
|
||||
var trialReadingCriterionConfig = await _trialReadingCriterionRepository.Where(t => t.Id == confirmedTrialReadingCriterionId).Select(t => new { TrialReadingCriterionId = t.Id, t.ReadingTool, t.ReadingType, t.IsReadingTaskViewInOrder, t.IsFollowVisitAutoAssign, t.IsFollowGlobalVisitAutoAssign, t.FollowGlobalVisitAutoAssignDefaultState, t.FollowVisitAutoAssignDefaultState, t.TaskAllocateObjEnum, t.CriterionType }).FirstNotNullAsync();
|
||||
|
||||
//获取确认的临床数据配置
|
||||
var clinicalDataConfirmList = _trialClinicalDataSetRepository.Where(t => t.TrialId == trialId && t.IsConfirm).Include(t => t.TrialClinicalDataSetCriteriaList).ToList();
|
||||
|
||||
var visitBlindConfig = _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.BlindBaseLineName, t.BlindFollowUpPrefix }).FirstOrDefault();
|
||||
var visitBlindConfig = await _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.BlindBaseLineName, t.BlindFollowUpPrefix }).FirstNotNullAsync();
|
||||
|
||||
var dbMaxCode = _visitTaskRepository.Where(t => t.TrialId == trialId).Select(t => t.Code).DefaultIfEmpty().Max();
|
||||
|
||||
@@ -318,7 +318,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
task1.TaskAllocationState = defaultState;
|
||||
//分配给对应Arm的人
|
||||
task1.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm1).DoctorUserId;
|
||||
task1.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm1)!.DoctorUserId;
|
||||
task1.AllocateTime = DateTime.Now;
|
||||
|
||||
task1.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||
@@ -327,7 +327,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
|
||||
{
|
||||
task2.TaskAllocationState = defaultState;
|
||||
task2.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm2).DoctorUserId;
|
||||
task2.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm2)!.DoctorUserId;
|
||||
task2.AllocateTime = DateTime.Now;
|
||||
task2.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||
}
|
||||
@@ -376,9 +376,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.SingleReadingArm))
|
||||
{
|
||||
singleTask.TaskAllocationState = defaultState;
|
||||
singleTask!.TaskAllocationState = defaultState;
|
||||
|
||||
singleTask.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.SingleReadingArm).DoctorUserId;
|
||||
singleTask.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.SingleReadingArm)!.DoctorUserId;
|
||||
|
||||
singleTask.AllocateTime = DateTime.Now;
|
||||
|
||||
@@ -459,6 +459,13 @@ namespace IRaCIS.Core.Application.Service
|
||||
var haveSignedCount = _readingClinicalDataRepository
|
||||
.Where(t => t.TrialId == trialId && t.IsSign && t.ReadingClinicalDataState == ReadingClinicalDataStatus.HaveSigned && t.ReadingId == readingId && t.ClinicalDataTrialSet.UploadRole == UploadRole.PM).Count();
|
||||
|
||||
|
||||
var readModule = _readModuleRepository.Where(t => t.Id == readingId).FirstOrDefault();
|
||||
//CRC 阅片期自定义结构化录入是否签名
|
||||
bool crcReadModuleSign = true;
|
||||
|
||||
|
||||
|
||||
//访视
|
||||
if (readingCategory == ReadingCategory.Visit)
|
||||
{
|
||||
@@ -478,16 +485,37 @@ namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//阅片期
|
||||
else if (readingCategory == ReadingCategory.Global)
|
||||
{
|
||||
needSignCount = trialClinicalDataSetList.Where(t => t.TrialClinicalDataSetCriteriaList.Any(c => c.TrialReadingCriterionId == trialReadingCriterionId) && t.ClinicalDataLevel == ClinicalLevel.ImageRead && t.UploadRole == UploadRole.PM).Count();
|
||||
|
||||
if (readModule != null)
|
||||
{
|
||||
// 不存在需要CRC上传的临床数据 或者 PM已确认
|
||||
crcReadModuleSign =
|
||||
!trialClinicalDataSetList.Any(x =>
|
||||
x.UploadRole == UploadRole.CRC
|
||||
&& x.ClinicalDataLevel == ClinicalLevel.ImageRead
|
||||
&& x.ClinicalUploadType == ClinicalUploadType.Structuring
|
||||
&& x.TrialClinicalDataSetCriteriaList.Any(c => c.TrialReadingCriterionId == trialReadingCriterionId)) || readModule.IsPMConfirm;
|
||||
}
|
||||
}
|
||||
// 肿瘤学
|
||||
else if (readingCategory == ReadingCategory.Oncology)
|
||||
{
|
||||
return trialClinicalDataSetList.Any(t => t.TrialClinicalDataSetCriteriaList.Any(c => c.TrialReadingCriterionId == trialReadingCriterionId) && t.ClinicalDataLevel == ClinicalLevel.OncologyRead);
|
||||
needSignCount= trialClinicalDataSetList.Where(t => t.TrialClinicalDataSetCriteriaList.Any(c => c.TrialReadingCriterionId == trialReadingCriterionId) && t.ClinicalDataLevel == ClinicalLevel.OncologyRead && t.UploadRole == UploadRole.PM).Count();
|
||||
if (readModule != null)
|
||||
{
|
||||
// 不存在需要CRC上传的临床数据 或者 PM已确认
|
||||
crcReadModuleSign =
|
||||
!trialClinicalDataSetList.Any(x =>
|
||||
x.UploadRole == UploadRole.CRC
|
||||
&& x.ClinicalDataLevel == ClinicalLevel.OncologyRead
|
||||
&& x.ClinicalUploadType == ClinicalUploadType.Structuring
|
||||
&& x.TrialClinicalDataSetCriteriaList.Any(c => c.TrialReadingCriterionId == trialReadingCriterionId)) || readModule.IsPMConfirm;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -495,7 +523,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
}
|
||||
|
||||
//可能仅仅CRC 基线 没有PM
|
||||
if (needSignCount == haveSignedCount /*&& needSignCount != 0*/)
|
||||
if (needSignCount == haveSignedCount && crcReadModuleSign )
|
||||
{
|
||||
isClinicalDataSign = true;
|
||||
|
||||
@@ -562,7 +590,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
var trialReadingCriterionConfigList = _trialReadingCriterionRepository.Where(t => t.TrialId == trialId && t.ReadingInfoSignTime != null).Select(t => new { TrialReadingCriterionId = t.Id, t.ReadingTool, t.ReadingType, t.IsReadingTaskViewInOrder, t.IsFollowVisitAutoAssign, t.IsAutoCreate, t.IsFollowGlobalVisitAutoAssign, t.FollowGlobalVisitAutoAssignDefaultState, t.FollowVisitAutoAssignDefaultState, t.TaskAllocateObjEnum, t.CriterionType }).ToList();
|
||||
|
||||
var visitBlindConfig = _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.BlindBaseLineName, t.BlindFollowUpPrefix }).FirstOrDefault();
|
||||
var visitBlindConfig = await _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.BlindBaseLineName, t.BlindFollowUpPrefix }).FirstNotNullAsync();
|
||||
|
||||
//获取确认的临床数据配置
|
||||
var clinicalDataConfirmList = _trialClinicalDataSetRepository.Where(t => t.TrialId == trialId && t.IsConfirm).Include(t => t.TrialClinicalDataSetCriteriaList).ToList();
|
||||
@@ -620,7 +648,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
foreach (var trialReadingCriterionConfig in trialReadingCriterionConfigList)
|
||||
{
|
||||
|
||||
var trialReadingCriterionId = trialReadingCriterionConfig.TrialReadingCriterionId;
|
||||
//var subjectCriteriaEvaluation = _subjectCriteriaEvaluationRepository.Where(t => t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.IsJoinEvaluation && t.SubjectId == subjectVisit.SubjectId).FirstOrDefault();
|
||||
|
||||
if (trialReadingCriterionConfig.IsAutoCreate == true /*|| (trialReadingCriterionConfig.IsAutoCreate == false && subjectCriteriaEvaluation != null && subjectCriteriaEvaluation?.IsJoinEvaluation == true)*/)
|
||||
@@ -660,7 +688,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
|
||||
var existCurrentVisitTaskList = _visitTaskRepository.Where(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId
|
||||
&& t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.TaskState == TaskState.Effect
|
||||
&& t.TrialReadingCriterionId == trialReadingCriterionId && t.TaskState == TaskState.Effect
|
||||
&& t.TaskAllocationState == TaskAllocationState.NotAllocate && t.DoctorUserId == null && t.SourceSubjectVisitId == subjectVisit.Id).ToList();
|
||||
|
||||
VisitTask? task1 = null;
|
||||
@@ -773,7 +801,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
task1.TaskAllocationState = defaultState;
|
||||
//分配给对应Arm的人
|
||||
task1.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm1).DoctorUserId;
|
||||
task1.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm1)!.DoctorUserId;
|
||||
task1.AllocateTime = DateTime.Now;
|
||||
|
||||
task1.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||
@@ -782,7 +810,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
|
||||
{
|
||||
task2.TaskAllocationState = defaultState;
|
||||
task2.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm2).DoctorUserId;
|
||||
task2.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm2)!.DoctorUserId;
|
||||
task2.AllocateTime = DateTime.Now;
|
||||
task2.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||
}
|
||||
@@ -798,7 +826,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
//存在退回访视1 又退回基线 这种情况 生成任务 考虑基线先一致性核查通过,但是访视1还未通过时 生成任务
|
||||
var followVisitTaskList = await _visitTaskRepository
|
||||
.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum > subjectVisit.VisitNum && t.SourceSubjectVisit.CheckState == CheckStateEnum.CVPassed && t.ReadingCategory == ReadingCategory.Visit && t.IsAnalysisCreate == false, true)
|
||||
.WhereIf(followBackVisitTask != null, t => t.VisitTaskNum < followBackVisitTask.VisitTaskNum)
|
||||
.WhereIf(followBackVisitTask != null, t => t.VisitTaskNum < followBackVisitTask!.VisitTaskNum)
|
||||
.ToListAsync();
|
||||
|
||||
var followVisitGroup = followVisitTaskList.GroupBy(t => t.VisitTaskNum);
|
||||
@@ -887,7 +915,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
IsSelfAnalysis = latestTask.IsSelfAnalysis,
|
||||
TaskAllocationState = TaskAllocationState.Allocated,
|
||||
AllocateTime = DateTime.Now,
|
||||
DoctorUserId = task1.DoctorUserId,
|
||||
DoctorUserId = task1!.DoctorUserId,
|
||||
SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget),
|
||||
TrialReadingCriterionId = latestTask.TrialReadingCriterionId,
|
||||
IsNeedClinicalDataSign = latestTask.IsNeedClinicalDataSign,
|
||||
@@ -954,7 +982,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
TaskAllocationState = TaskAllocationState.Allocated,
|
||||
|
||||
AllocateTime = DateTime.Now,
|
||||
DoctorUserId = task2.DoctorUserId,
|
||||
DoctorUserId = task2!.DoctorUserId,
|
||||
SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget),
|
||||
|
||||
TrialReadingCriterionId = latestTask.TrialReadingCriterionId,
|
||||
@@ -981,7 +1009,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
task1.TaskAllocationState = defaultState;
|
||||
//分配给对应Arm的人
|
||||
task1.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm1).DoctorUserId;
|
||||
task1.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm1)!.DoctorUserId;
|
||||
task1.AllocateTime = DateTime.Now;
|
||||
|
||||
task1.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||
@@ -990,7 +1018,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
|
||||
{
|
||||
task2.TaskAllocationState = defaultState;
|
||||
task2.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm2).DoctorUserId;
|
||||
task2.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm2)!.DoctorUserId;
|
||||
task2.AllocateTime = DateTime.Now;
|
||||
task2.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||
}
|
||||
@@ -1061,7 +1089,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
|
||||
//该Subject 之前是否有已分配的 如果改变配置 可能会出现 一个Subject 分配的同一个医生 有的在Arm1 有的在Arm2
|
||||
var allocateSubjectArmList = _visitTaskRepository.Where(t => t.SubjectId == subjectVisit.SubjectId && t.TrialId == trialId && t.DoctorUserId != null && t.ArmEnum != Arm.JudgeArm)
|
||||
var allocateSubjectArmList = _visitTaskRepository.Where(t => t.SubjectId == subjectVisit.SubjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.TrialId == trialId && t.DoctorUserId != null && t.ArmEnum != Arm.JudgeArm)
|
||||
.Select(t => new { t.DoctorUserId, t.ArmEnum }).Distinct().ToList();
|
||||
|
||||
//不是初次分配
|
||||
@@ -1082,7 +1110,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder)
|
||||
{
|
||||
//之前有回退到影像上传的访视 那么当前访视一致性核查通过的时候,当前访视生成但是不分配出去(排除失访的)
|
||||
var beforeBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum < subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync();
|
||||
var beforeBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.VisitTaskNum < subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync();
|
||||
|
||||
|
||||
if (beforeBackVisitTask == null)
|
||||
@@ -1096,7 +1124,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
singleTask.TaskAllocationState = defaultState;
|
||||
|
||||
singleTask.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.SingleReadingArm).DoctorUserId;
|
||||
singleTask.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.SingleReadingArm)!.DoctorUserId;
|
||||
|
||||
singleTask.AllocateTime = DateTime.Now;
|
||||
|
||||
@@ -1107,12 +1135,12 @@ namespace IRaCIS.Core.Application.Service
|
||||
#endregion
|
||||
|
||||
|
||||
var followBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum > subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync();
|
||||
var followBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.VisitTaskNum > subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync();
|
||||
|
||||
//存在退回访视1 又退回基线 这种情况 生成任务 考虑基线先一致性核查通过,但是访视1还未通过时 生成任务
|
||||
var followVisitTaskList = await _visitTaskRepository
|
||||
.Where(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum > subjectVisit.VisitNum && t.SourceSubjectVisit.CheckState == CheckStateEnum.CVPassed && t.ReadingCategory == ReadingCategory.Visit && t.IsAnalysisCreate == false, true)
|
||||
.WhereIf(followBackVisitTask != null, t => t.VisitTaskNum < followBackVisitTask.VisitTaskNum)
|
||||
.Where(t => t.TrialId == trialId && t.SubjectId == subjectVisit.SubjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.VisitTaskNum > subjectVisit.VisitNum && t.SourceSubjectVisit.CheckState == CheckStateEnum.CVPassed && t.ReadingCategory == ReadingCategory.Visit && t.IsAnalysisCreate == false, true)
|
||||
.WhereIf(followBackVisitTask != null, t => t.VisitTaskNum < followBackVisitTask!.VisitTaskNum)
|
||||
.ToListAsync();
|
||||
|
||||
var followVisitGroup = followVisitTaskList.GroupBy(t => t.VisitTaskNum);
|
||||
@@ -1202,7 +1230,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
singleTask.TaskAllocationState = defaultState;
|
||||
|
||||
singleTask.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.SingleReadingArm).DoctorUserId;
|
||||
singleTask.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.SingleReadingArm)!.DoctorUserId;
|
||||
|
||||
singleTask.AllocateTime = DateTime.Now;
|
||||
|
||||
@@ -1339,7 +1367,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
if (reReadingVisitTask.ReadingCategory == ReadingCategory.Judge)
|
||||
{
|
||||
var judgeRecord = await _readingJudgeInfoRepository.Where(t => t.JudgeTaskId == reReadingVisitTask.Id).FirstOrDefaultAsync();
|
||||
var judgeRecord = await _readingJudgeInfoRepository.Where(t => t.JudgeTaskId == reReadingVisitTask.Id).FirstNotNullAsync();
|
||||
|
||||
var origenalTaskIdList = new Guid[] { judgeRecord.TaskIdOne, judgeRecord.TaskIdTwo };
|
||||
|
||||
@@ -1463,7 +1491,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
break;
|
||||
|
||||
case GenerateTaskCategory.Judge:
|
||||
var firstTask = await _visitTaskRepository.Where(x => generateTaskCommand.JudgeVisitTaskIdList.Contains(x.Id)).FirstOrDefaultAsync();
|
||||
var firstTask = await _visitTaskRepository.Where(x => generateTaskCommand.JudgeVisitTaskIdList.Contains(x.Id)).FirstNotNullAsync();
|
||||
|
||||
var subjectUser = await _subjectUserRepository.Where(x => x.SubjectId == firstTask.SubjectId && x.ArmEnum == Arm.JudgeArm && x.IsConfirmed && x.TrialReadingCriterionId == firstTask.TrialReadingCriterionId).FirstOrDefaultAsync();
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ using System.Linq;
|
||||
using DocumentFormat.OpenXml.Bibliography;
|
||||
using Org.BouncyCastle.Crypto;
|
||||
using IRaCIS.Core.Domain.Share.Reading;
|
||||
using MassTransit;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.Allocation
|
||||
{
|
||||
@@ -576,8 +577,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
|
||||
var taskList = _visitTaskRepository.Where(t => t.TrialId == assignConfirmCommand.TrialId && t.DoctorUserId == null, true)
|
||||
.WhereIf(subjectIdList.Count() > 0 && assignConfirmCommand.IsJudgeDoctor == false, t => subjectIdList.Contains(t.SubjectId) && t.Subject.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).Any())
|
||||
.WhereIf(subjectIdList.Count() > 0 && assignConfirmCommand.IsJudgeDoctor, t => subjectIdList.Contains(t.SubjectId) && t.Subject.SubjectDoctorList.Where(t => t.ArmEnum == Arm.JudgeArm).Any())
|
||||
.WhereIf(subjectIdList.Count > 0 && assignConfirmCommand.IsJudgeDoctor == false, t => subjectIdList.Contains(t.SubjectId) && t.Subject.SubjectDoctorList.Where(t => t.ArmEnum != Arm.JudgeArm).Any())
|
||||
.WhereIf(subjectIdList.Count > 0 && assignConfirmCommand.IsJudgeDoctor, t => subjectIdList.Contains(t.SubjectId) && t.Subject.SubjectDoctorList.Where(t => t.ArmEnum == Arm.JudgeArm).Any())
|
||||
//过滤掉 那些回退的subject
|
||||
.Where(t => !t.Subject.SubjectVisitList.Any(t => t.IsPMBackOrReReading))
|
||||
|
||||
@@ -1068,7 +1069,6 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
/// 获取有序阅片IQuery对象
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
|
||||
/// <returns></returns>
|
||||
public async Task<(int, List<IRUnReadSubjectView>)> GetOrderReadingIQueryable(GetOrderReadingIQueryableInDto inDto)
|
||||
{
|
||||
@@ -1081,15 +1081,19 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
var visitQuery = _visitTaskRepository.Where(x => x.TrialId == inDto.TrialId && x.DoctorUserId == _userInfo.Id
|
||||
&& x.TaskState == TaskState.Effect /*&& x.TrialReadingCriterionId== inDto.TrialReadingCriterionId*/)
|
||||
.WhereIf(critrion.IsAutoCreate == false, t => t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(t => t.IsGeneratedTask == false) ?
|
||||
t.VisitTaskNum <= t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.IsGeneratedTask == false).Min(t => t.SubjectVisit.VisitNum) : true)
|
||||
|
||||
//前序 不存在 未生成任务的访视
|
||||
.WhereIf(critrion.IsAutoCreate == false, t => !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum))
|
||||
|
||||
.Where(t => t.Subject.SubjectVisitList.Any(t => t.CheckState != CheckStateEnum.CVPassed) ? t.VisitTaskNum <= t.Subject.SubjectVisitList.Where(t => t.CheckState != CheckStateEnum.CVPassed).Min(t => t.VisitNum) : true)
|
||||
// 前序 不存在 未一致性核查未通过的
|
||||
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum))
|
||||
//.WhereIf(critrion.IsAutoCreate == false, t => t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(t => t.IsGeneratedTask == false) ?
|
||||
//t.VisitTaskNum <= t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.IsGeneratedTask == false).Min(t => t.SubjectVisit.VisitNum) : true)
|
||||
//.Where(t => t.Subject.SubjectVisitList.Any(t => t.CheckState != CheckStateEnum.CVPassed) ? t.VisitTaskNum <= t.Subject.SubjectVisitList.Where(t => t.CheckState != CheckStateEnum.CVPassed).Min(t => t.VisitNum) : true)
|
||||
//满足前序访视不存在 需要签署但是未签署 sql 相当复杂 同时想查询所有未读的统计数字 就无法统计 byzhouhang
|
||||
//但是加字段 IsFrontTaskNeedSignButNotSign 那么签名临床数据的时候,要对该subject 该标准的有效的任务 这个字段需要在签名的时候维护 采取这种方式 统计数字灵活
|
||||
//.Where(t => t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum))
|
||||
.WhereIf(!string.IsNullOrEmpty(inDto.SubjectCode), t => (t.Subject.Code.Contains(inDto.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inDto.SubjectCode) && t.IsAnalysisCreate));
|
||||
.WhereIf(!string.IsNullOrEmpty(inDto.SubjectCode), t => (t.Subject.Code.Contains(inDto.SubjectCode!) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inDto.SubjectCode!) && t.IsAnalysisCreate));
|
||||
|
||||
|
||||
var visitGroupQuery = visitQuery.GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode });
|
||||
@@ -1145,7 +1149,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
var result = new List<IRUnReadSubjectView>();
|
||||
|
||||
var propName = string.IsNullOrWhiteSpace(inDto.Page.SortField) ? "UnReadCanReadTaskCount" : inDto.Page.SortField;
|
||||
var propName = string.IsNullOrWhiteSpace(inDto.Page!.SortField) ? "UnReadCanReadTaskCount" : inDto.Page.SortField;
|
||||
|
||||
var visitTaskOrderQuery = inDto.Page.Asc ? visitTaskQuery.OrderBy(propName) : visitTaskQuery.OrderBy(propName + " desc");
|
||||
if (inDto.Page != null)
|
||||
@@ -1210,6 +1214,17 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
var baseLineTaskList = await _visitTaskRepository.Where(t => t.TrialId == command.TrialId && t.TrialReadingCriterionId == command.TrialReadingCriterionId && t.DoctorUserId == _userInfo.Id
|
||||
&& t.TaskState == TaskState.Effect && t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState == ReadingTaskState.HaveSigned && t.SourceSubjectVisit.IsBaseLine == true).ToListAsync();
|
||||
|
||||
var judegeList= await _visitTaskRepository.Where(t => t.TrialId == command.TrialId && t.TrialReadingCriterionId == command.TrialReadingCriterionId && t.DoctorUserId == _userInfo.Id
|
||||
&& t.TaskState == TaskState.Effect && t.ReadingCategory == ReadingCategory.Judge && t.ReadingTaskState == ReadingTaskState.HaveSigned).ToListAsync();
|
||||
|
||||
foreach (var item in judegeList)
|
||||
{
|
||||
if (!baseLineTaskList.Any(t => t.SubjectId == item.SubjectId))
|
||||
{
|
||||
baseLineTaskList.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var baseLineTaskIdList = baseLineTaskList.Select(t => t.Id).ToList();
|
||||
|
||||
@@ -1229,7 +1244,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
var requestRecordList = await _visitTaskReReadingRepository.Where(t => baseLineTaskIdList.Contains(t.OriginalReReadingTaskId) && t.RequestReReadingUserId == _userInfo.Id && t.RequestReReadingReason == "AIR自动重阅基线").ToListAsync();
|
||||
|
||||
if (requestRecordList.Count() != baseLineTaskIdList.Count())
|
||||
if (requestRecordList.Count != baseLineTaskIdList.Count)
|
||||
{
|
||||
//---后台数据有错误
|
||||
return ResponseOutput.NotOk(_localizer["VisitTask_DoctorConfiguration"]);
|
||||
@@ -1412,7 +1427,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
//添加申请记录
|
||||
var visitTaskReReading = await _visitTaskReReadingRepository.AddAsync(new VisitTaskReReading()
|
||||
{
|
||||
|
||||
TrialId = applyReReadingCommand.TrialId,
|
||||
RootReReadingTaskId = rootReReadingTaskId == Guid.Empty ? task.Id : rootReReadingTaskId,
|
||||
OriginalReReadingTaskId = task.Id,
|
||||
RequestReReadingTime = DateTime.Now,
|
||||
@@ -1433,10 +1448,11 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重阅原任务跟踪处理 只会在同意的时候调用这个
|
||||
/// 重阅原任务跟踪处理
|
||||
/// </summary>
|
||||
/// <param name="origenalTask"></param>
|
||||
/// <param name="agreeReReadingCommand"></param>
|
||||
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||
private void ReReadingTaskTrackingDeal(VisitTask origenalTask, ConfirmReReadingCommand agreeReReadingCommand)
|
||||
{
|
||||
if (origenalTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed || origenalTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed)
|
||||
@@ -1478,7 +1494,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
/// </summary>
|
||||
/// <param name="subjectId"></param>
|
||||
/// <returns></returns>
|
||||
private async Task SetReReadingOrBackInfluenceAnalysisAsync(Guid subjectId)
|
||||
private async Task PMReReadingConfirmOrBackInfluenceAnalysisAsync(Guid subjectId)
|
||||
{
|
||||
if (await _repository.AnyAsync<VisitTask>(t => t.IsAnalysisCreate && t.SubjectId == subjectId))
|
||||
{
|
||||
@@ -1546,7 +1562,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
//1.1 有附加评估,会影响其他标准的任务
|
||||
if (criterionConfig.CriterionType == CriterionType.RECIST1Point1 && criterionConfig.IsAdditionalAssessment)
|
||||
{
|
||||
// PM申请 SPM / CPM审批
|
||||
// PM申请 SPM / CPM审批
|
||||
if (visitTaskReReadingAppply.RequestReReadingType == RequestReReadingType.TrialGroupApply && (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM))
|
||||
{
|
||||
filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == origenalTask.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB);
|
||||
@@ -1561,7 +1577,6 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
isIR1Point1AdditionalAssessmentBaseline = true;
|
||||
|
||||
//filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == origenalTask.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB);
|
||||
}
|
||||
// 1.1 非基线任务不影响BM任务
|
||||
else
|
||||
@@ -1579,33 +1594,9 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
if (agreeReReadingCommand.RequestReReadingResultEnum == RequestReReadingResult.Agree)
|
||||
{
|
||||
//PM申请 SPM / CPM审批 回退访视,在此不生成访视任务 影响多个标准的任务
|
||||
//PM申请 SPM / CPM审批 回退访视,因此这里不生成访视任务 影响多个标准的任务
|
||||
if (visitTaskReReadingAppply.RequestReReadingType == RequestReReadingType.TrialGroupApply && (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM))
|
||||
{
|
||||
#region PM 申请两个IR 同一访视,其他人的申请记录也设置为同意 不会出现,因为在未处理前 一个Subject只能申请一次
|
||||
|
||||
|
||||
// await _visitTaskReReadingRepository.BatchUpdateNoTrackingAsync(t => t.OriginalReReadingTask.SubjectId == origenalTask.SubjectId &&
|
||||
// t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed &&
|
||||
// t.RequestReReadingType == RequestReReadingType.TrialGroupApply &&
|
||||
//t.OriginalReReadingTask.VisitTaskNum == origenalTask.VisitTaskNum &&
|
||||
//t.Id != item.Id, u => new VisitTaskReReading()
|
||||
//{
|
||||
// RequestReReadingConfirmUserId = _userInfo.Id,
|
||||
// RequestReReadingResultEnum = RequestReReadingResult.Agree,
|
||||
//});
|
||||
|
||||
// //只更新 PM 申请 同一访视的数据
|
||||
// await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.SubjectId == origenalTask.SubjectId &&
|
||||
// t.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed &&
|
||||
// t.TrialReadingCriterionId == origenalTask.TrialReadingCriterionId &&
|
||||
// t.IsAnalysisCreate == origenalTask.IsAnalysisCreate &&
|
||||
// t.VisitTaskNum == origenalTask.VisitTaskNum &&
|
||||
// t.Id != origenalTask.Id, u => new VisitTask()
|
||||
// {
|
||||
// ReReadingApplyState = ReReadingApplyState.Agree
|
||||
// });
|
||||
#endregion
|
||||
|
||||
// 不管有序 无序 都会 回退访视
|
||||
if (origenalTask.ReadingCategory == ReadingCategory.Visit)
|
||||
@@ -1644,9 +1635,9 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
{
|
||||
ReReadingTaskTrackingDeal(influenceTask, agreeReReadingCommand);
|
||||
|
||||
await InfluenceAddtioncalEvaluationCritrionAsync(origenalTask, influenceTaskList.Where(t => t.Id != origenalTask.Id).Where(t => t.SourceSubjectVisitId != null).Select(t => (Guid)t.SourceSubjectVisitId).Distinct().ToList());
|
||||
await InfluenceAddtioncalEvaluationCritrionAsync(origenalTask, influenceTaskList.Where(t => t.Id != origenalTask.Id).Where(t => t.SourceSubjectVisitId != null).Select(t => t.SourceSubjectVisitId!.Value).Distinct().ToList());
|
||||
|
||||
await SetReReadingOrBackInfluenceAnalysisAsync(origenalTask.SubjectId);
|
||||
await PMReReadingConfirmOrBackInfluenceAnalysisAsync(origenalTask.SubjectId);
|
||||
|
||||
await SetMedicalReviewInvalidAsync(influenceTaskList);
|
||||
|
||||
@@ -1666,52 +1657,6 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
trakingOrigenalTask?.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = influenceTask.Id, OptType = ReReadingOrBackOptType.Abandon });
|
||||
}
|
||||
|
||||
#region 废弃 分配 留存
|
||||
|
||||
////申请的访视 要不是重阅重置,要不就是失效 不会存在取消分配
|
||||
//if (influenceTask.ReadingCategory == ReadingCategory.Visit && influenceTask.VisitTaskNum != origenalTask.VisitTaskNum)
|
||||
//{
|
||||
// if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
// {
|
||||
// influenceTask.TaskState = TaskState.HaveReturned;
|
||||
|
||||
// trakingOrigenalTask?.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = influenceTask.Id, OptType = ReReadingOrBackOptType.Return });
|
||||
// }
|
||||
// else if (influenceTask.ReadingTaskState == ReadingTaskState.Reading)
|
||||
// {
|
||||
// influenceTask.TaskState = TaskState.Adbandon;
|
||||
// trakingOrigenalTask?.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = influenceTask.Id, OptType = ReReadingOrBackOptType.Abandon });
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// influenceTask.DoctorUserId = null;
|
||||
// influenceTask.AllocateTime = null;
|
||||
// influenceTask.SuggesteFinishedTime = null;
|
||||
// influenceTask.TaskAllocationState = TaskAllocationState.NotAllocate;
|
||||
|
||||
// trakingOrigenalTask?.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = influenceTask.Id, OptType = ReReadingOrBackOptType.CancelAssign });
|
||||
// }
|
||||
//}
|
||||
////当前访视
|
||||
//else
|
||||
//{
|
||||
// if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
// {
|
||||
// influenceTask.TaskState = TaskState.HaveReturned;
|
||||
|
||||
// trakingOrigenalTask?.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = influenceTask.Id, OptType = ReReadingOrBackOptType.Return });
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// influenceTask.TaskState = TaskState.Adbandon;
|
||||
|
||||
// trakingOrigenalTask?.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = influenceTask.Id, OptType = ReReadingOrBackOptType.Abandon });
|
||||
// }
|
||||
|
||||
//}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
@@ -1741,7 +1686,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
ReReadingTaskTrackingDeal(influenceTask, agreeReReadingCommand);
|
||||
|
||||
|
||||
await SetReReadingOrBackInfluenceAnalysisAsync(origenalTask.SubjectId);
|
||||
await PMReReadingConfirmOrBackInfluenceAnalysisAsync(origenalTask.SubjectId);
|
||||
|
||||
await SetMedicalReviewInvalidAsync(influenceTaskList);
|
||||
|
||||
@@ -1863,7 +1808,6 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
#endregion
|
||||
|
||||
|
||||
#region 这里时影响其他的任务 /*不包括申请的任务 申请的任务,在上面会统一处理*/
|
||||
|
||||
var influenceTaskList = await _visitTaskRepository.Where(filterExpression, true).OrderBy(t => t.VisitTaskNum).ToListAsync();
|
||||
|
||||
@@ -1895,13 +1839,12 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
await SetMedicalReviewInvalidAsync(influenceTaskList, false);
|
||||
|
||||
await InfluenceAddtioncalEvaluationCritrionAsync(origenalTask, influenceTaskList.Where(t => t.Id != origenalTask.Id).Where(t => t.SourceSubjectVisitId != null).Select(t => (Guid)t.SourceSubjectVisitId).Distinct().ToList(), false);
|
||||
await InfluenceAddtioncalEvaluationCritrionAsync(origenalTask, influenceTaskList.Where(t => t.Id != origenalTask.Id).Where(t => t.SourceSubjectVisitId != null).Select(t => t.SourceSubjectVisitId!.Value).Distinct().ToList(), false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
{
|
||||
influenceTask.TaskState = TaskState.HaveReturned;
|
||||
@@ -1915,6 +1858,9 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
trakingOrigenalTask?.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = influenceTask.Id, OptType = ReReadingOrBackOptType.Abandon });
|
||||
}
|
||||
|
||||
|
||||
#region 受影响的任务生成
|
||||
|
||||
// 影响的任务 仅仅访视类别的才生成 或者就是IR 申请的任务
|
||||
if (influenceTask.ReadingCategory == ReadingCategory.Visit || influenceTask.Id == origenalTask.Id)
|
||||
{
|
||||
@@ -1940,12 +1886,9 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
}
|
||||
|
||||
//var canGenerateTaskIdList = influenceTaskList.GroupBy(t => new { t.VisitTaskNum, t.DoctorUserId, t.TrialReadingCriterionId, t.SubjectId })
|
||||
// .Select(g => g.First().Id);
|
||||
|
||||
}
|
||||
|
||||
#region 影响的任务生成
|
||||
|
||||
await _visitTaskCommonService.AddTaskAsync(new GenerateTaskCommand()
|
||||
{
|
||||
@@ -1967,34 +1910,14 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
newTask.AllocateTime = DateTime.Now;
|
||||
newTask.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||
|
||||
|
||||
//拷贝原始表单
|
||||
if (visitTaskReReadingAppply.IsCopyOrigenalForms && influenceTask.Id == origenalTask.Id)
|
||||
{
|
||||
if (origenalTask.ReadingCategory == ReadingCategory.Visit)
|
||||
{
|
||||
var list = _readingTaskQuestionAnswerRepository.Where(t => t.VisitTaskId == origenalTask.Id).ToList();
|
||||
CopyForms(newTask, origenalTask);
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
item.Id = Guid.Empty;
|
||||
item.VisitTaskId = newTask.Id;
|
||||
}
|
||||
|
||||
_ = _readingTaskQuestionAnswerRepository.AddRangeAsync(list).Result;
|
||||
}
|
||||
//else if (origenalTask.ReadingCategory == ReadingCategory.Global)
|
||||
//{
|
||||
// var list = _repository.Where<ReadingGlobalTaskInfo>(t => t.GlobalTaskId == origenalTask.Id).ToList();
|
||||
|
||||
// foreach (var item in list)
|
||||
// {
|
||||
// item.Id = Guid.Empty;
|
||||
// item.GlobalTaskId = newTask.Id;
|
||||
// }
|
||||
|
||||
// _ = _repository.AddRangeAsync(list).Result;
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2003,28 +1926,10 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
{
|
||||
if (origenalTask.ReadingCategory == ReadingCategory.Visit)
|
||||
{
|
||||
var list = _readingTaskQuestionAnswerRepository.Where(t => t.VisitTaskId == origenalTask.Id).ToList();
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
item.Id = Guid.Empty;
|
||||
item.VisitTaskId = newTask.Id;
|
||||
}
|
||||
|
||||
_ = _readingTaskQuestionAnswerRepository.AddRangeAsync(list).Result;
|
||||
CopyForms(newTask, origenalTask);
|
||||
}
|
||||
//else if (origenalTask.ReadingCategory == ReadingCategory.Global)
|
||||
//{
|
||||
// var list = _repository.Where<ReadingGlobalTaskInfo>(t => t.GlobalTaskId == origenalTask.Id).ToList();
|
||||
|
||||
// foreach (var item in list)
|
||||
// {
|
||||
// item.Id = Guid.Empty;
|
||||
// item.GlobalTaskId = newTask.Id;
|
||||
// }
|
||||
|
||||
// _ = _repository.AddRangeAsync(list).Result;
|
||||
//}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2037,18 +1942,12 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
//无序阅片 只会申请访视类型和裁判类型的任务 注意这里有一致性分析的申请同意
|
||||
//无序阅片 IR只会申请访视类型和裁判类型的任务 注意这里有一致性分析的申请同意
|
||||
else
|
||||
{
|
||||
|
||||
@@ -2089,6 +1988,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
}
|
||||
}
|
||||
|
||||
#region 受影响任务的生成
|
||||
|
||||
if (influenceTask.ReadingCategory == ReadingCategory.Visit || influenceTask.Id == origenalTask.Id)
|
||||
{
|
||||
@@ -2120,15 +2020,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
{
|
||||
if (origenalTask.ReadingCategory == ReadingCategory.Visit)
|
||||
{
|
||||
var list = _readingTaskQuestionAnswerRepository.Where(t => t.VisitTaskId == origenalTask.Id).ToList();
|
||||
CopyForms(newTask, origenalTask);
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
item.Id = Guid.Empty;
|
||||
item.VisitTaskId = newTask.Id;
|
||||
}
|
||||
|
||||
_ = _readingTaskQuestionAnswerRepository.AddRangeAsync(list).Result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2138,15 +2031,8 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
{
|
||||
if (origenalTask.ReadingCategory == ReadingCategory.Visit)
|
||||
{
|
||||
var list = _readingTaskQuestionAnswerRepository.Where(t => t.VisitTaskId == origenalTask.Id).ToList();
|
||||
CopyForms(newTask, origenalTask);
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
item.Id = Guid.Empty;
|
||||
item.VisitTaskId = newTask.Id;
|
||||
}
|
||||
|
||||
_ = _readingTaskQuestionAnswerRepository.AddRangeAsync(list).Result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2155,16 +2041,12 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
});
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2203,6 +2085,74 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
await _visitTaskRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
private void CopyForms(VisitTask newTask, VisitTask origenalTask)
|
||||
{
|
||||
|
||||
//自定义
|
||||
var readingCustomTagList = _repository.Where<ReadingCustomTag>(t => t.VisitTaskId == origenalTask.Id).ToList();
|
||||
|
||||
foreach (var item in readingCustomTagList)
|
||||
{
|
||||
item.Id = Guid.Empty;
|
||||
item.VisitTaskId = newTask.Id;
|
||||
}
|
||||
|
||||
_ = _repository.AddRangeAsync(readingCustomTagList).Result;
|
||||
|
||||
|
||||
var readingTaskQuestionMarkList = _repository.Where<ReadingTaskQuestionMark>(t => t.VisitTaskId == origenalTask.Id).ToList();
|
||||
|
||||
foreach (var item in readingTaskQuestionMarkList)
|
||||
{
|
||||
item.Id = Guid.Empty;
|
||||
item.VisitTaskId = newTask.Id;
|
||||
}
|
||||
|
||||
_ = _repository.AddRangeAsync(readingTaskQuestionMarkList).Result;
|
||||
|
||||
var readingTaskQuestionAnswerList = _repository.Where<ReadingTaskQuestionAnswer>(t => t.VisitTaskId == origenalTask.Id).ToList();
|
||||
|
||||
foreach (var item in readingTaskQuestionAnswerList)
|
||||
{
|
||||
item.Id = Guid.Empty;
|
||||
item.VisitTaskId = newTask.Id;
|
||||
}
|
||||
_ = _repository.AddRangeAsync(readingTaskQuestionAnswerList).Result;
|
||||
|
||||
|
||||
|
||||
//ReadingTableAnswerRowInfo ReadingTableQuestionAnswer 一起加
|
||||
var readingTableAnswerRowInfoList = _repository.Where<ReadingTableAnswerRowInfo>(t => t.VisitTaskId == origenalTask.Id).Include(t => t.LesionAnswerList).ToList();
|
||||
|
||||
foreach (var item in readingTableAnswerRowInfoList)
|
||||
{
|
||||
|
||||
var originalVisitTaskId= item.VisitTaskId;
|
||||
var originalFristAddTaskId= item.FristAddTaskId;
|
||||
|
||||
item.Id = NewId.NextSequentialGuid();
|
||||
item.VisitTaskId = newTask.Id;
|
||||
|
||||
//默认值是当前任务添加的
|
||||
item.FristAddTaskId = originalVisitTaskId == originalFristAddTaskId ? newTask.Id : item.FristAddTaskId;
|
||||
|
||||
|
||||
foreach (var item2 in item.LesionAnswerList)
|
||||
{
|
||||
item2.Id = Guid.Empty;
|
||||
item2.RowId = item.Id;
|
||||
item2.VisitTaskId = newTask.Id;
|
||||
}
|
||||
}
|
||||
|
||||
_ = _repository.AddRangeAsync(readingTableAnswerRowInfoList).Result;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2252,19 +2202,22 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
Expression<Func<VisitTask, bool>> filterExpression = t => t.TrialId == trialId && t.SubjectId == task.SubjectId && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze) && t.TaskAllocationState == TaskAllocationState.Allocated;
|
||||
|
||||
|
||||
if (criterionConfig.CriterionType == CriterionType.RECIST1Point1 && criterionConfig.IsAdditionalAssessment)
|
||||
{
|
||||
//影像退回,必定影响两个标准的任务
|
||||
filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == task.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB);
|
||||
|
||||
#region 退回到访视 不区分标准
|
||||
//if (criterionConfig.CriterionType == CriterionType.RECIST1Point1 && criterionConfig.IsAdditionalAssessment)
|
||||
//{
|
||||
// //影像退回,必定影响两个标准的任务
|
||||
// filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == task.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB);
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//默认影响的都是该标准的任务
|
||||
filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == task.TrialReadingCriterionId);
|
||||
}
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// //默认影响的都是该标准的任务
|
||||
// filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == task.TrialReadingCriterionId);
|
||||
//}
|
||||
#endregion
|
||||
|
||||
|
||||
//PM 才允许操作
|
||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager)
|
||||
@@ -2320,9 +2273,9 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
if (influenceTask.Id == task.Id)
|
||||
{
|
||||
|
||||
await InfluenceAddtioncalEvaluationCritrionAsync(task, influenceTaskList.Where(t => t.Id != task.Id).Where(t => t.SourceSubjectVisitId != null).Select(t => (Guid)t.SourceSubjectVisitId).Distinct().ToList());
|
||||
await InfluenceAddtioncalEvaluationCritrionAsync(task, influenceTaskList.Where(t => t.Id != task.Id).Where(t => t.SourceSubjectVisitId != null).Select(t => t.SourceSubjectVisitId!.Value).Distinct().ToList());
|
||||
|
||||
await SetReReadingOrBackInfluenceAnalysisAsync(influenceTask.SubjectId);
|
||||
await PMReReadingConfirmOrBackInfluenceAnalysisAsync(influenceTask.SubjectId);
|
||||
|
||||
await SetMedicalReviewInvalidAsync(influenceTaskList);
|
||||
|
||||
@@ -2341,53 +2294,6 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
origenalTask.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = influenceTask.Id, OptType = ReReadingOrBackOptType.Abandon });
|
||||
}
|
||||
|
||||
#region 废弃取消分配留存
|
||||
|
||||
////申请的访视 要不是重阅重置,要不就是失效 不会存在取消分配
|
||||
//if (influenceTask.ReadingCategory == ReadingCategory.Visit && influenceTask.VisitTaskNum != task.VisitTaskNum)
|
||||
//{
|
||||
// //后续访视处理访视
|
||||
// if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
// {
|
||||
// influenceTask.TaskState = TaskState.HaveReturned;
|
||||
|
||||
// origenalTask.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = influenceTask.Id, OptType = ReReadingOrBackOptType.Return });
|
||||
// }
|
||||
// else if (influenceTask.ReadingTaskState == ReadingTaskState.Reading)
|
||||
// {
|
||||
// influenceTask.TaskState = TaskState.Adbandon;
|
||||
// origenalTask.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = influenceTask.Id, OptType = ReReadingOrBackOptType.Abandon });
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// influenceTask.DoctorUserId = null;
|
||||
// influenceTask.AllocateTime = null;
|
||||
// influenceTask.SuggesteFinishedTime = null;
|
||||
// influenceTask.TaskAllocationState = TaskAllocationState.NotAllocate;
|
||||
|
||||
// origenalTask.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = influenceTask.Id, OptType = ReReadingOrBackOptType.CancelAssign });
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// //申请的访视 全局肿瘤学
|
||||
|
||||
// if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
// {
|
||||
// influenceTask.TaskState = TaskState.HaveReturned;
|
||||
// origenalTask.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = influenceTask.Id, OptType = ReReadingOrBackOptType.Return });
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// influenceTask.TaskState = TaskState.Adbandon;
|
||||
// origenalTask.TaskInfluenceList.Add(new TaskInfluence() { InfluenceTaskId = influenceTask.Id, OptType = ReReadingOrBackOptType.Abandon });
|
||||
// }
|
||||
|
||||
//}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -2586,8 +2492,6 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
var filterObj = (await _visitTaskRepository.FirstOrDefaultNoTrackingAsync(t => t.Id == taskId)).IfNullThrowException();
|
||||
var trialId = filterObj.TrialId;
|
||||
|
||||
//var trialConfig = (await _trialRepository.Where(t => t.Id == trialId).Select(t => new { TrialId = t.Id, t.IsReadingTaskViewInOrder, t.ReadingType }).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
var criterionConfig = (await _trialReadingCriterionRepository.Where(x => x.Id == filterObj.TrialReadingCriterionId).Select(x => new { x.ReadingTool, x.CriterionType, x.IsAdditionalAssessment, x.IsReadingTaskViewInOrder }).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
Expression<Func<VisitTask, bool>> filterExpression = t => t.TrialId == trialId && t.SubjectId == filterObj.SubjectId && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze) && t.TaskAllocationState == TaskAllocationState.Allocated;
|
||||
@@ -2609,10 +2513,10 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
{
|
||||
|
||||
// 1.1 基线任务影响BM任务
|
||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager && _subjectVisitRepository.Any(t=>t.Id==filterObj.SourceSubjectVisitId && t.IsBaseLine==true))
|
||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager && _subjectVisitRepository.Any(t => t.Id == filterObj.SourceSubjectVisitId && t.IsBaseLine == true))
|
||||
{
|
||||
|
||||
isIR1Point1AdditionalAssessmentBaseline=true;
|
||||
isIR1Point1AdditionalAssessmentBaseline = true;
|
||||
//filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB);
|
||||
|
||||
|
||||
@@ -2628,7 +2532,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
else
|
||||
{
|
||||
filterExpression = filterExpression.And(t => t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId || t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2651,10 +2555,10 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|| (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer && applyId == null))
|
||||
{
|
||||
|
||||
//当前任务及其之后的所有访视任务、全局任务、裁判任务、肿瘤学阅片任务
|
||||
//当前任务及其之后的所有访视任务、全局任务、裁判任务、肿瘤学阅片任务
|
||||
|
||||
//有序
|
||||
if (criterionConfig.IsReadingTaskViewInOrder)
|
||||
//有序
|
||||
if (criterionConfig.IsReadingTaskViewInOrder)
|
||||
{
|
||||
|
||||
switch (filterObj.ReadingCategory)
|
||||
@@ -2678,7 +2582,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
)) || t.Id == filterObj.Id)
|
||||
;
|
||||
}
|
||||
// IR 申请1.1 基线重阅,影响附加评估所有的任务
|
||||
// IR 申请1.1 基线重阅,影响附加评估所有的任务
|
||||
else if (isIR1Point1AdditionalAssessmentBaseline)
|
||||
{
|
||||
filterExpression = filterExpression.And(t => t.VisitTaskNum >= filterObj.VisitTaskNum &&
|
||||
@@ -2687,7 +2591,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
// 裁判 肿瘤学是另外的医生做
|
||||
|| t.ReadingCategory == ReadingCategory.Judge
|
||||
|| t.ReadingCategory == ReadingCategory.Oncology
|
||||
)&& t.TrialReadingCriterionId==filterObj.TrialReadingCriterionId )||( t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB))
|
||||
) && t.TrialReadingCriterionId == filterObj.TrialReadingCriterionId) || (t.TrialReadingCriterion.CriterionType == CriterionType.RECIST1Pointt1_MB))
|
||||
);
|
||||
}
|
||||
else
|
||||
@@ -2871,147 +2775,6 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
foreach (var influenceTask in list)
|
||||
{
|
||||
influenceTask.OptType = influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned ? ReReadingOrBackOptType.Return : ReReadingOrBackOptType.Abandon;
|
||||
|
||||
|
||||
#region 变更前 注释
|
||||
|
||||
//if (isReReading)
|
||||
//{
|
||||
|
||||
// if ((_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager && applyId != null) || (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer && applyId == null))
|
||||
// {
|
||||
// //有序
|
||||
// if (criterionConfig.IsReadingTaskViewInOrder)
|
||||
// {
|
||||
// if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
// {
|
||||
// influenceTask.OptType = ReReadingOrBackOptType.Return;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// influenceTask.OptType = ReReadingOrBackOptType.Abandon;
|
||||
// }
|
||||
// //else if (influenceTask.ReadingTaskState == ReadingTaskState.Reading)
|
||||
// //{
|
||||
// // influenceTask.OptType = ReReadingOrBackOptType.Abandon;
|
||||
// //}
|
||||
// //else
|
||||
// //{
|
||||
// // throw new BusinessValidationFailedException("IR 申请重阅,不会影响到后续未读的任务,当前影响列表有未读的任务,请核查");
|
||||
// //}
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
// {
|
||||
// influenceTask.OptType = ReReadingOrBackOptType.Return;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// influenceTask.OptType = ReReadingOrBackOptType.Abandon;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (((_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM) && applyId != null) || (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager && applyId == null))
|
||||
// {
|
||||
// //有序
|
||||
// if (criterionConfig.IsReadingTaskViewInOrder)
|
||||
// {
|
||||
// //申请的访视 要不是重阅重置,要不就是失效 不会存在取消分配
|
||||
// if (influenceTask.ReadingCategory == ReadingCategory.Visit && influenceTask.VisitTaskNum != filterObj.VisitTaskNum)
|
||||
// {
|
||||
// if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
// {
|
||||
// influenceTask.OptType = ReReadingOrBackOptType.Return;
|
||||
// }
|
||||
// else if (influenceTask.ReadingTaskState == ReadingTaskState.Reading)
|
||||
// {
|
||||
// influenceTask.OptType = ReReadingOrBackOptType.Abandon;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// influenceTask.OptType = ReReadingOrBackOptType.CancelAssign;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
// {
|
||||
// influenceTask.OptType = ReReadingOrBackOptType.Return;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// influenceTask.OptType = ReReadingOrBackOptType.Abandon;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
// {
|
||||
// influenceTask.OptType = ReReadingOrBackOptType.Return;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// influenceTask.OptType = ReReadingOrBackOptType.Abandon;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//}
|
||||
////PM退回
|
||||
//else
|
||||
//{
|
||||
|
||||
|
||||
|
||||
// //有序
|
||||
// if (criterionConfig.IsReadingTaskViewInOrder)
|
||||
// {
|
||||
// //申请的访视 要不是重阅重置,要不就是失效 不会存在取消分配
|
||||
// if (influenceTask.ReadingCategory == ReadingCategory.Visit && influenceTask.VisitTaskNum != filterObj.VisitTaskNum)
|
||||
// {
|
||||
// //后续访视处理访视
|
||||
// if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
// {
|
||||
// influenceTask.OptType = ReReadingOrBackOptType.Return;
|
||||
// }
|
||||
// else if (influenceTask.ReadingTaskState == ReadingTaskState.Reading)
|
||||
// {
|
||||
// influenceTask.OptType = ReReadingOrBackOptType.Abandon;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// influenceTask.OptType = ReReadingOrBackOptType.CancelAssign;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //申请的访视 全局肿瘤学
|
||||
|
||||
// if (influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned)
|
||||
// {
|
||||
// influenceTask.OptType = ReReadingOrBackOptType.Return;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// influenceTask.OptType = ReReadingOrBackOptType.Abandon;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// //无序
|
||||
// else
|
||||
// {
|
||||
// //重阅重置或者失效
|
||||
// influenceTask.OptType = influenceTask.ReadingTaskState == ReadingTaskState.HaveSigned ? ReReadingOrBackOptType.Return : ReReadingOrBackOptType.Abandon;
|
||||
// }
|
||||
|
||||
|
||||
//}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Application.Contracts;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
@@ -99,15 +100,58 @@ namespace IRaCIS.Core.Application.Service
|
||||
//---读取模板内容失败, 请将文件另存为docx格式尝试!
|
||||
return ResponseOutput.NotOk(_localizer["Document_ TemplateRead"]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
var entity = await _commonDocumentRepository.InsertOrUpdateAsync(addOrEditCommonDocument, true, verifyExp1, verifyExp2);
|
||||
|
||||
if (addOrEditCommonDocument.Id == null) //insert
|
||||
{
|
||||
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
|
||||
var entity = await _commonDocumentRepository.InsertFromDTOAsync(addOrEditCommonDocument, true, verifyExp1, verifyExp2);
|
||||
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
else //update
|
||||
{
|
||||
|
||||
var dbbeforeEntity = await _commonDocumentRepository.UpdateFromDTOAsync(addOrEditCommonDocument, true, true, verifyExp1, verifyExp2);
|
||||
|
||||
var filePath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, dbbeforeEntity.Path);
|
||||
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
File.Delete(filePath);
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
[HttpDelete("{commonDocumentId:guid}")]
|
||||
public async Task<IResponseOutput> DeleteCommonDocument(Guid commonDocumentId)
|
||||
{
|
||||
var find= await _commonDocumentRepository.FirstOrDefaultNoTrackingAsync(t=>t.Id== commonDocumentId);
|
||||
|
||||
var success = await _commonDocumentRepository.DeleteFromQueryAsync(t => t.Id == commonDocumentId, true,true);
|
||||
|
||||
if (find != null)
|
||||
{
|
||||
var filePath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, find.Path);
|
||||
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
File.Delete(filePath);
|
||||
}
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
{
|
||||
public CriterionType? CriterionTypeEnum { get; set; }
|
||||
public CommonDocumentFileType? FileTypeEnum { get; set; }
|
||||
public CommonDocumentBusinessScenario? BusinessScenarioEnum { get; set; }
|
||||
public EmailBusinessScenario? BusinessScenarioEnum { get; set; }
|
||||
|
||||
public string Name { get; set; } = String.Empty;
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
|
||||
public CriterionType? CriterionTypeEnum { get; set; }
|
||||
public CommonDocumentFileType FileTypeEnum { get; set; }
|
||||
public CommonDocumentBusinessScenario BusinessScenarioEnum { get; set; }
|
||||
public EmailBusinessScenario BusinessScenarioEnum { get; set; }
|
||||
|
||||
|
||||
//public Guid FileTypeId { get; set; }
|
||||
|
||||
@@ -165,7 +165,40 @@ namespace IRaCIS.Application.Contracts
|
||||
|
||||
|
||||
|
||||
public class AddBasicDicAndChild
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid ConfigTypeId { get; set; }
|
||||
|
||||
public bool IsEnable { get; set; }
|
||||
|
||||
public string Code { get; set; } = String.Empty;
|
||||
|
||||
public int ShowOrder { get; set; }
|
||||
public string Description { get; set; } = String.Empty;
|
||||
|
||||
public DicDataTypeEnum DataTypeEnum { get; set; }
|
||||
|
||||
|
||||
public List<AddBasicDicChild> ChildList { get; set; } = new List<AddBasicDicChild>();
|
||||
}
|
||||
|
||||
|
||||
public class AddBasicDicChild
|
||||
{
|
||||
public string Code { get; set; } = String.Empty;
|
||||
public string Value { get; set; } = String.Empty;
|
||||
|
||||
public string ValueCN { get; set; } = String.Empty;
|
||||
|
||||
public string ChildGroup { get; set; } = String.Empty;
|
||||
|
||||
public int ShowOrder { get; set; }
|
||||
|
||||
public string Description { get; set; } = String.Empty;
|
||||
|
||||
public bool IsEnable { get; set; } = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,10 +3,16 @@
|
||||
// 生成时间 2022-02-15 11:55:57
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Newtonsoft.Json;
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
public class TrialSelectEmailNoticeConfigView : EmailNoticeConfigView
|
||||
{
|
||||
public bool IsHaveSelected { get; set; }
|
||||
}
|
||||
|
||||
/// <summary> EmailNoticeConfigView 列表视图模型 </summary>
|
||||
public class EmailNoticeConfigView : EmailNoticeConfigAddOrEdit
|
||||
{
|
||||
@@ -19,6 +25,12 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
|
||||
|
||||
public List<EmailUserTypeDto> EmailNoticeUserList { get; set; }
|
||||
|
||||
|
||||
public new List<UserTypeEnum> ToUserTypeList => EmailNoticeUserList.Where(t => t.EmailUserType == EmailUserType.To).Select(t => t.UserType).ToList();
|
||||
public new List<UserTypeEnum> CopyUserTypeList => EmailNoticeUserList.Where(t => t.EmailUserType == EmailUserType.Copy).Select(t => t.UserType).ToList();
|
||||
|
||||
//[JsonIgnore]
|
||||
//public SystemBasicDataSelect Scenario { get; set; }
|
||||
////public Guid? ScenarioParentId => Scenario.ParentId;
|
||||
@@ -28,17 +40,29 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
}
|
||||
|
||||
public class EmailUserTypeDto
|
||||
{
|
||||
public UserTypeEnum UserType { get; set; }
|
||||
|
||||
public EmailUserType EmailUserType { get; set; }
|
||||
}
|
||||
|
||||
///<summary>EmailNoticeConfigQuery 列表查询参数模型</summary>
|
||||
public class EmailNoticeConfigQuery:PageInput
|
||||
public class EmailNoticeConfigQuery : PageInput
|
||||
{
|
||||
//public Guid? ScenarioId { get; set; }
|
||||
|
||||
public CommonDocumentBusinessScenario? BusinessScenarioEnum { get; set; }
|
||||
public EmailBusinessScenario? BusinessScenarioEnum { get; set; }
|
||||
|
||||
public bool? IsReturnRequired { get; set; }
|
||||
public bool? IsUrgent { get; set; }
|
||||
public bool? IsEnable { get; set; }
|
||||
|
||||
public CriterionType? CriterionTypeEnum { get; set; }
|
||||
|
||||
public Guid? TrialId { get; set; }
|
||||
|
||||
public bool? IsDistinguishCriteria { get; set; }
|
||||
|
||||
}
|
||||
|
||||
///<summary> EmailNoticeConfigAddOrEdit 列表查询参数模型</summary>
|
||||
@@ -47,31 +71,66 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public Guid? Id { get; set; }
|
||||
public string Code { get; set; } = String.Empty;
|
||||
|
||||
|
||||
public CommonDocumentBusinessScenario BusinessScenarioEnum { get; set; }
|
||||
public EmailBusinessScenario BusinessScenarioEnum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否区分标准
|
||||
/// </summary>
|
||||
public bool IsDistinguishCriteria { get; set; }
|
||||
|
||||
|
||||
//public string AuthorizationCode { get; set; } = String.Empty;
|
||||
//public Guid ScenarioId { get; set; }
|
||||
//public string Title { get; set; } = String.Empty;
|
||||
//public string Body { get; set; } = String.Empty;
|
||||
//public string FromEmail { get; set; } = String.Empty;
|
||||
//public string ReceiveEmail { get; set; } = String.Empty;
|
||||
//public string CopyEmail { get; set; } = String.Empty;
|
||||
public bool IsReturnRequired { get; set; }
|
||||
public bool IsUrgent { get; set; }
|
||||
public bool IsEnable { get; set; }
|
||||
public bool IsAutoSend { get; set; }
|
||||
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
|
||||
|
||||
public CriterionType? CriterionTypeEnum { get; set; }
|
||||
|
||||
/// <summary> 业务模块 /// </summary>
|
||||
public int BusinessModuleEnum { get; set; }
|
||||
|
||||
/// <summary> 业务层级 /// </summary>
|
||||
public int BusinessLevelEnum { get; set; }
|
||||
|
||||
/// <summary> 邮件类型 /// </summary>
|
||||
public int EmailTypeEnum { get; set; }
|
||||
|
||||
/// <summary> 邮件加急类型 /// </summary>
|
||||
public int EmailUrgentEnum { get; set; }
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
|
||||
/// <summary> 定时周期 /// </summary>
|
||||
public string EmailCron { get; set; } = string.Empty;
|
||||
|
||||
/// <summary> 邮件主题 /// </summary>
|
||||
public string EmailTopic { get; set; } = string.Empty;
|
||||
|
||||
public string EmailTopicCN { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public string AttachPath { get; set; } = string.Empty;
|
||||
|
||||
public string AttachCNPath { get; set; } = string.Empty;
|
||||
|
||||
public string EmailHtmlContent { get; set; } = string.Empty;
|
||||
|
||||
public string EmailHtmlContentCN { get; set; } = string.Empty;
|
||||
|
||||
public string AttachName { get; set; }
|
||||
public string AttachNameCN { get; set; }
|
||||
|
||||
|
||||
public List<UserTypeEnum> ToUserTypeList { get; set; }
|
||||
public List<UserTypeEnum> CopyUserTypeList { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,27 +9,23 @@ using System.Collections.Generic;
|
||||
namespace IRaCIS.Core.Application.ViewModel
|
||||
{
|
||||
/// <summary> InternationalizationView 列表视图模型 </summary>
|
||||
public class InternationalizationView
|
||||
public class InternationalizationView : InternationalizationAddOrEdit
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public int ShowOrder { get; set; }
|
||||
public Guid CreateUserId { get; set; }
|
||||
public DateTime CreateTime { get; set; }
|
||||
public DateTime UpdateTime { get; set; }
|
||||
public Guid UpdateUserId { get; set; }
|
||||
public int State { get; set; }
|
||||
public string FolderPath { get; set; }
|
||||
public string Code { get; set; }
|
||||
public string Value { get; set; }
|
||||
public string ValueCN { get; set; }
|
||||
|
||||
}
|
||||
|
||||
///<summary>InternationalizationQuery 列表查询参数模型</summary>
|
||||
public class InternationalizationQuery:PageInput
|
||||
public class InternationalizationQuery : PageInput
|
||||
{
|
||||
|
||||
public string? FolderPath { get; set; }
|
||||
public string? Code { get; set; }
|
||||
public int? InternationalizationType { get; set; }
|
||||
public int? State { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public string? Code { get; set; }
|
||||
public string? Value { get; set; }
|
||||
|
||||
public string? ValueCN { get; set; }
|
||||
@@ -41,14 +37,38 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
public int State { get; set; }
|
||||
public string FolderPath { get; set; }
|
||||
public string Code { get; set; }
|
||||
public string Value { get; set; }
|
||||
public string ValueCN { get; set; }
|
||||
public string Description { get; set; } = string.Empty;
|
||||
public string Code { get; set; } = string.Empty;
|
||||
public string Value { get; set; } = string.Empty;
|
||||
public string ValueCN { get; set; } = string.Empty;
|
||||
|
||||
public int InternationalizationType { get; set; }
|
||||
}
|
||||
|
||||
public class BatchAddInternationalization
|
||||
{
|
||||
public int InternationalizationType { get; set; }
|
||||
|
||||
public int State { get; set; }
|
||||
|
||||
public List<BatchAddInternationalizationDto> AddList { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class BatchAddInternationalizationDto
|
||||
{
|
||||
public string Description { get; set; } = string.Empty;
|
||||
public string Code { get; set; } = string.Empty;
|
||||
public string Value { get; set; } = string.Empty;
|
||||
public string ValueCN { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class InternationalizationSimpleDto
|
||||
{
|
||||
public string Code { get; set; } = string.Empty;
|
||||
public string Value { get; set; } = string.Empty;
|
||||
public string ValueCN { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
//--------------------------------------------------------------------
|
||||
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||
// 生成时间 2023-06-27 15:47:02
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
using System;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using System.Collections.Generic;
|
||||
namespace IRaCIS.Core.Application.ViewModel
|
||||
{
|
||||
/// <summary> PublishLogView 列表视图模型 </summary>
|
||||
public class PublishLogView : PublishLogAddOrEdit
|
||||
{
|
||||
|
||||
public DateTime CreateTime { get; set; }
|
||||
public Guid CreateUserId { get; set; }
|
||||
public Guid UpdateUserId { get; set; }
|
||||
public DateTime UpdateTime { get; set; }
|
||||
}
|
||||
|
||||
///<summary>PublishLogQuery 列表查询参数模型</summary>
|
||||
public class PublishLogQuery:PageInput
|
||||
{
|
||||
|
||||
public string? Version { get; set; }
|
||||
|
||||
public string? UpdateContent { get; set; }
|
||||
|
||||
}
|
||||
|
||||
///<summary> PublishLogAddOrEdit 列表查询参数模型</summary>
|
||||
public class PublishLogAddOrEdit
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
public string Version { get; set; }
|
||||
public DateTime PublishTime { get; set; }
|
||||
public string UpdateContent { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ namespace IRaCIS.Application.Services
|
||||
private readonly IRepository<ReadingSystemCriterionDictionary> _readingCriterionDictionaryRepository;
|
||||
private readonly IRepository<ReadingQuestionCriterionSystem> _readingQuestionCriterionSystem;
|
||||
private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrial;
|
||||
private readonly IReadingQuestionService _readingQuestionService;
|
||||
|
||||
public DictionaryService(IRepository<Dictionary> sysDicRepository, IRepository<DoctorDictionary> doctorDictionaryRepository, IRepository<TrialDictionary> trialDictionaryRepository,
|
||||
IRepository<Doctor> doctorRepository, IRepository<Trial> trialRepository,
|
||||
@@ -37,8 +36,7 @@ namespace IRaCIS.Application.Services
|
||||
IRepository<ReadingTrialCriterionDictionary> readingTrialCriterionDictionaryRepository,
|
||||
IRepository<ReadingSystemCriterionDictionary> readingCriterionDictionaryRepository,
|
||||
IRepository<ReadingQuestionCriterionSystem> readingQuestionCriterionSystem,
|
||||
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrial,
|
||||
IReadingQuestionService readingQuestionService
|
||||
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrial
|
||||
|
||||
|
||||
)
|
||||
@@ -54,7 +52,6 @@ namespace IRaCIS.Application.Services
|
||||
this._readingCriterionDictionaryRepository = readingCriterionDictionaryRepository;
|
||||
this._readingQuestionCriterionSystem = readingQuestionCriterionSystem;
|
||||
this._readingQuestionCriterionTrial = readingQuestionCriterionTrial;
|
||||
this._readingQuestionService = readingQuestionService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -88,6 +85,39 @@ namespace IRaCIS.Application.Services
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加字典 的同时 一起添加子项 --New
|
||||
/// </summary>
|
||||
/// <param name="addBasicDicAndChild"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> AddBasicDicAndChild(AddBasicDicAndChild addBasicDicAndChild)
|
||||
{
|
||||
var verifyExp1 = new EntityVerifyExp<Dictionary>()
|
||||
{
|
||||
VerifyExp = t => t.Code == addBasicDicAndChild.Code && t.ParentId == null,
|
||||
VerifyMsg = $"已有{addBasicDicAndChild.Code}名称的字典",
|
||||
IsVerify = true
|
||||
};
|
||||
|
||||
|
||||
var entity = await _dicRepository.InsertFromDTOAsync(addBasicDicAndChild, false, verifyExp1);
|
||||
|
||||
var childList = _mapper.Map<List<Dictionary>>(addBasicDicAndChild.ChildList);
|
||||
|
||||
foreach (var item in childList)
|
||||
{
|
||||
item.DataTypeEnum = addBasicDicAndChild.DataTypeEnum;
|
||||
item.ParentId = entity.Id;
|
||||
}
|
||||
|
||||
await _dicRepository.AddRangeAsync(childList);
|
||||
|
||||
await _dicRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// New 查询条件
|
||||
/// </summary>
|
||||
@@ -226,7 +256,7 @@ namespace IRaCIS.Application.Services
|
||||
public async Task<Dictionary<string, List<BasicDicSelectCopy>>> GetBasicDataSelect(string[] searchArray)
|
||||
{
|
||||
|
||||
var searchList = await _dicRepository.Where(t => searchArray.Contains(t.Parent.Code) && t.ParentId != null && t.IsEnable).ProjectTo<BasicDicSelectCopy>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var searchList = await _dicRepository.Where(t => searchArray.Contains(t.Parent.Code) && t.ParentId != null && t.IsEnable).ProjectTo<BasicDicSelectCopy>(_mapper.ConfigurationProvider,new { isEn_Us = _userInfo.IsEn_Us}).ToListAsync();
|
||||
|
||||
return searchList.GroupBy(t => t.ParentCode).ToDictionary(g => g.Key, g => g.OrderBy(t => t.ShowOrder).ToList());
|
||||
|
||||
|
||||
@@ -17,19 +17,22 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
public class EmailNoticeConfigService : BaseService, IEmailNoticeConfigService
|
||||
{
|
||||
private readonly IRepository<EmailNoticeConfig> _emailNoticeConfigrepository;
|
||||
private readonly IRepository<EmailNoticeUserType> _emailNoticeUserTypeRepository;
|
||||
|
||||
public EmailNoticeConfigService(IRepository<EmailNoticeConfig> repository)
|
||||
public EmailNoticeConfigService(IRepository<EmailNoticeConfig> repository, IRepository<EmailNoticeUserType> emailNoticeUserTypeRepository)
|
||||
{
|
||||
_emailNoticeConfigrepository = repository;
|
||||
_emailNoticeUserTypeRepository = emailNoticeUserTypeRepository;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<EmailNoticeConfigView>> GetEmailNoticeConfigList(EmailNoticeConfigQuery queryEmailNoticeConfig)
|
||||
{
|
||||
var emailNoticeConfigQueryable = _emailNoticeConfigrepository
|
||||
.WhereIf(queryEmailNoticeConfig.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == queryEmailNoticeConfig.IsDistinguishCriteria)
|
||||
.WhereIf(queryEmailNoticeConfig.CriterionTypeEnum != null, t => t.CriterionTypeEnum == queryEmailNoticeConfig.CriterionTypeEnum)
|
||||
.WhereIf(queryEmailNoticeConfig.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == queryEmailNoticeConfig.BusinessScenarioEnum)
|
||||
.WhereIf(queryEmailNoticeConfig.IsReturnRequired != null, t => t.IsReturnRequired == queryEmailNoticeConfig.IsReturnRequired)
|
||||
.WhereIf(queryEmailNoticeConfig.IsUrgent != null, t => t.IsUrgent == queryEmailNoticeConfig.IsUrgent)
|
||||
.WhereIf(queryEmailNoticeConfig.IsEnable != null, t => t.IsEnable == queryEmailNoticeConfig.IsEnable)
|
||||
.ProjectTo<EmailNoticeConfigView>(_mapper.ConfigurationProvider);
|
||||
|
||||
@@ -39,10 +42,55 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
public async Task<IResponseOutput> AddOrUpdateEmailNoticeConfig(EmailNoticeConfigAddOrEdit addOrEditEmailNoticeConfig)
|
||||
{
|
||||
|
||||
var entity = await _emailNoticeConfigrepository.InsertOrUpdateAsync(addOrEditEmailNoticeConfig, true);
|
||||
if (addOrEditEmailNoticeConfig.Id == null)
|
||||
{
|
||||
|
||||
var entity = _mapper.Map<EmailNoticeConfig>(addOrEditEmailNoticeConfig);
|
||||
|
||||
|
||||
foreach (var item in addOrEditEmailNoticeConfig.ToUserTypeList)
|
||||
{
|
||||
entity.EmailNoticeUserTypeList.Add(new EmailNoticeUserType() { EmailUserType = EmailUserType.To, UserType = item });
|
||||
|
||||
}
|
||||
|
||||
foreach (var item in addOrEditEmailNoticeConfig.CopyUserTypeList)
|
||||
{
|
||||
entity.EmailNoticeUserTypeList.Add(new EmailNoticeUserType() { EmailUserType = EmailUserType.Copy, UserType = item });
|
||||
|
||||
}
|
||||
|
||||
|
||||
await _emailNoticeConfigrepository.AddAsync(entity, true);
|
||||
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
var emailNoticeConfigId = addOrEditEmailNoticeConfig.Id;
|
||||
await _emailNoticeUserTypeRepository.BatchDeleteNoTrackingAsync(t => t.EmailNoticeConfigId == emailNoticeConfigId);
|
||||
|
||||
|
||||
foreach (var item in addOrEditEmailNoticeConfig.ToUserTypeList)
|
||||
{
|
||||
await _emailNoticeUserTypeRepository.AddAsync(new EmailNoticeUserType() { EmailUserType = EmailUserType.To, UserType = item, EmailNoticeConfigId = (Guid)emailNoticeConfigId });
|
||||
|
||||
}
|
||||
|
||||
foreach (var item in addOrEditEmailNoticeConfig.CopyUserTypeList)
|
||||
{
|
||||
await _emailNoticeUserTypeRepository.AddAsync(new EmailNoticeUserType() { EmailUserType = EmailUserType.Copy, UserType = item, EmailNoticeConfigId = (Guid)emailNoticeConfigId });
|
||||
|
||||
}
|
||||
|
||||
|
||||
var entity = await _emailNoticeConfigrepository.UpdateFromDTOAsync(addOrEditEmailNoticeConfig, true);
|
||||
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
|
||||
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user